Вы находитесь на странице: 1из 27

The Digital Filter Design

Ir. Dadang Gunawan, Ph.D Electrical Engineering University of Indonesia

Session 6 : Digital Filter Design

The Outline
6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 State-of-the-art The advantages of Digital Filter The disadvantages of Digital Filter Types of Digital Filter How to choose the two types ? Example of IIR Filter Example of FIR Filter The three filter ( contd )

Session 6 : Digital Filter Design

The Outline
6.9 6.9.1 6.9.2 6.9.3 6.9.4 6.9.5 6.10 Filter Design Steps Step 1 : Specification of the filter requirements Step 2 : Calculation of the filter coefficients Step 3 : Representation filter by suitable structure Step 4 : Analysis of Finite Wordlength effects Step 5 : Implementation of the filter Review

Session 6 : Digital Filter Design

6.1

State of the art


The Digital Filter is one of the key of DSP A filter is essentially a system or network that selectively changes the wave shape, amplitudefrequency and/or phase-frequency characteristic of a signal in a desired manner A filter is purely mathematical algorithm implemented in hardware/software
Session 6 : Digital Filter Design

6.1

State of the art (contd)


The objectives of filter are to improve the quality of a signal (for example, to remove or reduce noise) Digital filters often operate on digitized analog signals or just numbers, representing some variable, stored in a computer memory Figure 6.1 below represent a simplified block diagram of a real-time digital filter
Session 6 : Digital Filter Design

6.1

Block Diagram of a-real time digital filter with analog input and output signals

Input filter

B-bit ADC with sample and hold

Digital processor

B-bit DAC

Output filter

x(n)
Figure 6.1

y(n)

Session 6 : Digital Filter Design

6.2

The advantages of digital filter


Can have characteristic which are not possible with analog filters, such as a truly linear phase response It doesnt vary with environmental changes such as thermal variations, so that it eliminates the need to calibrate periodically It can be used at very low frequencies, found in many biomedical applications etc.
Find others by yourself
Session 6 : Digital Filter Design

6.3

The disadvantages of digital filter


SPEED LIMITATION

FINITE WORDLENGTH EFFECTS

LONG DESIGN and DEVELOPMENT TIMES

Session 6 : Digital Filter Design

6.4

Types of digital filters

INFINITE IMPULSE RESPONSE (IIR)

FINITE IMPULSE RESPONSE (FIR)


N 1 k =0

y ( n) = h( k ) x ( n k )
k =0

y ( n) = h( k ) x ( n k )

Find out the different !


Session 6 : Digital Filter Design

6.5

How to choose the two types ?


Choose I I R when the only requirements are sharp cutoff filters and high throughput. It will give fewer coefficients than FIR WHY ?

WHY ?

Choose F I R when the the number of filter Coefficients is not too large and when no phase distortion is desired

Session 6 : Digital Filter Design

6.6

Example of IIR filter


Suppose we have one transfer function like this :

b0 + b1 z 1 + b2 z 2 H ( z) = 1 a1 z 1 a2 z 2

Watch the mark + and -

For drawing its block diagram, we have to make the corresponding difference equations :

w(n) = x(n) a1w(n 1) a2 w(n 2) y (n) = b0 w(n) + b1w(n 1) + b2 w(n 2)


Session 6 : Digital Filter Design

6.6

Example of IIR filter (contd)


The block diagram (basic lattice structure) for its IIR filter is :

Figure 6.2 Session 6 : Digital Filter Design

6.7

Example of FIR filter


Suppose we have a transfer function like this :

H ( z ) = h(k ) z 1
k =0

11

For drawing its block diagram, we have to make the corresponding difference equations :

y ( n) = h( k ) x ( n k )
k =0

11

Session 6 : Digital Filter Design

6.7

Example of FIR filter (contd)


The block diagram (basic lattice structure) for its FIR filter is :

Figure 6.3 Session 6 : Digital Filter Design

6.7

Example of FIR filter (contd)


From two block diagram above, we can summarize the computational and storage requirement for both filters :

Discuss the difference Number of multiplications Number of additions Storage locations (coefficients and data )
Session 6 : Digital Filter Design

IIR 5 4 8

FIR 12 11 24

6.8

The three filter


LOW PASS filter : reject the high frequency

HIGH PASS filter : reject the low frequency BAND PASS filter : reject any frequency and pass any frequency
Session 6 : Digital Filter Design

6.9

Filter Design Steps


SPECIFY THE FILTER REQUIREMENTS CALCULATE THE FILTER COEFFICIENT REPRESENT FILTER BY A SUITABLE STRUCTURE ANALYSIS of FINITE WORDLENGTH EFFECTS IMPELEMENT FILTER IN SOFT/HARDWARE
Session 6 : Digital Filter Design

6.9.1

Step 1 : Specification of the filter requirements


There are 6 key parameters of interest :

p s fp fs As Ap

passband deviation stopband deviation passband edge frequency stopband edge frequency stopband attenuation = - 20.log10 s passband ripple = - 20.log10 (1+p)

Session 6 : Digital Filter Design

6.9.1

Step 1 : Specification of the filter requirements (contd)


Here are the position of each parameter in a lowpass filter :

Figure 6.4 Session 6 : Digital Filter Design

6.9.1

Step 1 : Specification of the filter requirements (contd)


This an example of FIR bandpass filter that is designed to the following requirements : - passband : 1.8 3.3 kHz - stopband : 0 - 1.4 kHz and 3.7 5 kHz - stopband deviation : 0.001 - passband deviation : 0.05 - stopband attenuation : - 20.log10 (0.001) = 60 dB - passband ripple : - 20.log10 (1+0.05) = 0.42 dB
Session 6 : Digital Filter Design

6.9.1

Step 1 : Specification of the filter requirements (contd)


According to the value of those requirements, here are the scheme :

Session 6 : Digital Filter Design

Figure 6.5

6.9.2

Step 2 : Calculation of the filter coefficients


There are several method to calculate it : Impulse invariant ( IIR ) Bilinear Transformation ( IIR ) Pole-zero placement ( IIR ) Window ( FIR ) Frequency Sampling ( FIR ) Optimal ( FIR )
Session 6 : Digital Filter Design

FREE YOUR MIND ! Use The Computer

6.9.3

Step 3 : Representation filter by suitable structure


There are some realization structure : Transversal (direct) (FIR) Frequency sampling (FIR) Fast Convolution (FIR) Direct form (I I R) Cascade (I I R) Parallel (I I R)
Session 6 : Digital Filter Design

6.9.4

Step 4 : Analysis of finite wordlength effects


The main sources of performance degradation in digital filters are : ADC noise Input / Output signal quantization Deviations Coefficient quantization in the frequency Arithmetic roundoff errors response Overflow
instability in IIR filter
Session 6 : Digital Filter Design

6.9.5

Step 5 : Implementation of the filter


To implement the filter at least we need : Memory (e.g. ROM) for storing filter coefficients Memory (e.g. RAM) for storing the present and pasts inputs/outputs Hardware and software multipliers Adder or arithmetic logic unit

Session 6 : Digital Filter Design

6.10

Preparation to Review
END of THIS SESSION ARE YOU READY TO REVIEW ?

Before the review, you have to consider yourself. If you feel you dont understand yet.. Please ask.
Session 6 : Digital Filter Design

6.10

Review
1. Explain about Band-stop filter. 2. Try to explore about disadvantages of digital filter. And why it becomes like that ? 3. Compare the advantages and disadvantages between digital filter and analog filter. 4. Please explain about the relationship between Discrete Transformation and Filter Design.

Session 6 : Digital Filter Design

Вам также может понравиться