













Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
i made a FM course report, mainly the Chinese version of the content, uprising watch a I ah xa
Typology: Schemes and Mind Maps
1 / 21
This page cannot be seen from the preview
Don't miss anything!














2.学会 Matlab 仿真软件在 AM FM PM 调制和解调中的应用。
t
c
cos
m m
s t A mt t
AM c
( ) [ ()]cos
0
从高频已调信号中恢复出调制信号的过程称为解调(demodulation ),又
称为检波(detection )。对于振幅调制信号,解调(demodulation )就是从它
的幅度变化上提取调制信号的过程。解调(demodulation )是调制的逆过程。
matlab 仿真
t=-1:0.00001:1;
A0=10; %载波信号振幅
f=6000; %载波信号频率
w0=f*pi;
Uc=A0cos(w0t); %载波信号
figure(1);
subplot(2,1,1);
plot(t,Uc);
title('载频信号波形');
axis([0,0.01,-15,15]);
subplot(2,1,2);
Y1=fft(Uc); %对载波信号进行傅里叶变换
plot(abs(Y1));title('载波信号频谱');
axis([5800,6200,0,1000000]);
t
c
cos
m ( t )
s ( t )
AM
0
A
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
0
5
t
调 制 信 号
1.98 1.985 1.99 1.995 2 2.005 2.01 2.015 2.
x 10
5
0
5
10
x 10
5
调 制 信 号 频 谱
调制信号
t=-1:0.00001:1;
A0=10; %载波信号振幅
A1=5; %调制信号振幅
A2=3; %已调信号振幅
f=3000; %载波信号频率
w0=2fpi;
m=0.15; %调制度
mes=A1cos(0.001w0*t); %消调制信号
Uam=A2(1+mmes).cos((w0).t); %AM 已调信号
subplot(2,1,1);
plot(t,Uam);
grid on;
title('AM 调制信号波形');
subplot(2,1,2);
Y3=fft(Uam); % 对 AM 已调信号进行傅里叶变换
plot(abs(Y3)),grid;
title('AM 调制信号频谱');
axis([5950,6050,0,500000]);
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
0
5
10
AM调 制 信 号 波 形
5950 5960 5970 5980 5990 6000 6010 6020 6030 6040 6050
0
1
2
3
4
5
x 10
5
AM调 制 信 号 频 谱
AM 已调信号
Ft=2000; %采样频率
fpts=[100 120]; %通带边界频率 fp=100Hz,阻带截止频率 fs=120Hz
mag=[1 0];
dev=[0.01 0.05]; %通带波动 1%,阻带波动 5%
[n21,wn21,beta,ftype]=kaiserord(fpts,mag,dev,Ft);%kaiserord 估计采用凯塞窗设计的 FIR
滤 波器的参数
b21=fir1(n21,wn21,Kaiser(n21+1,beta)); %由 fir1 设计滤波器
[h,w]=freqz(b21,1); %得到频率响应
plot(w/pi,abs(h));
grid on
t=-1:0.00001:1;
A0=10; %载波信号振幅
A1=5; %调制信号振幅
A2=3; %已调信号振幅
f=3000; %载波信号频率
w0=2fpi;
m=0.15; %调制度
k=0.5 ; %DSB 前面的系数
mes=A1cos(0.001w0*t); %调制信号
Uam=A2(1+mmes).cos((w0).t); %AM 已调信号
Dam=Uam.cos(w0t); %对 AM 调制信号进行解调
axis([0,0.01,-15,15]);
T1=fft(Uc); %傅里叶变换
subplot(5,2,2);
plot(abs(T1));
title('载波信号频谱');
axis([5800,6200,0,1000000]);
mes=A1cos(0.001w0*t); %调制信号
subplot(5,2,3);
plot(t,mes);
title('调制信号');
T2=fft(mes);
subplot(5,2,4);
plot(abs(T 2 ));
title('调制信号频谱');
axis([19 8 000, 202 000,0, 2 000000]);
Uam=A2(1+mmes).cos((w0).t); %AM 已调信号 *****************
subplot(5,2,5);
plot(t,Uam);
title('已调信号');
T3=fft(Uam);
subplot(5,2,6);
plot(abs(T3));
title('已调信号频谱');
axis([5950,6050,0,500000]);
Dam=Uam.cos(w0t); %对 AM 已调信号进行解调
subplot(5,2,7);
plot(t,Dam);
title('滤波前的 AM 解调信号波形');
T4=fft(Dam); %求 AM 信号的频谱
subplot(5,2,8);
plot(abs(T4));
title('滤波前的 AM 解调信号频谱');
axis([187960,188040,0,200000]);
z21=fftfilt(b21,Dam); %FIR 低通滤波
subplot(5,2,9);
plot(t,z21,'r');
title('滤波后的 AM 解调信号波形');
T5=fft(z21); %求 AM 信号的频谱
subplot(5,2,10);
plot(abs(T5),'r');
title('滤波后的 AM 解调信号频谱');
axis([198000,202000,0,200000]);
2 . FM 调制解调系统设计
通信系统一般模型
信息源 发送设备 信 道 接受设备 信息源
噪声源
dt=0.001; %设定时间步长
t=0:dt:1.5; %产生时间向量
am=15; % 设定调制信号幅度← 可更改
fm=15; % 设定调制信号频率← 可更改
mt=amcos(2pifmt); %生成调制信号
fc=50; % 设定载波频率← 可更改
ct=cos(2pifc*t); %生成载波
kf=10; %设定调频指数
int_mt(1)=0; %对 mt 进行积分
for i=1:length(t)-
int_mt(i+1)=int_mt(i)+mt(i)*dt;
end
sfm=amcos(2pifct+2pikf*int_mt); %调制,产生已调信号
0 0.5 1 1.
0
10
时 间 t
调 制 信 号 的 时 域 图
0 0.5 1 1.
0
1
时 间 t
载 波 的 时 域 图
0 0.5 1 1.
0
10
时 间 t
已 调 信 号 的 时 域 图
图 3 FM 调制
2.3 FM 解调模型的建立
图 4 FM 解调模型
2.4 解调过程分析
for i=1:length(t)-1 %接受信号通过微分器处理
diff_nsfm(i)=(nsfm(i+1)-nsfm(i))./dt;
for i=1:length(t)-
int_mt(i+1)=int_mt(i)+mt(i)*dt; %求信号 m(t)的积分
end %调制,产生已调信号
sfm=amcos(2pifct+2pikf*int_mt); %调制信号
%****************FM 解调*******************
for i=1:length(t)-1 %接受信号通过微分器处理
diff_nsfm(i)=(nsfm(i+1)-nsfm(i))./dt;
end
diff_nsfmn = abs(hilbert(diff_nsfm)); %hilbert 变换,求绝对值得到瞬时幅度(包络检波)
zero=(max(diff_nsfmn)-min(diff_nsfmn))/2;
diff_nsfmn1=diff_nsfmn-zero;
%*****************************************
%···············*·
%**************时域到频域转换**************
ts=0.001; %抽样间隔
fs=1/ts; %抽样频率
df=0.25; %所需的频率分辨率,用在求傅里叶变换
%时,它表示 FFT 的最小频率间隔
%*****对调制信号 m(t)求傅里叶变换*****
m=amcos(2pifmt); %原调信号
fs=1/ts;
if nargin==
n1=0;
else
n1=fs/df;
end
n2=length(m);
n=2^(max(nextpow2(n1),nextpow2(n2)));
M=fft(m,n);
m=[m,zeros(1,n-n2)];
df1=fs/n; %以上程序是对调制后的信号 u 求傅里变换
M=M/fs; %缩放,便于在频铺图上整体观察
f=[0:df1:df1*(length(m)-1)]-fs/2; %时间向量对应的频率向量
%************对已调信号 u 求傅里变换**********
fs=1/ts;
if nargin==
n1=0;
else
n1=fs/df;
end
n2=length(sfm);
n=2^(max(nextpow2(n1),nextpow2(n2)));
U=fft(sfm,n);
u=[sfm,zeros(1,n-n2)];
df1=fs/n; %以上是对已调信号 u 求傅里变换
U=U/fs; %缩放
%******************************************
%*****************************************
%···············*·
%***************显示程序******************
disp('按任意键可以看到原调制信号、载波信号和已调信号的曲线')
pause
%**************figure(1)******************
figure(1)
subplot(3,1,1);plot(t,mt); %绘制调制信号的时域图
xlabel('时间 t');
title('调制信号的时域图');
subplot(3,1,2);plot(t,ct); %绘制载波的时域图
xlabel('时间 t');
title('载波的时域图');
subplot(3,1,3);
plot(t,sfm); %绘制已调信号的时域图
xlabel('时间 t');
title('已调信号的时域图');
%******************************************
disp('按任意键可以看到原调制信号和已调信号在频域内的图形')
pause
%************figure(2)*********************
figure(2)
subplot(2,1,1)
plot(f,abs(fftshift(M))) %fftshift:将 FFT 中的 DC 分量移到频谱中心
xlabel('频率 f')
title('原调制信号的频谱图')
subplot(2,1,2)
plot(f,abs(fftshift(U)))
xlabel('频率 f')
title('已调信号的频谱图')
%******************************************
disp('按任意键可以看到原调制信号、无噪声条件下已调信号和解调信号的曲线')
pause
%**************figure(3)******************
figure(3)
subplot(3,1,1);plot(t,mt); %绘制调制信号的时域图
xlabel('时间 t');
title('调制信号的时域图');
subplot(3,1,2);plot(t,sfm); %绘制已调信号的时域图
xlabel('时间 t');
xlabel('时间 t');
title('调制信号的时域图');
db1=am^2/(2*(10^(sn2/10))); %计算对应的大信噪比高斯白躁声的方差
n1=sqrt(db1)*randn(size(t)); %生成高斯白躁声
nsfm1=n1+sfm; %生成含高斯白躁声的已调信号(信号通过信道传输)
for i=1:length(t)-1 %接受信号通过微分器处理
diff_nsfm1(i)=(nsfm1(i+1)-nsfm1(i))./dt;
end
diff_nsfmn1 = abs(hilbert(diff_nsfm1)); %hilbert 变换,求绝对值得到瞬时幅度(包
%络检波)
zero=(max(diff_nsfmn)-min(diff_nsfmn))/2;
diff_nsfmn1=diff_nsfmn1-zero;
subplot(3,1,2);
plot(1:length(diff_nsfm1),diff_nsfm1); %绘制含大信噪比高斯白噪声已调信号
%的时域图
xlabel('时间 t');
title('含大信噪比高斯白噪声已调信号的时域图');
subplot(3,1,3); %绘制含大信噪比高斯白噪声解调信号
%的时域图
plot((1:length(diff_nsfmn1))./1000,diff_nsfmn1./400,'r');
xlabel('时间 t');
title('含大信噪比高斯白噪声解调信号的时域图');
3 PM 调制原理
S (t)=Acos[ω t+φ(t)]
式中,A 是载波的恒定振幅;[ω t+φ(t)]是信号的瞬时相位,而 φ(t)称为瞬
时相位偏移;d[ω t+φ(t)]/dt 为信号的瞬时频率,而 dφ(t)/dt 称为瞬时频率偏移
即相对于 ω 的瞬时频率偏移。
设高频载波为 u =U cosω t,调制信号为 UΩ(t),则调相信号的瞬时相位
φ(t)=ω +K UΩ(t)
瞬时角频率 ω(t)= =ω +K
调相信号 u =U cos[ω t+K uΩ(t)]
S (t)=Acos[ω t+K f(t)+φ ]
时相位偏移是调制信号 f(t)的线性函数,称为相位调制。
ω= =ω +K f(t)
φ(t)= ω t+K
PM 调相信号的产生
实现相位调制的基本原理是使角频率为 ω 的高频载波 u (t)通过一个可控
相移网络, 此网络产生的相移 Δφ 受调制电压 uΩ(t)控制, 满足 Δφ=K uΩ(t)的关
x1=z.exp(-j2pif0*t); %产生信号z的正交分量,
%并将z信号与它的正交分量加在一起
t0=0.2; %信号的持续时间,用来定义时间向量
ts=0.001; %抽样间隔
fs=1/ts; %抽样频率
fc=300; %载波频率,fc可以任意改变
t=[-t0/2:ts:t0/2]; %时间向量
kf=100; %偏差常数
df=0.25; %所需的频率分辨率,用在求傅里叶变换时,它表示FFT
m=sin(100*t); %调制信号,m(t)可以任意更改
int_m(1)=0; %求信号m(t)的积分
for i=1:length(t)-
int_m(i+1)=int_m(i)+m(i)*ts;
end
[M,m,df1]=fftseq(m,ts,df); %对调制信号m(t)求傅里叶变换
M=M/fs; %缩放,便于在频谱图上整体观察
f=[0:df1:df1*(length(m)-1)]-fs/2; %时间向量对应的频率向量
u=cos(2pifct+2pikfint_m); %调制后的信号
[U,u,df1]=fftseq(u,ts,df); %对调制后的信号u求傅里叶变换
U=U/fs; %缩放
%通过调用子程序env_phas和loweq来实现解调功能
[v,phase]=env_phas(u,ts,fc); %解调,求出u的相位
phi=unwrap(phase); %校正相位角,使相位在整体上连续,便于后面对该
dem=(1/(2pikf))(diff(phi)fs); %对校正后的相位求导
%乘以fs是为了恢复原信号,因为前面使用了缩放
subplot(3,2,1) %子图形式显示结果
plot(t,m(1:length(t))) %现在的m信号是重新构建的信号,
%因为在对m求傅里叶变换时m=[m,zeros(1,n-n2)]
axis([-0.1 0.1 -1 1]) %定义两轴的刻度
xlabel('时间t')
title('原调制信号的时域图')
subplot(3,2,2)
plot(t,u(1:length(t)))
axis([-0.1 0.1 -1 1])
xlabel('时间t')
title('已调信号的时域图')
subplot(3,2,3)
plot(f,abs(fftshift(M))) %fftshift:将FFT中的DC分量移到频谱中心
axis([-600 600 0 0.04])
xlabel('频率f')
title('原调制信号的频谱图')
subplot(3,2,4)
plot(f,abs(fftshift(U)))
axis([-600 600 0 0.04])
xlabel('频率f')
title('已调信号的频谱图')
subplot(3,2,5)
plot(t,m(1:length(t)))
axis([-0.1 0.1 -1 1])
xlabel('时间t')
title('原调制信号的时域图')
subplot(3,2,6)
plot(t,dem(1:length(t)))
axis([-0.1 0.1 -1 1])
xlabel('时间t')