Copyright © 2003 Texas Instruments. All rights reserved. DSP C5000 Chapter 15 Infinite Impulse Response (IIR) Filter Implementation.

Slides:



Advertisements
Similar presentations
Chapter 15 Infinite Impulse Response (IIR) Filter Implementation
Advertisements

Nonrecursive Digital Filters
ECE 8443 – Pattern Recognition EE 3512 – Signals: Continuous and Discrete Objectives: Filters and Difference Equations Signal Flow Graphs FIR and IIR Filters.
EE513 Audio Signals and Systems Digital Signal Processing (Synthesis) Kevin D. Donohue Electrical and Computer Engineering University of Kentucky.
Signal and System IIR Filter Filbert H. Juwono
Chapter 6 Infinite Impulse Response Filter Design.
CHAPTER 7 Digital Filter Design Wang Weilian School of Information Science and Technology Yunnan University.
ELEN 5346/4304 DSP and Filter Design Fall Lecture 8: LTI filter types Instructor: Dr. Gleb V. Tcheslavski Contact:
Filtering Filtering is one of the most widely used complex signal processing operations The system implementing this operation is called a filter A filter.
Infinite Impulse Response (IIR) Filters
ECE651 Digital Signal Processing I Digital IIR Filter Design.
So far We have introduced the Z transform
Digital Signal Processing – Chapter 11 Introduction to the Design of Discrete Filters Prof. Yasser Mostafa Kadah
Unit 9 IIR Filter Design 1. Introduction The ideal filter Constant gain of at least unity in the pass band Constant gain of zero in the stop band The.
AMI 4622 Digital Signal Processing
Implementation of Basic Digital Filter Structures R.C. Maher ECEN4002/5002 DSP Laboratory Spring 2003.
IIR Filters and Equalizers R.C. Maher ECEN4002/5002 DSP Laboratory Spring 2002.
AGC DSP AGC DSP Professor A G Constantinides 1 Digital Filter Specifications Only the magnitude approximation problem Four basic types of ideal filters.
EE313 Linear Systems and Signals Fall 2010 Initial conversion of content to PowerPoint by Dr. Wade C. Schwartzkopf Prof. Brian L. Evans Dept. of Electrical.
EE513 Audio Signals and Systems Digital Signal Processing (Systems) Kevin D. Donohue Electrical and Computer Engineering University of Kentucky.
Chapter 7 IIR Filter Design
PRINCE BRAVE GUHYAPATI V  Background  Problem Definition  Theoretical Framework  Design Steps  Results  Conclusion.
EE Audio Signals and Systems Digital Signal Processing (Synthesis) Kevin D. Donohue Electrical and Computer Engineering University of Kentucky.
MATLAB for Signal Processing The MathWorks Inc. Natick, MA USA Filter Design.
IIR Filter design (cf. Shenoi, 2006) The transfer function of the IIR filter is given by Its frequency responses are (where w is the normalized frequency.
Chapter 8 Design of infinite impulse response digital filter.
Copyright ©2010, ©1999, ©1989 by Pearson Education, Inc. All rights reserved. Discrete-Time Signal Processing, Third Edition Alan V. Oppenheim Ronald W.
DISP 2003 Lecture 6 – Part 2 Digital Filters 4 Coefficient quantization Zero input limit cycle How about using float? Philippe Baudrenghien, AB-RF.
Infinite Impulse Response Filters
Dan Ellis 1 ELEN E4810: Digital Signal Processing Topic 8: Filter Design: IIR 1.Filter Design Specifications 2.Analog Filter Design 3.Digital.
Z TRANSFORM AND DFT Z Transform
Fundamentals of Digital Signal Processing. Fourier Transform of continuous time signals with t in sec and F in Hz (1/sec). Examples:
Chapter 7 Finite Impulse Response(FIR) Filter Design
Chapter 9-10 Digital Filter Design. Objective - Determination of a realizable transfer function G(z) approximating a given frequency response specification.
1 Conditions for Distortionless Transmission Transmission is said to be distortion less if the input and output have identical wave shapes within a multiplicative.
Lecture 5 BME452 Biomedical Signal Processing 2013 (copyright Ali Işın, 2013)1 BME 452 Biomedical Signal Processing Lecture 5  Digital filtering.
EE422 Signals and Systems Laboratory Infinite Impulse Response (IIR) filters Kevin D. Donohue Electrical and Computer Engineering University of Kentucky.
Chapter 7. Filter Design Techniques
1 Digital Signal Processing Digital Signal Processing  IIR digital filter structures  Filter design.
Digital Signal Processing
First-Order System Revisited
Z Transform The z-transform of a digital signal x[n] is defined as:
Nov '03csDSP61 CS3291: Section 6 IIR discrete time filter design Introduction: Many design techniques for IIR discrete time filters have adopted ideas.
1 Teaching Innovation - Entrepreneurial - Global The Centre for Technology enabled Teaching & Learning, MGI,India DTEL DTEL (Department for Technology.
Chapter 6 Discrete-Time System. 2/90  Operation of discrete time system 1. Discrete time system where and are multiplier D is delay element Fig. 6-1.
DISP 2003 Lecture 5 – Part 1 Digital Filters 1 Frequency Response Difference Equations FIR versus IIR FIR Filters Properties and Design Philippe Baudrenghien,
Finite Impulse Response Filtering EMU-E&E Engineering Erhan A. Ince Dec 2015.
 What is Filter ? A Filter is an electrical network that can transmit signal within a specified frequency range. This Frequency range is called PASS BAND.
1 BIEN425 – Lecture 9 By the end of the lecture, you should be able to: –Describe the properties of ideal filters –Describe the linear / logarithm design.
Professor A G Constantinides 1 Digital Filter Specifications We discuss in this course only the magnitude approximation problem There are four basic types.
Digital Signal Processing
IIR Filter design (cf. Shenoi, 2006)
Figure 8.1 (p. 615) Time-domain condition for distortionless transmission of a signal through a linear time-invariant system. Signals and Systems, 2/E.
UNIT - 5 IIR FILTER DESIGN.
Lecture: IIR Filter Design
EEE4176 Applications of Digital Signal Processing
Speech Signal Processing
IIR Filters FIR vs. IIR IIR filter design procedure
Infinite Impulse Response (IIR) Filters
Chapter 6 IIR Digital Filter Design
EE Audio Signals and Systems
Chapter 8 Design of Infinite Impulse Response (IIR) Digital Filter
ME2300 DIGITAL SIGNAL PROCESSING [Slide 6] IIR Filter Design BY DREAMCATCHER
Infinite Impulse Response Filters
z Transform Signal and System Analysis
Z TRANSFORM AND DFT Z Transform
Chapter 6 Discrete-Time System
Quadrature-Mirror Filter Bank
Chapter 7 Finite Impulse Response(FIR) Filter Design
Chapter 7 Finite Impulse Response(FIR) Filter Design
Presentation transcript:

Copyright © 2003 Texas Instruments. All rights reserved. DSP C5000 Chapter 15 Infinite Impulse Response (IIR) Filter Implementation

Copyright © 2003 Texas Instruments. All rights reserved. ESIEE, Slide 2 IIR Filters  Rational Z transfer function  Linear difference equation

Copyright © 2003 Texas Instruments. All rights reserved. ESIEE, Slide 3 IIR Filters – Poles and Zeros  Roots of the numerator  Roots of the denominator r i are the roots of the z polynomial with b i coefficients. H(z) is null when z is equal to one of the values. They are called the zeroes of the filter and often noted by z i. r i are the roots of the z polynomial with a i coefficients. H(z) tends to infinity when z is close to one of these values. They are called the poles of the filters and often noted by p i.

Copyright © 2003 Texas Instruments. All rights reserved. ESIEE, Slide 4 Z Transfer Function  Define frequency behaviour of the filter  Consider a first order z rational filter: H(z) can be evaluated for each value  n from 0 to 1 with 1 corres- ponding to sampling frequency magnitudephase

Copyright © 2003 Texas Instruments. All rights reserved. ESIEE, Slide 5 Z Transfer Function  We obtain the transfer function by evaluation of the z transform on the unit circle  We can see that it is a minimum phase filter (the phase comes back at 0 at F e /2) because the zero of the filter is inside the unit circle.

Copyright © 2003 Texas Instruments. All rights reserved. ESIEE, Slide 6 Z Transfer Function  If we change the zero z 1 to 1/ z 1 we get the same magnitude transfer function (up to a scale factor) …  But a maximum phase filter (the phase goes to -  at F e /2) because now, the zero lies outside the unit circle.

Copyright © 2003 Texas Instruments. All rights reserved. ESIEE, Slide 7 IIR Filter Synthesis  Starting from frequency specifications (here low pass filter):  F pass : passband end frequency,  F stop : stopband start frequency,  A pass : maximum passband ripple,  A stop : minimum stopband attenuation.

Copyright © 2003 Texas Instruments. All rights reserved. ESIEE, Slide 8 IIR Filters Synthesis  Analog prototype with analog to digital transformation (bilinear transform) :  Digital to analog frequency specification transformation using prewarping  Analog filter prototype  Analog transfer function to digital transfer function transformation using bilinear transform.  Direct digital method : Yule Walker  Try to find the recursive filter of order N which is as close as possible to the frequency specifi- cations using the least square optimization method.

Copyright © 2003 Texas Instruments. All rights reserved. ESIEE, Slide 9 IIR Filters Synthesis  Bilinear transform :  One to one map of analog frquencies to digital frequencies.  Based on the approximation of the continuous integral operator by the trapezoïdal method. Laplacetransform Ztransform Equating integral operators, we get the bilinear transform.

Copyright © 2003 Texas Instruments. All rights reserved. ESIEE, Slide 10 IIR Filters Synthesis  Bilinear transform  Maps the stability region of the Laplace plane inside the unit circle of the complex plane

Copyright © 2003 Texas Instruments. All rights reserved. ESIEE, Slide 11 IIR Filters Synthesis  Bilinear transform : The one to one mapping achieved by this transform prevents aliasing.

Copyright © 2003 Texas Instruments. All rights reserved. ESIEE, Slide 12 IIR Filters Synthesis  Characteristics frequencies (F p, F a ) of the target specifications have to be warped.  This warped specifications is used to compute an analog prototype using approximation functions :  Butterworth  Chebyshev I  Chebyshev II  Elliptic  Then the analog prototype is tranformed into a digital filter that matches target frequency specification thanks to Bilinear Transform (BT) (this cancels the warping introduce at the first step).

Copyright © 2003 Texas Instruments. All rights reserved. ESIEE, Slide 13 IIR Characteristics  Butterworth filters : Defined by its order N and its cut-off frequency f p. Defined by its order N and its cut-off frequency f p. Monotonic magnitude transfer function. Monotonic magnitude transfer function. Matlab commands: buttord : estimate the needed order buttord : estimate the needed order butter : compute the digital filter from butter : compute the digital filter from analog prototype using warping and BT, given the order and cut-off frequency. Sample Matlab code Sample Matlab code

Copyright © 2003 Texas Instruments. All rights reserved. ESIEE, Slide 14 IIR Characteristics  Chebyshev I filters : Defined by its order N, its passband corner Defined by its order N, its passband corner frequency f p and its passband ripple . Ripple in passband and monotonic in stopband. Ripple in passband and monotonic in stopband. Matlab commands: cheb1ord : estimate the needed order cheb1ord : estimate the needed order cheby1 : compute the digital filter from cheby1 : compute the digital filter from analog prototype using warping and BT, Given the order and passband ripple and Corner frequency. Sample Matlab code Sample Matlab code T N ( ) is a Chebyshev polynomial of order N

Copyright © 2003 Texas Instruments. All rights reserved. ESIEE, Slide 15 IIR Characteristics  Chebyshev II filters : Defined by its order N, its stopband edge Defined by its order N, its stopband edge frequency f s and its stopband attenuation . Monotonic in passband and ripple in stopband. Monotonic in passband and ripple in stopband. Matlab commands: cheb2ord : estimate the needed order cheb2ord : estimate the needed order cheby2 : compute the digital filter from cheby2 : compute the digital filter from analog prototype using warping and BT, Given the order and stopband attenuation and edge frequency. Sample Matlab code Sample Matlab code T N ( ) is a Chebyshev polynomial of order N

Copyright © 2003 Texas Instruments. All rights reserved. ESIEE, Slide 16 IIR Characteristics  Elliptic filters : R N ( ) is a Chebyshev rationnal polynomial of order N Defined by its order N, its passband and stopband Defined by its order N, its passband and stopband edge frequencies, f p and f s, its passband ripple and its stopband attenuation . Ripple in passband and in stopband. Ripple in passband and in stopband. Matlab commands: ellipord : estimate the needed order ellipord : estimate the needed order ellip : compute the digital filter from ellip : compute the digital filter from analog prototype using warping and BT, given the order, passband ripple, stopband attenuation and center frequency. Sample Matlab code Sample Matlab code

Copyright © 2003 Texas Instruments. All rights reserved. ESIEE, Slide 17 IIR Characteristics  Group delay  Characterize the phase distorsion (waveform distorsion) introduced by the filter.

Copyright © 2003 Texas Instruments. All rights reserved. ESIEE, Slide 18 IIR structure  Derived from difference equation z -1 b1b1b1b1 b0b0b0b0 b2b2b2b2 b3b3b3b3 b Q-1 -a 1 -a 2 -a 3 -a Q-1 xnxnxnxn ynynynyn non canonical form non canonical form Direct form I

Copyright © 2003 Texas Instruments. All rights reserved. ESIEE, Slide 19 IIR structure z -1 b1b1b1b1 b0b0b0b0 b2b2b2b2 b3b3b3b3 b Q-1 -a 1 -a 2 -a 3 -a Q-1 ynynynyn Direct form II Canonical form Canonical form xnxnxnxn

Copyright © 2003 Texas Instruments. All rights reserved. ESIEE, Slide 20 IIR structure Transposed direct form II b2b2b2b2 b3b3b3b3 b Q-1 -a 1 -a 2 -a 3 -a Q-1 xnxnxnxn Canonical form Canonical form z -1 b1b1b1b1 b2b2b2b2 ynynynyn

Copyright © 2003 Texas Instruments. All rights reserved. ESIEE, Slide 21 IIR – Coefficients quantization  Finite precision of DSP involves coefficients quantization: Let consider the denominator of the transfer function with, the k th quantized coefficients and  a k the quantification error. Quantized denominator is then: The resulting quantified poles will disrupt the transfer function. The higher order the polynomial is, the greater will be pertubation on its roots due to quantization. Following slides illustrate this fact: Next slide shows the transfer function of a 6 th order direct form filter for different quantification. Next slide shows the transfer function of a 6 th order direct form filter for different quantification. Following one shows the transfer function obtained for the same filter and same quantificaiton, but with a cascade structure of second order section, this last structure is much less sensitive to quantization than the previous one. Following one shows the transfer function obtained for the same filter and same quantificaiton, but with a cascade structure of second order section, this last structure is much less sensitive to quantization than the previous one.

Copyright © 2003 Texas Instruments. All rights reserved. ESIEE, Slide 22 Direct structure

Copyright © 2003 Texas Instruments. All rights reserved. ESIEE, Slide 23 Cascade structure of second order section

Copyright © 2003 Texas Instruments. All rights reserved. ESIEE, Slide 24 IIR structure  This sensitivity to coefficients quantization leads to second order cascade or parallel form.  Second order section is chosen to get the least order together with complex conjugated roots. 4 th order example: Parallel form xnxnxnxn ynynynyn Cascade form Partial fraction expansion c0c0 xnxnxnxn ynynynyn Spectral factorisation

Copyright © 2003 Texas Instruments. All rights reserved. ESIEE, Slide 25 IIR – Cascade structure  Cascade structure involves addressing two problems :  Pairing: which zeros with which poles to form a second order rational transfer function. The goal will be minimize the overshoot caused by the poles.  Ordering: which second order section will be ahead and which one will be the last. To answer to this question we will have consider quantification noise and the way to minimize it.

Copyright © 2003 Texas Instruments. All rights reserved. ESIEE, Slide 26 IIR – case study 1  Consider the following specification:  Using inverse Chebyshev approximation, we get a 6 th order filter (matlab commands) [N,Wn]=CHEB2ORD(1800/8000,4000/8000,0.01,50);[B,A]=CHEBY2(N,50,Wn)

Copyright © 2003 Texas Instruments. All rights reserved. ESIEE, Slide 27 IIR – case study 2 Actual transfer function is obtained with: freqz(B,A) Plot of poles and zeros with: zplane(A,B) Pairing: complex conjugate poles closest to the unit circle (responsible for the greatest overshoot) are paired with complex conjugate zeros closest in frequency (angle on unit circle). Then the process iterate with the next complex conjugate closest to the unit circle. This done with the following routine routine 123

Copyright © 2003 Texas Instruments. All rights reserved. ESIEE, Slide 28 IIR – data quantization z -1 b1b1b1b1 b0b0b0b0 b2b2b2b2 -a 1 -a 2 ynynynyn xnxnxnxn Direct form II one noise source b2b2b2b2 -a 1 -a 2 xnxnxnxn b1b1b1b1 z -1 b2b2b2b2 ynynynyn Transposed direct form II two noise sources For DSP, quantification noise appear when we truncate the accumulator to store its high part. (e n equivalent noise source) enenenen enenenen Output noise power is reduced by the ENB of the complete filter Output noise power is only reduced by the ENB of the denominator

Copyright © 2003 Texas Instruments. All rights reserved. ESIEE, Slide 29 IIR – scaling factor  Direct form II z -1 b1b1b1b1 b0b0b0b0 b2b2b2b2 -a 1 -a 2 ynynynyn xnxnxnxn wnwnwnwn To prevent overflow when storing at the node w n, we need a scale factor to have a 0 dB gain from input to this node. This scale factor, , is commonly computed depending on the nature of signal that will be process: Narrow band signal, in this case we use L  norm and we get: Wide band signal, we use L 2 norm and we get: Futhermore we have: z -1 b 1  b 0  b 2  -a 1 -a 2 ynynynyn xnxnxnxn wnwnwnwn  

Copyright © 2003 Texas Instruments. All rights reserved. ESIEE, Slide 30 IIR – ordering  Depend on:  Criteria for scale factor computation, L   or L 2 norm.  Which norm of the quantization noise we want to minimize L   max value) or L 2 norm (power).  Following rules could apply: L  for scale factor and L 2 for noise ascending order of overshoot. L  for scale factor and L 2 for noise ascending order of overshoot. L 2 for scale factor and L  for noise descending order of overshoot. L 2 for scale factor and L  for noise descending order of overshoot. If the same norm is used no prefered order.

Copyright © 2003 Texas Instruments. All rights reserved. ESIEE, Slide 31 Scale factor & ordering  6 th filter example ( look at this routine ) routine : quantization noise source

Copyright © 2003 Texas Instruments. All rights reserved. ESIEE, Slide 32 IIR – coefficients coding  We have to choose the right Qn coding for the coefficients.  For second order section, A(z) or B(z) can be written, if we let their roots to be  Denominator: for stability we need |r|<1, so coefficients belong to [-2,2].  Numerator, by using analog approximation function as prototype we get zeros on the unit circle so |r|=1 and coefficients also belong to [-2,2].  The right coding is then Q 14 for 16 bits word.  Look at this routine which does the work fir the 6 th order filter. routine

Copyright © 2003 Texas Instruments. All rights reserved. ESIEE, Slide 33 IIR – noise power  The noise power at the output of that 6 th order filter: First stage noise power Second stage noise power Third stage noise power Input scale factor attenuates only the input signal not the quantization noise: the lower the scale factor is the worst the signal to noise ratio will be. the lower the scale factor is the worst the signal to noise ratio will be.

Copyright © 2003 Texas Instruments. All rights reserved. ESIEE, Slide 34 IIR - computation  Evaluation of an order 2 direct form II is as follows : ACC=x(n)    ACC=ACC - a 1  w(n-1) ACC=ACC - a 2  w(n-2) ACC<<2 w(n)=ACCH ACC=w(n)  b 0 ACC=ACC + b 2  w(n-2) ACC=ACC + b 1  w(n-1) ACC<<2 y(n)=ACCH w(n-2)=w(n-1) w(n-1)=w(n) Q29=Q15  Q14 Q29=Q29 - (Q15  Q14) Q31=Q29  2 2 Q15 Q29=Q15  Q14 Q29=Q29 + (Q15  Q14) Q31=Q29  2 2 Q15

Copyright © 2003 Texas Instruments. All rights reserved. ESIEE, Slide 35 IIR – program on C54  Following program works on a sample by sample basis and is C callable. program Memory managment  sect1 a 11 a 12 b 12 b 11 b 10 a 21 a 22 b 22 b 21 b 20 *AR2 w 1 (n-1) memfilt w 1 (n-2) w 2 (n-1) w 2 (n-2) *AR3

Copyright © 2003 Texas Instruments. All rights reserved. ESIEE, Slide 36 Follow on Activities for thr C5416 DSK  Laboratory 6 for the C5416 DSK  Implemements high pass and low pass Butterworth filters from 1st order to 6th order.  Laboratory 7 for the C5416 DSK  Implemements band stop and notch filters using poles / zeroes and Bilinear Transform (BLT).  Laboratory 8 for the C5416 DSK  Looks at sharpness of cut off and stability of IIR filters designed by placing poles and zeroes and Bilinear Transform (BLT).

Copyright © 2003 Texas Instruments. All rights reserved. ESIEE, Slide 37 Follow on Activities for thr C5510 DSK  Application 3 for the C5510 DSK  Uses IIR filter for reverberation  Simulates single and multiple reflections from the walls of a room. Introduces the configuration used for an Infinite Impulse Response (IIR) filter.  The majority of the code is written in C, except where the C code would be too slow and assembly code is required