Re: fft2 filtering real vs complex question
On Jan 31, 1:12*pm, Rune Allnor <all...@tele.ntnu.no> wrote:
> On 31 Jan, 19:54, Steve <ssheri...@gmail.com> wrote:
>
> > I have a real valued 2D array of magnetic observations F which I am
> > working with in Matlab.
>
> > ifft2(fft2(F))= real, as expected.
>
> > I want to calculate the first vertical integral of those data to get
> > the magnetic potential which should be real as well. That requires
> > dividing by the wavenumber array.
>
> > vertInt=ifft2(fft2(F)./wn)
>
> One obvious question is what the wavenumber array looks like.
> It needs to be symmetric in a certain way for the output data
> to become real-valued. See if you can find a text on image
> processing to learn about the 2D DFT (e.g. the one by Gonzales
> and Woods, 1992 edition).
>
> The second comment is that the 2D FFT, when performed correctly,
> will produce a result that is real-valued to within numerical
> precision. This means that the imaginary part will be non-zero
> but vanishingly small.
>
> Rune
Thanks - vertInt=ifft2(fft2(F)./wn,'symmetric') solved my problem.
I'd read the fft2 docs but wrongly assumed ifft2 was just a sign and
scaling swap.
|