您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 管理学资料 > 数字信号处理实验一-时域离散信号的产生与基本运算
实验一时域离散信号的产生与基本运算一、实验目的1、了解常用的时域离散信号及其特点;2、掌握Matlab产生常用时域离散信号的方法;3、掌握时域离散信号简单的基本运算方法;二、实验内容1、自己设定参数,分别表示并绘制单位抽样序列、单位阶跃序列、正弦序列、实指数序列、随机序列;2、自己设定参数,分别表示并绘制信号移位、信号相加、信号相乘、信号翻转、信号和、信号积、信号能量。3、已知信号其他040614452)(nnnnx(1)描绘)(nx序列的波形;(2)用延迟的单位脉冲序列及其加权和表示)(nx序列;(3)描绘一下序列的波形)2()(),2(2)(),2(2)(321nxnxnxnxnxnx三、实现步骤1、自己设定参数,分别表示并绘制单位抽样序列、单位阶跃序列、正弦序列、实指数序列、随机序列。输出图形如图1所示。x=zeros(1,10);x(2)=1;subplot(3,2,1);stem(x,'filled')axis([0,10,-0.2,1]);title('单位抽样序列');N=10;u=ones(1,N);subplot(3,2,2);stem(u,'filled')axis([-10,10,0,1]);title('单位阶跃序列');x=-20:1:20;y=sin(0.2*pi.*x+0.5*pi);subplot(3,2,3);stem(x,y,'filled');axis([-20,20,-2,2]);title('正弦序列');n=0:10;a1=1/2;y1=a1.^n;subplot(3,2,4);stem(n,y1,'filled');axis([0,10,0,1]);title('实指数序列,a=1/2');n=0:10;a2=2;y2=a2.^n;subplot(3,2,5);stem(n,y2,'filled');title('实指数序列,a=2');y=rand(1,20);subplot(3,2,6);stem(y,'filled');title('随机序列');图12、自己设定参数,分别表示并绘制信号移位、信号相加、信号相乘、信号翻转、信号和、信号积、信号能量。信号的移位:n=-3:10;k0=3;k1=-3;%实现信号的移位x=cos(2*pi*n/10);x1=cos(2*pi*(n-k0)/10);x2=cos(2*pi*(n-k1)/10);subplot(3,1,1),stem(n,x,'filled');ylabel('x(n)');subplot(3,1,2),stem(n,x1,'filled');ylabel('x(n-2)');subplot(3,1,3),stem(n,x2,'filled');ylabel('x(n+2)');信号的相加相乘:n=-3:20;x1=cos(2*pi*n/10);图2subplot(2,2,1);stem(n,x1,'filled');title('x(1)');axis([-4,20,-2,2]);x2=cos(2*pi*n/10);subplot(2,2,2);stem(n,x2,'filled');title('x(2)');axis([-4,20,-2,2]);y=x1+x2;subplot(2,2,3);stem(n,y,'filled');title('信号相加');axis([-4,20,-2,2]);y=x1.*x2;subplot(2,2,4);stem(n,y,'filled');title('信号相乘');axis([-4,20,-2,2]);图3信号的翻转:n=-5:5;x=exp(-0.4*n);x1=fliplr(x);n1=-fliplr(n);subplot(2,1,1),stem(n,x,'filled');title('x(n)');subplot(2,1,2),stem(n1,x1,'filled');title('x(-n)');%见下图4信号和、信号积、信号能量:x=[1,2,3,4,5,6,7,8,9];%和y1=sum(x)%积y2=prod(x)%能量E1=sum(x.*conj(x))得到:y1=45y2=362880E1=285图43、已知信号其他040614452)(nnnnx(1)描绘)(nx序列的波形;(2)用延迟的单位脉冲序列及其加权和表示)(nx序列;(3)描绘一下序列的波形)2()(),2(2)(),2(2)(321nxnxnxnxnxnxfunctionf=u(t)f=(t=0);subplot(2,1,1)n=-10:10;y1=(2*n+5).*(u(n+4)-u(n))+6.*(u(n)-u(n-5));stem(n,y1,'filled')axis([-10,10,-3,6]);title('序列波形');t=-10:10;subplot(2,1,2)y=(-3)*(u(t+4)-u(t+3))+(-1)*(u(t+3)-u(t+2))+(u(t+2)-u(t+1))+3*(u(t+1)-u(t))+6*(u(t)-u(t-1))+6*(u(t-1)-u(t-2))+6*(u(t-2)-u(t-3))+6*(u(t-3)-u(t-4))+6*(u(t-4)-u(t-5));stem(t,y,'filled')axis([-10,10,-3,6]);title('用单位脉冲序列及其加权和表示序列波形');图5subplot(2,2,1)t=-10:10;y=(-3)*(u(t+4)-u(t+3))+(-1)*(u(t+3)-u(t+2))+(u(t+2)-u(t+1))+3*(u(t+1)-u(t))+6*(u(t)-u(t-1))+6*(u(t-1)-u(t-2))+6*(u(t-2)-u(t-3))+6*(u(t-3)-u(t-4))+6*(u(t-4)-u(t-5));stem(t,y,'filled')axis([-10,10,-6,12]);title('x(n)');subplot(2,2,2)t=-10:10;y=(-3)*(u(t+4)-u(t+3))+(-1)*(u(t+3)-u(t+2))+(u(t+2)-u(t+1))+3*(u(t+1)-u(t))+6*(u(t)-u(t-1))+6*(u(t-1)-u(t-2))+6*(u(t-2)-u(t-3))+6*(u(t-3)-u(t-4))+6*(u(t-4)-u(t-5));stem(t+2,2*y,'filled')axis([-10,10,-6,12]);title('2x(n-2)');subplot(2,2,3)t=-10:10;y=(-3)*(u(t+4)-u(t+3))+(-1)*(u(t+3)-u(t+2))+(u(t+2)-u(t+1))+3*(u(t+1)-u(t))+6*(u(t)-u(t-1))+6*(u(t-1)-u(t-2))+6*(u(t-2)-u(t-3))+6*(u(t-3)-u(t-4))+6*(u(t-4)-u(t-5));stem(t-2,2*y,'filled')axis([-10,10,-6,12]);title('2x(n+2)');subplot(2,2,4)t=-10:10;y=(-3)*(u(t+4)-u(t+3))+(-1)*(u(t+3)-u(t+2))+(u(t+2)-u(t+1))+3*(u(t+1)-u(t))+6*(u(t)-u(t-1))+6*(u(t-1)-u(t-2))+6*(u(t-2)-u(t-3))+6*(u(t-3)-u(t-4))+6*(u(t-4)-u(t-5));stem(2-t,y,'filled')axis([-10,10,-6,12]);title('x(2-n)');图6
本文标题:数字信号处理实验一-时域离散信号的产生与基本运算
链接地址:https://www.777doc.com/doc-6198824 .html