ch2example1prg2.m
来自「一些有用的MATLAB通信信号处理的源代码程序」· M 代码 · 共 14 行
M
14 行
% 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);xlabel('时间 t');ylabel('被调信号');
subplot(3,1,2); plot(t,carrier);xlabel('时间 t');ylabel('载波');
subplot(3,1,3); plot(t,output);xlabel('时间 t');ylabel('调幅输出');
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?