ELEC-C5230 Digitaalisen signaalinkäsittelyn perusteet Lecture 10: Summary Taneli Riihonen 16.05.2016
Lecture 10 in Course Book Sanjit K. Mitra, Digital Signal Processing: A Computer-Based Approach, 4th Edition, McGraw-Hill, 2011. 1 Signals and Signal Processing 1 2 Discrete-Time Signals in the Time Domain 41 3 Discrete-Time Signals in the Frequency Domain 89 4 Discrete-Time Systems 143 5 Finite-Length Discrete Transforms 199 6 z-transform 277 7 LTI Discrete-Time Systems in the Transform Domain 333 8 Digital Filter Structures 417 9 IIR Digital Filter Design 489 10 FIR Digital Filter Design 527 ELEC-C5230 Digitaalisen signaalinkäsittelyn perusteet; Mitra, 4th Edition, Chapters 1-10 2
Analog and Digital Signal Sampling, Nyquist rate
Digital Signals ELEC-C5230 is the basic DSP course given in Aalto The assumption was that you were already familiar with analog systems: ELEC-A7200 Signaalit ja järjestelmät (Signals and Systems) Here you learnt just the digital equivalents ELEC-A7200 ELEC-C5230 a) Analog signal: Continuous in both time and amplitude b) Digital signal: Discrete in both time and amplitude 4
Simplified (Ideal) System Model We had roughly the system below in mind digital analog analog x a (t) ideal A/D conversion x[n] DSP y[n] ideal D/A conversion y a (t) We only considered DSPs that were LTI finite (FIR) and infinite (IIR) impulse response filters 5
Ideally Sampled Signal with Ω T > 2Ω m the Fourier transform of the analog signal x a (t) 1 X a (jω) the highest frequency in analog signal x a (t) -Ω m 0 Ω Ω m P(jΩ) sampling pulse train -Ω T 0 Ω T Ω 1 T X p (jω) -Ω T -Ω m 0 Ω m Ω T Ω Ω T - Ω m 6
Ideally Sampled Signal with Ω T < 2Ω m 1 X a (jω) the highest frequency in x a (t) -Ω m 0 Ω Ω m P(jΩ) -2Ω T -Ω T 0 Ω T 2Ω T Ω 1 T X p (jω) causes aliasing -2Ω T -Ω T -Ω m 0 Ω m Ω T 2Ω T Ω T - Ω m Ω 7
LTI Systems Linearity, time-invariance, causality, stability, time-domain representation, convolution
LTI Systems (1) input sequence x[n] discrete-time system T( ) output sequence LTI systems satisfy: a general operator on sequences 1) Linearity: 2) Time-invariance: (linear) convolution x[n] LTI system h[n] impulse response: 9
LTI Systems (2) LTI system is often required to be also: 1) Causal: 2) BIBO stable: Output does not depend on future inputs Bounded inputs stay bounded at output The output of many causal LTI systems can alternatively be written using a fixed-coefficient difference equation fixed constants (past) outputs (past) inputs 10
LTI Systems (3) It turned out that: 1) If, the system was FIR; - Output is a weighted sum of current and past inputs 2) and otherwise IIR - Output is computed recursively by weighting and summing current and past inputs, and past (only) outputs Filter design: Choose the coefficients {d k } and {p k } so that the output satisfies the desired specification 11
LTI Systems (4) For LTI systems, the impulse response h[n] fully describes the transformation from inputs x[n] to outputs y[n] via convolution: Convolution satisfies the following properties: (commutative) (distributive) (associative) 12
LTI Systems in Transform Domain Fourier transforms z-transform
Frequency Domain Characterization (1) All BIBO stable LTI systems have an equivalent frequency-domain characterization via DTFT: time-domain: frequency-domain: x[n] h[n] Frequency response tells how the amplitude and phase of the input are scaled at each (normalized angular) frequency ω 14
Frequency Domain Characterization (2) There are two components in the filter specification: 1) Magnitude response 2) Phase response (we mainly considered this) For FIR filters, linear phase was also examined Even length Odd length Positive symmetry h[n] n h[n] n Negative symmetry h[n] n h[n] n 15
Frequency Domain Characterization (3) Analysis equation, with operator Synthesis equation, with operator If the DTFT exists, then and we write 16
17
z-domain Characterization (1) The DTFT could be generalized to z-transform that also provided a transform-domain characterization: time-domain: z-domain: x[n] X(z) h[n] H(z) DTFT vs. z-transform Transfer function is a common way to describe filters: If the LTI system is described by a difference equation then H(z) is a ratio of polynomials 18
z-domain Characterization (2) Rational transfer function could be written as: zeros poles The locations of poles determine the region of convergence, which also gives the stability conditions - FIR always stable, IIR if all poles are within unit circle 19
z-domain Characterization (3) Constant-coefficient IIR filter via difference equation The transfer function H(z) reads 20
Filter Design Structures, specifications, FIR vs. IIR filters
Direct-Form I Straightforward concatenation: Direct Form I This form is, in general, not canonic The transfer function here is of order 3, so a canonic structure should have only three delays (here are 6). Direct Form I can be converted to a canonic structure which is called here Direct Form II. 22
Cascade Realizations (SOS) Usually, a cascade realization is such that P k (z) and D k (z) are at most of 2 nd order and for 1 st order sections Example: second order sections (SOS) model 23
Filter Design and Specifications Example: specification for an ideal zero-phase lowpass filter 1 0 Example: magnitude specification for a practical lowpass filter with ripples minimum attenuation 24
Selection of the Filter Type FIR filters: + Linear phase response possible + Stability with quantized coefficients + Always possible to make them causal - Higher order required than using IIR filters IIR filters: + Better attenuation properties + Closed-form approximation formulas - Nonlinear phase response - Instability with finite wordlength computation Oftentimes, N FIR /N IIR is of the order of ten(s) 25
Bilinear Transform Method We learnt the substitution Plugging into the above expression gives left half-plane Ł inside unit circle imaginary axis Ł on unit circle right half-plane Ł outside unit circle so-that the left-hand side of the s-plane maps to unit disc in the z-plane as required 26
Basic IIR Filter Design ELEC-A7200 1) Prewarp the digital frequency specifications using relation 2) If the desired filter is not of lowpass-type, convert the analog filter specifications (Appendix B in book) 3) Design the analog filter H(s) (Butterworth, elliptic, ) 4) Convert the analog transfer function to digital G(z) using bilinear transformation 5) Use spectral transformation to convert the IIR digital lowpass filter into the desired one (if needed) 27
Example: IIR via Bilinear Transform Lowpass digital IIR filter ( good design) After prewarping, analog prototype filter is converted to an IIR digital filter via bilinear transform using Matlab. Prewarping before analog design matches both frequencies Note Butterworth order = 13, so IIR order is also 13 Remark: Here we first prewarp, then design analog prototype with prewarped edge frequencies and then convert it to IIR The edge frequencies are now where we wanted Butterworth has lower order since the correct transition band is used Matlab hints: >> doc bilinear 28
FIR Filter Design with Windowing Recipe: 1) Let the filter specifications be given and assume that the minimum stopband attenuation is db while the passband and stopband edges are 2) Set the cutoff frequency 3) Examine which windows satisfy the requirement for stopband attenuation 4) Estimate the number of coefficients N and compute the impulse response by windowing the ideal filter 29
Example: Lowpass Filter Gain, [db] Lowpass Filter Designed Using Hann window 0-50 -100 0 0.2 0.4 0.6 0.8 1 w/p Lowpass Filter Designed Using Hamming window 0 Filter length N = 2M + 1 = 51 Cutoff frequency Hann has narrowest main lobe shortest transition band Blackman has greatest sidelobe level biggest stopband attenuation Lowpass Filter Designed Using Blackman window 0 Gain, db [db] -50 Gain, db [db] -50-100 -100 0 0.2 0.4 0.6 0.8 1 w/p 0 0.2 0.4 0.6 0.8 1 w/p 30
Example: Matlab FIR Filter Design Fpass = 0.37; Fstop = 0.43; FIR filter with designfilt Ap = 6; Ast = 30; Compare to IIR filter in Slide 28 Matlab code d = designfilt('lowpassfir', 'PassbandFrequency', Fpass,... 'StopbandFrequency', Fstop, 'PassbandRipple', Ap,... 'StopbandAttenuation', Ast, 'DesignMethod', 'equiripple'); fvtool(d); FIR filter Parks-McClellan algorithm Least possible maximum deviation from ideal filter given its length is N Here N = 23 (minimum to satisfy the specification) Linear phase Matlab hints: >> info(d) >> designfilt(d) >> doc signal/firpm 31
Summary What is the minimum you should know? What an LTI system is; how to represent and analyze it in time-, frequency- and z-domains How to compute (linear) convolution, D(T)FT and z-transforms; the main properties of above What ideal filters are and why they are unrealizable Able to interpret and express frequency specifications Know how to design, at least in principle, realizable FIR and IIR filters given frequency-domain specifications Recognize the pros and cons of the designs 32