10.7MHzFM中频信号的AD带通采样的MATLAB
时间: 2023-10-07 15:12:57 浏览: 77
代码如下:
% 10.7MHz FM intermediate frequency signal sampling
clear all;
close all;
% Sampling parameters
fs = 22.4e6; % Sampling frequency
Ts = 1/fs; % Sampling period
N = 8192; % Number of samples
% Signal parameters
fc = 10.7e6; % Carrier frequency
fm = 20e3; % Modulation frequency
kf = 75e3; % Frequency deviation constant
Ac = 1; % Carrier amplitude
% Generate FM signal
t = linspace(0, N*Ts, N);
s = Ac*cos(2*pi*fc*t + 2*pi*kf*cumsum(sin(2*pi*fm*t))*Ts);
% Plot FM signal
figure;
plot(t, s);
xlabel('Time (s)');
ylabel('Amplitude');
title('FM Signal');
% Calculate frequency spectrum of FM signal
S = fftshift(fft(s));
f = linspace(-fs/2, fs/2, N);
figure;
plot(f, abs(S));
xlabel('Frequency (Hz)');
ylabel('Magnitude');
title('Frequency Spectrum of FM Signal');
% Bandpass filter
f_passband = [9.7e6, 11.7e6];
f_stopband = [9.5e6, 11.9e6];
rp = 0.1; % Passband ripple (dB)
rs = 60; % Stopband attenuation (dB)
[n, Wn] = buttord(f_passband/(fs/2), f_stopband/(fs/2), rp, rs);
[b, a] = butter(n, Wn, 'bandpass');
s_filtered = filter(b, a, s);
% Plot filtered signal
figure;
plot(t, s_filtered);
xlabel('Time (s)');
ylabel('Amplitude');
title('Filtered FM Signal');
% Calculate frequency spectrum of filtered signal
S_filtered = fftshift(fft(s_filtered));
figure;
plot(f, abs(S_filtered));
xlabel('Frequency (Hz)');
ylabel('Magnitude');
title('Frequency Spectrum of Filtered FM Signal');
% Bandpass sampling
fs_bandpass = 200e3; % Bandpass sampling frequency
Ts_bandpass = 1/fs_bandpass; % Bandpass sampling period
t_bandpass = 0:Ts_bandpass:(N-1)*Ts_bandpass; % Bandpass sampling time vector
s_bandpass = s_filtered(1:floor(fs/fs_bandpass):end); % Bandpass sampled signal
% Plot bandpass sampled signal
figure;
plot(t_bandpass, s_bandpass);
xlabel('Time (s)');
ylabel('Amplitude');
title('Bandpass Sampled FM Signal');
% Calculate frequency spectrum of bandpass sampled signal
S_bandpass = fftshift(fft(s_bandpass));
f_bandpass = linspace(-fs_bandpass/2, fs_bandpass/2, length(s_bandpass));
figure;
plot(f_bandpass, abs(S_bandpass));
xlabel('Frequency (Hz)');
ylabel('Magnitude');
title('Frequency Spectrum of Bandpass Sampled FM Signal');
阅读全文