信号分析与处理 MATLAB仿真实验报告
2009.12.25
院系:电气工程学院 专业: 自动化 班级: 姓名: 学号:
实验7 离散时间序列的卷积
实验目的:学会用MATLAB实现对离散时间序列的卷积,掌握利用h(n) 与输入x(n)卷积来求系统零状态响应的方法。
实验要求:使用MATLAB中求卷积函数的conv(),并对结果分析总结。 实验内容:LTI系统的单位脉冲响应为h(n)=(0.9)n ε(n),输入序列为x(n)=ε(n)- ε(n-10),求系统的输出y(n)。
程序
function [y,ny]=conv_m(x,nx,h,nh); y=conv(x(5:45),h); ny=nh; y=y(1:41);
subplot(3,1,1);stem(nx,x,'filled');axis([-4,40,0,1]);title('x[n]');
subplot(3,1,2);stem(nh,h,'filled');axis([-4,40,0,1]);title('h[n]');
subplot(3,1,3);stem(ny,y,'filled');axis([-4,40,0,8]);title('y[n]');
实验结果:
结果分析:
改变参数以后的程序:
function [y,ny]=conv_m(x,nx,h,nh); y=conv(x(5:45),h); ny=nh; y=y(1:41);
subplot(3,1,1);stem(nx,x,'filled');axis([-4,40,0,1]);title('x[n]');
subplot(3,1,2);stem(nh,h,'filled');axis([-4,40,0,1]);title('h[n]');
subplot(3,1,3);stem(ny,y,'filled');axis([-4,40,0,2]);title('y[n]');
输出结果:
实验8 连续时间信号的卷积
实验目的:学会用MATLAB实现对连续时间信号的卷积,掌握利用卷积的方法求系统零状态响应,并与离散系统比较。
实验要求:使用MATLAB中求卷积函数的conv(),并对结果分析总结。 实验内容:已知某连续系统的单位冲激响应h(t)=e-5t*ε(t),输入信号x(t)= ε(t)- ε(t-1),求解系统的零状态响应y(t)
程序 p=0.01; t=0:p:2;
x=heaviside(t)-heaviside(t-1); x(1)=1;x(101)=1; h=exp(-5*t); hl=h*p; y=conv(x,hl); y=y(1:length(t));
subplot(3,1,1);plot(t,x);axis([-1,2,0,1.2]);title('x(t)');
subplot(3,1,2);plot(t,h);axis([0,2,0,1.2]);title('h(t)'); subplot(3,1,3);plot(t,y);axis([0,2,0,0.22]);title('y(t)');