数字信号处理 MATLAB程序
更新时间:2023-08-09 17:15:01 阅读量: IT计算机 文档下载
例题3.1.1
Fm=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.实现抑制载波的幅度调制。已调信号y(t) x(t)cos( ct),式中x(t)为调制信号;
cos( ct)rad/s
为载波信号。此处可取x(t) cos( m t), c 80 rad/s, m 10
。
(1)分析调制信号x(t)的频谱,绘出其时域波形和频谱。 Matlab程序如下: Fs=1000; Fc=40; N=1000;
wc=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)分析已调信号y(t)的频谱,绘出其时域波形和频谱。 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(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(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.3 0.5 -0.1 0.1]); 解调后的波形如下图:
2.实现含有载波的幅度调制。已调信号y(t) [A mx(t)]cos( ct),A 1,m 0.5,观察调制结果,与抑制载波的幅度调制有什么不同?
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).*sin(100*pi*t); subplot(3,1,3); plot(t,y1); xlabel('t(s)');
title('Modulateed signal'); 两种调制结果如下:
(3)实现含有载波的幅度调制y(t) [A mx(t)]cos( ct),调制信号为
t
t
t04t04
t
3t04
t04 t
3t04
x(t) t t0
t
3t4
t04
设t0 5s,载波为cos( ct) cos(100 t),取A 1,m 0.8。 (1)分析调制信号x(t)的频谱,绘出其时域波形和频谱。 (2)分析已调信号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; x=t;
z1=fft(x,256);subplot(4,1,1);plot(t,x); grid on;legend('x(t)= t的时域波形');
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;
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);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;
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.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)若传输中有噪声加入。生成噪声信号0.1*randn(1,N),叠加在已调信号y(t)上,观察其时域波形和频谱。 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=fft(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: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)。已知三个已调制信号aip[k],经幅度调制而产生的
3
FDMA信号为s[k]
i 1
aip[k] cos(
ki
4
)
式中:ai为常数;p[k]为具有窄带特性的Hanning信号,其定义为
0.5 )0 k N 1 0.5
N 12 k
p[k]
0 其他
若将此已调信号通过信道传输,描述该信道的模型为宜全通系统,其差分方程为
y[k] 1.1172y[k 1] 0.9841y[k 2] 0.4022y[k 3] 0.2247y[k 44] 0.2247x[k] 0.4022x[k 1] 0.9841x[k 2] 1.1172x[k 3] x[k 3]
已调信号s(k)通过该信道后,得到的接收信号为y(k) s(k)*h(k)。 1
N=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)的频谱
');
2
N=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
频率响应特性
a=[1 -1.1172 0.9842 -0.4022 0.2247]; b=[0.2247 -0.4022 0.9842 -1.1172 1]; w=linspace(1,pi,512);
H=freqz(a,b,w);plot(w/pi,abs(H));
单位脉冲响应
a=[1 -1.1172 0.9842 -0.4022 0.2247]; b=[0.2247 -0.4022 0.9842 -1.1172 1]; n=-0.1:0.01:0.5; x=impDT(n); y=filter(b,a,x); plot(n,y);grid on;
4
a=[1 -1.1172 0.9842 -0.4022 0.2247]; b=[0.2247 -0.4022 0.9842 -1.1172 1]; k=0:0.1:100;
p=0.5-0.5*cos(2*pi*k./74);
s=p.*(cos(pi*k/4)+2*cos(pi*k/2)+3*cos(3*pi*k/4)); y=filter(b,a,s); z1=fft(y,256);
plot([-128:127],fftshift(abs(z1)));axis([-30 30 0 120]);grid on;
正在阅读:
数字信号处理 MATLAB程序08-09
城市道路设计年度总结03-11
行业研究-电力设备100822:坚强智能电网系列报告之二:智能变电站,无法阻挡的未来(增持)05-21
6个单韵母和20个声母的笔顺(1)06-09
高中生物模块综合测评新人教版选修309-12
热处理试题(高级、技师、高级技师)10-30
虹口小升初补习班恒高一对一复习卷01-31
巢湖流域表层土壤氮磷空间分布特征研究07-18
中国石油大学出版社03-08
泉州市教育科学研究所 - 图文11-27
- 供应商绩效评价考核程序
- 美国加州水资源开发管理历史与现状的启示
- 供应商主数据最终用户培训教材
- 交通安全科普体验教室施工方案
- 井架安装顺序
- 会员积分制度
- 互联网对美容连锁企业的推动作用
- 互联网发展先驱聚首香港
- 公司文档管理规则
- 机电一体化系统设计基础作业、、、参考答案
- 如何选择BI可视化工具
- 互联网产品经理必备文档技巧
- 居家装修风水的布置_家庭风水布局详解
- 全省基础教育信息化应用与发展情况调查问卷
- 中国石油--计算机网络应用基础第三阶段在线作业
- 【知识管理专题系列之五十八】知识管理中如何实现“场景化协同”
- 网络推广方案
- 中国石油--计算机网络应用基础第二阶段在线作业
- 汽车检测与维修技术专业人才培养方案
- 详解胎儿颈透明层
- 信号处理
- 数字
- 程序
- MATLAB
- 现场急救小常识
- 2020版新高考数学二轮复习(京津鲁琼版)练习:第一部分 小题专题练 小题专题练(四) 立体几何
- 斜井主提升机的改造
- 幼儿园规模办园统计表
- 过秦论_知识点整理
- 调查报告-2019中学生近视调查报告范文
- 远程教育3月工作小结
- 云南小学教师教育学心理学资料
- 外国庄园事例
- 逻辑回归和人工神经网络模型在滑坡灾害空间预测中的应用
- 2012年新民事诉讼法与旧民事诉讼法区别整理版
- 微单拍摄技巧
- 方仁工作文教学课堂实录3
- 通信工程建设施工管理
- PowerDesigner使用教程
- 六年级关于人与动物作文600字3篇.doc
- 毕业论文中期报告
- 汽车制动鼓刹车盘减壳等配件的高效加工专机
- XX镇政府干部职工管理制度
- Research on mechanical properties of X100 pipeline steel after JCOE welded