**excerpt**. Sign up to view the full document! View Full Document

Digital Signal Processing This page intentionally left blank Digital Signal Processing SIGNALS SYSTEMS AND FILTERS Andreas Antoniou University of Victoria British Columbia Canada McGraw-Hill New York Chicago San Francisco Lisbon London Madrid Mexico City Milan New Delhi San Juan Seoul Singapore Sydney Toronto Copyright 2006 by The McGraw-Hill Companies, Inc. All rights reserved. Manufactured in the United States of America. Except as permitted under the United States Copyright Act of 1976, no part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the publisher. 0-07-158904-X The material in this eBook also appears in the print version of this title: 0-07-145424-1. All trademarks are trademarks of their respective owners. Rather than put a trademark symbol after every occurrence of a trademarked name, we use names in an editorial fashion only, and to the benefit of the trademark owner, with no intention of infringement of the trademark. Where such designations appear in this book, they have been printed with initial caps. McGraw-Hill eBooks are available at special quantity discounts to use as premiums and sales promotions, or for use incorporate training programs. For more information, please contact George Hoare, Special Sales, at george_hoare@mcgraw-hill.com or (212) 904-4069. TERMS OF USE This is a copyrighted work and The McGraw-Hill Companies, Inc. (McGraw-Hill) and its licensors reserve all rights in and to the work. Use of this work is subject to these terms. Except as permitted under the Copyright Act of 1976 and the right to store and retrieve one copy of the work, you may not decompile, disassemble, reverse engineer, reproduce, modify, create derivative works based upon, transmit, distribute, disseminate, sell, publish or sublicense the work or any part of it without McGraw-Hills prior consent. You may use the work for your own noncommercial and personal use; any other use of the work is strictly prohibited. Your right to use the work may be terminated if you fail to comply with these terms. THE WORK IS PROVIDED AS IS. McGRAW-HILL AND ITS LICENSORS MAKE NO GUARANTEES OR WARRANTIES AS TO THE ACCURACY, ADEQUACY OR COMPLETENESS OF OR RESULTS TO BE OBTAINED FROM USING THE WORK, INCLUDING ANY INFORMATION THAT CAN BE ACCESSED THROUGH THE WORK VIA HYPERLINK OR OTHERWISE, AND EXPRESSLY DISCLAIM ANY WARRANTY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. McGraw-Hill and its licensors do not warrant or guarantee that the functions contained in the work will meet your requirements or that its operation will be uninterrupted or error free. Neither McGraw-Hill nor its licensors shall be liable to you or anyone else for any inaccuracy, error or omission, regardless of cause, in the work or for any damages resulting therefrom. McGraw-Hill has no responsibility for the content of any information accessed through the work. Under no circumstances shall McGraw-Hill and/or its licensors be liable for any indirect, incidental, special, punitive, consequential or similar damages that result from the use of or inability to use the work, even if any of them has been advised of the possibility of such damages. This limitation of liability shall apply to any claim or cause whatsoever whether such claim or cause arises in contract, tort or otherwise. DOI: 10.1036/0071454241 Professional Want to learn more? We hope you enjoy this McGraw-Hill eBook! If youd like more information about this book, its author, or related books and websites, please click here. In memory of my wife Rosemary my mother Eleni and my father Antonios This page intentionally left blank ABOUT THE AUTHOR Andreas Antoniou received the B.Sc. (Eng.) and Ph.D. degrees in Electrical Engineering from the University of London, U.K., in 1963 and 1966, respectively, and is a Fellow of the Institution of Electrical Engineers and the Institute of Electrical and Electronics Engineers. He taught at Concordia University from 1970 to 1983 serving as Chair of the Department of Electrical and Computer Engineering during 197783. He served as the founding Chair of the Department of Electrical and Computer Engineering, University of Victoria, B.C., Canada, from 1983 to 1990, and is now Professor Emeritus in the same department. His teaching and research interests are in the areas of circuits and systems and digital signal processing. He is the author of Digital Filters: Analysis, Design, and Applications (McGraw-Hill), rst and second editions, published in 1978 and 1993, respectively, and the co-author with W.-S Lu of Two-Dimensional Digital Filters (Marcel Dekker, 1992). Dr. Antoniou served as Associate Editor and Chief Editor for the IEEE Transactions on Circuits and Systems (CAS) during 198385 and 198587, respectively; as a Distinguished Lecturer of the IEEE Signal Processing Society in 2003; and as the General Chair of the 2004 IEEE International Symposium on Circuits and Systems. He received the Ambrose Fleming Premium for 1964 from the IEE (best paper award), a CAS Golden Jubilee Medal from the IEEE Circuits and Systems Society in 2000, the B.C. Science Council Chairmans Award for Career Achievement for 2000, the Doctor Honoris Causa degree from the Metsovio National Technical University of Athens, Greece, in 2002, and the IEEE Circuits and Systems Society Technical Achievements Award for 2005. Copyright 2006 by The McGraw-Hill Companies, Inc. Click here for terms of use. This page intentionally left blank For more information about this title, click here TABLE OF CONTENTS Preface xix 1 1 1 4 7 8 15 16 19 23 23 24 26 Chapter 1. Introduction to Digital Signal Processing 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 Introduction Signals Frequency-Domain Representation Notation Signal Processing Analog Filters Applications of Analog Filters Digital Filters Two DSP Applications 1.9.1 Processing of EKG signals 1.9.2 Processing of Stock-Exchange Data References Chapter 2. The Fourier Series and Fourier Transform 2.1 Introduction 2.2 Fourier Series 2.2.1 Denition 2.2.2 Particular Forms 2.2.3 Theorems and Properties 2.3 Fourier Transform 2.3.1 Derivation 2.3.2 Particular Forms 2.3.3 Theorems and Properties References Problems 29 29 29 30 31 35 46 47 50 57 73 73 Chapter 3. The z Transform 3.1 Introduction 3.2 Denition of z Transform 79 79 80 x DIGITAL SIGNAL PROCESSING 3.3 3.4 3.5 3.6 3.7 3.8 Convergence Properties The z Transform as a Laurent Series Inverse z Transform Theorems and Properties Elementary Discrete-Time Signals z -Transform Inversion Techniques 3.8.1 Use of Binomial Series 3.8.2 Use of Convolution Theorem 3.8.3 Use of Long Division 3.8.4 Use of Initial-Value Theorem 3.8.5 Use of Partial Fractions 3.9 Spectral Representation of Discrete-Time Signals 3.9.1 Frequency Spectrum 3.9.2 Periodicity of Frequency Spectrum 3.9.3 Interrelations References Problems 81 83 85 86 95 101 103 108 110 113 115 119 119 120 124 126 126 Chapter 4. Discrete-Time Systems 4.1 Introduction 4.2 Basic System Properties 4.2.1 Linearity 4.2.2 Time Invariance 4.2.3 Causality 4.3 Characterization of Discrete-Time Systems 4.3.1 Nonrecursive Systems 4.3.2 Recursive Systems 4.4 Discrete-Time System Networks 4.4.1 Network Analysis 4.4.2 Implementation of Discrete-Time Systems 4.4.3 Signal Flow-Graph Analysis 4.5 Introduction to Time-Domain Analysis 4.6 Convolution Summation 4.6.1 Graphical Interpretation 4.6.2 Alternative Classication 4.7 Stability 4.8 State-Space Representation 4.8.1 Computability 4.8.2 Characterization 4.8.3 Time-Domain Analysis 4.8.4 Applications of State-Space Method References Problems 131 131 132 132 134 136 140 140 140 142 143 146 147 155 163 166 169 171 174 175 176 184 186 186 186 Chapter 5. The Application of the z Transform 5.1 Introduction 5.2 The Discrete-Time Transfer Function 5.2.1 Derivation of H (z ) from Difference Equation 5.2.2 Derivation of H (z ) from System Network 5.2.3 Derivation of H (z ) from State-Space Characterization 201 201 202 202 204 205 TABLE OF CONTENTS xi 207 207 211 214 215 216 217 219 222 223 224 224 227 228 229 232 245 246 246 251 251 254 254 5.3 Stability 5.3.1 Constraint on Poles 5.3.2 Constraint on Eigenvalues 5.3.3 Stability Criteria 5.3.4 Test for Common Factors 5.3.5 Schur-Cohn Stability Criterion 5.3.6 Schur-Cohn-Fujiwara Stability Criterion 5.3.7 Jury-Marden Stability Criterion 5.3.8 Lyapunov Stability Criterion 5.4 Time-Domain Analysis 5.5 Frequency-Domain Analysis 5.5.1 Steady-State Sinusoidal Response 5.5.2 Evaluation of Frequency Response 5.5.3 Periodicity of Frequency Response 5.5.4 Aliasing 5.5.5 Frequency Response of Digital Filters 5.6 Transfer Functions for Digital Filters 5.6.1 First-Order Transfer Functions 5.6.2 Second-Order Transfer Functions 5.6.3 Higher-Order Transfer Functions 5.7 Amplitude and Delay Distortion References Problems Chapter 6. The Sampling Process 6.1 Introduction 6.2 Fourier Transform Revisited 6.2.1 Impulse Functions 6.2.2 Periodic Signals 6.2.3 Unit-Step Function 6.2.4 Generalized Functions 6.3 Interrelation Between the Fourier Series and the Fourier Transform 6.4 Poissons Summation Formula 6.5 Impulse-Modulated Signals 6.5.1 Interrelation Between the Fourier and z Transforms 6.5.2 Spectral Relationship Between Discrete- and Continuous-Time Signals 6.6 The Sampling Theorem 6.7 Aliasing 6.8 Graphical Representation of Interrelations 6.9 Processing of Continuous-Time Signals Using Digital Filters 6.10 Practical A/D and D/A Converters References Problems 261 261 263 263 272 274 274 278 284 286 288 290 294 296 297 298 303 311 311 Chapter 7. The Discrete Fourier Transform 7.1 7.2 7.3 7.4 Introduction Denition Inverse DFT Properties 321 321 322 322 323 xii DIGITAL SIGNAL PROCESSING 7.5 7.6 7.7 7.8 7.9 7.10 7.11 7.12 7.4.1 Linearity 7.4.2 Periodicity 7.4.3 Symmetry Interrelation Between the DFT and the z Transform 7.5.1 Frequency-Domain Sampling Theorem 7.5.2 Time-Domain Aliasing Interrelation Between the DFT and the CFT 7.6.1 Time-Domain Aliasing Interrelation Between the DFT and the Fourier Series Window Technique 7.8.1 Continuous-Time Windows 7.8.2 Discrete-Time Windows 7.8.3 Periodic Discrete-Time Windows 7.8.4 Application of Window Technique Simplied Notation Periodic Convolutions 7.10.1 Time-Domain Periodic Convolution 7.10.2 Frequency-Domain Periodic Convolution Fast Fourier-Transform Algorithms 7.11.1 Decimation-in-Time Algorithm 7.11.2 Decimation-in-Frequency Algorithm 7.11.3 Inverse DFT Application of the FFT Approach to Signal Processing 7.12.1 Overlap-and-Add Method 7.12.2 Overlap-and-Save Method References Problems 323 323 323 325 328 333 333 335 335 337 337 350 352 354 358 358 359 361 362 362 370 375 376 377 380 381 382 Chapter 8. Realization of Digital Filters 8.1 Introduction 8.2 Realization 8.2.1 Direct Realization 8.2.2 Direct Canonic Realization 8.2.3 State-Space Realization 8.2.4 Lattice Realization 8.2.5 Cascade Realization 8.2.6 Parallel Realization 8.2.7 Transposition 8.3 Implementation 8.3.1 Design Considerations 8.3.2 Systolic Implementations References Problems 389 389 391 392 395 397 401 404 407 410 412 412 412 417 417 Chapter 9. Design of Nonrecursive (FIR) Filters 9.1 Introduction 9.2 Properties of Constant-Delay Nonrecursive Filters 9.2.1 Impulse Response Symmetries 9.2.2 Frequency Response 9.2.3 Location of Zeros 9.3 Design Using the Fourier Series 425 425 426 426 428 430 431 TABLE OF CONTENTS xiii 434 435 437 439 440 445 445 453 453 458 459 9.4 Use of Window Functions 9.4.1 Rectangular Window 9.4.2 von Hann and Hamming Windows 9.4.3 Blackman Window 9.4.4 Dolph-Chebyshev Window 9.4.5 Kaiser Window 9.4.6 Prescribed Filter Specications 9.4.7 Other Windows 9.5 Design Based on Numerical-Analysis Formulas References Problems Chapter 10. Approximations for Analog Filters 10.1 Introduction 10.2 Basic Concepts 10.2.1 Characterization 10.2.2 Laplace Transform 10.2.3 The Transfer Function 10.2.4 Time-Domain Response 10.2.5 Frequency-Domain Analysis 10.2.6 Ideal and Practical Filters 10.2.7 Realizability Constraints 10.3 Butterworth Approximation 10.3.1 Derivation 10.3.2 Normalized Transfer Function 10.3.3 Minimum Filter Order 10.4 Chebyshev Approximation 10.4.1 Derivation 10.4.2 Zeros of Loss Function 10.4.3 Normalized Transfer Function 10.4.4 Minimum Filter Order 10.5 Inverse-Chebyshev Approximation 10.5.1 Normalized Transfer Function 10.5.2 Minimum Filter Order 10.6 Elliptic Approximation 10.6.1 Fifth-Order Approximation 10.6.2 N th-Order Approximation (n Odd) 10.6.3 Zeros and Poles of L (s 2 ) 10.6.4 N th-Order Approximation (n Even) 10.6.5 Specication Constraint 10.6.6 Normalized Transfer Function 10.7 Bessel-Thomson Approximation 10.8 Transformations 10.8.1 Lowpass-to-Lowpass Transformation 10.8.2 Lowpass-to-Bandpass Transformation References Problems 463 463 465 465 465 466 466 469 471 474 475 475 476 479 481 481 485 489 490 493 493 494 497 497 504 504 507 508 509 513 516 516 516 519 520 Chapter 11. Design of Recursive (IIR) Filters 11.1 Introduction 11.2 Realizability Constraints 11.3 Invariant Impulse-Response Method 529 529 530 530 xiv DIGITAL SIGNAL PROCESSING 11.4 Modied Invariant Impulse-Response Method 11.5 Matched-z Transformation Method 11.6 Bilinear-Transformation Method 11.6.1 Derivation 11.6.2 Mapping Properties of Bilinear Transformation 11.6.3 The Warping Effect 11.7 Digital-Filter Transformations 11.7.1 General Transformation 11.7.2 Lowpass-to-Lowpass Transformation 11.7.3 Lowpass-to-Bandstop Transformation 11.7.4 Application 11.8 Comparison Between Recursive and Nonrecursive Designs References Problems 534 538 541 541 543 545 549 549 551 552 554 554 555 556 Chapter 12. Recursive (IIR) Filters Satisfying Prescribed Specications 12.1 Introduction 12.2 Design Procedure 12.3 Design Formulas 12.3.1 Lowpass and Highpass Filters 12.3.2 Bandpass and Bandstop Filters 12.3.3 Butterworth Filters 12.3.4 Chebyshev Filters 12.3.5 Inverse-Chebyshev Filters 12.3.6 Elliptic Filters 12.4 Design Using the Formulas and Tables 12.5 Constant Group Delay 12.5.1 Delay Equalization 12.5.2 Zero-Phase Filters 12.6 Amplitude Equalization References Problems 563 563 564 565 565 568 573 575 576 576 577 586 586 587 588 588 588 Chapter 13. Random Signals 13.1 Introduction 13.2 Random Variables 13.2.1 Probability-Distribution Function 13.2.2 Probability-Density Function 13.2.3 Uniform Probability Density 13.2.4 Gaussian Probability Density 13.2.5 Joint Distributions 13.2.6 Mean Values and Moments 13.3 Random Processes 13.3.1 Notation 13.4 First- and Second-Order Statistics 13.5 Moments and Autocorrelation 13.6 Stationary Processes 13.7 Frequency-Domain Representation 13.8 Discrete-Time Random Processes 13.9 Filtering of Discrete-Time Random Signals References Problems 593 593 593 594 594 594 594 594 595 598 598 599 602 604 604 609 610 613 613 TABLE OF CONTENTS xv 617 617 618 618 620 623 625 627 632 635 636 638 640 640 641 643 645 647 651 654 654 659 660 665 667 668 Chapter 14. Effects of Finite Word Length in Digital Filters 14.1 Introduction 14.2 Number Representation 14.2.1 Binary System 14.2.2 Fixed-Point Arithmetic 14.2.3 Floating-Point Arithmetic 14.2.4 Number Quantization 14.3 Coefcient Quantization 14.4 Low-Sensitivity Structures 14.4.1 Case I 14.4.2 Case II 14.5 Product Quantization 14.6 Signal Scaling 14.6.1 Method A 14.6.2 Method B 14.6.3 Types of Scaling 14.6.4 Application of Scaling 14.7 Minimization of Output Roundoff Noise 14.8 Application of Error-Spectrum Shaping 14.9 Limit-Cycle Oscillations 14.9.1 Quantization Limit Cycles 14.9.2 Overow Limit Cycles 14.9.3 Elimination of Quantization Limit Cycles 14.9.4 Elimination of Overow Limit Cycles References Problems Chapter 15. Design of Nonrecursive Filters Using Optimization Methods 15.1 Introduction 15.2 Problem Formulation 15.2.1 Lowpass and Highpass Filters 15.2.2 Bandpass and Bandstop Filters 15.2.3 Alternation Theorem 15.3 Remez Exchange Algorithm 15.3.1 Initialization of Extremals 15.3.2 Location of Maxima of the Error Function 15.3.3 Computation of | E ()| and Pc () 15.3.4 Rejection of Superuous Potential Extremals 15.3.5 Computation of Impulse Response 15.4 Improved Search Methods 15.4.1 Selective Step-by-Step Search 15.4.2 Cubic Interpolation 15.4.3 Quadratic Interpolation 15.4.4 Improved Formulation 15.5 Efcient Remez Exchange Algorithm 15.6 Gradient Information 15.6.1 Property 1 15.6.2 Property 2 15.6.3 Property 3 15.6.4 Property 4 15.6.5 Property 5 15.7 Prescribed Specications 673 673 674 675 676 677 678 679 679 681 682 683 683 683 687 689 689 691 694 695 695 695 696 696 700 xvi DIGITAL SIGNAL PROCESSING 15.8 Generalization 15.8.1 Antisymmetrical Impulse Response and Odd Filter Length 15.8.2 Even Filter Length 15.9 Digital Differentiators 15.9.1 Problem Formulation 15.9.2 First Derivative 15.9.3 Prescribed Specications 15.10 Arbitrary Amplitude Responses 15.11 Multiband Filters References Additional References Problems 703 703 705 707 707 708 708 712 712 715 716 716 Chapter 16. Design of Recursive Filters Using Optimization Methods 16.1 16.2 16.3 16.4 Introduction Problem Formulation Newtons Method Quasi-Newton Algorithms 16.4.1 Basic Quasi-Newton Algorithm 16.4.2 Updating Formulas for Matrix Sk +1 16.4.3 Inexact Line Searches 16.4.4 Practical Quasi-Newton Algorithm Minimax Algorithms Improved Minimax Algorithms Design of Recursive Filters 16.7.1 Objective Function 16.7.2 Gradient Information 16.7.3 Stability 16.7.4 Minimum Filter Order 16.7.5 Use of Weighting Design of Recursive Delay Equalizers References Additional References Problems 719 719 720 722 726 726 729 730 734 738 741 745 745 746 746 746 747 753 766 766 767 16.5 16.6 16.7 16.8 Chapter 17. Wave Digital Filters 17.1 17.2 17.3 17.4 Introduction Sensitivity Considerations Wave Network Characterization Element Realizations 17.4.1 Impedances 17.4.2 Voltage Sources 17.4.3 Series Wire Interconnection 17.4.4 Parallel Wire Interconnection 17.4.5 2-Port Adaptors 17.4.6 Transformers 17.4.7 Unit Elements 17.4.8 Circulators 17.4.9 Resonant Circuits 17.4.10 Realizability Constraint 773 773 774 775 777 778 779 780 782 783 784 786 788 788 791 TABLE OF CONTENTS xvii 791 791 792 796 798 802 805 807 808 810 811 811 811 812 814 817 818 819 820 822 17.5 Lattice Wave Digital Filters 17.5.1 Analysis 17.5.2 Alternative Lattice Conguration 17.5.3 Digital Realization 17.6 Ladder Wave Digital Filters 17.7 Filters Satisfying Prescribed Specications 17.8 Frequency-Domain Analysis 17.9 Scaling 17.10 Elimination of Limit-Cycle Oscillations 17.11 Related Synthesis Methods 17.12 A Cascade Synthesis Based on the Wave Characterization 17.12.1 Generalized-Immittance Converters 17.12.2 Analog G-CGIC Conguration 17.12.3 Digital G-CGIC Conguration 17.12.4 Cascade Synthesis 17.12.5 Signal Scaling 17.12.6 Output Noise 17.13 Choice of Structure References Problems Chapter 18. Digital Signal Processing Applications 18.1 Introduction 18.2 Sampling-Frequency Conversion 18.2.1 Decimators 18.2.2 Interpolators 18.2.3 Sampling Frequency Conversion by a Noninteger Factor 18.2.4 Design Considerations 18.3 Quadrature-Mirror-Image Filter Banks 18.3.1 Operation 18.3.2 Elimination of Aliasing Errors 18.3.3 Design Considerations 18.3.4 Perfect Reconstruction 18.4 Hilbert Transformers 18.4.1 Design of Hilbert Transformers 18.4.2 Single-Sideband Modulation 18.4.3 Sampling of Bandpassed Signals 18.5 Adaptive Digital Filters 18.5.1 Wiener Filters 18.5.2 Newton Algorithm 18.5.3 Steepest-Descent Algorithm 18.5.4 Least-Mean-Square Algorithm 18.5.5 Recursive Filters 18.5.6 Applications 18.6 Two-Dimensional Digital Filters 18.6.1 Two-Dimensional Convolution 18.6.2 Two-Dimensional z Transform 18.6.3 Two-Dimensional Transfer Function 18.6.4 Stability 18.6.5 Frequency-Domain Analysis 18.6.6 Types of 2-D Filters 18.6.7 Approximations 18.6.8 Applications 829 829 830 830 833 839 839 839 840 844 846 849 851 854 859 861 862 865 867 867 870 871 872 874 875 875 875 876 877 880 881 881 xviii DIGITAL SIGNAL PROCESSING References Additional References Problems 882 884 884 Appendix A. Complex Analysis A.1 Introduction A.2 Complex Numbers A.2.1 Complex Arithmetic A.2.2 De Moivres Theorem A.2.3 Eulers Formula A.2.4 Exponential Form A.2.5 Vector Representation A.2.6 Spherical Representation A.3 Functions of a Complex Variable A.3.1 Polynomials A.3.2 Inverse Algebraic Functions A.3.3 Trigonometric Functions and Their Inverses A.3.4 Hyperbolic Functions and Their Inverses A.3.5 Multi-Valued Functions A.3.6 Periodic Functions A.3.7 Rational Algebraic Functions A.4 Basic Principles of Complex Analysis A.4.1 Limit A.4.2 Differentiability A.4.3 Analyticity A.4.4 Zeros A.4.5 Singularities A.4.6 Zero-Pole Plots A.5 Series A.6 Laurent Theorem A.7 Residue Theorem A.8 Analytic Continuation A.9 Conformal Transformations References 891 891 892 894 894 895 896 897 898 899 899 900 900 901 902 904 905 906 906 907 907 908 908 910 911 915 919 920 921 924 Appendix B. Elliptic Functions B.1 B.2 B.3 B.4 B.5 B.6 B.7 B.8 Introduction Elliptic Integral of the First Kind Elliptic Functions Imaginary Argument Formulas Periodicity Transformation Series Representation References 925 925 925 927 930 932 932 934 936 937 Index 939 PREFACE The great advancements in the design of microchips, digital systems, and computer hardware over the past 40 years have given birth to digital signal processing (DSP) which has grown over the years into a ubiquitous, multifaceted, and indispensable subject of study. As such DSP has been applied in most disciplines ranging from engineering to economics and from astronomy to molecular biology. Consequently, it would take a multivolume encyclopedia to cover all the facets, aspects, and ramications of DSP, and such a treatise would require many authors. This textbook focuses instead on the fundamentals of DSP, namely, on the representation of signals by mathematical models and on the processing of signals by discrete-time systems. Various types of processing are possible for signals but the processing of interest in this volume is almost always linear and it typically involves reshaping, transforming, or manipulating the frequency spectrum of the signal of interest. Discretetime systems that can reshape, transform, or manipulate the spectrum of a signal are known as digital lters, and these systems will receive very special attention as they did in the authors previous textbook Digital Filters: Analysis, Design, and Applications, McGraw-Hill, 1993. This author considers the processing of continuous- and discrete-time signals to be different facets of one and the same subject of study without a clear demarcation where the processing of continuous-time signals by analog systems ends and the processing of discrete-time signals by digital systems begins. Discrete-time signals sometimes exist as distinct entities that are not derived from or related to corresponding continuous-time signals. The processing of such a signal would result in a transformed discrete-time signal, which would be, presumably, an enhanced or in some way more desirable version of the original signal. Obviously, reference to an underlying continuoustime signal would be irrelevant in such a case. However, more often than not discrete-time signals are derived from corresponding continuous-time signals and, as a result, they inherit the spectral characteristics of the latter. Discrete-time signals of this type are often processed by digital systems and after that they are converted back to continuous-time signals. A case in point can be found in the recording industry where music is rst sampled to generate a discrete-time signal which is then recorded on a CD. When the CD is played back, the discrete-time signal is converted into a continuous-time signal. In order to preserve the spectrum of the underlying continuous-time signal, e.g., that delightful piece of music, through this series of signal manipulations, special attention must be paid to the spectral relationships that exist between continuous- and discrete-time signals. These relationships are examined in great detail in Chapters 6 and 7. In the application just described, part Copyright 2006 by The McGraw-Hill Companies, Inc. Click here for terms of use. xx DIGITAL SIGNAL PROCESSING of the processing must be performed by analog lters. As will be shown in Chapter 6, there is often a need to use a bandlimiting analog lter before sampling and, on the other hand, the continuoustime signal we hear through our stereo systems is produced by yet another analog lter. Therefore, knowledge of analog lters is prerequisite if we are called upon to design DSP systems that involve continuous-time signals in some way. Knowledge of analog lters is crucial in another respect: some of the better recursive digital lters can be designed only by converting analog into digital lters, as will be shown in Chapters 1012 and 17. The prerequisite knowledge for the book is a typical undergraduate mathematics background of calculus, complex analysis, and simple differential equations. At certain universities, complex analysis may not be included in the curriculum. To overcome this difculty, the basics of complex analysis are summarized in Appendix A which can also serve as a quick reference or refresher. The derivation of the elliptic approximation in Section 10.6 requires a basic understanding of elliptic functions but it can be skipped by most readers. Since elliptic functions are not normally included in undergraduate curricula, a brief but adequate treatment of these functions is included in Appendix B for the sake of completeness. Chapter 14 requires a basic understanding of random variables and processes which may not be part of the curriculum at certain universities. To circumvent this difculty, the prerequisite knowledge on random variables and processes is summarized in Chapter 13. Chapter 1 provides an overview of DSP. It starts with a classication of the types of signals encountered in DSP. It then introduces in a heuristic way the characterization of signals in terms of frequency spectrums. The ltering process as a means of transforming or altering the spectrum of a signal is then described. The second half of the chapter provides a historical perspective of the evolution of analog and digital lters and their applications. The chapter concludes with two specic applications that illustrate the scope, diversity, and usefulness of DSP. Chapter 2 describes the Fourier series and Fourier transform as the principal mathematical entities for the spectral characterization of continuous-time signals. The Fourier transform is deduced from the Fourier series through a limiting process whereby the period of a periodic signal is stretched to innity. The most important mathematical tool for the representation of discrete-time signals is the z transform and this forms the subject matter of Chapter 3. The z transform is viewed as a Laurent series and that immediately causes the z transform to inherit the mathematical properties of the Laurent series. By this means, the convergence properties of the z transform are more clearly understood and, furthermore, a host of algebraic techniques become immediately applicable in the inversion of the z transform. The chapter also deals with the use of the z transform as a tool for the spectral representation of discrete-time signals. Chapter 4 deals with the fundamentals of discrete-time systems. Topics considered include basic system properties such as linearity, time invariance, causality, and stability; characterization of discrete-time systems by difference equations; representation by networks and signal ow graphs and analysis by node-elimination techniques. Time-domain analysis is introduced at an elementary level. The analysis is accomplished by solving the difference equation of the system by using induction. Although induction is not known for its efciency, it is an intuitive technique that provides the newcomer with a clear understanding of the basics of discrete-time systems and how they operate, e.g., what are initial conditions, what is a transient or steady-state response, what is an impulse response, and so on. The chapter continues with the representation of discrete-time systems by convolution summations on the one hand and by state-space characterizations on the other. PREFACE xxi The application of the z transform to discrete-time systems is covered in Chapter 5. By applying the z transform to the convolution summation, a discrete-time system can be represented by a transfer function that encapsulates all the linear properties of the system, e.g., time-domain response, stability, steady-state sinusoidal response, and frequency response. The chapter also includes stability criteria and algorithms that can be used to decide with minimal computational effort whether a discretetime system is stable or not. The concepts of amplitude and phase responses and their physical signicance are illustrated by examples as well as by two- and three-dimensional MATLAB plots that show clearly the true nature of zeros and poles. Chapter 5 also delineates the standard rst- and second-order transfer functions that can be used to design lowpass, highpass, bandpass, bandstop, and allpass digital lters. The chapter concludes with a discussion on the causes and elimination of signal distortion in discrete-time systems such as amplitude distortion and delay distortion. Chapter 6 extends the application of the Fourier transform to impulse and periodic signals. It also introduces the class of impulse-modulated signals which are, in effect, both sampled and continuous in time. As such, they share characteristics with both continuous- as well as discrete-time signals. Therefore, these signals provide a bridge between the analog and digital worlds and thereby facilitate the DSP practitioner to interrelate the spectral characteristics of discrete-time signals with those of the continuous-time signals from which they were derived. The chapter also deals with the sampling process, the use of digital lters for the processing of continuous-time signals, and the characterization and imperfections of analog-to-digital and digital-to-analog converters. Chapter 7 presents the discrete Fourier transform (DFT) and the associated fast Fouriertransform method as mathematical tools for the analysis of signals on the one hand and for the software implementation of digital lters on the other. The chapter starts with the denition and properties of the DFT and continues with the interrelations that exist between the DFT and (1) the z transform, (2) the continuous Fourier transform, and (3) the Fourier series. These interrelations must be thoroughly understood, otherwise the user of the fast Fourier-transform method is likely to end up with inaccurate spectral representations for the signals of interest. The chapter also deals with the window method in detail, which can facilitate the processing of signals of long or innity duration. Chapters 1 to 7 deal, in effect, with the characterization and properties of continuous- and discrete-time, periodic and nonperiodic signals, and with the general properties of discrete-time systems in general. Chapters 8 to 18, on the other hand, are concerned with the design of various types of digital lters. The design process is deemed to comprise four steps, namely, approximation, realization, implementation, and study of system imperfections brought about by the use of nite arithmetic. Approximation is the process of generating a transfer function that would satisfy the required specications. Realization is the process of converting the transfer function or some other characterization of the digital lter into a digital network or structure. Implementation can take two forms, namely, software and hardware. In a software implementation, a difference equation or state-space representation is converted into a computer program that simulates the performance of the digital lter, whereas in a hardware implementation a digital network is converted into a piece of dedicated hardware. System imperfections are almost always related to the use of nite-precision arithmetic and manifest themselves as numerical errors in lter parameters or the values of the signals being processed. Although the design process always starts with the solution of the approximation problem, the realization process is much easier to deal with and for this reason it is treated rst in Chapter 8. As will be shown, several realization methods are available that lead to a great variety of digital-lter xxii DIGITAL SIGNAL PROCESSING structures. Chapter 8 also deals with a special class of structures known as systolic structures which happen to have some special properties that make them amenable to integrated-circuit implementation. Chapter 9 is concerned with closed-form methods that can be used to design nonrecursive lters. The chapter starts by showing that constant-delay (linear-phase) nonrecursive lters can be easily designed by forcing certain symmetries on the impulse response. The design of such lters through the use of the Fourier series in conjunction with the window method is then described. Several of the standard window functions, including the Dolph-Chebyshev and Kaiser window functions, and their interrelations are detailed. The chapter includes a step-by-step design procedure based on the Kaiser window function that can be used to design standard nonrecursive lters that would satisfy prescribed specications. It concludes with a method based on the use of classical numerical analysis formulas which can be used to design specialized nonrecursive lters that can perform interpolation, differentiation, and integration. The approximation problem for recursive lters can be solved by using direct or indirect methods. In direct methods, the discrete-time transfer function is obtained directly in the z domain usually through iterative optimization methods. In indirect methods, on the other hand, the discrete-time transfer function is obtained by converting the continuous-time transfer function of an appropriate analog lter through a series of transformations. Thus the need arises for the solution of the approximation problem in analog lters. The basic concepts pertaining to the characterization of analog lters and the standard approximation methods used to design analog lowpass lters, i.e., the Butterworth, Chebyshev, inverse-Chebyshev, elliptic, and Bessel-Thomson methods, are described in detail in Chapter 10. The chapter concludes with certain classical transformations that can be used to convert a given lowpass approximation into a corresponding highpass, bandpass, or bandstop approximation. Chapter 11 deals with the approximation problem for recursive digital lters. Methods are described by which a given continuous-time transfer function can be transformed into a corresponding discrete-time transfer function, e.g., the invariant impulse-response, matched-z transformation, and bilinear-transformation methods. The chapter concludes with certain transformations that can be used to convert a given lowpass digital lter into a corresponding highpass, bandpass, or bandstop digital lter. A detailed procedure that can be used to design Butterworth, Chebyshev, inverse-Chebyshev, and elliptic lters that would satisfy prescribed specications, with design examples, is found in Chapter 12. The basics of random variables and the extension of these principles to random processes as a means of representing random signals are introduced in Chapter 13. Random variables and signals arise naturally in digital lters because of the inevitable quantization of lter coefcients and signal values. The effects of nite word length in digital lters along with relevant up-to-date methods of analysis are discussed in Chapter 14. The topics considered include coefcient quantization and methods to reduce its effects; signal scaling; product quantization and methods to reduce its effects; parasitic and overow limit-cycle oscillations and methods to eliminate them. Chapters 15 and 16 deal with the solution of the approximation problem using iterative optimization methods. Chapter 15 describes a number of efcient algorithms based on the Remez exchange algorithm that can be used to design nonrecursive lters of the standard types, e.g., lowpass, highpass, bandpass, and bandstop lters, and also specialized lters, e.g., lters with arbitrary amplitude responses, multiband lters, and digital differentiators. Chapter 16, on the other hand, considers the design of recursive digital lters by optimization. To render this material accessible to PREFACE xxiii the reader who has not had the opportunity to study optimization before, a series of progressively improved but related algorithms is presented starting with the classical Newton algorithm for convex problems and culminating in a fairly sophisticated, practical, and efcient quasi-Newton algorithm that can be used to design digital lters with arbitrary frequency responses. Chapter 16 also deals with the design of recursive equalizers which are often used to achieve a linear phase response in a recursive lter. Chapter 17 is in effect a continuation of Chapter 8 and it deals with the realization of digital lters in the form of wave digital lters. These structures are derived from classical analog lters and, in consequence, they have certain attractive features, such as low sensitivity to numerical errors, which make them quite attractive for certain applications. The chapter includes step-by-step procedures by which wave digital lters satisfying prescribed specications can be designed either in ladder or lattice form. The chapter concludes with a list of guidelines that can be used to choose a digital-lter structure from the numerous possibilities described in Chapters 8 and 12. Chapter 18 deals with some of the numerous applications of digital lters to digital signal processing. The applications considered include downsampling and upsampling using decimators and interpolators, the design of quadrature-mirror-image lters and their application in time-division to frequency-division multiplex translation, Hilbert transformers and their application in singlesideband modulation, adaptive lters, and two-dimensional digital lters. The purpose of Appendix A is twofold. First, it can be regarded as a brief review of complex analysis for readers who have not had the opportunity to take a course on this important subject. Second, it can serve as a reference monograph that brings together those principles of complex analysis that are required for DSP. Appendix B, on the other hand, presents the basic principles of elliptic integrals and functions and its principal purpose is to facilitate the derivation of the elliptic approximation in Chapter 10. The book can serve as a text for undergraduate or graduate courses and various scenarios are possible depending on the background preparation of the class and the curriculum of the institution. Some possibilities are as follows: Series of Two Undergraduate Courses. First-level course: Chapters 1 to 7, second-level course: Chapters 8 to 14 Series of Two Graduate Courses. First-level course: Chapters 5 to 12, second-level course: Chapters 13 to 18 One Undergraduate/Graduate Course. Assuming that the students have already taken relevant courses on signal analysis and system theory, a one-semester course could be offered comprising Chapters 5 to 12 and parts of Chapter 14. The book is supported by the authors DSP software package D-Filter which can be used to analyze, design, and realize digital lters, and to analyze discrete-time signals. See D-Filter page at the end of the book for more details. The software can be downloaded from D-Filters website: www.d-lter.com or www.d-lter.ece.uvic.ca. In addition, a detailed Instructors Manual and PDF slides for classroom use are now being prepared, which will be made available to instructors adopting the book through the authors website: www.ece.uvic.ca/ andreas. I would like to thank Stuart Bergen, Rajeev Nongpiur, and Wu-Sheng Lu for reviewing the reference lists of certain chapters and supplying more up-to-date references; Tarek Nasser for checking certain parts of the manuscript; Randy K. Howell for constructing the plots in Figures 16.12 and 16.13; xxiv DIGITAL SIGNAL PROCESSING Majid Ahmadi for constructive suggestions; Tony Antoniou for suggesting improvements in the design of the cover and title page of the book and for designing the installation graphics and icons of D-Filter; David Guindon for designing a new interface for D-Filter; Catherine Chang for providing help in updating many of the illustrations; Lynne Barrett for helping with the proofreading; Michelle L. Flomenhoft, Development Editor, Higher Education Division, McGraw-Hill, for her many contributions to the development of the manuscript and for arranging the reviews; to the reviewers of the manuscript for providing useful suggestions and identifying errata, namely, Scott T. Acton, University of Virginia; Selim Awad, University of Michigan; Vijayakumar Bhagavatula, Carnegie Mellon University; Subra Ganesan, Oakland University; Martin Haenggi, University of Notre Dame; Donald Hummels, University of Maine; James S. Kang, California State Polytechnic University; Takis Kasparis, University of Central Florida; Preetham B. Kumar, California State University; Douglas E. Melton, Kettering University; Behrooz Nowrouzian, University of Alberta; Wayne T. Padgett, Rose-Hulman Institute of Technology; Roland Priemer, University of Illinois, Chicago; Stanley J. Reeves, Auburn University; Terry E. Riemer, University of New Orleans; A. David Salvia, Pennsylvania State University; Ravi Sankar, University of South Florida; Avtar Singh, San Jose State University; Andreas Spanias, Arizona State University; Javier Vega-Pineda, Instituto Tecnologico de Chihuahua; Hsiao-Chun Wu, Louisiana State University; Henry Yeh, California State University. Thanks are also due to Micronet, Networks of Centres of Excellence Program, Canada, the Natural Sciences and Engineering Research Council of Canada, and the University of Victoria, British Columbia, Canada, for supporting the research that led to many of the authors contributions to DSP as described in Chapters 12 and 14 to 17. Last but not least, I would like to express my thanks and appreciation to Mona Tiwary, Project Manager, International Typesetting and Composition, and Stephen S. Chapman, Editorial Director, Professional Division, McGraw-Hill, for seeing the project through to a successful conclusion. Andreas Antoniou CHAPTER 1 INTRODUCTION TO DIGITAL SIGNAL PROCESSING 1.1 INTRODUCTION The overwhelming advancements in the fabrication of microchips and their application for the design of efcient digital systems over the past 50 years have led to the emergence of a new discipline that has come to be known as digital signal processing or DSP. Through the use of DSP, sophisticated communication systems have evolved, the Internet emerged, astronomical signals can be distilled into valuable information about the cosmos, seismic signals can be analyzed to determine the strength of an earthquake or to predict the stability of a volcano, computer images or photographs can be enhanced, and so on. This chapter deals with the underlying principles of DSP. It begins by examining the types of signals that are encountered in nature, science, and engineering and introduces the sampling process which is the means by which analog signals can be converted to corresponding digital signals. It then examines the types of processing that can be applied to a signal and the types of systems that are available for the purpose. The chapter concludes with two introductory applications that illustrate the nature of DSP for the benet of the neophyte. 1.2 SIGNALS Signals arise in almost every eld of science and engineering, e.g., in astronomy, acoustics, biology, communications, seismology, telemetry, and economics to name just a few. Signals arise naturally through certain physical processes or are man-made. Astronomical signals can be generated by 1 Copyright 2006 by The McGraw-Hill Companies, Inc. Click here for terms of use. 2 DIGITAL SIGNAL PROCESSING huge cosmological explosions called supernovas or by rapidly spinning neutron stars while seismic signals are the manifestations of earthquakes or volcanos that are about to erupt. Signals also abound in biology, e.g., the signals produced by the brain or heart, the acoustic signals used by dolphins or whales to communicate with one another, or those generated by bats to enable them to navigate or catch prey. Man-made signals, on the other hand, occur in technological systems, as might be expected, like computers, telephone and radar systems, or the Internet. Even the market place is a source of numerous vital signals, e.g., the prices of commodities at a stock exchange or the Dow Jones Industrial Average. We are very interested in natural signals for many reasons. Astronomers can extract important information from optical signals received from the stars, e.g., their chemical composition, they can decipher the nature of a supernova explosion, or determine the size of a neutron star from the periodicity of the signal received. Seismologists can determine the strength and center of an earthquake whereas volcanologists can often predict whether a volcano is about to blow its top. Cardiologists can diagnose various heart conditions by looking for certain telltale patterns or aberrations in electrocardiographs. We are very interested in man-made signals for numerous reasons: they make it possible for us to talk to one another over vast distances, enable the dissemination of huge amounts of information over the Internet, facilitate the different parts of a computer to interact with one another, instruct robots how to perform very intricate tasks rapidly, help aircraft to land in poor weather conditions and low visibility, or warn pilots about loss of separation between aircraft to avoid collisions. On the other hand, the market indices can help us determine whether it is the right time to invest and, if so, what type of investment should we go for, equities or bonds. In the above paragraphs, we have tacitly assumed that a signal is some quantity, property, or variable that depends on time, for example, the light intensity of a star or the strength of a seismic signal. Although this is usually the case, signals exist in which the independent parameter is some quantity other than time, and the number of independent variables can be more than one occasionally. For example, a photograph or radiograph can be viewed as a two-dimensional signal where the light intensity depends on the x and y coordinates which happen to be lengths. On the other hand, a TV image which changes with time can be viewed as a three-dimensional signal with two of the independent variables being lengths and one being time. Signals can be classied as continuous-time, or discrete-time. Continuous-time signals are dened at each and every instant of time from start to nish. For example, an electromagnetic wave originating from a distant galaxy or an acoustic wave produced by a dolphin. On the other hand, discrete-time signals are dened at discrete instants of time, perhaps every millisecond, second, or day. Examples of this type of signal are the closing price of a particular commodity at a stock exchange and the daily precipitation as functions of time. Natures signals are usually continuous in time. However, there are some important exceptions to the rule. For example, in the domain of quantum physics electrons gain or lose energy in discrete amounts and, presumably, at discrete instants. On the other hand, the DNA of all living things is constructed from a ladder-like structure whose ranks are made from four fundamental distinct organic molecules. By assigning distinct numbers to these basic molecules and treating the length of the ladder-like structure as if it were time, the genome of any living organism can be represented by a discrete-time signal. Man-made signals can be continuous- or discrete-time and typically the type of signal depends on whether the system that produced it is analog or digital. INTRODUCTION TO DIGITAL SIGNAL PROCESSING 3 In mathematical terms, a continuous-time signal can be represented by a function x (t ) whose domain is a range of numbers (t1 , t2 ), where < t1 and t2 < , as illustrated in Fig. 1.1a . Similarly, a discrete-time signal can be represented by a function x (nT ), where T is the period between adjacent discrete signal values and n is an integer in the range (n 1 , n 2 ) where < n 1 and n 2 < , as shown in Fig. 1.1b. Discrete-time signals are often generated from corresponding continuous-time signals through a sampling process and T is, therefore, said to be the sampling period. Its reciprocal, i.e., f s = 1/ T , is known as the sampling frequency. Signals can also be classied as nonquantized, or quantized. A nonquantized signal can assume any value in a specied range, whereas a quantized signal can assume only discrete values, usually equally spaced. Figure 1.1c and d shows quantized continuoustime and quantized discrete-time signals, respectively. Signals are sometimes referred to as analog or digital in the literature. By and large, an analog signal is deemed to be a continuous-time signal, and vice versa. Similarly, a digital signal is deemed to be a discrete-time signal, and vice versa. A pulse waveform, like the numerous waveforms found in a typical digital system, would be regarded as a digital signal if the focus were on its two-level idealized representation. However, if the exact actual level of the waveform were of interest, then the pulse waveform would be treated as a continuous-time signal as the signal level can assume an innite set of values. x(t) x(nT ) t (a) (b) nT x(t) x(nT ) t (c) (d ) nT Figure 1.1 Types of signals: (a) Nonquantized continuous-time signal, (b) nonquantized discrete-time signal, (c) quantized continuous-time signal, (d) quantized discrete-time signal. 4 DIGITAL SIGNAL PROCESSING Sampler x(nT ) x(t) Quantizer xq(nT ) Encoder xq(nT ) ' Clock nT (a) y(nT ) Decoder ^ y(nT ) Smoothing device y(t) (b) Figure 1.2 Sampling system: (a) A/D interface, (b) D/A interface. Discrete-time signals are often generated from corresponding continuous-time signals through the use of an analog-to-digital (A/D) interface and, similarly, continuous-time signals can be obtained by using a digital-to-analog (D/A) interface. An A/D interface typically comprises three components, namely, a sampler, a quantizer, and an encoder as depicted in Fig. 1.2a . In the case where the signal is in the form of a continuous-time voltage or current waveform, the sampler in its bare essentials is a switch controlled by a clock signal, which closes momentarily every T s thereby transmitting the level of the input signal x (t ) at instant nT , that is, x (nT ), to the output. A quantizer is an analog device that will sense the level of its input and produce as output the nearest available level, say, xq (nT ), from a set of allowed levels, i.e., a quantizer will produce a quantized continuous-time signal such as that shown in Fig. 1.1c. An encoder is essentially a digital device that will sense the voltage or current level of its input and produce a corresponding number at the output, i.e., it will convert a quantized continuous-time signal of the type shown in Fig. 1.1c to a corresponding discrete-time signal of the type shown in Fig. 1.1d . The D/A interface comprises two modules, a decoder and a smoothing device as depicted in Fig. 1.2b. The decoder will convert a discrete-time signal into a corresponding quantized voltage waveform such as that shown in Fig. 1.1c. The purpose of the smoothing device is to smooth out the quantized waveform and thus eliminate the inherent discontinuities. The A/D and D/A interfaces are readily available as off-the-shelf components known as A/D and D/A converters and many types, such as high-speed, low-cost, and high-precision, are available. 1.3 FREQUENCY-DOMAIN REPRESENTATION Signals have so far been represented in terms of functions of time, i.e., x (t ) or x (nT ). In many situations, it is useful to represent signals in terms of functions of frequency. For example, a INTRODUCTION TO DIGITAL SIGNAL PROCESSING 5 Table 1.1 Parameters of signal in Eq. (1.1) k 1 2 3 4 5 6 7 8 9 k 1 2 3 4 5 6 7 8 9 Ak 0.6154 0.7919 0.9218 0.7382 0.1763 0.4057 0.9355 0.9169 0.4103 k 0.0579 0.3529 0.8132 0.0099 0.1389 0.2028 0.1987 0.6038 0.2722 continuous-time signal made up of a sum of sinusoidal components such as 9 x (t ) = k =1 Ak sin(k t + k ) (1.1) can be fully described by two sets,1 say, A() = { Ak : = k for k = 1, 2, . . . , 9} and () = {k : = k for k = 1, 2, . . . , 9} that describe the amplitudes and phase angles of the sinusoidal components present in the signal. Sets A() and () can be referred to as the amplitude spectrum and phase spectrum of the signal, respectively, for obvious reasons, and can be represented by tables or graphs that give the amplitude and phase angle associated with each frequency. For example, if Ak and k in Eq. (1.1) assume the numerical values given by Table 1.1, then x (t ) can be represented in the time domain by the graph in Fig. 1.3a and in the frequency domain by Table 1.1 or by the graphs in Fig. 1.3b and c. The usefulness of a frequency-domain or simply spectral representation can be well appreciated by comparing the time- and frequency-domain representations in Fig. 1.3. The time-domain representation shows that what we have is a noise-like periodic signal. Its periodicity is to be expected as the signal is made up of a sum of sinusoidal components that are periodic. The frequency-domain representation, on the other hand, provides a fairly detailed and meaningful description of the individual frequency components, namely, their frequencies, amplitudes, and phase angles. 1 This representation of a set will be adopted throughout the book. 6 DIGITAL SIGNAL PROCESSING 5 x(t) 0 5 10 5 0 Time, s 5 10 15 (a) Amplitude spectrum 1.0 0.4 0.2 0.8 0 Magnitude 0.6 Phase angle, rad 0.2 0.4 0.6 0.8 Phase spectrum 0.4 0.2 0 0 5 Frequency, rad /s 10 1.0 0 5 Frequency, rad /s 10 (b) (c) Figure 1.3 Time- and frequency-domain representations of the periodic signal represented by Eq. (1.1) with the parameters given in Table 1.1: (a ) Time-domain representation, (b) amplitude spectrum, (c) phase spectrum. The representation in Eq. (1.1) is actually the Fourier series of signal x (t ) and deriving the Fourier series of a periodic signal is just one way of obtaining a spectral representation for a signal. Scientists, mathematicians, and engineers have devised a variety of mathematical tools that can be used for the spectral representation of different types of signals. Other mathematical tools, in addition to the Fourier series, are the Fourier transform which is applicable to periodic as well as nonperiodic continuous-time signals; the z transform which is the tool of choice for discrete-time nonperiodic signals; and the discrete-Fourier transform which is most suitable for discrete-time periodic signals. INTRODUCTION TO DIGITAL SIGNAL PROCESSING 7 The Fourier series and Fourier transform will be reviewed in Chap. 2, the z transform will be examined in detail in Chap. 3, and the discrete-Fourier transform will be treated in Chap. 7. 1.4 NOTATION The notation introduced in Sec. 1.2 for the representation of discrete-time signals, i.e., x (nT ), preserves the exact relation between a discrete-time signal and the underlying continuous-time signal x (t ) for the case where the former is generated from the latter through the sampling process. The use of this notation tends to be somewhat cumbersome on account of the numerous Ts that have to be repeated from one equation to the next. For the sake of simplicity, many authors use x (n ) or xn instead of x (nT ). These simplied notations solve one problem but create another. For example, a discrete-time signal generated from the continuous-time signal x (t ) = et sin(t ) through the sampling process would naturally be x (nT ) = enT sin(nT ) If we were to drop the T in x (nT ), that is, x (n ) = enT sin(nT ) then a notation inconsistency is introduced as evaluating x (t ) at t = n does not give the correct expression for the discrete-time signal. This problem tends to propagate into the frequency domain and, in fact, it causes the spectral representation of the discrete-time signal to be inconsistent with that of the underlying continuous-time signal. The complex notation can be avoided while retaining consistency between the continuousand discrete-time signals through the use of time normalization. In this process, the time axis of the continuous-time signal is scaled by replacing t by t / T in x (t ), that is, x (t )|t t / T = x If t is now replaced by nT , we get x (n ) = e(nT / T ) sin nT T = en sin(n ) t T = e(t / T ) sin t T In the above time normalization, the sampling period is, in effect, changed from T to 1 s and, consequently, T disappears from the picture. Time normalization can be reversed by applying time denormalization by simply replacing n by nT where T is the actual sampling period. In this book, the full notation x (nT ) will be used when dealing with the fundamentals, namely, in Chaps. 36. In later chapters, signals will usually be assumed to be normalized with respect to time and, in such cases, the simplied notation x (n ) will be used. The notation xn will not be used. It was mentioned earlier that the independent variable can be some quantity other than time, e.g., length. Nevertheless, the symbol T will be used for these situations as well, for the sake of 8 DIGITAL SIGNAL PROCESSING a consistent notation. In certain situations, the entity to be processed may well be just a sequence of numbers that are independent of any physical quantity. In such situations, x (n ) is the correct notation. The theories presented in this book apply equally well to such entities but the notions of time domain and frequency domain lose their usual physical signicance. We are, in effect, dealing with mathematical transformations. 1.5 SIGNAL PROCESSING Signal processing is the science of analyzing, synthesizing, sampling, encoding, transforming, decoding, enhancing, transporting, archiving, and in general manipulating signals in some way. With the rapid advances in very-large-scale integrated (VLSI) circuit technology and computer systems, the subject of signal processing has mushroomed into a multifaceted discipline with each facet deserving its own volume. This book is concerned primarily with the branch of signal processing that entails the spectral characteristics and properties of signals. The spectral representation and analysis of signals in general are carried out through the mathematical transforms alluded to in the previous section, e.g., the Fourier series and Fourier transform. If the processing entails modifying, reshaping, or transforming the spectrum of a signal in some way, then the processing involved will be referred to as ltering in this book. Filtering can be used to select one or more desirable and simultaneously reject one or more undesirable bands of frequency components, or simply frequencies. For example, one could use lowpass ltering to select a band of preferred low frequencies and reject a band of undesirable high frequencies from the frequencies present in the signal depicted in Fig. 1.3, as illustrated in Fig. 1.4; use highpass ltering to select a band of preferred high frequencies and reject a band of undesirable low frequencies as illustrated in Fig. 1.5; use bandpass ltering to select a band of frequencies and reject low and high frequencies as illustrated in Fig. 1.6; or use bandstop ltering to reject a band of frequencies but select low frequencies and high frequencies as illustrated in Fig. 1.7. In the above types of ltering, one or more undesirable bands of frequencies are rejected or ltered out and the term ltering is quite appropriate. In some other types of ltering, certain frequency components are strengthened while others are weakened, i.e., nothing is rejected or ltered out. Yet these processes transform the spectrum of the signal being processed and, as such, they fall under the category of ltering in the broader denition of ltering adopted in this book. Take differentiation, for example. Differentiating the signal in Eq. (1.1) with respect to t gives d x (t ) = dt = k =1 9 k =1 9 d [ Ak sin(k t + k )] = dt 9 k Ak cos(k t + k ) k =1 k Ak sin k t + k + 1 2 The amplitude and phase spectrums of the signal have now become A() = {k Ak : = k for k = 1, 2, . . . , 9} and () = k + 1 : = k for k = 1, 2, . . . , 9 2 INTRODUCTION TO DIGITAL SIGNAL PROCESSING 9 5 x(t) 0 5 10 5 0 Time, s 5 10 15 (a) Amplitude spectrum 1.0 0.4 0.2 0.8 0 Magnitude 0.6 Phase angle, rad 0.2 0.4 0.6 0.2 0.8 0 0 5 Frequency, rad/s 10 1.0 0 Phase spectrum 0.4 5 Frequency, rad/s 10 (b) (c) Figure 1.4 Lowpass ltering applied to the signal depicted in Fig. 1.3: (a ) Time-domain representation, (b) amplitude spectrum, (c) phase spectrum. respectively. The effect of differentiating the signal of Eq. (1.1) is illustrated in Fig. 1.8. As can be seen by comparing Fig. 1.3b and c with Fig. 1.8b and c, differentiation scales the amplitudes of the different frequency components by a factor that is proportional to frequency and adds a phase angle of 1 to each value of the phase spectrum. In other words, the amplitudes of low-frequency 2 components are attenuated, whereas those of high-frequency components are enhanced. In effect, the process of differentiation is a type of highpass ltering. 10 DIGITAL SIGNAL PROCESSING 5 x(t) 0 5 10 5 0 Time, s 5 10 15 (a) Amplitude spectrum 1.0 0.2 0.1 0.8 Phase angle, rad 0 0.1 0.2 0.3 0.4 0.5 0.6 0 0 5 Frequency, rad/s 10 0.7 0 5 Frequency, rad/s 10 Phase spectrum Magnitude 0.6 0.4 0.2 (b) (c) Figure 1.5 Highpass ltering applied to the signal depicted in Fig. 1.3: (a ) Time-domain representation, (b) amplitude spectrum, (c) phase spectrum. Integrating x (t ) with respect to time, on the other hand, gives 9 9 x (t ) dt = k =1 9 Ak sin(k t + k ) dt = k =1 Ak cos(k t + k ) k = k =1 Ak sin k t + k 1 2 k INTRODUCTION TO DIGITAL SIGNAL PROCESSING 11 5 x(t) 0 5 10 5 0 Time, s 5 10 15 (a) Amplitude spectrum 0.8 0.7 0.6 Magnitude 0.5 0.4 0.3 0.2 0.1 0 0 5 Frequency, rad/s 10 Phase angle, rad 0.15 0.10 0.05 0 0.05 0.10 0.15 0.20 0.25 0 5 Frequency, rad/s 10 Phase spectrum (b) (c) Figure 1.6 Bandpass ltering applied to the signal depicted in Fig. 1.3: (a ) Time-domain representation, (b) amplitude spectrum, (c) phase spectrum. In this case, the amplitude and phase spectrums become A() = { Ak /k : = k for k = 1, 2, . . . , 9} and () = k 1 : = k for k = 1, 2, . . . , 9 2 12 DIGITAL SIGNAL PROCESSING 5 x(t) 0 5 10 5 0 Time, s 5 10 15 (a) Amplitude spectrum 1.0 0.4 0.2 0.8 0 Magnitude 0.6 Phase angle, rad 0.2 0.4 0.6 0.2 0.8 0 5 Frequency, rad/s 10 1.0 0 5 Frequency, rad/s 10 Phase spectrum 0.4 0 (b) (c) Figure 1.7 Bandstop ltering applied to the signal depicted in Fig. 1.3: (a ) Time-domain representation, (b) amplitude spectrum, (c) phase spectrum. respectively, i.e., the amplitudes of the different frequency components are now scaled by a factor that is inversely proportional to the frequency and a phase angle of 1 is subtracted from each value of 2 the phase spectrum. Thus, integration tends to enhance low-frequency and attenuate high-frequency components and, in a way, it tends to behave very much like lowpass ltering as illustrated in Fig. 1.9. In its most general form, ltering is a process that will transform the spectrum of a signal according to some rule of correspondence. In the case of lowpass ltering, the rule of correspondence INTRODUCTION TO DIGITAL SIGNAL PROCESSING 13 20 10 0 x(t) 10 20 30 10 5 0 Time, s 5 10 15 (a) Amplitude spectrum 8 7 6 Magnitude 5 4 3 2 1 0 0 5 Frequency, rad/s 10 2.5 0 5 Frequency, rad/s 10 Phase angle, rad 0.5 0 Phase spectrum 1.0 1.5 2.0 (b) (c) Figure 1.8 Differentiation applied to the signal depicted in Fig. 1.3: (a ) Time-domain representation, (b) amplitude spectrum, (c) phase spectrum. might specify, for example, that the spectrum of the output signal be approximately the same as that of the input signal for some low-frequency range and approximately zero for some high-frequency range. Electrical engineers have known about ltering processes for well over 80 years and, through the years, they invented many types of circuits and systems that can perform ltering, which are known collectively as lters. Filters can be designed to perform a great variety of ltering tasks, in addition, to those illustrated in Figs. 1.41.9. For example, one could easily design a lowpass lter 14 DIGITAL SIGNAL PROCESSING 5 x(t) 0 5 10 5 0 Time, s 5 10 15 (a) Amplitude spectrum 0.7 0.6 0.5 Phase angle, rad Magnitude 0.4 0.3 0.2 2.0 0.1 0 0 5 Frequency, rad/s 10 2.5 1.0 0 Phase spectrum 0.5 1.5 0 5 Frequency, rad/s 10 (b) (c) Figure 1.9 Integration applied to the signal depicted in Fig. 1.3: (a ) Time-domain representation, (b) amplitude spectrum, (c) phase spectrum. that would select low frequencies in the range from 0 to p and reject high frequencies in the range from a to . In such a lter, the frequency ranges from 0 to p and a to , are referred to as the passband and stopband, respectively. Filters can be classied on the basis of their operating signals as analog or digital. In analog lters, the input, output, and internal signals are in the form of continuous-time signals, whereas in digital lters they are in the form of discrete-time signals. INTRODUCTION TO DIGITAL SIGNAL PROCESSING 15 1.6 ANALOG FILTERS This book is concerned mainly with DSP and with discrete-time systems that can perform DSP, such as digital lters. Since digital lters evolved as a natural extension of analog lters and are often designed through the use of analog-lter methodologies, a brief outline of the historical evolution and applications of analog lters are worthwhile. Analog lters were originally invented for use in radio receivers and long-distance telephone systems and continue to be critical components in all types of communication systems. Various families of analog lters have evolved over the years, which can be classied as follows on the basis of their constituent elements and the technology used [1, 2].2 Passive R LC 3 lters Discrete active RC lters Integrated active RC lters Switched-capacitor lters Microwave lters Passive R LC lters began to be used extensively in the early twenties. They are made of interconnected resistors, inductors, and capacitors and are said to be passive in view of the fact that they do not require an energy source, like a power supply, to operate. Filtering action is achieved through the property of electrical resonance which occurs when an inductor and a capacitor are connected in series or in parallel. The importance of ltering in communications motivated engineers and mathematicians between the thirties and fties to develop some very powerful and sophisticated methods for the design of passive R LC lters. Discrete active RC lters began to appear during the mid-fties and were a hot topic of research during the sixties. They comprise discrete resistors, capacitors, and amplifying electronic circuits. Inductors are absent and it is this feature that makes active RC lters attractive. Inductors have always been bulky, expensive, and generally less ideal than resistors and capacitors particularly for low-frequency applications. Unfortunately, without inductors, electrical resonance cannot be achieved and with just resistors and capacitors only crude types of lters can be designed. However, through the clever use of amplifying electronic circuits in RC circuits, it is possible to simulate resonance-like effects that can be utilized to achieve ltering of high quality. These lters are said to be active because the amplifying electronic circuits require an energy source in the form of a power supply. Integrated-circuit active RC lters operate on the basis of the same principles as their discrete counterparts except that they are designed directly as complete integrated circuits. Through the use of high-frequency amplifying circuits and suitable integrated-circuit elements, lters that can operate at frequencies as high as 15 GHz can be designed [3, 4].4 Interest in these lters has been strong during the eighties and nineties and research continues. Switched-capacitor lters evolved during the seventies and eighties. These are essentially active RC lters except that switches are also utilized along with amplifying devices. In this family 2 Numbered 3 R, references will be found at the end of each chapter. L, and C are the symbols used for the electrical properties of resistance, inductance, and capacitance, respectively. 4 One GHz equals 109 Hz. 16 DIGITAL SIGNAL PROCESSING of lters, switches are used to simulate high resistance values which are difcult to implement in integrated-circuit form. Like integrated active RC lters, switched-capacitors lters are compatible with integrated-circuit technology. Microwave lters are built from a variety of microwave components and devices such as transverse electromagnetic (TEM) transmission lines, waveguides, dielectric resonators, and surface acoustic devices [5]. They are used in applications where the operating frequencies are in the range 0.5 to 500 GHz. 1.7 APPLICATIONS OF ANALOG FILTERS Analog lters have found widespread applications over the years. A short but not exhaustive list is as follows: Radios and TVs Communication and radar systems Telephone systems Sampling systems Audio equipment Every time we want to listen to the radio or watch TV, we must rst select our favorite radio station or TV channel. What we are actually doing when we turn the knob on the radio or press the channel button on the remote control is tuning the radio or TV receiver to the broadcasting frequency of the radio station or TV channel, and this is accomplished by aligning the frequency of a bandpass lter inside the receiver with the broadcasting frequency of the radio station or TV channel. When we tune a radio receiver, we select the frequency of a desirable signal, namely, that of our favorite radio station. The signals from all the other stations are undesirable and are rejected. The same principle can be used to prevent a radar signal from interfering with the communication signals at an airport, for example, or to prevent the communication signals from interfering with the radar signals. Signals are often corrupted by spurious signals known collectively as noise. Such signals may originate from a large number of sources, e.g., lightnings, electrical motors, transformers, and power lines. Noise signals are characterized by frequency spectrums that stretch over a wide range of frequencies. They can be eliminated through the use of bandpass lters that would pass the desired signal but reject everything else, namely, the noise content, as in the case of a radio receiver. We all talk daily to our friends and relatives through the telephone system. More often than not, they live in another city or country and the conversation must be carried out through expensive communication channels. If these channels were to carry just a single voice, as in the days of Alexander Graham Bell,5 no one would ever be able to afford a telephone call to anyone, even the very rich. What makes long-distance calls affordable is our ability to transmit thousands of conversations through one and the same communications channel. And this is achieved through the use of a so-called frequency-division multiplex (FDM) communications system [6]. A rudimentary 5 (18471921) Scottish-born scientist and inventor who spent most of his career in the northeast US and Canada. He invented the telephone between 1874 and 1876. INTRODUCTION TO DIGITAL SIGNAL PROCESSING 17 Transmitter Modulator 1 1 Modulator 2 g(t) Bandpass filters 2 Modulator m 1 Demodulator 1 m 2 g(t) Demodulator 2 m Demodulator m Receiver (a) G() 1 2 (b) m Figure 1.10 Frequency-division multiplex communications system: (a ) Basic system, (b) frequency spectrum of g (t ). version of this type of system is illustrated in Fig. 1.10a . The operation of an FDM communications system is as follows: 1. At the transmit end, the different voice signals are superimposed on different carrier frequencies using a process known as modulation. 2. The different carrier frequencies are combined by using an adder circuit. 3. At the receive end, carrier frequencies are separated using bandpass lters. 4. The voice signals are then extracted from the carrier frequencies through demodulation. 5. The voice signals are distributed to the appropriate persons through the local telephone wires. 18 DIGITAL SIGNAL PROCESSING What the transmit section does in the above system is to add the frequency of a unique carrier to the frequencies of each voice signal, thereby shifting its frequency spectrum by the frequency of the carrier. In this way, the frequency spectrums of the different voice signals are arranged contiguously one after the other to form the composite signal g (t ) which is referred to as a group by telephone engineers. The frequency spectrum of g (t ) is illustrated in Fig. 1.10b. The receive section, on the other hand, separates the translated voice signals and restores their original spectrums. As can be seen in Fig. 1.10a , the above system requires as many bandpass lters as there are voice signals. On top of that, there are as many modulators and demodulators in the system and these devices, in their turn, need a certain amount of ltering to achieve their proper operation. In short, communications systems are simply not feasible without lters. Incidentally, several groups can be further modulated individually and added to form a supergroup as illustrated in Fig. 1.11 to increase the number of voice signals transmitted over an intercity cable or microwave link, for example. At the receiving end, a supergroup is subdivided into the individual groups by a bank of bandpass lters which are then, in turn, subdivided into the individual voice signals by appropriate banks of bandpass lters. Similarly, several supergroups can be combined into a master group, and so on, until the bandwidth capacity of the cable or microwave link is completely lled. An important principle to be followed when designing a sampling system like the one illustrated in Fig. 1.2 is that the sampling frequency be at least twice the highest frequency present in the spectrum of the signal by virtue of the sampling theorem (see Chap. 6). In situations where the sampling frequency is xed and the highest frequency present in the signal can exceed half Transmitter 11 12 1m Modulator 1 1 21 22 2m Modulator 2 2 Modulator k Bandpass filters k1 k2 km 1 Demodulator 1 11 12 1m 21 22 2m k 2 Demodulator 2 k Demodulator k Receiver k1 k2 km Figure 1.11 Frequency-division multiplex communications system with two levels of modulation. INTRODUCTION TO DIGITAL SIGNAL PROCESSING 19 the sampling frequency, it is crucial to bandlimit the signal to be sampled to prevent a certain type of signal distortion known as aliasing. This bandlimiting process, which amounts to removing signal components whose frequencies exceed half the sampling frequency, can be carried out through the use of a lowpass lter. Discrete-time signals are often converted back to continuous-time signals. For example, the signal recorded on a compact disk (CD) is actually a discrete-time signal. The function of a CD player is to reverse the sampling process illustrated in Fig. 1.2, that is, it must read the discrete-time signal, decode it, and reproduce the original continuous-time audio signal. As will be shown later on in Chap. 6, the continuous-time signal can be reconstructed through the use of a lowpass lter. Loudspeaker systems behave very much like lters and, consequently, they tend to change the spectrum of an audio signal. This is due to the fact that the enclosure or cabinet used can often exhibit mechanical resonances that are superimposed on the audio signal. In fact, this is one of the reasons why different makes of loudspeaker systems often produce their own distinct sound which, in actual fact, is different from the sound recorded on the CD. To compensate for such imperfections, sound reproduction equipment, such as CD players and stereos, are often equipped with equalizers that can be used to reshape the spectrum of the audio signal. These subsystems typically incorporate a number of sliders that can be adjusted to modify the quality of the sound reproduced. One can, for example, strengthen or weaken the low-frequency or high-frequency content (bass or treble) of the audio signal. Since an equalizer is a device that can modify the spectrum of a signal, equalizers are lters in the broader denition adopted earlier. What the sliders do is to alter the parameters of the lter that performs the equalization. In the same way, one can also compensate for the acoustics of the room. For example, one might need to boost the treble a bit if there is a thick carpet in the room because the carpet could absorb a large amount of the high-frequency content. Transmission lines, telephone wires, and communication channels often behave very much like lters and, as a result, they tend to reshape the spectrums of the signals transmitted through them. The local telephone lines are particularly notorious in this respect. We often do not recognize the voice of the person at the other end only because the spectrum of the signal has been signicantly altered. As in loudspeaker systems, the quality of transmission through communication channels can be improved by using suitable equalizers. In fact, it is through the use of equalizers that it is possible to achieve high data transmission rates through local telephone lines. This is achieved by incorporating sophisticated equalizers in the modems at either end of a telephone line. 1.8 DIGITAL FILTERS In its most general form, a digital lter is a system that will receive an input in the form of a discrete-time signal and produce an output again in the form of a discrete-time signal, as illustrated in Fig. 1.12. There are many types of discrete-time systems that fall under this category such as digital control systems, encoders, and decoders. What differentiates digital lters from other digital systems is the nature of the processing involved. As in analog lters, there is a requirement that the spectrum of the output signal be related to that of the input by some rule of correspondence. The roots of digital lters go back in history to the 1600s when mathematicians, on the one hand, were attempting to deduce formulas for the areas of different geometrical shapes, and astronomers, on the other, were attempting to rationalize and interpret their measurements of planetary orbits. A need arose in those days for a process that could be used to interpolate a function represented by numerical data, and a wide range of numerical interpolation formulas were proposed over the 20 DIGITAL SIGNAL PROCESSING x(nT ) Digital filter y(nT ) x(nT ) y(nT ) nT nT Figure 1.12 The digital lter as a discrete-time system. years by Gregory (16381675), Newton (16421727), Taylor (16851731), Stirling (16921770), Lagrange (17361813), Bessel (17841846), and others [7, 8]. On the basis of interpolation formulas, formulas that will perform numerical differentiation or integration on a function represented by numerical data can be generated. These formulas were put to good use during the seventeenth and eighteenth centuries in the construction of mathematical, scientic, nautical, astronomical, and a host of other types of numerical tables. In fact, it was the great need for accurate numerical tables that prompted Charles Babbage (17911871) to embark on his lifelong quest to automate the computation process through his famous difference and analytical engines [9], and it is on the basis of numerical formulas that his machines were supposed to perform their computations. Consider the situation where a numerical algorithm is used to compute the derivative of a signal x (t ) at t = t1 , t2 , . . . , t K , and assume that the signal is represented by its numerical values x (t1 ), x (t2 ), . . . , x (t M ). In such a situation, the algorithm receives a discrete-time signal as input and produces a discrete-time signal as output, which is a differentiated version of the input signal. Since differentiation is essentially a ltering process, as was demonstrated earlier on, an algorithm that performs numerical differentiation is, in fact, a digital ltering process. Numerical methods have found their perfect niche in the modern digital computer and considerable progress has been achieved through the fties and sixties in the development of algorithms that can be used to process signals represented in terms of numerical data. By the late fties, a cohesive collection of techniques referred to as data smoothing and prediction began to emerge through the efforts of pioneers such as Blackman, Bode, Shannon, Tukey [10, 11], and others. During the early sixties, an entity referred to as the digital lter began to appear in the literature to describe a collection of algorithms that could be used for spectral analysis and data processing [1217]. In 1965, Blackman described the state of the art in the area of data smoothing and prediction in his seminal book on the subject [18], and included in this work certain techniques which he referred to as numerical ltering. Within a year, in 1966, Kaiser authored a landmark chapter, entitled Digital Filters [19] in which he presented a collection of signal processing techniques that could be applied for the simulation of dynamic systems and analog lters. From the late sixties on, the analysis and processing of signals in the form of numerical data became known as digital signal processing, and algorithms, computer programs, or systems that could be used for the processing of these signals became fully established as digital lters [2022]. INTRODUCTION TO DIGITAL SIGNAL PROCESSING 21 With the rapid advances in integrated-circuit technology during the sixties, a trend toward digital technologies began to emerge to take advantage of the classical merits of digital systems in general, which are as follows: Component tolerances are uncritical. Accuracy is high. Physical size is small. Reliability is high. Component drift is relatively unimportant. The inuence of electrical environmental noise is negligible. Owing to these important features, digital technologies can be used to design cost-effective, reliable, and versatile systems. Consequently, an uninterrupted evolution, or more appropriately revolution, began to take place from the early sixties on whereby analog systems were continuously being replaced by corresponding digital systems. First, the telephone system was digitized through the use of pulse-code modulation, then came long-distance digital communications, and then the music industry adopted digital methodologies through the use of compact disks and digital audio tapes. And more recently, digital radio and high-denition digital TV began to be commercialized. Even the movie industry has already embarked on large-scale digitization of the production of movies. Digital lters in hardware form began to appear during the late sixties and two early designs were reported by Jackson, Kaiser, and McDonald in 1968 [23] and Peled and Liu in 1974 [24]. Research on digital lters continued through the years and a great variety of lter types have evolved, as follows: Nonrecursive lters Recursive lters Fan lters Two-dimensional lters Adaptive lters Multidimensional lters Multirate lters The applications of digital lters are widespread and include but are not limited to the following: Communications systems Audio systems such as CD players Instrumentation Image processing and enhancement Processing of seismic and other geophysical signals Processing of biological signals Articial cochleas Speech synthesis 22 DIGITAL SIGNAL PROCESSING It is nowadays convenient to consider computer programs and digital hardware that can perform digital ltering as two different implementations of digital lters, namely, software hardware. Software digital lters can be implemented in terms of a high-level language, such as C++ or MATLAB, on a personal computer or workstation or by using a low-level language on a generalpurpose digital signal-processing chip. At the other extreme, hardware digital lters can be designed using a number of highly specialized interconnected VLSI chips. Both hardware and software digital lters can be used to process real-time or nonreal-time (recorded) signals, except that the former are usually much faster and can deal with real-time signals whose frequency spectrums extend to much higher frequencies. Occasionally, digital lters are used in so-called quasi-real-time applications whereby the processing appears to a person to be in real time although, in actual fact, the samples of the signal are rst collected and stored in a digital memory and are then retrieved in blocks and processed. A familiar, quasi-real-time application involves the transmission of radio signals over the Internet. These signals are transmitted through data packets in a rather irregular manner. Yet the music appears to be continuous only because the data packets are rst stored and then properly sequenced. This is why it takes a little while for the transmission to begin. Hardware digital lters have an important advantage relative to analog lters, in addition to the classical merits associated with digital systems in general. The parameters of a digital lter are stored in a computer memory and, consequently, they can be easily changed in real time. This means that digital lters are more suitable for applications where programmable, time-variable, or adaptive lters are required. However, they also have certain important limitations. At any instant, say, t = nT , a digital lter generates the value of the output signal through a series of computations using some of the values of the input signal and possibly some of the values of the output signal (see Chap. 4). Once the sampling frequency, f s , is xed, the sampling period T = 1/ f s is also xed and, consequently, a basic limitation is imposed by the amount of computation that can be performed by the digital lter during period T . Thus as the sampling frequency is increased, T is reduced, and the amount of computation that can be performed during period T is reduced. Eventually, at some sufciently high sampling frequency, a digital lter will become computation bound and will malfunction. In effect, digital lters are suitable for low-frequency applications where the operating frequencies are in some range, say, 0 to max . The upper frequency of applicability, max , is difcult to formalize because it depends on several factors such as the number-crunching capability and speed of the digital hardware on the one hand and the complexity of the ltering tasks involved on the other. Another basic limitation of digital lters comes into play in situations where the signal is in continuous-time form and a processed version of the signal is required, again in continuous-time form. In such a case, the signal must be converted into a discrete-time form, processed by the digital lter, and then converted back to a continuous-time form. The two conversions involved would necessitate various interfacing devices, e.g., A/D and D/A converters, and a digital-lter solution could become prohibitive relative to an analog-lter solution. This limitation is, of course, absent if we are dealing with a digital system to start with in which the signals to be processed are already in discrete-time form. Table 1.2 summarizes the frequency range of applicability for the various types of lters [1]. As can be seen, for frequencies less than, say, 20 kHz digital lters are most likely to offer the best INTRODUCTION TO DIGITAL SIGNAL PROCESSING 23 Table 1.2 Comparison of lter technologies Type of technology Digital lters Discrete active RC lters Switched-capacitor lters Passive R LC lters Integrated active RC lters Microwave lters Frequency range 0 to max 10 Hz to 1 MHz 10 Hz to 5 MHz 0.1 MHz to 0.1 GHz 0.1 MHz to 15 GHz 0.5 GHz to 500 GHz engineering solution whereas for frequencies in excess of 0.5 GHz, a microwave lter is the obvious choice. For frequencies between 20 kHz and 0.5 GHz, the choice of lter technology depends on many factors and trade-offs and is also critically dependent on the type of application. To conclude this section, it should be mentioned that software digital lters have no counterpart in the analog world and, therefore, for nonreal-time applications, they are the only choice. 1.9 TWO DSP APPLICATIONS In this section, we examine two typical applications of ltering, namely, its use for the processing of an electrocardiogram (EKG), on the one hand, and the processing of stock exchange data, on the other. 1.9.1 Processing of EKG Signals The EKG of a healthy individual assumes a fairly well-dened form although signicant variations can occur from one person to the next as in ngerprints. Yet certain telltale patterns of an EKG enable a cardiologist to diagnose certain cardiac ailments or conditions. An EKG is essentially a graph representing a low-level electrical signal picked up by a pair of electrodes attached to certain well-dened points on the body and connected to an electrical instrument known as the electrocardiograph. These machines are used in clinics and hospitals where a multitude of other types of electrical machines are utilized such as x-ray machines and electrical motors. All these machines along with the power lines and transformers that supply them with electricity produce electrical 60-Hz noise, which may contaminate an EKG waveform. A typical noise-free EKG signal is shown in Fig. 1.13a . An EKG signal that has been contaminated by electrical 60-Hz noise is illustrated in Fig. 1.13b. As can be seen, the distinct features of the EKG are all but obliterated in the contaminated signal and are, therefore, difcult, if not impossible, to discern. A diagnosis based on such an EKG would be unreliable. As electrical noise originating from the power supply has a well-dened frequency, i.e., 60 Hz, one can design a bandstop lter that will reject the electrical noise. Such a lter has been designed using the methods to be studied in later chapters and was then applied to the contaminated EKG signal. The ltered signal is shown in Fig. 1.13c and, as can be seen, apart from some transient artifacts over the interval n = 0 to 100, the ltered signal is a faithful reproduction of the original noise-free signal. As another experiment, just to illustrate the nature of ltering, the contaminated 24 DIGITAL SIGNAL PROCESSING 10 10 5 x(n) x(n) 0 5 0 5 0 200 400 600 Sample index n (a) 800 1000 5 0 200 400 600 Sample index n (b) 800 1000 10 5 5 x(n) x(n) 0 5 0 200 400 600 Sample index n (c) 800 1000 0 5 0 200 400 600 Sample index n (d) 800 1000 Figure 1.13 Processing of EKG waveform: (a ) Typical EKG, (b) noisy EKG, (c) noisy EKG processed with a bandstop lter, (d ) noisy EKG waveform processed with a bandpass lter. EKG signal was passed through a bandpass lter which was designed to select the 60-Hz noise component. The output of the bandpass lter is illustrated in Fig. 1.13d . After an initial transience over the interval n = 0 to 150, a steady noise component is isolated by the bandpass lter. This is actually a sinusoidal waveform. It does not appear to be so because there are only six samples per cycle with the approximate values of 0, 1.7, 1.7, 0, 1.7, and 1.7. 1.9.2 Processing of Stock-Exchange Data We are all interested in the health of the market place for various reasons. We would all like, for example, to put aside some funds for another day and, naturally, we would prefer to invest any such funds in secure low-risk stocks, bonds, or mutual funds that provide high returns. To make nancial decisions such as these, we read the business section of our daily newspaper or browse the Web for numerical stock-exchange data. Naturally, we would like to make investments that grow steadily from year to year at a steady rate and never devalue. However, this is not what happens in real life. The prices of stocks change rapidly with time and once in a while, for example, when a market recession occurs, they can actually lose a large proportion of their values. Typically, there are many economic forces that cause the value of a stock to change. Some of these forces are of short duration while others reect long-term economic pressures. As long-term INTRODUCTION TO DIGITAL SIGNAL PROCESSING 25 investors, we should perhaps ignore the day-to-day variations and focus as far as possible on the underlying changes in the stock price. An investor with a sharp eye may be able to draw conclusions by simply comparing the available stock-exchange data of two competing stocks. For most of us this is not an easy task. However, through the use of DSP the task can be greatly simplied, as will be demonstrated next. The price of a companys stock is a signal and, as such, it possesses a spectrum that can be manipulated through ltering. Day-to-day variations in a stock constitute the high-frequency part of the spectrum whereas the underlying trend of the stock is actually the low-frequency part. If we are interested in the long-term behavior of a stock, then perhaps we should lter out the high-frequency part of the spectrum. On the other hand, if we cannot tolerate large day-to-day variations, then, perhaps we should attempt to check the volatility of the stock. Measures of volatility are readily available, for example, the variance of a stock. Another way to ascertain the volatility would be to remove the low-frequency and retain the high-frequency content of a stock through a highpass lter. To illustrate these ideas, two actual mutual funds, a bond fund and a high-tech fund, were chosen at random for processing. One years worth of data were chosen for processing and to facilitate the comparison, the scaled share prices of the two funds were normalized to unity at the start of the year. The normalized share prices of the two funds are plotted in Fig. 1.14a . As can be seen, the bond fund has remained rather stable throughout the year, as may be expected, whereas the high-tech one was subjected to large variations. The day-to-day variations, i.e., the high-frequency content, in the two mutual funds can be eliminated through the use of a lowpass lter to obtain the smooth curves shown in Fig. 1.14b. On the other hand, the underlying trend of the mutual fund or the low-frequency spectrum can be removed through the use of a highpass lter to obtain the high-frequency content shown in Fig. 1.14c. In this gure, the lter output is depicted as a percentage of the unit value. In the plots obtained, certain anomalies are observed during the rst 50 or so sample values. These are due to certain initial transient conditions that exist in all types of systems including lters, which will be explained in Chap. 4, but they can be avoided in practice by using a suitable initialization. Ignoring this initial phase, we note that the lowpass-ltered version of the data shown in Fig. 1.14b provides a less cluttered view of the funds whereas Fig. 1.14c gives a much clearer picture of their relative volatilities. In this respect, note the 5 to 1 difference in the scale of the y axis between the two funds. Quantitative measures of volatility analogous to the variance of a stock can also be deduced from plots like those in Fig. 1.14c. One could, for example, obtain the mean-square average (MSA) of y (n ) which is dened as 1 N N MSA = [ y (n )]2 n =1 or the average of | y (n )| or some other norm. The value of the MSA for the bond and high-tech funds for values of 50 n 250 can be readily computed as 0.0214 and 1.2367, respectively, i.e., a ratio of 1 to 57.7 in favor of the bond fund. Evidently, the message is very clear as to what type of fund one should buy to avoid sleepless nights. Another intriguing possibility that deserves a mention is the use of extrapolating lters. Filters of this type can be used to predict tomorrows stock prices but if we pursue the subject any further, we will nd ourselves in the domain of what is known in the business world as technical analysis. 26 DIGITAL SIGNAL PROCESSING 1.4 1.2 Normalized unit value 1.0 0.8 0.6 0.4 0.2 0 0 50 100 Day (a) 1.4 1.2 1.0 0.8 0.6 0.4 0.2 0 0 50 100 Day (b) 150 150 Bond High tech 200 250 Bond High tech y(n) 200 250 Figure 1.14 Processing of stock-exchange data: (a ) Unit values of bond and high technology mutual funds, (b) data processed with a lowpass lter. REFERENCES R. Schaumann and M. E. Van Valkenburg, Design of Analog Filters, New York: Oxford University Press, 2001. [2] K. L. Su, Analog Filters, London: Chapman & Hall, 1996. [3] C. Rauscher, Two-branch microwave channelized active bandpass lters, IEEE Trans. Microwave Theory Tech., vol. MTT-48, pp. 437444, Mar. 2000. [1] INTRODUCTION TO DIGITAL SIGNAL PROCESSING 27 Bond fund 1.0 0.5 y(n), % 0 0.5 1.0 0 50 100 Hi-tech fund 5 150 200 250 y(n), % 0 5 0 50 100 Day (c) 150 200 250 Figure 1.14 Contd (c) Processing of stock-exchange data: Data processed with a highpass lter. [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] C.-H. Lee, S. Han, and J. Laskar, GaAs MESFET dual-gate mixer with active lter design for Ku-band applications, IEEE Radio Frequency Integrated Circuits Symposium, pp. 203206, 1999. I. C. Hunter, Theory and Design of Microwave Filters, London: The Institution of Electrical Engineers, 2001. B. P. Lathi, Modern Digital and Analog Communication Systems, New York: Holt, Reinhart and Winston, 1983. R. Butler and E. Kerr, An Introduction to Numerical Methods, London: Pitman, 1962. C.-E. Fr berg, Introduction to Numerical Analysis, 2nd ed., Reading, MA: Addison-Wesley, o 1969. D. D. Swade, Redeeming Charles Babbages mechanical computer, Scientic American, vol. 268, pp. 8691, Feb. 1993. R. B. Blackman, H. W. Bode, and C. E. Shannon, Data smoothing and prediction in re-control systems, Summary Technical Report of Division 7, NDRC, vol. 1, pp. 71160. Reprinted as Report Series, MGC 12/1 (August 15, 1948), National Military Establishment, Research and Development Board. R. B. Blackman and J. W. Tukey, The Measurement of Power Spectra from the Point of View of Communications Engineering, New York: Dover, 1959. M. A. Martin, Digital Filters for Data Processing, General Electric Co., Missile and Space Division, Tech. Inf. Series Report No. 62-SD484, 1962. K. Steiglitz, The General Theory of Digital Filters with Applications to Spectral Analysis, AFOSR Report no. 641664, New York University, New York, May 1963. E. B. Anders et al., Digital Filters, NASA Contractor Report CR-136, Dec. 1964. 28 DIGITAL SIGNAL PROCESSING [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] H. H. Robertson, Approximate design of digital lters, Technometrics, vol. 7, pp. 387403, Aug. 1965. J. F. Kaiser, Some practical considerations in the realization of digital lters, Proc. Third Allerton Conf. on Circuits and Systems, pp. 621633, Oct. 1965. K. Steiglitz, The equivalence of digital and analog signal processing, Information and Control, vol. 8, pp. 455467, Oct. 1965. R. B. Blackman, Data Smoothing and Prediction, Reading, MA: Addison-Wesley, 1965. F. F. Kuo and J. F. Kaiser, System Analysis by Digital Computer, New York: Wiley, 1966. B. Gold and C. M. Rader, Digital Signal Processing, New York: McGraw-Hill, 1969. R. E. Bogner and A. G. Constantinides (eds.), Introduction to Digital Filtering, New York: Wiley, 1975. A. Antoniou, Digital Filters: Analysis and Design, New York: McGraw-Hill, 1979. L. B. Jackson, J. F. Kaiser, and H. S. McDonald, An approach to the implementation of digital lters, IEEE Trans. Audio and Electroacoust., vol. 16, pp. 413421, Sept. 1968. A. Peled and B. Liu, A new hardware realization of digital lters, IEEE Trans. Acoust. Speech, Signal Process., vol. 22, pp. 456462, Dec. 1974. CHAPTER 2 THE FOURIER SERIES AND FOURIER TRANSFORM 2.1 INTRODUCTION Spectral analysis has been introduced in a heuristic way in Chap. 1. In the present chapter, the spectral analysis of continuous-time signals is developed further. The basic mathematical tools required for the job, namely, the Fourier series and the Fourier transform, are described in some detail. The Fourier series, which provides spectral representations for periodic continuous-time signals, is treated rst. Then the Fourier transform is derived by applying a limiting process to the Fourier series. The properties of the Fourier series and the Fourier transform are delineated through a number of theorems. The chapter also deals with the application of the Fourier series and Fourier transform to a variety of standard continuous-time signals. The reader may question the extent of the treatment of the spectral representation of continuoustime signals in a book that claims to deal with DSP. However, as was emphasized in Chap. 1, most of the signals occurring in nature are essentially continuous in time, and it is, therefore, reasonable to expect the spectrums of discrete-time signals to be closely related to those of the continuous-time signals from which they are derived. This indeed is the case, as will be shown in Chaps. 3, 6, and 7. 2.2 FOURIER SERIES In Chap. 1, the concept of frequency spectrum of a signal was introduced as an alternative to timedomain representation. As was demonstrated, a periodic signal that comprises a weighted sum of 29 Copyright 2006 by The McGraw-Hill Companies, Inc. Click here for terms of use. 30 DIGITAL SIGNAL PROCESSING sinusoids such as that in Eq. (1.1) can be represented completely in the frequency domain in terms of the amplitudes and phase angles of its individual sinusoidal components. Below, we demonstrate that through the use of the Fourier1 series, the concept of frequency spectrum can be applied to arbitrary periodic signals. In the next and subsequent sections, periodic signals are typically represented in terms of nonperiodic signals. To avoid possible confusion between the two types of signals we will use the notation x (t ) for a periodic signal and simply x (t ) for a nonperiodic one. Signals will be assumed to be real unless otherwise stated. 2.2.1 Denition A periodic continuous-time signal, namely, a signal that satises the condition x (t + r 0 ) = x (t ) for |r | = 1, 2, . . . , where 0 is a constant called the period of the signal, can be expressed as x (t ) = r = x (t + r 0 ) (2.1) where x (t ) is a nonperiodic signal given by x (t ) = x (t ) 0 for 0 /2 < t 0 /2 otherwise (2.2) The time interval 0 /2 < t 0 /2 will be referred to as the base period hereafter. What the above formulas are saying is this: If a nonperiodic signal x (t ) is available that fully describes the periodic signal x (t ) with respect to the base period, then the periodic signal x (t ) can be generated by creating time-shifted copies of x (t ), that is, x (t + r 0 ) for r = 1, 2, . . . , and r = 1, 2, . . . , , and then adding them up. This replication process occurs frequently in DSP and it will be referred to as periodic continuation, that is, x (t ) is the periodic continuation of x (t ) in the present context. A periodic signal x (t ) that satises certain mathematical requirements as detailed in Theorem 2.1 (see Sec. 2.2.3) can be represented by the Fourier series (see Chap. 7 of Ref. [1] or Chap. 5 of Ref. [2]). The most general form of this important representation is given by x (t ) = k = X k e jk 0 t for 0 /2 t 0 /2 (2.3) Baptiste Joseph Fourier (17681830) was a French mathematician who was taught by Lagrange and Laplace. He got himself involved with the French Revolution and in due course joined Napoleons army in the invasion of Egypt as a scientic advisor. The series named after him emerged while Fourier was studying the propagation of heat in solid bodies after his return from Egypt. 1 Jean THE FOURIER SERIES AND FOURIER TRANSFORM 31 where 0 = 2/0 . The coefcients2 { X k } can be deduced by multiplying both sides of Eq. (2.3) by e jl 0 t and then integrating over the base period 0 /2 < t 0 /2. Thus 0 /2 0 /2 x (t )e jl 0 t dt = = 0 / 2 0 /2 k = X k e jk 0 t e jl 0 t dt e j (k l )0 t dt 0 /2 Xk k = 0 /2 The change in the order of integration and summation between the rst and second equations is allowed for signals that satisfy the conditions in Theorem 2.1. Now 0 /2 0 /2 e j (k l )0 t dt = 0 0 if l = k if l = k (2.4) (see Prob. 2.1) and as x (t ) = x (t ) over the base period 0 /2 < t 0 /2 according to Eq. (2.2), we have 1 0 /2 x (t )e jk 0 t dt (2.5) Xk = 0 0 /2 As e jk 0 t is a complex quantity, coefcients { X k } are complex in general but can be purely real or purely imaginary.3 X k can be represented in terms of its real and imaginary parts or its magnitude and angle as X k = Re X k + j Im X k = | X k |e j arg X k where |Xk| = (Re X k )2 + (Im X k )2 and arg X k = tan1 Im X k Re X k 2.2.2 Particular Forms The Fourier series can also be expressed in terms of a sum of sines and cosines, or just sines or just cosines, as will now be demonstrated. Equation (2.3) can be expanded into a sum of two series plus a constant as 1 x (t ) = k = 4 1 X k e jk 0 t + X 0 + k =1 X k e jk 0 t and by letting k k in the rst summation and then noting that X k e k = jk 0 t k =1 X k e jk 0 t 2 The notation { X } is used to represent the set of coefcients X for k , which can also be represented k k more precisely by the notation { X k : k }. 3 See Appendix A for the basic principles of complex analysis. 4 The notation k k here and in the subsequent chapters represents two variable transformations carried out in sequence one after the other, that is, k = k and k = k. 32 DIGITAL SIGNAL PROCESSING we get x (t ) = k =1 X k e jk 0 t + X 0 + k =1 X k e jk 0 t = X0 + k =1 X k (cos k 0 t j sin k 0 t ) X k (cos k 0 t + j sin k 0 t ) + k =1 = X0 + k =1 ( X k + X k ) cos k 0 t + k =1 j ( X k X k ) sin k 0 t (2.6) Now from Eq. (2.5), we have X0 = Xk = = = X k = = = 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 /2 x (t ) dt 0 /2 0 /2 0 /2 0 /2 0 /2 0 /2 0 /2 0 /2 0 /2 0 /2 0 /2 0 /2 0 /2 (2.7a) x (t )e jk 0 t dt x (t )(cos k 0 t j sin k 0 t ) dt x (t ) cos k 0 t dt j x (t )e jk 0 t dt x (t )(cos k 0 t + j sin k 0 t ) dt x (t ) cos k 0 t dt + j 1 0 0 /2 0 /2 1 0 0 /2 0 /2 x (t ) sin k 0 t dt (2.7b) x (t ) sin k 0 t dt (2.7c) and hence Eqs. (2.7b) and (2.7c) give 2 0 2 0 0 /2 0 /2 0 /2 0 /2 X k + X k = j ( X k X k ) = x (t ) cos k 0 t dt x (t ) sin k 0 t dt (2.8a) (2.8b) (2.8c) X k = X k THE FOURIER SERIES AND FOURIER TRANSFORM 33 where X k is the complex conjugate of X k . On using Eqs. (2.7a), (2.8a), and (2.8b), Eq. (2.6) can also be expressed as x (t ) = 1 a0 + 2 k =1 (ak cos k 0 t + bk sin k 0 t ) 0 /2 (2.9) where a0 = 2 X 0 = 2 0 x (t ) dt 0 /2 (2.10a) (2.10b) (2.10c) a k = X k + X k = 2 0 0 /2 0 /2 x (t ) cos k 0 t dt x (t ) sin k 0 t dt bk = j ( X k X k ) = 2 0 0 /2 0 /2 The 1/2 in the constant term of Eq. (2.9) is used to make the formula for a0 in Eq. (2.10a) a special case of the formula for ak in Eq. (2.10b). These equations are often referred to as the Euler or Euler-Fourier formulas. Equation (2.9) gives the Fourier series in terms of sines and cosines. As sines can be converted to cosines and vice versa, a representation of the Fourier series in terms of just sines or just cosines can be readily obtained. If we let ak = Ak cos k and bk = Ak sin k (2.11) (2.12a) (2.12b) (2.12c) (2.12d) then parameters { Ak } and {k } can be expressed in terms of {ak } and {bk } or { X k } as A0 = |a0 | = 2| X 0 | 0 = Ak = 0 if a0 or X 0 0 if a0 or X 0 < 0 2 2 a k + bk = 2 | X k | k = tan1 bk ak = arg X k (see Prob. 2.2). Now on eliminating coefcients a0 , ak , and bk in Eq. (2.9) using Eq. (2.11), the Fourier series can be put in the form x (t ) = 1 A0 cos 0 + 2 k =1 Ak (cos k cos k 0 t sin k sin k 0 t ) Ak (cos k 0 t cos k sin k 0 t sin k ) k =1 = 1 A0 cos 0 + 2 = 1 A0 cos 0 + 2 k =1 Ak cos(k 0 t + k ) (2.13a) = 1 A0 sin(0 + 1 ) + 2 2 k =1 Ak sin k 0 t + k + 1 2 (2.13b) 34 DIGITAL SIGNAL PROCESSING In summary, the Fourier series can be used to express a periodic signal in terms of an innite linear combination of exponentials as in Eq. (2.3), in terms of sines and cosines as in Eq. (2.9), just cosines as in Eq. (2.13a), or just sines as in Eq. (2.13b). Engineers often refer to the sinusoidal component of frequency 0 as the fundamental and to those of frequencies k 0 for k = 2, 3, . . . , as the harmonics. The terms 1 a0 in Eq. (2.9), 1 A0 cos 0 in Eq. (2.13a), and 1 A0 sin(0 + /2) 2 2 2 in Eq. (2.13b) are alternative ways of representing the zero frequency component and can assume positive or negative values. The set of coefcients { X k : k } in Eq. (2.5), the sets of coefcients {ak } and {bk } in Eq. (2.9), and the corresponding amplitudes and phase angles of the sinusoids in Eq. (2.13b), that is, { Ak : 0 k } and {k : 0 k }, respectively, constitute alternative but complete descriptions of the frequency spectrum of a periodic signal. The coefcients { X k } are closely related to the Fourier transform of the nonperiodic signal x (t ), as will be demonstrated in Sec. 2.3.1, and, for this reason, they will receive preferential treatment in this book, although the alternative representations in terms of {ak } and {bk } or { Ak } and {k } will also be used once in a while. The magnitude and phase angle of X k , that is, | X k | and arg X k , viewed as functions of the discrete frequency variable k 0 for < k 0 < , will henceforth be referred to as the amplitude spectrum and phase spectrum, respectively. The periodic signal x (t ) in the above analysis can be symmetrical or antisymmetrical with respect to the vertical axis. If it is symmetrical, signal x (t ) in Eq. (2.2) is an even function of time since x (t ) = x (t ) We know that cos t is an even and sin t is an odd function of time, that is, cos(t ) = cos t and sin(t ) = (sin t ) and hence x (t ) cos k 0 t is even and x (t ) sin k 0 t is odd. Consequently, Eqs. (2.7a)(2.7c) give X0 = Xk = = X k = = 1 0 1 0 2 0 1 0 2 0 0 /2 0 /2 0 /2 0 /2 0 /2 0 0 /2 0 /2 0 /2 0 x (t ) dt = 2 0 0 /2 x (t ) dt 0 (2.14a) x (t ) sin k 0 t dt (2.14b) x (t ) cos k 0 t dt j x (t ) cos k 0 t dt x (t ) cos k 0 t dt + j x (t ) cos k 0 t dt 1 0 0 /2 0 /2 for k = 1, 2, . . . 1 0 0 /2 0 /2 x (t ) sin k 0 t dt (2.14c) for k = 1, 2, . . . that is, X k = X k for k = 1, 2, . . . THE FOURIER SERIES AND FOURIER TRANSFORM 35 and from Eqs. (2.10a)(2.10c), we get a0 = 2 X 0 = 4 0 0 /2 x (t ) dt 0 (2.15a) for k = 1, 2, . . . (2.15b) (2.15c) a k = X k + X k = 4 0 /2 x (t ) cos k 0 t dt 0 0 bk = j ( X k X k ) = 0 for k = 1, 2, . . . On the other hand, if x (t ) is antisymmetrical about the vertical axis, then x (t ) is an odd function and thus x (t ) cos k 0 t is an odd function and x (t ) sin k 0 t is an even function. In this case, Eqs. (2.7a) (2.7c) give X0 = Xk = 1 0 1 0 0 /2 0 /2 0 /2 0 /2 x (t ) dt = 0 x (t ) cos k 0 t dt j x (t ) sin k 0 t dt 1 0 1 0 0 /2 0 /2 (2.16a) x (t ) sin k 0 t dt (2.16b) = j X k = 1 0 2 0 0 /2 0 0 /2 for k = 1, 2, . . . 0 /2 0 /2 0 /2 x (t ) cos k 0 t dt + j x (t ) sin k 0 t dt x (t ) sin k 0 t dt (2.16c) =j that is, 2 0 0 /2 0 for k = 1, 2, . . . X k = X k for k = 1, 2, . . . and from Eqs. (2.10a)(2.10c), we get a0 = 2 X 0 = 0 a k = X k + X k = 0 4 0 0 /2 0 (2.17a) for k = 1, 2, . . . (2.17b) (2.17c) for k = 1, 2, . . . (2.17d) bk = j ( X k X k ) = 2 j X k = x (t ) sin k 0 t dt In effect, if x (t ) is antisymmetrical, then the DC component, which is the average value of the waveform, is zero. 2.2.3 Theorems and Properties Fourier series have certain theoretical properties that are often of considerable practical interest. A few of the most important ones are described below in terms of a number of theorems. To start with, we are quite interested in the circumstances under which the substitution of the coefcients given by Eq. (2.5) in the Fourier series of Eq. (2.3) would yield the periodic signal x (t ). 36 DIGITAL SIGNAL PROCESSING x(t) x(td +) x(td) x(td ) td td td + t Figure 2.1 A signal x (t ) with a discontinuity. Theorem 2.1 Convergence If x (t ) is a periodic signal of the form x (t ) = r = x (t + r 0 ) where x (t ) is dened by Eq. (2.2), and over the base period 0 /2 < t 0 /2 x (t ) has a nite number of local maxima and minima has a nite number of points of discontinuity is bounded, that is, |x (t )| K < for some positive K , then the substitution of coefcients { Xk } given by Eq. (2.5) in the Fourier series of Eq. (2.3) converges to x (t ) at all points where x (t ) is continuous. At points where x (t ) is discontinuous, the Fourier series converges to the average of the left- and right-hand limits of x (t ), namely, x (td ) = 1 [x (td ) + x (td +)] 2 as illustrated in Fig. 2.1 where the left- and right-hand limits of x (t ) at t = td are dened as x (td ) = lim x (td | |) 0 and x (td +) = lim x (td + | |) 0 Proof (See pp. 225232 of Ref. [3] for proof.) The prerequisite conditions for convergence as stated in Theorem 2.1 are known as the Dirichlet5 conditions (see Ref. [4]). 5 Johann Peter Gustave Lejeune Dirichlet (18051859) was born in D ren, a town between Aachen and Cologne. In u addition to his work on the Fourier series, he contributed a great deal to differential equations and number theory. He married one of the two sisters of the composer Felix Mendelssohn. THE FOURIER SERIES AND FOURIER TRANSFORM 37 In the above analysis, we have tacitly assumed that the periodic signal x (t ) is real. Nevertheless, the Fourier series is applicable to complex signals just as well. Furthermore, the variable need not be time. In fact, the Fourier series is often used to design certain types of digital lters, as will be demonstrated in Chap. 9, and in that application a function is used, which is periodic with respect to frequency, that is, the roles of time and frequency are interchanged. In the following theorem, signal x (t ) is deemed to be complex but the theorem is, of course, valid for real signals as well. The theorem provides a relation between the power associated with a periodic signal and the Fourier-series coefcients of the signal. Theorem 2.2 Parsevals Formula for Periodic Signals The mean of the product x (t )x (t ), where x (t ) is the complex conjugate of x (t ), can be expressed in terms of the Fourier-series coefcients { Xk } as x (t )x (t ) = = k= 1 0 0 /2 0 /2 x (t )x (t ) dt = 1 0 0 /2 0 /2 |x (t )|2 dt (2.18) Xk Xk = | X k |2 k= See footnote on Parseval6 . Proof The mean of the product x (t )x (t ) is dened as x (t )x (t ) = Hence, Eqs. (2.3) and (2.19) give x (t )x (t ) 1 = 0 = = 1 0 1 0 0 /2 0 /2 0 /2 0 /2 0 /2 0 /2 1 0 0 /2 0 /2 x (t )x (t ) dt (2.19) Xke k = k = jk 0 t Xl e l = l = jl 0 t dt X k e jk 0 t X l e jl 0 t dt Xk k = l = X l e j (k l )0 t dt For signals that satisfy Theorem 2.1, the order of summation and integration can be interchanged and thus x (t )x (t ) = k = Xk l = X l 1 0 0 /2 0 /2 e j (k l )0 t dt 6 Marc-Antoine Parseval de Chenes (17551836) was a French mathematician of noble birth who lived in Paris during the French Revolution. He published some poetry against Napoleons regime, which nearly got him arrested. 38 DIGITAL SIGNAL PROCESSING Now the value of the integral is equal to 0 if l = k and zero otherwise, according to Eq. (2.4). Therefore, x (t )x (t ) = k = X k X k = | X k |2 For a real x (t ), we have x (t ) = x (t ) and hence Parsevals formula in Eq. (2.18) assumes the simplied form x 2 (t ) = 1 0 0 /2 0 /2 x 2 (t ) dt = k = Xk Xk = k = | X k |2 (2.20) where x 2 (t ) is the mean square value of the periodic signal x (t ). If x (t ) represents a voltage across or a current through a resistor then the mean square of x (t ) is proportional to the average power delivered to the resistor. In effect, Parsevals theorem provides a formula that can be used to calculate the average power by using the Fourier-series coefcients. Theorem 2.3 Least-Squares Approximation A truncated Fourier series for a real periodic signal x (t ) of the form N x (t ) = k = N Xk e jk0 t (2.21) is a least-squares approximation of x (t ) independently of the value of N. Proof Let N y (t ) = k = N Yk e jk 0 t (2.22) be an approximation for x (t ) and assume that e(t ) is the error incurred. From (2.3) and (2.22), we can write e(t ) = x (t ) y (t ) N = k = X k e jk 0 t k = N Yk e jk 0 t = k = E k e jk 0 t (2.23) where Ek = X k Yk Xk for N k N for |k | > N On comparing Eq. (2.23) with Eq. (2.3), we conclude that Eq. (2.23) is the Fourier series of the approximation error, e(t ), and by virtue of Parsevals theorem (that is, Eq. (2.20)), the THE FOURIER SERIES AND FOURIER TRANSFORM 39 mean-square error is given by e2 (t ) = k = N | E k |2 | X k Yk |2 + k = N |k |> N = | X k |2 (2.24) The individual terms at the right-hand side of Eq. (2.24) are all positive and, therefore, e2 (t ) is minimized if and only if Yk = X k that is, N N for N k N y (t ) = k = N Yk e jk 0 t = k = N X k e jk 0 t = x (t ) That is, the approximation y (t ) of x (t ) that minimizes the mean-square error incurred is the truncated Fourier series of Eq. (2.21). Such an approximation is said to be a least-squares approximation. Theorem 2.4 Uniqueness If two periodic signals x1 (t ) and x2 (t ) are continuous over the base period and have the same Fourier-series coefcients, that is, { Xk1 } = { Xk2 }, then they must be identical, that is, x1 (t ) = x2 (t ). Proof (See p. 487 in Ref. [1] for proof.) The theorem also applies if the signals have a nite number of discontinuities over the base period provided that the values of x1 (t ) or x2 (t ) at each discontinuity are dened as the average of the left- and right-hand limits as in Theorem 2.1. A consequence of the uniqueness property is that an arbitrary linear combination of sines, or cosines, or both, such as Eq. (1.1), for example, is a unique Fourier series of a corresponding unique periodic signal. The application of the Fourier series will now be illustrated by analyzing some typical periodic waveforms. Example 2.1 The periodic pulse signal x (t ) shown in Fig. 2.2a can be represented by Eq. (2.1) with x (t ) given by7 0 for 0 /2 < t < /2 x (t ) p (t ) = 1 for /2 t /2 0 for /2 < t 0 /2 7 The values of the pulse function at the points of discontinuity t = /2 and /2 should, in theory, be dened to be to make the function consistent with Theorem 2.1. However, this more precise but more complicated denition would not change the Fourier series of the function since the integral in Eq. (2.5) would assume an innitesimal value when evaluated over an innitesimal range of t, . 1 2 40 DIGITAL SIGNAL PROCESSING ~ x(t) 0 2 2 (a) 2 0 2 t ~ x (t) |sin (0t/2)| 0 2 0 0 2 (b) t Figure 2.2 Periodic signals: (a ) Pulse signal, (b) rectied sinusoid. with 0 = 2/0 . (a ) Obtain the Fourier series of x (t ) in terms of Eq. (2.3). (b) Obtain and plot the amplitude and phase spectrums. Solution As x (t ) is symmetrical with respect to the vertical axis, it is an even function of t and Eqs. (2.14a) and (2.14b) apply. We note that Eq. (2.14a) can be obtained from Eq. (2.14b) by letting k = 0 and hence, for any k , we have Xk = = = Thus 0 sin k 0 /2 0 k 0 /2 for k = 0 otherwise 2 0 0 /2 0 /2 0 x (t ) cos k 0 t dt = 2 0 /2 0 cos k 0 t dt 2 sin k 0 t 0 k 0 sin k 0 /2 0 k 0 /2 (2.25) |Xk| = THE FOURIER SERIES AND FOURIER TRANSFORM 41 Amplitude spectrum 0.6 0 0.5 1.0 0.4 Phase angle, rad Magnitude 1.5 2.0 2.5 0.1 3.0 3.5 50 Phase spectrum 0.5 0.3 0.2 0 50 0 Frequency, rad/s (a) 50 0 Frequency, rad/s (b) 50 Figure 2.3 Frequency spectrum of periodic pulse signal (Example 2.1): (a ) Amplitude spectrum, (b) phase spectrum. and arg X k = 0 if X k 0 if X k < 0 The amplitude and phase spectrums of the signal for 0 = 1 s and = 0 /2 are plotted in Fig. 2.3a and b. The periodic pulse signal analyzed in the above example is of interest in a number of applications, for example, in A/D and D/A converters (see Chap. 6). Example 2.2 The periodic waveform depicted in Fig. 2.2b can be represented by Eq. (2.1) with x (t ) given by x (t ) = sin 1 0 t 2 for 1 0 < t 1 0 2 2 42 DIGITAL SIGNAL PROCESSING and 0 = 2/0 . (a ) Obtain its Fourier-series representation in terms of Eq. (2.3). (b) Obtain and plot the amplitude and phase spectrums of x (t ). (c) Express the Fourier series obtained in part (a ) as a linear combination of sines. Solution (a ) As x (t ) is an even function of t , Eqs. (2.14a) and (2.14b) give Xk = = 2 0 2 0 0 /2 0 0 /2 0 x (t ) cos k 0 t dt = 2 0 0 /2 0 sin 1 0 t cos k 0 t dt 2 cos k 0 t sin 1 0 t dt 2 From trigonometry cos sin = 1 [sin( + ) sin( )] 2 and hence we obtain Xk = 1 0 0 /2 0 sin k + 1 2 1 2 0 t sin k cos k k 1 2 1 2 0 t d t 0 t 0 /2 1 = 0 cos k + k+ 1 2 0 t 0 1 2 0 0 On evaluating the limits, straightforward manipulation gives Xk = 2 1 4k 2 Thus for any value of k including zero, we have |Xk| = and arg X k = 0 if k = 0 otherwise 2 1 4k 2 THE FOURIER SERIES AND FOURIER TRANSFORM 43 Amplitude spectrum 0.7 0 0.5 1.0 Phase angle, rad 1.5 2.0 2.5 3.0 3.5 10 Phase spectrum 0.6 0.5 Magnitude 0.4 0.3 0.2 0.1 0 10 0 5 5 Frequency, rad/s (a) 10 5 0 5 Frequency, rad/s (b) 10 Figure 2.4 Frequency spectrum of rectied waveform (Example 2.2): (a ) Amplitude spectrum, (b) phase spectrum. (b) From Eqs. (2.12a)(2.12d), we have Ak = 2| X k | = 4 1 4k 2 0 for k 0 k = arg X k = if k = 0 for k > 0 The amplitude and phase spectrums of the waveform are illustrated in Fig. 2.4 for the case where 0 = 1 rad/s. (c) Now Eq. (2.13b) yields x (t ) = = 2 + 2 k =1 4 3 4 1 4k 2 sin k 0 t + 1 2 4 15 4 63 + sin 0 t 1 + 2 sin 20 t 1 2 sin 40 t 1 + 2 4 + 35 sin 30 t 1 + 2 44 DIGITAL SIGNAL PROCESSING The waveform analyzed in Example 2.2 is essentially a sinusoidal waveform with its negative half cycles reversed and is the type of waveform generated by a so-called full-wave rectier circuit. Circuits of this type are found in AC-to-DC adaptors such as those used to power laptop or handheld computers and modems. The Fourier series obtained shows that an AC supply voltage of amplitude 1 V8 would produce a DC output voltage of 2/ V. Hence, an AC voltage of amplitude 170 V would produce a DC voltage of 108.23 V. We note also that there would be an innite number of residual AC components with frequencies 0 , 20 , 30 , 40 , . . . , namely, the fundamental and harmonics, with amplitudes, of 72.15, 14.43, 6.18, 3.44 V, . . . , respectively. In good-quality AC-to-DC adaptors, the amplitudes of the harmonics are reduced to insignicant levels through the use of analog lter circuits. Example 2.3 (a ) Obtain the Fourier series of the periodic signal shown in Fig. 2.5a in terms of Eq. (2.3). (b) Obtain and plot the amplitude and phase spectrums of x (t ). Solution (a ) The signal in Fig. 2.5a can be modeled by using shifted copies of p/2 (t ) for the representation of signal x (t ) in Eq. (2.2), where p (t ) is the pulse signal of Example 2.1, that is, we can write x (t ) = p/2 t + 1 p/2 t 1 4 4 As x (t ) is antisymmetrical with respect to the vertical axis, it is an odd function of time. Hence, from Eq. (2.16a), we get X0 = 0 Now from Eq. (2.16b), we have 2 0 /2 Xk = j x (t ) sin k 0 t dt 0 0 = j = j =j =j 2 0 2 0 0 /2 0 /2 0 /2 0 p/2 t 1 sin k 0 t dt 4 sin k 0 t dt =j 2 1 cos k 0 /2 0 k 0 2 cos k 0 t 0 k 0 4 sin2 k 0 /4 k 0 0 for k = 1, 2, . . . 8 The symbol V stands for volts. THE FOURIER SERIES AND FOURIER TRANSFORM 45 Time domain 1.5 1.0 0.5 x(t) 0 0.5 1.0 1.5 2 2 2 1 Amplitude spectrum 0 Time, s (a) 2 1 2 Phase spectrum 0.4 0.3 Phase angle, rad 0 Frequency, rad/s (b) 50 Magnitude 1 0.2 0 0.1 1 0 50 2 50 0 Frequency, rad/s (c) 50 Figure 2.5 Frequency spectrum (Example 2.3): (a ) Time-domain representation, (b) amplitude spectrum, (c) phase spectrum. that is, 0 for k = 0 for k = 1, 2, . . . Xk = 4 sin2 k 0 /4 j k 0 0 46 DIGITAL SIGNAL PROCESSING (b) The amplitude and phase spectrums are obtained as | X 0| = 0 |Xk| = and arg X 0 = 0 for k = 1, 2, . . . 2 k sin2 k 20 1 2 arg X k = 0 1 2 if k > 0 if k = 0 if k < 0 for k = 1, 2, . . . (See Fig. 2.5b and c for plots.) Example 2.4 Deduce the Fourier series of the following periodic signal x (t ) = sin4 0 t in terms of cosines. Solution We can write x (t ) = (sin2 0 t )2 = = = = = 1 4 1 4 1 (1 2 cos 20 t ) 2 1 2 cos 20 t + cos2 20 t 1 2 cos 20 t + 1 2 1 + cos 40 t 13 42 3 8 2 cos 20 t + 1 cos 40 t 2 1 cos 20 t + 1 cos 40 t 2 8 The above is a Fourier series and by virtue of Theorem 2.4, it is the unique Fourier series for the given signal. 2.3 FOURIER TRANSFORM The Fourier series described in the previous section can deal quite well with periodic signals but, unfortunately, it is not applicable to nonperiodic signals. Periodic signals occur in a number of applications but more often than not signals tend to be nonperiodic, e.g., communications, seismic, THE FOURIER SERIES AND FOURIER TRANSFORM 47 or music signals, and for signals of this type some mathematical technique other than the Fourier series must be used to obtain useful spectral representations. A mathematical technique that can deal quite effectively with nonperiodic signals is the Fourier transform [5]. This can be dened as an independent transformation. Alternatively, it can be deduced from the Fourier series by treating a nonperiodic signal as if it were periodic and then letting the period approach innity [2]. The latter approach provides a fairly accurate physical interpretation of a somewhat abstract mathematical technique and will, therefore, be pursued. 2.3.1 Derivation Let us consider the nonperiodic pulse signal of Fig. 2.6a , which comprises just a single pulse. This signal can, in theory, be deemed to be the special case of the periodic pulse signal x (t ) shown in Fig. 2.2a when the period 0 is increased to innity, that is, x (t ) = lim x (t ) = p (t ) 0 The Fourier series of the periodic pulse signals was obtained in Example 2.1 and its Fourier-series coefcients { X k } are given by Eq. (2.25). If we replace k 0 by the continuous variable , Eq. (2.25) assumes the form Xk = sin /2 sin k 0 /2 = 0 k 0 /2 0 /2 Let us examine the behavior of the Fourier series as the period 0 of the waveform is doubled to 20 , then doubled again to 40 , and so on, assuming that the duration of each pulse remains xed. Using a simple MATLAB program with 0 = 1 and = 1 s, the plots in Fig. 2.6b can be readily 2 obtained. Two things can be observed in this illustration, namely, the magnitudes of the Fourierseries coefcients { X k } are progressively halved because X k is proportional to /0 , whereas the number of frequency components is progressively doubled because the spacing between adjacent harmonics is halved from 0 to 1 0 , then to 1 0 , and so on. Evidently, if we were to continue 2 4 doubling the period ad innitum, the coefcients { X k } would become innitesimally small whereas the number of harmonics would become innitely large and the spacing between adjacent harmonics would approach zero. In effect, applying the Fourier series to the periodic pulse signal of Fig. 2.2a and letting 0 would transform the signal in Fig. 2.2a to the nonperiodic pulse signal of Fig. 2.6a but as X k 0, the approach does not yield a meaningful spectral representation for the nonperiodic pulse signal of Fig. 2.6a. The same problem would arise if one were to apply the Fourier series to any nonperiodic signal and, therefore, an alternative spectral representation must be sought for nonperiodic signals. The previous analysis has shown that as 0 , we get 0 0 and X k 0. However, the quantity X ( j ) = lim X ( jk 0 ) 0 0 lim Xk f0 (2.26) 48 DIGITAL SIGNAL PROCESSING 1.5 1.0 p(t) 0.5 0 2 1 2 0 Time, s 2 1 2 (a) 0.6 0.5 0.4 0.3 sin /2 0 /2 0=1 s 0=2 s 0=4 s 0.2 0.1 0 0.1 0.2 40 30 20 10 0 10 Frequency, rad/s 20 30 40 (b) Figure 2.6 (a ) Pulse function. (b) Fourier-series representation of the pulse signal shown in Fig. 2.2a for pulse periods of 0 , 20 , and 40 . where = k 0 and f 0 = 1/0 = 0 /2 is the frequency between adjacent harmonics in Hz, assumes a nite value for a large class of signals and, furthermore, it constitutes a physically meaningful spectral representation for nonperiodic signals. As will be shown in Theorem 2.16, | X ( j )|2 is proportional to the energy density of signal x (t ) per unit bandwidth in Hz at frequency f = /(2 ) in Hz. THE FOURIER SERIES AND FOURIER TRANSFORM 49 From Eqs. (2.26) and (2.5), we can write X ( jk 0 ) = = and therefore, X ( j ) = lim X ( jk 0 ) 0 Xk = 0 X k f0 0 / 2 0 /2 x (t )e jk 0 t dt or X ( j ) = x (t )e j t dt (2.27) The quantity X ( j ) is known universally as the Fourier transform of nonperiodic signal x (t ). If the Fourier-series coefcients of a periodic signal are known, then the signal itself can be reconstructed by using the formula for the Fourier series given by Eq. (2.3), namely, x (t ) = k = X k e jk 0 t for 0 /2 t 0 /2 As before, a nonperiodic signal can be generated from a periodic one by letting 0 in x (t ), that is, x (t ) = lim x (t ) = lim 0 0 X k e jk 0 t for 0 /2 t 0 /2 (2.28) k = From Eq. (2.26), we have X ( jk 0 ) = or Xk = and hence Eq. (2.28) assumes the form x (t ) = lim 1 0 2 k = Xk 0 /2 X ( jk 0 )0 2 X ( jk 0 )e jk 0 t 0 for 0 /2 t 0 /2 50 DIGITAL SIGNAL PROCESSING If we now let k 0 = and 0 = Therefore, , then as 0 the above summation denes an integral. x (t ) = 1 2 X ( j )e j t d (2.29) This is referred to as the inverse Fourier transform of X ( j ) because it can be used to recover the nonperiodic signal from its Fourier transform. A nonperiodic signal can be represented by a Fourier transform to the extent that the integrals in Eqs. (2.27) and (2.29) can be evaluated. The conditions that would assure the existence of the Fourier transform and its inverse are stated in Theorem 2.5 in Sec. 2.3.3. The Fourier transform and its inverse are often represented in terms of operator notation as X ( j ) = F x (t ) and x (t ) = F 1 X ( j ) respectively. An even more economical notation, favored by Papoulis [5], is given by x (t ) X ( j ) and is interpreted as: X ( j ) is the Fourier transform of x (t ), which can be obtained by using Eq. (2.27), and x (t ) is the inverse Fourier transform of X ( j ), which can be obtained by using Eq. (2.29). The choice of notation depends, of course, on the circumstances. Like the Fourier series coefcients of a periodic signal, X ( j ) is, in general, complex and it can be represented in terms of its real and imaginary parts as X ( j ) = Re X ( j ) + j Im X ( j ) Alternatively, it can be expressed in terms of its magnitude and angle as X ( j ) = A()e j () where A() = | X ( j )| = and () = arg X ( j ) = tan1 Im X ( j ) Re X ( j ) (2.31) [Re X ( j )]2 + [Im X ( j )]2 (2.30) As physical quantities, the magnitude and angle of the Fourier transform are the amplitude spectrum and phase spectrum of the signal, respectively, and the two together constitute its frequency spectrum. A fairly standard practice, is to use lower-case symbols for the time domain and upper-case symbols for the frequency domain. This convention will as far as possible be adopted throughout this textbook to avoid confusion. 2.3.2 Particular Forms In the above analysis, we have implicitly assumed that signal x (t ) is real. Although this is typically the case, there are certain applications where x (t ) can be complex. Nevertheless, the Fourier transform THE FOURIER SERIES AND FOURIER TRANSFORM 51 as dened in the previous section continues to apply (see Ref. [5]), that is, F x (t ) = F [Re x (t ) + j Im x (t )] = = [Re x (t ) + j Im x (t )]e j t dt [Re x (t ) + j Im x (t )][cos t j sin t ] dt (2.32a) = Re X ( j ) + j I m X ( j ) where Re X ( j ) = {Re[x (t )] cos t + Im [x (t )] sin t } dt (2.32b) (2.32c) Im X ( j ) = {Re[x (t )] sin t Im [x (t )] cos t } dt If x (t ) is real, then Eqs. (2.32b) and (2.32c) assume the forms Re X ( j ) = x (t ) cos t dt (2.33a) (2.33b) Im X ( j ) = x (t ) sin t dt As the cosine is an even function and the sine is an odd function of frequency, we conclude that the real part of the Fourier transform of a real signal is an even function and the imaginary part is an odd function of frequency. Hence, X ( j ) = Re X ( j ) + j Im X ( j ) = Re X ( j ) j Im X ( j ) = X ( j ) (2.34) that is, X ( j ) is equal to the complex conjugate of X ( j ). It also follows that the amplitude spectrum given by Eq. (2.30) is an even function and the phase spectrum given by Eq. (2.31) is an odd function of frequency. For a real x (t ), the inverse Fourier transform can be expressed as x (t ) = F 1 [Re X ( j ) + j Im X ( j )] = 1 2 [Re X ( j ) + j Im X ( j )]e j t d [Re X ( j ) + j Im X ( j )][cos t + j sin t ] d {Re[ X ( j )] cos t Im [ X ( j )] sin t } d (2.35a) 1 = 2 = 1 2 52 DIGITAL SIGNAL PROCESSING since the imaginary part is zero. The product of two odd functions such as Im [ X ( j )] sin t is an even function and thus we can write x (t ) = 1 2 Re[ X ( j )e j t ] d 0 1 = Re X ( j )e j t d (2.35b) If the signal is both real and an even function of time, that is, x (t ) = x (t ), then Eqs. (2.33a) and (2.33b) assume the form Re X ( j ) = 2 0 x (t ) cos t dt (2.36a) (2.36b) Im X ( j ) = 0 that is, the Fourier transform is real. As the imaginary part of the Fourier transform is zero in this case, Eq. (2.35a) assumes the form x (t ) = 1 0 Re[ X ( j )] cos t d (2.36c) The converse is also true, i.e., if the Fourier transform is real, then the signal is an even function of time. If the signal is both real and an odd function of time, that is, x (t ) = x (t ), then Eqs. (2.33a) and (2.33b) assume the form Re X ( j ) = 0 I m X ( j ) = 2 0 (2.37a) x (t ) sin t dt (2.37b) and from Eq. (2.35a), we get x (t ) = 1 0 Im [ X ( j )] sin t d (2.37c) The above principles can be extended to arbitrary signals that are neither even nor odd with respect to time. Such signals can be expressed in terms of even and odd components, xe (t ) and xo (t ), respectively, as x (t ) = xe (t ) + xo (t ) where xe (t ) = 1 [x (t ) + x (t )] 2 xo (t ) = 1 [x (t ) x (t )] 2 (2.38b) (2.38c) (2.38a) THE FOURIER SERIES AND FOURIER TRANSFORM 53 From Eq. (2.38a) X ( j ) = Re X ( j ) + j Im X ( j ) = X e ( j ) + X o ( j ) and as X e ( j ) is purely real and X o ( j ) is purely imaginary, we have xe (t ) Re X ( j ) where Re X ( j ) = 2 0 (2.39) (2.40a) xe (t ) cos t dt Re[ X ( j )] cos t d (2.40b) (2.40c) xe (t ) = and 1 0 xo (t ) j Im X ( j ) where Im X ( j ) = 2 0 (2.41a) xo (t ) sin t dt Im [ X ( j )] sin t d (2.41b) (2.41c) xo (t ) = 1 0 Occasionally, signals are right-sided in the sense that their value is zero for negative time,9 that is, x (t ) = 0, for t < 0. For such signals, x (t ) = 0 for t > 0 and hence Eqs. (2.38b) and (2.38c) give x (t ) = 2xe (t ) = 2xo (t ) and from Eqs. (2.40c) and (2.41c), we have x (t ) = 2 2 0 0 (2.42a) Re[ X ( j )] cos t d Im [ X ( j )] sin t d (2.42b) (2.42c) = For this particular case, the real and imaginary parts of the Fourier transform are dependent on each other and, in fact, one can readily be obtained from the other. For example, if Re X ( j ) is known, then x (t ) can be obtained from Eq. (2.42b) and upon eliminating x (t ) in Eq. (2.33b) Im X ( j ) can be obtained. 9 Such signals have often been referred to as causal signals in the past but the word is a misnomer. Causality is a system property as will be shown in Chap. 4. 54 DIGITAL SIGNAL PROCESSING It should be emphasized here that the relations in Eq. (2.42) are valid only for t > 0. For the case t = 0, x (t ) must be dened as the average of its left- and right-hand limits at t = 0, to render x (t ) consistent with the convergence theorem of the Fourier transform (see Theorem 2.5), that is, x (0) = 1 [x (0) + x (0+)] = 1 x (0+) 2 2 = 1 0 Re[ X ( j )] d The Fourier transform will now be used to obtain spectral representations for some standard nonperiodic waveforms. Example 2.5 (a ) Obtain the Fourier transform of the nonperiodic pulse signal shown in Fig. 2.6a . (b) Obtain and plot the amplitude and phase spectrums of x (t ). Solution (a ) From Fig. 2.6a , the pulse signal can be represented by x (t ) p (t ) = 1 0 for /2 t /2 otherwise Hence X ( j ) = x (t )e j t dt = /2 /2 /2 /2 e j t dt = = or e j t j = 2 e j /2 e j /2 2 j 2 sin /2 p (t ) 2 sin /2 where (2 sin /2)/ is often referred to as a sinc function. THE FOURIER SERIES AND FOURIER TRANSFORM 55 Amplitude spectrum 0.6 0 0.5 1.0 0.4 Phase angle, rad Magnitude 1.5 2.0 2.5 0.1 Phase spectrum 0.5 0.3 0.2 3.0 3.5 50 0 50 0 Frequency, rad/s (a) 50 0 Frequency, rad/s (b) 50 Figure 2.7 spectrum. Frequency spectrum of pulse (Example 2.5): (a ) Amplitude spectrum, (b) phase (b) The amplitude and phase spectrums are given by A() = | X ()| = 2 sin /2 2 sin /2 0 if 0 () = arg X () = 2 sin /2 <0 if and are illustrated in Fig. 2.7. Note the continuous frequency spectrum of the nonperiodic pulse signal in contrast to the discrete frequency spectrum of the periodic pulse signal depicted in Fig. 2.3. Example 2.6 (a ) Obtain the Fourier transform of the decaying exponential signal x (t ) = u (t )et 56 DIGITAL SIGNAL PROCESSING where is a positive constant and u (t ) = 1 0 for t 0 for t < 0 is known as the unit-step function. (b) Obtain and plot the amplitude and phase spectrums of x (t ). Solution (a ) We can write X ( j ) = u (t )et e j t dt = 0 0 e(+ j )t dt e(+ j )t = + j For > 0, we note that t lim et 0 and as a result t lim e( j )t = lim et e j t 0 t Thus X ( j ) = or u (t )et 1 + j 1 + j (b) The amplitude and phase spectrums of the signal are given by A() = 1 2 + 2 and () = tan1 respectively. Note that certain ambiguities can arise in the evaluation of the phase spectrum as the above equation has an innite number of solutions due to the periodicity of the tangent function (see Sec. A.3.7). (See Fig. 2.8 for plots.) THE FOURIER SERIES AND FOURIER TRANSFORM 57 Time domain 1.2 1.0 0.8 x(t) 0.6 0.4 0.2 0 5 0 5 Time, s (a) 2 10 15 Amplitude spectrum 3.0 2.5 1 Phase angle, rad 2.0 Magnitude 1.5 1.0 0.5 0 5 2 5 Phase spectrum 0 1 0 Frequency, rad/s (b) 5 0 Frequency, rad/s (c ) 5 Figure 2.8 Frequency spectrum of decaying exponential (Example 2.6 with = 0.4): (a ) Amplitude spectrum, (b) phase spectrum. 2.3.3 Theorems and Properties The properties of the Fourier transform, like those of the Fourier series, can be described in terms of a small number of theorems as detailed below. 58 DIGITAL SIGNAL PROCESSING Theorem 2.5 Convergence If signal x (t ) is piecewise smooth in each nite interval and is, in addition, absolutely integrable, i.e., it satises the inequality |x (t )| dt K < (2.43) where K is some positive constant, then the integral in Eq. (2.27) converges. Furthermore, the substitution of X ( j ) in Eq. (2.29) converges to x (t ) at points where x (t ) is continuous; at points where x (t ) is discontinuous, Eq. (2.29) converges to the average of the left- and right-hand limits of x (t ), namely, x (t ) = 1 [x (t +) + x (t )] 2 Proof (See pp. 471473 of [6] for proof.) The convergence theorem essentially delineates sufcient conditions for the existence of the Fourier transform and its inverse and is analogous to the convergence theorem of the Fourier series, i.e., Theorem 2.1. Note that periodic signals are not absolutely integrable as the area under the graph of |x (t )| over the innite range t is innite, and a similar problem arises in connection with impulse signals which comprise innitely tall and innitesimally thin pulses. The application of the Fourier transform to signals that do not satisfy the convergence theorem will be examined in Sec. 6.2. The following theorems hold if x (t ), x1 (t ), and x2 (t ) are absolutely integrable, which would imply that x (t ) X ( j ) x1 (t ) X 1 ( j ) x2 (t ) X 2 ( j ) The parameters a , b, t0 , and 0 are arbitrary constants which could be complex in theory. Theorem 2.6 Linearity The Fourier transform and its inverse are linear operations, that is, ax1 (t ) + bx2 (t ) a X1 ( j ) + bX2 ( j ) Proof See Prob. 2.18. Theorem 2.7 Symmetry10 Given a Fourier transform pair x (t ) X ( j ) the Fourier transform pair X ( jt ) 2 x ( ) can be generated. 10 Also referred to as the duality property. THE FOURIER SERIES AND FOURIER TRANSFORM 59 Proof By letting t t in the inverse Fourier transform of Eq. (2.29), we get 2 x (t ) = X ( j )e j t d and if we now let t and t , we have 2 x () = X ( jt )e j t dt that is, the Fourier transform of X ( jt ) is 2 x () and the inverse Fourier transform of 2 x () is X ( jt ). Theorem 2.8 Time Scaling x (at ) 1 X |a | j a Proof Assuming that a > 0, letting t = t /a , and then replacing t by t in the denition of the Fourier transform, we get x (at )e j t dt = = 1 a 1 a x (t )e j (/a )t d t x (t )e j (/a )t dt a (2.44a) 1 =X a j If a < 0, proceeding as above and noting that the limits of integration are reversed in this case, we get x (at )e j t dt = 1 a 1 a x (t )e j (/a )t d t x (t )e j (/a )t dt a (2.44b) = 1 X = |a | j Now, if we compare Eqs. (2.44a) and (2.44b), we note that Eq. (2.44b) applies for a < 0 as well as for a > 0, and hence the theorem is proved. One often needs to normalize the time scale of a signal to a more convenient range to avoid awkward numbers in the representation. For example, the time scale of a signal that extends from 0 to 106 s could be scaled to the range 0 to 1 s. Occasionally, the available signal is in terms of a normalized time scale and it may become necessary to denormalize the time scale, say, from the normalized range 0 to 1 s to the actual range. In either of these situations, time scaling is required, which changes the Fourier transform of the signal. 60 DIGITAL SIGNAL PROCESSING Theorem 2.9 Time Shifting x (t t0 ) e j t0 X ( j ) Proof See Prob. 2.19, part (a ). The time-shifting theorem is handy in situations where a signal is delayed or advanced by a certain period of time. Evidently, delaying a signal by t0 s amounts to multiplying the Fourier transform of the signal by the exponential of j t0 . Theorem 2.10 Frequency Shifting e j 0 t x (t ) X ( j j 0 ) Proof See Prob. 2.19, part (b). The similarity of Theorems 2.9 and 2.10 is a consequence of the similarity between the Fourier transform and its inverse. Theorem 2.11 Time Differentiation d k x (t ) ( j )k X ( j ) dt k Proof The theorem can be proved by obtaining the k th derivative of both sides in Eq. (2.29) with respect to t . Theorem 2.12 Frequency Differentiation ( jt )k x (t ) d k X( j ) d k Proof The theorem can be proved by obtaining the k th derivative of both sides in Eq. (2.27) with respect to . Theorem 2.13 Moments Theorem For a bounded signal x (t ), the relation d k X (0) d k (2.45) ( j )k mk = holds where mk = is said to be the kth moment of x (t ). Proof See Ref. [5] for proof. t k x (t ) dt The moments theorem will be found useful in the derivation of Fourier transforms for Gaussian functions (see Example 2.11). THE FOURIER SERIES AND FOURIER TRANSFORM 61 Theorem 2.14 Time Convolution x1 (t ) x2 (t ) X1 ( j ) X2 ( j ) where x1 (t ) x2 (t ) = = x1 ( )x2 (t ) d x1 (t )x2 ( ) d (2.46a) (2.46b) Proof From Eq. (2.46b) and the denition of the Fourier transform, we have F [x1 (t ) x2 (t )] = = x1 (t )x2 ( ) d e j t dt x1 (t )x2 ( )e j t d dt As x1 (t ) and x2 (t ) are deemed to be absolutely integrable, they are bounded and hence the order of integration can be reversed. We can thus write F [x1 (t ) x2 (t )] = = x1 (t )x2 ( )e j t dtd x2 ( )e j x1 (t )e j (t ) dtd By applying the variable substitution t = t + and then replacing t by t , we get F [x1 (t ) x2 (t )] = = = x2 ( )e j x2 ( )e j x1 (t )e j t d t d x1 (t )e j t dt d x2 ( )e j X 1 ( j ) d and as X 1 ( j ) is independent of , we can write F [x1 (t ) x2 (t )] = X 1 ( j ) x2 ( )e j d = X 1 ( j ) X 2 ( j ) The same result can be obtained by starting with Eq. (2.46a) (see Prob. 2.21). The above theorem is stating, in effect, that the Fourier transform of the time convolution is equal to the product of the Fourier transforms of the two signals. Equivalently, the time convolution is equal to the inverse Fourier transform of the product of the Fourier transforms of the two signals. 62 DIGITAL SIGNAL PROCESSING Therefore, if a Fourier transform X ( j ) can be factorized into two Fourier transforms X 1 ( j ) and X 2 ( j ), that is, X ( j ) = X 1 ( j ) X 2 ( j ) whose inverse Fourier transforms x1 (t ) and x2 (t ) are known, then the inverse Fourier transform of the product X ( j ) can be deduced by evaluating the time convolution. Theorem 2.15 Frequency Convolution x1 (t )x2 (t ) where X1 ( j ) X2 ( j ) = = 1 X1 ( j ) X2 ( j ) 2 X1 ( j v) X2 ( j j v) d v X1 ( j j v) X2 ( j v) d v (2.47a) (2.47b) Proof The proof of this theorem would entail using the denition of the inverse Fourier transform and then reversing the order of integration as in the proof of Theorem 2.14. The second formula can be obtained from the rst through a simple change of variable. (See Prob. 2.22, part (b).) Theorem 2.16 Parsevals Formula for Nonperiodic Signals |x (t )|2 dt = 1 2 | X ( j )|2 d Proof From Theorem 2.15, x1 (t )x2 (t )e j t dt = 1 2 X 1( j v) X 2( j j v) d v By letting 0, then replacing v by , we have x1 (t )x2 (t ) dt = 1 2 X 1 ( j ) X 2 ( j ) d Now if we assume that x1 (t ) = x (t ) and x2 (t ) = x (t ), then X 2 ( j ) = X ( j ) (see Prob. 2.23, part (b)). Hence, from the above equation, we obtain x (t )x (t ) dt = 1 2 X ( j ) X ( j ) d or |x (t )|2 dt = 1 2 | X ( j )|2 d THE FOURIER SERIES AND FOURIER TRANSFORM 63 If x (t ) represents a voltage or current waveform, the left-hand integral represents the total energy that would be delivered to a 1- resistor, that is, ET = 1 2 | X ( j )|2 d (2.48) and if = 2 f then the energy of the signal over a bandwidth of 1 Hz, say, with respect to the frequency range f0 can be obtained from Eq. (2.48) as ET = 1 2 1 ( f0 + ) 2 1 ( f 0 ) 2 2 1 1 < f < f0 + 2 2 | X ( j )|2 d (2 f ) 1 ( f0 + ) 2 | X ( j 0 )| 1 ( f 0 ) 2 d f = | X ( j 0 )|2 In effect, the quantity | X ( j )|2 represents the energy density per unit bandwidth (in Hz) of the signal at frequency f = /2 (in Hz) and is often referred to as the energy spectral density. As a function of , | X ( j )|2 is called the energy spectrum of x (t ). Parsevals formula is the basic tool in obtaining a frequency-domain representation for random signals, as will be shown in Chap. 13. The application of the above theorems is illustrated through the following examples. Example 2.7 Show that sin t t /2 p () where p () = Solution 1 0 for || otherwise /2 From Example 2.5, we have p (t ) where p (t ) = 1 0 for |t | /2 otherwise 2 sin /2 64 DIGITAL SIGNAL PROCESSING By using the symmetry theorem (Theorem 2.7), we get 2 sin t /2 2 p () t where p () = = 1 0 1 0 for | | /2 otherwise for || /2 otherwise = p () Now if we let = , we get sin t where p () = 1 0 t /2 p () for || otherwise /2 Example 2.8 Solution Obtain the Fourier transform of the signal shown in Fig. 2.9a . From Fig. 2.9a , the given signal can be modeled as x (t ) = p/2 t + 1 p/2 t 1 4 4 (2.49) by using shifted copies of the pulse p/2 (t ) which is obtained by replacing by /2 in the pulse of Example 2.5. On using the linearity and time-shifting theorems, we get X ( j ) = F p/2 t + 1 p t 1 4 4 = F p/2 t + 1 F p/2 t 1 4 4 = e j /4 F p/2 (t ) e j /4 F p/2 (t ) and from Example 2.5, we deduce X ( j ) = (e j /4 e j /4 )F p/2 (t ) = Hence p/2 t + 1 p/2 t 1 4 4 4 j sin2 /4 4 j sin2 /4 (2.50) THE FOURIER SERIES AND FOURIER TRANSFORM 65 and A() = 4 sin2 /4 and () = 1 2 1 2 for > 0 for < 0 (See Fig. 2.9b and c for plots.) Time domain 1.5 1.0 0.5 x(t) 0 2 0.5 1.0 1.5 2 2 1 0 Time, s (a) 1 2 Amplitude spectrum 1 2 Phase spectrum 0.8 1 Magnitude 0.6 Phase angle, rad 0 Frequency, rad/s (b) 50 0 0.4 0.2 1 0 50 2 50 0 Frequency, rad/s (c ) 50 Figure 2.9 Frequency spectrum of the function in Eq. (2.49) (Example 2.8 with = 0.4): (a ) Time-domain representation, (b) amplitude spectrum, (c) phase spectrum. 66 DIGITAL SIGNAL PROCESSING Example 2.9 Solution Obtain the Fourier transform of the triangular pulse q (t ) shown in Fig. 2.10a . From Fig. 2.10a , we have q (t ) = 1 0 2|t | for |t | /2 for |t | > /2 We note that the given triangular pulse can be generated by performing the integration q (t ) = where x (t ) = p/2 t + 1 p/2 t 1 4 4 (see Example 2.8). If we differentiate both sides in Eq. (2.51), we get 2x (t ) dq (t ) = dt (2.52a) t 2x (t ) dt (2.51) If we apply the time-differentiation theorem (Theorem 2.11) with k = 1 to the left-hand side of Eq. (2.52a), we have F d q (t ) = j Q ( j ) dt (2.52b) On the other hand, if we apply the Fourier transform to the right-hand side of Eq. (2.52a), we get F 2x (t ) 2 X ( j ) = (2.52c) Therefore, from Eqs. (2.52a)(2.52c) F or Q ( j ) = and from Eq. (2.50), we get Q ( j ) = 8 sin2 /4 2 2 X ( j ) j d q (t ) 2x (t ) =F dt THE FOURIER SERIES AND FOURIER TRANSFORM 67 or q (t ) 8 sin2 /4 2 The amplitude spectrum is illustrated in Fig. 2.10b. The phase spectrum is zero for all frequencies since the signal is a real, even function of time (see Eqs. (2.36a) and (2.36b)). Time domain 1.5 1.0 x(t) 0.5 0 2 1 0 Time, s (a) Amplitude spectrum 1 2 0.6 0.5 0.4 Magnitude 0.3 0.2 0.1 0 50 0 Frequency, rad/s (b) 50 Figure 2.10 Frequency spectrum of triangular function (Example 2.9 with = 1.0): (a ) Time-domain representation, (b) amplitude spectrum. 68 DIGITAL SIGNAL PROCESSING Example 2.10 Obtain the Fourier transform of the decaying sinusoidal signal x (t ) = u (t )et sin 0 t (see Fig. 2.11a ) where and 0 are positive constants. Solution We can write x (t ) = u (t )et sin 0 t = = u (t ) j 0 t e e j 0 t et 2j (2.53a) u (t ) ( j 0 )t e e(+ j 0 )t 2j From Example 2.6, we have u (t )et 1 + j and if we replace rst by j and then by + j , we get u (t )e( j 0 )t and u (t )e(+ j 0 )t respectively. Now from Eqs. (2.53a)(2.53c) u (t ) ( j 0 )t e e(+ j 0 )t 2j or u (t )et sin 0 t 2 + 2 0 1 j 0 + j (2.53b) 1 + j 0 + j (2.53c) 1 2j 1 1 j 0 + j + j 0 + j 0 0 = 2 2 + j 2 (a + j )2 + 0 Hence, the amplitude and phase spectrums of the decaying sinusoidal THE FOURIER SERIES AND FOURIER TRANSFORM 69 signal are given by A() = and 0 2 ( 2 + 0 2 )2 + 4 2 2 2 () = tan1 2 2 + 0 2 respectively. (See Fig. 2.11b and c for the plots.) Time domain 0.8 0.6 0.4 x(t) 0.2 0 0.2 0.4 0 5 Time, s (a) Amplitude spectrum 10 15 Phase spectrum 3 2 1 0 1 2 3 5 1.4 1.2 1.0 0.8 0.6 0.4 0.2 0 5 0 Frequency, rad/s (b) 5 Phase angle, rad Magnitude 0 Frequency, rad/s (c) 5 Figure 2.11 Frequency spectrum of continuous-time decaying sinusoidal signal (Example 2.10, a = 0.4, 0 = 2.0): (a ) Time-domain representation, (b) amplitude spectrum, (c) phase spectrum. 70 DIGITAL SIGNAL PROCESSING Example 2.11 Obtain the Fourier transform of the Gaussian function x (t ) = eat (see 2 Fig. 2.12a ). Solution A solution for this example found in Ref. [5] starts with the standard integral eat dt = 2 which can be obtained from mathematical handbooks, for example, Ref. [7]. On differentiating both sides of this equation k times with respect to , we can show that t 2k eat dt = 2 1 3 (2k 1) 2k 2k +1 (2.54a) On the other hand, if we replace e j t by its series representation (see Eq. A.11a) in the denition of the Fourier transform, we get X ( j ) = x (t )e j t dt = x (t ) k =0 ( j t )k k! dt = k =0 ( j )k k! t k x (t ) dt = k =0 ( j )k mk k! (2.54b) where mk = t k x (t ) dt is the kth moment of x (t ) (see Theorem 2.13). As x (t ) is an even function, the moments for odd k are zero and hence Eq. (2.54b) can be expressed as X ( j ) = m 0 + ( j )2 ( j )4 m2 + m4 + 2! 4! = k =0 ( j )2k m 2k (2k )! where m 2k = t 2k et dt = 2 1 3 (2k 1) 2k 2k +1 THE FOURIER SERIES AND FOURIER TRANSFORM 71 Time domain 1.5 1.0 x(t) 0.5 0 5 0 Time, s (a) Amplitude spectrum 5 2.0 1.5 Magnitude 1.0 0.5 0 5 0 Frequency, rad/s (b) 5 Figure 2.12 Frequency spectrum of continuous-time Gaussian function: (Example 2.11, = 1.0): (a ) Time-domain representation, (b) amplitude spectrum. according to Eq. (2.54a) or X ( j ) = k =0 ( j )2k 1 3 (2k 1) (2k )! 2k k =0 2k +1 = 1 3 (2k 1)( j )2k (2k )!(2 )k 72 DIGITAL SIGNAL PROCESSING The summation in the above equation is actually the series of e veried and, therefore, X ( j ) = or eat 2 2 /4 , as can be readily 2 /4 e 2 /4 e The Gaussian function and its Fourier transform are plotted in Fig. 2.12 and as can be seen, the frequency-domain function has the same general form as the time-domain function. (See Eq. (6.26) for another transform pair that has this property.) The Fourier transform pairs obtained in this chapter are summarized in Table 2.1. We have not dealt with impulse functions or periodic signals so far because these types of signals require special attention. It turns out that the applicability of the Fourier transform to periodic signals relies critically on the denition of impulse functions. Impulse functions and periodic signals are, of course, very important in DSP and they will be examined in detail in Chap. 6. Table 2.1 Standard Fourier transforms x (t ) p (t ) = 1 0 sin t 2|t | 1 q (t ) = 0 2 X( j ) 2 sin /2 p () = for |t | /2 for |t | > /2 1 0 for || for || > /2 /2 for |t | /2 for |t | > /2 t /2 4 sin t /4 t2 e t 2 2|| 1 q () = 0 8 sin2 /4 2 for || for || > /2 /2 1 2 et /4 4 u (t )et u (t )et sin 0 t 2 /4 e e 2 1 a + j 0 2 (a + j )2 + 0 THE FOURIER SERIES AND FOURIER TRANSFORM 73 REFERENCES [1] [2] [3] [4] [5] [6] [7] W. Kaplan, Operational Methods for Linear Systems, 3rd ed., Reading, MA: Addison-Wesley, 1984. R. J. Schwarz and B. Friedland, Linear Systems, New York: McGraw-Hill, 1965. H. S. Carslaw, Fourier Series, New York: Dover, 1930. C. R. Wylie, Jr. Advance Engineering Mathematics, 3rd ed., New York: McGraw-Hill, 1966. A. Papoulis, The Fourier Integral and Its Applications, New York: McGraw-Hill, 1962. W. Kaplan, Advanced Calculus, 3rd ed., Reading, MA: Addison-Wesley, 1962. M. R. Spiegel, Mathematical Handbook of Formulas and Tables, New York: McGraw-Hill, 1965. PROBLEMS 2.1. Derive Eq. (2.4). 2.2. Derive Eqs. (2.12c) and (2.12d). 2.3. A periodic signal x (t ) is described by Eq. (2.1) with for 0 /2 < t < 0 /4 1 for 0 /4 t < 0 /4 x (t ) = 2 1 for 0 /4 t < 0 /2 (a) Obtain the Fourier series of x (t ) in the form of Eq. (2.3). (b) Express the Fourier series in the form of Eq. (2.9). (c) Express the Fourier series in the form of Eq. (2.13b). (d) Obtain the amplitude and phase spectrums of x (t ). 2.4. A periodic signal x (t ) is described by Eq. (2.1) with for 0 /2 < t < 30 /8 0 1 for 30 /8 t < 0 /4 for 0 /4 t < 0 /4 x (t ) = 2 1 for 0 /4 t < 30 /8 0 for 30 /8 t 0 /2 (a) Obtain the Fourier series of x (t ) in the form of Eq. (2.3). (b) Express the Fourier series in the form of Eq. (2.9). (c) Express the Fourier series in the form of Eq. (2.13b). (d) Obtain the amplitude and phase spectrums of x (t ). 2.5. A periodic signal x (t ) is described by Eq. (2.1) with for 0 /2 < t /2 1 for /2 < t < /2 x (t ) = 0 1 for /2 t 0 /2 where < 0 . (a) Obtain the Fourier series of x (t ) in the form of Eq. (2.3). (b) Express the Fourier series in the form of Eq. (2.9). (c) Express the Fourier series in the form of Eq. (2.13b). (d) Obtain the amplitude and phase spectrums of x (t ). 74 DIGITAL SIGNAL PROCESSING 2.6. A periodic signal x (t ) is described by Eq. (2.1) with for 0 /2 < t /2 1 0 for /2 < t < /2 x (t ) = 1 for /2 t 0 /2 where < 0 . (a) Obtain the Fourier series of x (t ) in the form of Eq. (2.3). (b) Express the Fourier series in the form of Eq. (2.9). (c) Express the Fourier series in the form of Eq. (2.13b). (d) Obtain the amplitude and phase spectrums of x (t ). 2.7. A periodic signal x (t ) is described by Eq. (2.1) with for 0 /2 < t < 2 0 1 for 2 t 1 for 1 < t < 1 x (t ) = 0 1 for 1 t 2 0 for 2 < t 0 /2 where 1 < 2 < 0 /2. (a) Obtain the Fourier series in the form of Eq. (2.3). (b) Obtain the amplitude and phase spectrums of x (t ). 2.8. A periodic signal x (t ) is described by Eq. (2.1) with for 0 /2 < t < 2 0 for 2 t 1 1 0 for 1 < t < 1 x (t ) = 1 for 1 t 2 0 for 2 < t 0 /2 where 1 < 2 < 0 /2. (a) Obtain the Fourier series in the form of Eq. (2.3). (b) Obtain the amplitude and phase spectrums of x (t ). 2.9. A periodic signal x (t ) is described by Eq. (2.1) with for 0 /2 < t < 2 1 0 for 2 t 1 for 1 < t < 1 x (t ) = 1 0 for 1 t 2 1 for 2 < t 0 /2 where 1 < 2 < 0 /2. (a) Obtain the Fourier series in the form of Eq. (2.3). (b) Obtain the amplitude and phase spectrums of x (t ). 2.10. A periodic signal is given by x (t ) = cos2 t + cos4 t (a) Obtain the Fourier series of x (t ) in the form of a linear combination of cosines. (b) Obtain the amplitude and phase spectrums of x (t ). THE FOURIER SERIES AND FOURIER TRANSFORM 75 2.11. A periodic signal is given by x (t ) = 1 2 + sin t + 1 sin2 t + cos4 t 4 (a) Obtain the Fourier series of x (t ) in the form of a linear combination of sines. (b) Obtain the amplitude and phase spectrums of x (t ). 2.12. Find the Fourier series of (a) x (t ) = t for 0 /2 t /2 t for 0 /2 t < 0 (b) x (t ) = t for 0 t 0 /2 2.13. Find the Fourier series of (a) x (t ) = | cos 0 t | for 0 /2 t 0 /2 where 0 = 2/0 . (b) x (t ) = 0 | sin 0 t | where 0 = 2/0 . for 0 /2 t < 0 for 0 t 0 /2 2.14. Find the Fourier series of (a) x (t ) = jt for 0 /2 |t | 0 /2 (b) x (t ) = j |t | for 0 /2 |t | 0 /2 2.15. Find the Fourier series of (a) x (t ) = t /0 + 1/2 for for 0 t 0 e for (b) x (t ) = for e0 t 0 for 0 /2 t 0 /2 0 /2 t < 0 /4 0 /4 t < 0 0 t < 0 /4 0 /4 t 0 /2 2.16. Assuming that x (t ) is a real signal which can be either an even or odd function of time, show that (a) X ( j ) = X ( j ) (b) | X ( j )| = | X ( j )| (c) arg X ( j ) = arg X ( j ) 2.17. Assuming that x (t ) is purely imaginary show that (a) Re X ( j ) = Im x (t ) sin t dt and Im X ( j ) = Re x (t ) cos t dt (b) Assuming that x (t ) is purely imaginary and an even function of time, show that Re X ( j ) is an odd function and Im X ( j ) is an even function of frequency. (c) Assuming that x (t ) is purely imaginary and an odd function of time, show that Re X ( j ) is an even function and Im X ( j ) is an odd function of frequency. 2.18. (a) Prove Theorem 2.6 (linearity) for the Fourier transform. (b) Repeat part (a ) for the inverse Fourier transform. 2.19. (a) Prove Theorem 2.9 (time shifting). (b) Prove Theorem 2.10 (frequency shifting). 76 DIGITAL SIGNAL PROCESSING 2.20. Show that x1 ( )x2 (t ) d = x1 (t )x2 ( ) d 2.21. Prove Theorem 2.14 (time convolution) starting with Eq. (2.46a). 2.22. (a ) Prove Theorem 2.15 (frequency convolution) starting with Eq. (2.47a). (b) Show that Eq. (2.47b) is equivalent to Eq. (2.47a). 2.23. A complex signal x2 (t ) is equal to the complex conjugate of signal x (t ). Show that (a) X ( j ) = X ( j ) (b) X ( j ) = X ( j ) 2.24. (a ) Find the Fourier transform of x (t ) = p (t /2) where p (t ) is a pulse of unity amplitude and width . (b) Find the Fourier transform of 1 2 x (t ) = 1 0 for 0 /2 t < 0 /4 for 0 /4 t < 0 /4 for 0 /4 t < 0 /2 otherwise (c) Find the amplitude and phase spectrums for the signal in part (b). 2.25. (a ) Find the Fourier transform of x1 (t ) = [u (t + /2) u (t /2)] where u (t ) is the continuous-time unit-step function dened as u (t ) = (b) Sketch the waveform of 1 0 for t 0 for t < 0 x2 (t ) = n = x1 (t n ) (c) Using the result in part (a ), nd the Fourier transform of x2 (t ). 2.26. Find the Fourier transform of x (t ) = u (t 4.5T ) u (t 9.5T ). (b) Obtain the amplitude and phase spectrums of x (t ). 2.27. (a ) Find the Fourier transform of x (t ) = (1 + cos 0 t )/2 0 for |t | 0 /2 otherwise where 0 = 2/0 . (b) Obtain the amplitude and phase spectrums of x (t ). 2.28. (a ) Find the Fourier transform of x (t ) = u (t )eat cos 0 t . (b) Obtain the amplitude and phase spectrums of x (t ). THE FOURIER SERIES AND FOURIER TRANSFORM 77 2.29. (a ) Find the Fourier transform of x (t ) = eat cosh 0 t 0 for 0 t 1 otherwise (b) Obtain the amplitude and phase spectrums of x (t ). (See Prob. 2.25 for the denition of u (t ).) 2.30. (a ) Find the Fourier transform of x (t ) = sin 0 t 0 for 0 /4 t 0 /4 otherwise where 0 = 2/0 (b) Obtain the amplitude and phase spectrums of x (t ). 2.31. (a ) Find the Fourier transform of x (t ) = eat sinh 0 t 0 for 1 t 1 otherwise (b) Obtain the amplitude and phase spectrums of x (t ). 2.32. Find the Fourier transforms of (a) x (t ) = | cos 0 t | 0 where 0 = 2/0 | sin 0 t | 0 where 0 = 2/0 for 0 /2 t 0 /2 otherwise for 0 t 0 /2 otherwise (b) x (t ) = 2.33. Find the Fourier transforms of for 2 t 1 1 for 1 t 2 (a) x (t ) = 1 0 otherwise where 1 and 2 are positive constants and 1 < 2 0 t for 0 /4 t < 0 e t for 0 t < 0 /4 (b) x (t ) = e 0 0 otherwise 2.34. (a ) Using integration by parts, show that te t dt = ( t 1)e t / 2 (b) Using the result in part (a ) nd the Fourier transform of x (t ) = (c) Find the Fourier transform of t t x (t ) = 0 for 0 /2 t < 0 for 0 t 0 /2 otherwise t 0 for 0 /2 t /2 otherwise 78 DIGITAL SIGNAL PROCESSING 2.35. Find the Fourier transforms of t /0 + 1/2 for 0 /2 t 0 /2 0 otherwise for 0 /2 t < 0 1 + t for 0 t 0 /2 (b) x (t ) = 1 t 0 otherwise 2.36. Find the Fourier transforms of jt for 0 /2 |t | 0 /2 (a) x (t ) = 0 otherwise (a) x (t ) = j |t | for 0 /2 |t | 0 /2 0 otherwise 2.37. Obtain the Fourier transforms of the following: (a ) x (t ) = et cos2 0 t where > 0 (b) x (t ) = cos at 2 (b) x (t ) = CHAPTER 3 THE Z TRANSFORM 3.1 INTRODUCTION Chapter 2 has dealt with the Fourier series and transform. It has shown that through these mathematical tools, spectral representations can be obtained for a given periodic or nonperiodic continuous-time signal in terms of a frequency spectrum, which is composed of the amplitude and phase spectrums. Analogous spectral representations are also possible for discrete-time signals. The counterpart of the Fourier transform for discrete-time signals is the z transform [1]. The Fourier transform will convert a real continuous-time signal into a function of complex variable j . Similarly, the z transform will convert a real discrete-time signal into a function of a complex variable z . The transform name is based on nothing more profound than the consistent use of the letter z for the complex variable involved over the years. The z transform, like the Fourier transform, comes along with an inverse transform, namely, the inverse z transform. As a consequence, a signal can be readily recovered from its z transform. The availability of an inverse makes the z transform very useful for the representation of digital lters and discrete-time systems in general. Though the most basic representation of discrete-time systems is in terms of difference equations, as will be shown in Chap. 4, through the use of the z transform difference equations can be reduced to algebraic equations which are much easier to handle. In this chapter, the z transform is rst dened as an independent mathematical entity and it is immediately shown that it is actually a particular type of Laurent series. The inverse z transform is then introduced as a means of recovering the discrete-time signal from its z transform. This turns out to be an exercise in constructing Laurent series. The properties of the z transform are then described through a number of fundamental theorems as was done for the Fourier transform in Chap. 2. The z transform is then used for the representation of some typical discrete-time signals. 79 Copyright 2006 by The McGraw-Hill Companies, Inc. Click here for terms of use. 80 DIGITAL SIGNAL PROCESSING The chapter concludes with the application of the z transform as a tool for the spectral representation of discrete-time signals. The application of the z transform for the representation of digital lters and discrete-time systems in general will be treated in Chap. 5 and certain fundamental interrelations between the z transform and the Fourier transform will be investigated in Chap. 6. 3.2 DEFINITION OF Z TRANSFORM Given an arbitrary discrete-time signal that satises the conditions (i) (ii) (iii) x (nT ) = 0 |x (nT )| K 1 |x (nT )| K 2r n for n < N1 for N1 n < N2 for n N2 where N1 , N2 are positive integers and K 1 , K 2 , and r are positive constants, the innite series X (z ) = n = x (nT )z n (3.1) can be constructed where z is a complex variable. In mathematical terms, this is a Laurent series (see Sec. A.6) but in the digital signal processing (DSP) literature it is referred to as the z transform of x (nT ). As will be shown in Sec. 3.4, this turns out to be a unique representation of x (nT ) for all the values of z for which it converges. Innite series are not convenient to work with in practice but for most well- behaved discretetime signals that can be represented in terms of analytical expressions, the z transform can be expressed as a rational function of z of the form X (z ) = M M i N (z ) i =0 ai z = N D (z ) z N + i =1 bi z N i (3.2a) By factorizing the numerator and denominator polynomials, namely, N (z ) and D (z ), X (z ) can be put in the form X (z ) = N (z ) = H0 D (z ) M i =1 ( z z i ) N i =1 (z pi ) (3.2b) where z i and pi are the zeros and poles of X (z ). Thus the z transform of a discrete-time signal can be represented by a zero-pole plot. For example, the z transform X (z ) = (z 2)(z + 2) (z 2 4) = 2 1)(z 2 + 4) z (z z (z 1)(z + 1)(z j 2)(z + j 2) (3.3) can be represented by the zero-pole plot shown in Fig. 3.1. THE Z TRANSFORM 81 j Im z z plane j2 2 1 1 2 Re z j2 Figure 3.1 Zero-pole plot of z transform X (z ) in Eq. (3.3). 3.3 CONVERGENCE PROPERTIES The innite series in Eq. (3.1) is meaningful if it converges and, as in the case of the Fourier transform, convergence theorems exist that specify the circumstances under which the series converges. Two such theorems pertaining to absolute and uniform convergence are examined next. An innite series is said to converge absolutely if the sum of the magnitudes of its terms has a nite value. An innite series that involves an independent complex variable is said to converge uniformly in a given region of convergence if it converges absolutely everywhere in that region. Theorem 3.1 Absolute Convergence If (i) (ii) (iii) x (nT ) = 0 |x (nT )| K 1 |x (nT )| K 2r n for n < N1 for N1 n < N2 for n N2 where N 1 and N 2 are positive constants and r is the smallest positive constant that will satisfy condition (iii), then the z transform as dened in Eq. (3.1) exists and converges absolutely (see Theorem A.2) if and only if r < |z | < R Proof If we let z = e j , we can write n = n = with R (3.4) |x (nT )z n | = = |x (nT )| |z n | |x (nT )| | n e jn | n = 82 DIGITAL SIGNAL PROCESSING Noting that the magnitude of n e jn is simply n (see Eq. (A.13b)) and then substituting conditions (i) to (iii) of the theorem in the above equation, we get n = |x (nT )z n | N2 1 n = N1 K 1 n + K2 n = N2 n = N2 r r n N 2 1 K1 n = N1 n + K 2 n (3.5) The rst term at the right-hand side is the sum of a nite number of negative powers of and since is implicitly assumed to be nite, the rst term is nite. The second term is the sum of a geometric series and if > r , that is, r / < 1, it is nite by virtue of the ratio test (see Theorem A.3). Hence n = |x (nT )z n | K 0 where K 0 is nite, i.e., X (z ) converges absolutely. If < r , then r / > 1 and (r / )n as n ; consequently, the right-hand summation in Eq. (3.5) becomes innite. If = r , then (r / )n = 1 for all n . However, the right-hand summation in Eq. (3.5) entails an innite number of ones and again it is innite. In effect, X (z ) converges absolutely if > r and diverges if r . There is one more situation that needs to be taken into account before the proof can be considered complete, namely, the behavior of X (z ) as z . If x (nT ) = 0 for one or more negative values of n , then z lim x (nT )z n n = That is, X (z ) diverges if z = and, therefore, it converges if and only if r < |z | < or r < | z | < R with R In terms of the usual mathematical language, this is the necessary and sufcient condition for absolute convergence. Summarizing the essence of the above theorem, if x (nT ) is bounded by the shaded region in Fig. 3.2a , then its z transform converges absolutely if and only if z is located in the shaded region of the z plane depicted in Fig. 3.2b where R . The area between the two circles is referred to as an annulus and the radius of the inner circle, namely, r , as the radius of convergence of the function since the inner circle separates the regions of convergence and divergence (see Sec. A.5). Theorem 3.2 Uniform Convergence X (z ) converges uniformly and is analytic in the region dened by Eq. (3.4). This theorem follows readily from Theorem 3.1. Since X (z ) converges absolutely at any point in the region dened by Eq. (3.4), it has a limit and a derivative at any point in the region of THE Z TRANSFORM 83 x(nT ) z plane Region of convergence K2r n K1 nT N1 K1 N2 K2r n R r (a) (b) Figure 3.2 Convergence of z transform: (a ) Bounds in time domain, (b) region of convergence in z domain. convergence. Therefore, X (z ) is analytic in the annulus of Eq. (3.4). In addition, X (z ) converges uniformly in that annulus, which is a way of saying that the convergence X (z ) is independent of z (see Sec. A.5). 3.4 THE Z TRANSFORM AS A LAURENT SERIES If we compare the series in Eq. (3.1) with the Laurent series in Eq. (A.49), we note that the z transform is a Laurent series with X (z ) = F (z ) x (nT ) = an a=0 Therefore, the z transform inherits properties (a) to (d) in Theorem A.4. From property (a ), if X (z ), for example, the function represented by the zero-pole plot in Fig. 3.3a is analytic on two concentric circles C1 and C2 with center at the origin and in the area between them as depicted in Fig. 3.3b, then it can be represented by a series of the type shown in Eq. (3.1) where x (nT ) is given by the contour integral x (nT ) = 1 2 j X (z )z n 1 dz (3.6) The contour of integration is a closed contour in the counterclockwise sense enclosing all the singularities of X (z ) inside the inner circle, i.e., C1 . From property (b), a Laurent series of X (z ) converges and represents X (z ) in the open annulus obtained by continuously increasing the radius of C2 and decreasing the radius of C1 until each of C2 and C1 reaches one or more singularities of X (z ), as shown in Fig. 3.3c. 84 DIGITAL SIGNAL PROCESSING z plane j2 z plane C2 C1 2 1 1 2 j2 (a) z plane C2 C1 (b) z plane III II R0 I R (c) (d ) Figure 3.3 Laurent series of X (z ) with center at the origin of the z plane: (a ) Zero-pole plot of X (z ), (b), (c), and (d ) Properties (a ), (b), and (c), respectively, of the Laurent series (see Theorem A.4). From property (c), X (z ) can have several, possibly many, annuli of convergence about the origin; and from property (d), the Laurent series for a given annulus of convergence is unique. For example, function X (z ) given by Eq. (3.3) has three distinct annuli of convergence, namely, A I = { z : R 0 < | z | < 1} AII = {z : 1 < |z | < 2} AIII = {z : 2 < |z | < R } as illustrated in Fig. 3.3d where R0 0 and R , and a unique Laurent series can be obtained for each one of them. THE Z TRANSFORM 85 3.5 INVERSE Z TRANSFORM According to Theorem 3.1, the z transform of a discrete-time signal is a series that converges in the annulus dened by Eq. (3.4), that is, r < | z | < R with R where r is specied in condition (iii) of the theorem. On the other hand, the Laurent theorem states that function X (z ) can have several Laurent series, possibly many, about the origin that converge in different annuli but each one is unique to its annulus of convergence. The only annulus of convergence that is consistent with the annulus in Eq. (3.4) is the outermost annulus of X (z ), which is dened as R < | z | < R with R (3.7) where R is the radius of a circle passing through the most distant singularity of X (z ) from the origin. Therefore, we must have r = R , that is, if the pole locations of X (z ) are known, the template that bounds the discrete-time signal in Fig. 3.2a can be constructed and if the template in Fig. 3.2a is known, then the radius of the most distant pole of X (z ) from the origin can be deduced. On the basis of the above discussion, a discrete-time signal x (nT ) can be uniquely determined from its z transform X (z ) by simply obtaining the Laurent series that represents X (z ) in its outermost annulus of convergence as illustrated in Fig. 3.4. This can be accomplished by evaluating the coefcients of the Laurent series using the contour integral in Eq. (3.6), that is, x (nT ) = 1 2 j X (z )z n 1 dz where is a closed contour in the counterclockwise sense enclosing all the singularities of function X (z )z n 1 . Equation (3.6) is, in effect, the formal denition of the inverse z transform. z plane R R Figure 3.4 Evaluation of inverse z transform. 86 DIGITAL SIGNAL PROCESSING Like the Fourier transform and its inverse, the z transform and its inverse are often represented in terms of operator format as X (z ) = Z x (nT ) and x (nT ) = Z 1 X (z ) respectively. At rst sight, the contour integration in Eq. (3.6) may appear to be a formidable task. However, for most DSP applications, the z transform turns out to be a rational function like the one in Eq. (3.3) and for such functions the contour integral in Eq. (3.6) can be easily evaluated by using the residue theorem (see Sec. A.7). According to this theorem, x (nT ) = 1 2 j P X (z )z n 1 dz = i =1 Res X (z )z n 1 z pi (3.8) where Res z pi X (z )z n 1 is the residue of X (z )z n 1 at pole pi . P is the number of poles in X (z )z n 1 . The residue at a pole of order m i is given by Res X (z )z n 1 = z = pi 1 d m i 1 lim (z pi )m i X (z )z n 1 (m i 1)! z pi dz m i 1 (3.9a) which simplies to Resz = pi X (z )z n 1 = lim (z pi ) X (z )z n 1 z pi (3.9b) for a simple pole since no differentiation is needed and 0! = 1. Evidently, the residue at a rst-order pole pi can be readily obtained by simply deleting the factor (z pi ) from the denominator of X (z )z n 1 and then evaluating the remaining part of the function at pole pi . The above method of inversion is known as the general inversion method for obvious reasons and its application will be examined in Sec. 3.8. 3.6 THEOREMS AND PROPERTIES The general properties of the z transform can be described in terms of a small number of theorems, as detailed below. To facilitate the exposition we assume that Z x (nT ) = X (z ) Z x1 (nT ) = X 1 (z ) Z x2 (nT ) = X 2 (z ) The symbols a , b, w , and K represent constants which may be complex. Most of the z transform theorems are proved by applying simple algebraic manipulation to the z transform denition in Eq. (3.1). Theorem 3.3 Linearity Z [ax1 (nT ) + bx2 (nT )] = a X1 (z ) + bX2 (z ) and Z 1 [a X1 (z ) + bX2 (z )] = ax1 (nT ) + bx2 (nT ) Proof See Prob. 3.5. THE Z TRANSFORM 87 Theorem 3.4 Time Shifting For any positive or negative integer m, Z x (nT + mT ) = z m X (z ) Proof From the denition of the z transform Z x (nT + mT ) = n = x (nT + mT )z n = zm n = x [(n + m )T ]z (n +m ) If we now make the variable substitution n + m = n and then replace n by n , we have Z x (nT + mT ) = z m n = x (nT )z n = z m X (z ) If m is negative, then x (nT + mT ) = x (nT |m |T ) and thus the signal is delayed by |m |T s. As a consequence, the z transform of a discrete-time signal which is delayed by an integer number of sampling periods is obtained by simply multiplying its z transform by the appropriate negative power of z . On the other hand, multiplying the z transform of a signal by a positive power of z causes the signal to be advanced or shifted to the left with respect to the time axis. Theorem 3.5 Complex Scale Change For an arbitrary real or complex constant w, Z [wn x (nT )] = X (wz ) Proof Z [w n x (nT )] = = n = [w n x (nT )]z n x (nT )(w z )n n = = X (w z ) Evidently, multiplying a discrete-time signal by w n is equivalent to replacing z by w z in its z transform. If the signal is multiplied by v n , then we can write v n = (1/v )n and thus Z [v n x (nT )] = Z Theorem 3.6 Complex Differentiation Z [nT1 x (nT )] = T1 z d X (z ) dz 1 v n x (nT ) = X (z /v ) 88 DIGITAL SIGNAL PROCESSING Proof Z [nT1 x (nT )] = n = nT1 x (nT )z n = T1 z n = x (nT )(n )z n 1 = T1 z n = x (nT ) d dz n = d n (z ) dz d X (z ) dz = T1 z x (nT )z n = T1 z Changing the order of summation and differentiation is allowed in the last equation for values of z for which X (z ) converges. Complex differentiation provides a simple way of obtaining the z transform of a discrete-time signal that can be expressed as a product nT1 x (nT ) by simply differentiating the z transform of X (z ). Theorem 3.7 Real Convolution Z k= x1 (kT )x2 (nT kT ) = Z k= x1 (nT kT )x2 (kT ) = X1 (z ) X2 (z ) Proof This theorem can be proved by replacing x (nT ) in the denition of the z transform by either of the above sums, which are known as convolution summations, then changing the order of summation, and after that applying a simple variable substitution, as follows: k = Z k = x1 (kT )x2 (nT kT ) = n = x1 (kT )x2 (nT kT ) z n x1 (kT )x2 (nT kT )z n k n = = k = n = = k = x1 (kT )z x2 (nT kT )z (n k ) x2 (nT )z n = n = x1 (nT )z n n = = X 1 (z ) X 2 (z ) Changing the order of the two summations in the above proof is valid for all values of z for which X 1 (z ), and X 2 (z ) converge. THE Z TRANSFORM 89 Convolution summations arise naturally in the representation of digital lters and discrete-time systems as will be shown in Chap. 4. Consequently, the real-convolution theorem can be used to deduce z -domain representations for these systems, as will be shown in Chap. 5. Theorem 3.8 Initial-Value Theorem The initial value of x (nT ) for a z transform of the form X (z ) = occurs at K T = ( N M )T and the value of x (nT ) at nT = K T is given by x ( K T ) = lim [z K X (z )] z N (z ) = D (z ) M M i i =0 ai z N N i i =0 bi z (3.10) Corollary If the degree of the numerator polynomial, N (z ), in the z transform of Eq. (3.10) is equal to or less than the degree of the denominator polynomial D (z ), then we have x (nT ) = 0 i.e., the signal is right sided. Proof From the denition of the z transform for n < 0 X (z ) = n = x (nT )z n If the initial value of x (nT ) occurs at nT = K T , then X (z ) = n= K x (nT )z n = x ( K T )z K + x ( K T + T )z ( K +1) + x ( K T + 2T )z ( K +2) + On dividing both sides by the rst term, we have X (z ) x ( K T + T )z ( K +1) x ( K T + 2T )z ( K +2) = 1+ + + x ( K T )z K x ( K T )z K x ( K T )z K x ( K T + T ) x ( K T + 2T ) + = 1+ + x ( K T )z x ( K T )z 2 If we take the limit as z , we have z lim X (z ) =1 x ( K T )z K 90 DIGITAL SIGNAL PROCESSING or x ( K T ) = lim [z K X (z )] z (3.11) and from Eqs. (3.11) and (3.10), we can now write x ( K T ) = lim X (z )z K = lim z M M i i =0 ai z N N i i =0 bi z z zK = a0 M N K z z b0 and since the left-hand side of the equation is independent of z , we get MN+K =0 Therefore, K =NM i.e., the initial value of x (nT ) occurs at nT = K T , where K is the difference between the denominator and numerator degrees in X (z ). With K known, x ( K T ) can be obtained from Eq. (3.11) as x ( K T ) = lim [z K X (z )] z As has been demonstrated in the absolute-convergence theorem (Theorem 3.1), the z transform will not converge if x (nT ) is nonzero at n = . Consequently, a signal must start at some nite point in time in practice. The starting point of a signal as well as its value at the starting point are often of interest and Theorem 3.8 provides a means by which they can be determined. If the denominator degree in X (z ) is equal to or exceeds the numerator degree, then the rst nonzero value of x (nT ) will occur at K T = ( N M )T and if the condition of the Corollary is satised, i.e., N M , then K 0, that is, x (nT ) = 0 for n < 0. On the basis of this Corollary, one can determine by inspection whether a z transform represents a right-sided or two-sided signal. It is also very useful for checking whether a digital lter or discrete-time system is causal or noncausal (see Chap. 5). Theorem 3.9 Final Value Theorem The value of x (nT ) as n is given by x () = lim [(z 1) X (z )] z 1 Proof From the time-shifting theorem (Theorem 3.4) Z [x (nT + T ) x (nT )] = z X (z ) X (z ) = (z 1) X (z ) Alternatively, we can write n (3.12) Z [x (nT + T ) x (nT )] = lim n [x ( K T + T ) x ( K T )]z n k =n THE Z TRANSFORM 91 and if x ( K T ) is the rst nonzero value of x (nT ), we have Z [x (nT + T ) x (nT )] = lim [x ( K T )z ( K 1) + x ( K T + T )z K x ( K T )z K n + + x (nT )z (n 1) x (nT T )z (n 1) + x (nT + T )z n x (nT )z n ] = lim [(z ( K 1) z K )x ( K T ) + (z K z ( K +1) )x ( K T + T ) n + + (z (n 1) z n )x (nT ) + x (nT + T )z n ] = lim n (z 1) (z 1) 1 (z 1) x ( K T ) + K +1 x ( K T + T ) + + x (nT ) + n x (nT + T ) zK z zn z (3.13) Now from Eqs. (3.12) and (3.13), we can write lim (z 1) X (z ) = lim lim z 1 n z 1 (z 1) 1 (z 1) x (K T ) + + x (nT ) + n x (nT + T ) K n z z z (z 1) 1 (z 1) x (K T ) + + x (nT ) + n x (nT + T ) zK zn z = lim lim n n z 1 = lim x (nT + T ) Therefore, x () = lim [(z 1) X (z )] z 1 The nal-value theorem can be used to determine the steady-state value of a signal in the case where this is nite. Theorem 3.10 Complex Convolution If the z transforms of two discrete-time signals x1 (nT ) and x2 (nT ) are available, then the z transform of their product, X3 (z ), can be obtained as X3 (z ) = Z [x1 (nT )x2 (nT )] = = 1 2 j 1 2 j X1 (v) X2 X1 z 1 v dv v (3.14a) (3.14b) 1 2 z X2 (v)v1 d v v where 1 (or 2 ) is a contour in the common region of convergence of X1 (v) and X2 (z /v) (or X1 (z /v) and X2 (v)). The two contour integrals in the above equations are equivalent. 92 DIGITAL SIGNAL PROCESSING Proof From the denition of the z transform and Eq. (3.6), we can write X 3 (z ) = [x1 (nT )x2 (nT )]z n 1 2 j X 2 (v )v n 1 d v z n 2 n = = n = x1 (nT ) 1 2 j 1 2 j = = x1 (nT ) 2 n = z v n X 2 (v )v 1 d v X1 2 z v X 2 (v )v 1 d v The order of integration and summation has been interchanged in the last but one line and this is, of course, permissible if contour 2 satises the condition stated in the theorem. The obvious application of Theorem 3.10 is in obtaining the z transform of a product of discrete-time signals whose z transforms are available. The theorem is also vital in the design of nonrecursive digital lters, as will be shown in Chap. 9. Like the contour integral for the inverse z transform, those in Eq. (3.14) appear quite challenging. However, the most difcult aspect in their evaluation relates to identifying the common region of convergence alluded to in the theorem. Once this is done, what remains is to nd the residues of X 1 (z /v ) X 2 (v )v 1 or X 1 (z /v ) X 2 (v )v 1 at the poles that are encircled by contour 1 or 2 , which can be added to give the complex convolution. The complex convolution can be evaluated through the following step-by-step technique: 1. Obtain the zero-pole plots of X 1 (z ) and X 2 (z ) and identify the region of convergence for each, as in Fig. 3.5a and b. 2. Identify which of the two z transforms has the larger radius of convergence. If that of X 1 (z ) is larger, evaluate the contour integral in Eq. (3.14a); otherwise, evaluate the integral in Eq. (3.14b). In Fig. 3.5, X 1 (z ) has a larger radius of convergence than X 2 (z ) and hence the appropriate integral is the one in Eq. (3.14a). 3. Replace z by v in X 1 (z ) and z by z /v in X 2 (z ). Switch over from the z plane to the v plane at this point and plot the regions of convergence in the v plane. This can be accomplished as in Fig. 3.5c and d . The region of convergence in Fig. 3.5c is identical with that in Fig. 3.5a since the only change involved is a change in the name of the variable. In Fig. 3.5d , however, a so-called conformal mapping (or transformation) (see Sec. A.9) is involved. We note that if v , then z /v 0 and if v 0, then z /v ; therefore, the region outside (inside) the radius of convergence in Fig. 3.5b maps onto the region inside (outside) the radius of convergence in Fig. 3.5d , as shown. 4. Since the radius of convergence in Fig. 3.5b has been assumed to be smaller than that in Fig. 3.5a , it follows that the radius of the shaded region in Fig. 3.5d is larger than that of the unshaded region in Fig. 3.5c. The area that appears shaded in both Fig. 3.5c and d , illustrated in Fig. 3.5e, is the common region of convergence of the product X 1 (z /v ) X 2 (v )v 1 . THE Z TRANSFORM 93 X1(z) z plane X2(z) z plane (a) X1(v) (b) v plane X2(z/v) v plane (c) (d ) v plane Common region of convergence. (e) Figure 3.5 Complex convolution. 5. The integral is found by identifying the poles of X 1 (z /v ) X 2 (v )v 1 that are located inside the inner circle in Fig. 3.5e, nding the residues at these poles, and adding them up. The technique is illustrated by Example 3.2 in Sec. 3.7. In certain applications, contour 1 or 2 can be a circle in the common region of convergence and hence we can write v = e j and z = r e j . In these applications, the above complex convolution integrals become real-convolution integrals. For example, Eq. (3.14b) gives X 3 (r e j ) = (see Prob. 3.6, part (a )). 1 2 2 X1 0 r j ( ) e X 2 ( e j ) d (3.15) 94 DIGITAL SIGNAL PROCESSING Theorem 3.11 Parsevals Discrete-Time Formula If X (z ) is the z transform of a discretetime signal x (nT ), then |x (nT )|2 = n= 1 s s 0 | X (e j T )|2 d (3.16) where s = 2/ T . Proof Parsevals discrete-time formula can be derived from the complex-convolution theorem. Although the discrete-time signal x (nT ) has been implicitly assumed to be real so far, the z transform can be applied to a complex signal x (nT ) just as well as long as X (z ) converges. Consider a pair of complex-conjugate signals x1 (nT ) and x2 (nT ) such that x1 (nT ) = x (nT ) and x2 (nT ) = x (nT ) We can write X 1 (z ) = X (z ) and (3.17a) (3.17b) (3.18a) X 2 (z ) = n = x (nT )z n = 1 n = x (nT )(z 1 )n (3.18b) = X (z ) From the complex-convolution theorem (Eq. (3.14a)) and the denition of the z transform, we get Z [x1 (nT )x2 (nT )] = Equations (3.17)(3.19) give n = 1 2 j X 1 (v ) X 2 1 z 1 v dv v (3.19) [x (nT )x (nT )]z n = 1 2 j X (v ) X 1 v 1 v dv z (3.20) and if we let z = 1, we obtain |x (nT )|2 = n = 1 2 j | X (v )|2 v 1 d v 1 Now if we let v = e j T , contour 1 becomes the unit circle and the contour integral becomes a regular integral whose lower and upper limits of integration become 0 and 2/ T , respectively. Simplifying, the real integral obtained yields Parsevals relation. THE Z TRANSFORM 95 For a normalized signal, namely, for the case where T = 1, s = 2/ T = 2 and hence Parsevals summation formula assumes the more familiar form |x (n )|2 = n = 1 2 2 0 | X (e j )|2 d Note, however, that this formula will give the wrong answer if applied to a signal which is not normalized. Parsevals formula is often used to solve a problem known as scaling, which is associated with the design of recursive digital lters in hardware form (see Chap. 14). 3.7 ELEMENTARY DISCRETE-TIME SIGNALS The analysis of analog systems is facilitated by using several elementary signals such as the unit impulse and the unit step. Corresponding discrete-time signals can be used for the analysis of DSP systems. Some of the basic ones are dened in Table 3.1 and are illustrated in Fig. 3.6. The discrete-time unit step, unit ramp, exponential, and sinusoid are generated by letting t = nT in the corresponding continuous-time signals. The discrete-time unit impulse (nT ), however, is generated by letting t = nT in the unit pulse function of Fig. 2.6a , which can be represented by the equation p (t ) = 1 0 for |t | /2 < T otherwise Note that (nT ) cannot be obtained from the continuous-time impulse (t ) which is usually dened as an innitely tall and innitesimally thin pulse (see Sec. 6.2.1). Nevertheless, the discreteand continuous-time impulse signals play more or less the same role in the analysis and representation of discrete- and continuous-time systems, respectively. Table 3.1 Elementary discrete-time signals Denition (nT ) = u (nT ) = r (nT ) = 1 0 1 0 nT 0 for n = 0 for n = 0 for n 0 for n < 0 for n 0 for n < 0 Function Unit impulse Unit step Unit ramp Exponential Exponential Sinusoid u (nT )e nT , ( > 0) u (nT )e nT , ( < 0) u (nT ) sin nT 96 DIGITAL SIGNAL PROCESSING 1.0 1.0 0 nT 0 nT (a) 8T (b) 4T 1.0 nT 0 nT (c) 1.0 (d) 1.0 0 nT 0 nT (e) (f) Figure 3.6 Elementary discrete-time functions: (a ) Unit impulse, (b) unit step, (c) unit ramp, (d ) increasing exponential, (e) decreasing exponential, (c) sinusoid. The application of the z transform to the elementary functions as well as to some other discretetime signals is illustrated by the following examples. Example 3.1 Find the z transforms of (a) (nT ), (b) u (nT ), (c) u (nT kT ) K , (d) u (nT ) K wn , (e) u (nT )enT , ( f ) r (nT ), and (g) u (nT ) sin nT (see Table 3.1). Solution (a ) From the denitions of the z transform and (nT ), we have Z (nT ) = (0) + (T )z 1 + (2T )z 2 + = 1 (b) As in part (a ) Z u (nT ) = u (0) + u (T )z 1 + u (2T )z 2 + = 1 + z 1 + z 2 + THE Z TRANSFORM 97 The series at the right-hand side is a binomial series of (1 z 1 )1 , (see Eq. (A.47)). Hence, we have Z u (nT ) = (1 z 1 )1 = z z1 (c) From the time-shifting theorem (Theorem 3.4) and part (b), we have Z [u (nT kT ) K ] = K z k Z u (nT ) = K z (k 1) z1 (d ) From the complex-scale-change theorem (Theorem 3.5) and part (b), we get Z [u (nT ) K w n ] = K Z 1 w n u (nT ) Kz zw = K Z u (nT )|z z /w = (e) By letting K = 1 and w = e T in part (d ), we obtain Z [u (nT )enT ] = z z e T ( f ) From the complex-differentiation theorem (Theorem 3.6) and part (b), we have Z r (nT ) = Z [nT u (nT )] = T z = T z (g ) From part (e), we deduce Z [u (nT ) sin nT ] = Z = = = u (nT ) j nT e e j nT 2j d [Z u (nT )] dz d z Tz = dz (z 1) (z 1)2 1 1 Z [u (nT )e j nT ] Z u (nT )e j nT 2j 2j 1 2j z z j T ze z e j T z sin T z 2 2z cos T + 1 98 DIGITAL SIGNAL PROCESSING Example 3.2 Find the z transform of x3 (nT ) = u (nT )enT sin nT where < 0. Solution Evidently, we require the z transform of a product of signals and, therefore, this is a clear case for the complex convolution of Theorem 3.10. Let x1 (nT ) = u (nT ) sin nT and x2 (nT ) = u (nT )enT From Example 3.1, parts (g ) and (e), we have X 1 (z ) = (z e j T )(z z sin T e j T ) and X 2 (z ) = z z e T We note that X 1 (z ) has a complex-conjugate pair of poles at e j T whereas X 2 (z ) has a real pole at z = e T . Since |e j T | = 1, the radius of convergence of X 1 (z ) is unity and with assumed to be negative, the radius of convergence of X 2 (z ) is less than unity. Thus, according to the evaluation technique described earlier, the correct formula to use is that in Eq. (3.14a) and, by a lucky coincidence, the mappings in Fig. 3.5 apply. Now X 1 (v ) = v sin T (v e j T ) e j T )(v and thus it has poles at v = e j T . On the other hand, X 2 (z /v ) = z z e T = z /v ze T = T z /v e v ze T z z /v and, as a result, it has a pole at v = ze T . Hence the common region of convergence of X 1 (v ) and X 2 (z /v ) is the annulus given by 1 < |v | < ze T as depicted in Fig. 3.7. Therefore, the complex convolution assumes the form X 3 (z ) = 1 2 j X 1 (v ) X 2 1 z 1 v dv v 1 = 2 j 1 ze T sin T dv (v ze T )(v e j T )(v e j T ) THE Z TRANSFORM 99 1 v plane 1 T |zeT| Figure 3.7 Complex convolution (Example 3.2). where 1 is a contour in the annulus of Fig. 3.7. By evaluating the residues of the integrand at v = e+ j T and e j T , we obtain X 3 (z ) = ze T sin T (v ze T )(v e j T ) + = ze sin T (v ze T )(v e j T ) T T v =e j T v =e j T sin T ze z 2 2ze T cos T + e2 T The radius of convergence of X 3 (z ) is equal to the magnitude of the poles, which is given by the above equation as e2 T = e T . Alternatively, the annulus of convergence in Fig. 3.7 exists, if |ze T | > 1, that is, X 3 (z ) converges if |z | > e T . The above approach was used primarily to illustrate the complex-convolution theorem which happens to be quite important in the design of nonrecursive lters (see Chap. 9). A simpler approach for the solution of the problem at hand would be to use the complexscale-change theorem (Theorem 3.5), as will now be demonstrated. From Example 3.1, part (g ), we have Z [u (nT ) sin nT ] = z sin T 2z cos T + 1 z2 100 DIGITAL SIGNAL PROCESSING and from the complex-scale-change theorem, we can write Z [w n x (nT )] = X (w z ) Hence Z [u (nT )w n sin nT ] = = Now with w = e T , we deduce Z [u (nT )enT sin nT ] = z2 ze T sin T 2ze T cos T + e2 T (w z )2 w z sin T 2(w z ) cos T + 1 z w 1 sin T z 2 2z w 1 cos T + w 2 A list of the common z transforms is given in Table 3.2. A fairly extensive list can be found in the work of Jury [1]. Table 3.2 Standard z transforms x (nT ) (nT ) u (nT ) u (nT kT ) K u (nT ) K w n u (nT kT ) K w n 1 u (nT )enT r (nT ) r (nT )enT u (nT ) sin nT u (nT ) cos nT u (nT )enT sin nT u (nT )enT cos nT X (z ) 1 z z1 K z (k 1) z1 Kz zw K (z /w )(k 1) zw z z e T Tz (z 1)2 T e T z (z e T )2 z sin T z 2 2z cos T + 1 z (z cos T ) 2 2z cos T + 1 z ze T sin T z 2 2ze T cos T + e2 T z (z e T cos T ) 2 2ze T cos T + e2 T z THE Z TRANSFORM 101 3.8 Z -TRANSFORM INVERSION TECHNIQUES The most fundamental method for the inversion of a z transform is of course the general inversion method described in Sec. 3.5 since this is part and parcel of the Laurent theorem (Theorem A.4). If X (z )z n 1 has only rst- or second-order poles, the residues are relatively easy to evaluate. However, certain pitfalls can arise that could cause errors. To start with, if X (z ) does not have a zero at the origin, the presence of z n 1 in X (z )z n 1 will introduce a rst-order pole at the origin for n = 0, and this pole disappears for n > 0. This means that one would need to carry out two sets of calculations, one set to obtain x (nT ) for n = 0 and one set to obtain x (nT ) for n > 0. This problem is illustrated in the following example. Example 3.3 Using the general inversion method, nd the inverse z transforms of (2z 1)z 2(z 1) z + 1 X (z ) = 2(z 1) z + X (z ) = (a) (b) 1 2 1 2 Solution (a) We can write X ( z ) z n 1 = (2z 1)z z n 1 (2z 1)z n = 2(z 1) z + 1 2(z 1) z + 2 1 2 We note that X (z )z n 1 has simple poles at z = 1 and 1 . Furthermore, the zero 2 in X (z ) at the origin cancels the pole at the origin introduced by z n 1 for the case n = 0. Hence for any n 0, Eq. (3.8) gives x (nT ) = Res X (z )z n 1 + Res X (z )z n 1 z =1 z = 1 2 = = (2z 1)z n 2 z+1 2 12 + 33 + 1 2 z =1 n (2z 1)z n 2(z 1) z = 1 2 Since the numerator degree in X (z ) does not exceed the denominator degree, x (nT ) is a one-sided signal, i.e., x (nT ) = 0 for n < 0, according to the Corollary of Theorem 3.8. Therefore, for any value of n , we have x (nT ) = u (nT ) 1 3 + 2 3 1 2 n 102 DIGITAL SIGNAL PROCESSING (b) In this z transform, X (z ) does not have a zero at the origin and, as a consequence, z n 1 introduces a pole in X (z )z n 1 at the origin for the case n = 0, which must be taken into account in the evaluation of x (0). Thus for n = 0, we have X (z )z n 1 Hence x (0) = 1 2(z 1) z + + 1 2z (z 1) 1 2 n =0 = z n 1 2(z 1) z + 1 2 = n =0 1 2z (z 1) z + 1 2 + z =0 1 2z z + 1 3 1 2 2 3 z =1 1 z = 2 = 1 + + =0 Actually, this work is unnecessary. The initial-value theorem (Theorem 3.8), gives x (0) = 0 without any calculations. On the other hand, for n > 0 x (nT ) = = z n 1 2 z+1 2 1 3 + z =1 n 1 z n 1 2(z 1) z = 1 2 1 3 1 2 and as in part (a ), x (nT ) = 0 for n < 0. Thus, for any value of n , we have x (nT ) = u (nT T ) 1 3 1 3 1 2 n 1 The general inversion method tends to become somewhat impractical for z transforms of twosided signals whereby x (nT ) is nonzero for negative values of n . For such z transforms, X (z )z n 1 has a higher-order pole at the origin whose order is increased as n is made more negative. And the residue of such a pole is more difcult to evaluate since a higher-order derivative of a rational function in z needs to be calculated. However, the problem can be easily circumvented by using some other available inversion techniques, as will be shown next. Owing to the uniqueness of the Laurent series in a given annulus of convergence, any technique that can be used to generate a power series for X (z ) that converges in the outermost annulus of convergence given by Eq. (3.7) can be used to obtain the inverse z transform. Several such techniques are available, for example, by using binomial series, using the convolution theorem, performing long division, using the initial-value theorem (Theorem 3.8), or expanding X (z ) into partial fractions. THE Z TRANSFORM 103 3.8.1 Use of Binomial Series A factor (1 + b)r , where r is a positive or negative integer, can be expressed in terms of the binomial series given by Eq. (A.47) and by letting r = 1 in Eq. (A.47), we obtain (1 + b)1 = 1 + (b) + b2 + (b)3 + and if we replace b by b in Eq. (3.21a), we get (1 b)1 = [1 + (b)]1 = 1 + b + b2 + b3 + (3.21b) (3.21a) By applying the ratio test of Theorem A.3, the series in Eqs. (3.21a) and (3.21b) are found to converge for all values of b such that |b| < 1. Thus if b = w/z , the series converges for all values of z such that |z | > |w | and if b = z /w, then it converges for all values of z such that |z | < |w |. By expressing X (z ) in terms of factors such as the above with either b = w/z or b = z /w as appropriate and then replacing the factors by their binomial series representations, all the possible Laurent series for X (z ) centered at the origin can be obtained. If we have b = w/z in all the factors then the above series as well as the series obtained for X (z ) converge in the outermost annulus |w | |z | R for R which makes the series a z transform by denition. If we have b = z /w in all the factors, then their series and the series obtained for X (z ) converge in the innermost annulus, namely, R0 |z | |w | for R0 0 On the other hand, if we have b = w/z in some factors and b = z /w in others, then the series obtained for X (z ) will converge in one of the in-between annuli of convergence. Example 3.4 Using binomial series, nd the inverse z transform of X (z ) = K zm ( z w )k where m and k are integers, and K and w are constants, possibly complex. Solution The inverse z transform can be obtained by nding the Laurent series that converges in the outermost annulus and then identifying the coefcient of z n , which is x (nT ) by denition. Such a series can be obtained by expressing X (z ) as X (z ) = K z m k [1 + (w z 1 )]k = K z m k 1 + + + k k (w z 1 )2 (w z 1 ) + 2 1 k (w z 1 )n + n 104 DIGITAL SIGNAL PROCESSING where k n = k (k 1) . . . (k n + 1) n! according to Eq. (A.48). Now if we let n = n + m k and then replace n by n , we have X (z ) = n = K u [(n + m k )T ] (k )(k 1) (n m + 1)(w)n +m k n z (n + m k )! K zm (z w )k Hence the inverse z transform, which is the coefcient of z n , is obtained as x (nT ) = Z 1 = K u [(n + m k )T ] (k )(k 1) (n m + 1)(w )n +m k (n + m k )! Incidentally, this is a fairly general inverse z transform since seven of the twelve inverse z transforms in Table 3.2 can be derived from it by choosing suitable values for the constants k , K , and m . Example 3.5 (a ) Using binomial series, nd all the Laurent series of X (z ) = (z 2 4) z (z 2 1)(z 2 + 4) (3.22) with center at the origin of the z plane. (b) Identify which Laurent series of X (z ) is a z transform. Solution The zero-pole plot of X (z ) depicted in Fig. 3.3a has three distinct annuli of convergence, namely, AI , AII , and AIII as illustrated in Fig. 3.3d . The radius of the inner circle of annulus AI can be reduced to zero and that of the outer circle of annulus AIII can be increased to innity. Thus three Laurent series can be obtained for this function, one for each annulus. Annulus AI : To obtain the Laurent series for the innermost annulus of convergence in Fig. 3.3d , that is, AI , X (z ) must be expressed in terms of binomial series that converge for values of z in the annulus R0 < |z | < 1 where R0 0. Equation (3.22) can be THE Z TRANSFORM 105 expressed as X (z ) = = = (z 2 4) z (z 2 1)(z 2 + 4) (z 2 4) 4z (1 z 2 )(1 + z 2 /4) (z 2 4)(1 z 2 )1 (1 + z 2 /4)1 4z (3.23) From Eqs. (3.21b) and (3.21a), we have (1 z 2 )1 = 1 + z 2 + (z 2 )2 + + (z 2 )n + and (1 + z 2 /4)1 = [1 (z 2 /4)]1 = 1 + (z 2 /4) + (z 2 /4)2 + + (z 2 /4)k + (3.24b) (3.24a) respectively. Since both of the above series converge and (z 2 2)/(4z ) is nite for 0 < |z | < 1, the substitution of Eqs. (3.24a) and (3.24b) into Eq. (3.23) will yield a series representation for X (z ) that converges in annulus AI . We can write X (z ) = = = (z 2 4)(1 z 2 )1 (1 + z 2 /4)1 4z (z 2 4) [1 + z 2 + + (z 2 )n + ] [1 + (z 2 /4) + + (z 2 /4)k + ] 4z z2 4 4z (z 2 )n n =0 k =0 z2 4 k and after some routine algebraic manipulation, the series obtained can be expressed as X (z ) = z where n 1 + n =1 Cn z 2n 1 (3.25) Cn = 1 + 2 k =1 1 4 k 106 DIGITAL SIGNAL PROCESSING The sum in the formula for Cn is a geometric series with a common ratio of 1/4 and hence it can be readily evaluated as n 1 4 k =1 k = 1 1 1 5 4 n (see Eq. (A.46b)). Thus Cn = 1 5 3 + 2 1 4 n and on calculating the coefcients, the series in Eq. (3.25) assumes the form X (z ) = + 19 5 z 32 + 5 z 3 + 1 z + z 1 8 2 (3.26) Annulus AII (see Fig. 3.3d ): A series that converges in annulus AII , that is, 1 < |z | < 2, can be obtained in the same way. Equation (3.22) can be expressed as X (z ) = = = where (1 1/z 2 )1 = 1 + (1/z 2 ) + (1/z 2 )2 + + (1/z 2 )n + (3.28) (z 2 4) z (z 2 1)(z 2 + 4) (z 2 4) 4z 3 (1 1/z 2 )(1 + z 2 /4) (z 2 4)(1 1/z 2 )1 (1 + z 2 /4)1 4z 3 (3.27) and (1 + z 2 /4)1 can be expressed in terms of the binomials series in Eq. (3.24b). The series in Eqs. (3.24b) and (3.28) converge in the region 1 < |z | < 2, as can be easily shown by using the ratio test, and since (z 2 4)/4z 3 is nite for |z | > 0, and from Eq. (3.27) a series representation for X (z ) for annulus AII can be obtained as X (z ) = (z 2 4)(1 1/z 2 )1 (1 + z 2 /4)1 4z 3 (z 2 4) = [1 + (1/z 2 ) + + (1/z 2 )n + ] 4z 3 [1 + (z 2 /4) + + (z 2 /4)k + ] = z2 4 4z 3 n =0 k =0 1 z2 n z2 4 k THE Z TRANSFORM 107 After some manipulation and some patience, the series obtained can be simplied to X (z ) = n =1 E n z 2n 3 3 z (2n +1) 5 (3.29) where En = 2 5 1 4 n 1 If we calculate the numerical values of the coefcients in Eq. (3.29), we get X (z ) = + 13 z 40 1 z 10 + 2 z 1 3 z 3 3 z 5 5 5 5 (3.30) Annulus AIII (see Fig. 3.3d ): A series that converges in annulus AIII , that is, 2 < |z | < R , can be obtained by expressing X (z ) in Eq. (3.22) as X (z ) = = = where (1 + 4/z 2 )1 = [1 (4/z 2 )]1 = 1 + (4/z 2 ) + (4/z 2 )2 + + (4/z 2 )k + (3.32) and (1 1/z 2 )1 can be represented by the binomial series in Eq. (3.28). The series in Eqs. (3.28) and (3.32) converge in the region 2 < |z | < and since (z 2 4)/z 5 is nite for |z | < , a series representation for X (z ) for annulus AIII can be obtained from Eq. (3.31) as X (z ) = (z 2 4)(1 1/z 2 )1 (1 + 4/z 2 )1 z5 2 (z 4) = [1 + (1/z 2 ) + + (1/z 2 )n + ] z5 [1 + (4/z 2 ) + + (4/z 2 )k + ] z2 4 = z5 (z 2 4) z (z 2 1)(z 2 + 4) z 5 (1 (z 2 4) 1/z 2 )(1 + 4/z 2 ) (3.31) (z 2 4)(1 1/z 2 )1 (1 + 4/z 2 )1 z5 n =0 k =0 1 z2 n 4 z2 k 108 DIGITAL SIGNAL PROCESSING After quite a bit of algebra, one can show that X (z ) = n =0 G n z 2n 3 (3.33) where G n = Fn 4 Fn 1 with n Fn = k =0 (4)k = 1 5 1 (4)n +1 Hence Gn = 1 5 3 + 8(4)n and on evaluating the coefcients in Eq. (3.33), we get X (z ) = z 3 7z 6 + 25z 7 103z 9 + (3.34) (b) A comparison of Eqs. (3.26), (3.30), and (3.34) shows that the three Laurent series obtained for X (z ) are all linear combinations of positive and/or negative powers of z and are, in fact, quite similar to each other. Yet only the last one is a z transform that satises the absolute-convergence theorem (Theorem 3.1) since this is the only Laurent series that converges in the outermost annulus. 3.8.2 Use of Convolution Theorem From the real-convolution theorem (Theorem 3.7), we have Z 1 [ X 1 (z ) X 2 (z )] = x1 (kT )x2 (nT kT ) k = Thus, if a z transform can be expressed as a product of two z transforms whose inverses are available, then performing the convolution summation will yield the desired inverse. Using the real-convolution theorem, nd the inverse z transforms of X 3 (z ) = X 4 (z ) = z (z 1)2 z (z 1)3 Example 3.6 (a) (b) THE Z TRANSFORM 109 Solution (a ) Let X 1 (z ) = From Table 3.2, we can write x1 (nT ) = u (nT ) and x2 (nT ) = u (nT T ) z z1 and X 2 (z ) = 1 z1 and hence for n 0, the real convolution yields x3 (nT ) = k = x1 (kT )x2 (nT kT ) = k = k =1 k =0 u (kT )u (nT T kT ) = + u (T )u (nT ) + u (0)u (nT T ) k =1 k =n 1 + u (T )u (nT 2T ) + + u (nT T )u (0) k =n + u (nT )u (T ) + = 0 + 1 + 1 + + 1 + 0 = n For n < 0, we have x3 (nT ) = k = u (kT )u (nT T kT ) k =1 k =0 k =1 = + u (T )u (nT ) + u (0)u (nT T ) + u (T )u (nT 2T ) k =n 1 k =n + + u (nT T )u (0) + u (nT )u (T ) + and since all the terms are zero, we get x3 (nT ) = 0 Alternatively, by virtue of the initial-value theorem, we have x3 (nT ) = 0 since the numerator degree in X 3 (z ) is less than the denominator degree. Summarizing the results obtained, for any value of n , we have x3 (nT ) = u (nT )n (b) For this example, we can write X 1 (z ) = z (z 1)2 and X 2 (z ) = 1 z1 110 DIGITAL SIGNAL PROCESSING and from part (a ), we have x1 (nT ) = u (nT )n and x2 (nT ) = u (nT T ) For n 0, the convolution summation gives x3 (nT ) = k = ku (kT )u (nT T kT ) k =0 k =1 k =n 1 k =n = + 0 [u (nT T )] + 1 [u (nT 2T )] + + (n 1)u (0) + n u (T ) = +0 + 1 + 2 + + n 1 + 0 n 1 = k =1 k Now by writing the series 1, 2, . . . , n 1 rst in the forward and then in the reverse order and, subsequently, adding the two series number by number as follows a series of n 1 numbers, each of value n , is obtained: 1 2 3 n1 n2 n3 n n n n n1 1 n Hence, twice the above sum is equal to1 (n 1) n and thus n 1 x3 (nT ) = k =1 k = 1 n (n 1) 2 For n < 0, x3 (nT ) = 0, as in part (a ) and, therefore, n 1 x3 (nT ) = k =1 k = 1 u (nT )n (n 1) 2 3.8.3 Use of Long Division Given a z transform X (z ) = N (z )/ D (z ), a series that converges in the outermost annulus of X (z ) can be readily obtained by arranging the numerator and denominator polynomials in descending powers of z and then performing polynomial division, also known as long division. The method turns out to 1 Gauss is reputed to have astonished his mathematics teacher by obtaining the sum of the numbers 1 to 100 in just a few seconds by using this technique. THE Z TRANSFORM 111 be rather convenient for nding the values of x (nT ) for negative values of n for the case where the z transform represents a two-sided signal. However, the method does not yield a closed-form solution for the inverse z transform but the problem can be easily eliminated by using long division along with one of the methods that yield closed-form solutions for right-sided signals. The method is best illustrated by an example. Example 3.7 Using long division, nd the inverse z transform of X (z ) = 1 + 1 z 1 z 2 7 z 3 + 2z 4 + z 5 4 2 2 4 1 + 1 z z2 + z3 4 4 Solution The numerator and denominator polynomials can be arranged in descending powers of z as X (z ) = z 5 + 2z 4 7 z 3 1 z 2 + 1 z 4 2 2 z3 z2 + 1 z 4 1 4 1 4 Long division can now be carried out as follows: z 2 + 3 z + 1 + z 2 + z 3 z3 z2 + 1 z 4 1 4 z 5 + 2z 4 7 z 3 1 z 2 + 1 z 4 2 2 z 5 z 4 1 z 3 1 z 2 4 4 3z 4 8 z 3 1 z 2 + 1 z 4 4 2 3z 3z 4 3 32 z 4 1 4 1 4 3 z 4 z3 z2 + 5 z 4 z 3 z 2 1 z 4 1 4 1 4 z z 1 1 z 1 1 z 2 4 4 1 1 z 1 + 1 z 2 4 4 1 z 1 1 z 2 1 z 3 4 4 3 1 z 4 + 1 z 3 4 . . . 112 DIGITAL SIGNAL PROCESSING Hence X (z ) = z 2 + 3z + 1 + z 2 + z 3 + and, therefore, x (2T ) = 1 x (T ) = 3 x (0) = 1 x (T ) = 0 x (2T ) = 1, . . . In Example 3.7, one could obtain any number of signal values by continuing the long division but open-ended solutions such as the one obtained are not very convenient in practice. A better strategy would be to continue the long division until x (0) is obtained. At that point, X (z ) can be expressed in terms of the quotient plus the remainder as X (z ) = Q (z ) + R (z ) where R (z ) = The inverse z transform can then be obtained as x (nT ) = Z 1 [ Q (z ) + R (z )] = Z 1 Q ( z ) + Z 1 R ( z ) by virtue of the linearity of the inverse z transform. Since R (z ) represents a right-sided signal, its inverse Z 1 R (z ) can be readily obtained by using any inversion method that yields a closed-form solution, for example, the general inversion method. For the z transform in Example 3.7, we can write Q (z ) = z 2 + 3z + 1 Thus x (nT ) = Z 1 Q (z ) + Z 1 R (z ) = Z 1 (z 2 + 3z + 1) + Z 1 z3 z2 z + 1z 4 1 4 N (z ) D (z ) and R (z ) = z z3 z2 + 1 z 4 1 4 As may be recalled, the general inversion method is very convenient for nding x (nT ) for n > 0 but runs into certain complications for n 0. On the other hand, the long division method is quite straightforward for n 0 but does not give a closed-form solution for n > 0. A prudent strategy would, therefore, be to use the hybrid approach just described. THE Z TRANSFORM 113 It is important to note that if long division is performed with the numerator and denominator polynomials of X (z ) arranged in ascending instead of descending powers of z , a Laurent series is obtained that converges in the innermost annulus about the origin, i.e., for R0 r R where R0 0 and R is the radius of the circle passing through the pole nearest to the origin. Such a series is not considered to be a z transform in this textbook, as explained in Sec. 3.5. 3.8.4 Use of Initial-Value Theorem Theorem 3.8 can be used to nd the initial value of x (nT ), say, x ( K 0 T ). The term x ( K 0 T )z K 0 can then be subtracted from X (z ) to obtain X (z ) = X (z ) x ( K 0 T )z K 0 Theorem 3.8 can then be used again to nd the initial value of x (nT ), say, x ( K 1 T ). The term x ( K 1 T )z K 1 can then be subtracted from X (z ) to obtain X (z ) = X (z ) x ( K 1 T )z K 1 and so on. This method, just like the long-division method, is useful for obtaining the values of x (nT ) for negative values of n but, like long division, it does not yield a closed-form solution. Find x (nT ) for n 0 for X (z ) = Solution Example 3.8 3z 5 + 2z 4 2z 3 2z 2 z + 4 z2 1 Since the numerator degree in X (z ) exceeds the denominator degree, x (nT ) is nonzero for some negative values of n . From Theorem 3.8, the rst nonzero value of x (nT ) occurs at K T = ( N M )T = (2 5)T = 3T i.e., K = 3, and the signal value is given by x (3T ) = lim X (z ) 3z 5 + 2z 4 2z 3 2z 2 z + 4 = 3 z (z 2 1)z 3 z = lim 3z 5 =3 z z 5 114 DIGITAL SIGNAL PROCESSING Now if we subtract 3z 3 from X (z ) and then apply Theorem 3.8 again, the second nonzero value of x (nT ) can be deduced. We can write X (z ) 3z 3 = = = Hence K T = ( N M )T = (2 4)T = 2T and x (2T ) = lim = lim [ X (z ) 3z 3 ] 2z 4 + z 3 2z 2 z + 4 = lim z z z2 (z 2 1)z 2 2z 4 =2 z z 4 [ X (z ) 3z 3 2z 2 ] z z 2z 4 + z 3 2z 2 z + 4 2z 2 = lim z z2 1 3z 5 + 2z 4 2z 3 2z 2 z + 4 3z 3 z2 1 3z 5 + 2z 4 2z 3 2z 2 z + 4 3z 5 + 3z 3 z2 1 2z 4 + z 3 2z 2 z + 4 z2 1 Proceeding as before, we can obtain x (T ) = lim 1 z = lim 2z 4 + z 3 2z 2 z + 4 2z 4 + 2z 2 z (z 2 1)z z = lim and z3 z + 4 =1 (z 2 1)z x (0) = lim X (z ) 3z 3 2z 2 z z = lim z z3 z + 4 z (z 2 1) z3 z + 4 z3 + z (z 2 1) (z 2 4 =0 1) = lim z = lim z THE Z TRANSFORM 115 3.8.5 Use of Partial Fractions If the degree of the numerator polynomial in X (z ) is equal to or less than the degree of the denominator polynomial, the inverse of X (z ) can very quickly be obtained through the use of partial fractions. Two techniques are available, as detailed next. Technique I: The function X (z )/z can be expanded into partial fractions as X (z ) R0 = + z z where P is the number of poles in X (z ) and R0 = lim X (z ) z 0 P i =1 Ri z pi Ri = Res z = pi X (z ) z Hence P X ( z ) = R0 + i =1 Ri z z pi (3.35) and P x (nT ) = Z 1 Now from Table 3.2, we get R0 + i =1 Ri z z pi P = Z 1 R 0 + i =1 Z 1 Ri z z pi P x (nT ) = R0 (nT ) + i =1 u (nT ) Ri pin Technique II: An alternative approach is to expand X (z ) into partial fractions as P X ( z ) = R0 + i =1 Ri z pi (3.36) where R0 = lim X (z ) z Ri = Res X (z ) z = pi and P is the number of poles in X (z ) as before. Thus P x (nT ) = Z 1 R0 + i =1 P Ri z pi Ri z pi = Z 1 R 0 + i =1 Z 1 116 DIGITAL SIGNAL PROCESSING and, therefore, Table 3.2 gives P X (nT ) = R0 (nT ) + i =1 u (nT T ) Ri pin 1 Note that in a partial-fraction expansion, complex-conjugate poles give complex-conjugate residues. Consequently, one need only evaluate one residue for each pair of complex-conjugate poles. Note also that if the numerator degree in X (z ) is equal to the denominator degree, then the constant R0 must be present in Eqs. (3.35) and (3.36). If the numerator degree exceeds the denominators degree, one could perform long division until a remainder is obtained in which the numerator degree is equal to or less than the numerator degree as was done in Sec. 3.8.3. The inversion can then be completed by expanding the remainder function into partial fractions. It should be mentioned here that the partial-fraction method just described is very similar to the general inversion method of Sec. 3.8 in that both methods are actually techniques for obtaining Laurent series, the difference being that the general inversion method yields a Laurent series for X (z )z n 1 whereas the partial-fraction method yields a Laurent series of X (z ). However, there is a subtle difference between the two: The general inversion method is complete in itself whereas in the partial-fraction method it is assumed that the inverse z transforms of R0 are known. Ri z pi z Ri z pi Example 3.9 Using the partial-fraction method, nd the inverse z transforms of z +z+ 1 2 z X (z ) = z1 z 2 X (z ) = z2 (a) (b) 1 4 Solution (a ) On expanding X (z )/z into partial fractions as in Eq. (3.35), we get 1 X (z ) =2 z z +z+ where e j 3/4 p1 = 2 and p2 = e j 3/4 2 1 2 = R1 1 R2 = + (z p1 )(z p2 ) z p1 z p2 (3.37) THE Z TRANSFORM 117 Thus we obtain R1 = Res z = p1 X (z ) = j z and R2 = Res z = p2 X (z ) =j z i.e., complex-conjugate poles give complex-conjugate residues, and so Eq. (3.37) gives X (z ) = From Table 3.2, we now obtain n n x (nT ) = u (nT ) j p1 + j p2 jz jz + z p1 z p2 = =2 1 n /2 2 1 2 1 j 3 n /4 e e j 3 n /4 j 3 n n /2 u (nT ) sin 4 u (nT ) Alternatively, we can expand X (z ) into partial fractions using Eq. (3.36) as shown in part (b). (b) X (z ) can be expressed as X (z ) = where R0 = lim X (z ) = lim z z z 1 2 z 1 4 = R0 + R1 R2 + z1 z1 2 4 (3.38) z z 1 2 z z 1 4 = lim z 1 =0 z z z z z 1 4 R1 = Res X (z ) = 1 z= 2 =2 z= 1 2 R2 = Res X (z ) = z= 1 4 1 2 = 1 z= 1 4 Hence Eq. (3.38) gives X (z ) = 2 z 1 2 + 1 z1 4 118 DIGITAL SIGNAL PROCESSING and from Table 3.2 x (nT ) = 4u (nT T ) 1n 2 1n 4 And something to avoid. Given a z transform X (z ), one could represent the residues by variables, then generate a number of equations, and after that solve them for the residues. For example, given the z transform X (z ) = one could write X ( z ) = R0 + R2 R1 + z1 z2 R1 z 2 R1 + R2 z R2 + R0 (z 1)(z 2) = (z 1)(z 2) R1 z 2 R1 + R2 z R2 + R0 (z 2 3z + 2) (z 1)(z 2) R1 z 2 R1 + R2 z R2 + R0 z 2 3 R0 z + 2 R0 (z 1)(z 2) R0 z 2 + ( R1 + R2 3 R0 ) z 2 R1 R2 + 2 R0 (z 1)(z 2) (3.40) z2 2 (z 1)(z 2) (3.39) = = = One could then equate coefcients of equal powers of z in Eqs. (3.39) and (3.40) to obtain z2 : R0 = 1 z 1 : 3 R0 + R1 + R2 = 0 z 0 : 2 R0 2 R1 R2 = 2 Solving this system of equations would give the correct solution as R0 = 1 R1 = 1 R2 = 2 (3.41) For a z transform with six poles, a set of six simultaneous equations with six unknowns would need to be solved. Obviously, this is a very inefcient method, and it should denitely be avoided. The quick solution for this example is easily obtained by evaluating the residues individually, as follows: R0 = z2 2 (z 1)(z 2) =1 R1 = z2 2 (z 2) =1 R2 = z2 2 (z 1) =2 z = z =1 z =2 THE Z TRANSFORM 119 3.9 SPECTRAL REPRESENTATION OF DISCRETE-TIME SIGNALS This section examines the application of the z transform as a tool for the spectral representation of discrete-time signals. 3.9.1 Frequency Spectrum A spectral representation for a discrete-time signal x (nT ) can be obtained by evaluating its z transform X (z ) at z = e j T , that is, by letting X (z ) z =e j T = X (e j T ) Evidently, this substitution will give a function of the frequency variable , which turns out to be complex. The magnitude and angle of X (e j T ), that is, A() = | X (e j T )| and () = arg X (e j T ) dene the amplitude spectrum and phase spectrum of the discrete-time signal x (nT ), respectively, and the two together dene the frequency spectrum. The exponential function e j T is a complex number of magnitude 1 and angle T and as is increased from zero to 2/ T , e j T will trace a circle of radius 1 in the z plane, which is referred to as the unit circle. Thus evaluating the frequency spectrum of a discrete-time signal at some frequency amounts to evaluating X (z ) at some point on the unit circle, say, point B , in Fig. 3.8. Some geometrical features of the z plane are of signicant practical interest. For example, zero frequency, that is, = 0, corresponds to the point z = e j T |=0 = e0 = 1, that is, point A in j Im z z plane B 1 C 1 T A 1 Re z Figure 3.8 Evaluation of frequency spectrum of a discrete-time signal. 120 DIGITAL SIGNAL PROCESSING Fig. 3.8; half the sampling frequency, i.e., s /2 = / T , which is known as the Nyquist frequency, corresponds to the point z = e j T |=/ T = e j = 1, that is, point C ; and the sampling frequency corresponds to the point z = e j T |=2/ T = e j 2 = 1, that is, point A, which is also the location for zero frequency. The frequency spectrum of a discrete-time signal can be determined very quickly through the use of MATLAB, the authors DSP software package D-Filter, or other similar software. 3.9.2 Periodicity of Frequency Spectrum If frequency is changed to + k s where k is an integer, then e j (+k s )T = e j ( T +2k ) = e j T e j 2k = e j T (cos 2k + j sin 2k ) = e j T Thus X (z ) or X (e j (+k s )T ) = X (e j T ) i.e., the frequency spectrum of a discrete-time signal is a periodic function of frequency with period s . This actually explains why the sampling frequency corresponds to the same point as zero frequency in the z plane, namely, point A in Fig. 3.8. The frequency range between s /2 and s /2 is often referred to as the baseband. To consolidate these ideas, let us obtain spectral representations for the discrete-time signals that can be generated from the continuous-time signals of Examples 2.5 and 2.10 through the sampling process. Example 3.10 The pulse signal of Example 2.5 (see Fig. 2.6a ) is sampled using a sampling frequency of 100 rad/s to obtain a corresponding discrete-time signal x (nT ). Find the frequency spectrum of x (nT ) assuming that = 0.5 s. Solution z =e j (+k s )T = X (z ) z =e j T The sampling period is T= 2 2 = 0.062832 s = s 100 Hence from Fig. 2.6a , we note that there are int T = int 0.5 0.062832 =7 THE Z TRANSFORM 121 Time domain 1.6 1.4 1.2 1.0 x (nT ) 0.8 0.6 0.4 0.2 0 -20 -10 0 Time, s 10 20 (a) Amplitude spectrum 8 7 6 Magnitude 5 4 3 2 1 0 -50 0 Frequency, rad/s 50 Phase angle, rad 0 - 0.5 -1.0 -1.5 -2.0 -2.5 -3.0 -3.5 - 4.0 -50 0 Frequency, rad/s 50 Phase spectrum (b) (c) Figure 3.9 Frequency spectrum of discrete-time pulse signal (Example 3.10): (a ) Discrete-time pulse, (b) amplitude spectrum, (c) phase spectrum. samples in the range /2 to /2, as illustrated in Fig. 3.9a . Thus the required discretetime signal can be expressed as x (nT ) = 1 0 for 3 n 3 otherwise 122 DIGITAL SIGNAL PROCESSING From the denition of the z transform, we get 3 X (z ) = n = x (nT )z n = n =3 z n The frequency spectrum of the signal is obtained as X (e j T ) = 1 + (e j T + e j T ) + (e j 2 T + e j 2 T ) + (e j 3 T + e j 3 T ) = 1 + 2 cos T + 2 cos 2 T + 2 cos 3 T Hence the amplitude and phase spectrums of x (nT ) are given by A() = |1 + 2 cos T + 2 cos 2 T + 2 cos 3 T | and () = 0 if X (e j T ) 0 otherwise respectively. Their plots are depicted in Fig. 3.9b and c. Example 3.11 The z transform of the discrete-time signal x (nT ) = u (nT )enT sin 0 nT (see Example 2.10) where and 0 are positive constants and u (nT ) = 1 0 for n 0 for n < 0 is the discrete-time unit-step function can be obtained as X (z ) = ze T sin 0 T z 2 2ze T cos 0 T + e2 T (see Table 3.2). Deduce the frequency spectrum. Solution The given z transform can be expressed as X (z ) = a1 z z 2 + b1 z + b0 THE Z TRANSFORM 123 where a1 = e T sin 0 T b0 = e2 T b1 = 2e T cos 0 T The frequency spectrum of x (nT ) can be obtained by evaluating X (z ) at z = e j T , that is, X (e j T ) = = = e j 2 T a1 e j T + b 1 e j T + b0 a1 e j T cos 2 T + j sin 2 T + b1 cos T + jb1 sin T + b0 a1 e j T b0 + b1 cos T + cos 2 T + j (b1 sin T + sin 2 T ) = A()e j () where A() = = = |a1 | |e j T | |(b0 + b1 cos T + cos 2 T ) + j (b1 sin T + sin 2 T )| |a1 | (b0 + b1 cos T + cos 2 T )2 + (b1 sin T + sin 2 T )2 |a1 | 2 2 1 + b0 + b1 + 2b1 (1 + b0 ) cos T + 2b0 cos 2 T (See Eq. (A.32b).) Since T > 0, we have () = arg(a1 ) + arg e j T arg[b0 + b1 cos T + cos 2 T + j (b1 sin T + sin 2 T )] b1 sin T + sin 2 T = arg a1 + T tan1 b0 + b1 cos T + cos 2 T where arg a1 = 0 if 0 otherwise (See Eq. (A.32c).) The amplitude and phase spectrums of the discrete-time signal are illustrated in Fig. 3.10 for the case where = 0.4 and 0 = 2.0 rad/s assuming a sampling frequency s = 2/ T = 10 rad/s. 124 DIGITAL SIGNAL PROCESSING Amplitude spectrum 4.5 4.0 3.5 3.0 Magnitude 2.5 2.0 1.5 1.0 0.5 0 -5 4 3 2 Phase angle, rad 1 0 -1 -2 -3 -4 -5 Phase spectrum 0 Frequency, rad/s (a) 5 0 Frequency, rad/s (b) 5 Figure 3.10 Frequency spectrum of discrete-time decaying sinusoidal signal (Example 3.11, = 0.4, 0 = 2.0 rad/s, and s = 10 rad/s): (a ) Amplitude spectrum, (b) phase spectrum. The amplitude and phase spectrums of the discrete-time decaying sinusoidal signal of Example 3.11 over the frequency range 3s /2 to 3s /2 with s = 20 rad/s are depicted in Fig. 3.11. As expected, the frequency spectrum is periodic with period s = 20 rad/s. 3.9.3 Interrelations In the two examples presented in the preceding section, we have examined discrete-time signals that were obtained by sampling the continuous-time signals in Examples 2.5 and 2.10. If we compare the frequency spectrums of the discrete-time signals with those of the corresponding continuoustime signals (i.e., Fig. 2.7a and b with Fig. 3.9b and c and Fig. 2.11b and c with Fig. 3.10a and b), we note a strong resemblance between the two. Since the former are derived from the latter, it is reasonable to expect that some mathematical relation must exist between the two sets of spectrums. Such a relation does, indeed, exist but it depends critically on the frequency content of the continuoustime signal relative to the sampling frequency. If the highest frequency present in the signal is less than the Nyquist frequency (i.e., s /2), then the spectrum of the discrete-time signal over the baseband is exactly equal to that of the continuous-time signal times 1/ T , where T is the sampling period. Under these circumstances, the continuous-time signal can be recovered completely from the corresponding discrete-time signal by simply removing all frequency components outside the baseband and then multiplying by T . THE Z TRANSFORM 125 Amplitude spectrum 4.5 4.0 3.5 3.0 Magnitude 2.5 2.0 1.5 1.0 0.5 0 -30 -20 -10 0 10 Frequency, rad/s (a) Phase spectrum 4 3 2 Phase angle, rad 1 0 -1 -2 -3 -4 -30 -20 -10 0 10 Frequency, rad/s (b) 20 30 20 30 Figure 3.11 Frequency spectrum of discrete-time decaying sinusoidal signal (Example 3.11, = 0.4, 0 = 2.0 rad/s, s = 20 rad/s): (a ) Amplitude spectrum, (b) phase spectrum. The above discussion can be encapsulated in a neat theorem, known as the sampling theorem, which states that a continuous-time signal whose frequency spectrum comprises frequencies that are less than half the sampling frequency (or, alternatively, a continuous-time signal which is sampled at a rate that is higher than two times the highest frequency present in the signal) can be completely recovered from its sampled version. The sampling theorem is obviously of crucial importance because if it is satised, then we can sample our signals to obtain corresponding discrete-time signals without incurring loss of information. The discrete-time signals can then be transmitted or archived using digital hardware. Since no loss of information is involved, the original continuous-signal can be recovered at any time. One can go one step further and process the discrete-time signal using a 126 DIGITAL SIGNAL PROCESSING DSP system. Converting such a processed discrete-time into a continuous-time signal will yield a processed continuous-time signal, and in this way the processing of continuous-time signals can be achieved by means of DSP systems. If the sampling theorem is only approximately satised, for example, if there are some lowlevel components whose frequencies exceed the Nyquist frequency, then the relation between the spectrum of the continuous-time signal and that of the discrete-time signal becomes approximate and as more and more components have frequencies that exceed the Nyquist frequency, the relation becomes more and more tenuous and eventually it breaks down. It follows from the above discussion that the sampling theorem and the spectral relationships that exist between continuous- and discrete-time signals are of considerable importance. They will, therefore, be examined in much more detail later on in Chap. 6. REFERENCE [1] E. I. Jury, Theory and Application of the z-Transform Method, New York: Wiley, 1964. PROBLEMS 3.1. Construct the zero-pole plots of the following functions, showing the order of the zero or pole where applicable: z2 + 1 (a) X (z ) = 2 (z 3)2 (z 2 + 4)2 (b) X (z ) = (z + 1)4 z 2 + 2z + 1 (c) X (z ) = 2 3 z + 4z + 1 8 3.2. Construct the zero-pole plots of the following functions, showing the order of the zero or pole where applicable: (a) X (z ) = z 2 + z 1 z7 + 1 (b) X (z ) = 2 (z + 1)3 1 (c) X (z ) = 3 z + 6z 2 + 11z + 6 3.3. Construct the zero-pole plots of the following functions: z 5 (a) X (z ) = z + 1 z (z + 1) (b) X (z ) = 2 z 1.3z + 0.42 216z 2 + 162z + 29 (c) X (z ) = (2z + 1)(12z 2 + 7z + 1) 3.4. Construct the zero-pole plots of the following functions: (a) X (z ) = 4z 1 + 3z 2 + 2z 3 + z 4 + z 5 z 6 + 2z 2 (b) X (z ) = 4 (z + 3z 2 + 1) 3z + 2 2z 1 2z 2 z 3 4z 4 (c) X (z ) = 1 5 z 2 + 1 z 4 4 4 THE Z TRANSFORM 127 3.5. (a) Prove that the z transform is a linear operation. (b) Repeat part (a ) for the inverse z transform. 3.6. (a) Obtain the real-convolution integral of Eq. (3.15) from the complex convolution given in Eq. (3.14b). (b) Derive Parsevals discrete-time formula in Eq. (3.16) starting with the complex-convolution formula given in Eq. (3.14b). 3.7. For each of the following functions, obtain all Laurent series with center z = 0. Show the region of convergence and identify which series is a z transform in each case: 1 (a) X (z ) = 1 z2 1 (b) X (z ) = z (z 1)2 3.8. For each of the following functions, obtain all Laurent series with center z = 0. Show the region of convergence and identify which series is a z transform in each case: 4z 1 (a) X (z ) = 4 z 1 z 2 + 2z + 1 (b) X (z ) = (z 1) z + 1 2 3.9. For each of the following functions, obtain all Laurent series with center z = 0. Show the region of convergence and identify which series is a z transform in each case: 4z 2 + 2z 4 (a) X (z ) = 2 (z + 1)(z 2 4) 7z 2 + 9z 18 (b) X (z ) = z 3 9z 3.10. For each of the following functions, obtain all Laurent series with center z = 0. Show the region of convergence and identify which series is a z transform in each case: 4z 2 + 1 (a) X (z ) = 2 1 2 z 4 (z 1) z5 (b) X (z ) = 2 2 2)(z 2 + 3) (z 1)(z 3.11. Find the z transforms of the following functions: (a) u (nT )(2 + 3e2nT ) (b) u (nT ) (nT ) (c) 1 u (nT )en r (nT T ) 2 3.12. Find the z transforms of the following functions: (a) u (nT )[1 + (1)n ]enT (b) u (nT ) sinh nT (c) u (nT ) sin (nT + ) (d ) u (nT ) cosh nT 3.13. Find the z transforms of the following functions: (a) u (nT )nT wn (b) u (nT )(nT )2 (c) u (nT )(nT )3 (d) u (nT )nT e4nT 3.14. Find the z transforms of the following discrete-time signals: 1 for 0 n k (a) x (nT ) = 0 otherwise 128 DIGITAL SIGNAL PROCESSING (b) x (nT ) = nT 0 for 0 n 5 otherwise 3.15. Find the z transforms of the following discrete-time signals: for n < 0 0 1 for 0 n 5 (a) x (nT ) = for 5 < n 10 2 3 for n > 10 for n < 0 0 nT for 0 n < 5 (b) x (nT ) = for 5 n < 10 (n 5)T (n 10)T for n < 10 3.16. Find the z transforms of the following discrete-time signals: for n < 0 0 1 for 0 n 9 (a) x (nT ) = for 10 < n 19 2 1 for n 20 for n 3 0 n for 2 n < 1 (b) x (nT ) = for 1 n 5 1 2 for n 6 3.17. Find the z transforms of the following discrete-time signals: 0 for n < 0 (a) x (nT ) = 2 + nT for 2 + nT for n < 2 0 for 2 n 1 (b) x (nT ) = 2 2 nT for n 0 3.18. Find the z transforms of the following discrete-time signals: (a) x (nT ) = u (nT )nT (1 + enT ) (b) x (nT ) = 0 e nT nT for n 0 for n > 0 Note that ln 1 = 1y k =1 yk k 3.19. By using the real-convolution theorem (Theorem 3.7), obtain the z transforms of the following: (a) x (nT ) = n=0 r (nT kT )u (kT ) k (b) x (nT ) = n=0 u (nT kT )u (kT )ekT k 3.20. Prove that n Z k =0 x (kT ) = z Z x (nT ) z1 3.21. Find f (0) and f () for the following z transforms: 2z 1 (a) X (z ) = z1 (e T 1)z (b) X (z ) = 2 z (1 + e T )z + e T T ze4T (c) X (z ) = (z e4T )2 THE Z TRANSFORM 129 3.22. Find the z transforms of the following: (a) y (nT ) = iN 0 ai x (nT i T ) = (b) y (nT ) = iN 0 ai x (nT i T ) = 3.23. Form the z transform of N i =1 bi y (nT i T ) x (nT ) = [u (nT ) u (nT N T )]W kn 3.24. Find the z transforms of the following: (a) x (nT ) = u (nT ) cos2 nT (a) x (nT ) = u (nT ) sin4 nT 3.25. Find the z transforms of the following by using the complex-convolution theorem (Theorem 3.10): (a) x (nT ) = u (nT )enT sin(nT + ) (b) x (nT ) = r (nT ) sin(nT + ) (c) x (nT ) = r (nT )enT cos(nT + ) 3.26. Find the inverse z transforms of the following: 5 2 (b) X (z ) = (a) X (z ) = 2z 1 z e T 2z 3z (d ) X ( z ) = 2 (c) X (z ) = 3z + 2 z 2z + 1 3.27. Find the inverse z transforms of the following: z+2 z2 (a) X (z ) = 2 1 (b) X (z ) = 5 z 4 z 1 2 z 3 + 2z z (z + 1) (d) X (z ) = (c) X (z ) = 2 + 1) (z 1)(z (z + 1)(z 2 + 1) 3.28. Find the inverse z transforms of the following by using the long-division method for n 0 and the general inversion method for n > 0 method: 216z 3 + 96z 2 + 24z + 2 (a) X (z ) = 12z 2 + 9z + 18 4 3z z 3 z 2 (b) X (z ) = z1 3z 5 + 2z 4 2z 3 2z 2 z + 4 (c) X (z ) = z2 1 3.29. Find the inverse z transforms in Prob. 3.28 by using the initial-value theorem (Theorem 3.8) for n 0 and the partial-fraction method for n > 0 method. 3.30. Find the inverse z transforms of the following by using the general inversion method: 2z 2 z2 (b) X (z ) = 2 (a) X (z ) = 2 z +1 2z 2z + 1 3.31. Find the inverse z transforms of the following by using the general inversion method: 1 (a) X (z ) = 4 z 4 5 6z (b) X (z ) = (2z 2 + 2z + 1)(3z 1) 3.32. Find the inverse z transforms of the following by using the partial-fraction method: (z 1)2 4z 3 (a) X (z ) = 2 (b) X (z ) = z 0.1z 0.56 (2z + 1)(2z 2 2z + 1) 130 DIGITAL SIGNAL PROCESSING 3.33. Find the inverse z transforms of the following by using the real-convolution theorem (Theorem 3.7): z2 z2 (b) X (z ) = (a) X (z ) = 2 T )(z 1) z 2z + 1 (z e 3.34. Find the inverse z transform of X (z ) = z (z + 1) (z 1)3 3.35. Find the inverse z transform of the following by means of long division: X (z ) = z (z 2 + 4z + 1) (z 1)4 3.36. (a) Derive expressions for the amplitude and phase spectrums of the signal represented by the z transform X (z ) = z2 z + z2 1 z 2 1 2 +1 4 (b) Calculate that amplitude and phase spectrums at = 0, S /4, and S /2. (c) Using MATLAB or a similar software package compute and plot the amplitude and phase spectrums. 3.37. Repeat parts (a ) and (b) of Prob. 3.36, for the following z transform X (z ) = 0.086 (z 2 1.58z + 1) z 2 1.77z + 0.81 3.38. Repeat parts (a ) and (b) of Prob. 3.36, for the following z transform X (z ) = 3.39. The z transform of a signal is given by X (z ) = z 2 + a1 z + a0 z 2 + b 1 z + b0 (12z 3 + 6.4z 2 + 0.68z ) (z + 0.1)(z 2 + 0.8z + 0.15) (a) Show that the amplitude spectrum of the signal is given by X ( j ) = 2 2 1 + a0 + a1 + 2a1 (1 + 2a0 ) cos T + 2a0 cos 2 T 2 2 1 + b0 + b1 + 2b1 (1 + 2b0 ) cos T + 2b0 cos 2 T (b) Obtain an expression for the phase spectrum. CHAPTER 4 DISCRETE-TIME SYSTEMS 4.1 INTRODUCTION Digital-signal processing is carried out by using discrete-time systems. Various types of discrete-time systems have emerged since the invention of the digital computer such as digital control, robotic, and image-processing systems. Discrete-time systems that are designed to perform ltering are almost always referred to as digital lters, and a variety of digital lters have evolved over the years as detailed in Chap. 1. A discrete-time system is characterized by a rule of correspondence that describes the relationship of the output signal produced with respect to the signal applied at the input of the system. Depending on the rule of correspondence, a discrete-time system can be linear or nonlinear, time invariant or time dependent, and causal or noncausal. Discrete-time systems are built from a small set of basic constituent discrete-time elements that can perform certain elementary operations like addition and multiplication. By interconnecting a number of these basic elements, discrete-time networks can be formed that can be used to implement some fairly sophisticated discrete-time systems. Two types of processes can be applied to discrete-time systems, analysis and design. Analysis can be used to deduce a mathematical representation for a discrete-time system or to nd the output signal produced by a given input signal. Design, on the other hand, is the process of obtaining through the use of mathematical principles a discrete-time system that would produce a desired output signal when a specied signal is applied at the input. This chapter deals with the analysis of discrete-time systems. First, the fundamental concepts of linearity, time invariance, and causality as applied to discrete-time systems are discussed and tests are provided that would enable one to ascertain the properties of a given system from its 131 Copyright 2006 by The McGraw-Hill Companies, Inc. Click here for terms of use. 132 DIGITAL SIGNAL PROCESSING rule of correspondence. The representation of these systems in terms of networks and signal ow graphs is then examined and analysis methods are presented that can be used to derive mathematical representations for discrete-time systems in the form of difference equations. Next, an elementary analysis method based on a mathematical induction technique is presented that can be used to nd the time-domain response of a discrete-time system to a given input signal. An alternative representation of discrete-time systems known as the state-space representation follows, which provides alternative methods of analysis and design. The chapter concludes with an introduction to the concept of stability and outlines a basic test that can be used to establish whether a discrete-time system is stable or not. The design of discrete-time systems that can perform DSP, e.g., digital lters, will form the subject matter of several chapters, starting with Chap. 8. 4.2 BASIC SYSTEM PROPERTIES A discrete-time system can be represented by the block diagram of Fig. 4.1. Input x (nT ) and output y (nT ) are the excitation and response of the system, respectively. The response is related to the excitation by some rule of correspondence. We can indicate this fact notationally as y (nT ) = Rx (nT ) where R is an operator. Depending on its rule of correspondence, a discrete-time system can be classied as linear or nonlinear, time invariant or time dependent, and causal or noncausal [1]. 4.2.1 Linearity A discrete-time system is linear if and only if it satises the conditions R x (nT ) = Rx (nT ) R[x1 (nT ) + x2 (nT )] = Rx1 (nT ) + Rx2 (nT ) (4.1a) (4.1b) x(nT ) Discrete-time system y(nT ) x(nT ) y(nT ) nT nT Figure 4.1 Discrete-time system. DISCRETE-TIME SYSTEMS 133 for all possible values of and all possible excitations x1 (nT ) and x2 (nT ). The condition in Eq. (4.1a) is referred to as the proportionality or homogeneity condition and that in Eq. (4.1b) as the superposition or additivity condition [1]. On applying rst the superposition condition and then the proportionality condition, the response of a linear discrete-time system to an excitation x1 (nT ) + x2 (nT ), where and are arbitrary constants, can be expressed as y (nT ) = R[ x1 (nT ) + x2 (nT )] = R x1 (nT ) + R x2 (nT ) = Rx1 (nT ) + Rx2 (nT ) Thus, the two conditions in Eqs. (4.1a) and (4.1b) can be combined into one, namely, R[ x1 (nT ) + x2 (nT )] = Rx1 (nT ) + Rx2 (nT ) (4.1c) If this condition is violated for any pair of excitations or any constant or , then the system is nonlinear. The use of Eq. (4.1c) to check the linearity of a system tends to involve quite a bit of writing. A simpler approach that works well in a case where the system appears to be nonlinear is to rst check whether the proportionality condition in Eq. (4.1a) is violated. If it is violated, then the work is done and the system can be classied as nonlinear. Otherwise, the superposition condition in Eq. (4.1b) must also be checked. Telltale signs of nonlinearity are terms like |x (nT )| or x k (nT ) in the rule of correspondence. If the proportionality and superposition conditions hold for arbitrary excitations and arbitrary constants and , then the system is linear. Example 4.1 (a) The response of a discrete-time system is of the form y (nT ) = Rx (nT ) = 7x 2 (nT T ) Check the system for linearity. (b) Repeat part (a) if y (nT ) = Rx (nT ) = (nT )2 x (nT + 2T ) Solution (a) A delayed version of the input signal appears squared in the characterization of the system and the proportionality condition is most likely violated. For an arbitrary constant , we have R x (nT ) = 7 2 x 2 (nT T ) On the other hand, Rx (nT ) = 7 x 2 (nT T ) 134 DIGITAL SIGNAL PROCESSING Clearly if = 1, then R x (nT ) = Rx (nT ) that is, the proportionality condition is violated and, therefore, the system is nonlinear. (b) For this case, the proportionality condition is not violated, as can be easily veried, and so we should use Eq. (4.1c), which combines both the proportionality and superposition rules. We can write R[ x1 (nT ) + x2 (nT )] = (nT )2 [ x1 (nT + 2T ) + x2 (nT + 2T )] = (nT )2 x1 (nT + 2T ) + (nT )2 x2 (nT + 2T ) = Rx1 (nT ) + Rx2 (nT ) that is, the system is linear. The squared term (nT )2 may trick a few but it does not affect the linearity of the system since it is a time-dependent system parameter which is independent of the input signal. 4.2.2 Time Invariance A discrete-time system is said to be time invariant if its response to an arbitrary excitation does not depend on the time of application of the excitation. The response of systems in general depends on a number of internal system parameters. In time-invariant systems, these parameters do not change with time. Before we describe a test that can be used to check a discrete-time system for time invariance, the notion of a relaxed system needs to be explained. Systems in general have internal storage or memory elements that can store signal values. Such elements can serve as sources of internal signals and, consequently, a nonzero response may be produced even if the excitation is zero. If all the memory elements of a discrete-time system are empty or their contents are set to zero, the system is said to be relaxed. The response of such a system is zero for all n if the excitation is zero for all n . Formally, an initially relaxed discrete-time system with excitation x (nT ) and response y (nT ), such that x (nT ) = y (nT ) = 0 for n < 0, is said to be time-invariant if and only if Rx (nT kT ) = y (nT kT ) (4.2) for all possible excitations x (nT ) and all integers k . In other words, in a time-invariant discrete-time system, the response produced if the excitation x (nT ) is delayed by a period kT is numerically equal to the original response y (nT ) delayed by the same period kT . This must be the case, if the internal parameters of the system do not change with time. The behavior of a time-invariant discrete-time system is illustrated in Fig. 4.2. As can be seen, the response of the system to the delayed excitation shown in Fig. 4.2b is equal to the response shown in Fig. 4.2a delayed by kT . A discrete-time system that does not satisfy the condition in Eq. (4.2) is said to be time dependent. DISCRETE-TIME SYSTEMS 135 x(nT ) x (nT kT ) nT kT nT y(nT ) y (nT kT ) nT kT (a) (b) nT Figure 4.2 Time invariance: (a) Response to an excitation x (nT ), (b) response to a delayed excitation x (nT kT ). Example 4.2 (a) A discrete-time system is characterized by the equation y (nT ) = Rx (nT ) = 2nT x (nT ) Check the system for time invariance. (b) Repeat part (a) if y (nT ) = Rx (nT ) = 12x (nT T ) + 11x (nT 2T ) Solution (a) The response to a delayed excitation is Rx (nT kT ) = 2nT x (nT kT ) The delayed response is y (nT kT ) = 2(nT kT )x (nT kT ) Clearly, for any k = 0 Rx (nT kT ) = y (nT kT ) and, therefore, the system is time dependent. 136 DIGITAL SIGNAL PROCESSING (b) In this case Rx (nT kT ) = 12x [(n k )T T ] + 11x [(n k )T 2T ] = y (nT kT ) for all possible x (nT ) and all integers k , and so the system is time invariant. In practical terms, one would rst replace nT by nT kT in each and every occurrence of x (nT ) in the characterization of the system to obtain the response produced by a delayed excitation. Then one would replace each and every occurrence of nT by nT kT to obtain the delayed response. If the same expression is obtained in both cases, the system is time invariant. Otherwise, it is time dependent. 4.2.3 Causality A discrete-time system is said to be causal if its response at a specic instant is independent of subsequent values of the excitation. More precisely, an initially relaxed discrete-time system in which x (nT ) = y (nT ) = 0 for n < 0 is said to be causal if and only if Rx1 (nT ) = Rx2 (nT ) for n k (4.3a) for all possible distinct excitations x1 (nT ) and x2 (nT ), such that x1 (nT ) = x2 (nT ) Conversely, if Rx1 (nT ) = Rx2 (nT ) for n k for n k (4.3b) for at least one pair of distinct excitations x1 (nT ) and x2 (nT ) such that x1 (nT ) = x2 (nT ) for n k for at least one value of k , then the system is noncausal. The above causality test can be easily justied. If all possible pairs of excitations x1 (nT ) and x2 (nT ) that satisfy Eq. (4.3b) produce responses that are equal at instants nT kT , then the system response must depend only on values of the excitation at instants prior to nT , where x1 (nT ) and x2 (nT ) are specied to be equal, and the system is causal. This possibility is illustrated in Fig. 4.3. On the other hand, if at least two distinct excitations x1 (nT ) and x2 (nT ) that satisfy Eq. (4.3b) produce responses that are not equal at any instant nT kT , then the system response must depend on values of the excitation at instants subsequent to nT , since the differences between x1 (nT ) and x2 (nT ) occur after nT , and the system is noncausal. DISCRETE-TIME SYSTEMS 137 x1(nT ) x2(nT ) nT kT Rx1(nT ) Rx2(nT ) kT nT nT kT (a) (b) kT nT Figure 4.3 Causality: (a) Response to x1 (nT ), (b) response to x2 (nT ). Example 4.3 (a) A discrete-time system is represented by y (nT ) = Rx (nT ) = 3x (nT 2T ) + 3x (nT + 2T ) Check the system for causality. (b) Repeat part (a) if y (nT ) = Rx (nT ) = 3x (nT T ) 3x (nT 2T ) Solution (a) Let x1 (nT ) and x2 (nT ) be distinct excitations that satisfy Eq. (4.3b) and assume that x1 (nT ) = x2 (nT ) For n = k Rx1 (nT )|n =k = 3x1 (kT 2T ) + 3x1 (kT + 2T ) Rx2 (nT )|n =k = 3x2 (kT 2T ) + 3x2 (kT + 2T ) and since we have assumed that x1 (nT ) = x2 (nT ) for n > k , it follows that x1 (kT + 2T ) = x2 (kT + 2T ) and thus 3x1 (kT + 2T ) = 3x2 (kT + 2T ) for n > k 138 DIGITAL SIGNAL PROCESSING Therefore, Rx1 (nT ) = Rx2 (nT ) that is, the system is noncausal. (b) For this case Rx1 (nT ) = 3x1 (nT T ) 3x1 (nT 2T ) Rx2 (nT ) = 3x2 (nT T ) 3x2 (nT 2T ) If n k , then n 1, n 2 < k and so x1 (nT T ) = x2 (nT T ) for n k or Rx1 (nT ) = Rx2 (nT ) that is, the system is causal. for n k and x1 (nT 2T ) = x2 (nT 2T ) for n = k Noncausality is often recognized by the appearance of one or more terms such as x (nT + |k |T ) in the characterization of the system. In such a case, all one would need to do is to nd just one pair of distinct signals that satisfy Eq. (4.3b) but violate Eq. (4.3a) for just one value of n , as was done in Example 4.3(a ). However, to demonstrate causality one would need to show that Eq. (4.3a) is satised for all possible distinct signals that satisfy Eq. (4.3b) for all possible values of n k . Demonstrating that Eq. (4.3a) is satised for just one value of n , say, k , is not sufcient. Note that the presence of one or more terms like x (nT + |k |T ) in the system equation is neither a necessary nor a sufcient condition for causality. This point is illustrated by the following example. Example 4.4 A discrete-time system is characterized by the following equation y (nT + 2T ) = enT + 5x (nT + 2T ) Check the system for (a) linearity, (b) time invariance, and (c) causality. Solution By letting n = n 2 and then replacing n by n , the system equation can be expressed as y (nT ) = Rx (nT ) = e(n 2)T + 5x (nT ) DISCRETE-TIME SYSTEMS 139 (a ) We note that R[ x (nT )] = e(n 2)T + 5 x (nT ) On the other hand, Rx (nT ) = [e(n 2)T + 5x (nT )] = e(n 2)T + 5 x (nT + 2T ) For = 1, we have e(n 2)T = e(n 2)T and hence R[ x (nT )] = Rx (nT ) Therefore, the proportionality condition is violated and the system is nonlinear. (b) The response to a delayed excitation is Rx (nT kT ) = e(n 2)T + 5x (nT kT ) The delayed response is y (nT kT ) = enT 2T kT + 5x (nT kT ) For any k = 0, we have e(n 2)T = enT 2T kT and hence y (nT kT ) = Rx (nT kT ) Therefore, the system is time dependent. (c) Let x1 (nT ) and x2 (nT ) be two arbitrary distinct excitations that satisfy Eq. (4.3b). The responses produced by the two signals are given by Rx1 (nT ) = e(n 2)T + 5x1 (nT ) Rx2 (nT ) = e(n 2)T + 5x2 (nT ) and since x1 (nT ) = x2 (nT ) we have Rx1 (nT ) = Rx2 (nT ) for n k for n k that is, the condition for causality is satised and, therefore, the system is causal. Discrete-time systems come in all shapes and forms. Systems that operate as digital lters are almost always linear although there are some highly specialized types of digital lters that are 140 DIGITAL SIGNAL PROCESSING basically nonlinear. Most of the time, nonlinearity manifests itself as an imperfection that needs to be eliminated or circumvented. In continuous-time systems, nine times out of ten, time dependence is an undesirable imperfection brought about by drifting component values that needs to be obviated. However, in discrete-time systems it turns out to be a most valuable property. Through the use of time dependence, adaptive systems such as adaptive lters can be built whose behavior can be changed or optimized online. Causality is a prerequisite property for real-time systems because the present output cannot depend on future values of the input, which are not available. However, in nonreal-time applications no such problem is encountered as the numerical values of the signal to be processed are typically stored in a computer memory or mass storage device and are, therefore, readily accessible at any time during the processing. Knowledge of causality is important from another point of view. Certain design methods for digital lters, for example, those in Chaps. 9 and 15, yield noncausal designs and for a real-time application, the designer must know how to convert the noncausal lter obtained to a causal one. 4.3 CHARACTERIZATION OF DISCRETE-TIME SYSTEMS Continuous-time systems are characterized in terms of differential equations. Discrete-time systems, on the other hand, are characterized in terms of difference equations. Two types of discrete-time systems can be identied: nonrecursive and recursive. 4.3.1 Nonrecursive Systems In a nonrecursive discrete-time system, the output at any instant depends on a set of values of the input. In the most general case, the response of such a system at instant nT is a function of x (nT M T ), . . . , x (nT ), . . . , x (nT + K T ), that is, y (nT ) = f {x (nT M T ), . . . , x (nT ), . . . , x (nT + K T )} where M and K are positive integers. If we assume linearity and time invariance, y (nT ) can be expressed as M y (nT ) = i = K ai x (nT i T ) (4.4) where ai for i = K , ( K + 1), . . . , M are constants. If instant nT were taken to be the present, then the present response would depend on the past M values, the present value, and the future K values of the excitation. Equation (4.4) is a linear difference equation with constant coefcients of order M + K , and the system represented by this equation is said to be of the same order. If K > 0 in Eq. (4.4), then y (nT ) would depend on x (nT + T ), x (nT + 2T ), . . . , x (nT + K T ) and, obviously, the deference equation would represent a noncausal system but if K = 0, the representation of an M th-order causal system would be obtained. 4.3.2 Recursive Systems A recursive discrete-time system is a system whose output at any instant depends on a set of values of the input as well as a set of values of the output. The response of a fairly general recursive, linear, DISCRETE-TIME SYSTEMS 141 time-invariant, discrete-time system is given by M N y (nT ) = i = K ai x (nT i T ) i =1 bi y (nT i T ) (4.5) that is, if instant nT were taken to be the present, then the present response would be a function of the past M values, the present value, and the future K values of the excitation as well as the past N values of the response. The dependence of the response on a number of past values of the response implies that a recursive discrete-time system must involve feedback from the output to the input. The order of a recursive discrete-time system is the same as the order of its difference equation, as in a nonrecursive system, and it is the larger of M + K and N + K . The difference equation in Eq. (4.5) for the case where K = M = N = 2 is illustrated in Fig. 4.4. a2 a1 x(nT ) a0 a1 nT a2 b2 1 y(nT ) b1 nT Figure 4.4 Graphical representation of recursive difference equation. 142 DIGITAL SIGNAL PROCESSING Note that Eq. (4.5) simplies to Eq. (4.4) if bi = 0 for 1, 2, . . . , N , and essentially the nonrecursive discrete-time system is a special case of the recursive one. 4.4 DISCRETE-TIME SYSTEM NETWORKS The basic elements of discrete-time systems are the adder, the multiplier, and the unit delay. The characterizations and symbols for these elements are given in Table 4.1. Ideally, the adder produces the sum of its inputs and the multiplier multiplies its input by a constant instantaneously. The unit delay, on the other hand, is a memory element that can store just one number. At instant nT , in response to a synchronizing clock pulse, it delivers its content to the output and then updates its content with the present input. The device freezes in this state until the next clock pulse. In effect, on the clock pulse, the unit delay delivers its previous input to the output. The basic discrete-time elements can be implemented in analog or digital form and many digital congurations are possible depending on the design methodology, the number system, and the type of arithmetic used. Although analog discrete-time elements may be used in certain specialized applications, for example, for the implementation of neural networks, discrete-time systems that are used for DSP are almost always digital and, therefore, the adder, multiplier, and unit delay are digital circuits. A practical approach would be to implement adders and multipliers through the use of parallel combinational circuits and unit delays through the use of delay ip-ops.1 Under ideal Table 4.1 Elements of discrete-time systems Element Unit delay x(nT) Symbol y(nT) Equation y(nT) = x(nTT) x1(nT) x2(nT) Adder y(nT) y(nT) = xi(nT) i=1 K xK(nT) m Multiplier x(nT) y(nT) y(nT) = mx(nT ) 1 Also known as D ip-ops. DISCRETE-TIME SYSTEMS 143 conditions, the various devices produce their outputs instantaneously, as mentioned above, but in practice the three types of devices introduce a small delay known as the propagation delay due to the fact that electrical signals take a certain amount of time to propagate from the input to the output of the device. Collections of unit delays, adders, and multipliers can be interconnected to form discrete-time networks. 4.4.1 Network Analysis The analysis of a discrete-time network, which is the process of deriving the difference equation characterizing the network, can be carried out by using the element equations given in Table 4.1. Network analysis can often be simplied by using the shift operator E r which is dened by E rx (nT ) = x (nT + r T ) The shift operator is one of the basic operators of numerical analysis which will advance or delay a signal depending on whether r is positive or negative. Its main properties are as follows: 1. Since E r [a1 x1 (nT ) + a2 x2 (nT )] = a1 x1 (nT + r T ) + a2 x2 (nT + r T ) = a1 E r x1 (nT ) + a2 E r x2 (nT ) we conclude that E r is a linear operator which distributes with respect to a sum of functions of nT . 2. Since E r E p x (nT ) = E r x (nT + pT ) = x (nT + r T + pT ) = E r + p x (nT ) the shift operator obeys the usual law of exponents. 3. If x2 (nT ) = E r x1 (nT ) then E r x2 (nT ) = x1 (nT ) for all x1 (nT ), and if x1 (nT ) = E r x2 (nT ) then x2 (nT ) = E r x1 (nT ) for all x2 (nT ). Therefore, E r is the inverse of E r and vice versa, that is, E r E r = E r E r = 1 4. A linear combination of powers of E denes a meaningful operator, e.g., if f (E ) = 1 + a1 E + a2 E 2 then f (E )x (nT ) = (1 + a1 E + a2 E 2 )x (nT ) = x (nT ) + a1 x (nT + T ) + a2 x (nT + 2T ) 144 DIGITAL SIGNAL PROCESSING Further, given an operator f (E ) of the above type, an inverse operator f (E )1 may be dened such that f (E )1 x (E ) = x (E ) f (E )1 = 1 5. If f 1 (E ), f 2 (E ), and f 3 (E ) are operators that comprise linear combinations of powers of E , then they satisfy the distributive, commutative, and associative laws of algebra, that is, f 1 (E )[ f 2 (E ) + f 3 (E )] = f 1 (E ) f 2 (E ) + f 1 (E ) f 3 (E ) f 1 (E ) f 2 (E ) = f 2 (E ) f 1 (E ) f 1 (E )[ f 2 (E ) f 3 (E )] = [ f 1 (E ) f 2 (E )] f 3 (E ) The above operators can be used to construct more complicated operators of the form F (E ) = f 1 (E ) f 2 (E )1 = f 2 (E )1 f 1 (E ) which may also be expressed as F (E ) = without danger of ambiguity. Owing to the above properties, the shift operator can be treated like an ordinary algebraic quantity [2], and operators that are linear combinations of powers of E can be treated as polynomials which can even be factorized. For example, the difference equation of a recursive system given in Eq. (4.5) can be expressed as M N f 1 (E ) f 2 (E ) y (nT ) = i = K ai E i x (nT ) i =1 bi E i y (nT ) and, therefore, the recursive system can represented in terms of operator notation as y (nT ) = Rx (nT ) where R is an operator given by R= M i i = K ai E + iN 1 bi E i = (4.6) 1 The application of the above principles in the analysis of discrete-time networks is illustrated in Example 4.5(b) below. DISCRETE-TIME SYSTEMS 145 x(nT ) p B (a) A y(nT ) x(nT ) Adder y(nT ) Ry y(nTT ) Multiplier py(nTT ) Rp (b) m1 x(nT ) v1(nT ) v2(nT ) m2 y(nT ) m3 m4 m5 v3(nT ) (c) Figure 4.5 Discrete-time networks (Example 4.5): (a) First-order system, (b) implementation of rst-order system, (c) second-order system. Example 4.5 (a) Analyze the network of Fig. 4.5a . (b) Repeat part (a) for the network of Fig. 4.5c. Solution (a) From Fig. 4.5a , the signals at nodes A and B are y (nT T ) and py (nT T ), respectively. Thus, y (nT ) = x (nT ) + py (nT T ) (4.7) 146 DIGITAL SIGNAL PROCESSING (b) From Fig. 4.5c, we obtain v1 (nT ) = m 1 x (nT ) + m 3 v2 (nT ) + m 5 v3 (nT ) v2 (nT ) = E 1 v1 (nT ) v3 (nT ) = E 1 y (nT ) y (nT ) = m 2 v2 (nT ) + m 4 v3 (nT ) and on eliminating v2 (nT ) and v3 (nT ) in v1 (nT ) and y (nT ), we have (1 m 3 E 1 )v1 (nT ) = m 1 x (nT ) + m 5 E 1 y (nT ) and (1 m 4 E 1 ) y (nT ) = m 2 E 1 v1 (nT ) On multiplying both sides of Eq. (4.9) by (1 m 3 E 1 ), we get (1 m 3 E 1 )(1 m 4 E 1 ) y (nT ) = (1 m 3 E 1 )m 2 E 1 v1 (nT ) = m 2 E 1 (1 m 3 E 1 )v1 (nT ) and on eliminating (1 m 3 E 1 )v1 (nT ) using Eq. (4.8), we have [1 (m 3 + m 4 )E 1 + m 3 m 4 E 2 ] y (nT ) = m 1 m 2 E 1 x (nT ) + m 2 m 5 E 2 y (nT ) Therefore, y (nT ) = a1 x (nT T ) + b1 y (nT T ) + b2 y (nT 2T ) where a1 = m 1 m 2 b1 = m 3 + m 4 and b2 = m 2 m 5 m 3 m 4 (4.9) (4.8) 4.4.2 Implementation of Discrete-Time Systems The mode of operation of discrete-time systems depends on the implementation of their constituent elements. A relatively simple paradigm to explain is the case whereby adders and multipliers are built as parallel combinational digital circuits, and the unit delays are constructed using delay ipops. If the discrete-time system in Fig. 4.5a were implemented according to this paradigm and the signals and coefcients were assumed to be represented, say, by 4-bit signed binary digits, then an implementation of the type shown in Fig. 4.5b would be obtained where the unit delay is an array of four clocked D ip-ops and R P is a read-only register in which the digits of coefcient p are DISCRETE-TIME SYSTEMS 147 stored. Let us assume that the adder, multiplier, and unit delay have propagation delays A , M , and UD , respectively. At a sampling instant nT , a very brief clock pulse triggers the unit delay to deliver its content y (nT T ) to its output and the content of the unit delay is replaced by the current value of y (nT ) in UD s. The output of the unit delay will cause the correct product py (nT T ) to appear at the output of the multiplier in M s. This product will cause a new sum x (nT ) + py (nT T ) to appear at input of the unit delay and at the output of the system in A s. By that time, the clock pulse would have disappeared and the unit delay would be in a dormant state with the previous system output recorded in its memory and the present output at the input of the unit delay. Obviously, this scheme will work out in practice only if the outputs of the unit delay, multiplier, and adder reach steady state before the next clock pulse which will occur at the next sampling instant. This implies that the sampling period T must be long enough to ensure that T > M + A . Otherwise, the unit delay will record an erroneous value for the output of the adder. The system in Fig. 4.5c would operate in much the same way. Just before a sampling instant, signals are deemed to be in steady state throughout the system. When a clock pulse is received simultaneously by the two unit delays, the unit delays output their contents and their inputs overwrite their contents after a certain propagation delay. The outputs of the unit delays then propagate through the multipliers and adders and after as certain propagation delay, new numerical values appear at the inputs of the unit delays but by then, in the absence of a clock pulse, the unit delays will be dormant. We note that there are signal paths between the output of each unit delay and its input, between the output of the left and the input of the right unit delay, and between the output of the right and the input of the left unit delay. We note also that each of these signal paths involves a multiplier in series with an adder and thus the sampling period should be long enough to ensure that T > m + a , as in the rst-order system of Fig. 4.5a . This simple analysis has shown that the propagation delays of the multipliers and adders impose a lower limit on the sampling period T which translates into an upper limit on the sampling frequency f s = 1/ T ; consequently, high sampling frequencies can be used only if fast hardware with short propagation delays is available, as may be expected. 4.4.3 Signal Flow-Graph Analysis Given a discrete-time network, a corresponding topologically equivalent signal ow graph can be readily deduced by marking and labeling all the nodes of the network on a blank sheet of paper and then replacing Each adder by a node with one outgoing branch and as many incoming branches as there are inputs to the adder Each distribution node by a distribution node Each multiplier by a directed branch with transmittance equal to the constant of the multiplier Each direct transmission path by a directed branch with transmittance equal to unity Each unit delay by a directed branch with transmittance equal to the shift operator E 1 . For example, the signal ow graph of the network shown in Fig. 4.6a can be drawn by marking nodes A, C, F, G, H, D, and E on a sheet of paper and then replacing unit-delays, adders, multipliers, and signal paths by the appropriate nodes and branches, as depicted in Fig. 4.6b. 148 DIGITAL SIGNAL PROCESSING x(nT) A B a0 C b1 F b2 G b3 H (a) a3 D E y(nT) a1 a2 A 1 B 1 b1 b2 b3 C E1 a0 a1 a2 D 1 E F E1 a3 G E1 H (b) Figure 4.6 (a) Discrete-time network, (b) signal ow graph. As can be seen in Fig. 4.6b, signal ow graphs provide a compact and easy-to-draw graphical representation for discrete-time networks and can, in addition, be used to analyze networks through the use of some well-established signal ow-graph methods [35]. Two signal ow-graph methods that are readily applicable for the analysis of discrete-time networks are the node-elimination method and Masons method. NODE ELIMINATION METHOD. In the node elimination method, the given signal ow graph is reduced down to a single branch between the input and output nodes through a sequence of node eliminations [5] and simplications, and the transmittance of the last remaining branch is the operator of the network. From the functional relationship provided by this simplied signal ow graph, the difference equation of the network can be readily deduced. Node elimination can be accomplished by applying a small set of rules, as follows: Rule 1: K branches in series with transmittances T1 , T2 , . . . , TK can be replaced by a single branch with transmittance T1 T2 . . . TK , as shown in Fig. 4.7a . DISCRETE-TIME SYSTEMS 149 I1 A T1 O1 TI1 TI2 P TO1 TO2 B T2 C Y TK Z I2 O2 A T1 T2 TK Z TOM (a) TIN T1 IN I1 Z TI1TO2 T2 TI1TO1 TI2TO1 TI2TO2 OM O1 O2 A I2 TI1TOM TK TI2TOM TINTO1 +TK A T1+ T2+ Z IN TINTO2 TINTOM OM (b) (c) TK T2 T1 TSL I1 TI1 TMO M Z I2 TI2 TI1 1TSL TMO O A T1+ T2+ +TK I1 M A Z I2 TI2 1TSL O (d) Figure 4.7 (e) Node elimination rules: (a ) Rule 1, (b) Rule 2, (c) Rule 3, (d ) Rule 4a , (e) Rule 4b. Rule 2: K branches in parallel with transmittances T1 , T2 , . . . , TK can be replaced by a single branch with transmittance T1 + T2 + + TK , as illustrated in Fig. 4.7b. Rule 3: A node with N incoming branches with transmittances TI 1 , TI 2 , . . . , TI N and M outgoing branches with transmittances TO 1 , TO 2 , . . . , TO M can be replaced by N M branches with transmittances TI 1 TO 1 , TI 1 TO 2 , . . . , TI N TO M as illustrated in Fig. 4.7c. 150 DIGITAL SIGNAL PROCESSING Rule 4a : K self-loops at a given node with transmittances T1 , T2 , . . . , TK can be replaced by a single self-loop with transmittance T1 + T2 + + TK , as illustrated in Fig. 4.7d . Rule 4b: A self-loop at a given node with transmittance TS L can be eliminated by dividing the transmittance of each and every incoming branch by 1 TS L as shown in Fig. 4.7e. Actually, Rule 4a is a special case of Rule 2 since a self-loop is, in effect, a branch that starts from and ends on one and the same node. The above rules constitute a graphical way of doing algebra and, therefore, their validity can be readily demonstrated by showing that the equations of the simplied ow graph can be obtained from those of the original ow graph. For example, the equations of the bottom ow graph in Fig. 4.7e are given by M= TI 1 TI 2 I1 + I2 1 TS L 1 TS L O = TM O M and can be obtained from the equations of the top ow graph in Fig. 4.7e, that is, M = TI 1 I1 + TI 2 I2 + TS L M O = TM O M by moving the term TS L M in the rst equation to the left-hand side and then dividing both sides by the factor 1 TS L . Example 4.6 Find the difference equation of the discrete-time network shown in Fig. 4.6a by using the node elimination method. Solution Eliminating node H in Fig. 4.6b using Rule 3 yields the signal ow graph of Fig. 4.8a and on combining parallel branches by using Rule 2, the graph of Fig. 4.8b can be deduced. Applying Rule 3 to node G in Fig. 4.8b yields the graph in Fig. 4.8c which can be simplied to the graph in Fig. 4.8d by combining the parallel branches. Applying Rule 3 to node F in Fig. 4.8d yields the graph of Fig. 4.8e and on combining the parallel branches and then eliminating node C, the graph Fig. 4.8 f can be obtained. In Fig. 4.8 f , we note that there is a self-loop at node B and on using Rule 4b the graph of Fig. 4.8g is deduced, which can be simplied to the graph of Fig. 4.8h using Rule 1. Hence, y (nT ) = T1 1 T2 x (nT ) (4.10) DISCRETE-TIME SYSTEMS 151 A 1 B 1 C a0 D 1 E b1 b2 b3 E 1 E 1 a1 a2 F E 1 a3 E 1 G (a) A 1 B 1 C a0 D 1 E b1 b2 b3 E 1 E 1 a1 a2+ a3E 1 F E 1 G (b) A 1 B 1 C a0 D 1 E b1 b2 E 1 E 1 a1 2 1 a2E +a3E b3 E 2 F (c) A 1 B 1 C a0 D 1 E 1 b1 b2 E b3 E 2 E 1 a1+ a2E +a3E 1 2 F (d ) Figure 4.8 Signal ow graph reduction method (Example 4.6): (a ) Elimination of node H, (b) combining of parallel branches, (c) Elimination of node G, (d ) combining of parallel branches. 152 DIGITAL SIGNAL PROCESSING A 1 B 1 3 C a0 D 1 E b1E 1b2 E 2b3 E a1E 1 + a2E 2+ a3E 3 (e) A 1 B T1 D 1 E 2 3 T2 T1 = a0 + a1E 1 + a2 E + a3E T2 = b1E (f) A 1 1T2 (g) T1 1T2 (h) B 1 b2 E 2 b3 E 3 E T1 x(nT ) y(nT ) Figure 4.8 Contd (e) elimination of node F, ( f ) combining of parallel branches and elimination of node C, (g ) elimination of self-loop and node D, (h ) combining of series branches. or (1 T2 ) y (nT ) = T1 x (nT ) Therefore, y (nT ) = T1 x (nT ) + T2 y (nT ) and since T1 = a0 + a1 E 1 + a2 E 2 + a3 E 3 and T2 = [b1 E 1 + b2 E 2 + b3 E 3 ] we obtain y (nT ) = a0 x (nT ) + a1 x (nT T ) + a2 x (nT 2T ) + a3 x (nT 3T ) b1 y (nT T ) b2 y (nT 2T ) b3 y (nT 3T ) (4.14) (4.13) (4.12) (4.11) DISCRETE-TIME SYSTEMS 153 I1 TI1 TO1 O1 TO2 O2 TI2 I2 I1 TI1TO1 TI1TO2 TI1TO3 TO3 O3 O1 O2 TI2TO1 TI2TO2 I2 TI2TO3 O3 Figure 4.9 (a) Avoidance of node elimination errors. The amount of work required to simplify a signal ow graph tends to depend on the order in which nodes are eliminated. It turns out that the required effort is reduced if at any one time one eliminates the node that would result in the smallest number of new paths. The number of new paths for a given node is equal to the number of incoming branches times the number of outgoing branches. The most likely source of errors in signal ow graph simplication is the omission of one or more of the new paths generated by Rule 3. This problem can be circumvented to a large extent by drawing strokes on the branches involved as each new path is identied. At the end of the elimination process, each incoming branch should have as many strokes as there are outgoing branches and each outgoing branch should have as many strokes as there are incoming branches, as illustrated in Fig. 4.9. If the strokes do not tally, then the appropriate node elimination needs to be checked. MASONS METHOD. An alternative signal ow-graph analysis method is one based on the socalled Masons gain formula [5, 6]. If i and j are arbitrary nodes in a signal ow graph representing a discrete-time network, then the response at node j produced by an excitation applied at node i is given by Masons gain formula as y j (nT ) = 1 k Tk k xi (nT ) (4.15) 154 DIGITAL SIGNAL PROCESSING Parameter Tk is the transmittance of the k th direct path between nodes i and j , is the determinant of the ow graph, and k is the determinant of the subgraph that does not touch (has no nodes or branches in common with) the k th direct path between nodes i and j . The graph determinant is given by =1 u L u1 + v Pv2 w Pw3 + where L u 1 is the loop transmittance of the u th loop, Pv2 is the product of the loop transmittances of the v th pair of nontouching loops (loops that have neither nodes nor branches in common), Pw3 is the product of loop transmittances of the w th triplet of nontouching loops, and so on. The subgraph determinant k can be determined by applying the formula for to the subgraph that does not touch the k th direct path between nodes i and j . The derivation of Masons formula can be found in [6]. Its application is illustrated by the following example. Example 4.7 Solution Analyze the discrete-time network of Fig. 4.6a using Masons method. From Fig. 4.6b, the direct paths of the ow graph are ABCDE, ABCFDE, ABCFGDE, and ABCFGHDE and hence T1 = a0 T2 = a1 E 1 T3 = a2 E 2 T4 = a3 E 3 The loops of the graph are BCFB, BCFGB, and BCFGHB and hence L 11 = b1 E 1 L 21 = b2 E 2 L 31 = b3 E 3 All loops are touching since branch BC is common to all of them, and so Pv2 = Pw3 = = 0 Hence = 1 + b1 E 1 + b2 E 2 + b3 E 3 The determinants of the subgraphs k , k = 1, 2, 3, and 4, can similarly be determined by identifying each subgraph that does not touch the k th direct path. As can be seen in Fig. 4.6b, branch BC is common to all direct paths between input and output and, therefore, it does not appear in any of the subgraphs. Consequently, no loops are present in the k subgraphs and so 1 = 2 = 3 = 4 =1 DISCRETE-TIME SYSTEMS 155 Using Masons formula given by Eq. (4.15), we obtain y (nT ) = or 3 3 3 i i =0 ai E 3 i i =1 bi E 1+ x (nT ) y (nT ) = i =0 ai E i x (nT ) i =1 bi E i y (nT ) 4.5 INTRODUCTION TO TIME-DOMAIN ANALYSIS The time-domain response of simple discrete-time systems can be determined by solving the difference equation directly using mathematical induction. Although this approach is somewhat primitive, it demonstrates the mode by which discrete-time systems operate. The approach needs nothing more sophisticated than basic algebra as illustrated by the following examples. Example 4.8 (a) Find the impulse response of the system in Fig. 4.5a . The system is initially relaxed, that is, y (nT ) = 0 for n < 0, and p is a real constant. (b) Find the unit-step response of the system. Solution (a) From Example 4.5(a ), the system is characterized by the difference equation y (nT ) = x (nT ) + py (nT T ) With x (nT ) = (nT ), we can write y (0) = 1 + py (T ) = 1 y (T ) = 0 + py (0) = p y (2T ) = 0 + py (T ) = p 2 y (nT ) = p n and since y (nT ) = 0 for n 0, we have y (nT ) = u (nT ) p n (4.17) (4.16) 156 DIGITAL SIGNAL PROCESSING p<1 y(nT ) nT p=1 y(nT ) nT p>1 y(nT ) nT Figure 4.10 Impulse response of rst-order system (Example 4.8(a )). The impulse response is plotted in Fig. 4.10 for p < 1, p = 1, and p > 1. We note that the impulse response diverges if p > 1. (b) With x (nT ) = u (nT ), we get y (0) = 1 + py (T ) = 1 y (T ) = 1 + py (0) = 1 + p y (2T ) = 1 + py (T ) = 1 + p + p 2 n y (nT ) = u (nT ) k =0 pk DISCRETE-TIME SYSTEMS 157 This is a geometric series with common ratio p and hence we can write y (nT ) py (nT ) = u (nT )(1 p (n +1) ) or y (nT ) = u (nT ) 1 p (n +1) 1 p (4.18) For p < 1, limn p (n +1) 0 and hence the steady-state value of the response is obtained as n lim y (nT ) = 1 1 p p<1 y(nT ) nT p=1 y(nT ) nT p>1 y(nT ) nT Figure 4.11 Unit-step response of rst-order system (Example 4.8(b)). 158 DIGITAL SIGNAL PROCESSING For p = 1, Eq. (4.18) gives y (nT ) = 0/0 but if we apply lH pitals rule, we obtain o y (nT ) = lim Thus y (nT ) as n . For p > 1, Eq. (4.18) gives n d (1 p (n +1) )/d p =n+1 p 1 d (1 p )/d p lim y (nT ) pn p1 The unit-step response for the three values of p is illustrated in Fig. 4.11. Evidently, the response converges if p < 1 and diverges if p 1. Example 4.9 (a) Find the response of the system in Fig. 4.5a to the exponential excitation x (nT ) = u (nT )e j nT (b) Repeat part (a ) for the sinusoidal excitation x (nT ) = u (nT ) sin nT (c) Assuming that p < 1, nd the response of the system to the sinusoidal excitation in part (b) as n . Solution (a ) With the system initially relaxed, the use of Eq. (4.16) gives y (0) = e0 + py (T ) = 1 y (T ) = e j T + py (0) = e j T + p y (2T ) = e j 2 T + py (T ) = e j 2 T + pe j T + p 2 y (nT ) = u (nT )(e j nT + pe j (n 1)T + + p (n 1) e j T + p n ) = u (nT )e j nT (1 + pe j T + + p n e jn T ) ) n = u (nT )e j nT k =0 p k e jk T DISCRETE-TIME SYSTEMS 159 This is a geometric series with a common ratio pe j T and, as in Example 4.8(b), the above sum can be obtained in closed form as y (nT ) = u (nT ) Now consider the function H (e j T ) = and let H (e j T ) = M ()e j () where M () = | H (e j T )| = and () = arg H (e j T ) = T tan1 sin T cos T p (4.22b) 1 1+ p2 2 p cos T (4.22a) (4.21) 1 e j T = j T 1 pe j T e p (4.20) e j nT p (n +1) e j T 1 pe j T (4.19) as can be easily shown. On using Eqs. (4.19)(4.21), y (nT ) can be expressed as y (nT ) = u (nT ) H (e j T )(e j nT p (n +1) e j T ) = u (nT ) M ()(e j [ ()+nT ] p (n +1) e j [ () T ] ) (b) The system is linear and so y (nT ) = Ru (nT ) sin nT = Ru (nT ) = = where y1 (nT ) = Ru (nT )e j nT and y2 (nT ) = Ru (nT )e j nT 1 j nT (e e j nT ) 2j (4.23) 1 [Ru (nT )e j nT Ru (nT )e j nT ] 2j 1 [ y1 (nT ) y2 (nT )] 2j (4.24) 160 DIGITAL SIGNAL PROCESSING Partial response y1 (nT ) can be immediately obtained from Eq. (4.23) in part (a ) as y1 (nT ) = u (nT ) M ()(e j [ ()+nT ] p (n +1) e j [ () T ] ) and since y2 (nT ) = Ru (nT )e j nT (4.25) (4.26) partial response y2 (nT ) can be obtained by replacing by in y1 (nT ), that is, y2 (nT ) = u (nT ) M ()(e j [ ()nT ] p (n +1) e j [ ()+ T ] ) (4.27) From Eqs. (4.22a) and (4.22b), we note that M () is an even function and () is an odd function of , that is, M () = M () and () = () Hence Eqs. (4.24), (4.25), and (4.27) yield y (nT ) = u (nT ) M () j [ ()+nT ] (e e j [ ()+nT ] ) 2j M () (n +1) j [ () T ] p (e e j [ () T ] ) 2j u (nT ) = u (nT ) M () sin [nT + ()] u (nT ) M () p (n +1) sin [ () T ] (4.28) We note that the response of the system consists of two components. For a given frequency , the rst term is a steady sinusoid of xed amplitude and the second term is a transient component whose amplitude is proportional to p (n +1) . (c) If p < 1, then the transient term in Eq. (4.28) reduces to zero as n since limn p (n +1) 0 and, therefore, we have y (nT ) = lim y (nT ) = M () sin [nT + ()] n This is called the steady-state sinusoidal response and, as can be seen, it is a sinusoid of amplitude M () displaced by a phase angle (). Since the input is a sinusoid whose amplitude and phase angle are unity and zero, respectively, the system has introduced a gain M () and a phase shift (), as illustrated in Fig. 4.12. DISCRETE-TIME SYSTEMS 161 1.0 1 x(nT ) nT 1.0 () M() y(nT ) nT Figure 4.12 Steady-state sinusoidal response of rst-order system (Example 4.9b). The sinusoidal response in the above example turned out to comprise a steady-state and a transient component. This is a property of discrete-time systems in general, as will be demonstrated in Chap. 5. Functions M () and (), which will resurface in Sec. 5.5.1, facilitate one to nd the steady-state sinusoidal response of a system for any specied frequency and by virtue of linearity one can also nd the response produced by a signal that comprises an arbitrary linear combination of sinusoids of different frequencies. Obviously, these are very useful functions and are called the amplitude response and phase response of the system, respectively. If p were greater than unity in the above example, then the amplitude of the transient component would, in principle, increase indenitely since limn p (n +1) in such a case. Lack of convergence in the time-domain response is undesirable in practice and when it can occur for at least one excitation, the system is said to be unstable. On the basis of the results obtained in Examples 4.8 and 4.9, the system in Fig. 4.5a is unstable if p 1 since the unit-step response does not converge for p 1. The system appears to be stable if p < 1 since the impulse, unit-step, and sinusoidal responses converge for this case but, at this point, we cannot be certain whether an excitation exists that would produce an unbounded time-domain response. The circumstances and conditions that must be satised to assure the stability of a discrete-time system will be examined in Sec. 4.7. 162 DIGITAL SIGNAL PROCESSING The above time-domain analysis method can be easily extended to higher-order systems. Consider, for example, the general system represented by Eq. (4.6). Assuming that N M , then through some simple algebra one can express Eq. (4.6) in the form N y (nT ) = R0 + i =1 Ri 1 + pi E 1 x (nT ) (4.29) where pi and Ri are constants, possibly complex. This equation characterizes the equivalent parallel conguration of Fig. 4.13a where Hi is a rst-order system characterized by y (nT ) = Ri x (nT ) 1 + pi E 1 The time-domain response of this rst-order system can be obtained as in Examples 4.8 and 4.9 and the response of the multiplier in Fig. 4.13a is simply R0 x (nT ). Therefore, by virtue of linearity, the response of the parallel conguration, and thus that of the original high-order system, can be deduced. For example, the impulse response of the rst-order system in Fig. 4.13b can be obtained as y (nT ) = u (nT ) Ri pin R0 (4.30) x(nT ) H1 y(nT ) HN (a) Ri x(nT ) pi y(nT ) (b) Figure 4.13 Representation of a high-order system in terms of a set of rst-order systems. DISCRETE-TIME SYSTEMS 163 as in Example 4.8(a ) and the impulse response of the multiplier is R0 (nT ). Thus Eqs. (4.29) and (4.30) give the impulse response of an N -order recursive system as N y (nT ) = R0 + i =1 Ri 1 + pi E 1 N x (nT ) = R0 x (nT ) + i =1 Ri x (nT ) 1 + pi E 1 N = R0 (nT ) + u (nT ) i =1 Ri pin The unit-step or sinusoidal response of the system can similarly be deduced. Unfortunately, the induction method just described can easily run into serious complications and lacks both generality and potential. An alternative approach that overcomes some of these difculties is the state-space method described in Sec. 4.8. The most frequently used method for timedomain analysis, however, involves the use of the z transform and is described in detail in Chap. 5. 4.6 CONVOLUTION SUMMATION The response of a discrete-time system to an arbitrary excitation can be expressed in terms of the impulse response of the system. An excitation x (nT ) can be expressed as a sum of signals as x (nT ) = k = xk (nT ) (4.31) where each signal xk (nT ) has just one nonzero value equal to the value of x (nT ) at n = k , that is, xk (nT ) = x (kT ) 0 for n = k otherwise as illustrated in Fig. 4.14. Each of the signals xk (nT ) is actually an impulse signal and can be represented as xk (nT ) = x (kT ) (nT kT ) and hence Eqs. (4.31) and (4.32) give (4.32) x (nT ) = k = x (kT ) (nT kT ) (4.33) Now consider a system characterized by the equation y (nT ) = Rx (nT ) (4.34) 164 DIGITAL SIGNAL PROCESSING x(2T ) x(nT ) x(T ) x(0) 0 T 2T 3T nT = x1(nT ) x(0) nT + x2(nT ) x(T ) + x(2T ) x3(nT ) nT nT Figure 4.14 Convolution summation: decomposition of a discrete-time signal into a sum of impulses. and let h (nT ) = R (nT ) (4.35) be the impulse response of the system. Assuming that the system is linear and time invariant, Eqs. (4.33)(4.35) give y (nT ) = R k = x (kT ) (nT kT ) = k = x (kT )R (nT kT ) = k = x (kT )h (nT kT ) (4.36a) This relation is of considerable importance in the characterization as well as analysis of discrete-time systems and is known as the convolution summation. Some special forms of the convolution summation are of particular interest. To start with, by letting n = n k in Eq. (4.36a) and noting that the limits of the summation do not change, the DISCRETE-TIME SYSTEMS 165 alternative but equivalent form y (nT ) = k = h (kT )x (nT kT ) (4.36b) can be obtained. If the system is causal, h (nT ) = 0 for n < 0 and thus Eqs. (4.36a) and (4.36b) give n y (nT ) = k = x (kT )h (nT kT ) = k =0 h (kT )x (nT kT ) (4.36c) h(kT ) x(kT ) kT (a) (b) kT h(kT ) h(nT kT ) kT nT (c) kT = x(kT )h(nT kT ) y(nT ) (d ) } kT (e) Figure 4.15 Convolution summation: graphical representation. 166 DIGITAL SIGNAL PROCESSING and if, in addition, x (nT ) = 0 for n < 0, then n n y (nT ) = k =0 x (kT )h (nT kT ) = k =0 h (kT )x (nT kT ) (4.36d) The convolution summation plays a critical role in the application of the z transform to discretetime systems, as will be demonstrated in Chap. 5, and the assumptions made here in deriving the convolution summation, namely, that the system is linear and time invariant, become inherited assumptions for the applicability of the z transform to discrete-time systems. 4.6.1 Graphical Interpretation The st convolution summation in Eq. (4.36d) is illustrated in Fig. 4.15. The impulse response h (kT ) is folded over with respect to the y axis, as in Fig. 4.15c, and is then shifted to the right by a time interval nT , as in Fig. 4.15d , to yield h (nT kT ). Then x (kT ) is multiplied by h (nT kT ), as in Fig. 4.15e. The sum of all values in Fig. 4.15e is the response of the system at instant nT . Example 4.10 (a) Using the convolution summation, nd the unit-step response of the system in Fig. 4.5a . (b) Hence nd the response to the excitation x (nT ) = 1 0 for 0 n 4 otherwise Solution (a) From Example 4.8(a ), the impulse response of the system is given by h (nT ) = u (nT ) p n (See Eq. (4.17).) Since the unit step is zero for n < 0, the convolution summation in Eq. (4.36a) gives y (nT ) = Ru (nT ) = k = u (kT ) p k u (nT kT ) k =1 1 k =0 0 1 k =1 = + u (T ) p u (nT + T ) + u (0) p u (nT ) + u (T ) p u (nT T ) k =n n k =n +1 + + u (nT ) p u (0) + u (nT + T ) p n +1 u (T ) + DISCRETE-TIME SYSTEMS 167 For n < 0, we get y (nT ) = 0 since all the terms are zero. For n 0, we obtain n y (nT ) = 1 + p 1 + p 2 + + p n = 1 + n =1 pn This is a geometric series and has a sum S= 1 p (n +1) 1 p (see Eq. (A.46b)). Hence, the response can be expressed in closed form as y (nT ) = u (nT ) (b) For this part, we observe that x (nT ) = u (nT ) u (nT 5T ) and so y (nT ) = Rx (nT ) = Ru (nT ) Ru (nT 5T ) Thus y (nT ) = u (nT ) Alternatively, we can write (n +1) u (nT ) 1 p 1 p p (n 4) p (n +1) 1 p for n 4 for n > 4 1 p (n 4) 1 p (n +1) u (nT 5T ) 1 p 1 p (4.38) (4.37) 1 p (n +1) 1 p y (nT ) = Example 4.11 An initially relaxed causal nonrecursive system was tested with an input x (nT ) = 0 n for n < 0 for n 0 and found to have the response given by the following table: n y (nT ) 0 0 1 1 2 4 3 10 4 20 5 30 6 40 7 50 168 DIGITAL SIGNAL PROCESSING (a) Find the impulse response of the system for values of n over the range 0 n 5. (b) Using the result in part (a ), nd the unit-step response for 0 n 5. Solution (a ) Problems of this type can be easily solved by using the convolution summation. Since the system is causal and x (nT ) = 0 for n < 0, the left-hand convolution summation in Eq. (4.36d) applies and hence n y (nT ) = Rx (nT ) = k =0 x (kT )h (nT kT ) or y (nT ) = x (0)h (nT ) + x (T )h (nT T ) + + h (0)x (nT ) Evaluating y (nT ) for n = 1, 2, . . . , we get y (T ) = x (0)h (T ) + x (T )h (0) = 0 h (T ) + 1 h (0) = 1 or h (0) = 1 y (2T ) = x (0)h (2T ) + x (T )h (T ) + x (2T )h (0) = 0 h (2T ) + 1 h (T ) + 2 h (0) = 0 + h (T ) + 2 = 4 or h (T ) = 2 y (3T ) = x (0)h (3T ) + x (T )h (2T ) + x (2T )h (T ) + x (3T )h (0) = 0 h (3T ) + 1 h (2T ) + 2 h (T ) + 3 h (0) = h (2T ) + 2 2 + 3 1 = 10 or h (2T ) = 3 y (4T ) = x (0)h (4T ) + x (T )h (3T ) + x (2T )h (2T ) + x (3T )h (T ) + x (4T )h (0) = 0 h (4T ) + 1 h (3T ) + 2 h (2T ) + 3 h (T ) + 4 h (0) = h (3T ) + 2 3 + 3 2 + 4 1 = 20 or h (3T ) = 4 y (5T ) = x (0)h (5T ) + x (T )h (4T ) + x (2T )h (3T ) + x (3T )h (2T ) + x (4T )h (T ) + x (5T )h (0) = 0 h (5T ) + 1 h (4T ) + 2 h (3T ) + 3 h (2T ) + 4 h (T ) + 5 h (0) = 0 + h (4T ) + 2 4 + 3 3 + 4 2 + 5 1 = 30 or h (4T ) = 0 DISCRETE-TIME SYSTEMS 169 y (6T ) = x (0)h (6T ) + x (T )h (5T ) + x (2T )h (4T ) + x (3T )h (3T ) + x (4T )h (2T ) + x (5T )h (T ) + x (6T )h (0) = 0 h (6T ) + 1 h (5T ) + 2 h (4T ) + 3 h (3T ) + 4 h (2T ) + 5 h (T ) + 6 h (0) = h (5T ) + 2 0 + 3 4 + 4 3 + 5 2 + 6 1 = 40 Thus h (0) = 1 h (T ) = 2 h (4T ) = 0 h (2T ) = 3 h (5T ) = 0 h (3T ) = 4 or h (5T ) = 0 (b) Using the convolution summation again, we obtain the unit-step response as follows: n n y (nT ) = Rx (nT ) = k =0 u (kT )h (nT kT ) = k =0 h (nT kT ) Hence y (0) = h (0) = 1 y (T ) = h (T ) + h (0) = 2 + 1 = 3 y (2T ) = h (2T ) + h (T ) + h (0) = 3 + 2 + 1 = 6 y (3T ) = h (3T ) + h (2T ) + h (T ) + h (0) = 10 y (4T ) = h (4T ) + h (3T ) + h (2T ) + h (T ) + h (0) = 15 y (5T ) = h (5T ) + h (4T ) + h (3T ) + h (2T ) + h (T ) + h (0) = 21 Thus y (0) = 1 y (T ) = 3 y (4T ) = 15 y (2T ) = 6 y (5T ) = 21 y (3T ) = 10 4.6.2 Alternative Classication Discrete-time systems may also be classied on the basis of the duration of their impulse response either as nite-duration impulse response (FIR) systems or as innite-duration impulse response (IIR) systems.2 2 Actually, the acronyms for these systems should be FDIR and IDIR lters since it is the duration that is innite and not the response. However, the acronyms FIR and IIR are too entrenched to be changed. 170 DIGITAL SIGNAL PROCESSING If the impulse response of a causal discrete-time system is of nite duration such that h (nT ) = 0 for n < K and n > M , then the convolution summation in Eq. (4.36b) gives M y (nT ) = k = K h (kT )x (nT kT ) This equation is of the same form as Eq. (4.4) with a K = h ( K ), a K +1 = h ( K + 1), . . . , a M = h ( M T ) and, in effect, such a system is nonrecursive. Conversely, if a nonrecursive system is characterized by Eq. (4.4), then its impulse response can be readily shown to be h ( K ) = a K , h ( K + 1) = a K +1 , . . . ,h ( M T ) = a M and, therefore, it is of nite duration. In recursive systems, the impulse response is almost always of innite duration but it can, in theory, be of nite duration, as will now be demonstrated. Consider a nonrecursive system characterized by the difference equation y (nT ) = x (nT ) + 3x (nT T ) (4.39a) The impulse response of the system is obviously of nite duration since h (0) = 1, h (T ) = 3, and h (kT ) = 0 for all values of k = 0 or 1. If we premultiply both sides of Eq. (4.39a) by the operator (1 + 4E 1 ), we get (1 + 4E 1 ) y (nT ) = (1 + 4E 1 )[x (nT ) + 3x (nT T )] and after simplication, we have y (nT ) = x (nT ) + 7x (nT T ) + 12x (nT 2T ) 4 y (nT T ) Thus, an FIR system can be represented by a recursive difference equation! Evidently, the manipulation has increased the order of the difference equation from one to two but the system response will not change in any way. Under these circumstances, there is no particular reason in applying such a manipulation. In fact, there is every reason to identify common factors and cancel them out since they tend to increase the order of the difference equation and, in turn, the complexity of the system. On the other hand, an IIR system cannot be nonrecursive and vice versa, as depicted in Fig. 4.16. An arbitrary recursive system can be represented by an equation of the form y (nT ) = N (E 1 ) x (nT ) D (E 1 ) (4.39b) and if operator polynomials N (E 1 ) and D (E 1 ) are free from common factors, then the recursive system is also an IIR system. Since common factors are a form of redundancy that must be removed, then, for all practical purposes, the terms recursive and IIR are exchangeable and so are the terms nonrecursive and FIR. In this book, we shall be referring to systems as nonrecursive or recursive if the emphasis is on the difference equation or network and as FIR or IIR if the emphasis is on the duration of the impulse response. DISCRETE-TIME SYSTEMS 171 Nonrecursive Recursive Impossible Possible but unnecessary FIR IIR Figure 4.16 Nonrecursive versus FIR and recursive versus IIR systems. 4.7 STABILITY A continuous- or discrete-time system is said to be stable if and only if any bounded excitation will result in a bounded response. In mathematical language, a discrete-time system is stable if and only if any input x (nT ) such that |x (nT )| P < will produce an output y (nT ) that satises the condition | y (nT )| Q < for all n (4.41) for all n (4.40) where P and Q are positive constants. For a linear and time-invariant system, the convolution summation in Eq. (4.36b) gives | y (nT )| = k = h (kT )x (nT kT ) |h (kT )x (nT kT )| k = k = |h (kT )| |x (nT kT )| (4.42) The equal sign in the rst equation is replaced by the less than or equal sign in the second and third equations since some of the terms under the sum may be negative and, consequently, the magnitude 172 DIGITAL SIGNAL PROCESSING of the sum may be smaller than the sum of the magnitudes, for example, |2 2 + 3 3 + 7 (1)| < |2 2| + |3 3| + |7 (1)| = |2| |2| + |3| |3| + |7| |(1)|. The equal sign is retained to take care of the rare possibility where the terms are all positive. If the input satises the condition in Eq. (4.42), then if we replace |x (nT kT )| by its largest possible value as specied in Eq. (4.40), we obtain | y (nT )| k = |h (kT )| P P k = |h (kT )| (4.43) Now if the impulse response is absolutely summable, that is, |h (kT )| R < k = (4.44) then Eqs. (4.43) and (4.44) give | y (nT )| Q < for all n where Q = P R . Therefore, Eq. (4.44) constitutes a sufcient condition for stability. A system can be classied as stable only if its response is bounded for all possible bounded excitations. Consider the bounded excitation x (nT kT ) = P P if h (kT ) 0 if h (kT ) < 0 (4.45) where P is a positive constant. From Eq. (4.36b) | y (nT )| = k = h (kT )x (nT kT ) = k = P |h (kT )| = P k = |h (kT )| since the product h (kT )x (nT kT ) is always positive in this case by virtue of the denition of x (nT kT ) in Eq. (4.45). Therefore, the condition in Eq. (4.41) will be satised if and only if the impulse response is absolutely summable and, therefore, Eq. (4.44) constitutes both a necessary and a sufcient condition for stability. Under these circumstances, the system is said to be bounded-input, bounded-output (or BIBO) stable. Note that although stability is a crucial requirement for most systems, it should be mentioned here that there are certain inherently unstable systems which can be useful contrary to popular belief. Consider, for example, a continuous-time integrator which is a system that would integrate an input waveform. The response of such a system to a unit-step input would increase with time and would DISCRETE-TIME SYSTEMS 173 become unbounded as t since the area under the unit-step over an innite period is innite. Integrators would be classied as unstable in the above denition, yet they are useful in a number of DSP applications.3 It should be mentioned, however, that such systems are problematic in practice because the level of their internal signals can easily become large enough to cause them to operate outside their linear range. Discrete-time systems also exist that are inherently unstable but which can be useful, for example, discrete-time integrators. These are systems that can perform numerical integration. In nonrecursive systems, the impulse response is of nite duration and hence Eq. (4.44) is always satised. Consequently, these systems are always stable. This is a great advantage in certain applications, for example, in adaptive lters which are lters that change their characteristics on line. Recursive adaptive lters, would need certain recovery mechanisms to prevent them from becoming unstable. The stability of a system can be checked by establishing whether the impulse response satises Eq. (4.44). This boils down to checking whether the series is absolutely convergent, and a number of tests are available at our disposal for this purpose such as the ratio test (see Theorem A.3 in Sec. A.5). Example 4.12 (a) Check the system of Fig. 4.5a for stability. (b) A discrete-time system has an impulse response h (nT ) = u (nT )e0.1nT sin Check the stability of the system. n 6 Solution (a) The impulse response of the system was obtained in Example 4.8(a ) and is given by h (nT ) = u (nT ) p n (See Eq. (4.17)). Hence |h (kT )| = 1 + | p | + + | p k | + k = (4.46) This is a geometric series and has a sum k = |h (kT )| = lim 1 | p |(n +1) n 1 | p| 3 They used to build analog computers with them during the 1950s and 1960s. 174 DIGITAL SIGNAL PROCESSING (see Eq. (A.46b)). If p > 1, k = |h (kT )| = lim and if p = 1, 1 | p |(n +1) n 1 | p| |h (kT )| = 1 + 1 + 1 + = k = On the other hand, if p < 1, k = |h (kT )| = lim 1 1 | p |(n +1) =K < n 1 | p| 1 | p| where K is a positive constant. Therefore, the system in is stable if and only if | p| < 1 This result explains why the unit-step and sinusoidal responses of the system obtained in Examples 4.8(b) and 4.9(b) are bounded if | p | < 1 and unbounded if | p | 1. (b) We can write |h (nT )| = k =0 k =0 u (kT )e0.1kT sin k 6 k k + u (kT )e0.1kT sin 6 6 k =3,9,15,... e0.1kT sin k 6 = k =3,9,15,... u (kT )e0.1kT sin e0.1kT + = k =3,9,15,... k =3,9,15,... that is, the impulse response is not absolutely summable and, therefore, the system is unstable. 4.8 STATE-SPACE REPRESENTATION Systems in general can be represented in terms of equations that involve vectors and matrices. Characterizations of this type are usually based on so-called state-space methods and, as will be demonstrated in due course, they have certain inherent advantages. Below we develop a state-space representation for discrete-time systems. DISCRETE-TIME SYSTEMS 175 4.8.1 Computability The state-space representation to be described is based on Masons gain formula (see Sec. 4.4.3) but before we proceed with the representation itself, a prerequisite property of signal ow graphs known as computability needs to be explained. Earlier on, we have shown that given a discrete-time network, a corresponding signal ow graph can be obtained. This process can obviously be reversed and given a signal ow graph, a discrete-time network can be derived from it. Consider the signal ow graph of Fig. 4.17a and its equivalent network shown in Fig. 4.17b. We observe that the signal ow graph has a loop that does not include the shift operator E 1 , namely, loop ABCDA. In the network, this loop corresponds to the delay-free loop shown enclosed in dashed lines. If a signal x (nT ) is applied at the input of the network, the sum w (nT ) = x (nT ) b1 v (nT ) b0 y (nT ) will appear at the output of the left-hand adder in A s, where A is the propagation delay of the adder; the product a1 w (nT ) will then be formed in M s, where M is the propagation delay of the b0 1 A b1 1 w(nT ) x(nT) a1 C a2 1 D 1 B E 1 y(nT) v(nT ) (a) b0 Delay-free loop x(nT ) w (nT ) y(nT ) a1 v (nT ) b1 (b) a2 Figure 4.17 (a ) Noncomputable signal ow graph, (b) equivalent network. 176 DIGITAL SIGNAL PROCESSING multiplier. Signals a1 w (nT ) and a2 v (nT ) will then be added in A s to produce a new output y (nT ) = a1 w (nT ) + a2 v (nT ) which will be fed back to the left-hand adder; this will produce the signal w (nT ) = x (nT ) b1 v (nT ) b0 y (nT ) = x (nT ) b1 v (nT ) b0 [a1 w (nT ) + a2 v (nT )] = x (nT ) [b1 + b0 a2 ]v (nT ) a1 b0 w (nT ) at the output of the left-hand adder in A s. This chain of events will continue indenitely and the end result would be a runaway situation with the output of the network assuming some unpredictable value. Even though the signal ow graph may represent a valid set of algebraic equations, the presence of a delay-free loop renders the ow graph nonimplementable basically because a variable depends on itself, namely, w (nT ), in the above example. Obviously, ow graphs such as the above cannot be implemented in terms of practical networks and are, therefore, of no practical interest. They are said to be noncomputable. If a unit delay were inserted in the feedback branch in Fig. 4.17b, then signals w (nT ) and v (nT ) would propagate as far as the input of that unit delay and in the absence of a clock pulse, action would stop, the signals would reach steady state, and the runaway situation would not take place. The above problem cannot occur if each and every loop in a signal ow graph contains at least one shift operator E 1 in which case the network would have no delay-free loops. Such a signal ow graph is said to be computable for obvious reasons. 4.8.2 Characterization Now consider an arbitrary discrete-time network containing N unit delays and assume that its signal ow graph is computable, i.e., it has no delay-free loops. The network can be drawn as shown in Fig. 4.18a where Subnetwork A consists exclusively of interconnected adders and multipliers. Subnetwork A cannot contain any loops since each loop of the network is completed by a unit delay which is not part of Subnetwork A, i.e., all loops would be broken if the unit delays in Fig. 4.18a were to be removed as depicted in Fig. 4.18b. Now let qi (nT ), for i = 1, 2, . . . , N , be variables at the outputs of unit delays. These are stored quantities and can thus be referred to as state variables. The signals at the inputs of the unit delays can obviously be represented by corresponding variables qi (nT + T ). If all the state variables are assumed to be zero and the input x (nT ) is assumed to be nonzero, then from Masons gain formula given in Eq. (4.15), the response at the input of the i th unit delay can be obtained as qi (nT + T ) = 1 k Tk k x (nT ) DISCRETE-TIME SYSTEMS 177 q1(nT+T ) q1(nT ) qn(nT+T ) qn(nT ) x(nT ) Subnetwork A y(nT ) qi(nT+T ) qi(nT ) (a) qj(nT+T ) qj(nT ) q1(nT+T ) q1(nT ) qn(nT+T ) qn(nT ) x(nT ) Subnetwork A y(nT ) qi(nT+T ) qi(nT ) (b ) qj(nT+T ) qj(nT ) Figure 4.18 Arbitrary discrete-time network. where Tk is the transmittance of the k th direct path between input and node i , is the determinant of the ow graph, and k is the determinant of the subgraph that does not touch the k th direct path between input and node i (see Sec. 4.4.3). Since there are no complete loops in the graph of Subnetwork A, we have = k =1 Furthermore, since there are no unit delays in Subnetwork A, the transmittances Tk are independent of the shift operator E 1 and we conclude that qi (nT + T ) = bi x (nT ) (4.47) for i = 1, 2, . . . , N where b1 , b2 , . . . , b N are constants independent of nT for a time-invariant discrete-time system. Similarly, if input x (nT ) and all the state variables except the j th state variable are assumed to be zero, we have qi (nT + T ) = ai j q j (nT ) (4.48) 178 DIGITAL SIGNAL PROCESSING for i = 1, 2, . . . , N where a1 j , a2 j , . . . , a N j are again constants independent of nT for a timeinvariant discrete-time system. Now if the system is linear, then from the principle of superposition the response at the input of the i th unit delay is the sum of all the contributions originating from all the state variables plus the contribution from the input of the system. Hence, from Eqs. (4.47) and (4.48), we obtain N qi (nT + T ) = j =1 ai j q j (nT ) + bi x (nT ) (4.49) for i = 1, 2, . . . , N . Similarly, the response of the system, y (nT ), is made of contributions from all the state variables plus the input of the system, and for the same reasons as before, we have N y (nT ) = j =1 c j q j (nT ) + d0 x (nT ) (4.50) Therefore, from Eqs. (4.49) and (4.50), the discrete-time system can be characterized by the system of equations q(nT + T ) = Aq(nT ) + bx (nT ) y (nT ) = cT q(nT ) + d x (nT ) where a11 a12 a21 a22 A= . . . . . . aN 1 aN 2 a1 N a2 N . . . . . . aN N b1 b2 b= . . . bN (4.51a) (4.51b) cT = c1 c2 c N and d = d0 q(nT ) = [q1 (nT ) q2 (nT ) q N (nT )]T (4.52) is a column vector whose elements are the state variables of the discrete-time network. This is referred to as a state-space characterization. DISCRETE-TIME SYSTEMS 179 q1(nT+T ) 1 2 x(nT ) q1(nT ) q2(nT+T ) y(nT ) 1 3 q2(nT ) q3(nT+T ) 1 4 q3(nT ) 2 Figure 4.19 Parallel discrete-time system (Example 4.13). Example 4.13 Obtain a state-space representation for the parallel system shown in Fig. 4.19. Solution State variables can be assigned to the system as shown in Fig. 4.19. By inspection, we obtain q1 (nT + T ) = 1 q1 (nT ) + x (nT ) 2 q2 (nT + T ) = 1 q2 (nT ) + x (nT ) 3 q3 (nT + T ) = 1 q3 (nT ) + x (nT ) 4 and y (n ) = q1 (nT ) + q2 (nT ) + 2q3 (nT ) 180 DIGITAL SIGNAL PROCESSING Therefore, q(nT + T ) = Aq(nT ) + bx (nT ) y (n ) = cT q(nT ) + d x (nT ) where q(nT ) is the state-variable vector and 00 A = 0 1 0 3 001 4 2 1 1 b = 1 1 1 c = 1 2 d=0 In a state-space representation, state-variables can be assigned to nodes arbitrarily, e.g., in Example 4.13, q1 (nT ) could be assigned to the output of any one of the three unit delays, q2 (nT ) to the output of any one of the two remaining unit delays, and q3 (nT ) to the output of the remaining unit delay. In each possible assignment, a different representation would be obtained and, in effect, the state-space approach does not yield a unique representation. A state-space characterization can also be obtained from a signal ow graph as illustrated by the following example. Example 4.14 Obtain a state-space characterization for the system of Fig. 4.6. Solution State variables can be assigned to the ow graph of the system as depicted in Fig. 4.20, where q1 (nT + T ) = q2 (nT ) q2 (nT + T ) = q3 (nT ) q3 (nT + T ) = b3 q1 (nT ) b2 q2 (nT ) b1 q3 (nT ) + x (nT ) The output of the system can be expressed as y (nT ) = a3 q1 (nT ) + a2 q2 (nT ) + a1 q3 (nT ) + a0 q3 (nT + T ) DISCRETE-TIME SYSTEMS 181 x(nT ) 1 1 q3(nT + T ) a0 b1 b2 b3 1 y(nT ) E 1 a1 a2 E 1 a3 q3(nT ) E 1 q2(nT ) q1(nT ) Figure 4.20 Assignment of state variables for the discrete-time system of Fig. 4.6. and on eliminating q3 (nT + T ), we obtain y (nT ) = (a3 a0 b3 )q1 (nT ) + (a2 a0 b2 )q2 (nT ) + (a1 a0 b1 )q3 (nT ) + a0 x (nT ) Hence, the system can be represented by q(nT + T ) = Aq(nT ) + bx (nT ) y (nT ) = cT q(nT ) + d x (nT ) where 010 A = 0 0 1 b3 b2 b1 0 b = 0 1 d = a0 (4.53) cT = [(a3 a0 b3 ) (a2 a0 b2 ) (a1 a0 b1 )] and q(nT ) = [q1 (nT ) q2 (nT ) q3 (nT )]T Note that state variables must always be assigned at the outputs of unit delays but if a signal ow-graph representation is used, it is sometimes possible to inadvertently assign one or more state variables to nodes that are not outputs of unit delays. Consider, for example, the discrete-time network of Fig. 4.21a which can be represented by the signal ow graph of Fig. 4.21b. Assigning state-variables to nodes 2 and 3 will lead to erroneous results simply because these nodes represent the outputs of the adders, not of the unit delays.The problem can be avoided by working directly with the network or by inserting new nodes at the outputs of the unit delays as depicted in Fig. 4.21c. 182 DIGITAL SIGNAL PROCESSING x(nT ) 5 a2 4 a1 3 q1(nT ) b1 a0 2 q2(nT ) 1 y(nT ) b2 (a) a0 a1 x(nT ) a2 5 4 E 1 3 b2 (b) a0 a1 x(nT ) a2 5 4 E 1 1 3 b2 (c) E 1 1 b1 2 1 1 E 1 b1 2 1 1 y(nT ) y(nT ) Figure 4.21 Assignment of state variables. Example 4.15 A system can be represented by the state-space equations in Eqs. (4.51a) and 2 b = 0 0 (4.51b) with 1 1 1 2 3 4 A= 1 0 0 010 cT = 1 4 11 6 12 d=2 Deduce the difference equation of the system. DISCRETE-TIME SYSTEMS 183 Solution From Eqs. (4.51a) and (4.51b), the state-space equations can be written out as q1 (nT + T ) = 1 q1 (nT ) 1 q2 (nT ) 1 q3 (nT ) + 2x (nT ) 2 3 4 q2 (nT + T ) = q1 (nT ) q3 (nT + T ) = q2 (nT ) and y (nT ) = 1 q1 (nT ) + 1 q2 (nT ) + 4 6 From Eqs. (4.54b) and (4.54c), we can write E q2 (nT ) = q1 (nT ) E q3 (nT ) = q2 (nT ) = E 2 q1 (nT ) Now if we eliminate q2 (nT ) and q3 (nT ) in Eq. (4.54a), we get E q1 (nT ) = 1 q1 (nT ) 1 E 1 q1 (nT ) 1 E 2 q1 (nT ) + 2x (nT ) 2 3 4 and hence E+ or q1 (nT ) = E+ 1 2 1 2 1 q (nT ) 12 3 (4.54a) (4.54b) (4.54c) + 2x (nT ) (4.55) or or q2 (nT ) = E 1 q1 (nT ) q3 (nT ) = E 1 q2 (nT ) (4.56a) (4.56b) + 1 E 1 + 1 E 2 q1 (nT ) = 2x (nT ) 3 4 2 x (nT ) + 1 E 1 + 1 E 2 3 4 (4.57) Similarly, if we eliminate q2 (nT ) and q3 (nT ) in Eq. (4.55), we get y (nT ) = 1 q1 (nT ) + 1 E 1 q1 (nT ) + 4 6 = 1 4 + 1 1 E 6 1 2 E q1 (nT ) 12 + 2x (nT ) (4.58) + 1 2 E 12 q1 (nT ) + 2x (nT ) If we now eliminate q1 (nT ) in Eq. (4.58) using Eq. (4.57), we have y (nT ) = = 2 1 + 1 E 1 + 4 6 E+ 1 2 1 2 E 12 1 1 1 2 E + 4E 3 + x (nT ) + 2x (nT ) x (nT ) 2 + 1 E 1 + E 2 + 2 E 3 2 3 1 + 1 E 1 + 1 E 2 + 1 E 3 2 3 4 184 DIGITAL SIGNAL PROCESSING Alternatively, we can write 1 + 1 E 1 + 1 E 2 + 1 E 3 y (nT ) = 2 + 1 E 1 + E 2 + 2 E 3 x (nT ) 2 3 4 2 3 or y (nT ) = 2x (nT ) + 1 x (nT T ) + x (nT 2T ) + 2 x (nT 3T ) 2 3 1 y (nT T ) 1 y (nT 2T ) 1 y (nT 3T ) 2 3 4 4.8.3 Time-Domain Analysis The preceding state-space characterization leads directly to a relatively simple time-domain analysis. For n = 0, 1, . . . , Eq. (4.51a) gives q(T ) = Aq(0) + bx (0) q(2T ) = Aq(T ) + bx (T ) q(3T ) = Aq(2T ) + bx (2T ) Hence q(2T ) = A2 q(0) + Abx (0) + bx (T ) q(3T ) = A3 q(0) + A2 bx (0) + Abx (T ) + bx (2T ) and in general n 1 q(nT ) = An q(0) + k =0 0 A(n 1k ) bx (kT ) where A is the N N unity matrix. Therefore, from Eq. (4.51b), we obtain n 1 y (nT ) = cT An q(0) + cT k =0 A(n 1k ) bx (kT ) + d x (nT ) If x (nT ) = 0 for all n < 0, then for n = 1 Eq. (4.51a) yields q(0) = bi x (T ) = 0 Thus for an initially relaxed system n 1 y (nT ) = cT k =0 A(n 1k ) bx (kT ) + d x (nT ) DISCRETE-TIME SYSTEMS 185 The impulse response h (nT ) of the system is n 1 h (nT ) = cT k =0 A(n 1k ) b (kT ) + d (nT ) For n = 0 h (0) = d (nT ) = d0 and for n > 0 h (nT ) = cT A(n 1) b (0) + cT A(n 2) b (T ) + + d (nT ) Therefore, h (nT ) = d0 cT A(n 1) b for n = 0 for n > 0 (4.59) Similarly, the unit-step response of the system is n 1 y (nT ) = cT k =0 A(n 1k ) bu (kT ) + du (nT ) Hence, for n 0 n 1 y (nT ) = cT k =0 A(n 1k ) b + d (4.60) Example 4.16 An initially relaxed discrete-time system can be represented by the matrices A= 0 1 4 1 1 2 b= 0 1 cT = 7 8 5 4 d= 3 2 Find h (17T ). Solution From Eq. (4.59), we immediately get h (17T ) = cT A16 b By forming the matrices A2 , A4 , A8 , and then A16 through matrix multiplication, we get 610 987 32,768 0 65,536 1076 5 = 262,144 h (17T ) = 7 4 8 987 1597 1 131,072 65,536 186 DIGITAL SIGNAL PROCESSING 4.8.4 Applications of State-Space Method The state-space method offers the advantage that systems can be analyzed through the manipulation of matrices which can be carried out very efciently using array or vector processors. Another important advantage of this method is that it can be used to characterize and analyze time-dependent systems, that is, systems in which one or more of the elements of A, b, and cT and possibly constant d depend on nT . This advantage follows from the fact that only linearity is a prerequisite property for the derivation of the state-state representation. Time-varying systems like adaptive lters are now used quite extensively in a variety of communications applications. The state-space method can also be used to realize digital lters that have certain important advantages, e.g., increased signal-to-noise ratio (see Sec. 14.7). A negative aspect associated with state-space time-domain analysis is the fact that the solutions are not in closed form in general. REFERENCES [1] [2] [3] [4] [5] [6] R. J. Schwarz and B. Friedland, Linear Systems, McGraw-Hill, New York, 1965. R. Butler and E. Kerr, An Introduction to Numerical Methods, Pitman, London, 1962. J. R. Abrahams and G. P. Coverley, Signal Flow Analysis, Pergamon, New York, 1965. B. C. Kuo, Automatic Control Systems, Prentice-Hall, Englewood Cliffs, N.J., 1962. N. Balabanian and T. A. Bickart, Electrical Network Theory, Wiley, New York, 1969. S. J. Mason, Feedback theoryFurther properties of signal-ow graphs, Proc. IRE, Vol. 44, pp. 920926, July 1956. PROBLEMS 4.1. By using appropriate tests, check the systems characterized by the following equations for linearity, time invariance, and causality: (a) y (nT ) = Rx (nT ) = 1.25 + 2.5x (nT ) + 5.0(nT + 2T )x (nT T ) 6x (nT 5T ) for x (nT ) 6 (b) y (nT ) = Rx (nT ) = 7x (nT 5T ) for x (nT ) > 6 (c) y (nT ) = Rx (nT ) = (nT + 3T )x (nT 3T ) 4.2. Repeat Prob. 4.1 for the systems characterized by the following equations: (a) y (nT ) = Rx (nT ) = 5nT x 2 (nT ) (b) y (nT ) = Rx (nT ) = 3x (nT + 3T ) (c) y (nT ) = Rx (nT ) = x (nT ) sin nT 4.3. Repeat Prob. 4.1 for the systems characterized by the following equations: (a) y (nT ) = Rx (nT ) = nT + K 1 x (nT ) where x (nT ) = x (nT + T ) x (nT ) (b) y (nT ) = Rx (nT ) = 1 + K 2 x (nT ) where x (nT ) = x (nT ) x (nT T ) (c) y (nT ) = Rx (nT ) = x (nT + T )enT 4.4. Repeat Prob. 1.1 for the systems characterized by the following equations: (a) y (nT ) = Rx (nT ) = x 2 (nT + T )enT sin nT (b) y (nT ) = Rx (nT ) = 1 e0.01nT i1=1 x (nT i T ) 3 (c) y (nT + T ) = Rx (nT ) = x (nT ) x (nT ) DISCRETE-TIME SYSTEMS 187 4.5. (a) Obtain the difference equation of the discrete-time network shown in Fig. P4.5a . (b) Repeat part(a ) for the network of Fig. P4.5b. x(nT ) y(nT ) 1 2 Figure P4.5a x(nT ) y(nT ) 1 2 Figure P4.5b 4.6. (a) Obtain the difference equation of the network shown in Fig. P4.6a . (b) Repeat part(a ) for the network of Fig. P4.6b. x(nT ) y(nT ) a1 b1 a2 b2 Figure P4.6a 188 DIGITAL SIGNAL PROCESSING x(nT ) y(nT ) b1 a1 b2 a2 Figure P4.6b 4.7. Two second-order system sections of the type shown in Fig. P4.6a are connected in cascade as in Fig. P4.7. The parameters of the two sections are a11 , a21 , b11 , b21 and a12 , a22 , b12 , b22 , respectively. Deduce the characterization of the combined system. x(nT ) y(nT ) Figure P4.7 4.8. Two second-order systems of the type shown in Fig. P4.6a are connected in parallel as in Fig. P4.8. Obtain the difference equation of the combined system. x(nT ) y(nT ) Figure P4.8 4.9. Fig. P4.9 shows a network with three inputs and three outputs. (a) Derive a set of equations characterizing the network. (b) Express the equations obtained in part (a ) in the form y = Mx where y and x are column vectors given by [ y1 (nT ) y2 (nT ) y3 (nT )]T and [x1 (nT ) x2 (nT ) x3 (nT )]T , respectively, and M is a 3 3 matrix. DISCRETE-TIME SYSTEMS 189 x2(nT ) x1(nT ) m1 m2 x3(nT ) y1(nT ) 1 y3(nT ) y2(nT ) Figure P4.9 4.10. The network of Fig. P4.10 can be characterized by the equation b = Ca where b = [b1 b2 b3 ]T and a = [a1 a2 a3 ]T are column vectors and C is a 3 3 matrix. Obtain C. a1 m1 1 m2 1 b2 b1 1 a2 a3 b3 Figure P4.10 190 DIGITAL SIGNAL PROCESSING 4.11. By using appropriate tests, check the systems of Fig. P4.11a to c for linearity, time invariance, and causality. (a) The system of Fig. P4.11a uses a device N whose response is given by Rx (nT ) = |x (nT )| (b) The system of Fig. P4.11b uses a multiplier M whose parameter is given by m = 0.1x (nT ) (c) The system of Fig. P4.11c uses a multiplier M whose parameter is given by m = 0.1v (nT ) where v (nT ) is an independent control signal. x(nT ) N y(nT ) Figure P4.11a 0.1 x(nT ) m M y(nT ) Figure P4.11b x(nT ) 0.1 v (nT ) m M y(nT ) Figure P4.11c 4.12. An initially relaxed discrete-time system employs a device D, as shown in Fig. P4.12, which is characterized by the equation w(nT ) = 2(1)n |v (nT )| DISCRETE-TIME SYSTEMS 191 v (nT ) D w (nT ) x(nT ) y(nT ) 3 2 Figure P4.12 (a) Deduce the difference equation. (b) By using appropriate tests, check the system for linearity, time invariance, and causality. (c) Evaluate the time-domain response for the period 0 to 10T if the input signal is given by x (nT ) = u (nT ) 2u (nT 4T ) where u (nT ) is the unit step. (d) What is the order of the system? 4.13. The discrete-time system of Fig. P4.13 uses a device D whose response to an input w(nT ) is d0 + d1 w (nT ), where d0 and d1 are nonzero constants. By using appropriate tests, check the system for linearity, time invariance, and stability. m2 m1 x(nT ) w (nT ) D y(nT ) Figure P4.13 4.14. A discrete-time system is characterized by the equation y (nT ) = Rx (nT ) = a0 x (nT ) + a1 x (nT T ) + nT x (nT )x (nT T ) + a0 a1 x (nT 2T ) (a) By using appropriate tests, check the system for linearity, time invariance, and stability. (b) Find the unit-step response at t = 5T if a0 = 2, a1 = 3, and T = 1 assuming that the system is initially relaxed. 192 DIGITAL SIGNAL PROCESSING 4.15. The system of Fig. P4.15 is initially relaxed. Find the time-domain response for the period nT = 0 to 6T , if x (nT ) = where = /6T and T = 1. x(nT ) sin nT 0 for n 0 otherwise y(nT ) 3 m r(nT ) Figure P4.15 4.16. (a) Obtain the signal ow graph of the system shown in Fig. P4.16. (b) Deduce the difference equation by using the node elimination method. m21 x(nT ) m11 m12 y(nT ) m22 Figure P4.16 4.17. (a) Obtain the signal ow graph of the system shown in Fig. P4.17. (b) Deduce the difference equation by using the node elimination method. a0 x(nT ) a2 y(nT ) Figure P4.17 b1 a1 b2 a3 DISCRETE-TIME SYSTEMS 193 4.18. (a) Obtain the signal ow graph of the system shown in Fig. P4.6a . (b) Deduce the difference equation by using the node elimination method. 4.19. Deduce the difference equation of the system shown in Fig. 4.19 by using the node elimination method. 4.20. Derive a closed-form expression for the response of the system in Fig. 4.5a to an excitation x (nT ) = The system is initially relaxed and p = 1 . 2 4.21. (a) Show that r (nT ) = 0 T n k =1 1 0 for 0 n 3 otherwise for n 0 u (nT kT ) otherwise (b) By using this relation obtain the unit-ramp response of the system shown in Fig. 4.5a in closed form. The system is initially relaxed. (c) Sketch the response for > 0, = 0, and < 0. 4.22. The excitation in the rst-order system of Fig. 4.5a is for 0 n 4 1 for n>4 x (nT ) = 2 0 for n<0 Find the response in closed form. 4.23. Repeat Prob. 4.22 for an excitation 1 x (nT ) = 0 1 for n = 0 for n < 0, n = 1, 2, 3, 4 for n > 4 4.24. Fig. P4.24 shows a second-order recursive system. Using MATLAB or similar software, compute and plot the unit-step response for 0 n 15 if (a) = 1 = 1 2 (b) = (c) = = 25 32 Compare the three responses and determine the frequency of the transient oscillation in terms of T where possible. 1 2 1 2 5 4 = 1 8 x(nT ) y (nT ) Figure P4.24 194 DIGITAL SIGNAL PROCESSING 4.25. Fig. P4.25 shows a system comprising a cascade of two rst-order sections. The input signal is x (nT ) = sin nT 0 for n 0 otherwise y (nT ) 0.8 0.6 x (nT ) Figure P4.25 and T = 1 ms. (a) Assuming that the two sections are linear, give an expression for the overall steady-state sinusoidal response. (b) Compute the gain and phase shift of the system for a frequency = 20 rad/s. Repeat for = 200 rad/s. 4.26. Fig. P4.26 shows a linear rst-order system. (a) Assuming a sinusoidal excitation, derive an expression for the steady-state gain of the system. (b) Using MATLAB, compute and plot the gain in decibels (dB), that is, 20 log M (), versus log for = 0 to 6 krad/s if T = 1 ms. (c) Determine the lowest frequency at which the gain is reduced by 3 dB relative to the gain at zero frequency. 1 2 x(nT ) y(nT ) 1 2 Figure P4.26 4.27. Two rst-order systems of the type shown in Fig. 4.5a are connected in parallel as in Fig. P4.8. The multiplier constants for the two systems are m 1 = e0.6 and m 2 = e0.7 . Find the unit-step response of the combined network in closed form. 4.28. The unit-step response of a system is y (nT ) = nT 0 for n 0 for n < 0 (a) Using the convolution summation, nd the unit-ramp response. (b) Check the system for stability. DISCRETE-TIME SYSTEMS 195 4.29. A nonrecursive system has an impulse response nT h (nT ) = (8 n )T 0 for 0 n 4 for 5 n 8 otherwise The sampling frequency is 2 rad/s. (a) Deduce the network of the system. (b) By using the convolution summation, determine the response y (nT ) at nT = 4T if the input signal is given by x (nT ) = u (nT T )enT (c) Illustrate the solution in part (b) by a graphical construction. 4.30. An initially relaxed nonrecursive causal system was tested with the input signal x (nT ) = u (nT ) + u (nT 2T ) and its response was found to be as shown in the following table: n y (nT ) 0 3 1 5 2 9 3 11 4 12 5 12 100 12 (a) Find the impulse response for the period 0 to 5T . (b) Find the response for the period 0 to 5T if the input is changed to x (nT ) = u (nT ) u (nT 2T ) 4.31. The response of an initially relaxed fth-order causal nonrecursive system to the excitation x (nT ) = u (nT )n is given in the following table: n y (nT ) 0 0 1 1 2 3 3 7 4 14 5 25 6 41 7 57 8 73 9 89 10 105 (a) Find the impulse response. (b) Obtain the difference equation. 4.32. A discrete-time system has an impulse response h (nT ) = u (nT )nT (a) Using the convolution summation, nd the response y (nT ) for an excitation x (nT ) = u (nT ) sin 2nT at nT = 4T . The sampling frequency is s = 16 rad/s. (b) Illustrate graphically the steps involved in the solution of part (a ). 196 DIGITAL SIGNAL PROCESSING 4.33. An initially relaxed nonrecursive system was tested with the input signal x (nT ) = 2u (nT ) and found to have the response given in the following table: n y (nT ) 0 2 1 6 2 12 3 20 4 30 5 30 100 30 (a) Deduce the difference equation. (b) Construct a possible network for the system. 4.34. The unit-step response of an initially relaxed nonrecursive causal system is given in the following table: n y (nT ) 0 0 1 1 2 9 3 36 4 100 5 225 (a) Find the impulse response for 0 nT 5T using the convolution summation. (b) Assuming that the general pattern of the impulse response continues in subsequent values of nT , write a closed-form expression for the impulse response. (c) Is the system stable or unstable? Justify your answer. 4.35. (a) A discrete-time system has an impulse response 1 n By using an appropriate test, check the system for stability. (b) Repeat part (a) for the system characterized by 1 h (nT ) = u (nT T ) n! 4.36. Check the systems represented by the following impulse responses for stability: u (nT )n (a) h (nT ) = 2n u (nT )n (b) h (nT ) = n+1 (n + 1) (c) h (nT ) = u (nT T ) n2 4.37. (a) Check the system of Fig. P4.37a for stability. (b) Repeat part (a) for the system of Fig. P4.37b. h (nT ) = u (nT T ) 2 x(nT ) 2 y(nT ) Figure P4.37a DISCRETE-TIME SYSTEMS 197 x(nT ) a0 a1 a2 a3 y(nT ) Figure P4.37b 4.38. (a) Derive a state-space representation for the system of Fig. P4.38. (b) Calculate the response y (nT ) at nT = 3T for an excitation x (nT ) = 2 (nT ) + u (nT ) if m 1 = 1 2 and m 2 = 1 . 4 m1 x(nT ) y(nT ) m2 Figure P4.38 4.39. 4.40. 4.41. 4.42. 4.43. Derive a state-space representation for the system of Fig. P4.5a . Derive a state-space representation for the system of Fig. P4.6a . Derive a state-space representation for the system of Fig. P4.17. Derive a state-space representation for the system of Fig. 4.21a . Derive a state-space representation for the system of Fig. P4.43. x(nT ) y(nT ) m1 m2 Figure P4.43 198 DIGITAL SIGNAL PROCESSING 4.44. Derive a state-space representation for the system of Fig. P4.44. x (nT ) 1 2 1 3 1 4 1 5 y (nT ) Figure P4.44 4.45. The system in Fig. 4.5c is initially relaxed. (a) Derive a state-space representation. (b) Give an expression for the response of the system at nT = 5T if x (nT ) = u (nT ) sin nT 4.46. Derive a state-space representation for the system of Fig. P4.46. x (nT ) 0.5 2 y (nT ) 0.25 3 0.125 Figure P4.46 4.47. An initially relaxed discrete-time system is characterized by the state-space equations with A= 01 5 16 1 0 b= 1 cT = 11 8 2 d=2 (a) Calculate the impulse response for the period nT = 0 to 5T and for nT = 17T using the state-space method. (b) Calculate the unit-step response for nT = 5T . 4.48. (a) Deduce the difference equation of the system in Prob. 4.47. (b) Calculate the impulse response for the period nT = 0 to 5T by using the difference equation. (c) Calculate the unit-step response for nT = 5T by using the difference equation. 4.49. A discrete-time system is characterized by the state-space equations with A= 01 1 1 2 4 0 b= 1 cT = 1 4 3 2 d=1 DISCRETE-TIME SYSTEMS 199 (a) Assuming that y (nT ) = 0 for n < 0, nd y (nT ) for the period nT = 0 to 5T if x (nT ) = (nT ). (b) Repeat part (a) if x (nT ) = u (nT ) (c) Derive a network for the system. 4.50. A signal x (nT ) = 3u (nT ) cos nT is applied at the input of the system in Prob. 4.47. Find the response at instant 5T if = 1/10T by using the convolution summation. 4.51. Find the response of the system in Prob. 4.47 at nT = 5T if the excitation is x (nT ) = u (nT T )enT 4.52. Find the response of the system in Prob. 4.49 at nT = 5T if the excitation is x (nT ) = u (nT ) + u (nT 2T ) This page intentionally left blank CHAPTER 5 THE APPLICATION OF THE Z TRANSFORM 5.1 INTRODUCTION Through the use of the z transform, a discrete-time system can be characterized in terms of a so-called discrete-time transfer function, which is a complete representation of the system in the z domain. The transfer function can be used to nd the response of a given system to an arbitrary time-domain excitation, to nd its frequency response, and to ascertain whether the system is stable or unstable. Also, as will be shown in later chapters, the transfer function serves as the stepping stone between desired specications and system design. In this chapter, the discrete-time transfer function is dened and its properties are examined. It is then used as a tool for the stability, time-domain, and frequency-domain analysis of discrete-time systems. In Sec. 5.2, it is shown that the transfer function is a ratio of polynomials in complex variable z and, as a result, a discrete-time system can be represented by a set of zeros and poles. In Sec. 5.3, it is shown that the stability of a system is closely linked to the location of its poles. Several stability criteria are then presented, which are simple algorithms that enable one to determine with minimal computational effort whether a system is stable or unstable. Sections 5.4 and 5.5 deal with general time-domain and frequency-domain methods, respectively, that can be used to analyze systems of arbitrary order and complexity. The chapter concludes by introducing two types of system imperfection, known as amplitude distortion and delay (or phase) distortion, which can compromise the quality of the signal being processed. 201 Copyright 2006 by The McGraw-Hill Companies, Inc. Click here for terms of use. 202 DIGITAL SIGNAL PROCESSING 5.2 THE DISCRETE-TIME TRANSFER FUNCTION The transfer function of a discrete-time system is dened as the ratio of the z transform of the response to the z transform of the excitation. Consider a linear, time-invariant, discrete-time system, and let x (nT ), y (nT ), and h (nT ) be the excitation, response, and impulse response, respectively. From the convolution summation in Eq. (4.36a), we have y (nT ) = k = x (kT )h (nT kT ) and, therefore, from the real-convolution theorem (Theorem 3.7), Z y (nT ) = Z h (nT )Z x (nT ) or Y (z ) = H (z ) X (z ) In effect, the transfer function of a discrete-time system is the z transform of the impulse response. Continuous-time systems can also be characterized in terms of transfer functions. In later chapters we shall be dealing with analog lters, which are continuous-time systems, and with digital lters, which are discrete-time systems, at the same time. To avoid possible confusion, we refer to the transfer functions of analog systems as continuous-time and those of digital systems as discrete-time. The exact form of H (z ) can be derived (i) from the difference equation characterizing the system, (ii) from a network representation of the system, or (iii) from a state-space characterization, if one is available. 5.2.1 Derivation of H (z ) from Difference Equation A noncausal, linear, time-invariant, recursive discrete-time system can be represented by the difference equation N N y (nT ) = i = M ai x (nT i T ) i =1 bi y (nT i T ) where M and N are positive integers. On applying the z transform to both sides of the difference equation, we get N N Z y (nT ) = Z i = M ai x (nT i T ) Z i =1 bi y (nT i T ) If we use the linearity and time-shifting theorems of the z transform, we obtain N N Y (z ) = Z y (nT ) = i = M N ai z i Z x (nT ) i =1 N bi z i Z y (nT ) = i = M ai z i X (z ) i =1 bi z i Y (z ) THE APPLICATION OF THE Z TRANSFORM 203 Now if we solve for Y (z )/ X (z ) and then multiply the numerator and denominator polynomials by z N , we get H (z ) = = N N i N i Y (z ) i = M ai z i = M ai z = = X (z ) 1 + iN 1 bi z i z N + iN 1 bi z N i = = a( M ) z M + N + a( M +1) z M + N 1 + + a N z N + b 1 z N 1 + + b N (5.1) For example, if M = N = 2 we have H (z ) = N (z ) a(2) z 4 + a(1) z 3 + a0 z 2 + a1 z + a2 = D (z ) z 2 + b1 z + b 2 For a causal, linear, time-invariant system, we have M = 0 and hence the transfer function assumes the form H (z ) = N i =0 ai z N i N i =1 zN + bi z N i = a 0 z N + a 1 z N 1 + + a N z N + b1 z N 1 + + b N (5.2) If we compare Eqs. (5.1) and (5.2), we note that in a noncausal recursive system, the degree of the numerator polynomial is greater than that of the denominator polynomial. In a nonrecursive system, coefcients bi are all zero and hence the above analysis gives H (z ) = a( M ) z M + a( M +1) z M 1 + + a N z N = a( M ) z M + N + a( M +1) z M + N 1 + + a N zN (5.3) The order of a discrete-time transfer function, which is also the order of the system, is the order of N (z ) or D (z ), whichever is larger, i.e., M + N , if the system is noncausal or N if it is causal. By factorizing the numerator and denominator polynomials, the transfer function of an arbitrary discrete-time system can be put in the form H (z ) = where z 1 , z 2 , . . . , z Z are the zeros and p1 , p2 , . . . , p N are the poles of H (z ), m i and n i are the orders of zero z i and pole pi , respectively, M + N = iZ=1 m i is the order of the numerator polynomial N (z ), N = iP 1 n i is the order of the denominator polynomial D (z ), and = H0 is a multiplier constant. Thus a discrete-time system can be represented by a zero-pole plot such as the one in Fig. 5.1. From Eq. (5.3), we note that all the poles of a nonrecursive system are located at the origin of the z plane. H0 N (z ) = D (z ) Z mi i =1 ( z z i ) P ni i =1 (z pi ) (5.4) 204 DIGITAL SIGNAL PROCESSING jIm z z plane Re z Figure 5.1 Typical zero-pole plot for H (z ). 5.2.2 Derivation of H (z ) from System Network The z -domain characterizations of the unit delay, the adder, and the multiplier are obtained from Table 4.1 as K Y (z ) = z 1 X (z ) Y (z ) = i =1 X i (z ) and Y (z ) = m X (z ) respectively. By using these relations, H (z ) can be derived directly from a network representation as illustrated in the following example. Example 5.1 Solution Find the transfer function of the system shown in Fig. 5.2. From Fig. 5.2, we can write W (z ) = X (z ) + 1 z 1 W (z ) 1 z 2 W (z ) 2 4 Y (z ) = W (z ) + z 1 W (z ) Hence W (z ) = Therefore, Y (z ) z (z + 1) = H (z ) = 2 1 X (z ) z 2z + 1 4 1 1 1 z 2 X (z ) + 1 z 2 4 and Y (z ) = (1 + z 1 )W (z ) THE APPLICATION OF THE Z TRANSFORM 205 W(z) X(z) 1 2 Y(z) 1 4 Figure 5.2 Second-order recursive system (Example 5.1). 5.2.3 Derivation of H (z ) from State-Space Characterization Alternatively, H (z ) can be deduced from a state-space characterization. As was shown in Sec. 4.8.2, an arbitrary discrete-time system can be represented by the equations q(nT + T ) = Aq(nT ) + bx (nT ) y (nT ) = cT q(nT ) + d x (nT ) (see Eqs. (4.51a) and (4.51b)). By applying the z transform to Eq. (5.5a), we obtain Z q(nT + T ) = AZ q(nT ) + bZ x (nT ) = AQ(z ) + b X (z ) and since Z q(nT + T ) = z Z q(nT ) = z Q(z ) Equations (5.6) and (5.7) give z Q(z ) = AQ(z ) + b X (z ) or Q(z ) = (z I A)1 b X (z ) (5.8) (5.7) (5.6) (5.5a) (5.5b) where I is the N N identity matrix. Now on applying the z transform to Eq. (5.5b), we have Y (z ) = cT Q(z ) + d X (z ) and on eliminating Q(z ) using Eq. (5.8), we get N (z ) Y (z ) = H (z ) = = cT (z I A)1 b + d X (z ) D (z ) (5.9) 206 DIGITAL SIGNAL PROCESSING Example 5.2 A discrete-time system can be represented by the state-space equations in 1 1 2 3 10 Eq. (5.5) with A= b= 2 0 cT = 1 4 1 6 d=2 Deduce the transfer function of the system. Solution The problem can be solved by evaluating the inverse of matrix (z I A) = and then using Eq. (5.9). The inverse of an n n matrix a11 a21 A= . . . an 1 is given by [1, 2] A11 A21 1 = . det A . . An 1 A12 A22 . . . An 2 T A1n A2n . . . Ann a12 a1n a22 a2n . . . . . . an 2 ann 1 z+1 3 2 1 z (5.10) A1 (5.11a) where det A is the determinant of A, Ai j = (1)i + j det Mi j and Mi j represents matrix A with its i th row and j th column deleted. Ai j and det Mi j are known as the cofactor and minor determinant of element ai j , respectively. For a 2 2 matrix, we have A 1 = = 1 A11 A12 det A A21 A22 T = 1 a22 a21 det A a12 a11 T 1 a22 a12 det A a21 a11 (5.11b) THE APPLICATION OF THE Z TRANSFORM 207 Now from Eqs. (5.10) and (5.11b), we obtain (z I A)1 = 1 (z + 1 )z 2 + 1 3 z 1 3 1 z+1 2 (5.12) and from Eqs. (5.9) and (5.12), we have H (z ) = cT (z I A)1 b + d = = = 1 (z + 1 )z 2 + 1 3 1 4 1 4 1 6 z 1 3 1 z+1 2 2z +2 2 2 3 2 +2 0 1 z2 + 1 z + 2 1z + 2 1 3 1 6 1 + 2z 2 + 3 z2 + 1 z + 1 2 3 z+ = 2z 2 + 1 z + 1 2 z2 + 1 z + 2 1 3 5.3 STABILITY As can be seen in Eq. (5.1), the discrete-time transfer function is a rational function of z with real coefcients, and for causal systems the degree of the numerator polynomial is equal to or less than that of the denominator polynomial. We shall now show that the poles of the transfer function or, alternatively, the eigenvalues of matrix A in a state-space characterization, determine whether the system is stable or unstable. 5.3.1 Constraint on Poles Consider a causal system with simple poles characterized by the transfer function H (z ) = H0 N (z ) = D (z ) M M i i =0 ai z N i =1 (z pi ) (5.13) where N M and assume that the numerator and denominator polynomials N (z ) and D (z ) have no common factors that are not constants, i.e., they are relatively prime. Since such common factors can be canceled out at any time, they have no effect on the response of the system and, therefore, cannot affect its stability. The impulse response of such a system is given by h (nT ) = Z 1 H (z ) = and from Eq. (3.8), we get N 1 2 j H (z )z n 1 dz h (0) = R0 + i =1 Res z = pi [z 1 H (z )] (5.14a) 208 DIGITAL SIGNAL PROCESSING where R0 = and N Res z =0 0 H (z ) z if H (z )/z has a pole at the origin otherwise h (nT ) = i =1 Res [ H (z )z n 1 ] z = pi (5.14b) for all n > 0. Now if an arbitrary function F (z ) has a simple pole at z = pi and a function G (z ) is analytic at z = pi , then it can be easily shown that Res [ F (z )G (z )] = G ( pi ) Res F (z ) z = pi z = pi (5.14c) (see Prob. 5.9). Thus Eqs. (5.14a)(5.14c) give R0 + iN 1 pi1 Res z = pi H (z ) = h (nT ) = N p n 1 Res z = pi H (z ) i =1 i for n = 0 for n > 0 where the i th term in the summations is the contribution to the impulse response due to pole pi . If we let pi = ri e j i then the impulse response can be expressed as R0 + iN 1 ri1 e j i Res z = pi H (z ) = h (nT ) = N r n 1 e j (n 1)i Res z = pi H (z ) i =1 i for n = 0 for n > 0 (5.15) At this point, let us assume that all the poles are on or inside a circle of radius rmax , that is, ri rmax for i = 1, 2, . . . , N (5.16) where rmax is the radius of the most distant pole from the origin. From Eq. (5.15), we can write N |h (nT )| = R0 + n =0 i =1 ri1 e j i Res H (z ) + z = pi n =1 N rin 1 e j (n 1)i Res H (z ) i =1 z = pi and since |e j | = 1 and the magnitude of a sum of complex numbers is always equal to or less than the sum of the magnitudes of the complex numbers (see Eq. (A.18)), we have N |h (nT )| | R0 | + n =0 i =1 ri1 | Res H (z )| + z = pi N rin 1 | Res H (z )| z = pi (5.17) n =1 i =1 THE APPLICATION OF THE Z TRANSFORM 209 From the basics of complex analysis, if pk is a simple pole of some function F (z ), then function (z pk ) F (z ) is analytic at z = pk since the factor (z pk ) will cancel out the same factor in the denominator of F (z ) and will thereby remove pole pk from F (z ). Hence, the residue of F (z ) at z = pk is a nite complex number in general. For this reason, R0 as well as all the residues of H (z ) are nite and so | Res H (z )| Rmax z = pi for i = 1, 2, . . . , N where Rmax is the largest residue magnitude. If we replace the residue magnitudes by Rmax and the radii of the poles by the largest pole radius rmax in Eq. (5.17), the inequality will continue to hold and thus |h (nT )| | R0 | + N Rmaxrmax + n =0 N Rmax rmax n rmax n =1 The sum at the right-hand side is a geometric series and if rmax < 1 the series converges and, therefore, we conclude that |h (nT )| K < n =0 where K is a nite constant. In effect, if all the poles are inside the unit circle of the z plane, then the impulse response is absolutely summable. Let us now examine the situation where just a single pole of H (z ), let us say pole pk , is located on or outside the unit circle. In such a case, as n the contributions to the impulse response due to all the poles other than pole pk tend to zero since ri < 1 and rin 1 0 for i = k , whereas the contribution due to pole pk either remains constant if rk = 1 or tends to get larger and larger if n rk > 1 since rk 1 is increased as n is increased. Hence for a sufciently large value of n , Eq. (5.15) can be approximated as n h (nT ) rk 1 e j ( n 1)k Res H (z ) z = pk and thus Eq. (5.17) gives |h (nT )| | Res H (z )| n =0 z = pk n =0 n rk 1 (5.18) Since rk 1, the above geometric series diverges and as a consequence |h (nT )| n =0 210 DIGITAL SIGNAL PROCESSING jIm z z plane Regions of instability 1 Re z Region of stability Figure 5.3 Permissible z -plane region for the location of the poles of H (z ). That is, if at least one pole is on or outside the unit circle, then the impulse response is not absolutely summable. From the above analysis, we conclude that the impulse response is absolutely summable, if and only if all the poles are inside the unit circle. Since the absolute summability of the impulse response is a necessary and sufcient condition for system stability, the inequality in Eq. (5.16) with rmax < 1, that is, | pi | < 1 for i = 1, 2, . . . , N is also a necessary and sufcient condition for stability. The permissible region for the location of poles is illustrated in Fig. 5.3. The above stability constraint has been deduced on the assumption that all the poles of the system are simple. However, the constraint applies equally well to the case where the system has one or more higher-order poles (see Prob. 5.10). In Sec. 4.6.2, we found out that in nonrecursive systems the impulse response is always of nite duration and that assures its absolute summability and, in turn, the stability of these systems. This result is conrmed here by noting that the poles of these systems are always located at the origin of the z plane, right at the center of the region of stability, as can be seen in Eq. (5.3). Example 5.3 Solution Check the system of Fig. 5.4 for stability. The transfer function of the system is H (z ) = z2 z + 1 z2 z + 1 = (z p1 )(z p2 ) z2 z + 1 2 THE APPLICATION OF THE Z TRANSFORM 211 X(z) 1 Y(z) 1 2 Figure 5.4 Second-order recursive system (Example 5.3). where p1 , p2 = since | p1 |, | p2 | < 1 the system is stable. 1 2 j1 2 5.3.2 Constraint on Eigenvalues The poles of H (z ) are the values of z for which D (z ), the denominator polynomial of H (z ), becomes zero. The inverse of a matrix is given by the adjoint of the matrix divided by its determinant (see Eq. (5.11a)). Hence, D (z ) can be obtained from Eqs. (5.9) and (5.11a) as D (z ) = det(z I A) (see Example 5.4 below). Consequently, D (z ) is zero if and only if det(z I A) = 0 Now the determinant of (z I A) is the characteristic polynomial of matrix A [1, 2] and, consequently, the poles of an N th-order transfer function H (z ) are numerically equal to the N eigenvalues 1 , 2 , . . . , N of matrix A. Therefore, a system characterized by the state-space equations in Eq. (5.5) is stable if and only if |i | < 1 for i = 1, 2, . . . , N 212 DIGITAL SIGNAL PROCESSING Example 5.4 A discrete-time system is characterized by the state-space equations in Eq. (5.5) 1 1 1 2 3 4 A= 1 0 0 010 2 b = 0 0 with cT = 1 4 11 6 12 d=2 Check the system for stability. Solution One approach to the problem would be to nd the denominator of the transfer function D (z ) and then nd the zeros of D (z ), which are the poles of the transfer function. We can write 1 z+1 1 4 23 z I A = 1 z 0 0 1 z and from Eq. (5.11a), we obtain (z I A)1 Hence Eq. (5.9) yields N (z ) Y (z ) = H (z ) = = cT (z I A)1 b + d X (z ) D (z ) 2 1 z z+1 1z 2 3 4 4 1 11 1 1 1 0 + 2 = 4 6 12 z (z + 2 )z 4 det(z I A) 0 1 (z + 1 ) (z + 1 )z + 1 2 2 3 2 2z 1 1 = 1 1 12 2z + 2 46 det(z I A) 2 Thus polynomials N (z ) and D (z ) can be deduced as 2 2z 11 N (z ) = 1 6 12 2z + 2 det(z I A) 4 2 and D (z ) = det(z I A) (5.19b) 2 T z 1 z 1 1 z + 1 (z + 1 )z (z + 1 ) = 2 2 det(z I A) 3 1 4 1 4z (z + 1 )z + 1 4 2 3 (5.19a) THE APPLICATION OF THE Z TRANSFORM 213 respectively. Since N (z ) has nothing to do with stability, all we need to do is to nd the determinant of matrix z I A. The determinant of a 3 3 matrix a11 a12 a13 A = a21 a22 a23 a31 a32 a33 can be readily obtained by writing two copies of the matrix side by side as follows | a11 | | a21 | | a31 a12 a22 a32 a13 | a11 a23 | a21 a33 | a31 a12 a22 a32 a13 | | a23 | | a33 | The sum of element products along the south-east diagonals shown form the positive part of the determinant, D + = a11 a22 a33 + a12 a23 a31 + a13 a21 a32 On the other hand, the sum of the products along the south-west diagonals shown below | a11 | | a21 | | a31 a12 a22 a32 a13 | a11 a23 | a21 a33 | a31 a12 a22 a32 a13 | | a23 | | a33 | form the negative part of the determinant, D = a11 a23 a32 + a12 a21 a33 + a13 a22 a31 The determinant of A is given by det A = D + D = (a11 a22 a33 + a12 a23 a31 + a13 a21 a32 ) (a11 a23 a32 + a12 a21 a33 + a13 a22 a31 ) Thus from Eq. (5.19b) and the above arrays (or from Eq. (5.20)), we obtain D (z ) = det(z I A) = (z + 1 )z 2 + 2 1 4 (5.20) 1z 3 1 4 = z3 + 1 z2 + 1 z + 2 3 214 DIGITAL SIGNAL PROCESSING Using function roots of MATLAB, the poles of the system can be obtained as p0 = 0.6168 p1 , p2 = or | p0 | = 0.6168 or | p1 | = | p2 | = 0.6367 0.0584 j 0.6340 and since | pi | < 1 for i = 0, 1, and 2, the system is stable. If the pole positions are not required, then the stability of the system can be easily ascertained by applying the Jury-Marden stability criterion (see Sec. 5.3.7). 5.3.3 Stability Criteria The stability of a system can be checked by nding the roots of polynomial D (z ) or the eigenvalues of matrix A in a state-space representation. For a second- or third-order system, this is easily accomplished. For higher-order systems, however, the use of a computer program1 is necessary. In certain applications, the designer may simply need to know whether a system is stable or unstable and the values of the poles of the transfer function may not be required. In such applications, the stability of the system can be checked quickly through the use of one of several available stability tests or criteria like the Schur-Cohn and Jury-Marden criteria [3]. Typically, these criteria are simple algorithms that involve an insignicant amount of computation relative to that required to nd the roots of D (z ). Some of the more important stability criteria will now be described. Derivations and proofs are omitted for the sake of brevity but the interested reader may consult the references at the end of the chapter. Consider a system characterized by the transfer function H (z ) = where M N (z ) D (z ) (5.21) N (z ) = i =0 N ai z M i (5.22a) and D (z ) = i =0 bi z N i (5.22b) and assume that b0 > 0. This assumption simplies the exposition of the stability criteria quite a bit. If b0 happens to be negative, a positive b0 can be obtained by simply replacing all the coefcients in D (z ) by their negatives. This modication amounts to multiplying the numerator and denominator of the transfer function by 1 and since such a manipulation does not change the response of the system, it does not affect its stability. Assume also that N (z ) and D (z ) have no common factors that are not constants. If there are such common factors in these polynomials, they must be identied and 1 For example, function roots of MATLAB. THE APPLICATION OF THE Z TRANSFORM 215 canceled out before the application of one of the stability criteria. Otherwise, a false result may be obtained, for example, if a common factor has a root inside the unit circle. In such a case, the transfer function will have a pole inside the unit circle that has nothing to do with the stability of the system. 5.3.4 Test for Common Factors The presence of common factors in N (z ) and D (z ) can be checked by applying the following test. The coefcients of N (z ) and D (z ) are used to construct the N ( N + M ) and M ( N + M ) matrices a0 a1 a2 aM 0 0 0 0 a0 a1 a M 1 a M 0 0 RN = . . . . . . . . . . . . . . . . . . . . . 0 and 0 . . = . 0 b0 0 . . . b0 b1 0 . . . b1 b2 0 . . . 0 . . . bN 0 . . . bN 0 b0 . . . 0 . . . 0 0 b N 1 . . . 0 0 bN . . . 0 0 0 0 a0 a1 a M 1 aM RM respectively. Then the ( N + M ) ( N + M ) matrix R= is formed and its determinant is computed. If det R = 0 then N (z ) and D (z ) do not have a common factor that is not a constant, i.e., the two polynomials are relatively prime [4, 5]. Otherwise, if det R = 0 the two polynomials are not relatively prime. In most practical situations, for example, in the transfer functions obtained through the design processes to be described in later chapters, polynomials N (z ) and D (z ) are almost always relatively prime but the possibility that they might not be should not be totally ignored. Example 5.5 RN RM Check the numerator and denominator polynomials of the transfer function H (z ) = z 2 + 3z + 2 N (z ) =3 D (z ) 3z + 5z 2 + 3z + 1 for common factors. 216 DIGITAL SIGNAL PROCESSING Solution Matrix R can be formed as 1 0 R = 0 0 3 3 1 0 3 5 2 3 1 5 3 0 2 3 3 1 0 0 2 1 0 Through the use of MATLAB, we nd that det R = 0. Therefore, N (z ) and D (z ) have a common factor that is not a constant. In actual fact H (z ) = (z + 1)(z + 2) (z + 1)(3z 2 + 2z + 1) 5.3.5 Schur-Cohn Stability Criterion The Schur-Cohn stability criterion was established during the early twenties [3], long before the era of digital systems, and its main application at that time was as a mathematical tool for the purpose of establishing whether or not a general polynomial of z has zeros inside the unit circle of the z plane. This criterion has been superseded in recent years by other more efcient criteria and is rarely used nowadays. Nevertheless, it is of interest as it is the basis of some of the modern criteria. The Schur-Cohn criterion states that a polynomial D (z ) of the type given in Eq. (5.22b), whose coefcients may be complex, has roots inside the unit circle of the z plane if and only if <0 >0 if k is odd if k is even det S for k = 1, 2, . . . , N where Sk is a 2k 2k matrix given by Sk = Ak T Bk Bk T Ak with Ak = b N k +1 b N k +2 b N k +3 b N bN b N 1 . . . 0 bN . . . 0 0 . . . . . . 0 0 . . . THE APPLICATION OF THE Z TRANSFORM 217 and b0 0 Bk = . . . b1 b0 . . . b2 b1 . . . bk 1 bk 2 . . . . . . 0 0 0 b0 The polynomial coefcients b0 , b1 , . . . , b N can, in general, be complex. Polynomials whose roots are inside the unit circle are sometimes referred to as Schur polynomials [5]. The Schur-Cohn criterion involves the evaluation of the determinants of N matrices of dimensions ranging from 2 2 to 2 N 2 N , which would require a large amount of computation. 5.3.6 Schur-Cohn-Fujiwara Stability Criterion A more efcient stability criterion was developed by Fujiwara during the mid-twenties [3]. This is actually a modied version of the Schur-Cohn criterion and for this reason it is usually referred to as the Schur-Cohn-Fujiwara criterion. In this criterion, the coefcients of D (z ), which can be complex, are used to construct the N N matrix f 11 f 1 N . . . . F= . . . .. fN1 fN N where min (i , j ) fi j = k =1 (bi k b j k b N i +k b N j +k ) (5.23) The Schur-Cohn-Fujiwara criterion states that the zeros of D (z ) are located inside the unit circle if and only if F is a positive denite matrix. An N N matrix F is said to be positive denite if the quadratic form xT Fx is a positive quantity for every nonzero column vector xT of dimension N . Matrix F is positive denite if and only if its principal minor determinants (or simply minors) are positive [1, 2], that is, | f 11 | > 0 f 11 f 12 f 13 f 21 f 22 f 23 > 0 f 31 f 32 f 33 f 11 f 12 >0 f 21 f 22 ... f 11 . . . fN1 f1N . . >0 . . . . fN N Evidently, like the original Schur-Cohn criterion, this criterion involves the evaluation of N determinants. However, the dimensions of the matrices involved now range from 1 1 to N N and, therefore, the amount of computation is signicantly reduced. It should be mentioned that matrix F is symmetrical with respect to both the main and cross diagonals, i.e., f i j = f ji = f ( N +1i )( N +1 j ) = f ( N +1 j )( N +1i ) 218 DIGITAL SIGNAL PROCESSING As a result, only the elements with subscripts i = 1 to K and j = i , i + 1, . . . , N + 1 i need to be computed where K= ( N + 1)/2 N /2 for N odd for N even These are the elements covered by the triangle formed by three lines drawn through the rst row, the main diagonal, and the cross diagonal. (a ) A digital system is characterized by the transfer function H (z ) = z4 4z 4 + 3z 3 + 2z 2 + z + 1 z 2 + 2z + 1 z 4 + 6z 3 + 3z 2 + 4z + 5 Example 5.6 Check the system for stability using the Schur-Cohn-Fujiwara criterion. (b) Repeat part (a ) if H (z ) = Solution (a ) The denominator polynomial of the transfer function is given by D (z ) = 4z 4 + 3z 3 + 2z 2 + z + 1 Using Eq. (5.23), the Fujiwara matrix can be constructed as 15 11 6 1 11 23 15 6 F= 6 15 23 11 1 6 11 15 The principal minors can be obtained as |15| = 15 15 11 = 224 11 23 15 11 6 1 11 6 1 23 15 6 = 27,753 15 23 11 6 11 15 15 11 6 11 23 15 = 2929 6 15 23 and since they are all positive, the system is stable. (b) In this case D (z ) = z 4 + 6z 3 + 3z 2 + 4z + 5 THE APPLICATION OF THE Z TRANSFORM 219 and hence Eq. (5.23) gives 2 2 | f 11 | = b0 b4 = 24 i.e., the principal minor of order 1 is negative, and the system can be classied as unstable. There is no need to compute the remaining principal minors because a matrix cannot be positive denite if any one of its principal minors is zero or negative. A simplied version of the Schur-Cohn stability criterion was described by Jury in 1962 [6] (see also Chap. 3 of Ref. [3]) and a simplied version of the Schur-Cohn-Fujiwara criterion was described by Anderson and Jury in 1973 [7]. 5.3.7 Jury-Marden Stability Criterion A stability criterion that has been applied widely through the years is one developed by Jury during the early sixties [3] using a relation due to Marden [8] that gives the Schur-Cohn determinants in terms of second-order determinants. This criterion is often referred to as the Jury-Marden criterion and, as is demonstrated below, it is both very efcient and easy to apply. In this criterion, the coefcients of D (z ), which are assumed to be real, are used to construct an array of numbers known as the JuryMarden array, as in Table 5.1. The rst two rows of the array are formed by entering the coefcients of D (z ) directly in ascending order for the rst row and in descending order for the second. The elements of the third and fourth rows are computed as ci = bi b N = bi b0 b N i b N b N i b0 for i = 0, 1, . . . , N 1 Table 5.1 The Jury-Marden array Row 1 2 3 4 5 6 b0 bN c0 c N 1 d0 d N 2 . . . 2N 3 r0 b1 b N 1 c1 c N 2 d1 d N 3 . . . r1 Coefcients b2 b N 2 c2 c N 3 r2 b3 b N 3 d N 2 d0 c N 1 c0 bN b0 220 DIGITAL SIGNAL PROCESSING those of the fth and sixth rows as di = ci c N 1 = ci c0 c N 1i c N 1 c N 1i c0 for i = 0, 1, . . . , N 2 and so on until 2 N 3 rows are obtained. The last row comprises three elements, say, r0 , r1 , and r2 . The Jury-Marden criterion states that polynomial D (z ) has roots inside the unit circle of the z plane if and only if the following conditions are satised: (i) D (1) > 0 (ii) (1) N D (1) > 0 (iii) b0 > |b N | |c0 | > |c N 1 | |d 0 | > |d N 2 | |r0 | > |r2 | As can be seen, the Jury-Marden criterion involves determinants of 2 2 matrices and is easy to apply even without the use of a computer. Note that all three of the preceding three conditions must be satised for the system to be stable. Therefore, the Jury-Marden array need not be constructed if either of conditions (i) or (ii) is violated. If these conditions are satised, then one can begin evaluating the elements of the Jury-Marden array. If a row is encountered where the magnitude of the rst coefcient is equal to or less than the magnitude of the last coefcient, then the construction of the array can be terminated and the system declared unstable. Thus to save unnecessary effort, conditions (i) and (ii) should be checked rst. If they are satised, then one can proceed with the Jury-Marden array. Example 5.7 Check the systems of Example 5.6, parts (a ) and (b), for stability using the Jury-Marden criterion. Solution (a ) We have D (1) = 11 (1)4 D (1) = 3 and thus conditions (i) and (ii) are satised. The Jury-Marden array can be constructed as shown in Table 5.2 and since b0 > |b4 |, |c0 | > |c3 |, |d0 | > |d2 |, condition (iii) is also satised and the system is stable. (b) In this case (1)4 D (1) = 1 i.e., condition (ii) is violated and the system is unstable. THE APPLICATION OF THE Z TRANSFORM 221 Table 5.2 Row 1 2 3 4 5 Jury-Marden array for Example 5.7 Coefcients 4 1 15 1 224 3 1 11 6 159 2 2 6 11 79 1 3 1 15 1 4 Example 5.8 A discrete-time system is characterized by the transfer function H (z ) = z4 7z 4 + 3z 3 + mz 2 + 2z + 1 Find the range of m that will result in a stable system. Solution The transfer function can be expressed as H (z ) = where D (z ) = 7z 4 + 3z 3 + mz 2 + 2z + 1 The stability problem can be solved by nding the range of m that satises all the conditions imposed by the Jury-Marden stability criterion. Condition (i) gives D (1) = 7 + 3 + m + 2 + 1 > 0 m > 13 N (z ) D (z ) or From condition (ii), we have (5.24) (1)4 D (1) = 7 3 + m 2 + 1 > 0 222 DIGITAL SIGNAL PROCESSING Table 5.3 Row 1 2 3 4 5 or Jury-Marden array for Example 5.8 Coefcients 7 1 48 11 2183 3 2 19 6m 912 66m m m 6m 19 288m 209 m > 3 (5.25) 2 3 11 48 1 7 The Jury-Marden array can be constructed as shown in Table 5.3. Hence for stability, the conditions 7>1 |48| > |11| |2183| > |288m 209| must be satised. The third condition is satised if 2183 > (288m 209) i.e., m> which implies that m > 6.8542 or m < 8.3056 (5.26) 2183 209 288 or m< 2183 + 209 288 Now for stability all the Jury-Marden conditions must be satised and thus from Eqs. (5.24) (5.26), the allowable range of m is obtained as 3 < m < 8.3056 5.3.8 Lyapunov Stability Criterion Another stability criterion states that a discrete-time systems characterized by a state-space representation is stable if and only if for any positive denite matrix Q, there exists a unique positive denite matrix P that satises the Lyapunov equation [9] AT PA P = Q THE APPLICATION OF THE Z TRANSFORM 223 In this criterion, a positive denite matrix Q is assumed, say Q = I, and the Lyapunov equation is solved for P [10]. If P is found to be positive denite, the system is classied as stable. This criterion is less practical to apply than the Jury-Marden criterion and, as a consequence, it is not used for routine analysis. Nevertheless, it has some special features that make it suitable for the study of certain parasitic oscillations that can occur in digital lters (see Sec. 14.9). 5.4 TIME-DOMAIN ANALYSIS The time-domain response of a discrete-time system to any excitation x (nT ) can be readily obtained from Eq. (5.1) as y (nT ) = Z 1 [ H (z ) X (z )] Any one of the inversion techniques described in Sec. 3.8 can be used. Example 5.9 Find the unit-step response of the system shown in Fig. 5.4. Solution From Example 5.3 H (z ) = where p1 = and from Table 3.2 X (z ) = z z1 1 2 z2 z + 1 (z p1 )(z p2 ) j1 = 2 e j /4 2 and p2 = 1 2 e j /4 + j1 = 2 2 On expanding H (z ) X (z )/z into partial fractions, we have H (z ) X (z ) = where R0 = 2 e j 5/4 R1 = 2 and R2 = R1 = R1 z R0 z R2 z + + z 1 z p1 z p2 e j 5/4 2 224 DIGITAL SIGNAL PROCESSING Hence y (nT ) = Z 1 [ H (z ) X (z )] 1 = 2u (nT ) + u (nT )(e j (n 5)/4 + e j (n 5)/4 ) ( 2)n +1 1 = 2u (nT ) + u (nT ) cos (n 5) n 1 4 ( 2) The unit-step response of the system is plotted in Fig. 5.5. 2.4 y(nT ) 1.8 1.2 0.6 0 nT Figure 5.5 Unit-step response (Example 5.9). 5.5 FREQUENCY-DOMAIN ANALYSIS The response of a rst-order discrete-time system to a sinusoidal excitation was examined in Sec. 4.5 and it was found to comprise two components, a transient and a steady-state sinusoidal component. We will now show that the same is also true for the response of a system of arbitrary order. If the system is stable, the transient component tends to diminish rapidly to zero as time advances and in due course only the sinusoidal component prevails. The amplitude and phase angle of the sinusoidal output waveform produced by a sinusoidal waveform of unit amplitude and zero phase angle turn out to be functions of frequency. Together they enable one to determine the steady-state response of a system to a sinusoidal waveform of arbitrary frequency or the response produced by arbitrary linear combinations of sinusoidal waveforms, and can be used, in addition, to nd the responses produced by complex waveforms. 5.5.1 Steady-State Sinusoidal Response Let us consider a causal system characterized by the transfer function of Eq. (5.13). The sinusoidal response of such a system is y (nT ) = Z 1 [ H (z ) X (z )] X (z ) = Z [u (nT ) sin nT ] = z sin T (z e j T )(z e j T ) (5.27) where THE APPLICATION OF THE Z TRANSFORM 225 or y (nT ) = = All poles 1 2 j H (z ) X (z )z n 1 dz Res [ H (z ) X (z )z n 1 ] (5.28a) Assuming that the poles of the system are simple, then for n > 0 Eqs. (5.27) and (5.28a) yield N y (nT ) = Res [ H (z ) X (z )z z =e j T n 1 ] + Res [ H (z ) X (z )z z =e j T n 1 ]+ i =1 Res [ H (z ) X (z )z n 1 ] z = pi = 1 [ H (e j T )e j nT H (e j T )e j nT ] + 2j N Res [ H (z ) X (z )z n 1 ] i =1 z = pi (5.28b) and if we let pi = ri e j i , the summation part in the above equation can be expressed as N N Res [ H (z ) X (z )z n 1 ] = i =1 z = pi i =1 X ( pi ) pin 1 Res H (z ) z = pi (see Prob. 5.9). Now if the system is stable, then | pi | = ri < 1 for i = 1, 2, . . . , N and hence as n , we have rin 1 0. Thus pin 1 = rin 1 e j (n 1)i 0 and, therefore, N n N lim Res [ H (z ) X (z )z n 1 ] = lim i =1 z = pi n X ( pi ) pin 1 Res H (z ) 0 i =1 z = pi (5.28c) Hence, Eqs. (5.28b) and (5.28c) give the steady-state sinusoidal response of the system as y (nT ) = lim y (nT ) = n 1 H (e j T )e j nT H (e j T )e j nT 2j (5.28d) This result also holds true for systems that have one or more higher-order poles (see Prob. 5.28) as well as for noncausal systems as can be easily demonstrated. From the linearity of complex conjugation, the sum of a number of complex conjugates is equal to the complex conjugate of the sum, and if we use the z transform, we obtain H (e j T ) = If we let H (e j T ) = M ()e j () where M () = | H (e j T )| and () = arg H (e j T ) (5.29) n = h (nT )e j nT = n = h (nT )e j nT = H (e j T ) (5.28e) 226 DIGITAL SIGNAL PROCESSING 1.0 1 x(nT ) nT 1.0 () M() y(nT ) nT Figure 5.6 Sinusoidal response of an arbitrary system. then from Eqs. (5.28d) and (5.28e), the steady-state response of the system can be expressed as y (nT ) = 1 H (e j T )e j nT H (e j T )e j nT 2j 1 M ()e j [nT + ()] M ()e j [nT + ()] = 2j = M () sin[nT + ()] (5.30) Clearly, the effect of a system on a sinusoidal excitation is to introduce a gain M () and a phase shift (), as illustrated in Fig. 5.6. As functions of frequency, M () and () are known as the amplitude and phase responses and function H (e j T ) from which they are derived is referred to as the frequency response of the system.2 As may be recalled from Sec. 3.9.1, the frequency spectrum of a discrete-time signal is the z transform of the signal evaluated on the unit circle of the z plane. Since H (z ) is the z transform of the impulse response, it follows that H (e j T ) is also the frequency spectrum of the impulse response. 2 Some people refer to M () as the magnitude response for obvious reasons. THE APPLICATION OF THE Z TRANSFORM 227 That is, function H (e j T ) has a dual physical interpretation, namely, it is the frequency response of the system or the frequency spectrum of the impulse response. In digital lters, the gain often varies over several orders of magnitude as the frequency is varied and to facilitate the plotting of the amplitude response, the gain is usually measured in decibels (dB) as Gain = 20 log10 M () The gain in lters is typically equal to or less than unity and it is usually convenient to work with the reciprocal of the gain, which is known as attenuation. Like the gain, the attenuation can be expressed in dB as Attenuation = 20 log10 1 = 20 log10 M () M () The phase shift is measured either in degrees or in radians. 5.5.2 Evaluation of Frequency Response The above analysis has shown that the amplitude and phase responses of a system can be obtained by evaluating the transfer function H (z ) on the unit circle |z | = 1 of the z plane, which is very much what we do to nd the amplitude and phase spectrums of a discrete-time signal. This can be done very efciently by using MATLAB or other similar digital signal processing (DSP) software. It can also be done by using a graphical method as will be demonstrated below. The method is inefcient and is unlikely to be used in practice, yet it merits consideration because it reveals some of the basic properties of discrete-time systems and provides, in addition, intuitive appreciation of the inuence of the zero and pole locations on the amplitude response of a system. Let us consider a general transfer function expressed in terms of its zeros and poles as in Eq. (5.4). The frequency response of the system at some frequency , can be obtained as H (z ) |z e j T = H (e j T ) = M ()e j () = and by letting e j T z i = M z i e j z i e j T pi = M pi e j pi we obtain M () = | H0 | Z i =1 P i =1 m Mz i i (5.31) (5.32) H0 iZ=1 (e j T z i )m i P j T p )n i i i =1 (e (5.33a) (5.33b) M nii p Z P (5.34) n i pi i =1 () = arg H0 + i =1 m i z i (5.35) 228 DIGITAL SIGNAL PROCESSING jIm z z plane B Mp1 Mz 1 1 T z1 z1 A Re z p1 p1 C Mp2 Mz2 p2 p2 z2 z 2 Figure 5.7 Graphical evaluation of frequency response of a discrete-time system. where arg H0 = if H0 is negative. Thus M () and () can be determined graphically through the following procedure: 1. 2. 3. 4. 5. 6. Mark the zeros and poles of the system in the z plane. Draw the unit circle z = 1. Draw complex number (or vector) e j T where is the frequency of interest. Draw m i complex numbers of the type given by Eq. (5.33a) for each zero of H (z ) of order m i . Draw n i complex numbers of the type given by Eq. (5.33b) for each pole of order n i . Measure the magnitudes and angles of the complex numbers in Steps 4 and 5 and use Eqs. (5.34) and (5.35) to calculate the gain M () and phase shift (), respectively. The procedure is illustrated in Fig. 5.7 for the case of a second-order discrete-time system with simple zeros and poles. The amplitude and phase responses of a system can be obtained by repeating the above procedure for a number of frequencies in the range of interest. 5.5.3 Periodicity of Frequency Response Point A in Fig. 5.7 corresponds to zero frequency, point C corresponds to half the sampling frequency, i.e., s /2 = / T , which is often referred to as the Nyquist frequency, and one complete revolution of vector e j T about the origin corresponds to an increase in frequency equal to the sampling frequency s = 2/ T rad/s. If vector e j T in Fig. 5.7 is rotated k complete revolutions, the vector will return to its original position and the values of M () and () will obviously remain the same as before. As a result H (e j (+k s )T ) = H (e j T ) THE APPLICATION OF THE Z TRANSFORM 229 We conclude, therefore, that the frequency response is a periodic function of frequency with a period s . 5.5.4 Aliasing The periodicity of the frequency response can be viewed from a different perspective by examining the discrete-time sinusoidal signal given by x (nT ) = sin[( + k s )nT ] Using the appropriate trigonometric identity, we can write x (nT ) = sin nT cos k s nT + cos nT sin k s nT = sin nT cos k 2 nT T + cos nT sin k 2 nT T = sin nT cos 2kn + cos nT sin 2kn = sin nT We conclude that discrete-time signals sin( + k s )nT and sin nT are numerically identical for any value of k as illustrated in Fig. 5.8. Consequently, if signal sin( + k s )t is sampled at a sampling rate of s , the sampled version of sin t will be obtained and the frequency of the signal will appear to have changed from + k s to . This effect is known as aliasing since frequency + k s is impersonating frequency . Now if the frequency of the sinusoidal input of a discrete-time system is increased from to + k s , the system will obviously produce the same output as before since the two input signals will, after all, be numerically identical. Another facet of aliasing can be explored by considering a sinusoidal signal whose frequency is in the range (k 1 )s to k s where k is an integer, say, frequency k s , where 0 < s /2. 2 sin nT 3T T 2T 4T 5T nT sin[(+s)nT ] Figure 5.8 Plots of sin(nT ) and sin[( + s )nT ] versus nT . 230 DIGITAL SIGNAL PROCESSING In this case, the signal can be expressed as x (nT ) = sin(k s )nT = sin k s nT cos nT cos k s nT sin nT = sin k 2 nT T cos nT cos k 2 nT T sin nT = sin 2kn cos nT cos 2kn sin nT = sin nT = sin(nT ) Consequently, a positive frequency k s in the range (k 1 )s to k s will be aliased to the 2 negative frequency . The above analysis demonstrates that the highest frequency that can be present in a discrete-time sinusoidal signal is s /2. If a continuous-time signal has sinusoidal components whose frequencies exceed s /2, then the frequencies of any such components will be aliased. This can cause some serious problems as will be demonstrated in Chap. 6. The effects of aliasing can be demonstrated in a different setting that is very familiar to movie fans. As the cowboy wagon accelerates into the sunset, the wheels of the wagon appear to accelerate in the forward direction, then reverse, slow down, stop momentarily, and after that they accelerate again in the forward direction. This series of events happen in the reverse order if the wagon decelerates. Actually, this is exactly what we should see, it is not an illusion, and it has to do with the fact that the image we see on the screen is a series of still photographs which constitute a sampled signal. The phenomenon is easily explained by the illustrations in Fig. 5.9. In this context, the sampling frequency s is the number of lm frames per second as taken by the movie camera and the number of wheel revolutions per second denes the frequency of a signal component. Let us examine what happens as the number of wheel revolutions is increased from 0 to 5s /4. In Fig. 5.9a , the wheel revolves at a speed s /4 and the marker will thus move a quarter revolution before the next frame. The wheel appears to be rotating in the clockwise direction. In Fig. 5.9b, the wheel revolves at a speed s /2 and the marker will thus move half a revolution before the next frame. If this speed were maintained, the viewer would have difculty discerning the direction of rotation since the marker on the wheel would alternate between the top and bottom. In Fig. 5.9c, the wheel revolves at a speed 3s /4 and the marker will thus move three-quarters of a revolution before the next frame. Miraculously, the wheel will appear to turn in the counterclockwise direction at s /4 revolutions per second. This is analogous to the situation where a frequency of a sinusoidal signal in the range s /2 to s is aliased to a negative frequency. Increasing the rotation speed to, say, 7s /8 as in Fig. 5.9d , the wheel will appear to rotate slowly in the reverse direction and if the rotation speed is exactly s , the wheel will appear to stop as can be seen in Fig. 5.9e, that is, the sampling frequency will appear to behave very much like zero frequency.3 If the speed of the wheel is increased a bit more, say, to 9s /8, then the wheel will appear to move slowly in the forward direction, as depicted in Fig. 5.9 f , is actually the basis of the stroboscope which is an instrument that can be used to measure the speed in motors and other machinery. 3 This THE APPLICATION OF THE Z TRANSFORM 231 s /4 (a) s /2 (b) 3s /4 (c) 0.9s (d ) s (e) 1.1s (f) Figure 5.9 Aliasing at the movies. and at a speed of 5s /4 the wheel will appear to rotate at the rate of s /4 revolutions per second as depicted in Fig. 5.9a , that is, back to square one. This analogy provides a visual demonstration as to why the signals sin( + k s )nT and sin nT cannot be distinguished, on the one hand, and why the highest frequency in a discrete-time signal cannot exceed s /2. 232 DIGITAL SIGNAL PROCESSING 5.5.5 Frequency Response of Digital Filters In view of the periodicity of the frequency response, a discrete-time system is completely specied in the frequency domain by its frequency response over the frequency range s /2 s /2 which is known as the baseband. In Chap. 1, four types of lters were described, namely, lowpass, highpass, bandpass, and bandstop, depending on the range of frequencies selected or rejected. In discrete-time systems such as digital lters, these terms are applied with respect to the positive half of the baseband, e.g., a highpass lter is one that will select frequencies is some range p s /2 and reject frequencies in some range 0 a , where a < p . The magnitude of H (z ) is a surface over the z plane. From Eq. (5.4), since z z i , | H (z )| 0 since (z z i ) 0. On the other hand, as z pi , | H (z )| since (z pi ) 0. After all, z i is a zero and pi is a pole. So if a zero z i = r zi e j zi is located close to the unit circle, then the gain of the system at frequencies close to zi / T will be very small. On the other hand, if a pole pi = r pi e j pi is located close to the unit circle, then the gain of the system will be large at frequencies close to pi / T . On the basis of these observations, one can easily visualize the amplitude response of a system by simply inspecting its zero-pole plot. If the poles are clustered in the region near the point (1, 0) and the zeros are clustered near the point (1, 0), then the system is a lowpass lter. More precisely, a system is a lowpass lter if the poles and zeros are enclosed in the sectors p pi p and z zi z , respectively, where z and p are positive angles such that p < z < . On the basis of these principles, the system represented by the zero-pole plot of Fig. 5.10a should be a lowpass lter and this, indeed, is the case as can be seen in the 3-D plot of Fig. 5.10b. The angle of H (z ) is also a surface over the z plane but, unfortunately, this is usually far too convoluted to be correlated to the zero-pole plot. See, for example, the 3-D plot of Fig. 5.10c, which represents the angle of H (z ) for the lowpass lter under consideration. The amplitude and phase responses could be displayed in terms of 3-D plots, as depicted in Fig. 5.10d and e, by evaluating the magnitude and angle of H (z ) on the unit circle, i.e., by letting z = e j T . If the surfaces in Fig. 5.10b and c were deemed to represent solid objects, say, made of wax, then the amplitude and phase responses would be the proles of the cores punched through these objects by a cylindrical corer tool of radius 1. Three-dimensional plots such as these are both difcult to plot as well as visualize, particularly, the one for the phase response. For these reasons, the amplitude and phase responses are usually plotted in terms of 2-D plots of 20 log M () and (), respectively, as illustrated in Fig. 5.10 f and g . To continue the geometrical interpretation, these 2-D plots can be obtained by spreading ink over the surfaces of the wax cores obtained before and then rolling them over a white sheet of paper. It should be mentioned here that ambiguities can arise in the evaluation of the phase response owing to the fact that = tan1 is a multivalued function of (see Sec. A.3.7). Typically, one would evaluate the phase response of a system by nding the real and imaginary parts of the frequency response, i.e., H (e j T ) = Re H (e j T ) + j Im H (e j T ) and then compute the phase response as () = tan1 Im H (e j T ) Re H (e j T ) THE APPLICATION OF THE Z TRANSFORM 233 2 1 jIm z 0 1 2 2 1 0 Re z (a) 1 2 60 40 |H(z)|, dB 20 0 20 40 60 2 1 0 jIm z 1 1 (b) 0 Re z 2 1 2 2 4 2 0 2 4 2 1 0 jIm z 1 1 2 2 (c) 1 0 Re z 2 Figure 5.10 Frequency response of lowpass lter: (a ) Zero-pole plot, (b) plot of 20 log | H (z )| versus z = Re z + j Im z , (c) plot of arg H (z ) versus z . arg H(z), rad 234 DIGITAL SIGNAL PROCESSING 0 10 20 Gain, dB 30 40 50 60 2 1 0 jIm z 1 1 2 2 (d) 1 0 Re z 2 4 2 Phase shift, rad 0 2 4 2 1 0 jIm z 1 1 2 2 (e) 1 0 Re z 2 Figure 5.10 Contd Frequency response of lowpass lter: (d ) Plot of 20 log | H (e j T )| versus z , (e) plot of arg H (e j T ) versus z . Things would work out perfectly if < () < . However, if the value of () is outside this range, the phase response computed by the typical DSP software, including MATLAB, would be wrong. The phase response of causal systems is a decreasing function of frequency because of certain physical reasons to be explained shortly and at some frequency it will decrease below . When this happens, the typical DSP software will yield a positive angle in the range 0 to instead of the correct negative value, i.e., an angle will be computed instead of the correct angle of ; thus an abrupt discontinuity of +2 will be introduced as an artifact. This problem can be corrected by THE APPLICATION OF THE Z TRANSFORM 235 0 10 20 Gain, dB 30 40 50 60 10 5 0 Frequency, rad/s (f) 5 10 4 3 2 Phase shift, rad 1 0 1 2 3 4 10 5 0 Frequency, rad/s (g) 5 10 Figure 5.10 Contd () versus . Frequency response of lowpass lter: ( f ) Plot of 20 log M () versus , (g ) plot of monitoring the change in the phase response as the frequency is increased and whenever a sign change is observed in the phase response from a negative to a positive value, which corresponds to a crossing of the negative real axis, to subtract an angle of 2 from the phase response at that frequency as well as all the subsequent frequencies (see Sec. A.3.7). This problem is quite apparent in the 3-D and 2-D plots of Fig. 5.10e and g , which were computed with MATLAB using function atan2. The corrected phase responses are depicted in Fig. 5.10h and i . Incidentally, the phase response continues to have discontinuities after correction but these are legitimate. They are caused by the zeros in Fig. 5.10a . 236 DIGITAL SIGNAL PROCESSING 5 0 5 Phase shift, rad 10 15 20 25 30 2 jIm z 0 2 2 1 (h) 5 0 5 Phase shift, rad 10 15 20 25 30 10 0 Re z 1 2 5 0 Frequency, rad/s (i) 5 10 Figure 5.10 Contd Frequency response of lowpass lter: (h ) Corrected plot of arg H (e j T ) versus z , (i ) corrected plot of () versus . Example 5.10 The discrete-time system shown in Fig. 5.11 is a nonrecursive lter. The multiplier constants are A0 = 0.3352 A1 = 0.2540 A2 = 0.0784 THE APPLICATION OF THE Z TRANSFORM 237 A1 A1 A2 X(z) A0 Y(z) A2 Figure 5.11 Fourth-order, nonrecursive lter (Example 5.10). and the sampling frequency is s = 20 rad/s. (a ) Construct the zero-pole plot of the lter. (b) Plot the surface | H (z )| as a function of z = Re z + j Im z . (c) Obtain expressions for the amplitude and phase responses. (d ) Plot the amplitude and phase responses rst in terms of 3-D plots and then in terms of 2-D plots. Solution (a ) The transfer function of the lter can be readily obtained by inspection as H (z ) = A2 + A1 z 1 + A0 z 2 + A1 z 3 + A2 z 4 = = A2 z 2 + A1 z + A0 + A1 z 1 + A2 z 2 z2 A2 z 4 + A1 z 3 + A0 z 2 + A1 z + A2 z4 (5.36a) (5.36b) (5.36c) From Eq. (5.36c), we note that the lter has four zeros and a fourth-order pole at the origin. Using MATLAB, the zeros can be obtained as z 1 = 1.5756 z 2 = 0.6347 z 3 , z 4 = 0.5148 j 0.8573 Hence the zero-pole plot of Fig. 5.12a can be obtained. We note that the high-order pole at the origin tends to create high gain at low frequencies, whereas the zeros tend to produce low gain at high frequencies. Thus, the system must be a lowpass lter. 238 DIGITAL SIGNAL PROCESSING 2 1 j Im z 0 1 2 2 1 0 Re z (a) 1 2 100 |H(z)|, dB 50 0 50 2 1 0 jIm z 1 1 2 2 (b) 1 0 Re z 2 Figure 5.12 Frequency response of lowpass lter (Example 5.10): (a ) Zero-pole plot, (b) plot of 20 log | H (z )| versus z = Re z + j Im z . (b) The 3-D plot of 20 log | H (z )| versus z is shown in Fig. 5.12b. (c) From Eq. (5.36b), we have H (e j T ) = A2 (e j 2 T + e j 2 T ) + A1 (e j T + e j T ) + A0 e j 2 T 2 A2 cos 2 T + 2 A1 cos T + A0 = e j 2 T THE APPLICATION OF THE Z TRANSFORM 239 0 10 Gain, dB 20 30 40 50 60 2 1 0 jIm z 1 1 2 2 (c) 1 0 Re z 2 5 0 Phase shift, rad 5 10 15 20 2 1 0 jIm z 2 1 1 2 2 (d ) 0 1 Re z Figure 5.12 Contd Frequency response of lowpass lter (Example 5.10): (c) Plot of 20 log | H (e j T )| versus z , (d ) corrected plot of arg H (e j T ) versus z . 240 DIGITAL SIGNAL PROCESSING 0 10 20 Gain, dB 30 40 50 60 10 5 0 Frequency, rad/s (e) 5 10 5 0 Phase shift, rad 5 10 15 20 10 5 0 Frequency, rad/s (f) 5 10 Figure 5.12 Contd Frequency response of lowpass lter (Example 5.10): (e) Plot of 20 log M () versus , ( f ) corrected plot of () versus . THE APPLICATION OF THE Z TRANSFORM 241 and so M () = |2 A2 cos 2 T + 2 A1 cos T + A0 | () = N 2 T where N = 0 if 2 A2 cos 2 T + 2 A1 cos T + A0 0 otherwise (d ) The amplitude and phase responses are depicted in Fig. 5.12c and d as 3-D plots and in Fig. 5.12e and f as 2-D plots. An interesting property of nonrecursive lters is that they can have a linear phase response, as can be seen in Fig. 5.12 f . This is an important feature that makes nonrecursive lters attractive in a number of applications. Example 5.11 A recursive digital lter is characterized by the transfer function 3 H (z ) = H0 i =1 Hi (z ) where Hi (z ) = a0i + a1i z + z 2 b0i + b1i z + z 2 and the numerical values of the coefcients are given in Table 5.4. The sampling frequency is 20 rad/s. (a ) Construct the zero-pole plot of the lter. (b) Plot the surface | H (z )| as a function of z = Re z + j Im z . (c) Obtain expressions for the amplitude and phase responses. (d ) Plot the amplitude and phase responses rst in terms of 3-D plots and then in terms of 2-D plots. Table 5.4 Transfer-function coefcients for Example 5.11 i 1 2 3 a0i 1.0 1.0 1.0 a1i 0.0 1.275258 1.275258 b0i 8.131800E1 9.211099E1 9.211097E1 b1i 7.870090E8 5.484026E1 5.484024E1 H0 = 1.763161 E 2 242 DIGITAL SIGNAL PROCESSING Solution (a ) The zeros and poles of the transfer function can be readily obtained as z 1 , z 2 = 1 z 3 , z 4 = 0.6376 j 0.7703 z 5 , z 6 = 0.6376 j 0.7703 and p1 , p2 = j 0.9018 p3 , p4 = 0.2742 j 0.7703 p5 , p6 = 0.2742 j 0.7703 respectively. Hence the zero-pole plot depicted in Fig. 5.13a can be readily constructed. Since there is a cluster of poles close to the unit circle at T /2 and zeros at (1, 0) and (1, 0), the recursive lter must be a bandpass lter which will select frequencies closed to = /2T . (b) The 3-D plot of 20 log | H (z )| versus z depicted in Fig. 5.13b demonstrates clearly that this is a bandpass lter. (c) The frequency response of the lter can be obtained as H (z ) |z e j T = H (e j T ) = M ()e j () with 3 3 M () = | H0 | i =1 Hi (e j T ) = | H0 | i =1 Mi () and 3 3 () = arg H0 + i =1 arg Hi (e j T ) = i =1 i () where Mi () = Hi (e j T ) = = a0i + a1i e j T + e j 2 T b0i + b1i e j T + e j 2 T (a0i + a1i cos T + cos 2 T ) + j (a1i sin T + sin 2 T ) (b0i + b1i cos T + cos 2 T ) + j (b1i sin T + sin 2 T ) 1 2 (a0i + a1i cos T + cos 2 T )2 + (a1i sin T + sin 2 T )2 = (b0i + b1i cos T + cos 2 T )2 + (b1i sin T + sin 2 T )2 2 2 1 + a0i + a1i + 2(1 + a0i )a1i cos T + 2a0i cos 2 T = 2 2 1 + b0i + b1i + 2(1 + b0i )b1i cos T + 2b0i cos 2 T 1 2 THE APPLICATION OF THE Z TRANSFORM 243 2 1 jIm z 0 1 2 2 1 0 Re z (a) 1 2 40 20 |H(z)|, dB 0 20 40 60 2 1 0 jIm z 2 1 1 2 2 1 0 Re z (b) Figure 5.13 Frequency response of bandpass lter (Example 5.11): (a ) Zero-pole plot, (b) plot of 20 log | H (z )| versus z = Re z + j Im z . and i () = arg Hi (e j T ) = arg = arg a0i + a1i e j T + e j 2 T b0i + b1i e j T + e j 2 T (a0i + a1i cos T + cos 2 T ) + j (a1i sin T + sin 2 T ) (b0i + b1i cos T + cos 2 T ) + j (b1i sin T + sin 2 T ) 244 DIGITAL SIGNAL PROCESSING 0 10 M(), dB 20 30 40 50 60 2 1 0 jIm z 1 1 2 2 (c) 1 0 Re z 2 0 10 () 20 30 2 1 0 jIm z 1 2 2 1 0 Re z 1 2 (d ) Figure 5.13 Contd Frequency response of bandpass lter (Example 5.11): (c) Plot of 20 log | H (e j T )| versus z , (d ) corrected plot of arg | H (e j T )| versus z . = tan1 a1i sin T + sin 2 T a0i + a1i cos T + cos 2 T b1i sin T + sin 2 T tan1 b0i + b1i cos T + cos 2 T The 3-D plots for the amplitude and phase responses are depicted in Fig. 5.13c and d and the corresponding 2-D plots can be readily obtained from the above expressions as shown in Fig. 5.13e and f . As can be seen from these plots, the system being analyzed is denitely a bandpass lter. THE APPLICATION OF THE Z TRANSFORM 245 0 10 20 M(), dB 30 40 50 60 10 5 0 Frequency, rad/s (e) 5 10 5 0 5 10 (), rad 15 20 25 30 35 10 5 0 Frequency, rad/s (f ) 5 10 Figure 5.13 Contd Frequency response of bandpass lter (Example 5.11): (e) Plot of 20 log M () versus , ( f ) corrected plot of () versus . 5.6 TRANSFER FUNCTIONS FOR DIGITAL FILTERS In the previous section, we have demonstrated that the ltering action of a discrete-time system depends critically on the patterns formed by the zeros and poles of the transfer function in the z plane. In this section, we show that a set of standard low-order transfer functions can be derived through the judicious choice of the zero/pole locations. 246 DIGITAL SIGNAL PROCESSING 5.6.1 First-Order Transfer Function A rst-order transfer function can only have a real zero and a real pole, i.e. it must be of the form H (z ) = z z0 z p0 and to ensure that the system is stable, the pole must satisfy the condition 1 < p0 < 1. The zero can be anywhere on the real axis of the z plane. If the pole is close to point (1, 0) and the zero is close to or at point (1, 0), then we have a lowpass lter; if the zero and pole positions are interchanged, then we get a highpass lter. Certain applications call for discrete-time systems that have a constant amplitude response and a varying phase response. Such systems can be constructed by using allpass transfer functions. A rst-order allpass transfer function is of the form H (z ) = z 1/ p 0 p0 z 1 = p0 z p0 z p0 where the zero is the reciprocal of the pole. The frequency response of a system characterized by H (z ) is given by H (e j T ) = p0 e j T 1 p0 cos T + j p0 sin T 1 = j T p e cos T + j sin T p0 0 and hence the amplitude and phase responses can be obtained as M () = p0 cos T 1 + j p0 sin T cos T p0 + j sin T 1 2 ( p0 cos T 1)2 + ( p0 sin T )2 = (cos T p0 )2 + (sin T )2 and () = tan1 respectively. =1 p0 sin T sin T tan1 p0 cos T 1 cos T p0 5.6.2 Second-Order Transfer Functions LOWPASS TRANSFER FUNCTION. As was shown earlier, a system whose poles and zeros are located in the sectors p pi p and z zi z , respectively, where p and z are positive angles such that z > p is a lowpass lter. Hence a lowpass second-order transfer function can be constructed by placing a complex-conjugate pair of poles anywhere inside the unit circle and a pair of zeros at the Nyquist point, as shown in Fig. 5.14a . Such a transfer function can THE APPLICATION OF THE Z TRANSFORM 247 2 1 jIm z 0 1 2 2 1 0 Re z (a) 1 2 50 40 30 20 Gain, dB 10 r = 0.50 r = 0.99 0 r = 0.99 0.5 1.0 r = 0.50 Phase shift, rad 10 1.5 2.0 2.5 3.0 3.5 0 10 20 30 0 5 Frequency, rad/s 0 5 Frequency, rad/s 10 (b) Figure 5.14 responses. Frequency response of second-order lowpass lter: (a ) Zero-pole plot, (b) amplitude and phase be constructed as HL P (z ) = z 2 + 2z + 1 (z + 1)2 =2 j )(z r e j ) (z r e z 2r (cos )z + r 2 (5.37) where 0 < r < 1. As the poles move closer to the unit circle, the amplitude response develops a peak at frequency = / T while the slope of the phase response tends to become steeper and steeper at that frequency, as illustrated in Fig. 5.14b. 248 DIGITAL SIGNAL PROCESSING HIGHPASS TRANSFER FUNCTION. If the zeros and poles of a system are located in the sectors z zi z and p pi p , where z and p are positive angles such that p > z , then the system is a highpass lter. A highpass transfer function can be readily obtained form Eq. (5.37) by simply moving the zeros from point (1, 0) to (1, 0) as in Fig. 5.15a , that is, H H P (z ) = z2 (z 1)2 (z 2 2z + 1) =2 2 2r (cos )z + r z 2r (cos )z + r 2 (5.38) The amplitude and phase responses obtained are shown in Fig. 5.15b. 2 1 jIm z 0 1 2 2 1 0 Re z (a) 1 2 50 40 30 20 Gain, dB 10 r = 0.50 r = 0.99 3.5 3.0 2.5 Phase shift, rad r = 0.50 r = 0.99 2.0 1.5 1.0 0.5 0 0 10 20 30 0 5 Frequency, rad/s 10 (b) 0 5 Frequency, rad/s 10 Figure 5.15 Frequency response of second-order highpass lter: (a ) Zero-pole plot, (b) amplitude and phase responses. THE APPLICATION OF THE Z TRANSFORM 249 BANDPASS TRANSFER FUNCTION. In a bandpass system, a cluster of poles is sandwiched between clusters of zeros in the neighborhoods of points (1, 0) and (1, 0). A second-order bandpass transfer function can be obtained from the lowpass transfer function of Eq. (5.37) by moving one zero from point (1, 0) to (1, 0), as shown in Fig. 5.16a . The transfer function assumes the form H B P (z ) = z2 z2 1 2r (cos )z + r 2 (5.39) and some typical amplitude and phase responses are shown in Fig. 5.16b. 2 1 jIm z 0 1 2 2 1 0 Re z (a) 1 2 40 30 20 10 r = 0.50 r = 0.99 2 r = 0.99 1 r = 0.50 Phase shift, rad 10 (b) Gain, dB 0 0 10 20 30 1 0 5 Frequency, rad/s 2 0 5 Frequency, rad/s 10 Figure 5.16 Frequency response of second-order bandpass lter: (a ) Zero-pole plot, (b) amplitude and phase responses. 250 DIGITAL SIGNAL PROCESSING NOTCH TRANSFER FUNCTION. A notch system is one that has a notch in its amplitude response, as may be expected, and such a response can be achieved by placing a complex-conjugate pair of zeros on the unit circle, as illustrated in Fig. 5.17a . The transfer function of such a system assumes the form z 2 2(cos )z + 1 H N (z ) = 2 (5.40) z 2r (cos )z + r 2 and as can be seen in Fig. 5.17b three types of behavior can be achieved depending on the relative location of the zeros in relation to the poles. If > , then a lowpass notch lter is obtained and if > , then a highpass notch is the outcome. The case, = will yield a lter that will reject frequencies in the neighborhood of = / T , and such a lter is usually referred to as a bandstop lter. 1 jIm z 1 1 0 0 0 1 1 1 1 1 0 1 0 Re z (a) 1 1 0 1 30 = /4 = = 3/4 4 3 20 2 10 Phase shift, rad 0 5 Frequency, rad/s 10 (b) 1 0 1 2 20 3 4 Gain, dB 0 10 30 0 5 Frequency, rad/s 10 Figure 5.17 Frequency response of second-order notch lter ( = /2): (a ) Zero-pole plots, (b) amplitude and phase responses. THE APPLICATION OF THE Z TRANSFORM 251 ALLPASS TRANSFER FUNCTION. An N th-order allpass transfer function with a denominator polynomial b0 + b1 z + + b N 1 z N 1 + b N z N can be obtained by constructing a corresponding numerator polynomial b N + b N 1 z + + b1 z N 1 + b0 z N by simply reversing the order of the coefcients. Hence a second-order allpass transfer function can be obtained as H A P (z ) = r 2 z 2 2(cos )z + 1 z 2 2r (cos )z + r 2 (5.41) As in the rst-order allpass transfer function, the zeros of the second-order allpass transfer function are the reciprocals of the poles (see Prob. 5.31). To demonstrate that this is indeed an allpass transfer function, we note that M A P () = | H A P (e j T )| = H A P (e j T ) H A P (e j T ) 1 2 = H A P (e j T ) H A P (e j T ) and hence M A P () = = H A P (z ) H A P (z ) 1 1 2 z =e j T 1 2 r 2 z 2 + 2(cos )z + 1 r 2 z 2 + 2(cos )z 1 + 1 z 2 + 2r (cos )z + r 2 z 2 + 2r (cos )z 1 + r 2 r 2 z 2 + 2(cos )z + 1 r 2 + 2(cos )z + z 2 z 2 + 2r (cos )z + r 2 1 + 2r (cos )z + z 2r 2 1 2 z =e j T 1 2 = z =e j T =1 As in the rst-order allpass transfer function, the zeros of a second-order (also an N th-order) transfer function are the reciprocals of corresponding poles. As will be shown in the next section, a nonlinear phase response in a lter would lead to phase distortion which is undesirable in certain applications. Some of the design methods for recursive lters to be explored later on in Chap. 11 tend to yield lters with nonlinear phase responses. The phase responses of these lters can be linearized through the use of allpass systems known as delay equalizers (see Sec. 16.8). 5.6.3 Higher-Order Transfer Functions Higher-order transfer functions can be obtained by forming products or sums of rst- and/or secondorder transfer functions. Methods for obtaining transfer functions that will yield specied frequency responses will be explored in later chapters. 5.7 AMPLITUDE AND DELAY DISTORTION In practice, a discrete-time system can distort the information content of a signal to be processed as will now be demonstrated. 252 DIGITAL SIGNAL PROCESSING Consider an application where a digital lter characterized by a transfer function H (z ) is to be used to select a specic signal xk (nT ) from a sum of signals m x (nT ) = i =1 xi (nT ) Let the amplitude and phase responses of the lter be M () and (), respectively. Two parameters associated with the phase response are the absolute delay a () and the group delay g () which are dened as a () = g () = () d () d (5.42a) (5.42b) As functions of frequency, a () and g () are known as the absolute-delay and group-delay characteristics. Now assume that the amplitude spectrum of signal xk (nT ) is concentrated in frequency band B given by B = { : L H } as illustrated in Fig. 5.18. Also assume that the lter has amplitude and phase responses M () = and () = g + 0 for B (5.44) G0 0 for B otherwise (5.43) respectively, where G 0 and g are constants. The z transform of the output of the lter is given by m m Y (z ) = H (z ) X (z ) = H (z ) i =1 X i (z ) = i =1 H (z ) X i (z ) G() L B (e) H Figure 5.18 Amplitude spectrum of a sum of signals. THE APPLICATION OF THE Z TRANSFORM 253 and thus the frequency spectrum of the output signal is obtained as m Y (e j T ) = i =1 m H (e j T ) X i (e j T ) M ()e j () X i (e j T ) i =1 = Hence from Eqs. (5.43)(5.45), we have (5.45) Y (e j T ) = G 0 e j g + j 0 X k (e j T ) since all signal spectrums except X k (e j T ) will be multiplied by zero. If we let g = mT where m is a constant, we can write Y (z ) = G 0 e j 0 z m X k (z ) Therefore, from the time-shifting theorem of the z transform (Theorem 3.4), we deduce the output of the lter as y (nT ) = G 0 e j 0 xk (nT mT ) That is, if the amplitude response of the lter is constant with respect to frequency band B and zero elsewhere and its phase response is a linear function of , that is, the group delay is constant in frequency band B, then the output signal is a delayed replica of signal xk (nT ) except that a constant multiplier G 0 e j 0 is introduced. If the amplitude response of the system is not constant in frequency band B , then the so-called amplitude distortion will be introduced since different frequency components of the signal will be amplied by different amounts. On the other hand, if the group delay is not constant in band B , different frequency components will be delayed by different amounts, and delay (or phase) distortion will be introduced. Amplitude distortion can be quite objectionable in practice. Consequently, the amplitude response is required to be at to within a prescribed tolerance in each frequency band that carries information. If the ultimate receiver of the signal is the human ear, e.g., when a speech or music signal is to be processed, delay distortion turns out to be quite tolerable. However, in other applications it can be as objectionable as amplitude distortion, and the delay characteristic is required to be fairly at. Applications of this type include data transmission where the signal is to be interpreted by digital hardware and image processing where the signal is used to reconstruct an image which is to be interpreted eventually by the human eye. From Eq. (5.42a), we note that the absolute delay a () is constant if the phase response is linear at all frequencies. In such a case, the group delay is also constant and, therefore, delay distortion can also be avoided by ensuring that the absolute delay is constant. However, a constant absolute delay is far more difcult to achieve in practice since the phase response would need to be linear at all frequencies.4 4 This is why the absolute delay is hardly ever mentioned in DSP and communications textbooks. 254 DIGITAL SIGNAL PROCESSING REFERENCES [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] G. Strang, Introduction to Linear Algebra, 3rd ed., MA: Wellesley-Cambridge Press, 2003. P. Lancaster and M. Tismenetsky, The Theory of Matrices, 2nd ed., New York: Academic, 1985. E. I. Jury, Theory and Application of the Z -Transform Method, New York: Wiley, 1964. E. I. Jury, Inners and Stability of Dynamical Systems, New York: Wiley-Interscience, 1974. N. K. Bose, Digital Filters, New York: North-Holland, 1985. E. I. Jury, A simplied stability criterion for linear discrete systems, Proc. IRE, vol. 50, pp. 14931500, June 1962. B. D. O. Anderson and E. I. Jury, A simplied Schur-Cohn test, IEEE Trans. Automatic Control, vol. 18, pp. 157163, Apr. 1973. M. Marden, The Geometry of the Zeros of a Polynomial in a Complex Variable, New York: Amer. Math. Soc., pp. 152157, 1949. H. Freeman, Discrete-Time Systems, New York: Wiley, 1965. S. J. Hammarling, Numerical solution of the stable, non-negative denite Lyapunov equation, IMA J. Numer. Anal., vol. 2, pp. 303323, 1982. PROBLEMS 5.1. 5.2. 5.3. 5.4. Derive the transfer functions of the systems in Fig. P4.5a and b. Derive the transfer functions of the systems in Fig. P4.6a and b. Derive the transfer functions of the systems in Fig. P4.7 and P4.8. A recursive system is characterized by the equations y (nT ) = y1 (nT ) + 7 y (nT T ) 4 y1 (nT ) = x (nT ) + 1 y1 (nT T ) 2 Obtain its transfer function. 5.5. A system is represented by the state-space equations q(nT + T ) = Aq(nT ) + bx (nT ) y (nT ) = cT q(nT ) + d x (nT ) where 0 10 0 0 1 A= 1 1 1 2 2 2 Deduce its transfer function. 5.6. Show that H (z ) = M i =0 49 y (nT 32 2T ) 0 b= 0 1 cT = 755 222 d=1 ai z M i N i =1 zN + bi z N i represents a causal system only if M N . 5.7. (a ) Find the impulse response of the system shown in Fig. 5.2. (b) Repeat part (a ) for the system of Fig. 5.4. 5.8. Obtain the impulse response of the system in Prob. 5.4. Sketch the response. THE APPLICATION OF THE Z TRANSFORM 255 5.9. At z = pi , F (z ) is analytic and G (z ) has a simple pole. Show that Res [ F (z )G (z )] = F ( pi ) Res G (z ) z = pi z = pi 5.10. (a ) In Sec. 5.3.1, it was shown that a system with simple poles is stable if and only if its poles are inside the unit circle of the z plane. Show that this constraint applies equally well to a system that has one or more second-order poles. (b) Indicate how you would proceed to conrm the validity of the stability constraint in part (a ) for the case where the system has one or more poles of order higher than two. 5.11. Starting from rst principles, show that H (z ) = represents a stable system. 5.12. (a ) A recursive system is represented by H (z ) = Check the system for stability. (b) Repeat part (a ) if H (z ) = 6z 6 + 5z 5 (z + 2)2 4z 4 + 3z 3 + 2z 2 + z + 1 + + z6 + 3z 3 + 2z 2 + z + 1 z z 14 4 6z 6 5z 5 4z 4 5.13. (a ) Check the system of Fig. P5.13a for stability. (b) Check the system of Fig. P5.13b for stability. x(nT ) 2 3 4 5 y(nT ) (a) x(nT ) 2 2 y(nT ) 3 2 4 (b) Figure P5.13a and b 256 DIGITAL SIGNAL PROCESSING 5.14. (a ) A system is characterized by the difference equation y (nT ) = x (nT ) 1 x (nT T ) 1 x (nT 2T ) 1 x (nT 3T ) 1 x (nT 4T ) 2 3 4 5 By using appropriate tests, check the stability of the system. (b) Repeat part (a ) for the system represented by the equation y (nT ) = x (nT ) 1 y (nT T ) 1 y (nT 2T ) 1 y (nT 3T ) 1 y (nT 4T ) 2 3 4 5 5.15. Obtain (a ) the transfer function, (b) the impulse response, and (c) the necessary condition for stability for the system of Fig. P5.15. The constants m 1 and m 2 are given by m 1 = 2r cos and m2 m 2 = r 2 m1 x(nT ) y(nT ) Figure P5.15 5.16. A system is characterized by the transfer function H (z ) = z4 + mz 2 + z + 1 4z 4 + 3z 3 Find the range of m that will result in a stable system. 5.17. Find the permissible range for m in Fig. P5.17 if the system is to be stable. x(nT ) 2 y(nT ) m 1 2 Figure P5.17 THE APPLICATION OF THE Z TRANSFORM 257 5.18. A system is characterized by the transfer function H (z ) = Derive an expression for its unit-step response. 5.19. A system is characterized by the transfer function H (z ) = 32z z 1 2 1 + z2 1 4 (a ) Find the response of the system at t = 4T using the convolution summation if the excitation is x (nT ) = (5 + n )u (nT ) (b) Give a graphical construction for the convolution in part (a ) indicating relevant quantities. 5.20. Repeat part (a ) of Prob. 5.19 using the general inversion formula in Eq. (3.8). 5.21. A system is characterized by the transfer function H (z ) = z2 z + 1 z 2 z + 0.5 Obtain its unit-step response. 5.22. Find the unit-step response of the system shown in Fig. 5.2. 5.23. Find the unit-ramp response of the system shown in Fig. 5.4 if T = 1 s. 5.24. The input excitation in Fig. 5.2 is n x (nT ) = 4 n 0 for 0 n 2 for 2 < n 4 for n > 4. Determine the response for 0 n 5 by using the z transform. 5.25. Repeat Prob. 4.24 by using the z transform. For each of the three cases deduce the exact frequency of the transient oscillation and also the steady-state value of the response if T = 1 s. 5.26. A system has a transfer function H (z ) = (a ) Find the response if x (nT ) = u (nT ) sin nT (b) Deduce the steady-state sinusoidal response. 5.27. A system is characterized by H (z ) = 1 (z r )2 1 + z2 1 4 258 DIGITAL SIGNAL PROCESSING x(nT ) 2 3 2 y(nT ) Figure P5.29 where |r | < 1. Show that the steady-state sinusoidal response is given by y (nT ) = M () sin[nT + ()] where and () = arg H (e j T ) M () = | H (e j T )| 5.28. (a ) In Sec. 5.5.1 it was shown that the steady-state sinusoidal response of a system with simple poles is given by Eq. (5.30). Show that this equation is also valid for a system with one or more second-order poles. (b) Indicate how you would proceed to show that Eq. (5.30) applies equally well to a system with one or more poles of order higher than two. 5.29. Figure P5.29 depicts a nonrecursive system. (a ) Derive an expression for its amplitude response. (b) Derive an expression for its phase response. (c) Calculate the gain in dB at = 0, s /4, and s /2 (s is the sampling frequency in rad/s). (d ) Calculate the phase-shift in degrees at = 0, s /4, and s /2. 5.30. The discrete-time signal x (nT ) = u (nT ) sin nT is applied to the input of the system in Fig. P5.30. (a ) Give the steady-state time-domain response of the system. (b) Derive an expression for the amplitude response. (c) Derive an expression for the phase response. (d ) Calculate the gain and phase shift for = /4T rad/s. 2 x(nT ) 0.5 y(nT ) Figure P5.30 5.31. Show that the poles of the allpass transfer function in Eq. (5.41) are the reciprocals of the zeros. 5.32. Figure P5.32 shows a nonrecursive system. (a ) Derive expressions for the amplitude and phase responses. (b) Determine the transmission zeros of the system, i.e., zero-gain frequencies. THE APPLICATION OF THE Z TRANSFORM 259 (c) Sketch the amplitude and phase responses. x(nT ) 2 cos 0T y(nT ) Figure P5.32 5.33. Show that the equation y (nT ) = x (nT ) + 2x (nT T ) + 3x (nT 2T ) + 4x (nT 3T ) + 3x (nT 4T ) + 2x (nT 5T ) + x (nT 6T ) represents a constant-delay system. 5.34. Derive expressions for the amplitude and phase responses of the system shown in Fig. 5.4. 5.35. Table P5.35 gives the transfer function coefcients of four digital lters labeled A to D . Using MATLAB, compute and plot 20 log M () versus in the range 0 to 5.0 rad/s. On the basis of the plots obtained, identify a lowpass, a highpass, bandpass, and a bandstop lter. Each lter has a transfer function of the form 2 H (z ) = H0 i =1 a0i + a1i z + a0i z 2 b0i + b1i z + z 2 and the sampling frequency is 10 rad/s in each case. Table P5.35 Filter i 1 A 2 1 B 2 1 C 2 1 D 2 Transfer-function coefcients for Prob. 5.35 a0i a 1i b0i b1i 1.561833 E 1 2.168171 E 1 4.944635 E 1 2.222545 E 1 4.445091 E 1 4.520149 E 2 3.085386 E 1 6.170772 E 1 4.509715 E 1 H0 = 1.0 5.490566 9.752955 7.226400 E 1 5.871082 E 1 1.042887 H0 = 2.816456 E 2 1.747744 E 1 1.399382 9.208915 2.300089 1.517270 E 8 5.741567 E 1 7.226400 E 1 4.944634 E 1 1.224608 1.214846 E 7 5.741567 E 1 1.224608 1.561801 E + 1 5.087094 E 1 1.291110 1.721670 8.092186 E 1 1.069291 H0 = 8.912509 E 1 H0 = 6.669086 E 4 5.36. Show that the gain and phase shift in a digital lter satisfy the relations M (s ) = M () and (s ) = () This page intentionally left blank CHAPTER 6 THE SAMPLING PROCESS 6.1 INTRODUCTION The sampling process was briey reviewed in Chap. 1 and there was reason to refer to it in Sec. 3.9.3. In this chapter, it is treated in some detail both from a theoretical as well as practical point of view. The sampling process involves several aspects that need to be addressed in detail, as follows: The constituent components of a sampling system The underlying principles that make the sampling process possible The applications of the sampling process The imperfections introduced through the use of practical components The sampling process requires several components. Converting a continuous- to a discretetime signal would require some sort of a switch. However, a sampling system that uses just a simple switch would introduce a certain kind of signal distortion known as aliasing if the signal is not bandlimited. Continuous-time signals, man-made or otherwise, are only approximately bandlimited, at best, and almost always they must be preprocessed by suitable analog lowpass lters to render them bandlimited so as to prevent aliasing. At some point, a discrete-time signal would need to be converted back to a continuous-time signal and this conversion requires some sort of a sampleand-hold device. In practice, devices of this type tend to produce a noisy version of the required continuous-time signal and once again a suitable analog lowpass lter would be required to remove the noise introduced. 261 Copyright 2006 by The McGraw-Hill Companies, Inc. Click here for terms of use. 262 DIGITAL SIGNAL PROCESSING The one mathematical principle that makes the sampling process workable is the sampling theorem. The validity of this theorem can be demonstrated by examining the relationships that exist between the spectrums of continuous- and discrete-time signals. A most important relation in this respect is the so-called Poissons summation formula which gives the frequency spectrum of a discrete-time signal in terms of the spectrum of the underlying continuous-time signal. The connection between the spectral properties of discrete- and continuous-time signals is made by examining a class of signals referred to here as impulse-modulated signals. These are both sampled as well as continuous in time and, therefore, they share common characteristics with discrete-time signals on the one hand and continuous-time signals on the other. Consequently, they serve as a bridge between the discrete- and continuous-time worlds. The dual personality of impulse-modulated signals allows them to possess both a Fourier and a z transform and by examining the properties of these signals, some fundamental relations can be established between these transforms. From this link follow the spectral relationships between discrete- and continuous-time signals. The study of impulse-modulated signals requires a clear understanding of what are impulse functions and what are their spectral characteristics. This subject has received considerable attention throughout most of the twentieth century and some very rigorous theories have been proposed, for example, the treatment of impulse functions as generalized functions [1]. What these theories offer in rigor, they lack in practicality and, in consequence, they have not received the attention they deserve. At the other extreme, authors often dene impulse functions in terms of thin tall pulses which are easy to reproduce in the lab but which lack the mathematical sophistication of generalized functions. In order to obtain a true impulse function, the duration of the pulse must be made innitesimally small and its amplitude must be made innitely large but this limiting operation is fraught with perils and pitfalls. In this chapter, a somewhat new way of looking at impulse functions is proposed which provides practical solutions to the classical DSP problems without compromising mathematical principles. Through the sampling process, digital lters can be used to process continuous-time signals. The continuous-time signal is rst converted to a discrete-time signal, which is then processed by a digital lter. Subsequently, the processed discrete-time signal is converted back to a continuous-time signal. Once we establish a relation between analog and digital lters, in addition to our being able to use digital lters to perform analog-lter functions we can also design digital lters by using analog lter methodologies. In fact, some of the better innite-duration impulse response (IIR) digital lters are designed by transforming analog into digital lters. In addition to analog lters, switches, and sample-and-hold devices, a sampling system also uses quantizers and encoders. All these components have imperfections that need to be examined carefully. In this chapter, the Fourier transform theory of Chap. 2 is rst extended to impulse functions and then to periodic and impulse-modulated signals. On the basis of these principles, Poissons summation formula is derived in a rather practical way. From this formula, the crucial interrelations that exist between the spectrums of continuous- and discrete-time signals are established. From these interrelations, the conditions that must be satised for a discrete-time signal to be a true representation of the underlying continuous-time signal become immediately obvious and the validity of the sampling theorem can be easily established. The chapter concludes by examining the imperfections introduced by the various components of the sampling system. THE SAMPLING PROCESS 263 6.2 6.2.1 FOURIER TRANSFORM REVISITED Impulse Functions The properties and theorems of the Fourier transform described in Sec. 2.3.3 apply to the extent that the convergence theorem (Theorem 2.5) is satised. In practice, a number of important signals are not absolutely integrable and, therefore, two situations can arise: Either the integral in Eq. (2.27) or that in Eq. (2.29) does not converge. Signals of this category include impulse signals and the entire class of periodic signals. We will show in this section that many of the mathematical difculties associated with these signals can be circumvented by paying particular attention to the denition of impulse functions. Impulse signals are used in many applications and are part and parcel of the sampling process, as will be demonstrated later on in this chapter; consequently, their properties, spectral or otherwise, must be clearly understood by the DSP practitioner. Such signals can be modeled in terms of impulse functions. A unit impulse function that has been used for many years can be generated by scaling the amplitude of the pulse signal in Example 2.5a from unity to 1/ , that is, p (t ) = 1 p (t ) = 1 0 for |t | /2 otherwise (6.1) The Fourier transform of this pulse is obtained from Example 2.5a as F p (t ) = 1 2 sin /2 F p (t ) = (6.2) Evidently, as approaches zero, the pulse in Eq. (6.1) becomes very thin and very tall, as can be seen in Fig. 6.1a but the area of the pulse remains constant and equal to unity. As long as is nite, the absolute integrability of the signal is assured and, therefore, it would satisfy Theorem 2.5. If we now attempt to nd the Fourier transform of the pulse as 0, we get F lim p (t ) = 0 0 lim p (t )e j t dt = /2 /2 0 lim p (t )e j t dt If we now attempt to evaluate the limit lim 0 [ p (t )e j t ], we nd that it becomes unbounded at = 0 and, therefore, the above integral cannot be evaluated. More formally, the integral does not exist in the Riemann sense of a denite integral (see pp. 217221 of Kaplan [2]). However, since the denite integral of a real function of t would give the area bounded by the graph of the function and the t axis, we might be tempted to write F lim p (t ) = 0 /2 /2 0 /2 lim p (t )e j t dt lim p (t ) dt = 1 /2 0 264 DIGITAL SIGNAL PROCESSING 25 = 0.50 = 0.10 = 0.05 20 15 p (t) 10 5 0 1 0 (a) t 1 1.2 1.0 0.8 sin ( / 2)/( / 2) 0.6 0.4 0.2 0 0.2 0.4 40 30 2 2 d = 0.50 = 0.10 = 0.05 10 0 (b) 10 20 20 w 30 40 Figure 6.1 Impulse function: (a ) Pulse function for three values of , (b) corresponding Fourier transform. since e j t 1 for /2 t /2 with 0 and the area of the pulse p (t ) is equal to unity and remains unity as 0. Many authors have taken this approach in the past [3]. Interestingly, the Fourier transform obtained in the above analysis is consistent with the limit of the Fourier transform of the pulse given by Eq. (6.2), that is, 0 lim F p (t ) = lim 0 2 sin /2 =1 THE SAMPLING PROCESS 265 Now, if we attempt to nd the inverse Fourier transform of 1, we run into certain mathematical difculties. From Eq. (2.29), we have F 1 1 = 1 2 1 = 2 e j t d cos t d + j sin t d Mathematicians will tell us that these integrals do not converge or do not exist1 and, therefore, we conclude that the inverse Fourier transform of 1 does not satisfy Eq. (2.29). Dening a unit impulse function in terms of an innitesimally thin, innitely tall pulse is obviously problematic. However, there are certain important practical advantages as well in using a thin, tall pulse. Specically, pulses are very easy to create in terms of electrical voltage or current waveforms and, in fact, we will use them later on in this chapter in the implementation of sampling systems. For this reason, we would like to dene the unit impulse function in terms of a thin, tall pulse but at the same time we would like to nd a way to avoid the above mathematical pitfalls. The above difculties can be circumvented in a practical way by dening impulse functions in terms of the way they interact with other functions under integration while adopting a somewhat practical interpretation of the limit of a function. In this approach, a function (t ) is said to be a unit impulse function if for a function x (t ) which is continuous for |t | < , we have (t )x (t ) dt x (0) (6.3) where the symbol is used to indicate that the relation is approximate in the very special sense that the integral at the left-hand side can be made to approach the value of x (0) to any desired degree of precision. Now consider the pulse function p (t ) = lim p (t ) = 1 0 for |t | /2 otherwise with =0 (6.4) where is a small but nite constant. If we let (t ) = p (t ) then Eqs. (6.3) and (6.4) yield lim p (t )x (t ) dt = /2 /2 1 x (t ) dt 1 /2 x (0) /2 dt x (0) 1 Presumably the values of these integrals would depend on the limiting behavior of the sine and cosine functions at innity but nobody seems to have come up with a reasonable answer for that so far! 266 DIGITAL SIGNAL PROCESSING and by making smaller and smaller the integral at the left-hand can be made to approach the value x (0) as closely as desired. In other words, the pulse function of Eq. (6.4) satises Eq. (6.3) and it is, therefore, an impulse function that can be represented, say, by (t ). From Eq. (6.4) and Table 2.1, we have lim p (t ) lim 2 sin /2 (6.5) As is reduced, the pulse at the left-hand side tends to become thinner and taller whereas the socalled sinc function at the right-hand side tends to be attened out as depicted in Fig. 6.1b. For some small value of , the sinc function will be equal to unity to within an error over a bandwidth /2 /2 as shown in Fig. 6.1b where is inversely related to , i.e., the smaller the the larger the . Evidently, for some sufciently small but nite , the sinc function would be approximately equal to unity over the frequency range /2 to /2 which could include all the frequencies of practical interest. Therefore, from Eq. (6.5), we can write (t ) = p (t ) and since i () = 2 sin /2 1 for || < /2 2 sin /2 = i () (6.6) function i () may be referred to as a frequency-domain unity function. Let us now examine the sinc function sinc (t ) = sin t t /2 This is, of course, a pulse-like function that tends to become thinner and taller as is increased, very much like the pulse in Fig. 6.1a , as can be seen in Fig. 6.2a . Now let us consider the function sinc /2 (t ) = lim sin t t /2 = sin t /4 t (6.7) /2 where is a large but nite constant. If we let (t ) = sinc /2 (t ) then Eqs. (6.3) and (6.7) yield sinc /2 (t )x (t ) dt = = sin t /4 x (t ) dt t sin t /4 x (t ) dt + t sin t /4 x (t ) dt t /2 /2 /2 sin t /4 x (t ) dt t (6.8a) + /2 THE SAMPLING PROCESS 267 0.8 0.6 =1 =2 =4 sinc (t) 0.4 0.2 0 0.2 20 10 0 (a) 10 t 20 1.5 =1 =2 =4 1.0 p () 0.5 0 6 4 2 0 (b) 2 4 6 Figure 6.2 Impulse function: (a ) Sinc function for three values of , (b) corresponding Fourier transforms. If (x ) is an absolutely integrable function and a and b are nite or innite constants, then b lim sin(t ) (t ) dt = 0 (6.8b) a according to the Riemann-Lebesque lemma [4]. Thus if x (t )/ t is absolutely integrable, the rst and the last integrals at the right-hand side in Eq. (6.8a) approach zero. Since x (t ) x (0)|t | /2 (6.8c) 268 DIGITAL SIGNAL PROCESSING Eqs. (6.8a)(6.8c) give give2 /2 sinc /2 (t )x (t ) dt /2 sin t /4 x (t ) dt t /2 /2 x (0) Now for a large , it is known that /2 /2 sin t /4 dt t (6.8d) sin t /4 t sin t /4 dt = 1 t (6.8e) (see pp. 280281 of Ref. [4]) and, therefore, Eqs. (6.8d) and (6.8e) give sinc /2 (t )x (t ) dt x (0) In effect, the sinc function of Eq. (6.7) satises Eq. (6.3) and we conclude, therefore, that sinc /2 (t ) is another impulse function that could be represented, say, by (t ). From Example 2.7, we have sin t where p () = and hence from Eq. (6.9), we can write (t ) = where i () = 1 for || /2 sin t /2 p () = i () t (6.10) 1 0 for || otherwise /2 t /2 p () (6.9) Like function i (), function i () behaves as a frequency-domain unity function as can be seen in Fig. 6.2b. In the above analysis, we have identied two distinct impulse functions, namely, (t ) and (t ) and we have demonstrated that their Fourier transforms are unity functions, as shown in Table 6.1. In fact, there are other Fourier transform pairs with these properties but the above two are entirely sufcient for the purposes of this textbook. Since the two impulse functions have the same properties, they are alternative but equivalent forms and each of the two transform pairs in Eqs. (6.6) and (6.10) can be represented by (t ) i () 2 See 278281 of Ref. [4] for a relevant discussion. THE SAMPLING PROCESS 269 Table 6.1 Impulse and unity functions (t ) p (t ) sin t /2 t i ( ) 2 sin /2 p () or even by the symbolic notation (t ) 1 (6.11) where the wavy, two-way arrow signies that the relation is approximate with the understanding that it can be made as exact as desired by making in Eq. (6.6) small enough or in Eq. (6.7) large enough. Symbolic graphs for the impulse and unity functions are shown in Fig. 6.3a . Some important properties of impulse functions, which will be found very useful in establishing the relationships between continuous- and discrete-time signals, can be stated in terms of the following theorem: Theorem 6.1A Properties of Time-Domain Impulse Functions Assuming that x (t ) is a continuous function of t for |t | < , the following relations hold: (a) (b) (c) (t )x (t ) dt = (t + )x (t ) dt x ( ) (t )x (t ) = (t + )x (t ) (t )x (t ) = (t )x (t ) (t )x ( ) (t )x (0) (t) i() 1 1 t (a) i(t) () 1 2 t (b) Figure 6.3 Fourier transforms of impulse and unity function: (a ) (t ) i (), (b) i (t ) 2 (). 270 DIGITAL SIGNAL PROCESSING Proof (a) From Eq. (6.6), we can write (t )x (t ) dt = p (t )x (t ) dt + /2 1 x ( ) dt /2 x ( ) (b) Let x (t ) and (t ) be continuous functions of t for |t | < . We can write (t )x (t ) (t ) dt = p (t )x (t ) (t ) dt + /2 1 x ( ) ( ) dt /2 x ( ) ( ) On the other hand, (6.13a) (t )x ( ) (t ) dt = p (t )x ( ) (t ) dt + /2 1 x ( ) ( ) dt /2 x ( ) ( ) From Eqs. (6.13a) and (6.13b), we have (6.13b) (t )x (t ) (t ) dt (t )x ( ) (t ) dt and, therefore, (t )x (t ) (t )x ( ) (6.14a) Since impulse functions, as dened above, are even functions of t , we have (t ) = (t ) and (t + ) = (t ) (6.14b) and hence Eqs. (6.14a) and (6.14b) yield (t )x (t ) = (t + )x (t ) (t )x ( ) (c) Part (c) follows readily from part (b) by letting = 0. THE SAMPLING PROCESS 271 In words, part (a ) of the theorem is saying that integrating an impulse function times a continuous function causes the integral to assume the value of the continuous function at the location of the impulse function. Similarly, parts (b) and (c) are saying that multiplying a continuous function by an impulse function yields a product of the impulse function times the value of the continuous function at the location of the impulse. The above theorem applies also to the impulse function in Eq. (6.10). The theorem is essentially a generalization of the denition of impulse functions and, in fact, any distinct functions that satisfy it may be deemed to be equivalent impulse functions. The theorem is of considerable practical importance as will be found out later on in this chapter. In the above analysis, time-domain impulse functions have been examined whose Fourier transforms are unity functions in the frequency domain. Occasionally, frequency-domain impulse functions are required whose inverse Fourier transforms are unity functions in the time domain. Such functions can be readily obtained from the impulse and unity functions examined already and, as will be shown below, they are required for the spectral representation of periodic signals. Consider the Fourier transform pair in Eq. (6.6), namely, (t ) = p (t ) 2 sin /2 = i () By applying the symmetry theorem (Theorem 2.7), we can write i (t ) 2 () where i (t ) = and () = lim p () = lim p () = () (6.15a) 2 sin t /2 t 1 for |t | < t (6.15b) (6.15c) 1 and is inversely related where t is a positive constant that denes the range of t over which i (t ) to . Therefore, from Eqs. (6.15a)(6.15c), we can write i (t ) 2 () or 1 2 () (6.16a) (6.16b) where i (t ) and () may be referred to as time-domain unity function and frequency-domain unit impulse function, respectively, by analogy with the frequency-domain unity function and timedomain impulse function, respectively. These functions can be represented by the symbolic graphs of Fig. 6.3b. The properties of time-domain impulse functions apply equally well to frequency-domain impulse functions as summarized by Theorem 6.1B below. 272 DIGITAL SIGNAL PROCESSING Theorem 6.1B Properties of Frequency-Domain Impulse Functions Assuming that X ( j ) is a continuous function of for | | < , the following relations hold: (a) ( ) X( j ) d = ( + ) X( j ) d X( j ) (b) ( ) X ( j ) = ( + ) X( j ) ( ) X( j ) (c) ( ) X ( j ) = ( ) X ( j ) ( ) X (0) 6.2.2 Periodic Signals The above approach circumvents the problem of impulse functions in a practical way. However, a similar problem arises if we attempt to nd the Fourier transform of a periodic signal. Consider, for example, x (t ) = cos 0 t . We can write F x (t ) = = = (cos 0 t )e j t dt = 1 2 1 2 e j 0 t + e j 0 t e j t dt e j (0 )t + e j (0 +)t d t )t ] + j sin[(0 )t ] 1 {cos[(0 2 + cos[(0 + )t ] j sin[(0 + )t ]} dt As can be seen, we have run into the same difculty as before, that is, we are attempting to evaluate integrals of sines and cosines over the innite range t and, therefore, F x (t ) does not exist. However, this problem can also be circumvented in a practical way by simply using the transform pair in Eq. (6.16a). On applying the frequency shifting theorem (Theorem 2.10), we can write i (t )e j 0 t 2 ( 0 ) and i (t )e j 0 t 2 ( + 0 ) and since i (t ) 1, we have e j 0 t 2 ( 0 ) (6.18c) (6.18b) (6.18a) If we add Eqs. (6.18a) and (6.18b), we deduce i (t )[e j 0 t + e j 0 t ] 2 [ ( 0 ) + ( + 0 )] THE SAMPLING PROCESS 273 x(t) X( j) t 0 0 Figure 6.4 Fourier transform of cosine function: x (t ) X ( j ) where x (t ) = cos 0 t and X ( j ) = [ ( 0 ) + ( 0 )]. and hence i (t ) cos 0 t [ ( + 0 ) + ( 0 )] Since i (t ) 1 for |t | < t (see Eq. (6.15b)), we may write cos 0 t [ ( + 0 ) + ( 0 )] (6.19) The Fourier transform of a cosine function can thus be represented by the symbolic graph of Fig. 6.4. If we now subtract Eq. (6.18b) from Eq. (6.18a), we obtain i (t )[e j 0 t e j 0 t ] 2 [ ( 0 ) ( + 0 )] and hence i (t ) sin 0 t j [ ( + 0 ) ( 0 )] or sin 0 t j [ ( + 0 ) ( 0 )] (6.20) With Fourier transforms available for exponentials, sines, and cosines, Fourier transforms of arbitrary periodic signals that satisfy the Dirichlet conditions in Theorem 2.1 can be readily obtained. From Eq. (6.18a), we can write i (t ) X k e jk 0 t 2 X k ( k 0 ) Therefore, Eq. (2.3) gives (6.21) i (t ) k = X k e jk 0 t 2 X k ( k 0 ) k = 274 DIGITAL SIGNAL PROCESSING or x (t ) = k = X k e jk 0 t 2 k = X k ( k 0 ) (6.22) In effect, the frequency spectrum obtained by applying the Fourier transform to a periodic signal comprises a sequence of frequency-domain impulses whose strengths are equal to 2 times the Fourier series coefcients { X k }. 6.2.3 Unit-Step Function Another time function that poses difculties is the unit step u (t ) as can be easily shown. However, by dening the unit step in terms of a function that is absolutely integrable, the problem can be circumvented in the same way as before. We can dene u (t ) = lim et 0 for t > 0 for t < 0 where is a very small but nite constant. The Fourier transform for the unit step can be obtained from Example 2.6a , as U ( j ) = lim 1 j + or u (t ) 1 j (6.23) The Fourier transform pairs obtained in this chapter along with those obtained in Chap. 2 are summarized in Table 6.2 for the sake of easy reference. For impulses and periodic signals, the transforms are approximate, as has been pointed out earlier, but can be made to approach any desired degree of precision by making in Eq. (6.6) smaller and in Eq. (6.10) or t in Eq. (6.15b) larger. Note that the impulse functions in Eqs. (6.6) and (6.10) would break down if we were to make zero in the rst case and innite in the second case but in practice there is very little to be gained in doing so. After all pulses of innite amplitude cannot be created in the laboratory. 6.2.4 Generalized Functions Analogous but exact Fourier transform pairs to those given by Eqs. (6.11), (6.16b), (6.18c), (6.19), (6.22), and (6.23) can be obtained but a more sophisticated denition of impulse functions is required in terms of generalized functions3 as detailed by Lighthill [1]. In that approach, impulse and unity functions are dened in terms of well-behaved functions that can be differentiated any number of 3 See Ref. [5] for a brief introduction to generalized functions. THE SAMPLING PROCESS 275 Table 6.2 Standard Fourier transforms x (t ) (t ) 1 (t t0 ) e j 0 t cos 0 t sin 0 t p (t ) = 1 0 sin for |t | /2 for |t | > /2 t /2 for |t | /2 for |t | > /2 X( j ) 1 2 () e j t0 2 ( 0 ) [ ( + 0 ) + ( 0 )] j [ ( + 0 ) ( 0 )] 2 sin /2 p () = 1 0 for || for || > /2 /2 t 2|t | 1 q (t ) = 0 2 4 sin t /4 t2 e 1 4 t 2 8 sin2 /4 2 2|| for || 1 q () = 0 for || > 2 /4 e /2 /2 et 2 /4 e 2 u (t ) u (t )et u (t )et sin 0 t 1 j 1 a + j 0 2 (a + j )2 + 0 2 2 times, for example, in terms of exponential functions such as (n / )ent and et /4n , respectively (see Example 2.11). It turns out that generalized functions solve one problem, namely, the limiting behavior of impulse functions, but create another: Apart from being of a somewhat abstract nature, generalized functions are also difcult, if not impossible, to realize in terms of voltage or current waveforms in the laboratory. In the practical denitions of impulse and unity functions dened in Sec. 6.2.1, the transform pairs are approximate but as parameter in Eq. (6.6) is reduced and parameter in Eq. (6.15c) is increased, the inexact transform pairs tend to approach their exact counterparts. In effect, the approximate transform pairs are for all practical purposes equivalent to their exact counterparts. In subsequent sections of this chapter and later on in the book the special symbols and will sometimes be replaced by the standard two-way arrow and equal to sign, 276 DIGITAL SIGNAL PROCESSING respectively, for the sake of consistency with the literature but with the clear understanding that an approximation is involved as to what constitutes an impulse function. Example 6.1 (a ) Find the Fourier transform of the periodic signal x (t ) = cos4 0 t (b) Repeat part (a ) for the periodic signal x (t ) = n = x (t + nT ) where x (t ) = where 0 = 2/0 . Solution sin 0 t 0 for 0 t 0 /2 for 0 /2 t 0 (a ) We can write x (t ) = (cos2 0 t )(cos2 0 t ) = 1 (cos 20 t + 1)(cos 20 t + 1) 4 = 1 (cos2 20 t + 2 cos 20 t + 1) 4 = = Now from Table 6.2, we get X ( j ) = 1 [ ( 8 1 4 1 8 1 2 (cos 40 t + 1) + 2 cos 20 t + 1 3 8 cos 40 t + 1 cos 20 t + 2 + 40 ) + ( 40 )] + 1 [ ( + 20 ) + ( 20 )] + 3 () 2 4 0 /2 0 /2 0 /2 0 0 /2 0 (b) The Fourier series of periodic signal x (t ) is given by Eqs. (2.3) and (2.5) where Xn = = = 1 0 1 0 1 0 [u (t ) sin 0 t ]e jn 0 t dt sin 0 t [cos n 0 t j sin n 0 t ] dt [cos n 0 t sin 0 t j sin n 0 t sin 0 t ] dt THE SAMPLING PROCESS 277 = 1 20 0 /2 0 [sin(n + 1)0 t sin(n 1)0 t ] j [cos(n 1)0 t + cos(n + 1)0 t ] d t 0 /2 0 = = = cos(n 1)0 t sin(n 1)0 t sin(n + 1)0 t 1 cos(n + 1)0 t + j +j 20 (n + 1)0 (n 1)0 (n 1)0 (n + 1)0 1 4 1 4 sin(n 1) sin(n + 1) cos(n 1) 1 cos(n + 1) 1 j +j n1 n+1 n1 n+1 sin n sin n cos n 1 cos n 1 +j j n1 n+1 n1 n+1 cos n + 1 j sin n 2 (n 2 1) = Evaluating X n and noting that lH pitals rule is required for the cases n = 1, the o following values of X n can be obtained: X0 = 1 X 1 = X 1 = j 4 X 2 = X 2 = 1 15 1 3 X 3 = X 3 = 0 X 6 = X 6 = X 4 = X 4 = 1 , 35 ... X 5 = X 5 = 0 On using Eqs. (2.9) and (2.10), the Fourier series of x (t ) can be deduced as x (t ) = 1 a0 + 2 n =1 an cos n 0 t + n =1 bn sin n 0 t (6.24) where a0 = 2 X 0 or a0 = 2 a1 = 0 a5 = 0 b1 = 1 2 b2 = 0 a2 = 2 3 2 35 b4 = 0 a3 = 0 a4 = 2 15 an = X n + X n bn = j ( X n X n ) a6 = b3 = 0 a 7 = 0, b5 = 0 b6 = 0, 278 DIGITAL SIGNAL PROCESSING Now from Table 6.2, we get F x (t ) = a0 () + k =1 an [ ( + n 0 ) + ( n 0 )] + k =1 jbn [ ( + n 0 ) ( n 0 )] (6.25) 6.3 INTERRELATION BETWEEN THE FOURIER SERIES AND THE FOURIER TRANSFORM Discrete-time signals are usually sampled versions of continuous-time signals and, therefore, it stands to reason that they inherit their spectral characteristics from the continuous-time signals from which they are derived. Specically, if the frequency spectrum of the underlying continuous-time signal is known, then that of the discrete-time signal can be deduced by using Poissons summation formula. The following theorem is prerequisite for the derivation of this most important formula. Theorem 6.2 Fourier-Series Kernel Theorem (t nT ) s n= n= ( ns ) (6.26) where s = 2/ T. The relation in Eq. (6.26) can be demonstrated to be valid on the basis of the principles developed in Sec. 6.2. To start with, on applying the inverse Fourier transform to the right-hand side of Eq. (6.26 ), we get F 1 s ( n s ) = n = 1 2 1 T s n = ( n s ) e j t d = and from Theorem 6.1B, part (a ), we have F 1 s ( n s )e j t d n = ( n s ) n = 1 T n = e jn s t (6.27) Consider the so-called Fourier-series kernel (see Papoulis [4], pp. 4245), which is dened as k N (t ) = 1 T N n = N e jn s t (6.28) THE SAMPLING PROCESS 279 where N is a nite integer. Since this is a geometric series with common ratio e j s t , its sum can be obtained as k N (t ) = = 1 T N n = N e jn s t = 1 e j ( N +1)s t e j N s t T e j s t 1 1 e j (2 N +1)s t /2 e j (2 N +1)s t /2 T e j s t /2 e j s t /2 1 sin[(2 N + 1)s t /2] = T sin(s t /2) (see Eq. (A.46b)). We can write k N (t ) = sin[(2 N + 1)s t /2] t 1 T sin(s t /2) t and if we let (2 N + 1)s = , then k N (t ) = t sin t /2 1 T sin(s t /2) t If N 1, (sin t /2)/ t behaves as a time-domain impulse function (see Table 6.1) and hence for T /2 < t < T /2, k N (t ) can be expressed as k N (t ) = (t ) (t ) where function (t ) = t 1 T sin(s t /2) is continuous and assumes the value of unity at t = 0. Now from Theorem 6.1A, part (c), we get k N (t ) = (t ) (t ) (0) (t ) = (t ) At this point, if we let t = t + nT in k N (t ) , we can easily verify that the Fourier-series kernel is periodic with period T , as illustrated in Fig. 6.5 (see Prob. 6.14, part (a )). Therefore, for N 1, it behaves as an innite series of impulse functions located at t = 0, T , 2T , . . . , nT , . . . and from Eq. (6.28), we can write 1 T N n = N k N (t ) = e jn s t (t nT ) n = (6.29) 280 DIGITAL SIGNAL PROCESSING 9.0 kN (t) 6.0 3.0 3.0 T 1.5 1.5 T t 3.0 3.0 Figure 6.5 Fourier-series kernel. Since N 1, Eqs. (6.27)(6.29) yield F 1 s ( n s ) n = 1 T n = e jn s t 1 T N n = N e jn s t (t nT ) n = Impulse functions as dened in Sec. 6.2.1 are absolutely integrable and hence they satisfy the convergence theorem of the Fourier transform (Theorem 2.5). We thus conclude that (t nT ) n = s n = ( n s ) An exact version of the above result can be obtained through the use of generalized functions [5]. The Fourier-series kernel theorem (Theorem 6.2) leads to a direct relationship between the Fourier series and the Fourier transform. This relationship is stated in the following theorem: Theorem 6.3 Interrelation Between the Fourier Series and the Fourier Transform Given a nonperiodic signal x (t ) with a Fourier transform X ( j ), a periodic signal with period T can be constructed as x (t ) = n= x (t + nT ) (6.30) THE SAMPLING PROCESS 281 1.0 0.5 x(t) 0 0.5 1.0 0 T 2T 3T 4T 5T 1.0 x (t), x(tnT ) x (t) x(tT ) x(t 4T ) 0.5 0 0.5 x(t+T ) 1.0 0 T 2T t 3T 4T 5T Figure 6.6 Generation of periodic signal x (t ) through the addition of an innite number of shifted copies of x (t ) over the range < t < . (see Fig. 6.6 and Prob. 6.14, part (b)). The Fourier series coefcients of x (t ) are given by X ( jns ) T Xn = (6.31) where X ( j ) = F x (t ) The above theorem states, in effect, that the Fourier series coefcient of the nth harmonic of periodic signal x (t ) is numerically equal to the Fourier transform of x (t ) evaluated at the frequency of the harmonic divided by T . The validity of the relationship in Eq. (6.31) can be demonstrated by using our practical approach to impulse and unity functions as described in Sec. 6.2.1. From Eq. (6.22), the Fourier transform of a periodic signal x (t ) is given by X ( j ) 2 n = X n ( n s ) (6.32) 282 DIGITAL SIGNAL PROCESSING From Theorem 6.1A, part (a ), Eq. (6.30) can be expressed as x (t ) = n = n = x (t + nT ) x ( ) (t + nT ) d x ( ) n = (t + nT ) d (t nT ) x (t ) n = (6.33) where the last two lines represent time convolution (see Theorem 2.14), and on using Theorem 6.2 and Eq. (6.33), we obtain X ( j ) F x (t ) F n = (t nT ) ( n s ) n = X ( j ) s 2 n = X ( j ) ( n s ) T (6.34) If we now use Theorem 6.1B, part (b), Eq. (6.34) yields X ( j ) 2 n = X ( jn s ) ( n s ) T (6.35) and on comparing Eqs. (6.32) and (6.35), we deduce Xn X ( jn s ) T It should be mentioned at this point that Eq. (6.31) holds independently of the values of x (t ) for |t | > T /2. If x (t ) = 0 for |t | > T /2, the shifted copies of x (t ) do not overlap and x (t ) = x (t ) for |t | < T /2 whereas if x (t ) = 0 for |t | > T /2, they do overlap and so x (t ) = x (t ) for |t | < T /2 THE SAMPLING PROCESS 283 In the latter case, x (t ) is said to be an aliased version of x (t ). For the nonaliased case, the Fourier series coefcients give one spectral representation for a periodic signal and the Fourier transform gives another, which are interrelated through Eq. (6.31). Example 6.2 Given the nonperiodic signal x (t ) = p/2 t + 1 p/2 t 1 4 4 where p/2 = 1 0 for |t | < /4 otherwise a periodic signal x (t ) with period T such as that in Eq. (6.30) can be constructed. Show that the Fourier series coefcients of x (t ) are related to the Fourier transform of x (t ) through the relation in Eq. (6.31). Solution The Fourier series coefcients of x (t ) can be obtained from Example 2.3 as 0 for n = 0 for n = 1, 2, . . . (6.36) Xn = 4 sin2 n s /4 j n s T by noting that k = n , 0 = T , and 0 = s = 2/ T in the present context. From the denition of the Fourier transform, we can write X ( j ) = x (t )e j t dt and since x (t ) is an odd function of t , Eqs. (2.37a)(2.37b) give X ( j ) = Re X ( j ) + j I m X ( j ) where Re X ( j ) = 0 (6.37b) (6.37a) 284 DIGITAL SIGNAL PROCESSING and Im X ( j ) = 2 0 x (t ) sin t dt sin t dt /2 0 /2 0 = 2 0 /2 =2 =2 = Hence Eqs. (6.37a) and (6.37c) give cos t cos /2 + 1 2 4 sin /4 (6.37c) X ( j ) = j 4 sin2 /4 where X (0) = 0 as can be readily veried. If we let = n s , we get X ( jn s ) = 0 for n = 0 for n = 1, 2, . . . (6.38) 4 sin2 n s /4 j n s Now on comparing Eqs. (6.36) and (6.38), we note that Theorem 6.3 is satised. 6.4 POISSONS SUMMATION FORMULA Given an arbitrary nonperiodic signal x (t ) that has a Fourier transform, the periodic signal in Eq. (6.30) can be immediately constructed. Such a signal has a Fourier series of the form x (t ) = n = x (t + nT ) = n = X n e jn s t (6.39) Now from Eqs. (6.31) and (6.39), we obtain x (t + nT ) = n = 1 T n = X ( jn s )e j s t (6.40) This relationship is known as Poissons summation formula and as will be shown below, it provides a crucial link between the frequency spectrum of a discrete-time signal and that of the underlying continuous-time signal. THE SAMPLING PROCESS 285 Two special cases of Poissons formula are of interest. If x (t ) assumes nonzero values for t < 0, then if we let t = 0 in Eq. (6.40), we obtain x (nT ) = n = 1 T X ( jn s ) n = (6.41a) On the other hand, if x (t ) = 0 for t < 0, then t 0 lim x (t ) + n =1 x (nT ) = 1 T X ( jn s ) n = (6.41b) Now the Fourier series also holds at a discontinuity provided that the value of the periodic signal at the discontinuity is deemed to be lim x (t ) = x (0) + x (0+) 2 t 0 (see Theorem 2.1) and since x (0) = 0 in the present case, Eq. (6.41b) assumes the form x (0+) + 2 or x (nT ) = n =1 1 T X ( jn s ) n = x (nT ) = n =0 1 x (0+) + 2 T X ( jn s ) n = (6.41c) where x (0) x (0+). Poissons summation formula is illustrated in Fig. 6.7 for the signal x (t ) = u (t )eat sin t with a = 0.35 and = 2.6. This important formula states, in effect, that the sum of the signal values of x (t ) at t = nT in Fig. 6.7a over the range < t < is equal to the sum of the complex values X ( jn s ) = | X ( jn s )|e j arg X ( jn s ) in Fig. 6.7b for < n < divided by the sampling period T . As an aside, note that there is only one term in the time-domain summations in Eqs. (6.41a) and (6.41c) if x (t ) = 0 for |t | > T /2, and hence we have x (0) = 1 n = T x (0+) 1 +T 2 X ( jn s ) n = X ( jn s ) if x (t ) = 0 for t < T /2 and t > T /2 if x (t ) = 0 for t < 0 and t > T /2 286 DIGITAL SIGNAL PROCESSING 1.0 0.5 x(t) 0 0.5 1.0 0 T 2T 3T 4T 5T (a) 1.5 1.0 |X( j)| 0.5 0 3s 2s s 0 s 2s 3s 4.0 arg x( j), rad/s 2.0 0 2.0 4.0 2s 3s s 0 (b) s 2s 3s Figure 6.7 Poisson summation formula for the case where x (t ) is dened over the range < t < : (a ) Time domain, (b) frequency domain. 6.5 IMPULSE-MODULATED SIGNALS An impulse-modulated signal, denoted as x (t ), can be generated by sampling a continuous-time signal x (t ) using an impulse modulator as illustrated in Fig. 6.8a . An impulse modulator is essentially a subsystem whose response to an input x (t ) is given by x (t ) = c(t )x (t ) where c(t ) is a carrier signal of the form (6.42a) c(t ) = n = (t nT ) (6.42b) THE SAMPLING PROCESS 287 Impulse modulator x(t) x(t) c(t) x(t) x(kT) (a) (b) kT t c(t) (c) 1 t kT = x(t) x(kT) (d) kT x(nT) t x(kT) (e) kT nT Figure 6.8 Generation of an impulse-modulated signal: (a ) Ideal impulse modulator, (b) continuous-time signal, (c) impulse-modulated carrier, (d ) impulse-modulated signal x (t ), (d ) discrete-time signal x (nT ). (see Fig. 6.8c). From Eqs. (6.42a) and (6.42b), we have x (t ) = x (t ) n = (t nT ) x (t ) (t nT ) = n = (6.42c) 288 DIGITAL SIGNAL PROCESSING and if we apply Theorem 6.1A, part (b), to Eq. (6.42c), we obtain x (t ) = n = x (nT ) (t nT ) (6.42d) Often x (t ) = 0 for t 0. In such a case Eq. (6.42d) assumes the form x (t ) = n =0 x (nT ) (t nT ) (6.42e) In effect, an impulse-modulated signal is a sequence of continuous-time impulses, like that illustrated in Fig. 6.8d . A signal of this type can be converted into a discrete-time signal by simply replacing each impulse of strength x (nT ) by a number x (nT ) as shown in Fig. 6.8e. 6.5.1 Interrelation Between Fourier and z Transforms Observe that an impulse-modulated signal is both a sampled as well as a continuous-time signal and this dual personality will immediately prove very useful. To start with, since it is continuous in time, it has a Fourier transform, that is, X ( j ) = F n = x (nT ) (t nT ) = n = x (nT )F (t nT ) (6.43a) Clearly X ( j ) = n = x (nT )e j nT = X D (z ) z =e j T (6.43b) where X D (z ) = Z x (nT ) For a right-sided signal, Eq. (6.43b) assumes the form X ( j ) = n =0 x (nT )e j nT = X D (z ) z =e j T (6.43c) The above analysis has shown that the Fourier transform of an impulse-modulated signal x (t ) is numerically equal to the z transform of the corresponding discrete-time signal x (nT ) evaluated on the unit circle |z | = 1. In other words, the frequency spectrum of x (t ) is equal to that of x (nT ). THE SAMPLING PROCESS 289 Example 6.3 (a ) The continuous-time signal 0 1 x (t ) = 2 1 0 for t < 3.5 s for 3.5 t < 2.5 for 2.5 t < 2.5 for 2.5 t 3.5 for t > 3.5 is subjected to impulse modulation. Find the frequency spectrum of x (t ) in closed form assuming a sampling frequency of 2 rad/s. (b) Repeat part (a ) for the signal x (t ) = u (t )et sin 2t assuming a sampling frequency of 2 rad/s. Solution (a ) The frequency spectrum of an impulse-modulated signal, x (t ), can be readily obtained by evaluating the z transform of x (nT ) on the unit circle of the z plane. The impulsemodulated version of x (t ) can be expressed as x (t ) = (t + 3T ) + 2 (t + 2T ) + 2 (t + T ) + 2 (0) +2 (t T ) + 2 (t 2T ) + (t 3T ) where T = 1 s. A corresponding discrete-time signal can be obtained by replacing impulses by numbers as x (nT ) = (nT + 3T ) + 2 (nT + 2T ) + 2 (nT + T ) + 2 (0) +2 (nT T ) + 2 (nT 2T ) + (nT 3T ) Hence X D (z ) = Z x (t ) = z 3 + 2z 2 + 2z 1 + 2 + 2z 1 + 2z 2 + z 3 and, therefore, from Eq. (6.43b) X ( j ) = X D (e j T ) = (e j 3 T + e j 3 T ) + 2(e j 2 T + e j 2 T ) + 2(e j T + e j T ) + 2 = 2 cos 3 T + 4 cos 2 T + 4 cos T + 2 290 DIGITAL SIGNAL PROCESSING (b) A discrete-time signal can be readily derived from x (t ) by replacing t by nT as x (nT ) = u (nT )enT sin 2nT = u (nT )enT = u (nT ) 1 nT (1+ j 2) e enT (1 j 2) 2j 1 j 2nT e e j 2nT 2j Since T = 2/s = 1 s, Table 3.2 gives X D (z ) = and after some manipulation X D (z ) = ze1 sin 2 z 2 2ze1 cos 2 + e2 1 2j z z 1+ j 2 ze z e1 j 2 Therefore, the frequency spectrum of the impulse-modulated signal is given by X ( j ) = X D (e j T ) = e j 1 sin 2 2e j 1 cos 2 + e2 e2 j 6.5.2 Spectral Interrelation Between Discrete- and Continuous-Time Signals Let X ( j ) be the Fourier transform of x (t ). From the frequency-shifting theorem of the Fourier transform (Theorem 2.10), the transform pair x (t )e j 0 t X ( j 0 + j ) can be formed. On using Poissons summation formula given by Eq. (6.41a), we get n = x (nT )e j 0 nT = 1 T X ( j 0 + jn s ) n = where s = 2/ T and if we now replace 0 by , we obtain n = x (nT )e j nT = 1 T X ( j + jn s ) n = (6.44) THE SAMPLING PROCESS 291 Therefore, from Eqs. (6.43b) and (6.44), we deduce 1 X ( j ) = X D (e j T ) = T X ( j + jn s ) n = (6.45a) Similarly, for a right-sided signal, the use of Eq. (6.41c) in the above analysis along with Eq. (6.43c) gives 1 x (0+) + X ( j ) = X D (e j T ) = 2 T X ( j + jn s ) n = (6.45b) that is, the frequency spectrum of the impulse-modulated signal x (t ) is equal to the frequency spectrum of discrete-time signal x (nT ) and the two can be uniquely determined from the frequency spectrum of the continuous-time signal x (t ), namely, X ( j ). As is to be expected, X ( j ) is a periodic function of with period s since the frequency spectrum of discrete-time signals is periodic as shown in Sec. 3.9.2. Indeed, if we replace j by j + jm s in Eq. (6.45a), we get 1 X ( j + jm s ) = T = 1 T X [ j + j (m + n )s ] n = X ( j + jn s ) n = = X ( j ) The above relationships can be extended to the s domain. By virtue of a principle of complex analysis known as analytic continuation (see Sec. A.8), given a Fourier transform F ( j ), the Laplace transform F (s ) can be obtained by replacing j by s in F ( j ), that is, F (s ) = F ( j ) j =s (See Sec. 10.2.2 for a more detailed description of the Laplace transform.) Thus if we let j = s and esT = z , Eqs. (6.45a) and (6.45b) assume the forms 1 X (s ) = X D (z ) = T X (s + jn s ) n = (6.46a) 292 DIGITAL SIGNAL PROCESSING and 1 x (0+) + X (s ) = X D (z ) = 2 T X (s + jn s ) n = (6.46b) where X (s ) and X (s ) are the Laplace transforms of x (t ) and x (t ), respectively. If the value of x (0+) is not available, it can be deduced from X (s ) as x (0+) = lim [s X (s )] s by using the initial-value theorem of the one-sided Laplace transform [3] (see Sec. 10.2.4). The relationship in Eq. (6.46b) turns out to be of signicant practical importance. It will be used in Sec. 6.9 to establish a relationship between analog and digital lters. This relationship is the basis of the so-called invariant impulse-response method for the design of IIR lters described in Chap. 11. (a ) Using Poissons summation formula, obtain X ( j ) if x (t ) = cos 0 t . (b) Repeat part (a ) for x (t ) = u (t )et . Solution Example 6.4 (a) From Table 6.2 X ( j ) = F cos 0 t = [ ( + 0 ) + ( 0 )] Hence Eq. (6.45a) gives X ( j ) = T [ ( + n s + 0 ) + ( + n s 0 )] n = The amplitude spectrum of x (t ) is illustrated in Fig. 6.9a . (b) From Table 6.2, we have X ( j ) = F [u (t )et ] = Since x (0+) = lim[u (t )et ] = 1 t 0 1 1 + j THE SAMPLING PROCESS 293 | X( j)| ^ 2s s 0 (a) 0 s 2s 1.0 0.8 0.6 0.4 0.2 0 30 20 10 0 10 20 30 |X( j)| 3 2 1 0 30 |X( j)| 1 T |X( j+ js)| 1 |X( j)| T 1 |X( j j )| s T ^ 20 s 10 s 2 0 s 2 10 20 30 s (b) Figure 6.9 Amplitude spectrum of x (t ): (a) Example 6.4a , (b) Example 6.4b. Eq. (6.45b) gives 1 1 X ( j ) = + 2T 1 1 + j ( + n s ) n = The amplitude spectrum of x (t ) is plotted in Fig. 6.9b for a sampling frequency s = 15 rad/s. 294 DIGITAL SIGNAL PROCESSING 6.6 THE SAMPLING THEOREM The application of digital lters for the processing of continuous-time signals is made possible by the sampling theorem4 which is as follows: Theorem 6.4 Sampling Theorem A bandlimited signal x (t ) for which X( j ) = 0 for | | s 2 (6.47) where s = 2/ T, can be uniquely determined from its values x (nT ). The validity of the sampling theorem can be demonstrated by showing that a bandlimited signal x (t ) can be recovered from an impulse-modulated version of the signal, x (t ), by using an ideal lowpass lter as depicted in Fig. 6.10.5 Assume that x (t ) is bandlimited and that the sampling frequency s is high enough to ensure that the condition in Eq. (6.47) is satised. The frequency spectrum of such a signal could assume the form depicted in Fig. 6.11a . Poissons summation formula in Eq. (6.45a ) gives the frequency spectrum of the impulse modulated signal x (t ) as 1 X ( j ) = T X ( j + jn s ) n = Evidently, the spectrum of x (t ) can be derived from that of x (t ) through a process of periodic continuation whereby exact copies of the spectrum of x (t )/ T are shifted by frequencies { , 2s , s , s , 2s , } and are then added. If x (t ) satises the condition in Eq. (6.47), then the shifted copies of the spectrum, often referred to as sidebands, would not overlap and, consequently, the spectrum of x (t ) would assume the form depicted in Fig. 6.11b. If the impulse-modulated signal is now passed through an ideal lowpass lter with cutoff frequencies at s /2 as illustrated in Fig. 6.11c, all the sidebands would be rejected and the spectrum of the lter output would be an Impulse modulator x(t) Lowpass filter y(t) ^ x(t) c(t) Figure 6.10 Sampling theorem: Derivation of x (t ) from x (t ) by using a lowpass lter. 4 The sampling theorem is attributed to Nyquist, Shannon, or both, depending on what one reads. In actual fact, the historical record shows that both of these individuals made a signicant contribution to the sampling theorem. Nyquist provided an intuitive derivation of the sampling theorem as early as 1928 in Ref. [6] whereas Shannon provided a rigorous proof for it in Ref. [7]. 5 See Sec. 10.2 for a brief summary of the basics of analog lters. THE SAMPLING PROCESS 295 X( j) s 2 (a) s 2 1 X( j + j ) s T X( j) ^ 1 T X( j) 1 X( j j ) s T s s 2 (b) H( j) s 2 s T s 2 T X( j) ^ (c) s 2 = X( j) s 2 (d ) s 2 Figure 6.11 Sampling theoremderivation of x (t ) from x (t ) by using a lowpass lter: (a ) X ( j ), (b) X ( j ), (c) frequency response of ideal lowpass lter, (d ) lowpass-ltered version of X ( j ). exact copy of the spectrum of the continuous-time signal, that is, the continuous-time signal will be recovered, as shown in Fig. 6.11d . The above thought experiment can be repeated through analysis. Consider a lowpass lter with a frequency response H ( j ) = T 0 for || < s /2 for || s /2 such as that illustrated in Fig. 6.11c. The frequency spectrum of the lter output is given by X ( j ) = H ( j ) X ( j ) (6.48) 296 DIGITAL SIGNAL PROCESSING (see Eq. (10.6a)). Thus from Eqs. (6.43b) and (6.48), we can write X ( j ) = H ( j ) n = x (nT )e j nT and hence x (t ) = F = n = 1 H ( j ) n = x (nT )e j nT x (nT )F 1 [ H ( j )e j nT ] (6.49) The frequency response of the lowpass lter is actually a frequency-domain pulse of height T and base s , that is, H ( j ) = T ps () as shown in Fig. 6.11c and hence from Table 6.2, we have T sin(s t /2) H ( j ) t and from the time-shifting theorem of the Fourier transform (Theorem 2.9), we obtain T sin[s (t nT )/2] H ( j )e j nT (t nT ) Therefore, from Eqs. (6.49) and (6.50), we conclude that (6.50) x (t ) = n = x (nT ) sin[s (t nT )/2] s (t nT )/2 (6.51) For an ideal lowpass lter, the frequency spectrum in Fig. 6.11d is exactly the same as that in Fig. 6.11a and thus the output of the ideal lter in Fig. 6.10 must be x (t ). In effect, Eq. (6.51) is an interpolation formula that can be used to determine signal x (t ) from its values x (nT ). That this, indeed, is the case, we note that the right-hand side in Eq. (6.51) assumes the values of x (t ) for n if t = nT since limx 0 sin x /x = 1. Note that the above analysis provides the standard method for the reconstruction of the original signal from an impulse-modulated version of the signal and, as will be shown below, it can also be used to reconstruct the continuous-time signal from a discrete-time version. 6.7 ALIASING If X ( j ) = 0 for || s 2 as in Fig. 6.12a , for example, frequencies pertaining to the shifted copies will move into the baseband of X ( j ) as depicted in Fig. 6.12b. As a result, X ( j ) (dashed curve in Fig. 6.12b) will no longer be THE SAMPLING PROCESS 297 0.2 X( j) 0.1 0 30 20 10 0 (a) 10 20 30 0.4 0.2 0 30 X( j) 1 X( j + js) T 20 10 1 T X( j) 0 (b) 1 X( j js) T 10 20 ^ 30 0.2 0.1 0 30 TX( j) ^ 20 10 0 s 2 10 s 20 30 s s 2 (c) Figure 6.12 Aliasing of an impulse-modulated signal: (a ) X ( j ), (b) shifted copies of X ( j )/ T and X ( j ), (c) lowpass-ltered version of X ( j ). equal to X ( j ) over the baseband, and the use of an ideal lowpass lter will at best yield a distorted version of x (t ), as illustrated in Fig. 6.12c. The cause of the problem is aliasing, which was explained in some detail in Sec. 5.5.4. 6.8 GRAPHICAL REPRESENTATION OF INTERRELATIONS Various important interrelations have been established in the preceding sections among continuoustime, impulse-modulated, and discrete-time signals. These are illustrated pictorially in Fig. 6.13. The two-directional paths between x (t ) and x (nT ) and between X ( j ) and X D (z ) render the Fourier transform applicable to DSP. The two-directional paths between x (t ) and x (nT ) and between X ( j ) and X D (z ) will allow us to use digital lters for the processing of continuous-time signals. And the path between X (s ) and X D (z ) will allow us to design digital lters by using analog-lter methodologies. 298 DIGITAL SIGNAL PROCESSING X(s) L L 1 s j j s F x(t) F 1 X( j) Eq. (6.51) Eq. (6.42d) or (6.42e) Eq. (6.48) Eq. (6.45a) or (6.45b) F x(t) X( j) F 1 Replace impulses by numbers Replace numbers by impulses z e jT j 1 ln z T Z x (nT ) Z 1 XD(z) Figure 6.13 Interrelations between continuous-time, impulse-modulated, and discrete-time signals. 6.9 PROCESSING OF CONTINUOUS-TIME SIGNALS USING DIGITAL FILTERS Consider the ltering scheme of Fig. 6.14a where S1 and S2 are impulse modulators and FA and FLP are analog lters characterized by transfer functions H A (s ) and HLP (s ), respectively, and assume that FLP is an ideal lowpass lter with a frequency response T2 0 for || < s /2 otherwise HLP ( j ) = (6.52) Filter FA in cascade with impulse modulator S2 constitute a so-called impulse-modulated lter F A . THE SAMPLING PROCESS 299 FA S1 x(t) x(t) S2 FA c(t) c(t) (a) y(t) FLP y (t ) x (t) x(t) x(nT ) y (nT ) y (t) y(t) FLP 1 2 c(t) 3 A/D 4 DF 5 D/A 6 FLP 7 (b) Figure 6.14 digital lter. The processing of continuous-time signals: (a ) Using an impulse-modulated lter, (b) using a By analogy with Eqs. (6.42e) and (6.46b), the impulse response and transfer function of lter F A can be expressed as h A (t ) = n =0 h A (nT ) (t nT ) (6.53a) and 1 h A (0+) + H A (s ) = H D (z ) = 2 T respectively, where h A (t ) = L1 H A (s ) H D (z ) = Z h A (nT ) h A (0+) = lim [s H A (s )] s H A (s + jn s ) n = (6.53b) z=e sT The transfer function of the cascade arrangement of the impulse-modulated lter and the lowpass lter is simply the product of their individual transfer functions, that is, H A (s ) HL P (s ), and hence the Laplace transform of y (t ) can be obtained as Y (s ) = H A (s ) HL P (s ) X (s ) Therefore, the Fourier transform of y (t ) in Fig. 6.14a is Y ( j ) = H A ( j ) HL P ( j ) X ( j ) (6.54) 300 DIGITAL SIGNAL PROCESSING and if x (0+) = h A (0+) = 0 and X ( j ) = H A ( j ) = 0 for || s /2 (6.55b) (6.55a) then X ( j ) and H A ( j ) are periodic continuations of X ( j )/ T and H A ( j )/ T , respectively, and thus Eqs. (6.45a), (6.53b), (6.55a), and (6.55b) give 1 X ( j ) = X ( j ) T and 1 H A ( j ) = H A ( j ) T for || < s 2 (6.56) Hence Eqs. (6.54), (6.52), and (6.56) give Y ( j ) = and Y ( j ) = 0 for || s /2 (6.57b) 1 1 H A ( j ) T 2 X ( j ) = H A ( j ) X ( j ) T T for || < s /2 (6.57a) Now from the assumptions made in Eqs. (6.55a) and (6.55b), H A ( j ) X ( j ) = 0 for || s /2 and thus Eq. (6.57b) is redundant, i.e., Eq. (6.57a) holds for all frequencies. On replacing j by s in Eq. (6.57a), the s -domain representation of the impulse-modulated lter can be obtained as Y (s ) = H A (s ) X (s ) After much science and some extravagant use of components, we have managed to construct an impulse-modulated lter that operates exactly like analog lter FA in Fig. 6.14a. At rst sight, this appears to be an unnecessarily complicated and highly redundant design of an analog lter that would certainly not excite the market place if offered as a commercial product! However, an important feat has been achieved in the process as will now be demonstrated. From Eq. (6.53b), we note that, just like a digital lter, an impulse-modulated lter can be characterized by a discrete-time transfer function and by replacing the impulse-modulated lter in Fig. 6.14a by an equivalent digital lter, the ltering of continuous-time signals by means of digital lters can be achieved. On the other hand, given an analog lter whose transfer function, H A (s ), satises the conditions h A (0+) = 0 and H A ( j ) 0 for || s /2 a corresponding impulse-modulated lter can be obtained and from that an equivalent digital lter can be deduced that has approximately the same frequency response as the analog lter. Therefore, digital lters can be designed by using analog-lter methodologies. This possibility will be explored further in Chap. 11. A digital-lter implementation of Fig. 6.14a can be obtained by replacing the impulsemodulated lter by a digital lter together with suitable interfacing devices, as shown in Fig. 6.14b. THE SAMPLING PROCESS 301 The analog-to-digital and digital-to-analog converters are required to convert impulses into numbers and numbers into impulses. The input lowpass lter is used to bandlimit x (t ) (if it is not already bandlimited) to prevent aliasing errors. The detailed operation of such a ltering scheme is illustrated by the following example. Example 6.5 The conguration of Fig. 6.14b is used to lter a periodic signal given by x (t ) = n = x (t + n 0 ) w her e x (t ) = sin 0 t 0 for 0 t 0 /2 for 0 /2 t 0 where 0 = 2/0 . The lowpass lters are characterized by HLP ( j ) = 1 0 for 0 || < 60 otherwise and the digital lter has a baseband response H D (e j T ) = T 0 for 0.950 < || < 1.050 otherwise Assuming that s = 120 , nd the time- and frequency-domain representations of the signals at nodes 1, 2, . . . , 7. Solution Node 1 From Example 6.1, part (b), the Fourier series of the signal can be expressed as x1 (t ) = 1 a0 + 2 n =1 an cos n 0 t + n =1 bn sin n 0 t (6.58) where a0 = 2 a1 = 0 a5 = 0 b1 = 1 2 b2 = 0 a2 = 2 3 2 a6 = 35 a3 = 0 a4 = 2 15 a7 = 0 b5 = 0 b6 = 0, b3 = 0 b4 = 0 and from Table 6.2, the Fourier transform of x1 (t ) can be obtained as X 1 ( j ) = F x1 (t ) = a0 () + k =1 an [ ( + n 0 ) + ( n 0 )] + k =1 jbn [ ( + n 0 ) ( n 0 )] (6.59) 302 DIGITAL SIGNAL PROCESSING Node 2 The bandlimiting lter will remove all frequencies equal to or greater than 60 and hence Eq. (6.58) gives 4 4 x2 (t ) = 1 a0 + 2 n =1 an cos n 0 t + n =1 bn sin n 0 t = and 1 1 2 2 + sin 0 t cos 20 t cos 40 t 2 3 15 X 2 ( j ) = F x2 (t ) = 2 () + j 2 [ ( + 0 ) ( 0 )] [ ( + 20 ) 2 3 2 [ ( + 40 ) + ( 40 )] 15 + ( 20 )] Nodes 3 and 4 The output of the impulse modulator is obtained from Eq. (6.42d) as x3 (t ) = n = x (nT ) (t nT ) 1 2 2 1 + sin 0 nT cos 20 nT cos 40 nT 2 3 15 = n = (t nT ) Thus x4 (nT ) = 1 1 2 2 + sin 0 nT cos 20 nT cos 40 nT 2 3 15 and from Eq. (6.45a), we have 1 X 3 ( j ) = X 4 (e j T ) = T = 1 T X 2 ( j + jn 0 ) n = 2 ( + n s ) + j n = [ ( + n s + 0 ) ( + n s 0 )] 2 2 [ ( + n s + 20 ) + ( + n s 20 )] 3 2 [ ( + n s + 40 ) + ( + n s 40 )] 15 THE SAMPLING PROCESS 303 Nodes 5 and 6 The bandpass digital lter will reject all components except those with frequencies 0 n s and it will also provide a gain of T , and so X 5 (e j T ) = X 6 ( j ) = n = j [ ( + n s + 0 ) ( + n s 0 )] 2 Thus, from Table 6.2, we get x5 (nT ) = and x6 (t ) = 1 (sin 0 nT ) (t nT ) 2 n = 1 2 sin 0 nT Node 7 Finally, the lowpass lter at the output will reject all components with frequencies outside the baseband, and as a result X 7 ( j ) = and x7 (t ) = 1 2 j 2 [ ( + 0 ) ( 0 )] sin 0 t The various signal waveforms and amplitude spectrums are illustrated in Fig. 6.15a and b, respectively. 6.10 PRACTICAL A/D AND D/A CONVERTERS A practical implementation of the analog-to-digital interface is shown in Fig. 6.16a . The function of the sample-and-hold device is to generate a signal of the form x (t ) = n = x (nT ) pT (t nT ) such as that illustrated in Fig. 6.16b. The function of the encoder, on the other hand, is to convert each signal level x (nT ) into a corresponding binary number. Since the number of bits in the binary representation must be nite, the response of the encoder denoted by xq (nT ) can assume only a nite number of discrete levels; that is, xq (nT ) will be a quantized signal. Assuming that the encoder is designed such that each value of x (nT ) is rounded to the nearest discrete level, the response of the encoder will be of the form depicted in Fig. 6.16c. We can write xq (nT ) = x (nT ) e(nT ) 304 x1(t) A1() t x2(t) FLP 60 1 120 180 t x3(t) A2() t x4(nT ) A3,4() DF nT x5(nT ) nT T A5,6() 60 120 180 x6(t) t FLP 1 x7(t) t A7() (a) (b) Figure 6.15 Example 6.5: (a) Time-domain representations of signals at nodes 1, 2, . . . , 7, (b) amplitude spectrums of signals at nodes 1, 2, . . . , 7. THE SAMPLING PROCESS 305 Practical A/D converter x(t) Sample and hold device x(t) Encoder xq(nT) (a) x(t) x(t) xq(nT) x(kT) T 0 (b) t kT 10T T 0 2T 4T (c) 6T nT 8T 10T e(nT) x(t) Ideal A/D x(nT) xq(nT) (d) Figure 6.16 Analog-to-digital interface: (a ) Practical A/D converter, (b) response of a practical A/D converter, (c) output of encoder, (d ) model for a practical A/D converter. where e(nT ) is the quantization error. Hence a practical A/D converter can be represented by the model of Fig. 6.16d , where e(nT ) can be regarded as a noise source. The effect of this noise source on the lter response will be considered in Sec. 14.5. The purpose of the D/A converter in Fig. 6.14b is to generate an impulse-modulated signal y (t ) like the one shown in Fig. 6.17a where the impulse functions are very thin and very tall pulses as dened in Sec. 6.2.1. However, a practical D/A converter will produce a waveform of the form illustrated in Fig. 6.17b where the pulses may not be very thin or very tall. Such a waveform can be represented by the equation y (t ) = n = y (nT ) p (t nT ) 306 y(t) y(kT ) y(kT ) y(t) T kT (a) (b) t kT t |Hp( j)| Practical D/A converter y(nT ) Ideal D/A converter y(t) Fp y(t) (c) 2 (d ) 4 Figure 6.17 Digital-to-analog interface: (a) Response of an ideal D/A converter, (b) response of a practical D/A converter, (c) model for a practical D/A converter, (d ) amplitude response of ctitious lter Fp . THE SAMPLING PROCESS 307 From Table 6.2 F p (t ) = 2 sin(/2) and by using the time-shifting theorem (Theorem 2.9), we obtain F p (t nT ) = 2 sin(/2) j nT e Hence the Fourier transform of y (t ) can be obtained as Y ( j ) = n = y (nT )F p (t nT ) 2 sin(/2) = y (nT )e j nT n = The above equation can be expressed as Y ( j ) = H p ( j )Y ( j ) H p ( j ) = sin(/2) /2 where and Y ( j ) = n = y (nT )e j nT By analogy with Eq. (6.43a), we can write Y ( j ) = n = y (nT )e j nT = F y (nT ) (t nT ) = F y (t ) n = where y (t ) is an impulse-modulated signal of the type that would be produced by an ideal D/A converted. Therefore, a practical D/A converter can be modeled in terms of an ideal D/A converter followed by a ctitious lter F p , as depicted in Fig. 6.17c, with a frequency response H p ( j ). The amplitude response of this lter is given by | H p ( j )| = sin (/2) /2 (6.60) and is sketched in Fig. 6.17d . Clearly, a practical D/A converter will introduce distortion in the overall amplitude response often referred to as sinc distortion which is actually a form of amplitude distortion (see Sec. 5.7). The effect of sinc distortion can be easily illustrated if we assume that the digital lter in Fig. 6.14b is a bandpass lter with an ideal amplitude response such as that in Fig. 6.18a . Due to sinc distortion, the amplitude response of the D/A converter will assume the form in Fig. 6.18b and thus the overall amplitude response of the bandpass lter in cascade with the D/A converter will 308 DIGITAL SIGNAL PROCESSING Gain (a) |Hp( j)| (b) 2 Gain (c) Figure 6.18 Effect of sinc distortion: (a ) Amplitude response of an ideal bandpass lter, (b) response of a practical D/A converter, (c) overall response of bandpass lter in cascade with D/A converter. be the product of the amplitude responses in Fig. 6.18a and b, as depicted in Fig. 6.18c. Evidently, the D/A converter will introduce a reduction in the overall gain, which would tend to increase with frequency. Sinc distortion can be reduced in a number of ways. One possibility would be to make the pulse width as small as possible which would move the notch at = 2/ to a higher frequency. Another possibility would be to design the output lowpass lter in Fig. 6.14b such that | H p ( j ) HLP ( j )| 1 0 for || s /2 otherwise On the other hand, in an application like that in Example 6.5 it is sometimes possible to design the digital lter such that the digital lter in cascade with the D/A converter satises the desired ltering specications. For example, the amplitude response of the bandpass lter can be designed to increase as the frequency is increased so as to compensate for the reduction in the amplitude response of the D/A converter, as illustrated in Fig. 6.19. Such a design would necessitate the use of optimization and an actual design of this type can be found in Sec, 16.7 (see Example 16.3). THE SAMPLING PROCESS 309 Gain (a) |Hp( j)| (b) 2 Gain (c) Figure 6.19 Compensation for sinc distortion: (a ) Amplitude response an ideal bandpass lter, (b) response of a practical D/A converter, (c) overall response of bandpass lter and D/A converter. Example 6.6 A bandpass digital lter with an idealized amplitude response 103 M B P () = 1 103 for 0 1200 rad/s for 1500 3000 rad/s for 3300 5000 rad/s is used in the DSP scheme shown in Fig. 6.14b. The output lowpass lter is ideal with a constant passband gain of 1/ and the D/A converter will produce an output waveform of the type shown in Fig. 6.17b with a pulse width = 0.3 ms. (a ) Find the maximum passband loss introduced by the D/A converter in dB if the sampling frequency is s = 104 rad/s. (b) Find the minimum sampling frequency that would keep the maximum passband loss to a value equal to or less than 0.1 dB. 310 DIGITAL SIGNAL PROCESSING Solution (a ) The overall amplitude response of the DSP system is given by M () = M B P () | H p ( j )| | HL P ( j )| and from Eq. (6.60), we have M () = M B P () = M B P () sin(/2) 1 /2 sin(/2) /2 Thus the D/A converter will introduce a loss which increases with frequency. The maximum passband loss will occur at the upper edge of the passband, i.e., at = 3000 rad/s, and hence sin(3000 0.3 103 /2) = 0.9666 3000 0.3 103 /2 Gain = M (3000) = or Loss = 20 log 1 = 0.2951 dB 0.9666 (b) The loss will be equal to or less than 0.1 dB at = 3000 if Loss = 20 log = 20 log Hence we require 3000/2 100.1/20 = 1.011579 sin(3000/2) A short MATLAB program will reveal that 3000/2 1.011579 sin(3000/2) if 1.7525 104 and, therefore, s 2/(1.7525 104 ) = 3.5853 104 rad/s. /2 0.1 sin(/2) 3000/2 0.1 sin(3000/2) THE SAMPLING PROCESS 311 REFERENCES [1] [2] [3] [4] [5] [6] [7] M. J. Lighthill, Introduction to Fourier Analysis and Generalised Functions, Cambridge: Cambridge University Press, 1958. W. Kaplan, Advanced Calculus, 3rd ed., Reading, MA: Addison-Wesley, 1962. R. J. Schwarz and B. Friedland, Linear Systems, New York: McGraw-Hill, 1965. A. Papoulis, The Fourier Integral and Its Applications, New York: McGraw-Hill, 1962. A. Antoniou, Digital Filters: Analysis, Design, and Applications, 2nd ed., New York: McGraw-Hill, 1993. H. Nyquist, Certain topics in telegraph transmission theory, Trans. A.I.E.E, pp. 617644, Feb. 1928. (See also Proc. IEEE, vol. 90, pp. 280305, Feb. 2002.) C. E. Shannon, Communication in the presence of noise, Proc. IRE, vol. 37, pp. 1021, Jan. 1949. (See also Proc. IEEE, vol. 86, pp. 447457, Feb. 1998.) PROBLEMS 6.1. (a ) Assuming that () = lim p () where p () = 1 0 for || otherwise /2 and is a very small but nite constant, show that () is an even function of , that is, () = () (b) (c) (d ) 6.2. (a ) Using the above denition, prove part (a ) of Theorem 6.1B. Prove part (b) of Theorem 6.1B. Prove part (c) of Theorem 6.1B. A periodic signal x (t ) can be represented by Eq. (6.30) with x (t ) p (t ) = Obtain the Fourier transform of x (t ). (b) Repeat part (a ) if x (t ) = p/2 t + 1 p/2 t 1 4 4 6.3. (a ) A periodic signal x (t ) can be represented by Eq. (6.30) with 1 2 x (t ) = 1 0 Obtain the Fourier transform of x (t ). for /2 t < /4 for /4 t < /4 for /4 t < /2 otherwise 1 0 for /2 t /2 otherwise 312 DIGITAL SIGNAL PROCESSING (b) Repeat part (a ) if for 3/8 t < /4 1 2 for /4 t < /4 x (t ) = for /4 t 3/8 1 0 otherwise 6.4. (a ) A periodic signal x (t ) can be represented by Eq. (6.30) with for /2 t 1 /2 1 for 1 /2 t /2 x (t ) = 1 0 otherwise where > 1 . Obtain the Fourier transform of x (t ). (b) Repeat part (a ) if for /2 t 1 /2 1 for 1 /2 t /2 x (t ) = 1 0 otherwise where > 1 . 6.5. (a ) A periodic signal x (t ) can be represented by Eq. (6.30) with for /2 t 2 /2 1 1 for 1 /2 t 1 /2 x (t ) = for 2 /2 t /2 1 0 otherwise where > 2 > 1 . Obtain the Fourier transform of x (t ). (b) Repeat part (a ) if for /2 t 2 /2 1 1 for 1 /2 < t < 1 /2 x (t ) = for 2 /2 t /2 1 0 otherwise where > 2 > 1 . 6.6. (a ) A periodic signal x (t ) can be represented by Eq. (6.30) with x (t ) = sin 0 t 0 for 0 t 0 /4 otherwise where 0 = 2/0 . Obtain the Fourier transform of x (t ). (b) Repeat part (a ) if x (t ) = cos 0 t 0 for 0 t 0 /4 otherwise where 0 = 2/0 . 6.7. (a ) A periodic signal x (t ) can be represented by Eq. (6.30) with x (t ) = sinh t 0 for /2 t /2 otherwise Obtain the Fourier transform of x (t ). THE SAMPLING PROCESS 313 (b) Repeat part (a ) if x (t ) = cosh t 0 for /2 t /2 otherwise 6.8. (a ) Find the Fourier transform of the periodic signal shown in Fig. P6.8a where 0 = 2/0 . Sketch the amplitude spectrum of the signal. (b) Repeat part(a ) for the signal shown in Fig. P6.8b. |sin (0 t/2)| 0 (a) t 0 (b) t Figure P6.8a and b 6.9. (a ) Find the Fourier transform of the periodic signal shown in Fig. P6.9a . Sketch the amplitude spectrum. (b) Repeat part (a ) for the signal shown in Fig. P6.9b. 1 0 (a) t 1 t 0 2 0 2 (b) Figure P6.9a and b 314 DIGITAL SIGNAL PROCESSING 6.10. (a ) Find the Fourier transform of the periodic signal shown in Fig. P6.10a . Sketch the amplitude spectrum. (b) Repeat part (a ) for the signal shown in Fig. P6.10b. 0 (a) t t 0 2 0 2 (b) Figure P6.10a and b 6.11. (a ) Find the Fourier transform of the periodic signals shown in Fig. P6.11a . Sketch the amplitude spectrum. (b) Repeat part (a ) for the signal shown in Fig. P6.11b. 0.5 t 0.5 0 2 (a) 0 2 0.5 t 0.5 0 (b) 0 Figure P6.11a and b THE SAMPLING PROCESS 315 6.12. Find the Fourier transforms of the periodic signals (a ) x (t ) = cos2 0 t + cos4 0 t (b) x (t ) = 1 2 + sin 0 t + 1 sin2 0 t + cos4 0 t 4 6.13. Find the Fourier transforms of the periodic signals (a ) x (t ) = (sin 50 t cos 0 t )2 (b) x (t ) = (cos 30 t cos 20 t )2 (c) x (t ) = (cos 0 t + j sin 0 t )n 6.14. (a ) (b) 6.15. (a ) (b) 6.16. (a ) (b) 6.17. (a ) (b ) 6.18. (a ) (b) 6.19. (a ) (b) 6.20. (a ) (b) 6.21. (a ) Show that the Fourier series kernel in Eq. (6.28) is periodic with period T . Show that the signal in Eq. (6.30) is periodic with period T . Show that the periodic signal in Prob. 6.2, part (a ), satises Theorem 6.3. Repeat part (a ) for the periodic signal in Prob. 6.2, part (b). Show that the periodic signal in Prob. 6.3, part (a ), satises Theorem 6.3. Repeat part (a ) for the periodic signal in Prob. 6.4, part (a ). Show that the periodic signal in Prob. 6.7, part (a ), satises Theorem 6.3. Repeat part (a ) for the periodic signal in Prob. 6.8, part (b). Signal x (t ) is obtained by applying impulse modulation to the nonperiodic signal in Prob. 6.3, part (a ). Obtain the Fourier transform of x (t ) in closed form if = 5T . Repeat part (a ) if = 6T . Signal x (t ) is obtained by applying impulse modulation to the nonperiodic signal in Prob. 6.4, part (a ). Obtain the Fourier transform of x (t ) in closed form if = 6T and 1 = T . Repeat part (a ) if = 7T and 1 = 1.5T . Signal x (t ) is obtained by applying impulse modulation to the nonperiodic signal in Prob. 6.7, part (a ). Obtain the Fourier transform of x (t ) in closed form if s = 2/ T = 18 rad/s and = 1.0 s. Repeat part (a ) if s = 2/ T = 20 rad/s. Find the Fourier transform of x (t ) = p (t 2T ) where = ( N 1)T /2 and N is odd. The sampling frequency is s = 2/ T . (b) Find the Fourier transform of the impulse-modulated signal x (t ) in closed form. (c) Find the Fourier transform of x (t ) using Poissons summation formula. 6.22. Repeat parts (a ), (b), and (c) of Prob. 6.21 if x (t ) = assuming that s = 2/ T . 6.23. (a ) Find the Fourier transform of x (t ) = u (t )2e0.5t +0.1 The sampling frequency is s = 2/ T . + (1 ) cos 0 t for |t | otherwise 316 DIGITAL SIGNAL PROCESSING (b) Find the Fourier transform of x (t ) in closed form. (c) Find the Fourier transform of x (t ) using Poissons summation formula. 6.24. The signal x (t ) = u (t )et cos 2t is sampled at a rate of 2 rad/s. (a ) Find the Fourier transform of x (t ). (b) Find the Fourier transform of x (t ) in closed form. (c) Show that 1 1 + j ( + 2 k ) X ( j ) = X D (e j T ) = + 2 k = [1 + j ( + 2 k )]2 + 4 (d ) By evaluating the left- and right-hand sides for a number of frequencies in the range 0 s /2, demonstrate that the relation in part (c) holds true. (Hint: The left-hand side is the z transform of x (nT ) evaluated on the unit circle |z | = 1. The right-hand side is, as can be seen, an innite series but the magnitudes of its terms tend to diminish rapidly and eventually become negligible as |k | increases.) 6.25. (a ) Find the Fourier transform of x (t ) = u (t )e0.01t sin 2 t (b) Find the Fourier transform of x (t ) in closed form assuming a sampling frequency s = 10 rad/s. (c) Repeat part (b) using Poissons summation formula. 6.26. A nonperiodic pulse signal x (t ) assumes the form depicted in Fig. P6.26. (a ) Obtain a representation for x (t ) in the form of a summation. (b) Find the Fourier transform of x (t ). (c) Obtain the Fourier transform of impulse-modulated signal x (t ) in the form of an innite summation. x (t) x (kT ) t kT Figure P6.26 THE SAMPLING PROCESS 317 6.27. (a ) Obtain the Fourier of x (t ) = 1 0 |t | for |t | otherwise where = ( N 1)T /2 and T = 2/s . (b) Using Poissons summation formula, show that X ( j ) 8 ( N 1)T sin2 2 ( N 1)T 2 4 for || < s 2 if s 16/ N . (Hint: Note that X ( j ) 0 if s 16/ N .) 6.28. The ltering scheme of Example 6.5 is used to process the signal of Fig. P6.8b. (a ) Assuming that 0 = 2/0 , nd the time- and frequency-domain representations of the signals at nodes 1, 2, . . . , 7. (b) Sketch the various waveforms and amplitude spectrums. 6.29. The DSP system of Fig. 6.14b employs a bandpass digital lter with an amplitude response like that depicted in Fig. P6.29. The output of the D/A converter is of the form shown in Fig. 6.17b, where = 3.0 ms and the sampling frequency is 1000 rad/s. (a ) Assuming an ideal output lowpass lter with a constant passband gain of 1/ , sketch the overall amplitude response of the conguration indicating relevant quantities. (b) The gain at = 300 rad/s is required to be equal to or greater than 0.99 times the gain at = 200 rad/s. Find the maximum permissible value of . Hence, calculate the lowest sampling frequency. 1.0 Gain 0.1 , rad/s 200 300 500 Figure P6.29 6.30. A digital lter is connected in cascade with a practical D/A converter as shown in Fig. 6.14b. The amplitude response of the lter is illustrated in Fig. P6.30a and the time-domain response of the D/A converter is a staircase waveform of the type shown in Fig. P6.30b. The sampling frequency is s = 8 rad/s. (a ) Calculate the overall gain of the cascade arrangement for = 0, 2 , 2 + , 3 , 3 + , and 4 rad/s ( is a small positive constant, say less than 0.0001). 318 DIGITAL SIGNAL PROCESSING (b) Sketch the amplitude response of the arrangement, indicating relevant quantities. 1.0 0.8 Gain 0.6 0.4 0.2 0 0 1.0 2.0 (a) 3.0 4.0 , rad/s ~ y(t) T t (b) Figure P6.30 6.31. The DSP system of Fig. 6.14b uses a bandpass lter characterized by the transfer function 3 H (z ) = H0 j =1 a0 j + a1 j z + z 2 b0 j + b1 j z + z 2 and has a passband ripple6 of 1 dB. The sampling frequency is 20 rad/s. The output lowpass lter is ideal with a constant passband gain of 1/ and the D/A converter will produce an output waveform of the type shown in Fig. 6.17b. (a ) Find the amplitude response of the system, including the effect of the D/A converter, assuming a pulse duration = T /100 in the waveform of Fig. 6.17b . (b) Repeat part (a ) if = T . (c) Find the lowest sampling frequency that would assure a maximum passband ripple that does not exceed 1.2 dB over the passband range 4.0 to 6.0 rad/s. 6 This is the difference between the maximum and minimum passband gain in dB. THE SAMPLING PROCESS 319 Table P6.31 j a0 j Coefcients of H (z ) (Prob. 6.31) a1 j b0 j b1 j 1 1.0 0.0 7.190253 E 1 7.461412 E 8 2 1.0 1.691081 8.670819 E 1 5.623427 E 1 3 1.0 1.691082 8.670819 E 1 5.623425 E 1 H0 = 1.640287 E 2 This page intentionally left blank CHAPTER 7 THE DISCRETE FOURIER TRANSFORM 7.1 INTRODUCTION Given a nite-duration discrete-time signal, a corresponding periodic discrete-time signal can be generated which has a discrete Fourier transform (DFT) that happens to be a discrete-frequency spectrum. Thus given a signal that can be represented by a sequence of numbers a spectral characterization of the signal can be obtained, which can also be represented by a sequence of numbers. Consequently, the DFT is highly amenable to processing by computers and digital signal processors. The DFT turns out to be a sampled version of the frequency spectrum of the original nite-duration nonperiodic signal and, therefore, it is a very important tool for digital signal processing (DSP). In a landmark paper published in 1965, Cooley and Tukey demonstrated that the direct evaluation of the DFT entails a considerable amount of redundancy and through an ingenious method that has come to be known as the fast Fourier transform (FFT), these authors and others [14] have shown that a huge amount of computation can be eliminated without degrading the precision of the DFT in any way. The FFT approach renders a highly amenable tool for computation also a very efcient one and for these reasons the DFT has found widespread applications over the years. By analogy with the convolution summation described in Sec. 4.6, periodic convolutions can be constructed, which can also benet greatly through the application of the FFT [5]. Through the periodic convolutions, some highly efcient implementations of nite-duration impulse response (FIR) lters can be achieved. 321 Copyright 2006 by The McGraw-Hill Companies, Inc. Click here for terms of use. 322 DIGITAL SIGNAL PROCESSING x(nT ) nT NT 0 NT 2NT 3NT Figure 7.1 A periodic discrete-time signal. This chapter deals with the denition of the DFT and inverse-DFT and their properties. The relations between the DFT and the z transform, the continuous-time Fourier transform (CFT), and Fourier series are then established. The chapter also deals with a technique known as the window technique which enables the processing of long- or innite-duration signals through the use of the FFT method. Periodic convolutions and their efcient computation through the use of FFTs are then discussed. 7.2 DEFINITION A discrete-time signal x (nT ) is periodic if it satises the condition x (nT + r N T ) = x (nT ) for 1, 2, . . . , where N is an integer and N T is said to be the period of the signal. A periodic discrete-time signal is illustrated in Fig. 7.1. The DFT of a periodic signal x (nT ) is dened as N 1 X ( jk ) = n =0 x (nT )W kn = D x (nT ) = s N and s = 2 T (7.1) where W = e j 2/ N In general, X ( jk ) is complex and can be put in the form X ( jk ) = A(k )e j (k where A(k ) = | X ( jk )| and ) (k ) = arg X ( jk ) are discrete-frequency functions. The functions A(k ) and (k ) are referred to as the amplitude spectrum and phase spectrum of x (nT ), respectively. They are entirely analogous to the corresponding spectrums of continuous-time and nonperiodic discrete-time signals. 7.3 INVERSE DFT The function x (nT ) is said to be the inverse DFT (IDFT) of X ( jk ) and is given by x (nT ) = 1 N N 1 k =0 X ( jk )W kn = D1 X ( jk ) (7.2) THE DISCRETE FOURIER TRANSFORM 323 The validity of the inverse DFT can be demonstrated by eliminating the DFT in Eq. (7.2) using Eq. (7.1). We can write 1 N N 1 k =0 1 X ( jk )W kn = N = 1 N N 1 k =0 N 1 N 1 m =0 x (mT )W km W kn N 1 x (mT ) m =0 k =0 W k (n m ) where one can show that N 1 k =0 W k (n m ) = N 1 N 0 for m = n otherwise (see Prob. 7.1). Therefore 1 N X ( jk )W kn = x (nT ) k =0 7.4 7.4.1 PROPERTIES Linearity The DFT obeys the law of linearity; that is, for any two constants a and b, D[a x (nT ) + b y (nT )] = a X ( jk ) + bY ( jk ) 7.4.2 Periodicity From Eq. (7.2) N 1 N 1 n =0 X [ j (k + r N ) ] = n =0 x (nT )W (k +r N )n = x (nT )W kn = X ( jk ) since W r n N = 1. In effect, X ( jk ) is a periodic function of k with period N (= s ). 7.4.3 Symmetry The DFT has certain symmetry properties that are often useful. For example, assuming that x (nT ) is real, we have N 1 X [ j (N k) ] = n =0 x (nT )W ( N k )n = N 1 x (nT )W kn n =0 N 1 = n =0 x (nT )W kn = X ( jk ) 324 DIGITAL SIGNAL PROCESSING and as a result Re X [ j ( N k ) ] = Re X ( jk ) A[( N k ) ] = A(k ) Im X [ j ( N k ) ] = Im X ( jk ) [( N k ) ] = (k ) + 2 r where r is any integer. If x (nT ) is real and, in addition, x (nT ) = x [( N n )T ] we obtain N 1 X ( jk ) = n =0 x [( N n )T ]W kn = N 1 m =0 x (mT )W k ( N m ) N 1 = n =0 x (nT )W kn = X ( jk ) Thus if x (nT ) = x [( N n )T ] we have Im X ( jk ) = 0 and if x (nT ) = x [( N n )T ] then Re X ( jk ) = 0 Example 7.1 Find the DFT of x (nT ) if x (nT ) = 1 0 for 2 n 6 for n = 0, 1, 7, 8, 9 assuming that N = 10. THE DISCRETE FOURIER TRANSFORM 325 Solution By noting that the DFT is a geometric series (see Sec. A.5) with a common ratio W k , Eq. (7.1) gives 6 X ( jk ) = n =2 W kn = W 2k W 7k 1 W k = e j 4 k /5 sin( k /2) sin( k /10) The amplitude and phase spectrums of x (nT ) can be obtained as A(k ) = and (k ) = C and are plotted in Fig. 7.2. 4 k 5 1 where C = 0 if sin( k /2) <0 sin( k /10) otherwise sin( k /2) sin( k /10) 7.5 INTERRELATION BETWEEN THE DFT AND THE Z TRANSFORM The DFT is dened in Sec. 7.2 in terms of periodic discrete-time signals. Nevertheless, it can also be applied for the analysis of nonperiodic discrete-time signals as long as they are of nite duration. Given an arbitrary nite-duration discrete-time nonperiodic signal x (nT ) such that x (nT ) = 0 for n < 0 and n>M where M < N , then a corresponding periodic signal x (nT ) with period N T can be readily formed as x (nT ) = r = x (nT + r N T ) (7.3) by analogy with Eq. (2.1). Since x (nT ) can be derived from x (nT ), the DFT of x (nT ) must be related to the frequency spectrum and, in turn, to the z transform of x (nT ) as will now be demonstrated. From Eqs. (7.1) and (7.3), we can write N 1 X ( jk ) = n =0 r = x (nT + r N T )W kn = N 1 x (nT + r N T )W kn r = n =0 326 DIGITAL SIGNAL PROCESSING 1.5 1.0 x(nT ) 0.5 ~ 0 0 2 4 6 8 10 NT (a) 12 14 16 nT 18 20 2NT 6 4 A(k) 2 0 0 2 4 6 8 10 N (b) 12 14 16 k 18 20 2N 0 10 (k) 20 30 0 2 4 6 8 10 N (c) 12 14 16 k 18 20 2N Figure 7.2 DFT of x (nT ) (Example 7.1): (a ) Periodic discrete-time signal, (b) amplitude spectrum, (c) phase spectrum. and by letting n = m r N , we have r N + N 1 X ( jk ) = r = m =r N 1 x (mT )W k (m r N ) N 1 m =0 = + m = N x (mT )W km + x (mT )W km + 2 N 1 m=N x (mT )W km + = m = x (mT )W km THE DISCRETE FOURIER TRANSFORM 327 Alternatively, on replacing W by e j 2/ N and m by n we have X ( jk ) = n = x (nT )e jk nT and, therefore, where X ( jk ) = X D (e jk X D (z ) = Z x (nT ) T ) (7.4) In effect, the DFT of a periodic signal x (nT ) is a sampled version of the frequency spectrum of the nonperiodic signal x (nT ), which is obtained by evaluating the z transform of x (nT ) on the unit circle |z | = 1, as shown in Fig. 7.3. Through a technique known as zero padding, the above interrelationship can be used to facilitate the computation of the frequency spectrum of a nite-duration discrete-time signal to any desired resolution, as will now be demonstrated. Consider a nonperiodic signal x (nT ) which is zero outside the interval 0 to ( L 1)T . Such a signal has a frequency spectrum X D (e j T ) = n = x (nT )z n L 1 z =e j T = n =0 x (nT )e jn T If we let = k s / N = 2 k / N T , we get X D (e jk s / N ) = L 1 n =0 x (nT )e j 2 kn / N (7.5) z plane 4 3 2 1 kT N = 12 N1 Figure 7.3 Relation between X ( jk ) and X D (e jk T ). 328 DIGITAL SIGNAL PROCESSING Let us construct a periodic signal x (nT ) with period N T such that x (nT ) = x (nT ) 0 for 0 n L 1 for L n N 1 (7.6) through periodic continuation (see Eq. (7.3)). From the denition of the DFT, we have N 1 X ( jk ) = n =0 L 1 x (nT )W kn x (nT )e j 2 kn / N = n =0 (7.7) If we now compare Eqs. (7.5) and (7.7), we conclude that X D (e jk s / N ) = X ( jk ) (7.8) As was shown earlier, the DFT gives a sampled version of the frequency spectrum of a discrete-time signal and by increasing the number of zeros in Eq. (7.6), = s / N is reduced and, consequently, a higher density of sample points can be achieved. The zero padding technique is illustrated in Fig. 7.4 which shows the DFT of Example 7.1 with the value of N increased from 10 to 20. As can be seen by comparing Fig. 7.4b and c with Fig. 7.2b and c, the density of samples in the amplitude and phase spectrums is doubled. 7.5.1 Frequency-Domain Sampling Theorem The application of the DFT to DSP is made possible by the frequency-domain sampling theorem which is analogous to the time-domain sampling theorem considered in Sec. 6.6 except that the roles of time and frequency are interchanged. Theorem 7.1 Frequency-Domain Sampling Theorem A z transform X D (z ) whose inverse satises the nite-duration condition x (nT ) = Z 1 X D (z ) = 0 for n < 0 and nN (7.9) can be uniquely determined from its values X D (e jkT ) or, equivalently, from the values of the DFT of x (nT ), X ( jk), by virtue of Eq. (7.4). The validity of Theorem 7.1 can be easily demonstrated. If the condition in Eq. (7.9) is satised, then x (nT ) as given by Eq. (7.3) is a periodic continuation of x (nT ) and x (nT ) can be isolated by multiplying x (nT ) by a discrete-time pulse as illustrated in Fig. 7.5. We can write x (nT ) = [u (nT ) u (nT N T )]x (nT ) and so X D (z ) = Z {[u (nT ) u (nT N T )]x (nT )} (7.10) THE DISCRETE FOURIER TRANSFORM 329 1.5 1.0 ~ x(nT ) 0.5 0 0 5 10 15 20 NT (a) 25 30 nT 35 40 2NT 6 4 A(k) 2 0 0 5 10 15 20 N (b) 25 30 k 35 40 2N 0 10 (k) 20 30 0 5 10 15 20 N (c) 25 30 k 35 40 2N Figure 7.4 Effect of zero padding: (a ) Periodic discrete-time signal of Example 7.1 with zero padding, (b) amplitude spectrum, (c) phase spectrum. Now x (nT ) = D1 X ( jk ) and from Eq. (7.2) X D (z ) = Z = 1 N [u (nT ) u (nT N T )] N 1 where X ( jk ) = X D (e jk T ) 1 N N 1 X ( jk )W kn k =0 X ( jk )Z {[u (nT ) u (nT N T )]W kn } k =0 330 DIGITAL SIGNAL PROCESSING x(nT ) nT NT NT 2 NT u(nT ) u(nT NT ) nT NT x(nT ) nT NT Figure 7.5 Derivation of x (nT ) from x (nT ). The z transform of the unit-step is given by Z u (nT ) = z z1 Therefore, from the time-shifting and complex-scale-change theorems (Theorems 3.4 and 3.5), we have X D (z ) = 1 N N 1 k =0 1 zN X ( jk ) 1 W k z 1 (7.11) since W k N = 1. In summary, if the nonperiodic signal x (nT ) is zero outside the range 0 nT ( N 1)T , then the periodic signal x (nT ) and its DFT X ( jk ) can be obtained from x (nT ) and X D (z ) by using Eqs. (7.3) and (7.4), respectively. Conversely, x (nT ) and X D (z ) can be obtained from x (nT ) and X ( jk ) by using Eqs. (7.10) and (7.11), respectively, as illustrated in Fig. 7.6. Therefore, x (nT ) can be represented by the DFT of x (nT ). As a result, any nite-duration discrete-time signal can be x(nT ) Z |XD(ejT )| Z 1 nT NT s 0 s Eq. (7.3) Eq. (7.10) Eq. (7.4) Eq. (7.11) x(nT ) D |X( jk)| D1 nT NT N 0 k N Figure 7.6 Interrelations between the DFT and the z transform. 331 332 |XD(ejT )| x(nT ) Z Z1 nT NT s 0 s Eq. (7.3) Eq. (7.4) x(nT ) D D1 |X( jk)| nT NT 2NT N 0 k N Figure 7.7 Time-domain aliasing. THE DISCRETE FOURIER TRANSFORM 333 processed by employing the FFT algorithms to be described in Sec. 7.11 provided that a sufciently large value of N is chosen. 7.5.2 If Time-Domain Aliasing x (nT ) = 0 for n < 0 or nN then parts of one or more of the shifted signal copies x (nT N T ), x (nT 2 N T ), . . . in Eq. (7.3) will contribute to the value of x (nT ) in the range 0 t < N T thereby causing so-called time-domain aliasing which is analogous to the frequency-domain aliasing encountered in Sec. 6.7. Consequently, x (nT ) will not be a periodic continuation of x (nT ), as illustrated in Fig. 7.7. Nevertheless, the peri odic signal x (nT ) and its DFT X ( jk ) can again be obtained from the nonperiodic signal x (nT ) and its z transform X D (z ), respectively, by using Eqs. (7.3) and (7.4), as illustrated in Fig. 7.7. However, in such a case, x (nT ) cannot be recovered from x (nT ) by using Eq. (7.10), because of the signal distortion introduced by time-domain aliasing, and so Eq. (7.11) will not yield the z transform of x (nT ). Under these circumstances, the DFT of x (nT ) is at best a distorted representation for x (nT ). 7.6 INTERRELATION BETWEEN THE DFT AND THE CFT The frequency spectrum of a nonperiodic discrete-time signal x (nT ) is related to that of the underlying continuous-time signal x (t ), as was shown in Sec. 6.5.2. On the other hand, given a nite-duration discrete-time signal x (nT ), a corresponding periodic discrete-time signal x (nT ) can be generated by using Eq. (7.3), which has a DFT. Consequently, a direct interrelation exists between the DFT of x (nT ) and the CFT [5] of x (t ). This can be readily established by using the results of Secs. 6.5.2 and 7.5. Let X ( j ) and X ( j ) be the CFTs of x (t ) and x (t ), respectively, where x (t ) is the impulsemodulated version of x (t ). From Eqs. (7.4) and (6.45a), we have X ( jk ) = X D (e jk T 1 ) = X ( jk ) = T X ( jk r = + jr s ) (7.12a) and, therefore, from Eqs. (7.3) and (7.12a) D r = x (nT + r N T ) = 1 T X ( jk r = + jr s ) (7.12b) Now if x (t ) = 0 for t < 0 and for || s 2 t NT (7.13) and X ( j ) = 0 (7.14) 334 |X( j)| x(t) F 1 F t NT t = nT x(nT ) Eq. (6.51) s 0 Eq. (6.45a) or (6.45b) |XD(ejT )| Eq. (6.48) s Z Z 1 nT s Eq. (7.3) x(nT ) D1 Eq. (7.10) Eq. (7.4) |X( jk)| D Eq. (7.11) s nT NT N k N Figure 7.8 Interrelations between the DFT and the CFT. THE DISCRETE FOURIER TRANSFORM 335 the left- and right-hand summations in Eq. (7.12b) become periodic continuations of x (nT ) and X ( j ), respectively, and as a result x (nT ) = x (nT ) for 0 nT ( N 1)T 1 s X ( jk ) = X ( jk ) for |k | < T 2 Hence the periodic signal x (nT ) and its DFT X ( jk ) can be obtained from the continuous-time signal x (t ) and its CFT X ( j ), respectively, and conversely, as depicted in Fig. 7.8. That is, a continuous-time signal x (t ) can be represented by a DFT and, accordingly, it can be processed by using the FFT method. 7.6.1 Time-Domain Aliasing If Eq. (7.13) is violated, then parts of one or more of the shifted signal copies x (t N T ), x (t 2 N T ), . . . will contribute to the value of x (t ) in the range 0 t < N T thereby causing time-domain aliasing and, as in the case of discrete-time signals described in Sec. 7.5.2, x (t ) cannot be recovered from x (t ). On the other hand, if the spectrum of x (t ) does not satisfy the bandlimiting condition in Eq. (7.14), then X ( j ) cannot be recovered from the DFT of x (t ). 7.7 INTERRELATION BETWEEN THE DFT AND THE FOURIER SERIES The results of the previous section lead directly to a relationship between the DFT and the Fourier series [5]. A periodic signal x (t ) with a period 0 can be expressed as x (t ) = r = x (t + r 0 ) (7.15) where x (t ) = 0 for t < 0 and t 0 1 . Alternatively, by using the Fourier series (see Eqs. (2.3) and (2.5)), we have x (t ) = k = X k e jk 0 t where 0 = 2/0 and Xk = 1 0 0 0 x (t )e jk 0 t dt 1 Note that x (t ) is dened to be zero for t 0 /2 and t > 0 /2 in Chap. 2 but the two denitions are equivalent. 336 DIGITAL SIGNAL PROCESSING Now with t = nT and 0 = N T , Eq. (7.15) becomes x (nT ) = r = x (nT + r N T ) and, consequently, Eq. (7.12a) yields 1 X ( jk ) = T X ( jk r = + jr s ) (7.16) where X ( jk ) = F x (t ) =k = 0 0 x (t )e jk t dt or since X ( jk ) = 0 0 x (t )e jk 0 t dt = s / N = 2/ N T = 2/0 = 0 . Evidently X ( jk ) = 0 X k and since 0 = N T , Eq. (7.16) can be put in the form 1 X ( jk ) = T X [ j (k + r N ) ] = N r = r = X k +r N (7.17) In effect, the DFT of x (nT ) can be expressed in terms of the Fourier-series coefcients of x (t ). Now with Xk 0 Eq. (7.17) gives X ( jk ) N X k 1 X ( jk ) N for |k | < N 2 N 2 for |k | N 2 or Xk for |k | < Thus the Fourier-series coefcients of x (t ) can be efciently computed by using the FFT method. THE DISCRETE FOURIER TRANSFORM 337 7.8 WINDOW TECHNIQUE As was demonstrated in Secs. 7.5 and 7.6, in order to process a discrete- or continuous-time signal, say, x (nT ) or x (t ), through the FFT method, a corresponding periodic discrete-time signal x (nT ) = r = x (nT + r T ) must rst be generated through periodic continuation. If x (nT ) = 0 or x (t ) = 0 outside the time range 0 to ( N 1)T , then time-domain aliasing will be introduced, as was shown in Secs. 7.5.2 and 7.6.1, which will distort the signal over the period 0 to ( N 1)T . The effects of time-domain aliasing can be reduced by forcing the signal to become zero outside the time range 0 to ( N 1)T in such a way so as to as far as possible preserve the signals frequency spectrum. This can be done through the use of the so-called window technique. The window technique entails the use of a class of functions known collectively as window functions (or simply as windows) [6, 7]. The underlying windows are continuous-time functions but they are usually applied in their nonperiodic or periodic discrete-time form. Discrete-time windows inherit their characteristics from their continuous-time counterparts. Consequently, it is worthwhile to study the basic principles associated with continuous-time windows before we proceed to the properties and application of discrete-time windows. For the sake of simplicity, we consider the case of two-sided windows that are dened over the range t but the principles involved are also valid for right-sided windows that are dened over the range 0 t . 7.8.1 Continuous-Time Windows Two-sided window functions share two fundamental properties: 1. They are dened to be zero outside some interval t , that is, w (t ) = w0 (t ) 0 for t otherwise where w0 (t ) is normally an even function of t . 2. Their spectral energy2 is concentrated in a narrow frequency range m m and is zero outside this range. The most basic window is the rectangular window which is dened as w R (t ) = 1 0 for t otherwise (7.18) spectral energy of a signal with respect to a range of frequencies 1 to 2 is proportional to the integral of the square of the amplitude spectrum of the signal over the given frequency range. 2 The 338 DIGITAL SIGNAL PROCESSING 40 35 30 25 20 WR( j) 15 10 Main-lobe width AML 5 0 5 10 2.0 1.5 1.0 0.5 0 , rad/s Amax 0.5 1.0 1.5 2.0 Figure 7.9 Spectrum of rectangular window ( = 15.0 s). The frequency spectrum of the rectangular window is given by the Fourier transform of the pulse function p (t ) (see Table 6.2) as W R ( j ) = 2 sin (7.19) and is illustrated in Fig. 7.9. Windows are characterized by their main-lobe width B M L , which is the bandwidth between the rst negative and the rst positive zero crossings, and by their ripple ratio r which is dened as r = 100 Amax % AML R = 20 log Amax dB AML or where Amax and AML are the maximum side-lobe and main-lobe amplitudes, respectively (see Fig. 7.9). From Eq. (7.19), we note that the frequency spectrum of the rectangular window has zero crossings when = m for m = 1, 2,. . . and hence BML = 2/ . On the other hand, the ripple ratio can be plotted as a function of as shown in Fig. 7.10. Evidently, the ripple ratio assumes a value of about 13.26 dB which is practically independent of the window length . This is a fairly large ripple ratio which tends to limit the usefulness of the rectangular window. The window technique entails multiplying the signal to be processed by the window function, i.e., xw (t ) = w (t )x (t ) THE DISCRETE FOURIER TRANSFORM 339 13.10 13.15 13.20 13.25 13.30 13.35 13.40 13.45 13.50 0 10 20 30 40 50 , s 60 70 80 90 100 Ripple ratio, dB Figure 7.10 Ripple ratio of rectangular window versus window length . In order to examine the effect of a window on the frequency spectrum of a signal, consider a signal that has a uniform real spectrum over the frequency range c < < c , that is, X ( j ) = 1 0 for || < c otherwise as shown in Fig. 7.11a and assume that the spectrum of w (t ) is concentrated in the range m m and is zero outside this range, i.e., W ( j ) = W0 () 0 for || m otherwise where W0 () is an even real function of as depicted in Fig. 7.11b. For the sake of convenience and without loss of generality, assume that the area under the graph of W ( j ) is equal to 2 . The reason for this will become evident below. Since xw (t ) is the product of two time-domain functions, the spectrum of the modied signal can be obtained by using the frequency convolution of the Fourier transform (Theorem 2.15) as X w ( j ) = = 1 2 1 2 W(j )X ( j j )W ( j j )d )d (7.20a) (7.20b) X( j 340 DIGITAL SIGNAL PROCESSING X( j) 1 c (a) c W ( j) 2 m (b) m Figure 7.11 Frequency spectrums of x (t ) and w (t ). Using Eq. (7.20b), the spectrum of xw (t ) at some arbitrary frequency can be obtained through the following graphical construction: 1. Replace the frequency variable in X ( j ) and W ( j ) by variable to obtain X ( j ) and W ( j ), respectively, as shown in Fig. 7.12a and b. 2. Replace in W ( j ) by in Fig. 7.12b, that is, turn over the spectrum of w (t ) end-to-end with respect to the axis, to obtain W ( j ). This step would have no effect in the present application because the spectrum of the window has been assumed to be an even function of and it is, therefore, symmetrical about the y axis. 3. Shift W ( j ) to the right by to obtain W ( j j ) as shown in Fig. 7.12c. 4. Form the product X ( j )W ( j j ) as shown in Fig. 7.12d . 5. Area A( j ) in Fig. 7.12d is given by A( j ) = X( j )W ( j j )d and from Eq. (7.20b) we note that X w ( j ) = A( j )/2 . Since the area under the graph W ( j ) has been assumed to be equal to 2 , A( j ) would be equal to 2 in the frequency range 0 to c m and a fraction of that amount in the range c m to c + m . In effect, X w ( j ) would assume the value of unity for frequencies in the range 0 to c m and a fraction between 1 and 0 in the range c m to c + m . THE DISCRETE FOURIER TRANSFORM 341 X( j ) 1 c c (a) W( j ) 2 m m (b) W( jj ) (c ) X( j )W( jj ) A( j) (d ) Figure 7.12 Evaluation of convolution integral. If is varied in the range 1 to 5 through the point of discontinuity = c , the above graphical construction will give Fig. 7.13c to f and by multiplying each of the areas A( j 1 ), A( j 2 ),. . . by the factor 1/2 , the frequency spectrum of the modied signal can be obtained as illustrated in Fig. 7.13g . Since the areas A( j 1 ), A( j 2 ), . . . assume values in the range 2 to 0, it follows that X w ( j ) will assume values in the range 1 to 0. As can be seen in Fig. 7.13g, the spectrum of the modied signal is the same as that of the original signal except that a transition band has been introduced at the point of discontinuity = c . The same would also happen at any other discontinuity. From Fig. 7.13g , we observe that the width of the transition band introduced is equal to 2m , which is the main-lobe width of the window. Therefore, the main-lobe width should, in practice, be as small as possible. The window considered in the above demonstration is actually an idealization. In practice, the window has side lobes and, therefore, the spectral energy outside the main lobe is never zero. If an 342 DIGITAL SIGNAL PROCESSING X( j ) (a) cm W( j-j ) (b) 1 5 A( j1) 1 c c+ m (c) A( j2) 2 (d ) (e) 3 (f) 4 Xw( j) (g) Figure 7.13 Effect of an idealized window on the spectrum of a signal. actual window were to be used in the graphical construction of Fig. 7.13, as illustrated in Fig. 7.14, then the areas under the graphs in Fig. 7.14d and e, namely, A( j 0 ) and A( j 6 ), respectively, would be slightly different from 2 in the rst case and from zero in the second case due to the area of the side lobes. Similarly, the spectrum of xw (t ) would be slightly different from unity and 0 at frequencies 0 and 6 , respectively, as shown in Fig. 7.14 f . Now as is varied, the area of the side ripples that happen to fall in the range 0 < < c will vary and, consequently, the spectrum of the modied signal will exhibit oscillations whose amplitude would be directly related to the amplitude of the window side ripples. We conclude, therefore, that the amplitude of side lobes should, in practice, be THE DISCRETE FOURIER TRANSFORM 343 X( j ) (a) 0 c W( j j ) (b) 0 (c) 6 A( j0 ) 0 (d ) A( j6) (e) 6 Xw( j) (f) Figure 7.14 Effect of window side lobes. as small as possible in relation to the amplitude of the main lobe, i.e., the ripple ratio should be as small as possible. Example 7.2 The innite-duration signal x (t ) = sin c t t where c = 1 rad/s, is to be converted into a corresponding nite-duration signal xw (t ) by using the rectangular window dened in Eq. (7.18) with = 15.0 s. (a ) Obtain X ( j ), the frequency spectrum of x (t ). (b) Repeat part (a ) for the modied signal xw (t ). (c) Plot the difference between X ( j ) and X w ( j ). 344 DIGITAL SIGNAL PROCESSING Solution (a ) From Table 6.2, we have X ( j ) = p2c () where p2c () = 1 0 for || < c otherwise (7.21) (b) From Eqs. (7.19), (7.20b), and (7.21), the frequency spectrum of the modied signal is obtained as X w ( j ) = 1 2 1 1 X( j c c )W R ( j j sin( ) d ) )d = p2c ( ) sin( d = (7.22) The real integral in Eq. (7.22) can be evaluated by means of some numerical formula, for example, Simpsons one-third rule (see p. 381 of Ref. [11]) given by xm +1 x1 x f (x ) d x = 3 m m 1 y1 + 4 i even yi + 2 i odd yi + ym +1 (7.23) where m is assumed to be an even integer. The graphical construction for the convolution integral of Eq. (7.22) for = 15.0 s and c = 1 rad/s is illustrated in Fig. 7.15. The spectrum of xw (t ), that is, X m ( j ) is illustrated in Fig. 7.15e. (c) The difference between X w () and X (), which is plotted in Fig. 7.15 f , is seen to oscillate about zero and becomes signicantly larger at frequencies close to the band edges c . The oscillations in X w () are caused by the side lobes in the spectrum of the window, as was anticipated earlier. The larger difference near the band edges is due to the nite main-lobe width and it is caused by the fact that convolution tends to smooth the value of the function in the region of a discontinuity. If the ripple ratio and main-lobe width of the window function were decreased, the spectrum of the nite-duration signal xw (t ) would tend to approach that of the innite-duration signal x (t ). THE DISCRETE FOURIER TRANSFORM 345 1.5 1.0 X( j ) (a) 0.5 0 2.0 1.5 1.0 0.5 0 0.5 1.0 1.5 2.0 40 W(jj ) 20 (b) 0 20 2.0 1.5 1.0 0.5 0 0.5 1.0 1.5 2.0 40 W(j j ) 20 (c) 0 20 2.0 1.5 1.0 0.5 0 0.5 1.0 1.5 2.0 1.5 Xm( j ) 1.0 (d ) 0.5 0 2.0 1.5 1.0 0.5 0 0.5 1.0 1.5 2.0 2 Xm(j) 1 (e) 0 1 2.0 1.5 1.0 0.5 0 0.5 1.0 1.5 2.0 1.0 0.5 Error 0 0.5 1.0 2.0 1.5 1.0 0.5 0 0.5 1.0 1.5 2.0 (f) Figure 7.15 Use of rectangular window (Example 7.2): (a ) Spectrum of original signal, (b) shifted spectrum of window, (c) truncated spectrum of window, (d ) area under the curve in plot (c), (e) modied spectrum of signal, ( f ) difference between the spectrums of the original and modied signals. 346 DIGITAL SIGNAL PROCESSING KAISER WINDOW. For a xed value of , the rectangular window has a fairly narrow main lobe relative to that in other windows, which is an advantage because it tends to introduce narrow transition bands at signal discontinuities. Its main disadvantage is that it has a high ripple ratio which causes a large in-band error (see Fig. 7.15e). Since the main-lobe width of the rectangular window is given by Bw = 2/ , it can be controlled by choosing parameter but as was found out, the ripple ratio of the rectangular window is practically independent of and cannot be controlled (see Fig. 7.10). The alternative is to use more sophisticated windows, such as the Kaiser and Dolph-Chebyshev windows [6, 8] which offer two degrees of freedom, namely, and some other parameter. An even more advanced window is the so-called ultraspherical window [9, 10] which offers three degrees of freedom, namely, and two other parameters. In these parametric windows the available degrees of freedom can be used to adjust the main-lobe width and/or the ripple ratio. An important feature of known windows is that the main-lobe width is always inversely proportional to the window length . The Kaiser window is a fairly exible and easy to compute window and it is, therefore, used widely. It is given by I0 ( ) w K (t ) = I0 ( ) 0 where is an independent parameter and = 1 for t otherwise (7.24) t 2 (7.25) Function I0 (x ) is the zeroth-order modied Bessel function of the rst kind.3 It can be computed to any degree of precision by using the rapidly converging series I0 ( x ) = 1 + k =1 1 k! x 2 k2 (7.26) The frequency spectrum of the Kaiser window is given by [6] 2 2 2 sin a W K ( j ) = 2 I0 ( ) 2 a (7.27) where a = / . The Kaiser window and its frequency spectrum are plotted in Fig. 7.16a and b for = 15.0 s. Using Eq. (7.27), the ripple ratio and main-lobe width of the Kaiser window can be plotted as functions of as depicted in Fig. 7.17a and b. The ripple ratio decreases rapidly as is increased but it is practically independent of the window length. On the other hand, the main-lobe width increases 3 Function besseli(0,x) in MATLAB. THE DISCRETE FOURIER TRANSFORM 347 1.5 wK (t) 1.0 0.5 0 15 10 5 0 (a) 5 10 t 15 30 20 WK( j) 10 0 10 2 1 0 (b) 1 2 Figure 7.16 Kaiser window ( = 3.0, = 15.0 s): (a ) Time domain, (b) frequency domain. with increasing values of but, as in other windows, it is inversely proportional to the window length. (a ) Solve the problem of Example 7.2 using the Kaiser window with = 3.0 and = 15.0 s and compare the results with those obtained with the rectangular window in Example 7.2. (b) Repeat for = 63.0 s. Example 7.3 Solution (a ) For this example, X w ( j ) = 1 2 X( j )W K ( j j )d where X ( j ) and W K ( j ) are given by Eqs. (7.21) and (7.27), respectively. Evaluating the above integral with = 3.0 and = 15.0 s using the formula in Eq. (7.23), as in Example 7.2, the frequency spectrum of xw (t ) shown in Fig. 7.18a can be obtained. The difference between the spectrums of x (t ) and xw (t ) is plotted in Fig. 7.18b. (b) The spectrum of xw (t ) for = 3.0 and = 63.0 s is obtained, as shown in Fig. 7.18c, as in part (a ). The difference between the spectrums of x (t ) and xw (t ) is plotted in Fig. 7.18d . 348 DIGITAL SIGNAL PROCESSING 10 20 30 40 50 60 70 80 Ripple Ratio, dB 0 1 2 3 4 5 (a) 6 7 8 9 10 2.5 2.0 Main-lobe width, Bm 1.5 1.0 =21 =31 0.5 =61 0 0 1 2 3 4 5 (b) 6 7 8 9 10 Figure 7.17 Characteristics of Kaiser window : (a ) Ripple ratio in dB versus for = 21 s, (b) main-lobe width versus for different window lengths. A comparison of Fig. 7.15e and 7.18a shows that the rectangular window offers narrower transition bands whereas the Kaiser window offers a reduced ripple amplitude. By increasing in the Kaiser window, which amounts to reducing the main-lobe width, the width of the transition bands can be reduced, as can be seen by comparing Fig. 7.18a and c, while maintaining a reduced ripple amplitude. THE DISCRETE FOURIER TRANSFORM 349 2 Xm ( j) 1 0 1 2.0 1.0 0.5 1.5 1.0 0.5 0 (a) 0.5 1.0 1.5 2.0 Error 0 0.5 1.0 2.0 2 1.5 1.0 0.5 0 (b) 0.5 1.0 1.5 2.0 Xm( j) 1 0 1 2.0 1.0 0.5 1.5 1.0 0.5 0 (c) 0.5 1.0 1.5 2.0 Error 0 0.5 1.0 2.0 1.5 1.0 0.5 0 (d ) 0.5 1.0 1.5 2.0 Figure 7.18 Use of Kaiser window (Example 7.3): (a ) Spectrum of modied signal for = 3.0 and = 15.0 s, (b) difference between the spectrums of the original and modied signals, (c) spectrum of modied signal for = 3.0 and = 63.0 s, (d ) difference between the spectrums of the original and modied signals. 350 DIGITAL SIGNAL PROCESSING 7.8.2 Discrete-Time Windows Given a continuous-time window, two corresponding discrete-time windows can be derived, namely, odd- and even-length windows. These are obtained by sampling the continuous-time window function at nT = 0, T , 2T , . . . , ( Nw 1)T /2 for an odd-length window or at nT = 1 T , 3 T , . . . , 2 2 ( Nw 1)T /2 for an even-length window. Typically an odd window length is preferred although even-length windows are sometimes required for certain specialized applications (see, for example, Sec. 18.4.1). A rectangular discrete-time window of odd length can be readily obtained by letting t = nT and = [( Nw 1)T ]/2 in Eq. (7.18), that is, w R (nT ) = Its z transform is given by ( Nw 1)/2 1 0 for [( Nw 1)T ]/2 nT [( Nw 1)T ]/2 otherwise W R (z ) = n =( Nw 1)/2 z n and since the above sum is a geometric series, a closed-form expression can be obtained as W R (z ) = = z ( Nw 1)/2 z ( Nw +1)/2 1 z 1 z Nw /2 z Nw /2 z 1/2 z 1/2 By evaluating the z transform on the unit circle, the frequency spectrum of the rectangular window can be obtained as W R (e j T ) = e j Nw T /2 e j Nw T /2 sin ( Nw T /2) = j T /2 e j T /2 e sin ( T /2) Similarly, a Kaiser discrete-time window of odd length can be derived from Eqs. (7.24) and (7.25) as I0 ( ) w K (nT ) = I0 ( ) 0 for ( Nw 1)T /2 nT ( Nw 1)T /2 otherwise (7.28) where is an independent parameter and 2n Nw 1 2 = 1 (7.29) THE DISCRETE FOURIER TRANSFORM 351 (see Prob. 7.13, part (a )). The z transform of w K (nT ) is given by ( Nw 1)/2 W K (z ) = n =( Nw 1)/2 w K (nT )z n and hence the frequency spectrum of the Kaiser window can be obtained as W K (e j T ) = ( Nw 1)/2 n =( Nw 1)/2 w K (nT )e j T An approximate but closed-form expression for the spectrum of the discrete-time Kaiser window can be deduced by noting that the spectral energy of the continuous-time Kaiser window is concentrated at low frequencies (see Fig. 7.16b) and, therefore, for a sufciently large sampling frequency s , we have W K ( j ) 0 for || s 2 (7.30) Consequently, the spectrum of impulse-modulated signal w K (t ) and, equivalently, the spectrum of w K (nT ) can be expressed as 1 W K ( j ) = W K (e j T ) W K ( j ) T for 0 || < s 2 (7.31) according to Eq. (6.45a). Hence Eqs. (7.27), (7.30), and (7.31) give W K (e j T ) where a = 2 ( Nw 1)T 2 Nw 1 sin (/a ) 1 I0 ( ) (/a )2 1 (7.32) (see Prob. 7.13, part (b)). The application of the window technique to discrete-time signals involves the same steps as in the continuous-time case although some subtle differences should be noted for its successful application. The modied discrete-time signal is obtained by multiplying the signal by a suitable discrete-time window, i.e., xw (nT ) = w (nT )x (nT ) The frequency spectrum of the modied signal xw (nT ) can be obtained by nding the z transform of xw (nT ) and then evaluating it on the unit circle. Since the z transform of a product of discrete-time functions can be obtained by using the complex-convolution theorem (Theorem 3.10), 352 DIGITAL SIGNAL PROCESSING we can write Z xw (nT ) = X w (z ) = 1 2 j 1 = 2 j X (v )W X z 1 v dv v (7.33a) (7.33b) z W (v )v 1 d v v where X (z ) is the z transform of x (nT ) and gence of X (v ) and W (z /v ). With v = ej T represents a contour in the common region of converand z = e j T and X (v ) as well as W (z /v ) convergent on the unit circle of the v plane, Eqs. (7.33a) and (7.33b) give the frequency spectrum of xw (t ) as X w (e j T ) = = T 2 T 2 2/ T 0 2/ T 0 X (e j T )W (e j ( )T )T )d )d (7.34a) (7.34b) X (e j ( )W (e j T These formulas are essentially convolution integrals of the type given by Eqs. (7.20a) and (7.20b) except that the integration is carried out over the nite frequency range 0 2/ T . Thus the effects of a discrete-time window on a discrete-time signal are entirely analogous to those encountered in the continuous-time case. The side lobes of the window function tend to introduce oscillations in the amplitude spectrum of the signal whose amplitude tends to decrease as the ripple ratio of the window is decreased. The main-lobe width tends to even out abrupt changes in the amplitude spectrum and, as a consequence, it tends to introduce transition bands at discontinuities. To minimize this effect, the main-lobe width should be as small as possible. As in the continuous-time case, the main-lobe width can be reduced by increasing the length of the window. 7.8.3 Periodic Discrete-Time Windows The application of the window technique to periodic discrete-time signals involves one more wrinkle. Since the values of a periodic signal x (nT ) are normally dened at 0, T , . . . , ( N 1)T and N is usually a power of 2, to facilitate the application of the FFT method N must be even. As may be recalled from Sec. 7.8.2, the values of a window of odd-length Nw occur at 0, T , . . . , ( Nw 1)/2 whereas those of an even-length window occur at T /2, 3T /2, . . . , ( Nw 1)/2. Consequently, a window of odd length is easier to apply. Therefore, the window length Nw should not exceed N 1. A periodic window w (nT ) with a period N T can be readily obtained from a nonperiodic win dow w (nT ) through periodic continuation whereby shifted copies of w(nT ), namely, w (nT + r N T ) for . . . , 2, 1, 0, 1, 2, . . . are added up according to Eq. (7.3). Now the DFT is normally computed with respect to the period 0 to ( N 1)T whereas nonperiodic windows of odd length Nw are dened with respect to the period [( Nw 1)T ]/2 to [( Nw 1)T ]/2. This discrepancy can be easily circumvented by constructing a right-sided discrete-time window before converting it into a periodic window through periodic continuation. For example, a right-side discrete-time Kaiser window can THE DISCRETE FOURIER TRANSFORM 353 be readily obtained as w K (nT ) = w K [nT ( Nw 1)T /2] and a corresponding periodic version can be constructed as (7.35a) w K (nT ) = r = w K (nT + r N T ) (7.35b) as illustrated in Fig. 7.19b. An alternative but equivalent possibility would be to apply periodic continuation to the two-sided window as for n = 0 w K (0) w (nT ) for 1 n ( Nw 1)/2 K w (nT ) = (7.35c) 0 for [( Nw 1)/2 + 1] n [ N ( Nw + 1)/2] for [ N ( Nw 1)/2] n ( N 1) w K [(n N )T ] This possibility is illustrated in Fig. 7.19c. (a) (Nw 1)/2 (Nw 1)/2 (b) Nw N 2N (c) (Nw 1)/2 N 2N Figure 7.19 Generation of a periodic window function: (a ) Nonperiodic window, (b) periodic window of Eq. (7.35b), (c) periodic window of Eq. (7.35c). 354 DIGITAL SIGNAL PROCESSING Example 7.4 (a ) Obtain a periodic Kaiser window of length 13 for a 16-point DFT using Eq. (7.35b). (b) Repeat part (a ) using Eq. (7.35c). Solution From Eqs. (7.35b) and (7.35c), the values shown in columns 2 and 3 of Table 7.1 can be obtained. The numerical values of the Kaiser window can be calculated using Eqs. (7.28) and (7.29) where I0 (x ) is given by Eq. (7.26). Table 7.1 Values of periodic Kaiser window of length 13 (Example 7.4) Eq. (7.35b) w K (6T ) w K (5T ) w K (4T ) w K (3T ) w K (2T ) w K (T ) w K (0) w K (T ) w K (2T ) w K (3T ) w K (4T ) w K (5T ) w K (6T ) 0 0 0 Eq. (7.35c) w K (0) w K (T ) w K (2T ) w K (3T ) w K (4T ) w K (5T ) w K (6T ) 0 0 0 w K (6T ) w K (5T ) w K (4T ) w K (3T ) w K (2T ) w K (T ) wK (nT ) w K (0) w K (T ) w K (2T ) w K (3T ) w K (4T ) w K (5T ) w K (6T ) w K (7T ) w K (8T ) w K (9T ) w K (10T ) w K (11T ) w K (12T ) w K (13T ) w K (14T ) w K (15T ) 7.8.4 Application of Window Technique The window technique can be applied to continuous- and discrete-time nonperiodic or periodic signals. If the signal to be processed is a nonperiodic continuous-time signal, then it must be subjected to three processes before it can be processed, namely, sampling, windowing, and periodic continuation. Depending on the order of these operations, three options are available to us, namely, to apply windowing to the continuous-time signal, to the discrete-time signal, or to the periodic discrete-time signal. The three possibilities are, of course, equivalent but the rst is the easiest to explain. A given continuous-time signal x (t ) of arbitrary length with a frequency spectrum X ( j ) can be forced to assume zero values outside the range 0 t < Nw T through windowing such that xw (t ) = 0 for t < 0 and t Nw T (7.36) as illustrated in Fig. 7.20c. By choosing a window with sufciently small main-lobe width and ripple ratio, the spectrum of the modied signal can be made to approach the spectrum of the original signal so that X w ( j ) X ( j ) as shown in Fig. 7.20c. |X( j)| x(t) F 1 (a) t F |W( j)| F F1 |Xw( j)| Z w(t) (b) t (Nw 1)T xw(t) (c) |Xw( jk)| t Z1 ~ xw(nT ) D (d ) D1 2N nT N k Figure 7.20 The use of window functions. 355 356 DIGITAL SIGNAL PROCESSING If the frequency spectrum of xw (t ), is bandlimited and a sufciently high sampling frequency s is used, we have Xw( j ) 0 in which case Eq. (7.12b) would assume the form for | | > s 2 (7.37) D r = xw (nT + r N T ) 1 T X w ( jk r = + jr s ) as illustrated in Fig. 7.20d . Unfortunately, the frequency spectrum of the signal is usually not known a priori and, therefore, the sampling frequency that would satisfy Eq. (7.37) is also not known. One way of estimating the correct sampling frequency would be to compute the DFT of xw (nT ) for progressively larger sampling frequencies (smaller sampling periods) until two successive DFT evaluations yield approximately the same DFT values. When that happens, the reduction in aliasing brought about by the last sampling frequency can be deemed to be negligible and the last but one sampling frequency can be taken to be the lowest acceptable sampling frequency for the application at hand. One possibility would be to start with some low sampling frequency, say s , and then carry out DFT evaluations for sampling frequencies 2s , 4s , . . . . Since the sampling frequency for each new DFT evaluation is twice the previous value, the number of points N must also be doubled to maintain a constant resolution for the DFT, i.e., = s / N . This technique is illustrated by the following example. Example 7.5 An innite-duration right-sided discrete-time signal x (nT ) is obtained by sampling the continuous-time signal x (t ) = u (t ) A0 e p0 t + 2 M1 e1 t cos(1 t + 1 ) where A0 = 4.532, M1 = 2.350, 1 = 2.873 rad, p0 = 2.322, 1 = 1.839, and 1 = 1.754 rad/s. A nite duration signal can be obtained by applying the discrete-time Kaiser window with = 1.0. Using the above technique, nd the lowest sampling frequency (largest sampling period) that would result in negligible aliasing. Solution A problem of this type can be solved by obtaining the DFT of the signal for several increasing sampling frequencies until two successive DFTs differ from one another by an error that is considered acceptable for the application at hand. The last DFT can be deemed to be free of aliasing and the sampling frequency used in the last evaluation can be taken to be the required one. THE DISCRETE FOURIER TRANSFORM 357 Table 7.2 N 16 32 64 128 Values of N, T, and s for Example 7.5 T, s 1.6 0.8 0.4 0.2 s , rad /s 3.9264 7.8528 15.7056 31.4112 In order to be able to compare successive DFTs of the same signal, it is important to keep the discrete-frequency parameter xed. From the denition of the DFT in Sec. 7.2, we have = 2 s = N NT and by selecting the values of N and T shown in Table 7.2, a constant value of equal to 0.2454 rad/s can be achieved. The corresponding values of s for N = 16, 32, 64, and 128 are given by the product N and are listed in column 3 of Table 7.2. A periodic Kaiser window function can be constructed as w (nT ) = r = w (nT + N T ) where w (nT ) = w K (nT ) for ( N 2)/2 n < ( N 2)/2 is a nonperiodic window function of odd length. Assuming a window length Nw = N 1, Eq. (7.35b) gives w K (nT ) 0 w (nT ) = w K [(n N )] for 0 n ( N 2)/2 for n = N /2 for ( N + 2)/2 n ( N 1) The values of w K (nT ) can be determined by using Eqs. (7.28) and (7.29) where I0 (x ) is given by Eq. (7.26). On obtaining the DFT of xw (nT ) for the four sets of parameters shown in Table 7.2, the results plotted in Fig. 7.21 can be obtained. As can be seen, the difference between the DFTs for the last and last-but-one cases is barely noticeable and we conclude, therefore, that the use of the sampling frequency 15.7056 rad/s would entail negligible aliasing. 358 DIGITAL SIGNAL PROCESSING 1.0 0.9 0.8 0.7 A() 0.6 0.5 0.4 0.3 0.2 T = 1.6 s T = 0.8 s T = 0.4 s T = 0.2 s 0 0.5 1.0 1.5 2.0 , rad/s 2.5 3.0 3.5 4.0 Figure 7.21 Amplitude spectrum of x (t ) for different sampling frequencies (Example 7.5). Discrete-time windows are also used in the design of FIR digital lters and a good collection of such functions, including the Dolph-Chebyshev window, can be found in Sec. 9.4. 7.9 SIMPLIFIED NOTATION The preceding somewhat complicated notation for the DFT was adopted in order to eliminate possible confusion between the various transforms. As we shall be dealing exclusively with the DFT for the rest of this chapter, we can write N 1 X (k ) = n =0 x (n )W kn x (n ) = 1 N N 1 X (k )W kn k =0 where x (n ) x (nT ) X (k ) X ( jk ) i.e., x (n ) and X (k ) are implicitly assumed to be periodic. Furthermore, signals and their frequency spectrums are deemed to be normalized with respect to time and frequency whereby the discrete time and frequency variables T and are assumed to be 1 s and 2/ N rad/s, respectively (see Sec. 1.4). 7.10 PERIODIC CONVOLUTIONS The convolutions of the CFT and the z transform nd numerous applications in signal processing. Analogous and equally useful convolutions exist for the DFT. These are usually referred to as periodic or cyclic convolutions. THE DISCRETE FOURIER TRANSFORM 359 7.10.1 Time-Domain Periodic Convolution The time-domain convolution of two periodic signals x (n ) and h (n ), each with period N , is dened as N 1 y (n ) = m =0 N 1 x (m )h (n m ) x (n m )h (m ) m =0 (7.38a) = (7.38b) Like x (n ) or h (n ), y (n ) is a periodic function of n with period N . The periodic time-domain convolution can be illustrated by a graphical construction which is very similar to that used for the convolution summation described in Sec. 4.6.1; the main difference being the periodicity of the signals involved in the present convolution. The time-domain convolution is illustrated by the following example. Example 7.6 Each of the signals x (n ) = en for 0 n 9 and 1 h (n ) = 0 0 for 3 n 6 for 0 n 2 for 7 n 9 is periodic with period N = 10. Find the periodic convolution of the two signals at n = 5. Solution A graphical construction for the time-domain convolution can be obtained as follows: 1. Replace variable n by m in both h (n ) and x (n ) to obtain x (m ) and h (m ). 2. Turn signal x (m ) over end-to-end to obtain x (m ). 3. Shift x (m ) to the right by 5 s as shown in Fig. 7.22a which can be drawn as shown in Fig. 7.22b. 4. Noting the periodicity of x (m ), construct the equivalent graph shown in Fig. 7.22c. 5. Form all the possible products h (m )x (5 m ) in Fig. 7.22c. 6. Add all the nonzero products in Fig. 7.22c to obtain the time-convolution. From Fig. 7.22c, we have y (5) = 1 + e + e2 + e9 360 DIGITAL SIGNAL PROCESSING h(m) 1 m x(5m) 5 9 0 5 (a) h(m) 1 N1 m 5 m x(0) x(9) 0 (b) h(m) 1 5 x(9) N1 x(5m) x(0) 0 (c) Figure 7.22 Time-domain, periodic convolution (Example 7.6). Alternatively, from the time-domain convolution of Eq. (7.38b), we have y (k ) = x (k )h (0) + x (k 1)h (1) + + x (k )h (0) + x (k + 1)h (1) + + x (k N + 1)h ( N 1) THE DISCRETE FOURIER TRANSFORM 361 Hence y (5) = x (5)h (0) + x (4)h (1) + x (3)h (2) + x (2)h (3) + x (1)h (4) +h (5)x (0) + h (6)x (1) + h (7)x (2) + h (8)x (3) +h (9)x (4) = x (5)h (0) + x (4)h (1) + x (3)h (2) + x (2)h (3) + x (1)h (4) +x (0)h (5) + x (9)h (6) + x (8)h (7) + x (7)h (8) + x (6)h (9) = x (2)h (3) + x (1)h (4) + x (0)h (5) + x (9)h (6) = x (0) + x (1) + x (2) + x (9) = 1 + e + e2 + e9 Theorem 7.2 A Time-Domain Periodic Convolution If h(n) and x (n) are two periodic discrete-time functions, each with period N, with DFTs H (k) and X (k), respectively, then the DFT of the time-domain convolution of h(n) and x (n) is given by Y (k) = H (k) X (k) Proof The DFT of y (n ) can be obtained from the denition in Sec. 7.2 as N 1 N 1 m =0 Y (k ) = n =0 N 1 h (m )x (n m ) W kn N 1 n =0 = m =0 N 1 h (m )W km h (n )W kn x (n m )W k (n m ) N 1 n =0 = n =0 x (n )W kn and, therefore, Y (k ) = H (k ) X (k ) (7.39) 7.10.2 Frequency-Domain Periodic Convolution N 1 The frequency-domain convolution of two DFTs H (k ) and X (k ) is dened as Y (k ) = = 1 N 1 N X (m ) H (k m ) m =0 N 1 (7.40a) X (k m ) H (m ) m =0 (7.40b) 362 DIGITAL SIGNAL PROCESSING Theorem 7.2 B Frequency-Domain Periodic Convolution domain periodic convolution of H (k) and X (k) is given by y (n) = h(n)x (n) The proof is left as an exercise (see Prob. 7.23). The IDFT of the frequency- (7.41) 7.11 FAST FOURIER-TRANSFORM ALGORITHMS The direct evaluation of the DFT involves N complex multiplications and N 1 complex additions for each value of X (k ), and since there are N values to determine, N 2 multiplications and N ( N 1) additions are necessary. Consequently, for large values of N , say in excess of 1000, direct evaluation involves a considerable amount of computation. It turns out that the direct evaluation of the DFT on the basis of its denition entails a large amount of redundancy and through some clever strategies, a huge reduction in the amount of computation can be achieved. These strategies have come to be known collectively as fast Fourier transforms (FFTs) although, to be precise, these methods have nothing to do with transforms in the true sense of the word. We describe here two FFTs, the so-called decimation-in-time and decimation-in-frequency algorithms. 7.11.1 Decimation-in-Time Algorithm N 1 Let the desired DFT be X (k ) = n =0 x (n )W N kn where W N = e j 2/ N and assume that N = 2r where r is an integer. The above summation can be split into two parts as N 1 X (k ) = n =0 n even x (n )W N kn + N 1 n =0 n odd x (n )W N kn Alternatively N /21 X (k ) = n =0 x10 (n )W N 2kn + W N k N /21 n =0 x11 (n )W N 2kn (7.42) where x10 (n ) = x (2n ) x11 (n ) = x (2n + 1) (7.43a) (7.43b) THE DISCRETE FOURIER TRANSFORM 363 for 0 n N /2 1. Since kn W N 2kn = e j 4kn / N = e j 2kn /( N /2) = W N /2 Eq. (7.42) can be expressed as N /21 X (k ) = n =0 kn x10 (n )W N /2 + W N k N /21 n =0 kn x11 (n )W N /2 Clearly X (k ) = X 10 (k ) + W N k X 11 (k ) (7.44) and since X 10 (k ) and X 11 (k ) are periodic, each with period N /2, we have X k+ N 2 = X 10 k + N 2 + WN (k + N /2) X 11 k + N 2 (7.45) = X 10 (k ) W N k X 11 (k ) Equations (7.44) and (7.45) can be represented by the signal ow graph of Fig. 7.23a , where the minus sign in W N k is pertinent in the computation of X (k + N /2). Since the graph looks very much like a buttery, it has come to be known as a buttery and it is often represented by the simplied diagram of Fig. 7.23b for convenience. X10(k) 1 1 X(k) + W k 1 X k+ N 2 X11(k) (a) X10(k) ( ) X(k) k X11(k) (b) X k+ N 2 ( ) Figure 7.23 (a ) Buttery ow graph, (b) simplied diagram. 364 DIGITAL SIGNAL PROCESSING What we have accomplished so far is to express the desired N -element DFT as a function of two ( N /2)-element DFTs. Assuming that the values of X 10 (k ) and X 11 (k ) are available in corresponding arrays, the values of X (k ) can be readily computed as depicted in Fig. 7.24a . X 10 (k ) and X 11 (k ) can now be expressed in terms of ( N /4)-element DFTs by repeating the above cycle of activities. For X 10 (k ), we can write N /21 X 10 (k ) = n =0 N /41 kn x10 (n )W N /2 N /41 = n =0 N /41 2kn x10 (2n )W N /2 + n =0 k (2 x10 (2n + 1)W N /2 n +1) = n =0 kn x20 (n )W N /4 + W N 2k N /41 n =0 kn x21 (n )W N /4 (7.46a) and, similarly, for X 11 (k ) N /21 X 11 (k ) = n =0 N /41 kn x11 (n )W N /2 N /41 n =0 = n =0 kn x22 (n )W N /4 + W N 2k kn x23 (n )W N /4 (7.46b) where x20 (n ) = x10 (2n ) x21 (n ) = x10 (2n + 1) x22 (n ) = x11 (2n ) x23 (n ) = x11 (2n + 1) for 0 n N /4 1. Consequently, from Eqs. (7.46a) and (7.46b), we have X 10 (k ) = X 20 (k ) + W N 2k X 21 (k ) (7.47a) (7.47b) (7.47c) (7.47d) X 10 k + N 4 = X 20 (k ) W N 2k X 21 (k ) X 11 (k ) = X 22 (k ) + W N 2k X 23 (k ) X 11 k + N 4 = X 22 (k ) W N 2k X 23 (k ) THE DISCRETE FOURIER TRANSFORM 365 X2i(k) 0 X10(k) 0 X(k) 0 X20(k) k k k N 4 1 0 2k X21(k) k k+ N 4 N 4 1 N 2 1 N 1 2 N 2 0 0 k X22(k) k k k+ N 2 N 4 1 0 2k X23(k) k k+ N 4 N 1 4 N 1 2 N1 X11(k) (a) Figure 7.24 Decimation-in-time FFT algorithm: (a ) First and second cycles. 366 DIGITAL SIGNAL PROCESSING Thus if the values of X 20 (k ), X 21 (k ), X 22 (k ), and X 23 (k ) are available, those of X 10 (k ) and X 11 (k ) and in turn those of X (k ) can be computed, as illustrated in Fig. 7.24a . In exactly the same way, the mth cycle of the above procedure would yield X (m 1)0 (k ) = X m 0 (k ) + W N 2 m 1 k X m 1 (k ) m 1 X (m 1)0 k + N 2m = X m 0 (k ) W N 2 m 1 k X m 1 (k ) X (m 1)1 (k ) = X m 2 (k ) + W N 2 k X m 3 (k ) N m 1 = X m 2 (k ) W N 2 k X m 3 (k ) 2m X (m 1)1 k + where xm 0 (n ) = x(m 1)0 (2n ) xm 1 (n ) = x(m 1)0 (2n + 1) xm 2 (n ) = x(m 1)1 (2n ) xm 3 (n ) = x(m 1)1 (2n + 1) ........................ for 0 n N /2m 1. Clearly, the procedure would terminate with the r th cycle ( N = 2r ) since xr 0 (n ), xr 1 (n ), . . . reduce the one-element sequences, in which case X ri (0) = xri (0) for i = 0, 1, . . . , N 1 (7.48a) (7.48b) (7.48c) (7.48d) The values of the penultimate DFTs can be obtained from the above equations as 0 X (r 1)0 (0) = xr 0 (0) + W N xr 1 (0) 0 X (r 1)0 (1) = xr 0 (0) W N xr 1 (0) 0 X (r 1)1 (0) = xr 2 (0) + W N xr 3 (0) 0 X (r 1)1 (1) = xr 2 (0) W N xr 3 (0) Assuming that the sequence {xr 0 (0), xr 1 (0), . . . } is available in an array, the values of X (r 1)i (k ) for i = 0, 1, . . . can be computed as in Fig. 7.24b. Then the values of X (r 2)i (k ), X (r 3)i (k ), . . . can be computed in sequence, and ultimately the values of X (k ) can be obtained. THE DISCRETE FOURIER TRANSFORM 367 Xri(0) x(0) xr 0(0) X(r1)i(k) 0 X(r1)0 x(1) xr1(0) 0 1 xr2(0) 0 X(r1)1 xr3(0) 0 1 xr4(0) 0 0 X(r1)2 xr 5(0) 1 xr 6(0) 0 X(r1)3 0 x(7) xr7(0) 1 (b) Figure 7.24 Contd Decimation-in-time FFT algorithm: (b) r th cycle. The only remaining task at this point is to identify elements xr 0 (0), xr 1 (0), . . . . Fortunately, this turns out to be easy. It can be shown that xr p (0) is given by xr p (0) = x ( p ) (7.49) where p is the r -bit binary representation of p reversed in decimal form. For example, if N = 16, r = 4 and hence we have x40 (0) = x (0) 0000 0000 x41 (0) = x (1) 0001 1000 x42 (0) = x (2) 0010 0100 . . . . . . . . . x4(15) (0) = x (15) 1111 1111 x (0) x (8) x (4) . . . x (15) 368 DIGITAL SIGNAL PROCESSING In effect, sequence {xr 0 (0), xr 1 (0), . . . } is a reordered version of sequence {x (0), x (1), . . . }, namely, {x (0), x (1), . . . } or {x (0), x (8), . . . }. Entering the time sequence, properly reordered in the lefthand array in Fig. 7.24b and performing the computations involved in the signal ow graphs of Fig. 7.24b and a will produce the DFT of the given time sequence in the right-hand array of Fig. 7.24a properly ordered as illustrated. In the above discussion, N has been assumed to be a power of 2. Nevertheless, the algorithm can be applied to any other nite-duration time sequence by including a number of trailing zero elements in the given sequence. This would amount to zero padding and, as may be recalled from Sec. 7.5, including trailing zeros improves the resolution of the frequency spectrum of the discretetime signal. Example 7.7 Construct the decimation-in-time algorithm for N = 8. Solution From Eqs. (7.43a) and (7.43b), we have x10 (n ) = x (2n ) for n = 0, 1, 2, 3. Hence x10 (n ) = {x (0), x (2), x (4), x (6)} x11 (n ) = {x (1), x (3), x (5), x (7)} Now from Eqs. (7.47a)(7.47d), we obtain x20 (n ) = x10 (2n ) x22 (n ) = x11 (2n ) x21 (n ) = x10 (2n + 1) x23 (n ) = x11 (2n + 1) (7.50a) (7.50b) x11 (n ) = x (2n + 1) for n = 0, 1. Thus Eqs. (7.50a) and (7.50b), give x20 (n ) = {x (0), x (4)} x22 (n ) = {x (1), x (5)} x21 (n ) = {x (2), x (6)} x23 (n ) = {x (3), x (7)} (7.51a) (7.51b) Finally, from Eqs. (7.48a)(7.48d), the elements of the third cycle can be generated by replacing k in the second cycle rst by 2k and then by 2k + 1, x30 (n ) = x20 (2n ) x32 (n ) = x21 (2n ) x34 (n ) = x22 (2n ) x36 (n ) = x23 (2n ) x31 (n ) = x20 (2n + 1) x33 (n ) = x21 (2n + 1) x35 (n ) = x22 (2n + 1) x37 (n ) = x23 (2n + 1)] THE DISCRETE FOURIER TRANSFORM 369 X3i(k) x(0) x(4) 0 x(2) x(6) 0 x(1) x(5) x(3) x(7) X2 i(k) 0 1 0 0 1 2 0 1 0 0 0 0 1 X1i(k) 0 1 2 3 0 1 2 2 3 2 3 X(k) 0 1 2 3 4 5 6 7 0 1 Figure 7.25 Decimation-in-time FFT algorithm for N = 8 (Example 7.7). for k = 0. Hence from Eqs. (7.51a) and (7.51b), we obtain x30 (0) = x (0) = X (0) x32 (0) = x (2) = X (2) x34 (0) = x (1) = X (1) x36 (0) = x (3) = X (3) x31 (0) = x (4) = X (4) x33 (0) = x (6) = X (6) x35 (0) = x (5) = X (5) x37 (0) = x (7) = X (7) The complete algorithm is illustrated in Fig. 7.25. The algorithm can be easily programmed as computations can be carried out in place in a single array. As can be observed in Fig. 7.25, once the outputs of each input buttery are computed, the input elements are no longer needed for further processing and can be replaced by the corresponding outputs. When we proceed in the same way from left to right, at the end of computation the input array will contain the elements of the desired DFT properly ordered. The input elements can be entered in the appropriate array locations by using a simple reordering subroutine. In general, each cycle of the algorithm involves N /2 butteries, as can be seen in Fig. 7.25, and each buttery requires one (complex) multiplication. Since there are r cycles of computation and r = log2 N , the total number of multiplications is ( N /2) log2 N as opposed to N 2 in the case of direct evaluation. This constitutes a huge saving in computation. For example, if N 512, then the number of multiplications is reduced to a fraction of 1 percent of that required by direct evaluation. 370 DIGITAL SIGNAL PROCESSING 7.11.2 Decimation-in-Frequency Algorithm In the decimation-in-time algorithm, the given time sequence is split in two by separating the evenand odd-index elements. The same procedure is then applied repeatedly on each new sequence until one-element sequences are obtained. The decimation-in-frequency algorithm can be developed by splitting the given sequence about its midpoint and then repeating the same for each resulting sequence until one-element sequences are obtained. We can write N /21 X (k ) = n =0 N /21 x (n )W N kn + N 1 n = N /2 x (n )W N kn = n =0 x (n ) + W N k N /2 x n+ N 2 W N kn and on replacing k rst by 2k and then by 2k + 1, we obtain N /21 X (2k ) = n =0 N /21 kn x10 (n )W N /2 = X 10 (k ) (7.52a) X (2k + 1) = n =0 kn x11 (n )W N /2 = X 11 (k ) (7.52b) where x10 (n ) = x (n ) + x n + N 2 N 2 WN n (7.53a) (7.53b) x11 (n ) = x (n ) x n + for 0 n N /2 1. Thus the even- and odd-index values of X (k ) are given by the DFTs of x10 (n ) and x11 (n ), respectively. Assuming that the values of x (n ) are stored sequentially in an array, the values of x10 (n ) and x11 (n ) can be computed as illustrated in Fig. 7.26a , where the left-hand buttery represents Eqs. (7.53a) and (7.53b). The same cycle of activities can now be applied to x10 (n ) and x11 (n ). For x10 (n ), we can write N /41 X (2k ) = n =0 x10 (n ) + W N k N /2 x10 n + N 4 kn W N /2 and, similarly, for x11 (n ) N /41 k N /2 X (2k + 1) = n =0 x11 (n ) + W N x11 n + N 4 kn W N /2 THE DISCRETE FOURIER TRANSFORM 371 x(n) 0 x10(n) 0 x2i(n) 0 n n n x20(n) N 1 4 0 2n n+ N 4 n x21(n) N 1 2 N 2 N 1 2 N 4 1 n 0 0 n+ N 2 n n x22(n) N 1 4 0 2n n+ N 4 n x23(n) N1 N 1 2 N 1 4 x11(n) (a) Figure 7.26 Decimation-in-frequency FFT algorithm: (a ) First and second cycles. 372 DIGITAL SIGNAL PROCESSING Hence with k replaced rst by 2k and then by 2k + 1, we have N /41 X (4k ) = n =0 N /41 kn x20 (n )W N /4 = X 20 (k ) (7.54a) X (4k + 2) = n =0 N /41 kn x21 (n )W N /4 = X 21 (k ) (7.54b) X (4k + 1) = n =0 N /41 kn x22 (n )W N /4 = X 22 (k ) (7.54c) X (4k + 3) = n =0 kn x23 (n )W N /4 = X 23 (k ) (7.54d) where x20 (n ) = x10 (n ) + x10 n + N 4 N 4 W 2n (7.55a) (7.55b) (7.55c) W 2n (7.55d) x21 (n ) = x10 (n ) x10 n + x22 (n ) = x11 (n ) + x11 n + N 4 N 4 x23 (n ) = x11 (n ) x11 n + for 0 n ( N /4 1). The values of x20 (n ), x21 (n ), . . . can be computed as in Fig. 7.26a . The DFT of each of these sequences gives one-quarter of the values of X (k ). Similarly, the mth cycle of the above procedures would yield N 1 1 X (2m k ) = n =0 xm 0 (n )W N1kn = X m 0 (k ) (7.56a) X (2m k + 2m 1 ) = N 1 1 n =0 xm 1 (n )W N1kn = X m 1 (k ) (7.56b) where N1 = N /2 and m xm 0 (n ) = x(m 1)0 (n ) + x(m 1)0 n + N 2m N m 1 WN 2 n 2m m for 0 n N /2 1. xm 1 (n ) = x(m 1)0 (n ) x(m 1)0 n + THE DISCRETE FOURIER TRANSFORM 373 As for the decimation-in-time algorithm, the procedure terminates with the r th cycle at which point xr 0 (n ), xr 1 (n ), . . . reduce the one-element sequences each giving one value of the desired DFT except that the elements of the DFT are not properly ordered. What we get instead is the sequence X (0) = xr 0 (0) X (1) = xr 1 (0) . . . X ( p ) = xr p (0) . . . X ( N 1) = xr ( N 1) (0) (7.57a) (7.57b) (7.57c) (7.57d) where p is the r -bit binary representation of p reversed in decimal form as in the decimation-in-time algorithm. The last two cycles of the algorithm are illustrated in Fig. 7.26b. Note that the elements of the DFT can be put in the right order by simply reversing the r -bit binary representation of the location index at the end of the computation, as is done for the input sequence in the case of the decimation-in-time algorithm. The advantage of this algorithm is that the values of x (n ) are entered in the input array sequentially. x(r1)i(n) 0 1 0 0 xri(n) xr0(0) xr1(0) X(0) X(1) xr2(0) xr3(0) 1 0 0 xr4(0) 1 0 xr5(0) 0 xr6(0) 1 0 xr7(0) X(7) (b) Figure 7.26 Contd Decimation-in-frequency FFT algorithm: (b) r th cycle. 374 DIGITAL SIGNAL PROCESSING Example 7.8 Construct the decimation-in-frequency algorithm for N = 8. Solution From Eqs. (7.52a) and (7.52b), we have X 10 (k ) = X (2k ) for k = 0, 1, 2, 3. Hence X 10 (k ) = { X (0), X (2), X (4), X (6)} X 11 (k ) = { X (1), X (3), X (5), X (7)} From Eqs. (7.54a)(7.54d), we have X 20 (k ) = X (4k ) X 22 (k ) = X (4k + 1) X 21 (k ) = X (4k + 2) X 23 (k ) = X (4k + 3) (7.58a) (7.58b) and X 11 (k ) = X (2k + 1) for k = 0, 1. Thus Eqs. (7.58a) and (7.58b), give X 20 (k ) = { X (0), X (4)} X 22 (k ) = { X (1), X (5)} X 21 (k ) = { X (2), X (6)} X 23 (k ) = { X (3), X (7)} (7.59a) (7.59b) Finally, from Eqs. (7.56a) and (7.56b) or Eqs. (7.57a)(7.57c), the elements of the 3rd cycle can be generated by replacing k in the 2nd cycle rst by 2k and then by 2k + 1, that is, X 30 (k ) = X [4(2k )] X 32 (k ) = X [4(2k ) + 2)] X 34 (k ) = X [4(2k ) + 1] X 36 (k ) = X [4(2k ) + 3] X 31 (k ) = X [4(2k + 1)] X 33 (k ) = X [4(2k + 1) + 2] X 35 (k ) = X [4(2k + 1) + 1] X 37 (k ) = X [4(2k + 1) + 3] for k = 0. Hence from Eqs. (7.59a) and (7.59b), we obtain X 30 (0) = X (0) = x (0) X 32 (0) = X (2) = x (2) X 34 (0) = X (1) = x (1) X 36 (0) = X (3) = x (3) X 31 (0) = X (4) = x (4) X 33 (0) = X (6) = x (6) X 35 (0) = X (5) = x (5) X 37 (0) = X (7) = x (7) The complete algorithm is illustrated in Fig. 7.27. THE DISCRETE FOURIER TRANSFORM 375 X(k) 0 1 2 3 4 0 5 1 6 2 7 3 X1i(k) 0 1 2 0 3 0 1 2 0 3 2 X2i(k) 0 1 0 1 2 0 1 0 0 1 X3i (k) x (0) x (4) x (2) x (6) x (1) x (5) x (3) x (7) 0 X(0) X(4) X(2) X(6) X(1) X(5) X(3) X(7) 0 0 Figure 7.27 Decimation-in-frequency FFT algorithm for N = 8 (Example 7.8). 7.11.3 Inverse DFT Owing to the similarity between Eqs. (7.1) and (7.2), the preceding two algorithms can be readily employed for the computation of the IDFT. Equation (7.2) can be put in the form x (n ) = or x (n ) = D Therefore, x (n ) = D 1 X (k ) N 1 N N 1 X (k )W k =0 kn = 1 N N 1 k =0 X (k )W kn 1 X (k ) N Thus if a computer program is available that can be used to compute the DFT of a complex signal x (n ), then exactly the same program can be used to compute the inverse DFT, i.e., x (n ), by entering the complex conjugate of X (k )/ N as input and then taking the complex conjugate of the output. 376 DIGITAL SIGNAL PROCESSING 7.12 APPLICATION OF THE FFT APPROACH TO SIGNAL PROCESSING The processing of discrete-time signals can be carried out through the use of a digital lters in the form of software or hardware. Alternatively, one can simulate the action of a digital lter through the use of the convolution summation. The response of an FIR lter to an excitation x (n ) is given by y (n ) = m = x (n m )h (m ) and if h (n ) = 0 x (n ) = 0 then we have N 1 for n < 0 for n < 0 and and n > N 1 n > L 1 y (n ) = m =0 x (n m )h (m ) for 0 n N + L 2 (7.60) A software implementation for the lter can be readily obtained by programming Eq. (7.60) directly. However, this approach can involve a large amount of computation since N multiplications are necessary for each sample of the response. The alternative is to use the FFT method [12]. Let us dene ( L + N 1)-element DFTs for h (n ), x (n ), and y (n ), as in Sec. 7.2, which we can designate as H (k ), X (k ), and Y (k ), respectively. From Eqs. (7.39) and (7.60), we have Y (k ) = H (k ) X (k ) and hence y (n ) = D1 [ H (k ) X (k )] Therefore, an arbitrary nite-duration signal can be processed through the following procedure: 1. Compute the DFTs of h (n ) and x (n ) using an FFT algorithm. 2. Compute the product H (k ) X (k ) for k = 0, 1, . . . . 3. Compute the IDFT of Y (k ) using an FFT algorithm. The evaluation of H (k ), X (k ), or y (n ) requires [( L + N 1)/2] log2 ( L + N 1) complex multiplications, and step 2 above entails L + N 1 of the same. Since one complex multiplication corresponds to four real ones, the total number of real multiplications per output sample is 6 log2 ( L + N 1) + 4, THE DISCRETE FOURIER TRANSFORM 377 as opposed to N in the case of direct evaluation using Eq. (7.60). Clearly, for large values of N , the FFT approach is much more efcient. For example, if N = L = 512, the number of multiplications would be reduced to 12.5 percent of that required by direct evaluation. The above convolution method of implementing digital lters can also be applied to IIR digital lters but only if the frequency response of the lter is bandlimited. In such a case, an impulse response of nite duration can be obtained through the use of a suitable window function. In the convolution method for the implementation of digital lters, the entire input sequence must be available before the processing can start. Consequently, if the input sequence is long, a long delay known as latency will be introduced, which is usually objectionable in real-time or even quasi-real-time applications. For such applications, the input sequence is usually broken down into small blocks or segments that can be processed individually. In this way, the processing can begin as soon as the rst segment is received and the processed signal begins to become available soon after. Simultaneously, new segments of the input continue to be received while the processing continues. Two segmentation techniques have evolved for the processing of signals, as follows: 1. Overlap-and-add method 2. Overlap-and-save method These are two somewhat different schemes of dealing with the fact that the periodic convolution produces a longer sequence than the length of either the signal x (n ) or the impulse response h (n ) of the lter being simulated. 7.12.1 Overlap-and-Add Method In the overlap-and-add method, successive convolution summations produce consecutive processed segments of the signal that are overlapped to give the overall processed signal as will be shown below. The input signal can be expressed as a sum of signal segments xi (n ) for i = 1, 2, . . . , q , each comprising L samples, such that q x (n ) = i =0 xi (n ) for 0 n q L 1, where xi (n ) = x (n ) 0 for i L n (i + 1) L 1 otherwise (7.61) as illustrated in Fig. 7.28. With this manipulation, Eq. (7.60) assumes the form N 1 q y (n ) = m =0 i =0 xi (n m )h (m ) 378 DIGITAL SIGNAL PROCESSING x(n) 0 L 2L 3L n = x0(n) 0 L1 n + x1(n) 0 L 2L1 n + x2(n) 0 2L 3L1 n Figure 7.28 Segmentation of input sequence. and on interchanging the order of summation, we get q y (n ) = i =0 ci (7.62) where N 1 ci (n ) = m =0 xi (n m )h (m ) (7.63) In this way, y (n ) can be computed by evaluating a number of partial convolutions. THE DISCRETE FOURIER TRANSFORM 379 For i L 1 n (i + 1) L + N 1, Eqs. (7.63) and (7.61) give ci (i L 1) = 0 ci (i L ) = x (i L )h (0) ci (i L + 1) = x (i L + 1)h (0) + x (i L )h (1) ......... ............................ ci [(i + 1) L + N 2] = x [(i + 1) L 1]h ( N 1) ci [(i + 1) L + N 1] = 0 Evidently, the i th partial-convolution sequence has L + N 1 nonzero elements which can be stored in an array Ci , as demonstrated in Fig. 7.29. From Eq. (7.63), the elements of Ci can be computed as ci (n ) = D1 [ H (k ) X i (k )] Now from Eq. (7.62), an array Y containing the values of y (n ) can be readily formed, as illustrated in Fig. 7.29, by entering the elements of nonoverlapping segments in C0 , C1 , . . . and then adding C0 0 + C1 L L+N2 L + C2 2L 2L+N2 2L 3L 3L 3L+N2 = 0 L 2L Y Overlap Figure 7.29 Overlap-and-add implementation. 380 DIGITAL SIGNAL PROCESSING the elements in overlapping adjacent segments. As can be seen, processing can start as soon as L input samples are received, and the rst batch of L output samples is available as soon as the rst input segment is processed. Evidently, a certain amount of latency is still present but through the overlap-and-add method, this is reduced from (q L 1)T to ( L 1)T s where T is the sampling period. 7.12.2 Overlap-and-Save Method If x (n ) = 0 for n < 0 as before, then the rst L elements of convolution summation c0 (n ), namely, elements 0 to L 1, are equal to the corresponding L elements of y (n ). However, this does not apply to the last N 1 elements of c0 (n ), i.e., elements L to L + N 2, owing to the overlap between convolutions c0 (n ) and c1 (n ) as can be seen in Fig. 7.29. This problem can be avoided through the following scheme. If we dene x1 (n ) such that x1 (n ) = x (n ) 0 for L ( N 1) n 2 L ( N 1) 1 otherwise as illustrated in Fig. 7.30, then the convolution of x1 (n ) with h (n ) would assume the form N 1 c1 (n ) = m =0 x1 (n m )h (m ) for L ( N 1) n 2 L 1 Straightforward evaluation of c1 (n ) for n = L , L + N 2, and 2 L ( N 1) 1 gives c1 ( L ) = x1 ( L )h (0) + x1 ( L 1)h (1) + + x1 ( L N + 1)h ( N 1) = c0 ( L ) + c1 ( L ) = y ( L ) c1 ( L + N 2) = x1 ( L + N 2)h (0) + x1 ( L + N 3)h (1) + +x1 ( L 1)h ( N 1) = c0 ( L + N 2) + c1 ( L + N 2) = y ( L + N 2) c1 [2 L ( N 1) 1] = x1 (2 L N )h (0) + x1 (2 L N 1)h (1) + +x1 (2 L 2 N + 1)h ( N 1) = c1 [2 L ( N 1) 1] = y [2 L ( N 1) 1] where ci (n ) for i = 0, 1 are given by Eq. (7.63) and L is assumed to be greater than 2( N 1) for the sake of convenience. Evidently, N 1 c1 (n ) = m =0 x (n m )h (m ) = y (n ) for L n 2 L ( N 1) 1 that is, c1 (n ) gives elements L to 2 L ( N 1) 1 of the required output, which can be stored in the unshaded part of array C1 in Fig. 7.31. THE DISCRETE FOURIER TRANSFORM 381 x(n) 0 L x0(n) 2L 3L n 0 L1 x1(n) n 0 L(N1) x2(n) 2L(N1)1 n 0 2L2(N1) 3L2(N1)1 n Figure 7.30 Alternative segmentation of input sequence. Similarly, by letting xi (n ) = x (n ) 0 for i L (i 1)( N 1) n (i + 1) L i ( N 1) 1 otherwise one can easily show that for i L (i 1)( N 1) n (i + 1) L i ( N 1) 1 ci (n ) = y (n ) (7.64) for i = 2, 3, . . . (see Prob. 7.34). In effect, the processed signal can be evaluated by computing the rst L elements of c0 (n ) and elements i L (i 1)( N 1) to (i + 1) L i ( N 1) 1 of the partial convolutions ci (n ) for i = 1, 2, . . . , and then concatenating the sequences obtained as shown in Fig. 7.31. In the scheme just described, the input sequences rather than the output sequences are overlapped, as can be seen in Fig. 7.30, and the last N 1 elements of each input sequence are saved 382 DIGITAL SIGNAL PROCESSING C0 0 L L + N2 C1 L(N1) L 2L(N1)1 2L1 C2 3L(N1)1 3L2(N1)1 L1 C2 C3 2L2(N1) 2L(N1) 0 C0 Y C1 N1 Figure 7.31 Overlap-and-save implementation. to be re-used for the computation of the next partial convolution. For these reasons, the scheme is known as the overlap-and-save method. REFERENCES [1] [2] J. W. Cooley and J. W. Tukey, An algorithm for the machine calculation of complex Fourier series, Math Comp., vol. 19, pp. 297301, Apr. 1965. W. T. Cochran, J. W. Cooley, D. L. Favin, H. D. Helms, R. A. Kaenel, W. W. Lang, G. C. Maling, D. E. Nelson, C. M. Rader, and P. D. Welch, What is the fast Fourier transform? IEEE Trans. Audio Electroacoust., vol. 15, pp. 4555, June 1967. G. D. Bergland, A guided tour of the fast Fourier transform, IEEE Spectrum, vol. 6, pp. 4152, July 1969. J. W. Cooley, P. A. W. Lewis, and P. D. Welch, Historical notes on the fast Fourier transform, IEEE Trans. Audio Electroacoust., vol. 15, pp. 7679, June 1967. J. W. Cooley, P. A. W. Lewis, and P. D. Welch, Application of the Fast Fourier transform to computation of Fourier integrals, Fourier series and convolution integrals, IEEE Trans. Audio Electroacoust., vol. 15, pp. 7984, June 1967. J. F. Kaiser, Nonrecursive digital lter design using the I0 -sinh window function, IEEE Int. Symp. Circuit Theory, pp. 2023, 1974. H. Babic and G. C. Temes, Optimum low-order windows for discrete Fourier transform systems, IEEE Trans. Acoust., Speech, Signal Process., vol. 24, pp. 512517, Dec. 1976. [3] [4] [5] [6] [7] THE DISCRETE FOURIER TRANSFORM 383 [8] [9] [10] [11] [12] C. L. Dolph, A current distribution for broadside arrays which optimizes the relationship between beamwidth and side-lobe level, Proc. IRE, vol. 34, pp. 335348, June 1946. R. L. Streit, A two-parameter family of weights for nonrecursive digital lters and antennas, IEEE Trans. Acoust., Speech, Signal Process., vol. 32, pp. 108118, Feb. 1984. S. W. A. Bergen and A. Antoniou, Design of ultraspherical window functions with prescribed spectral characteristics, Applied Journal of Signal Processing, vol. 13, pp. 20532065, 2004. M. L. James, G. M. Smith, and J. C. Wolford Applied Numerical Methods for Digital Computation, 3rd ed., New York: Harper & Row, 1985. H. D. Helms, Fast Fourier transform method of computing difference equations and simulating lters, IEEE Trans. Audio Electroacoust., vol. 15, pp. 8590, June 1967. PROBLEMS 7.1. Show that N 1 k =0 W k (nm ) = N 0 for m = n otherwise 7.2. Show that (a ) D x (nT + mT ) = W km X ( jk ) (b) D1 X ( jk + jl ) = W nl x (nT ) 7.3. The denition of the DFT can be extended to include complex discrete-time signals. Show that (a ) D x (nT ) = X ( jk ) 1 (b) D X ( jk ) = x (nT ) 7.4. (a ) A complex discrete-time signal is given by x (nT ) = x1 (nT ) + j x2 (nT ) where x1 (nT ) and x2 (nT ) are real. Show that Re X 1 ( jk ) = 1 {Re X ( jk ) + Re X [ j ( N k ) ]} 2 Im X 1 ( jk ) = 1 {Im X ( jk ) Im X [ j ( N k ) ]} 2 Re X 2 ( jk ) = 1 {Im X ( jk ) + Im X [ j ( N k ) ]} 2 Im X 2 ( jk ) = 1 {Re X ( jk ) Re X [ j ( N k ) ]} 2 (b) A DFT is given by X ( jk ) = X 1 ( jk ) + j X 2 ( jk ) where X 1 ( jk ) and X 2 ( jk ) are real DFTs. Show that Re x1 (nT ) = 1 {Re x (nT ) + Re x [( N n )T ]} 2 Im x1 (nT ) = 1 {Im x (nT ) Im x [( N n )T ]} 2 Re x2 (nT ) = 1 {Im x (nT ) + Im x [( N n )T ]} 2 Im x2 (nT ) = 1 {Re x (nT ) Re x [( N n )T ]} 2 384 DIGITAL SIGNAL PROCESSING 7.5. Figure P7.5 shows four real discrete-time signals. Classify their DFTs as real, imaginary, or complex. Assume that N = 10 in each case. x(nT ) 0 (a) x(nT ) 10 nT 20 10 (b) x(nT ) nT 20 10 (c) nT 20 x(nT ) 0 (d ) 10 nT 20 Figure P7.5 7.6. Find the DFTs of the following periodic signals: 1 for n = 3, 7 (a ) x (nT ) = 0 for n = 0, 1, 2, 4, 5, 6, 8, 9 (b) x (nT ) = 1 2 for 0 n 5 for 6 n 9 7.7. Find the DFTs of the following periodic signals: 2ean for 0 n 5 (a ) x (nT ) = 0 for 6 n 9 The period is 10 in each case. THE DISCRETE FOURIER TRANSFORM 385 n for 0 n 2 0 for 3 n 7 (10 n ) for n = 8, 9 The period is 10 in each case. 7.8. Find the DFTs of the following periodic signals in closed form: (a ) x (n ) = e n for 0 n 31 if N = 32. (b) Repeat part (a ) for x (n ) = e n /2 for 0 n 31 if N = 32. 7.9. A periodic signal is given by (b) x (nT ) = x (nT ) = r = wH (nT + r N T ) where wH (nT ) = 0 + (1 ) cos 2 n N 1 for |n | otherwise N 1 2 Find X ( jk ). 7.10. Obtain the IDFTs of the following: 2 k (a ) X ( jk ) = (1)k 1 + 2 cos 10 4k 3k + sin (b) X ( jk ) = 1 + 2 j (1)k sin 5 5 The value of N is 10. 7.11. (a ) Find the z transform of x (nT ) for the DFTs of Prob. 7.10. Assume that x (nT ) = 0 outside the range 0 n 9 in each case. 7.12. (a ) Working from rst principles, derive an expression for the frequency spectrum of the rectangular window of length 31 in closed form. (b) Repeat part (a ) for a window length of 32. 7.13. (a ) Starting with Eq. (7.25), derive Eq. (7.29). (b) Starting with Eq. (7.27), derive Eq. (7.32). 7.14. Show that the Kaiser window includes the rectangular window as a special case. 7.15. Compute the values of the Kaiser window of length Nw = 7 and = 3.0. 7.16. Construct Table 7.1 for a Kaiser length of length 31. 7.17. Function wH (nT ) in Prob. 7.9 with = 0.54 is known as the Hamming window. Obtain a closed-form expression for the frequency spectrum of the window. 7.18. Using MATLAB or similar software, plot the ripple ratio and main-lobe width of the Hamming window described in Prob. 7.17 as a function of the window length. 7.19. The triangular window 4 is given by 1 2|n | N 1 for |n | otherwise N 1 2 wTR (nT ) = 0 4 This is also known as the Bartlett window. 386 DIGITAL SIGNAL PROCESSING (a) Assuming that wTR (t ) is bandlimited, obtain an approximate expression for WTR (e j T ). (b) Estimate the main-lobe width if N 1. (c) Estimate the ripple ratio if N 1. (Hint: See Prob. 6.27.) 7.20. An innite-duration discrete-time signal is described by x (nT ) = u (nT ) A0 e p0 nT + 2 M1 e1 t cos(1 nT + 1 ) where A0 = 4.532, M1 = 2.350, 1 = 2.873 rad, p0 = 2.322, 1 = 1.839, and 1 = 1.754 rad/s. (a ) Obtain an expression for the frequency spectrum of the signal. (b) Plot the frequency spectrum over the range 0 s /2 assuming a sampling frequency s = 10 rad/s. (c) Repeat part (b) if the signal is modied through the use of a rectangular window of length 21. (d ) Repeat part (b) if the signal is modied through the use of a Kaiser window of length 21 and = 1.0. (e) Compare the results obtained in parts (c) and (d ). 7.21. An innite-duration right-sided discrete-time signal x (nT ) is obtained by sampling the continuous-time signal x (t ) = u (t )[ A0 e p0 t + 2 M1 e1 t cos(1 t + 1 )] where A0 = 5.0, M1 = 2.0, 1 = 3.0 rad, p0 = 2.0, 1 = 1.5, and 1 = 2.5 rad/s. A nite duration signal can be obtained by applying the discrete-time Kaiser window with = 2.0. Following the approach in Example 7.5, nd the lowest sampling frequency that would result in negligible aliasing error. 7.22. Repeat Prob. 7.21 if A0 = 4.0, M1 = 3.0, 1 = 2.0 rad, p0 = 3.0, 1 = 2.0, 1 = 1.5 rad/s, and = 1.5. 7.23. Prove Theorem 6.2 B . 7.24. (a ) Periodic signals x (n ) and h (n ) are given by x (n ) = h (n ) = n Find the time-domain convolution 9 1 2 for 0 n 4 for 5 n 9 for 0 n 9 y (n ) = m =0 x (m )h (n m ) at n = 4 assuming a period N = 10. (b) Repeat part (a ) if x (n ) = u (n 4)en 7.25. Two periodic signals are given by x (n ) = cos n /9 and h (n ) = u (n 4) for 0 n 9 for 0 n 9 h (n ) = 1 0 n = 0, 1, 8, 9 otherwise Find the time-domain convolution y (n ) at n = 5 assuming that N = 10. THE DISCRETE FOURIER TRANSFORM 387 (b) Repeat part (a ) if x (n ) = cos n /9 7.26. Show that D [x (n )h (n )] = 1 N N 1 and h (n ) = e n 0 for 0 n 3 otherwise X (m ) H (k m ) m =0 where X (k ) = D x (n ) and H (k ) = D h (n ). 7.27. Construct the ow graph for a 16-element decimation-in-time FFT algorithm. 7.28. Construct the ow graph for a 16-element decimation-in-frequency FFT algorithm. 7.29. (a ) Compute the Fourier-series coefcients for the periodic signal depicted in Fig. P7.29 by using a 32-element FFT algorithm. (b) Repeat part (a ) using a 64-element FFT algorithm. (c) Repeat part (a ) using an analytical method. (d ) Compare the results obtained. x(t) t Figure P7.29 7.30. Repeat Prob. 7.29 for the signal of Fig. P7.30. x(t) |sin t| 0 t 2 Figure P7.30 7.31. (a ) Compute the Fourier transform of x (t ) = 1 (1 2 + cos t ) 0 for 0 |t | otherwise by using a 64-element FFT algorithm. The desired resolution in the frequency domain is 0.5 rad/s. (b) Repeat part (a ) for a frequency domain resolution of 0.25 rad/s. (c) Repeat part (a ) by using an analytical method. (d ) Compare the results in parts (a ) to (c). 388 DIGITAL SIGNAL PROCESSING 7.32. Repeat Prob. 7.31 for the signal x (t ) = 1 |t | 0 for |t | < 1 otherwise The desired frequency-domain resolutions for parts (a ) and (b) are /4 and /8 rad/s, respectively. 7.33. An FFT program is available which allows for a maximum of 64 complex input elements. Show that this program can be used to process a real 128-element sequence. 7.34. Demonstrate the validity of Eq. (7.64). CHAPTER 8 REALIZATION OF DIGITAL FILTERS 8.1 INTRODUCTION The previous chapters considered the basics of signal analysis and the characterization and analysis of discrete-time systems. From this chapter onward, the design of discrete-time systems that can be used in DSP will be examined in great detail. Discrete-time systems come in all shapes and forms. However, this textbook is concerned with discrete-time systems that can be used to reshape the spectral characteristics of discrete-time signals, and such systems are of course digital lters be it nonrecursive or recursive, FIR or IIR lters, one- or two-dimensional, single-rate or multirate, adaptive or xed. In broad terms, the design of digital lters encompasses all the activities that need to be undertaken from the point where a need for a specic type of digital lter is identied to the point where a prototype is constructed, tested, and approved. The compendium of activities that need to be undertaken to obtain a design can be packaged into four basic steps, as follows: 1. 2. 3. 4. Approximation Realization Study of arithmetic errors Implementation When performed successfully, these steps would lead to the implementation of a digital lter that would satisfy a set of prescribed specications which would depend on the application at hand. 389 Copyright 2006 by The McGraw-Hill Companies, Inc. Click here for terms of use. 390 DIGITAL SIGNAL PROCESSING The approximation step is the process of generating a transfer function that would satisfy the desired specications, which may concern the amplitude or phase response or even the time-domain response of the lter. The available methods for the solution of the approximation problem can be classied as direct or indirect. In direct methods, the problem is solved directly in the z domain. In indirect methods, a continuous-time transfer function is rst obtained and then converted into a corresponding discrete-time transfer function. Nonrecursive lters are always designed through direct methods whereas recursive lters can be designed either through direct or indirect methods. Approximation methods can also be classied as closed-form or iterative. In closed-form methods, the problem is solved through a small number of design steps using a set of closed-form formulas. In iterative methods, an initial solution is assumed and, through the application of optimization methods, a series of progressively improved solutions are obtained until some design criterion is satised. In general, the designer is interested in approximation methods that are simple, are reliable, yield precise designs, require minimal computation effort, and so on. The realization or synthesis of a digital lter is the process of generating a digital-lter network or structure from the transfer function or some other characterization of the lter. The network obtained is said to be the realization of the transfer function. As for approximation methods, realization methods can be classied as direct or indirect. In direct methods the realization is obtained directly from a given discrete-time transfer function whereas in indirect realizations, the lter structure is obtained indirectly from an equivalent prototype analog lter. Many realization methods have been proposed in the past that lead to digital-lter structures of varying complexity and properties. The designer is usually interested in realizations that are easy to implement in very-large-scale integrated (VLSI) circuit form, require the minimum number of unit delays, adders, and multipliers, are not seriously affected by the use of nite-precision arithmetic in the implementation, and so on. Designs of all types from that of a refrigerator or an electrical drill to that of a microwave communications channel entail imperfections of various sorts brought about by modeling inaccuracies, component tolerances, unusual or unexpected nonlinear effects, and so on. A design will be approved to the extent that design imperfections do not violate the desired specications. In digital lters and digital systems in general, most imperfections are caused by numerical imprecision of some form and studying the ways in which numerical imprecision will manifest itself needs to be undertaken. During the approximation step, the coefcients of the transfer function are determined to a high degree of precision. In practice, however, digital hardware have nite precision that depends on the length of registers used to store numbers; the type of number system used (e.g., signed-magnitude, twos complement); the type of arithmetic used (e.g., xed-point or oating-point), and so on. Consequently, lter coefcients must be quantized (e.g., rounded or truncated) before they can be stored in registers. When the transfer function coefcients are quantized, errors are introduced in the amplitude and phase responses of the lter, which are commonly referred to as quantization errors. Such errors can cause the digital lter to violate the required specications and in extreme cases even to become unstable. Similarly, the signals to be processed as well as the internal signals of a digital REALIZATION OF DIGITAL FILTERS 391 lter (e.g., the products generated by multipliers) must be quantized. Since errors introduced by the quantization of signals are actually sources of noise (see Sec. 14.5), they can have a dramatic effect on the performance of the lter. Under these circumstances, the design process cannot be deemed to be complete until the effects of arithmetic errors on the performance of the lter are investigated and ways are found to mitigate any problems associated with numerical imprecision. The implementation of a digital lter can assume two forms, namely, software or hardware, as detailed in Sec. 1.8. In the rst case, implementation involves the simulation of the lter network on a general-purpose digital computer, workstation, or DSP chip. In the second case, it involves the conversion of the lter network into a dedicated piece of hardware. The choice of implementation is usually critically dependent on the application at hand. In nonreal-time applications where a record of the data to be processed is available, a software implementation may be entirely satisfactory. In realtime applications, however, where data must be processed at a very high rate (e.g., in communication systems), a hardware implementation is mandatory. Often the best engineering solution might be partially in terms of software and partially in terms of hardware since software and hardware are highly exchangeable nowadays. The design of digital lters may often involve other steps that do not appear explicitly in the above list. For example, if a digital lter is required to process continuous-time signals, the effects of the interfacing devices (e.g., analog-to-digital and digital-to-analog converters) on the accuracy of processing must be investigated. The natural order of the four basic design steps is as stated in the preceding discussion, namely, approximation, realization, study of imperfections, and implementation. However, realization is that much easier to learn than the approximation process and for this reason it will be treated rst, in this chapter, along with some implementation aspects. The approximation step is a multifaceted activity that involves a diverse range of principles since there are many types of digital lters and many methodologies to choose from. It even necessitates on occasion the design of analog lters since some of the best IIR lters can be derived only from analog lters. The approximation step for FIR lters is considered in Chap. 9, for analog lters in Chap. 10, for IIR lters in Chaps. 11 and 12. Chapters 13 and 14 have to do with the study of numerical errors associated with the use of nite word length in digital hardware. Some more advanced, optimization-based, approximation methods for FIR and IIR lters can be found in Chaps. 15 and 16. Chapter 17 deals with a fairly advanced class of digital lters, namely, the class of wave digital lters which are known to possess certain highly desirable properties, and Chap. 18 which concludes the book deals with a variety of digital-lter applications. 8.2 REALIZATION As stated in the introduction, two types of realization methods have evolved over the past 30 to 40 years, namely, direct and indirect. In direct methods, the transfer function is put in some form that enables the identication of an interconnection of elemental digital-lter subnetworks. The most frequently used direct realization methods of this class are [14], as follows: 1. 2. 3. 4. 5. 6. Direct Direct canonic State-space Lattice Parallel Cascade 392 DIGITAL SIGNAL PROCESSING In indirect methods, on the other hand, a given analog-lter network is represented by the so-called wave characterization, which is normally used to represent microwave circuits and systems, and through the use of a certain transformation the analog-lter network is converted into a topologically related digital-lter network [58]. 8.2.1 Direct Realization A lter characterized by the N th-order transfer function H (z ) = can be represented by the equation N (z ) N (z ) Y (z ) = H (z ) = = X (z ) D (z ) 1 + D (z ) N N (z ) = D (z ) 1+ N i i =0 ai z N i i =1 bi z (8.1a) (8.1b) (8.2a) where N (z ) = i =0 N ai z i bi z i i =1 and D (z ) = From Eq. (8.1b), we can write (8.2b) Y ( z ) = N ( z ) X ( z ) D ( z )Y ( z ) or where and Y ( z ) = U1 ( z ) + U2 ( z ) U1 ( z ) = N ( z ) X ( z ) U 2 ( z ) = D ( z )Y ( z ) (8.3a) (8.3b) and hence the realization of H (z ) can be broken down into the realization of two simpler transfer functions, N (z ) and D (z ), as illustrated in Fig. 8.1. Consider the realization of N (z ). From Eqs. (8.2a) and (8.3a) U1 (z ) = [a0 + z 1 N1 (z )] X (z ) N where N1 (z ) = i =1 ai z i +1 REALIZATION OF DIGITAL FILTERS 393 X(z) N(z) U1(z) Y(z) U2(z) D (z) Figure 8.1 Decomposition of H (z ) into two simpler transfer functions. and thus N (z ) can be realized by using a multiplier with a constant a0 in parallel with a network characterized by z 1 N1 (z ). In turn, z 1 N1 (z ) can be realized by using a unit delay in cascade with a network characterized by N1 (z ). Since the unit delay can precede or follow the realization of N1 (z ), two possibilities exist for N (z ), as depicted in Fig. 8.2. The above procedure can now be applied to N1 (z ). That is, N1 (z ) can be expressed as N N1 (z ) = a1 + z 1 N2 (z ) where N2 (z ) = i =2 ai z i +2 and as before two networks can be obtained for N1 (z ). Clearly, there are four networks for N (z ). Two of them are shown in Fig. 8.3. a0 X(z) U1(z) N1(z) a0 X(z) U1(z) N1(z) Figure 8.2 Two realizations of N (z ). 394 DIGITAL SIGNAL PROCESSING a0 X(z) U1(z) a1 N2(z) a0 X(z) U1(z) a1 N2(z) Figure 8.3 Two of four possible realizations of N (z ). The above cycle of activities can be repeated N times whereupon N N (z ) will reduce to a single multiplier. In each cycle of the procedure there are two possibilities, and since there are N cycles, a total of 2 N distinct networks can be deduced for N (z ). Three of the possibilities are depicted in Fig. 8.4a to c. These structures are obtained by placing the unit delays consistently at the left in the rst case, consistently at the right in the second case, and alternately at the left and right in the third case. Note that in the realization of Fig. 8.4a , the adders accumulate the products generated by the multipliers from the top to the bottom of the realization. If they are added from the bottom to the top, the structure of Fig. 8.4d is obtained, which can form the basis of systolic structures (see Sec. 8.3.2). D (z ) can be realized in exactly the same way by using Eqs. (8.2b) and (8.3b) instead of Eqs. (8.2a) and (8.3a) the only differences being the negative sign in D (z ) and the fact that the rst term in D (z ) is b1 not b0 . Thus a network for D (z ) can be readily obtained by replacing a0 , a1 , a2 , . . . in Fig. 8.4a by 0, b1 , b2 , . . . . Finally, the realization of H (z ) can be accomplished by interconnecting the realizations of N (z ) and D (z ) as in Fig. 8.1. REALIZATION OF DIGITAL FILTERS 395 aN1 a1 a0 aN (a) aN aN1 a1 a0 (b) Figure 8.4 Four possible realizations of N (z ). Example 8.1 Realize the transfer function H (z ) = a0 + a1 z 1 + a2 z 2 1 + b1 z 1 + b2 z 2 Solution Two realizations of H (z ) can be readily obtained from Fig. 8.4a and b, as shown in Fig. 8.5a and b. 8.2.2 Direct Canonic Realization The smallest number of unit delays required to realize an N th-order transfer function is N . An N th-order discrete-time network that employs just N unit delays is said to be canonic with respect to the number of unit delays. The direct realization of the previous section does not yield canonic structures but through the use of a specic nonrecursive realization from those obtained through the direct realization it is possible to eliminate half of the unit delays, as will now be shown. 396 DIGITAL SIGNAL PROCESSING a0 a1 a2 a3 aN (c) a0 a1 aN1 aN (d ) Figure 8.4 Contd Four possible realizations of N (z ). Equation (8.1b) can be expressed as Y ( z ) = N ( z )Y ( z ) where Y (z ) = X (z ) 1 + D (z ) or Y ( z ) = X ( z ) D ( z )Y ( z ) With this manipulation, H (z ) can be realized as shown by the block diagram in Fig. 8.6a . On using the nonrecursive network of Fig. 8.4a for both N (z ) and D (z ) in Fig. 8.6a , the realization of Fig. 8.6b can be obtained after replacing 2-input by multiinput adders. As can be observed in Fig. 8.6b, the signals at nodes A , B , . . . are equal to the corresponding signals at nodes A , B , . . . . Therefore, nodes A , B , . . . can be merged with nodes A , B , . . . , respectively, and one set of unit delays can be eliminated to yield a more economical canonic realization. REALIZATION OF DIGITAL FILTERS 397 a2 a1 a0 b1 b2 (a) a2 a1 a0 b1 b2 (b) Figure 8.5 Two possible realizations of H (z ) (Example 8.1): (a ) Using the structure in Fig. 8.4a , (b) using the structure in Fig. 8.4b. 8.2.3 State-Space Realization Another approach to the realization of digital lters is to start with the state-space characterization q(nT + T ) = Aq(nT ) + bx (nT ) y (nT ) = c q(nT ) + d x (nT ) T (8.4a) (8.4b) 398 DIGITAL SIGNAL PROCESSING X(z) Y (z) N(z) Y(z) D (z) (a) a0 Y (z) X(z) b1 A b2 B bN B aN A a2 Y(z) a1 (b) Figure 8.6 Derivation of the canonic realization of H (z ): (a ) Block diagram, (b) possible realization. For an N th-order lter, Eqs. (8.4a) and (8.4b) give N qi (nT + T ) = j =1 ai j q j (nT ) + bi x (nT ) for i = 1, 2, . . . , N (8.5) and N y (nT ) = j =1 c j q j (nT ) + d0 x (nT ) (8.6) respectively. By assigning nodes to x (nT ), y (nT ), qi (nT ), and qi (nT + T ) for i = 1, 2, . . . , N , the state-space signal ow graph of Fig. 8.7 can be obtained, which can be readily converted into a network. REALIZATION OF DIGITAL FILTERS 399 d0 a11 q1(nT + T ) a12 b1 a21 b2 x(nT ) bN aN1 aN 2 qN (nT + T ) aNN q2(nT + T ) a22 a2N a1N E 1 q1(nT ) E 1 q2(nT ) c1 c2 y(nT ) cN E 1 qN (nT ) Figure 8.7 State-space signal ow graph. Example 8.2 A digital lter is characterized by the state-space equations in Eqs. (8.4a) and 2 b = 0 0 (8.4b) with 1 1 1 2 3 4 A= 1 0 0 0 1 0 cT = 1 4 11 6 12 d=2 Obtain a direct canonic realization. Solution In order to obtain a direct canonic realization, we need to deduce the transfer function of the lter. From Eq. (5.9) and Example 5.4, we have N (z ) Y (z ) = H (z ) = = cT (z I A)1 b + d X (z ) D (z ) 2 1 z z+1 3 4 1 11 = 1 6 12 z z + 1 z 4 2 det(z I A) 1 z+1 2 2 2z 1 11 = 1 6 12 2z + 2 4 det(z I A) 2 1z 4 z+ 1 4 1 2 2 0 +2 1 z+3 0 400 DIGITAL SIGNAL PROCESSING where det(z I A) = z 3 + 1 z 2 + 1 z + 2 3 1 4 Thus polynomials N (z ) and D (z ) can be deduced as 2 2z 1 N (z ) = 1 1 12 2z + 2 det(z I A) 46 2 = 2z 3 + 1 z 2 + 1 z + 2 3 and D (z ) = det(z I A) = z 3 + 1 z 2 + 1 z + 2 3 respectively. Therefore, H (z ) = 2z 3 + 1 z 2 + 1 z + 2 3 z3 + 1 z2 + 1 z + 2 3 2 3 1 4 1 4 2 3 = 2 + 1 z 1 + 1 z 2 + 2 z 3 2 3 3 1 + 1 z 1 + 1 z 2 + 1 z 3 2 3 4 The required realization is shown in Fig. 8.8 where a0 = 2 b1 = 1 2 a1 = 1 2 1 3 a2 = 1 3 1 4 a3 = 2 3 b2 = b3 = a0 x(nT ) b1 a1 y (nT ) b2 a2 b3 a3 Figure 8.8 Canonic realization (Example 8.2). REALIZATION OF DIGITAL FILTERS 401 8.2.4 Lattice Realization Yet another method is the so-called lattice realization method of Gray and Markel [4]. This is based on the conguration depicted in Fig. 8.9a . The networks represented by the blocks in Fig. 8.9a can assume a number of distinct forms. The most basic section is the 2-multiplier rst-order lattice section depicted in Fig. 8.9b. A transfer function of the type given by Eq. (8.1a) can be realized by obtaining values for the multiplier constants 0 , 1 , . . . , N and 1 , 2 , . . . , N in Fig. 8.9a using the transfer function coefcients a0 , a1 , . . . , a N and 1, b1 , . . . , b N . The realization can be accomplished by using a recursive algorithm comprising N iterations whereby polynomials of the form j j N j (z ) = i =0 ji z i D j (z ) = i =0 ji z i are generated for j = N , N 1, . . . , 0, and for each value of j the multiplier constants j and j are evaluated using coefcients j j and j j in the above polynomials. The steps involved are detailed below. Step 1: Let N j (z ) = N (z ) and D j (z ) = D (z ) and assume that j = N , that is j N N N (z ) = i =0 j ji z i = i =0 N ai z i bi z i i =0 (8.7a) D N (z ) = i =0 ji z i = with b0 = 1 (8.7b) X(z) LN Lj L1 vN vj v1 v0 Y (z) (a) j j (b) Figure 8.9 (a) General lattice conguration, (b) j th lattice section. 402 DIGITAL SIGNAL PROCESSING Step 2: Obtain j , j , N j 1 (z ), and D j 1 (z ) for j = N , N 1, . . . , 2 using the following recursive relations: j = jj (8.8a) j = jj P j (z ) = D j 1 z j z j = i =0 ji z i j j 1 (8.8b) N j 1 (z ) = N j (z ) j P j (z ) = i =0 ji z i ji z i (8.8c) D j 1 (z ) = D j (z ) j P j (z ) = 1 2 j j 1 i =0 (8.8d) Step 3: Let j = 1 in Eqs. (8.8a)(8.8d) and obtain 1 , 1 , and N0 (z ) as follows: 1 = 11 P1 (z ) = D1 1 z 1 = 11 z 1 = 10 z 1 + 11 (8.9a) (8.9b) (8.9c) N0 (z ) = N1 (z ) 1 P1 (z ) = 00 Step 4: Complete the realization by letting 0 = 00 The above lattice realization procedure is illustrated in the following example by obtaining a general second-order lattice structure. Example 8.3 Solution Realize the transfer function of Example 8.1 using the lattice method. From Eqs. (8.7a) and (8.7b), we can write N2 (z ) = 20 + 21 z 1 + 22 z 2 = a0 + a1 z 1 + a2 z 2 D2 (z ) = 20 + 21 z 1 + 22 z 2 = 1 + b1 z 1 + b2 z 2 For j = 2, Eqs. (8.8a)(8.8d) yield 2 = 22 = a2 P2 (z ) = D2 1 z 2 = 22 = b2 z 2 = z 2 + b1 z 1 + b2 = 20 z 2 + 21 z 1 + 22 N1 (z ) = N2 (z ) 2 P2 (z ) = a0 + a1 z 1 + a2 z 2 2 (z 2 + b1 z 1 + b2 ) = 10 + 11 z 1 D1 ( z ) = D2 (z ) 2 P2 (z ) 1 + b1 z 1 + b2 z 2 2 (z 2 + b1 z 1 + b2 ) = 1 2 1 2 2 2 = 10 + 11 z 1 REALIZATION OF DIGITAL FILTERS 403 where 10 = a0 a2 b2 10 = 1 11 11 = a1 a2 b1 b1 = 1 + b2 Similarly, from Eqs. (8.9a)(8.9c), we have 1 = 11 = a1 a2 b1 P1 (z ) = D1 1 z 1 = 11 = b1 1 + b2 z 1 = 10 z 1 + 11 N0 (z ) = N1 (z ) 1 P1 (z ) = 10 + 11 z 1 1 (10 z 1 + 11 ) = 00 where 00 = (a0 a2 b2 ) and from step 4, we have 0 = 00 Summarizing, the multiplier constants for a general second-order lattice realization are as follows: 0 = (a0 a2 b2 ) (a1 a2 b1 )b1 1 + b2 2 = a2 (a1 a2 b1 )b1 1 + b2 1 = a 1 a 2 b1 b1 1 = 2 = b2 1 + b2 The 2-multiplier section of Fig. 8.9b yields structures that are canonic with respect to the number of unit delays. However, the number of multipliers can be quite large, as can be seen in Example 8.3. More economical realizations can be obtained by using 1-multiplier rst-order sections of the type shown in Fig. 8.10. Such realizations can be obtained by rst realizing the transfer function in terms of 2-multiplier sections as described above and then replacing each of the 2-multiplier sections by either of the 1-multiplier sections of Fig. 8.10. The denominator multiplier constants 1 , 2 , . . . , N remain the same as before. However, the numerator multiplier constants 0 , 1 , . . . , N must be modied as j j = j where j = 1 N 1 i = j (1 for j = N + i i +1 ) for j = 0, 1, . . . , N 1 404 DIGITAL SIGNAL PROCESSING j 1 (a) j 1 (b) Figure 8.10 1-multiplier section: (a) For case where i = +1, (b) for case where i = 1. Each parameter i is a constant which is equal to +1 or 1 depending on whether the i th 2-multiplier section is replaced by the 1-multiplier section of Fig. 8.10a or that of Fig. 8.10b. The choice between the two types of sections is, in theory, arbitrary; however, in practice, it can be used to improve the performance of the structure in some respect. For example, by choosing the types of sections such that the signal levels at the internal nodes of the lter are maximized, an improved signal-to-noise ratio can be achieved (see Ref. [4] and Chap. 14). 8.2.5 Cascade Realization When the transfer function coefcients are quantized, errors are introduced in the amplitude and phase responses of the lter. It turns out that when a transfer function is realized directly in terms of a single N th-order network using any one of the methods described so far, the sensitivity of the structure to coefcient quantization increases rapidly with N . Consequently, small errors introduced by coefcient quantization give rise to large errors in the amplitude and phase responses. This problem can to some extent be overcome by realizing high-order lters as interconnections of rst- and second-order networks. In this and the next section, it is shown that an arbitrary transfer REALIZATION OF DIGITAL FILTERS 405 X(z) H1(z) H2(z) HM (z) Y(z) X1(z) Y1(z) X2(z) (a) Y2(z) XM (z) YM (z) a0i xi (nT ) b1i a1i yi(nT ) b2i a2i (b) Figure 8.11 (a) Cascade realization of H (z ), (b) canonic second-order section. function can be realized by connecting a number of rst- and second-order structures in cascade or in parallel. Another approach to the reduction of coefcient quantization effects is to use the wave realization method, which is known to yield low-sensitivity structures. This possibility will be examined in Chap. 17. Consider an arbitrary number of lter sections connected in cascade as shown in Fig. 8.11a and assume that the i th section is characterized by Yi (z ) = Hi (z ) X i (z ) From Fig. 8.11a , we note that Y1 (z ) = H1 (z ) X 1 (z ) = H1 (z ) X (z ) Y2 (z ) = H2 (z ) X 2 (z ) = H2 (z )Y1 (z ) = H1 (z ) H2 (z ) X (z ) Y3 (z ) = H3 (z ) X 3 (z ) = H3 (z )Y2 (z ) = H1 (z ) H2 (z ) H3 (z ) X (z ) Y (z ) = Y M (z ) = HM (z )Y M 1 (z ) = H1 (z ) H2 (z ) HM (z ) X (z ) Therefore, the overall transfer function of a cascade arrangement of lter sections is equal to the product of the individual transfer functions, that is, M (8.10) H (z ) = i =1 Hi (z ) 406 DIGITAL SIGNAL PROCESSING An N th-order transfer function can be factorized into a product of rst- and second-order transfer functions of the form Hi (z ) = and Hi (z ) = a0i + a1i z 1 + a2i z 2 1 + b1i z 1 + b2i z 2 (8.11b) a0i + a1i z 1 1 + b1i z 1 (8.11a) respectively. Now the individual rst- and second-order transfer functions can be realized using any one of the methods described so far. Connecting the lter sections obtained in cascade would realize the required transfer function. For example, one could use the canonic section of Fig. 8.11b with a2i = b2i = 0 for a rst-order transfer function to obtain a cascade canonic realization. Example 8.4 Obtain a cascade realization of the transfer function H (z ) = 216z 3 + 96z 2 + 24z (2z + 1)(12z 2 + 7z + 1) using canonic sections. Solution The transfer function can be expressed as H (z ) = 9 z z+ z2 + 4 z + 9 z2 + 7 z 12 1 9 1 12 1 2 + = 9 1 1 + 1 z 1 2 1 + 4 z 1 + 1 z 2 9 9 1+ 7 1 z 12 + 1 2 12 Hence, the cascade canonic realization shown in Fig. 8.12 can be readily obtained. 9 X(z) 7 12 Y(z) 1 2 4 9 1 12 1 9 Figure 8.12 Cascade realization of H (z ) (Example 8.4). REALIZATION OF DIGITAL FILTERS 407 8.2.6 Parallel Realization Another realization comprising rst- and second-order lter sections is based on the parallel conguration of Fig. 8.13. Assuming that the i th section in Fig. 8.13 can be represented by Eq. (8.10) and noting that X 1 (z ) = X 2 (z ) = = X M (z ) = X (z ), we can write Y ( z ) = Y 1 ( z ) + Y2 ( z ) + + Y M ( z ) = H1 (z ) X 1 (z ) + H2 (z ) X 2 (z ) + + HM (z ) X M (z ) = H1 (z ) X (z ) + H2 (z ) X (z ) + + HM (z ) X (z ) = [ H1 (z ) + H2 (z ) + + HM (z )] X (z ) = H (z ) X (z ) where M H (z ) = i =1 Hi (z ) Through the use of partial fractions, an N -order transfer function H (z ) can be expressed as a sum of rst- and second-order transfer functions just like those in Eqs. (8.11a) and (8.11b). Connecting the sections obtained in parallel as in Fig. 8.13 would result in a parallel realization. An alternative parallel realization can be readily obtained by expanding H (z )/z instead of H (z ) into partial fractions. X1(z) H1(z) Y1(z) X(z) X2(z) H2(z) Y2(z) Y(z) XM (z) HM (z) YM (z) Figure 8.13 Parallel realization of H (z ). 408 DIGITAL SIGNAL PROCESSING Example 8.5 Obtain a parallel realization of the transfer function H (z ) = 10z 4 3.7z 3 1.28z 2 + 0.99z (z 2 + z + 0.34)(z 2 + 0.9z + 0.2) using canonic sections. Solution We rst need to nd the poles of the transfer function. We have H (z ) = where p1 , p2 = 0.5 j 0.3 p3 = 0.4 p4 = 0.5 If we expand H (z )/z into partial fractions, we get H (z ) R1 R2 R3 R4 = + + + z z 0.5 + j 0.3 z 0.5 j 0.3 z + 0.4 z + 0.5 The i th residue of H (z )/z is given by Ri = (z pi ) H (z ) z z = pi 10z 4 3.7z 3 1.28z 2 + 0.99z (z p1 )(z p2 )(z p3 )(z p4 ) and through routine arithmetic or through the use of MATLAB, we get R1 = = (10z 4 3.7z 3 1.28z 2 + 0.99z ) z (z p2 )(z p3 )(z p4 ) (10z 3 3.7z 2 1.28z + 0.99) (z p2 )(z p3 )(z p4 ) z = p1 z = p1 = 1.0 Similarly, R2 = 1 and thus H (z ) = z 3z 5z z + + + z 0.5 + j 0.3 z 0.5 j 0.3 z + 0.4 z + 0.5 R3 = 3 R4 = 5 REALIZATION OF DIGITAL FILTERS 409 2 1 0.34 H1(z) 8 0.9 3.5 0.2 H2(z) Figure 8.14 Parallel realization of H (z ) (Example 8.5). Now, if we combine the rst two and the last two partial fractions into second-order transfer functions, we get H (z ) = or H (z ) = H1 (z ) + H2 (z ) where H1 (z ) = 2 z 1 1 z 1 + 0.34z 2 and H2 (z ) = 8 + 3.5z 1 1 + 0.9z 1 + 0.2z 2 8z 2 + 3.5z 2z 2 z +2 z 2 z + 0.34 z + 0.9z + 0.2 Using canonic sections, the parallel realization shown in Fig. 8.14 can be obtained. 410 DIGITAL SIGNAL PROCESSING 1 2 J 1 2 J Signal flow graph Transpose 1 2 K 1 2 K Figure 8.15 Transposition. 8.2.7 Transposition Given a signal ow graph with inputs j = 1, 2, . . . , J and outputs k = 1, 2, . . . , K , a corresponding signal ow graph can be derived by reversing the direction in each and every branch such that the J input nodes become output nodes and the K output nodes become input nodes, as illustrated in Fig. 8.15. The signal ow graph so derived, is said to be the transpose (or adjoint) of the original signal ow graph [9] (see also Chap. 4 of Ref. [10]). An interesting property of transposition is summarized in terms of the following theorem. Theorem 8.1 Transposition If a signal ow graph and its transpose are characterized by transfer functions H jk (z ) and Hkj (z ), respectively, then H jk (z ) = Hkj (z ) Proof See Ref. [9] or [10] for the proof. The transposition property can be used as a tool in the realization process since given an arbitrary digital network obtain through anyone of the realization procedures described in this chapter, an alternative realization can be derived through transposition. Example 8.6 Solution Obtain the transpose of the canonic network of Fig. 8.16a . The signal ow graph of the canonic section of Fig. 8.16a can be readily obtained as shown in Fig. 8.16b. The transpose of the signal ow graph is shown in Fig. 8.16c and the transpose network is shown in Fig. 8.16d . REALIZATION OF DIGITAL FILTERS 411 a0 x(nT ) b1 a1 y(nT ) b2 a2 (a) a0 a1 E 1 3 b1 x(n) 1 1 2 E 1 4 a2 y(n) 5 b2 (b) a0 a1 E 1 3 b2 (c) x (n) 5 4 a2 5 x (n) y (n) 1 1 2 E 1 b1 a2 4 a1 3 a0 2 1 y (n) b2 b1 (d ) Figure 8.16 Transpose realization (Example 8.6): (a ) Original realization, (b) signal ow graph of original realization, (c) transpose signal ow graph, (d ) transpose realization. 412 DIGITAL SIGNAL PROCESSING 8.3 IMPLEMENTATION As was stated in Sec. 1.8, the implementation of digital lters can assume two forms, namely, software and hardware. This classication is somewhat articial, however, since software and hardware are highly interchangeable nowadays. In nonreal-time applications, usually speed is not of considerable importance and the implementation might assume the form of a computer program on a generalpurpose computer or DSP chip, which will emulate the operation of the digital lter. Such an implementation would be based on the difference equations characterizing one of the digital-lter structures described in the previous sections. On the other hand, if a digital lter is to be used in some communications system, speed is of the essence and the implementation would assume the form of a dedicated, highly specialized, piece of hardware. Depending on the application, a hardware implementation may comprise one or several interconnected VLSI circuit chips depending on the complexity of the required digital lter. Progress continues to be made in this technology in accordance with Moores Law and as more and more functions can be accommodated on a VLSI chip, on the one hand, more complicated digital lters can be accommodated on a single chip and, on the other, fewer chips are needed to implement digital lters of high complexity. 8.3.1 Design Considerations In practice, fabrication costs may be classied as recurring, e.g., the cost of parts, and nonrecurring, e.g., the design costs. For special-purpose systems like digital lters, demand is usually relatively small. Consequently, the design costs predominate over other costs and should be kept as low as possible. If the realization of the digital lter can be decomposed into a few types of basic building blocks that can be simply interconnected repetitively in a highly regular fashion, considerable savings in the design costs can be achieved. The reason is that the few types of building blocks need to be designed only once. A modular design of this type offers another advantage which can lead to cost reductions. By simply varying the number of modules used in a chip, a large selection of different digital lters can be easily designed that meet a variety of performance criteria or specications. In this way, the nonrecurring design costs can be spread over a larger number of units fabricated and, therefore, the cost per unit can be reduced. In certain real-time applications, high-order lters are required to operate at very high sampling rates. In such applications, a very large amount of computation needs to be carried out during each sampling period and the implementation must be very fast. While progress continues to be made in increasing the speed of gates and reducing the propagation delays by reducing the lengths of interconnection wires, progress is slowing down in these areas and the returns are slowly diminishing. Therefore, any major improvement in the speed of computation must of necessity be achieved through the concurrent use of many processing elements. It turns out that the degree of concurrency is an underlying property of the digital-lter realization. For example, realizations that comprise parallel substructures allow a high degree of concurrency and, therefore, lead to fast implementations. When a large number of processing elements must operate simultaneously, communication among processing elements becomes critical. Since the cost, performance, and speed of the chip depend heavily on the delay and area of the interconnection network, a high degree of concurrency should be achieved in conjunction with simple, short, and regular communication paths among processing elements. 8.3.2 Systolic Implementations VLSI chip designers have been well aware of the merits of simplicity of form, regularity, and concurrency for a number of years and have developed special VLSI structures that offer many of REALIZATION OF DIGITAL FILTERS 413 these advantages. A family of such structures is the family of systolic arrays which are highly regular VLSI networks of simply connected processing elements that rhythmically process and pass data from one element to the next [11, 12]. The operation of these arrays is analogous to the rhythmical systolic operation of the heart and arteries by which blood is pumped forward from one artery to the next. Evidently, systolic realizations satisfy the design requirements alluded to earlier and are, as a consequence, highly suitable for the implementation of digital lters. Close examination of the types of structures considered so far reveals that most of them are not suitable for systolic implementation. However, some of them can be made suitable by simple modications, as will be demonstrated below. A useful technique in this process is known as pipelining. In this technique, the computation is partitioned into smaller parcels that can be assigned to a series of different concurrent processing elements in such a way as to achieve a speed advantage. A pipeline in the present context is, in a way, analogous to a modern assembly line of cars whereby the task of building a car is partitioned into a set of small subtasks carried out by concurrent workers (or robots) working at different stations along the assembly line. Pipelining will introduce some delay in the system, but once the pipeline is lled, a car will roll off the assembly line every few minutes. This sort of efciency cannot be achieved by having all the workers working concurrently on one car for obvious reasons. Consider the realization of N y (nT ) = i =0 ai x (nT i T ) shown in Fig. 8.17a , and assume that each addition and multiplication can be performed in a and m seconds, respectively. This structure can be readily obtained from Fig. 8.4d . Processing elements can be readily identied, as illustrated by the dashed lines. The additional unit delay at the right and the adder at the left with zero input are used as place holders in order to improve the regularity of the structure; they serve no other purpose. A basic disadvantage associated with this implementation is that the processing rate, which is the maximum sampling rate allowed by the structure, is limited. The processing rate of an implementation is the reciprocal of the time taken to perform all the required arithmetic operations between two successive samples. While the multiplications in Fig. 8.17a can be carried out concurrently, the N + 1 additions must be carried out sequentially from left to right. Therefore, a processing time of m + ( N + 1)a seconds is required, which can be large in practice since N can be large. The processing rate in the structure of Fig. 8.17a can be increased by using faster adders. A more efcient approach, however, is to increase the degree of concurrency through the application of pipelining. Consider the possibility of adding unit delays between processing elements, as depicted in Fig. 8.17b. Since the top and bottom outputs of each processing element are delayed by the same amount by the additional unit delays, the two signals are not shifted relative to each other, and the operation of the structure is not destroyed. The only effect is that the overall output will be delayed by N T seconds, since there are N additional delays between processing elements. Indeed, straightforward analysis gives the output of the modied structure as N y p (nT ) = i =0 ai x (nT i T N T ) 414 DIGITAL SIGNAL PROCESSING x(nT ) a0 a1 aN1 aN 0 (a) x(nT ) y(nT ) a0 a1 aN 0 (b) y(nT ) ak (c) Figure 8.17 (a) Realization of Nth-order nonrecursive lter, (b) corresponding systolic realization, (c) typical processing element. that is, y p (nT ) = y (nT N T ) where y (nT ) is the output of the original structure. The delay N T is said to be the latency of the structure. In the modied structure, only one multiplication and one addition is required per digitallter cycle and, therefore, the processing rate is 1/(m + a ). In effect, the processing rate does not, in this case, decrease as the value of N is increased. The additional unit delays in Fig. 8.17b may be absorbed into the processing elements, as depicted in Fig. 8.17c. An alternative structure that is amenable to a systolic implementation is depicted in Fig. 8.18a . This is obtained from the structure of Fig. 8.4b. As can be seen, only one multiplication and one aN aN1 a0 (a) aN aN1 a0 (b) Figure 8.18 (a) Alternative realization of N th-order nonrecursive lter, (b) corresponding systolic realization. 415 416 DIGITAL SIGNAL PROCESSING addition are required per digital-lter cycle, and so the processing rate is 1/(m + a ). The basic disadvantage of this structure is that the input signal has to be communicated directly to all the processing elements simultaneously. Consequently, for large values of N , wires become long and the associated propagation delays are large, thereby imposing an upper limit on the sampling rate. The problem can be easily overcome by using padding delays, as in Fig. 8.18b. Example 8.7 A DSP chip that realizes the nonrecursive lter shown in Fig. 8.19 is readily available as an off-the-shelf component. The chip is tted with registers for coefcients m 0 to m 3 , which can accommodate arbitrary multiplier constants. Realize the transfer function H (z ) = 216z 3 + 96z 2 + 24z + 2 (2z + 1)(12z 2 + 7z + 1) using two of these DSP chips along with any necessary interfacing devices. Solution The transfer function can be expressed as H (z ) = or as Y (z ) = where N (z ) = 9 + 4z 1 + z 2 + D (z ) = Hence Y (z ) = N (z ) X (z ) Y (z ) D (z ) This equation can be realized using two nonrecursive lters with transfer functions N (z ) and D (z ) as shown in Fig. 8.1. N (z ) can be realized by the structure in Fig. 8.19 if m 0 = 9, m 1 = 4, m 2 = 1, m 3 = 1/12. On the other hand, D (z ) can be realized by the structure in Fig. 8.19 if m 0 = 0, m 1 = 26/24, m 2 = 9/24, and m 3 = 1/24. 26 1 z 24 1 3 z 12 216 2 + 96 z 1 + z 2 + 24 z 3 Y (z ) = 24 26 24 1 9 1 X (z ) 1 + 24 z + 24 z 2 + 24 z 3 N (z ) X (z ) 1 + D (z ) + 9 2 z 24 + 1 3 z 24 REALIZATION OF DIGITAL FILTERS 417 m0 m1 m2 m3 Figure 8.19 (a) Nonrecursive lter (Example 8.7). REFERENCES [1] B. Gold and C. M. Rader, Digital Processing of Signals, New York: McGraw-Hill, 1969. [2] A. Antoniou, Realization of digital lters, IEEE Trans. Audio Electroacoust., vol. AU-20, pp. 9597, Mar. 1972. [3] L. B. Jackson, A. G. Lindgren, and Y. Kim, Synthesis of state-space digital lters with low roundoff noise and coefcient sensitivity, in Proc. IEEE Int. Symp. Circuits and Systems, 1977, pp. 4144. [4] A. H. Gray, Jr. and J. D. Markel, Digital lattice and ladder lter synthesis, IEEE Trans. Audio Electroacoust., vol. AU-21, pp. 491500, Dec. 1973. [5] A. Fettweis, Digital lter structures related to classical lter networks, Arch. Elektron. Ubertrag., vol. 25, pp. 7989, 1971. [6] A. Sedlmeyer and A. Fettweis, Digital lters with true ladder conguration, Int. J. Circuit Theory Appl., vol. 1, pp. 510, Mar. 1973. [7] L. T. Bruton, Low-sensitivity digital ladder lters, IEEE Trans. Circuits Syst., vol. CAS-22, pp. 168176, Mar. 1975. [8] A. Antoniou and M. G. Rezk, Digital-lter synthesis using concept of generalizedimmittance convertor, IEE J. Electron. Circuits Syst., vol. 1, pp. 207216, Nov. 1977. [9] A. Fettweis, A general theorem for signal-ow networks with applications, Arch. Elektron. Ubertrag., vol. 25, pp. 557561, 1971. [10] A. Antoniou, Digital Filters: Analysis, Design, and Applications, New York: McGraw-Hill, 1993. [11] H. T. Kung, Why systolic architectures, IEEE Computer, vol. 15, pp. 3746, Jan. 1982. [12] S. Y. Kung, VLSI array processors, IEEE ASSP Magazine, vol. 2, pp. 422, July 1985. PROBLEMS 8.1. (a ) Obtain the signal ow graph of the digital lter shown in Fig. P8.1. (b) Deduce the transfer function of the lter using the node elimination method. 418 DIGITAL SIGNAL PROCESSING 0.09 1.4 0.09 0.8 1.8 Figure P8.1 8.2. (a ) The ow graph of Fig. P8.2a represents a recursive lter. Deduce the transfer function. (b) Repeat part (a) for the ow graph of Fig. P8.2b. z 1 1 z 1 X(z) 1 1 z 1 1 2 Y(z) 1 2 z 1 Figure P8.2a X(z) 1 1 1 z 1 z 1 1 z 1 1 z 1 2 2 1 Y(z) Figure P8.2b REALIZATION OF DIGITAL FILTERS 419 8.3. (a) Convert the ow graph of Fig. P8.3 into a topologically equivalent network. (b) Obtain an alternative realization by using the direct canonic method. 1 X(z) 1 m1 z 1 m2 1 1 1 1 1 1 z 1 1 1 1 Y(z) Figure P8.3 8.4. (a ) Derive ow-graph representations for the lter of Fig. 8.5b. (b) Repeat part (a ) for the lter of Fig. 8.14. 8.5. A ow graph is said to be computable if there are no closed delay-free loops (see Sec. 4.8.1). (a ) Check the ow graphs of Fig. P8.5a for computability. (b) Repeat part (a ) for the lter of Fig. P8.5b. a z 1 z 1 X(z) 1 a b b 1 Y(z) Figure P8.5a X(z) 1 1 2 1 Y(z) 1 3 2 4 z 1 8 2 z 1 4 Figure P8.5b 420 DIGITAL SIGNAL PROCESSING 8.6. By using rst the direct and then the direct canonic method, realize the following transfer functions: (a) H (z ) = 4(z 1)4 4z 4 + 3z 3 + 2z 2 + z + 1 (b) H (z ) = (z + 1)2 4z 3 2z 2 + 1 8.7. A digital lter is characterized by the state-space equations q(nT + T ) = Aq(nT ) + bx (nT ) y (nT ) = cT q(nT ) + d x (nT ) where 01 A = 5 1 16 0 b= 1 cT = 11 2 8 d=2 (a) Obtain a state-space realization. (b) Obtain a corresponding direct canonic realization. (c) Compare the realizations in parts (a) and (b). 8.8. Repeat Prob. 8.7 if A= 8.9. Repeat Prob. 8.7 if A= 0 0 25 64 0.1 0.5 1.1 0.2 0.7 b = 2.0 8.8 cT = 0.6 d = 8.0 10 01 29 3 32 4 0 b= 0 1 cT = 25 3 11 64 32 4 d=1 8.10. (a ) Realize the transfer function H (z ) = using a lattice structure. (b) Repeat part (a ) for the transfer function H (z ) = 8.11. Realize the transfer function H (z ) = 0.0154z 3 + 0.0462z 2 + 0.0462z + 0.0154 z 3 1.990z 2 + 1.572z 0.4582 z 2 + 2z + 1 z 2 + 0.5z + 0.3 z (z + 1) z2 1 z + 2 1 4 using the lattice method. 8.12. A recursive digital lter is characterized by the state-space equations in Prob. 8.7 with A= 010 001 1 m 2 2 0 b= 0 1 cT = 1 2 1 d=1 (a ) Determine the range of m for which the lter is stable. (b) Obtain a state-space realization for the lter. REALIZATION OF DIGITAL FILTERS 421 (c) Obtain a lattice realization. (d ) Compare the realizations in parts (b) and (c). 8.13. (a ) Realize the transfer function H (z ) = 6z (6z 3 + 6z 2 + 3z )(3z 1) using direct canonic sections in cascade. (b) Repeat part (a ) using direct canonic sections in parallel. 8.14. (a ) Realize the transfer function H (z ) = 216z 3 + 168z 2 + 48z 1 24(z + 1 )(z 2 + 16 ) 2 using low-order direct canonic sections in cascade. (b) Repeat part (a ) using direct canonic sections in parallel. 8.15. (a ) Obtain a cascade realization for the transfer function H (z ) = 4(z 1)(z + 1)2 (2z + 1)(2z 2 2z + 1) using canonic sections. (b) Obtain a parallel realization of the transfer function in part (a ) using canonic sections. 8.16. (a ) Obtain a cascade realization for the transfer function H (z ) = 12z 3 + 6.4z 2 + 0.68z (z + 0.1)(z 2 + 0.8z + 0.15) using canonic sections. (b) Obtain a parallel realization of the transfer function in part (a ) using canonic sections. 8.17. (a) Obtain a realization of the transfer function H (z ) = 96z 2 72z + 13 24(z 1 )(z 1 )(z 1 ) 2 3 4 using a canonic rst-order and a canonic second-order section in cascade. (b) Obtain a parallel realization of the transfer function in part (a ) using canonic rst-order sections. 8.18. (a ) Realize the transfer function H (z ) = 16(z + 1)z 2 (4z + 3)(4z 2 2z + 1) using canonic sections in cascade. (b) Repeat part (a ) using canonic sections in parallel. 8.19. First-order lter sections of the type depicted in Fig. P8.19 are available. Using sections of this type, obtain a parallel realization of the transfer function H (z ) = 216z 2 + 162z + 29 (2z + 1)(3z + 1)(4z + 1) 422 DIGITAL SIGNAL PROCESSING X(z) Y(z) a b Figure P8.19 8.20. (a) Construct a ow chart for the software implementation of an N -section cascade lter assuming second-order lter sections. (b) Write a computer program that will emulate the cascade lter in part (a ). 8.21. (a) Construct a ow chart for the software implementation of an N -section parallel lter assuming second-order lter sections. (b) Write a computer program that will emulate the parallel lter in part (a ). 8.22. (a) Construct a ow chart for the software implementation of an N th-order state-space lter. (b) Write a computer program that will emulate the state-space lter of part (a ). 8.23. (a) Construct a ow chart for the software implementation of an 2nd-order lattice lter. (b) Write a computer program that will emulate the lattice lter of part (a ). 8.24. (a) Obtain the transpose of the network of Fig. 5.2. (b) Repeat part (a) for the network of Fig. 5.11. 8.25. (a) Obtain the transpose of the network shown in Fig. 8.5b. (b) Repeat part (a ) for the network of Fig. 8.14. 8.26. A digital-lter network that has a constant gain at all frequencies is said to be an allpass network. (a ) Show that the network depicted in Fig. P8.26 is an allpass network. (b) Obtain an alternative allpass network using transposition. (c) Show that the transpose network has the same transfer function as the original network. b a 1 b Figure P8.26 REALIZATION OF DIGITAL FILTERS 423 8.27. DSP VLSI chips that realize the module shown in Fig. P8.27a and the adder shown in Fig. P8.27b are readily available as off-the-shelf components. The chip in Fig. P8.27a is tted with a register for coefcient ak , which can accommodate an arbitrary multiplier constant. Using as many chips as necessary of the type shown in Fig. P8.27a plus an adder of the type shown in Fig. P8.27b, realize the transfer function H (z ) = 1.1z 2 2.2z + 1.1 z 2 0.4z + 0.3 ak + (a) (b) Figure P8.27 8.28. Realize the transfer function H (z ) = z2 1 z + 2 1 3 1 8 z3 1 z2 + 1 z + 2 4 using the VLSI chip of Prob. 8.27. 8.29. A DSP chip that realizes the nonrecursive lter shown in Fig. P8.29a is readily available as an off-the-shelf component. The chip is tted with registers for coefcients m 0 to m 3 , which can accommodate arbitrary multiplier constants. Realize the transfer function H (z ) = 216z 3 + 96z 2 + 24z + 2 (2z + 1)(12z 2 + 7z + 1) using two of these chips along with a 2-input adder such as that in Fig. P8.29b. 424 DIGITAL SIGNAL PROCESSING x(nT ) m0 m1 m2 m3 y(nT ) (a) (b) Figure P8.29 8.30. A DSP chip that realizes the recursive lter shown in Fig. 8.16d is readily available as an off-the-shelf component. The chip is tted with registers that can accommodate the coefcients a0 , a1 , a2 , b1 , and b2 . Realize the transfer function H (z ) = 48(z + 0.138)(z 2 + 0.312z + 0.0694) (2z + 1)(12z 2 + 7z + 1) using exactly two of these DSP chips, i.e., no other types of components are available. Show the conguration chosen and give suitable values to the various coefcients. CHAPTER 9 DESIGN OF NONRECURSIVE (FIR) FILTERS 9.1 INTRODUCTION The preceding chapter has dealt with the realization of digital lters whereby given an arbitrary transfer function or state-space characterization, a digital-lter network or structure is deduced. This and several of the subsequent chapters will deal with the approximation process whereby given some desirable lter characteristics or specications, a suitable transfer function is derived. As was mentioned in the introduction of Chap. 8, approximation methods can be classied as direct or indirect. In direct methods the discrete-time transfer function is generated directly in the z domain whereas in indirect methods it is derived from a continuous-time transfer function. Approximations can also be classied as noniterative or iterative. The former usually entail a set of formulas and transformations that yield designs of high precision with minimal computational effort. Iterative methods, on the other hand, are based on optimization algorithms. In these methods an initial design is assumed and is progressively improved until a discrete-time transfer function is obtained that satises the prerequisite specications. These methods are very versatile and can, therefore, be used to obtain solutions to problems that are intractable with noniterative methods although they usually require a large amount of computation. Approximation methods for the design of nonrecursive lters differ quite signicantly from those used for the design of recursive lters. The basic reason for this is that in nonrecursive lters the transfer function is a polynomial in z 1 whereas in recursive lters it is ratio of polynomials in z . 425 Copyright 2006 by The McGraw-Hill Companies, Inc. Click here for terms of use. 426 DIGITAL SIGNAL PROCESSING Nonrecursive lters are designed by using direct noniterative or iterative methods whereas recursive lters are designed by using indirect noniterative methods or direct iterative methods. The approximation problem for nonrecursive lters can be solved by applying the Fourier series or through the use of numerical analysis formulas. These methods provide closed-form solutions and, as a result, they are easy to apply and involve only a minimal amount of computation. Unfortunately, the designs obtained are suboptimal with respect to lter complexity whereby a lter design is said to be optimal if the lter order is the lowest that can be achieved for the required specications. Another approach to the design of nonrecursive lters is to use a powerful multivariable optimization algorithm known as the Remez exchange algorithm as will be shown in Chap. 15. The Remez approach yields optimal designs but, unfortunately, a huge amount of computation is required to complete a design, which renders the approach unsuitable for applications where nonrecursive lters have to be designed in real or quasi-real time. This chapter begins by examining the basic properties of nonrecursive lters. Then the use of the Fourier series as a tool in the design of nonrecursive lters is examined. It turns out that the use of the Fourier series by itself does not yield good designs but by applying the window technique described in Sec. 7.8 in conjunction with the Fourier series some moderately successful approximations can be obtained. The chapter concludes with the application of some classical numerical analysis formulas for the design of nonrecursive lters that can perform numerical interpolation, differentiation, or integration. 9.2 PROPERTIES OF CONSTANT-DELAY NONRECURSIVE FILTERS Nonrecursive lters can be designed to have linear or nonlinear phase responses. However, linearphase designs are typically preferred. In this section, it is shown that linear phase (or constant delay) can be achieved by ensuring that the impulse response has certain symmetries about its center point. 9.2.1 Impulse Response Symmetries A nonrecursive causal lter of length N can be characterized by the transfer function N 1 H (z ) = n =0 h (nT )z n (9.1) Its frequency response is given by H (e j T ) = M ()e j () = where M () = | H (e j T )| and () = arg H (e j T ) () d () d (9.3) N 1 n =0 h (nT )e j nT (9.2) The phase (or absolute) and group delays of a lter are given by p = respectively (see Sec. 5.7). and g = DESIGN OF NONRECURSIVE (FIR) FILTERS 427 For constant phase and group delays, the phase response must be linear, i.e., () = and thus from Eqs. (9.2) and (9.3), we have () = = tan1 Consequently, tan = and accordingly N 1 N 1 n =0 h (nT ) sin nT N 1 n =0 h (nT ) cos nT N 1 n =0 h (nT ) sin nT N 1 n =0 h (nT ) cos nT h (nT )(cos nT sin sin nT cos ) = 0 n =0 N 1 or n =0 h (nT ) sin( nT ) = 0 The solution of this equation is ( N 1)T 2 h (nT ) = h [( N 1 n )T ] = (9.4a) for 0 n N 1 (9.4b) as can be easily veried. Therefore, a nonrecursive lter can have constant phase and group delays over the entire baseband. It is only necessary for the impulse response to be symmetrical about the midpoint between samples ( N 2)/2 and N /2 for even N or about sample ( N 1)/2 for odd N . The required symmetry is illustrated in Fig. 9.1 for N = 10 and 11. In contrast, recursive lters with constant phase or group delay are not easy to design as will be found out in Chaps. 11 and 12. In most applications only the group delay needs to be constant in which case the phase response can have the form () = 0 where 0 is a constant. On assuming that 0 = /2, the above procedure yields a second class of constant-delay nonrecursive lters where ( N 1)T 2 h (nT ) = h [( N 1 n )T ] = (9.5a) (9.5b) In this case, the impulse response is antisymmetrical about the midpoint between samples ( N 2)/2 and N /2 for even N or about sample ( N 1)/2 for odd N , as illustrated in Fig. 9.2. 428 DIGITAL SIGNAL PROCESSING 1.0 Center of symmetry N = 10 h(nT ) nT = 9T 1.0 (a) 1.0 nT Center of symmetry N = 11 h(nT ) nT nT = 10T 1.0 (b) Figure 9.1 Impulse response for constant phase and group delays: (a) Even N , (b) odd N . 9.2.2 Frequency Response The symmetries in the impulse response in Eqs. (9.4b) and (9.5b) lead to some simple expressions for the frequency response of nonrecursive lters as will now be demonstrated. For a symmetrical impulse response with N odd, Eq. (9.2) can be expressed as ( N 3)/2 n =0 H (e j T ) = h (nT )e j nT + h ( N 1)T j ( N 1)T /2 + h (nT )e j nT e 2 n =( N +1)/2 N 1 (9.6) By using Eq. (9.4b) and then letting N 1 n = m and m = n , the last summation in Eq. (9.6) can be expressed as N 1 n =( N +1)/2 N 1 n =( N +1)/2 ( N 3)/2 h (nT )e j nT = h [( N 1 n )T ]e j nT = n =0 h (nT )e j ( N 1n )T (9.7) DESIGN OF NONRECURSIVE (FIR) FILTERS 429 Center of symmetry 1.0 N = 10 h(nT ) nT = 9T 1.0 (a ) 1.0 nT Center of symmetry N = 11 h (nT ) nT nT = 10T 1.0 (b) Figure 9.2 Alternative impulse response for constant group delay: (a) Even N , (b) odd N . Now from Eqs. (9.6) and (9.7) H (e j T ) = e j ( N 1)T /2 h ( N 1)T 2 ( N 3)/2 + n =0 2h (nT ) cos N 1 n T 2 and with ( N 1)/2 n = k , we have H (e j T ) = e j ( N 1)T /2 ( N 1)/2 ak cos kT k =0 where a0 = h ak = 2 h ( N 1)T 2 N 1 k T 2 (9.8a) (9.8b) Similarly, the frequency responses for the case of symmetrical impulse response with N even and for the two cases of antisymmetrical response simplify to the expressions summarized in Table 9.1. 430 DIGITAL SIGNAL PROCESSING Table 9.1 h(nT ) Frequency response of constant-delay nonrecursive lters N Odd Even e j ( N 1)T/2 e j ( N 1)T/2 H (e j T ) ( N 1)/2 k =0 N /2 k =1 Symmetrical ak cos kT bk cos[(k 1 )T ] 2 ( N 1)/2 k =1 N /2 k =1 Antisymmetrical Odd Even where a0 = h ( N 1)T 2 e j [( N 1)T/2/2] e j [( N 1)T /2/2] ak = 2 h N 1 2 ak sin kT bk sin[(k 1 )T ] 2 bk = 2 h N 2 k T k T 9.2.3 Location of Zeros The impulse response constraints of Eqs. (9.4) and (9.5) impose certain restrictions on the zeros of H (z ). For odd N , Eqs. (9.1), (9.4b), and (9.5b) yield H (z ) = 1 z ( N 1)/2 ( N 3)/2 n =0 1 ( N 1)T h (nT ) z ( N 1)/2n z [( N 1)/2n ] + h (z 0 z 0 ) 2 2 (9.9) where the negative sign applies to the case of antisymmetrical impulse response. With ( N 1)/2n = k , Eq. (9.9) can be put in the form 1 N (z ) = ( N 1)/2 H (z ) = D (z ) z where a0 and ak are given by Eqs. (9.8a) and (9.8b). The zeros of H (z ) are the roots of ( N 1)/2 ( N 1)/2 k =0 ak k ( z z k ) 2 N (z ) = k =0 a k ( z k z k ) If z is replaced by z 1 in N (z ), we have N ( z 1 ) = ( N 1)/2 k =0 ( N 1)/2 ak (z k z k ) a k ( z k z k ) = N ( z ) = k =0 DESIGN OF NONRECURSIVE (FIR) FILTERS 431 z plane 1/z5* z3 N1 poles z2 z4 z1 1/z4 z5 z5* z3* 1/z5 Figure 9.3 Typical zero-pole plot for a constant-delay nonrecursive lter. The same relation holds for even N, as can be easily shown, and therefore if z i = ri e j i is a zero of H (z ), then z i1 = e j i / ri must also be a zero of H (z ). This has the following implications on the zero locations: 1. An arbitrary number of zeros can be located at z i = 1 since z i1 = 1. 2. An arbitrary number of complex-conjugate pairs of zeros can be located on the unit circle since (z z i ) z z i = (z e j i )(z e j i ) = z 1 z i z 1 zi 3. Real zeros off the unit circle must occur in reciprocal pairs. 4. Complex zeros off the unit circle must occur in groups of four, namely, z i , z i , and their reciprocals. Polynomials with the above properties are often called mirror-image polynomials. A typical zero-pole plot for a constant-delay nonrecursive lter is shown in Fig. 9.3. 9.3 DESIGN USING THE FOURIER SERIES Since the frequency response of a nonrecursive lter is a periodic function of with period s , it can be expressed as a Fourier series (see Sec. 2.2). We can write H (e j T ) = where h (nT ) = n = h (nT )e j nT s /2 s /2 (9.10) (9.11) 1 s H (e j T )e j nT d and s = 2/ T . In Chap. 2, the Fourier series was applied for the time-domain representation of signals but in the present application it is applied for the frequency-domain representation of lters. 432 DIGITAL SIGNAL PROCESSING In effect, the roles of time and frequency are interchanged. If we let e j T = z in Eq. (9.10)1 , we obtain H (z ) = n = h (nT )z n (9.12) Hence with an analytic representation for a required frequency response available, a corresponding transfer function can be readily derived. Unfortunately, however, this is noncausal and of innite order since h (nT ) is dened over the range < n < according to Eq. (9.12). In order to achieve a nite-order transfer function, the series in Eq. (9.12) can be truncated by assigning h (nT ) = 0 in which case ( N 1)/2 for |n | > N 1 2 H (z ) = h (0) + n =1 [h (nT )z n + h (nT )z n ] (9.13) Causality can be brought about by delaying the impulse response by ( N 1)T /2 s, which translates into multiplying H (z ) by z ( N 1)/2 by virtue of the time-shifting theorem of the z transform (Theorem 3.4), so that H (z ) = z ( N 1)/2 H (z ) (9.14) Since |z ( N 1)/2 | = 1 if z = e j T , the above modication does not change the amplitude response of the derived lter. Note that if H (e j T ) in Eq. (9.10) is an even function of , then the impulse response obtained is symmetrical about n = 0, and hence the lter has zero group delay. Consequently, the lter represented by the transfer function of Eq. (9.14) has constant group delay equal to ( N 1)T /2. The design approach just described is illustrated by the following example. Example 9.1 Design a lowpass lter with a frequency response H (e j T ) 1 0 for || c for c < || s /2 where s is the sampling frequency. Solution From Eq. (9.11) h (nT ) = = 1 s c c e j nT d = e 2j j c nT 1 s ) = e j nT jnT c c 1 (e n j c nT 1 sin c nT n 1 This substitution is allowed by virtue of analytic continuation (see Sec. A.8). DESIGN OF NONRECURSIVE (FIR) FILTERS 433 1.0 N = 11 N = 41 0 1.0 Gain, dB 20 30 40 50 0 2 4 , rad/s 6 8 10 Figure 9.4 Amplitude response of lowpass lter (Example 9.1). Hence Eqs. (9.13) and (9.14) yield H (z ) = z ( N 1)/2 ( N 1)/2 n =0 an n ( z + z n ) 2 where a0 = h (0) an = 2h (nT ) The amplitude response of the lowpass lter obtained in Example 9.1 with c and s assumed to be 4 and 20 rad/s, respectively, is plotted in Fig. 9.4 for N = 11 and 41. The passband and stopband oscillations observed are due to slow convergence in the Fourier series, which in turn, is caused by the discontinuity at c = 4 rad/s. These are known as Gibbs oscillations. As N is increased, the frequency of these oscillations is seen to increase, and at both low and high frequencies their amplitude is decreased. Also the transition between passband and stopband becomes steeper. However, the amplitudes of the passband and stopband ripples closest to the passband edge remain virtually unchanged as can be see in Fig. 9.4. Consequently, the quality of the lter obtained is not very good and ways must be found for the reduction of Gibbs oscillations. A rudimentary method is to avoid discontinuities in the idealized frequency response by introducing transition bands between passbands and stopbands [1]. For example, the response of the 434 DIGITAL SIGNAL PROCESSING above lowpass lter could be redened as 1 a j T H (e ) a p 0 for || p for p < || < a for a || s /2 9.4 USE OF WINDOW FUNCTIONS An alternative and easy-to-apply technique for the reduction of Gibbs oscillations is to truncate the innite-duration impulse response h (nT ) given by Eq. (9.11) through the use of a discrete-time window function w (nT ) such as those encountered in Sec. 7.8.2. If we let h w (nT ) = w (nT )h (nT ) then the complex-convolution theorem (Theorem 3.10) gives Hw (z ) = Z [w (nT )h (nT )] = where 1 2 j H (v ) W z 1 v dv v (9.15) represents a contour in the common region of convergence of H (v ) and W (z /v ) and H (z ) = Z h (nT ) = n = h (nT )z n w (nT )z n (9.16a) W (z ) = Z w (nT ) = n = (9.16b) If we let v = ej T and z = e j T and assume that H (v ) and W (z /v ) converge on the unit circle of the v plane, Eq. (9.15) can be expressed as Hw (e j T ) = T 2 2/ T 0 H (e j T )W e j ( )T d (9.17) This is, of course, a convolution integral like the one in Eq. (7.20) and the effect of the window spectrum on the frequency response of the nonrecursive lter is very much analogous to the effect of the frequency spectrum of a nonperiodic continuous-time window on the frequency spectrum of the truncated continuous-time signal in Sec. 7.8.1. Assuming that a lowpass lter with an idealized frequency response H (e j T ) = 1 0 for 0 || c for c < || s /2 DESIGN OF NONRECURSIVE (FIR) FILTERS 435 is required, the graphical construction for the convolution integral assumes the form illustrated in Fig. 9.5. This is very similar to the graphical construction in Fig. 7.14 except for the fact that the frequency response of the lter and the frequency spectrum of the window function are periodic in the present application. As may be easily deduced following the steps in Sec. 7.8.1, the main-lobe width of the window will introduce transition bands at frequency points where the frequency response of the lter has discontinuities, i.e., at passband edges. On the other hand, the side ripples of the window will introduce ripples in the passband(s) of the lter whose amplitudes are directly related to the ripple ratio of the window function used. A variety of window functions have been described in the literature in recent years and some of them are as follows [1, 2]: 1. 2. 3. 4. 5. 6. Rectangular von Hann2 Hamming Blackman Dolph-Chebyshev Kaiser The rst four windows have only one adjustable parameter, the window length N . The last two, namely, the Dolph-Chebyshev and the Kaiser windows, have two parameters, the window length and one other parameter. 9.4.1 Rectangular Window The rectangular window is given by 1 w R (nT ) = 0 for |n | otherwise N 1 2 (9.18) and its frequency spectrum has been deduced in Sec. 7.8.2 as W R (e j T ) = sin( N T /2) sin( T /2) (9.19) Its main-lobe width is 2s / N and its ripple ratio remains relatively independent of N at approximately 22 percent for values of N in the range 11 to 101. The rectangular window corresponds, of course, to the direct truncation of the Fourier series and the effect of direct truncation on H (e j T ) is quite evident in Fig. 9.4. As N is increased the transition width between passband and stopband is decreased, an effect that is common in all windows. However, the amplitudes of the last passband and rst stopband ripples remain virtually unchanged with increasing values of N , and this is a direct consequence of the fact that the ripple ratio of the rectangular window is virtually independent of N (see Fig. 7.10). 2 Due to Julius von Hann and often referred to inaccurately as the Hanning window function. 436 DIGITAL SIGNAL PROCESSING H(e jT ) 1 c c T 2 T (a) W(e jT ) T 2 T (b) W(e j ( )T) T 2 T (c ) H(e j T)W(e j( )T) Hw(e jT) T 2 T (d ) Hw(e jT) c c T 2 T (e ) Figure 9.5 Convolution integral of Eq. (9.17). DESIGN OF NONRECURSIVE (FIR) FILTERS 437 9.4.2 von Hann and Hamming Windows The von Hann and Hamming windows are essentially one and the same and are both given by the raised-cosine function + (1 ) cos 2 n w H (nT ) = N 1 0 for |n | otherwise N 1 2 (9.20) where = 0.5 in the von Hann window and = 0.54 in the Hamming window. The small increase in the value of from 0.5 to 0.54 in the latter window has a benecial effect, namely, it reduces the ripple ratio by about 50 percent (see Table 9.2 below). The spectrums of these windows can be related to that of the rectangular window. Equation (9.20) can be expressed as w H (nT ) = w R (nT ) + (1 ) cos = w R (nT ) + 2 n N 1 1 w R (nT ) e j 2 n /( N 1) + e j 2 n /( N 1) 2 and on using the time-shifting theorem of the z transform (Theorem 3.4), we have W H (e j T ) = Z [w H (nT )] z =e j T = W R (e j T ) + + Table 9.2 1 W R e j [ T 2/( N 1)] 2 (9.21a) 1 W R e j [ T +2/( N 1)] 2 Summary of window parameters Ripple ratio, % Main-lobe Type of window Rectangular von Hann Hamming Blackman width 2s N 4s N 4s N 6s N N = 11 22.34 2.62 1.47 0.08 N = 21 21.89 2.67 0.93 0.12 N = 101 21.70 2.67 0.74 0.12 438 DIGITAL SIGNAL PROCESSING 6.0 First term 4.0 Third term 2.0 Second term WH (e 6.0 jT ) 4.0 2.0 3.0 2.0 1.0 0 1.0 2.0 3.0 , rad/s Figure 9.6 Spectrum of von Hann or Hamming window. Now from Eqs. (9.19) and (9.21a), we get W H (e j T ) = sin( N T /2) 1 sin[ N T /2 N /( N 1)] + sin( T /2) 2 sin[ T /2 /( N 1)] + 1 sin[ N T /2 + N /( N 1)] 2 sin[ T /2 + /( N 1)] (9.21b) Consequently, the spectrums for the von Hann and Hamming windows can be formed by simply shifting W R (e j T ) rst to the right and then to the left by 2/( N 1)T and after that adding the three spectral components in Eq. (9.21b) as illustrated in Fig. 9.6. As can be observed, the second and third terms tend to cancel the rst right and rst left side lobes in W R (e j T ), and as a result both the von Hann and Hamming windows have reduced side lobe amplitudes compared with those of the rectangular window. For N = 11 and s = 10 rad/s, the ripple ratios for the two windows are 2.62 and 1.47 percent and change to 2.67 and 0.74 percent, respectively, for N = 101 (see Table 9.2). DESIGN OF NONRECURSIVE (FIR) FILTERS 439 The rst term in Eq. (9.21b) is zero if = m s N and, similarly, the second and third terms are zero if = m+ N N 1 s N = m N N 1 s N and respectively, for m = 1, 2, . . . . If N 1, all three terms in Eq. (9.21b) have their rst common zero at || 2s / N , and hence the main-lobe width for the von Hann and Hamming windows is approximately 4s / N . 9.4.3 Blackman Window The Blackman window is similar to the preceding two and is given by N 1 0.42 + 0.5 cos 2 n + 0.08 cos 4 n for |n | w B (nT ) = N 1 N 1 2 0 otherwise The additional cosine term leads to a further reduction in the amplitude of Gibbs oscillations. The ripple ratio for N = 11 and s = 10 rad/s is 0.08 percent and changes to 0.12 percent for N = 101. The main-lobe width, however, is increased to about 6s / N (see Table 9.2). As can be seen in Table 9.2, as the ripple ratio is decreased from one window to the next one, the main-lobe width is increased. This happens to be a fairly general trade-off among windows. Example 9.2 Solution Redesign the lowpass lter of Example 9.1 using the von Hann, Hamming, and Blackman windows. The impulse response is the same as in Example 9.1, that is, 1 sin c nT n On multiplying h (nT ) by the appropriate window function and then using Eqs. (9.15) and (9.14), in this order, we obtain h (nT ) = Hw (z ) = z ( N 1)/2 a0 = w (0)h (0) ( N 1)/2 n =0 an n (z + z n ) 2 an = 2w (nT )h (nT ) where and 440 DIGITAL SIGNAL PROCESSING 0.1 Hamming 0 0.1 Gain, dB von Hann Blackman 40 60 80 100 0 1.0 2.0 3.0 4.0 5.0 , rad/s Figure 9.7 Amplitude response of lowpass lter (Example 9.2). The amplitude responses of the three lters are given by ( N 1)/2 M () = n =0 an cos nT These are plotted in Fig. 9.7 for N = 21 and s = 10 rad/s. As expected, the amplitude of the passband ripple is reduced, and the minimum stopband attenuation as well as the transition width are increased progressively from the von Hann to the Hamming to the Blackman window. 9.4.4 Dolph-Chebyshev Window The windows considered so far have a ripple ratio which is practically independent of N , as can be seen in Table 9.2, and as a result the usefulness of these windows is limited. A more versatile window is the so-called Dolph-Chebyshev window [3]. This window is given by w DC (nT ) = 1 N 1 +2 r ( N 1)/2 TN 1 x0 cos i =1 i N cos 2n i N (9.22) for n = 0, 1, 2, . . . , ( N 1)/2 where r is the required ripple ratio as a fraction and x0 = cosh 1 1 cosh1 N 1 r DESIGN OF NONRECURSIVE (FIR) FILTERS 441 Function Tk (x ) is the k th-order Chebyshev polynomial associated with the Chebyshev approximation for recursive lters (see Sec. 10.4.1) and is given by cos(k cos1 x ) cosh(cosh1 x ) for |x | 1 for |x | > 1 Tk (x ) = Evidently, an arbitrary ripple ratio can be achieved with this window and, as in other windows, the main-lobe width can be controlled by choosing the value of N . The Dolph-Chebyshev window has two additional properties of interest. First, with N xed, the main-lobe width is the smallest that can be achieved for a given ripple ratio; second, all the side lobes have the same amplitude, as can be seen in Fig. 9.8, that is, its amplitude spectrum is equiripple. A consequence of the rst property is that lters designed by using this window have a narrow transition band. A consequence of the second property is that the approximation error tends to be somewhat more uniformly distributed with respect to frequency. There is a practical issue in connection with most windows, including the Dolph-Chebyshev window, which needs to be addressed. We have assumed an ideal passband amplitude response of unity in the lters considered so far and typically the response of the designed lter is required to oscillate about unity. The value of the lter gain at any given frequency depends on the area of the window spectrum, as can be seen in Fig. 9.5, and if the passband gain is required to be approximately equal to unity, then the area of the window spectrum should be approximately equal to 2/ T to cancel out the factor T /(2 ) in the convolution integral of Eq. (9.17). For the Kaiser window, this turns out to be the case. However, in the case of the Dolph-Chebyshev window, the area of the window spectrum tends to 25 20 15 )|, dB 10 5 0 5 10 10 |W(e jT 5 0 , rad/s 5 10 Figure 9.8 Amplitude spectrum for Dolph-Chebyshev window ( N = 21, ripple ratio = 20 dB). 442 DIGITAL SIGNAL PROCESSING depend on the ripple ratio and, consequently, the passband gain will oscillate about some value other than unity. The problem can be easily circumvented by simply scaling the values of the impulse response by a suitable factor after the design is completed. This amounts to scaling the amplitude response by the same factor as can be readily veried. Depending on the application at hand, one may want the amplitude response to have a maximum value of unity (or 0 dB), or to oscillate about unity, or to do something else. In the rst case, one would need to nd the maximum value of the passband amplitude response as a ratio, say, Mmax and then divide all the values of the modied impulse response by Mmax , that is, h w (nT ) = h w (nT ) Mmax for ( N 1)/2 n ( N 1)/2 On the other hand, if the passband amplitude response is required to oscillate about unity, then one would need to scale the impulse response values with respect to the average passband response by letting h w (nT ) = h w (nT ) MAV where MAV = 1 ( Mmax + Mmin ) 2 (9.23) and Mmin is the minimum of the passband amplitude response. This scaling technique, which is also known as normalization of the amplitude response, is illustrated in the following example. Example 9.3 (a ) Using the Fourier-series method along with the Dolph-Chebyshev window, design a nonrecursive highpass lter assuming the idealized frequency response 1 H (e j T ) = 1 0 for s /2 < < c for c < < s /2 otherwise The required lter parameters are as follows: Ripple ratio: 20 dB c : 6.0 rad/s s : 20 rad/s N = 21 (b) Assuming that the passband of the lter extends from 6.8 to 10 rad/s, normalize the design obtained in part (a ) so as to achieve an amplitude response that oscillates about unity. (c) Find the passband peak-to-peak ripple A p in dB. (d ) Assuming that the stopband extends from 0 to 5.5 rad/s, nd the minimum stopband attenuation Aa in dB. DESIGN OF NONRECURSIVE (FIR) FILTERS 443 Solution (a ) From Eq. (9.11), we have h (nT ) = = = 1 s 1 s c s /2 e j nT d + c s /2 s /2 c e j nT d s /2 c e j nT jnT + e j nT jnT 1 [sin s nT /2 sin c nT ] n 1 [sin n sin c nT ] = n We note that (sin n )/ n is always zero except for n = 0 and hence we get 1 1 sin c nT for n = 0 n h (nT ) = 1 sin nT otherwise c n The ripple ratio in dB is given by 20 log r and hence 20 log r = 20 or r = 101 = 0.1 (9.24) On using Eqs. (9.22) and (9.24), the design of Table 9.3 where h w (nT ) = w DC (nT )h (nT ) can be obtained. (b) The amplitude response can be computed by using the formula for a symmetrical impulse response of odd length in Table 9.1. Through a simple MATLAB m-le the maximum and minimum values of the passband amplitude response can be Table 9.3 Numerical values of h(nT ) and wDC (nT )h(nT ) (Example 9.3) n 0 1 2 3 4 5 6 7 8 9 10 h(nT ) = h(nT ) 4.000000 E 3.027307 E 9.354893 E 6.236595 E 7.568267 E 0.0 5.045512 E 2.672827 E 2.338723 E 3.363674 E 0.0 1 1 2 2 2 2 2 2 2 hw(nT ) = hw(nT ) 2.343525 E 1.758746 E 5.298466 E 3.384614 E 3.865863 E 0.0 2.155795 E 1.012015 E 7.661656 E 9.278868 E 0.0 1 1 2 2 2 2 2 3 3 444 DIGITAL SIGNAL PROCESSING 0.5 0 0.5 Aa Gain, dB 20 30 40 50 60 0 2 4 , rad/s Ap 6 8 10 Figure 9.9 Amplitude response of lowpass lter (Example 9.3). obtained as Mmax = 0.6031 and Mmin = 0.5737 Hence the required scaling factor to normalize the passband amplitude response to unity is obtained from Eq. (9.23) as MAV = 0.5884. The amplitude response of the lter is plotted in Fig. 9.9. (c) The peak-to-peak passband ripple in dB can be obtained as A p = 20 log Mmax 20 log Mmin = 20 log Mmax = 0.43 dB Mmin (d ) The minimum stopband attenuation Aa is dened as the negative of the maximum stopband gain and it can be computed as 0.01549. Hence we have Aa = 20 log 0.01549 = 20 log 1 = 36.2 dB 0.01549 In view of the equiripple amplitude spectrum of the Dolph-Chebyshev window, one could expect to obtain an equiripple amplitude response for the lter. However, it does not work out that way because the relation between the amplitudes of the ripples in the lter response and those in the window spectrum is nonlinear. The nonlinear nature of this relation can be veried by examining the graphical construction of the convolution integral in Fig. 9.5. DESIGN OF NONRECURSIVE (FIR) FILTERS 445 9.4.5 Kaiser Window The Kaiser window [4] and its properties have been described in Sec. 7.8.1. As will be shown below, this window can be used to design nonrecursive lters that satisfy prescribed specications and it is, therefore, used widely. For this reason, its main characteristics are repeated here for easy reference. The window function is given by N 1 I0 ( ) for |n | 2 (9.25) w K (nT ) = I0 ( ) 0 otherwise where is an independent parameter and = 1 2n N 1 2 I0 ( x ) = 1 + k =1 1 k! x 2 k2 The exact spectrum of w K (nT ) can be readily obtained from Eq. (9.16b) as W K (e j T ) = w K (0) + 2 ( N 1)/2 w K (nT ) cos nT n =1 and an approximate but closed-form formula was given in Sec. 7.8.2 (see Eq. (7.32)). The ripple ratio can be varied continuously from the low value in the Blackman window to the high value in the rectangular window by simply varying the parameter . Also, as in other windows, the main-lobe width, designated as Bm , can be adjusted by varying N . The inuence of on the ripple ratio and main-lobe width is illustrated in Fig. 7.17a and b. An important advantage of the Kaiser window is that a method is available that can be used to design lters that will satisfy prescribed specications [4]. The design method is based on the fact that while the ripple ratio affects both the passband ripple and the transition width between passband and stopband, the window length N affects only the transition width. Consequently, one can choose the of the window through some empirical formulas to achieve the required passband or stopband ripple and then through another empirical formula one can choose the window length to achieve the desired transition width. The nuts and bolts of the method are as follows: 9.4.6 Prescribed Filter Specications In a lter designed through the use of the Kaiser window, the passband amplitude response oscillates between 1 and 1 + whereas the stopband amplitude response oscillates between 0 and where is the amplitude of the largest passband ripple, which happens to be the same as the amplitude of the largest stopband ripple. Hence the vital characteristics of a lowpass lter can be completely specied as illustrated in Fig. 9.10a where 0 to p and a to s /2 dene the passband and stopband, respectively. A prescribed set of specications , p , and a can be achieved for some specied sampling frequency s by choosing the parameter and the length N of the Kaiser window such that the amplitude response never crosses into the shaded areas in Fig. 9.10a . Typically in practice, the required lter characteristics are specied in terms of the peak-topeak passband ripple A p and the minimum stopband attenuation Aa in dB as dened in the solution 446 DIGITAL SIGNAL PROCESSING 1+ 1.0 1 Gain p c a s 2 (a) 1+ 1.0 1 Gain a c p s 2 (b) Figure 9.10 Idealized frequency responses: (a) Lowpass lter, (b) highpass lter. of Example 9.3. For a lowpass lter specied by Fig. 9.10a , we have 1+ A p = 20 log 1 and Aa = 20 log Bt = a p (9.26) (9.27) respectively, and the transition width is given by Given some arbitrary passband ripple and minimum stopband attenuation, say, A p and Aa , respectively, it may or may not be possible to achieve the required specications exactly. If it is possible, that would be just ne. If it is not possible to get the exact specications, the next best thing is to design a lter such that Ap Ap for 0 p DESIGN OF NONRECURSIVE (FIR) FILTERS 447 and Aa Aa for a s /2 i.e., design a lter that would oversatisfy one or both specications. This is a recurring theme in the design of lters both for nonrecursive as well as recursive. A lter with a passband ripple equal to or less than A p , a minimum stopband attenuation a , and a transition width Bt can be readily designed by using the following equal to or greater than A procedure [4]: 1. Determine h (nT ) using the Fourier-series approach of Sec. 9.3 assuming an idealized frequency response H (e j T ) = (dashed line in Fig. 9.10a ) where c = 1 ( p + a ) 2 2. Choose in Eqs. (9.26) and (9.27) such that A p A p and Aa Aa . A suitable value is = min( p , a ) where 100.05 A p 1 p = 0.05 A 10 p + 1 1 0 for || c for c < || s /2 and a = 100.05 Aa 3. With the required dened, the actual stopband loss Aa in dB can be calculated using Eq. (9.27). 4. Choose parameter as 0 for Aa 21 dB = 0.5842( Aa 21)0.4 + 0.07886( Aa 21) for 21 < Aa 50 dB for Aa > 50 dB 0.1102( Aa 8.7) 5. Choose parameter D as 0.9222 D = Aa 7.95 14.36 for Aa 21 dB for Aa > 21 dB Then select the lowest odd value of N that would satisfy the inequality N 6. Form w K (nT ) using Eq. (9.25). 7. Form Hw (z ) = z ( N 1)/2 Hw (z ) where Hw (z ) = Z [w K (nT )h (nT )] s D +1 Bt 448 DIGITAL SIGNAL PROCESSING Example 9.4 Design a lowpass lter that would satisfy the following specications: Maximum passband ripple in frequency range 0 to 1.5 rad/s: 0.1 dB Minimum stopband attenuation in frequency range 2.5 to 5.0 rad/s: 40 dB Sampling frequency: 10 rad/s Solution From step 1 and Example 9.1 h (nT ) = Step 2 gives 100.05(0.1) 1 = 5.7564 103 p = 0.05(0.1) 10 +1 a = 100.05(40) = 0.01 Hence and from step 3 Aa = 44.797 dB Steps 4 and 5 yield = 3.9524 Hence or Finally steps 6 and 7 give Hw (z ) = z ( N 1)/2 where ( N 1)/2 n =0 1 sin c nT n where c = 1 (1.5 + 2.5) = 2.0 rad/s 2 = 5.7564 103 D = 2.5660 N 10(2.566) + 1 = 26.66 1 N = 27 h w (nT )(z n + z n ) h w (nT ) = w K (nT )h (nT ) The numerical values of h (nT ) and w K (nT )h (nT ) are given in Table 9.4, and the amplitude response achieved is plotted in Fig. 9.11. This satises the prescribed specications. DESIGN OF NONRECURSIVE (FIR) FILTERS 449 Table 9.4 Numerical values of h(nT ) and wK (nT )h(nT ) (Example 9.4) n 0 1 2 3 4 5 6 7 8 9 10 11 12 13 h(nT ) = h(nT ) 4.000000 E 3.027307 E 9.354893 E 6.236595 E 7.568267 E 0.0 5.045512 E 2.672827 E 2.338723 E 3.363674 E 0.0 2.752097 E 1.559149 E 1.439214 E 1 1 2 2 2 2 2 2 2 2 2 2 hw(nT ) = hw(nT ) 4.000000 E 2.996921 E 8.983587 E 5.690178 E 6.420517 E 0.0 3.450028 E 1.577694 E 1.155982 E 1.343734 E 0.0 6.235046 E 2.395736 E 1.326848 E 1 1 2 2 2 2 2 2 2 3 3 3 0.1 0 0.1 20 Gain, dB 30 40 50 60 70 0 2 4 , rad/s 6 8 10 Figure 9.11 Amplitude response of lowpass lter (Example 9.4). 450 DIGITAL SIGNAL PROCESSING The above design procedure can be readily used for the design of highpass lters. For the specications of Fig. 9.10b, the transition width and idealized frequency response in step 1 can be taken as 1 for s /2 c j T Bt = p a and H (e ) = 1 for c s /2 0 otherwise where c = 1 (a + p ) 2 The remaining steps apply without modication. The procedure can also be extended to the design of multiband lters such as bandpass and bandstop lters. This is possible on account of the fact that the amplitudes of the passband and stopband ripples and the transition widths between passbands and stopbands depend directly on the ripple ratio of the window and its length and are independent of the number of lter bands. Thus all one needs to do for a multiband lter is to design the lter on the basis of the narrowest transition width. For the bandpass specications of Fig. 9.12a , the design must be based on the narrower of the two transition bands, i.e., Bt = min[( p1 a 1 ), (a 2 p2 )] Hence 1 j T H (e ) = 1 0 Bt 2 for c2 c1 for c1 c2 otherwise Bt 2 (9.28) (9.29) where c1 = p1 c2 = p2 + (9.30) Similarly, for the bandstop specications of Fig. 9.12b, we let Bt = min [(a 1 p1 ), ( p2 a 2 )] 1 j T H (e ) = 0 1 c1 = p1 + Bt 2 for 0 || c1 for c1 < || < c2 for c2 || s /2 c2 = p2 Bt 2 and where DESIGN OF NONRECURSIVE (FIR) FILTERS 451 1+ 1.0 1 Gain p1 c1 p2 c2 a2 s 2 a1 (a) 1+ 1.0 1 Gain p1 a1 a2 c2 p2 s 2 c1 (b) Figure 9.12 Idealized frequency responses: (a) Bandpass lter, (b) bandstop lter. Example 9.5 Design a bandpass lter that would satisfy the following specications: Minimum attenuation for 0 200: 45 dB Maximum passband ripple for 400 < < 600: 0.2 dB Minimum attenuation for 700 1000: 45 dB Sampling frequency: 2000 rad/s 452 DIGITAL SIGNAL PROCESSING Solution From Eq. (9.28) Bt = min [(400 200), (700 600)] = 100 Hence from Eq. (9.30) c1 = 400 50 = 350 rad/s Step 1 of the design procedure yields h (nT ) = and from Eq. (9.29), we get h (nT ) = = = h (nT ) = 1 s 1 s 1 n c1 c2 c2 = 600 + 50 = 650 rad/s 1 s s /2 s /2 H (e j T )e j nT d e j nT d + c 2 c 1 e j nT d e j c2 nT e j c2 nT e j c1 nT e j c1 nT + jnT jnT jnT jnT e j c2 nT e j c2 nT e j c1 nT e j c2 nT 2j 2j 1 (sin c2 nT sin c1 nT ) n 100.05(0.2) 1 = 1.1512 102 p = 0.05(0.2) 10 +1 a = 100.05(45) = 5.6234 103 Now according to step 2, and = 5.6234 103 Thus from Eq. (9.27), we obtain Aa = 45 dB The design can be completed as in Example 9.4. The resulting values for , D , and N are = 3.9754 D = 2.580 and N = 53 The amplitude response achieved is plotted in Fig. 9.13. Note that if we let c1 = 0 and c2 = c or c1 = c and c2 = s /2 in the above expression for h (nT ), we get the impulse response for a lowpass or highpass lter, as may be expected (see Examples 9.1 and 9.3). Thus a computer program that can design bandpass lters can also be used to design lowpass and highpass lters. DESIGN OF NONRECURSIVE (FIR) FILTERS 453 0.01 0 0.01 20 Gain, dB 30 40 50 60 70 0 200 400 , rad/s 600 800 1000 Figure 9.13 Amplitude response of bandpass lter (Example 9.5). 9.4.7 Other Windows There are several other window functions in the literature that can be applied in the design of nonrecursive lters such as the Saram ki and ultraspherical windows [5, 6]. Like the Dolph-Chebyshev and a Kaiser windows, the Saram ki window offers an independent parameter in addition to the window a length. The ultraspherical window is more exible than the others because it offers two independent parameters in addition to the window length. Consequently, it is possible to achieve a great variety of spectral characteristics with it [7], even to design better quality or more economical lters. The ultraspherical window includes the Dolph-Chebyshev and Saram ki windows as special cases and a it is also closely related to the Kaiser window. 9.5 DESIGN BASED ON NUMERICAL-ANALYSIS FORMULAS In signal processing, a continuous-time signal often needs to be interpolated, extrapolated, differentiated at some instant t = t1 , or integrated between two distinct instants t1 and t2 . Such mathematical operations can be performed by using the many classical numerical-analysis formulas [8, 9, 10]. Formulas of this type, which are derived from the Taylor series, can be readily used for the design of nonrecursive lters. The most fundamental numerical formulas are the formulas for interpolation since they form the basis of many other formulas, including formulas for differentiation and integration. The most commonly used interpolation formulas are the Gregory-Newton, Bessel, Everett, Stirling, and Gauss interpolation formulas. The value of x (t ) at t = nT + pT , where 0 p < 1, is given by the 454 DIGITAL SIGNAL PROCESSING Gregory-Newton formulas as x (nT + pT ) = (1 + and x (nT + pT ) = (1 ) p x (nT ) = 1 + p + where x (nT ) = x (nT + T ) x (nT ) and x (nT ) = x (nT ) x (nT T ) p ( p + 1) 2 + x (nT ) 2! ) p x (nT ) = 1 + p + p ( p 1) 2! 2 + x (nT ) are commonly referred to as the forward and backward differences, respectively. On the other hand, the Stirling formula yields x (nT + pT ) = 1 + + p2 2 p 2 ( p 2 1) 4 + + x (nT ) 2! 4! p x nT 1 T + x nT + 1 T 2 2 2 p ( p 2 1) 3 x n T 1 T + 3 x n T + 1 T + 2 2 2(3!) p ( p 2 1)( p 2 22 ) 5 x n T 1 T + 5 x n T + 1 T 2 2 2(5!) + (9.31) + where x n T + 1 T = x (nT + T ) x (nT ) 2 (9.32) is known as the central difference. The forward, backward, and central difference operators are, of course, linear and, therefore, higher-order differences can be readily obtained. For example, 3 x n T + 1 T = 2 x n T + 1 T 2 2 = 2 [x (nT + T ) x (nT )] = [ x (nT + T ) x (nT )] = x nT + 3 T x nT + 1 T 2 2 x nT + 1 T x nT 1 T 2 2 = x n T + 3 T 2 x n T + 1 T + x n T 1 T 2 2 2 = [x (nT + 2T ) x (nT + T )] 2[x (nT + T ) x (nT )] +[x (nT ) x (nT T )] = x (nT + 2T ) 3x (nT + T ) + 3x (nT ) x (nT T ) DESIGN OF NONRECURSIVE (FIR) FILTERS 455 The rst derivative of x (t ) with respect to time at t = nT + pT can be expressed as d x (t ) dt = = d x (nT + pT ) d p dp dt 1 d x (nT + pT ) T dp (9.33) t =nT + pT and, therefore, the above interpolation formulas lead directly to corresponding differentiation formulas. Similarly, integration formulas can be derived by writing t2 nT x (t ) dt = T 0 p2 x (nT + pT ) d p t2 nT T where nT < t2 nT + T and p2 = that is, 0 < p2 1. A nonrecursive lter that can perform interpolation, differentiation, or integration can now be obtained by expressing one of the above numerical formulas in the form of a difference equation. Let x (nT ) and y (nT ) be the input and output in a nonrecursive lter and assume that y (nT ) is equal to the desired function of x (t ), that is, y (nT ) = f [x (t )] (9.34) For example, if y (nT ) is required to be the rst derivative of x (t ) at t = nT + pT , where 0 p 1, we can write y (nT ) = d x (t ) dt (9.35) t =nT + pT By choosing an appropriate formula for f [x (t )] and then eliminating all the difference operators using their denitions, Eq. (9.34) can be put in the form M y (nT ) = i = K ai x (nT i T ) Thus the desired transfer function can be obtained as M H (z ) = n = K h (nT )z n For the case of a forward- or central-difference formula, H (z ) is noncausal. Hence for real-time applications it will be necessary to multiply H (z ) by an appropriate negative power of z , which would convert a noncausal into a causal design. 456 DIGITAL SIGNAL PROCESSING Example 9.6 A signal x (t ) is sampled at a rate of 1/ T Hz. Design a sixth-order differentiator with a time-domain response y (nT ) = Use the Stirling formula. Solution d x (t ) dt t =nT From Eqs. (9.31) and (9.33) d x (t ) dt 1 x nT 1 T + x nT + 1 T 2 2 2T + Now, on using Eq. (9.32) x n T 1 T + x n T + 1 T = x (nT + T ) x (nT T ) 2 2 3 x n T 1 T + 3 x n T + 1 T = x (nT + 2T ) 2x (nT + T ) 2 2 + 2x (nT T ) x (nT 2T ) 5 x n T 1 T + 5 x n T + 1 T = x (nT + 3T ) 4x (nT + 2T ) 2 2 + 5x (nT + T ) 5x (nT T ) + 4x (nT 2T ) x (nT 3T ) Hence y (nT ) = 1 [x (nT + 3T ) 9x (nT + 2T ) + 45x (nT + T ) 60T 45x (nT T ) + 9x (nT 2T ) x (nT 3T )] 1 3 x n T 1 T + 3 x n T + 1 T 2 2 12T 1 5 x n T 1 T + 5 x n T + 1 T 2 2 60T + y (nT ) = t =nT = and, therefore H (z ) = 1 (z 3 9z 2 + 45z 45z 1 + 9z 2 z 3 ) 60T Note that the differentiator has an antisymmetrical impulse response, i.e., it has a constant group delay, and it is also noncausal. A causal lter can be obtained by multiplying H (z ) by z 3 . The amplitude response of the differentiator is plotted in Fig. 9.14 for s = 2 . DESIGN OF NONRECURSIVE (FIR) FILTERS 457 3.5 3.0 2.5 2.0 Gain 1.5 Stirling formula Kaiser window Rectangular window Ideal 1.0 0.5 0 0 0.5 1.0 1.5 2.0 , rad/s 2.5 3.0 3.5 Figure 9.14 Amplitude response of digital differentiators (Examples 9.6 and 9.7). Differentiators can also be designed by employing the Fourier series method of Sec. 9.3. An analog differentiator is characterized by the continuous-time transfer function H (s ) = s Hence a corresponding digital differentiator can be designed by assigning H (e j T ) = j for 0 || < s /2 (9.36) Then on assuming a periodic frequency response, the appropriate impulse response can be determined by using Eq. (9.11). Gibbs oscillations due to the transition in H (e j T ) at = s /2 can be reduced, as before, by using the window technique. Example 9.7 Redesign the differentiator of Example 9.6 by employing the Fourier-series method. Use (a) a rectangular window and (b) the Kaiser window with = 3.0. Solution (a) From Eqs. (9.36) and (9.11), we have h (nT ) = 1 s s /2 s /2 j e j nT d = 1 s s /2 0 2 sin(nT ) d 458 DIGITAL SIGNAL PROCESSING On integrating by parts, we get h (nT ) = 1 1 cos n 2 sin n nT n T for n = 0 0 h (nT ) = 1 cos n otherwise nT or Now if we use the rectangular window with N = 7, we deduce Hw (z ) = 1 (2z 3 3z 2 + 6z 6z 1 + 3z 2 2z 3 ) 6T (b) Similarly, the Kaiser window yields 3 Hw (z ) = n =3 w K (nT )h (nT )z n where w K (nT ) can be computed using Eq. (9.25). The amplitude responses of the two differentiators are compared in Fig. 9.14 with the response of the differentiator obtained in Example 9.6. As before, the parameter in the Kaiser window can be increased to increase the in-band accuracy or decreased to increase the bandwidth. Thus the differentiator obtained with the Kaiser window has the important advantage that it can be adjusted to suit the application. The design of digital differentiators satisfying prescribed specications is considered in Refs. [11, 12] (see also Sec. 15.9.3). REFERENCES [1] [2] [3] [4] [5] [6] [7] F. F. Kuo and J. F. Kaiser, System Analysis by Digital Computer, Chap. 7, New York: Wiley, 1966. R. B. Blackman, Data Smoothing and Prediction, Reading, MA: Addison-Wesley, 1965. C. L. Dolph, A current distribution for broadside arrays which optimizes the relationship between beamwidth and side-lobe level, Proc. IRE, vol. 34, pp. 335348, June 1946. J. F. Kaiser, Nonrecursive digital lter design using the I0 -sinh window function, in Proc. IEEE Int. Symp. Circuit Theory, 1974, pp. 2023. T. Saram ki, Adjustable windows for the design of FIR ltersA tutorial, 6th a Mediterranean Electrotechnical Conference, vol. 1, pp. 2833, May 1991. R. L. Streit, A two-parameter family of weights for nonrecursive digital lters and antennas, IEEE Trans. Acoust., Speech, Signal Process., vol. 32, pp. 108118, Feb. 1984. S. W. A. Bergen and A. Antoniou, Design of Ultraspherical Window Functions with Prescribed Spectral Characteristics, Applied Journal of Signal Processing, vol. 13, pp. 20532065, 2004. DESIGN OF NONRECURSIVE (FIR) FILTERS 459 [8] R. Butler and E. Kerr, An Introduction to Numerical Methods, London: Pitman, 1962. [9] C. E. Fr berg, Introduction to Numerical Analysis, Reading, MA: Addison-Wesley, 1965. o [10] M. L. James, G. M. Smith, and J. C. Wolford, Applied Numerical Methods for Digital Computation, New York: Harper & Row, 1985. [11] A. Antoniou, Design of digital differentiators satisfying prescribed specications, Proc. Inst. Elect. Eng., Part E, vol. 127, pp. 2430, Jan. 1980. [12] A. Antoniou and C. Charalambous, Improved design method for Kaiser differentiators and comparison with equiripple method, Proc. Inst. Elect. Eng., Part E, vol. 128, pp. 190196, Sept. 1981. PROBLEMS 9.1. (a) A nonrecursive lter is characterized by the transfer function H (z ) = Find the group delay. (b) Repeat part (a) if H (z ) = 1 2z + 3z 2 4z 3 + 3z 4 2z 5 + z 6 z6 1 + 2z + 3z 2 + 4z 3 + 3z 4 + 2z 5 + z 6 z6 9.2. Figure P9.2 shows the zero-pole plots of two nonrecursive lters. Check each lter for phase-response linearity. z plane 1 z1* 1 z1* z2 z1 5 poles z2 z1* z1* z1 7 poles z3 z plane 1 z1 (a) 1 z1 z2* (b) Figure P9.2 9.3. A nonrecursive bandstop digital lter can be designed by applying the Fourier series method to the idealized frequency response: for || c1 1 for c1 < || < c2 H (e j T ) = 0 1 for c2 || s /2 (a) Obtain an expression for the impulse response of the lter. (a) Obtain a causal transfer function assuming a lter length N = 11. 460 DIGITAL SIGNAL PROCESSING 9.4. A nonrecursive digital lter can be designed by applying the Fourier series method to the idealized frequency response: 0 1 j T H (e ) 0 1 0 for || < c1 rad/s for c1 || c2 rad/s for c2 < || < c3 rad/s for c3 || c4 rad/s for c4 < || s /2 rad/s (a) Obtain an expression for the impulse response of the lter using the Fourier-series method. (a) Obtain a causal transfer function assuming a lter length N = 15. 9.5. (a) Derive an exact expression for the spectrum of the Blackman window. (b) Using the result in part (a) and assuming that N 1, show that the main-lobe width for the Blackman window is approximately 6s / N . 9.6. (a) Design a nonrecursive highpass lter in which H (e j T ) 1 0 for 2.5 || 5.0 rad/s for || < 2.5 rad/s Use the rectangular window and assume that s = 10 rad/s and N = 11. (b) Repeat part (a) with N = 21 and N = 31. Compare the three designs. 9.7. Redesign the lter of Prob. 9.6 using the von Hann, Hamming, and Blackman windows in turn. Assume that N = 21. Compare the three designs. 9.8. Design a nonrecursive bandpass lter in which 0 H (e j T ) 1 0 for || < 400 rad/s for 400 || 600 rad/s for 600 < || 1000 rad/s Use the von Hann window and assume that s = 2000 rad/s and N = 21. Check your design by plotting the amplitude response over the frequency range 0 to 1000 rad/s. 9.9. Design a nonrecursive bandstop lter with a frequency response 1 H (e j T ) 0 1 for || 300 rad/s for 300 < || < 700 rad/s for 700 || 1000 rad/s Use the Hamming window and assume that s = 2000 rad/s and N = 21. Check your design by plotting the amplitude response over the frequency range 0 to 1000 rad/s. 9.10. A digital lter is required with a frequency response like that depicted in Fig. P9.10. (a) Obtain a nonrecursive design using the rectangular window assuming that s = 10 rad/s and N = 21. (b) Repeat part (a) using a Dolph-Chebyshev window with a ripple ratio of 30 dB. (c) Repeat part (a ) using a Kaiser window with an of 3.0. (d) Compare the designs obtained in parts (a ) to (c). DESIGN OF NONRECURSIVE (FIR) FILTERS 461 H(e jT) 1 s s 2 s 2 s 3 s 2 2s Figure P9.10 9.11. A digital lter with a frequency response like that depicted in Fig. P9.11 is required. (a) Obtain a nonrecursive design using a rectangular window assuming that s = 10 rad/s and N = 21. (b) Repeat part (a) using a Dolph-Chebyshev window with a ripple ratio of 20 dB. (c) Repeat part (a ) using a Kaiser window with an of 2.0. (d) Compare the designs obtained in parts (a ) to (c). H(e jT) 1 |sin(/s)| s s 2 s 2 s 3s 2 2 s Figure P9.11 9.12. (a) Using the idealized amplitude response in Example 9.5, design a bandpass lter using the DolphChebyshev window. The required lter specications are as follows: Ripple ratio: 20 dB c1 = 3.0, c2 = 7.0 rad/s N = 21 s = 20 rad/s (b) Assuming that the passband extends from 3.8 to 6.8 modify the design in part (a ) so as to achieve an amplitude response that oscillates about unity. (c) Find the passband peak-to-peak ripple Ap in dB. (d) Assuming that the lower and upper stopbands extend from 0 to 2.1 and 7.9 to 10 rad/s, respectively, nd the minimum stopband attenuation. 9.13. (a) Repeat Prob. 9.12 assuming a ripple ratio of 25 dB. (b) Compare the design of this problem with that of Prob. 9.12. 9.14. Show that the Kaiser window includes the rectangular window as a special case. 9.15. (a) Repeat Prob. 9.12 using a Kaiser window with = 1.0. (b) Repeat Prob. 9.12 using a Kaiser window with = 4.0. (c) Compare the designs in parts (a ) and (b). 462 DIGITAL SIGNAL PROCESSING 9.16. Design a nonrecursive lowpass lter that would satisfy the following specications: A p 0.1 dB p = 20 rad/s Aa 44.0 dB s = 100 rad/s a = 30 rad/s 9.17. Design a nonrecursive highpass lter that would satisfy the following specications: A p 0.3 dB p = 3 rad/s Aa 45.0 dB s = 10 rad/s a = 2 rad/s 9.18. Design a nonrecursive bandpass lter that would satisfy the following specications: A p 0.5 dB Aa 35.0 dB p1 = 40 rad/s p2 = 60 rad/s a 1 = 20 rad/s a 2 = 80 rad/s s = 200 rad/s 9.19. Design a nonrecursive bandstop lter that would satisfy the following specications: A p 0.2 dB Aa 40 dB p1 = 1000 rad/s p2 = 4000 rad/s a 1 = 2000 rad/s 9.20. (a) Show that a 2 = 3000 rad/s s = 10,000 rad/s Z k x (nT ) = (1 z 1 )k X (z ) (b) A signal x (t ) is sampled at a rate of 2 rad/s. Design a sixth-order differentiator in which y (nT ) d x (t ) dt t =nT Use the Gregory-Newton backward-difference formula. (c) Repeat part (b) using the Stirling central-difference formula. 9.21. The phase response () of a digital lter is sampled at = n for n = 0, 1, 2, . . . . Design a sixth-order digital differentiator that can be used to generate the group delay of the digital lter. Use the Stirling formula. 9.22. A signal x (t ) is sampled at a rate of 2 rad/s. Design a sixth-order integrator lter in which y (nT ) (n +1)T x (t ) dt nT Use the Gregory-Newton backward-difference formula. 9.23. Two digital lters are to be cascaded. The sampling frequency in the rst lter is 2 rad/s, and that in the second is 4 rad/s. Design a sixth-order interface using the Gregory-Newton backward-difference formula. Hint: Design an interpolating lter. CHAPTER 10 APPROXIMATIONS FOR ANALOG FILTERS 10.1 INTRODUCTION As mentioned in the introduction of Chap. 8, the available approximation methods for recursive digital lters can be classied as indirect or direct. Alternatively, they can be classied as noniterative or iterative. In indirect methods a discrete-time transfer function that would satisfy certain required specications is deduced from a corresponding continuous-time transfer function through the application of certain transformations. In effect, indirect methods entail a closed-form formulation and they are, therefore, noniterative. The continuous-time transfer function is obtained by using one of several classical approximation methods for analog lters. On the other hand, in direct methods, a discrete-time transfer function is generated directly in the z domain usually using an optimization algorithm of some kind, i.e., direct methods are also iterative most of the time. Indirect methods have a historical basis. As detailed in Chap. 1, analog lters began to emerge around 1915 and during the rst half of the 20th century some really powerful analog-lter approximation methods were invented [15]. When digital lters appeared on the scene during the 1960s, it was quite natural for engineers to attempt to obtain digital-lter approximations by adapting, modifying, or transforming well-established analog-lter approximations. It is now clear, that these indirect methods have passed the test of time and are, as a consequence, very much a part of a modern DSP designers tool kit. This hypothesis can be veried by counting the analog-lter approximation methods found in MATLAB, for example. This chapter considers in some detail several analog-lter approximation methods that are suitable for the design of lters with piecewise-constant amplitude responses, i.e., lters whose 463 Copyright 2006 by The McGraw-Hill Companies, Inc. Click here for terms of use. 464 DIGITAL SIGNAL PROCESSING passband and stopband gains are constant and zero, respectively, to within prescribed tolerances. The most frequently used approximation methods of this type are as follows: 1. 2. 3. 4. 5. Butterworth Chebyshev Inverse-Chebyshev Elliptic Bessel-Thomson In the rst four methods, attention is focused on deriving a continuous-time transfer function that would yield a specied amplitude response (or loss characteristic) and no particular attention is paid to the associated phase response. This is in contrast with the design of nonrecursive lters whereby the linearity of the phase response is imposed at the outset, as may be recalled from Chap. 9. In consequence, the phase response achieved through these analog-lter approximations turns out to be nonlinear and, as a result, the group delay tends to vary with frequency. This may present a problem in applications where phase distortion is undesirable (see Sec. 5.7). In the fth approximation method, namely, the Bessel-Thomson [6] method, a constraint is imposed on the group delay associated with the transfer function, which results in a fairly linear phase response over a certain frequency range. The chapter begins with an introductory section dealing with the terminology and characterization of analog lters. While digital-lter designers talk about amplitude responses and gains, their analog-lter counterparts are more inclined to deal with loss characteristics and losses. This is because passive RLC analog lters, the forefathers of all lters, can provide only loss which can vary from zero to some large positive value. However, there is also a practical reason in describing analog lters in terms of loss characteristics. The derivations of the necessary formulas for the various approximations are that much easier to handle. The treatment of the basics provided is somewhat cursory and it is intended as a refresher. The interested reader is referred to Refs. [15] and also to a survey article written by the author in Ref. [7] for a more detailed exposition. The derivations provided deal with lowpass approximations since other types of approximations can be readily obtained through the application of transformations. Suitable transformations for the design of highpass, bandpass, and bandstop lters are described at the end of the chapter. It should be mentioned that the derivation of the formulas for the elliptic approximation is quite demanding as it entails a basic understanding of elliptic functions. Fortunately, however, the formulas that give the transfer-function coefcients can be put in a fairly simple form that is easy to apply even for the uninitiated. The elliptic approximation is treated in detail here because it yields the lowest-order transfer function for lters that are required to have prescribed piecewise-constant loss specications, which makes it the optimal approximation for such applications. The reader who is interested in the application of the method may skip the derivations and proceed to Sec. 10.6.6 for a step-by-step procedure for the design. The reader who is also interested in the derivation of this very important method may start by reading Appendix B which provides a brief review of the fundamentals of elliptic functions. The application of analog-lter approximations in the design of recursive digital lters will be considered in Chaps. 11 and 12. Chapter 12 considers, in addition, a delay-equalization technique that can be used in conjunction with the above methods for the design of digital lters with approximately linear phase response. Optimization methods that can be used to design recursive lters and equalizers can be found in Chap. 16. APPROXIMATIONS FOR ANALOG FILTERS 465 10.2 BASIC CONCEPTS The basics of analog lters bear a one-to-one correspondence with the basics of digital lters, i.e., characterization, time-domain analysis, stability, frequency-domain analysis, and so on. 10.2.1 Characterization An n th-order linear causal analog lter with input vi (t ) and output vo (t ) such as that in Fig. 10.1 can be characterized by a differential equation of the form bn d n vo (t ) d n 1 vo (t ) d n vi (t ) d n 1 vi (t ) + b n 1 + + b0 vo (t ) = an + a n 1 + + a0 vi (t ) dt n dt n 1 dt n dt n 1 (10.1) The coefcients a0 , a1 , . . . , an and b0 , b1 , . . . , bn are functions of the element values and are real since the parameters of the lter (e.g., resistances, inductances, and so on) are real. The element values can be time-dependent in real life but are assumed to be time-invariant in theory. 10.2.2 Laplace Transform The representation and analysis of discrete-time systems is facilitated through the use of the z transform. The transform of choice for analog lters and continuous-time systems in general is, of course, the Laplace transform which has already been encountered in Sec. 6.5.2. It is dened as X (s ) = x (t )est dt (10.2) where s is a complex variable of the form s = + j . Signal x (t ) can be recovered from X (s ) by applying the inverse Laplace transform which is given by x (t ) = where C is a positive constant. 1 2 j C+ j C j X (s ) est ds (10.3) L R1 2 C2 vi(t) C1 C3 vo(t) R2 Figure 10.1 Passive RLC analog lter. 466 DIGITAL SIGNAL PROCESSING The Laplace transform can be obtained by letting j s in the Fourier transform (see Fig. 6.13) and, therefore, it is an analytic continuation of the latter transform (see Sec. A.8). As for the Fourier and z transforms, short-hand notations can be used for the Laplace transform, i.e., X (s ) = Lx (t ) and x (t ) = L1 X (s ) or X (s ) x (t ) 10.2.3 The Transfer Function The Laplace transform of the k th derivative of some function of time x (t ) is given by L where x (0) d x (t ) dt d k 1 x (t ) dt k 1 d k x (t ) d x (t ) = s k X (s ) s k 1 x (0) s k 2 dt k dt d k 1 x (t ) dt k 1 t =0 t =0 t =0 t =0 are said to be the initial conditions of x (t ). In an analog lter, initial conditions are associated with the presence of charges in capacitors and inductors. In the present context, the analog lter can be safely assumed to be initially relaxed and thus all initial conditions can be deemed to be zero. On applying the Laplace transform to the differential equation in Eq. (10.1), we obtain (bn s n + bn 1 s n 1 + + b0 )Vo (s ) = (an s n + an 1 s n 1 + + a0 )Vi (s ) and thus Vo (s ) = Vi (s ) n i =0 n i =0 ai s i = H (s ) bi s i (10.4) This equation denes the transfer function of the lter, H (s ), which can also be expressed in terms of its zeros and poles as H (s ) = N (s ) = H0 D (s ) n i =1 (s z i ) n i =1 (s pi ) (10.5) The transfer function of a continuous-time system plays the same key role as that of a discretetime system. It provides a complete description of the lter both in the time and frequency domains. 10.2.4 Time-Domain Response The time-domain response of an analog lter can be expressed in terms of the time convolution as vo (t ) = h ( )vi (t ) d APPROXIMATIONS FOR ANALOG FILTERS 467 where h (t ) is the response of the lter to the continuous-time impulse function (t ). Now from the time-convolution theorem of the Fourier transform (Theorem 2.14), we can write Vo ( j ) = H ( j )Vi ( j ) (10.6a) that is, the Fourier transform (or frequency spectrum) of the output signal is equal to the Fourier transform of the impulse response times the Fourier transform of the input signal. If we now let j = s , we obtain Vo (s ) = H (s )Vi (s ) or H (s ) = Vo (s ) Vi (s ) (10.6c) (10.6b) Eq. (10.6c) is essentially the same as Eq. (10.4) and, in effect, the transfer function of an analog lter is one and the same as the Laplace transform of the impulse response. The response of an analog lter to an arbitrary excitation can be deduced by obtaining the inverse Laplace transform of Vo (s ) and from Eq. (10.6b), we have vo (t ) = L1 [ H (s )Vi (s )] If (i) the singularities of Vo (s ) in the nite plane are poles, and (ii) Vo (s ) 0 uniformly with respect to the angle of s as |s | with C , where C is a positive constant, then [8] 0 for t < 0 1 vo (t ) = (10.7) Vo (s ) est ds for t 0 2 j where is a contour in the counterclockwise sense made up of the part of the circle s = Re j to the left of line s = C and the segment of the line s = C that overlaps the circle, as depicted in Fig. 10.2, and C and R are sufciently large to ensure that encloses all the nite poles of Vo (s ). From the residue theorem (see Sec. A.7), the contour integral in Eq. (10.7) can be evaluated as 1 2 j P Vo (s ) est ds = i =1 Res [Vo (s ) est ] s = pi (10.8) where P is the number of poles in Vo (s ). Note that if the numerator degree of the transfer function is equal to the denominator degree, then condition (ii) above is violated and the inversion technique described cannot be applied. However, the problem can be readily circumvented by expressing Vo (s ) as Vo (s ) = R + Vo (s ) where R = lim Y (s ) s 468 DIGITAL SIGNAL PROCESSING j s plane R C R Figure 10.2 Contour for the evaluation of the inverse Laplace transform. As can be readily veried, in such a case Vo (s ) = Vo (s ) R would satisfy conditions (i) and (ii) above and thus the inverse Laplace transform of Y (s ) can be obtained as vo (t ) = R (t ) + L1 Vo (s ) The simplest way to obtain the time-domain response of a lter is to express H (s )Vi (s ) as a partialfraction expansion and then invert the resulting fractions individually. If Vo (s ) has simple poles, we can write P Vo (s ) = R + i =1 Ri s pi (10.9) where R is a constant and Ri = lim [(s pi ) Vo (s )] s pi APPROXIMATIONS FOR ANALOG FILTERS 469 is the residue of pole s = pi . On applying the inversion formula in Eq. (10.7) to each partial fraction, we obtain P vo (t ) = R (t ) + u (t ) i =1 Ri e pi t (10.10) where (t ) and u (t ) are the impulse function and unit step, respectively. The impulse response h (t ) of an analog system, that is, L1 H (s ), is of as much importance as the impulse response of a discrete-time system since its absolute integrability is a necessary and sufcient condition for the stability of the system. In discrete-time systems, the absolute summability of the impulse response imposes the condition that the poles of the transfer function be located inside the unit circle. Similarly, the absolute integrability of the impulse response in analog systems imposes the condition that the poles of the transfer function be located in the left-half s plane. Sometimes the unit-step response of an analog system may be required (see Prob. 11.9, for example). The Laplace transform of the unit step, u (t ), is 1/s . Hence the unit-step response is obtained as vo (t ) = Ru (t ) = L1 H (s ) s In certain applications, it may be necessary to deduce the initial or nal value of a signal from its Laplace transform (see Sec. 11.3, for example). Given the Laplace transform X (s ) of a right-sided signal x (t ), the initial and nal values of the signal can be obtained as x (0+) = lim [s X (s )] s and t lim x (t ) = lim [s X (s )] s 0 10.2.5 Frequency-Domain Analysis The sinusoidal response of an analog lter can be obtained vo (t ) = L1 [ H (s )Vi (s )] where X (s ) = L[u (t ) sin t ] = (s + j )(s j ) Through an analysis similar to that found in Sec. 5.5.1, it can be shown that the sinusoidal response of an analog lter comprises a transient and a steady-state component (see Prob. 10.1). If the analog lter is stable,1 i.e., the poles of the transfer function are in the left-half s plane, the transient 1 Of course passive R LC analog lters cannot be unstable for the same reason that a piano note cannot persist forever but there are active analog lters that can become unstable. 470 DIGITAL SIGNAL PROCESSING component approaches zero as t is increased and eventually the response of the lter assumes a steady state of the form vo (t ) = M () sin[t + ()] where M () = | H ( j )| and () = arg H ( j ) (10.11) are the gain and phase shift of the lter. As functions of frequency M () and () are the amplitude and phase response, respectively, and function H ( j ) = M ()e j () which includes both the amplitude and phase responses, denes the frequency response. Given an arbitrary lter characterized by a transfer function such as that in Eq. (10.5) with M simple zeros and N simple poles, we can write H ( j ) = M ()e j () = By letting j z i = M z i e j z i we obtain M () = and M N H0 M i =1 ( j N i =1 ( j zi ) pi ) (10.12) and j pi = M pi e j pi | H0 | M i =1 M z i N i =1 M pi (10.13) () = arg H0 + i =1 z i i =1 pi (10.14) where arg H0 = if H0 is negative. Thus the amplitude and phase responses of an analog lter can be determined by evaluating the transfer function on the imaginary axis of the s plane, as illustrated in Fig. 10.3. As in discrete-time systems the group delay is dened as () = d ( ) d and as a function of frequency () is said to be the delay characteristic. The approximation methods to be presented in this chapter have evolved hand in hand with realization methods for passive RLC analog lters such as that in Fig. 10.1. On the basis of energy considerations, M () is always equal to or less than unity in these lters and thus the gain in dB is always equal to or less than zero. For this reason, the past literature on passive analog lters has been almost entirely in terms of the loss (or attenuation) A() which is always equal to or greater APPROXIMATIONS FOR ANALOG FILTERS 471 j jip1=Mp e jp1 1 s plane ji jiz1=Mz e jz1 1 p p1 1 z 1 Mp 3 Mz Mp 2 z1 2 p 3 p3 z 2 p 2 z2 p2 Figure 10.3 Evaluation of frequency response. than zero since it is dened as the reciprocal of the gain in dB. The loss can be expressed as A() = 20 log 1 Vi ( j ) = 20 log = 10 log L (2 ) Vo ( j ) | H ( j )| L (2 ) = 1 H ( j ) H ( j ) (10.15) where A plot of A() versus is often referred to as a loss characteristic. With = s / j in Eq. (10.15), the function L (s 2 ) = D (s ) D (s ) N (s ) N (s ) can be formed. This is called the loss function of the lter, and, as can be easily veried, its zeros are the poles of H (s ) and their negatives, whereas its poles are the zeros of H (s ) and their negatives. Typical zero-pole plots for H (s ) and L (s 2 ) are shown in Fig. 10.4. 10.2.6 Ideal and Practical Filters The solution of the approximation problem for analog lters is facilitated by stipulating the existence of a set of idealized lters that can serve as models. An ideal lowpass lter is one that will pass 472 DIGITAL SIGNAL PROCESSING j H(s) j 2 2 L (s2) s plane s plane 2 2 Figure 10.4 Typical zero-pole plots for H (s ) and L (s 2 ). only low-frequency and reject high-frequency components. Such a lter would have zero loss in its passband and innite loss in its stopband as depicted in Fig. 10.5a . The boundary between the passband and stopband, namely, c , can be referred to as the cutoff frequency. Highpass, bandpass, and bandstop lters with loss characteristics like those depicted in Fig. 10.5b to d can similarly be dened. A() A() c c (a) A() A() (b) c1 c2 c1 c2 (c) (d ) Figure 10.5 Ideal loss characteristics: (a) Lowpass, (b) highpass, (c) bandpass, (d) bandstop. APPROXIMATIONS FOR ANALOG FILTERS 473 A practical lowpass lter differs from an ideal one in that the passband loss is not zero, the stopband loss is not innite, and the transition between passband and stopband is gradual. The loss characteristic might assume the form shown in Fig. 10.6a where p is the passband edge, a is the stopband edge, A p is the maximum passband loss, and Aa is the minimum stopband loss. The cutoff frequency c is usually a loose demarcation boundary between passband and stopband, which can vary from the one type of approximation to the next usually on the basis of convenience. For example, it is often used to refer to the 3-dB frequency in Butterworth lters or the square root of p a in the case of elliptic lters. Typical characteristics for practical highpass, bandpass, and bandstop lters are shown in Fig. 10.6b to d . A() Aa Ap p c a (a) A() Aa Ap a c p (b) Figure 10.6 Nonideal loss characteristics: (a) Lowpass, (b) highpass. 474 DIGITAL SIGNAL PROCESSING A() Aa Aa Ap a1 p1 (c) p2 a2 A() Aa Ap Ap p1 a1 (d ) a2 p2 Figure 10.6 Contd Nonideal loss characteristics: (c) Bandpass, (d ) bandstop. 10.2.7 Realizability Constraints An analog-lter approximation is a realizable continuous-time transfer function such that the loss characteristic approaches one of the idealized characteristics in Fig. 10.5. A continuous-time transfer function is said to be realizable if it characterizes a stable and causal network. Such a transfer function is required to satisfy the following constraints: 1. It must be a rational function of s with real coefcients. 2. Its poles must lie in the left-half s plane. 3. The degree of the numerator polynomial must be equal to or less than that of the denominator polynomial. APPROXIMATIONS FOR ANALOG FILTERS 475 In the following four sections, we focus our attention on normalized lowpass approximations; namely, Butterworth approximations in which the 3-dB cutoff frequency c is equal to 1 rad/s, Chebyshev approximations in which the passband edge p is equal to 1 rad/s, inverse-Chebyshev approximations in which the stopband edge a is equal to 1 rad/s, elliptic approximations in which the cutoff frequency c = ( p a ) is equal to 1 rad/s, and Bessel-Thomson approximations in which the group delay as 0 is equal to 1 s. Normalization keeps the sizes of numbers around unity which are easier to manage. Approximations for real-life practical lters can be obtained from the normalized ones through the use of transformations as described in Sec. 10.8. Approximations so obtained are sometimes said to be denormalized. 10.3 BUTTERWORTH APPROXIMATION The simplest lowpass approximation, the Butterworth approximation, is derived by assuming that L (2 ) is a polynomial of the form L (2 ) = b0 + b1 2 + + bn 2n such that 2 0 (10.16) lim L (2 ) = 1 in a maximally at sense. 10.3.1 Derivation The Taylor series of L (x + h ), where x = 2 , is L (x + h ) = L (x ) + h d L (x ) h k d k L (x ) + + dx k! d x k The polynomial L (x ) approaches unity in a maximally at sense as x 0 if its rst n 1 derivatives are zero at x = 0. We may, therefore, assign L (0) = 1 d L (x ) dxk Thus from Eq. (10.16), we have b0 = 1 or and b 1 = b2 = = b n 1 = 0 k x =0 =0 for k n 1 L (2 ) = 1 + bn 2n Now, for a normalized approximation in which L (1) = 2 that is, A() 3dB at = 1 rad/s, bn = 1 and L (2 ) = 1 + 2n (10.17) 476 DIGITAL SIGNAL PROCESSING 30 25 20 A(), dB n=9 15 n=6 10 n=3 5 0 0 0.5 , rad/s 1.0 1.5 Figure 10.7 Typical Butterworth loss characteristics (n = 3, 6, 9). Hence, the loss in a normalized lowpass Butterworth approximation is A() = 10 log (1 + 2n ) This is plotted in Fig. 10.7 for n = 3, 6, 9. (10.18) 10.3.2 Normalized Transfer Function With = s / j in Eq. (10.17), we have 2n L (s 2 ) = 1 + (s 2 )n = i =1 (s z i ) for even n for odd n zi = e j (2i 1)/2n e j (i 1)/ n (10.19) and since |z k | = 1, the zeros of L (s 2 ) are located on the unit circle |s | = 1. The normalized transfer function can be formed as HN (s ) = 1 n i =1 (s pi ) where pi for i = 1, 2, . . . , n are the left-half s -plane zeros of L (s 2 ). APPROXIMATIONS FOR ANALOG FILTERS 477 Example 10.1 Solution Using the Butterworth approximation, nd HN (s ) for (a ) n = 5 and (b) n = 6. (a ) For n = 5, Eq. (10.19) gives z i = e j (i 1)/5 (i 1) (i 1) + j sin = cos 5 5 Hence, the zeros of the loss function are as follows: z 1 = 1.0 z 2 = 0.809017 + j 0.587785 z 4 = 0.309017 + j 0.951057 z 6 = 1.0 z 8 = 0.309017 j 0.951057 z 10 = 0.809017 j 0.587785 z 3 = 0.309017 + j 0.951057 z 5 = 0.809017 + j 0.587785 z 7 = 0.809017 j 0.587785 z 9 = 0.309017 j 0.951057 Dropping the right-hand s plane zeros of the loss function, we get z 4 = 0.309017 + j 0.951057 z 6 = 1.0 z 5 = 0.809017 + j 0.587785 z 7 = 0.809017 j 0.587785 z 8 = 0.309017 j 0.951057 Now if we combine complex conjugate pairs of poles into factors, we obtain H (s )= 1 1 (s + 1) (s + 0.309017 j 0.951057)(s + 0.309017 + j 0.951057) = 1 (s + 0.809017 j 0.587785)(s + 0.809017 + j 0.587785) 1 1 1 (s + 1) (s 2 + 0.618034s + 1) (s 2 + 1.618034s + 1) (b) Similarly, for n = 6, we have z i = e j (2i 1)/2n = cos Hence z 1 = 0.965928 + j 0.258819 z 3 = 0.258819 + j 0.965926 z 2 = 0.707107 + j 0.707107 z 4 = 0.258819 + j 0.965926 (2i 1) (2i 1) + j sin 12 12 478 DIGITAL SIGNAL PROCESSING z 5 = 0.707107 + j 0.707107 z 7 = 0.965928 j 0.258819 z 9 = 0.258819 j 0.965926 z 11 = 0.707107 j 0.707107 z 6 = 0.965928 + j 0.258819 z 8 = 0.707107 j 0.707107 z 10 = 0.258819 j 0.965926 z 12 = 0.965928 j 0.258819 Dropping the right-hand s plane zeros of the loss function, we get z 4 = 0.258819 + j 0.965926 z 6 = 0.965928 + j 0.258819 z 8 = 0.707107 j 0.707107 z 5 = 0.707107 + j 0.707107 z 7 = 0.965928 j 0.258819 z 9 = 0.258819 j 0.965926 Now if we combine complex conjugate pairs of poles into factors, we obtain H (s ) = 1 (s + 0.258819 j 0.965926)(s + 0.258819 + j 0.965926) 1 (s + 0.707107 j 0.707107)(s + 0.707107 + j 0.707107) 1 (s + 0.965928 j 0.258819)(s + 0.965928 + j 0.258819) 1 1 =2 (s + 0.517638s + 1) (s 2 + 1.414214s + 1) 1 2 (s + 1.931852s + 1) The zero-pole plots of the loss function for the two examples are shown in Fig. 10.8. n=5 s plane n=6 s plane jIm s jIm s Re s Re s (a) (b) Figure 10.8 Zero-pole plots of loss function L (s 2 ) (Example 10.1). APPROXIMATIONS FOR ANALOG FILTERS 479 10.3.3 Minimum Filter Order Typically in practice, the required lter order is unknown. However, for Butterworth, Chebyshev, inverse-Chebyshev, and elliptic lters it can by easily deduced if the required specications are known. Let us assume that we need a Butterworth lter with a maximum passband loss A p , minimum stopband loss Aa , passband edge p , and stopband edge a . As can be seen in Fig. 10.7, the loss in the Butterworth approximation is a monotonic increasing function, and thus the maximum passband loss occurs at the passband edge. Hence, we have A( p ) = 10 log (1 + 2n ) A p p Thus 1 + 2n 10 A p /10 p 2n 100.1 A p 1 p 2n log p log (100.1 A p 1) For p < 1 and A p < 3.01 dB, both sides in the above inequality are negative and if we express the above relation as 2n log p log (100.1 A p 1) both sides will be positive. Solving for n , we get n [ log (100.1 A p 1)] (2 log p ) (10.20) Similarly, the minimum stopband loss occurs at the stopband edge. Hence, n must be large enough to ensure that 2 A(a ) = 10 log 1 + an Aa Solving for n , we get n log (100.1 Aa 1) 2 log a (10.21) In practice, we must, of course, satisfy both the passband and stopband specications and, therefore, n must be chosen large enough to satisfy both Eq. (10.20) as well as Eq. (10.21). It should be mentioned here that Eqs. (10.20) and (10.21) will not normally yield an integer but since the lter order must be an integer, the outcome of Eqs. (10.20) and (10.21) must be rounded up to the nearest integer. As a result of this rounding-up operation, the required specications will be slightly oversatised. The actual maximum passband loss and actual minimum stopband loss can be found by evaluating the loss of the lter at the specied passband and stopband edges using Eq. (10.18). 480 DIGITAL SIGNAL PROCESSING Example 10.2 In an application a normalized Butterworth lowpass lter is required that would satisfy the following specication: Passband edge p : 0.7 rad/s Stopband edge a : 2.0 rad/s Maximum passband loss A p : 0.5 dB Minimum stopband loss Aa : 30.0 dB (a ) Find the minimum lter order that would satisfy the specications. (b) Calculate the actual maximum passband loss and minimum stopband loss. (c) Obtain the required transfer function. Solution (a ) To ensure that the passband loss is equal to or greater than A p = 0.5 dB the inequality in Eq. (10.20) must be satised, i.e., n [ log (100.1 A p 1)] (2 log p ) [ log(100.10.5 1)] (2 log 0.7) 2.9489 3 To ensure that the stopband loss is equal to or greater than Aa = 30.0 dB, Eq. (10.21) must be satised, i.e., n log (100.1 Aa 1) 2 log a log (100.130 1) 2 log 2.0 4.9822 5 In order to satisfy the passband as well as the stopband specications, we choose the order n to be the larger of 3 and 5, that is, n = 5. (b) Because of the monotonic increasing nature of the loss of the Butterworth approximation, the actual maximum passband loss occurs at the passband edge. Hence, Eq. (10.18) gives A( p ) = 10 log 1 + 2n = 10 log (1 + 0.710 ) = 0.1210 dB p Similarly, the actual minimum stopband loss occurs at the stopband edge and thus 2 A(a ) = 10 log 1 + an = 10 log (1 + 2.010 ) = 30.11 dB APPROXIMATIONS FOR ANALOG FILTERS 481 The Butterworth method, like the Bessel-Thomson method to follow, yields only one approximation for each lter order and, therefore, the required transfer function is the one found in Example 10.1, part (a ). 10.4 CHEBYSHEV APPROXIMATION In the Butterworth approximation, the loss is an increasing monotonic function of , and as a result the passband characteristic is lopsided, as can be seen in Fig. 10.7. A more balanced characteristic can be achieved by employing the Chebyshev2 approximation in which the passband loss oscillates between zero and a prescribed maximum A p . In effect, the Chebyshev approximation leads to a so-called equiripple solution. 10.4.1 Derivation The loss characteristic in a fourth-order normalized Chebyshev approximation is of the form illustrated in Fig. 10.9, where p = 1. The loss is given by A() = 10 log L (2 ) 2.0 1.8 1.6 1.4 A(), dB 1.2 1.0 0.8 0.6 Ap 0.4 0.2 0 0 0.2 0.4 0.6 0.8 , rad/s 1 1.0 1.2 (10.22a) 01 02 p Figure 10.9 Loss characteristic of a fourth-order normalized Chebyshev lter. 2 Pafnuty Lvovitch Chebyshev (18211894) was a Russian mathematician who was born in Okatovo, a small town west of Moscow. In addition to his famous contribution to approximation theory, he contributed to number theory, integration, and probability theory, and studied the convergence of the Taylor series. 482 DIGITAL SIGNAL PROCESSING where L (2 ) = 1 + 2 F 2 () and 2 = 100.1 A p 1 (10.23) (10.22b) F (), L (2 ), and in turn L (s 2 ) are polynomials, and hence the normalized transfer function is of the form HN (s ) = H0 D (s ) where H0 is a constant. The derivation of HN (s ) involves three general steps: 1. The exact form of F () is deduced such that the desired loss characteristic is achieved. 2. The exact form of L (2 ) is obtained. 3. The zeros of L (s 2 ) and, in turn, the poles of HN (s ) are found. Close examination of the Chebyshev loss characteristic depicted in Fig. 10.9 reveals that F () and L (2 ) must have the following properties: Property 1: F () = 0 Property 2: F 2 () = 1 d L (2 ) =0 Property 3: d if = 01 , 02 if = 0, 1 , 1 if = 0, 01 , 1, 02 From Property 1, F () must be a polynomial of the form F () = M1 2 2 01 2 2 02 ( M1 , M2 , . . . , M7 represent miscellaneous constants in this analysis.) From Property 2, 1 F 2 () has zeros at = 0, 1 , 1. Furthermore, the derivative of 1 F 2 () with respect to , namely, 1 dL(2 ) d dF() [1 F 2 ()] = 2 F () = 2 d d d (10.24) has zeros at = 0, 01 , 1 , 02 , according to Property 3. Consequently, 1 F 2 () must have at least double zeros at = 0, 1 . Therefore, we can write 2 1 F 2 () = M2 2 2 2 (2 1) 1 APPROXIMATIONS FOR ANALOG FILTERS 483 Now from Eq. (10.24) and Properties 1 and 3, we get dF() 1 dL(2 ) =2 = M3 2 2 1 d 2 F () d By combining the above results, we can form the differential equation dF() d 2 = M4 [1 F 2 ()] 1 2 (10.25) which is the basis of the fourth-order Chebyshev approximation. The reader who is more interested in applying the Chebyshev approximation and less in its derivation can proceed to Sec. 10.4.3 where the general formulas for the n th-order Chebyshev approximation can be found. To continue with the derivation, Eq. (10.25) can be expressed in terms of denite integrals as F M5 0 dx + M6 = 1 x2 0 dy 1 y2 Hence, F and are interrelated by the equation M5 cos1 F + M7 = cos1 = i.e., for a given value of = cos and F = cos M7 M5 M5 (10.26) What remains to be done is to determine constants M5 and M7 . If = 0, then = /2; and if = 1, then = 0, as depicted in Fig. 10.10. Now, F will correspond to F () only if it has two zeros in the range 0 /2 (Property 1), and its magnitude is unity if = 0, /2 (Property 2). Thus F must be of the form illustrated in Fig. 10.10. As can be seen, for = 0 F = cos M7 M5 =1 or M7 = 0. In addition, one period of F must be equal to one-quarter period of , that is, 2 M 5 = 2 or M5 = 1 4 Therefore, the exact form of F () can be obtained from Eq. (10.26) as F () = cos(4 cos1 ) Alternatively, by expressing cos 4 in terms of cos , F () can be put in the form F () = 1 82 + 84 484 DIGITAL SIGNAL PROCESSING , F 02 1.0 F 01 0 4 2 1.0 Figure 10.10 Plots of and F versus . This polynomial is the fourth-order Chebyshev polynomial and is often designated as T4 ().3 Similarly, for an n th-order Chebyshev approximation, one can show that F () = Tn () = cos(n cos1 ) and hence from Eq. (10.22b) L (2 ) = 1 + 2 [cos(n cos1 )]2 (10.27) This relation gives the loss characteristic for || 1. For || > 1, the quantity cos1 becomes complex, i.e., cos1 = j and since = cos j = we have = cosh1 use of Tn for the representation of Chebyshev polynomials has to do with the German spelling of the great mathematicians name, i.e., Tchebyscheff [2], which does not appear to be in use nowadays. 3 The (10.28) 1 j( j) (e + e j ( j ) ) = cosh 2 APPROXIMATIONS FOR ANALOG FILTERS 485 Now from Eq. (10.28) cos1 = j cosh1 and cos(n cos1 ) = cos( jn cosh1 ) = cosh(n cosh1 ) Thus for || > 1, Eq. (10.27) becomes L (2 ) = 1 + 2 [cosh(n cosh1 )]2 In summary, the loss in a normalized lowpass Chebyshev approximation is given by A() = 10 log 1 + 2 Tn2 () where Tn () = cos(n cos1 ) cosh(n cosh1 ) for || 1 for || > 1 (10.30) (10.29) The loss characteristics for n = 4, A p = 1 dB and n = 7, A p = 0.5 dB are plotted in Fig. 10.11a . As can be seen A(0) = Ap 0 for even n for odd n as is generally the case in the Chebyshev approximation. As an aside, note that in Fig. 10.11a the number of stationary points is exactly equal to the order of the approximation, that is, 4 or 7 for a fourth- or seventh-order approximation. This is a general property of the Chebyshev approximation which is imposed by the formulation of the approximation problem. 10.4.2 Zeros of Loss Function 2 With = s / j , Eq. (10.29) becomes L (s 2 ) = 1 + 2 cosh n cosh1 and if si = i + j i is a zero of L (s 2 ), we can write u i + j vi = cosh1 ( j i + i ) j cosh[n (u i + j vi )] = From Eq. (10.31a) j i + i = cosh(u i + j vi ) = cosh u i cos vi + j sinh u i sin vi (10.31a) (10.31b) s j 486 DIGITAL SIGNAL PROCESSING 30 n=7 20 Loss, dB 10 1.6 0 60 20 1.0 n=7 0 0 0.2 0.4 1.0 , rad/s (b) 2.0 4.0 0 10.0 Loss, dB 40 n=4 Loss, dB 1.0 0 0 0.4 0.8 , rad/s (a) 1.2 n=4 Figure 10.11 (a) Typical loss characteristics for Chebyshev lters (n = 4, A p = 1.0 dB and n = 7, A p = 0.5 dB), (b) typical loss characteristics for inverse-Chebyshev lters (n = 4, Aa = 40 dB and n = 7, Aa = 50 dB). Loss, dB APPROXIMATIONS FOR ANALOG FILTERS 487 or i = sinh u i sin vi and i = cosh u i cos vi Similarly, from Eq. (10.31b) cosh nu i cos n vi + j sinh nu i sin n vi = or cosh nu i cos n vi = 0 and sinh nu i sin n vi = The solution of Eq. (10.34a) is vi = (2i 1) 2n for i = 1, 2, . . . , n (10.35a) 1 (10.34b) (10.34a) j (10.33) (10.32) and since sin(n vi ) = 1, Eq. (10.34b) yields 1 1 u i = u = sinh1 n Therefore, from Eqs. (10.32), (10.33), (10.35a), and (10.35b) i = sinh i = cosh for i = 1, 2, . . . , n . Evidently, i2 i2 + =1 2 sinh u cosh2 u i.e., the zeros of L (s 2 ) are located on an ellipse, as depicted in Fig. 10.12. 1 1 sinh1 n 1 1 sinh1 n sin cos (2i 1) 2n (10.36a) (10.36b) (10.35b) (2i 1) 2n 488 DIGITAL SIGNAL PROCESSING 1.2 1.0 0.8 0.6 0.4 0.2 jIm s 0 0.2 0.4 0.6 0.8 1.0 1.2 0.5 0 Re s (a) 0.5 1.2 1.0 0.8 0.6 0.4 0.2 jIm s 0 0.2 0.4 0.6 0.8 1.0 1.2 0.5 0 Re s (b) 0.5 Figure 10.12 Zero-pole plot of L (s 2 ) for Chebyshev lter: (a ) n = 5, A p = 1 dB, (b) n = 6, A p = 1 dB. APPROXIMATIONS FOR ANALOG FILTERS 489 10.4.3 Normalized Transfer Function The normalized transfer function HN (s ) can at this point be formed by identifying the left-half s -plane zeros of the loss function, which happen to be the poles of the transfer function, as HN (s ) = = where r i (s D (s ) D (s ) H0 pi )(s pi ) H0 2 Re( pi )s + | pi |2 ] (10.37a) (10.37b) r2 i [s n 1 2 r= n 2 for odd n and for even n D0 (s ) = s p0 1 for odd n for even n The poles and multiplier constant, H0 , can be calculated by using the following formulas in sequence: = 100.1 A p 1 (10.38) p0 = (n +1)/2 with (n +1)/2 = sinh 1 1 sinh1 n (10.39) (10.40) pi = i + j i for i = 1, 2, . . . , r (2i 1) 2n (10.41) with i = sinh i = cosh 1 1 sinh1 n 1 1 sinh1 n sin cos (10.42a) (10.42b) (2i 1) 2n and H0 = p0 10 r i =1 | pi |2 r i =1 for odd n | pi | 2 0.05 A p for even n (10.43) In the above formulation, constant H0 is chosen to yield zero minimum passband loss. Formulas for the required hyperbolic functions and their inverses can be found in Sec. A.3.4. 490 DIGITAL SIGNAL PROCESSING Example 10.3 Obtain a fourth-order normalized Chebyshev approximation assuming a maximum passband loss of A p = 1.0 dB. Solution From Eq. (10.23) 1 1 =x= = 1.965227 0.1 1 10 and sinh1 1 = ln(x + x 2 + 1) = 1.427975 Hence, Eqs. (10.42a) and (10.42b) give (2i 1) 8 (2i 1) i = 1.064402 cos 8 i = 0.364625 sin and from Eqs. (10.41) and (10.43), the poles and multiplier constant can be obtained as p1 , p1 = 0.139536 j 0.983379 p2 , p2 = 0.336870 j 0.407329 2 H0 = 100.051 i =1 | pi |2 = 0.245653 Since D0 (s ) = 1 for an even-order Chebyshev approximation, Eq. (10.37b) gives the required transfer function as 2 HN (s ) = H0 i =1 1 s 2 + b1i s + b0i where b01 = 0.986505 b02 = 0.279398 b11 = 0.279072 b12 = 0.673740 10.4.4 Minimum Filter Order In a normalized lowpass Chebyshev transfer function, the passband edge is xed at p = 1 rad/s and an arbitrary maximum passband loss A p dB can be achieved. Since the stopband loss is an increasing monotonic function of frequency as can be seen in Fig. 10.11a , the minimum stopband loss occurs APPROXIMATIONS FOR ANALOG FILTERS 491 at the stopband edge. From Eq. (10.30), we have A(a ) = 10 log 1 + 2 Tn2 (a ) = 10 log 1 + 2 cosh n cosh1 a 2 (10.44) Since the minimum stopband loss must be equal to or exceed Aa , we have 10 log {1 + 2 [cosh (n cosh1 a )]2 } Aa 1 + 2 [cosh (n cosh1 a )]2 100.1 Aa 100.1 Aa 1 cosh (n cosh1 a ) and on eliminating using Eq. (10.23) and then solving for n , we obtain cosh1 D n cosh1 a where D= 100.1 Aa 1 100.1 A p 1 (10.45b) (10.45a) The required lter order is the lowest integer that would satisfy the above inequality. Once the lter order is determined, the actual minimum stopband loss can be obtained by substituting back the lter order in Eq. (10.44). Example 10.4 An application calls for a normalized lowpass Chebyshev lter that would satisfy the following specications: Passband edge p : 1.0 rad/s Stopband edge a : 2.0 rad/s Maximum passband loss A p : 0.1 dB Minimum stopband loss Aa : 34.0 dB (a ) Find the minimum lter order. (b) Obtain the required transfer function. (c) Calculate the actual minimum stopband loss. Solution (a ) From Eq. (10.45b) D= Hence, Eq. (10.45a) gives n cosh1 100.134 1 = 1.077958 105 100.10.1 1 1.077958 105 = 4.93 5 cosh1 2.0 492 DIGITAL SIGNAL PROCESSING (b) From Eq. (10.38), we have = and 100.10.1 1 = 0.152620 sinh1 1 = ln(x + or 1 = x = 6.552203 x 2 + 1) = 2.578722 From Eqs. (10.40) and (10.41), we get 3 = 0.538914 and (2i 1) 10 (2i 1) i = 1.135970 cos 10 i = 0.5389143 sin Thus Eqs. (10.39), (10.41), and (10.43) give the poles and multiplier constant as p0 = 0.538914 p1 , p1 = 0.166534 j 1.080372 p2 , p2 = 0.435991 j 0.667707 2 H0 = p0 i =1 | pi |2 = 0.409513 Therefore, from Eq. (10.37b) the required transfer function is obtained as H0 HN (s ) = s + b00 where b00 = 0.538914 b01 = 1.194937 b02 = 0.635920 b11 = 0.333067 b12 = 0.871982 2 i =1 1 s 2 + b1i s + b0i (c) The actual minimum stopband loss can be obtained by evaluating the stopband loss at the stopband edge using the actual lter order. From Eq. (10.44), we get A(a ) = 10 log {1 + (0.152620)2 [cosh (5 cosh1 2.0)]2 } = 34.85 dB APPROXIMATIONS FOR ANALOG FILTERS 493 10.5 INVERSE-CHEBYSHEV APPROXIMATION A closely related approximation to the above is the inverse-Chebyshev approximation. This can actually be derived from the Chebyshev approximation but the derivation is left as an exercise to the reader (see Prob. 10.12). The passband loss in the inverse-Chebyshev is very similar to that of the Butterworth approximation, i.e., it is an increasing monotonic function of , while the stopband loss oscillates between innity and a prescribed minimum loss Aa , as depicted in Fig. 10.11b. The loss is given by A() = 10 log 1 + where 2 = and the stopband extends from = 1 to . 1 100.1 Aa 1 (10.47) 1 2 Tn2 (1/) (10.46) 10.5.1 Normalized Transfer Function The normalized transfer function has a number of zeros on the j axis in this case and is given by HN (s ) = H0 D0 (s ) H0 D0 (s ) H0 D0 (s ) r i =1 r i =1 r i =1 (s 1/z i )(s 1/z i ) (s 1/ pi )(s 1/ pi ) s 2 2 Re s 2 2 Re s2 + s 2 2 Re 1 zi 1 pi (10.48a) = s+ s+ 1 |z i |2 1 | pi |2 (10.48b) = where 1 |z i |2 1 pi s+ 1 | pi |2 (10.48c) r= and D0 (s ) = n 1 2 n 2 for odd n for even n (10.48d) s 1 1 p0 for odd n for even n (10.48e) If the lter order n and minimum stopband loss Aa are known, the multiplier constant H0 and zeros and poles or transfer function coefcient can be obtained by using the following formulas in sequence: = 1 100.1 Aa 1 (10.49) 494 DIGITAL SIGNAL PROCESSING z i = j cos (2i 1) 2n for 1, 2, . . . , r (10.50) (10.51) p0 = (n +1)/2 with (n +1)/2 = sinh pi = i + j i with i = sinh i = cosh and H0 = 1 1 sinh1 n for 1, 2, . . . , r sin cos (2i 1) 2n (10.52) (10.53) (10.54a) (10.54b) 1 1 sinh1 n 1 1 sinh1 n r |z i |2 i =1 | pi |2 (2i 1) 2n for odd n 1 p0 r | z i |2 i =1 | pi |2 (10.55) for even n The derivation of HN (s ) is left as an exercise for the reader (see Prob. 10.9). 10.5.2 Minimum Filter Order In a normalized lowpass inverse-Chebyshev transfer function, the stopband edge is xed at a = 1 rad/s and an arbitrary minimum stopband loss Aa dB can be achieved for any given order. The minimum lter order is thus determined by the maximum loss allowed in the passband, namely, A p dB. The highest passband loss occurs at the passband edge and from Eq. (10.46) A( p ) = 10 log 1 + = 10 log 1 + 1 2 Tn2 (1/ p ) 2 [cosh (n 1 cosh1 1/ p )]2 (10.56) Hence, the minimum lter order must satisfy the inequality 10 log 1 + and if we solve for n , we obtain n where 100.1 Aa 1 (10.57b) 100.1 A p 1 The minimum lter order is the lowest integer that would satisfy the above inequality. The actual maximum passband loss can be obtained by substituting the lter order obtained back in Eq. (10.56). D= 2 [cosh (n 1 Ap cosh1 1/ p )]2 cosh1 D cosh1 (1/ p ) (10.57a) APPROXIMATIONS FOR ANALOG FILTERS 495 Example 10.5 An application requires a normalized lowpass inverse-Chebyshev lter that would satisfy the following specications: Passband edge p : 0.6 rad/s Stopband edge a : 1.0 rad/s Maximum passband loss A p : 1.0 dB Minimum stopband loss Aa : 35.0 dB (a ) Find the minimum lter order. (b) Obtain the required transfer function. (c) Calculate the actual maximum passband loss. Solution (a ) From Eq. (10.57b) D= 100.135.0 1 = 1.2209 104 100.11.0 1 Hence, Eq. (10.57a) yields cosh1 1.2209 104 5.3981 = 4.9136 5 n = 1.0986 cosh1 016 . (b) From Eqs. (10.48d) and (10.48e), we have r = (n 1)/2 = 2 and from Eqs. (10.49)(10.55), we get 1 = 0.017786 = 0.135.0 1 10 1 1 sinh1 3 = sinh = 1.091354 5 0.017786 (2i 1) 10 1 1 sinh1 i = sinh 5 0.017786 z i = j cos = 1.091354 sin i = cosh (2i 1) 10 1 1 sinh1 5 0.017786 (2i 1) 10 and D0 (s ) = s 1/ p0 sin (2i 1) 10 cos (2i 1) 2n = 1.480221 cos 496 DIGITAL SIGNAL PROCESSING Hence, p0 = 3 = 1.091354 = j 0.951057 z 1 = j cos 10 3 z 2 = j cos = j 0.587785 10 + j 1.480221 cos p1 = 1.091354 sin 10 10 = 0.337247 + j 1.407774 3 3 + j 1.480221 cos p2 = 1.091354 sin 10 10 = 0.882924 + j 0.870052 Therefore, the transfer function in Eq. (10.48c) assumes the form HN (s ) = H0 s 2 + s 1 3 1 | z 1 |2 s2 + 1 |z 2 |2 1 p2 s 2 2 Re 1 p1 s+ 1 | p1 |2 s 2 2 Re s+ 1 | p 2 |2 = where a01 = b00 b01 H0 (s 2 + a01 )(s 2 + a02 ) (s + b00 )(s 2 + b11 s + b01 )(s 2 + b12 s + b02 ) 1 = 2.894427 |z 2 |2 1 = 1.105573 |z 1 |2 1 = = 0.916293 3 1 = = 0.477199 | p1 |2 1 = 0.650811 | p2 |2 1 p0 2 i =1 a02 = b11 = 2 Re b12 = 2 Re 1 p1 1 p2 = 0.321868 = 1.149232 b02 = H0 = |z i |2 | pi |2 = 0.088928 (c) From Eq. (10.56), the maximum passband loss can be determined by evaluating the loss at the passband edge as A( p ) = 10 log 1 + = 0.8427 dB 1 0.0177862 cosh 5 cosh1 1 0.6 2 APPROXIMATIONS FOR ANALOG FILTERS 497 10.6 ELLIPTIC APPROXIMATION The Chebyshev approximation yields a much better passband characteristic and the inverseChebyshev approximation yields a much better stopband characteristic than the Butterworth approximation. A lter with an improved passband as well as an improved stopband loss characteristic can be obtained by using the elliptic approximation in which the passband loss oscillates between zero and a prescribed maximum A p and the stopband loss oscillates between innity and a prescribed minimum Aa . The elliptic approximation is more efcient than the preceding two in that the transition between passband and stopband is steeper for a given approximation order. Our approach to this approximation follows the formulation of Grossman [9], which, although involved, is probably the simplest available. The approach taken is rst to deduce the fth-order approximation and then generalize the results obtained to the n th odd-order approximation. After that the n th even-order approximation is given without the derivation. The section concludes with a practical procedure for obtaining elliptic transfer functions that would satisfy prescribed lter specications. 10.6.1 Fifth-Order Approximation The loss characteristic in a fth-order normalized elliptic approximation is of the form depicted in Fig. 10.13, where 1 p = k a = c = a p = 1 k The constants k and k1 given by k= and k1 = 100.1 A p 1 100.1 Aa 1 1/2 p a (10.58) are the selectivity factor and discrimination factor, respectively. The loss is given by A() = 10 log L (2 ) where L (2 ) = 1 + 2 F 2 () and 2 = 100.1 A p 1 (10.60) (10.59) Function F () and in turn L (2 ), L (s 2 ), and H (s ), which are polynomials in the Chebyshev approximation, are ratios of polynomials in the case of the elliptic approximation. According to the elliptic loss characteristic of Fig. 10.13, the prerequisite properties of F () and L (2 ) are as follows: 498 DIGITAL SIGNAL PROCESSING A() Aa Ap 1 01 2 1 2 1 02 p 2 a Figure 10.13 Loss characteristic of a fth-order elliptic lter. Property 1: Property 2: Property 3: Property 4: Property 5: F () = 0 F () = F 2 () = 1 1 F 2 () = 2 k1 dL (2 ) =0 d if = 0, 01 , 02 if = , 1 , 2 if = 1 , 2 , k 1 if = 1 , 2 , k if = 1 , 2 , 1 , 2 By using each and every one of these properties we shall attempt to derive the exact form of F (). The approach is analogous to that used earlier in the Chebyshev approximation.4 From Properties 1 and 2, we obtain F () = M1 2 2 2 2 01 02 2 2 1 2 2 2 (10.61) DSP practitioner who is more interested in applying the elliptic approximation and less so in its derivation may proceed to Sec. 10.6.6 for the outcome of this exercise in mathematics. 4 The APPROXIMATIONS FOR ANALOG FILTERS 499 ( M1 to M7 represent miscellaneous unknown constants that arise in the formulation of the problem at hand). Similarly, from Properties 2 and 3, we can write 1 F () = 2 M2 2 2 1 2 2 2 2 2 (2 k ) 2 2 2 1 2 2 2 2 where the double zeros at = 1 , 2 are due to Property 5 (see Sec. 10.4.1). Similarly, from Properties 2, 4, and 5 2 1 k1 F 2 () = M3 2 2 1 2 2 2 2 2 (2 1/ k ) 2 2 2 1 2 2 2 2 and from Property 5 M4 2 2 2 2 2 2 2 2 dF () 1 2 1 2 = 2 2 2 2 2 2 d 1 2 By combining the above results, we can form the important relation d F () d Alternatively, we can write F 0 2 = 2 M5 [1 F 2 ()][1 k1 F 2 ()] (1 2 / k )(1 k 2 ) (10.62) dx 2 (1 x 2 ) 1 k1 x 2 = M5 0 dy (1 y 2 / k )(1 ky 2 ) + M7 and if y = ky , y = y F 0 dx (1 x 2 )(1 2 k1 x 2 ) = M6 0 / k dy (1 y 2 )(1 k2 y2) + M7 These are elliptic integrals of the rst kind, and they can be put in the more convenient form 1 0 d 1 2 1 k1 sin2 1 = M6 0 d 1 k 2 sin2 + M7 by using the transformations x = sin 1 F = sin 1 y = sin = sin k 500 DIGITAL SIGNAL PROCESSING The above two integrals can assume complex values if complex values are allowed for 1 and . By letting 0 d 1 k 2 sin2 =z where z = u + j v the solution of the differential equation in Eq. (10.62) can be expressed in terms of a pair of simultaneous equations as = sin = sn (z , k ) (10.63) k (10.64) F = sin 1 = sn ( M6 z + M7 , k1 ) The entities at the right-hand side are elliptic functions. Further progress in this analysis can be made by using the properties of elliptic functions as detailed in Appendix B. As demonstrated in Sec. B.7, Eq. (10.63) is a transformation that maps trajectory ABC D in Fig. 10.14a onto the positive real axis of the plane, as depicted in Fig. 10.14b. Since the behavior jv z plane jK' D C A 2K 5 4K 5 B K (a) u j Im plane A' B' 1 k 01 02 C' Re 1 k D' 2 1 (b) Figure 10.14 Mapping properties of Eq. (10.63). APPROXIMATIONS FOR ANALOG FILTERS 501 of F () is known for all real values of , constants M6 and M7 can be determined. In turn, the exact form of F () can be derived. If z = u and 0 u K (domain 1 in Sec. B.7), Eqs. (10.63) and (10.64) become = k sn(u , k ) (10.65) (10.66) F = sn ( M6 u + M7 , k1 ) where and F have real periods of 4 K and 4 K 1 / M6 , respectively (see Sec. B.6). If = 0, then u = 0; and if = k , then u = K , as illustrated in Fig. 10.15. Now, F will correspond to F () if it has zeros at u = 0 and at two other points in the range 0 < u K (Property 1), and its magnitude is unity at u = K (Property 3). Consequently, F must be of the form illustrated in Fig. 10.15. Clearly, for u = 0 F = sn ( M7 , k1 ) = 0 or M7 = 0. Furthermore, ve quarter periods of F must be equal to one quarter period of , that is, M6 = 5K1 K , F 1.0 F 02 01 0.5 k 0 K 5 3K 5 u K 0.5 1.0 Figure 10.15 Plots of and F versus u . 502 DIGITAL SIGNAL PROCESSING and so from Eq. (10.66) F = sn Now F has z -plane zeros at u= 2K i 5 for i = 0, 1, 2 5K1u , k1 K and, therefore, F () must have -plane zeros (zero-loss frequencies) at 0i = 2K i k sn ,k 5 for i = 0, 1, 2 according to Eq. (10.65) (see Fig. 10.14). If z = u + j K and 0 u K (domain 3 in Sec. B.7), Eqs. (10.63) and (10.64) assume the form = F = sn 1 k sn (u , k ) 5 K 1 (u + j K ) , k1 K (10.67) (10.68) If = , u = 0 and F must be innite (Property 2), that is, F = sn and from Eq. (B.19) F= Hence, it is necessary that cn and, therefore, the relation K 5K =1 K K1 (10.69) 5K1 K , k1 K =0 j sn (5 K 1 K / K , k1 ) = cn (5 K 1 K / K , k1 ) where k1 = 2 1 k1 j 5K1 K , k1 K = must hold. The quantities K , K are functions of k , and similarly K 1 , K 1 are functions of k1 ; in turn, k1 is a function of A p and Aa by denition. In effect, Eq. (10.69) constitutes an implicit constraint among lter specications. We shall assume here that Eq. (10.69) holds. The implications of this assumption will be examined at a later point. APPROXIMATIONS FOR ANALOG FILTERS 503 With Eq. (10.69) satised, Eq. (10.68) becomes F = sn and after some manipulation F= Evidently, F = if u = 2 K i /5 that is, F has poles at z= 2K i + jK 5 for i = 0, 1, 2 for i = 0, 1, 2 (10.70) 1 k1 sn(5 K 1 u / K , k1 ) 5K1 u + j K 1 , k1 K as depicted in Fig. 10.14, and since line CD maps onto line C D , F corresponds to F (). That is, F () has two poles in the range 1/ k < and one at = (Property 2). The poles of F () (innite-loss frequencies) can be obtained from Eqs. (10.67) and (10.70) as i 1 = k sn (2 K i /5, k ) for i = 0, 1, 2 Therefore, the innite-loss frequencies are the reciprocals of the zero-loss frequencies, i.e., i = 1 0i and by eliminating i in Eq. (10.61), we have F () = M1 2 2 2 01 1 2 2 1 2 01 2 02 2 02 (10.71) The only unknown at this point is constant M1 . With z = K + j v and 0 v K (domain 2 in Sec. B.7), Eqs. (10.63) and (10.64) can be put in the form k = dn(v, k ) and F = sn 5 K 1( K + j v) , k1 K If = 1, then v = K /2 and F (1) = M1 , according to Eq. (10.71). Hence, M1 = sn 5 K 1 + j 5K K1 , k1 2K or M1 = sn K 1 + jK 1 , k1 2 504 DIGITAL SIGNAL PROCESSING according to Eqs. (10.69) and (B.8) and after some manipulation, we get M1 = 1 1 = dn( K 1 /2, k1 ) k1 10.6.2 N th-Order Approximation (n Odd) For an n th-order approximation with n odd, constant M7 in Eq. (10.64) is zero, and n quarter periods of F must correspond to one quarter period of , that is, M6 = Therefore, Eq. (10.64) assumes the form F = sn where the relation nK K =1 K K1 must hold. The expression for F () can be shown to be F () = where r= = 2K i ,k n n1 2 for i = 1, 2, . . . , r (1)r k1 r i =1 n K1 K n K1z , k1 K (10.72) 2 1 2 2 i 2 i and i k sn 10.6.3 Zeros and Poles of L(s 2 ) The next task is to determine the zeros and poles of L (s 2 ). From Eqns. (10.59) and (10.72), the z -domain representation of the loss function can be expressed as L (z ) = 1 + 2 sn2 and by factorizing L (z ) = 1 + j sn n K1z , k1 K 1 j sn n K1z , k1 K n K1z , k1 K APPROXIMATIONS FOR ANALOG FILTERS 505 If z 1 is a root of the rst factor, z 1 must be a root of the second factor since the elliptic sine is an odd function of z . Consequently, the zeros of L (z ) can be determined by solving the equation sn n K1z , k1 K = j In practice, the value of k1 is very small. For example, k1 0.0161 if A p 1 dB and Aa 30 dB and decreases further if A p is reduced or Aa is increased. We can thus assume that k1 = 0, in which case sn n K1z ,0 K = sin n K1z j = K where K 1 = /2, according to Eq. (B.2). Alternatively, j and on using the identity sinh1 x = ln (x + and Eq. (10.60), we obtain one zero of L (z ) as z 0 = j v0 where v0 = 100.05 A p + 1 K ln 0.05 A p n 10 1 x 2 + 1) n z 1 = sinh1 2K Now sn (n K 1 z / K , k1 ) has a real period of 4 K / n , and as a result all z i given by zi = z0 + 4K i n for i = 0, 1, 2, . . . must also be zeros of L (z ). The zeros of L (2 ) can be deduced by using the transformation between the z and planes, namely, Eq. (10.63). In turn, the zeros of L (s 2 ) can be obtained by letting = s / j . For i = 0, there is a real zero of L (s 2 ) at s = 0 , where 0 = j k sn ( j v0 , k ) and for i = 1, 2, . . . , n 1 there are n 1 distinct complex zeros at s = i + j i , where 4K i ,k i + j i = j k sn j v0 + n (10.74) (10.73) 506 DIGITAL SIGNAL PROCESSING The remaining n zeros are negatives of zeros already determined. For n = 5, the required values of the elliptic sine are sn j v0 + sn j v0 + sn j v0 + sn j v0 + 4K 5 8K 5 = sn j v0 + 2 K = sn j v0 + 2 K + = sn j v0 + 4 K 2K 5 2K 5 4K 5 = sn j v0 = sn j v0 + = sn j v0 2K 5 2K 5 12 K 5 16 K 5 4K 5 Hence, Eq. (10.74) can be put in the form 2K i ,k i + j i = j k (1)i sn j v0 5 Similarly, for any odd value of n 2K i ,k i + j i = j k (1)i sn j v0 n for i = 1, 2, . . . , n1 2 for i = 1, 2 Now with the aid of the addition formula (see Sec. B.5) we can show that i + j i = where W= Vi = i 2 1 + k 0 (1)i 0 Vi j 2 1 + 0 i2 iW for i = 1, 2, . . . , n1 2 1+ 1 2 0 k 2 i (10.75) 1k k sn 2 i k (10.76) (10.77) = 2K i ,k n A complete description of L (s 2 ) is available at this point. It has zeros at s = 0 , (i + j i ) and double poles at s = j / i , which can be evaluated by using the series representation of elliptic functions given in Sec. B.8. From Eq. (10.73) and (B.30), we have 0 = 2q 1/4 =0 (1)m q m (m +1) sinh [(2m + 1) ] m 1 + 2 =1 (1)m q m 2 cosh 2m m (10.78) APPROXIMATIONS FOR ANALOG FILTERS 507 where = 1 100.05 A p + 1 ln 0.05 A p 2n 10 1 q = e K / K Similarly, from Eqs. (10.77) and (B.30) i The parameter q , which is known as the modular constant, is given by (10.79) = 2q 1/4 1+ m m (m +1) sin (2m +1) i m =0 (1) q n 2 2 m =1 (1)m q m cos 2m i n (10.80) for i = 1, 2, . . . , (n 1)/2. The modular constant q can be determined by evaluating K and K numerically. A quicker method, however, is to use the following procedure. Since dn(0, k ) = 1, Eq. (B.32) gives 1 2q + 2q 4 2q 9 + k= 1 + 2q + 2q 4 + 2q 9 + Now, q < 1 since K , K > 0, and hence a rst approximation for q is 1 1 k q0 = 2 1+ k By eliminating k using Eq. (10.81), rationalizing, and then performing long division we have q q0 + 2q 5 5q 9 + 10q 13 Thus, if qm 1 is an approximation for q 5 9 13 qm q0 + 2qm 1 5qm 1 + 10qm 1 (10.81) is a better approximation. By using this recursive relation repeatedly we can show that 5 9 13 q q0 + 2q0 + 15q0 + 150q0 Since k is known, the quantities k , q0 , q , 0 , i , i , and i can be evaluated. Subsequently, the normalized transfer function HN (s ) can be formed. 10.6.4 N th-Order Approximation (n Even) So far we have been concerned with odd-order approximations. However, the results can be easily extended to the case of even n . Function F is of the form F = sn n K1 z + K 1 , k1 K 508 DIGITAL SIGNAL PROCESSING where the relation K nK =1 K K1 must again hold. The expression for F () in this case is given by (1)r F () = k1 where r= n 2 and i r i =1 2 1 2 2 i 2 i = k sn (2i 1) K ,k n for i = 1, 2, . . . , r The zeros of L (s 2 ) are si = (i + j i ) where i + j i = [0 Vi + j (1)i 2 1 + 0 i2 iW] The parameters W , Vi , and 0 are given by Eqs. (10.75), (10.76), and (10.78), as in the case of odd n , and the values of i can be computed by replacing i by i 1 in the right-hand side of Eq. (10.80). 2 10.6.5 Specication Constraint The results of the preceding sections are based on the assumption that the relation K nK =1 K K1 (10.82) holds. As pointed out earlier, this equation constitutes a constraint among lter specications of the form f 1 (n , k ) = f 2 ( A p , Aa ) Consequently, if three of the four parameters are specied, the fourth is automatically xed. It is thus of interest to put Eq. (10.82) in a more useful form that can be used to evaluate the corresponding fourth parameter. From the denition of the elliptic sine sn ( K 1 , k1 ) = 1 and from Eq. (B.30) k 1 = 4 q1 2 6 1 + q1 + q1 + 4 1 + 2q1 + 2q1 + 2 where q1 = e K 1 / K 1 APPROXIMATIONS FOR ANALOG FILTERS 509 In practice, k1 is close to zero, k1 is close to unity, K 1 / K 1 is large, and, as a result, q1 we can assume that k 1 4 q1 or 2 k1 = 16q1 = 16e K 1 / K 1 1. Hence, By eliminating K 1 / K 1 , using Eq. (10.82), we have 2 k1 = 16e n K / K and from Eq. (10.79) 2 k1 = 16q n Therefore, from Eq. (10.58) the desired formula is 100.1 A p 1 = 16q n 100.1 Aa 1 If n , k , and A p are specied, the resulting minimum stopband loss is given by Aa = 10 log 100.1 A p 1 +1 16q n (10.84) (10.83) The minimum stopband loss Aa is plotted versus k in Fig. 10.16a for various values of A p in the range 0.125 A p 5 dB. On the other hand, Fig. 10.16b shows Aa versus k for various values of n in the range 2 n 10. We note in Fig. 10.16a and b that for a xed maximum passband loss or a xed lter order, the minimum stopband loss is reduced if we attempt to increase the selectivity, i.e., make the transition characteristic between the passband and stopband steeper. Alternatively, if k , Aa , and A p are specied, the required approximation order must satisfy the inequality n log 16 D log (1/q ) where D = 100.1 Aa 1 100.1 A p 1 10.6.6 Normalized Transfer Function The results obtained through the previous mathematical roller coaster can now be summarized in laymans language for the DSP practitioner. An elliptic normalized lowpass lter with a selectivity factor k , a maximum passband loss of A p dB, and a minimum stopband loss equal to or in excess of Aa dB has a transfer function of the form HN (s ) = H0 D0 (s ) r i =1 s2 s 2 + a0i + b1i s + b0i (10.85) 510 DIGITAL SIGNAL PROCESSING 80 n =5 70 60 50 Aa, dB 40 30 20 10 0 Ap = 0.125 0.25 0.5 1.0 2.0 dB 0.5 0.6 0.7 k (a) 0.8 0.9 1.0 140 Ap = 0.5 dB 120 100 80 60 40 20 0 n = 10 n=8 Aa, dB n=6 n=4 n=2 0.5 0.6 0.7 k (b) 0.8 0.9 1.0 Figure 10.16 4, 6, 8, 10. Plots of Aa versus k : (a ) n = 5, A p = 0.125, 0.25, 0.5, 1.0, 2.0 dB, (b) A p = 0.5 dB, n = 2, APPROXIMATIONS FOR ANALOG FILTERS 511 where n1 2 r= n 2 D0 (s ) = s + 0 1 for odd n for even n for odd n for even n and The transfer-function coefcients and multiplier constant H0 can be computed by using the following formulas in sequence: 1 k2 1 1 k q0 = 2 1+ k 5 9 13 q = q0 + 2q0 + 15q0 + 150q0 k= (10.86) (10.87) (10.88) (10.89) (10.90) (10.91) 1) ] (10.92) D= 100.1 Aa 1 100.1 A p 1 log 16 D n log(1/q ) = 100.05 A p + 1 1 ln 0.05 A p 2n 10 1 2q 1/4 1 m m (m +1) sinh [(2m + m =0 (1) q m q m 2 cosh 2m + 2 m =1 (1) 0 = W= = 2 1 + k 0 1+ 2 0 k (10.93) (10.94) 2q 1/4 1+ i m m (m +1) sin (2m +1) m =0 (1) q n 2 =1 (1)m q m 2 cos 2mn m where = Vi = a0i = b0i = 1 2 i i i 1 2 2 i for odd n for even n 1 2 i i = 1, 2, . . . , r (10.95) (10.96) 1k k (0 Vi )2 + ( 2 1 + 0 2 iW) 2 2 i (10.97) 512 DIGITAL SIGNAL PROCESSING b1i = 20 Vi 2 1 + 0 i2 0 r b0i i =1 a0i H0 = 100.05 A p r b0i i =1 a0i (10.98) for odd n (10.99) for even n The actual minimum stopband loss is given by Eq. (10.84). The series in Eqs. (10.92) and (10.94) converge rapidly, and three or four terms are sufcient for most purposes. Example 10.6 An elliptic lter is required satisfying the following specications: Passband edge p : 0.9 rad/s Stopband edge a : 1/ 0.9 rad/s Maximum passband loss A p : 0.1 dB Minimum stopband loss Aa : 50.0 dB Form HN (s ). Solution From Eqs. (10.86)(10.90) k = 0.9 q = 0.102352 k = 0.435890 D = 4,293,090 q0 = 0.102330 n 7.92 or n=8 From Eqs. (10.91)(10.99) the transfer-function coefcients in Table 10.1 can be obtained. The corresponding loss characteristic is plotted in Fig. 10.17. The actual value of Aa is 50.82 dB according to Eq. (10.84). Table 10.1 i a0i Coefcients of HN (s ) (Example 10.6) b0i b1i 1 8.711574 E 1 4.729136 E 1 1.825141 E 1 4.471442 E 1 1 1 2 1 1.434825 E + 1 2.914919 E 2 2.231643 6.123726 E 3 1.320447 8.397386 E 4 1.128832 9.264592 E H0 = 2.876332 E 3 APPROXIMATIONS FOR ANALOG FILTERS 513 60 50 40 A(), dB 30 20 0.1 0 0 0.5 1.0 1.5 , rad/s 2.0 2.5 3.0 Figure 10.17 Loss characteristic of an eighth-order, elliptic lter (Example 10.6). 10.7 BESSEL-THOMSON APPROXIMATION Ideally, the group delay of a lter should be independent of frequency, or, equivalently, the phase shift should be a linear function of frequency to minimize delay distortion (see Sec. 5.7). Since the only objective in the preceding three approximations is to achieve a specic loss characteristic, there is no reason for the phase characteristic to turn out to be linear. In fact, it turns out to be nonlinear as one might expect. Consequently, the delay tends to vary with frequency, in particular in the elliptic approximation. Consider the transfer function H (s ) = b0 n i i =0 bi s = b0 s n B (1/s ) (10.100) where bi = 2n i i !(n (2n i )! i )! (10.101) Function B (s ) is a Bessel polynomial, and s n B (1/s ) can be shown to have zeros in the left-half s plane. B (1/ j ) can be expressed in terms of Bessel functions [2, 10] as B 1 j = 1 jn [(1)n Jv () j Jv ()]e j 2 514 DIGITAL SIGNAL PROCESSING where v = n + 1 2 and i =0 Jv () = v (1)i 2i 22i +v i ! (v + i + 1) (10.102) ( () is the gamma function). Hence, from Eq. (10.100) 2 2b0 2 2 Jv () + Jv () | H ( j )|2 = 2n +1 () = + tan1 () = (1)n Jv () Jv () (1)n Jv Jv Jv Jv d () =1 2 2 d Jv () + Jv () Alternatively, from the properties of Bessel functions and Eq. (10.102) [2] 2(n 1) 4 2 + + 2n 1 (2n 1)2 (2n 3) 2n | H ( j )|2 2 b0 | H ( j )|2 = 1 () = 1 (10.103) (10.104) Clearly, as 0, | H ( j )| 1 and () 1. Furthermore, the rst n 1 derivatives of () with respect to 2 are zero if = 0, which makes the approximation maximally at at the origin. This means that there is some frequency range 0 < p for which the delay is approximately constant. On the other hand, if , | H ( j )| 1/( j )n 0 and, therefore, H (s ) is a lowpass constant-delay approximation. This is sometimes referred to as the Bessel approximation since it uses a Bessel function. However, the possibility of using the function in Eq. (10.100) as a normalized lowpass approximation with a maximally at group delay at he origin was proposed by Thomson [6] and its correct name should, therefore, be the Bessel-Thomson approximation. Note that the formulas in Eqs. (10.103) and (10.104) are used here to demonstrate the maximally at property of the group delay and have no other practical usefulness. For any other purpose, the amplitude and phase responses or the loss and delay characteristics should be obtained by using the transfer function in Eq. (10.100). The Bessel-Thomson approximation has a normalized group delay of 1 s. However, any other delay can be achieved by replacing s by 0 s in Eq. (10.100). Typical loss and group-delay characteristics for the Bessel-Thomson approximation are plotted in Fig. 10.18 and 10.19, respectively. APPROXIMATIONS FOR ANALOG FILTERS 515 30 25 20 Loss, dB 15 n=9 10 n=6 5 n=3 0 0 1 2 3 , rad/s 4 5 6 Figure 10.18 Loss characteristics of normalized Bessel-Thomson lowpass lters: n = 3, 6, 9. 1.2 1.0 n=9 n=6 0.8 , s 0.6 n=3 0.4 0.2 0 0 1 2 3 , rad/s 4 5 6 Figure 10.19 Delay characteristics of normalized Bessel-Thomson lowpass lters: n = 3, 6, 9. 516 DIGITAL SIGNAL PROCESSING Example 10.7 Solution Form the Bessel-Thomson transfer function for n = 6. From Eqs. (10.100) and (10.101), we obtain H (s ) = 10, 395 10, 395 + 10, 395s + 4725s 2 + 1260s 3 + 210s 4 + 21s 5 + s 6 (See Fig. 10.18 and 10.19 for the loss and delay characteristics). 10.8 TRANSFORMATIONS In the preceding sections, only normalized lowpass approximations have been considered. The reason is that denormalized lowpass, highpass, bandpass, and bandstop approximations can be easily derived by using transformations of the form s = f ( ) s 10.8.1 Lowpass-to-Lowpass Transformation Consider a normalized lowpass transfer function HN (s ) with passband and stopband edges p and a , and let s = s (10.105) in HN (s ). If s = j , we have s = j / and hence Eq. (10.105) maps the j axis of the s plane onto the j axis of the s plane. In particular, ranges 0 to j p and j a to j map onto ranges 0 to j p / and j a / to j , respectively, as depicted in Fig. 10.20. Therefore, HLP ( ) = HN (s ) s s = s constitutes a denormalized lowpass approximation with passband and stopband edges p / and a /, respectively. A graphical illustration of the lowpass-to-lowpass transformation is shown in Fig. 10.21. 10.8.2 Lowpass-to-Bandpass Transformation 2 0 s Now let s= 1 B s+ in HN (s ), where B and 0 are constants. If s = j and s = j , we have 2 j 0 B 2 0 + j = or j = j B 2 B 2 2 APPROXIMATIONS FOR ANALOG FILTERS 517 j s plane _ j jp s plane ja ja j p jp ja jp ja Figure 10.20 Lowpass-to-lowpass transformation: Mapping. = Aa a p slope = Ap A() A() Ap Aa p a Figure 10.21 Lowpass-to-lowpass transformation: Graphical interpretation. 518 DIGITAL SIGNAL PROCESSING _ j _ j a2 j s plane s plane _ j p2 _ j p1 ja jp _ j a1 jp ja _ ja1 _ j p1 _ jp2 _ ja2 Figure 10.22 Lowpass-to-bandpass transformation: Mapping. Table 10.2 Type LP to LP LP to HP LP to BP LP to BS Hence Analog-lter transformations Transformation s = s s= s= 1 B s 2 0 s s+ s= Bs 2 s 2 + 0 0 = p 1 , p 2 a 1 , a 2 if = 0 if = p if = a p B 2 a B 2 2 where p1 , p2 = a 1 , a 2 = p B + 2 a B + 2 2 0 + 2 2 0 + APPROXIMATIONS FOR ANALOG FILTERS 519 = Aa a p Ap A() 1 B () 2 2 0 slope = 0 0 1 B A() Aa Ap p 1 a 1 p2 a 2 Figure 10.23 Lowpass-to-bandpass transformation: Graphical interpretation. The mapping for s = j is thus of the form illustrated in Fig. 10.22, and consequently H BP ( ) = HN (s ) s 1 B 2 0 s s= s+ is a bandpass approximation with passband edges p1 , p2 and stopband edges a 1 , a 2 . A graphical illustration of the lowpass-to-bandpass transformation is shown in Fig. 10.23. Similarly, the transformations in the second and fourth rows of Table 10.2 yield highpass and bandstop approximations. REFERENCES [1] [2] E. A. Guillemin, Synthesis of Passive Networks, New York: Wiley, 1957. N. Balabanian, Network Synthesis, Englewood Cliffs, NJ: Prentice-Hall, 1958. 520 DIGITAL SIGNAL PROCESSING [3] [4] [5] [6] [7] [8] [9] [10] L. Weinberg, Network Analysis and Synthesis, New York: McGraw-Hill, 1962. J. K. Skwirzynski, Design Theory and Data for Electrical Filters, London: Van Nostrand, 1965. R. W. Daniels, Approximation Methods for Electronic Filter Design, New York: McGraw-Hill, 1974. W. E. Thomson, Delay networks having maximally at frequency characteristics, Proc. Inst. Elect. Eng., pt. 3, vol. 96, pp. 487490, 1949. A. Antoniou, General Characteristics of Filters in The Circuits and Systems Handbook, ed. W.-K. Chen, Portland, OR: Book News, Inc., 2004. R. J. Schwarz and B. Friedland, Linear Systems, New York: McGraw-Hill, 1965. A. J. Grossman, Synthesis of Tchebyscheff parameter symmetrical lters, Proc. IRE, vol. 45, pp. 454473, Apr. 1957. G. N. Watson, A Treatise on the Theory of Bessel Functions, London: Cambridge University Press, 1948. PROBLEMS 10.1. A stable analog system is characterized by the transfer function in Eq. (10.5). Show that the steady-state sinusoidal response of the system is given by Eq. (10.11). 10.2. A fourth-order lowpass Butterworth lter 5 is required. (a) Obtain the normalized transfer function HN (s ). (b) Derive expressions for the loss and phase shift. (c) Calculate the loss and phase shift at = 0.5 rad/s. (d) Obtain a corresponding denormalized transfer function HD (s ) with a 3-dB cutoff frequency at 1000 rad/s. 10.3. A fth-order Butterworth lter is required. (a) Form H (s ). (b) Plot the loss characteristic. 10.4. Filter specications are often described pictorially as in Fig. P10.4, where p and a are desired passband and stopband edges, respectively, A p is the maximum passband loss, and Aa is the minimum stopband loss. Find n and, in turn, form H (s ), if p = 1, a = 3 rad/s, A p = 3.0, Aa 45 dB. Use the Butterworth approximation. 10.5. In an application a normalized Butterworth lowpass lter is required that would satisfy the following specication: Passband edge p : 0.6 rad/s Stopband edge a : 2.5 rad/s Maximum passband loss A p : 1.0 dB Minimum stopband loss Aa : 40.0 dB (a ) Find the minimum lter order that would satisfy the specications. (b) Calculate the actual maximum passband loss and minimum stopband loss. (c) Obtain the required transfer function. 10.6. A third-order lowpass lter with passband edge p = 1 rad/s and passband ripple A p = 1.0 dB is required. Obtain the poles and multiplier constant of the transfer function assuming a Chebyshev approximation. 5 The lters considered in this problem section are all analog lters. APPROXIMATIONS FOR ANALOG FILTERS 521 Loss, dB Aa Ap , rad/s p a Figure P10.4 10.7. A fth-order normalized lowpass Chebyshev lter is required. (a) Form H (s ) if A p = 0.1 dB. (b) Plot the loss characteristic. 10.8. A Chebyshev lter that would satisfy the specications of Fig. P10.8 is required. Find n and, in turn, form H (s ). Loss, dB 45 30 0.5 , rad/s 1.0 3.0 4.0 Figure P10.8 522 DIGITAL SIGNAL PROCESSING 10.9. An application calls for a normalized Chebyshev lowpass lter that would satisfy the following specication: Passband edge p : 1.0 rad/s Stopband edge a : 2.2 rad/s Maximum passband loss A p : 0.2 dB Minimum stopband loss Aa : 40.0 dB (a ) Find the minimum lter order that would satisfy the specications. (b) Calculate the actual maximum passband loss and minimum stopband loss. (c) Obtain the required transfer function. 10.10. (a) Show that Tn+1 () = 2 Tn () Tn1 () (b) Hence demonstrate that the following relation [5] holds: Tn () = (c) Obtain T10 (). 10.11. (a) Find A() for the normalized lowpass Butterworth and Chebyshev approximations if (b) Show that A() increases at the rate of 20n dB/decade in both cases. 10.12. The inverse-Chebyshev approximation can be derived by considering the loss function A() = 10 log 1 + where 2 = 1 100.1 Aa 1 1 2 Tn2 () 1. n 2 K r =0 (1)r (n r 1)! (2)n2r r !(n 2r )! where K = Int n 2 (a) Show that A() represents a highpass lter with an equiripple stopband loss, a monotonic increasing passband loss, and a stopband edge a = 1 rad/s. (b) Show that the lter represented by A() has a transfer function of the form HHP (s ) = n i =1 (s z i ) n i =1 (s pi ) where z i and pi for i = 1, 2, . . . , n are given by Eqs. (10.50), (10.51), and (10.53), respectively. (c) Show that HN (s ) = HHP (1/s ) is the normalized lowpass transfer function for the inverseChebyshev approximation. 10.13. A fourth-order inverse-Chebyshev lter with a minimum stopband loss of 40 dB is required. (a) Obtain the required transfer function. (b) Find the 3-dB cutoff frequency. APPROXIMATIONS FOR ANALOG FILTERS 523 10.14. An application requires a normalized inverse-Chebyshev lowpass lter that would satisfy the following specications: Passband edge p : 0.5 rad/s Stopband edge a : 1.0 rad/s Maximum passband loss A p : 0.5 dB Minimum stopband loss Aa : 30.0 dB (a ) Find the minimum lter order that would satisfy the specications. (b) Obtain the required transfer function. (c) Calculate the actual maximum passband loss and minimum stopband loss. 10.15. (a ) Write a MATLAB m -le that can be used to obtain the normalized elliptic transfer function for an arbitrary set of given specications {k , A p , Aa } where k is the selectivity, A p is maximum passband loss, and Aa is the minimum stopband loss. Your program should also compute the actual stopband loss. (b) Use the program in part (a ) to obtain elliptic transfer functions for two different sets of specications that would result in an even- and an odd-order transfer function of order greater than 3. (c) Plot the loss characteristics associated with the transfer functions obtained. 10.16. (a) A lowpass elliptic lter is required that would satisfy the specications n=4 A p = 1.0 dB k = 0.7 Form H (s ). (b) Determine the corresponding minimum stopband loss. (c) Plot the loss characteristic. 10.17. In a particular application an elliptic lowpass lter is required. The specications are Selectivity k : 0.6 Maximum passband loss A p : 0.5 dB Minimum stopband loss Aa : 40.0 dB 10.18. An elliptic lowpass lter that would satisfy the specications Selectivity k : 0.95 Maximum passband loss A p : 0.3 dB Minimum stopband loss Aa : 60.0 dB is required. (a) Determine the order of the transfer function. (b) Determine the actual loss. (c) Obtain the transfer function. 10.19. (a) Obtain the normalized transfer function H (s ) for the eighth-order Bessel-Thomson approximation. (b) Plot the corresponding phase characteristic. 10.20. (a ) Obtain the normalized transfer function H (s ) for the ninth-order Bessel-Thomson approximation. (b) Using the transfer function in part (a ), obtain expressions (i) for the loss characteristic, (ii) for the phase response, and (iii) for the group delay characteristic. (c) Using MATLAB or similar software, plot (i) the loss characteristic, (ii) the phase response, and (iii) the delay characteristic for the frequency range 0 to 6 rad/s. 524 DIGITAL SIGNAL PROCESSING 10.21. Show that H (s ) = where bi = (2n i )! 2ni i !(n i )! n i i =0 bi (s ) n i i =0 bi s is a constant-delay, allpass transfer function. 10.22. A constant-delay lowpass lter is required with a group delay of 1 ms. Form H (s ) using the sixth-order Bessel-Thomson approximation. 10.23. An normalized inverse-Chebyshev lowpass lter has a transfer function HN (s ) = where H0 = 1.581147 E 2 a01 = 2.894427 a02 = 1.105573 b00 = 5.957330 E 1 b11 = 8.586353 E 1 b12 = 2.787138 E 1 H0 s + b00 2 i =1 s2 s 2 + a0i + b1i s + b0i b01 = 3.161351 E 1 b02 = 2.686568 E 1 (a ) By using the lowpass-to-lowpass transformation, obtain a lowpass transfer function that would result in a stopband edge of 1000 Hz. (b) By using MATLAB or similar software, nd the passband edge of the transformed lter assuming a maximum passband loss of 1.0 dB. 10.24. A normalized lowpass Chebyshev lter has a transfer function HN (s ) = where H0 = 0.287898 b01 = 1.117408 b02 = 0.558391 b00 = 0.461411 b11 = 0.285167 b12 = 0.746578 H0 s + b00 2 i =1 1 s 2 + b1i s + b0i (a ) By using the lowpass-to-highpass transformation, obtain a highpass transfer function that would result in a passband edge of 10,000 Hz. (b) By using MATLAB or similar software, nd (i) the maximum passband loss and (ii) the minimum stopband loss of the highpass lter assuming a stopband edge of 5800 Hz. 10.25. A normalized elliptic transfer function for which k = 0.8 and A p = 0.1 dB is subjected to the lowpass-to-bandpass transformation. Find the passband and stopband edges of the bandpass lter if B = 200, 0 = 1000 rad/s. 10.26. A normalized elliptic transfer function for which k = 0.7 and A p = 0.5 dB is subjected to the lowpass-to-bandstop transformation. Find the passband and stopband edges of the bandstop lter if B = 100, 0 = 2000 rad/s. APPROXIMATIONS FOR ANALOG FILTERS 525 10.27. A normalized, third-order, elliptic, lowpass lter is characterized by the transfer function HN (s ) = H0 where H0 = 6.710103 E 2 b00 = 3.715896 E 1 b11 = 3.044886 E 1 a01 = 2.687292 b01 = 4.852666 E 1 s 2 + a01 (s + b00 )(s 2 + b11 s + b01 ) (a ) Obtain a bandpass elliptic transfer function by applying the lowpass-to-bandpass transformation assuming that B0 = 1.153776 E + 3 and 0 = 1.445683 E + 3. (b) By plotting the loss characteristic of the bandpass lter over the frequency range 0 to 4000 rad/s, nd the maximum passband loss, the minimum stopband loss, the passband edges, and stopband edges of the lter. 10.28. A normalized, third-order, elliptic, lowpass lter is characterized by the transfer function HN (s ) = H0 where H0 = 4.994427 E 2 b00 = 3.461194 E 1 b11 = 2.961751 E 1 a01 = 3.011577 b01 = 4.345639 E 1 s 2 + a01 (s + b00 )(s 2 + b11 s + b01 ) (a ) Obtain a bandstop elliptic transfer function by applying the lowpass-to-bandpass transformation assuming that B0 = 8.0 E + 2 and 0 = 7.885545 E + 02. (b) By plotting the loss characteristic of the lter over the frequency range 0 to 2000 rad/s, nd the maximum passband loss, the minimum stopband loss, the passband edges, and stopband edges of the bandstop lter. 10.29. A lowpass lter is required that would satisfy the following specications: Passband edge p : 2000 rad/s Stopband edge a : 7000 rad/s Maximum passband loss A p : 0.4 dB Minimum stopband loss Aa : 45.0 dB (a ) Assuming a Butterworth approximation, nd the required order n and the value of the transformation parameter . (b) Form H (s ). 10.30. Repeat Prob. 10.29 for the case of a Chebyshev approximation and compare the design obtained with that obtained in Prob. 10.29. 10.31. Repeat Prob. 10.29 for the case of an inverse-Chebyshev approximation and compare the design obtained with that obtained in Prob. 10.29. 10.32. Repeat Prob. 10.29 for the case of an elliptic approximation and compare the design obtained with that obtained in Prob. 10.29. 10.33. A highpass lter is required that would satisfy the following specications: Passband edge p : 2000 rad/s Stopband edge a : 1000 rad/s 526 DIGITAL SIGNAL PROCESSING Maximum passband loss A p : 0.5 dB Minimum stopband loss Aa : 40.0 dB (a ) Assuming a Butterworth approximation, nd the required order n and the value of the transformation parameter . (b) Form H (s ). 10.34. Repeat Prob. 10.33 for the case of a Chebyshev approximation and compare the design obtained with that obtained in Prob. 10.33. 10.35. Repeat Prob. 10.33 for the case of an inverse-Chebyshev approximation and compare the design obtained with that obtained in Prob. 10.33. 10.36. Repeat Prob. 10.33 for the case of an elliptic approximation and compare the design obtained with that obtained in Prob. 10.33. 10.37. A bandpass lter is required that would satisfy the specications depicted in Fig. P10.37. Assuming that the elliptic approximation is to be employed, nd suitable values for 0 , k , B , and n . Loss, dB 60 60 0.3 , rad/s 625 900 1600 2304 Figure P10.37 10.38. A bandpass lter is required that would satisfy the following specications: Lower passband edge p1 : 9500 rad/s Upper passband edge p2 : 10,500 rad/s Lower stopband edge a 1 : 5000 rad/s Lower stopband edge a 2 : 15,000 rad/s Maximum passband loss A p : 1.0 dB Minimum stopband loss Aa : 50.0 dB (a ) Assuming a Butterworth approximation, nd the required order n and the value of the transformation parameters B and 0 . (b) Form H (s ). APPROXIMATIONS FOR ANALOG FILTERS 527 10.39. Repeat Prob. 10.38 for the case of a Chebyshev approximation and compare the design obtained with that obtained in Prob. 10.38. 10.40. Repeat Prob. 10.38 for the case of an inverse-Chebyshev approximation and compare the design obtained with that obtained in Prob. 10.38. 10.41. Repeat Prob. 10.38 for the case of an elliptic approximation and compare the design obtained with that obtained in Prob. 10.38. 10.42. A bandstop lter is required that would satisfy the specications depicted in Fig. P10.42. Assuming that the elliptic approximation is to be employed, nd suitable values for 0 , k , B , and n . Loss, dB 35 0.1 0.1 , rad/s 800 900 1100 1200 Figure P10.42 10.43. A bandstop lter is required that would satisfy the following specications: Lower passband edge p1 : 20 rad/s Upper passband edge p2 : 80 rad/s Lower stopband edge a 1 : 48 rad/s Lower stopband edge a 2 : 52 rad/s Maximum passband loss A p : 1.0 dB Minimum stopband loss Aa : 25.0 dB (a ) Assuming a Butterworth approximation, nd the required order n and the value of the transformation parameters B and 0 . (b) Form H (s ). 10.44. Repeat Prob. 10.43 for the case of a Chebyshev approximation and compare the design obtained with that obtained in Prob. 10.43. 10.45. Repeat Prob. 10.43 for the case of an inverse-Chebyshev approximation and compare the design obtained with that obtained in Prob. 10.43. 528 DIGITAL SIGNAL PROCESSING 10.46. Repeat Prob. 10.43 for the case of an elliptic approximation and compare the design obtained with that obtained in Prob. 10.43. R L1 L2 C1 R Figure P10.47 10.47. Figure P10.47 shows an LC lter. (a ) Derive a highpass LC lter. (b) Derive a bandpass LC lter. (c) Derive a bandstop LC lter. CHAPTER 11 DESIGN OF RECURSIVE (IIR) FILTERS 11.1 INTRODUCTION Approximation methods for the design of recursive (IIR) lters differ quite signicantly from those used for the design of nonrecursive lters. The basic reason is that in the rst case the transfer function is a ratio of polynomials of z whereas in the second case it is a polynomial of z 1 . In recursive lters, the approximation problem is usually solved through indirect methods. First, a continuous-time transfer function that satises certain specications is obtained using one of the standard analog-lter approximations described in Chap. 10. Then a corresponding discrete-time transfer function is obtained using one of the following methods [19]: 1. 2. 3. 4. Invariant impulse-response method Modied version of method 1 Matched-z transformation Bilinear transformation This chapter is concerned with the indirect approach to the design of recursive lters. It starts with the realizability constraints that must be satised by the discrete-time transfer function and then deals with the details of the aforementioned approximation methods. The chapter also describes a set of z -domain transformations that can be used to derive transformed lowpass, highpass, bandpass, or bandstop discrete-time transfer functions from a given lowpass discrete-time transfer function. It concludes with a general discussion on the choice between recursive and nonrecursive designs. 529 Copyright 2006 by The McGraw-Hill Companies, Inc. Click here for terms of use. 530 DIGITAL SIGNAL PROCESSING Iterative methods that are suitable for the design of nonrecursive and recursive lters are considered in Chaps. 15 and 16, respectively. 11.2 REALIZABILITY CONSTRAINTS In order to be realizable by a recursive lter, a transfer function must satisfy the following constraints: 1. It must be a rational function of z with real coefcients. 2. Its poles must lie within the unit circle of the z plane. 3. The degree of the numerator polynomial must be equal to or less than that of the denominator polynomial. The rst constraint is actually articial and is imposed by our assumption in Chaps. 1 and 4 that signals are real and that the constituent elements of a digital lter perform real arithmetic. If unit delays, adders, and multipliers are dened for complex signals in terms of complex arithmetic, then transfer functions with complex coefcients can be considered to be realizable [10, 11]. The second and third constraints will assure a stable and causal lter, respectively (see Secs. 5.3 and 5.2, respectively). 11.3 INVARIANT IMPULSE-RESPONSE METHOD Consider the impulse modulated lter FA of Fig. 11.1, where S is an ideal impulse modulator and FA is an analog lter characterized by H A (s ). FA can be represented by a continuous-time transfer A (s ) or, equivalently, by a discrete-time transfer function H D (z ), as shown in Sec. 6.9. function H From Eq. (6.53b) 1 h A (0+) + HA ( j ) = H D (e j T ) = 2 T where s = 2/T is the sampling frequency and h A (t ) = L1 H A (s ) h A (0+) = lim [s H A (s )] s H A ( j + jk s ) k = (11.1) (11.2) H D (z ) = Z h A (nT ) ^ FA S FA Figure 11.1 Impulse modulated lter. DESIGN OF RECURSIVE (IIR) FILTERS 531 Therefore, given an analog lter FA , a corresponding digital lter, represented by H D (z ), can be derived by using the following procedure: 1. Deduce h A (t ), the impulse response of the analog lter. 2. Replace t by nT in h A (t ). 3. Form the z transform of h A (nT ). If H A ( j ) 0 then for || s 2 s 2 (11.3a) H A ( j + jk s ) 0 k = k =0 for || < (11.3b) If, in addition, h A (0+) = 0 Eqs. (11.1), (11.3b), and (11.4) yield 1 s (11.5) H A ( j ) = H D (e j T ) H A ( j ) for || < T 2 i.e., if H A ( j ) is bandlimited, the baseband frequency response of the derived digital lter is approximately the same as that of the analog lter except that the gain of the digital lter is multiplied by the constant 1/T . This constant can be eliminated by multiplying the numerator coefcients of H D (z ) by T . If the denominator degree in H A (s ) exceeds the numerator degree by at least 2, the basic assumptions in Eqs. (11.3a) and (11.4) hold for some sufciently high value of s . If, in addition, the poles of H A (s ) are simple, we can write N (11.4) H A (s ) = i =1 Ri s pi (11.6) Hence from steps 1 and 2 above N N h A (t ) = L1 H A (s ) = i =1 Ri e pi t and h A (nT ) = i =1 Ri e pi nT (see Sec. 10.2.4). Subsequently, from step 3 N H D (z ) = Z h A (nT ) = i =1 Ri z z e T pi (11.7) Since complex-conjugate pairs of poles in H A (s ) yield complex-conjugate values of Ri and e T pi , the coefcients in H D (z ) are real. Pole pi = i + j i gives rise to a pole pi in H D (z ), where pi = e T pi = e T (i + j i ) 532 DIGITAL SIGNAL PROCESSING and for i < 0, | pi | < 1. Hence a stable analog lter yields a stable digital lter. Also the numerator degree in H D (z ) cannot exceed the denominator degree as can be easily veried, and H D (z ) is therefore realizable. The method described, which is known as the invariant impulse-response method, yields good results for Butterworth, Bessel-Thomson, or Chebyshev lowpass and bandpass lters for which the basic assumptions of Eqs. (11.3a) and (11.4) hold. An advantage of the method is that it preserves the phase response as well as the loss characteristic of the analog lter. Example 11.1 Design a digital lter by applying the invariant impulse-response method to the Bessel-Thomson transfer function H A (s ) = 105 105 + 105s + 45s 2 + 10s 3 + s 4 (see Sec. 10.7). Employ a sampling frequency s = 8 rad/s; repeat with s = 16 rad/s. Solution The poles of H A (s ) and the residues in Eq. (11.6) are p1 , p1 = 2.896211 j 0.8672341 p2 , p2 = 2.103789 j 2.657418 R1 , R1 = 1.663392 j 8.396299 R2 , R2 = 1.663392 j 2.244076 Hence from Eq. (11.7) 2 TH D (z ) = j =1 a1 j z + a2 j z 2 b0 j + b1 j z + z 2 where coefcients ai j and bi j are given in Table 11.1. The transfer function is multiplied by T to eliminate the effect of constant 1/T in Eq. (11.5). Table 11.1 s 8 2 1 16 2 3.790011 E 1 1.306425 1.916064 E 1 4.404794 E 1 8.345233 E 1 3.114550 E 1 2.612851 1.306425 3.671301 E 2 1.028299 E 1 1.891907 E 1 6.045080 E 1 j 1 Coefcients of THD (z ) (Example 11.1) a1 j 6.452333 E 1 a2 j 2.612851 b0 j 1.057399 E 2 b1 j 1.597700 E 1 DESIGN OF RECURSIVE (IIR) FILTERS 533 The loss and delay characteristics obtained are plotted in Fig. 11.2a and b, respectively. The higher sampling frequency gives better results because aliasing errors are less pronounced. 14 12 10 8 Loss, dB 6 4 2 Analog filter 0 2 Digital filter s = 8 rad/s Digital filter s = 16 rad/s 0 0.5 1.0 1.5 2.0 , rad/s (a) 2.5 3.0 3.5 4.0 1.0 Analog filter 0.8 Digital filter s = 8 rad/s Delay, s 0.6 s = 16 rad/s Digital filter 0.4 0.2 0 0 0.5 1.0 1.5 2.0 , rad/s (b) 2.5 3.0 3.5 4.0 Figure 11.2 Example 11.1: (a ) Loss characteristics, (b) delay characteristics. 534 DIGITAL SIGNAL PROCESSING 11.4 MODIFIED INVARIANT IMPULSE-RESPONSE METHOD Aliasing errors tend to restrict the application of the invariant impulse-response method to the design of allpole lters.1 However, a modied version of the method is available, as will now be demonstrated, which can be applied to lters that also have zeros in the nite s plane. Consider the transfer function H A (s ) = H0 H0 N (s ) = D (s ) M i =1 (s N i =1 (s zi ) pi ) (11.8) where M can be as high as N . We can write H A (s ) = where H0 H A1 (s ) H A2 (s ) 1 H A1 (s ) = D (s ) 1 H A2 (s ) = N (s ) h A2 (0+) = 0 for || s 2 (11.9) (11.10) Clearly, with M , N 2 Eq. (11.2) yields h A1 (0+) = 0 and furthermore H A1 ( j ) 0 H A2 ( j ) 0 for some sufciently high value of s . Consequently, from Eq. (11.1) we can write 1 H A1 ( j ) = H D1 (e j T ) H A1 ( j ) T s for || < 2 1 H A2 ( j ) = H D2 (e j T ) H A2 ( j ) T Therefore, we can form H0 H D1 (z ) H D (z ) = H D 2 (z ) such that H0 H D1 (e j T ) s H D (e j T ) = H A ( j ) for || < j T ) H D2 (e 2 If the zeros and poles of H A (s ) are simple, Eq. (11.7) gives N (11.11) H D 1 (z ) = i =1 M Ai z N1 (z ) = T pi ze D1 ( z ) Bi z N2 (z ) = z e T zi D2 ( z ) (11.12) H D 2 (z ) = i =1 (11.13) 1 These are lters that have only poles in the nite s plane. DESIGN OF RECURSIVE (IIR) FILTERS 535 Thus from Eqs. (11.11)(11.13) H D (z ) = H0 N1 (z ) D2 (z ) N 2 ( z ) D1 ( z ) (11.14) The derived lter can be unstable since some of the zeros of N2 (z ) may be located on or outside the unit circle of the z plane, but the problem can be easily overcome. For an arbitrary pole of H D (z ), say, pi , we can write |(e j T pi )| = e j T pi = | pi | = | pi | If pi is real, we have |(e j T pi )| = | pi | e j T 1 pi e j T 1 pi 1 pi 1 pi e j T e j T and if pi and pi are a complex-conjugate pair of poles, then |(e j T pi )(e j T pi )| = | pi |2 e j T 1 pi e j T 1 pi Hence any poles of H D (z ) located outside the unit circle can be replaced by their reciprocals without changing the shape of the loss characteristic. This will introduce a constant vertical shift in the loss characteristic but the problem can be easily eliminated by adjusting H0 , the multiplier constant of the transfer function. The method yields excellent results for elliptic lters. For this class of lters, polynomial N2 (z ) turns out to be a mirror-image polynomial with roots on the negative real axis (see Sec. 9.2.3) and, in effect, its roots occur in reciprocal pairs. This means that half of the roots of N2 (z ) would be located outside the unit circle of the z plane and since these roots are poles in the derived transfer function given by Eq. (11.14), the lter obtained would be unstable. However, the problem can be easily eliminated by applying the above stabilization technique. If N2 (z ) has K roots pi that are located outside the unit circle, a stable lter can be obtained by replacing each pi by 1/ pi and then dividing K the multiplier constant H0 in Eq. (11.14) by 1 | pi |. The main problem with the modied invariant impulse-response method has to do with the order of the lter obtained. Unfortunately, polynomials N1 (z ) and N2 (z ) tend to increase the order of H D (z ), as can be seen in Eq. (11.14), and that makes the method uneconomical. The method is described in some detail here only because it provides a theoretical foundation for the matched-z transformation method as will be demonstrated in Sec. 11.5. 536 DIGITAL SIGNAL PROCESSING Example 11.2 The transfer function H A (s ) = H0 a0 j + s 2 b + b1 j s + s 2 j =1 0 j 3 where H0 , a0 j , and b1 j are given in Table 11.2, represents a lowpass elliptic lter satisfying the following specications: Passband ripple: 0.1 dB Minimum stopband loss: 43.46 dB Passband edge: 0.8 rad/s Stopband edge: 1/ 0.8 rad/s Employing the modied invariant impulse-response method, design a corresponding digital lter. Use s = 7.5 rad/s. Table 11.2 Coefcients of HA(s ) (Example 11.2) j 1 2 3 a0 j 1.199341 E + 1 2.000130 1.302358 b0 j 3.581929 E 1 6.860742 E 1 8.633304 E 1 b1 j 9.508335 E 1 4.423164 E 1 1.088749 E 1 H0 = 6.713267 E 3 Solution From Eqs. (11.9) and (11.10) 3 H A1 (s ) = j =1 3 b0 j 1 + b1 j s + s 2 H A2 (s ) = 1 a0 j + s 2 j =1 The design can be accomplished by using the following procedure: 1. 2. 3. 4. Find the poles and residues of H A1 (s ) and H A2 (s ). Form H D1 (z ) and H D2 (z ) using Eqs. (11.12) and (11.13). Replace zeros of N2 (z ) outside the unit circle by their reciprocals. Adjust constant H0 to achieve zero minimum passband loss. DESIGN OF RECURSIVE (IIR) FILTERS 537 Table 11.3 j 1 2 3 4 5 a0 j Coefcients of HD (z ) (Example 11.2) a1 j b0 j b1 j 1 1.281134 1 1.303838 1 1.362371 2 7.751650 E 1 2 7.751650 E 1 1.0 1.942528 4.508735 E 1.0 7.530225 E 1 6.903732 E 1.0 1.153491 9.128252 E 3.248990 E + 1 1.955491 E + 1 5.611278 E 1.331746 E 2 3.971465 E 1 5.611278 E H0 = 3.847141 E 4 With this procedure H D (z ) can be deduced as H D (z ) = H0 a0 j + a1 j z + z 2 b + b1 j z + z 2 j =1 0 j 5 where H0 , ai j , and bi j are given in Table 11.3. The loss characteristic achieved, plotted in Fig. 11.3a and b, is seen to be a faithful reproduction of the analog loss characteristic. For this lter, the conventional invariant impulse-response method gives unsatisfactory results because the assumptions of Eqs. (11.3a) and (11.4) are violated. 60 50 40 Loss, dB 30 20 10 0 0 0.5 1.0 1.5 2.0 , rad/s (a) 2.5 3.0 3.5 4.0 Figure 11.3 Examples 11.2 and 11.4: (a) Stopband characteristics. Analog lter; modied impulse-invariant response method; - - - - - matched-z transformation method. 538 DIGITAL SIGNAL PROCESSING 0.40 0.35 0.30 0.25 Loss, dB 0.20 0.15 0.10 0.05 0 0.05 0.10 0 0.2 0.4 , rad/s (b) 0.6 0.8 1.0 Figure 11.3 Contd Examples 11.2 and 11.4: (b) Passband characteristics. Analog lter; modied impulse-invariant response method; - - - - - matched-z transformation method. 11.5 MATCHED- Z TRANSFORMATION METHOD An alternative approximation method for the design of recursive lters is the so-called matched-z transformation method [5, 9]. In this method, given a continuous-time transfer function like that in Eq. (11.8), a corresponding discrete-time transfer function can be formed as H D (z ) = (z + 1) L H0 M i =1 (z N i =1 ( z e zi T ) e pi T ) (11.15) where L is an integer. The value of L is equal to the number of zeros at s = in H A (s ). Typical values for L are given in Table 11.4. The matched-z transformation method had little or no theoretical foundation when it rst found its way into the technical literature. It was probably observed that in the invariant impulse-response method, the i th pole of the digital lter, pi , is related to the i th pole of the analog lter, pi , through the relation pi = e pi T It did not take too long for someone to attempt to map the zeros of the analog lter in the same way by letting z i = e zi T DESIGN OF RECURSIVE (IIR) FILTERS 539 Table 11.4 Typical values of L in Eq. (11.15) Type of lter Butterworth Chebyshev Inverse-Chebyshev, N odd N even Elliptic, N odd N even Lowpass N N 1 0 Highpass 0 0 0 0 Bandpass N /2 N /2 N/A 1 for N /2 odd 0 for N /2 even N/A 1 for N /2 odd 0 for N /2 even Bandstop 0 0 N/A 0 1 0 0 0 N/A 0 This matched-z transformation seemed to work for highpass and bandstop lters and to make the method work for lowpass and bandpass lters as well the ddle factor (z + 1) L was introduced, which improved the situation. If we now compare Eqs. (11.14) and (11.15), we note that the only difference between the transfer function of the modied invariant impulse-response method and the matched-z transformation method is that the ratio of polynomials, N1 (z )/ N2 (z ), in Eq. (11.14) is replaced by the factor (z + 1) L . For the standard lter approximations, it turns out that N1 (z ) (z + 1) L N2 (z ) and this is why the matched-z transformation method works as well as it does. Note that the matched-z transformation method cannot control the level of the amplitude response, i.e., if one starts with an analog lter that has a maximum passband gain of unity, the maximum passband gain in the derived digital lter is always something other than unity and, therefore, a correction is necessary after the design is completed to restore the maximum passband gain to unity. This can be easily achieved by nding the maximum passband gain of the derived digital lter, say, Mmax , and then changing the multiplier constant in Eq. 11.15 from H0 to H0 = H0 / Mmax . The method is fairly simple to apply and gives reasonable results provided that a sufciently large sampling frequency is used. Its main disadvantage is that it introduces a relatively large error in the passband loss as will be seen in the following example. Example 11.3 The transfer function H A (s ) = H0 s 4 2 j =1 (s p j )(s p ) j where H0 = 0.9885531 p1 , p1 = 2.047535 j 1.492958 p2 , p2 = 0.3972182 j 1.688095 540 DIGITAL SIGNAL PROCESSING represents a highpass Chebyshev lter with a passband edge of 2 rad/s and a passband ripple of 0.1 dB. Obtain a corresponding discrete-time transfer function employing the matched-z transformation method. Use a sampling frequency of 10 rad/s. Solution The value of L in Eq. (11.15) is generally zero for highpass lters, according to Table 11.4. Hence H D (z ) can be readily formed as H D (z ) = H0 where b01 = 7.630567 102 b02 = 6.070409 101 H0 = 2.076398 101 The above value of H0 was chosen to give a maximum passband gain of unity, which corresponds to a minimum passband loss of zero dB. The loss characteristic of the derived lter is compared with that of the analog lter in Fig. 11.4. 50 45 40 35 Loss, dB 30 25 20 15 10 5 0 0 1 2 Analog filter , rad/s (1 2z + z 2 )2 2 j =1 (b0 j + b1 j z + z 2 ) b11 = 3.267079 101 b12 = 7.608887 101 Digital filter 3 4 5 Figure 11.4 Loss characteristic (Example 11.3). DESIGN OF RECURSIVE (IIR) FILTERS 541 Example 11.4 Redesign the lowpass lter of Example 11.2 employing the matched-z transformation method. Solution From Eq. (11.15) H D (z ) can be formed as H D (z ) = H0 a0 j + a1 j z + z 2 b + b1 j z + z 2 j =1 0 j 3 where a1 j and b1 j are given by the rst three rows in Table 11.3. For zero minimum passband loss, H0 is given by H0 = 8.605074 103 The loss characteristic achieved is shown in Fig. 11.3 (dashed curve). As can be seen, it is signicantly inferior to the loss characteristic obtained by using the modied invariant impulse-response method. However, as was mentioned earlier, the latter method leads to a higher-order transfer function which is more uneconomical. 11.6 BILINEAR-TRANSFORMATION METHOD In the approximation method of Sec. 11.3, the derived digital lter has exactly the same impulse response as the original analog lter for t = nT . An approximation method will now be described whereby a digital lter is derived that has approximately the same time-domain response as the original analog lter for any excitation. 11.6.1 Derivation Consider an analog integrator characterized by the transfer function 1 H AI (s ) = s and assume that its response to an excitation x (t ) is y (t ), as depicted in Fig. 11.5. The impulse response of the integrator is given by L1 HI (s ) = h I (t ) = 1 0 for t 0+ for t 0 (11.16) x(t) Analog integrator y(t) Figure 11.5 Analog integrator. 542 DIGITAL SIGNAL PROCESSING and its response at instant t to an arbitrary right-sided excitation x (t ), i.e., x (t ) = 0 for t < 0, is given by the convolution integral (see Theorem 2.14) y (t ) = 0 t2 0 t x ( )h I (t ) d t1 0 (see Sec. 10.2.4). If 0+ < t1 < t2 , we can write y (t2 ) y (t1 ) = For 0+ < t1 , t2 h I (t2 ) = h I (t1 ) = 1 and thus Eq. (11.17) simplies to y (t2 ) y (t1 ) = As t1 t2 , from Fig. 11.6 t2 t1 [x (t1 ) + x (t2 )] 2 and on letting t1 = nT T and t2 = nT the difference equation T y (nT ) y (nT T ) = [x (nT T ) + x (nT )] 2 can be formed. This equation represents a digital integrator that has approximately the same timedomain response as the analog integrator for any excitation. By applying the z transform, we obtain T Y (z ) z 1 Y (z ) = [z 1 X (z ) + X (z )] 2 and hence the transfer function of the digital integrator can be derived as y (t2 ) y (t1 ) H D I (z ) = The above equation can be expressed as H D I (z ) = 1 s s= 2 T z1 z+1 (11.18) T Y (z ) = X (z ) 2 z+1 z1 t2 t1 x ( )h I (t2 ) d x ( )h I (t1 ) d (11.17) x ( ) d x() t1 t2 Figure 11.6 Response of analog integrator. DESIGN OF RECURSIVE (IIR) FILTERS 543 and, therefore, from Eqs. (11.16) and (11.18), we have H D I (z ) = H AI (s ) s= 2 T z1 z+1 In effect, a digital integrator can be obtained from an analog integrator by simply applying the bilinear transformation2 2 z1 s= (11.19) T z+1 to the transfer function of the analog integrator. As T 0, the shaded area in Fig. 11.6 would tend to approach the area under the curve and, consequently, the time-domain response of the digital integrator would tend to approach that of the analog integrator, as may be expected. Applying the bilinear transformation to the transfer function of an arbitrary analog lter will yield a digital lter characterized by the discrete-time transfer function H D (z ) = H A (s ) s= 2 T z1 z+1 (11.20) The digital lter so obtained will produce approximately the same time-domain response as the analog lter from which it is derived for any excitation. Furthermore, the time-domain response of the digital lter would tend to approach that of the analog lter as T 0. The above time-domain analysis led to a transformation that can be used to obtain a digital lter from an analog one. All we know at this point is the relationship between the time-domain response of the digital lter with that of the analog lter. To make further progress, we must deduce the relationship between the frequency-domain response of the digital lter with that of the analog lter, and to do that we must examine the mapping properties of the bilinear transformation. 11.6.2 Mapping Properties of Bilinear Transformation 2/ T + s 2/ T s Equation (11.19) can be put in the form z= and with s = + j we have z = r e j where r= and = tan1 2 T 2 T 1/2 + 2 2 + 2 + 2 + tan1 2/ T + 2/ T (11.21) 2 The bilinear transformation is one of the standard conformal transformations (see Sec. A.9). 544 DIGITAL SIGNAL PROCESSING Clearly if > 0 if = 0 if < 0 i.e., the bilinear transformation maps 1) the open right-half s plane onto the region exterior to the unit circle |z | = 1 of the z plane, 2) the j axis of the s plane onto the unit circle |z | = 1, and 3) the open left-half s plane onto the interior of the unit circle |z | = 1. For = 0, we have r = 1, and from Eq. (11.21) = 2 tan1 ( T /2). Hence if = 0 if + if then = 0 then + then then r > 1 then r = 1 then r < 1 i.e., the origin of the s plane maps onto point (1, 0) of the z plane and the positive and negative j axes of the s plane map onto the upper and lower semicircles |z | = 1, respectively. The transformation is illustrated in Fig. 11.7a and b. From Property 2 above it follows that the maxima and minima of | H A ( j )| will be preserved in | H D (e j T )|. Also if M1 | H A ( j )| M2 for some frequency range 1 2 , then M1 | H D (e j T )| M2 for a corresponding frequency range 1 2 . Consequently, passbands or stopbands in the analog lter translate into passbands or stopbands in the digital lter. j s plane z plane s= j s=j s=0 (a) Figure 11.7 Bilinear transformation: (a ) Mapping from s to z plane. DESIGN OF RECURSIVE (IIR) FILTERS 545 0 10 M(), dB 20 30 40 50 60 1 0 Re s Ap Aa s plane 10 0 jIm s 10 20 1 20 Ap 0 10 M(), dB 20 30 40 50 60 2 1 0 jIm z 1 2 2 (b) 1 1 0 Re z Aa z plane 2 Figure 11.7 Contd domain. Bilinear transformation: (b) Mapping of amplitude response of analog lter to the z From Property 3 it follows that a stable analog lter will yield a stable digital lter, and since the transformation has real coefcients, H D (z ) will have real coefcients. Finally, the numerator degree in H D (z ) cannot exceed the denominator degree and, therefore, H D (z ) is a realizable transfer function. 11.6.3 The Warping Effect Let and represent the frequency variable in the analog lter and the derived digital lter, respectively. From Eq. (11.20) H D (e j T ) = H A ( j ) 546 DIGITAL SIGNAL PROCESSING provided that = For < 0.3/ T and, as a result, the digital lter has the same frequency response as the analog lter. For higher frequencies, however, the relation between and becomes nonlinear, as illustrated in Fig. 11.8, and distortion is introduced in the frequency scale of the digital lter relative to that of the analog lter. This is known as the warping effect [2, 5]. The inuence of the warping effect on the amplitude response can be demonstrated by considering an analog lter with a number of uniformly spaced passbands centered at regular intervals, as in Fig. 11.8. The derived digital lter has the same number of passbands, but the center frequencies and bandwidths of higher-frequency passbands tend to be reduced disproportionately, as shown in Fig. 11.8. If only the amplitude response is of concern, the warping effect can for all practical purposes be eliminated by prewarping the analog lter [2, 5]. Let 1 , 2 , . . . , i , . . . be the passband and stopband edges in the analog lter. The corresponding passband and stopband edges in the digital T 2 tan T 2 (11.22) 6.0 T=2s 4.0 2.0 |HA( j)| |HD(e jT)| 0 0.1 0.2 0.3 0.4 0.5 , rad/s Figure 11.8 Inuence of the warping effect on the amplitude response. DESIGN OF RECURSIVE (IIR) FILTERS 547 lter are given by Eq. (11.22) as i = i T 2 tan1 T 2 for i = 1, 2, . . . (11.23) Consequently, if prescribed passband and stopband edges 1 , 2 , . . . , i , . . . are to be achieved in the digital lter, the analog lter must be prewarped before application of the bilinear transformation to ensure that i = Under these circumstances i iT 2 tan T 2 (11.24) = i according to Eqs. (11.23) and (11.24), as required. The bilinear transformation together with the prewarping technique is used in Chap. 12 to develop a detailed procedure for the design of Butterworth, Chebyshev, inverse-Chebyshev, and elliptic lters satisfying prescribed loss specications. The inuence of the warping effect on the phase response can be demonstrated by considering an analog lter with linear phase response. As illustrated in Fig. 11.9, the phase response of the derived digital lter is nonlinear. Furthermore, little can be done to linearize it except by employing delay equalization (see Sec. 12.5.1). Consequently, if it is mandatory to preserve a linear phase response, the alternative methods of Secs. 11.311.4 should be considered. Example 11.5 The transfer function H A (s ) = a0 j + s 2 b + b1 j s + s 2 j =1 0 j 3 where a0 j and bi j are given in Table 11.5, represents an elliptic bandstop lter with a passband ripple of 1 dB and a minimum stopband loss of 34.45 dB. Use the bilinear transformation to obtain a corresponding digital lter. Assume a sampling frequency of 10 rad/s. Table 11.5 Coefcients of HA(s ) (Example 11.5) j 1 2 3 a0 j 6.250000 8.013554 4.874554 b0 j 6.250000 1.076433 E + 1 3.628885 b1 j 2.618910 3.843113 E 1 2.231394 E 1 548 DIGITAL SIGNAL PROCESSING 6.0 T=2s 4.0 2.0 arg HA( j) 0 0.1 0.2 0.3 , rad/s 0.4 0.5 arg HD(e jT) Figure 11.9 Inuence of the warping effect on the phase response. Solution From Eq. (11.20), one can show that 3 H D (z ) = j =1 a0 j + a1 j z + a0 j z 2 b0 j + b1 j z + z 2 where a0 j = b0 j = a0 j + 4/ T 2 cj a1 j = 2(a0 j 4/ T 2 ) cj b1 j = 2(b0 j 4/ T 2 ) cj b0 j 2b1 j / T + 4/ T 2 cj 4 2b1 j +2 T T c j = b0 j + DESIGN OF RECURSIVE (IIR) FILTERS 549 The numerical values of ai j and bi j are given in Table 11.6. The loss characteristic of the derived digital lter is compared with that of the analog lter in Fig. 11.10. The expected lateral displacement in the characteristic of the digital lter is evident. Table 11.6 j 1 2 3 Coefcients of HD (z ) (Example 11.5) a0 j a1 j b0 j b1 j 6.627508 E 1 3.141080 E 1 3.255016 E 1 3.141080 E 1 8.203382 E 1 1.915542 E 1 8.893929 E 1 5.716237 E 2 1.036997 7.266206 E 1 9.018366 E 1 8.987781 E 1 40 35 30 25 Loss, dB 20 15 10 5 0 Digital filter Analog filter 0 1 2 , rad/s 3 4 5 Figure 11.10 Loss characteristic (Example 11.5). 11.7 DIGITAL-FILTER TRANSFORMATIONS A normalized lowpass analog lter can be transformed into a denormalized lowpass, highpass, bandpass, or bandstop lter by employing the transformations described in Sec. 10.8. Analogous transformations can be derived for digital lters as we shall now show. These are due to Constantinides [12]. 11.7.1 General Transformation m Consider the transformation z = f ( ) = e j z i =1 z ai 1 ai z (11.25) 550 DIGITAL SIGNAL PROCESSING where and m are integers and ai is the complex conjugate of ai . With z = Re j ai = ci e j i , Eq. (11.25) becomes m T , z = re j T , and Re j and hence m T = e j i =1 r e j T ci e j i 1 r ci e j ( T +i ) R2 = i =1 r 2 + ci2 2r ci cos( T + i ) 1 + (r ci )2 2r ci cos( T + i ) or or or r >1 r =1 r <1 (11.26) Evidently, if R > 1 if R = 1 if R < 1 In effect, Eq. (11.26) maps 1. the unit circle |z | = 1 onto the unit circle |z | = 1, 2. the interior of |z | = 1 onto the interior of |z | = 1, and 3. the exterior of |z | = 1 onto the exterior of |z | = 1 as illustrated in Fig. 11.11. Now consider a normalized lowpass lter characterized by HN (z ) with a passband extending from 0 to p . On applying the above transformation we can form (11.27) z = f ( ) z With the poles of HN (z ), located inside the unit circle |z | = 1, those of H ( ) will be located inside z the unit circle |z | = 1; that is, H ( ) will represent a stable lter. Furthermore, from item 1, if z M1 | HN (e j Re jT z plane z plane T then r 2 + ci2 > 1 + (r ci )2 then r 2 + ci2 = 1 + (r ci )2 then r + 2 ci2 < 1 + (r ci ) 2 H ( ) = HN (z ) z )| M2 re jT Figure 11.11 General z -domain transformation. DESIGN OF RECURSIVE (IIR) FILTERS 551 for some frequency range 1 2, then M1 | H (e j T )| M2 for one or more corresponding ranges of ; that is, the passband (stopband) in HN (z ) will translate into one or more passbands (stopbands) in H ( ). Therefore, the above transformation can form the z basis of a set of transformations that can be used to derive transformed lowpass, highpass, bandpass, and bandstop digital lters from a given lowpass digital lter. 11.7.2 Lowpass-to-Lowpass Transformation The appropriate values for , m , and ai in Eq. (11.25) can be determined by examining the details of the necessary mapping. If H ( ) is to represent a lowpass lter with a passband edge p , the mapping z must be of the form shown in Fig. 11.12a , where solid lines denote passbands. As complex number e j T traces the unit circle in the z plane once, e j T must trace the unit circle in the z plane once in the same sense. The transformation must thus be bilinear (m = 1) of the form z = e j z a 1 az (11.28) At points A and A , z = z = 1, and at C and C , z = z = 1 Hence Eq. (11.28) gives 1 = e j 1 a 1a and 1 = e j 1 + a 1+a z plane B A D z plane p B' p C p C' p D' (a) A' z plane p z plane C' B A p D D' A'' p2 B'' C'' (b) p2 p1 B' C A' p1 D'' Figure 11.12 (a ) Lowpass-to-lowpass transformation, (b) lowpass-to-bandstop transformation. 552 DIGITAL SIGNAL PROCESSING By solving these equations, we obtain a = a where is a real constant. Thus Eq. (11.28) becomes z= z 1 z = p =0 The necessary value for can be determined by noting that at points B and B , we have and = p , in which case e jp T e j pT = 1 e j p T or = sin[( sin[( p )T /2] p + p ) T /2] p 11.7.3 Lowpass-to-Bandstop Transformation If a bandstop lter is required with passband edges p1 and p2 , the mapping must have the form shown in Fig. 11.12b. In order to introduce an upper passband in H ( ), e j T must trace the unit z circle of the z plane twice for each revolution of e j T in the z plane. Consequently, in this case, the transformation must be biquadratic (m = 2) of the form z = e j z2 + z + 1 + z + z2 where and are real constants. At points A and A , z = z = 1 and e j = 1 so that z= With z = e j T z2 + z + 1 + z + z2 and z = e j T ej T = e j 2 T + e j T + e j 2 T (e j 2 T + e j T + ) Hence T sin 2 T + sin T = tan1 T 2 cos 2 T + cos T + (1 ) sin T T = 2 (1 + ) cos T + and after some manipulation tan DESIGN OF RECURSIVE (IIR) FILTERS 553 At points B and B , = p and = p1 , respectively, and as a result tan pT 2 p pT = (1 ) sin p1 T (1 + ) cos p1 T + (11.29) Likewise, at points D and D , = tan 2 and = p2 , respectively, so that = (1 ) sin p2 T (1 + ) cos p2 T + (11.30) Now by solving Eqs. (11.29) and (11.30), and can be deduced as = where = cos[( p2 + p1 )T /2] cos[( p2 p1 )T /2] and k = tan pT 2 1+k = 1k 1+k ( p2 p1 )T 2 2 tan Lowpass-to-highpass and lowpass-to-bandpass transformations can similarly be derived. The complete set of transformations is summarized in Table 11.7. Table 11.7 Type LP to LP Constantinides transformations Transformation z= z 1 z z 1 z z2 = = sin[( sin[( cos[( cos[( p , k p )T /2] p + p ) T /2] p )T /2] p + p ) T /2] p LP to HP z= LP to BP k1 2 k z+ k+1 k+1 z= k1 2 2 k z+ z 1 k+1 k+1 = cos[( p2 + p1 )T /2] cos[( p2 p1 )T /2] pT k = tan 2 1k z+ 1+k 1+k z= 1k 2 2 z+ z 1 1+k 1+k z2 2 cot ( p2 p1 )T 2 LP to BS = cos[( p2 + p1 )T /2] cos[( p2 p1 )T /2] pT k = tan 2 tan ( p2 p1 )T 2 554 DIGITAL SIGNAL PROCESSING 11.7.4 Application The Constantinides transformations can be readily applied to design lters with prescribed passband edges. The following procedure can be employed: 1. Obtain a lowpass transfer function HN (z ) using any approximation method. 2. Determine the passband edge p in HN (z ). 3. Form H ( ) according to Eq. (11.27) using the appropriate transformation. z An important feature of lters designed by using this procedure is that the passband edge in lowpass or highpass lters can be varied by varying a single parameter, namely, . Similarly, both the lower and upper passband edges in bandpass or bandstop lters can be varied by varying only a pair of parameters, namely, and k [13]. An alternative design procedure by which prescribed passband as well as stopband edges can be achieved is described in Chap. 12. 11.8 COMPARISON BETWEEN RECURSIVE AND NONRECURSIVE DESIGNS Before a solution is sought for the approximation problem, a choice must be made between a recursive and a nonrecursive design [14]. In recursive lters the poles of the transfer function can be placed anywhere inside the unit circle. A consequence of this degree of freedom is that high selectivity (i.e., narrow transition bands) can easily be achieved with low-order transfer functions. In nonrecursive lters, on the other hand, with the poles xed at the origin, high selectivity can be achieved only by using a relatively high order for the transfer function. For the same lter specication the required order in a nonrecursive design can be as high as 5 to 10 times that in a recursive design. For example, the bandpass-lter specication in Example 9.5 can be met using a nonrecursive lter of order 52 or a recursive elliptic lter of order 8. In practice, the cost of a digital lter tends to increase and its speed tends to decrease as the order of the transfer function is increased. Hence, for high-selectivity applications where the delay characteristic is of secondary importance, the choice is expected to be a recursive design. Constant group delay is mandatory for certain applications, e.g., in data transmission and image processing (see Sec. 5.7). For such applications, the choice is between a nonrecursive design and an equalized recursive design. If computational efciency is unimportant (e.g., if the amount of data to be processed is small), a nonrecursive design based on the methods considered in Chap. 9 may be entirely acceptable. However, if computational efciency is of prime importance (e.g., in real-time applications or in applications where massive amounts of data are to be processed), an optimal nonrecursive design based on the Remez exchange algorithm described in Chap. 15 or an equalized recursive design based on the method of Sec. 16.8 must be selected. Optimal nonrecursive designs are easier to obtain than equalized recursive designs. However, computational efciency is signicantly better in equalized recursive designs, particularly if a high selectivity is required. Nonrecursive lters are naturally suited for certain applications, e.g., to perform numerical operations like interpolation, extrapolation, differentiation and integration. Further, owing to the fact that their impulse response is of nite duration, nonrecursive lters can be implemented in terms of fast-Fourier transforms without the need for a window function (see Sec. 7.8.). DESIGN OF RECURSIVE (IIR) FILTERS 555 In certain applications, the choice between a nonrecursive and a recursive design may be determined by other factors. For example, nonrecursive lters are always stable, owing to the absence of feedback, and this feature alone makes them the lters of choice for the implementation of adaptive lters (see Sec. 18.5). In these applications, the characteristics of the adaptive lter change with time on-line and if it is possible for the lter to become unstable, it will at some point. Recursive lters can also be used as adaptive lters but a special mechanism has to be incorporated in the lter implementation to prevent instability from arising. Nonrecursive lters tend to be relatively insensitive to quantization errors. In addition, their realizations are simple and regular and are highly attractive for very-large-scale integrated circuit implementation (see Sec. 8.3). REFERENCES [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] J. F. Kaiser, Design methods for sampled data lters, Proc. 1st Allerton Conf. Circuit Syst. Theory, pp. 221236, Nov. 1963. R. M. Golden and J. F. Kaiser, Design of wideband sampled-data lters, Bell Syst. Tech. J., vol. 43, pp. 15331546, July 1964. C. M. Rader and B. Gold, Digital lter design techniques in the frequency domain, Proc. IEEE, vol. 55, pp. 149171, Feb. 1967. D. J. Nowak and P. E. Schmid, Introduction to digital lters, IEEE Trans. Electromagn. Compat., vol. 10, pp. 210220, June 1968. R. M. Golden, Digital lter synthesis by sampled-data transformation, IEEE Trans. Audio Electroacoust., vol. 16, pp. 321329, Sept. 1968. A. J. Gibbs, An introduction to digital lters, Aust. Telecommun. Res., vol. 3, pp. 314, Nov. 1969. A. J. Gibbs, The design of digital lters, Aust. Telecommun. Res., vol. 4, pp. 2934, Mar. 1970. L. R. Rabiner and B. Gold, Theory and Application of Digital Signal Processing, Englewood Cliffs, NJ: Prentice-Hall, 1975. A. V. Oppenheim and R. W. Schafer, Discrete-Time Signal Processing, Englewood Cliffs, NJ: Prentice-Hall, 1989. T. H. Crystal and L. Ehrman, The design and applications of digital lters with complex coefcients, IEEE Trans. Audio Electroacoust., vol. 16, pp. 315320, Sept. 1968. P. A. Regalia, S. K. Mitra, and J. Fadavi-Ardekani, Implementation of real coefcient digital lters using complex arithmetic, IEEE Trans. Circuits Syst., vol. 34, pp. 345353, Apr. 1987. A. G. Constantinides, Spectral transformations for digital lters, Proc. Inst. Elect. Eng., vol. 117, pp. 15851590, Aug. 1970. R. E. Crochiere and P. Peneld, Jr., On the efcient design of bandpass digital lter structures, IEEE Trans. Acoust., Speech, Signal Process., vol. 23, pp. 380381, Aug. 1975. Rabiner, L. R., J. F. Kaiser, O. Herrmann, and M. T. Dolan, Some comparisons between FIR and IIR digital lters, Bell Syst. Tech. J., vol. 53, pp. 305331, Feb. 1974. S. S. Haykin and R. Carnegie, New method of synthesising linear digital lters based on convolution integral, Proc. Inst. Elect. Eng., vol. 117, pp. 10631072, June 1970. S. A. White, New method of synthesising linear digital lters based on convolution integral, Proc. Inst. Elect. Eng., vol. 118, p. 348, Feb. 1971. [12] [13] [14] [15] [16] 556 DIGITAL SIGNAL PROCESSING [17] A. Antoniou and C. Shekher, Invariant sinusoid approximation method for recursive digital lters, Electron. Lett., vol. 9, pp. 498500, Oct. 1973. PROBLEMS 11.1. By using the invariant impulse-response method, derive a discrete-time transfer function from the continuous-time transfer function 1 H A (s ) = (s + 1)(s 2 + s + 1) The sampling frequency is 10 rad/s. 11.2. A continuous-time system is characterized by the transfer function 1 H A (s ) = 3 s + 6s 2 + 11s + 6 By using the invariant impulse-response method, obtain the transfer function of a corresponding discretetime system. The sampling frequency is 6 . 11.3. A continuous-time system has a transfer function 5s + 13 5.0 H A (s ) = s + 2.5 s 2 + 4s + 25 4 Using the invariant impulse-response method, obtain the transfer function of a corresponding discretetime system. The sampling frequency is 20 rad/s. 11.4. A Bessel-Thomson normalized lowpass lter has a transfer function R0 R1 R1 H A (s ) = + + s p0 s p1 s p1 where R0 = 4.53, p0 = 2.32 p1 = 1.84 + j 1.75 R1 = 2.26 j 6.24, (a ) Using the invariant impulse-response method, obtain the transfer function of a corresponding digital lter. The sampling frequency is 20 rad/s. (b) Give an approximate expression for the frequency response of the digital lter in terms of the frequency response of the analog lter, H A ( j ), and state what determines the accuracy of your expression. 11.5. The sixth-order normalized Bessel-Thomson transfer function can be expressed as 3 H A (s ) = i =1 Ri Ri + s pi s pi where Ri and pi are given in Table P11.5. (a) Design a digital lter by using the invariant impulse-response method, assuming a sampling frequency of 10 rad/s. (b) Plot the phase response of the digital lter. Table P11.5 i pi Ri 1 4.248359 + j 0.867510 10.95923 j 39.42517 2 3.735708 + j 2.626272 14.12677 + j 12.70117 3 2.515932 + j 4.492673 3.16754 j 0.202460 DESIGN OF RECURSIVE (IIR) FILTERS 557 11.6. A continuous-time system has a transfer function H A (s ) = s 2 3s + 3 s 2 + 3s + 3 (a ) Find the amplitude response. (b) Can one design a corresponding discrete-time system by using the invariant impulse-response method? If so, carry out the design employing a sampling frequency of 10 rad/s. Otherwise, explain the reasons for the failure of the method. 11.7. A lowpass digital lter that would satisfy the specications of Fig. P11.7 is required. (a ) Obtain a design by applying the invariant impulse-response method to an appropriate Chebyshev approximation. The sampling frequency is 20,000 rad/s. (b) Check your design by plotting the amplitude responses of the original analog lter and the designed digital lter. Loss, dB 30 0.5 , rad/s 1000 2000 Figure P11.7 11.8. A bandpass lter is required with passband edges of 900 and 1600 rad/s and a maximum passband loss of 1.0 dB. Obtain a design by employing the invariant impulse-response method. Start with a second-order normalized lowpass Chebyshev approximation and neglect the effects of aliasing. A suitable sampling frequency is 10,000 rad/s. 11.9. Given an analog lter characterized by N H A (s ) = i =1 Ri s pi a corresponding digital lter characterized by HD (z ) can be derived such that R A u (t ) t =nT = R D u (nT ) This is called the invariant unit-step-response approximation method [15, 16]. 558 DIGITAL SIGNAL PROCESSING (a) Show that HD (e j T ) H A ( j ) if 1/ T and H A ( j ) 0 j for || < for || s 2 s 2 (b) Show that N H D (z ) = i =1 Ri z e pi T where Ri = (e pi T 1) Ri pi 11.10. (a) Design a third-order digital lter by applying the invariant unit-step-response method (see Prob. 11.9) to the transfer function in Prob. 11.1. Assume that s = 10 rad/s. (b) Compare the design with that obtained in Prob. 11.1. 11.11. Given an analog lter characterized by N H A (s ) = H0 + i =1 Ri s pi a corresponding digital lter characterized by HD (z ) can be derived such that R A u (t ) sin 0 t t =nT = R D u (nT ) sin 0 nT This is the so-called invariant sinusoid-response approximation method [17]. (a) Show that HD (e j T ) if 1/ T and 20 (cos T cos 0 T ) H A ( j ) 2 (0 2 )T sin 0 T 0 H A ( j ) 0 2 0 2 N for || < s 2 for || s 2 (b) Show that HD (z ) = H0 + i =1 Ui z + Vi z e pi T where Ui = (0 e pi T pi sin 0 T 0 cos 0 T ) Ri Vi = [e pi T ( pi sin 0 T 0 cos 0 T ) + 0 ] Ri Ri = Ri 2 ( pi2 + 0 ) sin 0 T 11.12. (a) Redesign the lter of Prob. 11.1 by employing the invariant sinusoid-response method (see Prob. 11.11). The value of 0 may be assumed to be 1 rad/s. (b) Plot the resulting phase response. 11.13. Design a lowpass lter that would satisfy specications of Fig. P11.7 by applying the modied invariant impulse-response method to a suitable elliptic approximation. The sampling frequency is 20,000 rad/s. DESIGN OF RECURSIVE (IIR) FILTERS 559 11.14. A given third-order lowpass Chebyshev lter has a transfer function H (s ) = H0 (s p0 )(s p1 )(s p1 ) where H0 = 0.49, p0 = 0.494, p1 = 0.247 + j 0.966, and p1 is the complex conjugate of p1 . (a ) Obtain a corresponding discrete-time transfer function using the matched-z transformation method assuming a sampling frequency of 20 rad/s. (b) What are the advantages and disadvantages of the matched-z transformation method and the invariant impulse-response method? 11.15. (a ) Design a digital lter by applying the matched-z transformation method to the inverse-Chebyshev lter of Example 10.5 assuming a sampling frequency of 20 rad/s. (b) Check your design by plotting the amplitude responses of the original analog lter and the designed digital lter. 11.16. An analog elliptic lowpass lter with a passband edge p = 0.7075 rad/s has a transfer function of the form H (s ) = 0.07488(s 2 + 2.577) (s + 0.3818)(s 2 + 0.3069s + 0.5053) (a ) Obtain a continuous-time highpass transfer function with the same passband edge. (b) Obtain a corresponding discrete-time highpass transfer function using the matched-z transformation method. The sampling frequency is 20 rad/s. 11.17. Design a lowpass lter that would satisfy the specications of Fig. P11.7 by applying the matchedz transformation method to an appropriate Chebyshev approximation. The sampling frequency is 20,000 rad/s. 11.18. Design a highpass lter that would satisfy the specications of Fig. P11.18. Use the matched-z transformation method along with an elliptic approximation. Assume that s = 6000 rad/s. Loss, dB 40 0.1 , rad/s 400 800 Figure P11.18 560 DIGITAL SIGNAL PROCESSING 11.19. (a ) Obtain a digital-lter network by applying the bilinear transformation to the transfer function H A (s ) = s2 s2 + 2s + 1 (b) Evaluate the gain of the lter for = 0 and = / T . 11.20. (a) Obtain a discrete-time transfer function by applying the bilinear transformation of the transfer function of Prob. 11.1. The sampling frequency is 4 rad/s. (b) Determine the gain and phase-shift of the lter at = 0 and = rad/s. 11.21. Design a digital lter by applying the bilinear transformation to the Chebyshev transfer function of Example 10.3. The sampling frequency is 10 rad/s. 11.22. Design a digital lter by applying the bilinear transformation to the inverse-Chebyshev transfer function of Example 10.5. The sampling frequency is 20 rad/s. 11.23. The lowpass transfer function of Example 10.6 is subjected to the bilinear transformation. (a) Assuming that s = 10 rad/s, nd the resulting passband and stopband edges and also the inniteloss frequencies. (b) Determine the effective selectivity factor3 for the digital lter designed. (c) Find the minimum value of s if the passband and stopband edges in the digital lter are to be within 1 percent of the corresponding values in the analog lter. 11.24. Redesign the highpass lter in Prob. 11.16, part (a ), using the bilinear transformation. 11.25. An analog elliptic lowpass lter has the following specications: Passband edge p = 0.6325 rad/s Stopband edge a = 1.5811 rad/s Maximum passband loss = 0.5 dB Minimum stopband loss = 37.7 dB The lter is characterized by the transfer function 0.05917(s 2 + 3.2634) (s + 0.4209)(s 2 + 0.3618s + 0.4587) (a ) Design a corresponding lowpass digital lter using the bilinear-transformation method assuming a sampling frequency of 2 rad/s. (b) Find the passband and stopband edges of the digital lter. (c) Find the maximum passband loss and minimum stopband loss of the digital lter. (a) Obtain a continuous-time fourth-order highpass transfer function with a 3-dB cutoff frequency at 1 rad/s using the Butterworth approximation. (b) Obtain a corresponding discrete-time transfer function using the bilinear transformation. Assume a sampling frequency of 10 rad/s. (c) Determine the exact 3-dB cutoff frequency of the digital lter. Derive the lowpass-to-highpass transformation of Table 11.7. Derive the lowpass-to-bandpass transformation of Table 11.7. HD (z ) represents a lowpass lter with a passband edge p . Show that HD (z ) represents a highpass lter with a passband edge p s /2. The transfer function 2 a0 j + a1 j z + a0 j z 2 H (z ) = H0 b0 j + b1 j z + z 2 j =1 H (s ) = 11.26. 11.27. 11.28. 11.29. 11.30. 3 This is the ratio of the actual passband edge to the actual stopband edge. DESIGN OF RECURSIVE (IIR) FILTERS 561 where ai j and bi j are given in Table P11.30, represents a lowpass digital lter with a passband edge of 1 rad/s if s = 2 rad/s. By using the lowpass-to-highpass transformation in Table 11.7, design a highpass lter with a passband edge of 2 rad/s if s = 2 rad/s. Table P11.30 j 1 2 a0 j 1.722415 E 1 1.727860 E 1 a1 j 3.444829 E 1 3.455720 E 1 b0 j 4.928309 E 1 7.892595 E 1 b1 j 1.263032 9.753164 E 1 H0 = 3.500865 E 1 11.31. By using the transfer function of Prob. 11.30 obtain a lowpass cascade canonic structure whose passband edge can be varied by varying a single parameter. This page intentionally left blank CHAPTER 12 RECURSIVE (IIR) FILTERS SATISFYING PRESCRIBED SPECIFICATIONS 12.1 INTRODUCTION The previous chapter has shown that given an analog lter, a corresponding digital lter can be readily obtained by using the bilinear transformation. This design method preserves the maxima and minima of the amplitude response and, as a consequence, passbands and stopbands in the analog lter translate into corresponding passbands and stopbands in the digital lter; furthermore, the passband ripple and minimum stopband attenuation in the analog lter are preserved in the digital lter, and the latter lter is stable if the former is stable. Owing to these important advantages, the bilinear transformation method is one of the most important methods for the design of digital lters, if not the most important. As was demonstrated in Chap. 11, the main problem with the method is the so-called warping effect which introduces frequency-scale distortion. If 1 , 2 , . . . , i , . . . are the passband and stopband edges in the analog lter, then, according to Eq. (11.23), the corresponding passband and stopband edges in the derived digital lter are given by i T 2 tan1 T 2 i = i = 1, 2, . . . 563 Copyright 2006 by The McGraw-Hill Companies, Inc. Click here for terms of use. 564 DIGITAL SIGNAL PROCESSING Consequently, if prescribed passband and stopband edges 1 , 2 , . . . , i , . . . are to be achieved, the analog lter must be prewarped before the application of the bilinear transformation to ensure that its band edges are given by i = iT 2 tan T 2 If this could be accomplished, then the band edges of the digital lter would assume their prescribed values i since i = i T 2 tan1 T 2 iT 2 T2 tan = tan1 T 2T 2 for i = 1, 2, . . . = i The design of lowpass, highpass, bandpass, and bandstop lters is usually accomplished in two steps. First a normalized continuous-time lowpass transfer function is transformed into a denormalized lowpass, highpass, bandpass, or bandstop transfer function employing one of the standard analog-lter transformations described in Sec. 10.8. Then the bilinear transformation is applied. Prewarping can be effected by choosing the parameters in the analog-lter transformations appropriately. This chapter considers the details of the above design procedure. Formulas are derived for the parameters of the analog-lter transformations for Butterworth, Chebyshev, inverse-Chebyshev, and elliptic lters, which simplify the design of digital lters satisfying prescribed specications [1]. 12.2 DESIGN PROCEDURE Consider a normalized analog lowpass lter characterized by HN (s ) with a loss A N () = 20 log and assume that 0 A N ( ) A p A N () Aa for 0 || p for a || 1 | HN ( j )| as illustrated in Fig. 12.1. A corresponding denormalized lowpass (LP), highpass (HP), bandpass (BP), or bandstop (BS) digital lter with the same passband ripple and the same minimum stopband loss can be derived by using the following steps: 1. Form s H X ( ) = HN (s ) s = f X ( ) s (12.1) where f X ( ) is one of the transformations given in Table 12.1 (see Sec. 10.8). s RECURSIVE (IIR) FILTERS SATISFYING PRESCRIBED SPECIFICATIONS 565 A() Aa Ap p c a Figure 12.1 Loss characteristic of normalized LP analog lter. 2. Apply the bilinear transformation to H X ( ), that is, s H D (z ) = H X ( ) s s= 2 T z1 z+1 (12.2) If the derived lter is to have prescribed passband and stopband edges, the parameters , 0 , and B in Table 12.1 and the order of HN (s ) must be chosen appropriately. Formulas for these parameters for the various standard types of analog-lter approximations are derived in the following section. 12.3 12.3.1 DESIGN FORMULAS Lowpass and Highpass Filters Consider the lowpass-lter specications of Fig. 12.2, where p and a are the desired passband and stopband edges, and assume that the above design procedure yields a transfer function H D (z ) such that 1 A D ( ) = 20 log | HD (e j T )| Table 12.1 X LP HP BP BS Standard forms of f X ( ) s f X ( s) s s 1 B s2 s+ Bs 2 + 0 2 0 s 566 DIGITAL SIGNAL PROCESSING A() Aa Ap ~ p p a ~ a Figure 12.2 Loss characteristic of LP digital lter. where 0 AD( ) A p A D ( ) Aa for for 0 | | a p | | s /2 as shown in Fig. 12.2. If we let s = j and s = j in Eq. (12.1), then from Table 12.1 | HLP ( j )| = | HN ( j )| provided that Hence = p = p a = a (12.3) (12.4) where p and a denote the passband and stopband edges, respectively, in HLP ( ). If we now let s z = e j T and s = j in Eq. (12.2), we get | H D (e j T )| = | HLP ( j )| T 2 tan T 2 pT provided that Thus = p = 2 tan T 2 a = tan T 2 aT 2 (12.5) (12.6) RECURSIVE (IIR) FILTERS SATISFYING PRESCRIBED SPECIFICATIONS 567 and from Eqs. (12.3)(12.6), we obtain p = 2 tan T 2 a = tan T pT 2 aT 2 (12.7) (12.8) From Eqs. (12.7) and (12.8), parameter of the lowpass-to-lowpass (LP-to-LP) transformation and the selectivity of the normalized analog LP lter can be deduced as = and p tan ( = a tan ( p T /2) a T /2) T p 2 tan ( p T /2) (12.9) (12.10) respectively. The digital LP lter will satisfy the prescribed specications if we force the actual passband and stopband edges p and a to be equal to the prescribed passband and stopband edges p and a , respectively, but, in practice, it is usually difcult to x both the passband and stopband edges at the prescribed values. A feasible alternative is to x the passband edge at the prescribed value and to make the stopband edge equal to or less than the prescribed stopband edge. This can be accomplished by assigning p = p and a a In this way, the loss at = p will be exactly equal to the minimum value specied and the loss at = a will be equal to or exceed the minimum value specied as can be seen in Fig. 12.2. With the above assignment, Eq. (12.9) gives the required value of the LP-to-LP transformation as = On the other hand, Eq. (12.10) gives p tan ( = a tan ( or p K0 a p T /2) a T /2) T p 2 tan ( p T /2) tan ( p T /2) tan ( a T /2) tan ( p T /2) tan ( a T /2) (12.11) where K 0 = The inequality in Eq. (12.11) can be justied by noting that a and a are both less than the Nyquist frequency, s /2, and hence the values of a T /2 and a T /2 are in the range 0 to /2. Since tan ( T /2) is a monotonic increasing function of over the range 0 < T /2 < /2 or 568 DIGITAL SIGNAL PROCESSING Table 12.2 Lowpass and highpass lters p K0 a = pT 2 tan ( p T /2) LP HP p 1 a K0 = 2 p tan ( p T /2) T p T /2) tan ( K0 = tan ( a T /2) where 0< < s /2 and a a , according to the above assignment, it follows that tan ( a T /2) tan ( a T /2). This inequality states, in effect, that the selectivity of the normalized analog LP lter, p /a , must be greater than or equal to constant K 0 , and this constraint imposes a lower limit on the order of HN (s ), as will be shown later. The preceding approach can be readily extended to highpass lters. The formulas for and p /a for LP and HP lters are summarized in Table 12.2. 12.3.2 Bandpass and Bandstop Filters Now consider the bandpass-lter specications of Fig. 12.3, where p1 , p2 and a 1 , a 2 represent the desired passband and stopband edges, respectively, and assume that the derived lter satises the A() Aa Ap Aa ~ a1 a1 p1 ~ p1 ~ p2 p2 a2 ~ a2 Figure 12.3 Loss characteristic of bandpass digital lter. RECURSIVE (IIR) FILTERS SATISFYING PRESCRIBED SPECIFICATIONS 569 conditions 0 AD( ) A p A D ( ) Aa for 0 | | for a1 p1 | | a2 p2 and | | s / 2 as shown in Fig. 12.3. From Eq. (12.1) and Table 12.1 | HBP ( j )| = | HN ( j )| provided that = and by solving for , we obtain = With B 2 2 0 + 1 B 2 0 B 2 a 2 (12.12) = p or the positive passband and stopband edges in HBP ( ) can be deduced from Eq. (12.12) as s p1 , p2 = a 1 , a 2 = p B + 2 a B + 2 2 0 + 2 p B 2 B 2 2 2 and 2 2 0 + a respectively. As can be readily veried 2 p 1 p 2 = 0 2 a 1 a 2 = 0 (12.13) (12.14) (12.15) (12.16) p2 p1 = p B a 2 a 1 = a B From Eq. (12.2) | H D (e j if T )| = | HBP ( j )| = T 2 tan T 2 570 DIGITAL SIGNAL PROCESSING and hence p1 = p2 a 1 a 2 We can now assign p1 2 T 2 = T 2 = T 2 = T tan tan tan tan p1 T 2 p2 T (12.17) (12.18) (12.19) (12.20) 2 a1 T 2 a2 T 2 = p1 and p2 = p2 (12.21) From Eqs. (12.15), (12.17), and (12.18), we obtain B= 2K A T p tan p1 T (12.22) where K A = tan p2 T 2 2 (12.23) Similarly, from Eqs. (12.13), (12.17), and (12.18) 0 = K B = tan 2 KB T tan p2 T (12.24) where p1 T 2 2 (12.25) With the passband edge of the normalized LP lter, p , the sampling period T (= 2/s ), and the specied passband edges for the digital lter, p1 and p2 , known, parameters B and 0 of the LP-to-BP transformation can be determined. In order to determine the minimum order of the normalized LP lter that would satisfy the specications, we need to derive an expression for the selectivity of the LP lter as was done in the case of lowpass lters in the previous section. From Eqs. (12.13) and (12.14), we have a 1 a 2 = p1 p2 and from Eqs. (12.17)(12.20) tan a1 T 2 tan a2 T 2 = tan p1 T 2 tan p2 T 2 but since the passband edges of the BP digital lter, p1 and p2 , have already been xed (see Eq. (12.21)), the right-hand side of the above equation has also been xed and, therefore, it is not in RECURSIVE (IIR) FILTERS SATISFYING PRESCRIBED SPECIFICATIONS 571 general possible to also x the stopband edges, a 1 and is to nd suitable values for a 1 and a 2 such that a1 a 2 , at the prescribed values. The alternative a1 and a2 a2 without violating Eqs. (12.14) and (12.16). In this way, the loss at = a 1 and a 2 will be equal to or exceed the minimum specied values as can be seen in Fig. 12.3. If a1 a1 then Eq. (12.19) gives a 1 = 2 tan T a1 T 2 a1 T 2 tan T 2 (12.26) since tan( T /2) is a monotonic increasing function over the range 0 to s /2, as was shown in the case of LP lters. Let us assume that a 2 is chosen such that Eqs. (12.14) and (12.16) are satised. If we eliminate a 2 in Eq. (12.16) using Eq. (12.14) and then eliminate a 1 using Eq. (12.19), we get a = = 2 2 0 a 1 B a 1 2 0 (2/ T )2 tan2 ( a 1 T /2) (2 B / T ) tan ( a 1 T /2) (12.27) Therefore, from Eqs. (12.26) and (12.27), we have a 2 0 (2/ T )2 tan2 ( a 1 T /2) (2 B / T ) tan ( a 1 T /2) and on eliminating 0 and B using Eqs. (12.24) and (12.22), we deduce p K1 a where K1 = K A tan ( a 1 T /2) K B tan2 ( a 1 T /2) (12.28) and constants K A and K B are given by Eqs. (12.23) and (12.25), respectively. In other words, in order to satisfy the required specications at the lower stopband edge, a 1 , the selectivity of the normalized analog LP lter must be equal to or exceed constant K 1 . On the other hand, if a2 a2 572 DIGITAL SIGNAL PROCESSING then from Eq. (12.20) a 2 = 2 tan T a2 T 2 a2 T 2 tan T 2 (12.29) since a 2 a 2 and tan T /2 is a monotonic increasing function over the range 0 < < s /2. Let us assume that a 1 is chosen such that Eqs. (12.14) and (12.16) are satised. If we eliminate a 1 in Eq. (12.16) using Eq. (12.14) and then eliminate a 2 using Eq. (12.20), we get a = = 2 a 2 0 2 B a 2 2 (2/ T )2 tan2 ( a 2 T /2) 0 (2 B / T ) tan ( a 2 T /2) (12.30) Therefore, from Eqs. (12.29) and (12.30), we have a 2 (2/ T )2 tan2 ( a 2 T /2) 0 (2 B / T ) tan ( a 2 T /2) and on eliminating 0 and B , we conclude that p K2 p where K2 = K A tan ( a 2 T /2) tan2 ( a 2 T /2) K B (12.31) That is, in order to satisfy the required specications at the upper stopband edge, a 2 , the selectivity of the normalized analog LP lter must be equal to or exceed constant K 2 . Summarizing, if a 1 a 1 and a 2 is assumed to satisfy the required constraints, then p /a K 1 ; and if a 2 a 2 and a 1 is assumed to satisfy the required constraints, then p /a K 2 . These relations also hold in the reverse order, that is, if p /a K 1 then a 1 a 1 and if p /a K 2 then a 2 a 2 . Therefore, if we ensure that p K a then a1 where K = max( K 1 , K 2 ) a2 a1 and a2 as required. In words, in order to satisfy the specications at the lower stopband edge, we need a selectivity of at least K 1 for the normalized LP lter and to satisfy the specications at the upper stopband edge, we need a selectivity of at least K 2 . Therefore, choosing the larger value of the selectivity would ensure that the specications are satised at both stopband edges. The appropriate value for K is easily deduced from Eqs. (12.28) and (12.31) as K= K1 K2 if K C K B if K C < K B RECURSIVE (IIR) FILTERS SATISFYING PRESCRIBED SPECIFICATIONS 573 Table 12.3 Bandpass and bandstop lters 0 = 2 KB T K1 K2 if K C K B if K C < K B BP p a B= BS 2K A T p 2 KB 0 = T 1 K p 2 1 a K1 B= if K C K B if K C < K B where 2K A p T p1 T p2 T tan K A = tan 2 2 a2 T a1 T tan K C = tan 2 2 K A tan ( a 2 T /2) K2 = tan2 ( a 2 T /2) K B K B = tan p1 T 2 2 K A tan ( a 1 T /2) K1 = K B tan2 ( a 1 T /2) tan p2 T where K C = tan a1 T 2 tan a2 T 2 The same approach can also be applied to deduce appropriate formulas for bandstop lters. The required design formulas for BP and BS lters are summarized in Table 12.3. The formulas derived so far are very general and apply to any normalized LP lter that has a loss characteristic of a form illustrated in Fig. 12.1. Specic formulas for Butterworth, Chebyshev, inverse-Chebyshev, and elliptic lters can fairly easily be obtained as will now be demonstrated. 12.3.3 Butterworth Filters The loss in a normalized Butterworth lter is given by A N () = 10 log (1 + 2n ) 574 DIGITAL SIGNAL PROCESSING (see Sec. 10.3) where n is the order of the transfer function. Evaluating A N () for = p and a , we get A N ( p ) = A p = 10 log 1 + 2n p Solving for p and a , we obtain p = (100.1 A p 1)1/2n and a = (100.1 Aa 1)1/2n (12.32) and 2 A N (a ) = Aa = 10 log 1 + an Hence from Eq. (12.32) and Tables 12.2 and 12.3, we have p = a 100.1 A p 1 100.1 Aa 1 1/2n K where K depends on the type of lter and is given in terms of constants K 0 , K 1 , and K 2 in Table 12.4. Solving for n , we obtain n where D= 100.1 Aa 1 100.1 A p 1 (12.33) log D 2 log (1/ K ) The smallest integer that would satisfy the above equation is the minimum lter order that would satisfy the required specications. Table 12.4 LP HP Butterworth lters K = K0 K= K= 1 K0 if K C K B if K C < K B if K C K B if K C < K B D= 100.1 Aa 1 100.1 A p 1 BP BS K1 K2 1 K2 K= 1 K1 log D 2 log (1/ K ) n p = (100.1 A p 1)1/2n RECURSIVE (IIR) FILTERS SATISFYING PRESCRIBED SPECIFICATIONS 575 12.3.4 Chebyshev Filters In normalized Chebyshev lters, we have A N () = 10 log [1 + 2 Tn2 ()] where with and (see Sec. 10.4). For = a A N (a ) = Aa = 10 log {1 + (100.1 A p 1)[cosh (n cosh1 a )]2 } 1 cosh1 D a = cosh n Tn () = cosh (n cosh1 ) 2 = 100.1 A p 1 p = 1 (12.34) for p < or (12.35) Thus from Eqs. (12.34) and (12.35) and Tables 12.2 and 12.3, we obtain p = a cosh 1 1 n cosh1 D K where K is given in terms of constants K 0 , K 1 , and K 2 in Table 12.5. Solving for n , the order of the normalized LP lter that would satisfy the specications must satisfy the inequality cosh1 D n cosh1 (1/ K ) Table 12.5 LP HP Chebyshev lters K = K0 K= K= 1 K0 if K C K B if K C < K B if K C K B if K C < K B D= 100.1 Aa 1 100.1 A p 1 K1 K2 1 K2 BS K= 1 K1 cosh1 D n cosh1 (1/ K ) BP p = 1 576 DIGITAL SIGNAL PROCESSING where cosh1 x can be evaluated using the identity cosh1 x = ln (x + x 2 1) 12.3.5 Inverse-Chebyshev Filters In normalized inverse-Chebyshev lters, the loss is given by A N () = 10 log 1 + where with and 1 2 Tn2 (1/) for 0 < < a Tn (1/) = cosh [n cosh1 (1/)] 2 = 1 100.1 Aa 1 a = 1 (12.36) (see Sec. 10.5). For = p , we can write A N ( p ) = 10 log 1 + Now solving for p , we obtain p = and from Eqs. (12.36) and (12.37) p = a cosh 1 1 n 1 2 Tn2 (1/ p ) 1 cosh 1 n cosh1 (12.37) D cosh1 D K Therefore, the order of the normalized LP lter must satisfy the inequality cosh1 D n cosh1 (1/ K ) where K in terms of constants K 0 , K 1 , and K 2 is given in Table 12.5. Evidently, the formula for n is the same as for Chebyshev lters and thus inverse-Chebyshev lters can be designed in the same way as Chebyshev ones using the parameters in Table 12.5 except that the value for p given by Eq. (12.37) should be used instead of unity. 12.3.6 Elliptic Filters p a In elliptic lters, the selectivity factor is dened as k= RECURSIVE (IIR) FILTERS SATISFYING PRESCRIBED SPECIFICATIONS 577 Table 12.6 Elliptic lters k p K0 LP HP BP K0 1 K0 K1 K2 1 K2 1 K1 log 16 D log (1/q ) if K C K B if K C < K B if K C K B if K C < K B D= 1 K0 K1 K2 1 K2 1 K1 BS n 100.1 Aa 1 100.1 A p 1 (see Sec. 10.6) and from Tables 12.2 and 12.3, we have kK where K = K 0 , 1/ K 0 , . . . . Since any value in the range 0 to 1, except for unity, is a permissible value for k , we can assign the lowest acceptable value, namely, k=K as in Table 12.6, which will lead to the lowest order normalized LP analog lter. With k chosen, the value of p is also xed, that is, p = k Finally, with k , A p , and Aa known the necessary value for n can be computed by using the formula in Table 12.6 (see Sec. 10.6.5). 12.4 DESIGN USING THE FORMULAS AND TABLES The formulas and tables developed in the preceding section lead to the following simple design procedure: 1. Using the prescribed specications, determine n and p , and for elliptic lters also k , from Tables 12.4 to 12.6 (use Eq. (12.37) to calculate p for inverse-Chebyshev lters). 2. Determine for LP and HP lters using Table 12.2 or B and 0 for BP and BS lters using Table 12.3. 578 DIGITAL SIGNAL PROCESSING 3. Form the normalized transfer function (see Chap. 10). 4. Apply the analog-lter transformation in Eq. (12.1). 5. Apply the bilinear transformation in Eq. (12.2). The procedure yields LP and HP lters that satisfy the specications exactly at the passband edge and oversatisfy the specications at the stopband edge. In the case of bandpass and bandstop lters, the specications are satised exactly at the two passband edges and are oversatised at the stopband edges. Example 12.1 Design a highpass lter that would satisfy the following specications: A p = 1 dB Aa = 45 dB p = 3.5 rad/s a = 1.5 rad/s s = 10 rad/s Use a Butterworth, a Chebyshev, and then an elliptic approximation. Solution Butterworth lter: The sampling period is T= From Table 12.2 K0 = Hence from Table 12.4 D= 104.5 1 = 1.221270 105 100.1 1 log D n 4.34 5 2 log K 0 tan (3.5/10) = 3.851840 tan (1.5/10) 2 2 = s 10 p = (100.1 1)0.1 = 8.736097 101 Now from Table 12.2 = pT 2 p tan = 5.457600 T 2 Chebyshev lter: From Table 12.5 ln D + D 1 cosh1 D n = 2 cosh1 K 0 ln K 0 + K 0 1 p = 1 3.24 4 RECURSIVE (IIR) FILTERS SATISFYING PRESCRIBED SPECIFICATIONS 579 Hence from Table 12.2 = 6.247183 Elliptic lter: From Table 12.6 k= 1 = 2.596162 101 K0 Now, from Eqs. (10.86)(10.88), we obtain k= 1 q0 = 2 1 k 2 = 9.657119 101 1 1+ k k = 4.361108 103 5 q = q0 + 2q0 + q0 Hence from Table 12.6 log 16 D 2.67 3 log (1/q ) p = k = 5.095255 101 n and from Table 12.2 = 3.183099 At this point the normalized LP Butterworth, Chebyshev, and elliptic approximations can be obtained (see Chap. 10). The designs can be completed by applying the LPto-HP transformation and after that the bilinear transformation to each of the three approximations. s The transfer functions HN (s ), H H P ( ), and H D (z ) can be put in the form H0 a0 j + a1 j w + a2 j w 2 b + b1 j w + b2 j w 2 j =1 0 j J where H0 is a multiplier constant and w = s , s , or z . The coefcients of HN (s ) can be s computed as in Table 12.7, those of HHP ( ) as in Table 12.8, and those of H D (z ) as in Table 12.9. The loss characteristics of the three lters are plotted in Fig. 12.4. The actual minimum stopband loss for the Butterworth, Chebyshev, and elliptic lter are 52.70, 58.45, and 52.90 dB, respectively. 580 DIGITAL SIGNAL PROCESSING Table 12.7 Coefcients of HN (s ) (Example 12.1) j a0 j 1 1 1 a1 j 0 0 0 a2 j 0 0 0 1 1 1 b0 j b1 j 1.0 1.618034 6.180340 E 1 b2 j 0 1 1 Butterworth 1 2 3 H0 = 1.0 Chebyshev 1 2 1 1 0 0 0 0 2.793981 E 1 9.865049 E 1 6.737394 E 1 2.790720 E 1 1 1 H0 = 2.456533 E 1 Elliptic 1 2 1.0 5.091668 0 0 0 1 2.573050 E 1 2.592344 E 1 1.0 2.442048 E 1 0 1 H0 = 1.310029 E 2 Table 12.8 Coefcients of HHP ( ) (Example 12.1) s j a0 j 0 0 0 a1 j 1 0 0 a2 j 0 1 1 b0 j 5.457600 2.978540 E + 1 2.978540 E + 1 b1 j 1.0 8.830582 3.372982 b2 j 0 1 1 Butterworth 1 2 3 H0 = 1.0 Chebyshev 1 2 0 0 0 0 1 1 1.396835 E + 2 3.956118 E + 1 1.506443 E + 1 1 1.767263 1 H0 = 8.912509 E 1 Elliptic 1 2 0.0 1.989941 1 0 0 1 1.237091 E + 1 3.908478 E + 1 1.0 2.998552 0 1 H0 = 1.0 RECURSIVE (IIR) FILTERS SATISFYING PRESCRIBED SPECIFICATIONS 581 Table 12.9 Coefcients of H D (z ) (Example 12.1) j a0 j 1 1 1 a1 j 1 2 2 a2 j 0 1 1 b0 j 2.632312 E 1 1.735936 E 1 5.760838 E 1 b1 j 1.0 5.778156 E 1 7.759805 E 1 b2 j 0 1 1 Butterworth 1 2 3 H0 = 1.097518 E 2 Chebyshev 1 2 1 1 2 2 1 1 5.150704 E 1 7.966193 E 1 1.310140 1.063983 1 1 H0 = 8.363241 E 3 Elliptic 1 2 1 1 1.0 1.343365 0 1 5.907039 E 1 6.751385 E 1 1.0 9.854281 E 1 0 1 H0 = 4.221731 E 2 70 60 50 40 30 20 10 0 Passband loss, dB 1.0 4 3.5 5 Elliptic (n = 3) Chebyshev (n = 4) Loss, dB Butterworth (n = 5) 0 1 1.5 2 , rad/s 3 Figure 12.4 Loss characteristics of highpass lters (Example 12.1). 582 DIGITAL SIGNAL PROCESSING Example 12.2 Design an elliptic bandpass lter that would satisfy the following specicaAa = 45 dB = 900 rad/s = 1100 rad/s tions: A p = 1 dB p1 p2 a 1 = 800 rad/s Solution a 2 = 1200 rad/s s = 6000 rad/s From Table 12.3 K A = tan K B = tan K C = tan 900 1100 tan = 1.398821 101 6000 6000 1100 900 tan = 3.308897 101 6000 6000 1200 800 tan = 3.234776 101 6000 6000 Hence K C < K B and from Table 12.6, we get k = K2 = p = K A tan ( a 2 T /2) = 5.159570 101 tan2 ( a 2 T /2) K B K 2 = 7.183016 101 D is the same as in Example 12.1, that is, D = 1.221270 105 , and from Eqs. (10.86) (10.88), we have 1 k 2 = 8.566144 101 1 1 k q0 = = 1.933628 102 2 1+ k k= 5 q = q0 + 2q0 + 1.933629 102 Hence n log 16 D 3.67 4 log (1/q ) Now, from Table 12.3 2 KB 0 = = 1.098609 103 T and B= 2 KA = 3.719263 102 T p The parameters of the elliptic approximation and the LP-to-BP transformation are, at this point, available. Hence the elliptic approximation can be obtained (see Sec. 10.6.6). RECURSIVE (IIR) FILTERS SATISFYING PRESCRIBED SPECIFICATIONS 583 Table 12.10 j 1 2 3 4 a0 j 1.0 1.0 1.0 1.0 Coefcients of HD (z ) (Example 12.2) a1 j b0 j 9.268668 E 9.306057 E 9.738539 E 9.767824 E 1 1 1 1 b1 j 8.886598 E 1 1.046605 8.048914 E 1 1.160308 1.602667 7.283103 E 3 1.331115 5.885571 E 1 H0 = 3.444154 E 3 Applying the LP-to-BP transformation followed by the bilinear transformation yields the transfer function of the required lter as H D (z ) = H0 a0 j + a1 j z + z 2 b + b1 j z + z 2 j =1 0 j 4 The numerical values of the coefcients are given in Table 12.10. The loss characteristic of the lter is plotted in Fig. 12.5. The actual minimum stopband loss is 50.64 dB. 70 60 50 40 30 20 10 0 0 500 800 1000 900 1100 1200 1500 1.0 Passband loss, dB Loss, dB , rad/s 2000 Figure 12.5 Loss characteristic of elliptic bandpass lter (Example 12.2). 584 DIGITAL SIGNAL PROCESSING Example 12.3 Design a Chebyshev bandstop lter that would satisfy the following speciAa = 40 dB = 350 rad/s = 700 rad/s cations: A p = 0.5 dB p1 p2 a 1 = 430 rad/s Solution a 2 = 600 rad/s s = 3000 rad/s The sampling period is given by T= Hence 35 2 300 a1 T 43 = 2 300 p1 T 2 2 = s 3000 70 2 300 a2 T 60 = 2 300 p2 T = = From Table 12.3, we have 35 70 tan = 5.165400 101 300 300 70 35 tan = 3.456327 101 K B = tan 300 300 60 43 tan = 3.512244 101 K C = tan 300 300 Since K C > K B , according to Table 12.5, we need to compute K = 1/ K 2 , that is, K A = tan K= From Table 12.5, 104.0 1 = 8.194662 104 100.05 1 cosh1 D = 4.70 5 n= cosh1 1/ K p = 1 D= Now from Table 12.3, the parameters of the LP-to-BS transformation can be obtained as 2 KB = 5.614083 102 0 = T 2K A p = 4.932594 102 B= T 1 tan2 ( a 2 T /2) K B = = 4.855769 101 K2 K A tan ( a 2 T /2) RECURSIVE (IIR) FILTERS SATISFYING PRESCRIBED SPECIFICATIONS 585 Table 12.11 j 1 2 3 4 5 a0 j 1.0 1.0 1.0 1.0 1.0 Coefcients of H D (z ) (Example 12.3) a1 j b0 j 1 1 1 1 1 2.887281 E 6.230100 E 7.543570 E 9.168994 E 9.428927 E 2 1 1 1 1 b1 j 4.722491 E 1 5.028889 E 2 1.400163 2.175109 E 1 1.435926 9.725792 E 9.725792 E 9.725792 E 9.725792 E 9.725792 E H0 = 2.225052E 1 By obtaining the appropriate Chebyshev approximation (see Sec. 10.4.3) and then applying the LP-to-BS transformation followed by the bilinear transformation the transfer function is of the required digital lter can be obtained as H D (z ) = H0 a0 j + a1 j z + z 2 b + b1 j z + z 2 j =1 0 j 5 where the coefcients ai j and bi j are given in Table 12.11. The loss characteristic of the lter is plotted in Fig. 12.6. The actual minimum stopband loss is 43.50 dB. 60 50 30 20 10 0.5 0 0 200 400 350 430 , rad/s 800 600 700 1000 Figure 12.6 Loss characteristic of Chebyshev bandstop lter (Example 12.3). Passband loss, dB 40 Loss, dB 586 DIGITAL SIGNAL PROCESSING 12.5 CONSTANT GROUP DELAY The phase response in lters designed by using the method described in this chapter is in general quite nonlinear because of two reasons. First, the Butterworth, Chebyshev, inverse-Chebyshev, and elliptic approximations are inherently nonlinear-phase approximations. Second, the warping effect tends to increase the nonlinearity of the phase response. As a consequence, the group delay tends to vary with frequency and the application of these lters tends to introduce delay distortion (see Sec. 5.7). Constant group-delay lters can sometimes be designed by using constant-delay approximations such as the Bessel-Thomson approximation with design methods that preserve the linearity in the phase response of the analog lter, e.g., the invariant impulse-response method. However, a constant delay and prescribed loss specications are usually difcult to achieve simultaneously, particularly if bandpass or bandstop high-selectivity lters are desired. 12.5.1 Delay Equalization The design of constant-delay analog lters satisfying prescribed loss specications is almost invariably accomplished in two steps. First a lter is designed satisfying the loss specications ignoring the group delay. Then a delay equalizer is designed which can be used in cascade with the lter to compensate for variations in the group delay of the lter. The same technique can also be used in digital lters. Let HF (z ) and HE (z ) be the transfer functions of the lter and equalizer, respectively. The group delays of the lter and equalizer are given by d F () d d E () d F () = respectively, where and E () = F () = arg HF (e j T ) and E () = arg HE (e j T ) The overall transfer function of the lter-equalizer combination is HFE (z ) = HF (z ) HE (z ) Hence and | HFE (e j T )| = | HF (e j T )|| HE (e j T )| FE () = F () + E () (12.38) Now from Eq. (12.38), the overall group delay of the lter-equalizer combination can be obtained as FE () = F () + E () RECURSIVE (IIR) FILTERS SATISFYING PRESCRIBED SPECIFICATIONS 587 Therefore, a digital lter that satises prescribed loss specications and has constant group delay with respect to some passband p1 p2 can be designed using the following steps: 1. Design a lter satisfying the loss specications using the procedure in Sec. 12.4. 2. Design an equalizer with | HE (e j T )| = 1 and where is a constant. From step 2, HE (z ) must be an allpass transfer function of the form H E (z ) = 1 + c1 j z + c0 j z 2 c + c1 j z + z 2 j =1 0 j M for 0 s /2 for p1 p2 (12.39) E () = F () (12.40) The equalizer can be designed by nding a set of values for c0 j , c1 j , , and M such that (a) Eq. (12.39) is satised to within a prescribed error in order to achieve approximately constant group delay with respect to the passband, and (b) the poles of HE (z ) are inside the unit circle of the z plane to ensure that the equalizer is stable. Equalizers can be designed by using optimization methods as will be demonstrated in Sec. 16.8. Note that delay equalization is unnecessary for stopbands since signals that pass through stopbands are normally deemed to be noise and delay distortion in noise is of no concert. 12.5.2 Zero-Phase Filters In nonreal-time applications, the problem of delay distortion can be eliminated in a fairly simple manner by designing the lter as a cascade arrangement of two lters characterized by H (z ) and H (z 1 ), as depicted in Fig. 12.7a . Since H (e j T ) is the complex conjugate of H (e j T ), the frequency response of the cascade arrangement can be expressed as H0 (e j T ) = H (e j T ) H (e j T ) = | H (e j T )|2 H(z) H(z1) (a) H(z) R H(z) R (b) Figure 12.7 (a) Zero-phase lter, (b) implementation. 588 DIGITAL SIGNAL PROCESSING In other words, the frequency response of the arrangement is real and, as a result, the lter has zero phase response and, therefore, it would introduce zero delay. If a lter with passband ripple A p and minimum stopband loss Aa is required, the design can be readily completed by obtaining a transfer function with passband ripple A p /2 and minimum stopband loss Aa /2, since the two lters in Fig. 12.7a have identical amplitude responses. If the impulse response of the rst lter is h (nT ), then that of the second lter is h (nT ), as can be readily demonstrated (see Prob. 12.20), and if the rst lter is causal, the second one is noncausal. Hence the cascade of Fig. 12.7a can be implemented, as depicted in Fig. 12.7b, where devices R are used to reverse the signals at the input and output of the second lter. In this arrangement, the rst lter introduces a certain delay, which depends on the frequency, and thus a certain amount of delay distortion is introduced. The second lter introduces exactly the same delay as the rst, but, since the signal is fed backward, the delay is actually a time advance and, therefore, cancels the delay of the rst lter. The scheme of Fig. 12.7 is suitable for nonreal-time applications since it uses a noncausal lter. An alternative approach for the design of constant-delay lters that can be used for nonreal- or real-time applications is to use nonrecursive approximations which are explored in Chaps. 9 and 15. 12.6 AMPLITUDE EQUALIZATION In many applications, a lter is required to operate in cascade with a channel or system that does not have a constant amplitude response (e.g., a D/A converter, Fig. 6.17d ). If the transfer function of such a channel is HC (z ) and the passband of the channel-lter combination extends from p1 to p2 , then the transfer function of the lter must be chosen such that | HC (e j T ) HF (e j T )| = 1 for p1 p2 to within a prescribed tolerance in order to keep the amplitude distortion to an acceptable level (see Sec. 5.7). If the variation in the amplitude response of the channel is small, it may be possible to solve the problem by taking the channel loss into account when the lter specications are formulated. Alternatively, if the variation of the amplitude response of the channel is large, then the lter may have to be tuned or redesigned using one of the optimization methods described in Chap. 16 (e.g., see Example 16.3). REFERENCES [1] A. Antoniou, Design of elliptic digital lters: Prescribed specications, Proc. Inst. Elect. Eng., Part G, vol. 124, pp. 341344, Apr. 1977 (see vol. 125, p. 504, June 1978 for errata). PROBLEMS 12.1. Design a lowpass digital lter that would satisfy the specications of Fig. P12.1. Use a Butterworth approximation. RECURSIVE (IIR) FILTERS SATISFYING PRESCRIBED SPECIFICATIONS 589 s = 5000 rad/s Loss, dB 45 0.5 , rad/s 800 1600 Figure P12.1 12.2. Redesign the lter of Prob. 12.1 using a Chebyshev approximation. 12.3. Redesign the lter of Prob. 12.1 using an inverse-Chebyshev approximation. 12.4. Redesign the lter of Prob. 12.1 using an elliptic approximation. 12.5. Design a highpass digital lter that would satisfy the specications of Fig. P12.5. Use a Butterworth approximation. 12.6. Redesign the lter of Prob. 12.5 using a Chebyshev approximation. 12.7. Redesign the lter of Prob. 12.5 using an inverse-Chebyshev approximation. 12.8. Redesign the lter of Prob. 12.5 using an elliptic approximation. 12.9. Design a bandpass digital lter that would satisfy the specications of Fig. P12.9. Use a Butterworth approximation. 12.10. Redesign the lter of Prob. 12.9 using a Chebyshev approximation. 12.11. Redesign the lter of Prob. 12.9 using an inverse-Chebyshev approximation. 12.12. Redesign the lter of Prob. 12.9 using an elliptic approximation. 12.13. Design a bandstop digital lter that would satisfy the specications of Fig. P12.13. Use a Butterworth approximation. 12.14. Redesign the lter of Prob. 12.13 using a Chebyshev approximation. 12.15. Redesign the lter of Prob. 12.13 using an inverse-Chebyshev approximation. 12.16. Redesign the lter of Prob. 12.13 using an elliptic approximation. 590 DIGITAL SIGNAL PROCESSING s = 10,000 rad/s Loss, dB 40 0.1 , rad/s 1600 3200 Figure P12.5 s = 100 rad/s Loss, dB 30 30 1.0 , rad/s 10 20 30 40 Figure P12.9 RECURSIVE (IIR) FILTERS SATISFYING PRESCRIBED SPECIFICATIONS 591 s = 3,000 rad/s Loss, dB 35 0.3 0.3 , rad/s 100 200 400 700 Figure P12.13 12.17. 12.18. 12.19. 12.20. Derive the formulas of Table 12.2 for highpass lters. Derive the formulas of Table 12.3 for bandstop lters. Shaw that the transfer function of Eq. (12.40) is an allpass transfer function. A digital lter with an impulse response h (nT ) has a transfer function H (z ). Show that a lter with a transfer function H (z 1 ) has an impulse response h (nT ). This page intentionally left blank CHAPTER 13 RANDOM SIGNALS 13.1 INTRODUCTION The methods of analysis considered so far assume deterministic signals. Frequently in digital lters and communication systems in general random signals are encountered, e.g., the noise generated by an analog-to-digital (A/D) converter or the noise generated by an amplier. Signals of this type can assume an innite number of waveforms, and measurement will at best yield a set of typical waveforms. Despite the lack of a complete description, many statistical attributes of a random signal can be determined from a statistical description of the signal. The time- and frequency-domain statistical attributes of random signals as well as the effect of ltering on such signals can be studied by using the concept of a random process. This chapter provides a brief description of random processes. The main results are presented in terms of continuous-time random signals and are then extended to discrete-time signals by using the interrelation between the Fourier and z transforms. The chapter begins with a brief summary of the essential features of random variables. Detailed discussions of random variables and processes can be found in [15]. 13.2 RANDOM VARIABLES Consider an experiment which may have a nite or innite number of random outcomes, and let 1 , 2 , . . . be the possible outcomes. A set S comprising all the possible can be constructed, and a number x( ) can be assigned to each according to some rule. The function x( ), or simply x, whose domain is set S and whose range is a set of numbers is called a random variable. Typical random variables are the coordinates of the hit position in an experiment of target practice or the speed and 593 Copyright 2006 by The McGraw-Hill Companies, Inc. Click here for terms of use. 594 DIGITAL SIGNAL PROCESSING direction of the wind at some specied instant in a given region or at some specied location over a period of time. Specic random variables that will be studied in some detail in Chap. 14 are the errors introduced by the quantization of signals and lter coefcients. 13.2.1 Probability-Distribution Function A random variable x may assume values in a certain range (x1 , x2 ), where x1 can be as low as and x2 as high as +. The probability of observing random variable x below or at value x is referred to as the probability-distribution function of x and is denoted as Px (x ) = Pr [x x ] 13.2.2 Probability-Density Function The derivative of Px (x ) with respect to x is called the probability-density function of x and is denoted as d Px (x ) px ( x ) = dx A fundamental property of px (x ) is px ( x ) d x = 1 since the range (, +) must necessarily include the value of x. Also Px [x1 x x2 ] = x2 px ( x ) d x x1 13.2.3 Uniform Probability Density In many situations there is no preferred value or range for the random variable. In such a case, the probability density is said to be uniform and is given by 1 for x1 x x2 px ( x ) = x 2 x 1 0 otherwise 13.2.4 Gaussian Probability Density 1 2 2 e(x ) /2 2 Very common in nature is the Gaussian probability density given by px ( x ) = for x (13.1) The parameters and are constants. There are many other important probability-density functions, e.g., binomial, Poisson, and Rayleigh [1], but these are beyond the scope of this book. 13.2.5 Joint Distributions An experiment may have two sets of random outcomes, say, x 1 , x 2 , . . . and y 1 , y 2 , . . . . For example, in an experiment of target practice, the hit position can be described in terms of two RANDOM SIGNALS 595 coordinates. Experiments of this type necessitate two random variables, say, x and y. The probability of observing x and y below or at x and y , respectively, is said to be the joint distribution function of x and y and is denoted as Pxy (x , y ) = Pr [x x , y y ] The joint probability-density function of x and y is dened as pxy (x , y ) = 2 Pxy (x , y ) xy The range (, ) must include the values of x and y, and hence pxy (x , y ) d x d y = 1 The probability of observing x and y in the ranges x1 x x2 and y1 y y2 , respectively, is given by Pr [x1 x x2 , y1 y y2 ] = y2 y1 x2 x1 pxy (x , y ) d x d y Two random variables x and y representing outcomes x 1 , x 2 , . . . and y 1 , y 2 , . . . of an experiment are said to be statistically independent if the occurrence of any outcome x does not inuence the occurrence of any outcome y and vice versa. A necessary and sufcient condition for statistical independence is pxy (x , y ) = px (x ) py ( y ) (13.2) 13.2.6 Mean Values and Moments The mean or expected value of random variable x is dened as E {x} = x px ( x ) d x Similarly, if a random variable z is a function of two other random variables x and y, that is, z = f (x, y) then E {z } = zpz (z ) dz (13.3) If z is a single-valued function of x and y and x x x + d x , y y y + dy , then z z z + dz . Hence Pr [z z z + dz ] = Pr [x x x + d x , y y y + dy ] 596 DIGITAL SIGNAL PROCESSING or and from Eq. (13.3) E {z} = pz (z )dz = pxy (x , y )d x d y f (x , y ) pxy (x , y ) d x d y Actually this is a general relation that holds for multivalued functions as well [1]. For z = xy we have E {xy} = x ypxy (x , y ) d x d y and if variables x and y are statistically independent, then the use of Eq. (13.2) yields E {xy} = x px ( x ) d x ypy ( y ) dy = E {x} E {y} (13.4) The n th moment of x is dened as E {xn } = x n px ( x ) d x The second moment is usually referred to as the mean square of x. The n th central moment of x is dened as E {(x E {x})n } = (x E {x})n px (x ) d x (13.5) The second central moment is commonly referred to as the variance and is given by 2 x = E {(x E {x})2 } = E {x2 2x E {x} + ( E {x})2 } = E {x2 } ( E {x})2 If z = a1 x1 + a2 x2 where a1 , a2 are constants and x1 , x2 are statistically independent random variables, then from Eqs. (13.4) and (13.5), we have 22 22 z2 = a1 x1 + a2 x2 (13.6) RANDOM SIGNALS 597 In general, if n z= i =1 ai xi and variables x1 , x2 , . . . , xn are statistically independent, then n z2 = i =1 2 ai2 xi (13.7) Example 13.1 (a) Find the mean and variance for a random variable with a uniform probability density given by 1 px ( x ) = x 2 x 1 0 for x1 x x2 otherwise (b) Repeat part (a) for a random variable with a Gaussian probability density px ( x ) = Solution 1 2 2 e(x ) /2 2 for x (a) From the denition of the mean, we have E {x} = x2 x1 x 1 d x = (x1 + x2 ) x2 x1 2 (13.8) Similarly, the mean square can be deduced as E {x2 } = and from Eq. (13.6), we obtain 2 x = x2 x1 3 x2 x 3 x1 dx = 2 x2 x1 3(x2 x1 ) (13.9) (x2 x1 )2 12 (13.10) (b) In this case, we can write E {x} = 1 2 xe(x ) /2 d x 2 2 598 DIGITAL SIGNAL PROCESSING and with x = y + E {x} = 1 2 ye y 2 /2 2 dy + e y 2 /2 2 dy The rst integral is zero because the integrand is an odd function of y whereas the second integral is equal to 2 according to standard tables of integrals. Hence E {x} = Now E {x2 } = and, as before, E {x2 } = 2 + 2 or 2 x = 2 1 2 x 2 e(x ) /2 d x 2 2 13.3 RANDOM PROCESSES A random process is an extension of the concept of a random variable. Consider an experiment with possible random outcomes 1 , 2 , . . . . A set S comprising all can be constructed and a waveform x(t , ) can be assigned to each according to some rule. The set of waveforms obtained is called an ensemble, and each individual waveform is said to be a sample function. Set S , the ensemble, and the probability description associated with S constitute a random process. The concept of a random process can be illustrated by an example. Suppose that a large number of radio receivers of a particular model are receiving a carrier signal transmitted by a broadcasting station. With the receivers located at different distances from the broadcasting station, the amplitude and phase of the received carrier will be different at each receiver. As a result, the set of the received waveforms, illustrated in Fig. 13.1, can be described by x(t , ) = z cos(c t + y) where z and y are random variables and = 1 , 2 , . . . . The set of all possible waveforms that might be received constitutes an ensemble and the ensemble together with the probability densities of z and y constitutes a random process. 13.3.1 Notation A random process can be represented by x(t , ) or in a simplied notation by x(t ). Depending on the circumstances, x(t , ) can represent one of four things as follows: 1. The ensemble, if t and are variables. 2. A sample function, if t is variable and is xed. RANDOM SIGNALS 599 x(t, z1) t x(t, z2) t x(t, z3) t x(t, zn) t Figure 13.1 A random process. 3. A random variable, if t is xed and is variable. 4. A single number, if t and are xed. 13.4 FIRST- AND SECOND-ORDER STATISTICS For a xed value of t , x(t ) is a random variable representing the instantaneous values of the various sample functions over the ensemble. The probability distribution and probability density of x(t ) are denoted as P (x ; t ) = Pr [x(t ) x ] and p(x ; t ) = P (x ; t ) x respectively. These two equations constitute the rst-order statistics of the random process. 600 DIGITAL SIGNAL PROCESSING At any two instants t1 and t2 , x(t1 ) and x(t2 ) are distinct random variables. Their joint probability distribution and joint probability density depend on t1 and t2 in general, and are denoted as P (x1 , x2 ; t1 , t2 ) = Pr [x(t1 ) x1 , x(t2 ) x2 ] and p (x1 , x2 ; t1 , t2 ) = 2 P (x1 , x2 ; t1 , t2 ) x1 x2 respectively. These two equations constitute the second-order statistics of the random process. Similarly, at any k instants t1 , t2 , . . . , tk , the quantities x1 , x2 , . . . , and xk are distinct random variables. Their joint probability distribution and joint probability density depend on t1 , t2 , . . . , tk and can be dened as before. These quantities constitute the kth-order statistics of the random process. Example 13.2 Find the rst-order probability density p (x ; t ) for random process x(t ) = yt 2 where y is a random variable with a probability density 1 2 py ( y ) = e y /2 2 Solution for y If x and y are possible values of x(t ) and y, then x = yt 2 From Fig. 13.2 Pr [x x x + |d x |] = Pr [ y y y + |dy |] i.e., px (x )|d x | = py ( y )|dy | Since dx =t dy we obtain p ( x ; t ) = px ( x ) = 1 2 2 e(x +2) /2t |t | 2 for x or px ( x ) = py ( y ) |d x /dy | or y= 1 (x + 2) t RANDOM SIGNALS 601 x dx dy y Figure 13.2 Function x = yt 2 (Example 13.2). Example 13.3 Find the rst-order probability density p (x ; t ) of the random process x(t ) = cos(c t + y) where y is a random variable with probability density 1 for 0 y 2 py ( y ) = 2 0 otherwise Solution If x and y are possible values of x(t ) and y, then x = cos(c t + y ) and from Fig. 13.3, we get x 1 dx y dy1 1 dy2 2p Figure 13.3 Function x = cos (c t + y ) (Example 13.3). 602 DIGITAL SIGNAL PROCESSING Pr [x x x + |d x |] = Pr [ y1 y y1 + |dy1 |] +Pr [ y2 y y2 + |dy2 |] or Hence px (x )|d x | = py ( y1 )|dy1 | + py ( y2 )|dy2 | px ( x ) = py ( y2 ) py ( y1 ) + |x ( y1 )| |x ( y2 )| dx = sin (c t + y ) = 1 x 2 dy where Since x (y) = py ( y1 ) = py ( y2 ) = py ( y ) we obtain p (x ; t ) = px (t ) = and |x ( y1 )| = |x ( y2 )| = |x ( y )| 1 1 x2 for |x | < 1 otherwise 0 13.5 MOMENTS AND AUTOCORRELATION The rst-order statistics give the mean, mean square, and other moments of a random process at any instant t . From Sec. 13.2.6 E {x(t )} = E {x2 (t )} = x p(x ; t ) d x x 2 p(x ; t ) d x The second-order statistics give the autocorrelation function of a random process, which is dened as rx (t1 , t2 ) = E {x(t1 )x(t2 )} = x 1 x 2 p ( x 1 , x 2 ; t 1 , t2 ) d x 1 d x 2 The autocorrelation is a measure of the interdependence between the instantaneous signal values at t = t1 and those at t = t2 . This is the most important attribute of a random process, as it leads to a frequency-domain description of the process. RANDOM SIGNALS 603 Example 13.4 (a ) Find the mean, mean square, and autocorrelation for the random process in Example 13.2. (b) Repeat part (a ) for the process of Example 13.3. Solution (a) The probability density of x(t ) has been obtained in Example 13.2 as p ( x ; t ) = px ( x ) = 1 2 2 e(x +2) /2t |t | 2 for x Now the mean and mean square of a random variable x with a Gaussian probability density px ( x ) = 1 2 2 e(x ) /2 2 for x have been obtained in Example 13.1 as E {x} = and E {x2 } = 2 + 2 respectively. Thus, by comparison, the mean and mean square of x(t ) can be readily obtained as E {x(t )} = 2 The autocorrelation is given by rx (t1 , t2 ) = E {(yt1 2)(yt2 2)} = t1 t2 E {y2 } 2(t1 + t2 ) E {y} + 4 and since y is a random variable with a probability density 1 2 py ( y ) = e y /2 2 (see Example 13.2), we have E {y} = 0 and rx (t1 , t2 ) = t1 t2 + 4 (b) The probability density of x(t ) was obtained in Example 13.3 as p (x ; t ) = px (t ) = and E {x2 (t )} = t 2 + 4 for y and E {y2 } = 1 1 1 x2 for |x | < 1 otherwise 0 604 DIGITAL SIGNAL PROCESSING Thus the mean and mean square of x(t ) can be readily obtained as E {x(t )} = E {x2 (t )} = 1 1 1 1 1 1 x dx = 0 1 x2 x2 dx = 1 x2 1 2 (13.11) The autocorrelation can be expressed as rx (t1 , t2 ) = E {cos (c t1 + y) cos (c t2 + y)} = Now x(t ) = cos (c t1 + c t2 + 2y) is a random variable of the same type as x(t ) in Example 13.3, whose probability density can be obtained as p (x ; t ) = px (t ) = 1 2 cos (c t1 c t2 ) + 1 E {cos (c t1 + c t2 + 2y)} 2 1 1 x2 for |x | < 1 otherwise 0 (see Example 13.3), and hence E x (t ) = 0. Therefore, rx (t1 , t2 ) = 1 2 cos c where = t1 t2 (13.12) 13.6 STATIONARY PROCESSES A random process is said to be strictly stationary if x(t ) and x(t + T ) have the same statistics (all orders) for any value of T . If the mean of x(t ) is constant and its autocorrelation depends only on t2 t1 , that is, E {x(t )} = constant E {x(t1 )x(t2 )} = rx (t2 t1 ) the process is called wide-sense stationary. A strictly stationary process is also stationary in the wide sense; however, the converse is not necessarily true. The process of Example 13.4, part (a ), is wide-sense stationary; however, that of Example 13.4, part (b), is not stationary. 13.7 FREQUENCY-DOMAIN REPRESENTATION The frequency-domain representation of deterministic signals is normally in terms of amplitude, phase, and energy-density spectrums (see Chap. 2). Although such representations are possible for random processes [1], they are avoided in practice because of the mathematical difculties associated RANDOM SIGNALS 605 with innite-energy signals (see Sec. 6.2). Usually, random processes are represented in terms of power-density spectra. Consider a signal x (t ) and let x T0 (t ) = x (t ) 0 for |t | T0 otherwise The average power of x (t ) over the interval [T0 , T0 ] is PT0 = 1 2T0 T0 T0 x 2 (t ) dt = 1 2T0 2 x T0 (t ) dt and by virtue of Parsevals formula (see Theorem 2.16) PT0 = where X T0 ( j ) = F x T0 (t ) Evidently, the elemental area in the above integral, namely, | X T0 ( j )|2 | X T0 ( j )|2 d = df 2T0 2 2T0 represents average power ( f is the frequency in hertz). Therefore, the quantity | X T0 ( j )|2 2T0 represents the average power per unit bandwidth (in hertz) and can be referred to as the power spectral density (PSD) of x T0 (t ). If x T0 (t ) and x (t ) are sample functions of random processes xT0 (t ) and x(t ), respectively, we can dene PSD of xT0 (t ) = E and since xT0 (t ) x(t ) as T0 , we obtain PSD of x(t ) = Sx () = lim E T0 | X T0 ( j )|2 d 2T0 2 | X T0 ( j )|2 2T0 | X T0 ( j )|2 2T0 (13.13) The function Sx () is said to be the power-density spectrum of the process. 606 DIGITAL SIGNAL PROCESSING For stationary processes, the PSD is the Fourier transform of the autocorrelation function, as we shall now demonstrate. From Eq. (13.13) Sx () = lim E T0 X T0 ( j ) X T0 ( j ) 2T0 T0 T0 T0 T0 = lim 1 E T0 2 T0 1 T0 2 T0 x(t2 )e j t2 dt2 T0 T0 x(t1 )e j t1 dt1 = lim T0 T0 E {x(t1 )x(t2 )}e j (t2 t1 ) dt1 dt2 For a wide-sense-stationary process, we have E {x(t1 )x(t2 )} = rx (t2 t1 ) and hence we can write Sx () = lim where f (t2 t1 ) = rx (t2 t1 )e j (t2 t1 ) (13.15) 1 T0 2 T0 T0 T0 T0 T0 f (t2 t1 ) dt1 dt2 (13.14) The preceding double integral represents the volume under the surface y = f (t2 t1 ) and above the square region in Fig. 13.4. Since f (t2 t1 ) is constant on any line of the form t2 = t1 + c the volume over the elemental area bounded by the square region and the lines t2 = t1 + and t2 = t1 + + d is approximately constant. From the geometry of Fig. 13.4, we note that the elemental area d A is the difference between the areas of two overlapping equilateral right-angled triangles. For 0, the sides of the larger and smaller triangles are 2T0 and 2T0 ( + d ), respectively, and hence dA = 1 1 (2T0 )2 [2T0 ( + d )]2 2 2 1 = (2T0 )d + (d )2 2 (2T0 )d Similarly, for < 0, we get d A (2T0 + )d RANDOM SIGNALS 607 t2 2T0 T0 dt dA t T0 T0 t1 t T0 2T0 Figure 13.4 Domain of y = f (t2 t1 ). and in general, as d 0, we can write d A = (2T0 | |)d Hence the elemental volume for t2 t1 = is d V = f ( )(2T0 | |) d In order to obtain the entire volume under the surface y = f (t2 t1 ) and above the square region in Fig. 13.4, must be increased from 2T0 to +2T0 ; thus Eq. (13.14) can be expressed as Sx () = lim = 1 T0 2 T0 2T 0 2T0 f ( )(2T0 | |) d 1 | | 2T0 d = f ( ) lim T0 f ( ) d Therefore, from Eq. (13.15) Sx () = rx ( )e j d (13.16) 608 DIGITAL SIGNAL PROCESSING and if |rx ( )| d < we can write rx ( ) = E {x(t )x(t + )} = i.e., rx ( ) Sx () by virtue of the convergence theorem of the Fourier transform (Theorem 2.5). The formula in Eq. (13.16) is known as the Wiener-Khinchine relation. 1 2 Sx ()e j d (13.17) Example 13.5 Solution Find the PSD of the process in Example 13.3. The autocorrelation of the process was obtained in Example 13.4, part (b), as r ( ) = 1 2 cos c (see Eq. (13.12)). Hence from Eq. (13.16) and Table 6.2 Sx () = F r ( ) = [ ( + c ) + ( c )] 2 The autocorrelation is an even function of , that is, rx ( ) = rx ( ) as can be easily shown, and Sx () is an even function of by denition. Equations (13.16) and (13.17) can thus be written as Sx () = rx ( ) = i.e., Sx () is real. If = 0, then Sx (0) = rx ( ) cos( ) d 1 2 Sx () cos( ) d rx ( ) d RANDOM SIGNALS 609 i.e., the total area under the autocorrelation function equals the PSD at zero frequency. The average power of x(t ) is given by Average power = E {x2 (t )} = rx (0) = Sx () d 2 as is to be expected. A random process whose PSD is constant at all frequencies is said to be a white-noise process. If Sx () = K we have rx ( ) = K ( ) i.e., the autocorrelation of a white-noise process is an impulse at the origin. 13.8 DISCRETE-TIME RANDOM PROCESSES The concept of a random process can be readily extended to discrete-time random signals by simply assigning discrete-time waveforms to the possible outcomes of an experiment. The mean, mean square, and autocorrelation of a discrete-time process x(nT ) can be expressed as E {x(nT )} = E {x2 (nT )} = x p (x ; nT ) d x x 2 p (x ; nT ) d x rx (kT ) = E {x(nT )x(nT + kT )} A frequency-domain representation for a discrete-time process can be deduced by using the interrelations between the z transform and the Fourier transform (see Sec. 6.5.1). We can write Z rx (kT ) = k = r (kT )z k = Rx (z ) and from Eq. (6.43c) Rx (e j T ) = k = r (kT )e j k = F rx ( ) = S x () (13.18) 610 DIGITAL SIGNAL PROCESSING where x rx ( ) = E {x(t ) (t + )} x(t ) = n = x(nT ) (t nT ) = kT (see Sec. 6.5). Therefore, from Eqs. (13.13) and (13.18) Rx (e j T ) = lim E T0 | X T0 ( j )|2 2T0 and X T0 ( j ) = F xT0 (t ) and xT0 (t ) = x(t ) 0 for |t | T0 otherwise In effect, the z transform of the autocorrelation of discrete-time process x(nT ) evaluated on the unit circle |z | = 1 is numerically equal to the PSD of the impulse-modulated process x(t ). This quantity can be referred to as the PSD of discrete-time process x(nT ) and can be represented by Sx (e j T ) by analogy with the PSD of continuous-time process x(t ) which is represented by Sx (). Consequently, we can write Z rx (kT ) = Sx (z ) where rx (kT ) = 1 2 j Sx (z )z k 1 dz (13.19a) by virtue of Eq. (3.6). If x(t ) were a voltage or current waveform, then E {x2 (t )} would represent the average energy that would be delivered in a 1- resistor. Consequently, the quantity E {x2 (nT )} is said to be the power in x(nT ). It can be obtained by evaluating the autocorrelation function at k = 0, that is, E {x2 (nT )} = rx (0) = 1 2 j Sx (z )z 1 dz (13.19b) 13.9 FILTERING OF DISCRETE-TIME RANDOM SIGNALS If a discrete-time random signal is processed by a digital lter, we expect the PSD of the output signal to be related to that of the input signal. This indeed is the case, as will now be shown. RANDOM SIGNALS 611 Consider a lter characterized by H (z ), and let x(n ) and y(n ) be the input and output processes, respectively. From the convolution summation (see Eq. (4.36b)) y(i ) = p = h ( p )x(i p ) y( j ) = q = h (q )x( j q ) and hence E {y(i )y( j )} = E q = p = h ( p )h (q )x(i p )x( j q ) With j = i + k and q = p + n , we have ry (k ) = n = p = h ( p )h ( p + n ) E {x(i p )x(i p + k n )} g (n )rx (k n ) n = or ry (k ) = where g (n ) = p = h ( p )h ( p + n ) The use of the real-convolution theorem of the z transform (Theorem 3.7) gives Sy (z ) = Z ry (k ) = Z g (k )Z rx (k ) = G (z ) Sx (z ) Now (13.20) G (z ) = Z p = h ( p )h ( p + n ) = n = p = h ( p ) h ( p + n ) z n and with n = k p G (z ) = k = h (k )z k p = h ( p )(z 1 ) p = H (z ) H (z 1 ) (13.21) Therefore, from Eqs. (13.20) and (13.21) we get Sy (z ) = H (z ) H (z 1 ) Sx (z ) or Sy (e j T ) = | H (e j T )|2 Sx (e j T ) (13.22) i.e., the PSD of the output process is equal to the squared amplitude response of the lter times the PSD of the input process. 612 DIGITAL SIGNAL PROCESSING Example 13.6 The output of a digital lter is given by y (n ) = x (n ) + 0.8 y (n 1) 2 The input of the lter is a random signal with zero mean and variance x ; successive values of x (n ) are statistically independent. (a) Find the output PSD. (b) Obtain an expression for the average output power. Solution (a) The autocorrelation of the input signal is rx (k ) = E {x(n )x(n + k )} For k = 0 2 rx (k ) = E {x2 (n )} = x For k = 0, the use of Eq. (13.4) gives rx (k ) = E {x(n )} E {x(n + k )} = 0 Hence Now from Eq. (13.22) 2 Sy (z ) = x H (z ) H (z 1 ) z H (z ) = z 0.8 2 rx (k ) = x (k ) and 2 Sx (z ) = x where (b) From Eq. (13.19b) Output power = E {y2 (n )} = ry (0) = and if 1 2 j 2 x H (z ) H (z 1 )z 1 dz is taken to be the unit circle |z | = 1 we can let z = e j T , in which case Output power = 1 s s 0 2 x H (e j T ) H (e j T ) d A simple numerical method for the evaluation of the output power can be found in Ref. [6]. RANDOM SIGNALS 613 REFERENCES [1] [2] [3] [4] [5] [6] A. Papoulis, Probability, Random Variables, and Stochastic Processes, New York: McGraw-Hill, 1991. W. B. Davenport, Jr., and W. L. Root, Random Signals and Noise, New York: McGraw-Hill, 1958. B. P. Lathi, An Introduction to Random Signals and Communication Theory, Scranton: International Textbook, 1968. G. R. Cooper and C. D. McGillem, Probabilistic Methods of Signal and System Analysis, New York: Holt, Reinhart and Winston, 1971. H. Stark and J. W. Woods, Probability and Random Processes with Applications to Signal Processing, Englewood Cliffs, NJ: Prentice-Hall, 2002. o K. J. Astr m, E. I. Jury, and R. G. Agniel, A numerical method for the evaluation of complex integrals, IEEE Trans. Automatic Control, vol. 15, pp. 468471, Aug. 1970. PROBLEMS 13.1. A random variable x has a probability-density function px ( x ) = K ex 0 for 1 x otherwise (a) Find K . (b) Find Pr [0 x 2]. 13.2. A random variable x has a probability-density function 1 px ( x ) = q 0 for 0 x q otherwise Find its mean, mean square, and variance. 13.3. Find the mean, mean square, and variance for the random variable of Prob. 13.1. 13.4. Demonstrate the validity of Eq. (13.7). 13.5. A Gaussian random variable x has a mean and a variance 2 . Show that Px (x1 ) = 1 Px ( x1 ) where Px (x ) is the probability-distribution function of a Gaussian random variable with zero mean. 13.6. A Gaussian random variable x has = 0 and = 2. (a) Find Pr [x 2]. (b) Find Pr [|x| 2]. (c) Find x1 if Pr [|x| x1 ] = 0.95. 13.7. The random variable of Prob. 13.5 satises the relations Pr [x 60] = 0.2 Find and 2 . Pr [x 90] = 0.1 614 DIGITAL SIGNAL PROCESSING 13.8. A random variable x has a Rayleigh probability-density function given by 2 2 xex /2 for 0 x px ( x ) = 2 0 otherwise Show that (a) E {x} = 2 (b) E {x2 } = 2 2 2 (c) x = 2 2 2 13.9. A random process is given by x(t ) = yet u (t z) where y and z are random variables uniformly distributed in the range (1, 1). Sketch ve sample functions. 13.10. A random process is given by yt x(t ) = 2 + 2 where y is a random variable with a probability-density function 1 2 p y ( y ) = e y /2 for y 2 Find the rst-order probability-density function of x(t ). 13.11. A random process is given by x(t ) = z cos(0 t + y) Find the rst-order probability-density function of x(t ). (a) If z is a random variable distributed uniformly in the range (1, 1) and y is a constant. (b) If y is a random variable distributed uniformly in the range (, ) and z is a constant. 13.12. Find the mean, mean square, and autocorrelation for the process in Prob. 13.10. Is the process stationary? 13.13. Repeat Prob. 13.12 for the processes in Prob. 13.11. 13.14. A stationary discrete-time random process is given by x(nT ) = E {x(nT )} + x0 (nT ) where x0 (nT ) is a zero-mean process. Show that (a) rx (0) = E {x2 (nT )} (b) rx (kT ) = rx (kT ) (c) rx (0) |rx (kT )| (d) rx (kT ) = [ E {x(nT )}]2 + rx0 (kT ) 13.15. Explain the physical signicance of (a) E {x(nT )} (b) E 2 {x(nT )} (c) E {x2 (nT )} 2 (d) x = E {x2 (nT )} [ E {x(nT )}]2 13.16. A discrete-time random process is given by x(nT ) = 3 + 4nT y RANDOM SIGNALS 615 where y is a random variable with a probability-density function 1 2 py ( y ) = e( y 4) /8 2 2 Find its mean, mean square, and autocorrelation. 13.17. A discrete-time random process is given by x(nT ) = z cos 0 nT + 8 for y where z is a random variable distributed uniformly in the range (0, 1). Find the mean, mean square, and autocorrelation of x(nT ). Is the process stationary? 13.18. A discrete-time random process is given by x(nT ) = 2 cos(0 nT + y) where y is a random variable uniformly distributed in the range (, ). (a) Find the mean, mean square, and autocorrelation of x(nT ). (b) Show that the process is wide-sense stationary. (c) Find the PSD of x(nT ). 13.19. The random process of Prob. 13.18 is processed by a digital lter characterized by H (e j T ) = 1 0 for || c otherwise Sketch the input and output power-density spectrums if 0 c . 13.20. A random process x(nT ) with a probability-density function px (x ; nT ) = 1 0 for 1 x 2 otherwise 1 2 is applied at the input of the lter depicted in Fig. P13.20. Find the output PSD if x(nT ) and x(kT ) (n = k ) are statistically independent. x(nT ) 2cos w 0T y (nT ) Figure P13.20 This page intentionally left blank CHAPTER 14 EFFECTS OF FINITE WORD LENGTH IN DIGITAL FILTERS 14.1 INTRODUCTION In software as well as hardware digital-lter implementations, numbers are stored in nite-length registers. Consequently, if coefcients and signal values cannot be accommodated in the available registers, they must be quantized before they can be stored. Number quantization gives rise to three types of errors: 1. Coefcient-quantization errors 2. Product-quantization errors 3. Input-quantization errors The transfer-function coefcients are normally evaluated to a high degree of precision during the approximation step. If coefcient quantization is applied, the frequency response of the resulting lter may differ appreciably from the desired response, and if the quantization step is coarse, the lter may actually fail to meet the desired specications. 617 Copyright 2006 by The McGraw-Hill Companies, Inc. Click here for terms of use. 618 DIGITAL SIGNAL PROCESSING Product-quantization errors arise at the outputs of multipliers. Each time a signal represented by b1 digits is multiplied by a coefcient represented by b2 digits, a product having as many as b1 + b2 digits is generated. Since a uniform register length must, in practice, be used throughout the lter, each multiplier output must be rounded or truncated before processing can continue. These errors tend to propagate through the lter and give rise to output noise commonly referred to as output roundoff noise. Input-quantization errors arise in applications where digital lters are used to process continuous-time signals. These are the errors inherent in the analog-to-digital conversion process (see Sec. 6.9). This chapter begins with a review of the various number systems and types of arithmetic that can be used in digital-lter implementations. It then describes various methods of analysis and design that can be applied to quantify and minimize the effects of quantization. Section 14.3 deals with a method of analysis that can be used to evaluate the effect of coefcient quantization and Sec. 14.4 describes two families of lter structures that are relatively insensitive to coefcient quantization. Section 14.5 deals with methods by which roundoff noise caused by product quantization can be evaluated, and Secs. 14.614.8 describe methods by which roundoff noise can be reduced or minimized. In Sec. 14.9, two types of parasitic oscillations known as quantization and overow limit cycles are considered in some detail and methods for their elimination are described. 14.2 NUMBER REPRESENTATION The hardware implementation of digital lters, like the implementation of other digital hardware, is based on the binary-number representation. 14.2.1 Binary System In general, any number N can be expressed as n N= i =m bi r i (14.1) where 0 bi r 1 If distinct symbols are assigned to the permissible values of bi , the number N can be represented by the notation N = (bn bn 1 b0 .b1 bm )r (14.2) The parameter r is said to be the radix of the representation, and the point separating N into two parts is called the radix point. If r = 10, Eq. (14.2) becomes the decimal representation of N and the radix point is the decimal point. Similarly, if r = 2 Eq. (14.2) becomes the binary representation of N and the radix point is referred to as the binary point. The common symbols used to represent the two permissible values of bi are 0 and 1. These are called bits. EFFECTS OF FINITE WORD LENGTH IN DIGITAL FILTERS 619 A mixed decimal number can be converted into a binary number through the following steps: 1. Divide the integer part by 2 repeatedly and arrange the resulting remainders in the reverse order. 2. Multiply the fraction part by 2 and remove the resulting integer part; repeat as many times as necessary, and then arrange the integers obtained in the forward order. A binary number can be converted into a decimal number by using Eq. (14.1). Example 14.1 (a) Form the binary representation of N = 18.37510 . (b) Form the decimal representation of N = 11.1012 . Solution (a) The binary representation can be carried out as follows: 2 2 2 2 2 18 9 4 2 1 0 0 1 0 0 1 0 1 1 0 2 0.375 = 0.75 2 0.75 = 1.5 2 0.5 2 0 = 1.0 =0 Hence, we get 18.37510 = 10010.0112 (b) From Eq. (14.1) 11.1012 = 1(21 ) + 1(20 ) + 1(21 ) + 0(22 ) + 1(23 ) = 3.62510 The most basic electronic memory device is the ip-op which can be either in a low or a high state. By assigning a 0 to the low state and a 1 to the high state, a single-bit binary number can be stored. By arranging n ip-ops in juxtaposition, as in Fig. 14.1a , a register can be formed that will store an n -bit number. A rudimentary 4-bit digital-lter implementation is shown in Fig. 14.1b. Registers R y and R p are used to store the past output y (n 1) and the multiplier coefcient p , respectively. The output of the multiplier at steady state is by (n 1). Once a new input sample is received, the adder goes into action to form the new output y (n ), which is then used to update register R y . Subsequently, the multiplier is triggered into operation and the product by (n 1) is formed. The cycle is repeated when a new input sample is received. 620 DIGITAL SIGNAL PROCESSING (a) x (n) p y(n) x (n) Adder y (n) Ry y(n1) Multiplier py (n1) Rp (b) Figure 14.1 (a) Register, (b) rudimentary digital-lter implementation. A lter implementation like that in Fig. 14.1b can assume many forms, depending on the type of machine arithmetic used. The arithmetic can be of the xed-point or oating-point type and in each case various conventions can be used for the representation of negative numbers. The two types of arithmetic differ in the way numbers are stored in registers and in the way by which they are manipulated by the digital hardware. 14.2.2 Fixed-Point Arithmetic In xed-point arithmetic, the numbers are usually assumed to be proper fractions. Integers and mixed numbers are avoided because (1) the number of bits representing an integer cannot be reduced by rounding or truncation without destroying the number and (2) mixed numbers are more difcult to multiply. For these reasons, the binary point is usually set between the rst and second bit positions in the register, as depicted in Fig. 14.2a . The rst position is reserved for the sign of the number. Depending on the representation of negative numbers, xed-point arithmetic can assume three forms: 1. Signed magnitude 2. Ones complement 3. Twos complement EFFECTS OF FINITE WORD LENGTH IN DIGITAL FILTERS 621 Sign bit L Binary point (a) Signed mantissa (b) Signed exponent Figure 14.2 Storage of (a) xed-point numbers, (b) oating-point numbers. In the signed-magnitude arithmetic a fractional number N = 0.b1 b2 bm is represented as Nsm = 0.b1 b2 bm 1.b1 b2 bm for N 0 for N 0 The most signicant bit is said to be the sign bit; e.g., if N = +0.1101 or 0.1001, then Nsm = 0.1101 or 1.1001. The ones-complement representation of a number N is dened as N1 = N 2 2 L | N | for N 0 for N 0 (14.3) where L , referred to as the word length, is the number of bit locations in the register to the right of the binary point. The binary form of 2 2 L is a string of 1s lling the L + 1 locations of the register. Thus, the ones complement of a negative number can be deduced by representing the number by L + 1 bits, including zeros if necessary, and then complementing (changing 0s into 1s and 1s into 0s) all bits; e.g., if N = 0.11010, then N1 = 1.00101 for L = 5 and N1 = 1.00101111 for L = 8. The twos-complement representation is similar. We now have N2 = N 2 |N | for N 0 for N < 0 622 DIGITAL SIGNAL PROCESSING The twos complement of a negative number can be formed by adding 1 at the least signicant position of the ones complement. Similarly, a negative number can be recovered from its twos complement by complementing and then adding 1 at the least signicant position. The possible numbers that can be stored in a 4-bit register together with their decimal equivalents are listed in Table 14.1. Some peculiarities of the three systems are evident. The signedmagnitude and the ones-complement systems have two representations for zero whereas the twoscomplement system has only one. On the other hand, 1 is represented in the twos-complement system but not in the other two. The merits and demerits of the three types of arithmetic can be envisaged by examining how arithmetic operations are performed in each case. Ones-complement addition of any two numbers is carried out by simply adding their ones complements bit by bit. A carry bit at the most signicant position, if one is generated, is added at the least signicant position (end-around carry). Twos-complement addition is exactly the same except that a carry bit at the most signicant position is ignored. Signed-magnitude addition, on the other hand, is much more complicated as it involves sign checks as well as complementing and end-around carry [1]. In the ones- or twos-complement arithmetic, direct multiplication of the complements does not always yield the product, and as a consequence special algorithms must be employed. By contrast, signed-magnitude multiplication is accomplished by simply multiplying the magnitudes of the two numbers bit by bit and then adjusting the sign bit of the product. Table 14.1 Decimal equivalents of numbers 0.000 to 1.111 Decimal equivalent (eighths) Signed magnitude 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 Ones complement 0 1 2 3 4 5 6 7 7 6 5 4 3 2 1 0 Twos complement 0 1 2 3 4 5 6 7 8 7 6 5 4 3 2 1 Binary number 0.000 0.001 0.010 0.011 0.100 0.101 0.110 0.111 1.000 1.001 1.010 1.011 1.100 1.101 1.110 1.111 EFFECTS OF FINITE WORD LENGTH IN DIGITAL FILTERS 623 Example 14.2 Form the sum 0.53125 + (0.40625) using the ones- and twos-complement additions assuming a word length of 5 bits. Solution 0.5312510 = 0.100012 0.4062510 = 0.011012 Ones complement Twos complement 0.53125 0.40625 0.12500 0.10001 1.10010 0.00011 1 0.00100 0.10001 1.10011 1 0.00100 An important feature of the ones- or twos-complement addition is that a machine-representable sum S = n 1 + n 2 + + n i + will always be evaluated correctly, even if overow does occur in the evaluation of partial sums. Example 14.3 Form the sum L = 3. Solution 7 8 + 4 8 + ( 6 ) using the twos-complement addition. Assume 8 From Table 14.1 + 7/8 4/8 11/8 6/8 5/8 + 0.111 0.100 1.011 1.010 0.101 correct sum incorrect partial sum 14.2.3 Floating-Point Arithmetic There are two basic disadvantages in a xed-point arithmetic: (1) The range of numbers that can be handled is small; e.g., in the twos-complement representation the smallest number is 1 and the 624 DIGITAL SIGNAL PROCESSING largest is 1 2 L . (2) The percentage error produced by truncation or rounding tends to increase as the magnitude of the number is decreased. For example, if numbers 0.11011010 and 0.000110101 are both truncated such that only 4 bits are retained to the right of the binary point, the respective errors will be 4.59 and 39.6 percent. These problems can be alleviated to a large extent by using a oating-point arithmetic. In this type of arithmetic, a number N is expressed as N = M 2e where e is an integer and 1 M <1 2 M and e are referred to as the mantissa and exponent, respectively. For example, numbers 0.00110101 and 1001.11 are represented by 0.110101 22 and 0.100111 24 , respectively. Negative numbers are handled in the same way as in xed-point arithmetic. Floating-point numbers are stored in registers, as depicted in Fig. 14.2b. The register is subdivided into two segments, one for the signed mantissa and one for the signed exponent. Floating-point addition is carried out by shifting the mantissa of the smaller number to the right and increasing the exponent until the exponents of the two numbers are equal. The mantissas are then added to form the sum, which is subsequently put back into the normalized representation of Eq. (14.4). Multiplication is accomplished by multiplying mantissas, adding exponents, and then readjusting the product. It should be mentioned that the above scheme is just one of many. Nowadays most computers and digital hardware are designed to work with the IEEE oating-point representation format known as the ANSI/IEEE Standard 754-1985, which is, in effect, a variation of the above scheme. In the IEEE format, an arbitrary number N is represented as N = S 2e+bias where S is a signed mixed number in the range 1 to 2 2 L where L is the number of signicant bits allowed in the fractional part of S and bias is an integer. S is commonly referred to as the signicand [1]. The two obvious differences between the IEEE representation and the generic one in Eq. (14.4) is that, rst, S has an integer part and, second, a biased representation is used for the exponent. Normalizing numbers to the range 1 to 2 2 L , that is, 1.000 000 to 1.111 111, would cause the integer part of all numbers to be unity and, as a consequence, it would not need to be stored. Thus number precision can be increased by one bit without increasing the cost of hardware. The missing unity can be assumed by the software or hardware implementation. The use of a biased exponent eliminates the need to deal with negative numbers, which simplies the arithmetic a great deal, but it introduces another problem. If the exponent in some application is allowed to assume values, say, between 256 to +256, a bias of 256 can be added to all exponents to achieve an exponent range of 0 to 512. In such a scheme, exponents e1 and e2 would be represented by e1 + bias and e2 + bias. In the case of oating-point multiplication, the exponents would need to be added in which case a sum of e1 + e2 + 2bias would be produced. Evidently, in (14.4) EFFECTS OF FINITE WORD LENGTH IN DIGITAL FILTERS 625 order to achieve a biased sum, an amount bias would need to be subtracted from the sum. In the case of oating-point division, an exponent e2 would need to be subtracted from an exponent e1 and, consequently, a difference e1 e2 would be produced. In effect, in the case of subtraction, an amount bias would need to be added to get a biased representation. Multiplication and division of biased numbers would, of course, need much more attention, as can be readily veried, but, fortunately, these operations are not needed when dealing with the exponents in oating-point arithmetic. Summarizing, the use of a biased representation eliminates the need to deal with negative exponents but it introduces the problem of keeping taps on the ow of the bias and the question remains as to whether a biased representation is more cost effective. It turns out that if a bias which is a power of two minus 1 is used, i.e., bias = 2 L e 1 where L e is an integer, correcting for the bias is greatly simplied and the IEEE format becomes the oating-point representation of choice. Further details about the IEEE format as well as more information on computer arithmetic in general can be found in Parhami [1]. Floating-point arithmetic leads to increased dynamic range and improved precision of processing. Unfortunately, it also leads to increased cost of hardware (or more complicated software) and to reduced speed of processing. The reason is that more software/hardware is needed since both the signicand (or mantissa) and exponent have to be manipulated. For software non-real-time implementations on general purpose digital computers, oating-point arithmetic is always preferred since neither the cost of hardware nor the speed of processing is a signicant factor. 14.2.4 Number Quantization Once the register length in a xed-point implementation is assigned, the set of machine representable numbers is xed. If the word length is L bits (excluding the sign bit), the smallest number variation that can be represented is a 1 at the least signicant register position, which corresponds to 2 L . Therefore, any number consisting of B bits (excluding the sign bit), where B > L , must be quantized. This can be accomplished (1) by truncating all bits that cannot be accommodated in the register, and (2) by rounding the number to the nearest machine-representable number. Obviously, if a number x is quantized, an error will be introduced given by = x Q [x ] (14.5) where Q [x ] denotes the quantized value of x . The range of tends to depend on the type of number representation and also on the type of quantization. Let us examine the various possibilities, starting with truncation. As can be seen in Table 14.1, the representation of positive numbers is identical in all three xed-point representations. Since truncation can only reduce a positive number, is positive. Its maximum value occurs when all disregarded bits are 1s, in which case 0 T 2 L 2 B for x 0 For negative numbers the three representations must be considered individually. For the signedmagnitude representation, truncation will decrease the magnitude of the number or increase its signed value, and hence Q [x ] > x or (2 L 2 B ) T 0 for x < 0 626 DIGITAL SIGNAL PROCESSING The ones-complement representation of a negative number B x = i =1 bi 2i (14.6) (where bi = 0 or 1) is obtained from Eq. (14.3) as B x1 = 2 2 L i =1 bi 2i If all the disregarded bits are 0s, obviously = 0. At the other extreme if all the disregarded bits are 1s, we have B Q [x1 ] = 2 2 L i =1 bi 2i (2 L 2 B ) Consequently, the decimal equivalent of Q [x1 ] is B Q [x ] = i =1 bi 2i + (2 L 2 B ) (14.7) and, therefore, from Eqs. (14.5)(14.7) 0 T 2 L 2 B for x < 0 The same inequality holds for twos-complement numbers, as can easily be shown. In summary, for signed-magnitude numbers q < T < q where q = 2 L is the quantization step, whereas for ones- or twos-complement numbers 0 T < q Evidently, quantization errors can be kept as low as desired by using a sufciently large value of L . For rounding, the quantization error can be positive as well as negative by denition, and its maximum value is q /2. If numbers lying halfway between quantization levels are rounded up, we have q q R < 2 2 (14.8) Rounding can be effected, in practice, by adding 1 at position L + 1 and then truncating the number to L bits. EFFECTS OF FINITE WORD LENGTH IN DIGITAL FILTERS 627 Q(x) q x Quantizer Q(x) x Truncation Signed magnitude (a) Q(x) (b) Q(x) q x Truncation Ones complement Twos complement Rounding all systems x (c) (d ) Figure 14.3 Number quantization: (a) Quantizer, (b) to (d) Q (x ) versus x . A convenient way of visualizing the process of quantization is to imagine a quantizer with input x and output Q [x ]. Depending on the type of quantization, the transfer characteristic of the device can assume one of the forms illustrated in Fig. 14.3. The range of quantization error in oating-point arithmetic can be evaluated by using a similar approach. 14.3 COEFFICIENT QUANTIZATION Coefcient-quantization errors introduce perturbations in the zeros and poles of the transfer function, which in turn manifest themselves as errors in the frequency response. Product-quantization errors, on the other hand, can be regarded as noise sources that give rise to output roundoff noise. Since the importance of the two types of errors can vary considerably from application to application, it is frequently advantageous to use different word lengths for the coefcient and signal values. The coefcient word length can be chosen to satisfy prescribed frequency-response specications, whereas the signal word length can be chosen to satisfy a signal-to-noise ratio specication. 628 DIGITAL SIGNAL PROCESSING p p MI () M() MQ() a p a Figure 14.4 Coefcient quantization. Consider a digital lter characterized by H (z ) and let M () = | H (e j T )| = amplitude response without quantization M Q () = amplitude response with quantization M I () = ideal amplitude response p (a ) = passband (stopband) tolerance on amplitude response These quantities are illustrated in Fig. 14.4. The effect of coefcient quantization is to introduce an error M = M () M Q () The maximum permissible value of | M |, denoted by Mmax () = and if | M| Mmax () (14.9) Mmax (), can be deduced from Fig. 14.4 as for p for a M in M () given by p | M () M I ()| a | M () M I ()| for 0 p and a s /2, the desired specication will be met. The optimum word length can thus be determined exactly by evaluating | M | as a function of frequency for successively larger values of the word length until Eq. (14.9) is satised. Evidently, this is a trial-and-error approach and may entail considerable computation. An alternative approach is to employ a statistical method proposed by Avenhaus [2] and later modied by Crochiere [3]. This method yields a fairly accurate estimate of the required word length and is, in general, more efcient than the exact method described. Its details follow. EFFECTS OF FINITE WORD LENGTH IN DIGITAL FILTERS 629 Consider a xed-point implementation and assume that quantization is carried out by rounding. From Eq. (14.8) the error in coefcient ci (i = 1, 2, . . . , m ), denoted as ci , can assume any value in the range q /2 to +q /2; that is, ci is a random variable. If the probability density of ci is assumed to be uniform, that is, p ( ci ) = then from Eqs. (13.8) and (13.10) E { ci } = 0 2 ci = The variation write m 1 q for q 2 otherwise ci q 2 0 (14.10) (14.11) q2 12 M in M () is also a random variable. By virtue of Taylors theorem we can M= i =1 M ci Sci where the quantity M Sci = M () ci is known as the sensitivity of the amplitude response M () with respect to variations in coefcient ci . Evidently, m E{ M} = i =1 M Sci E { ci } = 0 according to Eq. (14.10). If from Eq. (13.7) ci and c j (i = j ) are assumed to be statistically independent, then m and, therefore, from Eq. (14.11) 2 M = i =1 M 2 ci Sci 2 2M = where m 2 ST = i =1 2 q 2 ST 12 (14.12) M Sci 2 (14.13) 630 DIGITAL SIGNAL PROCESSING For a large value of m , M is approximately Gaussian by virtue of the central-limit theorem [4], and since E { M } = 0, Eq. (13.1) gives p( M ) = Consequently, 1 e M 2 M 2 /2 2 M for M M1 0 M M will be in some range M1 y = Pr [| M | M1 ] = 2 M M1 with a probability y given by e M 2 /2 2 M 2 d( M) (14.14) With the variable transformation M = x M M1 = x 1 M (14.15) Equation (14.14) can be put in the standard form 2 y= 2 x1 0 ex 2 /2 dx Once an acceptable condence factor y is selected, the corresponding value of x1 can be obtained from published tables or by using a numerical method. The quantity M1 is essentially a statistical bound on M , and if the word length is chosen such that M1 Mmax () (14.16) the desired specications will be satised to within a condence factor y . The resulting word length can be referred to as the statistical word length. A statistical bound on the quantization step can be deduced from Eqs. (14.12), (14.15), and (14.16) as 12 Mmax () q x 1 ST (14.17) The register length should be sufciently large to accommodate the quantized value of the largest coefcient; so let J Q [max ci ] = i = K bi 2i where b J and b K = 0. The required word length must be L =1+ J +K and since q = 2 K or K = log2 1 q (14.19) (14.18) EFFECTS OF FINITE WORD LENGTH IN DIGITAL FILTERS 631 Eqs. (14.17)(14.19) now give the desired result as x 1 ST L L () = 1 + J + log2 12 Mmax () A reasonable agreement between the statistical and exact word lengths is achieved by using x1 = 2 [3, 5]. This value of x1 corresponds to a condence factor of 0.95. M The amplitude-response sensitivities Sci in Eq. (14.13) can be efciently computed as follows. The sensitivity of the frequency response with respect to a multiplier coefcient c can be expressed as ScH (e j T ) = and if H (e j T ) = M ()e j () we can show that () M () M ()[sin ()] c c () M () H j T + M ()[cos ()] Im Sc (e ) = [sin ()] c c Re ScH (e j T ) = [cos ()] Therefore, M Sc = H (e j T ) = Re ScH (e j T ) + j Im ScH (e j T ) c M () = [cos ()] Re ScH (e j T ) + [sin ()] Im ScH (e j T ) c and Sc = 1 () = {[cos ()] Im ScH (e j T ) [sin ()] Re ScH (e j T )} c M () where Sc is the sensitivity of the phase response () with respect to coefcient c. Now given an arbitrary digital-lter network incorporating a multiplier with a coefcient c, the sensitivity of the transfer function of the network can be obtained by using the transpose approach as ScH = H (z ) = H12 (z ) H34 (z ) c where H12 (z ) and H34 (z ) are the transfer functions form the input of the network to the input of the multiplier and from the output of the multiplier to the output of the network, respectively (see pp. 125128 of [6]). M With the transfer function sensitivities known, the amplitude-response sensitivities Sci can be deduced and thus ST , q , and K can be evaluated using Eqs. (14.13), (14.17), and (14.19), respectively. In turn, the statistical word length in Eq. (14.18) can be obtained. 632 DIGITAL SIGNAL PROCESSING The statistical word length is a convenient gure of merit of a specic lter structure. It can serve as a sensitivity measure in studies where a general comparison of various structures is desired. It can also be used as an objective function in word-length optimization algorithms [3]. A different approach for the study of quantization effects was proposed by Jenkins and Leon [7]. In this approach a computer-aided analysis scheme is used to generate condence-interval error bounds on the time-domain response of the lter. The method can be used to study the effects of coefcient or product quantization in xed-point or oating-point implementations. Furthermore, the quantization can be by rounding or truncation. 14.4 LOW-SENSITIVITY STRUCTURES The effects of coefcient quantization are most serious in applications where the poles of the transfer function are located close to the unit circle |z | = 1. In such applications, small changes in the coefcients can cause large changes in the frequency response of the lter, and in extreme cases they can actually cause the lter to become unstable. In this section, we show that second-order structures can be derived whose sensitivity to coefcient quantization is much lower than that of the standard direct realizations described in Chap. 8. These structures can be used in the cascade or parallel realizations for the design of high-selectivity or narrow-band lters. Let M () be the amplitude response of a digital-lter structure and assume that b is a multiplier constant. Now let M () be the change in M () due to a quantization error b in b. The normalized sensitivity of M () with respect to b is dened as M () M () = lim b b0 b b M () = M () b M Sb (14.20) and for small values of b, we have M () b M S M () bb (14.21) The normalized sensitivity can be used to compare different structures. Consider the direct realization of Fig. 14.5a . Straightforward analysis gives the transfer function H (z ) = z2 1 + b1 z + b0 and hence the amplitude response of the realization can be readily obtained as M () = 1 1+ 2 b0 + 2 b1 + 2b1 (1 + b0 ) cos T + 2b0 cos 2 T 1/2 (14.22) EFFECTS OF FINITE WORD LENGTH IN DIGITAL FILTERS 633 x(n) b1 y(n) b0 (a) x (n) 2 y (n) 1 1 0 (b) Figure 14.5 (a) Second-order direct realization, (b) corresponding low-sensitivity realization. Using Eqs. (14.20) and (14.22), the normalized sensitivities of M () with respect to b0 and b1 can be obtained as M S b0 = b0 (b0 + b1 cos T + cos 2 T )[ M ()]2 M S b1 = b1 [b1 + (1 + b0 ) cos T ][ M ()]2 A modied version of the structure in Fig. 14.5a can be obtained by replacing each of the multipliers by two multipliers in parallel, as shown in Fig. 14.5b, as suggested by Agarwal and Burrus [8]. The transfer function of the original structure will be maintained in the new structure if b0 = 1 + 0 and b1 = 1 2 634 DIGITAL SIGNAL PROCESSING and from Eq. (14.20) M S 0 = 0 M () 0 b 0 b0 M () = M () 0 b0 0 M () b0 0 M S = 1 + 0 b0 (14.23) and M S 1 = 1 M () 1 b 1 b1 M () = M () 1 b1 1 M () b1 1 M S = 1 2 b 1 (14.24) Now if the poles of the transfer function are located close to the point z = 1, as may be the case in a narrow-band lowpass lter of high selectivity, then b0 1 and b1 2. As a consequence, 0 and 1 will be small and, therefore, from Eqs. (14.23) and (14.24) | S 0 | M | S b0 | M and | S 1 | M | S b1 | M In effect, if coefcients 0 and 1 are represented to the same degree of precision as coefcients b0 and b1 , then the use of the structure in Fig. 14.5b instead of that in Fig. 14.5a leads to a signicant reduction in the sensitivity to quantization errors, as can be seen from Eq. (14.21). The same degree of precision in the representation of the coefcients can be achieved by using either oating-point or xed-point arithmetic. In the latter case, each multiplier coefcient should be scaled up to eliminate any zeros between the binary point and the most signicant nonzero bit and the product scaled down by a corresponding shift operation. The structure of Fig. 14.5b, like other structures in which all the outputs of multipliers are inputs to one and the same adder, has the advantage that the quantization of products can be carried out using one quantizer at the output of the adder instead of one quantizer at the output of each multiplier. Structures of this type are suitable for the application of error-spectrum shaping, which is a technique for the reduction of roundoff noise (see Sec. 14.8). The disadvantage of the structure of Fig. 14.5b is that the low-sensitivity property can be achieved only if the poles of the transfer function are close to point z = 1. A family of structures that are suitable for the application of error-spectrum shaping and simultaneously lead to low sensitivity for a variety of pole locations close to the unit circle |z | = 1 can be obtained from the general second-order conguration depicted in Fig. 14.6 by using a method reported by Diniz and Antoniou [9]. In this conguration, branches A , B , C , D , and E represent unit delays or machine-representable multiplier constants, such as, 0, 1, or 2. The structure of Fig. 14.6 realizes the transfer function H (z ) = N (z ) D (z ) (14.25) where N (z ) depends on the choice of multiplier coefcients c0 to c2 and D (z ) = z 2 (1 BD AC m 1 A + ABE + m 2 AB + ABCD + m 1 ABD ) (14.26) EFFECTS OF FINITE WORD LENGTH IN DIGITAL FILTERS 635 y(n) c2 c1 c0 x (n) A B C m1 D E m2 Figure 14.6 General second-order direct realization. Assuming that H (z ) is of the form H (z ) = a2 z 2 + a1 z + a0 z 2 + b1 z + b0 (14.27) and then comparing Eq. (14.25) with Eq. (14.27), a number of second-order structures can be deduced. In order to avoid delay-free loops (see Sec. 4.8.1) and keep the number of delays to the minimum of two, the constraints A = z 1 and B or D = z 1 must be satised. Therefore, two cases are possible, namely, Case I where A = B = z 1 and Case II where A = D = z 1 . 14.4.1 Case I For Case I, polynomial D (z ) of Eq. (14.26) assumes the form D (z ) = z 2 z (C + D + m 1 ) + CD + m 1 D + m 2 + E and to achieve low sensitivity, multipliers C , D , and E must be chosen as C + D = I R [b1 ] and E = I R [b0 + b1 D + D 2 ] (14.28) 636 DIGITAL SIGNAL PROCESSING where I R [x ] is the closest integer to x . Equation (14.28) forces the values of m 1 and m 2 to be as low as possible and, as in the structure of Fig. 14.5b, low sensitivity is assured. If the poles are close to point z = 1, then b1 2 and b0 1, and so C+D=2 We can thus assign C =1 D=1 and E =0 This choice of coefcients gives the structure of Fig. 14.5b, which is suitable for values of b1 in the range 2.0 < b1 < 1.5. Proceeding in the same way, the 15 structures in Table 14.2 can be deduced [9]. Structure I-2, like I-1, was reported in [8]. 14.4.2 Case II D (z ) = z 2 z ( B + C + m 1 m 2 B BE) + BC + m 1 B For Case II, polynomial D (z ) of Eq. (14.26) assumes the form Table 14.2 Structures for Case I Structure I-1 I-2 I-3 I-4 I-5 I-6 I-7 I-8 I-9 I-10 I-11 I-12 I-13 I-14 I-15 C 1 2 0 0 1 0 0 1 1 1 0 0 2 1 0 D 1 0 2 2 0 1 0 1 1 0 1 2 0 1 2 E 0 1 1 2 1 1 1 2 2 1 1 2 1 0 1 Range of b1 2.0 < b1 < 1.5 2.0 < b1 < 1.75 1.75 < b1 < 1.5 1.5 < b1 < 0.5 0.5 < b1 < 0.5 0.5 < b1 < 1.5 1.5 < b1 < 1.75 1.5 < b1 < 2.0 1.75 < b1 < 2.0 EFFECTS OF FINITE WORD LENGTH IN DIGITAL FILTERS 637 Table 14.3 Structures for Case II Structure II-1 II-2 II-3 II-4 II-5 II-6 B 1 1 1 1 1 1 C 1 1 1 1 1 1 E 0 1 2 2 1 0 Range of b1 2.0 < b1 < 1.5 1.5 < b1 < 0.5 0.5 < b1 < 0 0 < b1 < 0.5 0.5 < b1 < 1.5 1.5 < b1 < 2.0 and to achieve low sensitivity, constants B , C , and E must be chosen as B=1 C =1 and E = I R [b1 + b0 + 1] (14.29) for poles with positive real part, and B = 1 C = 1 and E = I R [b1 b0 1] (14.30) for poles with negative real part. Using Eqs. (14.29) and (14.30), the structures of Table 14.3 can be deduced [9]. Structure II-1 was reported by Nishimura, Hirano, and Pal [10]. Different biquadratic transfer functions can be realized by using the formulas in Table 14.4. In the above approach, the poles of the transfer function have been assumed to be close to the unit circle of the z plane. An alternative approach for selecting the optimum structure for a given transfer function, which is applicable for any pair of poles in the unit circle, was described by Ramana Rao and Eswaran [11]. Table 14.4 Realization of biquadratic transfer functions Multiplier constant c0 c1 c2 m1 m2 Case I a0 + a1 D + a2 D 2 a1 + a2 D a2 b1 C D b0 + b1 D + D 2 E 1+ Case II a2 + a0 a1 +2 B B a0 B a2 b0 C B b0 b1 + 2 E B B 638 DIGITAL SIGNAL PROCESSING 14.5 PRODUCT QUANTIZATION The output of a nite-word-length multiplier can be expressed as Q [ci x (n )] = ci x (n ) + e(n ) where ci x (n ) and e(n ) are the exact product and quantization error, respectively. A machine multiplier can thus be represented by the model depicted in Fig. 14.7a , where e(n ) is a noise source. Consider the lter structure of Fig. 14.7b and assume a xed-point implementation. Each multiplier can be replaced by the model of Fig. 14.7a , as in Fig. 14.7c. If product quantization is carried out by rounding, each noise signal ei (n ) can be regarded as a random process with uniform probability density, that is, p (ei ; n ) = 1 q for q ei (n ) 2 otherwise q 2 0 Hence, from Eqs. (13.8) and (13.9) and Sec. 13.8, we have E {ei (n )} = 0 E ei2 (n ) = q 12 rei (k ) = E {ei (n )ei (n + k )} 2 (14.31) (14.32) (14.33) If the signal levels throughout the lter are much larger than q , the following reasonable assumptions can be made: (1) ei (n ) and ei (n + k ) are statistically independent for any value of n (k = 0), and (2) ei (n ) and e j (n +k ) are statistically independent for any value of n or k (i = j ). Let us examine the implications of these assumptions starting with the rst assumption. From Eqs. (14.31) (14.33) and Eq. (13.4) rei (0) = E ei2 (n ) = and i.e., rei (k ) k =0 q2 12 = E {ei (n )} E {ei (n + k )} = 0 rei (k ) = q2 (k ) 12 where (k ) is the impulse function. Therefore, the power spectral density (PSD) of ei (n ) is Sei (z ) = Z rei (k ) = q2 12 (14.34) that is, ei (n ) is a white-noise process. Let us now consider the implications of the second assumption. The autocorrelation of sum ei (n ) + e j (n ) is rei +e j (k ) = E {[ei (n ) + e j (n )][ei (n + k ) + e j (n + k )]} = E {ei (n )ei (n + k )} + E {ei (n )} E {e j (n + k )} + E {e j (n )} E {ei (n + k )} + E {e j (n )e j (n + k )} or rei +e j (k ) = rei (k ) + re j (k ) EFFECTS OF FINITE WORD LENGTH IN DIGITAL FILTERS 639 x (n) ci e(n) (a) a0 x (n) Qci [x (n)] y (n) b1 a1 b2 a2 (b) e1(n) e2(n) a0 x(n) y (n) e3(n) b1 a1 e (n) 4 e5(n) b2 a2 (c) Figure 14.7 Product quantization: (a) Noise model for a multiplier, (b) second-order canonic section, (c) noise model for a second-order canonic section. Therefore Sei +e j (z ) = Z [rei (k ) + re j (k )] = Sei (z ) + Se j (z ) i.e., the PSD of a sum of two statistically independent processes is equal to the sum of their respective PSDs. In effect, superposition can be employed. 640 DIGITAL SIGNAL PROCESSING Now from Fig. 14.7c and Eq. (13.22) 2 5 S y ( z ) = H ( z ) H ( z 1 ) i =1 Sei (z ) + i =3 Sei (z ) where H (z ) is the transfer function of the lter, and hence from Eq. (14.34) the output PSD is given by q2 q2 H (z ) H (z 1 ) + 6 4 The above approach is applicable to any lter structure. Furthermore, it can be used to study the effects of input quantization. S y (z ) = 14.6 SIGNAL SCALING If the amplitude of any internal signal in a xed-point implementation is allowed to exceed the dynamic range, overow will occur and the output signal will be severely distorted. On the other hand, if all the signal amplitudes throughout the lter are unduly low, the lter will be operating inefciently and the signal-to-noise ratio will be poor. Therefore, for optimum lter performance suitable signal scaling must be employed to adjust the various signal levels. A scaling technique applicable to ones- or twos-complement implementations was proposed by Jackson [12]. In this technique a scaling multiplier is used at the input of a lter section, as in Fig. 14.8, with its constant chosen such that amplitudes of multiplier inputs are bounded by M if |x (n )| M . Under these circumstances, adder outputs are also bounded by M and cannot overow. This is due to the fact that a machine-representable sum is always evaluated correctly in ones- or twos-complement arithmetic, even if overow does occur in one of the partial sums (see Example 14.3). There are two methods for the determination of , as follows. 14.6.1 Method A Consider the lter section of Fig. 14.8, where v (n ) is a multiplier input. The transfer function between nodes 1 and 2 can be denoted by F (z ). From the convolution summation v (n ) = k =0 f (k )x (n k ) (14.35) b v (n) 2 x (n) 1 Figure 14.8 Signal scaling. EFFECTS OF FINITE WORD LENGTH IN DIGITAL FILTERS 641 where Evidently f (n ) = Z 1 F (z ) |v (n )| k =0 | f (k )| |x (n k )| and if |x (n )| M then |v (n )| M k =0 | f (k )| Thus a sufcient condition for |v (n )| M is | f (k )| 1 k =0 or Now consider the specic signal k =0 1 | f (k )| (14.36) x (n k ) = where M > 0. From Eq. (14.35) M M for f (k ) > 0 for f (k ) < 0 v (n ) = M k =0 | f (k )| and, therefore, |v (n )| M if and only if Eq. (14.36) holds. Signal scaling can be applied by calculating the innite sum of the magnitude of the impulse response from the input of the lter to the input of each multiplier and then evaluating using the largest sum so obtained in Eq. (14.36). The above method guarantees that overow will never occur as long as the input is bounded as prescribed. Unfortunately, the signal levels at the various nodes can be quite low and since quantization errors are independent of the signal level, a reduced signal-to-noise ratio may result. In addition, the computation of the sum in Eq. (14.36) is not usually straightforward. 14.6.2 Method B The second and more efcient method for the evaluation of is based on L p -norm notation. The L p norm of an arbitrary periodic function A(e j T ) with period s is dened as A p = 1 s s 0 | A(e j T )| p d 1/ p 642 DIGITAL SIGNAL PROCESSING where p 1. It exists if s 0 | A(e j T )| p d < and if A(e j T ) is continuous, then the limit p lim A p =A = max | A(e j T )| 0s (14.37) exists, as can be easily demonstrated (see Prob. 14.22). Usually, A(e j T ) is obtained by evaluating function A(z ) on the unit circle z = e j T and A p is often referred to as the L p norm of either A(e j T ) or A(z ). Now let X (z ) = n = x (n )z n f (n )z n with a < |z | < b with c < |z | < b F (z ) = n = where c < 1 for a stable lter and b > 1. From Eq. (14.35) V (z ) = F (z ) X (z ) 1 2 j with d < |z | < b where d = max (a , c). The inverse z transform of V (z ) is v (n ) = F (z ) X (z )z n 1 dz (14.38) where is a contour in the annulus of convergence. If a < 1, |z | = 1. With z = e j T Eq. (14.38) becomes v (n ) = We can thus write |v (n )| or |v (n )| 0s can be taken to be the unit circle 1 s s 0 F (e j T ) X (e j T )e jn T d s 0 s 0 max | X (e j T )| 1 s 1 s | F (e j T )| d | X (e j T )| d (14.39) (14.40) 0s max | F (e j T )| and by virtue of the Schwarz inequality [12], we can write |v (n )| 1 s s 0 | F (e j T )|2 d 1/2 1 s F s 0 | X (e j T )|2 d 1/2 (14.41) If L p -norm notation is used, Eqs. (14.39)(14.41) can be put in the compact form |v (n )| X F 1 |v (n )| X 1 |v (n )| X 2 F 2 In fact, these inequalities are particular cases of the Holder inequality [12, 13] |v (n )| X q F p (14.42) EFFECTS OF FINITE WORD LENGTH IN DIGITAL FILTERS 643 where the relation p= q q 1 (14.43) must hold. Equation (14.42) is valid for any transfer function F (z ) including F (z ) = 1, in which case v (n ) = x (n ) and 1 p = 1 for all p 1. Consequently, from Eq. (14.42) |x (n )| X Now if |x (n )| X Eq. (14.42) gives |v (n )| M F Therefore, provided that F or where Eq. (14.43) must hold. 1 F p p q q for all q 1 M |v (n )| M 1 q for X p M (14.44) 14.6.3 Types of Scaling Depending on the values of p and q , two types of scaling can be identied, namely, L 2 scaling if p = q = 2 and L scaling if p = and q = 1. From the denition of the L p norm and Eq. (14.37), we have F 2 = 1 s s 0 | F (e j T )|2 d 1/2 1 s 1 s s 0 s 0s max | F (e j T )| 2 2 d 1/2 F 0 d 1/2 F or 1 F 2 1 F As a consequence, L 2 scaling usually yields larger scaling constants than L scaling. This means that the signal levels at the various nodes are usually larger, and thus a better signal-to-noise ratio can be achieved. However, L 2 scaling is more likely to cause overow than L scaling. The circumstances in which these two types of scaling are applicable are examined next. 644 DIGITAL SIGNAL PROCESSING If x (n ) is obtained by sampling a random or deterministic, nite-energy, bandlimited, continuous-time signal x (t ) such that X A ( j ) = F x (t ) = 0 we can write X 2 s 0 s /2 s /2 for || s /2 1/2 (14.45) = 1 s | X (e j T )|2 d | X (e j T 2 1 = s 1/2 )| d where X (z ) = Z x (n ). From Eq. (6.46a), we have X (e j T ) = and hence X 2 1 X A ( j ) T s /2 s /2 for || < s /2 = = 1 2 T 1 2 T 1/2 | X A ( j )|2 d 1/2 | X A ( j )|2 d On using Parsevals formula (see Theorem 2.16), we obtain X 2 = 1 T |x (t )|2 dt 1/2 (14.46) For a nite-energy signal, the above integral converges. Therefore, Eq. (14.42) holds with p = 2 and q = 2, and L 2 scaling is applicable. If x (n ) is obtained by sampling a continuous-time signal x (t ) whose energy content is not nite (e.g., a sinusoidal signal) the integral in Eq. (14.46) does not converge, X 2 does not exist, and L 2 scaling is not applicable; therefore, if such a signal is applied to a structure incorporating L 2 scaling, then signal overow may occur. If x (t ) is bounded and bandlimited, Eq. (14.45) is satised, and hence we can write X 1 = = 1 s 1 2 s /2 s /2 s /2 s /2 | X (e j T )| d | X A ( j )| d (14.47) i.e., X 1 exists and Eq. (14.42) holds with p = and q = 1, and L scaling is applicable. The amplitude spectrum of x (t ) may become unbounded if x (t ) is a sinusoidal signal, in which case X A ( j ) has poles on the j axis, or if x (t ) is constant, in which case X A ( j ) is an impulse function. However, in both of these cases X 1 exists, as will now be demonstrated. If x (t ) = M cos 0 nT where 0 0 s /2, we have X A ( j ) = M [ ( 0 ) + ( + 0 )] EFFECTS OF FINITE WORD LENGTH IN DIGITAL FILTERS 645 and Eq. (14.47) gives X 1 = 1 2 s /2 s /2 | M [ ( 0 ) + ( + 0 )]| d =M On the other hand, if x (t ) = M , then X A ( j ) = 2 M () and X 1 s /2 s /2 = 1 2 |2 M ()| d = M Therefore, if we select such that F then v (n ) M This result is to be expected. With a sinusoidal input and the gain between the input and node 2 in Fig. 14.8 equal to or less than unity, the signal at node 2 will be a sinusoid with an amplitude equal to or less than M . = max | F (e j T )| 1 0s 14.6.4 Application of Scaling If there are m multipliers in the lter of Fig. 14.8, then |vi (n )| M provided that 1 i Fi p for i = 1, 2, . . . , m . Therefore, in order to ensure that all multiplier inputs are bounded by M we must assign = min (1 , 2 , . . . , m ) 1 = max ( F1 p , F2 p , . . . , Fm or p) (14.48) In the case of parallel or cascade realizations, efcient scaling can be accomplished by using one scaling multiplier per section. Deduce the scaling formulation for the cascade lter of Fig. 14.9a assuming that p = and q = 1. Solution Example 14.4 The only critical signals are y j (n ) and y j (n ) since the inputs of the feedback multipliers are delayed versions of y j (n ). The lter can be represented by the signal ow graph of 646 DIGITAL SIGNAL PROCESSING Fig. 14.9b, where F j (z ) = z2 z2 + b1 j z + b2 j F j (z ) = z2 (z + 1)2 + b1 j z + b2 j By using Eq. (14.48), we obtain 0 = 2 = 1 max ( F1 , F1 ) , 1 = 1 0 max ( F1 F2 ) , F1 F2 ) 1 0 1 max ( F1 F2 F3 F1 F2 F3 The scaling constants can be evaluated by noting that Fi according to Eq. (14.37). 0 x (n) F1(z) = max | Fi (e j T )| 0s 1 F2(z) 2 F3(z) 3 y(n) j-1 yj-1(n) b1j yj(n) b2j yj (n) (a) y1(n) y2(n) y3(n) x(n) 0 y1(n) 1 (b) F2 (z) F2(z) y2(n) 2 3 y3(n) Figure 14.9 (a) Cascade lter, (b) signal ow-graph representation. EFFECTS OF FINITE WORD LENGTH IN DIGITAL FILTERS 647 The scaling constants are usually chosen to be the nearest powers of 2 satisfying the overow constraints. In this way, scaling multiplications can be reduced to simple data shifts. In cascade lters, the ordering of sections has an inuence on scaling, which in turn has an inuence on the output noise. Analytical techniques for determining the optimum sequential ordering have not yet been devised. Nevertheless, some guidelines suggested by Jackson [14] lead to a good ordering. 14.7 MINIMIZATION OF OUTPUT ROUNDOFF NOISE The level of output roundoff noise in xed-point implementations can be reduced by increasing the word length. An alternative approach is to assume a general structure and vary its topology or parameters in such a way as to minimize the output roundoff noise. A method of this type that leads to optimal state-space structures was proposed by Mullis and Roberts [15]. The method is based on a state-space noise formulation reported by these authors and Hwang [16] at approximately the same time, and the principles involved are detailed below. The method is applicable to the general N th-order realization but for the sake of simplicity it will be presented in terms of the second-order case. A second-order state-space realization can be represented by the signal ow graph in Fig. 14.10 where ei (n ) for i = 1, 2, and 3 are noise sources due to the quantization of products. From Sec. 4.8.2, the lter can be represented by the equations q(n + 1) = Aq(n) + bx (n ) + e(n ) y (n ) = cT q(n) + d x (n ) + e3 (n ) T (14.49a) (14.49b) where e (n ) = [e1 (n ) e2 (n )]. Let F1 (z ), F2 (z ) and G 1 (z ), G 2 (z ) be the transfer functions from the input to nodes q1 (n ), q2 (n ) and from nodes e1 (n ), e2 (n ) to the output, respectively. In terms of this notation, the column vectors f(z ) and g(z ) can be formed as fT (z ) = [ F1 (z ) F2 (z )] a11 and gT (z ) = [G 1 (z ) G 2 (z )] (14.50) e1(n) 1 b1 a12 E 1 q1(n) c1 d e3(n) 1 1 y(n) x(n) 1 b2 e2(n) 1 a21 E 1 c2 q2(n) a22 Figure 14.10 Second-order state-space realization. 648 DIGITAL SIGNAL PROCESSING and from Eq. (14.49), we obtain f(z ) = (z I A)1 b and g(z ) = (z I AT )1 c (14.51) (see Prob. 14.23). Now if the realization of Fig. 14.10 is represented by the set {A, b,cT , d } and the state vector q(n ) is subjected to a transformation of the form q(n ) = Tq(n ), a new realization {A, b, cT , d } is obtained where A = TAT1 b = Tb cT = cT T1 d=d (14.52) and from Eq. (14.49), one can show that (z ) = Tf(z ) f and g(z ) = T1 g(z ) (14.53) (see Prob. 14.24). The realization {A, b, cT , d } has minimum output roundoff noise subject to L 2 norm scaling if and only if W = DKD and K ii W ii = K j j W j j for all i , j (14.55) (14.54) where D is a diagonal matrix and K = { K i j } and W = {Wi j } are the matrices given by 1 K= 2 j and 1 W= 2 j g g(z ) T (z 1 )z 1 dz (14.57) (z )T (z 1 )z 1 dz ff (14.56) respectively [15]. Matrices K and W are known as the reachability and observability gramians, respectively. From Eq. (14.44), L 2 scaling can be applied by ensuring that Fi 2 =1 for all i (14.58) and from Eqs. (14.56) and (14.58), we have 1 K ii = 2 j 1 = s = Fi F i (z ) F i (z 1 )z 1 dz s 0 2 2 | F i (e j T )|2 d (14.59) =1 EFFECTS OF FINITE WORD LENGTH IN DIGITAL FILTERS 649 Therefore, the condition for minimum output roundoff noise in Eq. (14.55) assumes the form Wii = W j j and from Eq. (14.57), we have Gi 2 2 for all i , j (14.60) = Gj 2 2 for all i , j In effect, the output noise is minimum if the individual contributions due to the different noise sources are all equal, as may be expected. The application of the above method to the N th-order general state-space realization would require N 2 + 2 N + 1 multipliers, as opposed to 2 N + 1 in parallel or cascade canonic structures. That is, the method is uneconomical. Recognizing this problem, Mullis and Roberts applied their methodology to obtain so-called block-optimal parallel and cascade structures that require only 4 N + 1 and 9 N /2 multipliers, respectively. Unfortunately, in both cases the realization process is relatively complicated; in addition, in the latter case the pairing of zeros and poles into biquadratic transfer functions and the ordering of second-order sections are not optimized, and to be able to obtain a structure that is fully optimized the designer must undertake a large number of designs. A practical approach to this problem is to obtain second-order sections that are individually optimized and then use sections of this type in parallel or cascade for the realization of N th-order transfer functions. Realizations so obtained are said to be section-optimal. This approach gives optimal parallel structures since in this case the output noise is independent of the pairing of zeros and poles and the ordering of sections; furthermore, as was shown by Jackson, Lindgren, and Kim [17], with some experience the approach gives suboptimal cascade structures that are nearly as good as corresponding block-optimal cascade structures. Optimized second-order sections can be obtained by noting that Eq. (14.54) is satised if and only if D = I, according to Eqs. (14.59) and (14.60); hence, Eq. (14.54) can be expressed as W = 2K (14.61) Since W and K are symmetric matrices with equal diagonal elements, Eq. (14.61) assumes the form W = 2 JKJ where J= 01 10 (14.62) for a second-order realization. Eq. (14.62) is satised by a network in which AT = JAJ and c = Jb If A = {ai j }, b = {bi }, and cT = {ci }, then the preceding conditions yield a11 = a22 650 DIGITAL SIGNAL PROCESSING and b1 c2 = c1 b2 If {A, b, cT , d } represents a specic realization that satises these conditions, then applying the scaling transformation T= F1 0 1 2 0 F2 1 2 (14.63) results in a structure that satises Eqs. (14.54), (14.59), and (14.60) simultaneously and, therefore, is optimal for L 2 scaling. It should be mentioned that if the transformation T= F1 0 1 0 F2 1 (14.64) is used instead, the structure obtained is not optimal for L scaling, although good results are usually obtained. A biquadratic second-order transfer function with complex-conjugate poles can be expressed as 1 z + 0 + (14.65) H (z ) = 2 z + 1 z + 0 and on the basis of the above principles, Jackson et al. [17] obtained the following optimal state-space realization: a11 = a22 = 1 /2 a12 = (1 + 0 )( K 1 K 2 )/12 a21 = [ K 1 K 2 ]2 /(1 + 0 ) 1 1 b1 = (1 + 0 ) b2 = 1 2 2 1 c1 = c2 = 1 1 + 0 d= 1 K 1 = 0 1 1 2 K2 = 02 0 1 1 + 0 12 (14.66a) (14.66b) (14.66c) (14.66d) (14.66e) (14.66f) An arbitrary parallel or cascade design can be obtained by expressing the individual biquadratic transfer functions as in Eq. (14.65) and then using the scaling transformation T= F 1i 0 1 p 0 F 2i 1 p with p = 2 or for each section, where F1i (z ) and F2i (z ) are the transfer functions between the input of the lter and the state-variable nodes 1 and 2, respectively, of the i th section. EFFECTS OF FINITE WORD LENGTH IN DIGITAL FILTERS 651 14.8 APPLICATION OF ERROR-SPECTRUM SHAPING An alternative approach for the reduction of output roundoff noise is through the application of a technique known as error-spectrum shaping [18, 19]. This technique involves the generation of a roundoff-error signal and the application of local feedback for the purpose of controlling and manipulating the output roundoff noise. The technique entails additional hardware which increases in direct proportion to the number of adders in the structure. Consequently, only structures in which the outputs of all multipliers are inputs to one and the same adder are suitable for the application of error-spectrum shaping. The most well-known structure of this type is the classical direct realization. Other structures of this type are the low-sensitivity structures described in Sec. 14.4. The application of error-spectrum shaping to the direct realization of Fig. 14.11a is illustrated in Fig. 14.11b. Signals and coefcients are assumed to be in xed-point format using L bits for the magnitude and one bit for the sign, and each of the two adders A1 and A2 can add products of 2 L bits to produce a sum of 2 L bits. Quantizer Q 1 rounds the output of adder A1 to L bits and simultaneously generates a scaled-up version of the quantization error which is fed back to adder A1 through the subnetwork. Quantizer Q 2 , on the other hand, scales down and rounds the output of adder A2 to 2 L bits. A suitable scaling factor for the subnetwork is 2 L since the leading L bits of the quantization error are zeros. Constant is used to scale the input of quantizer Q 1 . Assuming L 2 signal scaling, then = 1 H (14.67) 2 where H (z ) is the transfer function of the structure in Fig. 14.11a . A noise model for the conguration in Fig. 14.11b can be readily obtained as shown in Fig. 14.11c, where qi /2 ei (n ) qi /2 with q1 = 2 L and q2 = 22 L . Hence, the PSDs of signals e1 (n ) and e2 (n ) are given by Sei (z ) = e2i = qi2 12 As in Sec. 14.5, the PSD of the output noise can be obtained as 2 Sn (z ) = i =1 qi2 Hi (z ) Hi (z 1 ) 12 (14.68) where H1 (z ) = and H2 (z ) = (z 2 1 + b1 z + b0 ) (14.70) 1 z 2 + 1 z + 0 z 2 + b1 z + b0 (14.69) are the transfer functions from noise sources e1 (n ) and e2 (n ) to the output, respectively. The output noise power is numerically equal to the autocorrelation of the output noise evaluated at k = 0 and 652 DIGITAL SIGNAL PROCESSING a2 a1 b1 a0 b0 (a) 0 1 A2 a2 Q2 A1 Q1 1 a1 b1 a0 b0 (b) Figure 14.11 (a ) Second-order direct realization, (b) application of error-spectrum shaping. from Eqs. (13.19a) and (14.68), we obtain 2 rn (0) = n = 1 2 j 2 i =1 Sn (z )z 1 dz qi2 Hi (z ) Hi (z 1 )z 1 dz 12 2 2 = = 1 2 j 2 i =1 qi2 Hi 12 (14.71) EFFECTS OF FINITE WORD LENGTH IN DIGITAL FILTERS 653 0 1 2L 2L e2(n) e1(n) 1 a2 1 a1 b1 a0 b0 (c) Figure 14.11 Contd (c) Noise model. For a random input signal whose amplitude is uniformly distributed in the range (1, 1), we have r x (k ) = x2 = 1/3; hence the output power due to the signal is given by 2 r y (0) = y = 1 H 3 2 2 (14.72) Now from Eq. (14.67) and Eqs. (14.69)(14.72), the signal-to-noise ratio can be obtained as SNR = 2 y 2 n = 4 22 L z 2 + 1 z + 0 z 2 + b1 z + b0 2 + 22 L 2 1 2+b z+b z 1 0 2 2 If the parameters 1 and 2 are chosen to be equal to b1 and b2 , respectively, then the signal-to-noise ratio is maximized, as demonstrated by Higgins and Munson [19]. 654 DIGITAL SIGNAL PROCESSING Expressions for the coefcients of the error-spectrum shaping network for the case of cascade structures have been derived in [20]. 14.9 LIMIT-CYCLE OSCILLATIONS In the methods of analysis presented in Sec. 14.5, we made the fundamental assumption that signal levels are much larger than the quantization step throughout the lter. This allowed us to assume statistically independent noise signals from sample to sample and from source to source. On many occasions, signal levels can become very low or constant, at least for short periods of time, e.g., during pauses in speech and music signals. Under such circumstances, quantization errors tend to become highly correlated and can actually cause a lter to lock in an unstable mode whereby a steady output oscillation is generated. This phenomenon is known as the deadband effect, and the oscillation generated is commonly referred to as quantization or granularity limit cycle. Quantization limit cycles are low-level oscillations whose amplitudes can be reduced by increasing the word length of the implementation. Another type of oscillation that can cause serious problems is sometimes brought about by overow in the arithmetic devices used. Oscillations of this type are known as overow limit cycles and their amplitudes can be quite large, sometimes as large as the maximum signal handling capacity of the hardware. In this section, we examine the mechanisms by which quantization and overow limit cycles can be generated and present methods for their elimination. 14.9.1 Quantization Limit Cycles The deadband effect can be studied by using a technique developed by Jackson [21]. Consider the rst-order lter of Fig. 14.12a . The transfer function and difference equation of the lter are given by H (z ) = and y (n ) = H0 x (n ) + by (n 1) respectively. The impulse response is h (n ) = H0 (b)n If b = 1 or 1, the lter is unstable and has an impulse response h (n ) = H0 H0 (1)n for b = 1 for b = 1 (14.73) H0 z zb With H0 = 10.0 and b = 0.9, the exact impulse response given in the second column of Table 14.5 can be obtained. Now, assume that the lter is implemented using xed-point decimal arithmetic, where each product by (n 1) is rounded to the nearest integer according to the rule Q [|by (n 1)|] = Int [|by (n 1)| + 0.5] (14.74) EFFECTS OF FINITE WORD LENGTH IN DIGITAL FILTERS 655 H0 x (n) b y (n) (a) x (n) b1 y(n) b2 (b) Figure 14.12 (a) First-order lter, (b) second-order lter. With H0 = 10.0 and b = 0.9, the response in the third column of Table 14.5 is obtained. As can be seen, for n 5 the response oscillates between +5 and 5 and, in a sense, quantization has rendered the lter unstable. If Eq. (14.73) is assumed to hold during the unstable mode, the effective value of b must be 1 for b > 0 or 1 for b < 0. If this is the case Q [|by (n 1)|] = | y (n 1)| and from Eq. (14.74) Int [|b| | y (n 1)| + 0.5] = | y (n 1)| or Int [| y (n 1)| (1 |b|)| y (n 1)| + 0.5] = | y (n 1)| This equation can be satised if 0 (1 |b|)| y (n 1)| + 0.5 < 1 and by using the left-hand inequality, we conclude that | y (n 1)| 0.5 =k 1 |b | Since y (n 1) is an integer, instability cannot arise if |b| < 0.5. On the other hand, if |b| 0.5, the response will tend to decay to zero once the input is removed, and eventually y (n 1) will assume 656 DIGITAL SIGNAL PROCESSING Table 14.5 Impulse response of rst-order lter n 0 1 2 3 4 5 6 7 . . . 100 h(n) 10.0 9.0 8.1 7.29 6.561 5.9049 5.31441 4.782969 . . . 2.65614 104 Q [h(n)] 10.0 9.0 8.0 7.0 6.0 5.0 5.0 5.0 . . . 5.0 values in the so-called deadband range [k , k ]. When this happens, the lter will become unstable. Any tendency of | y (n 1)| to exceed k will restore stability, but in the absence of an input signal the response will again decay to a value within the deadband. Thus the lter will lock into a limit cycle of amplitude equal to or less than k . Since the effective value of b is +1 for 0.5 b < 1 or 1 for 1 < b 0.5, the frequency of the limit cycle will be 0 or s /2. For the second-order lter of Fig. 14.12b, we have H (z ) = and y (n ) = x (n ) b1 y (n 1) b0 y (n 2) If the poles are complex, then h (n ) = where r= and b = cos1 2 b0 For b0 = 1, the impulse response is a sinusoid with constant amplitude and frequency 1 b1 cos1 (14.76) T 2 This is sometimes referred to as the resonant frequency of the lter. In second-order lters, there are two distinct limit-cycle modes. In one mode, a limit cycle with frequency 0 or s /2 is generated, and a limit cycle whose frequency is related to the resonant frequency 0 is generated in the other. 0 = rn sin [(n + 1) ] sin b0 (14.75) z2 z 2 + b1 z + b0 EFFECTS OF FINITE WORD LENGTH IN DIGITAL FILTERS 657 If the lter is implemented using xed-point decimal arithmetic and each of the products b1 y (n 1) and b0 y (n 2) is rounded to the nearest integer according to the rule in Eq. (14.74), then Eq. (14.75) yields y (n ) = x (n ) Q [b1 y (n 1)] Q [b0 y (n 2)] The lter can sustain a zero-input limit cycle of amplitude y0 ( y0 > 0) and frequency 0 or s /2 if y0 = Q [b1 y0 ] Q [b0 y0 ] (14.77) where the plus sign applies for limit cycles of frequency s /2 (see Prob. 14.29). Regions of the (b0 , b1 ) plane that satisfy this equation and the corresponding values of y0 are shown in Fig. 14.13a . The domain inside the triangle represents stable lters, as can be easily shown (see Eqs. (14.91a) and (14.91c)). b1 b0 y0 = 1 y0 = 2 y0 = 4 (a) Figure 14.13 Eq. (14.77). Regions of the (b0 , b1 ) plane that yield quantization limit cycles: (a) Regions that satisfy 658 DIGITAL SIGNAL PROCESSING b1 b0 y0 = 1 y0 = 2 y0 = 4 (b) Figure 14.13 Contd Regions of the (b0 , b1 ) plane that yield quantization limit cycles: (b) Regions that satisfy Eqs. (14.77) and (14.78). If e1 (n ) and e2 (n ) are the quantization errors in products b1 y0 and b0 y0 , respectively, then Eq. (14.77) gives b1 = y0 e1 (n ) e2 (n ) + b0 y0 and since 0.5 < ei (n ) 0.5, a necessary but not sufcient condition for the existence of a limit cycle of frequency 0 or s /2 is obtained as |b1 | y0 1 + b0 y0 The second limit-cycle mode involves the quantization of product b0 y (n 2). If Q [|b0 y (n 2)|] = | y (n 2)| then the effective value of b0 is unity and, as in the rst-order case, a condition for the existence of limit cycles can be deduced as | y (n 2)| 0.5 =k 1 |b0 | (14.78) EFFECTS OF FINITE WORD LENGTH IN DIGITAL FILTERS 659 With k an integer, values of b0 in the ranges 0.5 |b0 | < 0.75 0.75 < |b0 | < 0.833 ................... . 2k 1 2k + 1 |b0 | < 2k 2(k + 1) ........................ will yield deadbands [1, 1], [2, 2], . . . , [k , k ], . . . , respectively. Regions of the (b0 , b1 ) plane that satisfy both Eqs. (14.77) and (14.78) are depicted in Fig. 14.13b. If the poles are close to the unit circle, the limit cycle is approximately sinusoidal with a frequency close to the resonant frequency given by Eq. (14.76). For signed-magnitude binary arithmetic, Eq. (14.78) becomes q | y (n 2)| 2(1 |b0 |) where q is the quantization step. 14.9.2 Overow Limit Cycles In ones- or twos- complement xed-point implementations, the transfer characteristic of adders is periodic, as illustrated in Fig. 14.14a ; as a consequence, if the inputs to an adder are sufciently Q[x] M M M M x (a) Q[x] M M M M x (b) Figure 14.14 (a) Transfer characteristic of ones- or twos-complement xed-point adder, (b) transfer characteristic of adder incorporating saturation mechanism. 660 DIGITAL SIGNAL PROCESSING large to cause overow, unexpected results can occur. Under certain circumstances, oscillations of large amplitude can be sustained, which are known as overow limit-cycle oscillations. These were identied and studied quite early in the development of digital lters by Ebert, Mazo, and Taylor [22]. The generation of overow limit cycles is demonstrated by the following example. Example 14.5 A second-order digital lter characterized by Eq. (14.75) with b1 = 1.375 and b0 = 0.625 is implemented in terms of twos-complement xed-point arithmetic using a word length of 6 bits, excluding the sign bit. The quantization of products is carried out by rounding. Show that if x (n ) = 0, y (2) = 43/64, and y (1) = 43/64, the lter will sustain an overow limit cycle. Solution Using the difference equation, output y (n ) given in column 2 of Table 14.6 can be readily computed. Evidently, y (4) = y (2) and y (5) = y (1) and, therefore, a sustained oscillation of amplitude 43/64 and frequency s /2 will be generated. Table 14.6 Overow limit cycle in second-order lter n 2 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 64 y (n) 43 43 42 43 43 42 43 43 42 43 43 42 43 43 42 43 43 42 64 y (n) 43 43 63 60 44 23 4 8 14 14 10 5 3 1 1 2 2 2 14.9.3 Elimination of Quantization Limit Cycles Quantization limit-cycle oscillations received considerable attention from researchers in the past, and two general approaches for minimizing or eliminating their effects have evolved. One approach EFFECTS OF FINITE WORD LENGTH IN DIGITAL FILTERS 661 entails the use of a sufciently large signal word length to ensure that the amplitude of the limit-cycle is small enough to meet some system specication imposed by the application. Bounds on the limitcycle amplitude that can be used in this approach have been deduced by Sandberg and Kaiser [23], Long and Trick [24], and Green and Turner [25]. The other approach entails the elimination of limit cycles altogether. Quantization limit cycles can be eliminated by using appropriate signal quantization schemes in specic structures, whereas overow limit cycles can be eliminated by incorporating suitable saturation mechanisms in arithmetic devices. An important method for the elimination of zero-input limit cycles was proposed by Meerk tter o [26] and was later used by Mills, Mullis, and Roberts [27], and Vaidyanathan and Liu [28] to show that there are several realizations that support the elimination of limit-cycle oscillations. In this method, a Lyapunov function related to the stored power is constructed and is then used to demonstrate that under certain conditions limit cycles cannot be sustained. The principles involved are as follows. Consider the digital lter shown in Fig. 14.15 and assume that block A is a linear subnetwork containing adders, multipliers, and interconnections but no unit delays. Further, assume that signal quantization and overow control are carried out by quantizers Q k for k = 1, 2, . . . , N placed at the inputs of the unit delays as shown. The state-space characterization of the lter can be expressed as v(n ) = Aq(n) + bx (n ) y (n ) = cT q(n) + d x (n ) and if x (n ) = 0, we can write v(n ) = Aq(n) q(n + 1) = v(n ) (14.79) (14.80) where A = {ai j } and vk (n ) is related to vk (n ) by some nonlinear and possibly time-varying functional relation of the form vk (n ) = Q k [vk (n )] The quadratic form p [q(n )] = qT (n )Dq(n ) (14.82) for k = 1, 2, . . . , N (14.81) where D is an N N positive denite diagonal matrix, is related to the power stored in the unit delays at instant nT , and changes in this quantity can provide information about the stability of the v1(n) Q1 v1(n) q1(n) vN (n) QN vN (n) qN (n) x(n) Subnetwork A y(n) Figure 14.15 N th-order digital lter incorporating nonlinearities. 662 DIGITAL SIGNAL PROCESSING lter under zero-input conditions. The increase in p [q(n )] in one lter cycle can be expressed as p [q(n )] = p [q(n + 1)] p [q(n )] and from Eqs. (14.80), (14.82), and (14.83), we have p [q(n )] = qT (n )Dq(n ) + vT (n )Dv(n ) Hence, Eqs. (14.79) and (14.84) yield p [q(n )] = qT (n )Dq(n ) + vT (n )Dv(n ) + [Aq(n )]T D[Aq(n )] vT (n )Dv(n ) N (14.83) (14.84) = qT (n )(D AT DA)q(n ) k =1 2 [vk (n ) vk (n )]dkk 2 (14.85) where dkk for k = 1, 2, . . . , N are the diagonal elements of D. Now if qT (n )(D AT DA)q(n ) 0 and signals vk (n ) are quantized such that |vk (n )| |vk (n )| then Eq. (14.85) yields p [q(n )] 0 (14.88) for k = 1, 2 , . . . , N (14.87) (14.86) that is, the power stored in the unit delays cannot increase. Since a digital lter is a nite-state machine, signals qk (n ) must after a nite number of lter cycles either become permanently zero or oscillate periodically. In the rst case, there are no limit cycle oscillations. In the second case, at least one qk (n ), say ql (n ), must oscillate periodically. However, from Eq. (14.88), we conclude that the amplitude of the oscillation must decrease with each lter cycle by some xed amount until ql (n ) becomes permanently zero after a nite number of lter cycles. Therefore, Eq. (14.86) and the conditions in Eq. (14.87) constitute a sufcient set of conditions for the elimination of limit cycles. A realization satisfying Eq. (14.86) is said to support the elimination of zero-input limit cycles. The conditions in Eq. (14.87) can be imposed by quantizing the state variables using magnitude truncation. For a stable lter, the magnitudes of the eigenvalues of A are less than unity and Eq. (14.86) is satised if a positive denite diagonal matrix D can be found such that matrix D AT DA is positive semidenite [27, 28]. For second-order lters, this condition is satised if a12 a21 0 or a12 a21 < 0 and |a11 a22 | + det (A) 1 (14.89b) (14.89a) There are quite a few realizations that support the elimination of zero-input limit cycles. Some examples are: normal state-space structures in which A= EFFECTS OF FINITE WORD LENGTH IN DIGITAL FILTERS 663 with > 0 [2931]; realizations that minimize the output roundoff noise such as those in [15, 17] (see Sec. 14.7); and lattice realizations [28, 31, 32]. Example 14.6 The structure shown in Fig. 14.16 realizes the biquadratic transfer function H (z ) = z 2 + a1 z + a0 z 2 + b1 z + b0 where a1 = (1 + 2 ) a 0 = 1 + 1 2 b1 = (1 + 2 ) b0 = 1 + 1 2 q1(n + 1) q1(n) (14.90a) (14.90b) (14.90c) (14.90d) 1 1 1 x(n) y (n) 2 2 q2(n + 1) q2(n) Figure 14.16 Biquadratic realization due to Meerk tter. o 664 DIGITAL SIGNAL PROCESSING and is due to Meerk tter [26]. Show that the structure supports the elimination of zero-input o limit cycles. Solution Straightforward analysis gives the state-space characterization of the structure as q(n + 1) = Aq(n) + bx (n ) y (n ) = cT q(n) + d x (n ) where A= b= a11 a21 a12 a22 = 1 (2 1) c= 1 1 (1 + 1) 2 and d=1 (1 1 ) (2 2 ) The lter is stable if and only if 1 b0 > 0 1 + b1 + b0 > 0 1 b1 + b0 > 0 (14.91a) (14.91b) (14.91c) as can be easily shown by using the Jury-Marden stability criterion (see Sec. 5.3.7. From Eq. (14.90), we can show that a12 a21 = (1 + 1)(2 1) = 12 b (1 + b0 )2 41 and since 1 + b0 > b1 , according to Eq. (14.91c), we conclude that a12 a21 < 0. Hence, zero-input limit cycles can be eliminated by using magnitude truncation only if the condition in Eq. (14.89b) is satised. Simple manipulation now yields |a11 a22 | + det (A) = |b0 1| + b0 1 + 1 = 1 since b0 1 is negative according to Eq. (14.91a); that is, Eq. (14.89b) is satised with the equal sign and, therefore, the structure supports the elimination of zero-input limit cycles. Limit cycles can also be generated if the input assumes a constant value for a certain period of time. Limit cycles of this type, which include zero-input limit cycles as a special case, are referred to as constant-input limit cycles; they can be eliminated by using techniques described by Verkroost [33], Turner [34], and Diniz and Antoniou [35]. A state-space realization of the transfer function in Eq. (14.65) that supports the elimination of zero- and constant-input limit cycles is illustrated in EFFECTS OF FINITE WORD LENGTH IN DIGITAL FILTERS 665 1 a11 E 1 1 x(n) 1 1 a12 d c2 q2(n) E a21 a22 1 1 q1(n) c1 1 y(n) 1 Figure 14.17 limit cycles. Second-order state-space realization that supports the elimination of zero- and constant-input Fig. 14.17, where a11 = a22 = 1 /2 a12 = / a21 = 1 + 0 (2 + 1 )0 (1 + 20 )1 c1 = c2 = 1 + 1 + 0 2 (1 + 1 + 0 ) d= = 0 2 1 4 (14.92a) (14.92b) (14.92c) (14.92d) Constant can be used to achieve optimal scaling. This structure is optimal or nearly optimal with respect to roundoff noise and is, in addition, slightly more economical than the state-space realization given by Eqs. (14.66a)(14.66f) (see [35] for more details). 14.9.4 Elimination of Overow Limit Cycles Overow limit cycles can be avoided to a large extent by applying strict scaling rules, e.g., using scaling method A in Sec. 14.6.1, to as far as possible prevent overow from occurring. The problem with this approach is that signal levels throughout the lter are low; as a result, a poor signal-to-noise ratio is achieved. The preferred solution is to allow overow on occasion but prevent the limit-cycle oscillations from occurring. A solution of this type reported in [22] involves incorporating a saturation mechanism in the design of adders so as to achieve a transfer characteristic of the type depicted in Fig. 14.14b where Q [x ] = x M if |x | < M if |x | M 666 DIGITAL SIGNAL PROCESSING If this type of adder is used in the lter of Example 14.5, output y (n ) given in column 3 of Table 14.6 will be obtained. Evidently, the overow limit cycle will be eliminated but a quantization limit cycle of amplitude 2/64 and frequency 0 will be present. This is due to the fact that this amplitude satises Eq. (14.77), as can be easily veried. A concept that is closely related to overow oscillations is the stability of the forced response of a nonlinear system or lter. If v (n ) and v (n ) are the state variables in Fig. 14.15, rst with and then without the quantizers installed, the forced response of the lter is said to be stable if n v lim [ (n ) v (n )] = 0 In practical terms, the stability of the forced response implies that transients due to overow effects tend to die out once the cause of the overow has been removed. Claasen, Mecklenbr uker, and Peek [36] have shown that if a lter incorporating certain a nonlinearities, e.g., overow nonlinearities, is stable under zero-input conditions, then the forced response is also stable with respect to a corresponding set of nonlinearities. On the basis of this equivalence, if a digital lter of the type shown in Fig. 14.15 is stable under zero-input conditions, i.e., it satises Eq. (14.86) subject to the conditions in Eq. (14.87), then the forced response is also stable provided that the nonlinearities in Eq. (14.81) satisfy the conditions 2 x < Q k [x ] 1 2 x > Q k [x ] 1 1 Q k [x ] 1 for 1 < x < 3 for 3 < x < 1 for | x | 3 for k = 1, 2, . . . , N , as illustrated in Fig. 14.18. The stability of the forced response implies freedom from overow limit cycles. It should be mentioned, however, that Claasen et al. deduced the above equivalence on the assumption that there is an innite time separation between successive occurrences of overow. Consequently, the above conditions may not guarantee the absence of overow limit cycles if overow occurs while the lter is recovering from a previous overow. Q[x] 1 3 2 1 1 2 3 x 1 Figure 14.18 Transfer characteristic that guarantees the stability of the forced response. EFFECTS OF FINITE WORD LENGTH IN DIGITAL FILTERS 667 REFERENCES [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] B. Parhami, Computer Arithmetic: Algorithms and Hardware Designs, New York: Oxford University Press, 2000. E. Avenhaus, On the design of digital lters with coefcients of limited word length, IEEE Trans. Audio Electroacoust., vol. 20, pp. 206212, Aug. 1972. R. E. Crochiere, A new statistical approach to the coefcient word length problem for digital lters, IEEE Trans. Circuits Syst., vol. 22, pp. 190196, Mar. 1975. A. Papoulis, Probability, Random Variables, and Stochastic Processes, New York: McGraw-Hill, 1991. R. E. Crochiere and A. V. Oppenheim, Analysis of linear digital networks, Proc. IEEE, vol. 63, pp. 581595, Apr. 1975. A. Antoniou, Digital Filters: Analysis, Design, and Applications, New York: McGraw-Hill, 1993. W. K. Jenkins and B. J. Leon, An analysis of quantization error in digital lters based on interval algebras, IEEE Trans. Circuits Syst., vol. 22, pp. 223232, Mar. 1975. R. C. Agarwal and C. S. Burrus, New recursive digital lter structures having very low sensitivity and roundoff noise, IEEE Trans. Circuits Syst., vol. 22, pp. 921927, Dec. 1975. P. S. R. Diniz and A. Antoniou, Low-sensitivity digital-lter structures which are amenable to error-spectrum shaping, IEEE Trans. Circuits Syst., vol. 32, pp. 10001007, Oct. 1985. S. Nishimura, K. Hirano, and R. N. Pal, A new class of very low sensitivity and low roundoff noise recursive digital lter structures, IEEE Trans. Circuits Syst., vol. 28, pp. 11521158, Dec. 1981. Y. V. Ramana Rao and C. Eswaran, A pole-sensitivity based method for the design of digital lters for error-spectrum shaping, IEEE Trans. Circuits Syst., vol. 36, pp. 10171020, July 1989. L. B. Jackson, On the interaction of roundoff noise and dynamic range in digital lters, Bell Syst. Tech. J., vol. 49, pp. 159184, Feb. 1970. G. Bachman and L. Naria, Functional Analysis, New York: Academic, 1966. L. B. Jackson, Roundoff-noise analysis for xed-point digital lters realized in cascade or parallel form, IEEE Trans. Audio Electroacoust., vol. 18, pp. 107122, June 1970. C. T. Mullis and R. A. Roberts, Synthesis of minimum roundoff noise xed point digital lters, IEEE Trans. Circuits Syst., vol. 23, pp. 551562, Sept. 1976. S. Y. Hwang, Roundoff noise in state-space digital ltering: A general analysis, IEEE Trans. Acoust., Speech, Signal Process., vol. 24, pp. 256262, June 1976. L. B. Jackson, A. G. Lindgren, and Y. Kim, Optimal synthesis of second-order state-space structures for digital lters, IEEE Trans. Circuits Syst., vol. 26, pp. 149153, Mar. 1979. T. Thong and B. Liu, Error spectrum shaping in narrow-band recursive lters, IEEE Trans. Acoust., Speech, Signal Process., vol. 25, pp. 200203, Apr. 1977. W. E. Higgins and D. C. Munson, Jr., Noise reduction strategies for digital lters: Error spectrum shaping versus the optimal linear state-space formulation, IEEE Trans. Acoust., Speech, Signal Process., vol. 30, pp. 963973, Dec. 1982. W. E. Higgins and D. C. Munson, Jr., Optimal and suboptimal error spectrum shaping for cascade-form digital lters, IEEE Trans. Circuits Syst., vol. 31, pp. 429437, May 1984. [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] 668 DIGITAL SIGNAL PROCESSING [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] L. B. Jackson, An analysis of limit cycles due to multiplication rounding in recursive digital lters, Proc. 7th Annu. Allerton Conf. Circuit Syst. Theory, pp. 6978, 1969. P. M. Ebert, J. E. Mazo, and M. G. Taylor, Overow oscillations in digital lters, Bell Syst. Tech. J., vol. 48, pp. 29993020, Nov. 1969. I. W. Sandberg and J. F. Kaiser, A bound on limit cycles in xed-point implementations of digital lters, IEEE Trans. Audio Electroacoust., vol. 20, pp. 110114, June 1972. J. L. Long and T. N. Trick, An absolute bound on limit cycles due to roundoff errors in digital lters, IEEE Trans. Audio Electroacoust., vol. 21, pp. 2730, Feb. 1973. B. D. Green and L. E. Turner, New limit cycle bounds for digital lters, IEEE Trans. Circuits Syst., vol. 35, pp. 365374, Apr. 1988. K. Meerk tter, Realization of limit cycle-free second-order digital lters, in Proc. IEEE o Int. Symp. Circuits and Systems, 1976, pp. 295298. W. L. Mills, C. T. Mullis, and R. A. Roberts, Digital lter realizations without overow oscillations, IEEE Trans. Acoust., Speech, Signal Process., vol. 26, pp. 334338, Aug. 1978. P. P. Vaidyanathan and V. Liu, An improved sufcient condition for absence of limit cycles in digital lters, IEEE Trans. Circuits Syst., vol. 34, pp. 319322, Mar. 1987. C. M. Rader and B. Gold, Effects of parameter quantization on the poles of a digital lter, Proc. IEEE, vol. 55, pp. 688689, May 1967. C. W. Barnes and A. T. Fam, Minimum norm recursive digital lters that are free of overow limit cycles, IEEE Trans. Circuits Syst., vol. 24, pp. 569574, Oct. 1977. A. H. Gray, Jr. and J. D. Markel, Digital lattice and ladder lter synthesis, IEEE Trans. Audio Electroacoust., vol. 21, pp. 491500, Dec. 1973. A. H. Gray, Jr., Passive cascaded lattice digital lters, IEEE Trans. Circuits Syst., vol. 27, pp. 337344, May 1980. G. Verkroost, A general second-order digital lter with controlled rounding to exclude limit cycles for constant input signals, IEEE Trans. Circuits Syst., vol. 24, pp. 428431, Aug. 1977. L. E. Turner, Elimination of constant-input limit cycles in recursive digital lters using a generalised minimum norm, Proc. Inst. Elect. Eng., Part G, vol. 130, pp. 6977, June 1983. P. S. R. Diniz and A. Antoniou, More economical state-space digital-lter structures which are free of constant-input limit cycles, IEEE Trans. Acoust., Speech, Signal Process., vol. 34, pp. 807815, Aug. 1986. T. A. C. M. Claasen, W. F. G. Mecklenbr uker, and J. B. H. Peek, On the stability of the a forced response of digital lters with overow nonlinearities, IEEE Trans. Circuits Syst., vol. 22, pp. 692696, Aug. 1975. PROBLEMS 14.1. (a) Convert the decimal numbers 730.796875 into binary representation. (b) Convert the binary numbers 11011101.011101 into decimal representation. and 100011100.1001101 and 3521.8828125 EFFECTS OF FINITE WORD LENGTH IN DIGITAL FILTERS 669 14.2. Deduce the signed-magnitude, ones-complement, and twos-complement representations of (a) 0.810546875 and (b) 0.9462890625. Assume a word length L = 10. 14.3. The twos complement of a number x can be designated as x = x0 .x1 x2 x L (a) Show that L x = x0 + i =1 xi 2i (b) Find x if x = 0.1110001011. (c) Find x if x = 1.1001110010. 14.4. Assuming that L = 7, perform the following operations by using ones- and twos-complement additions. (a) 0.6015625 0.4218750 (b) 0.359375 + (0.218750) 14.5. The twos complement of x is given by x = x0 .x1 x2 x L (a) Show that Twos complement (21 x ) = 21 x 1 + 21 x if x0 = 0 if x0 = 1 (b) Find the twos complement of 24 x if x = 1.00110. 14.6. (a) The register length in a xed-point digital-lter implementation is 9 bits (including the sign bit), and the arithmetic is of the twos-complement type. Find the largest and smallest machine-representable decimal numbers. (b) Show that the addition 0.8125 + 0.65625 will cause overow. (c) Show that the addition 0.8125 + 0.65625 + (0.890625) will be evaluated correctly despite the overow in the rst partial sum. 14.7. The mantissa and exponent register segments in a oating-point implementation are 8 and 4 bits long, respectively. (a) Deduce the register contents for 0.0234375, 5.0, 0.359375, and 11.5. (b) Determine the dynamic range of the implementation. Both mantissa and exponent are stored in signed-magnitude form. 14.8. A oating-point number B x = M 2e where M = i =1 bi 2i is to be stored in a register whose mantissa and exponent segments comprise L + 1 and e + 1 bits, respectively. Assuming signed-magnitude representation and quantization by rounding, nd the range of the quantization error. 14.9. A lter section is characterized by the transfer function H (z ) = H0 where H0 = 0.01903425 b0 = 0.8638557 b1 = 0.5596596 z2 (z + 1)2 + b1 z + b0 (a) Find the quantization error for each coefcient if signed-magnitude xed-point arithmetic is to be used. Assume quantization by truncation and a word length L = 6 bits. (b) Repeat part (a) if the quantization is to be by rounding. 670 DIGITAL SIGNAL PROCESSING 14.10. (a) Realize the transfer function of Prob. 14.9 by using a canonic structure. (b) The lter obtained in part (a) is implemented by using the arithmetic described in Prob. 14.9a . Plot the amplitude-response error versus frequency for 10 30 rad/s. The sampling frequency is 100 rad/s. (c) Repeat part (b), assuming quantization by rounding. (d) Compare the results obtained in parts (b) and (c). 14.11. (a) The transfer function H (z ) = z 2 + 2z + 1 z 2 + b1 z + b0 where b1 = r 2 and b0 = r 2 H H is to be realized by using the canonic structure of Fig. 14.7b. Find the sensitivities Sb1 (z ) and Sb0 (z ). (b) The section is to be implemented by using xed-point arithmetic, and the coefcient quantization is to be by rounding. Compute the statistical word length L () for 0.7 r 0.95 in steps of 0.05. Assume that Mmax () = 0.02, x1 = 2 (see Sec. 14.3). (c) Plot the statistical word length versus r and discuss the results achieved. 14.12. (a) Using Tables 14.2 and 14.3, obtain all possible low-sensitivity direct realizations of the transfer function in Prob. 14.9. (b) The realizations in part (a) are to be implemented in terms of signed-magnitude xed-point arithmetic using a word length L = 6, and quantization is to be by rounding. The sampling frequency is 100 rad/s. Plot the amplitude-response error versus frequency for 10 30 rad/s for each realization. (c) On the basis of the results in part (b), select the least sensitive of the possible realizations. (d) Compare the realization selected in part (c) with the canonic realization obtained in Prob. 14.10. 14.13. The transfer function 3 H (z ) = H0 i =1 z2 (z + 1)2 + b1i z + b0i where ai , b0i , and b1i are given in Table P14.13, represents a lowpass Butterworth lter. Table P14.13 i b0i b1i 1 2.342170 E 1 9.459200 E 1 2 3.753184 E 1 1.054062 3 7.148954 E 1 1.314318 H0 = 5.796931 E 4 (a) Realize the transfer function using three canonic sections in cascade. (b) The realization in part (a) is to be implemented in terms of xed-point signed-magnitude arithmetic using a word length L = 8 bits, and coefcient quantization is to be by rounding. The sampling frequency is 104 rad/s. Plot the amplitude-response error versus frequency for 0 103 rad/s. 14.14. (a) Realize the transfer function in Prob. 14.13 using structure II-2 of Table 14.3. (b) The realization in part (a) is to be implemented as in part (b) of Prob. 14.13. Plot the amplituderesponse error versus frequency for 0 103 rad/s. (c) Compare the realization in part (a) with the cascade canonic realization of Prob. 14.13 with respect to sensitivity and the number of arithmetic operations. 14.15. The response of an A/D converter to a signal x (t ) is given by y (n ) = x (n ) + e(n ) EFFECTS OF FINITE WORD LENGTH IN DIGITAL FILTERS 671 where x (n ) and e(n ) are random variables uniformly distributed in the ranges 1 x (n ) 1 and 2( L +1) e(n ) 2( L +1) , respectively. (a) Find the signal-to-noise ratio. This is dened as SNR = 10 log average signal power average noise power (b) Find the PSD of y (n ) if x (n ), e(n ), x (k ), and e(k ) are statistically independent. 14.16. The lter section of Prob. 14.9 is to be scaled using the scheme in Fig. 14.8. (a) Find for L scaling. (b) Find for L 2 scaling using a frequency-domain method. (c) Find for L 2 scaling using a time-domain method. (Hint: Use Parcevals discrete-time formula (Theorem 3.11)) (d ) Compare the methods in parts (b) and (c). (e) Compare the values of obtained with L and L 2 scaling and comment on the advantages and disadvantages of the two types of scaling. 14.17. The canonic realization of Prob. 14.13 is to be scaled according to the scheme in Fig. 14.9 using the L norm. (a) Find the scaling constants 0 , 1 , and 2 . (b) The scaled realization is to be implemented in terms of xed-point arithmetic and product quantization is to be by rounding. Plot the relative, output-noise PSD versus frequency. This is dened as RPSD = 10 log Sy (e j T ) Se (e j T ) where Sy (e j T ) is the PSD of output noise and Se (e j T ) is the PSD of a single noise source. The sampling frequency is 104 rad/s. 14.18. Repeat Prob. 14.17 using L 2 scaling and compare the results with those obtained in Prob. 14.17. 14.19. The low-sensitivity realization of Prob. 14.14 is to be scaled according to the scheme in Fig. 14.9 using the L 2 norm. (a) Find the scaling constants 0 , 1 , and 2 . (b) The scaled realization is to be implemented in terms of xed-point arithmetic and product quantization is to be by rounding. Plot the relative, output-noise PSD versus frequency. 14.20. The transfer function 3 H (z ) = i =1 a0i z 2 + a1i z + a0i z 2 + b1i z + b0i where a0i , a1i , b0i and b1i are given in Table P14.16 represents a bandstop elliptic lter. Table P14.16 i a0i a1i b0i b1i 1 4.623281 E 1 7.859900 E 9 7.534381 E 2 7.859900 E 9 2 4.879171 E 1 5.904108 E 2 8.051571 E 1 8.883641 E 1 3 1.269926 1.536691 E 1 8.051571 E 1 8.883640 E 1 (a) Realize the transfer function using three canonic sections in cascade. (b) Determine the scaling constants. Assume the section order implied by the transfer function and use L scaling. The sampling frequency is 18 rad/s. (c) Plot the relative output-noise PSD versus frequency. 672 DIGITAL SIGNAL PROCESSING 14.21. The transfer function 3 H (z ) = i =1 a0i z 2 + a1i z + 1 z 2 + a1i z + a0i where a0i and a1i are given in Table P14.17, represents a digital equalizer. Repeat parts (a) to (c) of Prob. 14.16. The sampling frequency is 2.4 rad/s. Table P14.17 i a0i a1i 1 0.973061 1.323711 2 0.979157 1.316309 3 0.981551 1.345605 14.22. Demonstrate the validity of Eq. (14.37). 14.23. Show that the column vectors f(z ) and g(z ) dened in Eq. (14.50) are given by the expressions in Eq. (14.51). 14.24. The vector q(n ) in the state-space realization {A,b,cT , d } is subjected to the transformation q(n ) = Tq(n ). (a) Show that the transformed realization {A, b, cT , d } is given by Eq. (14.52.) (b) Show that the transformed vectors (z ) and g(z ) are given by Eq. (14.53). f 14.25. (a) Obtain a state-space section-optimal realization of the lowpass lter in Prob. 14.13. (b) Apply L 2 scaling to the realization. (c) The scaled realization is to be implemented in terms of xed-point arithmetic and product quantization is to be by rounding. Plot the relative, output-noise PSD versus frequency. (d) Compare the results with those obtained in the case of the direct canonic realization in Prob. 14.18. 14.26. (a) Apply error-spectrum shaping to the scaled cascade canonic realization obtained in Prob. 11.13. (b) The modied realization is to be implemented in terms of xed-point arithmetic and product quantization is to be by rounding. Compute and plot the relative output-noise PSD versus frequency assuming the L 2 scaling obtained in Prob. 11.18. (c) Compare the results with those obtained without error-spectrum shaping in Prob. 11.18. 14.27. A second-order lter characterized by Eq. (14.75) with b1 = 1.343503 and b0 = 0.9025 is to be implemented using signed-magnitude decimal arithmetic. Quantization is to be performed by rounding each product to the nearest integer, and s = 2 rad/s. (a) Estimate the peak-to-peak amplitude and frequency of the limit cycle by using Jacksons approach. (b) Determine the actual amplitude and frequency of the limit cycle by simulation. (c) Compare the results obtained in parts (a) and (b). 14.28. Repeat Prob. 14.27 for the coefcients b1 = 1.8 and b0 = 0.99. 14.29. A second-order lter represented by Eq. (14.75) is implemented in terms of xed-point decimal arithmetic. (a) Show that the lter can sustain zero-input limit cycles of amplitude y0 ( y0 > 0) and frequency 0 or s /2 if Eq. (14.77) is satised. (b) Find y0 if b1 = 1.375 and b0 = 0.625. 14.30. The second-order realization shown in Fig. 4.5c can under certain conditions support the elimination of zero-input limit cycles. Deduce these conditions. 14.31. Show that the state-space realization of Eqs. (14.92a)(14.92d) supports the elimination of zero-input limit cycles. 14.32. Realize the lowpass lter of Prob. 14.13 using Meerk tters structure shown in Fig. 14.16. o 14.33. Design a sinusoidal oscillator by using a digital lter in cascade with a bandpass lter. The frequency of oscillation is required to be s /10. CHAPTER 15 DESIGN OF NONRECURSIVE FILTERS USING OPTIMIZATION METHODS 15.1 INTRODUCTION The window method for the design of nonrecursive lters described in Chap. 9 is based on a closedform solution and, as a result, it is easy to apply and entails a relatively insignicant amount of computation. Unfortunately, it usually leads to suboptimal designs whereby the lter order required to satisfy a set of given specications is not the lowest that can be achieved. Consequently, the number of arithmetic operations required per output sample is not minimum, and the computational efciency and speed of operation of the lter are not as high as could be. This chapter deals with a method for the design of nonrecursive lters known as the weightedChebyshev method. In this method, an error function is formulated for the desired lter in terms of a linear combination of cosine functions and is then minimized by using a very efcient multivariable optimization algorithm known as the Remez exchange algorithm. When convergence is achieved, the error function becomes equiripple as in other types of Chebyshev solutions (see Sec. 10.4). The amplitude of the error in different frequency bands of interest is controlled by applying weighting to the error function. The weighted-Chebyshev method is very exible and can be used to obtain optimal solutions for most types of nonrecursive lters, e.g., digital differentiators, Hilbert transformers, and lowpass, 673 Copyright 2006 by The McGraw-Hill Companies, Inc. Click here for terms of use. 674 DIGITAL SIGNAL PROCESSING highpass, bandpass, bandstop, and multiband lters with piecewise-constant amplitude responses. Furthermore, like the methods of Chaps. 12 and 16, it can be used to design lters with arbitrary amplitude responses. In common with other optimization methods, the weighted-Chebyshev method requires a large amount of computation; however, as the cost of computation is becoming progressively cheaper and cheaper with time, this disadvantage is not a very serious one. The development of the weighted-Chebyshev method began with a paper by Herrmann published in 1970 [1], which was followed soon after by a paper by Hofstetter, Oppenheim, and Siegel [2]. These contributions were followed by a series of papers, during the seventies, by Parks, McClellan, Rabiner, and Herrmann [38]. These developments led, in turn, to the well-known McClellan-ParksRabiner computer program for the design of nonrecursive lters, documented in [9], which has found widespread applications. The approach to weighted-Chebyshev lters presented in this chapter is based on that reported in Refs. [3, 6, 8], and includes several enhancements proposed by the author in Refs. [10, 11]. 15.2 PROBLEM FORMULATION Consider a nonrecursive lter characterized by the transfer function N 1 H (z ) = n =0 h (nT )z n (15.1) and assume that N is odd, the impulse response is symmetrical, and s = 2 . Since T = 2/s = 1 s, the frequency response of the lter can be expressed as H (e j T ) = e jc Pc () where c Pc () = k =0 ak cos k (15.2) a0 = h (c) ak = 2h (c k ) c = ( N 1)/2 (see Table 9.1). If e jc D () is the desired frequency response and W () is a weighting function, an error function E () can be constructed as E () = W ()[ D () Pc ()] If | E ()| is minimized such that | E ()| p (15.3) for k = 1, 2, . . . , c DESIGN OF NONRECURSIVE FILTERS USING OPTIMIZATION METHODS 675 with respect to some compact subset of the frequency interval [0, ], say, , a lter can be obtained in which | E 0 ()| = | D () Pc ()| p |W ()| for (15.4) 15.2.1 Lowpass and Highpass Filters The amplitude response of an equiripple lowpass lter is of the form illustrated in Fig. 15.1, where p and a are the amplitudes of the passband and stopband ripples, and p and a are the passband and stopband edges, respectively. Hence, we require D () = with | E 0 ()| p a for 0 p for a (15.5b) 1 0 for 0 p for a (15.5a) Therefore, from Eqs. (15.4) and (15.5b), we can deduce the weighting function as W () = 1 p /a for 0 p for a (15.6) Similarly, for highpass lters, we obtain D () = 0 1 for 0 a for p 1 + p 1.0 1 p Gain a p a Figure 15.1 Amplitude response of an equiripple lowpass lter. 676 DIGITAL SIGNAL PROCESSING and W () = p /a 1 for 0 a for p (15.7) 15.2.2 Bandpass and Bandstop Filters The amplitude responses of equiripple bandpass and bandstop lters assume the forms illustrated in Fig. 15.2a and b, respectively, where p and a are the passband and stopband ripples, respectively, 1 + p 1.0 1 p Gain a a1 p1 (a) p2 a2 1 + p 1.0 1 p Gain a p1 a1 (b) a2 p2 Figure 15.2 Amplitude responses of equiripple lters: (a) Bandpass lter, (b) bandstop lter. DESIGN OF NONRECURSIVE FILTERS USING OPTIMIZATION METHODS 677 p1 and p2 are the passband edges, and a 1 and a 2 are the stopband edges. For bandpass lters 0 D () = 1 0 p /a W () = 1 p /a and for bandstop lters 1 D () = 0 1 1 W () = p /a 1 for 0 p1 for a 1 a 2 for p2 for 0 p1 for a 1 a 2 for p2 for 0 a 1 for p1 p2 for a 2 for 0 a 1 for p1 p2 for a 2 (15.8) (15.9) 15.2.3 Alternation Theorem An effective approach for the solution of the optimization problem at hand is to solve the minimax problem minimize {max | E ()|} x (15.10) where x = [a0 a1 . . . ac ]T The solution of this problem exists by virtue of the so-called alternation theorem [12] which is as follows: Theorem 15.1 Alternation Theorem If Pc ( ) is a linear combination of r = c + 1 cosine functions of the form c Pc ( ) = k =0 ak cos k then a necessary and sufcient condition that Pc ( ) be the unique, best, weighted-Chebyshev approximation to a continuous function D ( ) on , where is a compact subset of the frequency interval [0, ], is that the weighted error function E ( ) exhibits at least r + 1 678 DIGITAL SIGNAL PROCESSING extremal frequencies in , that is, there must exist at least r + 1 points i in such that 0 < 1 < . . . < r E (i ) = E (i +1 ) and | E (i )| = max | E ( )| for i = 0, 1, . . . , r 1 for i = 0, 1, . . . , r From the alternation theorem and Eq. (15.3), we can write E (i ) = W (i )[ D (i ) Pc (i )] = (1)i (15.11) for i = 0, 1, . . . , r , where is a constant. This system of equations can be put in matrix form as 1 1 cos 0 cos 20 cos c0 W (0 ) a0 1 a1 D (0 ) D (1 ) 1 cos 1 cos 21 cos c1 W (1 ) . = . . . . . . . . . . . . . . . a . . . .c . D (r ) (1)r 1 cos r cos 2r cos cr W (r ) (15.12) If the extremal frequencies (or extremals for short) were known, coefcients ak and, in turn, the frequency response of the lter could be computed using Eq. (15.2). The solution of this system of equations exists since the above (r + 1) (r + 1) matrix is known to be nonsingular [12]. 15.3 REMEZ EXCHANGE ALGORITHM The Remez exchange algorithm is an iterative multivariable algorithm which is naturally suited for the solution of the minimax problem in Eq. (15.10). It is based on the second optimization method of Remez [13] and involves the following basic steps: Algorithm 1: Basic Remez exchange algorithm 1. Initialize extremals 0 , 1 , . . . , r and ensure that an extremal is assigned at each band edge. 2. Locate the frequencies 0 , 1 , . . . , at which | E ()| is maximum and | E ( i )| . These frequencies are potential extremals for the next iteration. 3. Compute the convergence parameter Q= max | E ( i )| min | E ( i )| max | E ( i )| (15.13) where i = 0, 1, . . . , . 4. Reject r superuous potential extremals i according to an appropriate rejection criterion and renumber the remaining i sequentially; then set i = i for i = 0, 1, . . . , r . DESIGN OF NONRECURSIVE FILTERS USING OPTIMIZATION METHODS 679 5. If Q > , where is a convergence tolerance (say = 0.01), repeat from step 2; otherwise continue to step 6. 6. Compute Pc () using the last set of extremals; then deduce h (n ), the impulse response of the required lter, and stop. u The amount of computation required by the algorithm tends to depend quite heavily on the initialization scheme used in step 1, the search method used for the location of the maxima of the error function in step 2, and the criterion used to reject superuous frequencies i in step 4. 15.3.1 Initialization of Extremals The simplest scheme for the initialization of extremals i for i = 0, 1, . . . , r is to assume that they are uniformly spaced in the frequency bands of interest. If there are J distinct bands in the required lter of widths B1 , B2 , . . . , B J and extremals are to be located at the left-hand and right-hand band edges of each band, the total bandwidth, that is, B1 + B2 + + B J , should be divided into r + 1 J intervals. Under these circumstances, the average interval between adjacent extremals is W0 = 1 r +1 J J Bj j =1 Since the quantities B j / W0 need not be integers, the use of W0 for the generation of the extremals will almost always result in a fractional interval in each band. This problem can be avoided by rounding the number of intervals B j / W0 to the nearest integer and then readjusting the frequency interval for the corresponding band accordingly. This can be achieved by letting the numbers of intervals in bands j and J be m j = Int and J 1 Bj + 0.5 W0 for j = 1, 2, . . . , J 1 (15.14a) mJ = r j =1 (m j + 1) (15.14b) respectively, and then recalculating the frequency intervals for the various bands as Wj = Bj mj for j = 1, 2, . . . , J (15.15) A more sophisticated initialization scheme which was found to give good results is described in Ref. [14]. 15.3.2 Location of Maxima of the Error Function The frequencies i , which must include maxima at band edges if | E (i )| | |, can be located by simply evaluating | E ()| over a dense set of frequencies. A reasonable number of frequency points that yields sufcient accuracy in the determination of the frequencies i is 8( N + 1). This 680 DIGITAL SIGNAL PROCESSING corresponds to about 16 frequency points per ripple of | E ()|. A suitable frequency interval for the j th band is w j = W j / S with S = 16. The above exhaustive step-by-step search can be implemented in terms of Algorithm 2 below where L j and R j are the left-hand and right-hand edges in band j ; W j is the interval between adjacent extremals and m j is the number of intervals W j in band j ; w j is the interval between successive samples of | E ()| in interval W j and S is the number of intervals w j in each interval W j ; N j is the total number of intervals w j in band j ; and J is the number of bands. Algorithm 2: Exhaustive step-by-step search 1. Set N j = m j S , w j = B j / N j , and e = 0. 2. For each of bands 1, 2, . . . , j , . . . , J do: For each of frequencies 1 j = L j , 2 j = L j + w j , . . . , i j = L j + (i 1)w j , . . . , ( N j +1) j = R j , set e = i j and e = e + 1 provided that | E (i j )| | | and one of the following conditions holds: (a) Case i j = L j : if | E (i j )| is maximum at i j = L j (i.e., | E ( L j )| > | E ( L j + )|); (b) Case L j < i j < R j : if | E ()| is maximum at = i j (i.e., | E (i j w j )| < | E (i j )| > | E (i j + w j )|); (c) Case i j = R j : if | E (i j )| is maximum at i j = R j (i.e., | E ( R j )| > | E ( R j )|. u The parameter in steps 2(a ) and 2(c) is a small positive constant and a value 102 w j was found to yield satisfactory results. In practice, | E ()| is maximum at an interior left-hand band edge1 if its rst derivative at the band edge is negative, and a mirror-image situation applies at an interior right-hand band edge. In such cases, | E ()| has a zero immediately to the right or left of the band edge and the inequality in step 2(a ) or 2(c) may sometimes fail to identify a maximum. However, the problem can be avoided by using the inequality | E ( L j )| > | E ( L j )| in step 2(a ) and | E ( R j )| < | E ( R j + )| in step 2(c) for interior band edges. An alternative approach to the problem is to use gradient information based on the formulas given in Sec. 15.6. In rare circumstances, a maximum of | E ()| may occur between a band edge and the rst sample point. Such a maximum may be missed by Algorithm 2 but the problem can be easily identied since the number of potential extremals will then be less than the minimum. The remedy is to check the number of potential extremals at the end of each iteration and if it is found to be less than r + 1, the density of sample points, i.e., S , is doubled and the iteration is repeated. If the problem persists, the process is repeated until the required number of potential extremals is obtained. If a value of S equal to or less than 256 does not resolve the problem, the loss of potential extremals is most likely due to some other reason. An important precaution in the implementation of the preceding as well as the subsequent search methods is to ensure that extremals belong to the dense set of frequency points to avoid numerical ill-conditioning in the computation of E () (see Eqs. (15.11) and (15.17)). In addition, the condition | E (i j )| | | should be replaced by | E (i j )| > | | 1 , where 1 is a small positive constant, say, 106 , to ensure that no maxima are missed owing to roundoff errors. 1 An interior band edge is one in the range 0 < < , that is, not at = 0 or . DESIGN OF NONRECURSIVE FILTERS USING OPTIMIZATION METHODS 681 The search method is very reliable and its use in Algorithm 1 leads to a robust algorithm since the entire frequency axis is searched using a dense set of frequency points. Its disadvantage is that it requires a considerable amount of computation and is, therefore, inefcient. Improved search methods will be considered in Sec. 15.4. A more efcient version of Algorithm 2 is obtained by maintaining all the interior band edges as extremals throughout the optimization independently of the behavior of the error function at the band edges. However, the algorithm obtained tends to fail more frequently than Algorithm 2. 15.3.3 Computation of | E ( )| and Pc ( ) In steps 2 and 6 of the basic Remez algorithm (Algorithm 1), | E ()| and Pc () need to be evaluated. This can be done by determining coefcients ak by inverting the matrix in Eq. (15.12). This approach is inefcient and may be subject to numerical ill-conditioning, in particular, if is small and N is large. An alternative and more efcient approach is to deduce analytically and then interpolate Pc () on the r frequency points using the barycentric form of the Lagrange interpolation formula. The necessary formulation is as follows. Parameter can be deduced as = and Pc () is given by Ck r 1 k Ck k =0 x x k r 1 k k =0 x x k r k =0 k D (k ) r (1)k k k =0 W (k ) (15.16) for = 0 , 1 , . . . , r 1 otherwise (15.17) Pc () = where r k = i =0, i =k 1 xk xi W (k ) (15.18) (15.19) (15.20) Ck = D (k ) (1)k r 1 k = i =0, i =k 1 xk xi with x = cos and xi = cos i for i = 0, 1, 2, . . . , r In step 2 of the Remez algorithm, | E ()| often needs to be evaluated at a frequency that was an extremal in the previous iteration. For these cases, the magnitude of the error function is simply | |, according to Eq. (15.11), and need not be evaluated. 682 DIGITAL SIGNAL PROCESSING 15.3.4 Rejection of Superuous Potential Extremals The solution of Eq. (15.12) can be obtained only if precisely r + 1 extremals are available. By differentiating E (), one can show that in a lter with one frequency band of interest (e.g., a digital differentiator) the number of maxima in | E ()| (potential extremals in step 2 of Algorithm 1) is r + 1. In the weighted-Chebyshev method, band edges at which | E ()| is maximum and | E ()| | | are treated as potential extremals (see Algorithm 2). Therefore, whenever the number of frequency bands is increased by one, the number of potential extremals is increased by 2, that is, for a lter with J bands there can be as many as r + 2 J 1 frequencies i and a maximum of 2 J 2 superuous i may occur. This problem is overcome by rejecting r of the potential extremals i , if > r , in step 4 of the algorithm. A simple rejection scheme is to reject the r frequencies i that yield the lowest | E (i )| and then renumber the remaining i from 0 to r [8]. This strategy is based on the well-known fact that the magnitude of the error in a given band is inversely related to the density of extremals in that band, i.e., a low density of extremals results in a large error and a high density results in a small error. Conversely, a low band error is indicative of a high density of extremals, and rejecting superuous i in such a band is the appropriate course of action. A problem with the above scheme is that whenever a frequency remains an extremal in two successive iterations, | E ()| assumes the value of | | in the second iteration by virtue of Eq. (15.11). In practice, there are almost always several frequencies that remain extremals from one iteration to the next, and the value of | E ()| at these frequencies will be the same. Consequently, the rejection of potential extremals on the basis of the magnitude of the error can become arbitrary and may lead to the rejection of potential extremals in bands where the density of extremals is low. This tends to increase the number of iterations, and it may even prevent the algorithm from converging on occasion. This problem can to some extent be alleviated by rejecting only potential extremals that are not band edges. An alternative rejection scheme based on the above strategy, which was found to give excellent results for 2-band and 3-band lters, involves ranking the frequency bands in the order of lowest average band error, dropping the band with the highest average error from the list, and then rejecting potential extremals, one per band, in a cyclic manner starting with the band with the lowest average error [11]. The steps involved are as follows: Algorithm 3: Alternative rejection scheme for superuous potential extremals 1. Compute the average band errors Ej = 1 j | E ( i )| i j for j = 1, 2, . . . , J where j is the set of potential extremals in band j given by j = { i : L j i R j } j is the number of potential extremals in band j , and J is the number of bands. 2. Rank the J bands in the order of lowest average error and let l1 , l2 , . . . , l J be the ranked list obtained, i.e., l1 and l J are the bands with the lowest and highest average error, respectively. 3. Reject one i in each of bands l1 , l2 , . . . , l J 1 , l1 , l2 , . . . until r superuous i are rejected. In each case, reject the i , other than a band edge, that yields the lowest | E ( i )| in the band. u DESIGN OF NONRECURSIVE FILTERS USING OPTIMIZATION METHODS 683 For example, if J = 3, r = 3, and the average errors for bands 1, 2, and 3 are 0.05, 0.08, and 0.02, then i are rejected in bands 3, 1, and 3. Note that potential extremals are not rejected in band 2, which is the band of highest average error. 15.3.5 Computation of Impulse Response The impulse response in step 6 of Algorithm 1 can be determined by noting that function Pc () is the frequency response of a noncausal version of the required lter. The impulse response of this lter, represented by h 0 (n ) for c n c, can be determined by computing Pc (k ) for k = 0, 1, 2, . . . , c, where = 2/ N , and then using the inverse discrete Fourier transform. It can be shown that h 0 (n ) = h 0 (n ) = 1 N c Pc (0) + k =1 2 Pc (k ) cos 2 kn N (15.21) for n = 0, 1, 2, . . . , c (see Prob. 15.1). Therefore, the impulse response of the required causal lter is given by h (n ) = h 0 (n c) for n = 0, 1, 2, . . . , N 1. 15.4 IMPROVED SEARCH METHODS For a lter of length N , with the number of intervals w j in each interval W j equal to S , the exhaustive step-by-step search of Sec. 15.3.2 (Algorithm 2) requires about S ( N + 1)/2 function evaluations, where each function evaluation entails N 1 additions, ( N + 1)/2 multiplications, and ( N + 1)/2 divisions (see Eq. (15.17)). A Remez optimization usually requires four to eight iterations for lowpass or highpass lters, 6 to 10 iterations for bandpass lters, and 8 to 12 iterations for bandstop lters. Further, if prescribed specications are to be achieved and the appropriate value of N is unknown, typically two to four Remez optimizations have to be performed (see Sec. 15.7). For example, if N = 101, S = 16, number of Remez optimizations = 4, iterations per optimization = 6, the design would entail 24 iterations, 19,200 function evaluations, 1.92 106 additions, 0.979 106 multiplications, and 0.979 106 divisions. This is in addition to the computation required for the evaluation of and coefcients k , Ck , and k once per iteration. In effect, the amount of computation required to complete a design is quite substantial. In this section, alternative search techniques which reduce the amount of computation to a fraction of that required by the exhaustive search described in the previous section, are described. 15.4.1 Selective Step-by-Step Search When Eq. (15.12) is solved, the error function | E ()| is forced to satisfy the alternation theorem of Sec. 15.2.3. This theorem can be satised in several ways. The most likely possibility is illustrated in Fig. 15.3a , where L j and R j are the left-hand and right-hand edges, respectively, of the j th frequency band. In this case, L j and R j are extremal frequencies and there is strict alternation 684 DIGITAL SIGNAL PROCESSING between maxima and zeros of | E ()|. Additional maxima of | E ()| can be introduced under the following circumstances: 1. To the right of = 0 (rst band), if there is an extremal and | E ()| has a minimum at = 0, as depicted in Fig. 15.3b (see properties of | Pc ()| in Sec. 15.6); 2. To the left of = (last band), if there is an extremal and | E ()| has a minimum at = , as depicted in Fig. 15.3c (see Sec. 15.6); 3. At = 0, if there is no extremal at = 0, as depicted in Fig. 15.3d ; 4. At = , if there is no extremal at = , as depicted in Fig. 15.3e; 5. To the right of an interior left-hand edge, as depicted in Fig. 15.3 f ; 6. To the left of an interior right-hand edge, as depicted in Fig. 15.3g ; 7. At = L j , if there is no extremal at = L j , as depicted in Fig. 15.3h ; 8. At = R j , if there is no extremal at = R j , as depicted in Fig. 15.3i ; 9. Two consecutive new maxima at the interior of a band between two adjacent extremals, as depicted in Fig. 15.3 j . The maxima in Fig. 15.3a can be located by searching in the neighborhood of each extremal frequency using gradient information since there is a one-to-one correspondence between extremals and maxima of | E ()|. If the rst derivative is positive (negative), there is a maximum of | E ()| to the right (left) of the extremal, which can be readily located by increasing (decreasing) the frequency in steps w j until | E ()| begins to decrease. The maxima in items (1) and (2) in the above list can be found by searching to the right of = 0 in the rst case or to the left of = in the second case, if the second derivative is positive at = 0 or . Similarly, the maxima in (3) and (4) can be identied by checking whether | E ()| has a maximum and | E ()| | | at = 0 in the rst case or at = in the second case. The maxima in (5) and (6) can be found by searching to the right of an interior left-hand edge if the rst derivative is positive or to the left of a right-hand interior edge if the rst derivative is negative. Similarly, the maxima in (7) and (8) can be identied by checking whether the rst derivative is negative at = L j in the rst case and positive at = R j in the second case, and | E ()| | | in each of the two cases. If a selective step-by-step search based on the above principles is used in Algorithm 1, then at the start of the optimization the distance between a typical extremal i and the nearby maximum point i will be less than half the period of the corresponding ripple of | E ()|, owing to the relative symmetry of the ripples of the error function. In effect, in the rst iteration only half of the combined width of the different bands needs to be searched. This will reduce the number of function evaluations by more than 50 percent relative to that required by the exhaustive search of Sec. 15.3.2 without degrading the accuracy of the optimization in any way. As the optimization progresses and the solution is approached, extremal i and maximum point i tend to coincide and, therefore, the cumulative length of the fre quency range that has to be searched is progressively reduced, thereby resulting in further economies in the number of function evaluations. In the last iteration, only two or three function evaluations are needed (including derivatives) per ripple. As a result, the total number of function evaluations can be reduced by 65 to 70 percent relative to that required by the exhaustive search [10]. A selective search of the type just described will miss maxima of the type in item (9) of the above list and the algorithm will fail. However, the problem can be overcome relatively easily. Maxima of the type in (9) can sometimes occur in the stopbands of bandstop lters, and it was found DESIGN OF NONRECURSIVE FILTERS USING OPTIMIZATION METHODS 685 |E()| || + + + Lj ^ ^ 2j 1j ^ 3j ^ 4j ^ 5j ^ 6j Rj ^ 7j (a) |E()| || 0 ^ 1j ^ 2j ^ (j1)J ^ j J (b) (c) || 0 ^ 1j ^ 2j ^ (j1)J ^ j J (d ) (e) Figure 15.3 Types of maxima in | E ()|. 686 DIGITAL SIGNAL PROCESSING |E()| || Lj ^ 1j ^ 2j ^ 3j ^ (j1)j Rj ^ j j (f) ( g) || L j ^ 1j ^ 2j ^ (j1) j ^ j j Rj (h) (i) |E()| || Lj 1j 2j ( j) 3j + 4j + Rj 5j Figure 15.3 Contd Types of maxima in | E ()|. DESIGN OF NONRECURSIVE FILTERS USING OPTIMIZATION METHODS 687 possible to reduce the number of failures by increasing somewhat the density of extremals in the stopband relative to the density of extremals in the passbands [11]. An alternative approach, which was found to give good results, is to check the distance between adjacent potential extremals at the end of the search; if the difference exceeds the initial difference by a signicant amount (say if ((k +1) k ) > RW j for some k , where R is a constant in the range 1.5 to 2.0), then an exhaustive search is undertaken between k and (k +1) to locate any missed maxima. 15.4.2 Cubic Interpolation This section deals with yet another search method that can further increase the computational efciency of the Remez algorithm. The method is based on cubic interpolation [11]. Assume that the error function, depicted in Fig. 15.4, can be represented by the third-order polynomial | E ()| = M = a + b + c2 + d 3 (15.22) where a , b, c, and d are constants. The rst derivative of M with respect to is obtained from Eq. (15.22) as dM = G = b + 2c + 3d 2 d Hence, the frequencies at which M has stationary points are given by = 1 c 3d (c2 3bd ) (15.23) |E()| ~ 1 ~ 2 ~ 3 Figure 15.4 Frequency points for cubic interpolation. ) 688 DIGITAL SIGNAL PROCESSING Assuming that d = 0, the stationary point that corresponds to a maximum point, designated as , can be selected by noting that M is maximum when d2 M = 2c + 6d < 0 d 2 or < c 3d (15.24) Evidently, if constants b, c, and d are known, can be readily determined. If we assume that 1 , 2 , and 3 are distinct frequencies, we can write M for k = 1, 2, and 3 and G = 1 =k = Mk = a + bk + c(k )2 + d (k )3 = G 1 = b + 2c1 + 3d (1 )2 By solving this system of simultaneous equations, we can show that d= c = d (15.25) (15.26) (15.27) b = G 1 2c1 3d (1 )2 where ( M2 M1 ) + G 1 (1 2 ) 2 (1 2 ) ( M3 M1 ) + G 1 (1 3 ) = 2 (1 3 ) = = = 2(1 )2 2 (1 + 2 ) (1 2 ) 2(1 )2 3 (1 + 3 ) (1 3 ) (15.28) (15.29) (15.30) (15.31) By evaluating constants , , , , d , c, and b and then using Eqs. (15.23) and (15.24), can be determined. The search just described entails four function evaluations, three for M1 , M2 , M3 , and one for G 1 , per external. The method is useful as a possible replacement of the selective search only if it gives a fairly accurate estimate of . To achieve this goal, the cubic interpolation should not be used near band edges where | E ()| is not well behaved (see Fig. 15.3). DESIGN OF NONRECURSIVE FILTERS USING OPTIMIZATION METHODS 689 If the above cubic interpolation is to be used to nd the maximum of | E ()| in the neighborhood of extremal i , the most suitable value for frequency 1 is the extremal itself since the value of M is known at this frequency and need not be computed. It is given by Eq. (15.11) as M |=i = | | The frequency 3 should bracket the required maximum point i , that is, |i | < |i | < |3 |, but it should not bracket the adjacent zero of the error function. It should be recalled at this point that as the solution is approached, i tends to move closer to i . Therefore, the accuracy of the cubic interpolation can be improved by reducing the interval 3 1 as the solution is approached. Such an adjustable bracket can be formed by using the convergence parameter Q of Eq. (15.13), which is known to reduce from 1 to 0 as the solution is approached. A formula for 3 , which was found to give good results [11] is i + Q (i +1 i ) 2 3 = Q ( ) i i 1 i 2 for G 1 > 0 (15.32) for G 1 < 0 Frequency 2 can be placed at the center of the frequency range 1 to 3 , that is, 2 = 1 (1 + 3 ) 2 (15.33) The computational efciency of the cubic-interpolation method described remains constant from iteration to iteration since the number of function evaluations required to perform an interpolation is constant. At the start of the optimization, the cubic-interpolation search is more efcient than the selective step-by-step method. However, as the solution is approached the number of function evaluations required by the selective search is progressively reduced, as was stated earlier, and at some point the selective search becomes more efcient. A prudent strategy under these circumstances is to use the cubic-interpolation search at the start of the optimization and switch over to the selective step-by-step search when some suitable criterion is satised. Extensive experimental results have shown that computational advantage can be gained by using the cubic-interpolation search if Q > 0.65, and the selective search otherwise [11]. The use of the cubic interpolation search along with the selective step-by-step search of the preceding section can reduce the number of function evaluations by 70 to 75 percent relative to that required by the exhaustive search. 15.4.3 Quadratic Interpolation An alternative method for the location of the maxima of | E ()| that was found to work well is based on a two-stage quadratic interpolation search. However, the computational efciency that can be achieved with this approach was found to be somewhat inferior relative to the above one-stage cubic-interpolation search. 15.4.4 Improved Formulation In the problem formulation considered so far, the extremals 0 , 1 , . . . , r are treated as a 1-D array and are numbered sequentially from 0 to r . Through the rejection of superuous extremals, as 690 DIGITAL SIGNAL PROCESSING detailed in the previous sections, the distribution of extremals can change from iteration to iteration. In order to evaluate and coefcients Ck in Eqs. (15.16) and (15.19) correctly, it is necessary to monitor and track the indices of the rst and last extremal of each band throughout the optimization. This tends to complicate the implementation of the Remez algorithm quite signicantly. The problem can be eliminated by representing the extremals in terms of a 2-D array of the form 11 12 21 22 = . . . . . . 1 1 2 2 1 j 1 J 2 j 2 J . . . . . . j j J J where the j th column represents the extremals of the j th band, j is the number of extremals in the j th band, and J is the number of bands. The use of this notation necessitates that the formulas for and Pc () be modied accordingly. From Eqs. (15.16)(15.20) one can show that (see Probs. 15.2 and 15.3) = and {k , m }Kr km D (km ) (1)q km {k , m }Kr W (km ) (15.34) Pc () = Ckm for (15.35) otherwise km Ckm {k , m }Kr 1 x xkm km {k , m }Kr 1 x xkm where km = km {i , j }Ir 1 1 xkm xi j if k = J and m = J otherwise W (km ) (15.36) km = km xkm x J J (15.37) Ckm = D (km ) (1)q with q= and x = cos k1 k1+ (15.38) m 1 j =1 j if m = 1 if m 2 (15.39) xi j = cos i j for {i , j } Ir DESIGN OF NONRECURSIVE FILTERS USING OPTIMIZATION METHODS 691 In the above formulation, Kr , Kr 1 , Ir , and Ir 1 are sets given by Kr = {{k , m } : (1 k m ) and (1 m J )} Kr 1 = {{k , m } : (1 k l ) and (1 m J )} Ir = {{i , j } : (1 i j ) and (1 j J )} and Ir 1 = {{i , j } : (1 i h ) and (1 j J ) and (i = k or j = m )} with l= and h= J 1 j for j = J otherwise J 1 m for m = J otherwise (15.43) (15.40) (15.41) (15.42) 15.5 EFFICIENT REMEZ EXCHANGE ALGORITHM The above principles will now be used to construct an efcient Remez exchange algorithm. As in Algorithm 2, L j and R j are the left- and right-hand edges in band j ; W j is the interval between adjacent extremals and m j is the number of intervals W j in band j ; w j is the interval between successive samples in interval W j , and S is the number of intervals w j in each interval W j ; N j is the total number of intervals w j in band j ; and J is the number of bands. The frequencies 1 j , 2 j , . . . , j j are the current extremals and 1 j , 2 j , . . . , j j are the potential extremals for the next iteration in band j . The magnitude of the error function and its rst and second derivatives with respect to are denoted as M = | E ()| G1 = d | E ()| d G2 = d 2 | E ()| d 2 The improved algorithm consists of a main part called MAIN which calls routines EXTREMALS, SELECTIVE, and CUBIC. The steps involved are detailed below. Algorithm 4: Efcient Remez exchange algorithm MAIN M1. (a) Initialize S , say, S = 16, and set Q = 1. (b) For j = 1, 2, . . . , J do: Compute m j and W j for j = 1, 2, . . . , J using Eqs. (15.14) and (15.15), respectively. Initialize extremals by letting 1 j = L j , . . . , i j = L j + (i 1)W j , . . . , j j = R j = L j + m j W j . Set N j = m j S and w j = B j / N j . 692 DIGITAL SIGNAL PROCESSING M2. (a) Compute coefcients k j , k j , and Ck j for j = 1, 2, . . . , J using Eqs. (15.36)(15.38). (b) Compute using Eq. (15.34). M3. Call EXTREMALS. M4. (a) Set = 1 + 2 + . . . J . (b) Reject (r + 1) superuous potential extremals2 using Algorithm 3, renumber the remaining i j sequentially, and update j if necessary. (c) Update extremals by letting i j = i j for i = 1, 2, . . . , j and j = 1, 2, . . . , J . M5. (a) Compute Q using Eq. (15.13). (b) If Q > 0.01, go to step M2. M6. (a) Compute Pc (k ) for k = 0, 1, . . . , r 1 using Eq. (15.35). (b) Compute h (n ) using Eq. (15.21). (c) Stop. EXTREMALS E1. For each of bands 1, 2, . . . , j , . . . , J do: (A) Set e = 0. (B) For each of extremals 1 j , 2 j , . . . , i j , . . . , j j do: (a) Case i j = 1 j : If i j = L j , then do: Case j = 1 (rst band): If G 2 < 0, then set e = e + 1 and ej = i j ; otherwise call SELECTIVE. Case j = 1 (other bands): If G 1 > 0, then call SELECTIVE; otherwise set e = e + 1 and ej = i j . If i j = L j , then call SELECTIVE. (b) Case 1 j < i j < j j : If Q < 0.65, then call SELECTIVE; otherwise call CUBIC. If flag 0 = 1 (CUBIC was unsuccessful in generating a good estimate of the maximum point), then call SELECTIVE. (c) Case i j = j j : If i j = R j , then do: Case j = J (last band): If G 2 < 0, then set e = e + 1 and ej = i j ; otherwise call SELECTIVE. Case j = J (other bands): If G 1 < 0, then call SELECTIVE; otherwise set e = e + 1 and ej = i j . If i j = R j , then call SELECTIVE. (C) Check for an additional potential extremal at the left-hand edge of band j : If 1 j and 1 j = L j , | E ( L j )| > | E ( L j + w j )|, and | E ( L j )| | |, then set e = e + 1 and insert new potential extremal at = L j . difference between the number of superuous extremals in step 4 of Algorithm 1 and step M4(b) of Algorithm 4 is due to the fact that the count of potential extremals starts with 0 in Algorithm 1 and with 1 in Algorithm 4. 2 The DESIGN OF NONRECURSIVE FILTERS USING OPTIMIZATION METHODS 693 (D) Check for an additional potential extremal at the right-hand edge of band j : If j j and e j = R j , | E ( R j w j )| < | E ( R j )|, and | E ( R j )| | |, then insert new potential extremal at = R j and set e = e + 1. (E) Check for additional potential extremals in band j : (a) For k = 1, 2, . . . , e 1 check if (k +1) j k j > RW j For each value of k for which the inequality is satised, use an exhaustive search between frequencies k j and (k +1) j (see Algorithm 2). For each new maximum of M such that | E ()| | |, insert a new potential extremal sequentially between k j and (k +1) j and set e = e + 1 ( R is a constant in the range 1.5 to 2.0). (b) If there is a large gap (larger than RW j ) between the left-hand edge and the rst potential extremal, check for additional potential extremals in the range L j < < 1 j ; for each new maximum such that | E ()| | |, insert a new potential extremal sequentially between L j and 1 j and set e = e + 1. (c) If there is a large gap (larger than RW j ) between the last potential extremal and the righthand edge, check for additional potential extremals in the range ej < < R j ; for each new maximum such that | E ()| | |, insert a new potential extremal sequentially between ej and R j and set e = e + 1. (F ) Set j = e. Return. E2. SELECTIVE S1. If (G 1 > 0 and i j = 0) or (G 2 > 0 and i j = 0), then increase in steps w j until a maximum of M is located. Set e = e + 1 and assign the frequency of this maximum to e . If no maximum is located in the frequency range i j < ((i +1) j or R j ), discontinue the search. S2. If (G 1 < 0 and i j = ) or (G 2 > 0 and i j = ), then decrease in steps w j until a maximum of M is located. Set e = e + 1 and assign the frequency of this maximum to e . If no maximum is located in the frequency range ( L j or (i 1) j ) < i j , discontinue the search. S3. Return. CUBIC C1. Set f lag 0 = 0. C2. Set 1 = i j and compute frequencies 3 and 2 using Eqs. (15.32) and (15.33). C3. Compute constants , , , and using Eqs. (15.28)(15.31). C4. Compute constants d , c, and b using Eqs. (15.25)(15.27). If 3bd > c2 (third-order polynomial has no maximum), then set f lag 0 = 1 and return. C5. Compute using Eqs. (15.23) and (15.24). If frequency is outside the interval [1 , 3 ] (estimate of the maximum point is unreliable), then set f lag 0 = 1 and return. C6. Set = w j Int ( /w j + 0.5). C7. Set e = e + 1 and ej = . C8. Return. u Step E1(B)(a) checks for maxima at or near the left-hand edge of each band for the cases illustrated in Fig. 15.3a , b, d, f, and h . Step E1(B)(b) locates the interior maxima in Fig. 15.3a that 694 DIGITAL SIGNAL PROCESSING correspond to extremals 2 j to ( j 1) j . Step E1(B)(c) checks for maxima at or near the right hand edge of each band for the cases illustrated in Fig. 15.3a , c, e, g, and i . Step E1(C) checks for a new maximum at left-hand edge L j in the special case where there is no extremal and a maximum has not been picked up already at this frequency by step E1(B)(a). Such a situation can arise as shown in Fig. 15.3d where step E1(B)(a) will pick up the maximum at the right of point = 1 j , since G 1 > 0, but miss the maximum at = 0. A similar situation can arise as illustrated in Fig. 15.3h . Step E1(D) checks for a new maximum at right-hand edge R j for the case where there is no extremal and a maximum has not been picked up already at this frequency by step E1(B)(c). Such a situation can arise as shown in Fig. 15.3e where step E1(B)(c) will pick up the maximum at the left of point = J J , since G 1< 0, but miss the maximum at = . A similar situation can arise as illustrated in Fig. 15.3i . Steps E1(E)(a) to E1(E)(c) check for any missed max ima, like the maxima between 1 j and 2 j in Fig. 15.3 j , in cases where the interval between any two adjacent maxima, between the left-hand edge and the rst maximum, or between the last maximum and the right-hand edge is signicantly larger than the average interval between adjacent extremals. When the ripple of the error function is seriously skewed (e.g., near band edges in the rst or second iteration) routine CUBIC may yield a poor estimate of the maximum point, and on rare occasions the third-order polynomial may not have a maximum. If either of these cases is detected, CUBIC is aborted and SELECTIVE is called in its place. CUBIC will almost always yield a value of between two adjacent sample points. In order to ensure that each potential extremal is a member of the set of sample points, is rounded to the nearest sample point in step C6. This makes the estimate produced by CUBIC compatible with that produced by SELECTIVE and prevents numerical ill-conditioning in the evaluation of E (), G 1 , and G 2 . The CUBIC interpolation routine may be disabled by modifying step E1(B)(b). Extensive experimentation by the author has shown the above algorithm to be quite robust. It never failed in the design of 81 2-band lters chosen at random, it failed twice in the design of 67 3-band lters, three times in the design of 50 4-band lters, and three times in the design of 33 5-band lters. Lack of convergence is usually brought about by a cyclic pattern of rejected potential extremals, but the problem can be easily overcome by changing one of the specied lter parameters slightly, e.g., a passband or stopband edge or the order of the lter. 15.6 GRADIENT INFORMATION Routines SELECTIVE and CUBIC in the above algorithm rely heavily on the rst and second derivatives of | E ()| with respect to . From Eq. (15.3), we have d D () d Pc () d | E ()| = sgn [ D () Pc ()] d d d and d 2 D () d 2 Pc () d 2 | E ()| = sgn [ D () Pc ()] 2 d d 2 d 2 where sgn (x ) = 1 1 for x 0 for x < 0. (15.45) (15.44) DESIGN OF NONRECURSIVE FILTERS USING OPTIMIZATION METHODS 695 The rst and second derivatives of | E ()| under different circumstances can be obtained from the following properties of | Pc ()| [10]. 15.6.1 Property 1 For any frequency including extremal J J (last extremal of last band) but excluding all other extremals, d ()n 1 () d1 ()n () d Pc () = d d 2 () where n () = {k , m }Kr 1 (15.46) km Ckm x xkm km x xkm km Ckm (x xkm )2 km (x xkm )2 d () = {k , m }Kr 1 n 1 () = sin {k , m }Kr 1 d1 () = sin {k , m }Kr 1 and Kr 1 is given by Eq. (15.41). 15.6.2 Property 2 For all extremal frequencies except J J , d Pc () d where Kr 1 = {{k , m } : (1 k l ) and (1 m J ) and (k = i or m = j )} with l= J 1 m for m = J otherwise ij =i j = sin (i j ) i j {k , m }Kr 1 ij km (Ci j Ckm ) xi j xkm (15.47) 15.6.3 Property 3 d Pc () =0 d For = 0 or , it follows from properties 1 and 2 that (15.48) 696 DIGITAL SIGNAL PROCESSING 15.6.4 Property 4 For = 0 if no extremal occurs at zero or for = under all circumstances, d 2 Pc () d ()n 2 () d2 ()n () = d 2 d 2 () where n 2 () = cos {k , m }Kr 1 (15.49) km Ckm (x xkm )2 km (x xkm )2 d2 () = cos {k , m }Kr 1 15.6.5 Property 5 If there is an extremal at = 0, then d 2 Pc () d 2 ij =0 = 1 11 11 {k , m }Kr 1 km (C11 Ckm ) x xkm (15.50) 11 where Kr 1 = Kr 1 with i = j = 1. Example 15.1 Design a nonrecursive equiripple highpass lter using the Remez algorithm (a) with the exhaustive search of Sec. 15.3.2, (b) with the selective step-by-step search of Sec. 15.4.1, and (c) with the selective step-by-step search in conjunction with the cubicinterpolation search of Sec. 15.4.2. Compare the results obtained. The required specications are as follows: Filter length N : 21 Passband edge p : 2.0 rad/s Stopband edge a : 1.0 rad/s Ratio p /a : 18.0 Sampling frequency s : 2 rad/s Solution The design in (a) was carried out using Algorithm 1 in conjunction with Algorithms 2 and 3, whereas the designs in (b) and (c) were carried out using Algorithm 4, rst without and then with routine CUBIC, respectively. The progress of the design is illustrated in Table 15.1. As can be seen, the exhaustive and selective search methods required four iterations each, whereas the selective search in conjunction with cubic interpolation required ve iterations. However, the number of function evaluations (evaluations of Pc () using DESIGN OF NONRECURSIVE FILTERS USING OPTIMIZATION METHODS 697 Table 15.1 Progress in design of highpass lter (Example 15.1) Iter. No. Exhaustive search Q 1 2 3 4 5 Total FEs 0.9379 0.5792 0.0846 0.0000 FEs 154 154 154 154 616 Selective search Q 0.9379 0.5792 0.0846 0.0000 FEs 70 48 29 20 167 Sel. with cub. interpolation Q 0.9379 0.6519 0.0756 0.0309 0.0000 FEs 49 28 28 22 20 147 Eq. (15.35) plus evaluations of G 1 and G 2 using Eqs. (15.44) and (15.45), respectively) decreased from 616 in the rst method to 167 in the second and to 147 in the third. In the Remez algorithm, approximately 80 to 90 percent of the computational effort involves function evaluations. In effect, relative to that required by the exhaustive search, the use of the selective step-by-step search reduced the amount of computation by about 73 percent, and the use of the selective step-by-step search in conjunction with the cubic-interpolation search reduced the amount of computation by about 76 percent. The three methods resulted in approximately the same impulse responses, as can be seen in Table 15.2, and the passband ripple and minimum stopband attenuation obtained in each case were 0.073 dB and 72.6 dB, respectively. The amplitude response of the lter is illustrated in Fig. 15.5. Table 15.2 Impulse response of highpass lter (Example 15.1) n h0 (n) = h0 (n) Exhaustive or selective search 0 1 2 3 4 5 6 7 8 9 10 4.976192 E 3.120628 E 2.462999 E 8.853907 E 2.605336 E 3.790087 E 2.553469 E 1.553835 E 2.126568 E 5.222708 E 1.898114 E 1 1 3 2 3 2 3 2 3 3 3 Selective with cubic interpolation 4.976160 E 3.120636 E 2.466692 E 8.854032 E 2.609410 E 3.790082 E 2.555600 E 1.553849 E 2.127674 E 5.222820 E 1.898558 E 1 1 3 2 3 2 3 2 3 3 3 698 DIGITAL SIGNAL PROCESSING 20.0 10.0 Gain, dB 40.0 70.0 100.0 0 0.785 1.571 , rad/s 2.356 3.142 Figure 15.5 Amplitude response of equiripple highpass lter (Example 15.1) (the passband gain is multiplied by the factor 200 to show the passband ripple). Example 15.2 Design a nonrecursive equiripple bandpass lter using the Remez algorithm (a) with the exhaustive search, (b) with the selective step-by-step search, and (c) with the selective step-by-step search in conjunction with the cubic-interpolation search. Compare the results obtained. The required specications are as follows: Filter length N : 33 Lower passband edge p1 : 1.00 rad/s Upper passband edge p2 : 2.00 rad/s Lower stopband edge a 1 : 0.63 rad/s Upper stopband edge a 2 : 2.40 rad/s Ratio p /a : 23.0 Sampling frequency s : 2 rad/s Solution As in Example 15.1, the design in (a) was carried out using Algorithm 1 in conjunction with Algorithms 2 and 3, whereas the designs in (b) and (c) were carried out using Algorithm 4 rst without and then with routine CUBIC. The progress of the design is illustrated in Table 15.3. In this example, each of the three methods required eight iterations, and in each case there was a superuous maximum at the end of the fourth iteration. The problem was eliminated by rejecting the second maximum of the third band, using the rejection method detailed in Sec. 15.3.4 (see Algorithm 3). As can DESIGN OF NONRECURSIVE FILTERS USING OPTIMIZATION METHODS 699 Table 15.3 Progress in design of bandpass lter (Example 15.2) Iter. No. Exhaustive search Q 1 2 3 4 5 6 7 8 Total FEs 0.8970 0.6109 0.4556 0.2975 0.6329 0.4035 0.1268 0.0063 FEs 231 231 231 231 231 231 231 231 1848 Q 0.8970 0.6109 0.4556 0.2975 23 rejected 0.6329 0.4035 0.1268 0.0063 Selective search FEs 99 63 54 40 45 44 40 32 417 Selective with cubic interpolation Q 0.8906 0.6098 0.3940 0.2924 0.6342 0.4019 0.1293 0.0078 FEs 42 42 59 41 45 44 40 32 345 be seen in Table 15.3, the number of function evaluations decreased from 1848 in the rst method to 417 in the second method to 345 in the third method. In effect, the use of the selective step-by-step search reduced the amount of computation by about 77 percent, and the use of the selective step-by-step search in conjunction with the cubicinterpolation search reduced the amount of computation by about 81 percent, relative to that required by the exhaustive search. The three methods resulted in approximately the same impulse responses, as can be seen in Table 15.4. The amplitude response of the lter is illustrated in Fig. 15.6; 20.0 5.0 Gain, dB 30.0 55.0 80.0 0 0.785 1.571 , rad/s 2.356 3.142 Figure 15.6 Amplitude response of equiripple bandpass lter (Example 15.2) (the passband gain is multiplied by the factor 20 to show the passband ripple). 700 DIGITAL SIGNAL PROCESSING the passband ripple and minimum stopband attenuation obtained in each case were 0.934 dB and 52.6 dB, respectively. Table 15.4 Impulse response of bandpass lter (Example 15.2) n h0 (n) = h0 (n) Exhaustive or selective search 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4.095939 E 1 2.529508 E 2 2.978313 E 1 3.828648 E 2 7.734350 E 2 1.885007 E 3 5.491991 E 2 3.246312 E 2 4.740273 E 2 1.517104 E 2 4.296619 E 3 1.645571 E 2 2.126770 E 2 2.137354 E 2 8.758516 E 3 8.493829 E 3 3.891420 E 5 Selective with cubic interpolation 4.095922 E 1 2.529615 E 2 2.978309 E 1 3.828785 E 2 7.734476 E 2 1.885265 E 3 5.491921 E 2 3.246380 E 2 4.740238 E 2 1.517257 E 2 4.294720 E 3 1.645695 E 2 2.126769 E 2 2.137482 E 2 8.760408 E 3 8.492478 E 3 3.931393 E 5 15.7 PRESCRIBED SPECIFICATIONS Given a lter length N, a set of passband and stopband edges, and a ratio p /a , a nonrecursive lter with approximately piecewise-constant amplitude-response specications can be readily designed. While the lter obtained will have passband and stopband edges at the correct locations and the ratio p /a will be as required, the amplitudes of the passband and stopband ripples are highly unlikely to be precisely as specied. An acceptable design can be obtained by predicting the value of N on DESIGN OF NONRECURSIVE FILTERS USING OPTIMIZATION METHODS 701 the basis of the required specications and then designing lters for increasing or decreasing values of N until the lowest value of N that satises the specications is found. A reasonably accurate empirical formula for the prediction of N for the case of lowpass and highpass lters, due to Herrmann, Rabiner, and Chan [15], is N = Int where B = |a p |/2 D = [0.005309(log p )2 + 0.07114 log p 0.4761] log a [0.00266(log p )2 + 0.5941 log p + 0.4278] F = 0.51244(log p log a ) + 11.012 This formula can also be used to predict the lter length in the design of bandpass, bandstop, and multiband lters in general. In these lters, a value of N is computed for each transition band between a passband and stopband or a stopband and passband using Eq. (15.51) and the largest value of N so obtained is taken to be the predicted lter length. Prescribed specications can be achieved by using the following design algorithm: Algorithm 5: Design of lters satisfying prescribed specications 1. Compute N using Eq. (15.51); if N is even, set N = N + 1. 2. Design a lter of length N using Algorithm 4 and determine the minimum value of , say . ( A) If > p , then do: (a) Set N = N + 2, design a lter of length N using Algorithm 4, and nd ; (b) If p , then go to step 3; else, go to step 2( A)(a ). ( B ) If < p , then do: (a) Set N = N 2, design a lter of length N using Algorithm 4, and nd ; (b) If > p , then go to step 4; else, go to step 2( B )(a ). 3. Use the last set of extremals and the corresponding value of N to obtain the impulse response of the required lter and stop. 4. Use the last but one set of extremals and the corresponding value of N to obtain the impulse response of the required lter and stop. u Example 15.3 ( D F B2) + 1.5 B (15.51) In an application, a nonrecursive equiripple bandstop lter is required, which should satisfy the following specications: Odd lter length Maximum passband ripple A p : 0.5 dB Minimum stopband attenuation Aa : 50.0 dB 702 DIGITAL SIGNAL PROCESSING Lower passband edge p1 : 0.8 rad/s Upper passband edge p2 : 2.2 rad/s Lower stopband edge a 1 : 1.2 rad/s Upper stopband edge a 2 : 1.8 rad/s Sampling frequency s : 2 rad/s Design the lowest-order lter that will satisfy the specications. Solution The use of Algorithm 4 in conjunction with Algorithm 5 gave a lter of length 35. The progress of the design is illustrated in Table 15.5. The impulse response of the lter obtained is given in Table 15.6. The corresponding amplitude response is depicted in Fig. 15.7; the passband ripple and minimum stopband attenuation achieved are 0.4342 and 51.23 dB, respectively, and are within the specied limits. Table 15.5 Progress in design of bandstop lter (Example 15.3) N 31 33 35 Iters. 10 7 9 FEs 582 376 545 A p , dB 0.5055 0.5037 0.4342 Aa , dB 49.91 49.94 51.23 Table 15.6 Impulse response of bandstop lter (Example 15.3) n 0 1 2 3 4 5 6 7 8 h0 (n) = h0 (n) 6.606345 E 2.307038 E 2.711461 E 4.306831 E 1.198723 E 1.829974 E 4.974998 E 2.016415 E 4.593774 E 1 2 1 2 1 2 3 2 2 n 9 10 11 12 13 14 15 16 17 h0 (n) = h0 (n) 2.806340 E 2.276572 E 9.924812 E 1.047638 E 1.412229 E 1.284774 E 1.096745 E 8.260758 E 3.482212 E 2 2 3 3 2 2 2 4 3 DESIGN OF NONRECURSIVE FILTERS USING OPTIMIZATION METHODS 703 20.0 5.0 Gain, dB 30.0 55.0 80.0 0 0.785 1.571 , rad/s 2.356 3.142 Figure 15.7 Amplitude response of equiripple bandstop lter (Example 15.3) (the passband gain is multiplied by the factor 40 to show the passband ripple). 15.8 GENERALIZATION As was demonstrated in Chap. 9, there are four types of constant-delay nonrecursive lters. The impulse response can be symmetrical or antisymmetrical, and the lter length can be odd or even. In the preceding sections, we considered the design of lters with symmetrical impulse response and odd length. In this section, we show that the Remez algorithm can also be applied for the design of the three other types of lters. 15.8.1 Antisymmetrical Impulse Response and Odd Filter Length Assuming that s = 2 , the frequency response of a nonrecursive lter with antisymmetrical impulse response and odd length can be expressed as H (e j T ) = e jc j Pc () where Pc () = k =1 c ak sin k for k = 1, 2, . . . , c (15.52) ak = 2h (c k ) c = ( N 1)/2 (see Table 9.1). 704 DIGITAL SIGNAL PROCESSING A lter with a desired frequency response e jc j D () can be designed by constructing the error function E () = W ()[ D () Pc ()] (15.53) and then minimizing | E ()| with respect to some compact subset of the frequency interval [0, ]. From Eq. (15.52), Pc () can be expressed as [6] Pc () = sin Pc1 () where c 1 (15.54) Pc1 () = k =0 ck cos k (15.55a) and a1 = c 0 1 c 2 2 ak = 1 (ck 1 ck +1 ) 2 a c 1 = 1 c 2 c 2 (15.55b) for k = 2, 3, . . . , c 2 (15.55c) (15.55d) (15.55e) a c = 1 c c 1 2 Hence Eq. (15.53) can be put in the form E () = W ()[ D () P ()] where W () = Q ()W () D () = D ()/ Q () P () = Pc1 () Q () = sin (15.56) Evidently, Eq. (15.56) is of the same form as Eq. (15.3), and on proceeding as in Sec. 15.2 one can obtain the system of equations 1 1 cos 0 cos 20 cos (c 1)0 W (0 ) a0 D (0 ) 1 a1 1 cos cos 2 cos (c 1) 1 1 1 . D (1 ) W (1 ) . = . . . . . . . . . . . . . . a . . . . c1 . D (r ) (1)r 1 cos r cos 2r cos (c 1)r W (r ) DESIGN OF NONRECURSIVE FILTERS USING OPTIMIZATION METHODS 705 where r = c is the number of cosine functions in Pc1 (). This system of equations is the same as that in Eq. (15.12) except that the number of extremals has been reduced from c + 2 to c + 1; therefore, the application of the Remez algorithm follows the methodology detailed in Secs. 15.2 and 15.3. The use of Algorithm 1 or 4 yields the optimum Pc1 () and from Eq. (15.54), the cosine function Pc () can be formed. Now j Pc () is the frequency response of a noncausal version of the required lter. The impulse response of this lter can be obtained as 1 N c h 0 (n ) = h 0 (n ) = 2 Pc (k ) sin k =1 2 kn N (15.57) for n = 0, 1, 2, . . . , c, where = 2/ N , by using the inverse discrete Fourier transform. The impulse response of the corresponding causal lter is given by h (n ) = h 0 (n c) for n = 0, 1, 2, . . . , N 1. 15.8.2 Even Filter Length H (e j T ) = e jc Pd () The frequency response of a lter with symmetrical impulse response and even length is given by where d Pd () = k =1 bk cos k 1 2 bk = 2h (d k ) d = N /2 (see Table 9.1). Pd () can be expressed as Pd () = cos where for k = 1, 2, . . . , d Pd 1 () 2 d 1 Pd 1 () = k =0 bk cos k (15.58a) and b1 = b0 + 1 b1 2 1 (bk 1 + bk ) 2 bd = 1 bd 1 2 bk = for k = 2, 3, . . . , d 1 (15.58b) (15.58c) (15.58d) 706 DIGITAL SIGNAL PROCESSING Proceeding as in the case of antisymmetrical impulse response, an error function of the form given in Eq. (15.56) can be constructed with P () = Pd 1 () and Q () = cos 2 Similarly, if the impulse response is antisymmetrical and the lter length is even, we have H (e j T ) = e jc j Pd () where d Pd () = k =1 bk sin k 1 2 bk = 2h (d k ) d = N /2 Pd () can now be expressed as Pd () = sin where for k = 1, 2, . . . , d Pd 1 () 2 d 1 Pd 1 () = k =0 d k cos k (15.59a) and b1 = d 0 1 d 1 2 bk = 1 (d 2 k 1 (15.59b) for k = 2, 3, . . . , d 1 (15.59c) (15.59d) dk) bd = 1 d d 1 2 As in the previous case, an error function of the form given in Eq. (15.56) can be obtained with P () = Pd 1 () and Q () = sin 2 The various polynomials for the four types of nonrecursive lters are summarized in Table 15.7. DESIGN OF NONRECURSIVE FILTERS USING OPTIMIZATION METHODS 707 Table 15.7 Functions H (e j T ), Q ( ), and P ( ) for the various types of nonrecursive lters h(n ) Symmetrical N odd H (e j T ) e jc Pc () e jc Pd () Pd () = d=1 bk cos k k Q ( ) 1 2 P ( ) Pc () = Pd 1 () = Pc1 () = c k =0 ak cos k cos k cos k even cos 1 2 d 1 k =0 bk Antisymmetrical odd e jc j Pc () Pc () = c =1 ak sin k k e jc j Pd () Pd () = d k =1 sin c 1 k = 0 ck even sin 1 2 bk sin k 2 Pd 1 () = d 1 k =0 d k cos k a0 = h (c) ak = 2h (c k ) b k = 2 h (d k ) d = N /2 c = ( N 1)/2 15.9 DIGITAL DIFFERENTIATORS The Remez algorithm can be easily applied for the design of equiripple digital differentiators. The ideal frequency response of a causal differentiator is of the form e jc j D () where D () = for 0 < || < (15.60) and c = ( N 1)/2 (see Sec. 9.5). From Table 15.7, we note that differentiators can be designed in terms of lters with antisymmetrical impulse response of either odd or even length. 15.9.1 Problem Formulation Assuming odd lter length, Eqs. (15.53) and (15.60) give the error function E () = W ()[ Pc ()] for 0 < p where p is the required bandwidth. Constant absolute or relative error may be required, depending on the application at hand. Hence W () can be chosen to be either unity or 1/. In the latter case, E () can be expressed as E () = 1 and from Eq. (15.54) E () = 1 sin Pc1 () for 0 < p (15.61) 1 P () c for 0 < p 708 DIGITAL SIGNAL PROCESSING Therefore, the error function can be expressed as in Eq. (15.56) with W () = sin 1 = () D P () = Pc1 () 15.9.2 First Derivative In Algorithm 4, the rst derivative of | E ()| with respect to is required. From Eq. (15.61), one can show that sin cos sin d | E ()| = sgn 1 Pc1 () Pc1 () d 2 sin d Pc1 () d (15.62) The rst derivative of Pc1 () can be computed by using the formulas in Sec. 15.6, except that the number of extremals is reduced from c + 2 to c + 1. The value of Pc1 () can be computed by using Eq. (15.35) with c replaced by c 1. If i is an extremal, then Eq. (15.61) yields Pc1 (i ) = [1 (1)i ] i sin i since E (i ) = (1)i . In Algorithm 4, the second derivative of | E ()| with respect to is used to determine whether there is a maximum or minimum at = 0. For differentiators, this information is more easily determined by computing the quantity G 2 = | E (w1 )| | E (0)| where w1 is the interval between successive samples. Depending on whether G 2 is positive or negative, | E ()| has a minimum or maximum at = 0. 15.9.3 Prescribed Specications | E ()| p for 0 < p A digital differentiator is fully specied by the constraint where p is the maximum passband error and p is the bandwidth of the differentiator. The differentiator length N that will just satisfy the required specications is not normally known a priori and, although it may be determined on a hit and miss basis, a large number of designs may need to be carried out. In lters with approximately piecewise-constant amplitude responses, N can be predicted using the empirical formula of Eq. (15.51). In the case of differentiators, N can be predicted by noting a useful property of digital differentiators. If and 1 are the maximum passband errors in differentiators of lengths N and N1 , respectively, then the quantity ln (/1 ) is DESIGN OF NONRECURSIVE FILTERS USING OPTIMIZATION METHODS 709 approximately linear with respect to N N1 for a wide range of values of N1 and p , as illustrated in Fig. 15.8. Assuming linearity, we can show that [16] N = N1 + ln (/1 ) ( N2 N1 ) ln (2 /1 ) (15.63) where 2 is the maximum passband error in a differentiator of length N2 . N N1 0 0 40 80 p = 3.05 rad/s 4.0 3.00 2.90 ln (/1) 8.0 2.75 2.40 12.0 16.0 Figure 15.8 Variation of ln (/1 ) versus N N1 for different values of p and N1 = 11. 710 DIGITAL SIGNAL PROCESSING By designing two low-order differentiators, a fairly accurate prediction of the required value of N can be obtained by using Eq. (15.63). A design algorithm based on this formula is as follows: Algorithm 6: Design of digital differentiators satisfying prescribed specications 1. 2. 3. 4. Design a differentiator of length N1 , and nd 1 . Design a differentiator of length N2 = N1 + 2 and nd 2 . If 2 p < 1 , go to step 7. Set = p and compute N using Eq. (15.63); set N3 = Int ( N + 0.5); if N3 is even and a differentiator of odd length is required, then set N3 = N3 + 1. 5. Design a differentiator of length N3 and nd 3 . ( A) If 3 > p , then do: (a) Set N3 = N3 + 2, design a differentiator of length N3 , and nd 3 ; (b) If 3 p , then go to step 6; else, go to step 5( A)(a ). ( B ) If 3 < p , then do: (a) Set N3 = N3 2, design a differentiator of length N3 , and nd 3 ; (a) If 3 > p , then go to step 7; else, go to step 5( B )(a ). 6. Use the last set of extremals and the corresponding value of N to obtain the impulse response of the required differentiator and stop. 7. Use the last but one set of extremals and the corresponding value of N to obtain the impulse response of the required differentiator and stop. u In an application, a digital differentiator is required which should satisfy the following specications: Odd differentiator length Bandwidth p : 2.5 rad/s Maximum passband ripple p : 1.0 106 Sampling frequency s : 2 rad/s Design the lowest-order differentiator that will satisfy the specications. Example 15.4 Solution The design was carried out using Algorithm 6 in conjunction with Algorithm 4; in Algorithm 4 the relative error of Eq. (15.61) was minimized. The progress of the design is illustrated in Table 15.8. First, differentiators of lengths 21 and 23 were designed and the Table 15.8 Progress in design of digital (differentiator Example 15.4) N 21 23 43 41 39 Iters. 4 5 5 6 6 FEs 141 187 616 538 500 p 7.649 E 3.786 E 4.078 E 8.069 E 1.582 E 4 4 7 7 6 DESIGN OF NONRECURSIVE FILTERS USING OPTIMIZATION METHODS 711 required N to satisfy the specications was predicted to be 43 using Eq. (15.63). This differentiator length was found to oversatisfy the specications, and designs for lengths 41 and 39 were then carried out. The design for N = 39 violates the specications, as can be seen in Table 15.8; therefore, the optimum differentiator length is 41. The impulse response of this differentiator is given in Table 15.9. The amplitude response and passband relative error of the differentiator are plotted in Fig. 15.9a and b. 3.00 2.25 Gain 1.50 0.75 0 0 0.785 1.571 , rad/s (a) 2.356 3.142 1.500 106 1.125 |E ()| 0.750 0.375 0 0 0.625 1.250 , rad/s (b) 1.875 2.500 Figure 15.9 Design of digital differentiator (Example 15.4): (a) Amplitude response, (b) passband relative error. 712 DIGITAL SIGNAL PROCESSING Table 15.9 Impulse response of digital differentiator (Example 15.4) n 0 1 2 3 4 5 6 7 8 9 10 h0 (n) = h0 (n) 0.0 9.852395 E 4.710789 E 2.914014 E 1.966634 E 1.371947 E 9.651420 E 6.751749 E 4.653727 E 3.138375 E 2.058332 E 1 1 1 1 1 2 2 2 2 2 n 11 12 13 14 15 16 17 18 19 20 h0 (n) = h0 (n) 1.305326 E 7.955151 E 4.626299 E 2.544983 E 1.309224 E 6.197315 E 2.633737 E 9.638584 E 2.795288 E 4.916591 E 2 3 3 3 3 4 4 5 5 6 15.10 ARBITRARY AMPLITUDE RESPONSES Very frequently nonrecursive lters are required whose amplitude responses cannot be described by analytical functions. For example, in the design of two-dimensional lters (see Sec. 18.6) through the singular-value decomposition [17, 18], the required two-dimensional lter is obtained by designing a set of one-dimensional digital lters whose amplitude responses turn out to have arbitrary shapes. In these applications, the desired amplitude response D () is specied in terms of a table that lists a prescribed set of frequencies and the corresponding values of the required lter gain. Filters of this class can be readily designed by employing some interpolation scheme that can be used to evaluate D () and its rst derivative with respect to at any . A suitable scheme is to t a set of third-order polynomials to the prescribed amplitude response. An interpolation scheme of this type is used in the design of recursive lters in the next chapter and is described in detail in Sec. 16.6. 15.11 MULTIBAND FILTERS The algorithms presented in the previous sections can also be used to design multiband lters. While there is no theoretical upper limit on the number of bands, in practice, the design tends to become more and more difcult as the number of bands is increased. The reason is that the difference between the number of possible maxima in the error function and the number of extremals increases linearly with the number of bands, e.g., if the number of bands is 8, then the difference is 14 (see Sec. 15.3.4). As a consequence, the number of potential extremals that need to be rejected is large and the available DESIGN OF NONRECURSIVE FILTERS USING OPTIMIZATION METHODS 713 rejection techniques become somewhat inefcient. The end result is that the number of iterations is increased quite signicantly, and convergence is slow and sometimes impossible. In mathematical terms, the problem discussed in the previous paragraph is attributed to the fact that, in the weighted-Chebyshev methods considered in this chapter, the approximating polynomial becomes seriously underdetermined if the number of bands exceeds three. The problem can be overcome by using the generalized Remez method described in Ref. [14]. This method is based on a different formulation of the design problem and leads to three types of equiripple lters, namely, maximal-ripple, extra-ripple, and weighted-Chebyshev lters. In the case of maximal-ripple lters, the approximating polynomial is fully determined; in the extra-ripple case, it is less underdetermined than the approximating polynomial in the methods described. Therefore, for lters with more than ve bands, the method in Ref. [14] is preferred. Example 15.5 In an application, a nonrecursive equiripple 5-band lter is required which should satisfy the specications in Table 15.10. The sampling frequency is 2 . Design the lowest-order lter that will satisfy the specications. Table 15.10 Specications of 5-band lter (Example 15.5) Band: D () A p , dB Aa , dB L , rad/s R , rad/s 1 1.00 0.50 0.00 0.60 2 0.00 50.00 0.80 1.25 3 1.00 0.75 1.50 1.90 4 0.00 30.00 2.10 2.60 5 1.00 1.00 2.80 Solution The use of Algorithm 4 in conjunction with Algorithm 5 gave a lter of length 61. The progress of the design is illustrated in Table 15.11. The impulse response of the lter obtained is given in Table 15.12, and the corresponding amplitude response is plotted in Fig. 15.10. As can be seen, the required specications are satised. Table 15.11 Progress in design of 5-band lter (Example 15.5) N 61 59 Iters. 9 19 FEs 913 2219 A p1 , dB 0.453 0.539 Aa 2 , dB 50.46 49.35 A p3 , dB 0.679 0.808 Aa 4 , dB 30.86 29.35 A p5 , dB 0.905 1.077 714 DIGITAL SIGNAL PROCESSING Table 15.12 Impulse response of 5-band lter (Example 15.5) n 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 h0 (n) = h0 (n) 5.608208 E 4.013174 E 1.006767 E 4.198731 E 2.414087 E 1.248415 E 1.019101 E 6.608448 E 1.355327 E 4.780217 E 1.549769 E 3.468520 E 8.299265 E 4.694733 E 2.641761 E 5.336269 E 1 2 1 2 1 1 1 3 2 3 2 2 4 2 3 2 n 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 h0 (n) = h0 (n) 8.164458 E 3.884179 E 2.625242 E 1.130791 E 9.190432 E 8.761118 E 6.476604 E 9.610168 E 1.976094 E 1.075689 E 3.013727 E 2.707701 E 2.549441 E 9.605488 E 1.495353 E 4 4 3 2 3 3 3 3 2 2 3 3 3 3 2 10.0 10.0 Gain, dB 30.0 50.0 70.0 0 0.785 1.571 , rad/s 2.356 3.142 Figure 15.10 Amplitude response of equiripple 5-band lter (Example 15.5) (the passband gain is multiplied by the factor 10 to show the passband ripple). DESIGN OF NONRECURSIVE FILTERS USING OPTIMIZATION METHODS 715 The required lter order for multiband lters can be predicted by using the formula in Eq. (15.51), as was stated earlier. A generalized version of this formula, which gives improved results, can be found in Ref. [14]. REFERENCES [1] [2] O. Herrmann, Design of nonrecursive digital lters with linear phase, Electron. Lett., vol. 6, pp. 182184, May 1970. E. Hofstetter, A. Oppenheim, and J. Siegel, A new technique for the design of non-recursive digital lters, 5th Annual Princeton Conf. Information Sciences and Systems, pp. 6472, Mar. 1971. T. W. Parks and J. H. McClellan, Chebyshev approximation for nonrecursive digital lters with linear phase, IEEE Trans. Circuit Theory, vol. 19, pp. 189194, Mar. 1972. T. W. Parks and J. H. McClellan, A program for the design of linear phase nite impulse response digital lters, IEEE Trans. Audio Electroacoust., vol. 20, pp. 195199, Aug. 1972. L. R. Rabiner and O. Herrmann, On the design of optimum FIR low-pass lters with even impulse response duration, IEEE Trans. Audio Electroacoust., vol. 21, pp. 329336, Aug. 1973. J. H. McClellan and T. W. Parks, A unied approach to the design of optimum FIR linear-phase digital lters, IEEE Trans. Circuit Theory, vol. 20, pp. 697701, Nov. 1973. J. H. McClellan, T. W. Parks, and L. R. Rabiner, A computer program for designing optimum FIR linear ph