LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Mag-Phase FFT average error

Solved!
Go to solution

The purpose of my program is to eventually take a random signal of a discrete length, and display the fft of the signal with windowing and averaging applied.  In the VI attached to this post, I've taken a sine wave signal, and processed it with both averaging and no averaging.  The averaged signal produces an incorrect spectrum. 

 

It would be appreciated if someone could let me know why the spectrums of the averaged and non-averaged ffts are not the same, and tell me how to improve my code to produce the same spectrums.

0 Kudos
Message 1 of 5
(2,643 Views)

The spectrums are different because they are representing different data. If I understand your code, one FFT is processing the entire dataset, and one is processing N subsets of the data and averaging them all together.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 5
(2,626 Views)

That is an accurate description of how the program works, but my confusion lies in why the result from averaging a few subsets of the signal does not produce the same result as the fft of the whole signal.

 

For example, if I had a 10 hz sine wave signal input, and I sampled for 1 second at 5000 S/sec, and I wanted to average 2 times.  The program should divide the data into two 0.5 sec sections, complete two ffts that should have identical results and then average them to give the fft of a 10Hz sine wave.  The problem is, that is not what is occuring.

0 Kudos
Message 3 of 5
(2,622 Views)
Solution
Accepted by topic author RossA.

One potential problem is that the frequency resolution from the FFT is a function of the number of datapoints in the FFT. Also the phase relationships between the various segments can vary based on how your segmentation works and how many segments you define. With windowing this can be a problem because windowing effects the amplitudes of the data samples at the ends. And with no windowing, there's spectral bleeding.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 4 of 5
(2,615 Views)

I think I overlooked the fact that the more I average, the more my resolution decreases, for the way my code is written.

 

Thanks

0 Kudos
Message 5 of 5
(2,611 Views)