"Compute the Fourier transform of the signal.
Compute the two-sided spectrum P2. Then compute the single-sided spectrum P1 based on P2 and the even-valued signal length L.
P2 = abs(Y/L);
P1 = P2(1:L/2+1);
P1(2:end-1) = 2*P1(2:end-1);
Why P1(2:end-1)= 2*P1(2:end-1)? What does it means (2:end-1)? I tried to deduce creating other example with some matrix, but i don't understand Why (1:L/2+1)?
_ Define the frequency domain f and plot the single-sided amplitude spectrum P1. The amplitudes are not exactly at 0.7 and 1, as expected, because of the added noise. On average, longer signals produce better frequency approximations. _
f = Fs*(0:(L/2))/L;
title('Single-Sided Amplitude Spectrum of X(t)')
This is my first time I approach to the FFT, and I have a civil engineer background, so is my first time with signal analysis, never studied Signal Theory before.
My interest for the FFT is to define the best low pass filter (example apply a butterworth but I don’t know how to choose the filter order and cutoff frequency.
Thanks in advance :)