You are on page 1of 11

Technical note on Decimation filter

July 2014

July 2014

A TECHNICAL NOTE ON DECIMATION FILTER

Many applications require analog and digital designs on same chip. Analog to Digital
Converters play an important role in systems, since almost all designs are better in digital
than in analog. For high speed applications, sigma delta ADCs are a widely used ADC type. A
delta-sigma ADC first encodes an analog signal using high-frequency delta-sigma
modulation, and then applies a digital filter to form a higher-resolution but lower samplefrequency digital output. Sigma delta modulator converts the analog input into a pulse stream,
where the frequency of the pulse stream varies with the analog signal input. So the output of
the ADC will be a single bit stream, obtained at a very high sampling rate. This stream is the
input to the decimation filter .the purpose of this filter is to reduce the sampling rate and give
out a signal with less sampling frequency and higher resolution.

Down Sampling

Sampling is one of the prime concepts in understanding digital signal processing.


According to Nyquist, for proper reconstruction of any analog signal, it should be sampled at
a frequency at least twice that of the highest frequency content of the signal. If not the
reconstructed signal will be distorted due to what is called aliasing.
Oversampling
Oversampling of signal is done in SDM for noise-shaping. Here, the signal is sampled
with a frequency many multiples higher than the Nyquist rate. Even though quantisation
noise is same for both Nyquist-sampled and over-sampled ADC, the noise is shifted to higher
frequencies by the SDM. Once the noise is shifted to high frequencies, the band of interest at
the lower frequencies can be secured by easy filtering. This paper describes the decimation
technique used in regard to the sigma delta analog to digital conversion. It also describes

Technical note on Decimation filter

July 2014

decimation in general, techniques used to implement, a structure of decimation filter, types,


how to decide best suited method to pursue decimation among the available options.
Down sampling
An oversampled signal can be down sampled to reduce the data rate and increase the
bit resolution. Reducing sampling rate simply accounts to discarding of some samples and
keeping the rest. Say, down sampling by 4, we will be keeping every fourth sample and
discarding the rest.

Technique of Decimation

Decimation is filtering and down


sampling combined.

Down
samplin
g

Decimati
on
Filtering

If we just discard some samples in the time domain and try to reconstruct the signal, we will
not be able to reconstruct the signal as intended due to aliasing. So, we have to make sure that
all possible aliasing components are filtered before doing down sampling. The process of
filtering and down sampling is collectively called decimation.

Figure 1: Aliasing affects due to down sampling


2

Technical note on Decimation filter

July 2014

The aliasing of signal spectrum can be better understood from the frequency response of
CIC filter with OSR=8, given in Fig.1. [3]. The Fig.1A gives the magnitude response of a
CIC filter before decimation. The region marked B is the required pass band. It is pretty clear
that the pass band is only fractional part of the expected pass band(0 to fsin/8).There is a
reason for this design issue, which will be discussed in following sections.
What happens after decimation is the interesting part. B width bands around each of the
notches, will be folded back to the required pass band, i.e., band of width B centred at 0 Hz.It
can be observed that the largest aliasing component folded into the pass band is below the
peak of band of interest by roughly 16 dB. It can be inferred that, smaller the B, lower will be
the aliased energy after decimation.
How does decimation increase the sample resolution? Here is an example. A decimation
filter down samples by 4 times, a 1-bit bit stream; if we have an input stream like 0110,
counting the number of ones, we get 2. Then the decimation result is 2/4 = 0.5. We can then
represent it with a 2-bits number 10 (binary), which means half of the largest possible
number. In other words,

the sample frequency is reduced by four

the serial input bus becomes parallel output.

Types of decimation filter

Decimation filtering can be done simply using a FIR filter. But the issue is the order of the
filter will be much high if we have to achieve a very narrow cut-off from such a wide
spectrum .Another concern is if we are doing down sampling after filtering, we will be
simply throwing away much of the samples that were processed by the filter, thus wasting so
much of the computations.
Fortunately, there are more efficient ways of doing it using a special type of moving average
filter called CIC (Cascaded Integrator Comb) filter. This genre of filters are found to be of
very handy for designing decimation as well as interpolation. Half band filters are yet another
kind of FIR filters used for decimation. Here we will be giving emphasis on CIC filters in
particular, since they are the best pick if the Oversampling Ratio (OSR) is high. The
decimation filter should act as anti-aliasing filter.

Cascaded Integrator Comb (CIC) filters

Technical note on Decimation filter

July 2014

CIC filters belongs to moving average FIR filters. As the name suggests, they have a series of
integrators and comb filters cascaded with a down sampler separating the two sections. The
cic filters were first proposed by Hogeuneur. The beauty of cic filter is that they need only
adders and delay elements to realise their functionality. Thus they are easy to implement and
more over cost effective since they do not use any multipliers. This makes their
implementation on hardware cost effective, in regards to area and computational complexity.

The transfer function of cic filter is

(Eq.1)
R is the OSR, M is the differential delaying is number of stages. With these parameters one
can design a CIC filter. Now let us see what does the frequency response of CIC filter looks
like. The frequency response of the CIC filter resembles that of a sinc filter. But it differs at
the zero-crossings.Fig.2.
The magnitude response of CIC filter is:

(Eq. 2)

Figure 2: Frequency response of Cascaded Comb Filter

Technical note on Decimation filter

July 2014

From the transfer function of CIC filter we can make out that, it is basically an integrator and
differentiator cascaded. Consider the transfer function for N=1. The denominator part

1/ (1-z-1) corresponds to an integrator, with its pole at unity. The numerator corresponds to
(RM) zeroes at the unity circle. One of these zeroes which falls exactly at the pole of the
integrator cancel each other.Fig.3.

Figure 3: Pole-Zero plot of CIC filter

The frequency response given in Fig.1is that of CIC decimation filter with sampling
frequency 2048 KHz being down converted by OSR 16. As can be seen from the plot, the
CIC filter have peculiar frequency response. In the first place, it does not have a very clear
pass band. Secondly its stop band attenuation is very much gradual. The point here is, how
this filter acts as anti-aliasing filter. For that, the filter has notches were the aliasing
frequencies fall into. The first notch appears at (fs/R). Second notch at 2(fs/R) and so on.
Region around every null is folded into the pass band causing aliasing errors. If fc is the
usable pass band, aliasing bands at every notch is of band 2fc.

So the design challenge is to make the aliasing bands fall exactly into the notches. The
band of interest for us is the first pass band, i.e., up to (fs/R). Here, we meet with a critical
design issue of CIC filter. The useful pass band of the CIC filter is, very limited, as you push
the required pass band towards the Nyquist limit, i.e., Fs_in/2R, the attenuation of the signal
output keeps on increasing. So for a given set of CIC design specifications, the usable pass
band may vary anywhere from 1/8Fs to 1/128Fs or so [1].

Technical note on Decimation filter

July 2014

Implementation of CIC filter

Figure 4: Structure of CIC filter implementation

As mentioned before, implementation of CIC filter requires only adders or simple


accumulators and delay elements.Fig.4. The comb and integrator sections can be
interchanged, so as to reduce the number of delays of the comb filter section. The number of
delayed inputs to be saved can be reduced by the use of a lower clock for the comb section,
generated by dividing the main clock by OSR times. The interchanging of comb and
integrator sections will not affect the function of the filter, since their operations are linear.
At DC, gain of CIC filter will be equal to the delay of the filter, which is here (RM) N. This
needs to be cancelled by taking mean of the filter output during implementation.

Effect of design parameters on filter performance

The design parameters of the CIC filter are R (decimation ratio), M (differential
delay) and N (number of stages). It is to be noted that the number of stages here points to the
number of integrator or comb sections (both will be same) in a CIC filter. It is not to be
confused with multi-stages of decimation where, higher OSR is achieved by more than one
CIC stages in cascade. It is described in later sections.

Technical note on Decimation filter

July 2014

Differential delay is a filter specific parameter which is normally kept to be 1 or 2. M


affects the placement of nulls. Also, increase of M increases the attenuation of side lobes in
the magnitude response. See the magnitude response plot in Fig.5.

Figure 5: Effect of differential delay , M

Decimation ratio for which filter is designed obviously affects the magnitude response.
Increase in R results in increase in attenuation and decrease in width of response side lobes.
The gain of the cic magnitude response is also affected by the decimation ratio. See the plot
for R=8, 16 and 24.Fig.6.

Figure 6: Effect of decimation ratio, R

Technical note on Decimation filter

July 2014

Increasing number of stages (N) or the number of integrators in the filter increases the
order of zeroes in the frequency response. This in turn increases the attenuation at frequencies
at the localities of nulls. This is illustrated in the Fig.7.

Figure 7: Effect of number of stages

Compensation filter for pass band compensation


As can be seen from the plots showing the effect of filter design specifications on the
pass band attenuation, it becomes clear that in order to compensate for the loss in pass band, a
final stage of compensation needs to be performed. A compensation FIR or compensation
CIC filter should be used at the final stage after decimation to compensate the pass band
droop of CIC filter. This filter should have a frequency response, inverse to that of CIC filter.
This will be in effect, an inverse sinc filter. The magnitude response will be the inverse of that
of CIC given in Eq. 2.

Thus, the magnitude response of CIC compensation filter will be,

(Eq. 3)

Technical note on Decimation filter

July 2014

When designing decimation filter for large OSR, the compensation filter can be
designed for decimating by a factor of two at the final stage. The Fig.8 shows the magnitude
compensation provided by the FIR filter when used in cascade with CIC filter with pass band
droop. The design parameters of the compensation filter is same as that of CIC filter if the
compensation filter is an inverse CIC. Compensation filters can also be FIR filters, whose
order and other specifications are decided based on the pass band droop of the CIC.
Compensation FIR filters can be designed using polynomial methods [5].

Figure 8: Effect of Compensation filter on CIC magnitude response

Multi-stage decimation
The pass band droop exhibited by the cic filters can be a bottle-neck for the ADC
design if the OSR is too high and the required pass band is a wide band, almost closer to the
Nyquist limit. In this scenario, it would be good to dissociate the decimation into number of
stages and cascade them. This will help in controlling attenuation since N and R can be kept
low. If the decimation ratio is say, 2048, instead of down sampling by 2048 in one go, it can
be decimated as given in Fig.9.

Figure 9: Multi-stage decimation design

Technical note on Decimation filter

July 2014

Half band filter for decimation


Half Band filters are used in splitting a full band signal of bandwidth W into two
equal sub bands each with bandwidth W/2. Since the bandwidth in the sub band signals is
now half, the sampling rate can also be reduced by a factor of 2.They are also called
quadrature Multi rate filters. Half band filters (HBF) are a class of filters which have their
transition band cantered around fs=4 and exhibit a symmetric response (i.e. linear phase
response). The HBF have odd tap weights equal to zero except for n = 0 and thus allowing
these filters are implemented with half the number of multiplications than the usual filters.
They can be designed to provide a sharp transition band and are well-suited for decimation by
a fixed factor of two. Fig.10 shows the magnitude response of a half band filter which
decimates by a factor of 2, with equal pass band and stop band width.

Figure 10: Half band filter magnitude response

References:
[1] "An Economical Class of Digital Filters for Decimation and Interpolation ",
Eugene.B.Hogenauer, IEEE TRANSACTIONS ON ACOUSTICS, SPEECH, AND SIGNAL
PROCESSING, VOL. ASSP-29, NO. 2, APRIL 1981
[2] "Understanding CIC compensation filters", ALTERA Application Note 455.
[3] "Understanding Cascaded-Integrator comb filters" by Richard Lyons
[4] Hardware-Efcient Implementation of Half-Band IIR Filter for Interpolation and
Decimation,I. H. H. Jrgensen, P. Pracn, and E. Bruun, Senior Member, IEEE, 2013
[5] Polynomial based Design of CIC Compensation Filter used in Software Defined Radio
for Multirate Signal Processing,Richa & R.K. Singh, International Journal of Computer
Applications ,Feb 2012.

10

Technical note on Decimation filter

July 2014

11

You might also like