[Numpy-discussion] Horizontal lines in diffraction image (NumPy FFT)

Stéfan van der Walt stefan@sun.ac...
Wed Aug 6 05:33:21 CDT 2008


2008/8/6 Matthieu Brucher <matthieu.brucher@gmail.com>:
> Exactly. Using FFT to do a convolution should be done after some
> signal processing readings ;)

When you convolve two signals, of lengths N and M, you need to pad the
FFTs to length (N+M-1) before multiplication.

You can take a look at my linear position-invariant filtering code at:

http://mentat.za.net/hg/filter

To construct a Gaussian filter, for example, you do:

           >>> def filt_func(r,c):
                   return np.exp(-np.hypot(r,c)/1)

           >>> filter = LPIFilter2D(filt_func)

You may then apply it on data by doing `filter(data)`.  I also
implemented inverse filtering, which can be accessed using
`filter.inverse` and `filter.wiener`.

Regards
Stéfan


More information about the Numpy-discussion mailing list