Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Electronic Equipment > Digital Signal Processing (DSP) > 5 Stages CIC Fi...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 13233 of 13815
Post > Topic >>

5 Stages CIC Filter Matlab Simulation Problem

by tonyjiang86@[EMAIL PROTECTED] Jun 26, 2008 at 06:39 PM

I implemented the matlab simulation model according to hardware
architecture.The impulse response is ok when the impulse length is
short.But when I increase the length of impulse stimulus, I found
increasing spurs. I don't know whether this is caused by the
instability of the filter or some other reasons. Attached is the
matlab code,and at the end of code I added the matlab internal
function mfilt.cicdecim for comparison.


%Filter Stimulus
%data_in =sin((1:2^15)*pi/2^10);
data_in =[1 zeros(1,4*6000-1)];

%Filter Parameters
R= 4;%decimation factor
M=1;%differential delay
N=5;%cascaded numbers of section

%Integrator Section Registers Initialization
intg_reg1(1) = data_in(1);
intg_reg1_d(1) =0;
intg_reg2(1) = 0;
intg_reg2_d(1) =0;
intg_reg3(1) = 0;
intg_reg3_d(1) =0;
intg_reg4(1) = 0;
intg_reg4_d(1) =0;
intg_reg5(1) = 0;
intg_reg5_d(1) =0;



for i=2:length(data_in)

    intg_reg1_d(i) = intg_reg1(i-1);
    intg_reg1(i) = intg_reg1_d(i) + data_in(i);

    intg_reg2_d(i) = intg_reg2(i-1);
    intg_reg2(i) = intg_reg2_d(i) + intg_reg1_d(i);

    intg_reg3_d(i) = intg_reg3(i-1);
    intg_reg3(i) = intg_reg3_d(i) + intg_reg2_d(i);

    intg_reg4_d(i) = intg_reg4(i-1);
    intg_reg4(i) = intg_reg4_d(i) + intg_reg3_d(i);

    intg_reg5_d(i) = intg_reg5(i-1);
    intg_reg5(i) = intg_reg5_d(i) + intg_reg4_d(i);

end

% Decimation by R

deci_data=intg_reg5_d(R:R:end);

%Comb Section Registers Initialization
diff_reg1(1) = deci_data(1);
diff_reg1_d(1) = 0;
diff_reg2(1) = 0;
diff_reg2_d(1) =0;
diff_reg3(1) = 0;
diff_reg3_d(1) = 0;
diff_reg4(1) = 0;
diff_reg4_d(1) = 0;
diff_reg5(1) = 0;
diff_reg5_d(1) = 0;
diff_reg6(1) = 0;

for ii=2:length(deci_data)

    diff_reg1(ii) = deci_data(ii);
    diff_reg1_d(ii) = diff_reg1(ii-1);

    diff_reg2(ii) = diff_reg1(ii)-diff_reg1_d(ii);
    diff_reg2_d(ii) = diff_reg2(ii-1);

    diff_reg3(ii) = diff_reg2(ii)-diff_reg2_d(ii);
    diff_reg3_d(ii) = diff_reg3(ii-1);

    diff_reg4(ii) = diff_reg3(ii)-diff_reg3_d(ii);
    diff_reg4_d(ii) = diff_reg4(ii-1);

    diff_reg5(ii) = diff_reg4(ii)-diff_reg4_d(ii);
    diff_reg5_d(ii) = diff_reg5(ii-1);

    diff_reg6(ii) = diff_reg5(ii)-diff_reg5_d(ii);
end
data_out = diff_reg6;

data_in =[1 zeros(1,4*10000-1)];

hm=mfilt.cicdecim(4,1,5);
cic_ir=double(filter(hm,data_in));
 




 2 Posts in Topic:
5 Stages CIC Filter Matlab Simulation Problem
tonyjiang86@[EMAIL PROTEC  2008-06-26 18:39:47 
Re: 5 Stages CIC Filter Matlab Simulation Problem
Tony <tonyjiang86@[EMA  2008-06-27 01:57:54 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Sep 5 22:38:28 CDT 2008.