Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 11

DIGITAL SIGNAL PROCESSING

IIR FILTERS

Edgar Fabela Salvans

A01183339

Ramiro Deter Vsquez Lira A01182824


Jorge Alejandro Porras

A01361608

For this assignment we were asked to modify the previuous equalizer, so that it
could work with IIR filters, thats why, we will have to discuss what an IIR filter is.
IIR filters are digital filters with infinite impulse response. Unlike FIR filters, they
have the feedback (a recursive part of a filter) and are known as recursive digital
filters therefore.

Fig. 1, Comparison
between a FIR filter
and
a
IIR
filter.

We will cover later on much more on this type of filters, but first, lets answer the
question, why should we use IIR filters instead of FIR?
Well the main reason is that IIR filters can achieve a given filtering characteristic
using less memory and calculations than a similar FIR filter, as they are usually
built with much lower order filters, which results in easier and fewer computations.
Although IIR filters have an excellence frequency response, the phase
characteristic is not linear which can cause a problem to the systems which need
phase linearity. For this reason, it is not preferable to use IIR filters in digital signal
processing when the phase is of the essence.

IIR Filters Design


The easiest way to design an IIR filter is the Analog Filter Approximation, on this
method you have to specify the characteristics of the filter that you need, later you
create an analog filter with thos psecifications and finally you transform the transfer
function of the analog filter to the digital domain using one of the methods that we
are going to show later.

Fig 2.- IIR Filter design Block Diagram

Just in the same way we did with digital filters we have to understand that
the filters we create are going to be just approximations to the ideal filter
response as shown in the figure 3.

Fig3. Ideal Filter approximations.

As we mentioned above, the first step in the design process of an IIR filter is to
determine an analog filter that behaves in a similar way to the one we want, from
previous course we know there are several types of filter, we will briefly show some
of the most representatives, and that are actually the ones we are using in this
project.

Butterworth Filter

The Butterworth filter is a type of signal processing filter designed to have as flat a
frequency response as possible in the passband.
The frequency response of the Butterworth filter is maximally flat (i.e. has no
ripples) in the passband and rolls off towards zero in the stopband.[2] When
viewed on a logarithmic Bode plot the response slopes off linearly towards
negative infinity. A first-order filter's response rolls off at 6 dB per octave (20 dB

per decade) (all first-order lowpass filters have the same normalized frequency
response). A second-order filter decreases at 12 dB per octave, a third-order at
18 dB and so on. Butterworth filters have a monotonically changing magnitude
function with , unlike other filter types that have non-monotonic ripple in the
passband and/or the stopband.

Compared with a Chebyshev Type I/Type II filter or an elliptic filter, the Butterworth
filter has a slower roll-off, and thus will require a higher order to implement a
particular stopband specification, but Butterworth filters have a more linear phase
response in the pass-band than Chebyshev Type I/Type II and elliptic filters can
achieve.

Fig4.- Bode diagram of a


Butterworth Filter.

Chebyshev Filter type I and II

Chebyshev filters are analog or digital filters having a steeper roll-off and more
passband ripple (type I) or stopband ripple (type II) than Butterworth filters.
Chebyshev filters have the property that they minimize the error between the
idealized and the actual filter characteristic over the range of the filter but with
ripples in the passband

Fig.5 Bode diagram of a Chebyshev I filter

Fig6. Bode diagram of a Chebyshev II


filter.

Elliptic Filter
An elliptic is a signal processing filter with equalized ripple (equiripple)
behavior in both the passband and the stopband. The amount of ripple in
each band is independently adjustable, and no other filter of equal order can
have a faster transition in gain between the passband and the stopband, for
the given values of ripple.
As the ripple in the stopband approaches
zero, the filter becomes a type I Chebyshev
filter. As the ripple in the passband
approaches zero, the filter becomes a type
II Chebyshev filter and finally, as both ripple
values approach zero, the filter becomes a
Butterworth filter.

Fig7. Bode diagram of an Elliptic filter.


We will not cover the mathematical expression of each filter type, because it is not
this courses material, for this reason we will be using Matlab to obtain the values
once we selected the type of filter that we are going to use.

In the Figure 8 below, we can take a look at the main differences between the four
different kinds of filters we are using in this project.

Fig. 9
Comparison
between main
linear filters.

The next step in our process to design an IIR filter is to determine the best
aproximation method to get from the analog filter to the digital one, these methods
include, impulse invariance, bilinear transformation, zero order hold and Pole
matching.

Impulse Invariance Method.

In this method the response, is the sampled versin of the analogue filter, The
frequency response of the discrete-time system will be a sum of shifted copies of
the frequency response of the continuous-time system; as shown in the images:

Fig9. Sampled version of


the analog filter.

H(s) -> h(t) -> h(nT) -> H(z)

The continuous-time system's impulse response, hc(t), is sampled with sampling


period T to produce the discrete-time system's impulse response, h[n].
h[n]=Thc(nT)
The frequency responses of the two systems are related by
H(ej)=k=Hc(jT+j2Tk)
If the continuous time filter is approximately band-limited (i.e. Hc(j)< when
||/T), then the frequency response of the discrete-time system will be
approximately the continuous-time system's frequency response for frequencies
below radians per sample:
H(ej)=Hc(j/T) for ||

In order to achieve this, the steps followes in this method may be applied as
follows:

It is important to mention here that you can find in Matlab many functions already
built-in to use the impulse invariance method, however for academic purposes
those methods were not used in this project, all the operations were made by
hand.

Bilinear Transform with Prewarping.

The bilinear transform method is the most widely used method, some of the
reasons behind it, are:

A stable analog filter gives a stable digital filter


The passband ripple and the minimum stopband atenuation are preserved.

According to this method, if we have a system with a continuos time transfer


function given by, Ha(S), Hd(z) can be found with the following equationn.

Now if we let small Omega and big Omega, represent the frequency variable in the
analog filter and the derived digital filter, then the previous equation, gives the
frequency response of the digital filter as a function of the frequency response of
the analog filter.

It can be seen from these equations that both frequency responses are going to be
really similar, however as the frequency increases the relation between small
omega and big omega becomes non-linear, and thus distortion is introduced in the
frequency response of the digital filter, this is known as the warping effect.
The warping effect changes the band edges of the digital filter realtive to those of
the analog filter.

Fig10.
Warping
effect on a digital
filter.

In order to avoid this, we will have to implement a method called prewarping,to do


so, we first need to understand that a frequency small omega on the analog filter
corresponds to a digital frequency represented by big omega and hence based on
the previous equations we can see that:

This

equation

leads

to:

Up to this point the process was almost finished, all was left to do was to add the
presets
buttons,
these
buttons simply put the
sliders for each filter in
specific
positions,
depending
on
which
configuration
would
be
better for different music
genres, as rock, classical,
pop among many others.

Fig.10 The final view of the


Equalizers front end or GUI.

As a general conclusion, it is important to mention the impact on some of theory


discussed in class, for example, the Fourier transforms and the convolution, we
can say that with this project, we were able to understand the process behind the
design of digital filters using windows, specifically the Kaiser Window Method, we
learned more about the different types of filters, for example low pass, high pass
and pass band.
We could also understand some aspects, in the standards of digital equalizers for
example their main uses, the band division in octaves. Finally we also improved
our skills in developing Matlab programs, especially GUIs.
Bibliography:
Tratamiento de seales en tiempo discreto, Alan V. Oppenheim.
FIR filter design, opens tax, Rice University at Houston.
The Scientist and Engineer's and Guide to Digital Signal Processing by Steven W.
Smith

You might also like