文档介绍:Forpersonaluseonlyinstudyandresearch;mercialuse实验十二:;mercialuseclearclcfs=40;f=ones(1,81);t=-1:1/fs:1;f1=cos(2*pi*5*t).*f;figuresubplot(2,2,1),plot(t,f),axis([-,,0,])title('f(t)时域波形')subplot(2,2,2),plot(t,f1),axis([-,,-,])title('f1(t)时域波形')N=512;Xf=fftshift(abs(fft(f,N)));Xf1=fftshift(abs(fft(f1,N)));w=-N/2:(N/2-1);w=w*fs/N;subplot(2,2,3),plot(w,Xf)title('f(t)的幅度频谱')subplot(2,2,4),plot(w,Xf1)title('f1(t)的幅度频谱')=400;Fc=40;N=400;n=0:N;t=n/Fs;xt=cos(2*pi*5*t);xct=cos(2*pi*Fc*t);%调制过程及频谱yt=xt.*xct;Xw=fftshift(abs(fft(xt,512)));Yw=fftshift(abs(fft(yt,512)));ww=-256:255;ww=ww*Fs/512;figuresubplot(2,1,1)plot(t,xt),title('被调信号波形')subplot(2,1,2)plot(ww,Xw)%被调信号频谱图title('被调信号频谱')figuresubplot(2,1,1)plot(t,yt),title('已调信号波形')subplot(2,1,2)plot(ww,Yw)%已调信号频谱图title('已调信号频谱')%解调y1t=yt.*xct;figuresubplot(2,1,1)plot(t,y1t),title('解调过程中间信号波形')Y1w=fftshift(abs(fft(y1t,512)));subplot(2,1,2)plot(ww,Y1w)title('解调过程中间信号频谱')%设计滤波器h=fir1(20,40/200,hamming(21));figurefreqz(h,1),title('滤波器频率特性')%滤波y2t=filter(h,1,y1t);Y2w=fftshift(abs(fft(y2t,512)));figuresubplot(2,1,1)plot(t,y2t),title('解调信号的波形')subplot(2,1,2)plot(ww,Y2w),title('解调信号的频谱')=1000;Fc=100;N=1000;n=0:N;t=n/Fs;x=sin(2*pi*2*t);y1=modulate(x,Fc,F