|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
本帖最后由 oceanwangchao 于 2016-10-19 18:17 编辑
我用脚本建立了一个CIC抽取滤波器的模型,3级积分器级联后,进行4倍降采样,然后级联3级差分器,输入一个正弦波激励,发现第三级积分器输出的信号波形是一条斜上升的直线,已经不收敛了,请大神指点一下,每一级数据累加的过程中还有别的处理步骤吗?以下是我的脚本代码:
close all
clc
clear all
% x_in=[1000,zeros(1,5000)];
% I=10;
n=0:1:16383;
w=2*pi*(1/32);
x_in=0.5*sin(n*w);
D=4;
% figure(1)
% plot(n,x);
% y=fltcic_dec(x,8);
% figure(2)
% plot(y);
%%%%%%%%%%%%%%%%积分部分第一级%%%%%%%%%%%%%%%%%
for ii=1:1:length(x_in)
if(ii==1)
int1(1)=x_in(1);
else
int1(ii)=x_in(ii)+int1(ii-1);
end
end
%%%%%%%%%%%%%%%%积分部分第二级%%%%%%%%%%%%%%%%%
for jj=1:1:length(int1)
if(jj==1)
int2(1)=int1(1);
else
int2(jj)=int1(jj)+int2(jj-1);
end
end
%%%%%%%%%%%%%%%%积分部分第三级%%%%%%%%%%%%%%%%%
for kk=1:1:length(int2)
if(kk==1)
int3(1)=int2(1);
else
int3(kk)=int2(kk)+int3(kk-1);
end
end
%%%%%%%%%%%%%%%%下采样部分%%%%%%%%%%%%%%%%%
% d3_us=[d3_temp;zeros(I-1,length(d3_temp))];
% % d3_us=repmat(d3_temp,I,1);
% int0=d3_us(';
int3_ds=downsample(int3,D);
%%%%%%%%%%%%%%%%梳状部分第一级%%%%%%%%%%%%%%%%%
x1_temp=[int3_ds,0];
ff1_dly=[0,int3_ds];
d1_temp=x1_temp-ff1_dly;
%%%%%%%%%%%%%%%%梳状部分第二级%%%%%%%%%%%%%%%%%
x2_temp=[d1_temp,0];
ff2_dly=[0,d1_temp];
d2_temp=x2_temp-ff2_dly;
%%%%%%%%%%%%%%%%梳状部分第三级%%%%%%%%%%%%%%%%%
x3_temp=[d2_temp,0];
ff3_dly=[0,d2_temp];
d3_temp=x3_temp-ff3_dly;
y_out=d3_temp; |
|