It is sometimes desirable to have circuits capable of selectively filtering one frequency or range of frequencies out of a mix of different frequencies in a circuit. A circuit designed to perform this frequency selection is called a filter circuit, or simply a filter. A common need for filter circuits is in high-performance stereo systems, where certain ranges of audio frequencies need to be amplified or suppressed for best sound quality and power efficiency. You may be familiar with equalizers, which allow the amplitudes of several frequency ranges to be adjusted to suit the listener's taste and acoustic properties of the listening area. You may also be familiar with crossover networks, which block certain ranges of frequencies from reaching speakers. A tweeter (high-frequency speaker) is inefficient at reproducing low-frequency signals such as drum beats, so a crossover circuit is connected between the tweeter and the stereo's output terminals to block low-frequency signals, only passing high-frequency signals to the speaker's connection terminals. This gives better audio system efficiency and thus better performance. Both equalizers and crossover networks are examples of filters, designed to accomplish filtering of certain frequencies.
1. UNIVERSITY OF BAHRI
COLLAGE OF ENGINEERING AND ARCHITECTURE
ELECTERICAL ENGINEERING (control)
4th
year – 8th
semester
Report about
digital filters design
Present by :
1.محمدإبراهيمباللاحمد
2.معاذعبدهللاإبراهيممحمدعلي
3.محسنعبدالماجداحمدإسماعيل
Supervisor :
Dr. zain alabdeen
2. 1. INTRODUCTION:
It is sometimes desirable to have circuits capable of selectively filtering one frequency or range
of frequencies out of a mix of different frequencies in a circuit. A circuit designed to perform this
frequency selection is called a filter circuit, or simply a filter. A common need for filter circuits
is in high-performance stereo systems, where certain ranges of audio frequencies need to be
amplified or suppressed for best sound quality and power efficiency. You may be familiar with
equalizers, which allow the amplitudes of several frequency ranges to be adjusted to suit the
listener's taste and acoustic properties of the listening area. You may also be familiar with
crossover networks, which block certain ranges of frequencies from reaching speakers. A tweeter
(high-frequency speaker) is inefficient at reproducing low-frequency signals such as drum beats,
so a crossover circuit is connected between the tweeter and the stereo's output terminals to block
low-frequency signals, only passing high-frequency signals to the speaker's connection
terminals. This gives better audio system efficiency and thus better performance. Both equalizers
and crossover networks are examples of filters, designed to accomplish filtering of certain
frequencies.
FILTER:
A filter is one, which rejects unwanted frequencies from the input signal and allows
the desired frequencies. The range of frequencies of signal that are passed through the filter is
called passband and those frequencies that are blocked is called stopband.
The analog and digital filters can be divided into four sub categories –
Lowpass filter
Highpass filter
Bandpass filter
Bandreject filter
3. 2. TYPES OF FILTER:
There are basically two types of filters in application purpose –
o Analog filter designing
o Digital filter designing
Analog filter:
Analog filter is used to filter out signals before conversion to the digital form, meaning they are
used before ADC in the circuit mainly in the analog part of the system. Analog filters are
designed using discrete components such as R (resistor), L (inductor) and C (capacitor).
RF/Microwave based analog filters are designed based on microstrip,strip line circuits or
waveguides etc.
Digitalfilter
Digital filter is used to filter out signals after conversion of the analog signal to the digital form ,
meaning they are used after ADC in the circuit mainly in the digital processing part of the
system. They are referred mainly as FIR or IIR filter, mainly designed in the form of software
ported either on FPGA/DSP .
Examples: FIR and IIR filters developed using C or assembly code or using any other languages.
These are ported on FPGA/DSP processor
.
xn yn
Digital Filter
Sampling
frequency
fS
A
D
C
D
A
C
x(t) y(t)
Analog
anti-
aliasing
filter
Analog
smoothing
filter
4. table (1) distinguish between continuous and digital filter.
CLASSIFICATIONOF DIGITAL FILTER :-
A digital filter transfer function can be realized in variety of way. There are
basically two types of realization
o Recursive
o Nonrecursive
Popularly those two types are known as –
o Infinite Impulse Response (IIR)
o Finite Impulse Response (FIR)
5. 3. THE DESIGN OF A DIGITAL FILTER.
THE DESIGN OF A DIGITAL FILTER IS CARRIED OUT IN THREE STEPS:
1. specifications: they are determined by the applications
2. approximations: once the specification are defined, we use various concepts and mathematics that
we studied so far to come up with a filter description that approximates the given set of
specifications. (in detail)
3. implementation: the product of the above step is a filter description in the form of either a
difference equation, or a system function h(z), or an impulse response h(n). from this description
we implement the filter in hardware or through software on a computer.
IIR FILTER DESIGN:
For recursive realization the current output y(n) is a function of past outputs and
past and present inputs. This form corresponds to an Infinite Impulse Response (IIR) digital
filter. In this section we will discuss type of realization.
IIR filter do not have linear phase response. These filter are easily realized recursively
and are less flexibility, usually limited to specific kind of filters. The round off noise of IIR filter
is more than FIR filter.
IIR filter can be realized in many forms. They are
o Direct form – I realization,
o Direct form – II realization,
o Transposed direct form realization,
o Cascade form realization
o Parallel form realization
o Lattice – ladder structure
6. DIRECT FORM – I REALIZATION:
Let us consider an LTI recursive system described by the difference equation –
Y(n) = - ∑ 𝑎 𝑘
𝑁
𝑘=1 𝑦(𝑛 − 𝑘) + ∑ 𝑏 𝑘
𝑁
𝑘=1 𝑥(𝑛 − 𝑘)
= - a1y(n-1) – a2y(n-2) … - aN-1y(n-N+1) - aN y(n-N) +b0 x(n) + b1 x(n-1) + … +
bM x(n-M)
Let, b0 x(n) + b1 x(n-1) + … + bM x(n-M) = v[n]
Then, y(n) = - a1y(n-1) – a2y(n-2) … - aN-1y(n-N+1) - aN y(n-N) + v[n]
8. Direct form – II realization:
Consider the difference equation of the form
Y(n) = - ∑ 𝑎 𝑘
𝑁
𝑘=1 𝑦(𝑛 − 𝑘) + ∑ 𝑏𝑘
𝑁
𝑘=1 𝑥(𝑛 − 𝑘)
The system function of above difference equation can be expressed as
H(z) =
𝑌(𝑧)
𝑋(𝑧)
=
∑ 𝑏 𝑘 𝑧−𝑘𝑁
𝑘=0
1+∑ 𝑎 𝑘 𝑧−𝑘𝑁
𝑘=1
Let,
𝑌(𝑧)
𝑋( 𝑧)
=
𝑌(𝑧)
𝑤(𝑧)
*
𝑤(𝑧)
𝑋(𝑧)
where,
𝑤(𝑧)
𝑋(𝑧)
=
1
1+∑ 𝑎 𝑘 𝑧−𝑘𝑁
𝑘=1
And,
𝑌(𝑧)
𝑤(𝑧)
= ∑ 𝑏 𝑘 𝑧−𝑘𝑁
𝑘=0
Fig : direct II realization of equation
9. TRANSPOSED DIRECT FORM REALIZATION:
Representation of Direct Form II with signal flow graphs is given as –
The transpose of a structure is defined by the following operations:
o Reverse the direction of all branches in the signal flow graph.
o Interchange the inputs and outputs.
o Reverse the roles of all nodes in the flowgraph.
o Summing points become branching points.
o Brunching points become summing points.
According to transposition theorem, the system transfer function remain unchanged by
transposition.
nwny
nwnw
nwbnwbnw
nwnw
nxnawnw
3
24
41203
12
41
1
1
1
1110
11
nwbnwbny
nxnawnw
10. CASCADE FORM REALIZATION:
Let us consider an IIR system with system function –
H(z) = H1(z) H2 (z) … Hk(z)
This can be represent as the block diagram –
Now realize each Hk(z) in direct form II and cascade all structures.
General form for cascade implementation is -
More practical form in 2nd order systems is –
21
21
1
11
1
1
1
11
1
1
111
111
N
k
kk
N
k
k
M
k
kk
M
k
k
zdzdzc
zgzgzf
AzH
1
1
2
2
1
1
2
2
1
10
1
M
k kk
kkk
zaza
zbzbb
zH
11. PARALLEL FORM REALIZATION:
A parallel form realization of an IIR system can be obtained by performing a partial
expansion of –
H(z) = c + ∑
𝑐 𝑘
1−𝑝 𝑘 𝑧−1
𝑁
𝑘=1
Where, { 𝑝 𝑘} are the poles.
H(z) = c +
𝑐1
1−𝑝1 𝑧−1 +
𝑐2
1−𝑝2 𝑧−1 + … +
𝑐 𝑁
1−𝑝 𝑁 𝑧−1
H(z) =
𝑌(𝑧)
𝑋(𝑧)
= c + H1(z) +H2 (z) + … +HN(z)
Now, 𝑌(𝑧) = c X(z) + H1(z) X(z) + H2(z) X(z) + … + HN(z) X(z)
The transfer function can be also represent as -
SP N
k kk
kk
N
k
k
k
zaza
zee
zCzH
1
2
2
1
1
1
10
0 1
12. Fig : Parallel form realization of equation
FIR FILTER DESIGN:
For non-recursive realization current output sample y(n) is a function of only past and
present inputs. This form corresponds to a Finite Impulse Response (FIR) digital filter.
In many digital processing applications FIR filters are preferred over their IIR
counterparts. The following main advantages of FIR filter over IIR filter are -
FIR filters are always stable.
FIR filters with exactly linear phase can easily be designed.
FIR filters are free of limit cycle oscillation, when implemented on a finite word length
digital system.
FIR filters can be realized in both recursive and non-recursive structures.
The disadvantage of FIR filters are –
13. The implementation of narrow transition band FIR filters are very costly, as it requires
considerably more arithmetic operations and hardware components such as multipliers,
adder and delay elements.
Memory requirement and execution time are very high.
4. Designof FIR filters using windows:
There are different window structures to design a FIR filter, they are –
Rectangular window
The Triangular or Bartlett window
Raised cosine window
Hanning window
Hamming window
Blackman window
Kaiser window
FILTER DESIGN BY WINDOWING:
The basic characteristics of Filter Design by Windowing are –
Simplest way of designing FIR filters
Method is all discrete-time no continuous-time involved
Start with ideal frequency response
Choose ideal frequency response as desired response
Most ideal impulse responses are of infinite length
The easiest way to obtain a causal FIR filter from ideal is
n
nj
d
j
d enheH
deeHnh njj
dd
2
1
else
Mnnh
nh d
0
0
14. More generally
The central lobe of the frequency response of the window should contain most of the
energy and should be narrow.
The highest side lobe level of the frequency response should be small.
The side lobe of the frequency response should decrease in energy rapidly as 𝜔 tends to
𝜋.
Windowing in Frequency Domain
Windowed frequency response can be expressed as mathematically –
The windowed version is smeared version of desired response is expressed in the given below
figure –
else
Mn
nwnwnhnh d
0
01
where
deWeHeH jj
d
j
2
1
15. Here, if w[n]=1 for all n, then W(ej) is pulse train with 2 period .
Properties of Windows:
Prefer windows that concentrate around DC in frequency
-Less smearing, closer approximation
Prefer window that has minimal span in time
-Less coefficient in designed filter, computationally efficient
So we want concentration in time and in frequency
- Contradictory requirements
RECTANGULAR WINDOW:
2/sin
2/1sin
1
1 2/
1
0
M
e
e
e
eeW Mj
j
MjM
n
njj
16. • Narrowest main lob
– 4/(M+1)
– Sharpest transitions at discontinuities in frequency
• Large side lobs
– -13 dB
– Large oscillation around discontinuities
Simplest window possible W[n] = 1 for 0 ≤ n ≤ M
0 elsewher
21. – Complex equation
Kaiser Window Filter Design Method:
else
Mn
M
n
M
n
nw
0
0
4
cos08.0
2
cos5.042.0
22. • Parameterized equation forming a set of windows
– Parameter to change main-lob width and side-lob area trade-off
– I0(.) represents zeroth-order modified Bessel function of 1st kind
else
Mn
I
M
Mn
I
nw
0
0
2/
2/
1
0
2
0
23. MATLABPROGRAMMING SIMULATION:
IIR FILTER METHOD
The following table summarizes the various filter methods in the toolbox and lists the functions available
to implement these methods.
Toolbox Filters Methods and Available Function
25. FIR FILTER
Window-based FIR filter design
SYNTAX
b = fir1(n,Wn)
b = fir1(n,Wn,ftype)
b = fir1(___,window)
b = fir1(___,scaleopt)
DESCRIPTION
b = fir1(n,Wn) uses a Hamming window to design an nth-order lowpass, bandpass, or multiband FIR filter with
linear phase.The filter type depends on the number of elements of Wn.
b = fir1(n,Wn,ftype) designs a lowpass, highpass, bandpass, bandstop, or multiband filter, depending on the value
of ftype and the number of elements of Wn.
b = fir1(___,window) designs the filter using the vector specified in window and any of the arguments from previous
syntaxes.
b = fir1(___,scaleopt) additionally specifies whether or not the magnitude response ofthe filter is normalized.
Note: Use fir2 for windowed filters with arbitrary frequency response.
5. CASE STUDY
by method Window-based FIR filter design
design the following by using matlab
A. Design a 48th-order FIR bandpass filter with passband rad/sample.
Visualize its magnitude and phase responses.
B. Design a lowpass filter with the same specifications. Filter the signal and compare the result to
the original. Use the same y-axis scale for both plots.
26. C. Design a 34th-order FIR highpass filter to attenuate the components of the signal below Fs/4. Use
a cutoff frequency of 0.48 and a Chebyshev window with 30 dB of ripple.
D. Filter the signal. Display the original and highpass-filtered signals. Use the same y-axis scale for
both plots
solution
A. MATLAB CODE
b = fir1(48,[0.35 0.65]);
freqz(b,1,512)
B.
matlab code
>> blo = fir1(34,0.48,chebwin(35,30));
31. 4. CONCLUSION
IIR filters are difficult to control and have no particular phase, whereas FIR filters make a
linear phase always possible. IIR can be unstable, whereas FIR is always stable. IIR,
when compared to FIR, can have limited cycles, but FIR has no limited cycles. IIR is
derived from analog, whereas FIR has no analog history. IIR filters make polyphase
implementation possible, whereas FIR can always be made casual.
Our Command
FIR stands for Finite IR filters, whereas IIR stands for Infinite IR filters. IIR and FIR
filters are utilized for filtration in digital systems. FIR filters are more widely in use,
because they differ in response. FIR filters have only numerators when compared to IIR
filters, which have both numerators and denominators.
32. 5. REFERANCE
here are some various sites from where we collectsome of important information related to our
report .these are : -
1. http://www.rfwireless-world.com/Terminology/analog-filter-vs-digital-filter.html
2. https://ch.mathworks.com/help/signal/ug/iir-filter-
design.html?s_tid=gn_loc_drop#brbq5qb
3. “Design of IIR Filter” by K.S Chandra, M.Tech, IIT-Bombay,Jan-2006
4. “Digital Filter Design” by Prof.A.G. Constantinides, University of Auckland, 2006
5. WWW.WIKIPEDIA.ORG
6. WWW.TUTORIALPOINT.COM
7. DIGITAL SIGNAL PROCESSING BOOKS
BY RAMESH BABU