Re: Fourier Transform [message #74090 is a reply to message #45093] |
Thu, 23 December 2010 14:15   |
R.G.Stockwell
Messages: 163 Registered: October 2004
|
Senior Member |
|
|
"Ammar Yusuf" <amyusuf1@gmail.com> wrote in message
news:0976cc7b-4c34-4355-aa06-1cc52757cbe7@o14g2000yqe.google groups.com...
> Hi, let's say I have 2 graphs (2 arrays with numbers). They both look
> different but are similar. I'm doing a FFT on one of the arrays and
> then zero out some of the coefficients and then do an inverse FFT on
> that array to try to get the 2nd array. When I plot the 2nd array and
> the inverse one I get something similar to it but not close enough.
> I've tried zeroing many coefficients but can't get anywhere. What
> would be the best way to do this? Thanks.
offhand, simply zeroing out coefficients in an fft is a lousy way to filter
(quick and dirty, emphasis on dirty).
I don't have a clear idea of what your aim is, but here are a couple of
points. Are you trying to show
the same wave energy is present in both images? do a cross spectral
analysis S1 * conj(S2).
given two images I1 and I2 and the two spectra S1 and S2,
look at the ratio of abs(S2)/abs(S1). That will show you were the
difference are, but make
sure you treat the zero points (and small value points) of abs(s1). I'd do
the division and
then mask out the points of abs(S2)/abs(S1) where abs(S1) is small.
note: when you ifft into the image domain, you will not have the correct
phase, so the waves
will likely shift in the image domain and there can be interference.
you could try something like
I2new = inverse FFT ( S1 * abs(S2)/abs(S1) )
again, I have no idea what the goal is, so I can't really say anything more.
cheers,
bob
|
|
|