Reconstructing functions using Fourier Transforms
chungadaddy
I am a bit confused on how to use the Fourier Transform algorithm for my purposes. My intentions were to reconstruct an unknown periodic function into a sum of sin and cos functions. I was very happy when I realized that the output complex wave allowed me very easily to extrapolate the value for the linear component (often called DC by electrical engineers), the frequencies and respective amplitudes. I used it first on some test functions, simple ones so I could determine if the calculations matched my input. There are a couple of things that I have not been able to determine and perhaps such is due to my own incompetence.
My first problem is determining the phase. Lets imagine the test function sin(2*pi*x+pi/2).
If I did everything right, the FFS complex output does not store any information regarding the phase (which in this case would be pi/2). I tried the phase output using FFT but I really do not understand what that output means since it resemble to noise scattered over a range between 0 and the Nyquist frequency.
My second problem is determining the outputted type of function.
If I use the test functions f(x)=cos(2*pi*x) and g(x)=sin(2*pi*x) I obtain exactly the same complex output. How can I distinguish these? It would be important for me if I want to represent a hypothetical function into its parts as a sum of cos and sin.
I would also like to take this opportunity and ask if the magnitude output indeed corresponds to the amplitude.
I look forward to hearing from you.
Kind regards,
Joao
It might be worth recommending that you consult some books on Fourier Transforms. Bracewell's is my favorite but it is a very old book. I suspect that both of the problems that you describe are somewhat related to the understanding of the FFT hence my recommendation above.
If you want to detect phase you should consider the Hilbert transform. To find out more about this execute:
The example at the bottom of that help topic is particularly pertinent.
As for your second problem: both the sine and cosine functions produce a pair of delta functions in the transform domain. The difference, as you might expect is just a phase shift because the only difference between the two functions is a constant phase. This is known as the "Shift Theorem" (see, e.g., http://www.cv.nrao.edu/course/astr534/FourierTransforms.html).
I am not sure what you mean by "magnitude output". If you are referring to FFT/OUT=4 then this is the magnitude of the complex transform.
A.G.
WaveMetrics, Inc.
August 17, 2011 at 09:28 am - Permalink
Thank you for your reply.
Kind regards.
Joao
August 17, 2011 at 09:52 am - Permalink