Introduction to Digital Signal Processing Using MATLAB Second Edition Robert J. Schilling and Sandra L. Harris Clarkson University Potsdam, NY... CENGAGE l.earning: Australia Brazil Japan Korea Mexico Singapore Spain United Kingdom United States
Contents Margin Contents xvii PART I Signal and System Analysis 1 111... 1 Signal Processing 3 1.1 Motivation 3 1.1.1 Digital and Analog Processing 4 1.1.2 Total Harmonie Distortion (THD) 6 1.1.3 A Notch Filter 7 1.1.4 Active Noise ContraI 7 1.1.5 Video Aliasing 10 1.2 Signals and Systems 11 1.2.1 Signal Classification 11 1.2.2 System Classification 16 1.3 Sampling of Continuous-time Signals 21 1.3.1 Sampling as Modulation 21 1.3.2 Aliasing 23 1.4 Reconstruction of Continuous-time Signals 26 1.4.1 Reconstruction Formula 26 1.4.2 Zero-order Hold 29 1.5 Prefilters and Postfilters 33 1.5.1 Anti-aliasing Filter 33 1.5.2 Anti-imaging Filter 37 *1.6 DAC and ADC Circuits 39 1.6.1 Digital-to-analog Converter (DAC) 39 1.6.2 Analog-to-digital Converter (ADC) 41 1.7 The FDSP Toolbox 46 1.7.1 FDSP Driver Module 46 1.7.2 Toolbox Functions 46 1.7.3 GUI Modules 49 1.8 GUI Software and Case Studies 52 1.9 Chapter Summary 60 Sections marked with a contain more advanced or specialized material thatcan be skipped without loss of continuity. ix
x Contents 1.10 Problems 62 1.10.1 Analysis and Design 62 1.10.2 GUI Simulation 67 1.10.3 MATLAB Computation 68 11I. 2 Discrete-time Systems in the Time Domain 70 2.1 Motivation 70 2.1.1 Home Mortgage 71 2.1.2 Range Measurement with Radar 72 2.2 Discrete-time Signals 74 2.2.1 Signal Classification 74 2.2.2 Common Signals 79 2.3 Discrete-time Systems 82 2.4 Difference Equations 86 2.4.1 Zero-input Response 87 2.4.2 Zero-stare Response 90 2.5 Block Diagrams 94 2.6 The Impulse Response 96 2.6.1 FIR Systems 97 2.6.2 IIR Systems 98 2.7 Convolution 100 2.7.1 Linear Convolution 100 2.7.2 Circular Convolution 103 2.7.3 Zero Padding 105 2.7.4 Deconvolution 108 2.7.5 Polynomial Arithmetic 109 2.8 Correlation 110 2.8.1 Linear Cross-correlation 110 2.8.2 CircUlar Cross-correlation 114 2.9 Stability in thetime Domain 117 2.10 GUI Software and Case Studies 119 2.11 Chapter Summary 129 2.12 Problems 132 2.12.1 Analysis and Design 133 2.12.2 GUI Simulation 139 2.12.3 MATLAB Computation 141 11I. 3 Discrete-time Systems in the Frequency Domain 145 3.1 Motivation 145 3.1.1 Satellite Attitude Control 146 3.1.2 Modeling thevocal Tract 148 3.2 Z-transform Pairs 149 3.2.1 Region of Convergence 150 3.2.2 Common Z-transform Pairs 153 3.3 Z-transform Properties 157 3.3.1 General Properties 157 3.3.2 Causal Properties 162
Contents xi 3.4 InverseZ-transform 164 3.4.1 Noneausal Signals 164 3.4.2 Synthetie Division 164 3.4.3 Partial Fraetions 166 3.4.4 Residue Method 170 3.5 Transfer Funetions 174 3.5.1 The Transfer Funetion 174 3.5.2 Zero-State Response 176 3.5.3 Poles, Zeros, and Modes 177 3.5.4 DC Gain 180 3.6 Signal Flow Graphs 181 3.7 Stability in the Frequeney Domain 184 3.7.1 Input-output Representations 184 3.7.2 BIBO Stability 185 3.7.3 TheJuryTest 188 3.8 Frequeney Response 191 3.8.1 Frequeney Response 191 3.8.2 Sinusoidal Inputs 193 3.8.3 Periodie Inputs 196 3.9 System Identifieation 198 3.9.1 Least-squares Fit 199 3.9.2 Persistently Exeiting Inputs 202 3.10 GUI Software and Case Studies 203 3.10.1 g_sysfreq: Discrete-time System Analysis in the Frequeney Domain 203 3.11 Chapter Summary 213 3.12 Problems 215 3.12.1 Analysis and Design 215 3.12.2 GLiI Simulation 225 3.12.3 MATLAB Computation 226 11I 11 1Il. "... 4 Fourier Transforms and Spectral Analysis 228 4.1 Motivation 228 4.1.1 Fourier Series 229 4.1.2 DC Wall Transformer 230 4.1.3 Frequeney Response 232 4.2 Discrete-time Fourier Transform (DTFT) 233 4.2.1 DTFT 233 4.2.2 Properties of the DTFT 236 4.3 Discrete Fourier Transform (DFT) 241 4.3.1 DFT 241 4.3.2 Matrix Formulation 243 4.3.3 Fourier Series and Discrete Speetra 245 4.3.4 DFT Properties 248 4.4 Fast Fourier Transform (FFT) 256 4.4.1 Decimation in Time FFT 256 4.4.2 FFT Computational Effort 260 4.4.3 Alternative FFT Implementations 262
xii Contents 4.5 Fast Convolution and Correlation 263 4.5.1 Fast Convolution 263 *4.5.2 Fast Block Convolution 267 4.5.3 Fast Correlation 270 4.6 White Noise 274 4.6.1 Uniform White Noise 274 4.6.2 Gaussian White Noise 278 4.7 Auto-correlation 282 4.7.1 Auto-correlation of White Noise 282 4.7.2 Power Density Spectrum 284 4.7.3 Extracting Periodic Signals frorn Noise 286 4.8 Zero Padding and Spectral Resolution 291 4.8.1 Frequency Response Using the DFT 291 4.8.2 Zero Padding 295 4.8.3 Spectral Resolution 296 4.9 Spectrogram 299 4.9.1 Data Windows 299 4.9.2 Spectrogram 301 4.10 Power Density Spectrum Estimation 304 4.10.1 Bartlett's Method 304 4.10.2 Welch's Method 308 4.11 GUI Software and Case Studies 311 4.12 Chapter Summary 319 4.13 Problems 323 4.13.1 Analysis and Design 323 4.13.2 GUI Simulation 329 4.13.3 MATLAB Computation 331 PART 11 Digital Filter Design 335 ".lt"" 5 Filter Design Specifications 337 5.1 Motivation 337 5.1.1 Filter Design Specifications 338 5.1.2 Filter Realization Structures 339 5.2 Frequency-selective Filters 342 5.2.1 Linear Design Specifications 343 5.2.2 Logarithmic Design Specifications (db) 348 5.3 Linear-phase and Zero-phase Filters 350 5.3.1 Linear Phase 350 5.3.2 Zero-phase Filters 356 5.4 Minimum-phase and Allpass Filters 358 5.4.1 Minimum-phase Filters 359 5.4.2 Allpass Filters 362 5.4.3 Inverse Systems and Equalization 366 5.5 Quadrature Filters 367 5.5.1 Differentiator 367 5.5.2 Hilbert Transformer 369 5.5.3 Digital Oscillator 372
Contents xiii 5.6 Notch Filters and Resonators 374 5.6.1 Notch Filters 374 5.6.2 Resonators 376 5.7 Narrowband Filters and Filter Banks 378 5.7.1 Narrowband Filters 378 5.7.2 Filter Banks 381 5.8 Adaptive Filters 383 5.9 GUI Software and Case Study 386 5.9.1 g_filters: Evaluation of Digital Filter Characteristics 386 5.10 Chapter Summary 392 5.11 Problems 395 5.11.1 Analysis and Design 395 5.11.2 GUI Simulation 403 5.11.3 MATLAB Computation 404... 41 ~ ~ 6 FIR Filter Design 406 6.1 Motivation 406 6.1.1 Numerical Differentiators 407 6.1.2 Signal-to-noise Ratio 409 6.2 Windowing Method 411 6.2.1 Truncated Impulse Response 412 6.2.2 Windowing 416 6.3 Frequency-sampling Method 423 6.3.1 Frequency Sampling 424 6.3.2 Transition-band Optimization 425 6.4 Least-squares Method 430 6.5 Equiripple Filters 434 6.5.1 Minimax Error Criterion 434 6.5.2 Parks-McClellan Aigorithm 436 6.6 Differentiators and Hilbert Transformers 442 6.6.1 Differentiators 442 6.6.2 Hilbert Transformers 445 6.7 Quadrature Filters 448 6.7.1 Generation of a Quadrature Pair 448 6.7.2 Quadrature Filter 450 6.7.3 Equalizer Design 453 6.8 Filter Realization Structures 457 6.8.1 Direct Forms 457 6.8.2 Cascade Form 459 6.8.3 Lattice Form 461 *6.9 Finite Word Length Effects 464 6.9.1 Binary Number Representation 465 6.9.2 Input Quantization Error 466 6.9.3 Coefficient Quantization Error 470 6.9.4 Roundoff Error, Overflow, and Scaling 473 6.10 GUI Software and Case Study 477 6.11 Chapter Summary 484
xiv Contents 6.12 Problems 488 6.12.1 Analysis and Design 488 6.12.2 GLII Simulation 492 6.12.3 MATLAB Computation 494......"'''' 7 UR Filter Design 499 7.1 Motivation 499 7.1.1 Tunable Plucked-string Filter 500 7.1.2 Colored Noise 502 7.2 Filter Design by Pole-zero Placement 504 7.2.1 Resonator 504 7.2.2 Notch Filter 508 7.2.3 Comb Filters 510 7.3 Filter Design Parameters 514 7.4 C1assical Analog Filters 517 7.4.1 Butterworth Filters 517 7.4.2 Chebyshev-I Filters 522 7.4.3 Chebyshev-II Filters 525 7.4.4 Elliptic Filters 526 7.5 Bilinear transformation Method 529 7.6 Frequency Transformations 535 7.6.1 Analog Frequency Transformations 536 7.6.2 Digital Frequency Transformations 539 7.7 Filter Realization Structures 541 7.7.1 DirectForms 541 7.7.2 Parallel Form 544 7.7.3 Cascade Form 547 *7.8 Finite Word Length Effects 550 7.8.1 Coefficient Quantization Error 550 7.8.2 Roundoff Error, Overflow, and Scaling 553 7.8.3 Limit Cycles 557 7.9 GUI Sohware and Case Study 560 7.10 Chapter Summary 567 7.11 Problems 571 7.11.1 Analysis and Design 571 7.11.2 GUI Simulation 575 7.11.3 MATLAB Computation 577... PART 111 Advanced Signal Processing 581 8 Multirate Signal Processing 583 8.1 Motivation 583 8.1.1 Narrowband Filter Banks 584 8.1.2 Fractional Delay Systems 586 8.2 Integer Sampling Rate Converters 587 8.2.1 Sampling Rate Decimator 587 8.2.2 Sampling Rate Interpolator 588
Contents xv 8.3 Rational Sampling Rate Converters 591 8.3.1 Single-stage Converters 591 8.3.2 Multistage Converters 593 8.4 Multirate Filter Realization Structures 596 8.4.1 Polyphase Decimator 596 8.4.2 Polyphase Interpolator 598 8.5 Narrowband Filters and Filter Banks 600 8.5.1 Narrowband Filters 600 8.5.2 Filter Banks 601 8.6 A Two-channel QMF Bank 607 8.6.1 Rate Converters in the Frequency Domain 608 8.6.2 An Alias-free QNlF Bank 610 8.7 Oversampling ADC 612 8.7.1 Anti-aliasing Filters 612 8.7.2 Sigma-delta ADC 615 8.8 Oversampling DAC 620 8.8.1 Anti-imaging Filters 620 8.8.2 Passband Equalization 621 8.9 GUI Software andcase Study 623 8.10 Chapter Summary 630 8.11 Problems 633 8.11.1 Analysis and Design 633 8.11.2 GUI Simulation 640 8.11.3 MATLAB Computation 641 411 411."" 9 Adaptive Signal Processing 645 9.1 Motivation 645 9.1.1 System Identification 646 9.1.2 Channel Equalization 647 9.1.3 Signal Prediction 648 9.1.4 Noise Cancellation 648 9.2 Mean Square Error 649 9.2.1 Adaptive Transversal Filters 649 9.2.2 Cross-correlation Revisited 650 9.2.3 Mean Square Error 651 9.3 The Least Mean Square (LMS) Method 656 9.4 Performance Analysis of LMS Method 660 9.4.1 Step Size 660 9.4.2 Convergence Rate 663 9.4.3 Excess Mean Square Error 666 9.5 Modified LMS Methods 669 9.5.1 l'jormalized LMS Method 669 9.5.2 Correlation LMS Method 671 9.5.3 Leaky LMS Method 674 9.6 Adaptive FIR Filter Design 678 9.6.1 Pseudo-filters 678 9.6.2 Linear-phase Pseudo-filters 681
xvi Contents 9.7 The Recursive Least-Squares (RLS) Method 684 9.7.1 Performance Criterion 684 9.7.2 Recursive Formulation 685 9.8 Active Noise Control 690 9.8.1 The Filtered-x LMS Method 691 9.8.2 Secondary Path Identification 693 9.8.3 Signal-synthesis Method 695 9.9 Nonlinear System Identification 700 9.9.1 Nonlinear Discrete-time Systems 700 9.9.2 Grid Points 701 9.9.3 Radial Basis Functions 70~ 9.9.4 Adaptive RBF Networks 707 9.10 GUI Software and Case Study 713 9.11 Chapter Summary 718 9.12 Problems 721 9.12.1 Analysis and Design 721 9.12.2 GUI Simulation 725 9.12.3 MATLAB Computation 727 1II It «I... References and Further Reading 734 41... Appendix 1 Transform Tables 738 1.1 Fourier Series 738 1.2 Fourier Transform 739 1.3 Laplace Transform 741 1.4 Z-transform 743 1.5 Discrete-time Fourier Transform 744 1.6 Discrete Fourier Transform (DFT) 745. Appendix 2 MathematicalIdentities 747 2.1 Complex l\jumbers 747 2.2 Euler's Identity 747 2.3 Trigonometrie Identities 748 2.4 Inequalities 748 2.5 Uniform White Noise 749 «I... Appendix 3 FDSP Toolbox Functions 750 3.1 Installation 750 3.2 Driver Module: Cdsp 751 3.3 Chapter GUI Modules 751 3.4 FDSP Toolbox Functions 752 "... CI... Index 755