I have noticed many posts regarding frequency spectrum and many answers to the same questions. How to normalize the values of FFT and PSD from a periodic signal?
Most of us when we refeer to "normalize the frequency domain" we mean that it is required to obtain the frequency domain of the signals where the amplitude of the signal, or the time window, do not affect the obtained plot.
For example in my case I use a periodic sine signal with a frequency of 160HZ, and observed that the amplitude of the foundamental frequency in both figures changes according to the length of the signal. So the questions are:
How to obtain a FFT and PSD where the amplitude values are not affected by:
- The time window or the number of points.
- The peak amplitude of the signal. I mean for example if the signal amplitude is reduced by the half, still getting the corresponding peak value, or even better the corresponding percentage.
Notice that even the amplitud of the signal is 15. The obtained values in FFT and PSD are not 15.
For FFT the value varies between 10 and 14 depending on the time window, but never the 15 that it should be, even it the time window is very high.
For PSD the amplitude value increases as a function of the time window. From 2 up to 800.
Also notice that PSD shows the foundamental frequency at 160 Hz but in the one-side FFT varies 145 - 160 Hz. How to solve it? Why is this happening?
I attached the code and in the PDF the results with diverse time windows.
Do you have any comments about how to fix my code in order to get the same amplitude for PSD and FFT despite of the time window. Thanks
L = a(1,1)
Y = fft(R);
P2 = abs(Y/L);
P1 = P2(1:L/2+1);
P1(2:end-1) = 2*P1(2:end-1);
f = Fs*(0:(L/2))/L;
[SignalSpectrum,SignalFrequencies] = periodogram(R, ...