[SciPy-User] fitting with convolution?

Till Stensitzki mail.till at gmx.de
Sun Jul 21 09:10:32 EDT 2013


David Baddeley <david_baddeley <at> yahoo.com.au> writes:

> 
> 
> Hi Petro,
> 
> when I run the code I get very similar, although not identical curves,
which are roughly what you'd expect. Your exponential kernel that you're
convolving with is not band limited, but FFTs (and hence FFT based
convolution) are band-limited to whatever your effective nyquist frequency
is (strictly speaking out of band frequencies might be aliased into the pass
band - but in your case you can just think of the high frequency components
as being discarded). This
>  probably applies generally to any discrete way of doing convolution, when
compared to an analytical solution. Put simply, you can never sample fine
enough  to reproduce all the detail of the initial spikey bit of your
exponential (if you increase your sampling frequency you'll get a better
match, but you'll never quite get there). If you are referring to the factor
of 14.5, it is a result of fft normalisation, and should more accurately be
sqrt(N)/pi.
> 
> hope this helps,
> David

I this case the problem is much simpler, the analytical solution is not
circular, while the FFT convolution is. With the right zero-padding it is
possible to get identical results. But my testing did show this is slower
than just using the analytical solution.

greetings
Till





More information about the SciPy-User mailing list