文档详情

上机实验一 连续时间信号的时域分析.doc

发布:2017-12-15约2.17千字共4页下载文档
文本预览下载声明
上机实验一 连续时间信号的时域分析 实验目的 掌握连续时间信号时域运算的基本方法 掌握相关函数的调用格式及应用 掌握连续信号的基本运算 掌握利用计算机进行卷积运算的原理和方法 熟悉连续信号卷积运算函数conv的应用 二、实验内容 验证性实验 相加 实现两个连续信号的相加 Matlab程序: clear all; t=0:0.0001:3; b=3; t0=1; u=stepfun(t,t0); n=length(t); for i=1:n; u(i)=b*u(i)*(t(i)-t0); end y=sin(2*pi*t); f=y+u; plot(t,f); xlabel(时间(t));ylabel(幅值f(t));title(连续信号的相加); 相乘 实现两个连续信号的相乘 Matlab程序: clear all; t=0:0.0001:5; b=3; t0=1;u=stepfun(t,t0); n=length(t); for i=1:n; u(i)=b*u(i)*(t(i)-t0); end y=sin(2*pi*t); f=y.*u; plot(t,f); xlabel(时间(t));ylabel(幅值f(t));title(连续信号的相乘); 移位 实现连续信号的移位 Matlab程序: clear all; t=0:0.0001:2; y=sin(2*pi*t); y1=sin(2*pi*(t-0.2)); plot(t,y,-,t,y1,--); ylabel(f(t));xlabel(t);title(信号的移位); 翻转 信号的翻转就是将信号的波形以纵轴为对称轴翻转180。将信号f(t)中的自变量t替换为-t即可得到其翻转信号。 Matlab程序: clear all; t=0:0.02:1; t1=-1:0.02:0; g1=3*t;g2=3*(-t1); grid on; plot(t,g1,--,t1,g2); xlabel(t);ylabel(g(t));title(信号的反折); 程序设计实验 已知信号f1(t)=(-t+4)[U(t)-U(t-4)],f2(t)=sin(2πt),用Matlab绘出信号的时域波形。 f3(t)=f1(-t)+f1(t) f4(t)=-[f1(-t)+f1(t)] f5(t)=f2(t)*f3(t) f6(t)=f1(t)*f2(t) Matlab程序: syms t f1=sym((-t+4)*(heaviside(t)-heaviside(t-4))); f2=sin(2*pi*t); f3=f1+subs(f1,t,-t); f4=-f3; f5=f2*f3; f6=f1*f2; subplot(3,2,1);ezplot(f1,[-1,5]); title(f1(t)); subplot(3,2,2);ezplot(f2,[-5,5]); title(f2(t)); subplot(3,2,3);ezplot(f3,[-5,5]); title(f3(t)); subplot(3,2,4);ezplot(f4,[-5,5]); title(f4(t)); subplot(3,2,5);ezplot(f5,[-5,5]); title(f5(t)); subplot(3,2,6);ezplot(f6,[-5,5]); title(f6(t)); 证明卷积满足如下结论: f1(t)*f2(t)=f2(t)*f1(t); f1(t)*[f2(t)+f3(t)]=f1(t)*f2(t)+f1(t)*f3(t); Matlab程序: clear all; a=1000;t1=-5:1/a:5; f1=stepfun(t1,0); f2=stepfun(t1,-1/a)-stepfun(t1,1/a); f3= stepfun(t1,0)-stepfun(t1,4); y1=conv(f1,f2); y2=conv(f2,f1); g1=conv(f1,(f2+f3)); g2=conv(f1,f2)+conv(f1,f3); r=2*length(t1)-1; t=-10:1/a:10; subplot(2,2,1);plot(t,y1); axis([-5,5,0,1.2]); title(y1(t)); subplot(2,2,2);plot(t,y2); axis([-5,5,0,1.2]); title(y2(t)); subplot(2,2,3);plot(t,g1); axis([-5,5,0,1.2]); title(g1(t)); subplot(2,2,4);pl
显示全部
相似文档