LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FFT Amplitude is not constant for Different Sine Signals

Why is the amplitude of my Sine waves after doing FFT decreasing. It must have a constant amplitude of 1. How can I obtain a constant amplitude of 1 for my FFT? Is there any way in order to compensate and obtain a constant amplitude of 1.

 

decrease.JPG

 

0 Kudos
Message 1 of 11
(4,571 Views)

What's the amplitude of your input?  Is it constant?

0 Kudos
Message 2 of 11
(4,570 Views)

Hi, gjjude,

 

I wonder if the sampling rate is enough to prevent from the aliasing.

What sampling rate and sample number do you use?

 

0 Kudos
Message 3 of 11
(4,559 Views)

I didnt use any sampling rate and number of samples for this program. That's my problem I dont know how to use a sampling rate and number of samples for this. Can you recommend how? 

0 Kudos
Message 4 of 11
(4,552 Views)

Yes the amplitude is 1 and is constant for all sine waves.

0 Kudos
Message 5 of 11
(4,551 Views)

It would probably help to show your code so we can see what you've done so far.  Include a default dataset by right-clicking the input graph and selecting Data->Make Current Values Default unless it's an indicator that's reading the data in another format.

0 Kudos
Message 6 of 11
(4,542 Views)

This is my VI File

0 Kudos
Message 7 of 11
(4,531 Views)

A screenshot of his block diagram is in his other, related post here

 

I've recreated it without the mathscript (attached).

 

Somewhat instructive to index out one of the sine waves and one of the FFT's instead of comparing them all at once.  Try index=200 and compare it to index 800.   The width of the peak is larger for index 800 (than for 200) which agrees with the reduction in height, but I can't find the root cause.  Looks like the max frequency is 10kHz and the sample frequency is 100kHz so Nyquist should be happy.  I tried jacking up the number of samples per sine wave and that had no effect. Jacking up the sample rate did have an effect (change 1e-5 to 1e-6 and .1 to .01 to achieve higher sample rate with same number of samples) , but not sure why.

0 Kudos
Message 8 of 11
(4,527 Views)

I can't opden the vi, still stick with 2012... and the pic in the other thread , well, the express vi is hiding all information 😞

 

What type of window do you use?

 

Wellcome in the wonderfull world of signal processing 😄

 

Hint: Since (or better: just because ) you have always full periodes in your signals, you can use no or the rectangular window. BUT you should be aware of FFT leakage !!

FFT and windowing is signal processing 101...    

Funny, I don't get your result 😉    

fft test.png

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 9 of 11
(4,509 Views)

Henrik is exactly right. You are experiencing spectral leakage. If you expand the spectral graph to show just one peak, you will see that there are several non-zero values on both sides of the peak. Some of the energy is in those bins resulting in a decrease of the amplitude of the largest peak.

 

If you run Extract Single Tone Information.vi on each of your frequencies, you will find that it reports the amplitudes of all of the signals as equal. Internally this VI uses FFT but also compensates for spectral leakage and includes the energy in the adjacent bins.  The very slight discrepancy in the 20 Hz values are due to the fact that there are not enough points below 20 Hz to completely resolve the leakage there.

 

Zwired1,

 

There is no need to convert to 2D arrays to matrix and back to 1D array to array of waveforms.  The Ramp pattern VI and one for loop cna generate the same signals.

 

Lynn

0 Kudos
Message 10 of 11
(4,428 Views)