数字下变频仿真
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
数字下变频仿真原理:
信号采样的频谱
调频信号:02
()cos *(2/2)s x K t n f nt π=+
/MHz
00022
02
*cos(2/)cos(2)cos(2)
cos(4*/2*/2)cos(*/2)
s s s s x f n f f nt f nt f nt K t K t K t ππππ=+=++
0002022
*sin(2/)cos(2)sin(2)
sin(*/2*/2)sin(*/24)
s s s s K t
K t K x f n f f nt f nt f nt t π
πππ+-=-+=-+
因为f 0=30MHz ,整体向左平移30MHz 。
-40-20
带宽为5MHz
通过仿真得到()x n 的时域波形和频域波形,如下图所示。 clc;clear all;close all; f0=30e6; 中心频率 B=5e6; 带宽
T=30e-6; 脉冲宽度 fs=40e6; 采样频率 N=T*fs; 采样点数 K=B/T; 频率变换率 ts=1/fs; 采样周期
t=-T/2:ts:T/2-ts;
x=cos(2*pi*(f0*t+K*t.^2/2));
figure(1);
title('时域波形');
xlabel('point ');
figure(2);
plot(abs(fft(x)));
title('频域波形');
xlabel('point');
I路信号和Q路信号:
ddc_i = x.*cos(2*pi*f0*(1:N)/fs); I路信号ddc_q = -x.*sin(2*pi*f0*(1:N)/fs); Q路信号figure(3);
subplot(211);
plot(t,ddc_i);grid;
title('I路波形');
subplot(212);
plot(t,ddc_q);grid;
title('Q路波形');
FIR滤波器的设置
在command Windows里输入fdatool进入滤波器参数设置的界面
Hd=fir;
[h,f]=freqz(Hd,512);
figure(4);
plot(f,20*log10(abs(h)));grid
title('FIR低通滤波器的幅频特性响应')
hd=Hd.Numerator;
fir_i=conv(ddc_i,hd);
fir_q=conv(ddc_q,hd);
figure(5);
subplot(211);
plot(fir_i);grid
title('FIR低通滤波器后的I路信号'); subplot(212);
plot(fir_q);grid
title('FIR低通滤波器后的Q路信号');
s=fir_i+j*fir_q;
figure(6);
subplot(211);
sf=fftshift(abs(fft(s)));
plot(sf);grid;
title('信号滤波后的频谱')
subplot(212);
plot((20*log10(sf/max(sf))));grid title('归一化频谱')
clc;clear all;close all;
f0=30e6;
B=5e6;
T=30e-6;
fs=40e6;
N=T*fs;
K=B/T;
ts=1/fs;
t=-T/2:ts:T/2-ts;
x=cos(2*pi*(f0*t+K*t.^2/2));
figure(1);
plot(x);
title('时域波形');
xlabel('point');
figure(2);
plot(abs(fft(x)));
title('频域波形');
xlabel('point');
ddc_i = x.*cos(2*pi*f0*(1:N)/fs);
ddc_q = -x.*sin(2*pi*f0*(1:N)/fs); figure(3);
subplot(211);
plot(t,ddc_i);grid;
title(' I路波形');
subplot(212);
plot(t,ddc_q);grid;
title(' Q路波形');
Hd=fir;
[h,f]=freqz(Hd,512);
figure(4);
plot(f,20*log10(abs(h)));grid
title(' FIR低通滤波器的幅频特性响应') xlabel('w/pi');
hd=Hd.Numerator;
fir_i=conv(ddc_i,hd);
fir_q=conv(ddc_q,hd);
figure(5);
subplot(211);
plot(fir_i);grid
title(' FIR低通滤波器后的I路信号'); subplot(212);
plot(fir_q);grid
title(' FIR低通滤波器后的Q路信号'); s=fir_i+j*fir_q;
figure(6);
subplot(211);
sf=fftshift(abs(fft(s)));
plot(sf);grid;
title('信号滤波后的频谱')
subplot(212);
plot((20*log10(sf/max(sf))));grid
title('归一化频谱')