clear allx=0:2*pi/100:2*pi; y=sin(2*pi*5*x)+0.2*randn(1,101); yy=abs(fft(y)); subplot(211) plot(x,y) subplot(212) f=((0:100)*50/pi)/102;plot(f,yy); xlim([0,25/pi]);grid on