列举一个利用MATLAB进行仿真的案例,利用MATLAB仿真模拟调制系统

% 标准调幅AM调制

a0=2;f0=10;fc=50;snr=3; fs=1000; % 变量定义

t=[-50:0.001:50];

am1=cos(2*pi*f0*t); % 产生信号频率为f0的基带信号

am=a0+am1; % 产生AM信号

c_am=cos(2*pi*fc*t); % 产生频率为fc的载波

AM_mod=am.*c_am; % 产生调制信号

am_f=fft(am); % AM频域

AM_modf=fft(AM_mod);

y=awgn(AM_mod,snr); % 叠加噪声

figure(1); hold on;

subplot(2,2,1); plot(t,am1); axis([0 0.4 -2 2]); title('基带信号波形'); % 绘图subplot(2,2,2); plot(t,am); axis([0 0.4 -2 6]); title('AM信号波形');

subplot(2,2,3); plot(t,c_am); axis([0 0.4 -2 2]); title('载波信号波形'); subplot(2,2,4); plot(t,AM_mod); axis([0 0.4 -8 8]); title('已调信号波形'); hold off;

figure(2); hold on;

subplot(2,2,1); plot(t,AM_mod); axis([0 0.4 -8 8]); title('已调信号波形'); subplot(2,2,2); plot(t,y); axis([0 0.4 -8 8]); title('叠加噪声后的信号波形');; a=[35,65];b=[30,70];

Wp=a/(fs/2);Ws=b/(fs/2);Rp=3; Rs=15;

[N,Wn]= Buttord(Wp,Ws,Rp,Rs) ; % 计算巴特沃斯数字滤波器的阶数和

3db截止频率

[B,A]=Butter(N,Wn,'bandpass'); % 计算巴特沃斯模拟滤波器系统函数的分子、分母多项式系数向量

sig_bandpass=filtfilt(B,A,y); % 带通滤波后信号

subplot(2,2,3); plot(t,sig_bandpass); axis([0 0.4 -8 8]); title('经带通滤波后信号波形');

hold off;

AM_dem=sig_bandpass.*c_am;

Wp=15/(fs/2);Ws=40/(fs/2);Rp=3; Rs=20;

[N,Wn]= Buttord(Wp,Ws,Rp,Rs) ; % 同上

[B,A]=Butter(N,Wn,'low');

AM_demod=filtfilt(B,A,AM_dem) % 低通滤波后信号

AM_demodf=fft(AM_demod);

subplot(2,2,4); plot(t,AM_demod); axis([0 0.4 0 2]); title('解调信号波形'); hold off;

f=(0:100000)*fs/100001-fs/2;

figure(3); hold on;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值