数字信号处理实验一 实验目的:掌握利用Matlab 产生各种离散时间信号,实现信号的相加、相乘及卷积运算 实验函数:参考课本 77-19 页,注意式(2.11.1)的表达与各matlab 子函数间的关系。 1、stem(x,y) % 绘制以 x 为横轴,y 为纵轴的离散序列图形 2、[h ,t] = impz(b, a) % 求解数字系统的冲激响应 h,取样点数为缺省值 [h, t] = impz(b, a, n) % 求解数字系统的冲激响应 h,取样点数为 n impz(b, a) % 在当前窗口用stem(t, h)函数出图 3、[h ,t] = dstep(b, a) % 求解数字系统的阶跃响应 h,取样点数为缺省值 [h, t] = dstep (b, a, n) % 求解数字系统的阶跃响应 h,取样点数为 n dstep (b, a) % 在当前窗口用stairs(t, h)函数出图 4、y = filter(b,a,x) % 在已知系统差分方程或转移函数的情况下求系统输出 实验原理: 一、常用的时域离散信号及其程序 1、产生单位抽样函数δ(n) n1 = -5; n2 = 5; n0 = 0; n = n1:n2; x = [n==n0]; % x在n=n0时为1,其余为0 stem(n,x,'filled'); %filled:序列圆心处用实心圆表示 axis([n1,n2,0,1.1*max(x)]) title('单位抽样序列') xlabel('time(n)') ylabel('Amplitude:x(n)') 2、产生单位阶跃序列u(n) n1 = -2; n2 = 8; n0 = 0; n = n1:n2; x = [n>=n0]; % x在n>=n0时为1,其余为0 stem(n,x,'filled'); axis([n1,n2,0,1.1*max(x)]) title('单位阶跃序列') xlabel('time(n)') ylabel('Amplitude:x(n)') 3、复指数序列 复指数序列的表示式为 ,00,0jnenx nn ,当0 时, x n 为实指数序列;当0 时, x n 为虚指数序列,即cossinjnenjn,即其实部为余弦序列,虚部为正弦序列。 产生0.1 、0.6 复指数连续信号与离散序列的 Matlab程序如下: n1 = 30; sigma = -0.1; omega = 0.6; n = 0:n1; x = exp((sigma+i*omega)*n); subplot(2,2,1),plot(n,real(x)); title('复指数信号的实部') subplot(2,2,3),stem(n,real(x),'filled'); title('复指数序列的实部') subplot(2,2,2),plot(n,imag(x)); title('复指数信号的虚部') subplot(2,2,4),stem(n,imag(x),'filled'); title('复指数序列的虚部') 4、正(余)弦序列 正(余)弦序列的表示式为 0sinmx nUn...