10.7MHzFM中频的带通采样matlab
时间: 2023-10-30 10:08:58 浏览: 80
代码如下:
% 输入信号
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
fc = 10.7e6; % carrier frequency
fm = 15e3; % modulation frequency
fs = 50e6; % sampling frequency
t = 0:1/fs:5/fm; % time vector
m = cos(2*pi*fm*t); % message signal
c = cos(2*pi*fc*t); % carrier signal
x = m.*c; % modulated signal
[b,a] = butter(6,[2.5e6 3.5e6]/(fs/2),'bandpass'); % anti-aliasing filter
y = filter(b,a,x); % filtered signal
n = length(y);
f = (-n/2:n/2-1)*(fs/n); % frequency vector
Y = fftshift(fft(y));
figure;
plot(f,abs(Y));
xlabel('Frequency (Hz)');
ylabel('Magnitude');
title('Spectrum of FM signal');
grid on;
% AD bandpass sampling
f0 = 1e6; % sampling frequency
Ts = 1/f0; % sampling period
n0 = fs/f0; % oversampling factor
t0 = 0:Ts:5/fm; % time vector for sampling
k = -n0/2:n0/2-1; % sampling index
fi = fc + fm*k/n0; % intermediate frequency
s = zeros(size(k));
for i = 1:length(k)
s(i) = y(round(t0(i)*fs)+1)*cos(2*pi*fi(i)*t0(i)); % sampled signal
end
[b,a] = butter(4,[2.4e6 2.6e6]/(f0/2),'bandpass'); % reconstruction filter
z = filter(b,a,s); % reconstructed signal
figure;
plot(t,y,'b',t0,s,'ro',t,z,'g');
xlabel('Time (s)');
ylabel('Amplitude');
legend('Original signal','Sampled signal','Reconstructed signal');
title('AD bandpass sampling of FM signal');
grid on;
阅读全文