## Back to back CIC filters

Started by 6 years ago27 replieslatest reply 6 years ago215 views

Hi,

If I have to design a decimation filter for a 4-bit sigma-delta ADC, decimation factor say 6, I plan to split the filter into 2 stages of CIC filtering (first stage by 2 of order 3 and second stage by 3 of order 4). This can be done in single stage but separating into 2 will give me power benefits (first stage integrators can run at lower bit widths). My CIC structures will look like below.

First stage:

Second stage:

When these 2 are cascaded, can all the differentiators of first stage and 3 integrators of second stage be removed? Don't they cancel out? Though conceptually it seems fine, I am not able to prove it right in Matlab.The first stage integrators/differentiators are 7-bits wide and second stage will be all 14-bit wide. If we have to optimize by removing the differentiators and integrators, what would the bit widths of remaining integrator/differentiator be for second stage?

-Krishna

[ - ]

Hello,

The simple answer is no.  As someone else pointed out, you need matching integrators and differentiators so that the poles and zeros for a filter stage line up.

You are correct about cascading CIC filters.  It can be done to get a particular shape on your output.  About that, one of my favorite designs is a CIC followed by a half-band decimating filter.  The half-band response can be shaped to cancel out the CIC droop.  Also, the CIC can have delays in the stages so that one of the attenuation poles notches out an adjacent channel.  The CIC/half-band combo can give a very sharp cutoff response with a small (0.05 dB or less) pass band deviation.

Cheers,

Mark Napier

[ - ]

No the integrator (accumulators) and the comb sections do not "cancel" each other.  The pole in the integrator is cancel by the zero in the comb so you don't have infinite gain at DC.

[ - ]

I'm pretty sure that's not true, or at least not in the way that you think.  You have $$\frac{z - 1}{z}$$ cascaded with $$\frac{z}{z - 1}$$, so the product is one.  So I'm pretty sure that from that point of view you should be able to eliminate all but one of the integrators in the middle.

Where I do see a problem, however, is in the differing bit widths of the two data paths -- AFAIK, the CIC overflow canceling magic only works if all of the integrators and differentiators in the filter are of the same width.

If that's true, you could cancel out the three pairs of integrators and differentiators, but only at the cost of increasing your data path width at the front end.

I could be wrong on that -- hopefully if I am, someone will speak up.

[ - ]

Yes you can definitely do this. But as Tim pointed out in one answer, make sure you get the wordlength right. Draw the two filters in cascade, with the wordlength at each stage that you would normally use, and only then do the cancelling so you clearly see how many bits (and where) you have to add at the first stage after cancellation.

Just try it, it's easy enough. Your answer should be BIT-ACCURATE to the cascasde of two filters. Make sure you try with full scale DC signals etc...

For a more formal description, this is discussed in this rather old paper, they call it the 'merged structure':

http://ieeexplore.ieee.org/stamp/stamp.jsp?arnumbe...

[ - ]

Tim,

Absolutely. I was thinking the same, the bit-widths need to be same between integrators/differentiators. Hence, in theory what I have shown might make sense probably but not from implementation?

[ - ]
I think it's time to grab a pencil and paper and work it out.  Or do some simulations.
[ - ]

It works perfectly fine, if I operate the first stage integrator also with the same bit-width as the last stage differentiator.

[ - ]

Hi cfelton,

I am talking about the differentiators of the 1st stage and integrators of 2nd stage. Isn;t it

(1-z^-1)^3/(1-z^-1)^4 ?

Krishna

[ - ]

No, your math is incomplete (prematurely simplified) you either need
to include the multirate polyphase decomposition or use the
non-multirate equations, which would be:

$$\left[ \frac{1-z^{-R_1}}{1-z^{-1}} \right]^{N_1} \cdot \left[ \frac{1-z^{-R_2}}{1-z^{-1}} \right]^{N_2}$$

Regards,
Chris

[ - ]

The second integrator operates at the same rate as the differentiator of the first stage. So, the 1/(1-z^-1) is infact 1/(1-z^-R1).

[ - ]

@flutekick

No, you are mixing your understanding of the structure of the filter and the math, you are trying to take a short cut with the math.  Start with the equations I posted and purely via the math get to your claim and you will see if it will work or not - how do you reduce 1-z^{-R} to 1-z^{-1}?

[ - ]

Hi Chris,

Could you help me with what is wrong with the math? Atleast what i was referring to is given below with simplied diagram. Let me know what is wrong in the below diagram. Highlighted the portion which I am mentioning can be cancelled out.

[ - ]

Y'know, when I'm dealing with a smart person who I think is wrong, and the discussion isn't proceeding, I often just go dark while I scurry off and try stuff out on my own.  Then I know for sure, and I can either report positive findings or say "oh, on reflection, you seem to be right!"

[ - ]

The OP did try and simulate (stated "conceptually it seems fine, I am not able to prove it right in Matlab").  I think the OP would like a step-by-step proof if it should or should not work.

I have not done the math to prove yes or no but it seems to me you can't simply pull out that middle blocks and arbitrary try to cancel them because, in the math, the comb sections rely on the decimation, mathematically you can't separate them (I think).  If you move the decimate by A to the end you have to change the comb sections back to $$1-z^{-A}$$.

If I truly thought something was there, my approach would be to try and rearrange the original equations to a form that is similar to my filter structure.

[ - ]

For the combs and integrators that he's talking about, the sampling rate is the same -- so from that perspective I not only see no reason why they can't be optimized out, I see no possibility that they can't be optimized out.

However, see my comments on word widths elsewhere -- I think that would be the killer, unless there was some economical way to compensate.

[ - ]

Yes, I concede you should be able to do the cancelling (seems the OP proved this via simulation, this thread needs time tags since it gets reordered by thumbs up).  I was the one not appreciating (comprehending) the math to structure :)

[ - ]

Wowzers, I cannot get the inline math to work :(

[ - ]

slash open-paren, math, slash close-paren.

This may work:

$$\frac{z - 1}{z}$$


and

$$\frac{z - 1}{z}$$

[ - ]

Hi Chris! For some reasons, you had some html code (spans) around one of your ')'.  I removed the tags by editing the code of your post and now it looks like the inline math is working.

[ - ]

Thanks, that probably occurred because I went to the tips post and "copied" the inlined example instead of just typing it.  Good tip for the future, if I am having issues look at the raw HTML.

[ - ]
Hi flutekick. Good for you for asking such a sensible question.

Chris Felton’s advice is good!  To think more about your question, reduce your two filters from 3rd-order to 1st-order.  Next move the two downsample steps over to the extreme right side of your block diagram, this will cause the comb (differentiator) delay lines to be expanded in length.  Now look at your new simple block diagram and see if it looks like the comb delay line of first stage and the integrator of second stage can be removed.

[ - ]

Hi Rick,

Wouldn't that be equivalent to (1-z^-AB)/(1-z^-1) from the simplied diagram I have posted earlier?

Krishna

[ - ]

Hi Krishna,

it looks like your images didn't make it. Can you try to edit your post and upload them again?

Stephane

[ - ]

Hi Stephane,

Thanks for pointing out. I have uploaded them now.

Krishna

[ - ]