1 / 8
文档名称:

简单的matlab信号仿真.pdf

格式:pdf   大小:561KB   页数:8页
下载后只包含 1 个 PDF 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

简单的matlab信号仿真.pdf

上传人:青山代下 2024/7/2 文件大小:561 KB

下载得到文件列表

简单的matlab信号仿真.pdf

相关文档

文档介绍

文档介绍:该【简单的matlab信号仿真 】是由【青山代下】上传分享,文档一共【8】页,该文档可以免费在线阅读,需要了解更多关于【简单的matlab信号仿真 】的内容,可以使用淘豆网的站内搜索功能,选择自己适合的文档,以下文字是截取该文章内的部分文字,如需要获得完整电子版,请下载此文档到您的设备,方便您编辑和打印。实验1连续时间信号和离散信号的实现实验内容与方法一、验证性试验1、生成直流信号f(t)=6MATLAB程序代码:t=-10::10;a1=6;subplot(3,3,1)plot(t,a1,'b');title('直流信号');xlabel('时间(t)');ylabel('幅值(f)')2、生成正弦交流信号f(t)=sin(wt+φ)MATLAB程序代码:t=0::1;f=sym('sin(2*pi*t)');subplot(3,3,2)ezplot(f,[0,1]);title('正弦交流信号');xlabel('时间(t)');ylabel('幅值(f)')3、生成单位阶跃信号f(t)=ε(t)MATLAB程序代码:t0=0;t1=-1;t2=3;dt=;t=t1:dt:-t0;n=length(t);t3=-t0:dt:t2;n3=length(t3);u=zeros(1,n);u3=ones(1,n3);subplot(3,3,3)plot(t,u);holdon;plot(t3,u3);plot([-t0,-t0],[0,1]);holdoff;axis([t1,t2,-,]);xlabel('时间(t)');ylabel('幅值(f)');title('单位阶跃信号')4、生成单位冲激信号f(t)=δ(t)MATLAB程序代码:t0=0;t1=-1;t2=5;dt=;t=t1:dt:t2;n=length(t);x=zeros(1,n);x(1,(t0-t1)/dt+1)=1/dt;subplot(3,3,4)stairs(t,x);axis([t1,t2,0,1/dt]);xlabel('时间(t)');ylabel('幅值(f)');title('单位冲激信号')5、生成周期方波信号MATLAB程序代码:t=(0::1);y=square(2*pi*15*t);subplot(3,3,5)plot(t,y);axis([0,1,-,]);xlabel('时间(t)');ylabel('幅值(f)');title('周期方波信号')6、生成三角波信号MATLAB程序代码:t=(-3::5);y=tripuls(t,4,);subplot(3,3,6)plot(t,y);xlabel('时间(t)');ylabel('幅值(f)');title('三角波信号')7、生成正弦序列信号MATLAB程序代码:k1=-20;k2=20;k=k1:k2;f=sin(k*pi/6);subplot(3,3,7)stem(k,f,'filled');xlabel('时间(t)');ylabel('幅值(f)');title('正弦序列')8、生成单位斜波序列信号MATLAB程序代码:k1=-20;k2=20;k0=0;n=[k1:k2];ifk0>=k2x=zeros(1,length(n));elseif(k0<k2)&(k0>k1)x=[zeros(1,k0-k1),[0:k2-k0]];elsex=(k1-k0)+[0:k2-k1];endsubplot(3,3,8)stem(n,x);xlabel('时间(t)');ylabel('幅值(f)');title('单位斜波序列')9、生成幅值调制序列信号MATLAB程序代码:n=0:100;m=;fH=;fL=;xH=sin(2*pi*fH*n);xL=sin(2*pi*fL*n);y=(1+m*xL).*xH;subplot(3,3,9)stem(n,y);grid;xlabel('时间(k)');ylabel('幅值f(k)');title('幅值调制序列')10、生成复指数信号y(t)=e^(-at+bjt)MATLAB程序代码:t=0::3;a=-3;b=4;z=exp((a+i*b)*t);subplot(2,2,1);plot(t,real(z)),title('实部'):xlabel('时间(t)');ylabel('幅值(f)');subplot(2,2,2);plot(t,imag(z)),title('虚部'):xlabel('时间(t)');ylabel('幅值');subplot(2,2,3);plot(t,abs(z)),title('模'):xlabel('时间(t)');ylabel('幅值');subplot(2,2,4);plot(t,real(z)),title('相角'):xlabel('时间(t)');ylabel('幅值')二、程序设计实验①a=3;x=-10::10;y=(1-2*abs(x))/a;subplot(3,3,1)plot(x,y,'b')axis([-12,12,-10,5]);xlabel('x');ylabel('y');title('(1-2*abs(x))/a')②t=0::6*pi;f=sym('cos(3*t)+sin(2*t)');subplot(3,3,2)ezplot(f,[0,6*pi]);title('信号');xlabel('时间(t)');ylabel('幅值(f)')③t0=-5;t1=-10;t2=5;dt=;t=t1:dt:t0;n=length(t);t3=t0:dt:t2;n3=length(t3);u=zeros(1,n);u3=ones(1,n3);subplot(3,3,3)plot(t,u);holdon;plot(t3,u3);plot([t0,t0],[0,1]);holdoff;axis([t1,t2,-,]);xlabel('时间(t)');ylabel('幅值(f)');title('u(t+5)')④k1=-20;k2=20;k=k1:k2;f=cos(5*k)+sin(4*k);subplot(3,3,7)stem(k,f,'filled');xlabel('时间(k)');ylabel('幅值f(k)');title('信号4')⑤x=0::3;z=5*exp(-x);subplot(2,2,1);plot(x,real(z)),title('信号5'):xlabel('时间(x)');ylabel('幅值(f)')⑥k0=0;k1=-1;k2=10;dk=1;k=k1:dk:k2;n=length(k);x=zeros(1,n);x(1,(k0-k1)/dk+1)=1/dk;subplot(3,3,4)stairs(k+5,x);axis([k1,k2,0,1/dk]);xlabel('时间(k)');ylabel('幅值(f)');title('信号6')⑦t0=-5;t1=-6;t2=0;t=t1:t0-1;n=length(t);t3=t0:t2;n3=length(t3);u=zeros(1,n);u3=ones(1,n3);subplot(3,3,7)stem(t,u,'filled');holdon;stem(t3,u3,'filled');holdoff;axis([t1,t2,-,]);xlabel('时间(t)');ylabel('幅值(f)');title('信号7');