您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 管理学资料 > matlab-连续信号的时域分析
实验一:连续信号的时域分析1.连续信号的波形表示(单边指数信号、正弦信号、复指数信号、Sinc函数、单位阶跃信号、单位冲击信号)新建M-File:u.mfunctiony=u(t)y=(t0);endat=linspace(0,3,1000);y=exp(-t).*cos(10*pi*t).*[u(t-1)-u(t-2)];plot(t,y,'r');gridon;xlabel('t'),ylabel('f(t)')bt=linspace(-5*pi,5*pi,1000);Sa=sin(t)./t;plot(t,Sa);gridon;xlabel('t'),ylabel('Sa(t)')ct=linspace(0,3,1000);y=exp(1-t).*[u(t-1)-u(t-2)];plot(t,y);gridon;xlabel('t'),ylabel('y')t=linspace(-5,5,1000);y=sin(3*t-5)./(3*t-5);plot(t,y);gridon;xlabel('t'),ylabel('y')axis([-2,5,-0.4,1.5]);dt=linspace(-3,7,1000);y=0.5*[sign(t-2)+1];plot(t,y);gridon;xlabel('t'),ylabel('y')axis([-3,7,-1,2]);et=linspace(-3,5,1000);y=2*[u(t-1)-u(t-1.5)];plot(t,y,'r');gridon;axis([-3,5,-0.5,3]);ft=linspace(0,10,1000);y=exp((0.5+j*10)*t);subplot(1,2,1),plot(t,real(y)),gridon;xlabel('t'),ylabel('real(y)');subplot(1,2,2),plot(t,imag(y)),gridon;xlabel('t'),ylabel('imag(y)');2.信号的基本运算(相加、相乘、反折、移位、尺度变换)t=linspace(-3,3,1000);a=2;y=sin(a*t)+sin(8*a*t);plot(t,y,'r');gridon;axis([-3,3,-3,3]);t=linspace(-3,3,1000);a=2;y=sin(a*t).*sin(8*a*t);plot(t,y,'r');gridon;axis([-3,3,-3,3]);新建M-File:f.mfunctiony=f(x)y=u(x+2)-u(x)+(1-x).*[u(x)-u(x-1)];x=linspace(-3,3,1000);subplot(2,2,1),plot(x,f(x)),gridon;xlabel('x'),ylabel('f(x)');axis([-3,3,-0.5,1.5]);subplot(2,2,2),plot(x,f(x-2)),gridon;xlabel('x'),ylabel('f(x-2)');axis([-3,3,-0.5,1.5]);subplot(2,2,3),plot(x,f(3*x-2)),gridon;xlabel('x'),ylabel('f(3x-2)');axis([-3,3,-0.5,1.5]);subplot(2,2,4),plot(x,f(-3*x-2)),gridon;xlabel('x'),ylabel('f(-3x-2)');axis([-3,3,-0.5,1.5]);3.信号的奇偶分解新建M-File:g.mfunctiony=g(x)y=cos(0.5*pi*x).*[u(x+1)-u(x-1)]-cos(0.5*pi*x).*[u(x-1)-u(x-3)];x=linspace(-3,3,1000);subplot(3,1,1),plot(x,g(x)),gridon;xlabel('x'),ylabel('g(x)');axis([-3,3,-0.5,1.5]);subplot(3,1,2),plot(x,0.5*[g(x)+g(-x)]),gridon;xlabel('x'),ylabel('ge(x)');axis([-3,3,-0.5,1.5]);subplot(3,1,3),plot(x,0.5*[g(x)-g(-x)]),gridon;xlabel('x'),ylabel('go(x)');axis([-3,3,-0.5,1.5]);新建M-File:h.mfunctiony=h(x)y=(1-x).*[u(x)-u(x-2)];x=linspace(-2,2,1000);subplot(3,1,1),plot(x,h(x)),gridon;xlabel('x'),ylabel('h(x)');axis([-2,2,-1.5,1.5]);subplot(3,1,2),plot(x,0.5*[h(x)+h(-x)]),gridon;xlabel('x'),ylabel('he(x)');axis([-2,2,-1.5,1.5]);subplot(3,1,3),plot(x,0.5*[h(x)-h(-x)]),gridon;xlabel('x'),ylabel('ho(x)');axis([-2,2,-1.5,1.5]);
本文标题:matlab-连续信号的时域分析
链接地址:https://www.777doc.com/doc-4668017 .html