MATLAB通信仿真实例1:无噪声信道下DSB-SC调制解调器

  DSB-SC调制解调器模型如图1所示。若 m ( t ) = cos ⁡ ( 2 π f m t ) m(t)=\cos(2\pi f_mt) m(t)=cos(2πfmt) f m = 10 f_m=10 fm=10Hz, c ( t ) = cos ⁡ ( 2 π f c t ) c(t)=\cos(2\pi f_ct) c(t)=cos(2πfct) f c = 100 f_c=100 fc=100Hz。
(1)写出 s ( t ) s(t) s(t)的波形以及频谱表达式 S ( f ) S(f) S(f),分别画出 s ( t ) s(t) s(t) S ( f ) S(f) S(f)的示意图。
(2)写出 s d ( t ) s_d(t) sd(t)的波形以及频谱表达式 S d ( f ) S_d(f) Sd(f),分别画出 s d ( t ) s_d(t) sd(t) S d ( f ) S_d(f) Sd(f)的示意图。
(3)若解调器中 h ( t ) h(t) h(t)为低通解调器,其作用是使得 m o ( t ) = m ( t ) m_o(t)=m(t) mo(t)=m(t),请设计理想低通滤波器 h ( t ) h(t) h(t),写出 h ( t ) h(t) h(t) H ( f ) H(f) H(f) m o ( t ) m_o(t) mo(t) M o ( f ) M_o(f) Mo(f)的表达式并画出示意图。(这里可以不用考虑幅度的改变)
(4)用Matlab或者Python实现(3)中低通滤波器 h ( t ) h(t) h(t)的设计,给出滤波器的设计参数以及冲激响应和幅频特性。
(5)用Matlab仿真实现图中的调制器与解调器,观察并记录 m ( t ) m(t) m(t) ∣ M ( f ) ∣ |M(f)| M(f) s ( t ) s(t) s(t) ∣ S ( f ) ∣ |S(f)| S(f) s d ( t ) s_d(t) sd(t) ∣ S d ( f ) ∣ |S_d(f)| Sd(f) m o ( t ) m_o(t) mo(t) ∣ M o ( f ) ∣ |M_o(f)| Mo(f)的图形。

在这里插入图片描述

图1 DSB-SC调制解调器模型

【参考答案】

(1) s ( t ) = m ( t ) c ( t ) = cos ⁡ 20 π t cos ⁡ 200 π t S ( f ) = 1 4 [ δ ( f − 110 ) + δ ( f − 90 ) + δ ( f + 110 ) + δ ( f + 90 ) ] \begin{aligned} s(t)&=m(t)c(t)=\cos 20\pi t\cos200\pi t\\ S(f)&=\frac{1}{4}{\Large [}\delta(f-110)+\delta(f-90)+\delta(f+110)+\delta(f+90){\Large ]} \end{aligned} s(t)S(f)=m(t)c(t)=cos20πtcos200πt=41[δ(f110)+δ(f90)+δ(f+110)+δ(f+90)]
(2)
s d ( t ) = s ( t ) cos ⁡ 2 π f c t = m ( t ) cos ⁡ 2 2 π f c t = 1 2 m ( t ) + 1 2 m ( t ) cos ⁡ 4 π f c t = 1 2 cos ⁡ 20 π t + 1 2 cos ⁡ 20 π t ⋅ cos ⁡ 400 π t S d ( f ) = 1 4 [ δ ( f − 10 ) + δ ( f + 10 ) ] + 1 8 [ δ ( f − 210 ) + δ ( f − 190 ) + δ ( f + 210 ) + δ ( f + 190 ) ] \begin{aligned} s_d(t)&=s(t)\cos2\pi f_ct=m(t)\cos^2 2\pi f_ct\\ &=\frac{1}{2}m(t)+\frac{1}{2}m(t)\cos4\pi f_ct\\ &=\frac{1}{2}\cos20\pi t+\frac{1}{2}\cos20\pi t\cdot \cos 400\pi t\\ S_d(f)&=\frac{1}{4}{\Large [}\delta(f-10)+\delta(f+10){\Large ]}+\frac{1}{8}{\Large [}\delta(f-210)+\delta(f-190)+\delta(f+210)+\delta(f+190){\Large ]} \end{aligned} sd(t)Sd(f)=s(t)cos2πfct=m(t)cos22πfct=21m(t)+21m(t)cos4πfct=21cos20πt+21cos20πtcos400πt=41[δ(f10)+δ(f+10)]+81[δ(f210)+δ(f190)+δ(f+210)+δ(f+190)]
(3)
H ( f ) = R e c t ( f 2 f H ) h ( t ) = F − 1 [ H ( f ) ] = 2 f H S a ( 2 π f H t ) \begin{aligned} H(f)&={\rm Rect}{\Large (}\frac{f}{2f_H}{\Large )}\\ h(t)&={\mathcal F}^{-1}[H(f)]=2f_H{\rm Sa}(2\pi f_Ht) \end{aligned} H(f)h(t)=Rect(2fHf)=F1[H(f)]=2fHSa(2πfHt)这里的 f H f_H fH为滤波器的上截止频率。尽管只要 f m ≤ f H ≤ 2 f c − f m f_m\le f_H\le 2f_c-f_m fmfH2fcfm就可以将低通信号恢复出来,但我们还是希望 f H f_H fH尽量小。请思考这是为什么呢?事实上,这是考虑到滤波器对噪声的影响,在AWGN信道仿真部分我们再来看这个问题。
M o ( f ) = S d ( f ) H ( f ) = 1 4 [ δ ( f − 10 ) + δ ( f + 10 ) ] m o ( t ) = s d ( t ) ∗ h ( t ) = 1 2 cos ⁡ 20 π t \begin{aligned} M_o(f)&=S_d(f)H(f)=\frac{1}{4}{\Large [}\delta(f-10)+\delta(f+10){\Large ]}\\ m_o(t)&=s_d(t)*h(t)=\frac{1}{2}\cos20\pi t \end{aligned} Mo(f)mo(t)=Sd(f)H(f)=41[δ(f10)+δ(f+10)]=sd(t)h(t)=21cos20πt

下面我们来看如何实现仿真。代码如下,详见代码注释。各点波形以及频谱分别如图2、图3所示。


%------------------
%系统参数设置
%-----------------
T_start=0;%开始时间
T_stop=1;%截止时间
T=T_stop-T_start;%仿真持续时间
T_sample=1/1000;%采样间隔
f_sample=1/T_sample; % 采样速率
N_sample=T/T_sample;% 采样点数

%-----------------
%波形
%-----------------
n=0:N_sample-1;
f_m=10;
f_c=100;
%__________________________
%调制器各点波形
%—————————————
m=cos(2*pi*f_m*n*T_sample);%m(t)
c=cos(2*pi*f_c*n*T_sample);%c(t)
s=m.*c;%s(t)=m(t)c(t)
%-----------------
%解调器
%-----------------
c1=cos(2*pi*f_c*n*T_sample);%接收机端载波
s_d=s.*c1;%sd(t)=s(t)c1(t)
h=MyLowpass;%fdatool设计h(t)
m_o=conv(s_d,h);%mo(t)=sd(t)*h(t);
mm_o=m_o(length(h)/2:length(h)/2+N_sample-1);%将通过滤波器之后产生的延迟去掉
%-----------------
%绘制各点波形
%-----------------
figure(1)
subplot(3,2,1)
plot(n*T_sample,m);
subplot(3,2,2)
plot(n*T_sample,c);
subplot(3,2,3)
plot(n*T_sample,s);
subplot(3,2,4)
plot(n*T_sample,s_d);
subplot(3,2,5)
nn=0:length(m_o)-1;
plot(nn*T_sample,m_o)
subplot(3,2,6)
plot(n*T_sample,mm_o)
%----------------------------------------------------------------

%-------------------------
%频谱
%-------------------------

%-------------------------
%调制器各点频谱
%-------------------------
MM=abs(fft(m))/N_sample;%M(f)
M(1:N_sample/2)=MM(N_sample/2+1:N_sample);
M(N_sample/2+1:N_sample)=MM(1:N_sample/2);
CC=abs(fft(c))/N_sample;%C(f)
C(1:N_sample/2)=CC(N_sample/2+1:N_sample);
C(N_sample/2+1:N_sample)=CC(1:N_sample/2);
SS=abs(fft(s))/N_sample;%S(f)
S(1:N_sample/2)=SS(N_sample/2+1:N_sample);
S(N_sample/2+1:N_sample)=SS(1:N_sample/2);

%-------------------------
%解调器各点频谱
%-------------------------
SS_d=abs(fft(s_d))/N_sample;%Sd(f)
S_d(1:N_sample/2)=SS_d(N_sample/2+1:N_sample);
S_d(N_sample/2+1:N_sample)=SS_d(1:N_sample/2);
MM_o=abs(fft(mm_o))/NN_sample;%Mo(f)
M_o(1:N_sample/2)=MM_o(N_sample/2+1:N_sample);
M_o(N_sample/2+1:N_sample)=MM_o(1:N_sample/2);


%-------------------------
%绘制各点频谱
%-------------------------
figure(2)
subplot(3,2,1)
plot((n-N_sample/2)/N_sample*f_sample,M);
subplot(3,2,2)
plot((n-N_sample/2)/N_sample*f_sample,C);
subplot(3,2,3)
plot((n-N_sample/2)/N_sample*f_sample,S);
subplot(3,2,4)
plot((n-N_sample/2)/N_sample*f_sample,S_d);
subplot(3,2,5)
plot((n-N_sample/2)/N_sample*f_sample,M_o);

在这里插入图片描述

图2 DSB-SC调制解调器各点波形

在这里插入图片描述

图3 DSB-SC调制解调器各点频谱

  注意这里低通滤波器的上截止频率 f H = 20 f_H=20 fH=20Hz,在fdatool中的设计参数如图4所示。滤波器设计过程详见博文《现代通信原理A.2:FIR低通滤波器设计》。

在这里插入图片描述

图4 fdatool中低通滤波器设计界面

猜你喜欢

转载自blog.csdn.net/tanghonghanhaoli/article/details/100541035
今日推荐