LP_filter.m
上传用户:shencti
上传日期:2016-08-16
资源大小:16k
文件大小:2k
- %%低通滤波器
- function [signal_I,signal_Q,signal_I_noise,signal_Q_noise]=LP_filter(N,M,code_cycle,fs,Rece_Signal_Quan_down_I,Rece_Signal_Quan_down_Q,Rece_Signal_Quan_down_I_noise,Rece_Signal_Quan_down_Q_noise,EmulateIndex) %进过低通滤波器
- global filter_previous_I;
- global filter_previous_Q;
- global filter_previous_I_noise;
- global filter_previous_Q_noise;
- %%下变频后通过低通滤波器
-
- freq_replace=58.08e6;
- wp = code_cycle*2/fs; % 归一化数字截止频率
- b = fir1(10,wp); % 11个系数,即10阶海明窗FIR通滤波
- b=round(b*2^8);
- % 滤波器系数量化
- % b_bit=8;
- % b_step=1/(2^7);
- % b=round(b/b_step);
- if 1==mod(EmulateIndex,M)
- Rece_Signal_Quan_down_I=[0 0 0 0 0 0 0 0 0 0 Rece_Signal_Quan_down_I];
- Rece_Signal_Quan_down_Q=[0 0 0 0 0 0 0 0 0 0 Rece_Signal_Quan_down_Q];
- Rece_Signal_Quan_down_I_noise=[0 0 0 0 0 0 0 0 0 0 Rece_Signal_Quan_down_I_noise];
- Rece_Signal_Quan_down_Q_noise=[0 0 0 0 0 0 0 0 0 0 Rece_Signal_Quan_down_Q_noise];
- else
- Rece_Signal_Quan_down_I=[filter_previous_I Rece_Signal_Quan_down_I];
- Rece_Signal_Quan_down_Q=[filter_previous_Q Rece_Signal_Quan_down_Q];
- Rece_Signal_Quan_down_I_noise=[filter_previous_I_noise Rece_Signal_Quan_down_I_noise];
- Rece_Signal_Quan_down_Q_noise=[filter_previous_I_noise Rece_Signal_Quan_down_Q_noise];
- end
- signal_I_filter = filter(b,1,Rece_Signal_Quan_down_I);
- signal_Q_filter= filter(b,1,Rece_Signal_Quan_down_Q);
- signal_I_nosie_filter = filter(b,1,Rece_Signal_Quan_down_I_noise);
- signal_Q_nosie_filter = filter(b,1,Rece_Signal_Quan_down_Q_noise);
-
- signal_I_filter=round(signal_I_filter/2^9);
- signal_Q_filter=round(signal_Q_filter/2^9);
- signal_I_nosie_filter=round(signal_I_nosie_filter/2^9);
- signal_Q_nosie_filter=round(signal_Q_nosie_filter/2^9);
- signal_I=signal_I_filter(11:(N+10));
- signal_Q=signal_Q_filter(11:(N+10));
- signal_I_noise=signal_I_nosie_filter(11:(N+10));
- signal_Q_noise=signal_Q_nosie_filter(11:(N+10));
- filter_previous_I=Rece_Signal_Quan_down_I((N+1):(N+10));
- filter_previous_Q=Rece_Signal_Quan_down_Q((N+1):(N+10));
- filter_previous_I_noise=Rece_Signal_Quan_down_I_noise((N+1):(N+10));
- filter_previous_Q_noise=Rece_Signal_Quan_down_Q_noise((N+1):(N+10));