数字信号处理MATLAB程序

上传人:876****10 文档编号:142095198 上传时间:2020-08-16 格式:DOC 页数:20 大小:429KB
返回 下载 相关 举报
数字信号处理MATLAB程序_第1页
第1页 / 共20页
数字信号处理MATLAB程序_第2页
第2页 / 共20页
数字信号处理MATLAB程序_第3页
第3页 / 共20页
数字信号处理MATLAB程序_第4页
第4页 / 共20页
数字信号处理MATLAB程序_第5页
第5页 / 共20页
点击查看更多>>
资源描述

《数字信号处理MATLAB程序》由会员分享,可在线阅读,更多相关《数字信号处理MATLAB程序(20页珍藏版)》请在金锄头文库上搜索。

1、数字信号处理-MATLAB程序 作者: 日期:例题3.1.1Fm=10;Fc=100;Fs=500;k=0:199;t=k/Fs;x=sin(2*pi*Fm*t);y=x.*cos(2*pi*Fc*t);Y=fft(y,256);subplot(2,1,1);plot(y);subplot(2,1,2);plot(-128:127,fftshift(abs(Y);实验所得的图像如下图所示:实验内容1.实现抑制载波的幅度调制。已调信号,式中为调制信号;为载波信号。此处可取 , 。(1)分析调制信号的频谱,绘出其时域波形和频谱。Matlab程序如下:Fs=1000;Fc=40;N=1000;wc=

2、80*pi;n=0:N-2;t=n/Fs;x=cos(10*pi*pi*t);y=x.*cos(wc*t);z1=fft(x,256);subplot(2,1,1);plot(t,x);legend(x(t)的时域波形);subplot(2,1,2);plot(-128:127,fftshift(abs(z1);legend(x(t)的频谱);实验所得图形如下:(2)分析已调信号的频谱,绘出其时域波形和频谱。Matlab程序如下:Fs=1000;Fc=40;N=1000;n=0:N-2;t=n/Fs;x=cos(10*pi*pi*t);y=modulate(x,Fc,Fs,am);z=fft(

3、y,256);subplot(2,1,1);plot(t,y);legend(y(t)的时域波形);subplot(2,1,2);plot(-128:127,fftshift(abs(z);legend(y(t)的频域波形)(3)设计低通滤波器并应用filter函数,实现信号同步解调设计的低通滤波器为cheby1型低通滤波器,技术参数为:wp=0.2*pi,ws=0.6*pi,Ap=1Db,As=25dB调制:N,wc=cheb1ord(0.2*pi,0.6*pi,1,25,s);num,den=cheby1(N,1,wc,s);b,a=bilinear(num,den,0.5);x=cos(

4、10*pi*pi*t);y=x.*cos(80*pi*t);w1=filter(b,a,y);plot(w1);Y=fft(w1);plot(w1);axis(0 500 -1 1);调制后的波形如下图:解调:N,wc=cheb1ord(0.2*pi,0.6*pi,1,25,s);num,den=cheby1(N,1,wc,s);b,a=bilinear(num,den,0.5);x=cos(10*pi*pi*t);y=x.*cos(80*pi*t);w1=filter(b,a,y);plot(w1);Y=fft(w1);Q=demod(Y,Fc,Fs,am);plot(t,Q);axis(0

5、.3 0.5 -0.1 0.1);解调后的波形如下图:2.实现含有载波的幅度调制。已调信号,选取,观察调制结果,与抑制载波的幅度调制有什么不同?Matlab程序:Fm=10;Fc=100;Fs=1000;N=1000;k=0:N-1;t=k/Fs;x=sin(2*pi*Fm*t);subplot(3,1,1);plot(t,x);xlabel(t(s);title(Modulate signal);y=modulate(x,Fc,Fs,am);subplot(3,1,2);plot(t,y);xlabel(t(s);title(Modulateed signal(AM);y1=(1+0.5*x

6、).*sin(100*pi*t);subplot(3,1,3);plot(t,y1);xlabel(t(s);title(Modulateed signal);两种调制结果如下:(3)实现含有载波的幅度调制,调制信号为 设,载波为,取。(1)分析调制信号的频谱,绘出其时域波形和频谱。(2)分析已调信号的频谱,绘出其时域波形和频谱。Matlab程序为:Fs=1000;Fc=40;N=1000;wc=80*pi;n=0:N-2;t=0.5/4:0.001:1.5/4;x=t;z1=fft(x,256);subplot(4,1,1);plot(t,x);grid on;legend(x(t)= t的

7、时域波形);subplot(4,1,2);plot(-128:127,fftshift(abs(z1);grid on;legend(x(t)= t时的频谱); y=(1+0.8*x).*cos(100*pi*t);z=fft(y,256);subplot(4,1,3);plot(t,y);grid on;legend(y(t)的时域波形);subplot(4,1,4);plot(-128:127,fftshift(abs(z);grid on;legend(y(t)的频域波形);实验图形如下图所示:Matlab程序为:Fs=1000;Fc=40;N=1000;wc=80*pi;n=0:N-2

8、;t=0.5/4:0.001:1.5/4;t0=0.5;x=-t+t0/4;z1=fft(x,256);subplot(4,1,1);plot(t,x);grid on;legend(x(t)= -t+t0/4的时域波形);subplot(4,1,2);plot(-128:127,fftshift(abs(z1);grid on;legend(x(t)= -t+t0/4时的频谱); y=(1+0.8*x).*cos(100*pi*t);z=fft(y,256);subplot(4,1,3);plot(t,y);grid on;legend(y(t)的时域波形);subplot(4,1,4);p

9、lot(-128:127,fftshift(abs(z);grid on;legend(y(t)的频域波形);实验图形如下图所示:Matlab程序为:Fs=1000;Fc=40;N=1000;wc=80*pi;n=0:N-2;t=0.5/4:0.001:1.5/4;t0=0.5;x=t-t0;z1=fft(x,256);subplot(4,1,1);plot(t,x);grid on;legend(x(t)=t-t0的时域波形);subplot(4,1,2);plot(-128:127,fftshift(abs(z1);grid on;legend(x(t)=t-t0时的频谱); y=(1+0

10、.8*x).*cos(100*pi*t);z=fft(y,256);subplot(4,1,3);plot(t,y);grid on;legend(y(t)的时域波形);subplot(4,1,4);plot(-128:127,fftshift(abs(z);grid on;legend(y(t)的频域波形);实验图形如下图所示:(3)若传输中有噪声加入。生成噪声信号,叠加在已调信号上,观察其时域波形和频谱。wc=80*pi;t=0.5/4:0.001:1.5/4;N=length(t);x1=t;y1=(1+0.8*x1).*cos(100*pi*t)+0.1*randn(1,N);z1=f

11、ft(y1,256);subplot(3,2,1);plot(t,y1);grid on; legend(x(t)= t的时域波形);subplot(3,2,2);plot(-128:127,fftshift(abs(z1);grid on; legend(x(t)= t的频域波形);x2=-t+t0/4;y2=(1+0.8*x2).*cos(100*pi*t)+0.1*randn(1,N);z2=fft(y2,256);subplot(3,2,3);plot(t,y1);grid on; legend(x(t)= -t+t0/4的时域波形);subplot(3,2,4);plot(-128:

12、127,fftshift(abs(z2);grid on; legend(x(t)= -t+t0/4的频域波形);x3=t-t0;y3=(1+0.8*x3).*cos(100*pi*t)+0.1*randn(1,N);z3=fft(y3,256);subplot(3,2,5);plot(t,y3);grid on; legend(x(t)= t-t0的时域波形);subplot(3,2,6);plot(-128:127,fftshift(abs(z3);grid on; legend(x(t)= t-t0的频域波形);实验图形如下图所示:4.实现频分复用(FDMA)。已知三个已调制信号,经幅度

13、调制而产生的FDMA信号为式中:为常数;为具有窄带特性的Hanning信号,其定义为 0 其他若将此已调信号通过信道传输,描述该信道的模型为宜全通系统,其差分方程为已调信号通过该信道后,得到的接收信号为。1N=75;k=0:N-1;n=length(k);p=0.5-0.5*cos(2*pi*k./(N-1);z1=fft(p,n);subplot(2,1,1);plot(k,p);grid on;legend(p(k)的时域波形);subplot(2,1,2);plot(k,fftshift(abs(z1);grid on;legend(p(k)的频谱);2N=75;k=0:N-1;n=length(k);p=0.5-0.5*cos(2*pi*k./(N-1);s=p.*(cos(pi*k/4)+2*cos(pi*k/2)+3*cos(3*pi*k/4);z2=fft(s,n);subplot(2,1,1);plot(k,s);grid on;legend(s(k)的时域波形);subplot(2,1,2);plot(k,fftshift(abs(z2);grid on;legend(s(k)的频谱);3频

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 大杂烩/其它

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号