Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

CIC filter design question

Status
Not open for further replies.

analog_fever

Junior Member level 3
Joined
Dec 26, 2008
Messages
29
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
USA
Activity points
1,505
I am currently designing a CIC decimation filter in verilog. I followed Hogeaneur's paper and other threads in this forum. I am not sure if I am getting the proper response from the filter, and hence need help on it. I am very new to FFT, filters, and Matlab.

Given below are filter requirements. The only requirement on the output is that it should have 13 bit resolution:

Filter input bits from SD modulator - 3 (2's complement, no fractional bits)
Output resolution needed - 13 bits (no fractional bits)
Higher sampling frequency - 1.4MHz
Decimation factor - 100


Filter stages used - 3


From Hogenauer's paper, I got Bmax -24bits (size of each integrator, and comb section)

Questions:

1. I coded the 3 stage filter in Verilog. Supplied a 1024 point unit impulse input. Attached is the image of the output response. While plotting FFT, I used my sampling frequency to be 1.4MHz. I am not seeing proper output response here, can somebody tell me what is the problem? Am I doing the FFT correct?

2. I used the FDA tool in matlab for the same specifications, it is using S36.15 (36 integer, and 15 fractional bits) for the integrators, and comb sections. This is different from the calculation in Hogenauer's paper. Why is it so? The response looks good, and similar to what I wanted here.

Any response is appreciated.

[/b]
 

I would prefer to see the input and output in tíme domain to determine, if the CIC is working correctly.
 

Thank you. Attached are the time domain unit impulse input, and output responses. Input is in red, output is in blue. Only 1024 samples of the input are fed into the filter.

Can you explain how come Matlab FDA tool is using different sizes for integrator, and comb sections? Am I using the correct filter parameters like I described above?

Otherwise, am I calculating the FFT properly? Here is the FFT matlab code:


fclk = 1.4e6


filtOutData = load('./filtout.txt')
filtInData = load('./impulse_input.txt')

data_length = length(filtOutData)
fft_pts = 2^(fix(log2(data_length)))

fft_filtOutData = fft(filtOutData, fft_pts)
half = fix(fft_pts/2);
fft_filtOutData_dB = 20*log10(abs(fft_filtOutData(1:half,:)))

fft_pts_by2 = round(fft_pts/2);
freq = (fclk/fft_pts)*(1:1:fft_pts_by2);

figure(1)
semilogx(freq,fft_filtOutData_dB)



I really appreciate your help, I am very new to filter design, and DSP.
 

Hi,
The Filter design toolbox in MATLAB assumes 1.15 input data format for a CIC filter by default. The CIC output wordlength is calculated automatically in MATLAB. Therefore the S36e15 that you see means that the CIC filter design function has determined that the gain of your CIC filter is 2^20, which is close to your own estimate. In order to your input data format to be taken into account you must alter the filter design object parameters.
The frequency response plot that you have provided is not uncommon for a CIC filter. This plot is in the log scale, and i guess that the transfer function zeros that are close to DC are not so deep because of a limited number of FFT samples. But the impulse response doesn't look like what one would expect of a 3-rd order CIC. It has two discrete levels only, but it should have more (i guess that it should look like a trapezoid, you can check it by taking a convolution of three square pulses).
--
Alex
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top