⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mul.fliter.m

📁 用MATLAB实现了多相滤波器的仿真
💻 M
字号:
fs=12.8e+6; %the sampling frequency
ts=1/fs;
f1=6e+6; %the intermediate frequency
f0=16e+6; %the local frequency
f3=f0+f1;
fso=5e+6; %the desired data frequency
b=5e+6;   %the bandwidth
T=20e-6;  %the pulse width
N=floor(T*fs);
MM=floor(fs/fso);%the decimation factor
tn1=-T/2:1/fs:(T/2-1/fs);
tn2=length(tn1);
tn3=1:tn2;
tn4=(tn3/tn2)*T*1e+6;
smf=cos(2*pi*f3*tn1);

%低通中频数字正交化
fovi=cos(2*pi*f3/fs*tn3);%I路本振信号
fovq=sin(2*pi*f3/fs*tn3);%Q路本振信号
in=smf.*fovi;%I路解调
qn=smf.*fovq;%Q路解调
window=chebwin(51,40);                %这是采用51阶cheby窗的FIR低通滤波器
[b1,a1]=fir1(50,2*b/fs,window);
in=[in,zeros(1,25)];               %因为该FIR滤波器有25个采样周期的延迟,
qn=[qn,zeros(1,25)];               %因为该FIR滤波器有25个采样周期的延迟,
in=filter(b1,a1,in);                 %I路信号经过低通滤波器
qn=filter(b1,a1,qn);                 %Q路信号经过低通滤波器
in=in(26:end);                        %截取有效信息
qn=qn(26:end);         
figure(1),
subplot(2,1,1),
plot(tn1,in),
xlabel('t(单位:秒)'),title('I(n)路信号');
subplot(2,1,2),
plot(tn1,qn),
xlabel('t(单位:秒)'),title('Q(n)路信号');
% IR=IR(in,qn);
% %IR=max(IR_value);
% disp(['采用低通滤波法进行数字正交,对镜频分量的抑制比可达到  ', num2str(IR) ,'dB']);

% %采用多相滤波法进行数字正交
% wp=(0.5*b/fs)*2*pi;
% tb=0.5e+6;
% ws=(tb+0.5*b)/fs*2*pi;
% rp=0.30;
% rs=60;  
% delta1=(10^(rp/20)-1)/(10^(rp/20)+1);
% delta2=(1+delta1)*(10^(-rs/20));
% weights=[delta2/delta1 1];        
% deltaf=(ws-wp)/(2*pi);
% M=ceil((-20*log10(sqrt(delta1*delta1))-13)/(14.6*deltaf)+1);
% M=M+2;
% f=[0 wp/pi ws/pi 1];
% m=[1 1 0 0];
% h=remez(M-1,f,m,weights);
% hh=length(h);
% count1=floor(hh/MM);
% count2=floor(tn2/MM);
% in=zeros(1,128);qn=zeros(1,128);A=zeros(MM,count1);AI=zeros(MM,count2);
% for   i1=1:MM
%       i2=1:count1;
%       A(i1,i2)=h((i2-1)*MM+i1);
% end
% 
% for   i1=1:MM
%      i4=1:count2; 
%      AI(i1,i4)=filter(A((MM+1-i1),i2),[1],in1(MM*(i4-1)+i1));
%      in=in+AI(i1,i4);
%      AQ(i1,i4)=filter(A((MM+1-i1),i2),[1],qn1(MM*(i4-1)+i1));
%      qn=qn+AQ(i1,i4);
% end
% time=0:1/fs:(length(in)-1)/fs;
% figure(2),
% subplot(2,1,1),
% plot(time,in),
% xlabel('t(单位:秒)'),title('多相滤波后的I(n)路信号');
% subplot(2,1,2),
% plot(time,qn),
% xlabel('t(单位:秒)'),title('多相滤波后的Q(n)路信号');
% IR=IR(in,qn);
% %IR=max(IR_value);
% disp(['采用多相滤波法进行数字正交,对镜频分量的抑制比可达到  ', num2str(IR) ,'dB']);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -