Equalizer Using Matlab
Equalizer Using Matlab
IIR FILTERS
A01183339
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.
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.
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.
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
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.
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.
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:
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.
The bilinear transform method is the most widely used method, some of the
reasons behind it, are:
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.
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.