10.7MHzFM信号的射频直接带通采样用matlab实现
时间: 2024-05-26 16:01:22 浏览: 210
以下是一个简单的matlab代码实现:
% 设置采样频率和信号频率
fs = 20e6; % 采样频率
f = 10.7e6; % 信号频率
% 生成一个10.7MHz的FM信号
t = 0:1/fs:1/f; % 采样时间
x = cos(2*pi*f*t + 100*sin(2*pi*10*t)); % FM信号
% 进行射频直接带通采样
fc = 10.7e6; % 采样中心频率
Ts = 1/fs; % 采样时间间隔
n = 0:length(x)-1; % 采样点序列
y = x .* exp(-1j*2*pi*fc*n*Ts); % 射频直接带通采样
% 绘制采样前后的信号时域波形
figure;
subplot(2,1,1);
plot(t, x);
xlabel('Time (s)');
ylabel('Amplitude');
title('Original FM signal');
subplot(2,1,2);
plot(t, real(y));
xlabel('Time (s)');
ylabel('Amplitude');
title('RF direct sampling signal');
相关问题
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;
matlab设计10.7MHzFM信号的带通采样
以下是一个可以生成10.7MHz FM信号的MATLAB代码示例:
```matlab
% 生成10.7MHz FM信号
fs = 44.1e6; % 采样率
t = (0:1/fs:1-1/fs); % 时间向量
fc = 10.7e6; % 载波频率
fm = 1e3; % 调制频率
kf = 50e3; % 频偏灵敏度
m = sin(2*pi*fm*t); % 调制信号
s = cos(2*pi*fc*t + 2*pi*kf*cumsum(m)); % FM信号
% 显示10.7MHz FM信号的时域和频域图像
figure;
subplot(2,1,1);
plot(t*1e6, s); xlabel('时间(微秒)'); ylabel('幅度');
title('10.7MHz FM信号时域图像');
subplot(2,1,2);
f = (-length(s)/2:length(s)/2-1)*(fs/length(s));
S = abs(fftshift(fft(s)));
plot(f/1e6, S); xlabel('频率(MHz)'); ylabel('幅度');
title('10.7MHz FM信号频域图像');
% 带通采样
f0 = fc - kf/fm; % 采样起始频率
f1 = fc + kf/fm; % 采样终止频率
B = f1 - f0; % 采样带宽
fsamp = 2*B; % 采样率
tsamp = 1/fsamp; % 采样时间间隔
nsamp = ceil(length(s)/(fs/fsamp)); % 采样点数
t_samp = (0:nsamp-1)*tsamp; % 采样时间向量
s_samp = s(round(t_samp*fs)+1); % 采样信号
% 显示带通采样信号的时域和频域图像
figure;
subplot(2,1,1);
plot(t_samp*1e6, s_samp); xlabel('时间(微秒)'); ylabel('幅度');
title('10.7MHz FM信号带通采样时域图像');
subplot(2,1,2);
f_samp = (-length(s_samp)/2:length(s_samp)/2-1)*(fsamp/length(s_samp));
S_samp = abs(fftshift(fft(s_samp)));
plot(f_samp/1e6, S_samp); xlabel('频率(MHz)'); ylabel('幅度');
title('10.7MHz FM信号带通采样频域图像');
```
上述代码中,我们首先根据给定的载波频率、调制频率和频偏灵敏度生成了一个10.7MHz FM信号。然后,我们对该信号进行了带通采样,采样起始频率为$f_0=fc-k_f/f_m$,采样终止频率为$f_1=fc+k_f/f_m$,采样带宽为$B=f_1-f_0$,采样率为$fsamp=2B$。
最后,我们显示了原始信号和采样信号的时域和频域图像。可以看出,采样后的信号只保留了原始信号中位于带通范围内的频率成分。
阅读全文