5,0,1]);subplot(2,1,2)plot(f1,abs(fftshift(N1)));xlabel('频率');ylabel('幅值');axis([-500,500,0,0.05]);title('抽样正常时的信号频谱');axis([-500,500,-0.01,0.03]);t0=10; %信号持续的时间ts2=0.01; %不满足抽样条件的抽样间隔fs2=1/ts2;t2=[-t0/2:ts2:t0/2];%定义不满足抽样条件的时间序列x2=sin(200*t2);m2=x2./(200*t2+eps);w2=t0/(2*ts2)+1;m2(w2)=1;?%修正t=0时的信号值m2=m2.*m2;%定义信号[M2,mn2,df2]=fft_seq(m2,ts2,df);%对不满足抽样条件的信号进行傅立叶变换M2=M2/fs2;N2=[M2,M2,M2,M2,M2,M2,M2,M2,M2,M2,M2,M2,M2];f2=[-7*df2*length(mn2):df2:6*df2*length(mn2)-df2]-fs2/2;figure(3)subplot(2,1,1);stem(t2,m2);xlabel('时间');ylabel('幅值');title('抽样失真(fs=100Hz)时的信号波形');axis([-0.15,0.15,0,1]);subplot(2,1,2)plot(f2,abs(fftshift(N2)));xlabel('频率');ylabel('幅值');axis([-500,500,0,0.02]);title('抽样失真时的信号频谱');axis([-500,500,0.005,0.02]);function[M,m,df]=fft_seq(m,ts,df)fs=1/ts;ifnargin==2n1=0elsen1=fs/df