山大matlab实验报告.docxVIP

  • 42
  • 0
  • 约3.8千字
  • 约 18页
  • 2017-05-21 发布于浙江
  • 举报
山大matlab实验报告

MATLAB 实验报告实验一 信号在MATLAB中的表示画出下列信号的波形源程序如下:t = -3:0.00001:3;ft = exp(-2*abs(t));plot(t,ft),grid on%axis([0,0.01,-1.2,1.2])title(y_1 (t)=e^(-2|t|))运行结果如图:(2)源程序如下:n=-10:10;a=0.9;yn=a.^n;stem(n,yn);grid onaxis([-10,10,-1,3])title(y_2 (n)=〖(0.9)〗^n (-10≤n≤10))运行结果如图:(3)源程序如下:n=-10:10;yn=exp(i*pi*(n/3));stem(n,real(yn));grid onaxis([-10,10,-1,1])title((3) y_3 (n)=e^(iπ n/3) (-10≤n≤10) 的实部 )title((3) y_3 (n)=e^(iπ n/3) (-10≤n≤10) 的实部 )运行结果如图:2.使用MATLAB命令,产生频率为1KHZ、占空比为50%的周期方波信号。源程序如下:t = 0:0.000001:0.3;ft = square(2*1000*t,50);plot(t,ft),grid onaxis([0,0.01,-1.2,1.2])title(周期方波信号)运行结果如图:实验2 信号运算的MATLAB实现1.画出下列信号的波形图(1)y1(t)=3t^2+t+5源代码:t=-10:0.01:10;y1 = 3*(t.^2)+ t +5;plot(t,y1),grid ontitle(y1(t)=3t^2+t+5)波形图:(2)y2(t)=t*sin(5*pi*t)*u(t)源代码如下:t=--1:0.0001:5;y2 = t.*sin(5*pi*t).*heaviside(t);plot(t,y2),grid ontitle(y2(t)=t*sin(5*pi*t)*u(t))波形如图:(3)f(t)=exp(-t).*sin(10*pi*t)+exp(-t/2).*sin(9*pi*t)源代码:t=-10:0.0001:-6;ft =exp(-t).*sin(10*pi*t)+exp(-t/2).*sin(9*pi*t);plot(t,ft),grid ontitle(ft =exp(-t).*sin(10*pi*t)+exp(-t/2).*sin(9*pi*t))波形如图:已知f1(t)=sin,f2(t)=sin,使用MATLAB命令绘出f1(t)-f2(t)和f1(t)/f2(t)的波形图,其中f==1HZ.源程序如下:f = 1;t = 0:0.01:3/f;f1 = sin(2*pi*f*t);f2 = sin(2*pi*6*f*t);subplot(211),plot(t,f1-f2),grid on ,title(f1-f2);subplot(212),plot(t,f1./f2),grid on ,title(f1/f2);波形如图:实验三1.已知f(t)=u(t)-u(t-1),h(t)=u(t-1)-u(t-3),求时域卷积积分y(t)=f(t)*h(t)源程序如下:p = 0.01;t1=-1:p:1;f=ones(size(t1));t2=1:p:3;h=ones(size(t2));y=conv(f,h);t0=t1(1)+t2(1);t3=length(f)+length(h)-2;t=t0:p:(t3*p+t0);subplot(221)plot(t1,f)title(f(t))xlabel(t);ylabel(f(t));subplot(222)plot(t2,h)title(h(t))xlabel(t);ylabel(h(t));subplot(223)plot(t,y)g=get(gca,position);g(3)=2.5*g(3);set(gca,position,g)title(y(t)=f(t)*h(t))xlabel(t);ylabel(y(t));波形如图:2.某LTI离散系统,设激励x(n)= (0.5).^n2,系统单位冲激响应h(n)=u(n+9)-u(n-6),试确定系统的零状态响应y(n)=x(n)*h(n)。源码如下:n=-30:30;x1=zeros(1,30);n2=0:30;x2=(0.5).^n2;x=[x1,x2];h=zeros(1,31)h(16-9:16+5)=1;y=conv(x,h);%figure;subplot(211)stem(-15:15,h,rx)subplot(212)stem(-15-3

文档评论(0)

1亿VIP精品文档

相关文档