Matlab_通信系统建模与仿真例题源代码.docx

Matlab_通信系统建模与仿真例题源代码.docx

  1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
% ch2example1prg1.m dt=1e-4; % 仿真采样间隔 T=3*1e-3; % 仿真终止时间 t=0:dt:T; input=2*cos(2*pi*1000*t); % 输入被调信号 carrier=5*cos(2*pi*1e4*t); % 载波 output=(2+0.5*input).*carrier; % 调制输出 % 作图: 观察输入信号, 载波, 以及调制输出 subplot(3,1,1); plot(t,input,LineWidth,3);xlabel(时间 t);ylabel(被调信号); subplot(3,1,2); plot(t,carrier,LineWidth,3);xlabel(时间 t);ylabel(载波); subplot(3,1,3); plot(t,output,LineWidth,3);xlabel(时间 t);ylabel(调幅输出); % ch2example1prg2.m clear; % 清空内存变量,以避免以往运行的结果影响本程序 dt=1e-5; % 仿真采样间隔 T=3*1e-3; % 仿真终止时间 t=0:dt:T; for k=1:length(t) % 基于时间流的仿真计算 input(k)=2*cos(2*pi*1000*t(k)); % 第k个仿真步进时的输入被调信号 carrier(k)=5*cos(2*pi*1e4*t(k)); % 第k个仿真步进时的载波 output(k)=(2+0.5*input(k)).*carrier(k);% 第k个仿真步进时的调制输出 end % 作图: 观察输入信号, 载波, 以及调制输出 subplot(3,1,1); plot(t,input,LineWidth,3);xlabel(时间 t);ylabel(被调信号); subplot(3,1,2); plot(t,carrier,LineWidth,3);xlabel(时间 t);ylabel(载波); subplot(3,1,3); plot(t,output,LineWidth,3);xlabel(时间 t);ylabel(调幅输出); % ch2example1prg3.m dt=1e-6; % 仿真采样间隔 T=2*1e-3; % 仿真的帧周期 for N=0:500 % 总共仿真的帧数 t=N*T+(0:dt:T); % 帧中的取样时刻 input=2*cos(2*pi*1005*t); % 输入被调信号 carrier=5*cos(2*pi*(1e4)*t+0.1*randn); % 载波 output=(2+0.5*input).*carrier; % 调制输出 noise=randn(size(t)); % 噪声 r=output+noise; % 调制信号通过加性噪声信道 % 作图: 观察输入信号, 载波, 以及调制输出 subplot(3,1,1); plot([0:dt:T],input,LineWidth,3);xlabel(时间 t); ylabel(被调信号);text(T*2/3,1.5,[当前帧数: N=,num2str(N)]); subplot(3,1,2); plot([0:dt:T],carrier,LineWidth,3); xlabel(时间 t);ylabel(载波); subplot(3,1,3); plot([0:dt:T],r,LineWidth,3); xlabel(时间 t);ylabel(调幅输出); set(gcf,DoubleBuffer,on); % 双缓冲避免作图闪烁 drawnow; end % ch2example1prg25.m % 采用较低速率仿真,并用样条插值使得结果精细化 simurate=3000; % 较低仿真速率 mysimopts = simset(Solver,ode5); % 设置仿真求解器为ode5的 mysimopts = simset(mysimopts,FixedStep,1./simurate); % 设置仿真步进 timespan=[0, 0.01]; % 仿真时间段参数 sim(ch2example25,times

文档评论(0)

好老师 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档