数字下变频仿真原理:LPFLPFcos(2πf0nts)sin(2πf0nts)Xddc_iddc_q信号采样的频谱调频信号:02()cos*(2/2)sxKtnfnt300-30f/MHz-101050700002202*cos(2/)cos(2)cos(2)cos(4*/2*/2)cos(*/2)ssssxfnffntfntfntKtKtKt0002022*sin(2/)cos(2)sin(2)sin(*/2*/2)sin(*/24)ssssKtKtKxfnffntfntfntt因为f0=30MHz,整体向左平移30MHz。200f/MHz-40-2040-60带宽为5MHz通过仿真得到()xn的时域波形和频域波形,如下图所示。clc;clearall;closeall;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滤波器的设置在commandWindows里输入fdatool进入滤波器参数设置的界面Hd=fir;[h,f]=freqz(Hd,512);figure(4);plot(f,20*log10(abs(h)));gridtitle('FIR低通滤波器的幅频特性响应')hd=Hd.Numerator;fir_i=conv(ddc_i,hd);fir_q=conv(ddc_q,hd);figure(5);subplot(211);plot(fir_i);gridtitle('FIR低通滤波器后的I路信号');subplot(212);plot(fir_q);gridtitle('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))));gridtitle('归一化频谱')clc;clearall;closeall;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)));gridtitle('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);gridtitle('FIR低通滤波器后的I路信号');subplot(212);plot(fir_q);gridtitle('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))));gridtitle('归一化频谱')