DSP filter problem in matlab

Status
Not open for further replies.

ali kotb

Member level 3
Joined
Feb 11, 2012
Messages
61
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,732
hello all , I need to implement CIC decimator, here is the matlab code using fvtool

r=64;
m=1;
n=3;
iwl=16;
owl=12;
IFL = 0; % Input fraction length
CIC = mfilt.cicdecim(r,m,n);
CIC.InputFracLength = IFL;
f_in =5120;
h=fvtool(CIC,'FS',f_in);
I checked the impulse response using the fvtool and it gives me a complete different response when using the following code:

x= zeros(16*100,1,'int16'); x(1)=1;
d=filter(CIC,x);
stem(d);
what is the problem ? , when i used the HDL coder, the response of the verilog code is just like the 2nd case

please help me thank u
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…