0% found this document useful (0 votes)
16 views15 pages

Digitalfiltersnotes 15 Oct 2018

The document discusses digital filters. It begins by defining what a filter is and providing a block diagram of a real-time digital filter. Digital filters are preferred over analog filters for applications like data processing due to advantages like linear phase response, programmability, and repeatability. The document then discusses the types of digital filters, including infinite impulse response (IIR) and finite impulse response (FIR) filters. It provides guidance on choosing between IIR and FIR filters and outlines the typical design process for a digital filter.

Uploaded by

Gayatri Shinde
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views15 pages

Digitalfiltersnotes 15 Oct 2018

The document discusses digital filters. It begins by defining what a filter is and providing a block diagram of a real-time digital filter. Digital filters are preferred over analog filters for applications like data processing due to advantages like linear phase response, programmability, and repeatability. The document then discusses the types of digital filters, including infinite impulse response (IIR) and finite impulse response (FIR) filters. It provides guidance on choosing between IIR and FIR filters and outlines the typical design process for a digital filter.

Uploaded by

Gayatri Shinde
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Digital Filters

Prof. (Dr.) Shilpa Sondkar


Department of Instrumentation Engineering
Vishwakarma Institute of Technology, Pune

November 29, 2018

1
1 Introduction to Digital Filters
A filter is a system or network that selectively changes the waveshape, amplitude-
frequency and/or phase-frequency characteristics of a signal in a desired man-
ner. Comman filtering objectives are to improve the quality of a signal, to
extract information from signals or to separate two or more signals previously
combined.
A simplified block diagram of a real time digital filter with analog input and
output signal is shown in fig.1

Figure 1: Block Diagram of Real Time Digital Filter

The analog signal is sampled periodically and converted into a series of


digital samples, x(n), n = 0, 1, . . . The digital processor implements the fil-
tering operation, mapping the input sequence x(n), into the output sequence
y(n) in accordance with the computational algorithm for the filter. The DAC
converts the digitally filtered output into analog values which are then analog
filtered to smooth and remove unwanted high frequency components.
Compared with analog filters digital filters are preferred in a number of ap-
plications like data compression, biomedical signal processing, speech pro-
cessing, image processing, data transmission, digital audio, telephone echo
cancellation etc.

1.1 Advantages of Digital filters


1. They have characteristics linear phase response.

2. Unlike analog filters, the performance of digital filters does not vary
with environmental changes, for example thermal variations, This elim-
inates the need to calibrate periodically.

2 Digital Filters Notes


Prof. (Dr.) Shilpa Y. Sondkar
Instrumentation Engg. Dept.
VIT, Pune
1.2 Disadvantages of Digital filters

3. The frequency response of a digital filtres can be automatically adjusted


since it is implemented using a programmable processor.

4. Several input signals or channels can be filtered by one digital filter


without the need to replicate the hardware.

5. Both the filtered and unfiltered data can be saved for further use.

6. The performance of digital filters is repeatable from unit to unit.

7. Digital filters can be used at very low frequencies applications like


biomedical signal processing where use of analog filters is impractical.

1.2 Disadvantages of Digital filters


1. Speed limitation

• In real time situations, the analog-digital-analog conversion pro-


cess introduces a speed constraint on the digital filter performance.
The conversion time of the ADC and the settling time of the DAC
limit the highest frequency that can be processed.
• The speed of operation of a digital filter depends on the speed
of the digital processor used and on the number of arithmetic
operations that must be performed for the filtering algorithm.

2. Finite Wordlength effects


Digital filters are subkect to ADC noise resulting from quantizing a
continous signal (quantization error), and to round off noie incurred
during computation.

3. Long design and development times


the design and development times for the digital filterrs, especially
hardware development, can be much longer than for analog filters.
However once developed the hardware and/or software can be used
for other filtering or DSP tasks with little or no modifications

1.3 Types of Digital Filters


Digtal filtes are broadly divided into two classes, namely Infinte Impulse
Response (IIR) and Finite Impulse Response (FIR)

3 Digital Filters Notes


Prof. (Dr.) Shilpa Y. Sondkar
Instrumentation Engg. Dept.
VIT, Pune
1.4 Choosing between FIR and IIR filters

Representation for these filters is given below


FIR filter
NX−1
H(z) = h(k)z −k (1)
k=0
IIR filter
N
X
bk z −k
k=0
H(z) = M
(2)
X
1+ ak z −k
k=1

1.4 Choosing between FIR and IIR filters


The choice between FIR and IIR filters depends largely on the relative ad-
vantages of the two filtes types as stated below
1. FIR filters can have an exactly linear phse response which means no
phse distortion is introduced into the signal by the filter. The phse
response of IIR filter are non linear.
2. FIR filters are stable. The stability of IIR filters cannot always be
guaranteed.
3. The effect of using a limited number of bits to implement filters such as
round off noise and coefficients quantization errors are much less severe
in FIR than in IIR.
4. FIR requires more coefficients for sharp cut off filter than IIR
5. Analog filters can be readily transformed into equivalent IIR digital
filters meeting similar specifications. This is not possible with FIR
filters as they have no analog counterpart. However, with FIR it is
easier to synthesize filters of arbitrary frequency response.
A broad guideline on when to use FIR or IIR would be as follows:
1. Use IIR when the oly important requirements are sharp cut off filtes
and high throughput, as IIR filters
2. Use FIR if the number of filter coefficients is not too large and in
particular if little or no phase distortion is desired.

4 Digital Filters Notes


Prof. (Dr.) Shilpa Y. Sondkar
Instrumentation Engg. Dept.
VIT, Pune
1.5 Filter Design Steps

δp = passband ripple or deviation


δs = stopband ripple or deviation
fp or ωp = Passband Edge frequency
fs or ωs = Stopband Edge frequency
Ap = Passband ripple in decibel
Ap = 20log10 (1 + δp )
As = Stopband ripple in decibel
As = −20log10 (δs )

1.5 Filter Design Steps


The design of a digital filter involves five steps as follows
1. Specification of the filter requirements
2. Calculation of suitble filter coefficients
3. Representation of the filter by a suitable structure or realization
4. Analysis of the effects of finite wordlength on filter performance
5. Implementation of filter in software and/or hardware.
Summary of the design stages for digital filter is shown in fig.

1.6 Specification of Filter Requirements


These includes
1. Signal characterristics - types of signal source and sink, I/O interface,
data rates and width, highest frequency of interest
2. The characteristics of the filter - desired amplitude, and/or phase re-
sponse, speed of operation etc.
3. The manner of implementation

1.6.1 Magnitude Characteristics of Low Pass filter


Magnitude Characteristics of Low Pass filter are shown in fig.2
Edge frequecies are often in normalized form i.e f /Fs where Fs is sampling
frequency.

5 Digital Filters Notes


Prof. (Dr.) Shilpa Y. Sondkar
Instrumentation Engg. Dept.
VIT, Pune
Figure 2: Magnitude Characteristics of Low Pass Filter

2 FIR Filter
FIR filter is characterised by the following equation
N
X −1
y(m) = h(n)x(m − n) (3)
n=0

or
N
X −1
H(z) = h(k)z −k (4)
k=0

The objective of FIR coefficient calculation methods is to obtain values of


h(n) such that the resulting filter meets the design specification, such as
amplitude-frequency response and throughput requirements. Several meth-
ods are availabe for obtaining h(n). They are:
• Window Method or Windowing Technique

• Optimal Method

• Frequency Sampling Method or Technique

2.1 Window Method or Windowing Technique


In this method, we begin with the desired frequency response specification
Hd (ω) and determine the corrsponding unit sample response hd (n), where
Hd (ω) and hd (n) are related by Fourier Transform relation as follows:

6 Digital Filters Notes


Prof. (Dr.) Shilpa Y. Sondkar
Instrumentation Engg. Dept.
VIT, Pune
2.2 Steps for the window Method of calculating FIR filter Coefficeints


X
Hd (ω) = hd (n)e−jωn (5)
n=0

and π
1
Z
hd (n) = Hd (ω)ejωn dω (6)
2π −π

In general the unit sample response hd (n) obtained from Eq.(6) is infinite
in duration and must be truncated at some ponit, say at n = M − 1, to yield
a FIR filter of length M.
Truncation of hd (n) to a length M − 1 is equivalent to multiplying hd (n)
by a window function, w(n), whose duration is finite.

2.2 Steps for the window Method of calculating FIR


filter Coefficeints
1. Specify the ideal or desired frequency response of the filter Hd (ω).

2. Obtain the impulse response hd (n) of the desired filter by evaluting the
inverse Fourier transform in Eq.(6).

3. Select a window function that satisfies the passband ripple or stop


band attenuation specifications and then determine the number of filter
coefficients using the appropriate relationship between the filter length
and the transition width, ∆F .

4. Obtain values of w(n) for the choosen window function and the valuse
of the actual FIR coefficients, h(n) by multiplying hd (n) by w(n).

h(n) = hd (n)w(n) (7)

2.3 Design of a symmetric low pass linear phase FIR


filter
For such a filter the desired frequency response is given by
 (M −1)

Hd ((ω) = 1.e 0 ≤| ω |≤ ωc
−jω 2

0 otherwise

7 Digital Filters Notes


Prof. (Dr.) Shilpa Y. Sondkar
Instrumentation Engg. Dept.
VIT, Pune
where M is the length of filter. The corresponding unit sample response is
obtained by evaluating the integral as given below:
Z ωc
1 (M −1)
hd (n) = e−jω 2 dω (8)
2π ωc

which results into


(M −1)
sin (ωc (n − 2
)) M −1
hd (n) = (M −1)
f or n 6= (9)
π(n − ) 2
2

To obtain hd (n) for n = (M2−1) use L’Hospitals rule.


To obtain the filter coefficients h(n) multiply hd (n) by the window function
w(n). Such filter are symmetric about (M2−1) .

3 IIR Filter
IIR filters are characterised by
N
X M
X
y(n) = bk x(n − k) − ak y(n − k) (10)
k=0 k=1

or
N
X
bk z −k
k=0
H(z) = M
(11)
X
1+ ak z −k
k=1

To design IIR filter means to obtain the coefficients ak and bk .


IIR digital filters are obtained by beginning with an analog filter and then
using a mapping to transform the s-plane into the z-plane. Thus the design
of a digital filter is reduced to designing an appropriate analog filter and than
performing the conversion from H(s) to H(z) in such a way so as to preserve
as much as possible, the desired characteristics of the analog filter.
In analog filter design the low pass filter is designed first, then by using
spectral or frequency transformation the lowpass prototype filter is converted
to either a high pass, band pass or a band stop filter.

8 Digital Filters Notes


Prof. (Dr.) Shilpa Y. Sondkar
Instrumentation Engg. Dept.
VIT, Pune
4 Characteristics of common Analog filters
Following are the charaterised analog filters.

1. Butterworth filter

2. Chebyshev filter type I filter

3. Chebyshev filter type II filter

4. Elliptical filters

5. Bessel filters

Above all filters possess different characteristics equation for filters.

5 Butterworth filters
Low pass butterworth filters are all pole filters characterized by the magni-
tude -squared frequency response.
1
|H(Ω)|2 = (12)
1 + ( ΩΩC )2N

where N is the order of the filter, ΩC is its −3dB frequency (usually called
the cut off frequency).
By evaluating equ.12 at s = jΩ we get
π (2k+1)π
sk = Ωc ej 2 ej 2N (13)

where k = 0, 1, ...N − 1 Poles of Butterworth filter are sk . The transfer


function is
1
H(s) = (14)
(s − s0 )(s − s1 )(s − s2 )...(s − sk )
The filter order N is given by
 As

10 10 −1
log Ap
10 10 −1
N≥ h i (15)
Ωs
2 log Ωp

9 Digital Filters Notes


Prof. (Dr.) Shilpa Y. Sondkar
Instrumentation Engg. Dept.
VIT, Pune
where
As is stop band attentuation in dB.
Ap is pass band ripple in dB.
Ωs is stop band edge frequency in radian per sec.
Ωp is pass band edge frequency in radian per sec.

6 Butterworth Analog Low Pass Filter De-


sign
Steps to design Butterworth analog low pass filter is as follows
1. From the given specifications find the order of the filter by using equ.15
2. "  2N #
Ωs
As = 10 log 1 + (16)
Ωc
Find Ωc using the equ.16
3. Obtain the filter transfer function H(s) using equ.(13) and equ.(14).
Denominator of the H(s) for different filter order is shown in table 1
4. H(s) obtained in step 3 is normalized transfer function. Denormalize
this H(s) by substituting s = Ωsc

Table 1: Transfer function denominator for different filter order


Order N H(s) Denominator
1 s+1

2 s2 + 2s+1
3 (s+1)(s2 +s+1)

7 IIR filter design by the Bilinear Transfor-


mation
The bilinear transformation is a conformal mapping that transform the jΩ
axis into the unit circle in the z-plane All points in the LHP of s are mapped

10 Digital Filters Notes


Prof. (Dr.) Shilpa Y. Sondkar
Instrumentation Engg. Dept.
VIT, Pune
7.1 Steps to design IIR filter by Bilinear transformation (BZT)

inside the unit circle in the z-plane and all points in the RHP of s are mapped
into corresponding points out side the unit circle in the z-plane. The mapping
from the s-plane to the z-plane is given
 
2 1 − z −1
s= (17)
T 1 + z −1
This is called the bilinear transformation. Now

z = rejω (18)

and
s = σ + jΩ (19)
if we subtitute equ.18 in equ.17 and solve when r = 1 we get σ = 0 and
2 sin ω
Ω= (20)
T 1 + cos ω
2 ω 
Ω = tan (21)
T 2
or  
ΩT
ω = 2 tan−1
(22)
2
The relationship in equation 22 between the frequency varialbes in the two
domains is shown in fig.3
It is observed that the entire range is Ω (analog frequency domain) is
mapped into the range −π ≤ ω ≤ π (ω digital frequency domain). This
mapping is highly nonlinear. A frequency compression or frequency wraping
is observed. Also bilinear transformation maps the point s = ∞ into the
point z = −1.

7.1 Steps to design IIR filter by Bilinear transforma-


tion (BZT)
1. Prewarp the frequencies as follows
2 ω 
p
ΩP = tan (23)
T 2
2  ωs 
Ωs = tan (24)
T 2

11 Digital Filters Notes


Prof. (Dr.) Shilpa Y. Sondkar
Instrumentation Engg. Dept.
VIT, Pune
7.1 Steps to design IIR filter by Bilinear transformation (BZT)

Figure 3: Mapping of analog and digital frequencies

where
2πfp
ωP = (25)
Fs
2πfs
ωs = (26)
Fs
2. Obtain order of Butterworth filter N using equ.27
 A 
s
log 10 A10p −1
10 10 −1
N≥ h i (27)
2 log ΩΩps

3. Obtain cut off frequency Ωc using equ.28


"  2N #
Ωs
As = 10 log 1 + (28)
Ωc

4. Obtain Butterworth analog filter H(s) refering table 1

12 Digital Filters Notes


Prof. (Dr.) Shilpa Y. Sondkar
Instrumentation Engg. Dept.
VIT, Pune
5. Obtain H(z) by subtituting
 
2 1 − z −1
s= (29)
T 1 + z −1

in step 4.

6. Simplify H(z) to obtain coefficients ak and bk

8 IIR filter design by Impulse Invarient Method


In this method starting with a suitable analog transfer function H(s) the
impulse response h(t) is obtained using the Laplace transform. The h(t)
so obtained is suitably sampled to produce h(nT ) and the desired transfer
function H(z) is then obtained by z- transforming h(nT ) where T is the
sampling interval.
Consider a simple analog filter with the transfer function given by
C
H(s) = (30)
s−p

The impluse response h(t) is given by the inverse Laplace transform of equ.30
 
C
h(t) = L H(s) = L
−1 −1
= Cept (31)
s−p

According to the impluse invariant method, the impulse response of the


equivalent digital filter h(nT ) is equal to h(t) at the discrete times t = nT
whre n = 0, 1, 2, .. that is

h(nT ) = h(t)|t=nT = CepnT (32)

The transfer function of H(z) is obtained by z-transforming h(nT ).



X ∞
X
H(z) = h(nt)z −n = CepnT z −n (33)
n=0 n=0

C
H(z) = (34)
1 − epT z −1

13 Digital Filters Notes


Prof. (Dr.) Shilpa Y. Sondkar
Instrumentation Engg. Dept.
VIT, Pune
8.1 Remarks on the Impulse Invariant Method

Thus from above results we can write


C C
→ (35)
s−p 1 − epT z −1

For multiple poles H(s) first expand H(s) using partial fractions as sum of
single pole filters i.e.
C1 C2 CM
H(s) = + + ... + (36)
s − p1 s − p2 s − pM
M
X Ck
H(s) = (37)
k=1
s − pk
where pk are the poles of H(s). Each term on the right hand side of equ.37
has the same form as equ.30 Therefore we have
M M
X Ck X Ck
→ (38)
k=1
s − pk k=1
1 − epk T z −1

8.1 Remarks on the Impulse Invariant Method


1. The impulse response of the discrete filter h(nT ) is indentical to that
of the analog filter h(t) at the discrete time instants t = nT, n = 0, 1...
It is for this reason that the method is called the impulse invariant
method.

2. The sampling frequency affects the impluse response of the impulse


invariant discrete filter. A sufficiently high sampling frequency is nec-
essary for the frequency response to be close to that of the equivalent
analog filter.

3. Due to the presence of aliasing, the impulse invariance method is ap-


propriate for the design of low pass and bandpass filter only.

4. This method is unsuitable for highpass and bandstop filters since anti
aliasing filters are required.

14 Digital Filters Notes


Prof. (Dr.) Shilpa Y. Sondkar
Instrumentation Engg. Dept.
VIT, Pune
8.2 Step to design IIR filter by Impulse Invariant Method

8.2 Step to design IIR filter by Impulse Invariant Method


1. From the given specification obtain analog filter system function H(s).

2. Expand H(s) using partial fractions.

3. Use equ.38 to obtain H(z).

4. Simplify H(z) obtained in step 3 to obtain the coefficients ak and bk .

15 Digital Filters Notes


Prof. (Dr.) Shilpa Y. Sondkar
Instrumentation Engg. Dept.
VIT, Pune

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy