LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

getting wrong amplitude in FFT

HI all,

 

Simply I am doing frequency sweep. The attached photot has three graph, on the top left you can see I am getting - 16 dBm which is the same as I generated, on the right top graph is the FFT of each single step. the below graph shows the result of the power and frequency sweep of the total steps.

I am getting some wrong values in AMPLITUDE after inserted them in FFT, I tried to add zero padding to make the FFT work to power of 2 but i still have the same problem.I have read that the problem beacuse of spectral leakage but I don't know how to overcome this problem. Any support? Thanks in advance

 

Regards

 

0 Kudos
Message 1 of 11
(5,428 Views)
How is this problem different from this one:

http://forums.ni.com/t5/LabVIEW/problem-with-FFT/m-p/3267241

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 11
(5,397 Views)

Hi mike,

 

actaully this old post that you mentioned is different totally. I had got wrong amplitude when I inserted the values to the basic FFT. but I got right values when I use other kind of FFT. Then I google it and I found that I have to scale the output in order to get right amplitude, have a look for the below link.

 

http://digital.ni.com/public.nsf/allkb/EB86C3F027DF072186256DB0006C3612

 

now my problem is when I do frequency sweep I got wrong values as I mentioned before, but when I insert only one value at each time I still can get right amplitude.

0 Kudos
Message 3 of 11
(5,375 Views)
I am not sure I understand, but what I think you are saying is that a constant freq input give a correct answer but a sweep does not?

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 4 of 11
(5,365 Views)
Yeah exactly
0 Kudos
Message 5 of 11
(5,360 Views)
Spectral leakage is the result of an assumption that the FFT process makes. It assumes the the data it receives is one sample of an infinitely repeating pattern.

The simplest case is a sine wave. As long as your sample contains an exact integer number of cycles, the algorithm's assumption proves out and you have no spectral leakage. However, if you have a noninteger number of cycles, there is a discontinuity in the pattern that the algorithm will try to represent spectrally. This is spectral leakage.

Already you can see a problem for your sweep, a signal that by definition is not part of an infinitely repeating pattern.

The solution is to use a windowing function that reduces the spectral leakage by attenuating the signal amplitudes at the ends of the sample. However, this fix can cause it's own problems in that it will reduce or even eliminate peaks that occur in the parts of the waveform that are being attenuated to prevent the leakage.

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 6 of 11
(5,349 Views)

Thanks Mike for your explination,

 

 

as you mentioned I have tried to use windowing but it doesn't sort out the problem. Is there any other way that I can use it to solve the problem? thanks in advance

0 Kudos
Message 7 of 11
(5,315 Views)
Short answer: No.

This is one of those situations where you have to consider the tradeoffs and pick the least egregious.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

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

For help with grief and grieving.
Message 8 of 11
(5,302 Views)

hmmmm, Ok, isee. Thank you so much for your comment

0 Kudos
Message 9 of 11
(5,290 Views)

Getting more data may help. But only if the data is meaningful. 

 

If you can slow the sweep and increase the sampling rate then you get more samples at (or near) each frequency. It is best if you can have a data set which is sampled at only one frequency as opposed to a varying frequency. That will improve the frequency resolution.

 

Since it looks like your signal has a high signal to noise ratio, condsider calculating the sum of the energy in all the frequency bins near the peak which are above some threshold. That will probably be closer to the "amplitude" you think you should get.

 

Lynn

0 Kudos
Message 10 of 11
(5,288 Views)