**preview**has

**blurred**sections. Sign up to view the full version! View Full Document

**Unformatted text preview: **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 ) = eαt sin(ωt ) through the sampling process would naturally be x (nT ) = eαnT sin(ωnT ) If we were to drop the T in x (nT ), that is, x (n ) = eαnT 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 = eαn 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 jkω0 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 2ω0 t 1 π 2 sin 4ω0 t 1 π + · · · 2
4 + 35π sin 3ω0 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 , 2ω0 , 3ω0 , 4ω0 , . . . , 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π 2τ0
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 2ω0 t )
2
1 2 cos 2ω0 t + cos2 2ω0 t 1 2 cos 2ω0 t +
1 2
1 + cos 4ω0 t
13 42 3 8
2 cos 2ω0 t + 1 cos 4ω0 t 2
1 cos 2ω0 t + 1 cos 4ω0 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 2τ0 , then doubled again to 4τ0 , 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 , 2τ0 , and 4τ0 .
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 )eαt
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 )eαt e j ωt dt =
0 0
e(α+ j ω)t dt
e(α+ j ω)t = α + jω For α > 0, we note that
t
lim eαt 0
and as a result
t
lim e(α j ω)t = lim eαt · e j ωt 0
t
Thus X ( j ω) = or u (t )eαt 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 )eαt sin ω0 t
(see Fig. 2.11a ) where α and ω0 are positive constants.
Solution
We can write x (t ) = u (t )eαt sin ω0 t = = u (t ) j ω0 t e e j ω0 t eαt 2j (2.53a)
u (t ) (α j ω0 )t e e(α+ j ω0 )t 2j
From Example 2.6, we have u (t )eαt 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 )eαt 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 eαt 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 )eαt u (t )eαt 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 < 3τ0 /8 0 1 for 3τ0 /8 t < τ0 /4 for τ0 /4 t < τ0 /4 x (t ) = 2 1 for τ0 /4 t < 3τ0 /8 0 for 3τ0 /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 eω0 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 ) = eαt 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 )eαnT , ( 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 )eαnT ] = 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 )eαnT 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 )eαnT
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
|zeαT|
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 )eαnT 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 )eαnT r (nT ) r (nT )eαnT u (nT ) sin ωnT u (nT ) cos ωnT u (nT )eαnT sin ωnT u (nT )eαnT 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 )eαnT 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 3ωs /2 to 3ωs /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 + eαnT ) (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 )eαkT 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 )eαnT sin(ωnT + ψ ) (b) x (nT ) = r (nT ) sin(ωnT + ψ ) (c) x (nT ) = r (nT )eαnT 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 5ωs /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 3ωs /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, 7ωs /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 9ωs /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)
3ωs /4
(c)
0.9ωs
(d )
ωs
(e)
1.1ωs
(f)
Figure 5.9
Aliasing at the movies.
and at a speed of 5ωs /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
α
eαt 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 )eαt u (t )eαt 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 2ω0 t + 1)(cos 2ω0 t + 1) 4 = 1 (cos2 2ω0 t + 2 cos 2ω0 t + 1) 4 = = Now from Table 6.2, we get X ( j ω) = π
1 [δ (ω 8 1 4 1 8 1 2
(cos 4ω0 t + 1) + 2 cos 2ω0 t + 1
3 8
cos 4ω0 t + 1 cos 2ω0 t + 2
+ 4ω0 ) + δ (ω 4ω0 )] + 1 [δ (ω + 2ω0 ) + δ (ω 2ω0 )] + 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 2τ0
τ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 2τ0 (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=
δ (ω nωs )
(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 ( jnωs ) 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
3ωs
2ωs
ω
ωs
0
ωs
2ωs
3ωs
4.0
arg x( jω), rad/s
2.0
0
2.0
4.0
ω
2ωs
3ωs
ωs
0 (b)
ωs
2ωs
3ωs
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ω)|
^
2ωs
ωs
ω0 (a)
ω0
ωs
2ωs
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ω+ jωs)| 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 {· · · , 2ωs , ωs , ωs , 2ωs , · · · } 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 pωs (ω) 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ω + jωs) T 20 10 1 T X( jω) 0 (b) 1 X( jω jωs) 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 jωT
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 |ω| < 6ω0 otherwise
and the digital lter has a baseband response H D (e j ω T ) = T 0 for 0.95ω0 < |ω| < 1.05ω0 otherwise
Assuming that ωs = 12ω0 , 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 6ω0 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 2ω0 t cos 4ω0 t π 2 3π 15π
X 2 ( j ω) = F x2 (t ) = 2δ (ω) + j 2 π [δ (ω + ω0 ) δ (ω ω0 )] [δ (ω + 2ω0 ) 2 3 2 [δ (ω + 4ω0 ) + δ (ω 4ω0 )] 15
+δ (ω 2ω0 )]
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 2ω0 nT cos 4ω0 nT π 2 3π 15π
=
n =
δ (t nT )
Thus x4 (nT ) = 1 1 2 2 + sin ω0 nT cos 2ω0 nT cos 4ω0 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 + 2ω0 ) + δ (ω + n ωs 2ω0 )] 3 2 [δ (ω + n ωs + 4ω0 ) + δ (ω + n ωs 4ω0 )] 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 6ω0 1 12ω0 18ω0
ω
t ˆ x3(t)
A2(ω)
t x4(nT )
A3,4(ω)
DF nT x5(nT ) nT T
A5,6(ω) 6ω0 12ω0 18ω0
ˆ 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 5ω0 t cos ω0 t )2 (b) ˜ x (t ) = (cos 3ω0 t cos 2ω0 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(ejωT )|
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(ejωT )| 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(ejωT )| 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( jωj )
ω (c )
X( j )W( jωj ) 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 2ωm , 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) ωcωm W( jω-j ) (b) ω1 ω5 A( jω1) ω1 ωc ωc+ ωm
(c)
A( jω2) ω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( jω0 )
ω0
(d )
A( jω6) (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 ω) = p2ωc (ω) where p2ωc (ω) = 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
=
p2ωc ( ) 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(jωj )
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 2ωs , 4ωs , . . . . 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 eσ1 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 ) = eαn 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 eσ1 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 eσ1 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)eαn 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 2ωs / 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 jωT)
ω
π T
2π T
(d ) Hw(e jωT)
ω
ω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 2ωs N 4ωs N 4ωs N 6ωs 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
jωT
)
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 |ω| 2ωs / N , and hence the main-lobe width for the von Hann and Hamming windows is approximately 4ωs / 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 6ωs / 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
jωT
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 6ωs / 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 jωT) 1
ωs
ωs 2
ωs 2
ω ωs
3ω s 2
2ωs
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 jωT) 1
|sin(πω/ωs)|
ωs
ωs 2
ωs 2
ωs
ω
3ωs 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ω jωip1=Mp e jψp1
1
s plane
jωi jωiz1=Mz e jψz1
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 8ω2 + 8ω4
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.05×1
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.1×34 1 = 1.077958 × 105 100.1×0.1 1 1.077958 × 105 = 4.93 5 cosh1 2.0
492
DIGITAL SIGNAL PROCESSING
(b) From Eq. (10.38), we have ε= and 100.1×0.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.1×35.0 1 = 1.2209 × 104 100.1×1.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.1×35.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 =
2σ0 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ω jωp λ
s plane jωa λ
jωa j ωp
jωp jωa jωp
λ
jωa
λ
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
jωa jωp
_ j ωa1
jωp jωa
_ jωa1
_ j ωp1 _ jωp2
_ jωa2
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 jωT
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 jωp 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 2ω0 (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 )|
0ωωs
(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 )|
0ωωs
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)
0ωωs
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
0ωωs
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
0ωωs
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 )|
0ωωs
λ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 + 2β0 )γ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 2ω0 · · · cos cω0 ˆ ˆ ˆ W (ω0 ) a0 ˆ ˆ 1 a1 D (ω0 ) ˆ ˆ ˆ D (ω1 ) ˆ 1 cos ω1 cos 2ω1 · · · cos cω1 W (ω1 ) . = . ˆ . . . . . . . . . . . . . . a . . . .c . D (ωr ) ˆ (1)r δ ˆ ˆ 1 cos ωr cos 2ωr · · · cos cωr ˆ 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ω + cω2 + 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 + bωk + c(ωk )2 + d (ωk )3 ˜ ˜ ˜
= G 1 = b + 2cω1 + 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 2cω1 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