LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does averaging the phase information from the FFT spectrum VI appear to give me useless information?

Hello,
I am trying to build a simple application to sample an audio signal using the sound card then extract the various frequencies of this sound as well as the phase information. I have begun by simulating my audio signal with several sine waves (see the attached). The frequency spectrum comes out great but the phase information does not appear to be correct. I tried averging to get cleaner result bu this gives me zero phase for all frequencies (according to the phase diagram) and I know this is wrong. I get the same result if I use the Amplitude Spectrum.vi included as an example in LabView. There is something here that I do not understand. Please help!

Merce
0 Kudos
Message 1 of 3
(3,206 Views)
First, FFTs do not work well on small data sets, two cycles of the lower frequency in your example. I increased the number of samples in the function generators by a factor of 100 and got much sharper spectra.

Second, What phase are you trying to measure? What is the phase of a complicated signal, measured with respect to what reference? If your signals are not exactly harmonically related the phase of one of them with respect to the zero crossing of the other is meaninless as it changes from cycle to cycle?

The FFT is defined mathematically for a continuous signal extending to plus and minus infinity in time. The phase associated with the FFT is arctangent(Imaginary part/Real part).

Lynn
Message 2 of 3
(3,198 Views)
Thanks for the information. I guess I am thinking too simplictically. If I assume the fundamental frequency has a phase angle of zero, then I am trying to get the phase angle of all the other harmonics with respect to the fundamental. I assumed that if you looed at the phase output from the FFT VI output (not real and imaginary, but r and theta)I would get a plot of phase angle vs. frequency. From this plot I could determine the phase angle between the two harmonics. In the case of the attached example, the difference between the two phase angle should be 90 deg.
0 Kudos
Message 3 of 3
(3,191 Views)