10.7MHzFM中频的带通采样matlab
时间: 2023-10-30 18:08:58 浏览: 89
代码如下:
% 输入信号
fs = 44.1e3; % 采样频率
fc = 10.7e6; % 中频
N = 1024; % 采样点数
t = (0:N-1)/fs; % 时间序列
x = sin(2*pi*fc*t); % 输入信号
% 带通滤波器
f1 = 10.6e6; % 下限频率
f2 = 10.8e6; % 上限频率
fny = fs/2; % Nyquist频率
[b,a] = butter(6,[f1/fny f2/fny],'bandpass'); % 6阶带通滤波器
y = filter(b,a,x); % 滤波后的信号
% 采样
Ts = 1/10.7e6; % 采样间隔
n = 0:N-1; % 采样序列
xn = y.*cos(2*pi*fc*n*Ts); % 采样后的信号
% 解调
fc1 = 10.7e6; % 解调频率
y1 = xn.*cos(2*pi*fc1*n*Ts); % 解调后的信号
% 绘图
figure;
subplot(3,1,1); plot(t,x); title('输入信号');
subplot(3,1,2); plot(t,y); title('经过带通滤波器后的信号');
subplot(3,1,3); plot(t,y1); title('经过解调后的信号'); xlabel('时间 (s)');
相关问题
matlab生成10.7MHzFM中频的带通采样代码
以下是一个简单的MATLAB代码,用于生成10.7MHz FM中频的带通采样:
%% 生成10.7MHz FM中频信号
fc = 10.7e6; % 载频频率
fm = 10e3; % 调制信号频率
fs = 100e6; % 采样频率
t = (0:1/fs:1/fm); % 时间向量
kf = 75e3; % 调频灵敏度
m_signal = sin(2*pi*fm*t); % 调制信号
carrier = sin(2*pi*fc*t); % 载频信号
modulated_signal = sin(2*pi*(fc + kf*cumsum(m_signal)).*t); % 调频信号
%% 带通采样
f1 = fc - kf*max(m_signal); % 信号频率的最小值
f2 = fc + kf*max(m_signal); % 信号频率的最大值
BW = f2 - f1; % 带宽
fsampling = 2*BW; % 采样频率,根据奈奎斯特采样定理,fsampling必须大于2*BW
Ts = 1/fsampling; % 采样周期
n = 0:round(fsampling/fs):(length(modulated_signal)-1); % 生成采样时刻序列
sampled_signal = modulated_signal(n+1); % 采样信号
%% 绘图
figure;
subplot(2,1,1);
plot(t*1e6, modulated_signal);
title('调频信号');
xlabel('时间(微秒)');
ylabel('幅度');
subplot(2,1,2);
stem(n*Ts*1e6, sampled_signal);
title('采样信号');
xlabel('时间(微秒)');
ylabel('幅度');
请注意,此代码仅用于演示目的。实际应用中,您需要根据您的具体要求进行修改和优化。
10.7MHzFM中频信号的AD带通采样的MATLAB
代码如下:
% 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');
阅读全文