原博客地址:数字信号处理基础----FM的调制与解调(1)_fm解调-优快云博客
在学习FM调制解调过程中,采用上面博主介绍的方法并编写了相关的MATLAB程序进行了实现。
只是完全按照公式进行了实现,在整个实现过程中对求解调频灵敏度和该博主介绍的工程应用最大频偏求解最大角频偏和FPGA中求解DDS最大频率控制字的等方面还没有涉及。我是初学者,对此还尚不是很清楚。
在最后求解m(n)序列时使用了该博主介绍的公式进行了运算,代码如下:
% 规避反正切运算
m_t = zeros(1,length(Q_filtered));% 创建同样长度的最终解调结果信号
m_t(1) = 0;
for i = 2:length(Q_filtered)
m_t(i) = (I_filtered(i-1)*Q_filtered(i)-I_filtered(i)*Q_filtered(i-1))/...
(I_filtered(i)^2+Q_filtered(i)^2);
end
m_t = m_t*10;
最终效果图如下:

可以看到解调结果和基带形成基本呈现线性关系。
完整代码如下:
% FM调制的MATLAB代码
clc;
clear;
% 设置参数
Fc = 100e3; % 载波频率100kHz
Fs = 1e6; % 全局采样频率1MHz
t = 0:1/Fs:0.03; % 时间向量,持续1ms
Fm = 1e3; % 基带信号频率1kHz
Am = 5; % 基带信号振幅
Kf = 0.01; % 调频灵敏度,也即频率偏移系数
% 创建基频信号
F0 = 220;
fundamental = sin(2*pi*F0*t);
% 添加4个谐波分量
harmonic1 = 0.5 * sin(2*pi*2*F0*t);
harmonic2 = 1 * sin(2*pi*3*F0*t);
harmonic3 = 0.2 * sin(2*pi*4*F0*t);
harmonic4 = 0.6 * sin(2*pi*5*F0*t);
% 合成语音信号
message = fundamental + harmonic1 + harmonic2 + harmonic3 + harmonic4;
% FM调制
integrated_message = cumsum(message); % 基带信号积分
carrier = cos(2*pi*Fc*t); % 载波信号
fm_signal = cos(2*pi*Fc*t + 2*pi*Kf*integrated_message); % 调制信号
% IQ解调
% FM信号乘上与载波频率相同的同相和正交信号得到I、Q两路信号
I_demodulate = fm_signal .* cos(2*pi*Fc*t);
Q_demodulate = fm_signal .* -sin(2*pi*Fc*t);
% 滤除I、Q两路信号的两倍载波频率分量
I_filtered = lowpass(I_demodulate,2*pi*Fc*1.3,Fs*10);
Q_filtered = lowpass(Q_demodulate,2*pi*Fc*1.3,Fs*10);
% 规避反正切运算
m_t = zeros(1,length(Q_filtered));% 创建同样长度的最终解调结果信号
m_t(1) = 0;
for i = 2:length(Q_filtered)
m_t(i) = (I_filtered(i-1)*Q_filtered(i)-I_filtered(i)*Q_filtered(i-1))/...
(I_filtered(i)^2+Q_filtered(i)^2);
end
m_t = m_t*10;
% 绘制消息信号和FM调制信号
figure;
subplot(7,1,1);
plot(t, message);
title('基带信号');
xlabel('时间 (s)');
ylabel('振幅');
subplot(7,1,2);
plot(t, fm_signal);
title('FM调制信号');
xlabel('时间 (s)');
ylabel('振幅');
subplot(7,1,3)
plot(t, I_demodulate);
title('I路信号');
xlabel('时间 (s)');
ylabel('振幅');
subplot(7,1,5)
plot(t, Q_demodulate);
title('Q路信号');
xlabel('时间 (s)');
ylabel('振幅');
subplot(7,1,4)
plot(t, I_filtered);
title('I路信号过低通滤波器');
xlabel('时间 (s)');
ylabel('振幅');
subplot(7,1,6)
plot(t, Q_filtered);
title('Q路信号过低通滤波器');
xlabel('时间 (s)');
ylabel('振幅');
subplot(7,1,7)
plot(t, m_t);
title('最终解调结果');
xlabel('时间 (s)');
ylabel('振幅');
2730





