Digital Signal Processing FIR Filter Design

Slides:



Advertisements
Similar presentations
DSP-CIS Chapter-5: Filter Realization
Advertisements

Chapter 14 Finite Impulse Response (FIR) Filters.
Hossein Sameti Department of Computer Engineering Sharif University of Technology.
Filtering Filtering is one of the most widely used complex signal processing operations The system implementing this operation is called a filter A filter.
Digital Signal Processing – Chapter 11 Introduction to the Design of Discrete Filters Prof. Yasser Mostafa Kadah
LINEAR-PHASE FIR FILTERS DESIGN
Chapter 8 FIR Filter Design
Parks-McClellan FIR Filter Design
AGC DSP AGC DSP Professor A G Constantinides 1 Digital Filter Specifications Only the magnitude approximation problem Four basic types of ideal filters.
ELEN 5346/4304 DSP and Filter Design Fall Lecture 11: LTI FIR filter design Instructor: Dr. Gleb V. Tcheslavski Contact:
Relationship between Magnitude and Phase (cf. Oppenheim, 1999)
Lecture 9 FIR and IIR Filter design using Matlab
Unit III FIR Filter Design
1 Lecture 2: February 27, 2007 Topics: 2. Linear Phase FIR Digital Filter. Introduction 3. Linear-Phase FIR Digital Filter Design: Window (Windowing)
Practical Signal Processing Concepts and Algorithms using MATLAB
Lecture 2 Signals & Systems Review Marc Moonen & Toon van Waterschoot Dept. E.E./ESAT, K.U.Leuven
1 Diagramas de bloco e grafos de fluxo de sinal Estruturas de filtros IIR Projeto de filtro FIR Filtros Digitais.
DSP-CIS Chapter-5: Filter Realization Marc Moonen Dept. E.E./ESAT-STADIUS, KU Leuven
1 Lecture 5: March 20, 2007 Topics: 1. Design of Equiripple Linear-Phase FIR Digital Filters (cont.) 2. Comparison of Design Methods for Linear- Phase.
Filter Design Techniques
Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.
Chapter 7 LTI Discrete-Time Systems in the Transform domain.
DSP-CIS Chapter-4: FIR & IIR Filter Design Marc Moonen Dept. E.E./ESAT, KU Leuven
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.
DSP-CIS Chapter-4: FIR & IIR Filter Design Marc Moonen Dept. E.E./ESAT-STADIUS, KU Leuven
Copyright ©2010, ©1999, ©1989 by Pearson Education, Inc. All rights reserved. Discrete-Time Signal Processing, Third Edition Alan V. Oppenheim Ronald W.
1 Chapter 7 Filter Design Techniques (cont.). 2 Optimum Approximation Criterion (1)  We have discussed design of FIR filters by windowing, which is straightforward.
Dan Ellis 1 ELEN E4810: Digital Signal Processing Topic 9: Filter Design: FIR 1.Windowed Impulse Response 2.Window Shapes 3.Design by Iterative.
P. 1 DSP-II Digital Signal Processing II Lecture 3: Filter Realization Marc Moonen Dept. E.E./ESAT, K.U.Leuven homes.esat.kuleuven.ac.be/~moonen/
1 Chapter 7 FIR Filter Design Techniques. 2 Design of FIR Filters by Windowing (1)  We have discussed techniques for the design of discrete-time IIR.
P. 1 DSP-II Digital Signal Processing II Lecture 7: Modulated Filter Banks Marc Moonen Dept. E.E./ESAT, K.U.Leuven homes.esat.kuleuven.be/~moonen/
Digital Signal Processing II Chapter 3: FIR & IIR Filter Design
1 Lecture 1: February 20, 2007 Topic: 1. Discrete-Time Signals and Systems.
Chapter 2 Signals & Systems Review
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
1 Introduction to Digital Filters Filter: A filter is essentially a system or network that selectively changes the wave shape, amplitude/frequency and/or.
FIR Filter Design & Implementation
Prof. Brian L. Evans Dept. of Electrical and Computer Engineering The University of Texas at Austin EE345S Real-Time Digital Signal Processing Lab Fall.
Chapter 9-10 Digital Filter Design. Objective - Determination of a realizable transfer function G(z) approximating a given frequency response specification.
Chapter 7. Filter Design Techniques
1 Digital Signal Processing Digital Signal Processing  IIR digital filter structures  Filter design.
P. 1 DSP-II Digital Signal Processing II Lecture 2: FIR & IIR Filter Design Marc Moonen Dept. E.E./ESAT, K.U.Leuven homes.esat.kuleuven.be/~moonen/
Transform Analysis of LTI Systems Quote of the Day Any sufficiently advanced technology is indistinguishable from magic. Arthur C. Clarke Content and Figures.
Chapter 4 LTI Discrete-Time Systems in the Transform Domain
Design of FIR Filters. 3.1 Design with Least Squared Error Error Criterion.
DISP 2003 Lecture 5 – Part 1 Digital Filters 1 Frequency Response Difference Equations FIR versus IIR FIR Filters Properties and Design Philippe Baudrenghien,
P. 1 DSP-II Digital Signal Processing II Lecture 3: Filter Realization Marc Moonen Dept. E.E./ESAT, K.U.Leuven homes.esat.kuleuven.ac.be/~moonen/
Lecture 09b Finite Impulse Response (FIR) Filters
Finite Impulse Response Filtering EMU-E&E Engineering Erhan A. Ince Dec 2015.
EEE4176 Application of Digital Signal Processing
DSP-CIS Part-II / Chapter-4 : Filter Design Marc Moonen Dept. E.E./ESAT-STADIUS, KU Leuven
Professor A G Constantinides 1 Digital Filter Specifications We discuss in this course only the magnitude approximation problem There are four basic types.
IIR Filter design (cf. Shenoi, 2006)
Lecture: IIR Filter Design
IIR Filters FIR vs. IIR IIR filter design procedure
J McClellan School of Electrical and Computer Engineering
Fourier Series FIR About Digital Filter Design
LINEAR-PHASE FIR FILTERS DESIGN
Ideal Filters One of the reasons why we design a filter is to remove disturbances Filter SIGNAL NOISE We discriminate between signal and noise in terms.
Chapter 7 FIR Digital Filter Design
Chapter 7 Finite Impulse Response(FIR) Filter Design
Tania Stathaki 811b LTI Discrete-Time Systems in Transform Domain Simple Filters Comb Filters (Optional reading) Allpass Transfer.
Tania Stathaki 811b LTI Discrete-Time Systems in Transform Domain Ideal Filters Zero Phase Transfer Functions Linear Phase Transfer.
Finite Impulse Response Filters
Chapter 7 Finite Impulse Response(FIR) Filter Design
Digital Signal Processing II Lecture 3: Filter Realization
DSP-CIS Chapter-4: FIR & IIR Filter Design
Presentation transcript:

Digital Signal Processing FIR Filter Design Marc Moonen Dept. E.E./ESAT, K.U.Leuven

FIR Filter Design Review of discrete-time systems FIR filters LTI systems, impulse response, transfer function, ... FIR filters Direct form, Lattice, Linear-phase filters FIR design by optimization Weighted least-squares design Minimax design FIR design using `windows’ Equiripple design Software (Matlab,…)

Review of discrete-time systems 1/10 Linear time-invariant (LTI) systems Linear : input u1[k] -> output y1[k] input u2[k] -> output y2[k] hence input a.u1[k]+b.u2[k]-> a.y1[k]+b.y2[k] Time-invariant (shift-invariant) input u[k] -> output y[k] hence input u[k-T] -> output y[k-T] u[k] y[k]

Review of discrete-time systems 2/10 Linear time-invariant (LTI) systems Causal systems: for all input u[k]=0, k<0 -> output y[k]=0, k<0 Impulse response : input 1,0,0,0,... -> output h[0],h[1],h[2],h[3],... input u[0],u[1],u[2],u[3] -> output y[0],y[1],y[2],y[3],... = `convolution’ u[k] y[k]

Review of discrete-time systems 3/10 Impulse response/convolution: u[0],u[1],u[2],u[3],0,0…. y[0],y[1],... h[0],h[1],h[2],0,0,... `Toeplitz’ matrix

Review of discrete-time systems 4/10 Z-Transform:

Review of discrete-time systems 5/10 Z-Transform : input-output relation `shorthand’ notation (for convolution operation/Toeplitz-vector product) stability bounded input u[k] -> bounded output y[k] --iff --iff poles of H(z) inside the unit circle (for causal,rational systems)

Review of discrete-time systems 6/10 Frequency response : given a system with impulse response h[k] given an input signal = complex sinusoid output signal : is `frequency response’ is H(z) evaluated on the unit circle

Review of discrete-time systems 7/10 Frequency response : for a real impulse response h[k] Magnitude response is even function Phase response is odd function example : Nyquist frequency

Review of discrete-time systems 8/10 `Popular’ frequency responses for filter design : low-pass (LP) high-pass (HP) band-pass (BP) band-stop multi-band

Review of discrete-time systems 9/10 Rational transfer functions (`IIR filters’): N poles (zeros of A(z)) , N zeros (zeros of B(z)) corresponds to difference equation

Review of discrete-time systems 10/10 `FIR filters’ (finite impulse response): `Moving average filters’ (MA) N poles at the origin z=0 (hence guaranteed stability) N zeros (zeros of B(z)), `all zero’ filters corresponds to difference equation impulse response

Review of discrete-time systems `FIR filter’ (finite impulse response) design this lecture +++ : phase control (linear phase) guaranteed stability design flexibility minor coefficient sensitivity/quantization/round-off problems,…. - - - : long filters, hence expensive

FIR Filters 1/14 `direct-form’ realization u[k] u[k-4] u[k-3] u[k-2] x bo + b4 b3 b2 b1 y[k]

FIR Filters 2/14 `retiming’ = select subgraph (shaded) remove delay element on all inbound arrows add delay element on all outbound arrows u[k] u[k-1] u[k-2] u[k-3] u[k-4] x bo + b1 b2 b3 b4 x x x x y[k] + + +

FIR Filters 3/14 `retiming’ : results in... u[k] u[k-1] u[k-2] u[k-3] x bo + b1 b2 b3 b4 x x x x y[k] + + +

FIR Filters 4/14 `retiming’ : repeated application results in... `Transposed direct-form’ realization u[k] x bo + y[k] b1 b2 b3 b4

FIR Filters 5/14 `Lattice form’ : derived from combined realization with reversed coefficient vector results in - same magnitude response - different phase response

FIR Filters 6/14 `Lattice form’ : derivation (I) u[k] u[k-1] u[k-2] bo b1 b2 b3 b4 x x x x x b4 b3 b2 b1 bo x x x x x y[k] + + + + y[k] + + + +

FIR Filters 7/14 `Lattice form’ : derivation (II), this is equivalent to... (=simple proof) u[k] u[k-1] u[k-2] u[k-3] u[k-4] b’o b’1 b’2 b’3 x x x x x y[k] b’3 b’2 b’1 b’o x x x x x + x + + + + ko + + + + x y[k] +

FIR Filters 8/14 `Lattice form’ : derivation (III), retiming leads to... …repeat procedure for shaded graph u[k] u[k-2] u[k-2] u[k-3] b’o b’1 b’2 b’3 x x x x y[k] b’3 b’2 b’1 b’o x x x x + x + + + ko + + + x y[k] +

FIR Filters 9/14 `Lattice form’ : derivation (IV), end result is... u[k] k4 x y[k] + + + + x x x x ko k1 k2 k3 x x x x y[k] + + + +

FIR Filters 10/14 `Lattice form’ : ki’s are `reflection coefficients’ procedure for computing ki’s from bi’s corresponds to `Schur-Cohn’ stability test (control theory): all zeros of B(z) are stable (i.e. lie inside unit circle) iff all reflection coefficients statisfy |ki|<1 (i=1,…,N-1) (ps: procedure breaks down if |ki|=1 is encountered)

FIR Filters 11/14 Linear-phase FIR filters Non-causal zero-phase filters : example: symmetric impulse response h[-L],….h[-1],h[0],h[1],...,h[L] h[k]=h[-k], k=1..L frequency response is - real-valued (=zero-phase) transfer function - causal implementation by introducing (group) delay k L

FIR Filters 12/14 Linear-phase FIR filters Causal linear-phase filters : example: symmetric impulse response & N even h[0],h[1],….,h[N] N=2L (even) h[k]=h[N-k], k=0..L frequency response is - causal implementation of zero-phase filter, by introducing (group) delay k N

FIR Filters 13/14 Linear-phase FIR filters Type-1 Type-2 Type-2 Type-4 N=2L=even N=2L+1=odd N=2L=even N=2L+1=odd symmetric anti-symmetric symmetric anti-symmetric h[k]=h[N-k] h[k]=-h[N-k] h[k]=h[N-k] h[k]=-h[N-k] zero at zero at zero at LP/HP/BP LP/BP HP

FIR Filters 14/14 Linear-phase FIR filters efficient direct-form realization. example: u[k] + + + + + bo b1 b2 b3 b4 x x x x x y[k] + + + +

Filter Design by Optimization (I) Weighted Least Squares Design : select one of the basic forms that yield linear phase e.g. Type-1 specify desired frequency response (LP,HP,BP,…) e.g.: LP optimization criterion is where is a weighting function

Filter Design by Optimization …this is equivalent to i.e. convex `Quadratic Optimization’ problem this is often supplemented with additional constraints...

Filter Design by Optimization Example: Low-pass (LP) design optimization criterion is an additional constraint may be imposed to control the pass-band ripple … … as well as the stop-band ripple

PS: Filter Specification

Filter Design using `Windows’ Example : Low-pass filter design ideal low-pass filter is hence ideal time-domain impulse response is truncate hd[k] to N+1 samples : add (group) delay to turn into causal filter

Filter Design using `Windows’ Example : Low-pass filter design (continued) it can be shown that this corresponds to the solution of weighted least-squares optimization with the given Hd, and weighting function for all freqs. truncation corresponds to applying a `rectangular window’ : +++: simple procedure (also for HP,BP,…) - - - : truncation in the time-domain results in `Gibbs effect’ in the frequency domain, i.e. large ripple in pass-band and stop-band, which cannot be reduced by increasing the filter order N.

Filter Design using `Windows’ Remedy : apply windows other than rectangular window: time-domain multiplication with a window function w[k] corresponds to frequency domain convolution with W(z) : candidate windows : Han, Hamming, Blackman, Kaiser,…. (see textbooks, see DSP-I) window choice/design = trade-off between side-lobe levels (define peak pass-/stop-band ripple) and width main-lobe (defines transition bandwidth)

Design Procedure To fully design and implement a filter five steps are required: (1) Filter specification. (2) Coefficient calculation. (3) Structure selection. (4) Simulation (optional). (5) Implementation.

Filter Specification - Step 1

Coefficient Calculation - Step 2 There are several different methods available, the most popular are: Window method. Frequency sampling. Parks-McClellan. We will just consider the window method.

Window Method First stage of this method is to calculate the coefficients of the ideal filter. This is calculated as follows: ( ) ï î í ì = ¹ × ò - n for 2 sin 1 c j d f e H h w p

Window Method Using the Hamming Window: Second stage of this method is to select a window function based on the passband or attenuation specifications, then determine the filter length based on the required width of the transition band. Using the Hamming Window:

Window Method The third stage is to calculate the set of truncated or windowed impulse response coefficients, h[n]: for Where: for

Window Method Matlab code for calculating coefficients: close all; clear all; fc = 8000/44100; % cut-off frequency N = 133; % number of taps n = -((N-1)/2):((N-1)/2); n = n+(n==0)*eps; % avoiding division by zero [h] = sin(n*2*pi*fc)./(n*pi); % generate sequence of ideal coefficients [w] = 0.54 + 0.46*cos(2*pi*n/N); % generate window function d = h.*w; % window the ideal coefficients [g,f] = freqz(d,1,512,44100); % transform into frequency domain for plotting figure(1) plot(f,20*log10(abs(g))); % plot transfer function axis([0 2*10^4 -70 10]); figure(2); stem(d); % plot coefficient values xlabel('Coefficient number'); ylabel ('Value'); title('Truncated Impulse Response'); figure(3) freqz(d,1,512,44100); % use freqz to plot magnitude and phase response

Window Method

Equiripple Design Starting point is minimax criterion, e.g. Based on theory of Chebyshev approximation and the `alternation theorem’, which (roughly) states that the optimal ai’s are such that the `max’ (maximum weighted approximation error) is obtained at L+2 extremal frequencies… …that hence will exhibit the same maximum ripple (`equiripple’) Iterative procedure for computing extremal frequencies, etc. (Remez exchange algorithm, Parks-McClellan algorithm) Very flexible, etc., available in many software packages Details omitted here (see textbooks)

Software FIR Filter design abundantly available in commercial software Matlab: b=fir1(n,Wn,type,window), windowed linear-phase FIR design, n is filter order, Wn defines band-edges, type is `high’,`stop’,… b=fir2(n,f,m,window), windowed FIR design based on inverse fourier transform with frequency points f and corresponding magnitude response m b=remez(n,f,m), equiripple linear-phase FIR design with Parks-McClellan (Remez exchange) algorithm