10.7MHz的FM中频信号用ADC进行带通采样的matlab代码
时间: 2024-05-29 16:12:22 浏览: 145
以下是一个示例代码,可以用于将10.7MHz的FM中频信号进行带通采样:
% 设置采样率和采样时间
fs = 22.5e6;
t = 0:1/fs:0.01;
% 生成10.7MHz的中频信号
fc = 10.7e6;
fm = 1e3;
m = 2; % 调制指数
Ac = 1;
Am = 0.5;
xc = Ac*cos(2*pi*fc*t);
xm = Am*cos(2*pi*fm*t);
xif = xc.*cos(2*pi*fc*t) - xm.*sin(2*pi*fc*t);
% 带通滤波器参数
fpass = 150e3;
fstop = 200e3;
wpass = fpass/(fs/2);
wstop = fstop/(fs/2);
n = 6; % 阶数
% 设计带通滤波器
[b,a] = butter(n, [wpass, wstop], 'bandpass');
% 用带通滤波器进行采样
y = filter(b, a, xif);
% 绘制时域和频域图像
figure;
subplot(2,1,1);
plot(t, y);
xlabel('Time (s)');
ylabel('Amplitude');
title('Bandpass Sampling of 10.7MHz FM IF Signal');
subplot(2,1,2);
f = -fs/2:fs/length(y):fs/2-fs/length(y);
Y = fftshift(fft(y));
plot(f, abs(Y));
xlabel('Frequency (Hz)');
ylabel('Magnitude');
title('Frequency Domain of Bandpass Sampled Signal');
阅读全文