Sunteți pe pagina 1din 6

CIC FILTERS

Understanding cascaded integrator-


comb filters
By Richard Lyons
Consulting Systems Engineer and
Lecturer
Besser Associates

Cascaded integrator-comb
(CIC) digital filters are computa-
tionally efficient implementations
of narrowband lowpass filters and
are often embedded in hardware
implementations of decimation
and interpolation in modern
communications systems. CIC
filters were introduced to the Figure 1: CIC filter applications
signal-processing community,
by Eugene Hogenauer, more filters, I’ll introduce their struc- Because their frequency- A crucial bonus in using CIC
than two decades ago, but their ture and behaviour, present the magnitude-response envelopes filters, and a characteristic that
application possibilities have frequency-domain performance are sin(x)/x-like, CIC filters are makes them popular in hardware
grown in recent years.1 Im- of CIC filters, and discuss sev- typically either followed or pre- devices, is that they require no
provements in chip technology, eral important practical issues in ceded by higher performance multiplication. The arithmetic
the increased use of poly-phase building these filters. linear-phase lowpass tapped- needed to implement these digi-
filtering techniques, advances delay-line FIR filters whose tasks tal filters is strictly additions and
in delta-sigma converter imple- CIC filter applications are to compensate for the CIC subtractions only. With that said,
mentations, and the significant CIC filters are well-suited for anti- filter’s non-flat passband. That let’s see how CIC filters operate.
growth in wireless communi- aliasing filtering prior to decima- cascaded-filter architecture has
cations have all spurred much tion (sample-rate reduction), as valuable benefits. For example, Recursive running-sum filter
interest in CIC filters. shown in Figure 1a and for anti- with decimation, you can greatly CIC filters originate from the no-
While the behaviour and im- imaging filtering for interpolated reduce computational complex- tion of a recursive running-sum
plementation of these filters isn’t signals (sample-rate increase) as ity of narrowband lowpass filter- filter, which is itself an efficient
complicated, their coverage has in Figure 1b. Both applications are ing compared with if you’d used form of a nonrecursive moving
been scarce in the literature of associated with very high—data- a single lowpass finite impulse averager. Recall the standard D-
embedded systems. This article rate filtering, such as hardware response (FIR) filter. In addition, point moving-average process in
attempts to augment the body quadrature modulation and de- the follow-on FIR filter operates Figure 2a. There we see that D-1
of literature for embedded sys- modulation in modern wireless at reduced clock rates minimising summations (plus one multiply
tems engineers. After describ- systems and delta-sigma A/D and power consumption in high-speed by 1/D) are necessary to compute
ing a few applications for CIC D/A converters. hardware applications. the averager output y(n).

Figure 2: D-point averaging filters

EE Times-India | April 2005 | eetindia.com 


The D-point moving-average The recursive running-sum filter’s aging. Next we’ll see how a CIC pulse from the comb filter starts
filter’s output in time is expressed difference equation is: filter is, itself, a recursive running- the integrator’s all-ones output,
as: sum filter. as in Figure 3b. Then, D samples
later, the negative impulse from
CIC filter structures the comb stage arrives at the
If we condense the delay-line integrator to zero all further CIC
representation and ignore the filter output samples.
1/D scaling in Figure 2b we The key issue is that the com-
Equation 4 obtain the classic form of a 1st- bined unit-impulse response
having a z-domain H(z) trans order CIC filter, whose cascade of the CIC filter, being a rectan-
fer function of: structure is shown in Figure 2c. gular sequence, is identical to
Equation 1 The feedforward portion of the the unit-impulse responses of a
CIC filter is called the comb sec- moving-average filter and the
where n is our time-domain in- tion, whose differential delay is recursive running-sum filter.
dex. The z-domain expression for D, while the feedback section is (Moving averagers, recursive run-
this moving averager is: typically called an integrator. The ning-sum filters, and CIC filters are
Equation 5 comb stage subtracts a delayed close kin. They have the same z-
input sample from the current domain pole/zero locations, their
We use the same H(z) vari- input sample, and the integrator frequency magnitude responses
able for the transfer functions is simply an accumulator. The CIC have identical shapes, their phase
of the moving-average filter and filter’s difference equation is: responses are identical, and their
the recursive running-sum filter transfer functions differ only by
because their transfer functions a constant scale factor.) If you
Equation 2 are equal to each other! It’s true. understand the time-domain
Equation 3 is the nonrecursive Equation 6 behaviour of a moving averager,
while its z-domain H(z) trans- expression and Equation 5 is then you now understand the
fer function is: the recursive expression for a and its z-domain transfer func- time-domain behaviour of the
D-point averager. The math- tion is: CIC filter in Figure 2c.
ematical proof of this can be The frequency magnitude
found in my book on digital and linear-phase response of a D
signal processing, but shortly I’ll = 5 CIC filter is shown in Figure
demonstrate that equivalency 4a where the frequency ƒs is the
with an example.2 input-signal sample rate in Hz.
Here’s why we care about Equation 7 We can obtain an expression
recursive running-sum filters: for the CIC filter’s frequency re-
the standard moving averager To see why the CIC filter is sponse by evaluating Equation
in Figure 2a must perform D-1 of interest, first we examine its 7’s Hcic(z) transfer function on the
Equation 3 additions per output sample. The time-domain behaviour, for D = z-plane’s unit circle, by setting z
recursive running-sum filter has 5, shown in Figure 3. If a unit- = ej2πƒ, yielding:
I provide these equations not the sweet advantage that only impulse-sequence, a unity-valued
to make things complicated, but one addition and one subtrac- sample followed by many zero-
because they’re useful. Equation tion are required per output valued samples, was applied to
1 tells us how to build a moving sample, regardless of the delay the comb stage, that stage’s
averager, and Equation 3 is in the length D. This computational output is as shown in Figure 3a.
form used by commercial signal- efficiency makes the recursive Now think, what would be the
processing software to model the running-sum filter attractive output of the integrator if its in-
frequency-domain behaviour of in many applications seeking put was the comb stage’s impulse
the moving averager. noise reduction through aver- response? The initial positive im- Equation 8
The next step in our journey
towards understanding CIC fil-
ters is to consider an equivalent
form of the moving averager,
the recursive running-sum filter
depicted in Figure 2b. There we
see that the current input sample
x(n) is added, and the oldest input
sample x(n-D) is subtracted from
the previous output average y(n-
1). It’s called “recursive” because
it has feedback. Each filter output
sample is retained and used to
compute the next output value. Figure 3: Single-stage CIC filter time-domain responses when D = 5

 eetindia.com | April 2005 | EE Times-India


Using Euler’s identity 2jsin(α)
= ejα - ejα, we can write:

Equation 9

If we ignore the phase factor


in Equation 9, that ratio of sin()
terms can be approximated by a
sin(x)/x function. This means the Figure 4: Characteristics of a single-stage CIC filter when D = 5
CIC filter’s frequency magnitude
response is approximately equal
to a sin(x)/x function centred at
0Hz as we see in Figure 4a. (This
is why CIC filters are sometimes
called sinc filters.)
Digital-filter designers like to
see z-plane pole/zero plots, so
we provide the z-plane charac-
teristics of a D = 5 CIC filter in
Figure 4c, where the comb filter
produces D zeros, equally spaced
around the unit-circle, and the Figure 5: Single-stage CIC filters used in decimation and interpolation
integrator produces a single pole
cancelling the zero at z = 1. Each
of the comb’s zeros, being a Dth
root of 1, are located at z(m) =
ej2πm/D, where m = 0, 1, 2, ..., D-1,
corresponding to a magnitude
null in Figure 4a.
The normally risky situation
of having a filter pole directly on
the unit circle need not trouble
us here because there is no coef-
ficient quantisation error in our
Hcic(z) transfer function. CIC filter
coefficients are ones and can be
represented with perfect preci-
sion with fixed-point number
formats. Although recursive,
happily CIC filters are guaran-
teed stable, linear-phase shown
in Figure 4b, and have finite-
length impulse responses. At
0Hz (DC) the gain of a CIC filter
is equal to the comb filter delay
D. This fact, whose derivation is
available, will be important to us
when we actually implement a
CIC filter in hardware.2 Figure 6: Magnitude response of a 1st-order, D = 8, decimating CIC filter: before decimation; aliasiing after R = 8
Again, CIC filters are primar- decimation
ily used for antialiasing filtering
prior to decimation and for anti- because those operations are comb combination, prior to the but we’ll keep them as separate
imaging filtering for interpo- linear—and include decimation sample rate change, in Figure design parameters for now.
lated signals. With those notions by a sample rate change factor 5a is equal to that in Figure 3c.) The decimation operation ↓R
in mind we swap the order of R in Figure 5a. (You may wish In most CIC filter applications means discard all but every Rth
Figure 2c’s comb and integra- to prove that the unit-impulse the rate change R is equal to sample, resulting in an output
tor—we’re permitted to do so response of the integrator/ the comb’s differential delay D, sample rate of ƒ s,out = ƒs,in /R.

EE Times-India | April 2005 | eetindia.com 


by filtering.) Figure 7a shows an
arbitrary base band spectrum,
with its spectral replications, of
a signal applied to the D = R = 8
interpolating CIC filter of Figure
5b. The filter’s output spectrum
in Figure 7b shows how imperfect
filtering gives rise to the unde-
sired spectral images.
After interpolation, unwanted
images of the B-width base band
spectrum reside at the null cen-
tres, located at integer multiples
of ƒs,out/R. If we follow the CIC
filter with a traditional lowpass
tapped—delay-line FIR filter,
whose stopband includes the
first image band, fairly high image
rejection can be achieved.

Improving CIC attenuation


The most common method to
improve CIC filter anti-aliasing
and image-reject attenuation is
by increasing the order M of the
CIC filter using multiple stages.
Figure 7: 1st-order, D = R = 8, interpolating CIC filter spectra: input spectrum; output spectral images Figure 8 shows the structure
and frequency magnitude re-
sponse of a 3rd-order (M = 3) CIC
decimating filter.
Notice the increased attenu-
ation at ƒ s,out /R in Figure 8b
compared with the 1st-order CIC
filter in Figure 6a. Because the
M = 3 CIC stages are in cascade,
the overall frequency magnitude
response will be the product of
their individual responses or:

Equation 10

Figure 8: 3rd-order CIC decimation filter structure, and magnitude response before decimation when D = R = 8 The price we pay for improved
anti-alias attenuation is additional
To investigate a CIC filter’s fre- Those B-width shaded spec- on the bandwidth B—the smaller hardware adders and increased
quency-domain behaviour in tral bands centred about mul- B is, the lower the aliased energy CIC filter passband droop. An ad-
more detail, Figure 6a shows the tiples of ƒs,in/R in Figure 6a will after decimation. ditional penalty of increased filter
frequency magnitude response alias directly into our desired Figure 5b shows a CIC filter order comes from the gain of the
of a D = 8 CIC filter prior to passband after decimation by R used for interpolation where filter, which is exponential with
decimation. The spectral band, = 8 as shown in Figure 6b. Notice the ↑R symbol means insert R-1 the order. Because CIC filters gen-
of width B, centred at 0Hz is the how the largest aliased spectral zeros between each x(n) sample, erally must work with full preci-
desired passband of the filter. component, in this example, is yielding a y(n) output sample rate sion to remain stable, the number
A key aspect of CIC filters is the roughly 16dB below the peak of of ƒs,out = Rƒs,in. (In this CIC filter of bits in the adders is Mlog2(D),
spectral folding that takes place the band of interest. Of course discussion, interpolation is de- which means a large data word-
due to decimation. the aliased power levels depend fined as zeros-insertion followed width penalty for higher order

 eetindia.com | April 2005 | EE Times-India


Figure 9: Single-stage CIC filter implementations: for decimation; for interpolation

filters. Even so, this multi-stage


implementation is common in
commercial integrated circuits,
where an Mth-order CIC filter is
often called a sincM filter.

Building a CIC filter


In CIC filters, the comb section
can precede, or follow, the inte-
grator section. It’s sensible, how-
ever, to put the comb section on
the side of the filter operating at Figure 10: CIC decimation filter responses: for various values of differential delay N, when R = 8; for two decimation
the lower sample rate to reduce factors when N =2
the storage requirements in
the delay. Swapping the comb An important characteristic of samples reducing its gain by a filter stage and overflow must be
filters from Figure 5 with the rate- a CIC decimator is that the shape factor of 1/R to account for the avoided for the integrators to ac-
change operations results in the of the filter response changes zero-valued samples, so the net cumulate properly. So, we must
most common implementation very little, as shown in Figure gain of an interpolating CIC filter accommodate an extra bit of
of CIC filters, as shown in Figure 10b, as a function of the decima- is (NR)M/R. Because the filter data word growth in each comb
9. Notice the decimation filter’s tion ratio. For values of R larger must use integer arithmetic, the stage for interpolation. There is
comb section now has a delay than roughly 16, the change in word widths at each stage in some small flexibility in discard-
length (differential delay) of N = the filter shape is negligible. This the filter must be wide enough ing some of the least significant
D/R. That’s because an N-sample allows the same compensation to accommodate the maximum bits (LSBs) within the stages
delay after decimation by R is FIR filter to be used for variable- signal (full-scale input times the of a CIC filter, at the expense
equivalent to a D-sample delay decimation ratio systems. gain) at that stage. of added noise at the filter’s
before decimation by R. Likewise The CIC filter suffers from Although the gain of an Mth- output. The specific effects of
for the interpolation filter; an N- register overflow because of the order CIC decimation filter is this LSB removal are, however, a
sample delay before interpolation unity feedback at each integrator (NR)M individual integrators can complicated issue; you can learn
by R is equivalent to a D-sample stage. The overflow is of no con- experience overflow. (Their gain more about the issue by reading
delay after interpolation by R. sequence as long as the following is infinite at DC.) As such, the use Hogenauer’s paper.1
Those Figure 9 configurations two conditions are met: of two’s complement arithmetic While the preceding discus-
yield two major benefits: first, the • the range of the number sys- resolves this overflow situation sion focused on hard-wired CIC
comb section’s new differential tem is greater than or equal to just so long as the integrator filters, these filters can also be im-
delay is decreased to N = D/R the maximum value expected word width accommodates the plemented with programmable
reducing data storage require- at the output, and maximum difference between fixed-point DSP chips. Although
ments; second, the comb section • the filter is implemented with any two successive samples those chips have inflexible data
now operates at a reduced clock two's complement (nonsatu- (in other words, the difference paths and word widths, CIC
rate. Both of these effects reduce rating) arithmetic. causes no more than a single filtering can be advantageous
hardware power consumption. overflow). Using the two’s com- for high sample-rate changes.
The comb section’s differential Because a 1st-order CIC filter plement binary format, with its Large word widths can be ac-
delay design parameter N is typi- has a gain of D = NR at 0Hz (DC), modular wrap-around property, commodated with multi-word
cally 1 or 2 for high sample-rate M cascaded CIC decimation filters the follow-on comb filter will additions at the expense of extra
ratios as is often used in up/down- have a net gain of (NR)M. Each properly compute the correct dif- instructions. Even so, for large
converters. N effectively sets the additional integrator must add ference between two successive sample-rate change factors the
number of nulls in the frequency another NR bits width for stages. integrator output samples. computational workload per
response of a decimation filter, as Interpolating CIC filters have For interpolation, the growth output sample, in fixed-point DSP
shown in Figure 10a. zeros inserted between input in word size is one bit per comb chips, may be small.

EE Times-India | April 2005 | eetindia.com 


Compensation filters
In typical decimation/interpola-
tion filtering applications we
want reasonably flat passband
and narrow transition-region fil-
ter performance. These desirable
properties are not provided by
CIC filters alone, with their droop-
ing passband gains and wide
transition regions. We alleviate
this problem, in decimation for Figure 11: Compensation FIR filter responses; with a 1st-order decimation CIC filter; with a 3rd-order decimation
example, by following the CIC
filter with a compensation non- then must be amplified in the
recursive FIR filter, as in Figure 1a, correction filter, adding noise. As
to narrow the output bandwidth such, practitioners often limit the
and flatten the passband gain. passband width of the compen-
The compensation FIR filter’s sation FIR filter to roughly 1/4 the
frequency magnitude response is frequency of the first null in the
ideally an inverted version of the CIC-filter response.
CIC filter passband response simi- Those dashed curves in Fig-
lar to that shown by the dashed ure 11 represent the frequency
curve in Figure 11a for a simple magnitude responses of com-
three-tap FIR filter whose coeffi- pensating FIR filters within which Figure 12: Frequency magnitude response of a decimate-by-2 compensation
cients are [-1/16, 9/8, -1/16]. With no sample-rate change takes FIR filter
the dotted curve representing place. (The FIR filters’ input and
the uncompensated passband output sample rates are equal to moving-average filter running problem of the traditional recur-
droop of a 1st-order R = 8 CIC the ƒs,out output rate of the deci- at the output sample rate ƒs,out. sive CIC filters. Those advanced
filter, the solid curve represents mating CIC filter.) If a compensat- The cascade implementations in CIC filter architectures are dis-
the compensated response of ing FIR filter were designed to Figure 1 result in total computa- cussed in my book Understanding
the cascaded filters. If either the provide an additional decimation tional workloads far less than us- Digital Signal Processing, 2E.2
passband bandwidth or CIC filter by two, its frequency magnitude ing a single FIR filter alone for high
order increases the correction response would look similar to sample-rate-change decimation Endnotes
becomes greater, requiring more that in Figure 12, where <Iƒ>s,in and interpolation. CIC filter struc- 1. Hogenauer, Eugene. “An Eco-
compensation FIR filter taps. An is the compensation filter’s input tures are designed to maximise nomical Class of Digital Filters
example of this situation is shown sample rate. the amount of low-sample-rate For Decimation and Interpo-
in Figure 11b where the dotted processing to minimise power lation,” IEEE Transactions on
curve represents the passband Advanced techniques consumption in high-speed hard- Acoustics, Speech and Signal
droop of a 3rd-order R = 8 CIC Here’s the bottom line of our CIC- ware applications. Again, CIC filters Processing, Vol. ASSP-29, pp.
filter and the dashed curve, taking filter discussion: a decimating require no multiplication; their 155-162, April 1981.
the form of [x/sin(x)]3, is the re- CIC filter is merely a very efficient arithmetic is strictly addition and 2. Lyons, Richard, Understand-
sponse of a 15-tap compensation recursive implementation of a subtraction. Their performance ing Digital Signal Processing,
FIR filter having the coefficients moving-average filter, with NR allows us to state that, technically 2nd Ed., Prentice Hall, Upper
[-1, 4, -16, 32, -64, 136, -352, 1312, taps, whose output is decimated speaking, CIC filters are lean, mean Saddle River, New Jersey,
-352, 136, -64, 32, -16, 4, -1]. by R. Likewise, the interpolating filtering machines. 2004, pp. 556-561.
A wideband correction also CIC filter is insertion of R-1 zero In closing, there are ways to
means signals near ƒs,out/2 are samples between each input build nonrecursive CIC filters
attenuated with the CIC filter and sample followed by an NR-tap that ease the word-width growth Email   Send inquiry

 eetindia.com | April 2005 | EE Times-India

S-ar putea să vă placă și