I used the code below perform spectral analysis of signal with known period of 4 s:
load lujan.datdata_out.time = lujan(:,1);data_out.disp = lujan(:,2);Y = fft(data_out.disp,1000);Y(1)=[];NY = length(Y);Pyy = abs(Y(1:floor(NY/2))).^2;nyquist = 1/2;f = (1:NY/2)/(NY/2)*nyquist;plot(f,Pyy,'-b','LineWidth',3);title('Power spectral density');xlabel('Frequency (Hz)');
However the output graph shows a peak at 0.05 Hz which is not correct! IS there something obvious i'm doing wrong?
thanks
Best Answer