[sage-support] Convolution and sine integral

216 vues
Accéder directement au premier message non lu

Tobias Katz

non lue,
19 mai 2010, 06:46:1219/05/2010
à sage-support
Hi,
I am trying to use sage for signal analysis and didn't find a solution
to perform symbolic convolution. Is there a way to do this?
Has anybody done something similar in sage before?

Is there a way to work with the sine integral?
I tried to get it by integrating a sinc-function but I didn't get
anything usable.

Would be great if anybody could give me a hint.

Thanks,
Tobias

--
To post to this group, send email to sage-s...@googlegroups.com
To unsubscribe from this group, send email to sage-support...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

David Joyner

non lue,
19 mai 2010, 07:41:5219/05/2010
à sage-s...@googlegroups.com
On Wed, May 19, 2010 at 6:46 AM, Tobias Katz <tob...@web.de> wrote:
> Hi,
> I am trying to use sage for signal analysis and didn't find a solution
> to perform symbolic convolution. Is there a way to do this?
> Has anybody done something similar in sage before?



Do you mean this, for example?


sage: x,t = var("x,t")
sage: assume(t>0)
sage: f = function("f",x)
sage: g(t) = integral(f(x)*sin(t-x),x,0,t)
sage: g
t |--> -integrate(sin(-t + x)*f(x), x, 0, t)

kcrisman

non lue,
19 mai 2010, 09:11:4519/05/2010
à sage-support


On May 19, 7:41 am, David Joyner <wdjoy...@gmail.com> wrote:
> On Wed, May 19, 2010 at 6:46 AM, Tobias Katz <tobi...@web.de> wrote:
> > Hi,
> > I am trying to use sage for signal analysis and didn't find a solution
> > to perform symbolic convolution. Is there a way to do this?
> > Has anybody done something similar in sage before?
>
> Do you mean this, for example?
>
> sage: x,t = var("x,t")
> sage: assume(t>0)
> sage: f = function("f",x)
> sage: g(t) = integral(f(x)*sin(t-x),x,0,t)
> sage: g
> t |--> -integrate(sin(-t + x)*f(x), x, 0, t)
>


But perhaps the OP wishes functionality like

sage: g(t) = convolve(f,sin) # doesn't exist!

which I've wanted to implement for a long time for arithmetic
functions, but haven't quite figured out how to get Python to do
consistently for some reason (it being low on the priority list).

Does Maxima have a convolution?

- kcrisman


> > Is there a way to work with the sine integral?
> > I tried to get it by integrating a sinc-function but I didn't get
> > anything usable.
>
> > Would be great if anybody could give me a hint.
>
> > Thanks,
> > Tobias
>
> > --
> > To post to this group, send email to sage-s...@googlegroups.com
> > To unsubscribe from this group, send email to sage-support...@googlegroups.com
> > For more options, visit this group athttp://groups.google.com/group/sage-support
> > URL:http://www.sagemath.org
>
> --
> To post to this group, send email to sage-s...@googlegroups.com
> To unsubscribe from this group, send email to sage-support...@googlegroups.com
> For more options, visit this group athttp://groups.google.com/group/sage-support

Tobias Katz

non lue,
19 mai 2010, 10:58:3819/05/2010
à sage-s...@googlegroups.com
Hi,
Indeed I am looking for s.th. like

g(t) = convolve(f,sin)

I am not familiar with Maxima - I had a short look at it but I didn't
find a function like this.

Is the best way to convolve numerically?

Does anybody know a way in Maxima or another CAS?

Tobias

Jason Grout

non lue,
19 mai 2010, 11:15:2119/05/2010
à sage-s...@googlegroups.com
On 05/19/2010 09:58 AM, Tobias Katz wrote:
> Hi,
> Indeed I am looking for s.th. like
>
> g(t) = convolve(f,sin)
>
> I am not familiar with Maxima - I had a short look at it but I didn't
> find a function like this.
>
> Is the best way to convolve numerically?


You might look at scipy or numpy (both of which are included in Sage).
They have functions which do convolutions.

Jason

William Stein

non lue,
19 mai 2010, 11:22:4319/05/2010
à sage-s...@googlegroups.com
On Wednesday, May 19, 2010, Jason Grout <jason...@creativetrax.com> wrote:
> On 05/19/2010 09:58 AM, Tobias Katz wrote:
>
> Hi,
> Indeed I am looking for s.th. like
>
> g(t) = convolve(f,sin)
>
> I am not familiar with Maxima - I had a short look at it but I didn't
> find a function like this.
>
> Is the best way to convolve numerically?
>
>
>
> You might look at scipy or numpy (both of which are included in Sage). They have functions which do convolutions.

I think the OP asked for *symbolic* convolution. I don't think
scipy/jumpy do anything symbolically.

>
> Jason
>
>
> --
> To post to this group, send email to sage-s...@googlegroups.com
> To unsubscribe from this group, send email to sage-support...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org
>

--
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

Jason Grout

non lue,
19 mai 2010, 11:36:0019/05/2010
à sage-s...@googlegroups.com
On 05/19/2010 10:22 AM, William Stein wrote:
> On Wednesday, May 19, 2010, Jason Grout<jason...@creativetrax.com> wrote:
>> On 05/19/2010 09:58 AM, Tobias Katz wrote:

>> Is the best way to convolve numerically?
>>
>>
>>
>> You might look at scipy or numpy (both of which are included in Sage). They have functions which do convolutions.
>
> I think the OP asked for *symbolic* convolution. I don't think
> scipy/jumpy do anything symbolically.
>


I agree. I was responding to his last question about convolving things
numerically.

Thanks,

kcrisman

non lue,
19 mai 2010, 11:54:1519/05/2010
à sage-support


On May 19, 11:36 am, Jason Grout <jason-s...@creativetrax.com> wrote:
> On 05/19/2010 10:22 AM, William Stein wrote:
>
> > On Wednesday, May 19, 2010, Jason Grout<jason-s...@creativetrax.com>  wrote:
> >> On 05/19/2010 09:58 AM, Tobias Katz wrote:
> >> Is the best way to convolve numerically?
>
> >> You might look at scipy or numpy (both of which are included in Sage). They have functions which do convolutions.
>
> > I think the OP asked for *symbolic* convolution.   I don't think
> > scipy/jumpy do anything symbolically.
>
> I agree.  I was responding to his last question about convolving things
> numerically.
>

Symbolic is implemented in Mma (see http://mathworld.wolfram.com/Convolution.html)
but Maple seems to only have it for audio applications (? based on
brief search on maplesoft.com). Should we open a ticket for this?

- kcrisman

William Stein

non lue,
19 mai 2010, 12:08:4619/05/2010
à sage-s...@googlegroups.com
On Wed, May 19, 2010 at 8:54 AM, kcrisman <kcri...@gmail.com> wrote:
>
>
> On May 19, 11:36 am, Jason Grout <jason-s...@creativetrax.com> wrote:
>> On 05/19/2010 10:22 AM, William Stein wrote:
>>
>> > On Wednesday, May 19, 2010, Jason Grout<jason-s...@creativetrax.com>  wrote:
>> >> On 05/19/2010 09:58 AM, Tobias Katz wrote:
>> >> Is the best way to convolve numerically?
>>
>> >> You might look at scipy or numpy (both of which are included in Sage). They have functions which do convolutions.
>>
>> > I think the OP asked for *symbolic* convolution.   I don't think
>> > scipy/jumpy do anything symbolically.
>>
>> I agree.  I was responding to his last question about convolving things
>> numerically.
>>
>
> Symbolic is implemented in Mma (see http://mathworld.wolfram.com/Convolution.html)
> but Maple seems to only have it for audio applications (? based on
> brief search on maplesoft.com).  Should we open a ticket for this?

Yes, based on the mission statement of Sage: "... viable alternative
to ... Mathematica"





--
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

kcrisman

non lue,
19 mai 2010, 13:22:5119/05/2010
à sage-support


On May 19, 12:08 pm, William Stein <wst...@gmail.com> wrote:
> On Wed, May 19, 2010 at 8:54 AM, kcrisman <kcris...@gmail.com> wrote:
>
> > On May 19, 11:36 am, Jason Grout <jason-s...@creativetrax.com> wrote:
> >> On 05/19/2010 10:22 AM, William Stein wrote:
>
> >> > On Wednesday, May 19, 2010, Jason Grout<jason-s...@creativetrax.com>  wrote:
> >> >> On 05/19/2010 09:58 AM, Tobias Katz wrote:
> >> >> Is the best way to convolve numerically?
>
> >> >> You might look at scipy or numpy (both of which are included in Sage). They have functions which do convolutions.
>
> >> > I think the OP asked for *symbolic* convolution.   I don't think
> >> > scipy/jumpy do anything symbolically.
>
> >> I agree.  I was responding to his last question about convolving things
> >> numerically.
>
> > Symbolic is implemented in Mma (seehttp://mathworld.wolfram.com/Convolution.html)
> > but Maple seems to only have it for audio applications (? based on
> > brief search on maplesoft.com).  Should we open a ticket for this?
>
> Yes, based on the mission statement of Sage: "... viable alternative
> to ... Mathematica"

Sorry, I meant "is there already something related open, or is this
already implemented"...

And it turns out that there is a whole file (by David Harvey)
sage.rings.polynomial.convolution, as well as the method
sage.functions.piecewise.PiecewisePolynomial.convolution, not to
mention sage.gsl.dft.IndexedSequence.convolution (both of which are
due to David Joyner, who has already replied on this thread!).

So what do we *not* have implemented? Looks like polynomial
convolution is good, if hard to find, and also discrete/Dirichlet
convolution for IndexedSequences. How hard would it be to extend
these things - or would we want a totally new implementation for SR,
and for arithmetic functions?

This is now http://trac.sagemath.org/sage_trac/ticket/8994 . I also
hope that Tobias will find at least one of the already existing
functions useful, perhaps the piecewise implementation if he has
compact support?

- kcrisman

Robert Dodier

non lue,
19 mai 2010, 13:59:3319/05/2010
à sage-support
On May 19, 8:58 am, Tobias Katz <tobi...@web.de> wrote:

> Indeed I am looking for s.th. like
>
> g(t) = convolve(f,sin)
>
> I am not familiar with Maxima - I had a short look at it but I didn't
> find a function like this.

Maxima doesn't have a built-in symbolic convolution
function although you could formulate one easily enough
to just compute integrate(f(u)*g(x - u), u, minf, inf) or
whatever definition. I don't know whether a direct
approach like that is preferable, or if it's better to compute
the convolution via Fourier or Laplace transforms or some
other way.

FWIW

Robert Dodier
Répondre à tous
Répondre à l'auteur
Transférer
0 nouveau message