matlab对10.7MHz的FM信号进行采样和正交解调
时间: 2023-10-04 07:14:34 浏览: 138
FM.rar_FM_FM matlab_FM信号_FM调制解调_matlab FM信号
以下是matlab代码,对10.7MHz的FM信号进行采样和正交解调:
% 采样频率为20MHz,信号频率为10.7MHz
fs = 20e6;
fc = 10.7e6;
% 生成10秒的FM信号
t = 0:1/fs:10-1/fs;
fm = sin(2*pi*fc*t + 5*cos(2*pi*100e3*t));
% 对信号进行采样
Ts = 1/fs;
n = 0:1:999999;
xn = fm(n*Ts);
% 对信号进行正交解调
fc1 = fc - fs/4;
fc2 = fc + fs/4;
x1 = xn .* exp(-1i*2*pi*fc1*n*Ts);
x2 = xn .* exp(-1i*2*pi*fc2*n*Ts);
% 对解调后的信号进行带通滤波
[b,a] = butter(10, [2*fc/fs-0.1 2*fc/fs+0.1], 'bandpass');
y1 = filter(b,a,x1);
y2 = filter(b,a,x2);
% 计算幅度和相位
amp = abs(y1 + 1i*y2);
phase = atan2(imag(y1 + 1i*y2), real(y1 + 1i*y2));
% 绘制幅度和相位图像
figure;
subplot(2,1,1);
plot(amp);
title('Amplitude');
subplot(2,1,2);
plot(phase);
title('Phase');
% 绘制原始信号和解调后的信号图像
figure;
subplot(2,1,1);
plot(t, fm);
title('Original FM Signal');
subplot(2,1,2);
plot(n*Ts, amp);
title('Demodulated Signal');
阅读全文