Re: fft2 filtering real vs complex question



On Jan 31, 7:54 pm, Steve <ssheri...@xxxxxxxxx> 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)

This yields a complex array. I think the result should be real. The
negative and positive values of the result are equally important so
looking at abs(ifft2(fft2(F))) doesn’t help.

In short, I expect vertInt to be real, it isn’t. Any help on where I
am going wrong will be greatly appreciated.

You need to specify exactly what the array wn is to get an answer. In
the discrete Fourier basis, discrete wave numbers are only defined
modulo the number of points, but this is no longer quite true once you
start dividing by them. There are a couple of ways to see why this is
so.

1) In dividing by them you are attempting to approximate the inverse
of the continuous y differential. Thus your discrete expression should
(at least) tend to the continuous one as the sampling grid spacing
shrinks to zero. This requires to use the -N/2:N/2 type convention to
define the wave numbers.

2) Alternatively, you stay within the discrete domain, and instead
look for the inverse of the discrete difference operator in the
vertical direction. This operator is indeed diagonalized in the
discrete Fourier domain, but you need its eigenvalues. These are not
given by the wave number, but rather by

exp(i 2 pi m / N) - 1

where N is the number of points, and m is the wave number (in the
vertical direction in this case). Note that these are invariant to
shifts of m by N. Note, though, that to take the small m/N limit (to
get the continuous case) is tricky. If you are using the 0:(N - 1)
convention for the wave numbers, you need to take into account that
values of m close to N also give values of the exponential very close
to 1, and so need to be taken into account in addition to values of m
close to 0. This is because the frequency domain is really a torus.

illywhacker;
.



Relevant Pages

  • Re: Bras, kets etc.
    ... the difference between a continuous vs discrete basis set. ... this is assuming the wave is monochromatic. ... So, a general time-dependent spherical-wave problem turns out to have 3 indices, 2 discrete and one continuous. ...
    (sci.physics)
  • Quantum theory: A resonance effect?
    ... Emission from a source is a discrete phenomenon, as when an electron ... is nothing quantal or particle-like about the wave travelling through ... patterns of the electrons around the detector nucleus. ...
    (sci.physics)
  • Re: Bras, kets etc.
    ... the difference between a continuous vs discrete basis set. ... With a plane wave basis, ... a general time-dependent spherical-wave problem turns out to have 3 ...
    (sci.physics)
  • Re: discrete physics, a network approach
    ... > Theory and Quantum Mechanics ... > Discrete physical models often refer to a lattice arrangement of points ... is really not that different from the "waves" in quantum mechanics. ... Schrodinger equation gives us a wave solution. ...
    (sci.physics.research)
  • a simpler way for this sort of assignment?
    ... I have an array of size m x 2, where each row represents the discrete coordinates of a 2-d point, for a total of m points. ... but I can't help thinking there might be a more elegant way to do this in MATLAB, where each row of coords is directly interpreted as a 2-d index into M (and extends to n-dimensions, i.e. coords is of size mxn and M is n-dimensional matrix). ...
    (comp.soft-sys.matlab)