Lecture 3 - Design of Digital Filters

Similar documents
Multimedia Signals and Systems - Audio and Video. Signal, Image, Video Processing Review-Introduction, MP3 and MPEG2

-Digital Signal Processing- FIR Filter Design. Lecture May-16

Lecture 9 Infinite Impulse Response Filters

ELEG 305: Digital Signal Processing

DIGITAL SIGNAL PROCESSING. Chapter 6 IIR Filter Design

Filter Analysis and Design

EE482: Digital Signal Processing Applications

Digital Control & Digital Filters. Lectures 21 & 22

EE 521: Instrumentation and Measurements

ECE 410 DIGITAL SIGNAL PROCESSING D. Munson University of Illinois Chapter 12

Filter structures ELEC-E5410

Lecture 7 Discrete Systems

SIGNAL PROCESSING. B14 Option 4 lectures. Stephen Roberts

Digital Signal Processing

UNIVERSITY OF OSLO. Please make sure that your copy of the problem set is complete before you attempt to answer anything.

Time Series Analysis: 4. Linear filters. P. F. Góra

Time Series Analysis: 4. Digital Linear Filters. P. F. Góra

DIGITAL SIGNAL PROCESSING UNIT III INFINITE IMPULSE RESPONSE DIGITAL FILTERS. 3.6 Design of Digital Filter using Digital to Digital

(Refer Slide Time: 01:28 03:51 min)

Lecture 16: Filter Design: Impulse Invariance and Bilinear Transform

UNIVERSITY OF OSLO. Faculty of mathematics and natural sciences. Forslag til fasit, versjon-01: Problem 1 Signals and systems.

2.161 Signal Processing: Continuous and Discrete Fall 2008

Design of IIR filters

IT DIGITAL SIGNAL PROCESSING (2013 regulation) UNIT-1 SIGNALS AND SYSTEMS PART-A

There are two main classes of digital lter FIR (Finite impulse response) and IIR (innite impulse reponse).

DHANALAKSHMI COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING EC2314- DIGITAL SIGNAL PROCESSING UNIT I INTRODUCTION PART A

Question Bank. UNIT 1 Part-A

2.161 Signal Processing: Continuous and Discrete Fall 2008

1 1.27z z 2. 1 z H 2

DEPARTMENT OF EI DIGITAL SIGNAL PROCESSING ASSIGNMENT 1

Stability Condition in Terms of the Pole Locations

/ (2π) X(e jω ) dω. 4. An 8 point sequence is given by x(n) = {2,2,2,2,1,1,1,1}. Compute 8 point DFT of x(n) by

Time and Spatial Series and Transforms

Grades will be determined by the correctness of your answers (explanations are not required).

Digital Signal Processing IIR Filter Design via Bilinear Transform

V. IIR Digital Filters

VALLIAMMAI ENGINEERING COLLEGE. SRM Nagar, Kattankulathur DEPARTMENT OF INFORMATION TECHNOLOGY. Academic Year

Chapter 7: IIR Filter Design Techniques

GATE EE Topic wise Questions SIGNALS & SYSTEMS

Chapter 7: Filter Design 7.1 Practical Filter Terminology

E2.5 Signals & Linear Systems. Tutorial Sheet 1 Introduction to Signals & Systems (Lectures 1 & 2)

LINEAR-PHASE FIR FILTERS DESIGN

LAB 6: FIR Filter Design Summer 2011

Digital Signal Processing Lecture 8 - Filter Design - IIR

Digital Signal Processing Lecture 9 - Design of Digital Filters - FIR

Lecture 8 - IIR Filters (II)

Like bilateral Laplace transforms, ROC must be used to determine a unique inverse z-transform.

DSP. Chapter-3 : Filter Design. Marc Moonen. Dept. E.E./ESAT-STADIUS, KU Leuven

Today. ESE 531: Digital Signal Processing. IIR Filter Design. Impulse Invariance. Impulse Invariance. Impulse Invariance. ω < π.

Recursive, Infinite Impulse Response (IIR) Digital Filters:

Signal Processing Signal and System Classifications. Chapter 13

University of Illinois at Urbana-Champaign ECE 310: Digital Signal Processing

SIDDHARTH GROUP OF INSTITUTIONS:: PUTTUR Siddharth Nagar, Narayanavanam Road QUESTION BANK (DESCRIPTIVE)

Digital Signal Processing Lecture 10 - Discrete Fourier Transform

Discrete-Time David Johns and Ken Martin University of Toronto

Grades will be determined by the correctness of your answers (explanations are not required).

MITOCW watch?v=jtj3v Rx7E

Basic Design Approaches

Digital Signal Processing

2.161 Signal Processing: Continuous and Discrete Fall 2008

EE 3054: Signals, Systems, and Transforms Summer It is observed of some continuous-time LTI system that the input signal.

PS403 - Digital Signal processing

EE 225D LECTURE ON DIGITAL FILTERS. University of California Berkeley

UNIT - III PART A. 2. Mention any two techniques for digitizing the transfer function of an analog filter?

DFT & Fast Fourier Transform PART-A. 7. Calculate the number of multiplications needed in the calculation of DFT and FFT with 64 point sequence.

Signals & Systems. Lecture 5 Continuous-Time Fourier Transform. Alp Ertürk

ELEG 5173L Digital Signal Processing Ch. 5 Digital Filters

Filter Design Problem

UNIVERSITI SAINS MALAYSIA. EEE 512/4 Advanced Digital Signal and Image Processing

Vel Tech High Tech Dr.Ranagarajan Dr.Sakunthala Engineering College Department of ECE

E : Lecture 1 Introduction

APPLIED SIGNAL PROCESSING

Analog and Digital Filter Design

DSP-CIS. Chapter-4: FIR & IIR Filter Design. Marc Moonen

LABORATORY 3 FINITE IMPULSE RESPONSE FILTERS

Lecture 2 OKAN UNIVERSITY FACULTY OF ENGINEERING AND ARCHITECTURE

Electronic Circuits EE359A

EECE 301 Signals & Systems Prof. Mark Fowler

ECSE 512 Digital Signal Processing I Fall 2010 FINAL EXAMINATION

INFINITE-IMPULSE RESPONSE DIGITAL FILTERS Classical analog filters and their conversion to digital filters 4. THE BUTTERWORTH ANALOG FILTER

Chirp Transform for FFT

School of Information Technology and Electrical Engineering EXAMINATION. ELEC3004 Signals, Systems & Control

1. FIR Filter Design

Discrete-time models and control

Exercises in Digital Signal Processing

w n = c k v n k (1.226) w n = c k v n k + d k w n k (1.227) Clearly non-recursive filters are a special case of recursive filters where M=0.

R13 SET - 1

Square Root Raised Cosine Filter

Lecture 4 - Spectral Estimation

EE 311 February 22, 2019 Lecture 13

Fourier Methods in Digital Signal Processing Final Exam ME 579, Spring 2015 NAME

Responses of Digital Filters Chapter Intended Learning Outcomes:

SPEECH ANALYSIS AND SYNTHESIS

Design of Digital Filters

Lecture 8 - IIR Filters (II)

Dynamic Response. Assoc. Prof. Enver Tatlicioglu. Department of Electrical & Electronics Engineering Izmir Institute of Technology.


Digital Signal Processing. Lecture Notes and Exam Questions DRAFT

The Approximation Problem

8.1.6 Quadratic pole response: resonance

Transcription:

Lecture 3 - Design of Digital Filters 3.1 Simple filters In the previous lecture we considered the polynomial fit as a case example of designing a smoothing filter. The approximation to an ideal LPF can be improved by using a higher-degree polynomial: for example, instead of using a quadratic as in the example given in the previous lecture, we could have fitted a least-squares quartic to the original noisy data. The effect of using a higher-degree polynomial is to give both a higher degree of tangency at ω = 0 and a sharper cut-off in the amplitude response. All these methods though are just examples of weighted moving average filters. For example, we consider the the Hanning filter, for which: y[k] = 1 (x[k]+2x[k 1] + x[k 2]) 4 53

This filter produces an output which is a scaled average of three successive inputs, with the centre point of the three weighted twice as heavily as its two adjacent neighbours. 3.1.1 Design by z-domain arguments Taking the z-transfom we obtain a transfer function of the form H(z) = 1 4 (1 + 2z 1 + z 2 ) which has two zeroes at z 2 +2z +1=(z +1) 2 =0i.e. z = 1. Remember that this corresponds to a double damping at the Nyquist frequency. This will give attenuation of HF signals i.e. a LPF effect. Alternatively we could argue to put a pole at DC, some fraction 0 < α < 1 of the way along the real axis. This gives and thus H(z) = 1 z α = z 1 1 αz 1 Y (z)(1 αz 1 )=z 1 X(z) and in difference terms in the digital time domain y[k] =x[k 1] + αy[k 1] 54

which gives a LPF as a recurrent filter (which is thus an IIR filter). In general, we may use out knowledge of the Laplace design of transfer functions to argue the design in the z-domain as well. This is simple for low-order filters (as above), but would be tedious at higher orders there are other ways. 3.2 FIR designs based on window functions FIR filters can also be designed from a frequency response specification. The equivalent sampled impulse response, which determines the coefficientsofthe FIR filter, can then be found by inverse (discrete) Fourier transformation (Discrete Fourier Transforms are not covered until later in the course but the example filter design below should still be easy to follow). Consider an ideal low-pass characteristic (brick-wall filter) G(jω) withacut-off frequency ω c = π/4t where T = sampling period: We know that the continuous impulse response y(t) is given by (and shown in 55

Fig. 3.1): g(t) = 1 2π = ω c π ( sin ωc t G(jω)e jωt dω ) ω c t (3.1) The sampled impulse response g[k] (which would be obtained by taking the 0.25 0.25 0.2 0.2 0.15 0.15 g(t) 0.1 0.05 g[k] 0.1 0.05 0 0 0.05 0.05 0.1 10 5 0 5 10 t 0.1 10 5 0 5 10 kt (T=1) Figure 3.1: Impulse response of brick wall filter in (left) continuous and (right) discrete time domains. inverse DFT of the discrete equivalent brick-wall frequency characteristics) is the sampled version of the continuous sin x x function. It is not possible to implement the corresponding low-pass filter design because: 56

an infinite number of coefficients would be required the impulse response is that of a non-causal system (g[k] exists between k = and k =0). Afirstsolution hence we could, 1. Truncate the expression for g[k] at some reasonable value of k, say10. 2. Shift all the coefficients by the same number. This is shown in Fig 3.2. Now that we have the difference equation y[k] = 20 i=0 a i x[k i] for the filter, we can also obtain its transfer function G(z) = 20 i=0 a i z i 57

0.25 0.2 0.15 shift g[k] 0.1 0.05 0 0.05 0.1 0 5 10 15 20 k Figure 3.2: Impulse response of brick wall filter shifted. As before, we can obtain the actual frequency response of the filter by evaluating G(z) on the unit circle (i.e. G(e jωt )). This is shown in Fig 3.3 using both linear and logarithmic plots for the amplitude response. 58

1.4 10 1 1.2 1 10 0 0.8 0.6 10 1 0.4 10 2 0.2 0 0 20 40 60 80 100 120 140 10 3 π/4 0 20 40 60 80 100 120 140 π/4 Figure 3.3: Linear (left) and log (right) responses for 21 and 11 coefficients in the brick wall filter. 59

Better solution The truncation of the impulse response is equivalent to multiplying it by a rectangular window function. This leads to an overshoot and ripple before and after the discontinuity in the frequency response a phenomenom known as Gibb s phenomenom (the overshoot is about 9% see previous Fig). The amplitude of the overshoot does not decrease if more and more coefficients are included in the digital filter. A more successful way of designing an FIR filter is to use a finite weighting sequence w[k]. There are a number of such sequences, for example the Hamming, Hanning or Kaiser windows. { α +(1 α)cos kπ w[k] = N N k N 0 elsewhere If α =0.54 this is the Hamming window, ifα =0.5 thisisthehanning, or raised cosine, window. Fig 3.4 shows the 11 point Hamming window. The Fourier transform of these windows consists of a central lobe which contains most of the energy and side lobes which generally decay very rapidly. 60

1 0.8 w[k] 0.6 0.4 0.2 0 0 2 4 6 8 10 12 k Figure 3.4: 11 point Hamming window. 61

The use of such a window to reduce the Fourier coefficients for the higher frequency terms leads to a reduction in ripple amplitude, at the expense of a slightly worse initial cut-off slope. The frequency response of the 21-coefficient FIR filter Fig. 3.3 is shown in Fig. 3.5 together with that of the equivalent windowed filter (the filter weights on this case being computed from g[k] = g[k].w[k]) using a Hamming window. 62

1.4 1.2 1 π/4 0.8 0.6 0.4 0.2 0 0 20 40 60 80 100 120 140 Figure 3.5: Hamming window removing overshoot. 63

3.2.1 FIR filter design conclusion FIR filters are usually found in applications where waveform distortion due to non-linear phase is harmful. As the 2 examples of filters studied illustrate, FIR filters with exactly linear phase can be designed (they must have an impulse response which is either symmetrical i.e. palindromic coefficients or purely anti-symmetrical). FIR filters are mostly realised as non-recursive structures; such filters are always stable. However, if a sharp cut-off in the amplitude response is required, a large number of coefficients are needed (usually > 100). 64

3.3 Design of IIR filters Most recursive filters have an infinite impulse response, because of the feedback of previous outputs. Practical Infinite-Impulse-Response (IIR) filters are usually based upon analogue equivalents (Butterworth, Chebyshev, etc.), using a transformation known as the bilinear transformation which maps the s-plane poles and zeros of the analogue filter into the z-plane. However, it is quite possible to design an IIR filter without any reference to analogue designs, for example by choosing appropriate locations for the poles and zeroes on the unit circle (Remember: G(e jωt )=0whereverthereisazeroon the unit circle, i.e. complete attenuation of that frequency; on the other hand, G(e jωt ) when there is a pole near the unit circle, i.e. high gain at that frequency). 65

3.4 Bilinear transformation The technique of digitizing an analogue design is the most popular IIR filter design technique, since there is a large amount of theory on standard analogue filters available (some of which was explored in the first half of this lecture course). The bilinear z-transform is a mathematical transformation from the s-domain to the z-domain which preserves the frequency characteristics and is defined by: s = 2 T 1 z 1 1+z 1 where T = sampling period Under this mapping, the entire jω axis in the s-plane is mapped onto the unit circle in the z-plane; the left-half s-plane is mapped inside the unit circle and the right-half s-plane is mapped outside the unit circle. The bilinear transformation gives a non-linear relationship between analogue frequency ω a and digital frequency ω d. Since the frequency response of a digital filter is evaluated by setting z = e jωt : s a = jω a = 2 T 1 e jω d T 1+e jω d T = 2 T e jω dt 2 e jω d T 2 e jω d T 2 + e jω d T 2 = 2 T tanh jω dt 2 66

ie. ω a = 2 T tan ω dt 2 The form of this non-linearity is shown in Fig. 3.6 for the case T =2. For small values of ω d, the mapping is almost linear; for most of the frequency scale, however, the mapping is highly non-linear. ω a 3.5 3 2.5 2 1.5 1 0.5 0 0 0.5 1 1.5 ω d Figure 3.6: The bilinear mapping function, with T = 2 67

The cut-off frequencies of a digital filter will therefore be tangentially warped compared with those of the analogue filter from which it was designed. In order to compensate for this undesirable effect, it is necessary to pre-warp the required cut-off frequencies before designing the analogue filter. Thus the desired set of digital filter cut-off frequencies is determined first. For example, if there are four critcial cut-off frequencies, ω d1, ω d2, ω d3 and ω d4 ). Using the frequency warping relationship derived above, the filter cut-off frequencies are converted to a new set of analogue cut-off frequencies, ω a1, ω a2, ω a3 and ω a4. Finally, an analogue filter is designed with the appropriate warped cut-off frequencies. Applying the bilinear transformation to this analogue filter gives a digital filter with the desired cut-off frequencies. 68

3.4.1 Example: design of IIR filter using bilinear z-transform Design a digital low-pass Butterworth filter with a 3dB cut-off frequency of 2kHz and minimum attenuation of 30dB at 4.25kHz for a sampling rate of 10kHz. Answer f s =10 4 Hz; hence T =10 4 sec. ω d1 =2π 2 10 3 rads/sec; ω d2 =2π 4.25 10 3 rads/sec. Apply pre-warping transformation: ω a1 = 2 T tan ω d1t 2 =2 10 4 tan 0.2π =0.72654 2 T =14.53 103 rads/sec ω a2 = 2 T tan ω d2t =2 10 4 tan 0.425π =83.31 10 3 rads/sec 2 (ie. f a1 =2.3kHz and f a2 =13.3kHz this shows the warping effect near f s 2 ) The order of filter required can now be worked out as before: n log A log ω = log 1010 10 a 83.31 =1.98 ω c log 10 69 14.53

n =2meets the specification For a second-order Butterworth LPF, G(s) = Substitute ω a1 = ω c =0.72654 2 T in above equation and use the bilinear transformation s = 2 T 1 z 1 1+z 1 : ω 2 c s 2 + s 2ω c + ω 2 c G(z) = ( 2 T )2 0.72654 2 ( 2 T )2 ( 1 z 1 1+z 1 ) 2 + 2( 2 T )2 0.72654( 1 z 1 1+z 1 )+( 2 T )2 (0.72654) 2 (NB: ( 2 T ) factor cancels out) 0.52786 G(z) = ( 1 z 1 ) 1+z 2 +1.02749( 1 z 1 )+0.52786 1 1+z 1 1+2z 1 + z 2 G(z) =0.52786 2.55535 0.94427z 1 +0.50038z 2 70

1+2z 1 + z 2 G(z) =0.20657 1 0.36953z 1 +0.19582z 2 from which we can finally write the following difference equation: y[k] =0.20657x[k]+0.41314x[k 1] + 0.20657x[k 2] + 0.36953y[k 1] 0.19582y[k 2] In order to check the magnitude characteristics of the frequency response, re-write G(z) as: z 2 +2z +1 G(z) =0.20657 z 2 0.36953z +0.19582 dc gain: ω d T =0 z =1whichgives G(1) =1 3dB cut-off frequency ω d1 T =0.4π Thus G(e 0.4πj cos 0.8π + j sin 0.8π +2(cos0.4π + j sin 0.4π)+1 )=0.20657 cos 0.8π + j sin 0.8π 0.36953(cos 0.4π + j sin 0.4π)+0.19582 71

ie. G(e 0.4πj 0.8092 + 2.4899j )=0.20657 0.72739 + 0.23634j which gives G =0.707 You can also check the 30dB minimum attenuation requirement by working out G(e 0.85πj ). 72

Implementation is easy

3.4.2 Conclusion With recursive IIR filters, we can generally achieve a desired frequency response characteristic with a filter of lower order than for a non-recursive filter (especially if elliptic designs are used). A recursive filter has both poles and zeroes which can be selected by the designer, hence there are more free parameters than for a non-recursive filter of the same order (only zeroes can be varied). However, when the poles of an IIR filter are close to the unit circle, they need to be specified very accurately (typically 3 to 6 decimal places) if instability is to be avoided. 73