请看下面的程序:
- t=0:0.001:0.6;
- x=sin(2*pi*50*t)+sin(2*pi*120*t);
- y=x+2*randn(size(t));
- subplot(121);plot(t(1:50),y(1:50))
- title('signal with noise')
- xlabel('time/s')
- yy=fft(y,512);%快速傅立叶变换
- pyy=yy.*conj(yy)/512;%频谱
- f=1000*(0:256)/512;
- subplot(122);plot(f,pyy(1:257))
- title('spectrum')
- xlabel('frequency/Hz')


雷达卡



京公网安备 11010802022788号







