3d Hanning filter [message #39718] |
Thu, 10 June 2004 04:55  |
Tim[1]
Messages: 4 Registered: June 2004
|
Junior Member |
|
|
Dear all,
I want to produce a Hanning filter in 3d, and can do so using 3 for loops.
This is fine for small arrays, but uses too much memory and time, otherwise.
I've tried hacking hanning.pro, but can't get it to work.
Has anyone done this already?
Thanks,
Tim
|
|
|
Re: 3d Hanning filter [message #39806 is a reply to message #39718] |
Thu, 10 June 2004 06:50  |
K. Bowman
Messages: 330 Registered: May 2000
|
Senior Member |
|
|
In article <ca9i36$e1d$1@pegasus.csx.cam.ac.uk>,
"Tim" <tjvy2@cam.ac.uk> wrote:
> Dear all,
>
> I want to produce a Hanning filter in 3d, and can do so using 3 for loops.
> This is fine for small arrays, but uses too much memory and time, otherwise.
> I've tried hacking hanning.pro, but can't get it to work.
Have you considered doing your filtering in the spectral domain?
Convolution in the physical domain is eqivalent to multiplication in the
spectral domain; so, following the convolution theorem, the filtering
operation can be written
zfiltered = FFT(FFT(filter)*FFT(z), /INVERSE)
Filter is an array that's the same size as z. If z is real, you want to
take the FLOAT of the result.
As with all FFT methods, this works fastest if the dimensions of z have
small prime factors.
Ken Bowman
|
|
|