Tuesday, April 10, 2018

how to make CIC compensation filter


I gotta wrap my head around to design CIC compensation filter


I'm studying by referring these materials:



  1. Altera, "Understanding CIC compensation filters

  2. Hardware Efficient FIR Compensation Filter For Delta Sigma Modulator Analog to Digital Converters. Circuits and Systems, 2005. 48th Midwest Symposium on Saiyu Ren ; Dept. of Electr. Eng., Wright State Univ., Dayton, OH ; Siferd, R. ; Blumgold, R. ; Ewing, R.


first Altera just say "inverse sinc function" they wouldn't let me know how to realize the function except for using matlab function fir2 and how to get the coefficients of taps


so I found another reference (2) which I mentioned above.



they explain how to decide the coefficients of taps. but I couldn't figure out some equations.




they say


H(z)=a0*z^0+a1*z^-1 + ... + an*z^-n  => H(f)=h(0)+2*sigma(from 1 to (n-1)/2) h(k)*cos(2k*pi*F) where F=f/fs



Here is my first question. How is H(z) converted to H(f). If I substitute z to exp(iwT) it doesn't make sense.




second question I though a0=an=h(1). Is it correct?





finally i used matlab to calculate the coefficients of taps and i got the same coefficients in comparision with a result of the paper, but a simulation gave me a totally different and wrong data


h= [-0.70  2.09 -1.76  0.74 -1.26 0.40  0.34  0.26 0.74
-0.53 0.24 -0.74 0.04 -0.39 0.05 -0.02 0.28 0.14
0.41 -0.02 0.36 -0.02 0.41 0.14 0.28 -0.02 0.05 -
0.38 0.04 -0.74 0.24 -0.53 0.74 0.26 0.34 0.40 -
1.26 0.74 -1.76 2.09 -0.70] 41 taps

please let me know where I have to modify...


If I violate The copyright issue (because of the content of paper) please tell me and I will edit or delete this.


Here's my matlab code and plotenter image description here



clc; clear;
OSR=8
fb=125e6/2

fs=2*fb*OSR
f=[0 14 28 38 45.5 49.5 100 140 170 200 225 250 275 300 325 350 375 400 430 460 490]*10^6;

F=f/fs;
N=41;
L=[1: 1 : (N-1)/2];

S=max(L)

for i=1:S+1
A(i,1)=1;
end

for i=1:S+1
for j=2:S+1
A(i,j)=2*cos(2*pi*(j-1)*F(i));
end

end

H_sinc=((sin(OSR*pi.*F)./(OSR*sin(pi.*F)))).^2;

H_FIR=1./H_sinc;

H_IFIR(1:6)=H_FIR(1:6);

H_IFIR(1)=1;


H_IFIR(7)=0.1;

H_IFIR(8:21)=0;

H_IFIR=H_IFIR';

A_inv=inv(A);

H=inv(A)*H_IFIR;


H=H';

for i=1:S+1
H_sol(i)=H(S+2-i);
end

for i=1:20
H_sol(N-i+1)=H_sol(i);
end
f=[0:100:fs];

F=f/fs;

H_fir1=H_sol(21)+2*H_sol(1)*cos(2*pi.*F) ...
+2*H_sol(2)*cos(2*pi*2.*F) ...
+2*H_sol(3)*cos(2*pi*3.*F) ...
+2*H_sol(4)*cos(2*pi*4.*F) ...
+2*H_sol(5)*cos(2*pi*5.*F) ...
+2*H_sol(6)*cos(2*pi*6.*F) ...
+2*H_sol(7)*cos(2*pi*7.*F) ...
+2*H_sol(8)*cos(2*pi*8.*F) ...

+2*H_sol(9)*cos(2*pi*9.*F) ...
+2*H_sol(10)*cos(2*pi*10.*F) ...
+2*H_sol(11)*cos(2*pi*11.*F) ...
+2*H_sol(12)*cos(2*pi*12.*F) ...
+2*H_sol(13)*cos(2*pi*13.*F) ...
+2*H_sol(14)*cos(2*pi*14.*F) ...
+2*H_sol(15)*cos(2*pi*15.*F) ...
+2*H_sol(16)*cos(2*pi*16.*F) ...
+2*H_sol(17)*cos(2*pi*17.*F) ...
+2*H_sol(18)*cos(2*pi*18.*F) ...

+2*H_sol(19)*cos(2*pi*19.*F) ...
+2*H_sol(20)*cos(2*pi*20.*F);


figure(1), semilogx(f,db(H_fir1))
% hold on
grid on

please help me to solve this problem...




No comments:

Post a Comment

digital communications - Understanding the Matched Filter

I have a question about matched filtering. Does the matched filter maximise the SNR at the moment of decision only? As far as I understand, ...