A nice CIC-Filter, but I can't find the result in the bitsequence!?

I need a CIC-Filter, where I can change the decimation factor during runtime.So I inserted a BlackBox-Block in the SystemGenerator Model with the vdh and edn-file from Core-Generator. It works , but the output has a bitwidth of e.g. UFIX_43_0 and I have to convert this to Fix_16_15. I use the Force-Block to force the signed format, but now here is the problem: Where is the binary point? It's always like guessing. There are some formulas of bitgrowth, but I dont get helpful results. I know it works because for some factors I found the correct conversion, but there is no link. Thanks for answering!

Reply to
bg
Loading thread data ...

A decimating CIC has a DC gain of (N*R)^M where N is the number of clocks delay in the comb section, R is the decimation ratio (i.e. decimate by R), and M is the order of the filter (i.e. the number of cascaded stages). When you change the decimation ratio, the gain changes, and for a typical filter with M=4 or 5, the change can be substantial even for small changes in R. The placement of the binary point depends on where it is on the input. Assuming you aren't truncating any bits internally, then the input and output have the same number of bits to the right of the radix point before compensating for the gain. Note the gain is not constrained to a power of 2, so just shifting the output (by truncating lsbs) is not enough to entirely correct for the filter gain. You'll need a multiplier to fully compensate the gain. The efficient way to do this is to put a barrel shift between the integrator and comb sections to take care of the coarse gain (to the largest power of two less than the CIC gain), and then use a multiplier and look-up addressed by the decimation ratio to accomplish the fine gain adjustment. The fine gain can be done either after the barrel shift or on the filter output.

Reply to
Ray Andraka

Thanks a lot. I knew it would be quite simple, but I couldn't see it.

Reply to
bg

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.