当前位置:首页 > 实验一基本信号产生及信号的基本运算及MATLAB程序
实验一 基本信号产生及信号的基本运算
一、实验目的 1.熟悉Matlab的使用
2.掌握信号处理中基本信号的产生 3.掌握信号处理中信号的基本运算 二、实验内容
1.编程产生以下常用信号并画出波形(n为信号波形显示区间) (1) ?(n?n0) n0?-5;0;5 ?10?n?10 (2) u(n?n0) n0?-5;0;5 ?10?n?30
?(3)cos(n)u(n) 0?n?30
81(4)()nu(n) 0?n?20
42.编程实现以下基本运算并画出波形 (1)f1(n)?u(n)?u(n?10) ?20?n?20 (2)f2(n)?f1(n?2) (3)f3(n)?f1(?n)
(4)已知x(n)?{1 求h(n)?2R10(n),求系统的零状态响应。 ,?1,0,2,1},三、思考题
1.MATLAB中几种方式可以计算系统的零状态响应? 四、实验报告要求 1.简述实验目的
2.按实验内容要求编写实验程序,并附上实验结果 3.回答思考题 4.总结实验中的问题
1:
n1=-10:10;
x1=[(n1-0)==-5];x2=[(n1-0)==0];x3=[(n1-5)==5]; subplot(231)
stem(n1,x1,'fill'),grid on
xlabel('T1'),title('x(n)=Delta(n-5)') subplot(232)
stem(n1,x2,'fill'),grid on
xlabel('T2'),title('x(n)=Delta(n+0)') subplot(233)
stem(n1,x3,'fill'),grid on
xlabel('T3'),title('x(n)=Delta(n+5)') n2=-10:30;
u1=[(n2-5)>=0];u2=[(n2-0)>=0];u3=[(n2+5)>=0]; subplot(234)
stem(n2,u1,'fill'),grid on
xlabel('T1'),title('x(n)=u(n-5)') subplot(235)
stem(n2,u2,'fill'),grid on
xlabel('T2'),title('x(n)=u(n+0)') subplot(236)
stem(n2,u3,'fill'),grid on
xlabel('T3'),title('x(n)=u(n+5)')
2:
n1=0:30;
x1=cos(pi/8*n1); subplot(211);
stem(n1,x1,'fill');grid on; title('x(n)=cos(pi/8*n)u(n)'); n2=0:20;
x2=(1/4).^n2; subplot(212);
stem(n2,x2,'fill');grid on; title('x(n)=(0.25^n)u(n)');
3:
n=-20:20;
x1=[(n-0)>=0&(n-10)<=0];
%x1=[(n-0)>=0];x2=[(n-10)>=0];x3=x1-x2; subplot(311); stem(n,x1);
title('f1(n)=u(n)-u(n-10)'); subplot(312); stem(n+2,x1)
title('f2(n)=f1(n-2)'); subplot(313); stem(-n,x1);
title('f3(n)=f1(-n)');
4:
nx=0:4;
x=[1,-1,0,2,1]; h=2*ones(1,10); nh=0:9;
nys=nx(1)+nh(1);nyf=nx(end)+nh(end); ny=nys:nyf; y=conv(h,x);
stem(ny,y,'fill'); title('零状态响应'); 5:
共分享92篇相关文档