10.7Mhz的FM中频广播信号进行带通采样的matlab
时间: 2023-11-03 18:23:01 浏览: 124
中波广播系统声音的传播用matlab实现,附带中波广播系统的发射机simulink仿真
5星 · 资源好评率100%
代码如下:
% 设置采样率和采样点数
fs = 50e3;
N = 1024;
% 生成10.7MHz的FM中频信号
fc = 10.7e6;
fm = 1e3;
fsig = 2*pi*fm*t;
x = cos(2*pi*fc*t + cumsum(fsig));
% 进行带通滤波
f_low = 10e3;
f_high = 20e3;
[b,a] = butter(4, [f_low, f_high]/(fs/2), 'bandpass');
y = filter(b, a, x);
% 进行采样
t_sample = (0:N-1)/fs;
y_sample = interp1(t, y, t_sample);
% 绘制时域图和频谱图
figure;
subplot(2,1,1);
plot(t_sample, y_sample);
xlabel('Time (s)');
ylabel('Amplitude');
title('Sampled FM IF signal');
subplot(2,1,2);
f = linspace(-fs/2,fs/2,N);
Y = fftshift(fft(y_sample));
plot(f,abs(Y));
xlabel('Frequency (Hz)');
ylabel('Magnitude');
title('Spectrum of sampled FM IF signal');
阅读全文