11-03-2014 11:54 PM
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.
11-03-2014 11:56 PM
What's the amplitude of your input? Is it constant?
11-04-2014 12:34 AM
Hi, gjjude,
I wonder if the sampling rate is enough to prevent from the aliasing.
What sampling rate and sample number do you use?
11-04-2014 12:39 AM
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?
11-04-2014 12:39 AM
Yes the amplitude is 1 and is constant for all sine waves.
11-04-2014 01:05 AM
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.
11-04-2014 01:44 AM
This is my VI File
11-04-2014 01:51 AM
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.
11-04-2014 02:48 AM - edited 11-04-2014 02:53 AM
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 😉
11-04-2014 12:06 PM - edited 11-04-2014 12:08 PM
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