77un/ Edition DIGITAL SIGNAL PROCESSING Principles, Algorithms, m l Applications J o h n G. Proakis Dimitris G. M anolakis Digital Signal Processing Principles, Algorithms, and Applications Third E dition John G. Proakis Northeastern U niversity Dimitris G. Manolakis Boston C ollege PRENTICE-HALL INTERNATIONAL, INC. This edition may be sold only in those countries to which it is consigned by Prentice-Hall International. It is not to be reexported and it is not for sale in the U .S.A ., Mexico, or Canada. © 1996 by Prentice-Hall, Inc. Simon & Schuster/A Viacom Company U pper Saddle River, New Jersey 07458 All rights reserved. No part of this book may be reproduced, in any form or by any means, without permission in writing from the publisher. The author and publisher of this book have used their best efforts in preparing this book. These efforts include the development, research, and testing of the theories and programs to determine their effectiveness. The author and publisher make no warranty of any kind, expressed or implied, with regard to these programs or the documentation contained in this book. The author and publisher shall not be liable in any event for incidental or consequential damages in connection with, or arising out of. the furnishing, performance, or use of these programs. Printed in the United States of America 10 9 8 7 6 5 ISBN 0-13-3TM33fl-cl Prentice-Hall International (U K ) Limited. L ondon Prentice-Hall of Australia Pty. Limited, Sydney Prentice-Hall Canada, Inc., Toronto Prentice-Hall Hispanoamericana. S.A., M exico Prentice-Hall of India Private Limited, N ew D elhi Prentice-Hall of Japan, Inc., T okyo Simon & Schuster Asia Pie, Ltd., Singapore Editora Prentice-Hall do Brasil, Ltda., R io de Janeiro Prentice-Hall, Inc, Upper Saddle River, N ew Jersey Contents PREFACE xiii 1 1 INTRODUCTION 1.1 S ignals, S ystem s, and S ignal P ro cessin g 2 1.1.1 Basic Elements of a Digital Signal Processing System. 4 1.1.2 A dvantages of Digital over Analog Signal Processing, 5 1.2 C lassificatio n o f Signals 6 1.2.1 Multichannel and Multidimensional Signals. 7 1.2.2 Continuous-Time Versus Discrete-Time Signals. 8 1.2.3 Continuous-Valued Versus Discrete-Valued Signals. 10 1.2.4 Determ inistic Versus Random Signals, 11 1.3 T h e C o n c e p t o f F re q u e n c y in C o n tin u o u s -T im e an d D isc re te -T im e S ignals 14 1.3.1 Continuous-Time Sinusoidal Signals, 14 1.3.2 Discrete-Time Sinusoidal Signals. 16 1.3.3 Harmonically Related Complex Exponentials, 19 1.4 A n a lo g -to -D ig ita l an d D ig ita l-to -A n a lo g C o n v e rs io n 21 1.4.1 Sampling of Analog Signals, 23 1.4.2 The Sampling Theorem , 29 1.4.3 Q uantization of Continuous-Am plitude Signals, 33 1.4.4 Quantization of Sinusoidal Signals, 36 1.4.5 Coding of Quantized Samples, 38 1.4.6 Digital-to-Analog Conversion, 38 1.4.7 Analysis of Digital Signals and Systems Versus Discrete-Time Signals and Systems, 39 S u m m a ry a n d R e fe re n c e s Problems 39 40 iii iv 2 Contents DISCRETE-TIME SIGNALS AND SYSTEMS 2.1 D isc rete-T im e S ignals 43 2.1.1 Some Elem entary Discrete-Time Signals, 45 2.1.2 Classification of Discrete-Time Signals, 47 2.1.3 Simple Manipulations of Discrete-Time Signals, 52 2.2 D isc re te -T im e S ystem s 56 2.2.1 Input-O utput Description of Systems, 56 2.2.2 Block Diagram Representation of Discrete-Time Systems, 59 2.2.3 Classification of Discrete-Time Systems, 62 2.2.4 Interconnection of Discrete-Tim e Systems, 70 2.3 A n alysis o f D isc re te -T im e L in e a r T im e -In v a ria n t S ystem s 72 2.3.1 Techniques for the Analysis of Linear Systems, 72 2.3.2 Resolution of a Discrete-Time Signal into Impulses, 74 2.3.3 Response of LTI Systems to A rbitrary Inputs: The Convolution Sum, 75 2.3.4 Properties of Convolution and the Interconnection of LTI Systems, 82 2.3.5 Causal Linear Tim e-Invariant Systems. 86 2.3.6 Stability of Linear Tim e-Invariant Systems, 87 2.3.7 Systems with Fim te-D uration and Infinite-Duration Impulse Response. 90 2.4 D isc rete-T im e System s D e s c rib e d by D iffe re n c e E q u a tio n s 91 2.4.1 Recursive and Nonrecursive Discrete-Tim e Systems, 92 2.4.2 Linear Time-Invariant Systems Characterized by Constant-Coefficient Difference Equations, 95 2.4.3 Solution of Linear Constant-Coefficient Difference Equations. 100 2.4.4 The Impulse Response of a Linear Tim e-Invariant Recursive System, 108 2.5 Im p le m e n ta tio n o f D isc re te -T im e S ystem s 111 2.5.1 Structures for the Realization of Linear Tim e-Invariant Systems, 111 2.5.2 Recursive and Nonrecursive Realizations of FIR Systems, 116 2.6 C o rre la tio n of D isc re te -T im e S ignals 118 2.6.1 Crosscorrelation and A utocorrelation Sequences, 120 2.6.2 Properties of the A utocorrelation and Crosscorrelation Sequences, 122 2.6.3 Correlation of Periodic Sequences, 124 2.6.4 Com putation of Correlation Sequences, 130 2.6.5 Input-O utput Correlation Sequences, 131 2.7 S u m m ary a n d R e fe re n c e s Problems 135 134 43 Contents 3 THE Z-TRANSFORM AND ITS APPLICATION TO THE ANALYSIS OF LTI SYSTEMS 3.1 T h e r-T ra n sfo rm 151 3.1.1 The Direct ^-Transform. 152 3.1.2 The inverse : -Transform, 160 3.2 P ro p e rtie s o f th e ; -T ra n sfo rm 3.3 R a tio n a l c-T ran sfo rm s 172 3.3.1 Poles and Zeros, 172 3.3.2 Pole Location and Time-Domain Behavior for Causal Signals. 178 3.3.3 The System Function of a Linear Tim e-Invariant System. 181 3.4 In v e rs io n o f th e ^ -T ra n sfo rm 184 3.4.1 The Inverse ; -Transform by Contour Integration. 184 3.4.2 The Inverse ;-Transform by Power Series Expansion. 186 3.4.3 The Inverse c-Transform by Partial-Fraction Expansion. 188 3.4.4 Decomposition of Rational c-Transforms. 195 3.5 T h e O n e -sid e d ^ -T ra n sfo rm 197 3.5.1 Definition and Properties, 197 3.5.2 Solution of Difference Equations. 201 3.6 A n aly sis o f L in e a r T im e -In v a ria n t S ystem s in th e --D o m a in 3.6.1 Response of Systems with Rational System Functions. 203 3.6.2 Response of P ole-Z ero Systems with Nonzero Initial Conditions. 204 3.6.3 Transient and Steady-State Responses, 206 3.6.4 Causality and Stability. 208 3.6.5 P ole-Z ero Cancellations. 210 3.6.6 M ultiple-Order Poles and Stability. 211 3.6.7 The Schur-C ohn Stability Test, 213 3.6.8 Stability of Second-Order Systems. 215 3.7 S u m m ary an d R e fe re n c e s P ro b le m s 4 151 161 203 219 220 FREQUENCY ANALYSIS OF SIGNALS AND SYSTEMS 4.1 F re q u e n c y A n aly sis o f C o n tin u o u s-T im e Signals 230 4.1.1 The Fourier Series for Continuous-Time Periodic Signals. 232 4.1.2 Power Density Spectrum of Periodic Signals. 235 4.1.3 The Fourier Transform for Continuous-Time Aperiodic Signals, 240 4.1.4 Energy Density Spectrum of Aperiodic Signals. 243 4.2 F re q u e n c y A n aly sis o f D isc re te -T im e Signals 247 4.2.1 The Fourier Series for Discrete-Time Periodic Signals, 247 230 Contents V) 4.2.2 4.2.3 4.2.4 4.2.5 4.2.6 4.2.7 4.2.8 Power Density Spectrum of Periodic Signals. 250 The Fourier Transform of Discrete-Time Aperiodic Signals. 253 Convergence of the Fourier Transform. 256 Energy Density Spectrum of Aperiodic Signals, 260 Relationship of the Fourier Transform to the i-Transform , 264 The Cepstrum, 265 The Fourier Transform of Signals with Poles on the Unit Circle, 267 4.2.9 The Sampling Theorem Revisited, 269 4.2.10 Frequency-Domain Classification of Signals: The Concept of Bandwidth, 279 4.2.11 The Frequency Ranges of Some N atural Signals. 282 4.2.12 Physical and M athematical Dualities. 282 4.3 P ro p e rtie s of th e F o u rie r T ra n s fo rm fo r D isc re te -T im e S ignals 286 4.3.1 Symmetry Properties of the Fourier Transform, 287 4.3.2 Fourier Transform Theorems and Properties, 294 4.4 F re q u e n c y -D o m a in C h a ra c te ristic s of L in e a r T im e -In v a ria n t S ystem s 305 4.4.1 Response to Complex Exponential and Sinusoidal Signals: The Frequency Response Function. 306 44.2 Steady-State and Transient Response to Sinusoidal Input Signals. 314 4.4.3 Steady-State Response to Periodic Input Signals, 315 4.4.4 Response to Aperiodic Input Signals. 316 4.4.5 Relationships Between the System Function and the Frequency Response Function. 319 4.4.6 Com putation of the Frequency Response Function. 321 4.4.7 Input-O utput Correlation Functions and Spectra, 325 4.4.8 Correlation Functions and Power Spectra for Random Input Signals. 327 4.5 L in e a r T im e -In v a ria n t S ystem s as F re q u e n c y -S e le c tiv e F ilters 330 Ideal Filter Characteristics, 331 4.5.1 4.5.2 Lowpass, Highpass, and Bandpass Filters, 333 4,5.3 Digital Resonators, 340 4.5.4 Notch Filters, 343 4.5.5 Comb Filters. 345 4.5.6 All-Pass Filters. 350 4.5.7 Digital Sinusoidal Oscillators, 352 4.6 In v e rse S y stem s an d D e c o n v o lu tio n 355 4.6.1 Invertibility of Linear Tim e-Invariant Systems, 356 4.6.2 Minimum-Phase. Maximum-Phase, and Mixed-Phase Systems. 359 4.6.3 System Identification and Deconvolution, 363 4.6.4 Hom om orphic Deconvolution. 365 vii Contents 4.7 S u m m ary a n d R e fe re n c e s P ro b le m s 5 368 THE DISCRETE FOURIER TRANSFORM: ITS PROPERTIES AND APPLICATIONS 5.1 F re q u e n c y D o m a in Sam pling: T h e D isc re te F o u rie r T ra n s fo rm 394 5.1.1 Frequency-Dom ain Sampling and Reconstruction of Discrete-Time Signals. 394 5.1.2 The Discrete Fourier Transform (DFT). 399 5.1.3 The D FT as a Linear Transform ation. 403 5.1.4 Relationship of the DFT to O ther Transforms, 407 5.2 P ro p e rtie s o f th e D F T 409 5.2.1 Periodicity. Linearity, and Symmetry Properties, 410 5.2.2 Multiplication of Two DFTs and Circular Convolution. 415 5.2.3 Additional DFT Properties, 421 5.3 L in e a r F ilte rin g M e th o d s B ased on th e D F T 5.3.1 Use of the DFT in Linear Filtering. 426 5.3.2 Filtering of Long Data Sequences. 430 425 5.4 F re q u e n c y A n aly sis o f S ignals U sing th e D F T 433 5.5 S u m m ary an d R e fe re n c e s P ro b le m s 6 367 394 440 440 EFFICIENT COMPUTATION OF THE DFT: FAST FOURIER TRANSFORM ALGORITHMS 448 6.1 E fficien t C o m p u ta tio n of th e D F T : F F T A lg o rith m s 448 6.1.1 Direct Com putation of the DFT, 449 6.1.2 D ivide-and-Conquer Approach to Com putation of the DFT. 450 6.1.3 Radix-2 FFT Algorithms. 456 6.1.4 Radix-4 FFT Algorithms. 465 6.1.5 Split-Radix FFT Algorithms, 470 6.1.6 Im plem entation of FFT Algorithms. 473 6.2 A p p lic a tio n s o f F F T A lg o rith m s 475 6.2.1 Efficient Com putation of the D FT of Two Real Sequences. 475 6.2.2 Efficient Com putation of the D FT of a Z N -Point Real Sequence, 476 6.2.3 Use of the FFT Algorithm in Linear Filtering and Correlation, 477 6.3 A L in e a r F ilte rin g A p p ro a c h to C o m p u ta tio n o f th e D F T 6.3.1 The Goertzel Algorithm, 480 6.3.2 The Chirp-z Transform Algorithm, 482 479 viii Contents 6.4 Q u a n tiz a tio n E ffects in the C o m p u ta tio n o f th e D F T 486 6.4.1 Quantization Errors in the Direct Com putation of the DFT. 487 6.4.2 Quantization Errors in FFT Algorithms. 489 6.5 S u m m ary an d R e fe re n c e s P ro b le m s 493 494 500 7 IMPLEMENTATION OF DISCRETE-TIME SYSTEMS 7.1 S tru c tu res fo r th e R e a liz a tio n o f D isc re te -T im e S ystem s 7.2 S tru c tu res fo r F IR System s 502 7.2.1 Direcl-Form Structure, 503 7.2.2 Cascade-Form Structures. 504 7.2.3 Frequency-Sampling S tructures1. 506 7.2.4 Lattice Structure. 511 500 S tru c tu re s for IIR S ystem s 519 7.3.1 Direct-Form Structures. 519 7.3.2 Signal Flow Graphs and Transposed Structures. 521 7.3.3 Cascade-Form Structures, 526 7.3.4 Parallel-Form Structures. 529 7.3.5 Lattice and Lattice-Ladder Structures for IIR Systems, 531 S tate-S p a ce System A n aly sis a n d S tru c tu re s 539 7.4.1 State-Space Descriptions of Systems Characterized by Difference Equations. 540 7.4.2 Solution of the State-Space Equations. 543 7.4.3 Relationships Between Input-O utput and State-Space Descriptions, 545 7.4.4 State-Space Analysis in the z-Domain, 550 7.4.5 Additional State-Space Structures. 554 R e p re s e n ta tio n of N u m b e rs 556 7.5.1 Fixed-Point Representation of Numbers. 557 7.5.2 Binary Floating-Point R epresentation of Numbers. 561 7.5.3 E rrors Resulting from R ounding and Truncation. 564 Q u a n tiz a tio n of F ilte r C o e fficien ts 569 7.6.1 Analysis of Sensitivity to Quantization of Filter Coefficients. 569 7.6.2 Q uantization of Coefficients in FIR Filters. 578 7.7 R o u n d -O ff E ffects in D igital F ilte rs 582 7.7.1 Limit-Cycle Oscillations in Recursive Systems. 583 7.7.2 Scaling to Prevent Overflow, 588 7.7.3 Statistical Characterization of Q uantization Effects in Fixed-Point Realizations of Digital Filters. 590 7.8 S u m m ary a n d R e fe re n c e s P ro b le m s 600 598 Contents ix 8 614 DESIGN OF DIGITAL FILTERS 8.1 G e n e ra l C o n s id e ra tio n s 614 8.1.1 Causality and Its Implications. 615 8.1.2 Characteristics of Practical Frequency-Selective Filters. 619 8.2 D e sig n o f F IR F ilters 620 8.2.1 Symmetric and Antisym m eiric FIR Filters, 620 8.2.2 Design of Linear-Phase FIR Filters Using Windows, 623 8.2.3 Design of Linear-Phase FIR Filters by the Frequency-Sampling M ethod, 630 8.2.4 Design of Optimum Equiripple Linear-Phase FIR Filters, 637 8.2.5 Design of FIR Differentiators, 652 8.2.6 Design of Hilbert Transformers, 657 8.2.7 Comparison of Design M ethods for Linear-Phase FIR Filters, 662 8.3 D esig n o f I I R F ilters F ro m A n a lo g F iiters 666 8.3.1 IIR Filter Design by Approxim ation of Derivatives. 667 8.3.2 IIR Filter Design by Impulse Invariance. 671 8.3.3 IIR Filter Design by the Bilinear Transform ation, 676 8.3.4 The M atched-; Transform ation, 681 8.3.5 Characteristics of Commonly Used Analog Filters. 681 8.3.6 Some Examples of Digital Filter Designs Based on the Bilinear Transform ation. 692 8.4 F re q u e n c y T ra n s fo rm a tio n s 692 8.4.1 Frequency Transform ations in the Analog Dom ain, 693 8.4.2 Frequency Transform ations in the Digital Dom ain. 698 8.5 D esig n o f D ig ital F ilters B a sed on L e a st-S q u a re s M e th o d 8.5.1 Pade Approxim ation Method, 701 8.5.2 Least-Squares Design Methods, 706 8.5.3 FIR Least-Squares Inverse (W iener) Filters, 711 8.5.4 Design of IIR Filters in the Frequency Dom ain, 719 8.6 S u m m ary an d R e fe re n c e s P ro b le m s 9 701 724 726 SAMPLING AND RECONSTRUCTION OF SIGNALS 9.1 S am p lin g o f B a n d p a ss S ignals 738 9.1.1 R epresentation of Bandpass Signals, 738 9.1.2 Sampling of Bandpass Signals, 742 9.1.3 Discrete-Time Processing of Continuous-Time Signals, 746 9.2 A n a lo g -to -D ig ita l C o n v e rsio n 748 9.2.1 Sample-and-Hold. 748 9.2.2 Quantization and Coding, 750 9.2.3 Analysis of Q uantization Errors, 753 9.2.4 Oversampling A /D Converters, 756 738 Contents X 9.3 D ig ita l-to -A n a lo g C o n v e rsio n 763 9.3.1 Sample and Hold, 765 9.3.2 First-Order Hold. 768 9.3.3 Linear Interpolation with Delay, 771 9.3.4 Oversampling D/A Converters, 774 9.4 S u m m ary an d R e fe re n c e s P ro b le m s 774 775 10 MULTIRATE DIGITAL SIGNAL PROCESSING 782 10.1 In tro d u c tio n 10.2 D e c im a tio n by a F a c to r D 784 10.3 In te rp o la tio n by a F a c to r / 787 10.4 S am p lin g R a te C o n v e rsio n by a R a tio n a l F a c to r I ID 10.5 F iite r D esig n an d Im p le m e n ta tio n for S a m p lin g -R ate C o n v e rsio n 792 10.5.1 Direct-Form FIR Filter Structures, 793 10.5.2 Polyphase Filter Structures, 794 10.5.3 Time-Variant Filter Structures. 800 10.6 M u ltistag e Im p le m e n ta tio n o f S a m p lin g -R a te C o n v e rs io n 10.7 S a m p lin g -R a te C o n v e rsio n o f B a n d p a ss S ignals 810 10.7.1 Decim ation and Interpolation by Frequency Conversion, 812 10.7.2 M odulation-Free Method for Decimation and Interpolation. 814 10.8 S a m p lin g -R a te C o n v e rsio n by an A rb itra ry F a c to r 815 10.8.1 First-O rder Approxim ation, 816 10.8.2 Second-Order Approximation (Linear Interpolation). 819 10.9 A p p lic a tio n s o f M u ltira te Signal P ro c essin g 821 10.9.1 Design of Phase Shifters. 821 10.9.2 Interfacing of Digital Systems with Different Sampling Rates, 823 10.9.3 Im plem entation of Narrowband Lowpass Filters, 824 10.9.4 Im plem entation of Digital Filter Banks. 825 10.9.5 Subband Coding of Speech Signals, 831 10.9.6 Q uadrature M irror Filters. 833 10.9.7 Transmultiplexers. 841 10.9.8 Oversampling A/D and D /A Conversion, 843 10.10 S u m m ary an d R e fe re n c e s P ro b le m s 846 783 844 790 806 Contents xi 11 LINEAR PREDICTION AND OPTIMUM LINEAR FILTERS 852 11.1 In n o v a tio n s R e p re s e n ta tio n o f a S ta tio n a ry R a n d o m P ro c e ss 852 11.1.1 Rational Power Spectra. 854 11.1.2 Relationships Between the Filter Param eters and the Autocorrelation Sequence, 855 11.2 F o rw a rd an d B a ck w ard L in e a r P re d ictio n 857 11.2.1 Forw ard Linear Prediction, 857 11.2.2 Backward Linear Prediction, 860 11.2.3 The Optimum Reflection Coefficients for the Lattice Forward and Backward Predictors, 863 11.2.4 Relationship of an A R Process to Linear Prediction. 864 11.3 S o lu tio n o f th e N o rm al E q u a tio n s 864 11.3.1 The Levinson-Durbin Algorithm. 865 11.3.2 The Schiir Algorithm. 868 11.4 P ro p e rtie s o f th e L in e a r P re d ic tio n -E rro r F ilte rs 11.5 A R L attice an d A R M A L a ttic e -L a d d e r F ilters 876 11.5.1 AR LaLtice Structure. 877 11.5.2 A RM A Processes and Lattice-Ladder Filters. 878 11.6 W ie n e r F ilters fo r F ilterin g a n d P re d ictio n 880 11.6.1 FIR W iener Filter, 881 11.6.2 Orthogonality Principle in Linear M ean-Square Estimation, 884 11.6.3 IIR W iener Filter. 885 11.6.4 Noncausal Wiener Filter. 889 11.7 S u m m ary an d R e fe re n c e s P ro b le m s 873 890 892 12 POWER SPECTRUM ESTIMATION 12.1 E stim a tio n o f S p e c tra from F in ite -D u ra tio n O b s e rv a tio n s o f Signals 896 12.1.1 Com putation of the Energy Density Spectrum. 897 12.1.2 Estim ation of the Autocorrelation and Power Spectrum of Random Signals: The Periodogram. 902 12.1.3 The Use of the DFT in Power Spectrum Estim ation, 906 12.2 N o n p a ra m e tric M e th o d s fo r P o w er S p ectru m E s tim a tio n 908 12.2.1 The B artlett Method: Averaging Periodograms, 910 12.2.2 The Welch Method: Averaging Modified Periodogram s, 911 12.2.3 The Blackman and Tukey Method: Smoothing the Periodogram, 913 12.2.4 Perform ance Characteristics of N onparam etric Power Spectrum Estim ators, 916 896 xii Contents 12.2.5 Com putational Requirem ents of Nonparam etric Power Spectrum Estimates, 919 12.3 P a ra m e tric M e th o d s fo r P o w er S p e c tru m E stim a tio n 920 12.3.1 Relationships Between the A utocorrelation and the Model Param eters, 923 12.3.2 The Y ule-W alker M ethod for the A R Model Param eters, 925 12.3.3 The Burg M ethod for the A R Model Param eters, 925 12.3.4 Unconstrained Least-Squares M ethod for the A R Model Param eters, 929 12.3.5 Sequential Estim ation M ethods for the A R Model Param eters, 930 12.3.6 Selection of A R Model O rder, 931 12.3.7 MA Model for Power Spectrum Estim ation, 933 12.3.8 A R M A Model for Power Spectrum Estim ation, 934 12.3.9 Some Experim ental Results, 936 12.4 M in im u m V a rian ce S p ectral E stim a tio n 12.5 E ig e n an aly sis A lg o rith m s fo r S p e c tru m E stim a tio n 946 12.5.1 Pisarenko Harm onic Decom position M ethod, 948 12.5.2 Eigen-decomposition of the A utocorrelation Matrix for Sinusoids in White Noise, 950 12.5.3 MUSIC Algorithm. 952 12.5.4 ESPR IT Algorithm, 953 12.5.5 O rder Selection Criteria. 955 12.5.6 Experim ental Results, 956 12.6 S u m m ary an d R e fe re n c e s P ro b le m s 942 959 960 , A RANDOM SIGNALS CORRELATION FUNCTIONS, AND POWER SPECTRA A1 B RANDOM NUMBER GENERATORS B1 C TABLES OF TRANSITION COEFFICIENTS FOR THE DESIGN OF LINEAR-PHASE FIR FILTERS C1 D LIST OF MATLAB FUNCTIONS D1 REFERENCES AND BIBLIOGRAPHY R1 INDEX 11 Lj_ Preface T h is b o o k w as d e v e lo p e d b ased on o u r te ach in g o f u n d e rg ra d u a te and g ra d u ­ a te level co u rse s in d ig ital signal p ro cessin g o v er th e p a s t several y ears. In this b o o k w e p re se n t th e fu n d a m e n ta ls o f d isc re te -tim e signals, system s, and m o d e rn d ig ital p ro cessin g a lg o rith m s an d a p p lic a tio n s fo r stu d e n ts in electrical e n g in e e r­ ing. c o m p u te r en g in eerin g , a n d c o m p u te r science. T h e b o o k is su itab le fo r e ith e r a o n e -se m e s te r o r a tw o -se m e ste r u n d e rg ra d u a te level c o u rse in d isc re te system s a n d dig ital signal p ro cessin g . It is also in te n d e d fo r use in a o n e -se m e s te r first-year g ra d u a te -le v e l co u rse in digital signal processing. It is a ssu m ed th a t th e s tu d e n t in electrical and c o m p u te r e n g in e e rin g has h ad u n d e rg ra d u a te c o u rses in a d v an ce d calculus (in clu d in g o rd in a ry d iffe re n tia l e q u a ­ tio n s). an d lin ear sy stem s fo r c o n tin u o u s-tim e signals, including an in tro d u c tio n to th e L ap lace tran sfo rm . A lth o u g h the F o u rie r se ries a n d F o u rie r tra n sfo rm s of p e rio d ic an d a p e rio d ic signals a re d escrib ed in C h a p te r 4, we ex p ect th a t m any s tu d e n ts m ay have h ad th is m a te ria l in a p rio r course. A b ala n c e d co v erag e is p ro v id e d of b o th th e o ry an d p ra c tic a l ap p licatio n s. A larg e n u m b e r o f w ell d esigned p ro b le m s a re p ro v id e d to h e lp th e s tu d e n t in m a ste rin g th e su b ject m a tte r. A so lu tio n s m a n u a l is av ailab le fo r th e b en efit o f th e in stru c to r an d can be o b ta in e d fro m th e p u b lish er. T h e th ird e d itio n o f th e b o o k covers basically th e sa m e m a te ria l as th e se c­ o n d e d itio n , b u t is o rg an ized d ifferen tly . T h e m a jo r d ifferen ce is in th e o rd e r in w hich th e D F T a n d F F T alg o rith m s are co v ered . B a sed o n su g g estio n s m a d e by se v era l rev iew ers, w e n o w in tro d u c e th e D F T a n d d esc rib e its efficient c o m p u ta ­ tio n im m e d ia te ly fo llo w ing o u r tr e a tm e n t of F o u rie r analysis. T his re o rg a n iz a tio n h as also allo w ed us to elim in a te re p e titio n o f so m e to p ics c o n cern in g th e D F T and its ap p licatio n s. In C h a p te r 1 w e d escrib e th e o p e ra tio n s in v o lv ed in th e an alo g -to -d ig ital c o n v ersio n o f an alo g signals. T h e p ro cess o f sa m p lin g a sin u so id is d escrib ed in so m e d e ta il an d th e p ro b le m o f aliasing is ex p lain ed . Signal q u a n tiz a tio n an d d ig ita l-to -a n a lo g co n v ersio n a re also d escrib ed in g e n e ra l term s, b u t th e analysis is p re s e n te d in su b s e q u e n t c h a p te rs. C h a p te r 2 is d e v o te d e n tire ly to th e c h a ra c te riz a tio n a n d analysis o f lin e a r tim e -in v a ria n t (sh ift-in v arian t) d isc re te -tim e system s a n d d isc re te -tim e signals in th e tim e d o m a in . T h e co n v o lu tio n sum is d e riv e d a n d system s a re categ o rized a c co rd in g to th e d u ra tio n of th e ir im p u lse re sp o n s e as a fin ite -d u ra tio n im p u lse xiii xiv Preface re sp o n se (F IR ) an d as an in fin ite -d u ra tio n im pulse re sp o n se ( II R ) . L in e a r tim ein v a ria n t sy stem s c h a ra c te riz e d by d ifferen ce e q u a tio n s are p r e s e n te d an d th e so ­ lu tio n o f d ifferen ce e q u a tio n s w ith initial c o n d itio n s is o b ta in e d . T h e c h a p te r co n clu d es w ith a tre a tm e n t o f d isc re te -tim e c o rre la tio n . T h e z -tra n sfo rm is in tro d u c e d in C h a p te r 3. B o th th e b ila te ra l an d th e u n ila te ra l z -tra n sfo rm s are p re se n te d , a n d m e th o d s fo r d e te rm in in g th e in v erse z -tra n sfo rm are d esc rib e d . U se o f the z -tra n s fo rm in the analysis o f lin ear tim ein v a ria n t sy stem s is illu stra te d , an d im p o rta n t p ro p e rtie s o f system s, su c h as c a u s a l­ ity a n d stab ility , a re re la te d to z-d o m ain ch aracteristics. C h a p te r 4 tr e a ts th e analysis o f signals and sy stem s in th e fre q u e n c y d o m ain . F o u rie r se ries an d th e F o u rie r tra n sfo rm a re p re s e n te d fo r b o th co n tin u o u s-tim e an d d isc rete-tim e signals. L in e a r tim e -in v a ria n t (L T I) d isc rete sy stem s are c h a r­ a c terized in th e fre q u e n c y d o m a in by th e ir freq u e n c y resp o n se fu n c tio n an d th e ir re sp o n se to p e rio d ic an d a p e rio d ic signals is d e te rm in e d . A n u m b e r of im p o rta n t ty p es o f d isc re te -tim e system s are d esc rib e d , in clu d in g re s o n a to rs , n o tc h filters, co m b filters, all-p ass filters, a n d o scillato rs. T h e desig n of a n u m b e r of sim ple F IR a n d IIR filters is also co n sid ered . In a d d itio n , th e stu d e n t is in tro d u c e d to th e co n c e p ts o f m in im u m -p h a se , m ix ed -p h ase, an d m a x im u m -p h a se system s an d to th e p ro b le m o f d e c o n v o lu tio n . T h e D F T . its p ro p e rtie s an d its a p p licatio n s, a re th e topics c o v e re d in C h a p ­ te r 5. T w o m e th o d s a re d e sc rib e d fo r using th e D F T to p e rfo rm lin e a r filtering. T h e use o f th e D F T to p e rfo rm fre q u e n c y analysis o f signals is also d escrib ed . C h a p te r 6 co v ers th e efficient c o m p u ta tio n o f th e D F T . In c lu d e d in this c h a p ­ te r are d e sc rip tio n s o f radix-2, ra d ix -4, a n d sp lit-ra d ix fast F o u rie r tra n sfo rm (F F T ) alg o rith m s, a n d a p p lic a tio n s o f th e F F T a lg o rith m s to th e c o m p u ta tio n o f c o n v o ­ lu tio n a n d c o rre la tio n . T h e G o e rtz e l alg o rith m a n d the ch irp -z tra n sfo rm are in tro d u c e d as tw o m e th o d s fo r c o m p u tin g th e D F T using lin e a r filtering. C h a p te r 7 tre a ts th e re a liz a tio n o f I I R an d F IR system s. T h is tre a tm e n t in clu d es d irect-fo rm , cascad e, p a ra lle l, lattice, a n d la ttic e -la d d e r re a liz a tio n s. T h e c h a p te r in clu d es a tr e a tm e n t o f sta te -sp a c e analysis an d s tru c tu re s fo r d isc rete-tim e system s, an d ex am in es q u a n tiz a tio n effects in a d igital im p le m e n ta tio n o f F IR and I IR system s. T e c h n iq u e s fo r d esign o f digital F IR a n d IIR filters are p r e s e n te d in C h a p ­ te r 8. T h e d esign te c h n iq u e s in clu d e b o th d irect design m e th o d s in d isc re te tim e an d m e th o d s involv in g th e co n v ersio n o f an a lo g filters in to digital filters by v ario u s tra n sfo rm a tio n s. A lso tre a te d in this c h a p te r is th e d esig n o f F I R a n d IIR filters by le a st-sq u a re s m e th o d s. C h a p te r 9 fo cu ses o n th e sam pling o f c o n tin u o u s-tim e sig n a ls a n d th e r e ­ c o n s tru c tio n o f such signals fro m th e ir sam ples. In th is c h a p te r, w e d eriv e th e sam p lin g th e o re m fo r b a n d p a ss co n tin u o u s-tim e -sig n a ls an d th e n co v e r th e A /D an d D /A co n v ersio n te c h n iq u e s, including o v e rsam p lin g A /D a n d D /A co n v erters. C h a p te r 10 p ro v id e s an in d e p th tre a tm e n t o f sa m p lin g -ra te c o n v ersio n and its a p p lic a tio n s to m u ltira le d ig ital signal p ro cessin g . In a d d itio n to d escrib in g d e c ­ im atio n a n d in te rp o la tio n by in te g e r facto rs, we p re s e n t a m e th o d o f sa m p lin g -rate Preface xv co n v e rsio n by an a rb itra ry facto r. S ev eral a p p licatio n s to m u ltira te signal p ro c e ss­ ing a re p re s e n te d , in clu d in g th e im p le m e n ta tio n o f d igital filters, su b b a n d cod in g o f sp e ech sig n als, tra n sm u ltip le x in g , an d o v ersam p lin g A /D a n d D /A c o n v e rte rs. L in e a r p re d ic tio n an d o p tim u m lin e a r (W ien er) filters a re tr e a te d in C h a p ­ te r 11. A lso in clu d ed in this c h a p te r are d escrip tio n s o f th e L e v in s o n -D u rb in alg o rith m a n d Schiir a lg o rith m fo r solving th e n o rm a l e q u a tio n s , as w ell as th e A R la ttic e a n d A R M A la ttic e -la d d e r filters. P o w e r sp e c tru m e stim a tio n is th e m ain to p ic of C h a p te r 12. O u r co v erag e in clu d es a d e s c rip tio n o f n o n p a ra m e tric an d m o d el-b ased (p a ra m e tric ) m e th o d s. A lso d e s c rib e d a re e ig e n -d e c o m p o sitio n -b a se d m e th o d s, in clu d in g M U S IC an d E S P R IT . A t N o r th e a s te r n U n iv ersity , w e h av e u se d th e first six c h a p te rs o f this b o o k fo r a o n e -se m e s te r (ju n io r level) c o u rse in d isc rete sy stem s a n d d ig ital signal p r o ­ cessing. A o n e -s e m e s te r se n io r level c o u rse fo r stu d e n ts w h o h av e h a d p rio r e x p o su re to d isc rete sy stem s can u se th e m a te ria l in C h a p te rs 1 th ro u g h 4 for a q u ick rev iew a n d th e n p ro c e e d to co v er C h a p te r 5 th ro u g h 8. In a first-v ear g ra d u a te level c o u rse in digital signal p ro cessin g , th e first five c h a p te rs p ro v id e th e s tu d e n t w ith a goo d rev iew of d isc re te -tim e system s. T h e in stru c to r can m o v e q u ick ly th ro u g h m o st o f th is m aterial a n d th e n co v e r C h a p te rs 6 th ro u g h 9, fo llo w ed by e ith e r C h a p te rs 10 and 11 o r by C h a p te rs 11 an d 12. W e h a v e in c lu d e d m an y ex am p les th ro u g h o u t th e b o o k an d a p p ro x im a te ly 500 h o m e w o rk p ro b le m s. M an y o f th e h o m ew o rk p ro b le m s can b e so lv ed n u m e r ­ ically on a c o m p u te r, using a so ftw are p ack ag e such as M A T L A B © . T h e se p r o b ­ lem s a re id e n tifie d by an asterisk . A p p e n d ix D co n tain s a list o f M A T L A B fu n c­ tio n s th a t th e s tu d e n t can use in solving th e se p ro b lem s. T h e in s tru c to r m ay also w ish to c o n s id e r th e u se o f a s u p p le m e n ta ry b o o k th a t c o n ta in s c o m p u te r b ased exercises, su c h as th e b o o k s Digilal Signal Processing Us ing M A T L A B (P.W .S. K e n t, 1996) by V. K. In g le a n d J. G . P ro a k is a n d C o m p u te r- B a s e d Exercises f o r S ignal P ro cessing Using M A T L A B (P re n tic e H all, 1994) by C. S. B u rru s e t al. T h e a u th o rs a re in d e b te d to th e ir m an y facu lty c o lleag u es w ho h av e p ro v id e d v alu ab le su g g e stio n s th ro u g h review s o f the first an d se co n d ed itio n s o f this b o o k . T h e se in clu d e D rs. W . E . A le x a n d e r, Y. B re sle r, J. D e lle r, V. Ingle, C. K eller, H . L e v -A ri, L. M e ra k o s , W. M ik h a e l, P. M o n ticcio lo , C. N ikias, M . S ch etzen , H . T ru ssell, S. W ilso n , a n d M. Z o lto w sk i. W e a re also in d e b te d to D r. R , P ric e fo r re c o m m e n d in g th e in clu sion o f sp lit-ra d ix F F T alg o rith m s a n d re la te d su g g estio n s. F in ally , w e w ish to ac k n o w le d g e th e su g g e stio n s an d c o m m e n ts o f m an y fo rm e r g ra d u a te s tu d e n ts , a n d especially th o se by A . L. K ok, J. L in an d S. S rin id h i w ho assisted in th e p r e p a r a tio n o f several illu stra tio n s an d th e so lu tio n s m an u al. J o h n G . P ro a k is D im itris G , M a n o lak is Introduction D ig ital signal p ro cessin g is an are a o f science a n d e n g in e e rin g th a t h a s d ev e lo p e d rap id ly o v e r th e p ast 30 y ears. T his rap id d e v e lo p m e n t is a resu lt o f th e signif­ ican t ad v an ce s in digital c o m p u te r tech n o lo g y an d in te g ra te d -c irc u it fab rica tio n . T h e digital c o m p u te rs an d asso ciated digital h ard w are of th re e d e c a d e s ago w ere relativ ely larg e an d ex p en siv e and, as a co n seq u en ce, th e ir use w as lim ited to g e n e ra l-p u rp o s e n o n -re a l-tim e (o ff-line) scientific c o m p u ta tio n s an d business a p ­ p licatio n s. T h e ra p id d ev e lo p m e n ts in in te g ra te d -c irc u it te c h n o lo g y , sta rtin g with m ed iu m -scale in te g ra tio n (M S I) an d p ro g ressin g to large-scale in te g ra tio n (L S I), a n d now , v ery -larg e-scale in te g ra tio n (V L S I) of e le c tro n ic circuits has sp u rre d th e d e v e lo p m e n t o f p o w erfu l, sm a ller, faster, an d c h e a p e r digital c o m p u te rs an d sp e cial-p u rp o se d igital h a rd w a re . T h e se in ex p en siv e an d re lativ ely fast digital c ir­ cuits h av e m a d e it p o ssib le to co n stru c t highly so p h istic a te d digital system s cap ab le o f p e rfo rm in g co m p lex digital signal p ro cessin g fu n ctio n s a n d tasks, w hich are u su ­ ally to o difficult a n d /o r to o expensive to be p e rfo rm e d by an a lo g circuitry or a n alo g signal p ro cessin g system s. H e n c e m an y of th e signal p ro cessin g task s th a t w ere c o n v en tio n ally p e rfo rm e d by an alo g m e a n s a re realized to d a y by less ex p en siv e an d o fte n m o re re lia b le digital h a rd w a re . W e do n o t w ish to im ply th a t digital signal p ro cessin g is th e p ro p e r so lu ­ tio n fo r all signal p ro cessin g p ro b lem s. In d e e d , fo r m a n y signals w ith e x tre m e ly w ide b a n d w id th s, real-tim e p ro cessin g is a re q u ire m e n t. F o r such signals, a n a ­ log o r, p e rh a p s, o p tical signal p ro cessin g is th e only p o ssib le so lu tio n . H o w ev er, w h ere dig ital circuits are av ailab le an d h av e sufficient sp e e d to p e rfo rm th e signal p ro cessin g , th ey a re usually p re fe ra b le . N o t only d o d igital circuits yield c h e a p e r an d m o re re lia b le system s fo r signal p ro cessin g , th e y h av e o th e r a d v an tag es as w ell. In p a rtic u la r, digital pro cessin g h a rd w a re allow s p ro g ra m m a b le o p e ra tio n s. T h ro u g h so ftw are, on e can m o re easily m o d ify th e sig n al p ro cessin g fu n ctio n s to b e p e rfo rm e d by th e h a rd w a re . T h u s dig ital h a rd w a re a n d a s so ciated so ftw are p ro v id e a g re a te r d eg re e o f flexibility in sy stem d esign. A lso , th e re is o ften a h ig h e r o rd e r of p re c isio n ach iev ab le w ith d ig ital h a rd w a re an d so ftw are c o m p a re d w ith an alo g circu its a n d an alo g signal p ro cessin g system s. F o r all th e se re a so n s, th e re h as b e e n an explosive grow th in d ig ital signal p ro cessin g th e o ry a n d a p p licatio n s o v e r th e p ast th re e decades. 2 Introduction Chap. 1 In this b o o k o u r o b jectiv e is to p re se n t an in tro d u c tio n o f th e basic analysis to ols an d te c h n iq u e s fo r d igital p ro cessin g o f signals. W e b eg in by in tro d u c in g so m e o f th e n ecessa ry term in o lo g y an d by d escrib in g th e im p o rta n t o p e ra tio n s asso ciated w ith th e p ro cess of c o n v ertin g an an alo g signal to d ig ital fo rm su itab le fo r d igital p ro cessin g . A s we shall se e, digital p ro cessin g o f a n a lo g signals has som e d raw b ack s. F irst, an d fo re m o st, c o n v ersio n o f an a n a lo g signal to digital fo rm , acco m p lish ed by sa m p lin g th e signal an d q u a n tiz in g th e sa m p le s, resu lts in a d isto rtio n th a t p re v e n ts us fro m re c o n stru c tin g th e o rig in a l a n a lo g signal fro m the q u a n tiz e d sam p les. C o n tro l o f th e a m o u n t o f th is d isto rtio n is ach ie v e d by p ro p e r choice o f th e sam p lin g ra te a n d th e p recisio n in th e q u a n tiz a tio n p ro cess. S eco n d , th e re a re finite p re c isio n effects th a t m u st be c o n s id e re d in th e d igital pro cessin g o f th e q u a n tiz e d sam p les. W hile th e se im p o rta n t issues are c o n s id e re d in som e d etail in this b o o k , th e em p h asis is on th e analysis a n d d esig n o f digital signal p ro cessin g sy stem s a n d c o m p u ta tio n a l te ch n iq u es. 1.1 SIGNALS, SYSTEMS, AND SIGNAL PROCESSING A signal is d efin ed as any physical q u a n tity th a t varies w ith tim e, sp ace, o r any o th e r in d e p e n d e n t v ariab le o r variables. M a th em atic ally , we d e sc rib e a signal as a fu n ctio n o f o n e o r m o re in d e p e n d e n t variab les. F o r e x am p le, th e fu n ctio n s * i( r ) = 5/ (1.1.1) S2(t) = 20 r d escrib e tw o signals, o n e th a t varies lin early w ith the in d e p e n d e n t v ariab le t (tim e) an d a seco n d th a t v aries q u a d ra tic a lly w ith t. A s a n o th e r ex a m p le , co n sid e r the fu n ctio n v) = 3x + 2 x y + 1 0 y 2 (1.1.2) T his fu n ctio n d escrib es a signal o f tw o in d e p e n d e n t v a riab les x a n d y th a t could r e p re s e n t th e tw o sp a tia l c o o rd in a te s in a p lan e. T h e signals d e sc rib e d by (1.1.1) an d (1.1.2) b e lo n g to a class o f signals th a t are p recisely d efin ed by specifying th e fu n c tio n a l d e p e n d e n c e on th e in d e p e n d e n t v ariab le. H o w ev er, th e re are cases w h ere such a fu n c tio n a l re la tio n sh ip is u n k n o w n o r to o highly c o m p licated to be o f any p ractical use. F o r ex am p le, a sp e ech signal (see Fig. 1.1) c a n n o t be d e s c rib e d fu n ctio n ally by ex p ressio n s such as (1.1.1). In g e n eral, a se g m e n t o f sp e ech m ay be re p re se n te d to a high d eg re e o f accu racy as a sum of se v era l sin u so id s o f d iffe re n t am p litu d e s a n d freq u e n cies, th a t is, as N A j ( t ) s i n [ 2 ; r f } ( r ) f + #,■(/)] (1.1.3) i=i w h ere {/!,(/)}, {F ,(r)j, a n d {t9,(r)} a re th e se ts of (p o ssib ly tim e -v a ry in g ) a m p litu d es, freq u e n cies, an d p h a se s, resp ectiv ely , o f th e sinusoids. In fact, o n e w ay to in te rp re t th e in fo rm a tio n c o n te n t o r m essag e co n v ey ed by an y sh o rt tim e se g m e n t o f th e Sec. 1.1 — # S ^ # i j ^ 3 Signals, Systems, and Signal Processing I Th ... ‘ ^ • ft A N D ---------- ,|* y y y > v y y m w ■'r r m ■' w m ' W W W ’ ...................... 1 Figure 1.1 Example of a speech signal. sp e e c h signal is to m e a s u re the a m p litu d es, freq u e n cies, a n d p h a se s c o n ta in e d in th e sh o rt tim e se g m e n t o f the signal. A n o th e r ex am p le o f a n a tu ra l signal is an e le c tro c a rd io g ra m (E C G ). Such a signal p ro v id e s a d o c to r w ith in fo rm a tio n a b o u t th e co n d itio n o f the p a tie n t's h e a rt. S im ilarly, an e le c tro e n c e p h a lo g ra m (E E G ) signal p ro v id es in fo rm a tio n a b o u t th e activ ity o f th e b rain . S p eech , e le c tro c a rd io g ra m , a n d e le c tro e n c e p h a lo g ra m signals a re ex am p les o f in fo rm a tio n -b e a rin g signals th a t evolve as fu n ctio n s o f a single in d e p e n d e n t v ariab le, n am elv , tim e. A n ex am p le o f a signal th at is a fu n ctio n o f tw o in d e ­ p e n d e n t v ariab les is an im age signal. T h e in d e p e n d e n t v ariab les in th is case are th e sp atial c o o rd in a te s. T h e se a re b u t a few ex am p les o f th e co u n tless n u m b e r of n a tu ra l signals e n c o u n te re d in practice. A s so c ia te d w ith n a tu ra l signals are the m ean s by w hich such signals are g e n ­ e ra te d . F o r ex am p le, sp e ech signals are g e n e ra te d by fo rcin g air th ro u g h th e vocal co rd s. Im ag es a re o b ta in e d by ex p o sin g a p h o to g ra p h ic film to a scene o r an o b ­ ject. T h u s signal g e n e ra tio n is usually asso ciated w ith a sy stem th a t re sp o n d s to a stim u lu s o r fo rce. In a sp e ech signal, th e system consists o f th e vocal cords a n d th e vocal tra c t, also called th e vocal cavity. T h e stim ulus in c o m b in a tio n w ith th e sy stem is called a signal source. T h u s w e have sp eech so u rces, im ag es so u rces, an d v ario u s o th e r ty p es o f signal sources. A sy stem m ay also be defin ed as a physical device th a t p e rfo rm s an o p e r a ­ tio n on a signal. F o r e x am p le, a filter u sed to red u c e th e n o ise an d in te rfe re n c e co rru p tin g a d e s ire d in fo rm a tio n -b e a rin g signal is called a system . In this case th e filter p e rfo rm s so m e o p e ra tio n (s ) on th e signal, w hich h as th e effect o f red u cin g (filterin g ) th e n o ise a n d in te rfe re n c e from th e d e sire d in fo rm a tio n -b e a rin g signal. W h en w e pass a signal th ro u g h a system , as in filterin g , w e say th a t we h av e p ro c e sse d th e signal. In this case th e p ro cessin g of th e signal involves filtering th e n o ise an d in te rfe re n c e fro m th e d e s ire d signal. In g e n e ra l, th e system is c h a ra c ­ te riz e d by th e ty p e o f o p e ra tio n th a t it p e rfo rm s on th e signal. F o r ex am p le, if th e o p e ra tio n is lin ear, th e system is called linear. If th e o p e ra tio n o n th e signal is n o n lin e a r, th e system is said to be n o n lin e a r, a n d so fo rth . S uch o p e ra tio n s a re u su a lly re fe rre d to as signal processing. 4 Introduction Chap. 1 F o r o u r p u rp o se s, it is c o n v en ien t to b r o a d e n th e d efin itio n o f a system to include n o t o n ly physical devices, b u t also so ftw are re a liz a tio n s o f o p e ra tio n s on a signal. In d igital p ro cessin g o f signals on a digital c o m p u te r, th e o p e ra tio n s p e r­ fo rm e d on a signal co n sist of a n u m b e r of m a th e m a tic a l o p e ra tio n s as specified by a so ftw are p ro g ram . In this case, th e p ro g ra m r e p re s e n ts an im p le m e n ta tio n o f the system in software. T h u s we h ave a system th a t is re a liz e d on a d igital c o m p u te r by m ean s o f a se q u en ce o f m a th e m a tic a l o p e ra tio n s; th a t is, w e h av e a digital signal p ro cessin g system realized in so ftw are. F o r e x am p le, a d ig ital c o m p u te r can be p ro g ra m m e d to p e rfo rm digital filtering. A lte rn a tiv e ly , th e d igital processing o n th e signal m ay be p e rfo rm e d by digital h ard w a re (logic circu its) co nfigured to p e rfo rm th e d e sire d specified o p e ra tio n s. In such a re a liz a tio n , w e h av e a physical d ev ice th a t p e rfo rm s th e specified o p e ra tio n s. In a b r o a d e r se n se, a digital system can be im p le m e n te d as a c o m b in a tio n o f digital h a rd w a re an d so ftw are, each of w hich p e rfo rm s its ow n set of specified o p e ra tio n s. T h is b o o k d eals w ith th e p ro cessin g o f signals by digital m e a n s, e ith e r in so ft­ w are o r in h a rd w a re . Since m an y of the signals e n c o u n te re d in p ra c tic e are analog, w e will also co n sid er th e p ro b lem of c o n v ertin g an a n a lo g signal in to a digital sig­ n al fo r pro cessin g . T h u s we will be d ealin g p rim a rily w ith d ig ital system s. T he o p e ra tio n s p e rfo rm e d by such a system can u su ally be specified m ath em atically . T h e m e th o d o r set o f ru les for im p le m e n tin g th e sy stem by a p ro g ra m th a t p e r ­ fo rm s th e c o rre sp o n d in g m a th e m a tic a l o p e ra tio n s is called an algorithm. U sually, th e re are m an y w ays o r alg o rith m s by w hich a system can be im p le m e n te d , e ith e r in so ftw are o r in h a rd w a re , to p e rfo rm th e d e sire d o p e ra tio n s a n d c o m p u tatio n s. In p ra c tic e , we h av e an in te re st in devising a lg o rith m s th a t are c o m p u ta tio n a lly efficient, fast, an d easily im p lem en ted . T h u s a m a jo r to p ic in o u r stu d y o f digi­ tal signal p ro cessin g is th e discussion o f efficient a lg o rith m s fo r p e rfo rm in g such o p e ra tio n s as filterin g , c o rre la tio n , an d sp e c tra l analysis. 1.1.1 Basic Elements of a Digital Signal Processing System M o st o f th e signals e n c o u n te re d in science an d e n g in e e rin g a re a n a lo g in n a tu re. T h a t is. th e signals a re fu n ctio n s of a c o n tin u o u s v a ria b le , such as tim e o r space, an d u su ally ta k e o n v alues in a co n tin u o u s ran g e. S uch signals m ay be p ro cessed directly by a p p ro p ria te an alo g system s (such as filters o r fre q u e n c y an aly zers) or fre q u e n c y m u ltip lie rs for th e p u rp o se of ch an g in g th e ir c h a ra c te ristic s o r ex tractin g so m e d esired in fo rm a tio n . In such a case w e say th a t th e signal h as b e e n p ro cessed d irectly in its an alo g fo rm , as illu strated in Fig. 1.2. B o th th e in p u t signal a n d the o u tp u t signal a re in an a lo g form . Analog input signal Analog signal processor Analog output signal Figure 1.2 A nalog signal processing. Sec. 1.1 Signals, Systems, and Signal Processing 5 Analog output signal Analog input signal Digital input signal Figure 1.3 Digital output signal Block diagram of a digital signal processing system. D ig ital signal p ro cessin g p ro v id e s an a lte rn a tiv e m e th o d fo r p ro cessin g th e a n a lo g signal, as illu stra te d in Fig. 1.3. T o p e rfo rm th e p ro cessin g digitally, th e re is a n e e d fo r an in te rfa c e b e tw e e n th e an a lo g signal a n d th e digital p ro cesso r. T h is in te rfa c e is called an analog-to-digital ( A / D ) converter. T h e o u tp u t of th e A /D c o n v e rte r is a d ig ital signal th a t is a p p ro p ria te as an in p u t to th e d igital p ro cesso r. T h e dig ital signal p ro c e ss o r m ay be a larg e p ro g ra m m a b le digital c o m p u te r o r a sm all m ic ro p ro c e s so r p ro g ra m m e d to p e rfo rm th e d e s ire d o p e ra tio n s on th e in p u t signal. It m ay also be a h a rd w ire d digital p ro c e ss o r co n fig u red to p e rfo rm a specified se t o f o p e ra tio n s on th e in p u t signal. P ro g ra m m a b le m ach in es p r o ­ v id e th e flexibility to ch an g e th e signal p ro cessin g o p e ra tio n s th ro u g h a ch an g e in th e so ftw are, w h e re a s h a rd w ire d m ach in es a re difficult to reco n fig u re. C o n s e ­ q u e n tly , p ro g ra m m a b le signal p ro c e ss o rs a re in very c o m m o n use. O n th e o th e r h an d , w h en signal p ro cessin g o p e ra tio n s are w ell d efin ed , a h a rd w ire d im p le m e n ­ ta tio n o f th e o p e ra tio n s can be o p tim ized , re su ltin g in a c h e a p e r signal p ro c e sso r a n d , u su ally , o n e th a t ru n s fa ste r th a n its p ro g ra m m a b le c o u n te rp a rt. In a p p li­ c atio n s w h e re th e d ig ital o u tp u t fro m th e d igital signal p ro c e sso r is to be given to th e u se r in an alo g form , such as in sp e ech co m m u n icatio n s, w e m ust p r o ­ vid e a n o th e r in te rfa c e fro m th e digital d o m a in to th e a n a lo g d o m ain . S uch an in te rfa c e is called a digital-to-analog ( D / A ) converter. T h u s th e signal is p r o ­ v id ed to th e u se r in an a lo g form , as illu stra te d in th e b lo ck d iag ram o f Fig. 1.3. H o w e v e r, th e re a re o th e r p ractical a p p lic a tio n s involving signal analysis, w h ere th e d e s ire d in fo rm a tio n is co n v ey ed in digital form a n d n o D /A c o n v e rte r is re q u ire d . F o r ex am p le, in th e d igital p ro cessin g o f r a d a r signals, th e in fo rm a ­ tio n e x tra c te d fro m th e ra d a r signal, such as th e p o sitio n o f th e aircra ft a n d its sp e ed , m ay sim ply b e p rin te d on p a p e r. T h e re is n o n e e d fo r a D /A c o n v e rte r in th is case. 1.1.2 Advantages of Digital over Analog Signal Processing T h e re a re m an y re a so n s w hy d ig ital signal p ro cessin g o f an an alo g signal m ay be p re fe ra b le to p ro cessin g th e signal directly in th e an a lo g d o m ain , as m e n tio n e d briefly e a rlie r. F irst, a digital p ro g ra m m a b le sy stem allow s flexibility in r e c o n ­ figuring th e digital signal p ro cessin g o p e ra tio n s sim ply by ch anging th e p ro g ra m . 6 Introduction Chap. 1 R e c o n fig u ra tio n o f an an a lo g system usually im plies a re d e sig n o f th e h a rd w a re follow ed by te stin g a n d v erification to see th a t it o p e ra te s p ro p e rly . A ccu racy c o n s id e ra tio n s also p lay an im p o rta n t role in d e te rm in in g th e fo rm o f th e signal p ro cesso r. T o le ra n c e s in an alo g c ircu it c o m p o n e n ts m a k e it e x tre m e ly difficult fo r th e system d esig n er to co n tro l th e accu racy o f an an a lo g signal p r o ­ cessing system . O n th e o th e r h an d , a digital system p ro v id e s m uch b e tte r c o n tro l o f accu racy re q u ire m e n ts . Such re q u ire m e n ts , in tu rn , re s u lt in specifying th e a c ­ cu racy r e q u ire m e n ts in th e A /D c o n v e rte r a n d th e d igital sig n a l p ro c e sso r, in te rm s o f w ord le n g th , flo atin g -p o in t v ersu s fix ed -p o in t arith m e tic , a n d sim ilar facto rs. D ig ita l signals are easily sto re d o n m a g n e tic m ed ia (ta p e o r disk) w ith o u t d e ­ te rio ra tio n o r loss o f signal fidelity b e y o n d th a t in tro d u c e d in th e A /D co n v ersio n . A s a c o n se q u e n c e , th e signals b e c o m e tra n s p o rta b le an d can b e p ro cessed off-line in a re m o te la b o ra to ry . T h e digital signal p ro cessin g m e th o d also allow s for th e im ­ p le m e n ta tio n o f m o re so p h istic a te d signal p ro cessin g alg o rith m s. It is usually very difficult to p e rfo rm p recise m a th e m a tic a l o p e ra tio n s on signals in a n a lo g fo rm b u t th ese sam e o p e ra tio n s can b e ro u tin e ly im p le m e n te d on a d ig ital c o m p u te r using so ftw are. In so m e cases a d igital im p le m e n ta tio n of th e signal p ro cessin g system is c h e a p e r th a n its an a lo g c o u n te rp a rt. T h e lo w er cost m ay be d u e to th e fact th a t th e dig ital h a rd w a re is c h e a p e r, o r p e rh a p s it is a re su lt o f th e flexibility fo r m o d ­ ifications p ro v id e d by th e digital im p le m e n ta tio n . A s a c o n se q u e n c e o f th ese ad v a n ta g e s, d igital signal p ro c e ssin g has b e e n a p p lied in p ractical sy stem s co v erin g a b ro a d ra n g e of d iscip lin es. W e cite, fo r ex ­ am p le, th e a p p licatio n o f d igital signal p ro cessin g te c h n iq u e s in sp e ech p ro cessin g an d signal tran sm issio n o n te le p h o n e ch an n els, in im age p ro c e ssin g an d tra n sm is­ sio n , in seism o lo g y an d geophysics, in oil e x p lo ra tio n , in th e d e te c tio n of n u c le a r ex p lo sio n s, in th e p ro cessin g of signals receiv ed fro m o u te r sp a ce, an d in a vast v ariety o f o th e r a p p licatio n s. S om e o f th e se a p p lic a tio n s a re cited in su b s e q u e n t ch ap ters. A s a lre a d y in d icated , h o w ev er, digital im p le m e n ta tio n has its lim itatio n s. O n e p ractical lim ita tio n is th e sp e ed o f o p e ra tio n o f A /D c o n v e rte rs a n d digital signal p ro cesso rs. W e shall see th a t signals hav in g e x tre m e ly w id e b a n d w id th s re ­ q u ire fa st-sam p lin g -rate A /D c o n v e rte rs an d fast d igital signal p ro cesso rs. H e n c e th e re a re an alo g signals w ith larg e b a n d w id th s fo r w hich a digital p ro cessin g a p ­ p ro a c h is b ey o n d th e s ta te of th e a rt o f digital h a rd w a re . 1.2 CLASSIFICATION OF SIGNALS T h e m e th o d s we use in p ro cessin g a signal o r in an aly zin g th e re s p o n s e o f a system to a sig n al d e p e n d h eavily on th e ch a ra c te ristic a ttr ib u te s o f th e specific signal. T h e re a re te c h n iq u e s th a t ap p ly only to specific fam ilies o f signals. C o n seq u en tly , an y in v estig atio n in signal p ro cessin g sh o u ld sta rt w ith a classification o f th e signals in v o lv ed in th e specific ap p licatio n . Sec. 1.2 Classification of Signals 7 1.2.1 Multichannel and Multidimensional Signals A s e x p lain ed in S ectio n 1.1, a signal is d escrib ed by a fu n c tio n o f o n e o r m o re in d e p e n d e n t v ariab les. T h e v alue of th e fu n ctio n (i.e., th e d e p e n d e n t v ariab le) can be a re a l-v a lu e d sc alar q u a n tity , a co m p lex -v alu ed q u a n tity , o r p e rh a p s a v ecto r. F o r e x am p le, th e signal si( r ) = A sin37rr is a re a l-v a lu e d signal. H o w e v e r, th e signal s2(f) = A e ji7Tt = A cos 37t t j'A sin 3:r r is co m p lex v alu ed . In so m e a p p lic a tio n s, signals a re g e n e ra te d by m u ltip le so u rces or m u ltip le sen so rs. Such signals, in tu rn , can be re p re s e n te d in v e c to r fo rm . F ig u re 1.4 show s th e th re e c o m p o n e n ts of a v e c to r signal th a t re p re se n ts th e g ro u n d a c c e le ra tio n d u e to an e a r th q u a k e . T h is a c c e le ra tio n is the re su lt of th re e basic ty p es of elastic w aves. T h e p rim a ry (P ) w aves an d th e se co n d a ry (S) w aves p ro p a g a te w'ithin th e b o d y o f rock a n d a re lo n g itu d in al a n d tra n sv e rsa l, resp ec tiv ely . T h e th ird ty p e o f elastic w ave is called th e su rface w ave, b e c a u se it p ro p a g a te s n e a r th e g ro u n d su rface. If $*(/). k = 1. 2. 3. d e n o te s th e electrical signal from th e £ th se n so r as a fu n ctio n o f tim e, th e se t of p = 3 signals can be re p re se n te d by a v e c to r S?(f )< w h ere r si (O ' S;,(r) = Si(t) -Sl(t) J W e re fe r to such a v e c to r o f signals as a m u ltich a n n el signal. In e le c tro c a rd io g ra ­ p hy. for ex am p le, 3 -lead an d 12-lead e le c tro c a rd io g ra m s (E C G ) are o ften used in p ractice, w hich resu lt in 3 -ch an n el a n d 12-channel signals. L e t us n o w tu rn o u r a tte n tio n to th e in d e p e n d e n t v a ria b le (s). If the signal is a fu n ctio n o f a single in d e p e n d e n t v ariab le, th e signal is called a o ne-d im en sio n a l signal. O n th e o th e r h a n d , a signal is called M -d i m e n s i o n a l if its v alu e is a fu n ctio n of M in d e p e n d e n t v ariab les. T h e p ic tu re sh o w n in Fig. 1.5 is an ex am p le of a tw o -d im e n sio n al signal, since th e in ten sity o r b rig h tn e ss I ( x . y) a t each p o in t is a fu n ctio n of tw o in d e p e n d e n t v ariab les. O n th e o th e r h a n d , a b la c k -a n d -w h ite telev isio n p ic tu re m ay be r e p ­ r e se n te d as I ( x . y . t ) since th e b rig h tn e ss is a fu n ctio n of tim e. H e n c e th e T V p ic tu re m ay b e tr e a te d as a th re e -d im e n s io n a l signal. In c o n tra st, a co lo r T V p ic ­ tu re m ay b e d e sc rib e d by th re e in te n sity fu n ctio n s of th e fo rm Ir (x, y. ?), Is (x. y. t ), a n d I i , ( x . y , t ) , c o rre sp o n d in g to th e b rig h tn e ss of the th re e p rin cip al colors (red . g re e n , b lu e) as fu n ctio n s o f tim e. H e n c e th e co lo r T V p ic tu re is a th re e -c h a n n e l, th re e -d im e n s io n a l signal, w hich can b e re p re s e n te d by th e v e c to r -/,(* ,> ■ . O ' I U , y. t) — . l b(x, v ,r ) _ In this b o o k we d e a l m ainly w ith sin g le-ch an n el, o n e -d im e n sio n a l real- or co m p lex -v alu ed signals a n d w e re fe r to th e m sim ply as signals. In m a th e m a tic a l Introduction Chap. 1 Up / % East 7jJL______ South bouth 1 I____ i ]____ I. f S waves _4 P waves 1____ 1____ I t Surface waves r1 -2 I I i i i_______ I , I____ _ J _______I_______ I----------- 1-----------1----------- 1-----------1----------- 1-----------1 0 2 4 6 8 12 10 14 16 18 20 22 24 26 28 30 Time (seconds) (b) Figure 1.4 Three components of ground acceleration measured a few kilometers from the epicenter of an earthquake. (From Earthquakes, by B. A . Bold. © 1988 by W. H. Freeman and Company. Reprinted with permission of the publisher.) te rm s th ese signals are d escrib ed by a fu n ctio n o f a single in d e p e n d e n t v ariable. A lth o u g h th e in d e p e n d e n t variab le n e e d n o t be tim e, it is c o m m o n p ractice to use t as th e in d e p e n d e n t v ariab le. In m an y cases th e signal p ro c e ssin g o p e ra tio n s and a lg o rith m s d e v e lo p e d in this tex t for o n e -d im e n sio n a l, sin g le-ch an n el signals can b e e x te n d e d to m u ltic h a n n e l an d m u ltid im e n sio n a l signals. 1.2.2 Continuous-Time Versus Discrete-Time Signals Signals can b e fu rth e r classified in to fo u r d iffe re n t c a te g o rie s d e p e n d in g on the ch a ra c te ristic s o f th e tim e (in d e p e n d e n t) v a ria b le an d th e v alu es th ey tak e. Con tin u o u s -tim e signals o r a nalog signals a re d e fin ed for ev e ry value o f tim e an d Sec. 1.2 9 Classification of Signals Figure 1.5 Example of a two-dimensional signal. th ey ta k e on v alu es in the co n tin u o u s in terv al (a . b ). w h e re a can be —oc a n d b can be oc. M a th em atic ally , th ese signals can be d e sc rib e d by fu n ctio n s o f a c o n ­ tin u o u s v ariab le. T h e sp eech w av efo rm in Fig. 1.1 an d th e signals x i(r) = c o s 7i t , x j { t ) = e ^ 1' 1, —oc < t < oq are ex am p les o f an alo g signals. Discrete-time signals a re d efin ed o n ly at c e rta in specific v alu es o f tim e. T h e se tim e in sta n ts n eed n o t be e q u id ista n t, b u t in p ractice th ey are usually ta k e n a t e q u a lly sp a ced in terv als fo r c o m p u ta tio n a l c o n v en ien ce an d m a th e m a tic a l tra c ta b ility . T h e signal x(t„) = n = 0, ± 1 , ± 2 , . . . p ro v id es an ex am p le o f a d isc re te -tim e signal. If we use th e in d ex n o f th e d isc rete-tim e in sta n ts as th e in d e p e n d e n t v ariab le, th e signal v alu e b eco m es a fu n ctio n o f an in te g e r v ariab le (i.e., a se q u e n c e of n u m b e rs). T h u s a d isc re te -tim e signal can be re p re s e n te d m a th e m a tic a lly by a se q u e n c e of real o r c o m p lex n u m b ers. T o em p h asize the d isc rete-tim e n a tu r e o f a signal, w e sh all d e n o te such a signal as x{n) in ste a d o f x ( t ) . If th e tim e in stan ts t„ are e q u ally sp a ced (i.e., t„ = n T ), th e n o ta tio n x ( n T ) is also used. F o r ex am p le, th e se q u e n c e x(n) if n > 0 o th erw ise ( 1 .2 . 1 ) is a d isc re te -tim e signal, w hich is r e p re s e n te d g rap h ically as in Fig. 1.6. In ap p licatio n s, d isc rete-tim e signals m ay arise in tw o ways: 1. B y se lectin g v alu es o f an an alo g signal a t d isc re te -tim e in stan ts. T his p ro c e ss is called s am plin g an d is discussed in m o re d etail in S ectio n 1.4. A ll m e a s u r­ ing in stru m e n ts th a t ta k e m e a s u re m e n ts at a re g u la r in te rv a l o f tim e p ro v id e d isc rete-tim e signals. F o r ex am p le, th e signal x ( n ) in Fig. 1.6 can be o b ta in e d 10 Introduction Chap. 1 x{n) I I T Figure 1.6 Graphical representation of the discrete time signal x[n) = 0.8" for n > 0 and x(n) = 0 for n < 0. bv sa m p lin g th e an a lo g signal x ( t ) — 0 .8 ', t > 0 an d x ( t ) = 0. t < 0 once ev ery seco n d . 2. By accu m u latin g a v a ria b le o v e r a p e rio d o f tim e. F o r e x a m p le , c o u n tin g th e n u m b e r o f cars using a given s tre e t every h o u r, o r re c o rd in g th e v alu e of gold ev ery day, resu lts in d isc re te -tim e signals. F ig u re 1.7 show s a g rap h o f the W o lfer su n sp o t n u m b e rs. E a c h sam ple o f this d isc re te -tim e signal p ro v id es th e n u m b e r o f su n s p o ts o b se rv e d d u rin g an in te rv a l o f 1 y e a r. 1.2.3 Continuous-Valued Versus Discrete-Valued Signals T h e v alu es o f a c o n tin u o u s-tim e or d isc re te -tim e signal can be c o n tin u o u s or d is­ crete. If a signal ta k e s on all po ssib le values on a finite or an infinite ran g e, it Year Figure 1.7 W olfer annual sunspot num bers (1770-1869). Sec. 1.2 Classification of Signals 11 is said to b e c o n tin u o u s-v a lu e d signal. A lte rn a tiv e ly , if th e signal ta k e s on v alu es fro m a finite se t o f p o ssib le values, it is said to be a d isc re te -v a lu e d signal. U su ally , th e s e v alu es a re e q u id ista n t a n d h en ce can be e x p ressed as an in te g e r m u ltip le of th e d istan c e b e tw e e n tw o successive values. A d isc re te -tim e signal hav in g a set of d isc rete v alu es is called a digital signal. F ig u re 1,8 show s a d igital signal th a t ta k e s o n o n e o f fo u r p o ssib le values. In o r d e r fo r a signal to be p ro c e sse d digitally, it m u st be d isc rete in tim e a n d its v alu es m u st b e d isc re te (i.e., it m ust b e a digital sig n al). If th e signal to b e p ro c e sse d is in an a lo g fo rm , it is c o n v e rte d to a digital signal by sam pling th e an alo g signal at d isc rete in stan ts in tim e, o b ta in in g a d isc re te -tim e signal, and th e n by q ua n tizin g its v alu es to a set o f d isc re te v alu es, as d e sc rib e d la te r in th e c h a p te r. T h e p ro cess o f co n v e rtin g a c o n tin u o u s-v a lu e d signal in to a d isc re te -v a lu e d signal, called quan tizatio n, is basically an a p p ro x im a tio n p ro cess. It m ay be acco m p lish ed sim ply bv ro u n d in g o r tru n c a tio n . F o r ex am p le, if th e allo w ab le signal v alu es in th e d ig ital signal are in teg ers, say 0 th ro u g h 15, the c o n tin u o u s-v a lu e signal is q u a n tiz e d in to th ese in te g e r values. T h u s th e signal v alue 8.58 will be a p p ro x im a te d by th e v alu e 8 if th e q u a n tiz a tio n p ro cess is p e rfo rm e d by tru n c a tio n o r by 9 if th e q u a n tiz a tio n p ro c e ss is p e rfo rm e d by ro u n d in g to th e n e a re s t in teg er. A n ex p la n a tio n o f th e a n a lo g -to -d ig ita l co n v ersio n p ro cess is given la te r in th e c h a p te r. Figure 1.8 Digital signal with four different amplitude values. 1.2.4 Deterministic Versus Random Signals T h e m a th e m a tic a l an aly sis an d p ro cessin g o f signals re q u ire s th e availability o f a m a th e m a tic a l d e sc rip tio n fo r th e signal itself. T h is m a th e m a tic a l d e scrip tio n , o fte n re fe rre d to as th e signal m o d e l, lead s to a n o th e r im p o rta n t classification of signals. A n y signal th a t can b e u n iq u ely d esc rib e d by an explicit m a th e m a tic a l ex p ressio n , a tab le o f d a ta , o r a w ell-defined ru le is called deterministic. T his te rm is used to em p h asize th e fact th a t all p ast, p re se n t, an d fu tu re values o f th e signal are kno w n precisely , w ith o u t an y u n c e rta in ty . In m a n y p ractical ap p lic a tio n s, h o w ev er, th e re are sig n a ls th a t e ith e r c a n n o t b e d esc rib e d to an y re a so n a b le d e g re e o f accu racy by explicit m a th e m a tic a l fo r­ m u las, o r such a d e sc rip tio n is to o c o m p licated to b e of any p ractical use. T h e lack 12 Introduction Chap. 1 o f such a re la tio n sh ip im plies th a t such signals ev o lv e in tim e in an u n p re d ic ta b le m a n n e r. W e re fe r to th ese signals as ra n d o m . T h e o u tp u t o f a n oise g e n e ra to r, th e seism ic signal o f Fig. 1.4, an d th e sp e ech signal in Fig. 1.1 are ex am p les of ra n d o m signals. F ig u re 1.9 show s tw o signals o b ta in e d fro m th e sa m e n o ise g e n e ra to r an d th e ir asso ciated h isto g ram s. A lth o u g h th e tw o signals do n o t re s e m b le each o th e r visually, th e ir h isto g ra m s re v e a l som e sim ilarities. T his p ro v id e s m o tiv a tio n fo r —3>—4 1 ---------------------------------------------------------- 1 0 200 400 600 -------■*------------------- — 800 1000 ----- ------ --------------------------------------- 1200 1400 1600 (a) 400 f ----------------- ------------------- — - — -------------------------- ------------------- ------------------- 1 1 350 r i 300 - -j 250 <200 - 150 100 - I (b) Figure 1.9 tograms. Two random signals from the same signal generator and their his­ Sec. 1.2 Classification of Signals 13 4 4 0 —----- ' 200 ------------ '-------------------------------------------■---------------—--- --------1 400 600 800 1000 1200 1400 1600 <c) Figure 1.9 C ontinued th e an aly sis a n d d e sc rip tio n of ra n d o m signals using statistical te c h n iq u e s in stea d o f ex p licit fo rm u las. T h e m ath e m a tic a l fra m e w o rk fo r th e th e o re tic a l analysis of ra n d o m sig n als is p ro v id e d by th e th e o ry of p ro b a b ility a n d sto c h astic processes. S o m e b asic e le m e n ts o f this a p p ro a c h , a d a p te d to th e n e e d s o f this bo o k , are p re s e n te d in A p p e n d ix A . It sh o u ld b e em p h a siz e d a t th is p o in t th a t th e classification o f a real-world sig n al as d e te rm in is tic o r ra n d o m is n o t alw ays clear. S o m etim es, b o th a p p ro a c h e s le a d to m e a n in g fu l resu lts th a t p ro v id e m o re insight in to signal b eh av io r. A t o th e r Introduction 14 Chap. 1 tim es, th e w ro n g classification m ay le a d to e rro n e o u s resu lts, since som e m a th e ­ m atical to o ls m ay ap p ly o n ly to d e te rm in istic signals w hile o th e rs m ay apply only to ra n d o m signals. T h is will b e c o m e c le a re r as w e ex am in e specific m a th e m a tic a l tools. 1.3 THE CONCEPT OF FREQUENCY IN CONTINUOUS-TIME AND DISCRETE-TIME SIGNALS T h e co n cep t o f fre q u e n c y is fam iliar to stu d e n ts in e n g in e e rin g a n d th e sciences. T h is co n cep t is basic in. fo r ex am p le, th e design of a rad io re c e iv e r, a high-fidelity sy stem , o r a sp e c tra l filter fo r co lo r p h o to g ra p h y . F ro m physics w e k n o w th a t freq u e n cy is closely re la te d to a specific ty p e o f p e rio d ic m o tio n called h arm o n ic o scillatio n , w hich is d e s c rib e d by sin u so id al fu n ctio n s. T h e c o n c e p t o f freq u e n cy is d irectly re la te d to th e c o n c e p t o f tim e. A ctu ally , it has th e d im en sio n of inverse tim e. T h u s w e sh o u ld e x p ect th a t th e n a tu re of tim e (c o n tin u o u s o r d isc rete) w ould affect th e n a tu re o f th e fre q u e n c y accordingly. 1.3.1 Continuous-Time Sinusoidal Signals A sim ple h a rm o n ic o sc illatio n is m a th e m a tic a lly d escrib ed c o n tin u o u s-tim e sin u so id al signal: x a(t) = A cos(Q t + 0). —oc < t < oc by th e follow ing (1.3.1) show n in Fig. 1.10. T h e su b sc rip t a u se d w ith x { t ) d e n o te s an an a lo g signal. T his signal is co m p letely c h a ra c te riz e d by th re e p a ra m e te rs: A is th e a m p litu d e of the sin u so id . ft is th e fre q u e n c y in ra d ia n s p e r se co n d (rad /s), a n d 6 is th e p h a se in rad ian s. In ste a d o f ft, we o fte n use th e fre q u e n c y F in cycles p e r seco n d o r h e rtz (H z), w h ere Q — In F (1.3.2) In term s o f F. (1.3.1) can be w ritte n as x a(t) = A cos(2n F t + 6 ), —oo < t < oc (1.3.3) W e will use b o th fo rm s, (1.3.1) an d (1.3.3), in re p re s e n tin g sin u so id al signals. x j t ) = A cos(2nFt + 8) Figure 1.10 Example of an analog sinusoidal signal. Sec. 1.3 Frequency Concepts in Continuous-Discrete-Tim e Signals 15 T h e an a lo g sin u so id al signal in (1.3.3) is c h a ra c te riz e d by th e follow ing p r o p ­ erties: A L F o r ev ery fixed v alu e o f th e fre q u e n c y F, x a(r) is p erio d ic. In d e e d , it can easily b e sh o w n , using e le m e n ta ry trig o n o m e try , th a t x a(.t + Tp ) = A„(r) w h e re Tp = 1 / F is th e fu n d a m e n ta l p e rio d o f the sin u so id al signal. A 2 . C o n tin u o u s -tim e sin u so id al signals w ith d istin ct (d iffe re n t) fre q u e n c ie s a re th e m se lv e s d istin ct. A 3 . In c re a sin g th e fre q u e n c y F resu lts in an in crease in th e ra te o f o sc illatio n o f th e signal, in th e sense th a t m o re p e rio d s are included in a given tim e in terv al. W e o b se rv e th a t fo r F = 0. th e value Tp — oc is co n sisten t w ith the fu n ­ d a m e n ta l re la tio n F = 1 / T r . D u e to co n tin u ity o f th e tim e v a ria b le r, w e can in crease th e fre q u e n c y F, w ith o u t lim it, w ith a c o rre sp o n d in g increase in th e ra te o f oscillatio n . T h e re la tio n sh ip s we h ave d e sc rib e d fo r sin u so id al signals carry o v er to th e class o f co m p lex e x p o n e n tia l signals xa {t) - A e JlSi,+{" (1.3.4) T h is can easily b e seen by e x p ressin g th e se signals in te rm s o f sinusoids using th e E u le r id en tity e±j4: = cos <p i j sin <p (1.3.5) B y d efin itio n , freq u e n c y is an in h e re n tly p o sitiv e physical q u an tity . T his is o b v io u s if we in te r p re t fre q u e n c y as the n u m b e r o f cycles p e r u n it tim e in a p e rio d ic signal. H o w e v e r, in m any cases, only fo r m a th e m a tic a l co n v en ien ce , w e n e e d to in tro d u c e n e g a tiv e freq u e n cies. T o see this w e recall th a t th e sin u so id al signal (1.3.1) m ay be e x p ressed as xa (t) = A c o s (^ r + 6 ) = j eJ(Q,+f>) + ~ e - J(a+9) (1.3.6) w hich follow s fro m (1.3.5). N o te th a t a sin u so id al signal can be o b ta in e d by ad d in g tw o e q u a l-a m p litu d e c o m p lex -co n ju g ate e x p o n e n tia l signals, so m e tim e s called p h aso rs, illu stra te d in Fig. 1.11. A s t i m e p ro g re sse s th e p h a s o rs ro ta te in o p p o site d ire c tio n s w ith a n g u la r fre q u e n c ie s ±£2 ra d ia n s p e r se co n d . Since a positive f r e ­ q u e n c y c o rre sp o n d s to co u n te rc lo c k w ise u n ifo rm a n g u la r m o tio n , a negative f r e ­ q u e n c y sim ply c o rre sp o n d s to clockw ise a n g u la r m o tio n . F o r m a th e m a tic a l c o n v en ien ce , w e use b o th n e g a tiv e a n d po sitiv e freq u e n cies th ro u g h o u t th is b o o k . H e n c e th e fre q u e n c y ra n g e fo r a n a lo g sinusoids is —oo < F < oo. 16 Introduction Chap. 1 Re Figure 1.11 Representation of a cosine function by a pair of complex-conjugate exponentials (phasors). 1.3.2 Discrete-Time Sinusoidal Signals A d isc rete-tim e sin u so id al signal m ay be e x p ressed as x ( n ) — A cos (ton + 8), —oo < n < oc (1.3.7) w h ere n is an in te g e r v ariab le, called th e sam p le n u m b e r. A is th e am plitu de o f the sin u so id , co is th e fr e q u e n c y in rad ian s p e r sa m p le , and 8 is th e p h a s e in radians. If in ste a d o f a> we use the freq u e n cy v ariab le / defin ed by a; = 2 n f (1.3.8) x( n ) — A cos(2n f n + 8). —oc < n < oc (1.3.9) th e re la tio n (1.3.7) b eco m es T h e freq u e n cy / h as d im en sio n s o f cycles p e r sa m p le . In S ectio n 1.4. w here we co n sid e r th e sam p lin g o f an alo g sinusoids, w e re la te th e fre q u e n c y v ariab le / o f a d isc re te -tim e sin u so id to th e fre q u e n c y F in cycles p e r se co n d fo r the an a lo g sin u so id . F o r th e m o m e n t we co n sid er th e d isc re te -tim e sin u so id in (1.3.7) in d e p e n d e n tly of th e co n tin u o u s-tim e sinusoid given in (1.3.1). F ig u re 1.12 show s a sin u so id w ith fre q u e n c y co — n /6 ra d ia n s p e r sa m p le ( f ~ ~ cycles p e r sam ple) a n d p h ase 8 — n / 3 . x(n) - A cos (urn + 8) Figure 1.12 Example of a discrete-time sinusoidal signal (w — 7t / 6 and b — 7r/3). Sec. 1.3 Frequency Concepts in Continuous-Discrete-Tim e Signals 17 In c o n tra s t to co n tin u o u s-tim e sinusoids, th e d isc re te -tim e sin u so id s are c h a r­ a c te riz e d by th e fo llow ing p ro p e rtie s: B l . A discrete-time sinu so id is p er iod ic o n ly i f its fr e q u e n c y f is a rational n u m b e r . B y d efin itio n , a d isc rete-tim e signal x( n ) is p erio d ic w ith p e rio d N ( N > 0) if a n d only if x ( n + N ) = x(n ) fo r all n (1.3.10) T h e sm a llest v alu e o f N fo r w hich (1.3.10) is tru e is called th e f u n d a m e n ta l p eriod . T h e p r o o f o f th e p erio d icity p ro p e rty is sim ple. F o r a sin u so id w ith fre q u e n c y /o to b e p e rio d ic , we sh o u ld have cos[27t /o( A7 + n) + 8} — co s(2 ,t/o « + 6) T h is re la tio n is tru e if an d only if th e re exists an in te g e r k such th a t 2 n f ) N = 2kn o r, eq u iv alen tly . /o = 4 N (1.3.11) A cc o rd in g to (1.3.11). a d isc rete-tim e sin u so id al signal is p e rio d ic only if its f re ­ q u e n c y /o can be ex p re sse d as th e ra tio o f tw o in teg ers (i.e.. / () is ra tio n a l). T o d e te rm in e th e fu n d a m e n ta l p e rio d N o f a p e rio d ic sin u so id , w e e x p ress its fre q u e n c y /o as in (1.3.11) an d cancel com m on facto rs so th a t k a n d N are relativ ely p rim e . T h e n th e fu n d a m e n ta l p e rio d o f the sin u so id is e q u a l to N. O b serv e th a t a sm all ch an g e in fre q u e n c y can resu lt in a large change in th e p erio d . F o r ex am p le, n o te th a t f \ = 3 1 /6 0 im plies th at N\ = 60, w h ereas f i = 3 0 /6 0 resu lts in Nz = 2. B 2. Disc rete-tim e sinu so ids whose fre q u en cies are separa ted by an integer m ultiple o f 2 n are identical. T o p ro v e this assertio n , let us c o n sid er th e sin u so id cos(£oo« + 0). It easily fo llow s th a t cos[(wo + 2 n )n + B\ = cos(wo/i + 2 n n + 9) — co%{a)Qn + 9) (1.3.12) A s a re su lt, all sin u so id al se q u en ces x k(n) — A cos(a>tn + 8). k = 0 ,1 ,2 ,... (1.3.13) w h ere Wk = cl>c + 2k n , —7r < o>o < n are in distinguishable (i.e., identical). O n th e o th e r h a n d , th e se q u e n c e s o f any tw o sin u so id s w ith fre q u e n c ie s in th e ra n g e - n < a> < n or —^ < f < ~ a re distinct. C o n s e q u e n tly , d isc rete-tim e sinusoidal signals w ith fre q u e n c ie s M < n o r | / | < \ Introduction 18 Chap. 1 are u n iq u e. A n y se q u e n c e re su ltin g fro m a sin u so id w ith a fre q u e n c y M > n , or | / | > j , is id en tical to a se q u e n c e o b ta in e d fro m a sin u so id al signal w ith fre q u e n c y \co\ < n . B e c a u se o f th is sim ilarity, we call th e sin u so id h av in g th e freq u e n cy M > tt an alias o f a c o rre sp o n d in g sinusoid w ith fre q u e n c y jwj < n . T h u s w e re g a rd freq u e n cies in th e ra n g e —tt < a> < tt, o r —1 < / < 1 as u n iq u e a n d all freq u e n cies |o>[ > t t , o r | / | > ~, as aliases. T h e r e a d e r sh o u ld n o tice th e d iffe re n c e b e tw e e n d isc rete-tim e sin u so id s an d co n tin u o u s-tim e sinusoids, w h e re th e la tte r re su lt in d istin ct signals fo r £2 o r F in th e e n tir e ran g e —oc < £2 < oc o r —oc < F < oc. B 3. The highest rate o f oscillation in a discrete-time sin u s o i d is attained whe n to — 7i (or cu = —tt) or, eq uivalently, f — \ (or f = —\ ) . T o illu stra te th is p ro p e rty , let u s in v estig ate th e c h a ra c te ristic s of th e sin u ­ so id a l signal se q u e n c e x ( n ) = cos c^on w h en th e fre q u e n c y v aries fro m 0 to tt. T o sim plify th e a rg u m e n t, we ta k e values o f (l> o = 0, 7t / 8, tt/4 , jt/2 , n c o rre sp o n d in g to / = 0, 5, w hich resu lt in p erio d ic se q u e n c e s h av in g p e rio d s N = oc, 16, 8, 4, 2. as d e p ic te d in Fig. 1.13. W e n o te th a t th e p e rio d o f th e sinusoid d e c re a se s as th e fre q u e n c y in creases. In fact, we can see th a t th e ra te o f o scillatio n in crease s as th e fre q u e n c y increases. ,, xin) Figure 1.13 Signal x ( n ) = c o s cu^n for various values of the frequency cdq. Sec. 1.3 Frequency Concepts in Continuous-Discrete-Time Signals 19 T o see w h at h a p p e n s for tt < ioq < 2tt . we co n sid e r th e sinusoids w ith fre q u e n c ie s a>\ = a>(> a n d 0J2 — 2 n — ojq. N o te th at as co\ varies from tt to 2n . a>z v aries fro m ir to 0. it can be easily se en th at = A cos co} n — A cos won X2 (n) = A cos uhn — A cos(27r — coo)n (1.3.14) = A c o s (—coqii) — x \ (h) H e n ce ur± is an alias o f w\. If we h ad u sed a sine fu n ctio n in stea d o f a cosine fu n c ­ tio n , th e resu lt w ou ld basically be th e sam e, ex cep t fo r a 180' p h a se d ifferen ce b etw een th e sin u so id s A](«) and xi ( n ) . In any case, as we increase th e re lativ e freq u e n cy coo o f a d isc re te -tim e sin u so id from tt to 27r. its ra te of o sc illatio n d e ­ creases. F o r coo = 2 tt th e re su lt is a c o n sta n t signal, as in th e case fo r oju = 0. O b v io u sly , fo r co{) = tt (o r f = k) w e h ave th e hig h est ra te o f oscillation. A s fo r th e case o f co n tin u o u s-tim e signals, n eg ativ e fre q u e n c ie s can be in ­ tro d u c e d as w ell for d isc rete-tim e signals. F o r this p u rp o se w e use th e id en tity A A x (n ) = Acos(con + 0) = — (>Jiwn+0) + — (1.3.15) Since d isc re te -tim e sinusoidal signals w ith fre q u e n c ie s th a t are se p a ra te d by an in teg er m u ltip le o f 27r are iden tical, it follow s th a t th e fre q u e n c ie s in any in terv al co] < a> < co\ + 2 tt c o n stitu te all the existing d isc rete-tim e sinusoids o r com plex e x p o n en tials. H en ce th e fre q u e n c y ran g e fo r d isc rete-tim e sinusoids is finite with d u ra tio n 2 n . U sually, we choose th e ran g e 0 < co < 2n o r —tt < co < tt ({) < f < 1. —1 < / < | ) , w hich we call th e f u n d a m e n t a l range. 1.3.3 Harmonically Related Complex Exponentials S in u so id al signals a n d com plex e x p o n e n tia ls play a m a jo r role in th e analysis o f signals an d system s. In so m e cases we deal w ith sets of h arm on ic a lly related c o m ­ plex e x p o n e n tia ls (o r sin u so id s). T h e se are sets of p e rio d ic co m p lex e x p o n e n tia ls w ith fu n d a m e n ta l fre q u e n c ie s th a t are m u ltip le s o f a single positive freq u e n cy . A lth o u g h we confine o u r discussion to com plex e x p o n e n tia ls, th e sam e p r o p e r ­ ties clearly hold fo r sin u so id al signals. W e co n sid e r h a rm o n ically re la te d co m p lex e x p o n e n tia ls in b o th co n tin u o u s tim e and d isc rete tim e. Continuous-time exponentials. T h e basic signals for co n tin u o u s-tim e , h arm o n ically re la te d e x p o n e n tia ls are sk(t) = ejkno' = e ll7TkFn' jt = 0 . ± l . ± 2 . . . . (1.3.16) W e n o te th a t for ea c h value o f k, s^U) is p erio d ic w ith fu n d a m e n ta l p e rio d 1 /(kFo) = Tp/ k o r fu n d a m e n ta l freq u e n cy kFo. Since a signal th a t is p e rio d ic w ith p e rio d Tp / k is also p e rio d ic w ith p erio d k ( T p/ k ) = Tp fo r any positive in te g e r k, w e see th a t all o f th e s*(r) h av e a co m m o n p e rio d of Tp, F u rth e rm o re , acco rd in g 20 Introduction Chap. 1 to S ectio n 1.3.1, Fo is allo w ed to ta k e any v alu e an d all m e m b e rs of th e set are d istin ct, in th e se n se th a t if k\ ^ k2, th en 5*1 (7) ^ F ro m th e basic signals in (1.3.16) we can c o n s tru c t a lin e a r c o m b in a tio n of h arm o n ically re la te d co m p lex ex p o n e n tia ls o f th e form cc SC = x ° ( ' ) = Ckelkiltit k — — oc ( 1 -3 -1 7 ) k ~ — oc w h ere ck, k = 0, ± 1 , ± 2 . . . . are a rb itra ry co m p lex co n sta n ts. T h e signal x a(t) is p erio d ic w ith fu n d a m e n ta l p erio d Tp = l / f o , a n d its r e p re s e n ta tio n in term s o f (1.3.17) is called th e F ourier series ex p an sio n fo r x a (t). T h e co m p lex -v alu ed co n sta n ts are th e F o u rie r se rie s coefficients a n d th e signal sk (r) is called th e fcth h a rm o n ic o f x (l(t). Discrete-time exponentials. Since a d isc re te -tim e co m p le x e x p o n e n tia l is p erio d ic if its relativ e fre q u e n c y is a ra tio n a l n u m b e r, w e ch o o se f Q — 1/A' an d we d efine th e sets o f h arm o n ically re la te d co m p lex e x p o n e n tia ls by k = 0. ± 1 . ± 2 , . . . sk (n) = ej2* kf" \ (1.3.18) In c o n tra st to th e c o n tin u o u s-tim e case, we n o te th at sk+Nln) = eJ7* n'k+N,/N = e ^ s k (n) = sk (n) T his m ean s th a t, c o n siste n t w ith (1.3.10), th e re are only N d istin ct p e rio d ic com plex e x p o n en tials in th e se t d e sc rib e d by (1.3.18). F u rth e rm o re , all m e m b e rs of the set h av e a co m m o n p e rio d o f N sam ples. C learly, w e can ch o o se a n y co n secu tiv e A' co m p lex e x p o n e n tia ls, say from k = no to k — no 4- N — 1 to fo rm a h arm o n ically re la te d set w ith fu n d a m e n ta l freq u e n cy /(, = 1 / N . M o st o fte n , fo r co n v en ien ce , we ch o o se th e set th a t c o rre sp o n d s to no = 0 , th a t is, th e set * = 0 . 1 . 2 .........N - 1 sk(n) = ejl n k n / s . (1.3.19) A s in th e case o f c o n tin u o u s-tim e signals, it is o b v io u s th a t th e lin e a r co m ­ b in atio n N- 1 \-l x ( n ) = £ c * s * ( n ) = Y L ckei2nkn' N k= 0 Jt= 0 resu lts in a p e rio d ic signal w ith fu n d a m e n ta l p e rio d N . A s w e shall see later, this is th e F o u rie r series re p re s e n ta tio n for a p e rio d ic d isc re te -tim e se q u e n c e w ith F o u rie r co efficien ts {q}. T h e se q u e n c e sk (n) is called th e /tth h a rm o n ic o f x(n ). Example 1.3.1 Stored in the memory of a digital signal processor is one cycle of the sinusoidal signal . ( 2nn x ( n ) = sin I + 6 where 6 — 2 n q / N , where q and N are integers. Sec. 1.4 Analog-to-Digital and Digital-to-Analog Conversion 21 (a) Determ ine how this table of values can be used to obtain values of harmonically related sinusoids having the same phase. (b) D eterm ine how this table can be used to obtain sinusoids of the same frequency but different phase. Solution (a) Let denote the sinusoidal signal sequence ( 2yrnk xk(n) = sin I --------- ! V N This is a sinusoid with frequency f k = k / N. which is harmonically related to x{n). But xk{n) may be expressed as xk{n) = sin 2 tt ( k n ) —— = x(kn) Thus we observe that ,vt (0) = .v(0). **(1) = x ( k ) . x k (2) = x ( 2 k ) . and so on. Hence the sinusoidal sequence can be obtained from the table of values of x ( n ) by taking every k th value of * ( « ) . beginning with .v(0). In this m anner we can generate the values of all harmonically related sinusoids with frequencies fk = k / N for k = 0. 1....... N - 1. (b) We can control the phase 8 of the sinusoid with frequency j\ — k / N by taking the first value of the sequence from memory location q — 9 N/ 2 tt. where q is an integer. Thus the initial phase 6 controls the starling location in the table and we wrap around the table each time the index (kn) exceeds N. 1.4 ANALOG-TO-DIGITAL AND DIGITAL-TO-ANALOG CONVERSION M o st sig n als o f p ractical in terest, such as sp e ech , bio lo g ical signals, seism ic signals, ra d a r signals, so n a r signals, and v ario u s co m m u n ic a tio n s signals such as au d io a n d v id eo signals, are an alo g . T o p ro cess an a lo g signals by digital m e a n s , it is first n ecessa ry to c o n v e rt th e m into digital form , th a t is, to c o n v e rt th e m to a se q u e n c e o f n u m b e rs h av in g finite precision. T his p ro c e d u re is called analog-to-digital ( A / D ) co n v e r sio n , an d th e c o rre sp o n d in g devices a re called A / D converters ( A D C s ) . C o n c e p tu a lly , w e view A /D co n v ersio n as a th re e -s te p p ro cess. T his p ro cess is illu stra te d in Fig. 1.14. 1. S am p lin g . T his is th e c o n v ersio n o f a c o n tin u o u s-tim e signal in to a d is c re te ­ tim e signal o b ta in e d by tak in g “ sa m p le s’" o f th e c o n tin u o u s-tim e signal at d isc re te -tim e in stan ts. T h u s, if x a(t) is th e in p u t to th e sa m p le r, th e o u tp u t is x a ( n T ) = x ( n ), w h ere T is called th e s a m p lin g interval. 2. Q ua ntiza tio n . T h is is th e co n v ersio n o f a d isc re te -tim e c o n tin u o u s-v a lu e d signal in to a d isc rete-tim e, d isc rete-v alu ed (d ig ital) signal. T h e v alu e o f ea c h Introduction 22 Chap. 1 A/D converter 01011... "7 Analog signal Discrete-time signal Quantized signal Digital signal Figure 1.14 Basic parts of an analog-to-digital (A /D ) converter. signal sam p le is re p re s e n te d by a v alu e se lected from a finite set o f p o ssi­ b le values. T h e d ifferen ce b e tw e e n th e u n q u a n tiz e d sa m p le x ( n ) an d the q u a n tiz e d o u tp u t x q(n) is called th e q u a n tiz a tio n erro r. 3. Coding. In th e co d in g p ro cess, each d isc rete v alu e x q{n) is re p re s e n te d by a 6 -b it b in ary se q u en ce. A lth o u g h w e m o d e l th e A /D c o n v e rte r as a sa m p le r follow ed by a q u a n tiz e r an d co d er, in p ractice th e A /D co n v ersio n is p e rfo rm e d by a single device th at ta k e s x a(t) an d p ro d u c e s a b in a ry -c o d e d n u m b e r. T h e o p e ra tio n s of sa m p lin g an d q u a n tiz a tio n can be p e rfo rm e d in e ith e r o rd e r b u t. in p ractice, sa m p lin g is alw ays p e rfo rm e d b e fo re q u a n tiz a tio n . In m an y cases o f p ractical in te re st (e.g., sp e ech p ro cessin g ) it is d esirab le to co n v ert th e p ro cessed digital signals in to an a lo g form . (O b v io u sly , we can n o t listen to th e se q u e n c e of sa m p le s re p re se n tin g a sp e ech signal o r see th e n u m ­ b ers co rre sp o n d in g to a T V signal.) T h e p ro cess o f co n v e rtin g a digital signal in to an an alo g signal is kno w n as digital-to-analog ( D / A ) co nversion. A ll D /A c o n v e rte rs “c o n n ect th e d o ts ’" in a digital signal by p e rfo rm in g so m e kind of in te r­ p o la tio n , w hose accu racy d e p e n d s on th e q u ality of th e D /A c o n v ersio n process. F ig u re 1.15 illu strates a sim ple fo rm o f D /A c o n v ersio n , called a z e ro -o rd e r hold o r a sta ircase a p p ro x im a tio n . O th e r a p p ro x im a tio n s a re p o ssib le, such as lin early co n n ectin g a p a ir o f successive sa m p le s (lin e a r in te rp o la tio n ), fittin g a q u a d ra tic th ro u g h th re e successive sa m p le s (q u a d ra tic in te rp o la tio n ), an d so on. Is th e re an o p tim u m (ideal) in te rp o la to r? F o r signals hav in g a limited f r e q u e n c y co ntent (finite b an d w id th ), th e sa m p lin g th e o re m in tro d u c e d in th e follow ing se c tio n specifies the o p tim u m form o f in te rp o la tio n . S am p lin g a n d q u a n tiz a tio n are tr e a te d in th is sectio n . In p a rtic u la r, we d e m o n s tra te th a t sa m p lin g d o e s n o t re su lt in a loss of in fo rm a tio n , n o r d o es it in tro d u c e d isto rtio n in th e signal if th e signal b a n d w id th is finite. In p rin cip le , th e an alo g signal can b e re c o n stru c te d from th e sam ples, p ro v id e d th a t th e sam p lin g ra te is sufficiently high to avoid th e p ro b le m co m m o n ly called aliasing. O n th e o th e r h an d , q u a n tiz a tio n is a n o n in v e rtib le o r irre v e rsib le p ro c e ss th a t resu lts in signal d isto rtio n . W e shall sh o w th a t th e a m o u n t o f d isto rtio n is d e p e n d e n t on Sec. 1.4 Analog-to-Digital and Digital-to-Analog Conversion Original Signal 23 Staircase Approximation / / / V *o / / / -/ I I o 67Time Figure 1.15 Zero-ordcr hold digital-to-analog (D /A ) conversion. th e accu racy , as m e a s u re d by th e n u m b e r of bits, in th e A /D c o n v ersio n process. T h e facto rs affe ctin g the choice of th e d esired accu racy of th e A /D c o n v e rte r are cost an d sam p lin g ra te . In g en eral, th e cost in crease s w ith an in crease in accuracy a n d /o r sa m p lin g rate. 1.4.1 Sampling of Analog Signals T h e re are m an y ways to sa m p le an an a lo g signal. W e lim it o u r discussion to p er iod ic o r u n i f o r m s a m p li n g , w hich is th e ty p e of sa m p lin g used m o st o ften in p ractice. T h is is d escrib ed by the re la tio n x(n) = xa (nT). —o c < n < c c (1.4.1) w h ere x ( n ) is th e d isc re te -tim e signal o b ta in e d by “ ta k in g sa m p le s” o f th e an alo g signal x aU) ev ery T se co n d s. T his p ro c e d u re is illu stra te d in Fig. 1.16. T h e tim e in te rv a l T b etw e e n successive sa m p les is called th e sa m p li n g p er io d o r sa m p le interval an d its recip ro c al 1 / 7 — Fs is called the s a m p lin g rate (sam p les p e r second) o r th e sa m p lin g f r e q u e n c y (h ertz). P e rio d ic sa m p lin g estab lish es a re la tio n sh ip b e tw e e n th e tim e v ariab les t an d n o f c o n tin u o u s-tim e an d d isc re te -tim e signals, resp ec tiv ely . In d e e d , th e s e v a ri­ ab les a re lin early re la te d th ro u g h th e sa m p lin g p e rio d T or, e q u iv alen tly , th ro u g h th e sa m p lin g ra te Fs — l / 7 \ as (1.4.2) A s a c o n s e q u e n c e o f (1.4.2), th e re exists a re la tio n sh ip b e tw e e n th e freq u e n cy v a ria b le F (o r Q) fo r an a lo g signals a n d the freq u e n c y v a ria b le / (o r co) for d isc re te -tim e signals. T o estab lish th is re la tio n sh ip , co n sid e r an an alo g sinusoidal signal o f th e fo rm x B{t) = A c o s ( 2 t t F t + 8 ) (1.4.3) 24 Introduction *(n) = xa(nT) Analog signal Fs = 1IT Chap. 1 Discrete-time signal Sampler Figure 1.16 Periodic sampling of an analog signal. w hich, w h en sa m p le d p erio d ically at a ra te Fs — 1 / 7 sa m p le s p e r se co n d , yields x a( n T ) == x{ n) = A cos(27 t F n T -f 9) /2 n n F \ = A cos ( — + 9 \ (1-4.4) If we c o m p are (1.4.4) w ith (1.3.9). w e n o te th a t th e fre q u e n c y v ariab les F an d / a re lin early re la te d as Is or, eq u iv alen tly , as co = Q T (1.4.5) Fs=sampling frequency F=frequency of analoa f=frequency of digital signal (1.4.6) =relative or normalized frequency T h e re la tio n in (1.4.5) ju stifies th e n am e relative o r n o r m a li z e d f r e q u e n c y , w hich is so m e tim e s u sed to d esc rib e th e fre q u e n c y v a ria b le / . A s (1.4.5) im p lies, w e can use / to d e te rm in e th e fre q u e n c y F in h e rtz only if th e sa m p lin g fre q u e n c y Fs is k now n. W e recall fro m S ectio n 1.3.1 th a t th e ran g e o f th e fre q u e n c y v a ria b le F o r £2 fo r co n tin u o u s-tim e sin u so id s are —oc < F < oo —oc < £2 < 00 ( I .4 .7 ) H o w e v e r, th e situ a tio n is d iffe re n t fo r d isc re te -tim e sinusoids. F ro m S ectio n 1.3.2 w e recall th a t 2 c / < \ 2 (1.4.8) —n < co < n B y su b stitu tin g fro m (1.4.5) a n d (1.4.6) in to (1.4.8), w e find th a t th e freq u e n cy o f th e co n tin u o u s-tim e sin u so id w h e n sa m p le d a t a ra te Fs = 1 / 7 m u st fall in Sec. 1.4 25 Analog-to-Digitai and Digital-to-Analog Conversion th e ra n a e (1.4.9) or, e q u iv alen tly . T — n F, .< -Q < _Ti F, -----------= = — T (1.4.10) T h e se re la tio n s a re su m m a riz e d in T ab le 1.1. RELATIO NS AM ONG FR E Q U E N C Y VARIABLES Discrete-time sienals Continuous-time sienals co = 2,t f radians cycles sample sample F u .. \ u> = nT ,f=F /F, / / ' ‘ \ 1 Q = radians sec 1A 5 IA TA B LE 1.1 - / q = to/T.F~f- Fs \ \ .................. - ..... .. —tt/T < Q < ,T /r -f-2,/2 5 F < /-;«/- - o c < fi < oc —oc < f-' < oc F ro m th ese re la tio n s w e o b se rv e th at the fu n d a m e n ta l d ifferen ce b etw een c o n tin u o u s-tim e an d d isc rete-tim e signals is in th e ir ran g e of v alu es o f th e fre ­ q u en cy v a riab les F an d / , o r Q and w. P erio d ic sa m p lin g o f a c o n tin u o u s-tim e signal im p lies a m a p p in g of th e infinite freq u e n cy ran g e fo r th e v ariab le F (o r £2) in to a finite fre q u e n c y ran g e for the v ariab le / (o r a>). Since th e highest freq u e n cy in a d isc re te -tim e signal is co — tt o r / = •*, it follow s th a t, w ith a sa m p lin g rate Fs, th e c o rre sp o n d in g h ig h est values o f F and £2 are H _J_ Y ~ 2T (1.4.11) ^max — ft Fs — T h e re fo re , sa m p lin g in tro d u c e s an am b ig u ity , since th e h ig h est fre q u e n c y in a co n tin u o u s-tim e signal th a t can be u n iq u ely d istin g u ish ed w h en such a signal is sa m p le d at a ra te Fs = l / T is Fm&li — F J 2 , o r Qmax = n F s. T o see w h at h a p p e n s to fre q u e n c ie s a b o v e F J 2, let us co n sid er the follow ing ex am p le. Example 1.4.1 The implications of these frequency relations can be fully appreciated by considering the two analog sinusoidal signals xi (!) — cos 2ji(l0)t xi(t) — cos2;r(50)f (1.4.12) 26 Introduction Chap. 1 which are sampled at a rate Fs = 40 Hz. The corresponding discrete-time signals or sequences are (1.4.13) However. cos5,t«/2 = cos(2^n + 7rn/2) — co s7rn /2 . Hence = *i(n)- Thus the sinusoidal signals are identical and, consequently, indistinguishable. If we are given the sampled values generated by cos(7r/'2)n, there is some ambiguity as to whether these sampled values correspond to x\{i) or xz(D- Since x2(r) yields exactly the same values as when the two are sampled at F, — 40 samples per second, we say that the frequency F2 — 50 Hz is an alias of the frequency F\ = 10 Hz at the sampling rate of 40 samples per second. It is im portant to note that F2 is not the only alias of F]. In fact at the sampling rate of 40 samples per second, the frequency F3 = 90 Hz is also an alias of F], as is the frequency F4 = 130 Hz, and so on. All of the sinusoids cos2tt(Fj -f 40k)i. k = 1. 2. 3. 4 . . . . sampled at 40 samples per second, yield identical values. Consequently, they are all aliases of F\ = 10 Hz. In g en eral, th e sam pling o f a c o n tin u o u s-tim e sin u so id al signal x a(t) = A cos(27rF{)/ + 8) (1 .4 .1 4 ) w ith a sam pling rate F v = 1 / T resu lts in a d isc re te -tim e signal x ( n ) = A cos(27r/ 0« -f 6) (1.4.15) w h ere /o = F()/F , is th e re la tiv e fre q u e n c y o f th e sin u so id . If w e assum e th a t - F s /2 < Fo < F J 2 . th e fre q u e n c y f 0 o f x ( n ) is in th e ran g e —^ < /o < L w hich is th e freq u e n cy ran g e fo r d isc re te -tim e signals. In this case, the re la tio n sh ip b etw een Fo an d f {) is o n e -to -o n e , a n d h en ce it is p o ssib le to identify (o r re c o n stru c t) th e a n alo g signal xa (t) from th e sa m p les x ( n) . O n th e o th e r h a n d , if th e sinusoids x a {t) = A c o s (27z F kt + 6) (1.4.16) w h ere Fk = F0 + k F s . k = ± l.± 2 . (1.4.17) are sam p led a t a ra te F,, it is c le a r th a t th e fre q u e n c y F* is o u tsid e th e fu n d a m e n ta l fre q u e n c y ran g e —Fs / 2 < F < F J 2 . C o n se q u e n tly , th e sa m p le d signal is = A c o s (27zn F o / F s + 6 + 2 n k n ) — A c o s ( 2 n f o n + 6) Sec. 1.4 Analog-to-Digital and Digital-to-Analog Conversion 27 w hich is id en tical to th e d isc re te -tim e signal in (1.4.15) o b ta in e d by sam p lin g . (1.4.14). T h u s an infinite n u m b e r of c o n tin u o u s-tim e sin u so id s is re p re se n te d by sa m p lin g th e sa m e d isc re te -tim e signal (i.e.. by th e sam e se t o f sam p le s). C o n ­ se q u e n tly , if w e a re given th e se q u en ce an am b ig u ity exists as to w hich c o n tin u o u s-tim e signal x a(t) th e se v alu es re p re se n t. E q u iv a le n tly , we can say th a t th e fre q u e n c ie s Fk — F o + k F s, —oo < k < oo (k in te g e r) a re in d istin g u ish a b le fro m th e fre q u e n c y Fo a fte r sa m p lin g an d h e n c e th ey are aliases o f Fo. T he re la tio n sh ip b e tw e e n th e fre q u e n c y v a riab les o f th e c o n tin u o u s-tim e a n d d isc rete-tim e signals is illu stra te d in Fig. 1.17. A n ex a m p le o f aliasing is illu stra te d in Fig. 1.18. w h e re tw o sinusoids w ith fre q u e n c ie s F 0 = | H z an d Fj = —| H z yield id en tical sa m p le s w hen a sam p lin g ra te o f Fs — 1 H z is used. F ro m (1.4.17) it easily follow s th a t fo r k = - 1 , Fo = F, + Fs = ( —| + 1) H z = i H z. Figure 1.17 Relationship between the continuous-time and discrete-time fre­ quency variables in the case of periodic sampling. Figure 1.18 Illustration of aliasing. 28 Introduction Chap. 1 Since Fsf2. w hich c o rre sp o n d s to w = tt, is th e hig h est fre q u e n c y th a t can be r e p re s e n te d u n iq u ely w ith a sam p lin g ra te Fs , it is a sim ple m a tte r to d e te rm in e th e m ap p in g o f any (alias) fre q u e n c y above Fs/2 (co — tt) in to th e e q u iv a le n t freq u e n cy b elo w Fs /2. W e can use F J 2 or a) — t t as the p iv o ta l p o in t a n d reflect or “ fo ld ” th e alias freq u e n c y to the ran g e 0 < w < tt. Since th e p o in t o f reflectio n is Fsj 2 (co = t t ) , th e fre q u e n c y F J 2 (cu = re) is called th e f o l d i n g frequency. Example 1.4.2 Consider the analog signal Xait) = 3 cos IOOtt/ (a) Determ ine the minimum sampling rate required to avoid aliasing. (b) Suppose that the signal is sampled at the rate Fs = 200 Hz. What is the discrete-time signal obtained after sampling? (c) Suppose that the signal is sampled at the rate Fs ~ 75 Hz. W hat is the discretetime signal obtained after sampling? (d) What is the frequency 0 < F < FJ2 of a sinusoid that yields samples identical to those obtained in part (c)? Solution (a) The frequency of the analog signal is F — 50 Hz. Hence the minimum sampling rate required to avoid aliasing is Ff = 100 Hz. (b) If the signal is sampled at Fs = 200 Hz. the discrete-time signal is lOOtf TT x{n) = j cos — — n — j cos —n 200 2 (c) If the signal is sampled at F, = 75 Hz. the discrete-time signal is 100?r A tt x(n) — 3 cos —j ^ —n — 3 cos — n — 3 cos —~n 3 (d) For the sampling rate of Fs ~ 75 Hz. we have F = f F, = 7 5 / The frequency of the sinusoid in part (c) is / — |. Hence F = 25 Hz Clearly, the sinusoidal signal ya(i) — 3 cos I n Ft — 3 cos 507ti sampled at Fs — 75 samples/s yields identical samples. H ence F — 50 Hz is an alias of F = 25 Hz for the sampling rate Fs = 75 Hz. Sec. 1.4 Analog-to-Digital and Digital-to-Analog Conversion 29 1.4.2 The Sampling Theorem G iv en an y an a lo g signal, how sh o u ld w e select th e sa m p lin g p e rio d T or, eq u iv ­ alen tly , th e sa m p lin g ra te FJ. T o an sw er this q u e stio n , w e m u st h ave som e in­ fo rm a tio n a b o u t th e c h aracteristics of th e signal to be sa m p le d . In p a rtic u la r, we m u st h av e so m e g e n e ra l in fo rm a tio n c o n cern in g th e fr e q u e n c y con tent o f th e sig­ nal. S uch in fo rm a tio n is g en erally av ailab le to us. F o r e x am p le, w e k n o w g en erally th a t th e m a jo r fre q u e n c y co m p o n e n ts o f a sp eech signal fall b elo w 3000 H z. O n th e o th e r h a n d , telev isio n signals, in g e n eral, c o n ta in im p o rta n t fre q u e n c y co m ­ p o n e n ts u p to 5 M H z. T h e in fo rm a tio n c o n te n t of such signals is c o n ta in e d in th e a m p litu d e s, fre q u e n c ie s, an d p h ases o f the v ario u s fre q u e n c y co m p o n e n ts, b ut d e ta ile d k n o w le d g e o f th e c h aracteristics of such signals is n o t a v a ilab le to us p rio r to o b ta in in g th e signals. In fact, the p u rp o se of p ro cessin g the signals is usually to e x tra c t th is d e ta ile d in fo rm a tio n . H o w ev er, if w e k n o w th e m ax im u m freq u e n cy c o n te n t o f th e g e n e ra l class o f signals (e.g.. th e class of sp e ech signals, the class o f v id eo signals, etc.). w e can specify th e sam pling ra te n ecessa ry to co n v ert the a n alo g signals to dig ital signals. L et us su p p o se th a t any an alo g signal can be r e p re s e n te d as a sum o f sin u so id s o f d iffe re n t a m p litu d e s, freq u e n cies, a n d p h ases, th a t is. N (1.4.18) w h ere N d e n o te s th e n u m b e r o f freq u e n cy c o m p o n e n ts. A ll signals, such as speech an d v id eo , len d th em se lv e s to such a re p re s e n ta tio n o v er an y sh o rt tim e segm ent. T h e a m p litu d e s, freq u e n cies, a n d p h ases usually ch an g e slow ly w ith tim e from one tim e se g m en t to a n o th e r. H o w e v e r, su p p o se th a t th e fre q u e n c ie s do n o t exceed som e k n o w n fre q u e n c y , say Fmax. F o r ex am p le, F max = 3000 H z fo r th e class o f sp e ech signals a n d Fmax = 5 M H z fo r telev isio n signals. Since th e m ax im u m freq u e n cy m ay v ary slightly fro m d iffe re n t re a liz a tio n s am o n g signals of any given class (e.g., it m ay vary slightly from s p e a k e r to sp e a k e r), w e m ay wish to e n su re th a t Fmax d o e s n o t ex ceed som e p re d e te rm in e d v alue by passin g th e an a lo g signal th ro u g h a filter th a t se v ere ly a tte n u a te s freq u e n cy c o m p o n e n ts ab o v e Fmax. T hus we a re c e rta in th a t no signal in the class co n tain s fre q u e n c y c o m p o n e n ts (having significant a m p litu d e o r p o w e r) above Fmax. In p ra c tic e , such filtering is com m only u sed p rio r to sam p lin g . F ro m o u r k n o w led g e o f Fmax, w e can se lect th e a p p ro p ria te sam pling rate. W e k n o w th a t th e h ig h est freq u e n cy in an an alo g signal th a t can be u n a m b ig u ­ ously re c o n s tru c te d w h en th e signal is sa m p le d a t a ra te F, = 1 / T is F J 7. A ny fre q u e n c y a b o v e Fsf 2 o r b elo w - F J 2 resu lts in sa m p le s th a t a re id en tical w ith a c o rre sp o n d in g fre q u e n c y in th e ra n g e — F J 2 < F < Fs/2. T o avoid th e am b ig u ities re su ltin g fro m aliasin g , we m u st se lect th e sa m p lin g ra te to be sufficiently high. T h a t is, w e m u st select F J 2 to be g re a te r th an Fmax. T h u s to avoid th e p ro b le m o f aliasin g , Fs is se le c te d so th a t Fs > 2 Fmax (1.4.19) 30 Introduction Chap. 1 w h ere Fmax is th e larg est fre q u e n c y c o m p o n e n t in the a n a lo g signal. W ith the sa m p lin g ra te se le c te d in this m a n n e r, any fre q u e n c y c o m p o n e n t, say |F ;| < Fmax, in th e an alo g signal is m a p p e d in to a d isc re te -tim e sinusoid w ith a freq u e n cy 1 F 2 Fs ~ 2 1 (1.4.20) o r, eq u iv alen tly , — tt < a)j = 2n f < 7r (1.4.21) S ince, | / | = \ o r \co\ = n is th e h ig h est (u n iq u e ) freq u e n c y in a d isc re te -tim e signal, th e choice o f sam p lin g ra te acco rd in g to (1.4.19) avoids th e p ro b le m of aliasing. In o th e r w o rd s, th e co n d itio n Fs > 2 Fmax e n s u re s th a t all th e sin u so id al c o m p o ­ n e n ts in th e a n a lo g signal are m a p p e d in to c o rre sp o n d in g d isc re te -tim e freq u e n cy c o m p o n e n ts w ith fre q u e n c ie s in th e fu n d a m e n ta l in terv al. T h u s all the freq u e n cy c o m p o n e n ts o f th e a n alo g signal a re re p re s e n te d in sa m p le d fo rm w ith o u t am b i­ guity, a n d h en ce th e an alo g signal can be re c o n stru c te d w ith o u t d isto rtio n from th e sa m p le v alu es u sing an “ a p p r o p ria te ” in te rp o la tio n (d ig ita l-to -a n a lo g c o n v e r­ sio n ) m e th o d . T h e ‘■ ap p ro p riate” o r ideal in te rp o la tio n fo rm u la is specified by the s a m p ling theorem. Sam pling T h eorem . If the h ig h est fre q u e n c y c o n ta in e d in an an alo g signal x a (t) is Fmax = B a n d th e signal is sa m p le d at a ra te F, > 2 F max = 2 B. th e n A.u(r) can b e exactly re c o v e re d fro m its sa m p le values using th e in te rp o la tio n fu n ctio n s i n 2 jr B / 8(t) = 2n B t _ , ( } T h u s jcfl(f) m ay be e x p ressed as * . ( £ ) * ( ' - £ ) (1-4.23) w h ere x a(n / F s ) = x a( n T ) = Jt(rc) a re th e sa m p les o f x a(t). W h en th e sa m p lin g of x a(t) is p e rfo rm e d at the m in im u m sam p lin g ra te Fs = 2 B , th e re c o n stru c tio n fo rm u la in (1.4.23) b eco m es ^ = / n \ sin2nB (t — n flB ) , , ( zb) (1'4 2 4 ) , T h e sa m p lin g r a te F ^ = 2 B = 2 Fmax is called th e N y q u is t rate. F ig u re 1.19 illus­ tra te s th e ideal D /A c o n v ersio n p ro cess using th e in te rp o la tio n fu n c tio n in (1.4.22). A s can b e o b se rv e d from e ith e r (1.4.23) o r (1.4.24), th e re c o n stru c tio n o f x a(t) fro m th e se q u e n c e x ( n ) is a c o m p lic a te d p ro cess, involving a w e ig h te d sum o f the in te rp o la tio n fu n ctio n g (t) an d its tim e -sh ifte d v ersio n s g ( t —n T ) fo r —oo < n < oo, w h ere th e w eig h tin g facto rs a re th e sa m p le s x ( n ) . B e c a u se o f th e co m p lex ity an d th e infinite n u m b e r o f sa m p les re q u ire d in (1.4.23) o r (1.4.24), th e s e re c o n stru c tio n Sec. 1.4 Analog-to-Digital and Digital-to-Analog Conversion 31 sample of ,v„(n (/[ —^ / {ri — l )l fll \’t -r l 11 Figure 1.19 Ideal D /A conversion (interpolation). fo rm u ias are p rim a rily o f th e o re tic a l in te re st. P ra ctical in te rp o la tio n m e th o d s are given in C h a p te r 9. Example 1.4.3 Consider the analog signal xu(r) = 3cos50;rz 10sin300;n —cos 100tt? What is the Nvquist rate for this signal? Solution The frequencies present in the signal above are F = 25 Hz. F: = 150 Hz. F, = 50 Hz Thus Fnm = 150 Hz and according to (1.4.19), F > 2 Fmax = 300 Hz The Nvquist rale is FA = 2 Fm;„. Hence Fs = 300 Hz Discussion It should be observed that the signal component 10sin300;r/. sampled at the Nvquist raie FA- = 300, results in the samples 10 sin 7r/j. which are identically zero. In other words, we are sampling the analog sinusoid at its zero-crossing points, and hence we miss this signal component completely. This situation would not occur if the sinusoid is offset in phase by some am ount 8. In such a case we have lOsinGOOin -ffl) sampled at the Nvquist rate FA- = 300 samples per second, which yields the samples -c o s t t h sin f>) 10 sin(7rn+ ^) = 10(sin n n cos & -+ = lOsin 6 cos nn Thus if 6 ^ 0 or tt, the samples of the sinusoid taken at the Nvquist rate are not all zero. However, we still cannot obtain the correct amplitude from the samples when the phase 9 is unknown. A simple rem edy that avoids this potentially troublesome situation is to sample the analog signal at a rate higher than the Nvquist rate. Example 1.4.4 Consider the analog signal *a(t) = 3cos2000irf + 5 sin6000;rr + lOcos 12.000;?; Introduction Chap. 1 (a) What is the Nvquist rate for this signal? (b) Assume now that we sample this signal using a sampling rate Fs = 5000 samples/s. What is the discrete-time signal obtained after sampling? (c) What is the analog signal y„(r) we can reconstruct from the samples if we use ideal interpolation? — = 2.5 kHz 2 and this is the maximum frequency that can be represented uniquely by the sampled signal. By making use of (1.4.2) we obtain = 3 cos 2jt( j )h + 5 sin 2n- (^ )« + 10 cos 2n(^)n = 3 c o s2 ;r(|)n + 5 sin 2 7 r(l — §)« 4- 10cos2,t(1 4- ^)u = 3cos2jr({)n 4- 5sin27r(—1)« 4- 1 0 c o s 2 ^ (|)« Finally, we obtain x(n) = 13 cos2^({)/i - 5sin27r( = )fl The same result can be obtained using Fig. 1.17. Indeed, since F, = 5 kHz. the folding frequency is FJ2 = 2.5 kHz. This is the maximum frequency that can be represented uniquely by the sampled signal. From (1.4.17) we have Fti = Fk — kFs. Thus Fo can be obtained by subtracting from Fk an integer m ultiple of Fs such that —F t/2 < F0 < F J 2. The frequency F: is less than Fsf2 and thus it is not affected by aliasing. However, the other two frequencies are above the folding frequency and they will be changed by the aliasing effect. Indeed. F'2 = Fj ~ Fs = - 2 kHz f; = Fj — Fs = 1 kHz From (1.4.5) it follows that /] = with the result above. h — and h = ^ which are in agreem ent Sec. 1.4 A nalog-toD igital and Digital-to-Analog Conversion 33 (c) Since only the frequency components at 1 kHz and 2 kHz are present in the sampled signal, the analog signal we can recover is x„(t) = 13 cos 2000^r - 5sin400()-Tf which is obviously different from the original signal x„U). This distortion of the original analog signal was caused by the aliasing effect, due to the low sampling rate used. A lth o u g h aliasin g is a pitfall to be av o id ed , th e re are tw o useful p ractical a p p licatio n s b ased on th e ex p lo itatio n of the aliasing effect. T h e se a p p licatio n s are th e stro b o sc o p e an d the sam pling oscilloscope. B o th in stru m e n ts are d esigned to o p e ra te as aliasin g devices in o rd e r to re p re se n t high fre q u e n c ie s as low f re ­ q u en cies. T o e la b o ra te , co n sid er a signal w ith h ig h -freq u en cy c o m p o n e n ts confined to a given fre q u e n c y b an d B\ < F < B2. w h ere Bz — B\ = B is d efined as the b a n d w id th o f th e signal. W e assum e th a t B < < B\ < B 2. T h is co n d itio n m ean s th a t th e fre q u e n c y c o m p o n e n ts in the signal are m uch larg er th an th e b an d w id th B of th e signal. Such signals are usually called p a ssb a n d or n a rro w b a n d signals. N ow . if this signal is sa m p le d at a rate Fs > 2B. b u t F^ << B\. th e n all th e f re ­ q u en cy c o m p o n e n ts c o n ta in e d in the signal will be aliases of fre q u e n c ie s in the ran g e 0 < F < F J 2 . C o n seq u en tly , if we o b se rv e the freq u e n cy c o n te n t of the signal in th e fu n d a m e n ta l range 0 < F < F J 2 . we k now precisely the freq u e n cy co n te n t o f th e an a lo g signal since we k now the fre q u e n c y b an d B\ < F < B2 u n d e r c o n sid e ra tio n . C o n se q u e n tly , if the signal is a n a rro w b a n d (p a ss b a n d ) signal, we can re c o n stru c t th e o riginal signal from the sam p le s, p ro v id e d th a t the signal is sa m p le d at a ra te Fs > 2 B. w h ere B is th e b an d w id th . T h is s ta te m e n t c o n stitu te s a n o th e r fo rm o f th e sam pling th e o re m , w hich we call the p a s s b a n d f o r m in o rd e r to d istin g u ish it fro m th e p rev io u s form o f the sa m p lin g th e o re m , w hich ap p lies in g en eral to all ty p es of signals. T he la tte r is so m e tim es called th e bas e ban d f or m. T h e p a s s b a n d f o r m o f th e sam pling th e o re m is d escrib ed in d e ta il in S ectio n 9.1.2. 1.4.3 Quantization of Continuous-Amplitude Signals A s w e h av e se en , a dig ital signal is a se q u en ce of n u m b e rs (sa m p le s) in w hich each n u m b e r is re p re s e n te d by a finite n u m b e r of digits (finite p recisio n ). T h e p ro c e ss o f co n v ertin g a d isc rete-tim e c o n tin u o u s-a m p litu d e signal in to a dig ital signal by ex p ressin g each sa m p le value as a finite (in ste a d of an infinite) n u m b e r o f d igits, is called quant izati on. T he e rro r in tro d u c e d in re p re se n tin g th e c o n tin u o u s-v a lu e d signal by a finite set o f d isc rete v alu e levels is called quant i zat i on error o r quant i zat i on noise. W e d e n o te th e q u a n tiz e r o p e ra tio n o n th e sa m p le s x ( n ) as Q[x{n)] an d let x q{n) d e n o te th e se q u en ce o f q u a n tiz e d sam ples a t th e o u tp u t o f th e q u a n tiz e r. H e n ce Xq(n) = Q[x(n)] 34 Introduction Chap. 1 T h e n th e q u a n tiz a tio n e r ro r is a se q u e n c e eq (n) d efin ed as th e d iffe re n c e b etw e e n th e q u a n tiz e d v alu e a n d th e actu al sa m p le value. T h u s eq (n) = x q {n) - x ( n ) W e illu strate th e q u a n tiz a tio n p ro cess w ith a n ex am p le. d isc rete-tim e signal (1.4.25) L e t us co n sid e r the o b ta in e d by sa m p lin g th e an a lo g e x p o n e n tia l signal x a( t) = 0 .9 ', t > 0 w ith a sam p lin g freq u e n cy f , = 1 H z (see Fig. 1.20(a)). O b se rv a tio n o f T a b le 1.2, w hich show s th e v alu es o f th e first 10 sa m p les o f x ( n ) , rev eals th a t th e d e sc rip tio n o f the sam p le v alu e x{n) re q u ire s n significant digits. It is o b v io u s th a t th is signal can n o t (a) Figure 1.20 Illustration of quantization. Sec. 1.4 35 Analog-to-Digital and Digital-to-Analog Conversion TA B LE 1.2 NU M ER IC A L ILLU S TR A TIO N O F Q U A N TIZA TIO N W ITH ONE S IG N IF IC A N T D IG IT USING T R U N C A T IO N O R R O UN DING x,(n ) (Truncation) (Rounding) 1 0.9 1.0 0.9 1.0 0.9 3 4 5 6 7 0.81 0.729 0.6561 0.59049 0.531441 0.4782969 0.8 0.7 0.8 0.7 0.7 8 9 0.43046721 0.387420489 0.4 x ( n) n 0 1 2 D iscrete-tim e signal .voi) 0.6 0.5 0.5 0.4 0.3 0.6 0.5 0.5 0.4 0.4 (Rounding) 0.0 0.0 0.01 - 0.029 - 0.0439 0.00951 - 0.031441 - 0.0217031 0.03046721 0.012579511 be p ro cessed by u sing a c a lcu lato r o r a digital c o m p u te r since only the first few sam p les can be sto re d an d m a n ip u la te d . F o r ex am p le, m ost c alcu lato rs process n u m b e rs w ith only eig h t significant digits. H o w e v e r, let us assum e th a t w e w an t to use only o n e significant digit. To elim in ate th e excess digits, w e can e ith e r sim ply d iscard th em (tru n ca tion ) o r dis­ card th e m bv ro u n d in g th e resu ltin g n u m b e r (ro un din g). T h e resu ltin g q u an tized signals x q (n) a re show n in T ab le 1.2. W e discuss only q u a n tiz a tio n by ro u n d in g , alth o u g h it is ju st as easy to tr e a t tru n c a tio n . T h e ro u n d in g p ro c e ss is g raphically illu stra te d in Fig. 1.20b. T h e values allo w ed in th e digital signal are called the quan tizatio n levels, w h ereas the d istan c e A b etw een tw o successive q u a n tiz a tio n levels is called th e q uantization step siz e o r resolution. T h e ro u n d in g q u a n tiz e r assigns each sa m p le of x ( n ) to th e n e a re s t q u a n tiz a tio n level. In c o n tra st, a q u a n ­ tizer th a t p e rfo rm s tru n c a tio n w ould have assigned each sa m p le of jc(/z) to the q u a n tiz a tio n level b elo w it. T h e q u a n tiz a tio n e r ro r eq (n) in ro u n d in g is lim ited to th e ra n g e of —A /2 to A /2 , th a t is, A A - y <<?,(«)<•f (1A26) In o th e r w o rd s, th e in sta n ta n e o u s q u a n tiz a tio n e r ro r c a n n o t exceed half of the q u a n tiz a tio n ste p (see T a b le 1.2). If jcmjn an d j:max r e p re s e n t th e m in im u m an d m ax im u m v alu e of x (n ) a n d L is th e n u m b e r o f q u a n tiz a tio n levels, th en A = Xmax ~ ^ L - 1 (1.4.27) W e d efin e th e d y n a m i c range of th e signal as jrmax — -*min- 1° o u r ex am p le we h av e Jtmax = 1, Jtmjn = 0, a n d L — 11, w hich leads to A = 0.1. N o te th a t if the d y n am ic ran g e is fixed, in creasin g th e n u m b e r o f q u a n tiz a tio n levels, L resu lts in a d e c re a se o f th e q u a n tiz a tio n ste p size. T h u s th e q u a n tiz a tio n e r ro r d e c re a s e s and th e accu racy o f th e q u a n tiz e r in crease s. In p ra c tic e w e can re d u c e th e q u a n tiz a tio n 36 Introduction Chap. 1 error to an insignificant am ount by choosing a sufficient num ber o f quantization levels. T h eoretically, quantization o f analog signals always resu lts in a loss o f in­ form ation. T his is a result o f the am biguity introduced by quantization. Indeed, quantization is an irreversible or noninvertible process (i.e., a m any-to-on e m ap­ ping) since all sam ples in a distance A /2 about a certain quantization level are assigned the sam e value. This am biguity m akes the exact quantitative analysis of quantization extrem ely difficult. This subject is discussed further in C hapter 9, where w e use statistical analysis. 1.4.4 Quantization of Sinusoidal Signals Figure 1.21 illustrates the sam pling and quantization o f an an alog sinusoidal signal x a (/) = A cos using a rectangular grid. H orizontal lines w ithin the range of the quantizer indicate the allow ed levels o f quantization. V ertical lines indicate the sam pling tim es. Thus, from the original analog signal x a{t) w e obtain a discrete­ tim e signal x ( n ) = x a {nT) by sam pling and a discrete-tim e, discrete-am plitude signal x q ( nT) after quantization. In practice, the staircase sign al xv (r) can be obtained by using a zero-order hold. This analysis is useful b ecau se sinusoids are used as test signals in A /D converters. If the sam pling rate Fs satisfies the sam pling theorem , quantization is the only error in the A /D conversion process. Thus w e can evalu ate the quantization error Time Figure L21 Sampling and quantization of a sinusoidal signal. Sec. 1.4 Analog-to-Digital and Digital-to-Analog Conversion 37 bv q u a n tiz in g th e an alo g signal x„(t) in stead of th e d isc re te -tim e signal a (« ) = x a( nT) . In sp e c tio n o f Fig. 1.21 in d icates th at the signal x u {t) is alm o st lin ear b e tw e e n q u a n tiz a tio n levels (see Fig. 1.22). T he c o rre sp o n d in g q u a n tiz a tio n e rro r eq (t) — x u(t) — x q(t) is show n in Fig. 1.22. In Fig. 1.22. r d e n o te s th e tim e th at x a {t) stay s w ithin th e q u a n tiz a tio n levels. T he m e a n -sq u a re e r ro r p o w e r Pq is Pq = 2 t / e«{!)cJl = 7 j (1.4.28) Since eq (i) = ( A / 2 r ) t . - t < t < t . we have If th e q u a n tiz e r has b bits of accuracy an d the q u a n tiz e r co v ers the e n tire range 2A . th e q u a n tiz a tio n step is A = 2 A / 2 h. H en ce A 2/ 3 P., = (1.4.30) T h e a v erag e p o w e r o f the signal xu(D is 1 f 1' , A2 P, = — / (A cos Qi,i r d i = ~ TP Jo 2 (1.4.31) T h e q u ality o f th e o u tp u t o f the A /D c o n v e rte r is usually m e a s u re d by th e signalto- quanti zati on noise ratio ( S Q N R ) . w hich pro v id es th e ratio o f th e signal p o w er to th e no ise po w er: S Q N R = — = - • 22b P "> ' i/ E x p re s se d in d ecib els (d B ), th e S Q N R is S Q N R (d B ) = 101og1(l S Q N R = 1.76 + 6.026 (1.4.32) T his im p lies th a t th e S Q N R in crease s a p p ro x im ately 6 dB fo r ev ery bit a d d e d to th e w o rd le n g th , th a t is. fo r each d o u b lin g of th e q u a n tiz a tio n levels. A lth o u g h fo rm u la (1.4.32) was d eriv ed fo r sin u so id al signals, w e shall see in C h a p te r 9 th a t a sim ilar resu lt holds fo r every signal w hose d y n am ic ran g e sp a n s the ran g e o f th e q u a n tiz e r. T h is re la tio n sh ip is ex trem ely im p o rta n t b e c a u se it d ictates Figure 1.22 T he quantization error eq (t) — x a (t) - x q (t). 38 Introduction Chap. 1 th e n u m b e r of bits re q u ire d by a specific a p p lic a tio n to assu re a given signal-ton o ise ratio . F o r ex am p le, m o st co m p a c t disc p lay ers use a sa m p lin g freq u e n cy o f 44.1 k H z an d 16-bit sa m p le re so lu tio n , w hich im plies a S Q N R of m o re th an 96 dB . 1.4.5 Coding of Quantized Samples T h e co d in g p ro cess in an A /D c o n v e rte r assigns a u n iq u e b in a ry n u m b e r to each q u a n tiz a tio n level. If we h av e L levels w e n e e d at least L d iffe re n t binary' n u m b ers. W ith a w ord len g th o f b bits w e can c re a te 2b d iffe re n t b in ary n u m b e rs. H e n c e we h av e 2h > L. o r e q u iv alen tly , b > log 2 L. T h u s th e n u m b e r of bits re q u ire d in the co d e r is th e sm allest in te g e r g re a te r th a n o r eq u al to log 2 L. In o u r ex am p le it can easily be seen th a t we n eed a c o d e r w ith b = 4 bits. C o m m ercially av ailab le A /D c o n v e rte rs m ay be o b ta in e d w ith finite p recisio n of b — 16 o r less. G e n e ra lly , the h ig h er th e sam p lin g sp e ed a n d th e fin er th e q u a n tiz a tio n , th e m o re ex p en siv e the d evice becom es. 1.4.6 Digital-to-Analog Conversion Am plifude T o co n v ert a d igital signal in to an an a lo g signal we can use a d ig ital-to -an alo g (D /A ) co n v erter. A s sta te d p rev io u sly , th e task o f a D /A c o n v e rte r is to in te rp o la te b e tw e e n sam ples. T h e sam p lin g th e o re m specifies th e o p tim u m in te rp o la tio n fo r a bandlim ited signal. H o w ev er, this ty p e o f in te rp o la tio n is to o c o m p lic a te d an d . h en ce im p ractical, as in d icated p rev io u sly . F ro m a p ractical v iew p o in t, the sim p lest D /A co n v e rte r is th e z e ro -o rd e r h o ld show n in Fig. 1.15. w hich sim p ly holds c o n sta n t th e v alu e o f o n e sam p le u n til th e n ex t o n e is receiv ed . A d d itio n a l im p ro v e m e n t can b e o b ta in e d by u sing lin e a r in te rp o la tio n as show n in Fig. 1.23 to c o n n e c t successive sa m p les w ith stra ig h t-lin e se g m en ts. T h e z e ro -o rd e r hold an d lin ear in te rp o la to r are an aly zed in S ectio n 9.3. B e tte r in te rp o la tio n can be ach iev ed by u sing m o re so p h isticated h ig h e r-o rd e r in te rp o la tio n tech n iq u es. In g en eral, su b o p tim u m in te rp o la tio n te c h n iq u e s re su lt in p assin g fre q u e n c ie s ab o v e th e fo ld in g freq u e n cy . S uch fre q u e n c y c o m p o n e n ts are u n d e s ira b le a n d are u su ally rem o v ed by p assin g th e o u tp u t o f th e in te rp o la to r th ro u g h a p ro p e r an alo g Sec. 1.5 Summ ary and References 39 filter, w hich is called a postfilter or sm o o th in g filter. T h u s D /A c o n v ersio n usually involves a su b o p tim u m in te rp o la to r follow ed by a p ostfilter. D /A c o n v e rte rs are tre a te d in m o re d e ta il in S ectio n 9.3. 1.4.7 Analysis of Digital Signals and Systems Versus Discrete-Time Signals and Systems W e h av e seen th a t a d igital signal is defin ed as a fu n ctio n o f an in te g e r in d e p e n d e n t v ariab le an d its v alu es are ta k e n from a finite set of po ssib le values. T he usefulness of such signals is a c o n s eq u en ce of th e possibilities o ffe re d by digital co m p u ters. C o m p u te rs o p e ra te on n u m b ers, w hich are re p re s e n te d by a strin g of 0 's an d l's . T h e len g th of th is strin g (w o r d length) is fixed an d finite an d usually is 8. 12. 16. or 32 bits. T h e effe cts o f finite w ord len g th in c o m p u ta tio n s cause co m p licatio n s in th e an aly sis of d ig ital signal p ro cessin g system s. T o avoid th ese co m p licatio n s, we neg lect th e q u a n tiz e d n a tu re of digital signals an d system s in m uch o f o u r analysis an d c o n sid e r th em as d isc rete-tim e signals an d system s. In C h a p te rs 6 . 7. and 9 we in v estig ate th e c o n se q u e n c e s o f using a finite w ord len g th . T h is is an im p o rta n t topic, since m any digital signal p ro cessin g p ro b lem s are solved w ith sm all c o m p u te rs o r m icro p ro cesso rs th at em p lo y fix ed -p o in t arith m etic. C o n se q u e n tly , o n e m ust look carefully at the p ro b le m of fin ite-p recisio n arith m e tic an d a c c o u n t for it in th e design of so ftw are an d h a rd w a re th at p e rfo rm s the d esired signal p ro cessin g tasks. 1.5 SUMMARY AND REFERENCES In th is in tro d u c to ry c h a p te r w e have a tte m p te d to p ro v id e the m o tiv a tio n for digital signal p ro cessin g as an a lte rn a tiv e to a n a lo g signal pro cessin g . W e p re se n te d the basic e le m e n ts o f a digital signal p ro cessin g system an d d efin ed th e o p e ra tio n s n e e d e d to c o n v e rt an an alo g signal in to a digital signal re a d y fo r processing. O f p a rtic u la r im p o rta n c e is the sam pling th e o re m , w hich w as in tro d u c e d by N vquist (1928) an d la te r p o p u la riz e d in the classic p a p e r by S h a n n o n (1949). T h e sam pling th e o re m as d e sc rib e d in S ection 1.4.2 is d eriv ed in C h a p te r 4. S in u so id al signals w ere in tro d u c e d p rim a rily fo r the p u rp o se of illu stra tin g th e aliasin g p h e n o m e n o n an d fo r th e s u b s e q u e n t d e v e lo p m e n t o f th e sa m p lin g th e o re m . Q u a n tiz a tio n effects th a t are in h e re n t in the A /D co n v e rsio n of a signal w ere also in tro d u c e d in th is c h a p te r. Signal q u a n tiz a tio n is b est tre a te d in statistical term s, as d esc rib e d in C h a p te rs 6 , 7. an d 9. F in ally , th e to p ic o f signal re c o n stru c tio n , o r D /A co n v e rsio n , w as d escrib ed briefly. Signal re c o n stru c tio n b ased on sta ircase o r lin e a r in te rp o la tio n m eth o d s is tre a te d in S ectio n 9.3. T h e re a re n u m e ro u s p ractical a p p lic a tio n s of d igital signal processing. T he b o o k e d ite d by O p p e n h e im (1978) tre a ts a p p lic a tio n s to sp e ech p rocessing, im age p ro cessin g , ra d a r signal pro cessin g , so n a r signal p ro cessin g , a n d g eophysical signal p ro cessin g . 40 Introduction Chap. 1 PROBLEMS LI Classify the following signals according to whether they are (1) one- or multi­ dimensional; (2) single or multichannel, (3) continuous time or discrete time, and (4) analog or digital (in amplitude). Give a brief explanation. (a) Closing prices of utility stocks on the New York Stock Exchange. (b) A color movie. (c) Position of the steering wheel of a car in motion relative to car’s reference frame. (d) Position of the steering wheel of a car in motion relative to ground reference frame. (e) Weight and height measurem ents of a child taken every month. 1.2 D eterm ine which of the following sinusoids are periodic and com pute their funda­ mental period. 30n \ ( 62m (a) cosO.OIjt/i (b) c°s n ——- I (c) cos 3™ (d) sin3« (e) sin 105 / ' ' V 10 1 3 Determ ine whether or not each of the following signals is periodic. In case a signal is periodic, specify its fundamental period. (a) xu(r) — 3cos(5r + 7r/6) (b) = 3 cos(5n + ;r/6) (c) j:(h) = 2 e x p [j(n /6 - 7i)] (d) x(n) = cos(«/8) cos(?rn/8) (e) x(n) = cos(7rn/2) — sin(7rn/8) + 3cos(jrn/4 + 7t / 3) 1.4 (a) Show that the fundamental period Nr of the signals ,s>(«) = ei2nkr,IN. * = 0 .1 .2 ,... is given by Np = N / C C D ( k . N ), where GCD is the greatest common divisor of k and N. (b) What is the fundam ental period of this set for N =71 (c) What is it for N = 16? 1.5 Consider the following analog sinusoidal signal: xa(t) — 3 sin(1007rr) (a) Sketch the signal xa{t) for 0 < t < 30 ms. (b) The signal xa(t) is sampled with a sampling rate Fs = 300 samples/s. Determ ine the frequency of the discrete-time signal x{n) = xa( nT), T = 1 /F„. and show that it is periodic. (c) Compute the sample values in one period of .x(n). Sketch _*<n) on the same diagram with x„(t). W hat is the period of the discrete-time signal in milliseconds? (d) Can you find a sampling rate Fs such that the signal x(n) reaches its peak value of 3? W hat is the minimum Fs suitable for this task? L6 A continuous-time sinusoid xa(t) with fundamental period Tp = 1/F0 is sampled at a rate F, = 1/ T to produce a discrete-time sinusoid x(n) = x„(,nT). (») Show that x(n) is periodic if T / T p = k / N (i.e., T/ T p is a rational num ber). (b) If x(n) is periodic, what is its fundam ental period Tp in seconds? Chap. 1 41 Problem s (c) Explain the statement: ,r(n) is periodic if its fundamental period Tr . in seconds, is equal to an integer number of periods of .v„u). 1.7 An analog signal contains frequencies up to 10 kHz. (a) W hat range of sampling frequencies allows exact reconstruction of this signal from its samples? (b ) Suppose that we sample this signal with a sampling frequency F, = 8 kHz. Ex­ amine what happens to the frequency F| = 5 kHz. (c) Repeat part (b) for a frequency F> = 9 kHz. 1.8 An analog electrocardiogram (ECG) signal contains useful frequencies up to 100 Hz. (a) W hat is the Nvquist rate for this signal? (b ) Suppose that we sample this signal at a rate of 250 samples/s. What is the highest frequency that can be represented uniquely at this sampling rate? 1.9 An analog signal a „ u ) = sin(480;rr) + 3sin(720:rr) is sampled 600 times per second. (a) D eterm ine the Nvquist sampling rate for x a{t). (b ) D eterm ine the folding frequency. (c) What are the frequencies, in radians, in the resulting discrete time signal t (/j )? (d) If is passed through an ideal D/A converter, what is the reconstructed signal v„(n? 1.10 A digital communication link carries binary-coded words representing samples of an input signal (t) — 3 cos 600.7 r 2 cos 1800jt / The link is operated at 10.000 bits/s and each input sample is quantized into 1024 different voltage levels. (a) W hat is the sampling frequency and the folding frequency? ( b ) W hat is the Nvquist rate for the signal .*„(;)? (c) What are the frequencies in the resulting discrete-time signal x(n)7 (d) W hat is the resolution A? 1.11 Consider the simple signal processing system shown in Fig. P I.11. The sampling periods of the A/D and D /A converters are T = 5 ms and T' = 1 ms. respectively. Determ ine the output v„U) of the system, if the input is a:„(n = 3 cos 100;rf -+- 2 sin 250;rt (t in seconds) The postfilter removes any frequency component above F J 2. Figure P l . l l 1.12 (a) Derive the expression for the discrete-time signal .r(n) in Example 1.4.2 using the periodicity properties of sinusoidal functions. (b) W hat is the analog signal we can obtain from x(n) if in the reconstruction process we assume that Fs = 10 kHz? 42 Introduction Chap. 1 1.13 The discrete-time signal x(n) = 6.35cos(jr/10)n is quantized with a resolution (a) A = 0.1 or (b) A = 0.02. How many bits are required in the A/D converter in each case? 1.14 D eterm ine the bit rate and the resolution in the sampling of a seismic signal with dynamic range of 1 volt if the sampling rate is Fs = 20 samples/s and we use an S-bit A/D converter? W hat is the maximum frequency that can be present in the resulting digital seismic signal? 1.15* Sampling o f sinusoidal signals: aliasing Consider the following continuous-time si­ nusoidal signal XoO) = sin 2jr/r0f, —oc < t < oo Since xa(t) is described m athematically, its sampled version can be described by values every T seconds. The sampled signal is described by the formula where Fs = l / T is the sampling frequency. (a) Plot the signal j:(n), 0 < n < 99 for F, = 5 kHz and Fu = 0.5, 2, 3, and 4.5 kHz. Explain the similarities and differences am ong the various plots. (b) Suppose that F0 = 2 kHz and Fs = 50 kHz. (1) Plot the signal x(n). W hat is the frequency / (l of the signal je(n)? (2) Plot the signal v(n) created by taking the even-numbered samples of x(n). Is this a sinusoidal signal? Why? If so, what is its frequency? 1.16* Quantization error in A /D conversion o f a sinuoidal signal Let xq(n) be the signal obtained by quantizing the signal x(n) = sin27r/on. The quantization error power PQ is defined by The “quality” of the quantized signal can be measured by the signal-to-quantization noise ratio (SQ NR) defined by SQ N R = 10 log,0 “a where Px is the power of the unquantized signal x (n). («) For /o = 1/50 and N = 200, write a program to quantize the signal Jt(n), using truncation, to 64, 128, and 256 quantization levels. In each case plot the signals x (n), Xq(n), and e(n) and com pute the corresponding SQNR. (b) Repeat part (a) by using rounding instead of truncation. (c) Comment on the results obtained in parts (a) and (b). (d) Compare the experimentally m easured SQNR with the theoretical SQNR pre­ dicted by formula (1.4.32) and com m ent on the differences and similarities. 2 Discrete-Time Signals and Systems In C h a p te r 1 w e in tro d u c e d th e re a d e r to a n u m b e r o f im p o rta n t ty p es o f signals an d d escrib ed th e sa m p lin g p ro cess bv w hich an a n a lo g signal is c o n v e rte d to a d isc rete-tim e signal. In a d d itio n , we p re s e n te d in so m e d etail th e c h a racteristics o f d isc re te -tim e sin u so id al signals. T h e sin u so id is an im p o rta n t e le m e n ta ry signal th a t se rv es as a b asic b u ild in g block in m o re co m p lex signals. H o w e v e r, th e re are o th e r e le m e n ta ry signals th a t are im p o rta n t in o u r tr e a tm e n t o f signal processing. T h ese d isc re te -tim e signals a re in tro d u c e d in this c h a p te r a n d are used as basis fu n ctio n s o r b u ild in g b locks 1o d escrib e m o re com plex signals. T h e m a jo r e m p h asis in this c h a p te r is th e c h a ra c te riz a tio n o f d isc rete-tim e sy stem s in g en era! a n d the class o f lin ear tim e -in v a ria n t (L T I) system s in p articu lar. A n u m b e r o f im p o rta n t tim e-d o m ain p ro p e rtie s o f L T I sy stem s a re d efined and d e v e lo p e d , an d an im p o rta n t fo rm u la, called th e c o n v o lu tio n fo rm u la, is d eriv ed w hich allow s us to d e te rm in e th e o u tp u t of an L T I system to any given a rb itra ry in p u t signal. In a d d itio n to th e c o n v o lu tio n fo rm u la , d iffe re n c e e q u a tio n s are in ­ tro d u c e d as an a lte rn a tiv e m e th o d fo r describ in g th e in p u t- o u tp u t re la tio n sh ip of an L T I sy stem , an d in a d d itio n , recursive an d n o n re c u rsiv e re a liz a tio n s of LTI sy stem s are tre a te d . O u r m o tiv a tio n fo r th e em p h asis on th e stu d y o f L T I sy stem s is tw ofold. F irst, th e re is a larg e co llectio n o f m a th e m a tic a l te c h n iq u e s th a t can be ap p lied to the an aly sis o f L T I system s. S eco n d , m an y p ractical system s a re e ith e r L T I system s o r can b e a p p ro x im a te d by L T I system s. B ecau se of its im p o rta n c e in digital signal p ro cessin g a p p licatio n s an d its close re se m b la n c e to th e co n v o lu tio n form ula, we also in tro d u c e th e c o rre la tio n b e tw e e n tw o signals. T h e a u to c o rre la tio n and c ro ssc o rre la tio n o f signals a re defined an d th e ir p ro p e rtie s a re p re se n te d . 2.1 DISCRETE-TIME SIGNALS A s w e d iscu ssed in C h a p te r 1, a d isc re te -tim e signal x{n) is a fu n ctio n o f an in d e ­ p e n d e n t v a ria b le th a t is an in teg er. It is g rap h ically re p re s e n te d as in Fig. 2.1. It is im p o rta n t to n o te th a t a d isc re te -tim e signal is n o t defined at in sta n ts b etw een 43 44 Discrete-Time Signals and Systems Figure 2-1 Chap. 2 Graphical representation of a discrete-time signal. tw o successive sam p les. A lso , it is in c o rre c t to th in k th a t .v(n) is e q u a l to z e ro if n is n o t an in teg er. S im ply, th e signal x ( n ) is n o t defin ed fo r n o n in te g e r v alu es o f n. In th e se q u el w e will assu m e th a t a d isc re te -tim e signal is d efin ed fo r every in te g e r value n fo r —oo < n < oc. By tra d itio n , w e re fe r to x( n) as th e “n th sa m p le ” o f th e signal ev en if th e signal x( n) is in h e re n tly d isc re te tim e (i.e., n ot o b ta in e d by sam p lin g an a n a lo g signal). If, in d e e d , x ( n) w as o b ta in e d fro m sa m p lin g an a n alo g signal x a( t ), th e n .i(n ) = x a( nT) , w h ere T is th e sa m p lin g p e rio d (i.e., th e tim e b etw e e n successive sam p les). B e sid es th e g rap h ical re p re s e n ta tio n of a d isc re te -tim e signal o r se q u e n c e as illu strated in Fig. 2.1. th e re a re som e a lte rn a tiv e re p re s e n ta tio n s th at are o ften m o re co n v e n ie n t to use. T h e se are: 1. F u n ctio n al re p re s e n ta tio n , such as x(n) — f 1, fo r n = 1, 3 [ 0, else w h e re I4, fo r n = 2 (2 . 1.1) 2. T a b u la r r e p re s e n ta tio n , such as n ••• -2 -1 0 1 2 3 4 5 x ( n) ■■■ 0 0 0 1 4 1 0 0 3. S eq u en ce re p re s e n ta tio n A n in fin ite -d u ra tio n signal o r se q u e n c e w ith th e tim e o rig in (n = 0) in d ic a te d by th e sy m b o l | is re p re s e n te d as *<n) = { . . . 0 . 0 . 1 . 4 , 1 . 0 , 0 , . . . } T (2.1.2) A se q u e n c e j:(n ), w hich is z e ro fo r n < 0, can be re p re s e n te d as jc(«) = { 0 ,1 .4 .1 .0 .0 ....} T (2.1.3) T h e tim e o rig in fo r a se q u e n c e x ( n ) , w hich is z e ro fo r n < 0, is u n d e rs to o d to be th e first (le ftm o st) p o in t in th e seq u en ce. Sec. 2.1 45 Discrete-Time Signals A fin ite -d u ra tio n se q u e n c e can be re p re se n te d as T x i n) = {3. - 1 . - 2 . 5 .0 .4 . -1 } (2.1.4) w h ereas a fin ite -d u ra tio n se q u e n c e th a t satisfies the c o n d itio n x(/i) ~ 0 for n < 0 can be r e p re s e n te d as T jc(n) = { 0 .1 .4 . 1) (2.1.5) T h e signal in (2.1.4) co n sists of seven sa m p le s or p o in ts (in tim e), so it is called or id en tified as a se v e n -p o in t se q u e n c e . S im ilarly, the se q u e n c e given by (2.1.5) is a f o u r-p o in t se q u e n c e . 2.1.1 Some Elementary Discrete-Time Signals In o u r stu d y o f d isc re te -tim e signals an d system s th e re a re a n u m b e r o f b asic signals th at a p p e a r o ften a n d play an im p o rta n t role. T h ese signals a re d efin ed below . 1. T h e unit s a m p l e se quence is d e n o te d as <5(n) an d is defin ed as <5( / i ) = 0. for n - 0 for n ^ 0 ( 2 . 1. 6 ) In w o rd s, th e u n it sa m p le se q u e n c e is a signal th at is zero e v erv w h ere, ex cep t a t n — 0 w h e re its value is unity. T his signal is so m e tim e s re fe rre d to as a unit impul se. In c o n tra st to the an alo g signal 8(t). w hich is also called a u n it im p u lse an d is d efin ed to be ze ro ev ery w h ere ex cep t / = 0. an d has unit a re a , th e u n it sa m p le se q u e n c e is m uch less m ath e m a tic a lly c o m p licated . T he g rap h ical re p re s e n ta tio n o f <5(n ) is show n in Fig. 2.2. 2. T h e unil step signal is d e n o te d a s w (n ) an d is defin ed as u(n) = 1. 0. fo r n > 0 fo r n < 0 (2.1.7) F ig u re 2.3 illu stra te s th e u nit ste p signal. 3. T h e uni t r a m p signal is d e n o te d as u r (n) an d is d efin ed as u r (n) - fo r n > 0 fo r n < 0 ( 2 . 1. T h is signal is illu stra te d in Fig. 2.4. fi(n) Figure 2.2 G raphical rep resen tatio n of the unit sample signal. 46 Discrete-Tim e Signals and Systems Chap. 2 u(n) T 0 12 3 4 5 6 7 n Figure 2 3 G raphical rep resen tatio n of the unit step signal. n Figure 2,4 G raphical rep resen tatio n of the unit ram p signal. ur(n) T 4. T h e exponent i al signal is a se q u e n c e o f th e fo rm jr(n) = a ” fo r all n (2.1.9) If th e p a r a m e te r a is real, th e n jr(n) is a real signal. F ig u re 2.5 illu stra te s x ( n) fo r v ario u s v alu es o f th e p a r a m e te r a. W h en th e p a ra m e te r a is co m p lex v a lu e d , it can b e e x p re ss e d as a s rejf1 w h e re r an d 6 a re n o w th e p a ra m e te rs. H e n c e w e c a n e x p ress x ( n ) as x ( n ) = r nej0n (2 . 1. 10 ) = r n (cos On -j- y s in # n ) TiinilU Figure 2.5 G raphical representation of exponential signals. Sec. 2.1 47 Discrete-Time Signals Since x (/j ) is now co m plex valu ed , it can be re p re s e n te d g rap h ically by p lo ttin g th e real p a rt x K(n) = r" cos6#fi (2.1.11) as a fu n ctio n of n. an d se p a ra te ly p lo ttin g th e im ag in ary p a rt xi (n) = r ’1sin 6n (2.1.12) as a fu n ctio n o f n. F ig u re 2.6 illu strates th e g ra p h s o f x R(n) a n d x / ( n ) for r — 0.9 an d 6 = tt/1 0 . W e o b se rv e th a t th e signals x R(?i) a n d x / ( n ) a re a d a m p e d (decaying e x p o n e n tia l) co sin e fu n ctio n an d a d a m p e d sine fu n c tio n . T h e angle v ariab le 6 is sim ply th e freq u e n c y of th e sinusoid, p rev io u sly d e n o te d by th e (n o rm alized ) fre q u e n c y v ariab le w. C learly, if r — 1. th e d a m p in g d is a p p e a rs an d x K(n). x/ ( n). an d A'(n) h av e a fixed am p litu d e, w hich is unity. A lte rn a tiv e ly , th e signal .*(/?) given by (2.1.10) can be re p re s e n te d g raphically by th e a m p litu d e fu n ctio n |.i(h )| = A{n) = r ” (2.1.13) _ v (/;) = <f>{n) = Bn (2.1.14) an d th e p h ase fu n ctio n F ig u re 2.7 illu stra te s -4(/?) an d 0 (/i) fo r r — 0.9 a n d B = ,t/1 0 . W e o b se rv e th at th e p h ase fu n ctio n is lin ear w ith n. H o w ev er, th e p h ase is d efin e d only o v e r the in terv al —n < B < t t o r. eq u iv alen tly , o v er th e in terv al 0 < 6 < 2 t t . C o n seq u en tly , by co n v e n tio n 4>(n) is p lo tte d o v er th e finite in terv al —n < B < t t o t Q < $ < 2tt. In o th e r w o rd s, w e su b tra c t m u ltip lies o f I n fro m <p(n) b e fo re p lo ttin g . In one case. <p(n) is c o n s tra in e d to th e range —n < 0 < n a n d in th e o th e r case <p(n) is c o n stra in e d to th e ran g e 0 < fi < 2n. T h e su b tra c tio n o f m u ltip le s o f 2n from <p(n) is e q u iv a le n t to in te rp re tin g th e fu n ctio n 4>(n) as 4>{n), m o d u lo 2n. T he g rap h for <p{n). m o d u lo 2n . is show n in Fig. 2.7b. 2.1.2 Classification of Discrete-Time Signals T h e m a th e m a tic a l m e th o d s e m p lo y ed in th e analysis of d isc re te -tim e signals and system s d e p e n d on th e c h aracteristics o f th e signals. In this se ctio n we classify d isc rete-tim e signals acco rd in g to a n u m b e r of d iffe re n t c h aracteristics. Energy signals and power signals. T h e en e rg y £ of a signal x( n ) is d efin ed as OC E= |jc(n)|2 (2.1.15) n=-oc W e h av e u se d th e m a g n itu d e -sq u a re d v alu es o f jr(n), so th a t o u r d efin itio n applies to c o m p le x -v a lu e d signals as w ell as re a l-v a lu e d signals. T h e e n e rg y of a signal can be fin ite o r in fin ite. If E is finite (i.e., 0 < E < oo), th e n x ( n ) is called an energy Figure 2.6 signal. G raph of the real and im aginary com ponents of a com plex-valued exponential Sec. 2.1 49 Discrete-Time Signals -1 0 1 2 3 4 5 b 11 ~ S 9 (a* Gra ph of A {n I = r" . r = 0.9 ( b t G r a p h ol ^ n . m o d u l o 2ir p l o n e d in t h e r a n g e I—t t , it I Figure 2.7 G r a p h o f a m p l i tu d e and p h a s e function of a co m p l e x -v a l u e d e x p o n e n ­ tial sicnal: ( a ) gr ap h of A i m = r " . 4 = 0 . 9 : ( b ) g rap h of c/>in) = I . t / I O v j . m o d u lo 2ji p lo tt e d in the ran ge i - j i . t t J . signal. S o m etim es w e add a su b scrip t .v to £ an d w rite £ , to em p h asize th a t £ , is the en e rg y o f th e signal x( n). M anv signals th a t possess infinite en erg y , h av e a finite av e ra g e p o w er. T he av erag e p o w e r o f a d isc re te -tim e signal x( n) is defin ed as P = 1 lim ■**— 2 N -j- 1 n - — -,\ (2 .1.1 6) If we define th e signal en e rg y o f x(?i) o v er th e finite in terv al —N < n < N as (2.1.17) th e n w e can e x p ress th e signal energy £ as £ = lim £/v' ,\ —oc (2.1.18) an d th e a v erag e p o w e r o f th e signal x ( n ) as 1 En P = lim n -+x 2 N + 1 (2.1.19) 50 Discrete-Tim e Signals and Systems Chap. 2 C learly , if E is finite. P = 0. O n th e o th e r h a n d , if E is infinite, th e av erag e p o w e r P m ay be e ith e r finite o r infinite. If P is finite (an d n o n z e ro ), th e signal is called a p o w e r signal. T h e follow ing e x am p le illu stra te s such a signal. Example 2.1.1 Determ ine the power and energy of the unit step sequence. The average power of the unit step signal is = N + 1 lim -------------- A1-** 2 N 1 1 + l/N 1 lim ------------- --- - a—9c 2 4- l / N 2 Consequently, the unit step sequence is a power signal. Its energy is infinite. Sim ilarly, it can b e show n th a t th e co m p lex e x p o n e n tia l se q u e n c e x(n') = A e JUJan h as av erag e p o w e r A 2, so it is a p o w e r signal. O n th e o th e r h an d , th e unit ra m p se q u en ce is n e ith e r a p o w e r signal n o r an en e rg y signal. Periodic signals and aperiodic signals. A s d efin e d o n S ection 1.3, a signal x( n ) is p erio d ic w ith p e rio d N ( N > 0) if a n d only if x( n + N ) = x( n ) fo r all n (2 . 1.20 ) T h e sm allest v alu e o f N fo r w hich (2.1.20) h o ld s is called th e (fu n d a m e n ta l) p erio d . If th e re is no v alu e o f N th a t satisfies (2.1.20), th e signal is called nonper i odi c or aperiodic. W e h av e a lread y o b se rv e d th a t th e sin u so id al signal o f th e form x ( n) = A sin 2n f o n ( 2 . 1 .21 ) is p e rio d ic w h en /J, is a ra tio n a l n u m b e r, th a t is, if /o can be e x p re sse d as (2 .1.22 ) w h ere k an d N a re integers. T h e e n erg y o f a p erio d ic signal x ( n ) o v e r a single p e rio d , say. o v er th e in terv al 0 5 n < N - 1, is fin ite if x («) ta k e s on finite v alu es o v e r th e p e rio d . H o w ev er, the e n e rg y o f th e p e rio d ic signal fo r —oc < n < oo is infinite. O n th e o th e r h an d , the a v e ra g e p o w e r o f th e p erio d ic signal is finite an d it is e q u a l to th e av erag e p o w er o v e r a single p e rio d . T h u s if x («) is a p e rio d ic signal w ith fu n d a m e n ta l p e rio d N an d ta k e s o n fin ite v alues, its p o w e r is g iven by (2.1.23) n=0 C o n s e q u e n tly , p erio d ic signals are p o w e r signals. Sec. 2.1 Discrete-Time Signals 51 Symmetric (even) and antisymmetric (odd) signals. A real v a lu ed sig­ n al x ( n ) is called sy m m etric (ev en ) if j r ( - n ) = j («) (2.1.24) O n th e o th e r h a n d , a signal x ( n ) is called a n tisy m m etric (o d d ) if .v( - h ) = - x ( n ) (2.1.25) W e n o te th a t if .v(/7) is odd, th e n x(0) = 0. E x am p le s o f signals w ith ev en an d odd sy m m etry are illu stra te d in Fig. 2.8. W e w ish to illu strate th a t any a rb itra ry signal can be e x p re sse d as th e sum of tw o signal c o m p o n e n ts , o n e o f w hich is even an d th e o th e r o d d . T h e ev en signal co m p o n e n t is fo rm e d by ad d in g x(/i) to x ( —n) and div id in g by 2. th a t is. = j[.v{7!) + x ( - » ) ] (2.1.26) .v(n] <' 4► T !I j T ] ! • l M ! .................... * ll -4-3-2-I 0 12 3 4 i, (a) .r(n) • - 5 - 4 - 3 - 2 -1 .ill' 12 3 4 5 <> (b) Figure 2.8 Exam ple of even (a) and odd (b) signals. rt 52 Discrete-Time Signals and Systems Chap. 2 Clearly, x e(n) satisfies the sym m etry con d ition (2.1.24). Sim ilarly, w e form an odd signal com p onent x„(n) according to the relation x„(n) = j[.x(n) - * ( - / i ) ] (2.1.27) A gain , it is clear that x 0(n) satisfies (2.1.25); hence it is in d eed odd. N ow , if we add the tw o signal com p onents, defined by (2.1.26) and (2.1.27), w e ob tain ;c(n), that is, *(n ) = x e(n) + x n{n) (2.1.28) Thus any arbitrary signal can be exp ressed as in (2.1.28). 2.1.3 Simple Manipulations of Discrete-Time Signals In this section w e consider som e sim ple m odifications or m anipulations involving the in d ep en dent variable and the signal am plitude (depend en t variable). Transformation of the independent variable (time). A signal x ( n ) may be shifted in tim e by replacing the in d ep en dent variable n by n — k, w here k is an integer. If A: is a positive integer, the tim e shift results in a delay of the signal by k units o f tim e. If k is a negative integer, the tim e shift results in an advance of the signal by \k\ units in time. Example 2.L2 A signal x ( n ) is graphically illustrated in Fig. 2.9a. Show a graphical representation of the signals x ( n — 3) and x ( n -I- 2). Solution The signal x (/i —3) is obtained by delaying ;t(n) by three units in time. The result is illustrated in Fig. 2.9b. On the other hand, the signal x(n + 2 ) is obtained by advancing x ( n ) by two units in time. The result is illustrated in Fig. 2.9c. Note that delay corresponds to shifting a signal to the right, whereas advance implies shifting the signal to the left on the time axis. If the signal x ( n ) is stored on m agnetic tape or on a disk or, perhaps, in the m em ory o f a com puter, it is a relatively sim ple operation to m odify the base by introducing a delay or an advance. O n the other hand, if the signal is not stored but is b ein g generated by som e physical p h en om en on in real tim e, it is not p ossible to advance the signal in tim e, since such an op eration in volves signal sam ples that have not yet b een generated. W hereas it is alw ays possib le to insert a delay into signal sam ples that have already b een generated, it is physically im possible to view the future signal sam ples. C on sequ en tly, in real-tim e signal processing applications, the operation o f advancing the tim e base o f the signal is physically unrealizable. A n o th er useful m odification o f the tim e base is to replace th e in d ep en dent variable n by —n. T h e result o f this op eration is a f o l d i n g or a reflection o f the signal about the tim e origin n = 0. Sec. 2.1 53 Discrete-Time Signals xin) 4 i ■j— 1— I —4 —3 —2 — 1 0 1 2 3 4 x i n - 3) il T -l 0 1 2 3 4 S 6 (b) xin +2) - 6 - 5 - 4 -3 - 2 - 1 0 Figure 2.9 Graphical representation of a signal, and its delayed and advanced versions. 1 Example 2.1.3 Show the graphical representation of the signal x { - n ) and x i - n + 2). where x ( n ) is the signal illustrated in Fig. 2.10a. The new signal yin) = x ( —n) is shown in Fig. 2.10b. Note that y(0) = *(0). v ( l ) = x( — 1). y(2) = _t( —2). and so on. Also, y (—1) = jc(1 ) , v(—2) = x(2), and so on. Solution Therefore, yin) is simply xin) reflected or folded about the lime origin n = 0. The signal yin) — x ( —n ■ + • 2) is simply x ( —n) delayed by two units in time. The resulting signal is illustrated in Fig. 2.10c. A simple way to verify that the result in Fig. 2.10c is correct is to compute samples, such as y(0) = *(2), y (l) = jc(1 >, v(2) = ;t(0), v(—1) = jr(3). and so on. It is im p o rta n t to n o te th a t th e o p e ra tio n s o f folding an d tim e d elay in g (o r ad v an cin g ) a signal a re n o t co m m u ta tiv e . If we d e n o te th e tim e-d e la y o p e ra tio n by T D a n d th e fo ld in g o p e ra tio n by F D . we can w rite T D i[jc(n )l = jc(n - k) k > 0 (2.1.29) FD [jc(/j)] = x ( —n) N ow T D A(FD[.r(n)]l = T D *[.t(-n)] = x ( - n + k) (2.1.30) 54 Discrete-Time Signals and Systems Chap. 2 y(n) = x(-n + 2) -2 -1 in 0 1 2 3 4 5 (c) Figure 2.10 Graphical illustration of the folding and shifting operations. w hereas F D {T D i[j:(n )]} = FD[j:(/i — &)] = x ( —n — k ) (2.1.31) N o te that becau se the signs o f n and k in x { n —k) and Jt(-n + ik ) are different, the re­ sult is a shift o f the signals x ( n ) and x ( —n) to the right by k sam p les, corresponding to a tim e delay. A third m odification o f the in d ep en dent variable in volves replacing n by fin, w here /x is an integer. W e refer to this tim e-b ase m odification as time scaling or dow nsam pling. Example 2.L4 Show the graphical representation of the signal y(n) = x(2n), where x(n) is the signal illustrated in Fig. 2.11a. Solution We note that the signal y(n) is obtained from x(n) by taking every other sample from jc(«), starting with x(0). Thus y(0) = x(0), y{l) = x(2), y(2) = jc(4), and y ( - l ) = x(~ 2 ), y ( -2 ) = jc(—4), and so on. In other words, we have skipped Sec. 2.1 55 Discrete-Time Signals v(n) = .v(2n) I -4 I ! -2 0 I 2 3 (b) Figure 2.11 Graphical illustration ot down-samplinc operation. the odd-num bered samples in *(«) and retained the even-num bered samples. The resulting signal is illustrated in Fig. 2.11b. If th e signal ,\ («) w as o riginally o b ta in e d by sa m p lin g an a n a lo g signal x a(t), th e n jc(«) = Xa(nT), w h ere T is the sa m p lin g in terv al. Nowr. v(n) = x ( 2n) = x a(2Tn). H e n c e th e tim e-scalin g o p e ra tio n d escrib ed in E x a m p le 2.1.4 is e q u iv a le n t to ch an g in g th e sam p lin g ra te from 1 /T to 1/27". th a t is, to d e c re a s in g the ra te by a facto r o f 2. T h is is a d o w n s a mp l i n g o p e ra tio n . Addition, multiplication, and scaling of sequences. A m p litu d e m o d ifi­ catio n s in clu d e addition, multiplication, an d scaling o f d isc re te -tim e signals. A m p l i t u d e scaling o f a signal by a c o n sta n t A is acco m p lish ed by m u ltiplying th e v alu e o f ev ery signal sa m p le by A. C o n se q u e n tly , w e o b ta in v(n) = Ax ( n ) — oc < fi < oc T h e s u m o f tw o signals xj ( n) a n d xz i n) is a signal _v(n), w h o se v alu e at any in stan t is equal to th e sum o f th e values o f th e se tw o signals a t th a t in sta n t, th a t is. y(/t) = jq (n) + X2 <n) — oc < n < oc T h e p r o d u c t o f tw o signals is sim ilarly defin ed o n a sa m p le -to -sa m p le basis as v(n) = X](n)X 2 (n) — oo < n < oo 56 Discrete-Time Signals and Systems Chap. 2 2.2 DISCRETE-TIME SYSTEMS In m a n y ap p lic a tio n s o f d ig ital signal p ro cessin g w e w ish to desig n a d ev ice or an alg o rith m th a t p e rfo rm s so m e p re sc rib e d o p e ra tio n o n a d isc re te -tim e signal. S uch a d evice o r a lg o rith m is called a d isc re te -tim e system . M o re specifically, a discrete-time s y s t em is a d ev ice o r a lg o rith m th a t o p e ra te s on a d isc re te -tim e signal, called th e i nput o r excitation, acco rd in g to so m e w ell-defined ru le , to p ro d u c e a n ­ o th e r d isc rete-tim e signal called th e out p u t o r response of th e system . In g en eral, we view a system as an o p e r a tio n o r a se t o f o p e ra tio n s p e rfo rm e d on th e in p u t sig n al x( n) to p ro d u c e th e o u tp u t signal _v(n). W e say th a t th e in p u t signal x( n) is t r ans f ormed by th e sy stem in to a signal >■(«), an d ex p ress th e g e n e ra l re la tio n sh ip b e tw e e n jc («) a n d y ( n ) as y( n) = T[x{n) } (2 .2 .1) w h ere th e sym bol T d e n o te s th e tra n s fo rm a tio n (also called an o p e r a to r) , o r p r o ­ cessing p e rfo rm e d by th e sy stem on ;c(n) to p ro d u c e y(n). T h e m a th e m a tic a l re la tio n sh ip in (2.2.1) is d e p ic te d g rap h ically in Fig. 2.12. T h e re are v ario u s w ays to d escrib e th e c h a ra c te ristic s of th e system an d th e o p e ra tio n it p e rfo rm s on x( n ) to p ro d u c e y(n ). In this c h a p te r w e shall b e c o n ­ c e rn e d w ith th e tim e -d o m a in c h a ra c te riz a tio n o f system s. W e shall begin w ith an in p u t-o u tp u t d e sc rip tio n o f th e system . T h e in p u t-o u tp u t d e sc rip tio n focuses on th e b e h a v io r at th e te rm in a ls of th e system a n d ignores th e d e ta ile d in te rn a l co n stru ctio n o r re a liz a tio n o f th e system . L a te r, in S ection 7.5. w e in tro d u c e th e sta te -sp a c e d e sc rip tio n o f a system . In this d e sc rip tio n w e d e v e lo p m a th e m a ti­ cal e q u a tio n s th a t n o t o nly d esc rib e th e in p u t- o u tp u t b e h a v io r o f th e sy stem b u t specify its in te rn a l b e h a v io r a n d stru c tu re . 2.2.1 Input-Output Description of Systems T h e in p u t-o u tp u t d e sc rip tio n o f a d isc re te -tim e sy stem consists o f a m a th e m a tic a l ex p ressio n o r a ru le, w hich explicitly d efin es th e re la tio n b e tw e e n th e in p u t an d o u tp u t signals ( i n p u t - o u t p u t relationship). T h e ex act in te rn a l s tru c tu re o f th e sys­ tem is e ith e r u n k n o w n o r ig n o red . T h u s th e o n ly w ay to in te ra c t w ith th e sy stem is by u sin g its in p u t an d o u tp u t te rm in a ls (i.e., th e system is a ssu m ed to be a “black b o x ” to th e u se r). T o reflec t th is p h ilo so p h y , w e u se th e g ra p h ic a l re p re se n ta - x (n J Input signal or excitation Figure 2.12 Discrete-time System Output signal or response Block diagram representation of a discrete-tim e system. Sec. 2.2 57 Discrete-Time Systems tio n d e p ic te d in Fig. 2.12, an d th e g e n e ra l in p u t-o u tp u t re la tio n sh ip in (2.2.1) or, a lte rn a tiv e ly , th e n o ta tio n Jt(n) y(n) (2.2.2) w hich sim ply m e a n s th a t v(n) is th e re sp o n se of the system T to th e e x c ita tio n x{n). T h e fo llo w in g e x am p les illu stra te se v era l d iffe re n t system s. Example 2.2.1 D eterm ine the response of the following sytems to the input signal x(n) = , A u, (a) (b) (c) (d) -3 < n < 3 otherwise y(n) = x{n) v(«) = x in — i) y(n) = x i n 4- i) y i n ) = j[A-(n + 1) + x ( n ) + x i n - D] (e) y ( n) = m a x { x( n + 1), x ( n ) . x ( n — 1)1 (0 y ( n ) = Z L . x x ( k ) = x ( n ) + x ( n — 1) + x{n — 2) -t Solution (2.2.3) First, we determ ine explicitly the sample values of the input signal xin) = ( ....0 .3 ,2 .1 .0 .1 .2 , 3 ,0 ,...) T Next, we determ ine the output of each system using its input-output relationship. (a) In this case the output is exactly the same as the input signal. Such a system is known as the identity system. (b) This system simply delays the input by one sample. Thus its output is given by x{n) = { ...,0 ,3 .2 .1 ,0 ,1 .2 .3 ,0 ,..,) t (c) In this case the system “advances” the input one sample into the future. For example, the value of the output at time n = 0 is y(0) = *(1). The response of this system to the given input is x(n) = { ...,0 ,3 . 2 .1 .0 ,1 ,2 . 3 ,0 ....} t (d) The output of this system at any time is the mean value of the present, the im m ediate past, and the immediate future samples. For example, the output at time n = 0 is y(0) = + x(0) + jr(l)] = |[1 + 0 + 1] = | R epeating this com putation for every value of n, we obtain the output signal >■(«) = {• ...0 ,1 , f , 2 , l j . l . 2 , § , 1 .0 ,...) t 58 Discrete-Time Signals and Systems Chap. 2 (e> This system selects as its output at time n the maximum value of the three input samples x(n - l.l, .v(n). and ,r(n + 1). Thus the response of this system to the input signal .\{n) is v(n) = {0.3. 3. 3. 2 .1 .2 . 3, 3, 3 . 0 . . . . ) t (f) This system is basically an accumulator that computes the running sum of all the past input values up to present time. The response of this system to the given input is v(n) = {.. ..0 .3 . 5. 6. 6, 7, 9. 1 2 .0 ....} T W e o b se rv e th a t fo r several of th e sy stem s c o n sid e re d in E x a m p le 2.2.1 the o u tp u t at tim e n — no d e p e n d s n ot only on th e v alu e of the in p u t at n = n (, [i.e., jc(«o)]- b u t also on th e values o f the in p u t a p p lie d to th e system b e fo re an d after n = n (). C o n sid er, fo r in stan ce, th e a c c u m u la to r in th e ex a m p le . W e see th at the o u tp u t at tim e n = ?i() d e p e n d s n ot only on th e in p u t a t tim e n = no. b u t also on x ( n ) a t tim es n = no — 1. no - 2, and so on. By a sim ple a lg e b ra ic m a n ip u latio n th e in p u t-o u tp u t re la tio n o f th e a c c u m u la to r can b e w ritte n as = y(/i - 1) + x(ti) w hich justifies th e te rm accumul at or. In d e e d , th e system c o m p u te s th e c u rre n t v alu e o f th e o u tp u t by a d d in g (a ccu m u latin g ) th e c u rre n t v alu e o f th e in p u t to th e p rev io u s o u tp u t value. T h e re are so m e in te re stin g co n clu sio n s th a t can be d raw n by tak in g a close lo o k in to this a p p a re n tly sim ple system . S u p p o se th a t we are given th e in p u t signal x(rt ) fo r n > no. a n d we wish to d e te rm in e th e o u tp u t v(/i) o f th is system fo r n > no. F o r n = no. no + 1........ (2.2.4) gives v (n n) = v(«o - 1) -f x (/i0) _v(no + l l = v ( « o ) + x ( n o + 1) an d so on. N o te th a t we h ave a p ro b le m in c o m p u tin g y ( n a), since it d e p e n d s on y(«o - 1). H o w ev er, y(t io - 1) = ^ x(k) k — — ’X . th a t is. y(no - 1) “sum m arizes*’ th e effect on th e system from all the in p u ts w hich h ad b e e n ap p lied to th e system b efo re tim e no- T h u s th e re sp o n s e of th e system fo r n > no to th e in p u t x(/7j th a t is a p p lie d a t tim e no is th e c o m b in e d resu lt of this in p u t an d all in p u ts th a t h ad b e e n a p p lie d p re v io u sly to th e sy stem . C o n seq u en tly . y(/i), n > no is n o t u n iq u ely d e te rm in e d by th e in p u t x ( n ) fo r n > no. Sec. 2.2 59 Discrete-Time Systems T he additional inform ation required to d eterm ine y ( n) for n > no is the initial condi t i on y(no - 1). T his value sum m arizes the effect o f all p reviou s inputs to the. system . Thus the initial con d ition y(«o - 1) togeth er with the input seq u en ce x ( n ) for n > no uniquely d eterm ine the output sequ en ce y(n ) for n > n0. If the accum ulator had no excitation prior to n 0, the initial con d ition is y(no — 1) = 0. In such a case w e say that the system is initially relaxed. S ince y(no —1) = 0, the output seq u en ce y(n) d ep en d s only on the input seq u en ce x ( n ) for n > n0. It is custom ary to assum e that every system is relaxed at n = —oo. In this case, if an input x ( n ) is applied at n = —co, the corresponding output y( n) is solely and uni qu e l y determ ined by the given input. Example 2.2.2 T he accum ulator described by (2.2.3) is excited by the sequence x(n) = nu(n). D e­ term ine its output under the condition that: (a) It is initially relaxed [i.e., v ( - l ) = 0]. <b) Initially, y (— 1 )= 1. Solution The output of the system is defined as tl -] y(n) = ^ x(k) = x(k) + *=-oc *=-oc r i= < l x(k) = y (-l) + k=o But n(n -f 1) (a) If the system is initially relaxed, v(—1) = 0 and hence n(n + l) v (n) = -------- 2 -------- " - 0 (b) On the other hand, if the initial condition is y ( - l ) = 1, then n(n -I-1) n2 + n + 2 v(n) = 1 + ---- -— - = ------------- n > 0 2.2.2 Block Diagram Representation of Discrete-Time Systems It is useful at this point to introduce a block diagram representation o f d iscrete­ tim e system s. For this purpose w e n eed to define som e basic building blocks that can b e intercon n ected to form com p lex system s. An adder. F igure 2.13 illustrates a system (adder) that perform s the addi­ tion o f tw o signal seq u en ces to form another (th e sum ) seq u en ce, w hich w e d en ote Discrete-Time Signals and Systems 60 Chap. 2 x|(n ) y(n) = i,( n ) + x2(n) Figure 2.13 Graphical representation of an adder. as y (n ). N o te th a t it is n o t n ecessa ry to sto re e ith e r o n e o f th e se q u e n c e s in o rd e r to p e rfo rm th e a d d itio n . In o th e r w ords, th e a d d itio n o p e ra tio n is memor yl ess . A constant multiplier. T his o p e ra tio n is d e p ic te d by Fig. 2.14, an d sim ply re p re s e n ts ap p ly in g a scale fa c to r on th e in p u t x ( n) . N o te th a t th is o p e ra tio n is also m em oryless. a ------------------------ - v(n) = o i( n ) »■ Figure 2.14 Graphical representation of a constant multiplier. A signal multiplier. F ig u re 2.15 illu stra te s th e m u ltip lic a tio n o f tw o sig­ nal se q u en ces to fo rm a n o th e r (th e p ro d u c t) se q u e n c e , d e n o te d in th e figure as y (n ). A s in th e p re c e d in g tw o cases, w e can view th e m u ltip lic a tio n o p e ra tio n as m em o ry less. A|(n) v(n) = jT|(n)Ai(n) ---- -0 ^ — Figure 2.1S Graphical representation of a signal multiplier. x2( n ) A unit delay element. T h e u n it d elay is a sp e cial sy stem th a t sim ply d elay s th e signal passing th ro u g h it by one sam p le. F ig u re 2.16 illu stra te s such a system . If th e in p u t signal is x ( n) , th e o u tp u t is x( n — 1). In fact, the sa m p le x{n — 1) is sto re d in m em o ry at tim e n — 1 a n d it is recalled fro m m e m o ry a t tim e n to form v ( n ) = x( n - 1) T h u s th is basic b u ild in g b lock re q u ire s m em o ry . T h e use o f th e sym bol ; _1 to d e n o te th e u n it o f d eiay will b eco m e a p p a r e n t w h e n w e discuss th e z -tra n sfo rm in C h a p te r 3. x(n) ------------------ »- y (n ) = jr ( n— 1) _____ Figure 2,16 Graphical representation of the unit delay element. A unit advance element. In c o n tra st to th e u n it d e la y , a u nit ad v an ce m o v es th e in p u t x ( n ) a h e a d by o n e sa m p le in tim e to yield x ( n + 1). F ig u re 2.17 illu stra te s th is o p e ra tio n , w ith th e o p e r a to r ; b ein g used to d e n o te th e u n it advance. Sec. 2.2 Discrete-Time Systems 61 y( n ) = x( n + I ) x( n) Figure 2.17 Graphical representation of the unit advance element. W e o b se rv e th a t an y such ad v an ce is physically im possible in real tim e, since, in fact, it in v o lv es lo o k in g in to th e fu tu re o f th e signal. O n th e o th e r h an d , if we store th e signal in th e m em o ry o f th e c o m p u te r, w e can recall any sa m p le a t any tim e. In such a n o n re a l-tim e ap p lic a tio n , it is p o ssible to advance th e signal jr(?r) in tim e. Example 2.2.3 Using basic building blocks introduced above, sketch the block diagram representa­ tion of the discrete-time system described by the input-output relation. v(n) = 3.v(« - 1) + | x(n) + \x(n - 1) where x(n) is the input and y(n) is the output of the system. Solution According to (2.2.5), the output v(n) is obtained by multiplying the input x(n) by 0.5, multiplying the previous input jr ( n - l) by 0.5. adding the two products, and then adding the previous output v(n —1) multiplied by j. Figure 2.18a illustrates this block diagram realization of the system. A simple rearrangem ent of (2.2.5). namely. v (« ) = 5 .v(n - 1 ) + 5 [jc(k) + x(n - 1 )| ( 2 . 2 .6 ) leads to the block diagram realization shown in Fig. 2.18b. Note that if we treat "the system” from the “viewpoint” of an input-output or an external description, we are not concerned about how the system is realized. On the other hand, if we adopt an Black box 0.5 -i x( n ) (a) Black box -i x( n) Figure 2.18 Block diagram realizations of the system y(n) = 0.25y(n — 1) + 0.5 x{n) + 0.5j(n — 1). Discrete-Time Signals and Systems 62 Chap. 2 internal description of the system, we know exactly how the system building blocks are configured. In terms of such a realization, we can see that a system is relaxed at time n = no if the outputs of all the delays existing in the system are zero at n = n{) (i.e., all memory is filled with zeros). 2.2.3 Classification of Discrete-Time Systems In th e analysis as w ell as in th e design o f system s, it is d e s ira b le to classify the sy stem s acco rd in g to th e g e n e ra l p ro p e rtie s th a t th e y satisfy. In fact, th e m a th e ­ m atical te c h n iq u e s th a t w e d e v e lo p in th is an d in s u b s e q u e n t c h a p te rs fo r analyzing an d d esig n in g d isc rete-tim e system s d e p e n d h eav ily on th e g e n e ra l ch aracteristics of th e system s th a t are b ein g c o n sid e re d . F o r th is re a so n it is n ecessa ry for us to d ev elo p a n u m b e r o f p ro p e rtie s o r c a te g o rie s th a t can be u se d to d escrib e th e g e n e ra l ch aracteristics o f system s. W e stress th e p o in t th a t fo r a sy stem to po ssess a given p ro p e rty , th e p ro p e rty m u st h o ld fo r ev ery p o ssible in p u t signal to th e system . If a p ro p e rty holds for so m e in p u t signals b u t n ot fo r o th e rs, th e system d o e s n ot p o ssess th a t p ro p erty . T h u s a c o u n te re x a m p le is sufficient to p ro v e th a t a system d o e s n ot possess a p ro p e rty . H o w ev er, to p ro v e th a t th e system has so m e p ro p e rty , we m ust prove th a t th is p ro p e rty h o ld s fo r every po ssib le in p u t signal. Static versus dynamic systems. A d isc re te -tim e sy stem is called static o r m em o ry le ss if its o u tp u t at any in sta n t n d e p e n d s at m o st o n the in p u t sam ple at th e sam e tim e, b u t n o t o n p a st o r fu tu re sa m p le s o f th e in p u t. In any o th e r case, th e system is said to b e d y n a mi c o r to h av e m em o ry . If th e o u tp u t o f a system at tim e n is co m p letely d e te rm in e d by th e in p u t sa m p le s in th e in te rv a l fro m n - N to n ( N > 0), th e system is said to h av e m e m o r y o f d u ra tio n N . U N — 0. th e sy stem is static. H 0 < N < oo, th e sy stem is said to have f ini te m e m o r y , w h ereas if N = oo, th e system is said to have infinite m e m o r y . T h e system s d escrib ed by th e follow ing in p u t- o u tp u t e q u a tio n s y(n) = a x {n) (2.2.7) y ( n ) = nx ( n ) + b x 3(n) (2.2.8) a re b o th static o r m em o ry less. N o te th a t th e re is n o n e e d to s to re any o f th e past in p u ts o r o u tp u ts in o rd e r to c o m p u te th e p re se n t o u tp u t. O n th e o th e r h an d , th e sy stem s d escrib ed by th e follow ing in p u t-o u tp u t re la tio n s y( n) = x ( n ) + 3 x ( n — 1) (2.2.9) y(n) = J ^ x ( n - k ) k=0 (2.2.10) X y( n) = J 2 x ( n - k ) Jt=0 (2.2.11) are dynamic systems or systems with memory. The systems described by (2.2.9) Sec. 2.2 63 Discrete-Time Systems an d (2.2.10) h av e fin ite m em o ry , w h ereas the sy stem d e sc rib e d by (2.2.11) has infinite m em o ry . W e o b se rv e th a t sta tic o r m em oryless system s are d e sc rib e d in g e n e ra l by in p u t-o u tp u t e q u a tio n s o f th e form y(n) = T [ x ( n ) , n] (2.2.12) a n d th e y do n o t in clu d e d elay e le m e n ts (m em o ry ). Time-invariant versus time-variant systems. W e can su b d iv id e th e g en ­ eral class o f sy stem s in to th e tw o b ro a d c a teg o ries, tim e -in v a ria n t system s and tim e -v a ria n t sy stem s. A system is called tim e -in v a ria n t if its in p u t- o u tp u t c h a ra c ­ teristics d o n o t c h a n g e w ith tim e. T o e la b o ra te , su p p o se th a t w e h av e a system T in a re la x e d s ta te w hich, w h en ex cited by an in p u t signal x ( n) , p ro d u c e s an o u tp u t signal y(n). T h u s w e w rite y( n) = T [ x { n) ) (2.2.13) N o w su p p o se th a t th e sam e in p u t signal is d e la y e d by k u n its o f tim e to yield x (n - &), an d ag ain a p p lied to th e sam e system . If th e c h a ra c te ristic s of th e system d o n o t ch an g e w ith tim e, th e o u tp u t o f th e relax ed system will b e y(« —k). T h at is, th e o u tp u t will b e th e sa m e as th e resp o n se to x ( n) . ex cep t th a t it will be d elay ed by th e sam e k u n its in tim e th a t the in p u t w as d elay ed . T his lead s us to define a tim e -in v a ria n t o r sh ift-in v a ria n t system as follow s. Definition. A relax ed system T is time i nvariant o r shift i nvariant if and o n ly if x( n) y(n) im p lies th a t x {n — k) — y( n — k) (2.2.14) fo r ev ery in p u t signal x (n ) a n d every tim e shift k. T o d e te rm in e if an y given system is tim e in v a ria n t, w e n e e d to p e rfo rm the te st specified b y th e p re c e d in g definition. B asically, we ex cite th e system w ith an a rb itra ry in p u t se q u e n c e x ( n) , w hich p ro d u c e s an o u tp u t d e n o te d as y ( n) . N ext w e d elay th e in p u t se q u e n c e by sam e a m o u n t k an d re c o m p u te th e o u tp u t. In g e n eral, w e can w rite th e o u tp u t as y(«, k) = T [ x ( n — <:)] N o w if th is o u tp u t y{n, k) = y{n — k), for all p o ssib le v alu es o f k, th e system is tim e in v a ria n t. O n th e o th e r h a n d , if th e o u tp u t y( n, k ) ^ y ( n — k), ev en fo r o n e v alu e o f k, th e sy stem is tim e v arian t. Discrete-Time Signals and Systems 64 Chap. 2 VI 71) = X( 77I- V<71 - ] I xin ) “ D ifferentiator" - B x(/t) “Time" multiplier v( n ) = xl - n ) “ Folder" v(n J = .u n ) cos oi„ii Figure 2.19 Examples of a lime-invariant (a) and some time-variant systems (h)-(d). Example 2.2.4 Determ ine if the systems shown in Fig. 2.19 are time invariant or time variant. Solution (a) This system is described by the input^output equations y(7i) = T\ xin)} = x(n\ —x(n - 1) (2.2.15) Nov, if the input is delayed by k units in time and applied to the system, it is clear from the block diagram that the output will be y i n . k) = x i n - k) — x i n — k — 1) (2.2.16) On the other hand, from (2.2.14) we note that if we delay y (n) by k units in time, we obtain yin — k) = x(n — k) — xin — k — 1) (2.2.17) Since the right-hand sides of (2.2.16) and (2.2.17) are identical, it follows that v(n. k) = yin - k). Therefore, the system is time invariant. Sec. 2.2 Discrete-Time Systems 65 (b) The input-output equation for this system is y(n) = T[x(n)] = nx(n) (2.2.18) The response of this system to x(n - Jt) is y(n, k) = nx(n - k) (2.2.19) Now if we delay ;y(n) in (2.2.18) by k units in time, we obtain y(n - k) = (n — k)x(n — k) (2 .2.20) = nx(n — k) - kx(n - k) This system is time variant, since y(n, k) ^ y(n - k). (c) This system is described by the input-output relation >’(«) = T[x(n)\ = x ( - n ) (2.2.21) The response of this system to jr(n - k) is ;y(n, A;) = T[x(n - *)] = x ( - n - k) (2.2.22) Now, if we delay the output ;y(n), as given by (2.2.21), by k units in time, the result will be y(n - k) = x ( - n + k) (2.2.23) Since y(n, k) ^ y{n - it), the system is time variant. (d) The input-output equation for this system is y(n) = j:(n) costDon (2.2.24) The response of this system to x(n - k) is y(n, k) = x(n - k) cos o\)n (2.2.25) If the expression in (2.2.24) is delayed by k units and the result is compared to (2.2.25), it is evident that the system is time variant. Linear versus nonlinear systems. The general class o f system s can also be subdivided into linear system s and nonlinear system s. A linear system is one that satisfies the su pe rp ositio n princ iple. Sim ply stated, the principle o f su p erp osi­ tion requires that the resp onse o f the system to a w eighted sum o f signals b e equal to the corresponding w eighted sum of the responses (outp u ts) of the system to each of the individual input signals. H en ce w e have the follow ing definition o f linearity. Definition. A r e la x e d T s y s te m is lin e a r if a n d only if T [ a i x i ( n ) + azx2{n)] = a\ T [ x \ ( n ) ] + a i T [ x 2{n)] (2.2.26) for any arbitrary input seq u en ces x\ ( n) and x 2(n), and any arbitrary constants aj and 0 2 Figure 2.20 gives a pictorial illustration of the superposition principle. 66 Discrete-Time Signals and Systems Chap. 2 if and only if v(n) = v'(n). T h e su p e rp o sitio n p rin cip le e m b o d ie d in th e re la tio n (2.2.26) can be s e p a ­ r a te d in to tw o p arts. F irst, su p p o se th a t a2 = 0. T h e n (2.2.26) re d u c e s to T{a\ X\ ( n) ] = a\ T [ x \ { n ) } = a\ vi(n) (2.2.27) w h ere vi (fl) = T [ x x(n)} T h e re la tio n (2.2.27) d e m o n s tra te s the mul ti pli cat i ve o r scaling p r o p e r t y of a lin ear system . T h a t is, if th e re sp o n se o f th e system to th e in p u t x i ( n ) is vi(n ), the re sp o n se to a\X](n) is sim ply a i j ’i(n ). T h u s any scaling of th e in p u t resu lts in an id en tical scaling o f th e c o rre sp o n d in g o u tp u t. S eco n d , su p p o se th a t ai = a2 = 1 in (2.2.26). T h e n T [ x \ ( n ) + x 2 (n)] = T [ x \ { n ) ] + T [ x \ ( n ) } (2.2.28) = yi ( n) + yz(n) T his re la tio n d e m o n s tra te s th e additivity pr ope r t y o f a lin e a r sy stem . T h e ad ditivity an d m u ltip lic ativ e p ro p e rtie s c o n stitu te th e su p e rp o s itio n p rin c ip le as it ap p lies to lin ear system s. T h e lin earity co n d itio n em b o d ie d in (2.2.26) can b e e x te n d e d a rb itra rily to any w eig h ted lin e a r c o m b in a tio n o f signals by in d u ctio n . In g e n e ra l, we h av e M- 1 x( n) = ^ 2 GkXk(n) M- 1 y ( n ) = ^ akyk (n) k=l (2.2.29) i= l w h ere ^ ( n ) = T [ x k(n)} k = 1, 2, , . . , M — 1 (2.2.30) Sec. 2.2 67 Discrete-Time Systems W e o b se rv e fro m (2.2.27) th a t if a i — 0, th e n y (n ) = 0. In o th e r w ords, a r e ­ lax ed , lin e a r sy stem w ith z e ro in p u t p ro d u c e s a z e ro o u tp u t. If a system p ro d u c e s a n o n z e ro o u tp u t w ith a zero in p u t, th e system m ay be e ith e r n o n re la x e d o r n o n ­ lin ear. If a re la x e d sy stem d o e s n o t satisfy th e su p e rp o s itio n p rin cip le as given by th e d efin itio n ab o v e, it is called nonlinear. Exam ple 2.2^ D eterm ine if the systems described by the following input-output equations are linear or nonlinear. (a) y(n) = ttx(n) (b) y(n) = *(n2) <d) y( n) = Ax{n) + B (c) v(n) = v2(n) (e) y(n) = ex[n] Solution (a) For two input sequences jti(n) and the corresponding outputs are Vi(n) = n.ifi(n) (2.2.31) y2{n) = nx2(n) A iinear combination of the two input sequences results in the output Vj(«) = T[a\Xy (n) + oijMh)] = («) + (/i)] (2.2.32) = ainxi (n) + a2nx2(n) On the other hand, a linear combination of the two outputs in (2.2.31) results in the output a\ V] (n) + a2y 2(n) = ainx\(n) + a2n,x2(n) (2.2.33) Since the right-hand sides of (2.2.32) and (2.2.33) are identical, the system is iinear. (b) As in part (a), we find the response of the system to two separate input signals *i(n) and x 2(n). The result is v,(n) = X\(n2) (2.2.341 y2(rt) = X2(n2) The output of the system to a linear combination of Xi(n) and *;(»?) is y3(n) = T\a\X\ («) + a 2x 2(n)] = a hx,(n2) + a2x2(n2) (2.2.35) Finally, a linear combination of the two outputs in (2.2.36) yields O] \>i(n) + c 2V2(n) = a i JCi (n2) + <i2X2(n2) (2.2.36) By comparing (2.2.35) with (2.2.36). we conclude that the system is linear. (c) The output of the system is the square of the input. (Electronic devices that have such an input-output characteristic and are called square-law devices.) From our previous discussion it is clear that such a system is memoryless. We now illustrate that this system is nonlinear. 68 Discrete-Time Signals and Systems Chap. 2 The responses of the system to two separate input signals are v,(«) = .vf(n) ' y2(n) = x;(n) (2.2.37) The response of the system to a linear combination of these two input signals is >'3<n ) = T[a 1*1 (n) + a2x2(n)} = [fli*i(n) + a2x2(n)]2 (2.2.38) = cfA 'fln) -I- 2a-la 2x i ( n ) x 2(n) + a 2x 2 { n ) On the other hand, if the system is linear, it would produce a linear combination of the two outputs in (2.2.37). namely, ai_Vi(n) + fl2.V2(n) = (rt) + a2x2(n) (2.2.39) Since the actual output of the system, as given by (2.2.38). is not equal to (2.2.39), the system is nonlinear. (d) Assuming that the system is excited by x\(n) and x2in) separately, we obtain the corresponding outputs V](n) = AX](rt) + B (2.2.40) y2(n) = A x 2(n) + B A linear combination of X\(n) and x 2{n) produces the output V i(« ) = T[u^X ] (/i) + a 2x 2(n>] = A[a,x,(/i) + a 2x 2(n)} + B (2.2.41) = A a \ X \ ( n ) -I- a2A x 2(n) + B On the other hand, if the system were linear, its output to the linear com bina­ tion of Ji(n) and x 2 (n) would be a linear combination of vj i n) and y2(n). that is. ai yi (n ) + a 2y 2(n) = a ] A x ] { n ) + a \ B a 2A x 2{ n ) + a 2 B (2.2.42) Clearly. (2.2.41) and (2.2.42) are different and hence the system fails to satisfy the linearity test. The reason that this system fails to satisfy the linearity test is not that the system is nonlinear (in fact, the system is described by a linear equation) but the presence of the constant B. Consequently, the output depends on both the input excitation and on the param eter B ^ 0. Hence, for B ^ 0. the system is not relaxed. If we set B = 0, the system is now relaxed and the linearity test is satisfied. (e) Note that the system described by the input-output equation y(n) = e,1',) (2.2.43) is relaxed. If x(n) = 0, we find that y(n) = 1. This is an indication that the system is nonlinear. This, in fact, is the conclusion reached when the linearity test, is applied. Causal versus noncausal systems. d isc re te -tim e system s. W e b eg in w ith th e d efin itio n o f causal Sec. 2.2 69 Discrete-Time Systems D e fin itio n , a system is said to b e causal if th e o u tp u t o f th e system at any tim e n [i.e., v(n)] d e p e n d s oniy on p re s e n t an d p ast in p u ts [i.e., x { n ), x(tt - 1), x(rt — 2 ) , . . . ] , b u t d o e s n o t d e p e n d on fu tu re in p u ts [i.e., x( n + 1), x ( n + 2 ) , . . . ] . In m a th e m a tic a l te rm s, th e o u tp u t o f a cau sal sy stem satisfies an e q u a tio n o f th e form v(n) = F[x{n), x ( n - 1), x ( n - 2 ) , . . . ] (2.2.44) w h ere /'[■] is so m e a rb itra ry function. If a system d o e s n o t satisfy this d efin itio n , it is called noncausal . S uch a sy stem has an o u tp u t th a t d e p e n d s n o t oniy on p re s e n t a n d p ast in p u ts b u t also o n fu tu re in p u ts. It is a p p a re n t th a t in real-tim e signal p ro cessin g ap p licatio n s w e c a n n o t o b ­ serv e fu tu re v alu es o f th e signal, and h e n c e a n o n cau sal system is physically u n re a l­ izab le (i.e., it c a n n o t b e im p le m e n te d ). O n th e o th e r h an d , if th e signal is re c o rd e d so th a t th e p ro cessin g is d o n e off-line (n o n re a l tim e ), it is p o ssible to im p lem en t a n o n cau sal sy stem , since all v alu es o f th e signal are av ailab le a t th e tim e o f p r o ­ cessing. T h is is o fte n th e case in th e p ro cessin g o f g eophysical signals an d im ages. Example 2.2.6 D eterm ine if the systems described by the following input-output equations are causal or noncausal. (a) y(n) = x(n) - x(n - 1) (b) y(n) = (d) y(n') = x(n) + 3jr(n + 4) (e) y(n) = x( n2) x(k) (c) y(n) = ax(n) (t) y(n) = x(2n) (g) }'(n) = x ( -n ) Solution The systems described in parts (a), (b), and (c) are clearly causal, since the output depends only on the present and past inputs. On the other hand, the systems in parts (d). (e), and (f) are clearly noncausal, since the output depends on future values of the input. The system in (g) is also noncausal, as we note by selecting, for example, n = - 1 , which yields v(—1) = * 0 ) Thus the output at n = - 1 depends on the input at n = 1, which is two units of time into the future. Stable versus unstable systems. S tab ility is an im p o rta n t p ro p e rty th a t m u st b e c o n s id e re d in an y p ractical ap p lic a tio n o f a system . U n s ta b le system s u su ally ex h ib it e rra tic an d ex tre m e b e h a v io r an d cause overflow in an y p ractical im p le m e n ta tio n . H e re , w e define m a th e m a tic a lly w h at w e m e a n by a sta b le system , a n d la te r, in S ectio n 2.3.6, w e ex p lo re th e im plicatio n s o f this definition fo r lin ear, tim e -in v a ria n t system s. Definition. A n a rb itra ry re la x e d system is said to be b o u n d e d in p u t-b o u n d e d o u tp u t (B IB O ) sta b le if a n d only if ev ery b o u n d e d in p u t p ro d u ces a b o u n d e d o u tp u t. T h e c o n d itio n s th a t th e in p u t se q u e n c e x{n) a n d th e o u tp u t se q u e n c e y ( n) are b o u n d e d is tra n s la te d m a th e m a tic a lly to m e a n th a t th e re exist som e finite n u m b ers, Discrete-Time Signals and Systems 70 Chap. 2 say M x an d M v. such th at j.v(ri)! < M K < oc < M x < dc (2.2.45) fo r all n. If. fo r so m e b o u n d e d in p u t se q u e n c e ,v(»), the o u tp u t is u n b o u n d e d (in fin ite), th e sy stem is classified as u n sta b le . Exam ple 2.2.7 Consider the nonlinear system described by the input-output equation V(/I ) = — 1) ,V(/i ) As an input sequence we select the hounded signal xin ) = C&(n ) where C is a constant. We also assume that y(—1) = 0. Then the output sequence is y(0) = C, y (l) = C \ y(2) = Cd............ y(n) = C : " Clearly, the output is unbounded when ] < ICl < oc. Therefore, the system is BIBO unstable, since a bounded input sequence has resulted in an unbounded output. 2.2.4 Interconnection ot Discrete-Time Systems D isc rete-tim e sy stem s can be in te rc o n n e c te d to form larg er sy stem s. T h e re are tw o b asic ways in w hich system s can be in te rc o n n e c te d : in c a scad e (series) o r in p arallel. T h ese in te rc o n n e c tio n s are illu strated in Fig. 2.21. N o te th at th e tw o in te rc o n n e c te d sy stem s are d ifferen t. In th e cascad e in te rc o n n e c tio n the o u tp u t of th e first system is yiO?) = 7j[;r(/j)] xin) (2.2.46) y(n) : r T\ T, 7, (a) v | (n ) (b) Figure 2.21 Cascade (a) and parallel (b) interconnections of systems. Sec. 2.2 Discrete-Time Systems 71 an d th e o u tp u t o f th e second system is v(n) = T2[\\(n)] (2.2.47) = r 2{7 i[* (n )]} W e o b se rv e th a t sy stem s 7"j a n d T2 can be co m b in ed o r c o n s o lid a te d in to a single o v e ra ll sy stem % = T271 (2.2.48) C o n s e q u e n tly , w e can ex p ress th e o u tp u t o f th e co m b in ed sy stem as y( n) = Tc[x(n)] In g e n e ra l, th e o rd e r in w hich th e o p e ra tio n s T\ a n d T2 a re p e rfo rm e d is im p o rta n t. T h a t is, T27I # T,T2 fo r a rb itra ry system s. H o w ev er, if th e system s 7j a n d T2 a re iin e a r a n d tim e in v a ria n t, th e n (a) % is tim e in v arian t an d (b ) T2T\ = T \ T2, th a t is, th e o r d e r in w hich th e sy stem s p ro cess th e signal is n o t im p o rta n t. 7^71 a n d T \ T 2 yield id en tical o u tp u t se q u e n c e s. T h e p ro o f o f (a) follow s. T h e p ro o f o f (b ) is given in S e c tio n 2.3.4. T o p ro v e tim e in v a ria n c e , su p p o se th a t Tj and T2 a re tim e in v arian t; th e n x( n — k ) vi(/i - k) an d Vi(n - k) — '■+ y( n - k) Thus x{n — k) Tf y( n — k ) an d th e re fo re , Tc is tim e in v arian t. In th e p a ra lle l in te rc o n n e c tio n , th e o u tp u t of th e sy stem T\ is ^ ( n ) an d the o u tp u t o f th e sy stem T2 is y2(n). H e n c e th e o u tp u t o f th e p a ra lle l in te rc o n n e c tio n is v3(n) = .V] ( n) + >>2(n) = Ti[x{n)\ + T2[x(n)\ = (T\ + T2)[x(n)} = Tp[x(n)\ w h e re Tp = T\ + T2. In g e n e ra l, w e can u se p a rallel an d cascade in te rc o n n e c tio n o f sy stem s to c o n s tru c t la rg e r, m o re com plex system s. C o n v e rsely , w e can ta k e a la rg e r system a n d b re a k it d o w n in to sm a ller su b sy stem s fo r p u rp o se s o f an aly sis a n d im p le­ m e n ta tio n . W e sh all u se th e s e n o tio n s la te r, in th e design a n d im p le m e n ta tio n of d ig ital filters. Discrete-Time Signals and Systems 72 Chap. 2 2.3 ANALYSIS OF DISCRETE-TIME LINEAR TIME-INVARIANT SYSTEMS In S ectio n 2.2 we classified system s in a c c o rd a n c e w ith a n u m b e r of c h aracteristic p ro p e rtie s o r categ o ries, nam ely: lin e a rity , cau sality , stab ility , a n d tim e in variance. H av in g d o n e so. we now tu rn o u r a tte n tio n to th e analysis o f th e im p o rta n t class o f lin ear, tim e -in v a ria n t (L T I) system s. In p a rtic u la r, we shall d e m o n s tra te th a t such system s are c h a ra c te riz e d in th e tim e d o m ain sim ply bv th e ir resp o n se to a u n it sam p le se q u en ce. W e shall also d e m o n s tra te th a t any a rb itra ry in p u t signal can b e d eco m p o sed an d r e p re s e n te d as a w eig h ted sum of u n it sa m p le seq u en ces. A s a c o n s eq u en ce o f th e lin e a rity a n d tim e-in v arian ce p ro p e rtie s of the system , th e resp o n se o f th e system to any a rb itra ry in p u t signal can be e x p ressed in term s of th e u n it sam p le re sp o n se of th e system . T h e g en eral form o f the ex p ressio n th a t re la te s th e u n it sam ple re sp o n se o f the system an d th e a rb itra ry in p u t signal to th e o u tp u t signal, called th e c o n v o lu tio n sum o r th e c o n v o lu tio n fo rm u la, is also d eriv ed . T h u s we are ab le to d e te rm in e the o u tp u t o f any lin e a r, tim e-in v arian t system to any a rb itra ry in p u t signal. 2.3.1 Techniques for the Analysis of Linear Systems T h e re are tw o basic m e th o d s for an aly zin g th e b e h a v io r o r re sp o n s e of a lin ear system to a given in p u t signal. O n e m e th o d is b a se d on th e d ire c t so lu tio n o f the in p u t-o u tp u t e q u a tio n for th e system , w hich, in g e n e ra l, has th e form v(ji) - F [v ( n - 1), v (?7 — 2 ) ........ y(n - N) , x ( n ) . x ( n — 1).......... x ( n - M)] w h ere F[-] d e n o te s so m e fu n ctio n o f th e q u a n titie s in b ra c k e ts. Specifically, fo r an L T I system , w e shall see la te r th a t th e g e n e ra l form o f th e in p u t-o u tp u t re la ­ tio n sh ip is N M (2.3.1) w h ere an d {b*,.} are c o n sta n t p a ra m e te rs th a t specify th e sy stem an d a re in ­ d e p e n d e n t o f x( n) a n d y( n) . T h e in p u t-o u tp u t re la tio n sh ip in (2.3.1) is called a d ifferen ce e q u a tio n a n d re p re se n ts o n e w ay to c h a ra c te riz e th e b e h a v io r of a d isc re te -tim e L T I system . T h e so lu tio n o f (2.3.1) is th e su b je ct o f S ection 2.4. T h e seco n d m e th o d fo r analyzing th e b e h a v io r o f a lin e a r sy stem to a given in p u t signal is first to d e c o m p o se o r reso lv e th e in p u t signal in to a sum o f e le ­ m e n ta ry signals. T h e e le m e n ta ry signals a re se le c te d so th a t th e re sp o n se o f the system to each signal c o m p o n e n t is easily d e te rm in e d . T h e n , u sin g th e lin earity p ro p e rty o f th e sy stem , th e re sp o n se s o f th e sy stem to th e e le m e n ta ry signals are ad d e d to o b ta in th e to ta l re s p o n s e of th e sy stem to th e given in p u t signal. T h is seco n d m e th o d is th e o n e d e sc rib e d in th is se ctio n . Sec. 2.3 Analysis o f Discrete-Time Linear Tim e-Invariant Systems 73 T o e la b o ra te , su p p o se th a t th e in p u t signal x (n ) is reso lv ed into a w eig h ted sum o f elem en tary ' signal c o m p o n e n ts {*/. («)} so th a t w h ere th e {ct} a re th e set of a m p litu d e s (w eighting coefficients) in the d e c o m ­ p o sitio n o f th e signal x( n) . N ow su p p o se th a t th e re sp o n se o f th e system to the e le m e n ta ry signal c o m p o n e n t x k{n) is y k(n). T hus. y*(n) = T [j.t (n)] (2.3.3) assu m in g th a t th e sy stem is re la x e d an d th a t th e re sp o n se to ckx k(n) is cky k(n). as a c o n s e q u e n c e o f th e scaling p ro p e rty o f th e lin e a r system . F in ally , th e to ta l re sp o n se to th e in p u t x( n ) is (2.3.4) In (2.3.4) we u se d th e ad d itiv ity p ro p e rty o f th e lin e a r system . A lth o u g h to a larg e e x te n t, th e ch o ice o f th e e le m e n ta ry signals a p p e a rs to b e a rb itra ry , o u r se lectio n is heavily d e p e n d e n t on th e class of input signals that we w ish to co n sid er. If w e place n o re stric tio n on th e c h aracteristics of th e input signals, its re so lu tio n in to a w eig h ted sum of u n it sam ple (im p u lse) se q u en ces p ro v e s to b e m a th e m a tic a lly c o n v e n ie n t an d c o m p letely g en eral. O n th e o th e r h a n d , if w e re stric t o u r a tte n tio n to a subclass o f in p u t signals, th e re m ay be a n o th e r set o f e le m e n ta ry signals th a t is m o re c o n v e n ie n t m a th e m a tic a lly in the d e te rm in a tio n o f th e o u tp u t. F o r ex am p le, if th e in p u t signal x( n) is p erio d ic w ith p e rio d N , w e have a lre a d y o b se rv e d in S ectio n 1.3.5 th a t a m a th em atically c o n v e n ie n t set o f elem en tary 7 signals is th e set o f e x p o n en tials x k (n) = eJluin k = 0. l , . . . , i V - l (2.3.5) w h e re th e fre q u e n c ie s {cok } a re h arm o n ic a lly re la te d , th a t is. k = 0. 1.........N - 1 (2.3.6) T h e fre q u e n c y 2 n / N is called th e fu n d a m e n ta l fre q u e n c y , an d all h ig h er-freq u en cy c o m p o n e n ts a re m u ltip le s o f th e fu n d a m e n ta l fre q u e n c y c o m p o n e n t. T h is subclass o f in p u t sig n als is c o n s id e re d in m o re d e ta il later. F o r th e re so lu tio n o f th e in p u t signal in to a w eig h ted su m o f u n it sam ple se q u en ces, w e m u st first d e te rm in e th e re sp o n se o f th e system to a u n it sa m ­ p le se q u e n c e a n d th e n use th e scaling a n d m u ltip lic ativ e p ro p e rtie s of th e lin ear 74 Discrete-Time Signals and Systems Chap. 2 sy stem to d e te rm in e th e fo rm u la fo r th e o u tp u t given any a rb itra ry input, T his d e v e lo p m e n t is d escrib ed in d etail as follow s. 2.3.2 Resolution of a Discrete-Time Signal into Impulses S u p p o se w e h av e an a rb itra ry signal x ( n ) th a t we w ish to reso lv e in to a sum of unit sa m p le seq u en ces. T o utilize th e n o ta tio n e sta b lish e d in th e p re c e d in g se ctio n , we select th e e le m e n ta ry signals x k (n) to be (2.3.7) x k(n) = 8{n - k) w h ere k re p re se n ts th e d elay o f th e u n it sam p le se q u e n c e . T o h a n d le an a rb itra ry signal x ( n ) th a t m ay h ave n o n z e ro v alu es o v er an infinite d u ra tio n , th e set of unit im p u lses m u st also b e infinite, to en co m p ass th e infinite n u m b e r of delays. N o w su p p o se th a t we m u ltip ly th e tw o se q u e n c e s x( n) a n d <5(n - k). Since 8{n — k) is z e ro e v ery w h ere ex cep t a t n = k , w h e re its v alu e is u nity, the result o f th is m u ltip lic atio n is a n o th e r se q u e n c e th a t is z e ro e v ery w h ere e x c e p t at n — k , w h ere its v alu e is x ( k) , as illu stra te d in Fig. 2,22. T h u s x( n) 8( n — k) = x ( k) 8( n — k) (2.3.8) Jt(n) T TT 111 i ’ l l i [ -2-10113 (a) i , ‘ 1 I , Tt I i i 1 JC(Jc) 6(/i-Jt) (b) *(*) 6(n —k ) k 0 Figure 2.22 n M ultiplication of a signal x i n ) with a shifted unit sam ple sequence. Sec. 2.3 Analysis of Discrete-Time Linear Time-Invariant Systems 75 is a se q u e n c e th a t is z e ro e v e ry w h e re ex cep t at n = k , w h e re its v a lu e is x( k ) . If we w ere to re p e a t th e m u ltip lic a tio n of x ( n ) w ith <5(a? — m ), w h ere m is a n o th e r d elay (im =6 k), th e re su lt will b e a se q u en ce th a t is z e ro e v e ry w h e re e x cep t at n = m, w h ere its v alu e is x ( m ) . H e n c e x( n ) 5 ( n — m) = x ( m) 8( n — m) (2.3.9) In o th e r w o rd s, each m u ltip lic a tio n o f th e signal x( n ) by a u n it im p u lse at som e d elay k, [i.e., <5(n — it)], in essen ce picks o u t th e single v alu e x ( k ) o f th e signal jc(n) at th e d e la y w h e re th e u n it im pulse is n o n z e ro . C o n s e q u e n tly , if w e re p e a t this m u ltip lic a tio n o v e r all p o ssib le delays, - o o < k < oo, a n d su m all th e p ro d u c t se q u e n c e s, th e re su lt will be a se q u e n c e e q u a l to th e se q u e n c e x ( n ) , th a t is, PCx( n) = ^ x ( k) 8( n — k) k=—oc (2.3.10) W e e m p h a s iz e th a t th e rig h t-h an d side of (2.3.10) is th e su m m a tio n of an infinite n u m b e r o f u n it sa m p le se q u en ces w h ere th e u n it sa m p le se q u e n c e 6(n - k) h as an a m p litu d e value o f x( k ) . T h u s th e rig h t-h a n d sid e o f (2.3.10) gives th e re so lu tio n o f o r d e c o m p o s itio n o f any a rb itra ry signal jc(n) in to a w e ig h te d (scaled) sum o f sh ifted u n it sam p le seq u en ces. Exam ple 2.3.1 Consider the special case of a finite-duration sequence given as jc(«) = (2, 4, 0,3) T Resolve the sequence x(n) into a sum of weighted impulse sequences. Solution Since the sequence x(n) is nonzero for the time instants n = —1, 0. 2, we need three impulses at delays k = —1. 0, 2, Following (2.3.10) we find that x<n) = 2(5(n + 1) + 4<5(n) + 3<5(n —2) 2.3.3 Response of LTI Systems to Arbitrary Inputs: The Convolution Sum H av in g re so lv e d an a rb itra ry in p u t signal x ( n ) in to a w eig h te d su m o f im pulses, w e a re no w re a d y to d e te rm in e th e re sp o n se of an y re la x e d lin e a r sy stem to any in p u t signal. F irs t, w e d e n o te th e re sp o n se v(n, k) o f th e sy stem to th e in p u t unit sa m p le se q u e n c e a t n = it by th e special sym bol h(n, k), —oo < k < oo. T h a t is, y( n, k) = h(n. k ) = T[ S( n — £)] (2.3.11) In (2.3.11) w e n o te th a t n is th e tim e index a n d k is a p a r a m e te r sh ow ing th e lo c a tio n o f th e in p u t im p u lse. If th e im pulse at th e in p u t is sc aled by an a m o u n t ct = jc(it), th e re sp o n s e of th e system is th e c o rre sp o n d in g ly sc aled o u tp u t, th a t is, Ckh(n, k) = x(k)h(n, k) (2.3.12) Discrete-Time Signals and Systems 76 Chap. 2 F in ally , if th e in p u t is th e a rb itra ry signal x(/t) th a t is e x p re ss e d as a sum of w eig h ted im p u lses, th a t is. (2.3.13) th e n th e resp o n se o f the system to x(/i) is the c o rre sp o n d in g sum o f w eig h ted o u tp u ts, th a t is, y(rt) = 7"[.r(/;)] = T = ^ ^ x( k ) S( n — k) x ( k ) T [ 5 (m - k)] (2.3.14) ii= —oc C learly , (2.3.14) follow s from th e su p e rp o sitio n p ro p e rty of lin e a r system s, and is k n o w n as th e superposit i on s u mma t i o n . W e n o te th a t (2.3.14) is an e x p ressio n for th e resp o n se o f a lin e a r system to any a rb itra ry in p u t se q u e n c e x( n) . T his ex p ressio n is a fu n ctio n of b o th .v(») and th e resp o n ses h(n. k) of the system to th e unit im pulses Sin — k) fo r —oc < k < oc. In d eriv in g (2.3.14) w e used th e lin earity p ro p e rty o f th e system but not its tim ein v arian ce p ro p e rty . T h u s th e ex p ressio n in (2.3.14) ap p lies to any relax ed lin ear (tim e -v a ria n t) system . If. in a d d itio n , th e system is tim e in v a ria n t, th e fo rm u la in (2.3.14) sim plifies c o n sid erab ly . In fact, if the resp o n se o f th e L T I system to th e u n it sa m p le seq u en ce <5(rc) is d e n o te d as h(n). th a t is. h(n) = T [ b( n ) \ (2.3.15) th en by th e tim e-in v arian ce p ro p e rty , th e resp o n se o f the system to the delay ed u n it sa m p le se q u e n c e <5(n - k) is h(n — k) = T [ S( n — A')] (2,3.16) C o n seq u en tly , th e fo rm u la in (2.3.14) re d u c e s to (2.3.17) k=-oc N ow we o b serv e th a t th e relax ed L T I system is co m p letely c h a ra c te riz e d by a single fu n ctio n h(n), n am ely , its resp o n se to th e u n it sam p le se q u e n c e In c o n tra st, th e g en eral c h a ra c te riz a tio n of th e o u tp u t o f a tim e -v a ria n t, lin e a r sys­ tem re q u ire s an in fin ite n u m b e r o f u n it sa m p le re sp o n s e fu n ctio n s, h{n, k), o n e for ea c h p o ssib le d elay . T h e fo rm u la in (2.3.17) th a t gives th e re sp o n se y( n) of th e L T I system as a fu n c tio n o f th e in p u t signal x ( n ) a n d th e u n it sa m p le (im p u lse) re sp o n se h(n) is called a convol ut i on s um. W e say th a t th e in p u t jt(n ) is c o n v o lv ed w ith th e im p u lse Sec. 2.3 Analysis of Discrete-Time Linear Tim e-Invariant Systems 77 response h(n) to yield the output y in ). W e shall now explain the procedure for com puting the resp onse y (n ). both m athem atically and graphically, given the input x ( n ) and the im pulse response h(n) o f the system . Suppose that we wish to com pute the output of the system at som e time instant, say n = n 0. A ccordin g to (2.3.17), the resp onse at n = no is given as OC y (n 0) = ^ 2 x ( k ) h ( n 0 - k) (2.3.18) Jc=-oc O ur first observation is that the index in the sum m ation is k , and h en ce both the input signal x ( k ) and the im pulse resp onse h(no - k) are fun ction s o f k. Second, w e ob serve that the sequ en ces x ( k ) and h(nQ — k) are m ultiplied togeth er to form a product seq u en ce. T h e output >(«o) is sim ply the sum over all valu es o f the product sequ en ce. T he seq u en ce h ( n 0 — k) is ob tain ed from h ( k ) by, first, folding h (k) about k = 0 (the tim e origin), w hich results in the seq u en ce h ( —k). The folded seq u en ce is then shifted by no to yield h(no — k). T o sum m arize, the process o f com p utin g the con volu tion b etw een x ( k ) and h (k) in volves the follow in g four steps. 1. Folding. F old h(k) about k = 0 to obtain h ( ~ k ) . 2. Shifting, Shift h ( —k) by n 0 to the right (left) if n o is p ositive (n egative), to obtain h(no — £). 3. Multiplication. M ultiply v„ Jk) = x ( k ) h ( n 0 - k). by h (no — k) to obtain the product sequ en ce 4. S u m m a t i o n . Sum all the values o f the product seq u en ce vnt)( k ) to obtain the value o f the output at tim e n = n 0. W e note that this p rocedure results in the resp onse o f the system at a sin ­ gle tim e instant, say n = n 0. In gen eral, we are interested in evaluating the response o f the system over all tim e instants - o o < n < oo. C onsequently, steps 2 through 4 in the sum m ary m ust be rep eated , for all p ossible tim e shifts —oo < n < oo. In order to gain a b etter understanding o f the procedure for evaluating the convolution sum , w e shall dem onstrate the p rocess graphically. T he graphs will aid us in explaining the four steps in volved in the com p utation o f the convolution sum. Example 2.3.2 The impulse response of a linear time-invariant system is /!(«) = [1 .2 ,1 ,-1 } (2.3.19) T Determine the response of the system to the input signal x(n) = {1,2.3,1} t (2.3.20) Discrete-Time Signais and Systems Chap. 2 Solution We shall com pute the convolution according to the formula (2.3.17). but we shall use graphs of the sequences to aid us in the com putation. In Fig. 2.23a we illustrate the input signal sequence x(k) and the impulse response h{k) of the system, using k as the time index in order to be consistent with (2.3.17), The first step in the com putation of the convolution sum is to fold h(k). The folded sequence h(~k) is illustrated in Fig. 2.23b. Now we can compute the output at n = 0. according to (2.3.17), which is v(0) = (2.3.21) *=-cx Since the shift n = 0, we use h( —k) directly without shifting it. The product sequence = x(k)h(-k) (2.3.22) h(k) x(k 3 4i T 1 * -i -1 0 ! j 10 h(-k) • 1 2 3 L'n(k 1 2 . . -2 T ’t . . . -1 0 1 2 . (b) Shift vAk) Product ,,. L’ |{t) Product sequence h(\-k) 111 To Br T 7 (c) T . 2 ~3 T ! j-2 -1 0 1 1■ k 0 12 (d) Figure 2.23 G raphical com putation of convolution. * Sec. 2.3 Analysis of Discrete-Time Linear Time-Invariant Systems 79 is also shown in Fig. 2.23b. Finally, the sum of all the terms in the product sequence yields ■(°) = £ vott) = 4 We continue the com putation by evaluating the response of the system at n = 1. According to (2.3.17), (2.3.23) The sequence h(\ —k) is simply the folded sequence h( —k) shifted to the right by one unit in time. This sequence is illustrated in Fig. 2.23c. The product sequence V] (k} = x(k)h{l — k) (2.3.24) is also illustrated in Fig. 2.23c. Finally, the sum of all the values in the product sequence yields y(l) = £ ui(*) = 8 In a similar m anner, we obtain y(2) by shifting h ( - k ) two units to the right, forming the product sequence ih(A) = x(k)h(2 — k) and then summing all the terms in the product sequence obtaining y(2) = 8. By shifting h(—k) farther to the right, multiplying the corresponding sequence, and summing over all the values of the re­ sulting product sequences, we obtain v(3) = 3. v(4) = - 2 , y(5) = - 1 . For u > 5, we find that v(n) = 0 because the product sequences contain all zeros. Thus we have obtained the response y(n) for n > 0. Next we wish to evaluate v(n) for n < 0. We begin with n = Then (2.3.25) Now the sequence h (—1 —k) is simply the folded sequence h ( —k ) shifted one time unit to the left. The resulting sequence is illustrated in Fig. 2.23d. The corresponding product sequence is also shown in Fig. 2.23d. Finally, summing over the values of the product sequence, we obtain V (-1) = 1 From observation of the graphs of Fig. 2.23, it is clear that any further shifts of h (—1 - k) to the left always results in an all-zero product sequence, and hence y(n) = 0 for n 5 —2 Now we have the entire response of the system for —oc < n < oc. which we summarize below as y(n) = 0 ,0,1, 4. 8, 8. 3, - 2 , - 1 , 0 . 0 . . . .) t (2.3.26) 80 Discrete-Time Signals and Systems Chap. 2 In E x am p le 2.3.2 w e illu stra te d th e c o m p u ta tio n o f th e co n v o lu tio n sum . using g rap h s o f th e se q u en ces to aid us in visualizing th e ste p s in volved in th e c o m p u ta tio n p ro c e d u re . B e fo re w o rk in g o u t a n o th e r ex a m p le , w e w ish to show th a t th e co n v o lu ­ tio n o p e ra tio n is c o m m u ta tiv e in th e se n se th a t it is irre le v a n t w hich of th e tw o se q u e n c e s is fo ld ed a n d shifted. In d e e d , if w e b eg in w ith (2.3.17) a n d m ak e a ch an g e in th e v ariab le o f th e su m m a tio n , fro m k to m , by defin in g a new index m — n — k, th e n k = n — m an d (2.3.17) b e co m es CC y(n) = ^2 m— — x( n — m ) h { m ) (2.3.27) Since m is a d u m m y in dex, w e m ay sim ply re p la c e m by k so th a t y{n) = x(n-k)h(k) (2.3.28) T h e ex p ressio n in (2.3.28) involves leav in g th e im p u lse re sp o n s e h( k) u n a lte re d , w hile th e in p u t se q u en ce is fo ld ed a n d sh ifted . A lth o u g h th e o u tp u t v(n) in (2.3.28) is id en tical to (2.3.17), th e p ro d u c t se q u e n c e s in th e tw o fo rm s o f th e co n v o lu tio n fo rm u la are not id en tical. In fact, if w e define th e tw o p ro d u c t se q u e n c e s as v„(k) = x ( k ) h ( n — k) w n(k) = x( n — k) h(k) it can b e easily show n th at un(£) = w n (n — k) an d th e re fo re , v(n) = CC CC ^ ^ k——oc ~ k) oc since b o th se q u en ces co n tain th e sam e sa m p le v alu es in a d iffe re n t a rra n g e m e n t. Example 2.3.3 Determ ine the output y(n) of a relaxed linear tim e-invariant system with impulse response h(ri) = a"u(n), \a\ < 1 when the input is a unit step sequence, that is, x (n) = u(n) Solution In this case both /j(n) and jc(n) are infinite-duration sequences. We use the form of the convolution formula given by (2.3.28) in which x (k) is folded. The Sec. 2.3 81 Analysts of Discrete-Time Linear Tim e-Invariant Systems h{k\ x(k) TT i f 1 1 2 3 4 * (b) I'oCA') x(- k) l * 1 -3 -2 -1 -1 0 1 - A (c) A(1 - k ) > i'i(i-) a 1 - 1 0 v( 2—k) k 1 1':(!> II - 2 - 1 0 1 2 3 4 5 Figure 2.24 k Graphical computation of convolution in Example 2.3.3. sequences h(k), x(k). and x{—k) are shown in Fig. 2.24. The product sequences vo(k). v\(k), and v2(k) corresponding to x ( —k)h(k), x (l —k)h(k), and x(2 - k)h(k) are illus­ trated in Fig. 2.24c, d. and e. respectively. Thus we obtain the outputs v(0) = 1 y(l) = 1 + a y( 2) = 1 + a + a 1 Discrete-Time Signals and Systems 82 Chap. 2 Clearly, for n > 0, the output is y(n) = 1 + a 4- a2 + ■• ■+ a” 1 _ an+1 (2.3,29) = 1-a On the other hand, for n < 0, the product sequences consist of all zeros. Hence v(n) = 0 n < 0 A graph of the output y(n) is illustrated in Fig. 2.24f for the case 0 < a < 1. Note the exponential rise in the output as a function of n. Since |a| < 1, the final value of the output as n approaches infinity is v(oo) = lim v(n) = ------n-*oc ' 1 —a (2.3.30) T o su m m arize, th e co n v o lu tio n fo rm u la p ro v id e s us w ith a m ean s fo r co m ­ p u tin g th e re sp o n s e o f a re lax ed , lin ear tim e -in v a ria n t system to an y a rb itra ry in p u t signal x( n). It ta k e s o n e o f tw o e q u iv a le n t form s, e ith e r (2.3.17) o r (2,3.28), w h ere jt(n ) is th e in p u t sig n al to th e system , h (n ) is th e im p u lse re s p o n s e of th e system , an d y (n ) is th e out p u t o f th e system in re sp o n s e to th e in p u t signal x (n ). T he e v a lu a tio n o f th e co n v o lu tio n fo rm u la involves fo u r o p e ra tio n s , n am ely: f ol di ng e ith e r th e im p u lse re sp o n s e as specified by (2.3.17) o r th e in p u t se q u e n c e as sp ec­ ified by (2.3.28) to yield e ith e r h ( —k) o r x { —k). resp ec tiv ely , shifting th e folded se q u e n c e by n u n its in tim e to yield e ith e r h{n — k ) o r x { n — k ). mul t i pl yi ng the tw o se q u e n c e s to yield th e p ro d u c t se q u en ce, e ith e r x { k) h{ n — k) o r x ( n - k ) h ( k ) , a n d finally s u m m i n g all th e v alu es in th e p ro d u c t se q u e n c e to y ield th e o u tp u t v (n ) o f th e sy stem a t tim e n. T h e folding o p e ra tio n is d o n e only o n ce. H o w ev er, th e o th e r th re e o p e ra tio n s a re re p e a te d fo r all p o ssib le shifts —oc < n < oo in o rd e r to o b ta in y (n ) fo r —oo < n < oc. 2.3.4 Properties of Convolution and the Interconnection of LTI Systems In th is se ctio n w e in v estig ate so m e im p o rta n t p ro p e rtie s o f co n v o lu tio n an d in ­ te r p re t th e se p r o p e rtie s in te rm s o f in te rc o n n e c tin g lin ear tim e -in v a ria n t system s. W e sh o u ld stress th a t th ese p ro p e rtie s h o ld fo r e v e ry in p u t signal. It is c o n v e n ie n t to sim plify th e n o ta tio n by using an a s te ris k to d e n o te the c o n v o lu tio n o p e ra tio n . T h u s OC y( n) = x{n) * h(n) = ^ x ( k ) h ( n — k) (2.3.31) Jt = - O C In th is n o ta tio n th e se q u e n c e follow ing th e aste risk [i.e., th e im p u lse re sp o n se /i(«)] is fo ld e d an d sh ifted . T h e in p u t to th e sy stem is ;c(n). O n th e o th e r h a n d , we also sh o w ed th a t OC >>(n) = h{n) * x( n) = ^ k=-oc h ( k ) x ( n - k) (2.3.32) Sec. 2.3 83 Analysis of Discrete-Time Linear Time-Invariant Systems hin) h(n) Figure 2.25 < = > v(n ) xin) Interpretation of the commutative property of convolution. In th is fo rm o f th e co n v o lu tio n fo rm u la, it is the in p u t signal th a t is fo ld ed . A lte r ­ n ativ ely . we m ay in te r p re t this fo rm o f the c o n v o lu tio n fo rm u la as re su ltin g from an in te rc h a n g e o f th e ro les o f j:(n) an d h(n). In o th e r w ords, w e m ay re g a rd x( n) as th e im p u lse re sp o n se o f th e system an d h( n) as the e x c ita tio n o r in p u t signal. F ig u re 2.25 illu stra te s th is in te rp re ta tio n . W e can view co n v o lu tio n m o re ab stractly as a m a th e m a tic a l o p e ra tio n b e ­ tw een tw o signal se q u e n c e s, say x( n ) a n d h(n), th a t satisfies a n u m b e r o f p ro p e rtie s . T h e p ro p e rty e m b o d ie d in (2.3.31) an d (2.3.32) is called th e c o m m u ta tiv e law'. Commutative law jf(n) * h{n) = h(n) * x( n) (2.3.33) V iew ed m a th e m a tic a lly , the c o n v o lu tio n o p e ra tio n also satisfies th e asso cia­ tive law , w hich can be sta te d as follow s. Associative law [-v(/i) * /?[(«)] * h 2(/i) — x( n) * [/*!(«) * (2.3.34) F ro m a physical p o in t o f view, we can in te rp re t x (n) as the in p u t signal to a lin e a r tim e -in v a ria n t system w ith im pulse re sp o n se /j|(/i). T h e o u tp u t o f this sy stem , d e n o te d as v i(n ), b eco m es the in p u t to a seco n d lin e a r tim e -in v a ria n t sy stem w ith im p u lse re sp o n se hzin). T h en th e o u tp u t is y( n) — V] (n) * h 2(n) = [j:(fi) * h\(n)] * h2(n) w hich is p recisely th e left-h an d side of (2.3.34). T h u s th e le ft-h a n d side o f (2.3.34) c o rre sp o n d s to h av in g tw o lin ear tim e -in v a ria n t system s in cascad e. N ow th e righth an d side o f (2.3.34) in d icates th a t th e in p u t x ( n ) is a p p lied to an e q u iv a le n t system h av in g an im p u lse re sp o n se , say h(n), w hich is e q u a l to the co n v o lu tio n o f th e tw o im p u lse resp o n se s. T h a t is, h(n) = h](n) * h?(n) an d y(n) = x( n ) * h(n) F u rth e rm o re , sin ce th e co n v o lu tio n o p e ra tio n satisfies th e c o m m u ta tiv e p ro p e rty , o n e can in te rc h a n g e th e o r d e r o f th e tw o system s w ith re sp o n s e s h \ ( n ) a n d hzi n) w ith o u t a lte rin g th e o v erall in p u t-o u tp u t re la tio n sh ip . F ig u re 2.26 g rap h ically il­ lu stra te s th e asso ciativ e p ro p e rty . 84 Discrete-Time Signals and Systems xin) jr(n) y(«) h(n) = Chap. 2 y{/i) h\(n) * h2(n) (a) x(n) h,(n) y</i) v(n) h2(n) h t(n) (b) Figure Z 2 6 Implications of the associative (a) and the associative and commuta­ tive (b) properties of convolution. Example 2.3.4 D eterm ine the impulse response for the cascade of two iinear time-invariant systems having impulse responses h \ («) = ( j W " ) and Solution To determ ine the overall impulse response of the two systems in cascade, we simply convolve h}{n) with h2(n). Hence where h2(n) is folded and shifted. We define the product sequence v„(k) = h\(k)h2(n - k) = (£)*(*)"-* which is nonzero for k > 0 and n - k > 0 or n > k > 0. On the o th er hand, for n < 0, we have v„(k) = 0 for all k, and hence h{n) = 0, n < 0 For n > k > 0. the sum of the values of the product sequence v„(k) over all k yields hin) = tscO = Hr = (i)"(2"+l - 1 ) Sec. 2.3 Analysis of Discrete-Time Linear Tim e-Invariant Systems 85 T h e g e n e ra liz a tio n o f the associative law to m o re th a n tw o system s in cascade follow s easily fro m th e d iscu ssio n given ab o v e. T h u s if w e h av e L lin e a r tim ein v arian t sy stem s in cascade w ith im p u lse re sp o n se s h\ ( u) . h ^ i n ) ........ h L (n). th ere is an e q u iv a le n t lin e a r tim e -in v a ria n t sy stem hav in g an im p u lse re sp o n se th a t is e q u a l to th e (L — l)-fo id co n v o lu tio n of th e im p u lse resp o n se s. T h a t is. h( n) = h \ { n ) * hzi n) * ■■■* h L (n) (2.3.35) T h e c o m m u ta tiv e law im p lies th a t th e o rd e r in w hich the c o n v o lu tio n s a re p e r ­ fo rm e d is im m a te ria l. C o n v e rsely , an y lin e a r tim e -in v a ria n t system can be d e c o m ­ p o se d in to a cascad e in te rc o n n e c tio n o f subsystem s. A m e th o d for accom plishing th e d e c o m p o s itio n will be d escrib ed later. A th ird p ro p e rty th a t is satisfied by th e c o n v o lu tio n o p e ra tio n is the d istrib u ­ tive law, w hich m ay be sta te d as follow s. Distributive law xin) * 4- = .xin) * h\ {n) 4- x i n ) * hzi n) (2.3.36) I n te rp r e te d physically, this law im plies th a t if we h ave tw o lin ear tim ein v a ria n t sy stem s w ith im p u lse re sp o n se s h \ i n ) a n d /?;(») ex cited by the sam e in p u t signal .r(/;), th e sum of the tw o resp o n ses is identical to the resp o n se of an o v erall system w ith im pulse resp o n se h i n ) = )i\ in) 4- //:(/;) T h u s th e o v erall system is view ed as a p arallel co m b in a tio n of the tw o linear tim e -in v a ria n t sy stem s as illu stra te d in Fig. 2.27, T h e g e n e ra liz a tio n o f (2.3.36) to m o re th an tw o lin e a r tim e-in v arian t sys­ tem s in p a rallel follow's easily by m a th e m a tic a l in d u ctio n . T h u s th e in te rc o n n e c ­ tio n of L lin ear tim e -in v a ria n t system s in p a ra lle l w ith im p u lse resp o n ses h\ i n) . h z i n ) .........h L{n) a n d ex cited by the sa m e in p u t x i n ) is e q u iv a le n t to o n e overall system w ith im p u lse re sp o n se L h(n) — ^ hj i n) (=i (2.3.37) C o n v e rsely , an y lin ear tim e -in v a ria n t system can be d e c o m p o se d into a p arallel in te rc o n n e c tio n o f su b sy stem s. Figure 2.27 Interpretation of the distributive property of convolution: two LTI systems connected in parallel can be replaced by a single system with h(n) = (n) + k2{n). Discrete-Time Signals and Systems 86 Chap. 2 2.3.5 Causal Linear Time-Invariant Systems In S ectio n 2.2.3 w e d efin ed a causal system as o n e w hose o u tp u t at tim e n d e p en d s o n ly on p re s e n t an d p ast in p u ts b u t d o es n o t d e p e n d on f u tu re in p u ts. In o th e r w o rd s, th e o u tp u t o f the. sy stem at so m e tim e in s ta n t n, say n = no, d e p e n d s only on v alu es o f jc(«) fo r n < n 0In th e case o f a lin e a r tim e -in v a ria n t system , cau sality can b e tra n sla te d to a c o n d itio n o n th e im p u lse resp o n se. T o d e te rm in e this re la tio n sh ip , le t us co n sid e r a lin ear tim e -in v a ria n t system having an o u tp u t a t tim e n = no given by th e c o n v o lu tio n fo rm u la OC v (« o ) = ^2 h ( k ) x (n o ~ k ) k —- o c S u p p o se th a t w e su b d iv id e th e sum in to tw o sets o f term s, o n e se t involving p re se n t a n d p a st v alu es o f th e in p u t [i.e.. x{n) for n < n 0] a n d o n e se t involving fu tu re valu es o f th e in p u t [i.e., n > no]. T h u s we o b ta in OC -I y (n u) — ^ h ( k ) x ( n o - k) + i=0 h( k) x( nu - k) ^ k ——oc = [/ ?(0)x (n ()) + h( \ ) x( r tu - 1) + h ( 2 ) x ( n 0 - 2 ) + ■■•] + [/?( —1 )x(«(] + 1) + h ( - 2 ) x ( n o + 2) + ■■ ■] W e o b se rv e th a t th e term s in th e first sum involve jr(no), x( no — 1).........w hich are th e p re s e n t a n d p ast values of th e in p u t signal. O n th e o th e r h a n d , th e te rm s in th e se co n d sum in volve th e in p u t signal c o m p o n e n ts ;c(no + l) , x { n o -f 2 ) .........N ow , if th e o u tp u t a t tim e n = n 0 is to d e p e n d only on th e p re s e n t a n d p a st in p u ts, th en , clearly , th e im p u lse re sp o n se o f th e system m u st satisfy th e c o n d itio n ft(n) = 0 n < 0 (2.3.38) Since h{n) is th e re sp o n se o f th e re lax ed lin e a r tim e -in v a ria n t sy stem to a u nit im p u lse a p p lied a t n = 0, it follow s th a t h(n) = 0 fo r n < 0 is b o th a necessary an d a sufficient c o n d itio n fo r causality. H e n c e an L T I syst em is causal i f a n d onl y i f its i mpul se respons e is z e r o f o r negative values o f n. Since fo r a cau sal sy stem , h(n) = 0 fo r n < 0, th e lim its on th e su m m a tio n of th e co n v o lu tio n fo rm u la m ay be m odified to reflect th is re stric tio n . T h u s w e h ave th e tw o e q u iv a le n t form s OC y ( n ) = ^ h ( k ) x ( n - k) Jt=0 n = ^ x{k) h{n — k) k=~oc (2.3.39) (2.3.40) A s in d icated p rev io u sly , cau sality is re q u ire d in an y re a l-tim e signal p ro c e ss­ ing a p p licatio n , since at a n y given tim e n w e have n o access to f u tu re v alu es o f th e Sec. 2.3 Analysis of Discrete-Time Linear Time-Invariant Systems 87 in p u t signal. O n ly th e p re s e n t a n d p ast v alu es o f the in p u t signal are av ailab le in c o m p u tin g th e p re s e n t o u tp u t. It is so m e tim e s c o n v e n ie n t to call a se q u en ce th a t is z e ro fo r n < 0, a causa! s e q u e n c e , an d o n e th a t is n o n z e ro fo r n < 0 a n d n > 0. a n on c aus al sequence. T his te rm in o lo g y m e a n s th a t su c h a se q u e n c e could be th e u n it sa m p le re sp o n se of a causal o r a n o n c a u sa l system , resp ectiv ely . If th e in p u t to a causal lin e a r tim e -in v a ria n t system is a causal se q u e n c e [i.e., if jr(n) = 0 fo r n < 0]. th e lim its on th e co n v o lu tio n fo rm u la a re fu rth e r restricted . In th is case th e tw o e q u iv a le n t form s o f th e c o n v o lu tio n fo rm u la b eco m e n y ( n ) = ^ h( k ) x ( n — k) (2.3.41) *=o n = -k) (2.3.42) *■=<) W e o b se rv e th a t in th is case, th e lim its on the su m m a tio n s fo r the tw o a lte rn a tiv e fo rm s are id en tical, a n d th e u p p e r lim it is grow ing w ith tim e. C learly , th e resp o n se o f a cau sal sy stem to a causal in p u t se q u e n c e is causal, since y( n) — 0 fo r n < 0. Example 2.3.5 Determ ine the unit step response of the linear time-invariant system with impulse response h{n) = a " u( n ) \a\ < 1 Solution Since the input signal is a unit step, which is a causal signal, and the system is also causal, we can use one of the special forms of the convolution formula, either (2.3.41) or (2.3.42). Since x(n) = 1 for n > 0. (2.3.41) is simpler to use Because of the simplicity of this problem, one can skip the steps involved with sketching the folded and shifted sequences. Instead, we use direct substitution of the signals sequences in (2.3.41) and obtain y(n) = y ~ v *=(I 1 - a"*1 1 -ci and y(n) = 0 for n < 0. We note that this result is identical to that obtained in Ex­ ample 2.3.3. In this simple case, however, we computed the convolution algebraically without resorting to the detailed procedure outlined previously. 2.3.6 Stability of Linear Time-Invariant Systems A s in d ic a te d p rev io u sly , sta b ility is an im p o rta n t p ro p e rty th a t m u st be co n sid e re d in an y p ra c tic a l im p le m e n ta tio n o f a system . W e d efin ed an a rb itra ry relax ed system as B IB O sta b le if a n d only if its o u tp u t se q u e n c e y («) is b o u n d e d fo r every b o u n d e d in p u t x ( n) . 88 Discrete-Time Signals and Systems Chap. 2 If x ( n ) is b o u n d e d , th e re exists a c o n s ta n t M x such th a t l* (n )l < M x < 0 0 S im ilarly, if th e o u tp u t is b o u n d e d , th e re exists a c o n s ta n t M y such th a t | ^ ( n ) | < My < OO fo r all n. N ow , given such a b o u n d e d in p u t se q u e n c e x ( n ) to a lin e a r tim e -in v a ria n t sy stem , le t us in v e stig a te th e im p licatio n s of th e d efin itio n o f sta b ility o n th e c h a r­ acteristics o f th e system . T o w a rd th is en d , w e w o rk again w ith th e c o n v o lu tio n fo rm u la OO y( n) = £ h{k) x{n - k ) k=—oc If w e ta k e th e a b so lu te value of b o th sides o f th is e q u a tio n , w e o b tain h( k ) x ( n — k) Y Lv(«)| = * = -O C N ow , th e ab so lu te v alu e of th e sum o f term s is alw ays less th a n o r e q u a l to the sum o f th e a b so lu te v alu es o f th e term s. H e n c e OC \y(n)\ < Y IM*)II*(/1 - fc)l i = —oc If th e in p u t is b o u n d e d , th e re exists a finite n u m b e r M x such th a t |x(n)[ < M t , By su b s titu tin g th is u p p e r b o u n d fo r x( n ) in th e e q u a tio n ab o v e, w e o b ta in OC' |y (n )| < M X Y W * )l k = -o c F ro m th is ex p ressio n w e o b se rv e th a t th e o u tp u t is b o u n d e d if th e im p u lse resp o n se o f th e sy stem satisfies th e co n d itio n OO Sh = Y k = -o c IAWI < 00 <2-3-43) T h a t is, a linear time-invari ant s y s t em is stable i f its i mpu l s e respons e is absolutely s u m m a b l e . T h is c o n d itio n is n o t only sufficient b u t it is also n e c e ssa ry to e n su re th e sta b ility o f th e system . In d e e d , w e shall show th a t if 5* = 00, th e r e is a b o u n d e d in p u t fo r w hich th e o u tp u t is n o t b o u n d e d . W e c h o o se th e b o u n d e d in p u t ■ \h*(-n)\ 0, h{n) ? 0 h(n) = 0 w h e re h*(n) is th e co m p lex c o n ju g a te o f h(n). I t is sufficient to show th a t th e re is o n e v alu e o f n fo r w h ich y( n) is u n b o u n d e d . F o r n = 0 w e h av e ,< 0 ,= £ ; *= “ 00^ k = —(x. 1 v /l Thus, if Si, = 00, a bounded input produces an unbounded output since y(0) = 00. Sec. 2.3 Analysis of Discrete-Time Linear Tim e-Invariant Systems 89 T h e c o n d itio n in (2.3.43) im plies th a t th e im p u lse re s p o n s e h(n) goes to zero as n a p p ro a c h e s infinity. A s a co n se q u e n c e , th e o u tp u t o f th e system g o es to zero as n a p p ro a c h e s infinity if th e in p u t is set to z e ro b ey o n d n > n 0. T o p ro v e this, su p p o se th a t |j ( h ) | < M x fo r n < no an d x ( n ) = 0 fo r n > no- T h e n , at n = no + N, th e system o u tp u t is (no + AO = ^ h ( k ) x ( n 0 + N - k) + ^ *-=-oc h { k ) x ( n 0 + N - k) B u t th e first su m is z e ro since * («) = 0 fo r n > no- F o r th e rem ain in g p a rt, we ta k e th e a b so lu te v alu e o f th e o u tp u t, w hich is j oc y («0 + AO| = I sc h( k)x(no + N — £)j < < Mx |/i(/:)||jf(no + N — £)| W *)! k=N N ow , as N a p p ro a c h e s infinity. an d hen ce lim ]\ {/i() + AO! = 0 T h is re su lt im p lies th a t any ex citatio n at th e in p u t to th e system , w hich is of a finite d u ra tio n , p ro d u c e s an o u tp u t th a t is “tra n s ie n t” in n a tu re ; th a t is, its am p litu d e d ecay s w ith tim e an d dies o u t e v en tu ally , w h en th e system is stab le. Example 2.3.6 Determ ine the range of values of the param eter a for which the linear time-invariant system with impulse response hin) = a"u(n) is stable. Solution First, we note that the system is causal. Consequently, the lower index on the summation in (2.3.43) begins with k = 0. Hence Clearly, this geom etric series converges to provided that \a\ < 1 . Otherwise, it diverges. Therefore, the system is stable if |a| < 1. Otherwise, it is unstable. In effect, h(.n) must decay exponentially toward zero as n approaches infinity for the system to be stable. 90 Discrete-Time Signals and Systems Chap. 2 Example 23.7 D eterm ine the range of values of a and b for which the linear time-invariant system with impulse response ... ( a", n > 0 h(-n) = [ iw.f , n < n0 is stable. Solution This system is noncasual. The condition on stability given by (2.3.43) yields OC t : -1 OC i*(«)f= n= -o c ia i" + fi=s(J y i |fe,n n= -o c From Example 2.3.6 we have already determ ined that the first sum converges for |a| < 1. The second sum can be manipulated as follows: = p( l + p + p 2 + ■■■) = I - p where p = \f\b\ must be less than unity for the geometric series to converge. Conse­ quently, the system is stable if both \a\ < 1 and |fc| > 1 are satisfied, 2.3.7 Systems with Finite-Duration and Infinite-Duration Impulse Response U p to this p oin t w e have characterized a linear tim e-invariant system in term s of its im pulse resp onse h(n). It is also con ven ien t, how ever, to subdivide the class o f linear tim e-invariant system s in to tw o types, those that h ave a finite-duration im pulse resp onse (F IR ) and those that have an infinite-duration im pulse response (IIR ). Thus an F IR system has an im pulse resp onse that is zero ou tsid e o f som e finite tim e interval. W ithout loss o f generality, w e focus our atten tion on causal FIR system s, so that h (n) = 0 n < 0 and n > M The con volu tion form ula for such a system reduces to u-1 ? ( n ) = H h ^ x(^n ~ k ) t=0 A useful interpretation o f this exp ression is ob tain ed by ob serving that th e output at any tim e n is sim ply a w eigh ted iinear com b ination o f the in p ut signal sam ples x (n ), x { n - 1 ) , , x ( n - M + 1). In other words, the system sim ply w eigh ts, by the values o f the im pulse resp onse h(k), k = 0, 1, — 1, the m ost recent M signal sam ples and sum s the resulting M products. In e ffe ct, th e system acts as a w in d o w that view s on ly the m ost recent M input signal sam p les in form ing the output. It n eg lects or sim ply “forgets” all prior input sam p les [i.e., x ( n — M ), Sec. 2.4 Discrete-Time Systems Described by Difference Equations 91 x ( n — M — 1). . . .] . T h u s we say th a t an F IR svstem has a finite m e m o ry o f len g th -M sam p les. In c o n tra st, an I I R lin e a r tim e-in v arian t system has an in fin ite -d u ra tio n im ­ pu lse resp o n se. Its o u tp u t, b ased on th e c o n v o lu tio n fo rm u la, is v(n) = ^ >2h(k) x( n - k ) w h ere cau sality h as b e e n assu m ed , a lth o u g h this a ssu m p tio n is n o t n ecessary. N ow . th e system o u tp u t is a w eig h te d [by the im p u lse re sp o n se *(/:}] lin e a r co m b in a tio n o f th e in p u t sig n al sa m p le s .r(n), x{n - 1), x( n — 2 ) ........ S ince this w eig h te d sum in v olves th e p re s e n t an d all th e p ast in p u t sam ples, w e say th a t th e sy stem has an infinite m em o ry . W e in v e stig a te th e c h aracteristics of F IR an d IIR sy stem s in m o re d etail in su b s e q u e n t c h a p te rs. 2.4 DISCRETE-TIME SYSTEMS DESCRIBED BY DIFFERENCE EQUATIONS U p to this p o in t w e h ave tre a te d linear and tim e-in v arian t sy stem s th a t are c h a r­ a c terized by th e ir u n it sa m p le resp o n se h(n). In tu rn . h(n) allow s us to d e te rm in e th e o u tp u t v{n) o f th e system for any given in p u t se q u e n c e jc(/i) by m e a n s o f the c o n v o lu tio n su m m a tio n . (2.4.1) In g e n e ra l, th e n , we h av e show n th a t any linear tim e -in v a ria n t system is c h a r­ a c terized by th e in p u t- o u tp u t rela tio n sh ip in (2.4.1). M o re o v e r, th e co n v o lu tio n su m m a tio n fo rm u la in (2.4.1) suggests a m ean s fo r th e re a liz a tio n o f th e system . In th e case o f F IR sy stem s, such a realizatio n in v o lv es a d d itio n s, m u ltip lic atio n s, a n d a finite n u m b e r o f m e m o ry locations. C o n se q u e n tly , an F IR system is read ily im p le m e n te d d irectly , as im p lied by the c o n v o lu tio n su m m atio n . If th e sy stem is IIR , h o w ev er, its practical im p le m e n ta tio n as im p lied by c o n v o lu tio n is clearly im p o ssib le, since it re q u ire s an infinite n u m b e r o f m e m ­ o ry lo catio n s, m u ltip lic a tio n s, an d ad d itio n s. A q u e stio n th a t n a tu ra lly arises, th e n , is w h e th e r o r n o t it is possible to realize IIR sy stem s o th e r th a n in the form su g g e sted by th e c o n v o lu tio n su m m atio n . F o rtu n a te ly , th e an sw er is yes. th e re is a p ra c tic a l an d c o m p u ta tio n a lly efficient m e a n s fo r im p le m e n tin g a fam ily o f IIR sy stem s, as will b e d e m o n s tra te d in th is se ctio n . W ith in th e g en ­ eral class o f IIR sy stem s, this fam ily of d isc re te -tim e sy stem s is m o re c o n ­ v en ien tly d e s c rib e d by d ifferen ce eq u atio n s. T h is fam ily o r subclass of IIR sy stem s is v ery u sefu l in a v ariety o f p ractical ap p licatio n s, in clu d in g th e im p le ­ m e n ta tio n o f d ig ita l filters, a n d the m o d elin g o f physical p h e n o m e n a a n d physical system s. 92 Discrete-Time Signals and Systems Chap. 2 2.4.1 Recursive and Nonrecursive Discrete-Time Systems A s in d icated ab o v e, th e co n v o lu tio n su m m a tio n fo rm u la e x p re sse s th e o u tp u t of th e lin e a r tim e -in v a ria n t sy stem explicitly a n d only in te rm s o f th e in p u t signal. H o w e v e r, th is n e e d n o t b e th e case, as is sh o w n h e re . T h e re a re m an y system s w h ere it is e ith e r n ecessa ry o r d e sirab le to ex p re ss th e o u tp u t o f th e system n o t on ly in term s o f th e p re s e n t a n d p a st v alu es o f th e in p u t, b u t also in te rm s o f the a lre a d y av ailab le p a st o u tp u t values. T h e follow ing p ro b le m illu stra te s th is point. S u p p o se th a t w e w ish to c o m p u te th e cumul at i ve average o f a signal x ( n ) in th e in te rv a l 0 < k < n, d efin ed as 1 " v(n) = ------- « = 0 . 1, . . . n + 1 ~—f. (2.4.2) A s im p lied b y (2.4.2), th e c o m p u ta tio n o f _v(n) re q u ire s th e sto ra g e o f all th e in p u t sa m p le s x (k ) fo r 0 < k < n. Since n is in creasin g , o u r m em o ry r e q u ire m e n ts grow lin early w ith tim e. O u r in tu itio n suggests, h o w ev er, th a t y( n) can be c o m p u te d m o re efficiently by utilizin g th e p re v io u s o u tp u t v alue y( n — 1). In d e e d , by a sim p le alg eb raic re a rra n g e m e n t o f (2.4.2), we o b ta in it—l (« + l)y (n ) = x(k) + x(n) = ny( n - 1) + x {n) a n d h en ce y( n) = 1 -x(n) ■y(n - 1) + n + 1' n + 1' (2.4.3) N ow , th e cu m u lativ e a v erag e v(n) can b e c o m p u te d recu rsiv ely b y m u ltip ly in g th e p re v io u s o u tp u t v a lu e y( n - 1) by n/ ( n 4-1 ), m u ltip ly in g th e p r e s e n t in p u t x ( n ) by 1 / (n + 1), an d a d d in g th e tw o p ro d u cts. T h u s th e c o m p u ta tio n o f y (n ) by m ean s o f (2.4.3) re q u ire s tw o m u ltip lic atio n s, o n e a d d itio n , a n d o n e m e m o ry lo catio n , as illu stra te d in Fig. 2.28. T his is an ex a m p le of a recursive s yst em. In g e n e ra l, a sy stem w hose o u tp u t v(n) a t tim e n d e p e n d s o n a n y n u m b e r o f p a s t o u tp u t values y( n - 1), y ( n - 2 ) , . . . is called a recu rsiv e system . tin) Figure 2.28 Realization of a recursive cum ulative averaging system. Sec. 2.4 Discrete-Time Systems Described by Difference Equations 93 T o d e te rm in e th e c o m p u ta tio n of the recu rsiv e sy stem in (2.4.3) in m ore d etail, su p p o se th a t we begin th e p ro cess w ith n = 0 a n d p ro c e e d fo rw a rd in tim e. T h u s, acco rd in g to (2.4.3). we o b ta in y(0) - jc(0) v (l) = 5.v(0) + U ( l ) y(2) = § y ( l ) + i* ( 2 ) an d so on. If o n e grow s fatig u ed w ith this c o m p u ta tio n an d w ishes to pass the p ro b le m to so m e o n e else at som e tim e, say n = no. th e only in fo rm a tio n th a t one n e e d s to p ro v id e his o r h e r su ccesso r is the p a st value y(«o - 1) a n d the new' input sa m p le s jr(n), j (/j + 1 )........ T h u s the successor b eg in s w ith an d p ro c e e d s fo rw ard in tim e until som e tim e, say n = n j. w h en he or she b e­ co m es fatig u ed an d passes the c o m p u ta tio n a l b u rd e n to so m e o n e else w ith the in fo rm a tio n o n th e value _v(/?i — 1). an d so on. T h e p o in t wc wish to m ak e in th is discussion is th a t if o n e w ishes to co m p u te th e re sp o n se (in this case, the cu m u lativ e av e ra g e ) of the sy stem (2,4.3) to an input signal x( n ) a p p lied at n — tiu. we n eed th e value y (n (, - 1) an d th e input sam ples x ( n ) for /? > /in. T h e term y(>i() — 1) is called th e initial condi t i on for the system in (2.4.3) an d c o n ta in s all the in fo rm a tio n n e e d e d to d e te rm in e th e re sp o n se o f the sy stem for n > « () to th e in p u t signal x (n ). in d e p e n d e n t o f w h at has o ccu rred in th e p ast. T h e fo llow ing ex am p le illu strates th e use o f a (n o n lin e a r) recu rsiv e system to co m p u te th e sq u a re ro o t of a n u m b e r. Exam ple 2.4.1 Square-Root Algorithm Many computers and calculators compute the square root of a positive number A. using the iterative algorithm where j_i is an initial guess (estimate) of \/~A. As the iteration converges we have = J~A. Consider now the recursive system sn ~ s„_j. T hen it easily follows that (2.4.4) which is realized as in Fig, 2.29. If we excite this system with a step of amplitude A [i.e.. x(n) = A u ( n )] and use as an initial condition y(—1) an estimate of the response v(«) of the system will tend toward as n increases. Note that in contrast to the system (2.4.3), we do not need to specify exactly the initial condition. A rough estim ate is sufficient for the proper perform ance of the system. For example, if we 94 Discrete-Time Signals and Systems Chap. 2 -0---- -0 4n) v(n - I) Figure Z 2 9 Realization of the square-root system. let A = 2 and y ( - l ) = 1, we obtain j(0 ) = >-(1) = 1,4166667, v(2) = 1,4142157. Similarly, for y ( —1) = 1.5, we have v(0) = 1,416667, y (l) = 1.4142157. Compare these values with the %/2, which is approximately 1.4142136. W e h av e no w in tro d u c e d tw o sim ple recu rsiv e system s, w h ere th e o u tp u t vf/i) d e p e n d s o n th e p re v io u s o u tp u t v alu e y( n — 1) a n d th e c u rre n t in p u t ;r(n). B o th system s a re causal. In g e n e ra l, w e can fo rm u la te m o re co m p lex cau sal recu rsiv e system s, in w hich th e o u tp u t y ( n ) is a fu n ctio n o f se v era l p ast o u tp u t v alu es an d p re se n t a n d p ast in p u ts. T h e system sh o u ld h av e a finite n u m b e r o f d elay s o r, eq u iv alen tly , sh o u ld re q u ire a finite n u m b e r o f sto ra g e lo catio n s to be p ractically im p le m e n te d . T h u s th e o u tp u t o f a cau sal a n d p ractically re a liz a b le recursive system can be e x p ressed in g e n e ra l as y( n) = F[y( n — 1), y( n — 2 ) , . . . , y( n — N ) , x ( n) , x ( n — 1 ) , . . . , x ( n — M ) \ (2.4.5) w h ere F [ ] d e n o te s so m e fu n ctio n of its a rg u m e n ts. T h is is a re c u rsiv e e q u a tio n specifying a p ro c e d u re fo r co m p u tin g th e system o u tp u t in term s o f p rev io u s v alu es o f th e o u tp u t a n d p re s e n t an d p ast inputs. In c o n tra st, if y{n) d e p e n d s only o n th e p re s e n t an d p a st in p u ts, th e n y (n ) = F[ x ( n ) , x ( n — 1)........ x(rt — M) ] (2.4.6) S uch a sy stem is called nonrecursi ve. W e h a s te n to ad d th a t th e c a u s a l F IR system s d escrib ed in S ectio n 2.3.7 in te rm s o f th e co n v o lu tio n sum fo rm u la h av e th e fo rm o f (2.4.6). In d e e d , th e c o n v o lu tio n su m m a tio n fo r a cau sal F IR sy stem is M y ( n) = - *) i=0 = h( 0 ) x ( n ) -)- h ( \ ) x ( n — 1) + • - • + h ( M ) x ( n — M ) — F [j:(n ), x( n — 1), . . . , x ( n — M )] w h ere th e fu n ctio n F[-] is sim ply a lin e a r w eig h ted su m o f p re s e n t a n d p ast in p u ts a n d th e im p u lse re sp o n s e values h( n), 0 < n < M , c o n s titu te th e w eig h tin g c o e f­ ficients. C o n se q u e n tly , th e cau sal lin e a r tim e -in v a ria n t F IR sy stem s d e s c rib e d by th e c o n v o lu tio n fo rm u la in S ectio n 2.3.7, a re n o n re c u rsiv e . T h e b a sic d ifferen ces b e tw e e n n o n re c u rsiv e a n d re c u rsiv e system s a re illu stra te d in Fig. 2.30. A sim ple in sp e ctio n o f th is figure re v e a ls th a t th e fu n d a m e n ta l d iffe re n c e b e tw e e n th e s e tw o Sec. 2.4 x(n) Discrete-Time Systems Described by Difference Equations 95 V(H ) F[Mn). xin - 1), 1 x{n) 1 ^ | | ........ ti n - .Wl] K n ) ........... v(/i - y{n) M)\ ] 1--------------------------------- 1 (b) Figure 2.30 Basic form for a causal and realizable (a) nonrecursive and (b) recursive system. system s is the fe e d b ack loop in th e recu rsiv e system , w hich feed s b ack th e o u tp u t o f the system in to th e in p u t. T h is feed b ack loop co n tain s a d e la y ele m e n t. T he p resen c e o f this d elay is crucial for the realizab ility of the system , since the ab sen ce of this d e la y w ould force the system to c o m p u te yi n) in term s o f v(n). w hich is n o t po ssib le fo r d isc re te -tim e system s. T h e p re se n c e o f the fe ed b ack loop o r, eq u iv alen tly , the recu rsiv e n a tu re of (2.4.5) c re a te s a n o th e r im p o rta n t d ifferen ce b etw een recursive an d n o n re c u rsiv e system s. F o r e x am p le, su p p o se th a t we wish to c o m p u te th e o u tp u t y(«o) of a system w h en it is ex cited by an in p u t ap p lied at tim e n = 0. If th e system is recu rsiv e, to co m p u te y (« 0). we first n e e d to c o m p u te all the p re v io u s v alu es y(0). y ( l ) ........ y(«o - 1)- In c o n tra st, if the system is n o n recu rsiv e. we can c o m p u te the o u tp u t y (n 0) im m e d ia te ly w ith o u t having y(no - 1), y(«o — 2 )........ In co n clu sio n , th e o u tp u t o f a recu rsiv e system sh o u ld be c o m p u te d in o rd e r [i.e., v(0), y ( l) , y ( 2 ) . . . w h e re a s for a n o n re c u rsiv e system , th e o u tp u t can b e c o m p u te d in any o rd e r [i.e., y(200). y (15). y{3). y(300). etc.]. T his fe a tu re is d e sira b le in so m e p ractical a p p licatio n s. 2.4.2 Linear Time-Invariant Systems Characterized by Constant-Coefficient Difference Equations In S ectio n 2.3 w e tre a te d lin e a r tim e -in v a ria n t system s a n d c h a ra c te riz e d th em in te rm s o f th e ir im p u lse resp o n ses. In this su b sectio n w e focus o u r a tte n tio n o n a fam ily o f iin e a r tim e -in v a ria n t system s d escrib ed by an in p u t- o u tp u t r e la ­ tio n called a d iffe re n c e e q u a tio n w ith c o n s ta n t c o e ffic ie n ts . S ystem s d e sc rib e d by c o n s tan t-co efficien t lin e a r d ifferen ce e q u a tio n s are a subclass o f the recu rsiv e a n d n o n re c u rsiv e sy stem s in tro d u c e d in th e p re ced in g su b sectio n . T o b rin g o u t th e im p o rta n t id eas, w e b eg in by tre a tin g a sim ple re c u rsiv e sy stem d e sc rib e d by a first-o rd e r d iffe re n c e e q u a tio n . 96 Discrete-Time Signals and Systems Chap. 2 <*> Figure 131 Block diagram realization of a simple recursive system. a S u p p o se th a t w e h a v e a recu rsiv e system w ith an in p u t- o u tp u t e q u a tio n y( n) = ay( n - 1) + x ( n ) (2.4.7) w h ere a is a c o n sta n t. F ig u re 2.31 show s a block d ia g ra m re a liz a tio n o f th e system . In co m p a rin g th is sy stem w ith th e cu m u la tiv e a v erag in g sy stem d e sc rib e d by the in p u t-o u tp u t e q u a tio n (2.4.3), w e o b se rv e th a t th e system in (2.4.7) h as a c o n sta n t co effic ie n t (in d e p e n d e n t o f tim e ), w h e re a s th e sy stem d e sc rib e d in (2.4.3) h as tim ev a ria n t coefficients. A s w e will show , (2.4.7) is an in p u t- o u tp u t e q u a tio n fo r a lin e a r tim e -in v a ria n t sy stem , w h e re a s (2.4.3) d escrib es a lin e a r tim e -v a ria n t system . N ow , su p p o se th a t w e ap p ly an in p u t signal x ( n ) to th e sy stem fo r n > 0. W e m a k e n o assu m p tio n s a b o u t th e in p u t sig n a l fo r n < 0, b u t w e d o assum e th e ex iste n ce o f th e in itial c o n d itio n v ( —1). S ince (2.4.7) d e s c rib e s th e system o u tp u t im plicitly, w e m u st solve this e q u a tio n to o b ta in an ex p licit ex p ressio n for th e sy stem o u tp u t. S u p p o se th a t w e co m p u te successive valu es o f y(n) fo r n > 0, b eg in n in g w ith y(0), T h u s y (0) = o j ( - l ) + x(0) v (l) = ay (0 ) + jc(3 ) = a 2y ( - 1) + o j:( 0 ) + *(1) y(2) = o j ( l ) + x ( 2 ) = o 3y (—1) + a 2jr(0) + a ^ ( l ) + x ( 2 ) y( n) = a y( n - 1) + x( n) = e " +1y ( - l ) + a" x( 0) + fl"’ 1Jt(l) + • ■■+ a x ( n - 1) + x( n) o r, m o re co m p actly , n > 0 (2.4.8) T h e re sp o n se y ( n ) o f th e system as given by th e rig h t-h a n d sid e o f (2.4.8) co n sists o f tw o p arts. T h e first p a rt, w hich c o n ta in s th e te rm y ( —1), is a re su lt of th e in itial c o n d itio n y ( —1) o f th e system . T h e se co n d p a r t is th e re sp o n se o f the sy stem to th e in p u t sig n al x( n) . I f th e sy stem is initially re lax ed a t tim e n = 0, th e n its m e m o ry (i.e., the o u tp u t o f th e d e la y ) sh o u ld b e zero . H e n c e y ( —1) = 0. T h u s a rec u rsiv e system is re la x e d if it sta rts w ith z e ro in itial c o n d itio n s. B e c a u se th e m e m o ry o f th e system d escrib es, in so m e sen se, its “ sta te ,” w e say th a t th e system is a t z e ro s ta te an d its c o rre sp o n d in g o u tp u t is called th e zero-state respons e o r f o r c e d respons e, an d Sec. 2.4 Discrete-Time Systems Described by Difference Equations 97 is d e n o te d by yzs(n). O b v iously, the z e ro -sta te re sp o n se o r fo rc e d resp o n se o f the system (2.4.7) is given by V/jittf) — Y ^ a kx( n — k) *=() n > 0 (2.4.9) It is in te re stin g to n o te th at (2.4.9) is a co n v o lu tio n su m m a tio n involving the in p u t signal co n v o lv ed w ith the im p u lse re sp o n se h(n) = a':u ( n ) (2.4.10) W e also o b se rv e th a t the sy stem d e sc rib e d by th e first-o rd e r d ifferen ce e q u atio n in (2.4.7) is cau sal. A s a resu lt, th e low er lim it on th e c o n v o lu tio n su m m atio n in (2.4.9) is k = 0. F u rth e rm o re , th e co n d itio n v (—1) = 0 im plies th a t the in p u t signal can be a ssu m ed cau sal an d h en ce th e u p p e r lim it on th e co n v o lu tio n su m m atio n in (2.4.9) is n. since x( n - k) = 0 for k > n. In effect, we have o b ta in e d th e resull th a t th e re lax ed recu rsiv e system d esc rib e d by th e firs t-o rd e r d ifferen ce e q u atio n in (2.4.7), is a lin e a r tim e-in v arian t IIR svstem w ith im p u lse resp o n se given bv (2.4.10). N ow . su p p o se th at th e system d e sc rib e d by (2.4.7) is in itially n o n re la x e d [i.e.. y ( —1) ^ 0] an d th e in p u t x(/i) = 0 for all //. T h e n the o u tp u t of th e system with zero in p u t is called the zero- i nput response or nat ural r espons e an d is d e n o te d by yZj(/j). F ro m (2.4.7). w ith ,v(») = 0 for —oc < n < oc . we o b ta in \Y,OM = « ',+ l y ( — 1) n > (2.4.11) 0 W e o b se rv e th a t a recu rsiv e system w ith n o n z e ro initial c o n d itio n is n o n relax ed in th e se n se th a t it can p ro d u c e an o u tp u t w ith o u t b ein g ex cited . N o te th at the z e ro -in p u t re sp o n se is d u e to th e m e m o ry of th e system . T o su m m a riz e , th e z e ro -in p u t re sp o n se is o b ta in e d by se ttin g the in p u t signal to z e ro , m ak in g it in d e p e n d e n t of the in p u t. It d e p e n d s only on th e n a tu re of the system a n d th e in itial co n d itio n . T h u s th e z e ro -in p u t re sp o n s e is a ch a ra c te ristic of th e sy stem itself, a n d it is also know n as th e nat ural o r f ree r esponse of th e svstem . O n th e o th e r h a n d , th e z e ro -sta te resp o n se d e p e n d s on th e n a tu re of th e system an d th e in p u t signal. Since th is o u tp u t is a re sp o n se fo rce d u p o n it by th e input signal, it is u su ally called th e f o r c e d response of th e system . In g en eral, th e total re sp o n se o f th e system can b e ex p ressed as v(n) = y Zi ( n ) + .Vzs( n). T h e sy stem d escrib ed by th e first-o rd e r d iffe re n c e e q u a tio n in (2.4.7) is the sim p lest p o ssib le recu rsiv e system in th e g en eral class o f re c u rsiv e system s d e ­ sc rib ed by lin e a r co n stan t-co efficien t d iffe re n c e e q u a tio n s . T h e g e n eral form for such an e q u a tio n is S M v(/i) = — ^ ai,y{n - k) -j- ^ bkx ( n - k) i-=l k=0 (2.4,12) or, e q u iv alen tly , Ar M ' Y a ky{n - k) = ' Y ^ b kx( n - k) Jc=0 *=0 a0 m 1 (2.4.13) 98 Discrete-Time Signals and Systems Chap. 2 T h e in te g e r N is called th e order o f the d ifferen ce e q u a tio n o r th e o r d e r of the system . T h e n eg ativ e sign on th e rig h t-h a n d side o f (2.4.12) is in tro d u c e d as a m a tte r o f co n v en ien ce to allow us to ex p ress th e d ifferen ce e q u a tio n in (2.4.13) w ith o u t any n eg ativ e signs. E q u a tio n (2.4.12) ex p re sse s th e o u tp u t of the system at tim e rt d irectly as a w eig h ted sum o f p ast o u tp u ts \ {n - 1), y( n - 2 ).........y(/i - N ) as well as past an d p re se n t in p u t signals sam p les. W e o b se rv e th a t in o rd e r to d e te rm in e y( n) fo r n > 0, we n e e d th e in p u t x ( n ) for all n > 0, an d th e initial c o n d itio n s y ( —1), y ( —2), — y ( —N ) . In o th e r w o rd s, th e initial c o n d itio n s su m m a riz e all th a t we n eed to k n o w a b o u t th e p a s t h isto ry o f th e re sp o n se o f th e sy stem to c o m p u te th e p re se n t an d fu tu re o u tp u ts. T h e g e n e ra l so lu tio n o f th e /V -order c o n stan tco efficien t d ifferen ce e q u a tio n is c o n sid e re d in th e follow ing su b se c tio n . A t this p o in t we r e s ta te th e p ro p e rtie s of lin earity , tim e in v a ria n c e , an d stab ility in th e c o n te x t o f recu rsiv e system s d e sc rib e d by lin ear c o n s ta n t-c o e ffic ie n t d ifferen ce e q u a tio n s. A s we h av e o b se rv ed , a recu rsiv e system m a y b e relax ed o r n o n re la x e d , d e p e n d in g o n th e initial co n d itio n s. H e n c e th e d e fin itio n s o f th ese p ro p e rtie s m u st ta k e in to a c c o u n t th e p re se n c e o f the initial co n d itio n s. W e begin w ith th e d e fin itio n o f lin earity . A system is lin e a r if it satisfies th e follow ing th re e re q u ire m e n ts: 1. T h e to tal re sp o n se is e q u a l to th e sum o f th e z e ro -in p u t a n d z e ro -sta te r e ­ sp o n ses [i.e.. y ( n) = y 7.\(n) + yzs(n)]. 2. T h e p rin cip le o f su p e rp o s itio n ap p lies to th e z e ro -sta te re s p o n s e (zero-state linear). 3. T h e p rin cip le o f su p e rp o s itio n ap p lies to the z e ro -in p u t re s p o n s e (zero- i nput linear). A system th a t d o es n o t satisfy all three se p a ra te r e q u ire m e n ts is by d efin itio n n o n lin ear. O b v io u sly , fo r a re lax ed system , yZj(n) = 0, an d th u s re q u ire m e n t 2, w hich is th e d efin itio n o f lin e a rity given in S ection 2.2.4, is sufficient. W e illu strate th e a p p lic a tio n o f th ese re q u ire m e n ts by a sim p le ex am p le. Example 2.4.2 D eterm ine if the recursive system defined by the difference equation v(n) = av(n —1)4- x(n) is linear. Solution as By combining (2.4.9) and (2.4.11), we obtain (2.4.8), which can be expressed y(n) = yzi(n) + y*(n) Thus the first requirem ent for linearity is satisfied. Sec. 2.4 Discrete-Time Systems Described by Difference Equations 99 To check for the second requirem ent, let us assume that ,t(n) = Then (2.4.9) gives + *={} = ('iy ^ ’(n) + C2V^'(n) Hence y„(/i> satisfies the principle of superposition, and thus the system is zero-state linear. Now let us assume that y(—1) = q vj(—1) 4- f 2y;( —1). From (2.4.11) we obtain 1) 4- C;V;(—1)] = vi (—1)4- v; ( —1) = Ci v'i '(n) + r ;y ’^(/i) Hence the system is zero-input linear. Since the system satisfies all three conditions for linearity, it is linear. A lth o u g h it is so m e w h at ted io u s, the p ro c e d u re used in E x am p le 2.4,2 to d e m o n s tra te lin e a rity for th e system d escrib ed by th e first-o rd e r d ifferen ce e q u a ­ tio n , ca rrie s o v er d irectly to th e g en eral recu rsiv e system s d e sc rib e d by th e c o n stan tcoefficient d ifferen ce e q u a tio n given in (2.4.13). H en ce , a recu rsiv e system d escrib ed by th e lin ear d iffe re n c e e q u a tio n in (2.4.13) also satisfies all th re e c o n ­ d itio n s in th e d efin itio n o f lin earity , a n d th e re fo re it is linear. T h e n ex t q u e s tio n th a t arises is w h e th e r o r n o t the cau sal lin ear system d e sc rib e d by th e lin e a r c o n stan t-co efficien t differen ce e q u a tio n in (2.4.13) is tim e in v arian t. T h is is fairly easy, w h en d e alin g w ith system s d e sc rib e d by explicit i n p u t-o u tp u t m a th e m a tic a l re la tio n sh ip s. C learly, th e system d e sc rib e d by (2.4.13) is tim e in v a ria n t b ecau se th e coefficients ak an d bk are c o n stan ts. O n th e o th e r h a n d , if o n e o r m o re o f th e s e coefficients d e p e n d s on tim e, th e system is tim e v a ria n t, since its p ro p e rtie s ch an g e as a fu n ctio n of tim e. T h u s w e co n clu d e th at the recursive sy s t em descri bed b y a linear constant-coefficient difference equat i on is linear a n d t ime invariant. T h e final issu e is th e sta b ility of th e recursive system d e sc rib e d by th e lin ear, c o n stan t-co efficien t d iffe re n c e e q u a tio n in (2.4.13). In S ection 2.3.6 w e in tro d u c e d th e c o n c e p t o f b o u n d e d in p u t-b o u n d e d o u tp u t (B IB O ) sta b ility fo r re la x e d sys­ tem s. F o r n o n re la x e d system s th a t m ay b e n o n lin e a r, B IB O sta b ility sh o u ld be view ed w ith so m e care. H o w e v e r, in th e case o f a lin e a r tim e -in v a ria n t recursive system d e sc rib e d by th e lin e a r co n stan t-co efficien t d iffe re n c e e q u a tio n in (2.4.13), it suffices to s ta te th a t such a system is B IB O sta b le if a n d only if fo r every b o u n d e d in p u t a n d ev ery b o u n d e d initial c o n d itio n , th e to ta l system re sp o n se is bounded. 100 Discrete-Time Signals and Systems Chap. 2 Example 2.43 Determ ine if the linear tim e-invariant recursive system described by the difference equation given in (2.4.7) is stable. Solution i*(n)l < Let us assume that the input signal x(n) is bounded in amplitude, that is, < oc for all n > 0. From (2.4.8) we have j v{n J | < |a',+l_y(—1)| + ^ akx(n - k) , n>0 If n is finite, the bound M v is finite and the output is bounded independently of the value of a. However, as n -*• oo, the bound My remains finite only if |aj < 1 because |a |B -»■ 0 as n -*• oc. Then M y = Ms j(\ - |o|). Thus the system is stable only if \a\ < 1. For the sim ple first-order system in E xam ple 2.4,3, w e w ere able to express the con d ition for B IB O stability in term s o f the system param eter a. nam ely \a\ < 1. W e should stress, how ever, that this task b ecom es m ore difficult for higher-order system s. F ortunately, as we shall see in su bsequent chapters, other sim ple and m ore efficient tech n iqu es exist for investigating the stability o f recursive system s. 2.4.3 Solution of Linear Constant-Coefficient Difference Equations G iven a linear con stan t-coefficien t d ifferen ce eq u ation as the in p u t-o u tp u t rela­ tionship describing a linear tim e-invariant system , our objective in this subsection is to determ ine an explicit exp ression for the output y{n). T h e m eth od that is d ev elo p ed is term ed the direct m e t h o d . A n alternative m eth od based on the ztransform is described in Chapter 3. For reasons that will b eco m e apparent later, the z-transform approach is called the indirect m e th o d . Basically, the goal is to determ ine the output y(n ), n > 0, o f the system given a specific input x ( n ), n > 0, and a set o f initial con d ition s. T h e direct solution m ethod assum es that the total solu tion is the sum o f tw o parts: y ( n ) = y h(n) + }'r (n) T he part y/,(n) is know n as the h o m o g e n e o u s or c o m p l e m e n ta r y solu tion , w hereas yp(n) is called the particular solution. The homogeneous solution of a difference equation. W e begin the problem o f solving the linear con stan t-coefficien t d ifferen ce eq u ation given by Sec. 2.4 Discrete-Time Systems Described by Difference Equations 101 (2.4.13) bv assu m in g th a t th e in p u t x (n ) = 0. T h u s w e will first o b ta in th e so lu tio n to th e h o m o g e n e o u s di ff erence equati on \ J 2 a ky ( n - k ) = 0 *=(> (2.4.14) T h e p ro c e d u re fo r solving a lin e a r c o n s tan t-co efficien t d ifferen ce e q u a tio n d irectly is very sim ilar to th e p ro c e d u re fo r solving a iin e a r c o n stan t-co efficien t d iffe re n tia l e q u a tio n . B asically, we assum e th a t th e so lu tio n is in th e fo rm o f an e x p o n e n tia l, th a t is. yi,{n) = a" (2.4.15) w h ere th e su b scrip t h o n \ {n) is used to d e n o te th e so lu tio n to th e h o m o g e n e o u s d ifferen ce e q u a tio n . If w e su b stitu te this assu m ed so lu tio n in (2.4.14), w e o b tain th e p o ly n o m ial e q u a tio n =0 fc=U or k" A (k* + ci)k^ ! + a2k^ * + • • - + q n —\ k + a w ) = 0 (2.4.16) T h e p o ly n o m ial in p a re n th e se s is called th e characteristic p o l y n o m i a l o f the system . In g e n e ra l, it h as N roots, w hich we d e n o te as Xi. k 2.........k ^ . T h e ro o ts can b e real o r co m p lex v alued. In p ra c tic e the co efficien ts a \ , a 2........ are usually re a l. C o m p le x -v a lu e d ro o ts o ccu r as c o m p le x -c o n ju g a te p airs. S om e o f th e N ro o ts m ay be id en tical, in w hich case w e have m u ltip Je -o rd e r ro o ts. F o r th e m o m e n t, let us assum e th a t th e ro o ts a re d istin ct, th a t is, th e re are n o m u ltip le -o rd e r ro o ts. T h e n th e m o st g e n eral so lu tio n to th e h o m o g e n e o u s d iffe re n c e e q u a tio n in (2.4.14) is yh(n) = C \ k \ + C2k 2 + • ■■+ C^ k ^ , (2.4.17) w h ere C i. C 2.........C s are w eig h tin g coefficients. T h e se co efficien ts are d e te rm in e d fro m th e in itial c o n d itio n s specified fo r th e sy stem . Since th e in p u t jr(n) = 0. (2.4.17) can b e u sed to o b ta in th e z ero- i nput response o f th e system . T h e follow ing ex am p les illu stra te th e p ro c e d u re . Example 2.4.4 D eterm ine the hom ogeneous solution of the system described by the first-order dif­ ference equation _v(n) + a\y(rt — 1) = x(n) Solution The assumed solution obtained by setting x(n) = 0 is y*(n) = V (2.4.18) D iscrete-Time Signals and System s 102 Chap. 2 When we substitute this solution in (2.4.18), we obtain [with x(n) = 0] X -f-12]An ^ = 0 A" *(A + ai) = 0 A = —O) Therefore, the solution to the hom ogeneous difference equation is = CA" = C ( - a ,)" (2.4.19) The zero-input response of the system can be determ ined from (2.4,18) and (2.4.19). With x(n) = 0, (2.4.18) yields v(0) = -a, v ( - l ) On the other hand, from (2.4,19) we have v*(0) = C and hence the zero-input response of the system is Vii(«) = (—£i)n+1 v{—1) n >0 (2.4.20) With a = —ai, this result is consistent with (2.4,11) for the first-order system, which was obtained earlier by iteration of the difference equation. Example 2AS Determ ine the zero-input response of the system described by the homogeneous second-order difference equation y(«) - 3y(n - 1) - 4y(n - 2) = 0 (2.4.21) Solution First we determ ine the solution to the homogeneous equation. We assume the solution to be the exponential yh(n) = X" U pon substitution of this solution into (2.4.21), we obtain the characteristic equation a" - 3xn- ' - 4 r ~ 2 = o A"-2(X2 —3A —4) = 0 Therefore, the roots are X = - 1 , 4, and the general form of the solution to the homogeneous equation is }7i(n) = CjX" + C 2X2 (2.4.22) = C1( - i r + C2(4)" The zero-input response of the system can be obtained from the homogenous solution by evaluating the constants in (2.4.22), given the initial conditions y (—1) and y ( ~ 2). From the difference equation in (2.4.21) we have y(0) = 3y(—1) + 4y(—2) y(l) = 3v(0) + 4_y(—1) = 3 [3 y (-l)+ 4y(-2)] + 4y(-l) = 13y(—1) + l 2y( —2) Sec. 2.4 Discrete-Time Systems Described by Difference Equations 103 On the other hand, from (2.4.22) we obtain v(0> = C) + C; V( 1 I = -C l +4C; By equating these two sets of relations, we have C i + C ; = 3_v( —1) + 4y(—2) - C , + 4 C ; = 13 v{ —1) + 12 y( —2) The solution of these two equations is Ci = —7 v( —1 ) + ? v ( - 2 ) C; = X .V (-l) + T.v( -2 ) Therefore, the zero-input response of the system is v,i(n) = [—5 v( —1 >- i v(-2)](-l)'' (2.4.23) n >0 + [ x . v ( - l » + t.v(-2)](4>" For example, if v{—2) = 0 and y ( - l ) = 5. then C| = —1, C: = 16. and hence y-,i(H) = ( -1 ) " * 1 + (4)"+: n >0 T h e se e x am p les illu strate the m e th o d fo r o b ta in in g the h o m o g e n e o u s so lu tio n and th e z e ro -in p u t re sp o n se o f th e system w hen the ch a ra c te ristic e q u a tio n co n tain s d istin ct ro o ts. O n th e o th e r h an d , if th e c h a ra c te ristic e q u a tio n co n ta in s m u ltip le ro o ts, th e form o f th e so lu tio n given in (2.4.17) m ust be m odified. F o r ex am p le, if ai is a ro o t o f m u ltip licity m, th en (2.4.17) b eco m es \h(ii) = Ci A.'.' + C2/iX’! + C v;:a',' + ■■• + Cm>7n'~lX'! (2.4.24) + Cm+\)"m+\ + ■• • + C^Kl The particular solution of the difference equation. T h e p a rtic u la r so ­ lu tio n \ p (n) is re q u ire d to satisfy th e d ifferen ce e q u a tio n (2.4.13) fo r th e specific in p u t signal x (n ). n > 0. In o th e r w ords, y p(n) is any so lu tio n satisfying N M ' Y ^ a ky p (n - k) — ' Y ^ b kx ( n - k) A-0 *=0 an — 1 (2.4.25) T o solve (2.4.25). w e assu m e fo r yp (n), a fo rm th at d e p e n d s on th e fo rm o f th e in p u t j:(h ). T h e fo llow ing ex am p le illu strates the p ro c e d u re . Example 2.4.6 D eterm ine the particular solution of the first-order difference equation y(n) + fliy(n - 1) = x(n). | f l i | <l when the input x(n) is a unit step sequence, that is. x(n) = u (n ) (2,4.26) 104 Discrete-Time Signals and System s Chap. 2 Solution Since the input sequence x(n) is a constant for n > 0. the form of the solu­ tion that we assume is also a constant. Hence the assumed solution of the difference equation to the forcing function x(n), called the particular solution of the difference equation, is vr (n) = Ku(n) where A- is a scale factor determined so that (2.4.26) is satisfied. U pon substitution of this assumed solution into (2.4.26). we obtain Ku i n ) + d]Ku{,n — 1) = u ( n ) To determine K, we must evaluate this equation for any n > 1. where none of the terms vanish. Thus K -t- O] K — 1 1 K = -------l+^i Therefore, the particular solution to the difference equation is v (n) = --------u(n) '’ 1 +fii (2.4.27) In th is ex am p le, th e in p u t * (« ). n > 0. is a c o n s ta n t an d th e fo rm assu m ed for th e p a rtic u la r so lu tio n is also a c o n sta n t. If x{n) is an e x p o n e n tia l, w e w ould assu m e th a t th e p a rtic u ia r so lu tio n is also an e x p o n e n tia l. If x {n) w e re a sin u so id , th e n >■/,(«) w o uld also be a sinusoid. T h u s o u r assu m ed fo rm fo r th e p a rtic u la r so lu tio n tak es th e basic fo rm of th e signal x{n). T a b le 2.1 p ro v id e s th e g en eral fo rm o f th e p a rtic u la r so lu tio n for sev eral ty p es of excitatio n . Exam ple 2.4.7 Determ ine the particuiar solution of the difference equation v(n) = | y(n - 1) - £ v(w - 2) + x(n) when the forcing function x(n) = 2". n > 0 and zero elsewhere. TABLE 2.1 GENERAL FORM OF THE PARTICULAR SOLUTION FOR SEVERAL TYPES OF INPUT SIGNALS Input Signal, x(n) Particular Solution, vr (n) A (constant) AM" AnM K KM" Kan” + K ^ " - ' 1 + . . . + KM A cos Wf>n A sin a>on Kj cos toon -I- K2 sin won AnnM An(Ki)nM+ K\ttM 1 Sec. 2.4 Discrete-Time Systems Described by Difference Equations Solution 105 The form of the particular solution is yp (n ) = K2n n >0 Upon substitution of yP(n) into the difference equation, we obtain K2"u( n) = - 1 ) - I K 2 n- 2u(n - 2 ) + 2 " « ( « ) To determ ine the value of K, we can evaluate this equation for any n > 2, where none of the terms vanish. Thus we obtain 4A" = \ ( 2K) - i f f + 4 and hence K = Therefore, the particular solution is yn(n) = ^2" n > 0 W e h av e n o w d e m o n s tra te d how to d e te rm in e th e tw o c o m p o n e n ts o f the so lu tio n to a d ifferen ce e q u a tio n w ith c o n s ta n t coefficients. T h e se tw o c o m p o n e n ts are th e h o m o g e n e o u s so lu tio n and th e p a rtic u la r so lu tio n . F ro m th e s e tw o co m ­ p o n e n ts, we c o n s tru c t the to tal so lu tio n fro m w hich w e can o b ta in th e ze ro -sta te re sp o n se . The total solution of the difference equation. T h e lin e a rity p ro p e rty o f th e lin ear c o n stan t-co efficien t d ifferen ce e q u a tio n allow s u s to a d d th e h o m o g e ­ n e o u s so lu tio n an d the p a rtic u la r so lu tio n in o rd e r to o b ta in th e total solution. T h u s v(«) = y h(n) + \ p( n) T h e r e s u lta n t sum v(n) co n tain s th e c o n s ta n t p a r a m e te r s {C/} e m b o d ie d in th e h o m o g e n e o u s so lu tio n c o m p o n e n t >v,(n). T h e se c o n s ta n ts can be d e te rm in e d to satisfy th e in itial co n d itio n s. T h e follow ing ex a m p le illu stra te s th e p ro c e d u re , Exam ple 2.4.8 D eterm ine the total solution y(/i), n > 0, to the difference equation y(n) +a i y ( n - 1) = x(n) (2.4.28) when x( n) is a unit step sequence [i.e., x(n) = «(«)] and y (—1) is the initial condition. Solution From (2.4,19) of Example 2.4.4, the hom ogeneous solution is y*(n) = C(-fli)" and from (2.4.26) of Example 2.4.6, the particular solution is Consequently, the total solution is y(n) = C ( - a i)" + — -— 1 + fli n >0 where the constant C is determ ined to satisfy the initial condition y ( - l ) . (2.4.29) 106 Discrete-Time Signals and Systems Chap. 2 In particular, suppose that we wish to obtain the zero-siate response of the system described by the first-order difference equation in (2.4.28). T hen we set y( —1) = 0. To evaluate C. we evaluate (2.4.28) at n = 0 obtaining y ( 0 ) + Oi y ( — 1 ) = 1 y(0) = 1 On the other hand, (2.4.29) evaluated at n = 0 yields v(0) = C 4- —i — 1 + ax Consequently. 1 C + -------- = 1 1 + «i ai 1 + ai c Substitution for C into (2.4.29) yields the zero-state response of the system l-f-fli)" * ' Vi*(/i) = ---- —-----— 1 + «i n >0 If we evaluate the param eter C in (2,4.29) under the condition that y( —1) ^ 0. the total solution will include the zero-input response as well as the zero-state response of the system. In this case (2.4.28) yields y(0) + a]V( —1) = 1 y (0) = —fliy( —1) 4- 1 On the other hand. (2.4.29) yields ] 1 + U\ By equating these two relations, we obtain C + — ^— = —ai v(—1) 4- 1 1 4 - a, C = -g ] v( 1) + - — 1 4- a ] Finally, if we substitute this value of C into (2.4.29). we obtain y(n) = (—a , r +1y(—1) + -— = + ^ — 1 + a) n >0 (2.4.30) Vzs( n) W e o b se rv e th a t th e system re sp o n se as given by (2.4.30) is c o n s iste n t w ith th e re sp o n se y ( n) given in (2.4.8) for th e first-o rd e r system (w ith a = - o i ) . w hich was o b ta in e d by solv in g th e d ifferen ce e q u a tio n iterativ e ly . F u rth e rm o r e , we n o te th a t th e v alu e o f th e c o n s ta n t C d e p e n d s b o th o n th e initial co n d itio n y (—1) an d o n th e ex citatio n fu n ctio n . C o n se q u e n tly , th e v alue o f C in flu en ces b o th th e zeroin p u t re sp o n se a n d th e z e ro -sta te re sp o n se . O n th e o th e r h a n d , if w e w ish to Sec. 2.4 Discrete-Time Systems Described by Difference Equations 107 obtain the zero-state resp onse only, w e sim ply solve for C under th e con d ition that y ( - l ) = 0, as d em onstrated in E xam ple 2.4.8. W e further ob serve that the particular solution to the d ifferen ce equation can b e o b tain ed from the zero-state resp onse o f the system . In d eed , if |o]| < 1, which is the con d ition for stability o f the system , as w ill be show n in S ection 2.4.4, the lim iting valu e o f >’zs(«) as n approaches infinity, is the particular solu tion , that is, 1 » ( n ) = lim >zs(«) = --------n-*Oo 1+ai Since this com p onent o f the system response d o es not go to zero as n approaches infinity, it is usually called the steady-state re spons e o f the system . T his response persists as lon g as the input persists. T he com p onent that d ies out as n approaches infinity is called the transient re sponse o f the system . Example 2.4.9 D eterm ine the response y(n), n > 0, of the system described by the second-order difference equation v(n) - 3y(n - 1) - 4v(n - 2) = x( n ) + 2x(n - 1) (2.4.31) when the input sequence is x(n) =4"u(n) Solution We have already determ ined the solution to the homogeneous difference equation for this system in Example 2.4.5. From (2.4.22) we have y*(n) = C , ( - l ) n + C 2(4)n (2.4.32) The particular solution to (2.4.31) is assumed to be an exponential sequence of the same form as x(n). Normally, we could assume a solution of the form yp(n) = K(4,)au(n) However, we observe that » ( n ) is already contained in the hom ogeneous solution, so that this particular solution is redundant. Instead, we select the particular solution to be linearly independent of the terms contained in the homogeneous solution. In fact, we treat this situation in the same manner as we have already treated multiple roots in the characteristic equation. Thus we assume that yp(n) = Kn{4)"u(n) (2.4.33) Upon substitution of (2.4.33) into (2.4.31), we obtain Kn(4)"u(n) - 3 K ( n - l)(4 ),' - 1u(n - 1) - 4 K{n - 2)(4)n- 2u(n - 2) = (4)"u(n) + 2(4)"-1 m(/i —1) To determ ine K , we evaluate this equation for any n > 2, where none of the unit step term s vanish. To simplify the arithmetic, we select n = 2, from which we obtain K = | . Therefore, yP{n) « |rt(4)n«(/l) (2.4.34) 108 Discrete-Time Signals and System s Chap. 2 The total solution to the difference equation is obtained by adding (2.4.32) to (2.4.34). Thus y(«) — C ](—1)" + C;(4)n + |w(4)" n > 0 (2.4.35) where the constants C\ and C2 are determined such that the initial conditions are satisfied. To accomplish this, we return to (2.4.31), from which we obtain v(0) = 3 y (- l) + 4y (—2) + 1 y (1) = 3v(0) + 4_v(-l) + 6 = 1 3 y (- l) + 12y(-2) + 9 O n the other hand, (2.4.35) evaluated at n = 0 and n = 1 yields y(0) = Ci + C2 y (l) = -C] + 4C2 + f W e can now equate these two sets of relations to obtain C\ and C 2. In so doing, we have the response due to initial conditions y (—1) and y (—2) (the zero-input response), and the zero-state or forced response. Since we have already solved for the zero-input response in Exam ple 2.4.5. we can simplify the computations above by setting v (—1) = y (—2) = 0. Then we have C, + C; = 1 - C l + 4 C2 + f =9 Hence C : = —^ and C 2 = Finally, we have the zero-statc response to the forcing function = (4)"«(n) in the form vB(n) = +5<4)" +H 4)" nZ0 (2.4.36) The total response of the system, which includes the response to arbitrary initial conditions, is the sum of (2.4.23) and (2.4.36). 2.4.4 The Impulse Response of a Linear Time-Invariant Recursive System T h e im p u lse re sp o n se o f a lin e a r tim e -in v a ria n t sy stem w as p re v io u sly defin ed as th e re sp o n se o f th e sy stem to a u n it sa m p le e x citatio n [i.e., x (n ) = <5(n)]. In th e case o f a recu rsiv e sy stem , h ( n ) is sim ply e q u a l to th e z e ro -s ta te re sp o n s e o f the system w h en th e in p u t j:(n ) = <5(n) an d th e system is initially re la x e d . F o r ex am p le, in th e sim ple first-o rd e r re c u rsiv e system g iv en in (2.4.7), th e z e ro -sta te re sp o n se g iv en in (2.4.8), is n (2.4.37) *=o W ith jr(n) = i ( « ) is substituted into (2.4.37), we obtain n yzs(n) = Y 2 a k8(n - k) = an n > 0 Sec. 2.4 Discrete-Time Systems Described by Difference Equations 109 H e n c e th e im p u lse re sp o n se o f th e first-o rd e r rec u rsiv e system d e sc rib e d by (2.4.7) is h(n) = a nu(n) (2.4.38) as in d ic a te d in S ectio n 2.4.2. In th e g e n e ra l case o f an a rb itra ry , lin e a r tim e -in v a ria n t rec u rsiv e system , the z e ro -s ta te re sp o n s e ex p re sse d in te rm s o f th e co n v o lu tio n su m m a tio n is >’zs(n) — ^ 2 h ( k ) x ( n — k) n > 0 (2.4.39) i=0 W h e n th e in p u t is an im p u lse [i.e., * (« ) = <5(«)], (2.4.39) re d u c e s to Vzs(n) = h(n) (2.4.40) N o w , let us c o n s id e r th e p ro b le m o f d e te rm in in g th e im p u lse re sp o n se h i n ) given a lin e a r c o n s tan t-co efficien t d ifferen ce e q u a tio n d e sc rip tio n o f th e system . In term s o f o u r d isc u ssio n in th e p re c e d in g su b sectio n , we h av e e s ta b lis h e d th e fact th a t the to ta l re sp o n s e o f th e sy stem to any e x citatio n fu n ctio n co n sists o f th e sum o f tw o so lu tio n s o f th e d ifferen ce e q u atio n : th e so lu tio n to the h o m o g e n e o u s e q u atio n p lu s th e p a rtic u la r so lu tio n to th e e x c itatio n fu n ctio n . In th e case w h ere the exci­ ta tio n is an im p u lse, th e p a rtic u la r so lu tio n is z e ro , since x ( n ) = 0 for n > 0. th at is. yp (n) = 0 C o n s e q u e n tly , th e re sp o n se o f th e system to an im p u lse co n sists only o f th e so lu ­ tio n to th e h o m o g e n e o u s e q u a tio n , w ith the ( Q ) p a r a m e te r s e v a lu a te d to satisfy th e in itial c o n d itio n s d ic ta te d by th e im pulse. T h e follow ing ex am p le illu strates th e p ro c e d u re fo r o b ta in in g h(n) given th e d ifferen ce e q u a tio n fo r the system . Example 2.4.10 D eterm ine the impulse response h(n) for the system described by the second-order difference equation y(n ) — 3v(n — 1) — 4 y (« — 2) = x ( n ) + 2 x i n — 1) (2.4.41) Solution W e have already determ ined in Example 2.4.5 that the solution to the hom ogeneous difference equation for this system is ^ ( n ) = C, (-1 )" + C2(4)" n > 0 (2.4.42) Since the particular solution is zero when x(n) = 6(n), the impulse response of the sys­ tem is simply given by (2.4.42), where C] and C2 must be evaluated to satisfy (2.4.41). For n = 0 and n = 1, (2.4.41) yields v(0) = 1 y (1) = 3 y (0 )+ 2 = 5 where we have imposed the conditions y (—1) = y (—2) = 0. since the system must be relaxed. On the other hand, (2.4.42) evaluated at n = 0 and n = 1 yields y (0) = C, + C2 y (1) = —Ci + 4C2 Discrete-Time Signals and Systems 110 Chap. 2 By solving these two sets of equations for C] and C2, we obtain = C: = 5 Therefore, the impulse response of the system is h{n) = [—i ( —1)" + f (4)-}u(n) W e m ak e th e o b se rv a tio n th a t b o th th e sim ple firs t-o rd e r recu rsiv e system an d th e se c o n d -o rd e r recu rsiv e system h av e im pulse re sp o n se s th a t a re infinite in d u ra tio n . In o th e r w o rds, b o th o f th e s e recu rsiv e system s a re IIR system s. In fact, d u e to th e recu rsiv e n a tu re of th e system , an y recu rsiv e sy stem d e sc rib e d by a lin e a r co n stan t-co efficien t d iffe re n c e e q u a tio n is an I IR system . T h e co n v erse is n o t tru e, h o w ev er. T h a t is, n o t ev ery lin e a r tim e -in v a ria n t I I R sy stem can be d e sc rib e d by a lin e a r c o n s tan t-co efficien t d ifferen ce e q u a tio n . In o th e r w ords, recu rsiv e sy stem s d e sc rib e d by lin ear co n sta n t-c o e ffic ie n t d iffe re n c e e q u a tio n s are a su bclass o f lin e a r tim e -in v a ria n t I I R system s. T h e ex ten sio n o f th e a p p ro a c h th a t w e h av e d e m o n s tra te d fo r d e te rm in ­ ing th e im p u lse re sp o n se o f th e first- a n d s e c o n d -o rd e r system s, g en e ra liz e s in a stra ig h tfo rw a rd m a n n e r. W h e n th e system is d e sc rib e d by an A 'th -o rd e r lin e a r d ifferen ce e q u a tio n o f th e ty p e given in (2.4.13), th e so lu tio n o f th e h o m o g e n e o u s e q u a tio n is *=i w h en th e ro o ts {a*} o f th e c h a ra c te ristic p o ly n o m ial are d istin ct. H e n c e th e im pulse re sp o n se o f th e sy stem is id en tical in fo rm , th a t is. (2.4.43) w h ere th e p a ra m e te rs {Ctl are d e te rm in e d by se ttin g th e initial c o n d itio n s v ( —1) = . . . = y ( - N ) = 0. T h is fo rm o f h{n) allow s us to easily re la te th e stab ility of a system , d escrib ed by an N th -o rd e r d iffe re n c e e q u a tio n , to th e values o f th e ro o ts o f th e ch a ra c te ristic p o ly n o m ial. In d e e d , since B IB O sta b ility re q u ire s th a t th e im p u lse re sp o n s e be ab so lu te ly su m m ab le, th e n , fo r a causal system , w e h av e x oc N N oo oo £ > (* )! = £ Y ^ C kXnk < £ | C * | £ | A * | " «=0 n =0 n=0 Ik=-l k=\ n=0 N ow if | j < 1 fo r all k, th e n an d h en ce OC IM*)[ < oo Sec. 2.5 im plementation of Discrete-Time Systems 111 O n th e o th e r h an d , if o n e o r m o re o f th e > 1, h{n) is n o lo n g e r ab so lu te ly su m m ab le, an d c o n se q u e n tly , th e sy stem is u n sta b le . T h e re fo re , a n ecessa ry an d sufficient c o n d itio n fo r th e sta b ility o f a causal IIR system d e sc rib e d by a lin ear c o n s tan t-co efficien t d iffe re n c e e q u a tio n , is th a t al! ro o ts o f th e c h a ra c te ristic p o ly ­ n o m ial b e less th a n u n ity in m a g n itu d e. T h e re a d e r m ay verify th a t th is c o n d itio n ca rrie s o v er to th e case w h ere th e system h as ro o ts o f m u ltip lic ity m. 2.5 IMPLEMENTATION OF DISCRETE-TIME SYSTEMS O u r tre a tm e n t o f d isc re te -tim e sy stem s h as b e e n fo cu sed on th e tim e -d o m a in c h a r­ ac te riz a tio n an d analysis o f lin ear tim e -in v a ria n t system s d esc rib e d by c o n stan tco efficien t lin e a r d ifferen ce e q u a tio n s. A d d itio n a l an aly tical m e th o d s a re d e v e l­ o p e d in th e n ex t tw o c h a p te rs, w h ere we c h a ra c te riz e an d an aly ze L TI sy stem s in th e fre q u e n c y d o m ain . T w o o th e r im p o rta n t to p ics th a t will b e tr e a te d la te r are th e d esig n an d im p le m e n ta tio n o f th e se system s. In p ractice, system design a n d im p le m e n ta tio n a re usually tr e a te d jo in tly r a th e r th a n se p a ra te ly . O fte n , th e system design is d riv en by th e m e th o d o f im p le m e n ta tio n an d by im p le m e n ta tio n c o n stra in ts, such as cost, h a rd w a re lim ­ itatio n s, size lim ita tio n s, a n d p o w e r re q u ire m e n ts . A t th is p o in t, we h av e n o t as y e t d e v e lo p e d th e n ecessa ry analysis an d design tools to tr e a t such com plex issues. H o w ev er, we h ave d e v e lo p e d sufficient b a c k g ro u n d to c o n sid e r so m e b a ­ sic im p le m e n ta tio n m e th o d s for re a liz a tio n s o f L TI sy stem s d escrib ed by lin ear c o n s tan t-co efficien t d iffe re n c e e q u atio n s. 2.5.1 Structures for the Realization of Linear Time-Invariant Systems In th is su b sectio n we d esc rib e s tru c tu re s fo r th e re a liz a tio n o f system s d escrib ed by lin e a r c o n s tan t-co efficien t d ifferen ce e q u a tio n s. A d d itio n a l stru c tu re s fo r th ese sy stem s a re in tro d u c e d in C h a p te r 7. A s a b eg in n in g , let us c o n sid e r th e first-o rd e r system y(n) = —a iy (n — 1) + box ( n) + b \ x ( n - 1) (2.5.1) w hich is re a liz e d as in Fig. 2.32a. T h is re a liz a tio n uses s e p a ra te delays (m em o ry ) fo r b o th th e in p u t a n d o u tp u t signal sa m p le s a n d it is called a direct f o r m I structure. N o te th a t th is sy stem can b e view ed as tw o lin e a r tim e -in v a ria n t system s in cascad e. T h e first is a n o n re c u rsiv e , sy stem d e sc rib e d by th e e q u a tio n u(n) = Z»oj;(n) + 6 j j ( n — 1) (2.5.2) w h e re a s th e se c o n d is a rec u rsiv e system d e sc rib e d by th e e q u a tio n y ( n ) = - a i y ( n - 1) + t>{«) (2.5.3) H o w e v e r, as we h a v e se e n in S ectio n 2.3.4, if w e in te rc h a n g e th e o r d e r o f the c a s cad ed lin e a r tim e -in v a ria n t system s, th e o v erall system re sp o n s e re m a in s th e 112 Discrete-Time Signals and Systems Chap. 2 sam e. T h u s if w e in te rc h a n g e the o rd e r o f the recu rsiv e an d n o n re c u rsiv e system s, we o b ta in an a lte rn a tiv e s tru c tu re fo r th e re a liz a tio n o f th e sv stem d e sc rib e d by (2.5.1). T h e re su ltin g system is show n in Fig. 2.32b. F ro m th is figure we o b tain th e tw o d ifferen ce e q u a tio n s w( n) — —fl] w( n — 1) + jt(«) (2-5.4) v(n) = t>nw(n) + b\ w{ n - 1) (2.5.5) w hich p ro v id e an a lte rn a tiv e a lg o rith m for co m p u tin g th e o u tp u t o f the system d e sc rib e d by th e single d ifferen ce e q u a tio n given in (2.5.1). In o th e r w o rd s, the tw o d ifferen ce e q u a tio n s (2.5.4) an d (2.5.5) are e q u iv a le n t to th e single differen ce e q u a tio n (2.5.1). A close o b se rv a tio n o f Fig. 2.32 re v e a ls th at th e tw o d elay e le m e n ts co n tain th e sam e in p u t w( n) an d h en c e the sam e o u tp u t w( n — 1). C o n s e q u e n tly , these tw o e le m e n ts can be m e rg ed in to o n e delay, as show n in Fig. 2.32c. In c o n tra st x(n) b{, r(n) f n vim -----------------~ (a) (b.) (c) Figure 132 Steps in converting from the direct form I realization in (a) to the direct form II realization in (c). Sec. 2.5 Implementation of Discrete-Time Systems 113 to th e d ire c t fo rm I s tru c tu re , th is new re a liz a tio n re q u ire s o n ly o n e d elay fo r th e au x iliary q u a n tity ui(n), an d h en c e it is m o re efficient in te rm s o f m em o ry re q u ire m e n ts . It is called th e direct f o r m I I structure a n d it is u sed ex ten siv ely in p ra c tic a l a p p licatio n s. T h e se stru c tu re s can read ily be g e n e ra liz e d fo r th e g e n e ra l lin e a r tim ein v a ria n t recu rsiv e sy stem d escrib ed by th e d iffe re n c e e q u a tio n N M y (n ) = - y ^ a ^ .y (« - k) + *=l - k) (2.5.6) k=0 F ig u re 2.33 illu stra te s th e d ire c t fo rm I s tru c tu re fo r th is sy stem . T h is stru c tu re re q u ire s M + N d elay s a n d N + M + 1 m u ltip lic atio n s. I t c a n be v iew ed as the c ascad e o f a n o n re c u rsiv e system M i;(«) = Y bkx{n - k) (2.5.7) i=U a n d a recu rsiv e system s y(n) = - v(n ~ k) + v(n) (2.5.8) By rev ersin g th e o r d e r o f th ese tw o system s as was p rev io u sly d o n e fo r th e first-o rd e r sy stem , w e o b ta in th e d ire c t form II s tru c tu re sh o w n in Fig. 2.34 fo r Figure 1 3 3 Direct form I structure of the system described by (2.5.6). 114 Discrete-Time Signals and Systems w(n) b0 Chap. 2 N y(n ) -1 UJ{/1 - 1) J -1 Figure 2 3 4 w(n - 2) b2 w(n - 3) by Direct form II structure for the system described by (2.5.6). N > M. T h is stru c tu re is the cascad e o f a recu rsiv e system N w( n) = — ^ ai W(n - k ) -f x( n) (2.5.9) *=1 fo llo w ed by a n o n re c u rsiv e sy stem M v(n) = vu(n - k ) (2.5.10) W e o b serv e th a t if N > M . this s tru c tu re re q u ire s a n u m b e r o f d elay s e q u a l to th e o rd e r N o f th e sy stem . H o w e v e r, if M > N , th e re q u ire d m e m o ry is specified by M . F ig u re 2.34 can easily by m o d ified to h a n d le th is case. T h u s th e d ire c t form II stru c tu re re q u ire s M + N + 1 m u ltip lic a tio n s a n d m ax{M , jV} d elay s. B e cau se it re q u ire s th e m in im u m n u m b e r o f d elay s fo r th e re a liz a tio n o f th e system d e sc rib e d by (2.5.6), it is so m e tim es ca lle d a canoni c f o r m . Sec. 2.5 Implementation of Discrete-Time Systems 115 A special case o f (2.5.6) occurs if w e set th e system p a ra m e te rs ak — 0. it = 1.........N. T h e n th e in p u t-o u tp u t re la tio n sh ip fo r th e sy stem re d u c e s to M v(n) = - k) (2.5.11) k=0 w hich is a n o n re c u rsiv e lin e a r tim e -in v a ria n t system . T his sy stem view s only the m o st re c e n t M + 1 in p u t signal sa m p les a n d , p rio r to a d d itio n , w eights each sam ple by th e a p p ro p ria te co efficien t bk from th e set {i^}. In o th e r w ords, th e system o u tp u t is b asically a weight ed m o v i n g average of th e in p u t signal. F o r this reaso n it is so m e tim e s called a m o v i n g average ( M A ) syst em. S uch a system is an F IR sy stem w ith an im p u lse re sp o n s e h (k ) e q u a l to th e coefficients bk, th at is. * '* ) = { o ! ' o to rw l" « '5 1 2 » If w e r e tu rn to (2.5.6) a n d se t M = 0, th e g e n eral lin e a r tim e -in v a ria n t system red u ces to a “p u re ly re c u rsiv e ” system d escrib ed by th e d ifferen ce e q u a tio n N y ( n ) = ~ Y a O ’(n ~ k) + bux(n) i =1 (2.5.13) In th is case th e sy stem o u tp u t is a w eig h ted lin ear c o m b in a tio n o f N past o u tp u ts a n d th e p re s e n t in p u t. L in e a r tim e -in v a ria n t system s d esc rib e d by a se c o n d -o rd e r d ifferen ce e q u a ­ tio n a re an im p o rta n t subclass o f th e m o re g e n eral system s d e sc rib e d by (2.5.6) o r (2.5.10) o r (2.5.13). T h e re a so n fo r th e ir im p o rta n c e will be ex p lain ed later w h en w e discuss q u a n tiz a tio n effects. Suffice to say at this p o in t th a t se c o n d -o rd e r sy stem s a re u su ally u sed as b a sic b u ild in g b lo ck s fo r realizin g h ig h e r-o rd e r system s. T h e m o st g e n e ra l se c o n d -o rd e r sy stem is d escrib ed by th e d ifferen ce e q u a tio n y (n ) = - a[v( n - 1) - a2v(n - 2) 4- b(,x(n) (2.5.14) + b\ x ( n — 1) •+- b 2x ( n — 2) w hich is o b ta in e d fro m (2.5.6) b y se ttin g N = 2 an d M = 2. T h e d irect form II s tru c tu re fo r realizin g th is sy stem is sh o w n in Fig. 2.35a. If we se t a\ = = 0. th e n (2.5.14) re d u c e s to y( n) = box(n) + b\x(rt — 1) + b 2x ( n - 2) (2.5.15) w hich is a sp ecial case o f th e F IR system d esc rib e d by (2.5.11). T h e stru c tu re fo r realizin g th is sy stem is sh o w n in Fig. 2.35b. F inally, if w e set b\ = bz = 0 in (2.5.14), w e o b ta in th e p u re ly recu rsiv e se c o n d -o rd e r sy stem d esc rib e d by th e d iffe re n c e e q u a tio n y( n) = —a \ y ( n — 1) — a 2y(n - 2) 4- box(rt) (2.5.16) w hich is a sp e cial case o f (2.5.13). T h e stru c tu re fo r realizin g th is system is show n in Fig. 2.35c. Discrete-Time Signals and Systems 116 Chap. 2 (a) -©---- -0 Y[n) (b) x i n) —-^-1 H —02 I _a' -1 „-1 <c) Figure 2.35 Structures for the realization of second-order systems: (a) general second-order system; (b) FIR system; (c) “purely recursive system” 2.5.2 Recursive and Nonrecursive Realizations of FIR Systems W e h a v e a lread y m a d e th e d istin ctio n b etw e e n F IR an d IIR system s, b ased on w h e th e r th e im p u lse re sp o n se h( n) o f th e system h a s a finite d u ra tio n , o r an infi­ n ite d u ra tio n . W e h av e also m a d e th e d istin c tio n b e tw e e n rec u rsiv e a n d n o n re c u r­ sive system s. B asically, a causal recu rsiv e system is d esc rib e d by an in p u t-o u tp u t e q u a tio n o f th e fo rm y(n) = F[v(^i — 1).........y{n — N ) , x ( n ) , ------x ( n - M)] (2.5.17) an d fo r a lin ear tim e -in v a ria n t system specifically, by th e d iffe re n c e e q u a tio n N U y { n ) = - Y ak>’(n ~ k ) + Y , bkX(n ~ k ) *=i *=o (2.5.18) Sec. 2.5 Implementation of Discrete-Time Systems 117 O n th e o th e r h a n d , cau sal n o n recu rsiv e system s d o n o t d e p e n d o n p a st values of th e o u tp u t a n d h e n c e a re d escrib ed by an in p u t-o u tp u t e q u a tio n o f th e form y (n) = F [x (n ), jc(n - 1).........x ( n — Mj ] (2.5.19) a n d fo r iin e a r tim e -in v a ria n t system s specifically, by th e d iffe re n c e e q u a tio n in (2.5.18) w ith ak: = 0 fo r k = 1, 2 , . . . , N. In th e case o f F IR system s, we h av e a lre a d y o b se rv e d th a t it is aiw ays possible to re a liz e such sy stem s n o n recu rsiv ely . In fact, w ith at. = 0, k = 1, 2 , . . . , N , in (2.5.18), w e h av e a sy stem w ith an in p u t-o u tp u t e q u a tio n v(«) = ] p 6 * ;t( n ~ (2.5.20) T h is is a n o n re c u rsiv e a n d F IR system . A s in d ic a te d in (2.5.12), th e im pulse re sp o n s e o f th e sy stem is sim ply e q u a l to th e coefficients {&*). H e n c e every F IR sy stem can b e re a liz e d n o n recu rsiv ely . O n th e o th e r h a n d , an y F IR system can also b e realized recu rsiv ely. A lth o u g h the g e n eral p ro o f o f th is s ta te m e n t is given la te r, w e shall give a sim ple ex am p le to illu stra te th e p o in t. S u p p o se th a t w e h av e an F IR system o f th e form 1 m y( n) = —— M + If-' - k) (2.5.21) fo r co m p u tin g th e mo v i n g average of a signal jc(h). C learly , th is sy stem is F IR w ith im p u lse re sp o n se h( n) ~ 1 0 < n < M M + 1 F ig u re 2.36 illu stra te s th e stru c tu re of th e n o n re c u rsiv e re a liz a tio n o f th e system . N ow , su p p o se th a t w e ex p ress (2.5.21) as 1 M y (n ) = --------- x ( n — 1 — k) M m + ^ 1 ^Jt=0 + . [x(n) ~ x ( n - 1 - M )] M + 1 y(n - 1) + Figure 2 3 6 1 M + V [x(n) — x (n — 1 — Af)] N onrecursive realization of an FIR moving average system. (2.5.22) 118 Discrete-Time Signals and Systems Chap. 2 N ow , (2.5.22) re p re se n ts a recu rsiv e re a liz a tio n of th e F IR system . T h e stru c tu re o f th is recu rsiv e re a liz a tio n of th e m oving av erag e system is illu stra te d in Fig. 2.37. In su m m ary , w e can th in k of th e te rm s F IR a n d IIR as g e n e ra l ch aracteristics th a t distin g u ish a ty p e of lin e a r tim e -in v a ria n t system , and of th e term s recursive an d nonrecursi ve as d e sc rip tio n s of th e stru c tu re s fo r realizin g o r im p lem en tin g th e system . vt/> - 1) Figure 2 3 7 Recursive realization of an FIR moving averapc svstem. 2.6 CORRELATION OF DISCRETE-TIME SIGNALS A m a th em atical o p e ra tio n th a t closely rese m b le s co n v o lu tio n is c o rre la tio n . Just as in th e case o f c o n v o lu tio n , tw o signal se q u e n c e s are in v o lv ed in c o rre la tio n . In c o n tra st to c o n v o lu tio n , h o w ev er, o u r o bjective in co m p u tin g th e c o rre la tio n b etw een th e tw o signals is to m e a su re th e d e g re e to w hich th e tw o signals are sim ilar an d th u s to e x tra c t so m e in fo rm a tio n th a t d e p e n d s to a large e x te n t on th e ap p licatio n . C o rre la tio n o f signals is o ften e n c o u n te re d in ra d a r, so n a r, digital co m m u n icatio n s, geolo g y, an d o th e r a re a s in science an d en g in eerin g . T o b e specific, le t us su p p o se th a t we have tw o signal se q u e n c e s x ( n ) an d y( n) th a t we w ish to co m p a re . In r a d a r an d active so n a r a p p lic a tio n s. x( n ) can re p re s e n t th e sa m p le d v ersio n o f th e tra n s m itte d signal and y{n) can re p re s e n t th e sam p led v ersio n o f th e receiv ed signal at th e o u tp u t o f the a n a lo g -to -d ig ita l (A /D ) c o n v erter. If a ta rg e t is p re se n t in th e space b e in g se a rc h e d by th e ra d a r o r so n a r, th e receiv ed signal y( n) consists of a d e la y e d v ersio n o f th e tra n sm itte d signal, reflec te d from th e ta rg e t, an d c o rru p te d b y a d d itiv e noise. F ig u re 2.38 d e p ic ts the ra d a r signal re c e p tio n p ro b le m . W e can re p re s e n t th e re c e iv e d signal se q u e n c e as y ( n ) = a x ( n — D) + w( n ) (2.6.1) w h ere a is som e a tte n u a tio n fa c to r re p re s e n tin g th e signal loss involved in th e ro u n d -trip tran sm issio n o f th e signal x (n ), D is th e ro u n d -trip d elay , w hich is Sec. 2.6 Correlation of Discrete-Time Signals 119 assum ed to be an integer m ultiple o f the sam pling interval, and w (n) represents the additive n oise that is picked up by the antenna and any n oise generated by the electron ic com p onents and amplifiers contained in the front end o f the receiver. O n the other hand, if there is no target in the space searched by the radar and sonar, the received signal y(n ) consists o f noise alone. H avin g the tw o signal sequ en ces, x ( n ) , which is called the reference signal or transm itted signal, and y ( n ) , the received signal, the problem in radar and sonar d etection is to com p are y(n) and x ( n ) to determ ine if a target is present and, if so, to determ in e the tim e d elay D and com p ute the distance to the target. In practice, the signal x ( n — D) is h eavily corrupted by the additive n oise to the point w here a visual inspection o f y ( n ) d oes n ot reveal the p resen ce or absence o f the desired signal reflected from the target. Correlation provides us with a m eans for extracting this im portant inform ation from y( n). D igital com m unications is an oth er area w here correlation is o ften used. In digital com m unications the inform ation to be transm itted from on e p oin t to an­ other is usually con verted to binary from , that is, a seq u en ce o f zeros and ones, which are then transm itted to the in tend ed receiver. T o transm it a 0 w e can trans­ m it the signal seq u en ce xo(n) for 0 < n < L — 1, and to transm it a 1 w e can transmit the signal seq u en ce jti(n) for 0 < n < L — 1, w here L is som e integer that d en otes the num ber o f sam p les in each o f the tw o sequ en ces. V ery often , x\ (n) is selected to be th e negative o f xo(n). T h e signal received by the in tend ed receiver m ay be represented as y (n ) = x,-(n) + w (n ) * = 0 ,1 0 < n < L —1 (2.6.2) w here now the uncertainty is w hether x 0(n) or *](n ) is the signal com p on en t in >(n), and w (n ) rep resents the additive n oise and other interferen ce inherent in 120 Discrete-Time Signals and Systems Chap. 2 any co m m u n icatio n system . A g ain , such noise has its o rig in in th e e le ctro n ic c o m p o n e n ts c o n ta in e d in th e fro n t e n d o f th e receiv er. In an y case, th e receiv er k n o w s th e p o ssib le tra n sm itte d se q u e n c e s xo(n) a n d (n) a n d is fa c e d w ith the task o f co m p a rin g th e receiv ed signal y( n) w ith b o th xo(n) a n d Jti(n) to d e te rm in e w hich o f th e tw o signals b e tte r m a tc h e s y(n). T h is c o m p a riso n p ro c e ss is p e rfo rm e d by m ean s o f th e c o rre la tio n o p e ra tio n d e sc rib e d in th e follow ing su b se c tio n . 2.6.1 Crosscorrelation and Autocorrelation Sequences S u p p o se th a t we h av e tw o real signal se q u e n c e s x ( n ) an d y ( n ) ea c h o f w hich has finite en erg y . T h e crosscorrelation o f x ( n ) and v(n) is a se q u e n c e rxy(l), w hich is d efin ed as r.tv(l) — ~ 0 l = 0. ± 1 , ± 2 , . . . (2.6.3) riy(t) — Y , X ^n + 0 y ( « ) 1 = 0, ± 1 , ± 2 , . . . (2.6.4) n —~ x or, eq u iv alen tly , as OC n= -oc T h e in d ex I is th e (tim e ) sh ift (o r lag) p a r a m e te r an d th e su b scrip ts x y on th e c ro ss­ c o rre la tio n se q u e n c e rxy(l) in d icate the se q u e n c e s b ein g c o rre la te d . T h e o rd e r of th e su b scrip ts, w ith .x p re c e d in g y, in d ic a te s th e d ire c tio n in w h ich o n e se q u en ce is sh ifted , re lativ e to th e o th e r. T o e la b o ra te , in (2.6.3), th e se q u e n c e x ( n ) is left u n sh ifte d an d y (n ) is sh ifted by / u n its in tim e, to th e rig h t fo r / p o sitiv e a n d to th e left for I n eg ativ e. E q u iv a le n tly , in (2.6.4), th e se q u en ce y (« ) is left u n sh ifted a n d x{n) is sh ifted by I u n its in tim e, to th e left fo r / p o sitiv e a n d to th e rig h t fo r / n eg ativ e. B u t sh iftin g x (n ) to th e left by / u n its relativ e to y (n ) is e q u iv a le n t to sh iftin g y(«) to th e rig h t by / u n its re lativ e to x ( n) . H e n c e th e c o m p u ta tio n s (2.6.3) an d (2.6.4) yield id en tical c ro ssc o rre la tio n se q u en ces. If w e rev erse th e ro les o f jr(«) an d y (n) in (2.6.3) an d (2.6.4) a n d th e re fo re re v e rse th e o rd e r o f th e indices xy. we o b ta in th e c ro ss c o rre la tio n se q u e n c e OC ryx(I) = y ( n ) x ( n — I) (2.6.5) y ( n + l ) x ( n) (2.6.6) n=—0C o r, e q u iv alen tly , OC ryx(l) = Y n — —d c By c o m p a rin g (2.6.3) w ith (2.6.6) o r (2.6.4) w ith (2.6.5), we c o n c lu d e th a t rxy(l) = ryx( ~l ) (2.6.7) T h e re fo re , r y i (l) is sim ply th e fo ld ed v ersio n o f rxy(l), w h e re th e fo ld in g is d o n e w ith re sp e c t to / = 0. H e n c e , ryx(l) p ro v id e s exactly th e sam e in fo rm a tio n as rxv(l), w ith re sp e c t to th e sim ilarity o f x ( n ) to y(n ). Sec. 2.6 Correlation of Discrete-Time Signals 121 Exam ple 2.6.1 D eterm ine the crosscorrelation sequence rxv(l) of the sequences x(n) = { ....0 .0 .2 . —1 .3 .7 .1 .2 . —3. 0. 0 ....} t v(n) = { . . . . 0 . 0 . 1 . - 1 . 2 . - 2 . 4 . 1 . - 2 . 5 .0 .0 ,...] t Solution .(/). For I = 0 w e have Let us use the definition in (2.6.3) to compute r rv(0) = Y x(ri)v(n) The product sequence u()(n) = x ( n ) y ( r ) is u„(n) = { ..., 0. 0. 2. 1. 6. -1 4 . 4. 2, 6, 0, 0. . . .) t and hence the sum over all values of n is r,v(0) = 7 For I > 0, we simpiy shift v(«) to the right relaLive to a ' ( h ) hy / units, compute the product sequence v/(n) = jr(n)_v(n — I), and finally, sum o v er all va lu es o f the product sequence. Thus we obtain r t ,( l) = 13, rJV(2) = -1 8 . r vv(3) = 16. r,,(4 ) = - 7 rM5) = 5. r ,v(6) = - 3 , rxy (/) = 0. I >1 For / < 0, we shift y(n) to the left relative to jr(n) by / units, compute the product sequence v/(n) = j(n ) v(n —I), and sum over all values of the product sequence. Thus we obtain the values of the crosscorrelation sequence rIV(—1) = 0, riy( - 2 ) = 33. rly{ - 3) = -1 4 . rTV( - 4 ) = 36 rJV( -5 ) = 19, fxv(-6) = - 9 , rIV( - 7) = 10, rxv(l) = 0, I < - 8 Therefore, the crosscorrelation sequence of x{n) and y(n) is r,AD = (10, - 9 ,1 9 , 36, -1 4 , 33,0, 7,13, -1 8 ,1 6 . - 7 , 5, - 3 ) t T h e sim ilarities b e tw e e n th e c o m p u ta tio n o f th e c ro ss c o rre la tio n o f tw o se ­ q u e n c e s a n d th e c o n v o lu tio n o f tw o se q u e n c e s is a p p a re n t. In th e c o m p u ta tio n of c o n v o lu tio n , o n e o f th e se q u e n c e s is fo ld ed , th e n sh ifted , th e n m u ltip lie d by th e o th e r se q u e n c e to fo rm th e p ro d u c t se q u e n c e fo r th a t shift, a n d finally, th e values o f th e p r o d u c t se q u e n c e a re su m m ed . E x c e p t fo r th e fo ld in g o p e ra tio n , th e co m ­ p u ta tio n o f th e c ro ss c o rre la tio n se q u e n c e involves th e sa m e o p e ra tio n s: shifting o n e o f th e se q u e n c e s , m u ltip lic atio n o f th e tw o se q u e n c e s, an d su m m in g o v er all v alu es o f th e p r o d u c t se q u e n c e . C o n se q u e n tly , if w e h av e a c o m p u te r p ro g ra m th a t p e rfo rm s c o n v o lu tio n , w e can use it to p e rfo rm c ro ss c o rre la tio n by p ro v id in g 122 Discrete-Time Signals and Systems Chap. 2 as in p u ts to th e p ro g ra m , th e se q u e n c e jc(«) an d th e fo ld ed se q u e n c e y ( —n). T h e n th e c o n v o lu tio n o f x ( n ) w ith y ( —n) yields th e c ro ss c o rre la tio n r rv(/). th a t is, rxv(D = x ( l ) * y ( - l ) (2.6.8) In th e special case w h ere y( n) = x( n ) , we h av e th e aut ocorrel ati on o f *(« ), w hich is d efined as th e se q u e n c e OC rXx(l)= x(n)j:(n - 0 (2.6.9) ft ~ —OC o r, eq u iv alen tly , as OO rxx{l) = ^ 2 , x (n + (2.6.10) n= —oc In d ealin g w ith fin ite -d u ra tio n se q u e n c e s, it is cu sto m a ry to ex p ress th e a u to ­ c o rre la tio n an d c ro ss c o rre la tio n in te rm s of th e finite lim its on th e su m m a tio n . In p a rtic u la r, if x (« ) a n d v(n) a re causal se q u e n c e s o f le n g th N [i.e., .v(n) = y(n) = 0 for n < 0 an d n > N], th e c ro ssc o rre la tio n an d a u to c o rre la tio n se q u e n c e s m ay be ex p ressed as rxy(l) = x(n)y(n-l) ^ (2.6.11) an d A'-1*1-1 Y rxx( l ) = (2.6.12) n=f w h ere i = I, k = 0 fo r / > 0, a n d / = 0, k = I fo r / < 0. 2.6.2 Properties of the Autocorrelation and Crosscorrelation Sequences T h e a u to c o rre la tio n an d c ro ssc o rre la tio n se q u e n c e s h av e a n u m b e r of im p o rta n t p ro p e rtie s th a t w e n o w p re se n t. T o d e v e lo p th e s e p ro p e rtie s , le t us assu m e th a t we h av e tw o se q u e n c e s x ( n ) a n d y (n) w ith finite en erg y from w hich w e fo rm the lin e a r c o m b in a tio n , ax(n) bv( n — I) w h ere a an d b a re a rb itra ry c o n s ta n ts a n d I is so m e tim e shift. T h e en erg y in this signal is OC Y fj —-oc OC OC [ax(n) + by( n - I)]2 = a 2 ^ x 2( n ) + b 2 ^ n = —oc y 2{n - I) /i“ —oc -j l ^V""' x (in )\ y (tn — I) n +. 2ab n = —oc = a 2rxx(0) + b2r yy( 0) + l a b r xy{l) (2 '6 -13) Sec. 2.6 123 Correlation of Discrete-Time Signals F irst, we n o te th a t rx x (0) = E x a n d /-vy(0) = £ v, w hich a re th e en e rg ie s o f x{n) an d y (n ), resp ectiv ely . It is o b v io u s th a t a 2rxx(0) -I- b 2r y>.(0) + 2abrxy(l) > 0 (2.6.14) N ow , assu m in g th a t b ^ 0, w e can divide (2.6.14) by b 2 to o b ta in r„ (0 ) (^)2 + 2rxy(l) Q + r v_v(0) > 0 W e view th is e q u a tio n as a q u a d ra tic w ith coefficients r XJ(0), 2rxv(l), a n d ^ ,( 0 ) . Since th e q u a d ra tic is n o n n e g a tiv e , it follow s th a t th e d isc rim in a n t of this q u a d ra tic m u st b e n o n p o sitiv e , th a t is, 4 [ r ; v(/) - r , , ( 0 K v(0)] < 0 T h e re fo re , th e c ro ss c o rre la tio n se q u e n c e satisfies th e c o n d itio n th a t |r,v(/>| < y r „ ( 0 ) r , v(0) = (2.6.15) In th e sp ecial case w h ere v(n) = x ( n ), (2.6.15) re d u c e s to \rxx( D \ < r xx(0) = E x (2.6.16) T his m ean s th a t th e a u to c o rre la tio n se q u e n c e o f a signal a tta in s its m ax im u m value at z e ro lag. T h is re su lt is c o n siste n t w ith th e n o tio n th a t a sig n a l m a tc h e s p erfe ctly w ith itself at z e ro shift. In th e case o f th e c ro ssc o rre la tio n se q u en ce, th e u p p e r b o u n d o n its v alu es is given in (2.6.15). N o te th a t if an y o n e o r b o th o f th e signals involved in th e c ro ssc o rre la tio n a re scaled , th e sh a p e o f th e c ro ss c o rre la tio n se q u e n c e d o e s n o t ch an g e, only the a m p litu d e s o f th e c ro ss c o rre la tio n se q u e n c e a re sc aled accordingly. S ince scaling is u n im p o rta n t, it is o ften d e s ira b le , in p ra c tic e , to n o rm a liz e th e a u to c o rre la tio n a n d c ro ss c o rre la tio n se q u e n c e s to th e ran g e fro m - 1 to 1. In th e case o f the a u to c o rre la tio n se q u e n c e , w e can sim ply d iv id e by ^ ( 0 ) . T h u s th e n o rm aliz ed a u to c o rre la tio n se q u e n c e is d efin ed as P. A D = rixiO) (2-6 -17) Sim ilarly, we d efin e th e n o rm a liz e d c ro ssc o rre la tio n se q u e n c e pXY(l) = r ' v(l) : v/ r xx(0 )rvv(0) (2.6.18) N ow \pXI{l)\ < 1 a n d |/oXv(0! < 1, a n d h e n c e th ese se q u e n c e s a re in d e p e n d e n t of signal scaling. F in ally , as we h av e a lre a d y d e m o n s tra te d , th e c ro ss c o rre la tio n se q u e n c e sa t­ isfies th e p ro p e rty r Xy ( l ) = f y x ( - 0 Discrete-Time Signals and Systems 124 Chap. 2 W ith y(n) = x ( n) , th is re la tio n resu lts in th e follow ing im p o rta n t p ro p e rty fo r the a u to c o rre la tio n se q u en ce (2.6.19) r „ { l ) = rx s ( . - l ) H e n c e th e a u to c o rre la tio n fu n ctio n is an ev en fu n ctio n . C o n s e q u e n tly , it suffices to co m p u te rx x (l) fo r / > 0. Example 2.6.2 Compute the autocorrelation of the signal x(n) = a"u(n), 0 < a < 1 Solution Since x (n) is an infinite-duration signal, its autocorrelation also has infinite duration. We distinguish two cases. If I > 0. from Fig. 2.39 we observe that r t J (/) = x ( n ) x ( n - /) = ' = a n= l n =i 1 n~l Since a < 1, the infinite series coti crges and we obtain r tl (/) ~ I> 0 ^ -V 1 —a- For / < 0 we have = n=(l x(n)x(/i —/) = a -1'S~'(rr)" = ------- -ti~! I - a- / < 0 n=(l But when / is negative, c r 1 — a ' 1'. Thus the two relations for r i t ( ! ) can be combined into the following expression: rx,(!) = ■— ,,a ,t: —oc < / < oc 1 —a~ The sequence rxx(l) is shown in Fig. 2.42(d). We observe that (2.6.20) r „ ( ~ / | = rxAD and rlt(0) = 1 1 —a2 Therefore, the normalized autocorrelation sequence is r (/) p s,(!) - — — — cr|,: ~ oc < I < oc rxxW) (2.6.21) 2.6.3 Correlation of Periodic Sequences In S ectio n 2.6.1 w e d efin ed th e c ro ss c o rre la tio n an d a u to c o r re la tio n se q u en ces of en erg y signals. In this se ctio n we co n sid e r th e c o rre la tio n se q u e n c e s o f p o w er signals an d , in p a rtic u la r, p e rio d ic signals. L et x( n ) a n d y(rc) b e tw o p o w e r signals. T h e ir c ro ss c o rre la tio n se q u e n c e is d efin ed as 1 M rx \ 0 ) — lim — ----- - Y ] M -oc 2 M + 1 x(n)y(n~l) ( 2 .6 .2 2 ) Sec. 2.6 125 Correlation of Discrete-Time Signals xi n) ) i' in . -2-10123 (a) xin-I) / >o I o (b) x(n - I ) l< 0 (c) r„(!) = ■■■ - 2 - 1 0 Figure 139 1 2 (d) ' , a1'1 1 - a2 / Compulation of the autocorrelation o f the signal xin) = a", 0 < a < 1. If x ( n ) = y(tt), we have the definition o f the autocorrelation seq u en ce of a p ow er signal as 1 M rxx(I) = iim . . . , 1 Y ] x ( n ) x ( n - l ) (2.6.23) Af-oo 2M + 1 In particular, if x ( n ) and y ( n ) are two periodic seq u en ces, each with period the averages indicated in (2.6.22) and (2.6.23) o ver the infinite interval, are identical 126 D iscrete-Time Signals and Systems Chap. 2 to th e av erag es o v er a single p e rio d , so th a t (2.6.22) an d (2.6.23) re d u c e to (2.6.24) an d (2.6.25) It is c lear th a t r ry(l) an d rxx(l) are p e rio d ic c o rre la tio n se q u e n c e s w ith p e rio d N . T h e fa c to r 1 / N can b e v iew ed as a n o rm a liz a tio n scale facto r. In som e p ractical ap p licatio n s, c o rre la tio n is u se d to id en tify p erio d icitie s in an o b se rv e d physical signal w hich m ay be c o rru p te d by ra n d o m in te rfe re n c e . F o r ex am p le, c o n sid er a signal se q u e n c e y( n) o f th e form y{n) = * (n ) + w(n) (2.6.26) w h ere jc(/i) is a p erio d ic se q u e n c e o f so m e u n k n o w n p e rio d N a n d w( n) re p re se n ts an ad d itiv e ran d o m in te rfe re n c e . S u p p o se th a t w e o b se rv e M sa m p le s o f y(n ), say 0 < n < M — 1, w h ere M > > N. F o r all p ractical p u rp o se s, w e can assum e th a t y( n) — 0 fo r n < 0 an d n > M. N ow th e a u to c o rre la tio n se q u e n c e of y(n), using th e n o rm aliz atio n facto r o f \ / M . is (2.6.27) If we su b stitu te for y(n) fro m (2.6.26) in to (2.6.27) w e o b ta in __1 ry.T(/) = ■ ■j M- 1 — Y ] x ( n ) x i n - /) M j M —J H— - y ^ [ .r ( n ) itj (/2 — /) + w{ n) x{n — /)] M “ (2.6.28) T h e first fa c to r on th e rig h t-h a n d sid e of (2.6.28) is th e a u to c o rre la tio n se ­ q u e n c e o f x i n) . S ince x( n) is p e rio d ic , its a u to c o rre la tio n s e q u e n c e ex h ib its th e sam e p erio d icity , th u s co n ta in in g relativ ely larg e p e a k s at / = 0, N , 2N , a n d so on. H o w ev er, as th e shift I a p p ro a c h e s M , th e p e a k s a re re d u c e d in a m p litu d e d u e to th e fact th a t w e h av e a finite d a ta re c o rd o f M sa m p le s so th a t m any o f th e p ro d u c ts ;t(n)j:(rt — /) a re zero . C o n s e q u e n tly , w e sh o u ld av o id c o m p u tin g r VT(/) fo r larg e lags, say, I > M f l . Sec. 2.6 Correlation of Discrete-Time Signals 127 T h e c ro ss c o rre la tio n s rxu,(/) an d rwx(l) b etw e e n th e signal a n d th e a d ­ ditiv e ra n d o m in te rfe re n c e a re e x p ected to be relativ ely sm all as a resu lt of the e x p e c ta tio n th a t ;r(/i) a n d w ( n ) will be to ta lly u n re la te d . F in ally , the last term on th e rig h t-h a n d sid e of (2.6.28) is th e a u to c o rre la tio n se q u e n c e o f th e ra n d o m se ­ q u e n c e w( n) . T h is c o rre la tio n se q u en ce will c e rta in ly c o n tain a p e a k a t / = 0, but b ecau se o f its r a n d o m ch aracteristics, r ww(l) is ex p e c te d to d ecay rap id ly to w ard zero . C o n s e q u e n tly , o nly rxx{l) is e x p e c te d to h av e large p e a k s fo r / > 0. T his b e h a v io r allow s us to d e te c t th e p re se n c e of th e p e rio d ic signal a (/ j ) b u rie d in the in te rfe re n c e u>(n) a n d to id e n tify its p e rio d . A n e x am p le th a t illu stra te s th e use of a u to c o rre la tio n to identify a h id d e n p e rio d ic ity in an o b se rv e d physical signal is show n in Fig. 2.40. T h is figure illus­ tra te s th e a u to c o rre la tio n (n o rm a liz e d ) se q u e n c e fo r th e W o lfe r su n sp o t n u m b e rs fo r 0 < / < 20, w h ere an y v alu e o f / c o rre sp o n d s to o n e y ear. T h e se n u m b e rs are given in T a b le 2.2 fo r th e 100-year p e rio d 1770-1869. T h e re is c lear ev id en ce in th is fig u re th a t a p e rio d ic tre n d exists, w ith a p e rio d o f 10 to 11 years. Example 2.6.3 Suppose that a signal sequence jr(n) = sin(7r/5)/i, for 0 < n < 99 is corrupted by an additive noise sequence «Kn), where the values of the additive noise are selected independently from sample to sample, from a uniform distribution over the range TABLE 2.2 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 YEARLY WOLFER SUNSPOT NUMBERS 101 82 66 35 31 7 20 92 154 125 85 68 38 23 10 24 83 132 131 118 90 67 60 47 41 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 21 16 6 4 7 14 34 45 43 48 42 28 10 8 2 0 1 5 12 14 35 46 41 30 24 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 16 7 4 2 8 17 36 50 62 67 71 48 28 8 13 57 122 138 103 86 63 37 24 11 15 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 40 62 9X 124 96 66 64 54 39 21 7 4 23 55 94 96 77 59 44 47 30 16 7 37 74 128 Discrete-Time Signals and Systems Chap. 2 Year (a) Figure 2.40 Identification of periodicity in the Wolfer sunspot numbers: (a) an­ nual Wolfer sunspot numbers; (b) autocorrelation sequence. (—A /2, A /2), where A is a param eter of the distribution. The observed sequence is y(n) = x(n) + w(n). D eterm ine the autocorrelation sequence rvt(n) and thus determine the period of the signal x(rt). Solution The assumption is that the signal sequence x(n) has some unknown period that we are attem pting to determ ine from the noise-corrupted observations {y(n)). Although x(n) is periodic with period 10, we have only a ftmte-duration sequence of Sec. 2.6 129 Correlation of Discrete-Time Signals length M = 100 [i.e.. 10 periods of jcm )]. The noise power level P„ in the sequence u'(n) is determ ined by the param eter A. We simply state that Pu = A: /12. The signal power level is P, = I. Therefore, the signal-to-noise ratio (SNR) is defined as 3 P, 6 ~P~U ~ A : /1 2 “ A : Usually, the SNR is expressed on a logarithmic scale in decibels (dB) as 101ogui ( PJPv) . Figure 2.41 illustrates a sample of a noise sequence w(n), and the observed sequence y(n) — x(n) + it’(n) when the SNR = 1 dB. The autocorrelation sequence J ' I l l ♦ Lt 1 i ([Ijj-liii • ' Tllrii! 1 ttIiIt. j i i| 4 • * 4 * t ill ..tI 1. I i i h i p p T T J ljw ^ IT * 4 1 1 • la] (c) Figure 2.41 noise. Use of autocorrelation to detect the presence of a periodic signal corrupted by Discrete-Tim e Signals and Systems 130 Chap. 2 L T TTTT. Tt TJ IT.TTUTtTT ._L T .T. I .T. ttT .1. pp V|Vvli w(n) ' | (a) (b) r„M . 1 I ? r![It xij|il rl It i o1 r!lfit F 1 tTT 1 [1* ? (c) Figure 2.42 Use of autocorrelation to detect the presence of a periodic signal corrupted by noise. r vv(/) is illustrated in Fig. 2.41c. W e observe that the periodic signal •*(/?), embedded in y(n), results in a periodic autocorrelation function rZI(l) with period N — 10. The effect of the additive noise is to add to the peak value at / = 0. but for I ^ 0, the correlation sequence rwu,(l) = ^ 0 a s a result of the fact that values of w(ri) were gen­ erated independently. Such noise is usually called white noise. The presence of this noise explains the reason for the large peak at I = 0. The smaller, nearly equal peaks at I = ±10, ± 2 0 ,... are due the periodic characteristics of x(n). Figure 2.42 illustrates the noise sequence w(n), the noise-corrupted signal y(n), and the autocorrelation sequence r vv(/) for the same signal, within which is embedded a signal at a smaller noise level. In this case, the SNR = 5 dB. E ven with this relatively small noise level, the periodicity of the signal is not easily determ ined from observa­ tion of y( n). However, it is clearly evident from observation of the autocorrelation sequence ryy(n). 2.6.4 Computation of Correlation Sequences A s indicated on Section 2.6.1, the procedure for com puting the crosscorrelation seq u en ce b etw een x ( n ) and y ( n ) in volves shifting on e o f the seq u en ces, say x(n), Sec. 2.6 Correlation of Discrete-Time Signals 131 to o b ta in x( n - /), m u ltip ly in g th e sh ifted se q u e n c e by v(n) to o b ta in th e p r o d ­ u ct se q u e n c e y ( n ) x ( n - /), an d th en su m m in g all th e v alu es o f th e p ro d u c t se ­ q u en ce to o b ta in r yx(l). T his p ro c e d u re is r e p e a te d fo r d iffe re n t values o f th e lag /. E x c e p t fo r th e fo ld in g o p e ra tio n th a t is involved in c o n v o lu tio n , th ese b a ­ sic o p e ra tio n s fo r co m p u tin g th e c o rre la tio n se q u e n c e a re id e n tic a l to th o se in co n v o lu tio n . T h e p ro c e d u re fo r co m p u tin g th e co n v o lu tio n is directly a p p licab le to c o m ­ p u tin g th e c o rre la tio n o f tw o se q u en ces. S pecifically, if w e fo ld y (n) to o b ta in y ( —n), th e n th e c o n v o lu tio n o f x ( n ) w ith v ( —n) is id en tical to th e cro ssc o rre la tio n o f x ( n ) w ith y(n). T h a t is. rxy(l) = x(rt) * y ( —n ) |n=/ (2.6.29) A s a c o n se q u e n c e , th e c o m p u ta tio n a l p ro c e d u re d escrib ed for c o n v o lu tio n can be a p p lied d irectly to th e c o m p u ta tio n o f th e c o rre la tio n se q u en ce. W e no w d e sc rib e an a lg o rith m th a t can b e easily p ro g ra m m e d to c o m p u te th e c ro ss c o rre la tio n se q u e n c e of tw o fin ite -d u ra tio n signals * (« ), 0 < n < N ~ I, an d y ( n) , 0 < n < M — 1. T h e alg o rith m c o m p u te s rJV(/) fo r p o sitiv e lags. A cc o rd in g to th e re la tio n rxy(—l) = r YX(I), th e v alu es o f rXY(l) fo r n eg ativ e lags can be o b ta in e d by using th e sam e a lg o rith m fo r p o sitiv e lags, an d in te rc h a n g in g th e roles o f jt(« ) an d v(n). W e o b se rv e th a t if M < N, rXY{i) can be c o m p u te d by th e re la tio n s M - \ + l Y ' , x ( n ) y ( n — /), 0 < 1 < N —M (2.6.30) O n th e o th e r h a n d , if M > N , th e fo rm u la fo r th e c ro ss c o rre la tio n becom es rxy(l) = Y x ( n ) v ( n - 1) 0 < 1< N -1 (2.6.31) T h e fo rm u la s in (2.6.30) a n d (2.6.31) c a n b e c o m b in ed a n d c o m p u te d by m ean s o f th e fo llo w in g sim p le alg o rith m illu stra te d in th e flow chart in Fig. 2.43. By in terch an g in g th e ro les o f j ( « ) a n d y(n) an d re c o m p u tin g th e cro ssc o rre la tio n se q u e n c e , w e o b ta in th e v alu es o f rXY(l) c o rre sp o n d in g to n eg ativ e shifts I. If w e w ish to c o m p u te th e a u to c o rre la tio n se q u e n c e rxx(l), w e se t y (n ) = jr(n) an d M = N in (2.6.31). T h e co m p u ta tio n o f rxx{l) can be d o n e by m e a n s of the sa m e a lg o rith m fo r p o sitiv e shifts only. 2.6.5 Input-Output Correlation Sequences In th is se ctio n w e d e riv e tw o i n p u t- o u tp u t re la tio n sh ip s fo r L T I system s in th e “c o rre la tio n d o m a in .” L e t us assu m e th a t a signal x ( n ) w ith k n o w n a u to c o r re la ­ tio n rxx(I) is a p p lied to an L T I system w ith im p u lse re sp o n s e h( n), p ro d u c in g th e 132 Discrete-Tim e Signals and Systems C j “lD Chap. 2 Figure 2A3 Flowchart for software implementation of crosscorrelation. Sec. 2.6 133 Correlation of Discrete-Time Signals o u tp u t signal v(n) = h( n) * .x (/?) = ^ h(k)x(>i — k) k=—oc T h e c ro ss c o rre la tio n b e tw e e n th e o u tp u t a n d th e in p u t signal is r VJ-(7) = y d ) * x ( - l ) — h ( l ) * [*(/) * * ( - / ) ] or ryx(l) = /;(/) * rxx(l) (2.6.32) w h ere w e h av e u se d (2.6.8) a n d th e p ro p e rtie s o f co n v o lu tio n . H e n ce th e c ro ssco r­ re la tio n b e tw e e n th e in p u t an d the o u tp u t of th e sy stem is th e co n v o lu tio n of the im p u lse re sp o n s e w ith the a u to c o rre la tio n of th e in p u t se q u e n c e . A lte rn a tiv e ly . ryx(l) m av b e view ed as th e o u tp u t of th e L T I sy stem w hen th e in p u t se q u en ce is rxx (/). T h is is illu stra te d in Fig. 2.44. If we rep lace / by - / in (2.6.32), w e o b tain r.tyU) = h ( - D * rxx(l) T h e a u to c o rre la tio n of th e o u tp u t signal can be o b ta in e d by using (2.6.8) w ith x(/i) = y(/i) an d th e p ro p e rtie s o f co n v o lu tio n . T h u s we have r lv(/) = v(/) * v (—/) = [/;(/) * * (/)] * [/j ( —/ J * * ( —/)] (2.6.33) = [/?(/) * h ( —/)] * [*(/) * * ( —/)] = rhh(l) * rxx(l) T h e a u to c o rre la tio n rhh(l) of th e im pulse resp o n se h(n) exists if th e system is stable. F u rth e rm o re , th e stab ility in su res th a t th e system d o e s n ot ch an g e th e ty p e (en erg y o r p o w e r) o f th e in p u t signal. By ev alu atin g (2.6.33) fo r / = 0 we o b ta in CC (2.6.34) w hich p ro v id e s th e en e rg y (o r p o w er) of th e o u tp u t signal in te rm s o f a u to c o r re ­ latio n s. T h e se re la tio n sh ip s h o ld fo r b o th en erg y a n d p o w e r signals. T h e direct d e riv a tio n o f th e s e re la tio n sh ip s for en erg y an d p o w e r signals, a n d th e ir e x ten sio n s to co m p lex sig n als, are left as exercises fo r the stu d e n t. Input rxx<n ) LTI SYSTEM Output ft(n) rvr(n) Figure 2.44 Input-output relation for crosscorrelation ryx(n). 134 Discrete-Time Signals and Systems Chap. 2 2.7 SUMMARY AND REFERENCES T h e m a jo r th e m e o f th is c h a p te r is th e c h a ra c te riz a tio n o f d isc re te -tim e signals an d sy stem s in th e tim e d o m ain . O f p a rtic u la r im p o rta n c e is th e class o f lin e a r tim ein v a ria n t (L T I) sy stem s w hich a re w idely u se d in th e design a n d im p le m e n ta tio n o f d ig ital signal p ro cessin g system s. W e c h a ra c te riz e d L T I sy ste m s by th e ir u n it sa m p le re sp o n se h{n) an d d e riv e d th e co n v o lu tio n su m m a tio n , w hich is a fo rm u la fo r d e te rm in in g th e re sp o n se y( n) o f th e system c h a ra c te riz e d by h( n) to an y given in p u t se q u e n c e x(n). T h e class o f L T I system s c h a ra c te riz e d by lin e a r d ifferen ce e q u a tio n s w ith c o n s ta n t coefficients is by fa r th e m o st im p o rta n t of th e L T I sy stem s in th e th e o ry an d a p p licatio n o f d ig ital sig n a l p ro cessin g . T h e g e n e ra l s o lu tio n of a lin e a r dif­ fe re n c e e q u a tio n w ith c o n s ta n t coefficients w as d eriv e d in th is c h a p te r an d show n to co n sist of tw o c o m p o n en ts: th e so lu tio n o f th e h o m o g e n e o u s e q u a tio n w hich r e p re s e n ts th e n a tu ra l re sp o n se o f th e sy stem w h en th e in p u t is z e ro , an d th e p a r­ tic u la r so lu tio n , w hich re p re s e n ts th e re sp o n s e o f th e system to th e in p u t signal. F ro m th e d ifferen ce e q u a tio n , w e also d e m o n s tra te d h o w to d e riv e th e u n it sam ple re sp o n s e of th e L T I system . L in e a r tim e -in v a ria n t sy stem s w ere g en erally su b d iv id ed in to F IR (finited u ra tio n im p u lse re sp o n se ) a n d I I R (in fin ite -d u ra tio n im pulse re sp o n s e ) d e p e n d ­ ing o n w h e th e r h(n) h as finite d u ra tio n o r infinite d u ra tio n , resp ec tiv ely . T he re a liz a tio n s o f such system s w ere briefly d escrib ed . F u rth e rm o re , in the re a liz a ­ tio n o f F IR system s, we m a d e th e d istin ctio n b e tw e e n recu rsiv e a n d n o n recu rsiv e re a lizatio n s. O n th e o th e r h a n d , w e o b se rv e d th a t I I R system s can be im p le m e n te d recu rsiv ely , only. T h e re are a n u m b e r o f te x ts o n d isc re te -tim e signals a n d system s. W e m e n ­ tio n as ex am p les th e b o o k s by M c G illem a n d C o o p e r (1984), O p p e n h e im a n d W illsky (1983), an d S ie b e rt (1986). L in e a r c o n sta n t-c o e ffic ie n t d iffe re n c e e q u a tio n s are tr e a te d in d e p th in th e b o o k s by H ild e b ra n d (1952) a n d L evy a n d L essm an (1961). T h e last to p ic in this c h a p te r, o n c o rre la tio n o f d isc re te -tim e signals, plays an im p o rta n t ro le in d ig ital signal p ro cessin g , esp ecially in a p p lic a tio n s d ealin g w ith digital c o m m u n ic a tio n s, ra d a r d e te c tio n a n d e stim a tio n , so n a r, a n d geophysics. In o u r tr e a tm e n t o f c o rre la tio n se q u e n c e s, w e a v o id e d th e use o f sta tis tic a l concepts. C o rre la tio n is sim ply d efin ed as a m a th e m a tic a l o p e r a tio n b e tw e e n tw o se q u en ces, w hich p ro d u c e s a n o th e r se q u e n c e , called e ith e r th e crosscorrelat ion s e quence w hen th e tw o se q u e n c e s a re d iffe re n t, o r th e aut ocorrel ati on sequence w h e n th e tw o se ­ q u e n c e s are id en tical. In p ractical a p p lic a tio n s in w hich c o rre la tio n is u sed , o n e ( o r b o th ) o f th e se q u e n c e s is (a re ) c o n ta m in a te d by n o ise a n d , p e rh a p s , by o th e r fo rm s o f in te rfe r­ en ce. In such a case, th e noisy se q u e n c e is c alled a r a n d o m se q u e n c e a n d is c h a r­ a c te riz e d in sta tistical term s. T h e c o rre sp o n d in g c o rre la tio n se q u e n c e b e c o m e s a fu n ctio n o f th e sta tistical c h a ra c te ristic s of th e n o ise an d an y o th e r in te rfe re n c e . T h e statistical c h a ra c te riz a tio n o f se q u e n c e s a n d th e ir c o rre la tio n is tr e a te d in A p p e n d ix A . S u p p le m e n ta ry re a d in g o n p ro b a b ilis tic an d sta tistical c o n c e p ts deal- Chap. 2 135 Problems ing w ith c o rre la tio n can be fo u n d in th e b o o k s by D a v e n p o rt (1970). H e lstro m (1990). P ap o u lis (1984). an d P eeb les (1987). PROBLEMS 2.1 A discrete-time signal x(n) is defined as I l + j, —3 < n < —1 1. 0 < n < 3 0, elsewhere (a) Determ ine its values and sketch the signal .v(n). (b) Sketch the signals that result if we: (1) First fold x{n) and then delay the resulting signal by four samples. (2) First delay xin) by four samples and then fold the resulting signal (c) Sketch the signal x ( —n + 4 ). (d) Com pare the results in parts (b) and (c) and derive a rule for obtaining the signal ,v(—n -t- k) from (e) Can you express the signal ,r(n) in term s of signals S(n) and u{n)l 2.2 A discrete-time signal ,v(n) is shown in Fig. P2.2. Sketch and label carefully each of the following signals. .v(n) J_ J_ L L _ ________ _ - 2 - 1 0 1 2 3 4 „ FigUre P2.2 (a ) x(n - 2) (b) x(4 —n) ( c)x(n + 2) (d) x(n)u(2 — n) (e) x(n - 1 )8{n - 3) (F) x( n2) (g) even part of x{n) (h) odd part of x ( n ) 2 3 Show that (a ) &(n) = u(n) — u(n — 1) (b) u(n) = 8(k) = ^ 2.4 Show that any signal can be decomposed into an even and an odd component. Is the decomposition unique? Illustrate your arguments using the stgnal x(n) = {2. 3, 4. 5. 6) t 2.5 Show that the energy (power) of a real-valued energy (power) signal is equal to the sum of the energies (powers) of its even and odd components. 2.6 Consider the system vf«) = T[x( n) ] = x ( n 2) (a) Determ ine if the system is time invariant. 136 Discrete-Time Signals and Systems Chap. 2 (b) To clarify the result in part (a) assume that the signal _fl, \ 0, O 5 /1 < 3 elsewhere is applied into the system. (1) Sketch the signal *(«). (2) D eterm ine and sketch the signal y ( n ) = T[x(n)}, (3) Sketch the signal y'2(n) = y(n — 2). (4) D eterm ine and sketch the signal x2(n) = x(n - 2). (5) Determ ine and sketch the signal = T \ x 2(n)]. (6) Com pare the signals ^ ( n ) and y(n - 2). W hat is your conclusion? (c) R epeat part (b) for the system y(rt) = x(n) - x(n — 1) Can you use this result to make any statem ent about the time invariance of this system? Why? (d) Repeat parts (b) and (c) for the system y(rt) = T [ x ( n )] = nx(n) 2.7 A discrete-time system can be (1) Static or dynamic (2) Linear or nonlinear (3) Time invariant or time varying (4) Causal or noncausal (5) Stable o r unstable Examine the following systems with respect to the properties above. (a) v(«) = cos[jc(n)] (b) v(n) = x(k> (c) v(n) = x(n)cos(£^n) (d) y(n) ~ x ( —n + 2) (e) y(n) = Trun[;c(n)], where Trun[jc(n)] denotes the integer part of x(n), obtained by truncation (f) y(n) = Round[jc(n)], where Round[;c(n)] denotes the integer part of Jt(n) obtained by rounding Remark: The systems in parts (e) and (f) are quantizers that perform truncation and rounding, respectively. (g) y(B) = |*(n)| (h) v(rt) = x(n)u(n) (I) y(n) = x(n) + nx{n + 1) (j) y ( n ) = x ( 2 n ) (I) y( n) = x ( - n ) (m) y(n) = sign[j:(n)] (n) The ideal sampling system with input xaU) and output x(n) = x a(nT), —oc < n < oo 2J8 Two discrete-time systems 7] and T2 are connected in cascade to form a new system T as shown in Fig. P2.8. Prove or disprove the following statements. Chap. 2 137 Problems yin) xin ) Ti T; T - T-. T 2 Figure P2.8 (a) If T\ and % are linear, then T is linear (i.e.. the cascade connection of two linear systems is linear). (b) If T\ and are time invariant, then T is time invariant. (c) If T[ and 7? are causal, then T is causal. <d) If T] and T2 are linear and time invariant, the same holds for T . (e) If 7] and T2 are linear and time invariant, then interchanging their order does not change the system T. (0 As in part (e) except that 7J, T2 are now time varying. (Hint: Use an example.) (g) If 7] and T2 are nonlinear, then T is nonlinear. (h) If T< and T2 are stable, then T is stable. (i) Show by an example that the inverse of parts (c) and (h) do not hold in general. 2.9 Let T be an LTI, relaxed, and BIBO stable system with input x{n) and output y(n). Show that: (a) If x(n) is periodic with period N [i.e., jr(n) = x{n + N) for all n > 0], the output y(n) tends to a periodic signal with the same period. (b) If x(n) is bounded and tends 10 a constant, the output will also tend to a constant. (c) If x{n) is an energy signal, the output y(n) will also be an energy signal. 2.10 The following in p u t-output pairs have been observed during the operation of a umeinvariam system: x,(n) = {1.0,2} ^ y,(fi) = (0, 1.2} t t x,(n) = {0.0,3} ^ v; (n) = (0, 1.0,2} t t x-\(n) = {0. 0, 0. 1} vj(n) = (1,2, 1} t t Can you draw any conclusions regarding the linearity of the system. W hat is the impulse response of the system? 2.11 The following input-output pairs have been observed during the operation of a linear system: Xi(n) = {-1. 2. 1} t x2{n) = {1, - 1 , -1} y,(/i) = (1, 2. - 1 , 0. 1} t \'2in) = {-1. 1, 0, 2} t x 3(n) = {0, 1, 1) t t y i ( n) = {1, 2. 1} r Can you draw any conclusions about the time invariance of this system? 2.12 The only available information about a system consists of N input-output pairs, of signals y,(rc) = T[xj(n)], / = 1, 2........N. Discrete-Time Signals and Systems 138 Chap. 2 (a) What is the class of input signals for which we can determ ine the output, using the information above, if the system is known to be linear? (b) The sam e as above, if the system is known to be tim e invariant. 2.13 Show that the necessary and sufficient condition for a relaxed LTI system to be BIBO stable is y . i/i(«)i < Mh < oo for some constant Mn. 2.14 Show that; (a) A relaxed linear system is causal if and only if for any input x(n) such that for n < no jc(n) = 0 for n < no => y(n) = 0 (b) A relaxed LTI system is causal if and only if h(n) = 0 for n < 0 2.15 (a) Show that for any real or complex constant a, and any finite integer num bers M and N, we have n a M —a h . if « * ! 1 — <3 N - M + 1, if a = 1 (b) Show that if |o| < 1 , then y v = - i - l - a 2.16 (a) If y(n) = x (n) * h(n). show that £ v = £ / .- where ^ _w (b) Compute the convolution y(n) = x(n) * h(n) of the following signals and check the correctness of the results by using the test in (a). (1) jr(n) — (1,2, 4), /)(n) = (1 ,1 ,1 ,1 ,1 } (2) x(n) = {1, 2, - 1 ) , h(n) = x (n) (3) x(n) = (0,1, - 2 , 3. - 4 ) . h(n) = {£, i , 1, 1} (4) jc(n )= :{1 .2 .3.4.5J.A (n) = {l) (5) x(n) = (1, -2 ,3 } , h(n) = (0, 0 .1 .1 ,1 ,1 ) t t (6) x(n) = { 0 ,0 ,1 ,1 ,1 ,1 ), h(n) = { 1 ,-2 . 3} t t (7) jr(u) = {0,1, 4, -31. h(n) = [1,0, - 1 , -1} t t (8) = [1,1,2], h(n) = u(n) t (9) jt(n) = [1,1. 0,1,11, h(n) = {1, - 2 , - 3 , 4} t t (10) jc(n) = (1,2, 0,2 , l}/i(n) = Jt(n) t (11) *{n) = (i)"u(n), h(rt) = ( j ) nM(n) 2.17 Compute and plot the convolutions x(n) * h(n) and h(n) *x(n) for the pairs of signals shown in Fig. P2.17. Chap. 2 139 Problems trln) b TI f 0 12 3 0 l 2 3 4 5 b n ■Iiit. 1 2 3 -3-2-10 I 2 3 n hin) x(n) i n h\n) j x(n) ..III!.. 3 4 5 6 II n htnl J (n ) ] 111 ! II —2-1 2 3 4 5 <di 2.18 Figure P2.17 Determ ine and sketch the convolution y(n) of the signals -V(/l) = h(n) - 0. 0 < Ji < 6 elsewhere 1, 0. —2 < n < 2 elsewhere (a) Graphicallv (b) Analytically 2.19 Compute the convolution y(n) of the signals x (n) = h(n) = o'". —3 < n < 5 0. elsewhere 1, 0, 0< n< 4 elsewhere 2.20 Consider the following three operations. (a) Multiply the integer numbers: 131 and 122. (b) Compute the convolution of signals: {1. 3.1) * (1,2. 2}. (c) Multiply the polynomials: 1 4- 3; + z2 and 1 4- 2z 4- 2z2. (d> Repeat part (a) for the numbers 1.31 and 12.2. (e) Comment on your results. 2.21 Com pute the convolution y(n) = x ( n ) * h(n) of the following pairs of signals. (a) x(n) = a"u(n), h(n) = b"u{n) when a ^ b and when a ~ b (b) x ( n) = 1. 2, n = —2, 0, 1 n = —1 . 0, elsewhere h ( n ) = S(n) — S (n — 1) + S(n — 4) + S(n —5) 140 Discrete-Time Signals and System s Chap. 2 (c) x{n) = u(n + 1) —u(n —4) —<5(n —5) h(n) = [u(n +2) — u(n - 3)] • (3 - |n|) (d ) x ( n ) = u ( n ) - u( n - 5) h(n) = u(n —2) —u(n —8) 4- u(n — 11) —u(n — 17) 2.22 Let x(n) be the input signal to a discrete-time filter with impulse response ht(n) and let y,(n) be the corresponding output. (a) Compute and sketch x(n) and \ j ( n ) in the following cases, using the same scale in all figures. x(n) = {1,4, 2. 3, 5, 3, 3. 4. 5. 7. 6. 9} h](n) = (1,1) h2(n) = {1,2.1} ]ij(n) = {i, j) *4(») = {?• {■ j) Sketch x(n), yi(n), y 2(n) on one graph and *(«). y3(n), y,j(n), y.s(n) on another graph (b) W hat is the difference between yi(«) and \’2(n). and between y^(n) and y^(n)? (c) Comment on the smoothness of v2(/?) and v4(n). Which factors affect the sm ooth­ ness? (d) Compare y4(n) with ysfn). What is the difference? Can you explain it? (e) Let h(,(n) = {^, - j } . Com pute y’6<n). Sketch v(n), y 2(n), and yft(n) on the same figure and comment on the results. 2.23 The discrete-time system v(n) = ny(n — 1) + jr(n) n > 0 is at rest [i.e., v(—1) = 0]. Check if the system is linear time invariant and BIBO stable. 2.24 Consider the signal y(n) = a"u(n), 0 < a < 1. (a) Show that any sequence x{n) can be decomposed as and express ck in terms of x(n). (b) Use the properties of linearity and time invariance to express the output y(n) = T[x(n)] in term s of the input x (n) and the signal g(n) = T[y(n)], where T [ ] is an LTI system. (c) Express the impulse response h(n) = T[B{n)} in terms of g(rt). 2.25 D eterm ine the zero-input response of the system described by the second-order dif­ ference equation x(n) - 3y(n - 1) - 4y(n - 2) = 0 2.26 Determ ine the particular solution of the difference equation y(n) = jv(ii - 1) - £y(n - 2) +x ( n) when the forcing function is x(n) = 2"u(n). Chap. 2 Problems 141 2 2 1 D eterm ine the response yin). n > 0. of the system described by the second-order difference equation yin) - 3v(n —1) —4y(/i —2) = xin) + 2x(n — 1) to the input xin) = 4"w(n). 2.28 Determ ine the impulse response of the following causal system: y(n) —3y(n — 1) —4v(n —2) = jr(n) + 2x(n — 1) 2.29 Let xin). A'i < n < N2 and h(n), < n < M2 be two finite-duration signals. (a) Determ ine the range L\ < n < L 2 of their convolution, in term s of N\, N2, M\ and M2. (b) Determ ine the limits of the cases of partial overlap from the left, full overlap, and partial overlap from the right. For convenience, assume that h(n) has shorter duration than jc(«). (c) Illustrate the validity of your results by computing the convolution of the signals -2 < n < 4 elsewhere -1 < n < 2 elsewhere 2.30 Determ ine the impulse response and the unit step response of the systems described by the difference equation (a) yin) = ().6y(;i - 1) - ().08v(n - 2) + xin) (b) _v(« ) = 0.7y(;; - 1) - 0.1 yin - 2) -f 2xin) - xin - 2) 231 Consider a svstem with impulse response A,«) = H r ' ( 0. ° - n - 4 elsewhere Determ ine the input xin) for 0 < n < S that will generate the output sequence v(n) = 1 1 .2 .2 .5 .3 .3 .3 .2 .1 .0 ....} t 232 Consider the interconnection of LTI systems as shown in Fig. P2.32. (a) Express the overall impulse response in terms of h \ (n), h2(n), h^in). and h^in). (b) D eterm ine h{n) when M « ) = {j. 3 . 7 } h2{n) — hy(n) = (n + 1 )u(n) fi4(n) = S(n — 2) Figure P 2J2 Discrete-Time Signals and Systems 142 Chap. 2 (c) Determ ine the response of the system in part (b) if x(n) = &(n + 2) + 3S(n - 1) - 4 S(n - 3) 2 3 3 Consider the system in Fig. P2.33 with h(n) = a"u(n), —1 < a < 1. Determ ine the response y(n) of the system to the excitation *(n) = «(n + 5) —u(n — 10) x(n) Figure P233 2 3 4 Com pute and sketch the step response of the system U_ 1 2 3 5 Determ ine the range of values of the param eter a for which the linear time-invariant system with impulse response (Hint: The solution can be obtained easily and quickly by applying the linearity and tim e-invariance properties to the result in Exam ple 2.3.5.) 2 3 7 D eterm ine the response of the (relaxed) system characterized by the impulse response h(n) = ( l ) ”u(n) to the input signal | 1, x(n) = { ^ 10, 0 < n < 10 ~ otherwise 2 3 8 D eterm ine the response of the (relaxed) system characterized by the impulse response h(n) = ( j ) Hu{n) to the input signals (a) x(n) = 2nu(n) (b) x(n) = u ( - n ) Chap. 2 143 Problems 239 T hree systems with impulse responses h\(n) — 5(n) — &(n — 1). h2(rt) = h( n}. and = u(n), are connected in cascade. (a) W hat is the impulse response. of the overall system? (b ) Does the order of the interconnection affect the overall system? 2.40 (a) Prove and explain graphically the difference between the relations x(n )5(n —no) = —«o) x(n) *&(n - n0) = x(n - nu) and (b ) Show that a discrete-time system, which is described by a convolution summation, is LTI and relaxed, (c) W hat is the impulse response of the system described by y(n) = x(n —n())? 2.41 Two signals 5(n) and u(n) are related through the following difference equations j(n) + a\ j(n — 1) + ■ ■ — N) = bi)v(n) Design the block diagram realization of: (a) The system that generates x(n) when excited by v(n). (b ) The system that generates u(n) when excited by s(n). (c) What is the impulse response of the cascade interconnection of systems in parts (a) and (b)? 2.42 Com pute the zero-state response of the system described by the difference equation y(n ) + ^ v(n — 1) = x(n ) + 2x{n —2) to the input xin) = (1.2. 3. 4, 2, 1) T by solving the difference equation recursively. 2 .43 Determ ine the direct form II realization for each of the following LTI systems. (a) 2v(n) + y(n — 1 ) - 4 v(n — 3) = x(n) + 3x(n —5) (b) y(n) = Jr(n) —x(n — 1) + 2x(n — 2) — 3x(n - 4) 2 .4 4 Consider the discrete-time system shown in Fig. P2.44. Figure P2.44 (a) Com pute the 10 first samples of its impulse response. (b ) Find the input-output relation. (c) Apply the input x(n) = { 1 .1 .1 ....} and com pute the first 10 samples of the output, t 144 Discrete-Time Signals and Systems Chap. 2 (d) Com pute the first 10 samples of the output for the input given in part (c) by using convolution. (e) Is the system causal? Is it stable? 2 ^ 5 Consider the system described by the difference equation y(n) = ay(n - 1) + bx(n) (a) Determ ine b in terms of a so that (b ) Com pute the zero-state step response s(n) of the system and choose b so that j(oo) = 1. (c) Com pare the values of b obtained in parts (a) and (b). W hat did you notice? 2*46 A discrete-time system is realized by the structure shown in Fig. P2.46. (a) D eterm ine the impulse response. (b) Determ ine a realization for its inverse system, that is, the system which produces x( n) as an output when y(n) is used as an input. x in ) -o -0 ■v(n) 0.8 Figure P2.46 2 .4 7 Consider the discrete-time system shown in Fig. P2.47. v(n) Figure P2^f7 (a) Com pute the first six values of the impulse response of the system. (b ) Com pute the first six values of the zero-state step response of the system. (c) Determ ine an analytical expression for the impulse response of the system. 1 4 8 D eterm ine and sketch the impulse response of the following systems for n — 0, 1........9. (a) Fig. P2.48(a). (b ) Fig. P 2 .4 8 (b ). (c) Fig. P2.48(c). Chap. 2 Problems 145 Cc) Figure P2.48 (d) Classify the systems above as FIR or IIR. (e) Find an explicit expression for the impulse response of the system in part (c). 2.49 Consider the systems shown in Fig. P2.49. (a) Determ ine and sketch their impulse responses /i|(n), h2(n), and h3(n). (b) Is it possible to choose the coefficients of these systems in such a way that h\(n) = h2(n) = h3(n) 2.50 Consider the system shown in Fig. P2.50. (a) Determ ine its impulse response h(n). (b) Show that h(n) is equal to the convolution of the following signals. h] (n) = 6(n) + 6(n - 1) M " ) = (^)"u(n) Discrete-Time Signals and Systems 146 Chap. 2 v (n ) yin) 2.51 Com pute the sketch the convolution y,(n) and correlation r,(n) sequences for the following pair of signals and comment on the results obtained. (a) *,{«) = (1.2.4) A ,(n )= (1 ,1 .1 .1 . If t t (b) x2(n) = (0,1. - 2 . 3, - 4 ] h2(n) = U. 1. 2 . 1 , i} t (c) jt-j(b ) = (1.2. 3, 4} t (d) x4(n) = {1. 2, 3,4) t ‘ A3 (u ) t = (4. 3. 2, 1) t hA(n) = (1.2.3. 4) t 2.52 The zero-state response of a causal LTI system to the input x ( n ) = {1,3, 3,1) is y(n) = (1,4, 6 ,4 ,1 ). Determ ine its impulse response. t Chap. 2 Problems 147 2.53 Prove by direct substitution the equivalence of equations (2.5.9) and (2.5.10), which describe the direct form II structure, to the relation (2.5.6), which describes the direct form I structure. 2.54 D eterm ine the response y(n). n > 0 of the system described by the second-order difference equation y ( n) — 4 y(n - 1) + 4v(/i — 2) = x( n) — x( n — 1) when the input is x(n) = (-l)" u (n ) and the initial conditions are v(—1) = y ( -2 ) = 0. 2.55 D eterm ine the impulse response h(n) for the system described by the second-order difference equation v(ni — 4v(;i — 1 > + 4y(n — 2) = x(r?) — x(n — 1) 2.56 Show that any discrete-tim e signal x(n) can be expressed as [.v(A') —x(k — 1)]u(n - k) c(n) = where «(/i - k ) is a unit step delayed by k units in time, that is, u(/i - 1. I 0, k) = . n >k otherwise 2.57 Show that the output of an LTI system can be expressed in term s of its unit step response v(n) as follows. i'(n) = y " ' [,v(A:) —x(k — 1)]jr(fl —k) = Y [x(AQ - x ( k - l) ] s ( /i - k) c 2.58 Com pute the correlation sequences rIX(l) and rtv(l) for the following signal sequences. j _ P ■ nu - N < n < n {, + N I 0, f 1. v(n) = 1 „ 10, otherwise -N <n < N , otherwise 2.59 D eterm ine the autocorrelation sequences of the following signals. (a) x(n) = {1. 2.1.1) t (b) v(n) = il. 1.2.1} t W hat is your conclusion? 2.60 W hat is the normalized autocorrelation sequence of the signal x(n) given by 1, x(n) = , „ 0, -jV < n < N otherwise Discrete-Time Signals and Systems 148 Chap. 2 2.61 An audio signal j(r) generated by a loudspeaker is reflected at two different walls with reflection coefficients r ] and r2. The signal *(/) recorded by a microphone close to the loudspeaker, after sampling, is x (n) = s(n) + rxs(n — k\) + r2s(n — k2) where kt and k2 are the delays of the two echoes. (a) Determ ine the autocorrelation rzx(I) of the signal x(n). Can we obtain ri, r2, k\, and k2 by observing r,s (1)1 (c) W hat happens if r2 = 0? (b) 2.62* Time-delay estimation in radar Let xa(t) be the transm itted signal and yfl(r) be the received signal in a radar system, where y„(r) = axa(t - id) + vu(f) and va(t) is additive random noise. The signals xa(t) and >■„(/) are sampled in the receiver, according to the sampling theorem , and are processed digitally to deter­ mine the time delay and hence the distance of the object. The resulting discrete-time signals are jr(n) = xa(nT) y(n) = y„(nT) = axu(nT - DT) + vu(nT) = ax(n — D) + u(n) (a) Explain how we can measure the delay D by computing the crosscorrelation r*,.(/). (b) Let x(n) be the 13-point Barker sequence X (n) = (+ 1,+1,+1,+1,+1, -1, -l.+l.+l, -1,+1. -1,+1) and u(n) be a Gaussian random sequence with zero mean and variance a 2 = 0.01. Write a program that generates the sequence v(n), 0 < n < 199 for a = 0.9 and D = 20. Plot the signals jt(«), y(n), 0 < n < 199. (c) Compute and plot the crosscorrelation rTV(/), 0 < / < 59. Use the plot to estimate the value of the delay D. (d) Repeat parts (b) and (c) for a 2 = 0.1 and a 2 = 1. <e) Repeat parts (b) and (c) for the signal sequence jt(n) = j _ l , _ l , - l , + i , + i , + i . + i , - i , + 1 . - l . + l . + l , - 1 ,- 1 ,+ 1 } which is obtained from the four-stage feedback shift register shown in Fig. P2.62, Figure P2.61 register. Linear feedback shift Chap. 2 Problems 149 Note that x(n) is just one period of the periodic sequence obtained from the feedback shift register. (f) Repeat parts (b) and (c) for a sequence of period N — 27 — 1, which is obtained from a seven-stage feedback shift register. Table 2.3 gives the stages connected to the modulo-2 adder for (maximal-length) shift-register sequences of length N =2" — TABLE 2.3 SHIFT-REGISTER CONNECTIONS FOR GENERATING MAXIMAL-LENGTH SEQUENCES m Stages Connected to Modu)o-2 Adder 1 1 2 1. 2 1. 3 1. 4 S. 4 L6 1. 7 1, 5, 6. 7 1.6 1. K 1. 10 i. 7. y, 12 1. H), 11. 13 1. 5. 9. 14 1. 15 1. 5. 14, 16 1. 15 3 4 5 6 7 H y id li 12 13 14 15 16 17 2.63* Implementation o f L T I systems by the difference equation Consider the recursive discrete-time system described _v(n) = —U\ v( n — 1) —a;v (n —2) 4- b^x(rt) where a\ - —0.8, u? = 0.64. and b() = 0.866. (a) Write a program to compute and plot the impulse response h{n) of the system for 0 < n < 49. (b) Write a program to com pute and plot the zero-state step response s(n) of the system for 0 < n < 100. (c) Define an F IR system with impulse response ^ fir (h ) given by , , . 1 h(n), 10. 0 < n < 19 elsewhere where h(n) is the impulse response computed in part (a). W rite a program to compute and plot its step response. (d) Com pare the results obtained in parts (b) and (c) and explain their similarities and differences. 150 Discrete-Time Signals and Systems Chap. 2 2jS4* W rite a com puter program that computes the overall impulse response h(n) of the sys­ tem shown in Fig. P2.64 for 0 < n < 99. The systems TU T2, T 3, and % are specified by Ti : hi(n) = {1 . 5 . t g. 55) T2 : h 2(n) = {1,1,1,1,11 t Ts : + 5*(" - 1) + - 2) T4 : y(n) = 0.9y(n — 1) —0.81y{n —2) + v(n) + u(n —1) Plot h(n) for 0 < n < 99. Figure P2.64 3 The Z -Transform and Its Application to the Analysis of LTI Systems T ra n s fo rm te c h n iq u e s a re an im p o rta n t tool in the analysis o f signals a n d lin­ e a r tim e -in v a ria n t (L T I) system s. In this c h a p te r w e in tro d u c e th e ^ -tran sfo rm , d ev elo p its p ro p e rtie s , and d e m o n s tra te its im p o rta n c e in th e analysis an d c h a ra c ­ te riz a tio n o f lin ear tim e -in v a ria n t system s. T h e : -tra n sfo rm plays th e sam e role in th e analysis o f d isc re te -tim e signals an d L T I sy stem s as th e L ap lace tran sfo rm d o e s in th e analysis o f c o n tin u o u s-tim e signals a n d L T I svstem s. F o r ex am p le, w e sh a d see th a t in th e ^ -d o m ain (com plex z -p lan e) th e c o n v o lu tio n of tw o tim e-d o m ain signals is e q u iv a le n t to m u ltip lic atio n o f th e ir c o rre sp o n d in g ^ -tran sfo rm s. T h is p ro p e rty g reatly sim plifies the analysis o f th e re sp o n s e o f an L TI system to v ario u s signals. In ad d itio n , th e c-tran sfo rm p ro v id es us w ith a m ean s of ch a ra c te riz in g an L T I system , a n d its resp o n se to v ario u s signals, by its p o le - z e r o locations. W e b eg in th is c h a p te r by defining th e c-tran sfo rm . Its im p o rta n t p ro p e rtie s a re p re s e n te d in S ectio n 3.2. In S ection 3.3 the tra n sfo rm is u se d to ch aracterize signals in te rm s o f th e ir p o le - z e r o p a tte rn s. S ection 3.4 d escrib es m e th o d s fo r in v ertin g th e z-tra n sfo rm o f a signal so as to o b ta in th e tim e -d o m a in re p re s e n ta ­ tio n o f th e signal. T h e o n e-sid ed :-tra n s fo rm is tr e a te d in S ectio n 3.5 a n d used to solve lin e a r d ifferen ce e q u a tio n s w ith n o n z e ro in itial co n d itio n s. T h e c h a p te r c o n clu d es w ith a d iscussion o n th e use of th e z -tra n sfo rm in th e analysis o f L TI system s. 3.1 THE Z-TRANSFORM In th is sectio n w e in tro d u c e th e z -tra n sfo rm of a d isc re te -tim e signal, in v estig ate its c o n v e rg e n c e p ro p e rtie s , an d briefly discuss th e in v erse z-tran sfo rm . 151 152 The z-Transform and Its Application to the Analysis of LTI Systems Chap. 3 3.1.1 T h e D ire c t z - T r a n s f o r m T h e ^ -tran sfo rm o f a d isc re te -tim e signal jt(fi) is d efin ed as th e p o w e r series OC X(z) = n= —oo x { n ) z ~'‘ (3-u ) w h ere z is a co m p lex v ariab le. T h e re la tio n (3.1.1) is so m e tim e s called th e direct z - t ransform b ecau se it tra n sfo rm s th e tim e -d o m a in signal x ( n ) in to its co m p lex p la n e re p re s e n ta tio n X (z). T h e in v erse p ro c e d u re [i.e., o b ta in in g x ( n ) fro m X (z)] is called th e i nverse z- t ransf orm a n d is e x a m in e d briefly in S e ctio n 3.1.2 a n d in m o re d etail in S ectio n 3.4. F o r c o n v en ien ce , th e z -tra n sfo rm o f a signal x ( n ) is d e n o te d by X (z) - Z U (« )} (3.1.2) w h ereas th e re la tio n sh ip b e tw e e n x ( n ) a n d X ( z ) is in d ic a te d by jc(«) < -^ * (;) (3.1.3) S ince th e z-tra n sfo rm is an infinite p o w e r se ries, it exists only fo r th o se v alu es of z fo r w hich th is se ries co n v erg es. T h e region o f conver gence ( R O C ) o f X (z) is th e set o f all v alu es o f z fo r w hich X ( z ) a tta in s a finite value. T h u s an y tim e w e cite a z-tra n sfo rm w e sh o u ld also in d icate its R O C . W e illu strate th e se co n c e p ts by so m e sim ple ex am p les. Example 3.1.1 D eterm ine the ^-transforms of the following finite-duration signals. (a) jf,(n) = (1 ,2 .5 .7 ,0 ,1 } (b) jf■,(«) = ( I . 2 . 5 . 7 . 0 . 1) t (c) jc3(n) = (0 ,0 ,1 ,2 , 5, 7,0.1} (d) *4(h) = (2 .4 ,5 .7 .0 ,1 ) t (e) x j ( n ) = S( n) (f) x$(n) = <S(n —k), k > 0 (g) x j ( n ) = &(n + k) , k > 0 Solution From definition (3.1.1), we have (a) X](z) = 1 + 2z~' + 5z~2 + 7 z '3 + z~5, ROC: entire z-plane except z = 0 (b) X 2(z) = z2 + 2z + 5 + 7c-1 + z-3, ROC: entire z-plane except z = 0 and z = oo (c) Xj(z) = z~2 + 2z-3 + 5z-4 + 7z-5 -I- z-7, ROC: entire z-plane except z = 0 (d) X4(z) = 2z2 -I- 4z -I- 5 4- 7z_1 -I- z-3, ROC: entire z-plane except z = 0 and z = oo (e) X;(z) = l[i.e„ S(n) *■ 1], ROC: entire z-plane (f) Xb(z) = z_ t[i.e„ &(n — k) «— ►z_t], k > 0, ROC: entire z-plane except z = 0 (g) Xy(z) = zk[i.e„ &(n + k) z*], k > 0, ROC: entire z-plane except z = oo Sec. 3.1 153 The z-Transform F ro m th is ex a m p le it is easily se en th a t th e R O C o f a f i ni t e-durat i on signal is th e e n tire ;- p la n e , e x cep t p ossibly th e p o in ts z = 0 a n d /o r z — oo. T h e se p o in ts a re e x c lu d ed , b e c a u s e z t (k > 0} b eco m es u n b o u n d e d fo r z = oc an d z ~ k01 > 0) b ec o m e s u n b o u n d e d fo r z = 0. F ro m a m a th e m a tic a l p o in t of view th e z-tra n sfo rm is sim p ly an a lte rn a tiv e r e p re s e n ta tio n o f a signal. T h is is nicely illu stra te d in E x a m p le 3.1.1, w h e re w e see th a t th e co effic ie n t o f z~", in a given tra n sfo rm , is th e v a lu e o f th e signal at tim e n. In o th e r w o rd s, th e e x p o n e n t o f z co n tain s th e tim e in fo rm a tio n w e n eed to id en tify th e sa m p le s o f th e signal. In m an y cases w e can ex p ress th e sum of th e finite o r infinite se rie s fo r th e z-tra n s fo rm in a c lo sed -fo rm e x p ressio n . In such cases th e z -tra n s fo rm o ffers a co m p act a lte rn a tiv e r e p re s e n ta tio n of th e signal. Example 3.1.2 D eterm ine the z-transform of the signal Jf(n) = (5 Solution The signal jc(n) consists of an infinite num ber of nonzero values x(n)= ( l . a u ^ . U )'1.... The z-transform of x(n) is the infinite power series X( z ) = 1 + U ” ' + ( ^) 2z - 2 + (| ) "z"" + --- ft=<) nail This is an infinite geometric series. We recall that 1 + A + ,42 + A3 - t - - - - = — 1 —A Consequently, for | 1 if | A 1 < 1 < 1, or equivalently* for \z\ > X(z) = J X(z) converges to ROC: (zl > | jZ We see that in this case, the z-transform provides a compact alternative representation of the signal x(n). L e t us e x p ress th e co m p lex v a ria b le z in p o la r fo rm as z = r e }6 w h ere r = |z| a n d 6 = i^z- T h e n X ( z ) can be e x p ressed as OC X ( z ) \ t- r ' » = Y x ( n ) r ~ ne - j en n*-00 (3.1.4) 154 The z-Transform and Its Application to the Analysis of LTI Systems Chap. 3 In th e R O C o f X U ). |X ( ;) | < oc. B ut (3.1.5) 5 \ M n ) r - ne - ' * n \ = £ \ x( n) r ~n\ H e n c e |X (z)| is finite if th e se q u en ce x ( n ) r ~ ' ’ is a b s o lu te ly su m m a b le . T h e p ro b le m o f finding th e R O C fo r X ( z ) is e q u iv a le n t to d e te rm in in g the ra n g e o f v alu es o f r fo r w hich th e se q u e n c e x ( n ) r ~ " is a b so lu te ly su m m ab le. T o e la b o ra te , let us e x p ress (3.1.5) as (3.1.6) If X ( z ) co n v erg es in so m e region of the co m p lex p la n e , b o th su m m a tio n s in (3.1.6) m u st be finite in th a t region. If the first sum in (3.1.6) co n v erg es, th e re m ust exist v alu es o f r sm all e n o u g h such th at the p ro d u c t se q u e n c e x ( —n) r" . 1 < /; < oc, is a b s o lu te ly su m m ab le. T h e re fo re , the R O C for th e first sum co n sists o f all p o in ts in a circle of so m e rad iu s r^, w here /■] < oc, as illu stra te d in Fig. 3.1a. O n the o th e r h a n d , if th e seco nd sum in (3.1.6) co n v erg es, th e re m u st exist v alu es o f r larg e en o u g h such th a t th e p ro d u c t se q u e n c e x ( n ) / r " . 0 < n < oc, is a b so lu te ly su m m ab le. H en ce th e R O C fo r the se co n d sum in (3.1.6) co n sists o f all p o in ts o u tsid e a circle o f rad iu s r > r2. as illu stra te d in Fig. 3.1b. Since th e co n v erg en ce of X (c) re q u ire s th a t b o th sum s in (3.1.6) b e finite, it follow s th a t th e R O C o f X ( z ) is g en erally specified as th e a n n u la r region in th e ;- p la n e , r: < r < r\. w hich is the co m m o n reg io n w h e re b o th su m s are finite. T his reg io n is illu stra te d in Fig. 3.1c. O n th e o th e r h a n d , if > r\, th e r e is no co m m o n reg io n o f co n v erg en ce fo r th e tw o sum s an d h en ce X ( ;) d o es n o t exist. T h e follow ing ex am p les illu strate th e se im p o rta n t co n cep ts. Example 3.1.3 Determ ine the e-transform of the signal Solution From the definition (3.1.1) we have If \az 11 < 1 or equivalently, |z| > |a |, this power series converges to 1/(1 - a ; -1). Sec. 3.1 The z-Transform 155 Im(z) Im(;) Im(z) Figure 3.1 R egion of convergence for X (z) and its corresponding causal and anticausa! components. 156 The z-Transform and Its Application to the Analysis of LTI Systems Chap. 3 lm(;) Figure 3.2 The exponential signal xi n) = txnu{n) (a), and the ROC of its transform (b). Thus we have the z-transform pair x(n) =a" u( n ) X (;) = 1 ROC: |z| > |cr| 1 - a ;-1 (3.1.7) The R O C is the exterior of a circle having radius |a |. Figure 3.2 shows a graph of the signal .x(n) and its corresponding ROC. Note that, in general, or need not be real. If we set or = 1 in (3.1.7), we obtain the z-transform of the unit step signal x(n) - u(n) X(z) = 1 ROC: |zl > 1 1 (3.1.6 Example 3.1.4 Determ ine the z-transform of the signal x(n) = —a"u( —n — 1) = Solution n >0 n < -1 0, From the definition (3.1.1) we have -I oc n—---oc /= i where / = —n. Using the formula A + A: + A3 + • ■■= A(1 + A + A2 + ■■■) = A 1 - A when | >1f < 1 gives * ( ;) = - - 1 1 —a ~ lz l - a ; '1 provided that |cr_1z| < 1 or, equivalently, |z| < jar j. Thus 1 (3.1.9) ROC: [z| < |a | 1-azThe R O C is now the interior of a circle having radius |a|. This is shown in Fig. 3.3. x(n) = —a"u( —n — 1) X(Z) = - Sec. 3.1 The z-Transform 157 Im(c) Figure 3.3 Anticausal signal jt(h) = -crnu( —n - 1) (a), and the ROC of its transform (b). E x a m p le s 3.1.3 an d 3.1.4 illu stra te tw o very im p o rta n t issues. T h e first c o n ­ cern s th e u n iq u e n e s s o f th e "-tran sfo rm . F ro m (3.1.7) an d (3.1.9) we see that th e cau sal signal a nu ( n ) a n d th e an ticau sal signal —a " u ( —n — 1) have id en tical clo sed -fo rm e x p re ssio n s fo r th e ^ -tran sfo rm , th a t is, Z ( o " w ( « ) ) = Z { —a nu ( —n - 1) ) - ------ -------- 1 —a c ' 1 T h is im p lies th a t a clo sed -fo rm e x p ressio n fo r th e z-tra n sfo rm d o e s n o t u n iq u ely specify th e signal in th e tim e do m ain . T h e am b ig u ity can b e reso lv ed only if in a d d itio n to th e c lo sed -fo rm ex p ressio n , th e R O C is specified. In su m m ary , a discrete-time signal x ( n ) is uni quel y d et er mi ned b y its z- t rans f orm A' (;) a n d the region o f conver gence o f X( z ) . In this te x t th e te rm “z -tra n s fo rm " is u se d to re fe r to b o th th e clo sed -fo rm e x p ressio n an d th e c o rre sp o n d in g R O C . E x a m p le 3.1.3 also illu stra te s th e p o in t th a t the R O C o f a causal signal is the exterior o f a circle o f s o m e radius r 2 whi l e the R O C o f an ant icausal signal is the interior o f a circle o f s o m e radi us rj. T h e fo llow ing e x am p le co n sid ers a se q u en ce th a t is n o n z e ro for —00 < n < 00. Example 3.1.5 D eterm ine the z-transform of the signal x (n) = a"u(n) + bnu( —n — 1) Solution From definition (3.1.1) we have b"z " = X(z) = n=0 n = —oc + Y ib -'z)1 n=0 i= l The first pow er series converges if locz-11 < 1 or |z| > |a |. The second power series converges if \b~xz\ < 1 or |z| < |6j. In determ ining the convergence of XCz), we consider two different cases. 158 The z-Transform and Its Application to the Analysis of LTI Systems Chap. 3 Case 1 |b| < |a |: In this case the two R O C above do not overlap, as shown in Fig. 3.4(a). Consequently, we cannot find values of z for which both power series converge simultaneously. Clearly, in this case, X(c) does not exist. Case 2 |f>| > |a |: In this case there is a ring in the z-plane where both power series converge simultaneously, as shown in Fig. 3.4(b). Then we obtain X(z) = 1 —ccz 1 1 —bz 1 b —a (3.1.10) a + b — z — abz~l The R O C of X(z) ts |cr| < \z\ < \b\. T h is e x am p le show s th a t i f there is a R O C f o r an infinite durat i on two-si ded signal, it is a ring ( annul ar region) in the z-plane. F ro m E x a m p le s 3.1.1, 3.1.3, 3.1.4, an d 3.1.5. w e see th a t th e R O C of a signal d e p e n d s o n b o th its d u ra tio n (finite or in fin ite) an d o n w h e th e r it is cau sal, a n tic a u sa l, o r tw o -sid ed . T h e se facts are su m m a riz e d in T a b le 3.1. O n e special case of a tw o -sid ed signal is a signal th a t h as infinite d u ra tio n on th e rig h t sid e b u t n o t on th e left [i.e., x( n ) = 0 fo r n < « (l < 0], A sec­ on d case is a signal th a t has infinite d u ra tio n o n th e left side b u t n o t on the •plane Ifcl < tot X(z) does not exisl Im(;) krl < IAI ReU) ROC for X(z) Figure 3.4 R O C fo r z-transform in E xam ple 3.1.5. Sec. 3.1 159 The ^-Transform TABLE 3.1 CH A R A C TE R IS TIC FAM ILIES O F SIGN ALS W IT H T H E IR C O R R E S P O N D IN G ROC Signal ROC Finite-Duration Signals Two-sided . . TTT l i t , — n 0 Jnfinite-Duration Causal l l T t* - Anltcausal T] T1 Two-sided I . I t..... rig h t [i.e., x{ n ) = 0 fo r n > n\ > 0]. A th ird sp ecial case is a signal th a t has finite d u ra tio n o n b o th th e left a n d rig h t sides [i.e., x ( n ) = 0 fo r n < no < 0 a n d n > n\ > 0]. T h e se ty p e s o f signals a re so m e tim e s c alled right-sided, left­ sided, a n d finite-d uration two-sided, signals, resp ec tiv ely . T h e d e te rm in a tio n o f th e R O C fo r th e s e th r e e ty p es o f signals is left as an e x ercise fo r th e r e a d e r (P r o b ­ lem 3.5). F in ally , w e n o te th a t th e z -tra n sfo rm d efin ed b y (3.1.1) is so m e tim e s re fe rre d to as th e tw o-sided o r bilateral z-transform , to d istin g u ish it fro m th e o ne-sided o r 160 The z-Transform and Its Application to the Analysis of LTI Systems Chap. 3 unilateral z- t ransf orm given by X~(z) = ^ * ( « ) z ~ " (3.1.11) T h e o n e-sid ed z -tra n sfo rm is ex am in ed in S ection 3.5. In this tex t w e use the ex p ressio n z-tra n sfo rm exclusively to m ean th e tw o -sid ed z -tra n sfo rm d efined by (3.1.1). T h e te rm ‘'tw o -sid e d ’' will b e u se d oniy in cases w h ere w e w an t to resolve any am b ig u ities. C learly , if x ( n ) is causal [i.e., * ( 72) = 0 for n < 0], th e o n e-sid ed and tw o -sid ed z-tran sfo rm s a re eq u iv a le n t. In any o th e r case, th e y a re d ifferen t. 3.1.2 The Inverse z-Transform O ften , we h av e th e z-tra n sfo rm X ( z ) of a signal a n d w e m ust d e te rm in e th e signal se q u en ce. T h e p ro c e d u re fo r tra n sfo rm in g from th e z-d o m ain to th e tim e dom ain is called th e inverse z- t ransform. A n in v ersio n fo rm u la for o b ta in in g x( n) from X (z) can b e d eriv ed by using th e Cau c hy integral t h e o r e m , w hich is an im p o rta n t th e o re m in th e th e o ry o f co m p lex variables. T o b egin, we h av e th e z-tra n sfo rm defin ed by (3.1.1) as S u p p o se th a t we m u ltip ly b o th sides o f (3.1.12) by z"~' an d in te g ra te both sides o v er a closed c o n to u r w ithin the R O C o f X ( z ) w hich en clo ses th e origin. Such a c o n to u r is illu stra te d in Fig. 3.5. T h u s we have (3.1.13) w h e re C d e n o te s th e clo sed c o n to u r in th e R O C o f A'(z). ta k e n in a c o u n te rc lo c k ­ w ise d irectio n . Since th e se rie s c o n v erg es on th is c o n to u r, w e can in te rc h a n g e th e o rd e r o f in te g ra tio n an d su m m atio n o n th e rig h t-h a n d side o f (3,1.13). T h u s im (o Figure 3.5 (3.1.13). Contour C for integral in Sec. 3.2 Properties of the z-Transform 161 (3.1.13) b eco m es £ x ( z ) z n- ' d z = t= —00 x ( k ) ( h z n- l~kd z * (3.1.14) N o w w e can in v o k e th e C a u ch y in te g ra l th e o re m , w hich s ta te s th a t ftM5) w h ere C is an y c o n to u r th a t en clo ses th e origin. B y ap p ly in g (3.1.15), th e righth a n d side o f (3.1.14) re d u c e s to 2 n j x ( n ) a n d h en c e th e d e sire d in v e rsio n fo rm u la x ( n ) = ^ - ^ X ( z ) z n_I d z (3.1.16) A lth o u g h th e c o n to u r in te g ra l in (3.1.16) p ro v id es th e d e s ire d in v ersio n fo r­ m u la fo r d e te rm in in g th e se q u e n c e * (« ) fro m th e z-tra n sfo rm , w e sh all n o t use (3.1.16) d irectly in o u r e v a lu a tio n o f in v erse z -tran sfo rm s. In o u r tre a tm e n t w e d eal w ith signals a n d sy stem s in th e z-d o m ain w hich h av e ra tio n a l z -tra n s fo rm s (i.e., ztra n sfo rm s th a t a re a ra tio o f tw o p o ly n o m ials). F o r such z -tra n sfo rm s w e d e v e lo p a s im p ler m e th o d fo r in v ersio n th a t ste m s from (3.1.16) and e m p lo y s a ta b le lo o k u p . 3.2 PROPERTIES OF THE Z-TRANSFORM T h e z -tra n sfo rm is a v ery p o w erfu l to o l fo r th e stu d y o f d isc re te -tim e signals an d system s. T h e p o w e r o f th is tra n sfo rm is a c o n s eq u en ce o f so m e v ery im p o rta n t p ro p e rtie s th a t th e tra n sfo rm possesses. In th is sectio n w e e x am in e som e o f th e se p ro p e rtie s . In th e tre a tm e n t th a t follow s, it sh o u ld b e re m e m b e re d th a t w h e n w e c o m b in e sev eral z -tra n sfo rm s, th e R O C o f th e o v erall tra n sfo rm is, at least, th e in te rse c tio n o f th e R O C o f th e in d iv id u al tra n sfo rm s. T h is will b eco m e m o re a p p a re n t la te r, w h en w e discu ss specific ex am p les. Linearity. If Jt,(n) Xi ( z ) an d x 2(n) < -U X 2(z) th e n x( n) = a \ x \ ( n ) + a 2x 2(n) X( z ) = a j Xj ( z ) -h o2X 2(z) (3.2.1) fo r an y c o n s ta n ts a i a n d a 2. T h e p ro o f o f th is p ro p e rty follow s im m e d ia te ly from th e d efin itio n o f lin e a rity a n d is left as an ex ercise fo r th e re a d e r. T h e lin e a rity p ro p e rty can easily be g e n e ra liz e d fo r an a r b itra r y n u m b e r o f signals. B asically , it im p lies th a t th e z -tra n sfo rm o f a lin e a r c o m b in a tio n o f signals is th e sa m e lin e a r c o m b in a tio n o f th e ir z-tran sfo rm s. T h u s th e lin e a rity p ro p e rty h e lp s u s to find th e z -tra n s fo rm o f a signal by ex p ressin g th e signal as a su m o f e le m e n ta ry signals, fo r ea c h o f w hich, th e z -tra n sfo rm is a lre a d y k n o w n . 162 The z-Transform and Its Application to the Analysis of LTI Systems Chap. 3 Example 3.2.1 Determ ine the z-transform and the R O C of the signal *(«) = [3(2") -4 (3 ")]« (« ) Solution If we define the signals jti(«) = 2"u(n) and x2(n) = 3"u(n) then jc(«) can be written as x(n) = 3xi(n) — 4 x2(n) According to (3.2.1), its z-transform is X(;) = 3 X ,( c ) - 4 X 2(z) From (3.1.7) we recall that a'‘u(n) 1 - az - ROC: |z| > |a| (3.2.2) By setting a = 2 and or = 3 in (3.2.2). we obtain Ai(n) = 2”u(n) X,(z) = ^ x2(n) = 3nu(ri) X 2(z) ~ ^ __■ ROC: |zj > 2 , ROC: |zl > 3 The intersection of the ROC of X,(z) and X2(:) is |z| > 3. Thus the overall transform X (z) is ROC: |;| > 3 Example 3.2.2 Determ ine the z-transform of the signals (a) x(n) = (COSo»on)u(n) (b) x(n) = (sin w^n)u(n) Solution (a) By using E uler's identity, the signal .t(n) can be expressed as x (n) = (cosa>on)u(n) = \ e Jaln"u(.n) + ^e~JUJn”u(n) Thus (3.2.1) implies that X( z ) = \ Z { e ^ u ( n ) ) + ^ { g - ^ u i n ) } Sec. 3.2 Properties of the z-Transform 163 If we set a = e^^O ori = \e±i<u°\ = 1) in (3.2.2), we obtain eJUV"u(fi) --------------- R O C : |z[ > 1 e - ,wnnu(n) ^ --------— T T T R O C : l; l > and 1- 1 Thus X(z) = -------- ----------h I ------- - ------r 2 1 —^ “f z -1 2 1 —e~J‘^lz~I RO C : |;1 > 1 A fter some simple algebraic manipulations we obtain the desired result, namely, : 1 — C_ ! COSW() (coscO(}f?)u(n) <— ►-— -— ;---------------- 1 - 2z~1cos ton + , ROC: |-1 > 1 ,, ,, , L r2.j) (b) From E uler’s identity, x(n) = (sino<o«)«(n) = ^-\eiun" u(n) — e~,w""u(»)] 2j Thus X(-) = ^ - f - ------1------- - ------- ------- - | 2j \ 1 — r _1 1 — ROC: |:| > 1 and finally. z sm OH) (sin coi,n)u(n) x - ^ ----- -— -----------------1 - 2z_1 cos wo + z~- Time shifting. ROC: |;| > 1 (3.2.4) If x( n) X (c) th e n x{n - k ) z ~ kX{ z ) (3.2.5) T h e R O C o f z ~kX ( z ) is th e sam e as th a t o f X ( z ) e x c e p t fo r j = 0 if k > 0 and z = oo if k < 0. T h e p r o o f o f th is p ro p e rty follow s im m e d ia te ly fro m the definition o f th e ^ -tra n sfo rm given in (3.1.1) T h e p r o p e rtie s o f lin e a rity an d tim e shifting a re th e k ey fe a tu re s th a t m ake th e z -tra n s fo rm e x tre m e ly u se fu l fo r th e analysis o f d isc re te -tim e L T I system s. Exam ple 3*23 By applying the time-shifting property, determ ine the z-transform of the signals .T2(n,i and xi(n) in Exam ple 3.1.1 from the Z'transform of Jti(n). Solution It can easily be seen that x 2( n ) = * ](« + 2) 164 The ^-Transform and Its Application to the Analysis of LTI Systems Chap. 3 and *i(n) = j:i(n - 2) Thus from (3.2.5) we obtain X2(z) = z2X, (z) = r + 2; + 5 + 7z ' 1 + z“3 and X 3(z) = r 2X,(z) = z"2 + 2z"3 + 5z-4 + 7z"s + z-7 Note that because of the multiplication by z2, the R O C of X2(z) does not include the point z = oc, even if it is contained in the R O C of A^i(z). E x am p le 3.2.3 p ro v id es a d d itio n a l insight in u n d e rs ta n d in g th e m e an in g of th e shiftin g p ro p e rty . In d e e d , if we recall th a t th e coefficient o f z ~ n is th e sam ple v alu e at tim e n, it is im m e d ia te ly se en th a t d elay in g a signal by k( k > 0) sam ples [i.e., x ( n ) x ( n — A')] c o rre sp o n d s to m u ltip ly in g all te rm s o f th e z -tra n sfo rm by z~ k. T h e co efficien t o f z~" b ec o m e s th e coefficient o f ~~tn+k). Example 3.2.4 Determ ine the transform of the signal f 1, ' ‘" H o . 0 < n < jV - 1 „ „ , e lse w h e r e <316> Solution We can determ ine the z-transform of this signal by using the definition (3.1.1). Indeed, * -i f N, if z = l X(z) = ^ l • z ^ = l + ; - ' + - - - + z - (Af- l l = l - r * -f . , , (3.2.7) »*=<' I 1 - z-1' 1 Since .v(n) has finite duration, its R O C is the entire z-plane, except z — 0. Let us also derive this transform by using the linearity and time shifting prop­ erties. Note that x in) can be expressed in terms of two unit step signals x(n) = u(n) —u(n — N) By using (3.2.1) and (3.2.5) we have X(z) = Z{u(n)} - Z{u(n - N)) = (1 - z"*')Z{u («)} (3.2.8) However, from (3.1.8) we have Z[u(n)) = ^ ROC: jzl > 1 which, when combined with (3.2.8), leads to (3.2.7). E x a m p le 3.2,4 h e lp s to clarify a v ery im p o rta n t issue re g a rd in g th e R O C o f th e c o m b in a tio n o f se v era l z-tran sfo rm s. If th e lin ear c o m b in a tio n of several sig n als h as finite d u ra tio n , th e R O C o f its z -tra n sfo rm is exclusively d ic ta te d by the fin ite -d u ra tio n n a tu re o f th is signal, n o t by th e R O C o f th e in d iv id u al tran sfo rm s. Scaling in the z-domain. x{n) If X{z ) ROC: ri < [z| < r2 Sec. 3.2 165 Properties of the z-Transform th en a nx ( n ) ►X (c ~ ’z) R O C : \a\r\ < |z| < \a\r2 (3.2.9) for a n y c o n s ta n t a, re a l o r com plex. Proof. F ro m th e d efin itio n (3.1.1) OC Z{a" x( n) } = Y OC a nx ( n ) z " = ^ x( n) ( a ‘z) n \o\r i < I;I < \a\r2 T o b e tte r u n d e rsta n d th e m ean in g a n d im plicatio n s o f th e scaling p ro p e rty , w e e x p re ss a a n d z in p o la r form as a = rae->a", z = r e i<0, a n d w e in tro d u c e a new co m p lex v a ria b le w = a~^z- T h u s Z { x ( n ) ) = X ( z ) an d Z{a" x( n) } = X (if). It can easily b e seen th a t T h is ch a n g e o f v a ria b le s re su lts in e ith e r sh rin k in g (if r 0 > 1) o r e x p a n d in g (if r 0 < 1) th e z -p lan e in co m b in a tio n w ith a ro ta tio n (if too # 2i-jr ) o f th e z-p lan e (see Fig. 3.6). T h is e x p lain s w hy w e h av e a ch an g e in th e R O C o f th e n ew tra n sfo rm w h e re |a | < 1. T h e case \a\ = 1, th a t is, a = e^w" is o f special in te re st b e c a u se it c o rre sp o n d s o n ly to ro ta tio n o f th e z-p lan e. Exam ple 3.2.5 Determ ine the z-transforms of the signals (a) x(n) = a"(cosu\in)u(n) (b) x(n) = tf"(sinio»n)u(n) r-planc w-plane Im(-) (W-C^o 0 Figure 3.6 o _ 1 Z, Re(z) 0 Re(w) Mapping of the r-plane to the u -plane via the transformation ui = a —roe^. 166 The z-Transform and Its Application to the Analysis of LTI S ystem s Chap. 3 Solution (a) From (3.2.3) and (3.2.9) we easily obtain 1 - a ; -1 cos wn a (C O S a i |,« ) u ( r t ) (3.2.10) *-------*■ --------- ---------- ;-------------------------- 1 — l a z r 1 co s ton -f a (b) Similarly, (3.2.4) and (3.2.9) yield a r -1 sin to<i 1 —2az~ cos to,, + a a (sin wii/i)u(n) *— ► --- ---- ;--------- Time reversal. |z! > la I (3.2.11) If a (//) *-—> X ( z ) R O C : r\ < < r; th en j r ( - n ) <-i-> X { z ~ ]) R O C : — < |z < r2 (3.2.12) r\ P r o o f F ro m th e d efin itio n (3.1.1), w e have Z{a (—/;)) = Y h= - x. -x { - !i ) z~" — Y ■'‘ ( h ( z ~ t )~l — Ar (z~ ') /= ->; w h ere th e ch an g e o f v ariab le / = —n is m ad e. T h e R O C o f A '( ;_1) is < |c —1f < r-i o r e q u iv alen tly — < ];| < — r2 n N o te th a t th e R O C fo r x( n) is the inverse o f th a t fo r x ( —n). T h is m ean s th a t if co b elo n g s to th e R O C o f x( n) , th en l/" o is in th e R O C fo r x ( —n). A n in tu itiv e p ro o f o f (3.2.12) is th e follow ing. W h en w e fold a signal, the co efficien t o f z ~n b e co m es th e coefficient o f z n. T h u s, fo ld in g a signal is eq u iv alen t to rep lacin g ; by in th e z-tra n sfo rm fo rm u la. In o th e r w o rd s, reflectio n in the tim e d o m ain c o rre sp o n d s to inversion in th e z-d o m ain . Exam ple 3.2.6 Determ ine the z-transform of the signal x i n ) = u( —n) Solution It is known from (3.1.8) that u(n) <-U i ROC: | z l > 1 By using (3.2.12), we easily obtain u(—n) *■ ------ Differentiation in the z-domain. ROC: |z < 1 If (3.2.13) 167 Properties of the z-Transform Sec. 3.2 then n x { n ) <— >- —z ^ ^ y — dz (3.2.14) Proof . B y differentiating both sid es o f (3.1.1), w e have dX{z) n~—oc n=—oc — - z ~ l Z{nx(n)} N o te that b oth transform s have the sam e RO C . Example 3.2.7 D eterm ine the z-transform of the signal jr(n) = na"u(n) Solution The signal j:(n) can be expressed as njcitn), where Xj(n) = a"u(n). From (3.2.2) we have that jri(rt) = aKu(n) < - X,(z) = -— ----- 1 —az~' ROC: |z| > \a\ Thus, by using (3.2.14), we obtain n<j"ii(n) dXji z) a : '1 X(z) = - z — ^ - = ----------- r-r az (1 - az~' V ROC: |z| > |a| (3.2.15) If we set a = 1 in (3.2.15), we find the z-transform of the unit ram p signal 2 ntt(n) ROC: jz| > 1 (3.2.16) Example 3.2.8 D eterm ine the signal x(n) whose z-transform is given by X(z) = log(l -t- o z '1) |z! > |o( Solution By taking the first derivative of X(z), we obtain dX{z) - a z ~2 dz “ 1 + az~l Thus dX(z) dz = az 1 - (- a ) z -> > \a] The inverse z-transform of the term in brackets is (-a) ". The multiplication by z _1 implies a time delay by one sample (time shifting property), which results in ( - a ) " _ 1u(n — 1). Finally, from the differentiation property we have nx(n ) = a ( —a)n~lu(n — 1) 168 The z -Transfomn and Its Application to the Analysis of LTI Systems Chap. 3 x ( n) = ( - 1 } " +1 — u(n - 1) n Convolution of two sequences. If Xi (rt) X^z) x 2(n) X 2 {z) th e n x( n) = jfi(n) * x 2 (n) X ( z ) = X \ ( z ) X 2 (z) (3.2.17) T h e R O C o f X (;) is, at least, th e in te rse c tio n of th a t fo r ATi(c) an d AS(z). Proof. T h e co n v o lu tio n o f x i(n ) a n d x 2 (n) is d efin e d as OC x(n) = Y x i ( k ) x 2(n - k) i' = —oc T h e z-tra n sfo rm o f x( n ) is AT{;) = oc oc Y 2 x( n) z ~ " = Y , ac n—- x n= - o c |_Jt = -cc x \ ( k ) x 2(n - k) U p o n in te rch an g in g th e o rd e r o f the su m m a tio n s a n d ap p ly in g th e tim e-sh iftin g p ro p e rty in (3.2.5). we o b tain X{z) = Y x 2(n — k) z " x ' {k) = X 2 (z) Y ^ ( k ) z ~ k = X 2 ( z ) X ](z) Example 3.2.9 Compute the convolution x(rt) of the signals jt,(n) = { 1 .-2 ,1 ) _ f 1. 0 < n < 5 2 10 , elsewhere Solution From (3.1.1), we have * ,( ; ) = 1 - 2 ; “ ' + z ~ 2 X 2(z) = I + z ~ ' + z~2 + j ' 3 + z"4 + According to (3.2.17), we carry out the multiplication of X\(z) and X 2(z). Thus X(z) = X 1 (z)X 1 (z) = 1 - z "1 - z ~6 + z "7 Hence x ( n) = { 1 . - 1 . 0 , 0, 0, 0 , - 1 , 1 } t Sec. 3.2 Properties of the z-Transform 169 The same result can also be obtained by noting that X,U) = (1 - ; ~ 'r x 2w 1 - ; -6 = 3— p Then - z "6 + :" 7 X(z) = (1 - ; - ‘)(l - z~*) = 1 - The reader is encouraged to obtain the same result explicitly by using the convolution summation formula (tim e-domain approach). T h e co n v o lu tio n p ro p e rty is o n e o f th e m o st p o w erfu l p ro p e rtie s o f th e ztra n sfo rm b ec a u se it c o n v e rts th e co n v o lu tio n o f tw o signals (tim e d o m a in ) to m u ltip lic a tio n o f th e ir tra n sfo rm s. C o m p u ta tio n of th e c o n v o lu tio n o f tw o signals, using th e z -tra n sfo rm , re q u ire s th e follow ing steps: 1. C o m p u te th e z -tra n s fo rm s o f th e signals to be co n v o lv ed . X i(z) = Z{ x \ ( n ) \ (tim e d o m ain — *■ -.-dom ain) X 2 (z) = Z { x 2 (n) ] 2 . M u ltip ly th e tw o z -tran sfo rm s. X (z) = X ,(z )X 2(;) (z-d o m ain ) 3. F in d th e in v e rse z -tra n s fo rm o f X (z). x ( n ) = Z _ , {X(z)) (z-d o m ain — ►tim e d o m a in ) T h is p ro c e d u re is, in m a n y cases, c o m p u ta tio n a lly e a s ie r th a n th e d irect e v a l­ u a tio n o f th e co n v o lu tio n su m m atio n . Correlation of two sequences. If xj(n) X i(z) x 2 (n) X 2 (z) th e n OC Rx,J2 (z) = X 1 (Z)X 2(Z"1) OC Proof . We recall that rXix2U) = x\ ( l ) * x 2( - l ) (3.2.18) 170 The z-Transform and Its Application to the Analysis of LTI Systems Chap. 3 U sing th e co n v o lu tio n an d tim e-rev ersa l p ro p e rtie s , we easily o b ta in = Z{x] ( / ) }Z{xz ( —/)} = X l ( z ) X 2 ( z ~1) T h e R O C o f R X}X2(z) is at least the in te rse c tio n o f th a t fo r X i(c ) an d X 2("- 1 )A s in th e case o f co n v o lu tio n , th e c ro ssc o rre la tio n o f tw o signals is m o re easily d o n e via p o ly n o m ial m u ltip lic atio n acco rd in g to (3.2.18) a n d th en inverse tra n sfo rm in g th e resu lt. Exam ple 3.2.10 Determ ine the autocorrelation sequence of the signal x (n ) = a " u {n ). — 1 < a < 1 Since the autocorrelation sequence of a signal is its correlation with itself, (3.2.18) gives S o lu tio n Rxs(z) = Z{rxJ I ) ) = X (z)X (;~l ) From (3.2.2) we have ROC: |z| > \a\ Ale) = ---------- J - az~' (causal signal) and by using (3.2.15). we obtain 1 | = -.... ■ 1 - az 1 ROC: |;| < — (a| (anticausal signal) Thus = -— = ------------ ------------ 1 —az 1 1 - az 1 —a (; + ; ) + fl ROC: \a\ < |;| < — |c| Since the R O C of Rxx(z) is a ring, rIX{i) is a two-sided signal, even if x(n) is causal. To obtain rsJ l ) , we observe that the ^-transform of the sequence in Exam­ ple 3.1.5 with b = 1 /a is simply (1 —a1)Rxx(z). Hence it follows that rXI(l) = — -—- a ^ — oc < I < oo \ — a- The reader is encouraged to compare this approach with the time-dom ain solution of the same problem given in Section 2.6. Multiplication of two sequences. If x \ ( n) ATi(z) x 2 (n) X 2 {z) th e n •r(n) = x i ( n ) x 2 (n) X(z) = ( “ ) v~ ^ v (3.2.19) w h ere C is a clo sed c o n to u r th a t e n clo ses th e o rig in a n d lies w ith in th e reg io n of co n v erg en ce c o m m o n to b o th X](i>) a n d ^ ( l / u ) . Sec. 3.2 171 Properties of the z-Transform Proof . T h e z -tra n sfo rm o f J 3 (n) is OC X(z) = Y OC x( n)z ~n = Y x ] ( n) x 2 ( n) z ~n n = —oc ft— L e t us s u b s titu te th e in v erse tra n sfo rm * i(n ) = fo r in th e z -tra n sfo rm X (z) a n d in te rc h a n g e th e o r d e r o f su m m a tio n an d in te g ra tio n . T h u s w e o b ta in 1 / " oc X (z)= 2 v~ ^ v T h e su m in th e b ra c k e ts is sim ply th e tra n sfo rm X 2 (:) e v a lu a te d a t z / v . T h e re fo re , X(z) = ^ - 6 x ^ x 2 2 n j Jc w hich is th e d e s ire d result. T o o b ta in th e R O C o f X (z) w e n o te th a t if X i(u ) co n v e rg e s fo r ru < |u| < r\ an d X 2 iz) c o n v erg es fo r r2! < |z| < r2ll, th e n th e R O C o f X 2 {z/v) is H e n c e th e R O C fo r A"(z) is at least r\ir2i < |z[ < r u r2u (3.2.20) A lth o u g h this p ro p e rty will n o t be used im m e d ia te ly , it will p ro v e u se fu l later, esp ecially in o u r tr e a tm e n t o f filter design b ased o n th e w in d o w te c h n iq u e , w h ere w e m u ltip ly th e im p u lse re sp o n s e o f an IIR system by a fin ite -d u ra tio n “w in d o w ” w h ich se rv es to tru n c a te th e im p u lse re sp o n se o f th e I I R sy stem . F o r c o m p le x -v a lu e d se q u e n c e s .ti(rt) an d x 2 (n) w e c a n define th e p ro d u c t s e q u e n c e as x( n ) = Jti (nj x^i n) . T h e n th e c o rre sp o n d in g c o m p lex co n v o lu tio n in te g ra l b eco m es x ( n ) = x i ( n ) x 2 {n) X(z) = v~ldv (3.2.21) T h e p r o o f o f (3.2.21) is left as an ex ercise fo r th e re a d e r. Parseval’s relation. y If jti(n ) an d x 2 (n) a re c o m p le x -v a lu e d se q u en ces, th e n * i(n )x 2 (n) = l j ( j ^ X i ( v ) X 2 v ~ 'd v (3.2.22) p ro v id e d th a t r ^ r y < 1 < n ur2u, w h e re ry < |z| < r \ u a n d r ^ < |z| < r2u a re th e R O C o f X ](z) a n d X 2(z). T h e p ro o f o f (3.2.22) follow s im m e d ia te ly by ev alu atin g X ( z ) in (3.2.21) at z = 1. 172 The z-Transform and Its Application to the Analysis of LTI Systems The Initial Value Theorem. Chap. 3 If j ( ;i ) is causal [i.e.. x ( n ) = 0 fo r n < 0], th e n .r(0) = lim X ( z ) :—*•sc (3.2.23) Proof. Since x{n) is causal. (3.1.1) gives X (z) — y x {n )z ” — x (0) + x (1 )z 1 + x (2)z «=o + ■■• O b v iou sly , as z —►oc. z ~" —►0 since n > 0 an d (3.2.23) follow s. A ll th e p ro p e rtie s o f th e z -tra n sfo rm p r e s e n te d in th is s e c tio n are su m m arized in T a b le 3.2 fo r easy re fe re n c e . T h ey are listed in th e sam e o rd e r as th ey have b een in tro d u c e d in th e tex t. T h e c o n ju g atio n p ro p e rtie s a n d P a rse v a l's relatio n are left as ex ercise s fo r th e re a d e r. W e have now' d e riv e d m o st o f th e z -tra n sfo rm s th a t are e n c o u n te re d in m any p ractical ap p licatio n s. T h e se z -tra n sfo rm pairs a re su m m a riz e d in T ab le 3.3 for easy re fe re n c e . A sim ple in sp e ctio n o f th is ta b le show s th a t th e s e z-tran sfo rm s are all rational f u n c t i o n s (i.e., ratio s o f p o ly n o m ials in z _1). A s will soon b ecom e a p p a re n t, ratio n al z -tra n sfo rm s are e n c o u n te re d n o t only as th e z-tran sfo rm s of v ario u s im p o rta n t signals b u t also in th e c h a ra c te riz a tio n of d isc re te -tim e lin ear tim e -in v a ria n t sy stem s d esc rib e d by c o n s tan t-co efficien t d iffe re n c e e q u a tio n s. 3.3 RATIONAL Z-TRANSFORMS A s in d ic a te d in S ectio n 3.2, an im p o rta n t fam ily o f z-tra n sfo rm s a re th o se fo r w hich X ( z ) is a ra tio n a l fu n ctio n , th a t is. a ra tio of tw o p o ly n o m ials in z _l (o r z). In this sectio n w e discuss som e very im p o rta n t issues re g a rd in g th e class o f ra tio n a l z-tran sfo rm s. 3.3.1 Poles and Zeros T h e zeros of a z -tra n sfo rm X (z) a re th e v alu es of z fo r w hich X (z) = 0. T h e pol es o f a z-tra n sfo rm are th e v alu es o f z fo r w hich X (z) = oc. If X ( z ) is a ratio n al fu n ctio n , th e n J K ,) . D( z) ao + a i z 1 + ----- \ - aNz ~ h = ™ --------* (3.3.1) k=o If ao / 0 an d bo ^ 0, w e can avoid th e n eg ativ e p o w e rs o f z by fa cto rin g o u t the te rm s boz~M a n d a$z~N as follow s: X(z) = N( z) b 0z ~ M z M + {bx/ bo) z M~ x + • • ■+ b M/ b 0 D( z) a0z N Z N + ( a \ / a a) z fJ~ l H--------\ - aN/ a Q TABLE 3.2 PROPERTIES OF THE Z-TRANSFORM Property Time Domain z-Domain R OC Notation Linearity *(n) xt (n) ■^(n) aixy(n) + a2x 2(n) X(z) Xi(z) X 2(z) <t\* l(z ) + « 2X 2(z) Time shifting x{n - k) z~kX(z) Scaling in the z-domain a"x(n) X(a~' z) ROC: r2 < |z) < r\ ROC, ROC2 At least the intersection of R O Q and R O C 2 T hat of X (z), except z = 0 if k > 0 and z = oo if k < 0 \a\r2 < |z| < |a|r[ Time reversal x(~rj) X(z~') - Conjugation Real part Imaginary part x'(rt) Relx(n)} lm{x(n)) X' ( z ' ) ROC Includes ROC Includes ROC Differentiation in the z-domain Convolution nx(n) x i ( n ) * x 2(n) Jf|(z)X 2(z) Correlation rx,x2(l) = * i(0 * x 2 (~l) / W z ) = Xi<z)* 2<z_l) Initial value theorem If x(n) causal .r(O) = lim X(z) Multiplication Xi(n)x 2(n) 2~J^X,(v)X2^ J v - ' d v Parseval’s relation i[X (z) + X*U*)] i[X (z )-* ♦ (;• )] dX( z ) Z dz = 2? i i 5X ,( t)) ^ (l/tJ ’) v - ' dv 1 r1 1 < |z| < — r2 r2 < |z| < r. A t least, the intersection of ROCi and R O C 2 A t least, the intersection of ROC of X,(z) and -K^z” 1) A t least rj/ry < |z| < r]„r2 a 174 The z-Transform and Its Application to the Analysis of LTI Systems TABLE 3.3 SOME COMMON Z-TRANSFORM PAIRS Signal. x(n) 1 u(n) 3 a"u(n) A ll ; 1 —az~l a:" 1 na"u(n ) ( l - a z ^ )2 —a”u(—n — 1) 6 —na'’u(—n — 1) (cos aion)u(n) (sin a>nn)u(n) ( a" cosiH ) n ) u ( n ) 10 1 1 - r-1 1 5 8 ROC 1 2 7 : -Transform, X (c) 5{n) 4 Chap. 3 (a'1sin£i*in)u{n) 1:1 > 1 \z\ > \a\ Izt > !a| 1 1 —a : -1 a z~l (1 - c : - 1)2 1 - Z '1 COSf^o 1 - 2; _1 costal + z ~2 sin 2 ;" 1 cos tun + z ~2 1 —az~] cos a*) 1- k l < la| |;| < N kl > 1 \z\ > 1 1 — 2az~‘ cos wo + a 2z ~2 a ; -1 sinaiii 1 - 2a ; " 1 cos a*, + a 2z ~2 Since N ( z ) and D( z ) are polynom ials in z, they can be expressed in factored form as X (-) — — b() - - M + N D( z ) ~ ~ Z2) ■■■ (Z ~ Z m ) (z - p i ) ( z - P i ) ■• ■(z - p n ) u n « " z*} (3.3.2) X ( z ) = G z N~ M^A ------------ n<* ~ pjt) *=i w here G = 6o/ao- Thus X (r) has M finite zeros at z = z\, zi , ■. •, z m (th e roots o f the num erator p olyn om ial), N finite p oles at z = p \ , p i .........P n (th e roots o f the d enom inator p olyn om ial), and \N — M\ zeros (if N > M ) or p o le s (if N < M ) at the origin z = 0. P o les or zeros m ay also occur at z = 0 0 . A zero exists at z = oc if X ( 0 0 ) = 0 and a p o le exists at z = oc if X ( 0 0 ) = oc. If w e count the p oles and zeros at zero and infinity, w e find that X (z) has exactly the sam e num ber o f p o les as zeros. W e can represent X ( z ) graphically by a p o l e - z e r o p l o t (or pat t ern) in the com plex plane, which show s the location o f p oles by crosses ( x ) and the location o f zeros by circles (o). T he m ultiplicity of m ultipie*order p o les or zeros is indicated by a num ber clo se to the corresponding cross or circle. O b viou sly, by definition, the R O C o f a z-transform should not contain any poles. Sec. 3.3 175 Rational z-Transform s Exam ple 33.1 D eterm ine the pole-zero plot for the signal a >0 x(n) = a"u(n) Solution From Table 3.3 we find that 1_____ X(z) = ROC; \z\ > a - a 1 —a ; -1 Thus has one zero at n = 0 and one pole at pi = a. The pole-zero plot is shown in Fig. 3.7. Note that the pole p\ = a is not included in the R O C since the z-transform does not converge at a pole. Re(;) Figure 3.7 Pole-zero plot for the causal exponential signal ,v(«) = a"imu Exam ple 3 3 .2 D eterm ine the pole-zero plot for the signal 1 0, Of n < W - 1 elsewhere where a > 0. Solution From the definition (3.1.1) we obtain ^ X(z) = X W " ln l - t a ; ' 1) " z“ - a u 1 - az 1 = Sz T T t--------T (z - a) 1}" = - r r ^ ------ r Since a > 0, the equation z M = a M has M roots at Z t = a e ' 1* * ' " it = 0 , 1 . . . . . . M - 1 The zero zo = a cancels the pole at z = a. Thus w , (Z - Z\ ) ( Z - Zl ) ■’ ■(Z - Z j t f - i ) X(z) = ---------------- ^ - ---------------- which has M —1 zeros and M - 1 poles, located as shown in Fig. 3.8 for M = 8. Note th at the R O C is the entire z-plane except z = 0 because of the M - 1 poles located at the origin. 176 The z-Transfonm and Its Application to the Analysis of LTI Systems Chap. 3 Im(c) Red) Figure 3.8 Pole-zero patlem for the finite-duration signal x(n) = a", 0 < n < M — l(a > 0). for M = 8. C learly , if we are given a p o le - z e r o p lo t, w e can d e te rm in e X ( ’ ), by using (3.3.2), to w ithin a scaling fa c to r G. T his is illu stra te d in th e follow ing ex am p le. Example 3.3.3 Determine the c-transform and the signal that corresponds to the pole-zero plot of Fiji. 3.9. Solution There are two zeros (M = 2) at Z] = 0, Z2 = r cosojo and two poles (N = 2) al p] — reJ , Pz = re~iw". By substitution of these relations into (3.3.2), we obtain X(z) = ( Z(Z — r C O S ttH i) (; - Pi)(c - pi) = G(c - re}wu)(z - re~>w") ROC: A fter some simple algebraic manipulations, we obtain 1- C O S a><) Xiz) = G-. 1 - 2 r - ~ l costou + r1 ROC: 1-1 > r From Table 3.3 we find that x(n) = G(r" cosa>on)u(n) F ro m E x a m p le 3.3.3, w e see th a t th e p r o d u c t (; — p \ ) ( z — P 2 ) resu lts in a p o ly n o m ial w ith re a l coefficients, w h en p\ a n d p 2 a re c o m p lex co n ju g ates. In Im(2) Figure 3.9 P ole-zero p attern for Exam ple 3.3.3. Sec. 3.3 177 Rational z - T ransforms g e n e ra l, if a p o ly n o m ial h a s re a l coefficients, its ro o ts a re e ith e r real o r o ccu r in c o m p lex -co n ju g ate pairs. A s w e h av e seen , th e ; -tran sfo rm X ( z ) is a com plex fu n c tio n of th e com plex v ariab le z = R e ( z ) + j Im (r). O b v io u sly , |X (c )|, th e m a g n itu d e o f X ( z ), is a real and p o sitiv e fu n ctio n o f c. S ince : re p re se n ts a p o in t in th e co m p lex p la n e , |X ( ’ )| is a tw o -d im e n sio n a l fu n c tio n an d d esc rib e s a “su rfa c e .” T h is is illu stra te d in Fig. 3.10(a) fo r th e z -tra n sfo rm 7 - 1 _ - - 2 (a) Figure 3.10 Graph of |X (;)| for the ;;-Transform in (3.3.3). [Reproduced with permission fr om Introduction to Systems Analysis, by T. H. Glisson, © 1985 by McGraw-Hill B ook Company.] 178 The z-Transform and Its Application to the Analysis of LTI Systems Chap. 3 w hich h as o n e z e ro a t z\ = 1 a n d tw o p o le s a t p \ , p 2 = 0. 9e±J" /4. N o te the high p e a k s n e a r th e sin g u larities (p o les) a n d th e d e e p v alley close to th e zero. F ig u re 3.10(b) illu stra te s th e g rap h o f lX (z)j fo r z = eJO>. 3.3.2 Pole Location and Time-Domain Behavior for Causal Signals In th is su b sectio n w e c o n sid e r th e re la tio n b e tw e e n th e z -p la n e lo catio n o f a pole p a ir a n d th e fo rm (sh a p e ) o f th e c o rre sp o n d in g signal in th e tim e d o m ain . T h e dis­ cu ssio n is b a s e d g en erally o n th e collectio n o f z -tra n s fo rm p a irs given in T a b le 3.3 an d th e resu lts in th e p re c e d in g su b sectio n . W e d e a l exclusively w ith real, causal signals. In p a rtic u la r, w e se e th a t th e c h a ra c te ristic b e h a v io r o f cau sal signals d e­ p e n d s o n w h e th e r th e p o les o f th e tra n sfo rm a re c o n ta in e d in th e reg io n |z| < 1 , o r in th e reg io n |z| > 1, o r on th e circle |z| = 1. S ince th e circle jz| = 1 h as a ra d iu s o f 1 , it is called th e unit circle. If a real signal h as a z-tran sfo rm w ith o n e p o le , th is p o le h a s to b e real. T he o n ly su ch signal is th e re a l e x p o n e n tia l x ( n ) = a nu{n) ^ X ( z ) = — ------ r 1 — az R O C : |z] > |o| h av in g o n e z e ro a t zi = 0 an d o n e p o le a t pi — a on th e re a l axis. F ig u re 3.11 x (n) 11 o x(n ) 1 1 ! TTt l i t , x(n x(n) 0 i l l rt I I I x(n) '1 0 n n i 1 -oi ' Figure 3.11 Time-domain behavior of a single-real pole causal signal as a function of the location of the pole with respect to the unit circle. Sec. 3.3 179 Rational z-Transform s illu stra te s th e b e h a v io r o f th e signal w ith re sp e c t to th e lo c a tio n o f th e p o le r e l­ ative to th e u n it circle. T h e signal is d ecay in g if th e p o le is inside the unit circle, fixed if th e p o le is o n th e u n it circle, an d gro w in g if th e p o le is o u t­ side th e u n it circle. In a d d itio n , a n eg ativ e p o le resu lts in a signal th a t a lte r­ n a te s in sign. O b v io u sly , causal signals w ith p o les o u tsid e th e u n it circle b e ­ co m e u n b o u n d e d , cau se overflow in d igital system s, a n d in g e n e ra l, sh o u ld be av o id ed . A cau sal re a l signal w ith a d o u b le re a l p o le h as th e fo rm x ( n ) = n a nu ( n ) (see T a b le 3.3) an d its b e h a v io r is illu stra te d in Fig. 3.12. N o te th a t in c o n tra s t to th e sin g le-p o le signal, a d o u b le real p o le o n th e u n it circle re su lts in an u n b o u n d e d signal. F ig u re 3.13 illu stra te s th e case of a p a ir o f c o m p le x -c o n ju g a te poles. A c c o rd ­ ing to T a b le 3.3, th is co n fig u ratio n of p o le s resu lts in an e x p o n e n tia lly w eig h ted sin u so id al signal. T h e d istan c e r of th e p o les fro m th e o rigin d e te rm in e s th e e n v e ­ lope o f th e sin u so id al signal an d th e ir angle w ith th e real p o sitiv e axis, its relative freq u e n cy . N o te th a t th e a m p litu d e o f th e signal is gro w in g if r > 1, c o n stan t if r — 1 (sin u so id a l sig n als), a n d d ecaying if r < 1 . x(n) <■ T T .... T j . xin) T 0 ! 1 l Figure 3.12 Time-domain behavior of causal signals corresponding to a double (m = 2) real pole, as a function of the pole location. n 180 The z-Transform and Its Application to the Analysis of LTI Systems Chap. 3 Figw e 3.13 A pair of complex-conjugate poles corresponds to causal signals with oscillatory behavior. Finally, Fig. 3.14 show s the b eh avior o f a causal signal w ith a d ou b le pair of p o les on the unit circle. T his reinforces the corresponding results in Fig. 3.12 and illustrates that m ultiple p o les on the unit circle should b e treated with great care. T o sum m arize, causal real signals w ith sim ple real p oles or sim ple com plexconjugate pairs o f p oles, w hich are in sid e or on the unit circle are always bounded in am plitude. Furtherm ore, a signal with a p o le (or a com p lex-con ju gate pair o f p o les) near the origin decays m ore rapidly than on e a ssociated with a pole n ear (but inside) the unit circle. Thus the tim e behavior o f a signal depends strongly on the location o f its p o les relative to th e unit circle. Z eros also af­ fect the behavior o f a signal but n ot as strongly as p oles. F or exam ple, in the Sec. 3.3 181 Rational z-Transform s Figure 3.14 Causal signal corresponding to a double pair of complex-conjugate poles on the unit circle. case o f sin u so id al signals, th e p resen c e an d lo catio n o f ze ro s affects only th e ir p h ase. A t this p o in t, it sh o u ld be stressed th a t e v e ry th in g w e h av e said a b o u t causal signals ap p lies as w ell to causal L TI system s, since th e ir im p u lse re sp o n se is a causal signal. H en ce if a p o le of a system is o u tsid e the unit circle, th e im pulse resp o n se of th e system b eco m es u n b o u n d e d and. co n se q u e n tly , th e sy stem is u n sta b le . 3.3.3 The System Function of a Linear Time-Invariant System In C h a p te r 2 w e d e m o n s tra te d th a t th e o u tp u t o f a (re la x e d ) lin e a r tim e -in v a ria n t sy stem to an in p u t se q u e n c e x( n) can be o b ta in e d by co m p u tin g th e co n v o lu tio n of jc(h) w ith th e u n it sa m p le resp o n se o f th e system . T h e co n v o lu tio n p ro p e rty , d eriv e d in S ectio n 3.2, allow s us to ex p ress th is re la tio n sh ip in th e z-d o m ain as Y( z ) = m z ) X ( z ) (3.3.4) w h ere Y( z ) is th e z -tra n sfo rm o f th e o u tp u t se q u en ce v(n), X (z) is th e z-tra n sfo rm o f th e in p u t se q u e n c e x ( n ) an d H( z ) is th e z -tra n sfo rm o f th e u n it sa m p le resp o n se h{n). If w e k n o w h( n) an d x( n ) , w e can d e te rm in e th e ir c o rre sp o n d in g z-tra n sfo rm s H ( z ) a nd X ( z ) , m u ltip ly th e m to o b ta in Y(z), a n d th e r e fo r e d e te rm in e y( n) by e v a lu a tin g th e in v erse z -tra n sfo rm of K(z). A lte rn a tiv e ly , if w e k now x ( n ) an d we o b se rv e th e o u tp u t y( n) of th e system , w e can d e te rm in e th e u n it sa m p le resp o n se by first solv in g fo r H( z ) fro m th e re la tio n a n d th e n e v a lu a tin g th e in v erse z -tra n sfo rm o f H( z ) . Since OC (3.3.6) 182 The z-Transform and Its Application to the Analysis of LTI System s Chap. 3 it is c le a r th a t H ( z ) re p re s e n ts th e z -d o m ain c h a ra c te riz a tio n o f a system , w h ereas h{n) is th e c o rre sp o n d in g tim e -d o m a in c h a ra c te riz a tio n of th e system . In o th e r w o rd s, H{z ) an d h( n) are e q u iv a le n t d e s c rip tio n s o f a system in th e tw o d o m ain s. T h e tra n sfo rm H{ z ) is called th e s yst em f unct i on. T h e re la tio n in (3.3.5) is p a rtic u la rly u sefu l in o b ta in in g H{ z ) w h en th e system is d e s c rib e d b y a lin e a r c o n s tan t-co efficien t d iffe re n c e e q u a tio n o f th e fo rm M N (3.3.7) In th is case th e sy stem fu n ctio n can be d e te rm in e d d irectly fro m (3.3.7) by com ­ p u tin g th e z -tra n s fo rm o f b o th sid es o f (3.3.7). T h u s, by a p p ly in g th e tim e-sh iftin g p ro p e rty , w e o b ta in M y u ) = - J 2 a*Y ^ z ~k + E b iX (z )r‘ M Y(z) X(z) o r, eq u iv alen tly , £ > z-* (3.3.8) T h e re fo re , a lin e a r tim e -in v a ria n t system d e s c rib e d by a c o n s ta n t-c o e ffic ie n t dif­ fere n ce e q u a tio n h a s a ra tio n a l system fu n ctio n . T h is is th e g e n e ra l fo rm fo r th e system fu n c tio n o f a sy ste m d e sc rib e d by a lin e a r c o n s tan t-co efficien t d ifferen ce e q u a tio n . F ro m th is g e n e ra l fo rm w e o b tain tw o im p o rta n t sp e cial fo rm s. F irst, if ajt = 0 fo r 1 < k < N , (3.3.8) re d u c e s to M H ( z ) = J 2 bkz ~k k=0 1 » (3.3.9) In th is case, H ( z ) c o n ta in s M z ero s, w h o se valu es a re d e te r m in e d by the system p a ra m e te rs {£*}, a n d an M th -o rd e r p o le a t th e o rigin z = 0. S ince the sy stem c o n ta in s o n ly trivial p o le s (a t z = 0) an d M n o n triv ia l z e ro s, it is called Sec. 3.3 183 Rational z-Transform s an all -zero syst em. C learly, such a system h as a fin ite -d u ra tio n im p u lse resp o n se (F IR ), a n d it is called an F IR system o r a m oving av erag e (M A ) system . O n th e o th e r h an d , if bk — 0 fo r 1 < k < M, th e system fu n c tio n re d u c e s to A' 1 *= 1 k (3.3.10) boz" <io = l at*. In this case H ( z ) co n sists of N poles, w hose v alu es are d e te r m in e d by th e system p a ra m e te rs {a*} a n d an /V th-order zero at th e o rig in z = 0- W e usually do not m a k e re fe re n c e to th e se trivial zeros. C o n se q u e n tly , th e sy stem fu n c tio n in (3.3.10) c o n ta in s o n ly n o n triv ia l p o les an d th e c o rre sp o n d in g sy stem is called an all-pole syst em. D u e to th e p re se n c e o f poles, th e im p u lse re sp o n s e o f such a system is infinite in d u ra tio n , a n d h e n c e it is an I IR system . T h e g e n e ra l fo rm o f th e sy stem fun ctio n given by (3.3.8) c o n ta in s b o th poles a n d zero s, and h e n c e th e c o rre sp o n d in g sy stem is called a p o l e - z e r o s y s t e m , with N p o le s a n d M z ero s. P o les a n d /o r zero s at c = 0 an d z = oc a re im p lied b u t are n o t c o u n te d ex p licitly. D u e to th e p re se n c e o f p o les, a p o le - z e r o system is an IIR system . T h e fo llo w in g ex am p le illu strates th e p ro c e d u re fo r d e te rm in in g th e system fu n ctio n a n d th e u n it sa m p le resp o n se from the d iffe re n c e e q u a tio n . E xam ple 3.3.4 D eterm ine the system function and the unit sample response of the system described by the difference equation v(n) = Solution 1y(n - 1) + 2 x ( n ) By computing the -transform of the difference equation, we obtain Y(z) = ± z - >Y(z) + 2X(z) H ence the system function is xt:l I - Jz -1 This system has a pole at z = \ and a zero at the origin. Using Table 3.3 we obtain the inverse transform h(n) = 2(i)"u(«) This is the unit sample response of the system. 184 The z-T ransform and Its Application to the Analysis of LTI Systems Chap. 3 W e h av e n o w d e m o n s tra te d th a t ra tio n a l z -tra n s fo rm s a re e n c o u n te re d in c o m m o n ly u se d sy stem s a n d in th e c h a ra c te riz a tio n o f lin e a r tim e -in v a ria n t sys­ tem s. In S ectio n 3.4 w e d esc rib e se v e ra l m e th o d s fo r d e te rm in in g th e inverse z -tra n sfo rm o f ra tio n a l fu n ctio n s. 3.4 INVERSION OF THE Z-TRANSFORM A s w e saw in S ectio n 3.1.2, th e in v erse z -tra n s fo rm is fo rm ally given by x ( n ) = - — < £ x ( z ) z n~ 1d z 2 njjt (3.4.1) w h ere th e in te g ra l is a c o n to u r in te g ra l o v e r a clo sed p a th C th a t en clo ses the o rig in an d lies w ith in th e reg io n o f c o n v e rg e n c e o f ^ ( z ) . F o r sim plicity, C can be ta k e n as a circle in th e R O C o f X (z) in th e z-p lan e. T h e re a re th re e m e th o d s th a t a re o fte n u se d fo r th e e v a lu a tio n o f th e inverse z-tran sfo rm in practice: 1. D ire c t e v a lu a tio n o f (3.4.1), by c o n to u r in te g ra tio n . 2. E x p a n sio n in to a se rie s o f te rm s, in th e v a ria b le s z, an d z _1. 3. P a rtia l-fra c tio n ex p an sio n a n d ta b le lo o k u p . 3.4.1 The Inverse z-Transform by Contour Integration In th is se ctio n w e d e m o n s tra te th e use o f th e C au ch y re sid u e th e o r e m to d e te rm in e th e in v erse z -tra n sfo rm d irectly fro m th e c o n to u r in teg ral. Cauchy residue theorem. L e t / ( z ) b e a fu n c tio n o f th e c o m p lex v ariab le z an d C b e a clo sed p a th in th e z -p lan e. If th e d e riv a tiv e d f ( z ) / d z exists o n and inside th e c o n to u r C a n d if / ( z ) has no p o le s a t z = zo, th e n - L (f) J ! ± d z = |^ <Zl,)' 2njjcz-zo 10, (3.4.2) if zo is ou tsid e C M o re g en erally , if th e (k + l ) - o r d e r d e riv a tiv e o f / ( z) exists a n d / ( z ) h a s n o p o les a t z = zo, th e n 1 »-!>' 0, d k- ' f ( z ) C 04.3) if zo is o u ts id e C T h e v alu es o n th e rig h t-h a n d sid e o f (3.4.2) a n d (3.4.3) a re c a lle d th e re sid u e s of th e p o le a t z = zo- T h e re su lts in (3.4.2) a n d (3.4.3) a re tw o fo rm s o f th e Cauc hy residue t heorem. W e can ap p ly (3.4.2) a n d (3.4.3) to o b ta in th e v a lu e s o f m o re g en eral c o n to u r in teg rals. T o b e specific, su p p o s e th a t th e in te g ra n d o f th e c o n to u r in te g ra l is Sec. 3.4 Inversion of th e 2 - T ra n s fo rm 185 P(z) = f ( z ) / g ( z ) ~ w h e re f ( z ) h a s no p o les inside th e c o n to u r C an d g (z) is a p o ly n o m ial w ith d istin ct (sim p le) ro o ts c i, ^ 2 . ___-n inside C. T h e n (3.4.4) n 1=1 w h ere f(z) (3.4.5) A l (z) = ( z - z i ) P{ z ) = ( z - z l) -J - 1x g( z) T h e v alu es (A, (-;,)} a re re sid u e s o f th e c o rre sp o n d in g p o le s at z = / = 1, 2 , . . . . n. H e n c e th e v alu e o f th e c o n to u r in te g ra l is e q u a l to th e sum o f th e resid u es o f all th e p o le s in sid e th e c o n to u r C. W e o b se rv e th a t (3.4.4) w as o b ta in e d by p e rfo rm in g a p a rtia l-fra c tio n e x p a n ­ sion o f th e in te g ra n d an d ap p ly in g (3.4.2). W h en g(z) has m u ltip le -o rd e r ro o ts as w ell as sim p le ro o ts inside th e c o n to u r, th e p a rtia l-fra c tio n e x p a n sio n , w ith a p ­ p ro p ria te m o d ifica tio n s, an d (3.4.3) can b e used to e v a lu a te th e resid u es at th e c o rre sp o n d in g p o les. In th e case o f th e in v erse z -tra n sfo rm , w e h ave [resid u e of X (z )z n 1 a t z a ll p o l e s U t) in s id e (3.4.6) C p ro v id e d th a t th e p o les {z,} a re sim ple. If X (z )r "_1 has no p o le s inside th e c o n to u r C fo r o n e o r m o re v alu es o f n, th e n x (n) = 0 fo r th e s e values. T h e fo llo w in g ex am p le illu stra te s th e e v a lu a tio n o f th e in v erse z-tra n sfo rm by u se o f th e C a u ch y re sid u e th e o re m . Exam ple 3.4.1 Evaluate the inverse z-transform of X(z) = ---------- r 1 —az~ using the complex inversion integral. Solution kl > kil We have where C is a circle at radius greater than |a|. We shall evaluate this integral using (3.4.2) with f ( z ) = z". We distinguish two cases. 186 The ^-Transform and Its Application to the Analysis of LTI Systems Chap. 3 L If n > 0, f ( z ) has only zeros and hence no poles inside C. T he only pole inside C is z = a. Hence *(*) =• /(zo) = a n n > 0 2. If n < 0, / ( z ) = z" has an nth-order pole at z = 0, which is also inside C. Thus there are contributions from both poles. For n = - 1 we have x ( - l ) -= 1 S) 1 dz = 1 2 nj j c z ( z — a) z —a 1 + - = 0 If n = —2, we have 2) 2 n j § z H z - a ) dZ dz ( z - f l ) = 0 By continuing in the same way we can show that *(n) = 0 for n < 0. Thus x (n) = a"u(n) 3.4.2 The Inverse z-Transform by Power Series Expansion The basic idea in this m eth od is the follow ing: G iven a z-transform X ( z ) with its corresponding R O C , w e can expand X (z) into a p ow er series o f the form OO X(z) = c»z~n £ (3.4.7) co w hich con verges in the given R O C . T h en , by the u n iqu en ess o f the z-transform, x ( n ) = c„ for all n. W hen X ( z ) is rational, the exp an sion can b e perform ed by long division. T o illustrate this tech n iqu e, w e w ill invert som e z-transform s involving the sam e expression for X ( z ) , but different R O C . T his w ill also serve to em phasize again the im portance o f the R O C in d ealing with z-transform s. Exam ple 3A 2 D eterm ine the inverse z-transform of 1 —1.5z_1 + 0.5z “2 when (a) ROC: |z| > 1 (b) ROC: |z| < 0.5 Solution (a) Since the R O C is the exterior of a circle, we expect x(n) to be a causal signal. Thus we seek a power series expansion in negative powers of z. By dividing Sec. 3.4 187 Inversion of the z-Transform the num erator of X{z) by its denom inator, we obtain the power series A’UI = ! _ 3 _ -; + + = 1+ ^ + TE; "4 + " ' By com paring this relation with (3.1.1), we conclude that t Note that in each step of the long-division process, we eliminate the lowestpower term of c~*. (b) In this case the ROC is the interior of a circle. Consequently, the signal x(n) is anticausal. To obtain a power series expansion in positive powers of c. we perform the long division in the following way: 2: 2 + 6c3 + 14c4 + 30cs + 62c* + ■• ■ + ill 1 - 3: + 2c: 3c - 2z 2 3c - 9c: + 6c3 l z 2 - 6c3 7 r - 21 c3 + 14c4 15c3 - 14c4 15c3 - 45c4 + 30cs 31c4 - 30c5 Thus X (c) = 1_ , 1------:------= 2c: + 6c3 + 14c4 + 30c5 + 62cfi + ■• • In this case x(n) = 0 for n > 0. By comparing this result to (3.1.1), we conclude that Jt(n) = { 62. 30. 14.6,2, 0. 0} t We observe that in each step of the long-division process, the lowest-power term of c is eliminated. We emphasize that in the case of anticausal sig­ nals we simply carry out the long division by writing down the two poly­ nomials in “reverse” order (i.e., starting with the most negative term on the left). F ro m th is e x a m p le w e n o te th a t, in g e n eral, th e m e th o d o f long d ivision will n o t p ro v id e a n sw ers fo r x( n) w h en n is larg e b e c a u se th e lo n g division b eco m es ted io u s. A lth o u g h , th e m e th o d p ro v id es a d irect e v a lu a tio n o f x( n ) , a clo sed -fo rm so lu tio n is n o t p o ssib le , ex cep t if th e resu ltin g p a tte r n is sim p le e n o u g h to infer th e g e n e ra l te rm x ( n ) . H e n c e th is m e th o d is used only if o n e w ish e d to d e te rm in e th e v a lu e s o f th e first few sa m p le s o f th e signal. 188 The z-Transform and Its Application to the Analysis of LTI Systems Chap. 3 Example 3.4.3 Determ ine the inverse z-transform of X(z) = log(l + az_1) Solution |zj > |a| Using the power series expansion for log(l + x ) , with |jc| < 1, we have ^ ( - r v r " Thus n < 0 0, Expansion of irrational functions into power series can be obtained from tables. 3.4.3 The Inverse z-Transform by Partial-Fraction Expansion In th e tab le lo o k u p m e th o d , w e a tte m p t to e x p ress th e fu n c tio n X (z) as a linear c o m b in a tio n X ( z ) = a j X] (;) + 02 X 2 ( 1 ) + • - - + c/Kx fc(z) (3.4.8) w h ere X] ( ; ) , . . . . X k (z ) a re ex p ressio n s w ith in v erse tra n sfo rm s x \ ( n ) , . . . , x k W av ailab le in a ta b le o f z-tra n sfo rm p airs. If such a d e c o m p o s itio n is possible, th e n x( n) , th e in v erse z -tra n sfo rm o f X ( z ) , can easily b e fo u n d using th e lin earity p ro p e rty as x ( n) = at]Xi(n) + a 2x 2 (n) H--------\ - a Kx K (n) (3.4.9) T h is a p p ro a c h is p a rtic u la rly useful if X ( z ) is a ra tio n a l fu n ctio n , a s in (3.3.1). W ith ­ o u t loss o f g e n erality , w e assu m e th a t ao = 1, so th a t (3.3.1) can b e e x p ressed as _ t o D(z) _ b +b,r' + - + t„ r« l + f l i Z - 1 H----- + a u z ~ N N o te th a t if a 0 ^ 1. w e can o b ta in (3.4.10) fro m (3.3.1) by div id in g b o th n u m e ra to r an d d e n o m in a to r by aoA ra tio n a l fu n ctio n o f th e form (3.4.10) is called p r o p e r if a N ^ 0 an d M < N. F ro m (3.3.2) it fo llo w s th a t th is is e q u iv a le n t to saying th a t th e n u m b e r o f finite zero s is less th a n th e n u m b e r o f fin ite p o les. A n im p ro p e r ra tio n a l fu n ctio n ( M > N ) can alw ays b e w ritte n as th e sum of a p o ly n o m ial an d a p r o p e r ra tio n a l fu n ctio n . T h is p ro c e d u re is illu stra te d by the fo llow ing ex am p le. Example 3.4.4 Express the im proper rational transform l + 3 z - ' + n z - 2 + l 2-3 1 5 1 + 6Z + in terms of a polynomial and a proper function. Sec. 3.4 189 Inversion of the z-Transform Solution First, we note that we should reduce the num erator so that the term s ; -2 and c- *' are eliminated. Thus we should carry out the long division with these two polynomials written in reverse order. We stop the division when the order of the rem ainder becomes Then we obtain = 1 + 2: - i + ^ In g e n e ra l, an y im p ro p e r ra tio n a l fu n ctio n (M > N ) can b e e x p ressed as X ( ;) = W i = Co + C i:" 1 + ' ' ' + Cu~n Z ~im~N) + (3 A ll) T h e in v erse z -tra n s fo rm o f the p o ly n o m ial can easily b e fo u n d by in sp ectio n . W e fo cu s o u r a tte n tio n on th e inversion o f p r o p e r ra tio n a l tra n sfo rm s, since any im p ro p e r fu n c tio n can b e tra n sfo rm e d in to a p ro p e r fu n c tio n by using (3.4.11). W e carry o u t th e d e v e lo p m e n t in tw o steps. F irst, we p e rfo rm a p a rtia l fra c ­ tio n e x p a n sio n o f th e p r o p e r ra tio n a l fu n ctio n a n d th e n w e in v ert each o f th e term s. L e t A"(c) b e a p ro p e r ra tio n a l fu n ctio n , th a t is, * (.-) = — = - " - - ' " T ,1 +— +buZ^ D( z) 1 + ^ iC + • *• -t~ (3.4.12) w h ere aN ^ 0 M < N an d T o sim p lify o u r discu ssion w e e lim in ate n eg ativ e p o w ers of c by m ultip ly in g b o th th e n u m e r a to r a n d d e n o m in a to r of (3,4,12) by z N. T h is resu lts in L „N I L _ y v -l I I L „ N -M X{z) = CA 4- a \ z N w hich c o n ta in s only p o sitiv e p o w e rs o f (3.4.13, + ------(- <a/v Since N > M , th e fu n ctio n ,N -2 _i_____ l (3,4.14) ; : w + tiic w- 1 + - - - + flW is also alw ays p ro p e r. O u r ta sk in p e rfo rm in g a p a rtia l-fra c tio n ex p an sio n is to ex p ress (3.4.14) o r, e q u iv a le n tly , (3.4.12) as a sum o f sim ple fractio n s. F o r th is p u rp o se w e first fa c to r th e d e n o m in a to r p o ly n o m ial in (3.4.14) in to facto rs th a t c o n tain th e poles P i, p 2, . . . , p n o f X (z). W e d istinguish tw o cases. Distinct poles. S u p p o se th a t th e p o le s p \ , p 2 ........ p/v a re all d iffe re n t (dis­ tin ct). T h e n w e se e k an ex p an sio n of th e fo rm z z — p\ z — P2 + -. - + ( 3 . z — Pn 4 . 1 5 ) T h e p ro b le m is to d e te rm in e th e coefficients A i , A 2 , . - . , A s - T h e re a re tw o w ays to so lv e th is p ro b le m , as illu stra te d in th e follow ing exam p le. 190 The z-Transform and Its Application to the Analysis of LTI Systems Chap. 3 Example 3.4 .5 D eterm ine the partial-fraction expansion of the proper function (3'‘U 6 , Solution First we elim inate the negative powers, by multiplying both num erator and denom inator by z2. Thus .2 X i z ) = zV2 - 11.5z < +i 0n.5 The poles of X(z) are p\ = 1 and P2 = 0.5. Consequently, the expansion of the form (3.4,15) is X(z) z Cz —l)(z —0.5) A\ z 1 A2 z —0.5 (3.4.17) A very simple method to determ ine A[ and A 2 is to multiply the equation by the denom inator term (z - l)(z - 0.5). Thus we obtain z = ( z - 0 .5 M i + ( z - 1 ) A 2 (3.4.18) Now if we set z = p\ = 1 in (3.4.18), we eliminate the term involving A2. Hence 1 = (1 -0 .5 )A , Thus we obtain the result A i = 2. Next we return to (3.4.18) and set z = p 2 = 0.5, thus eliminating the term involving Ai, so we have 0.5 = ( 0 .5 - 1)A2 and hence Ai = —1. Therefore, the result of the partial-fraction expansion is X(z) 2 z- 1 1 z - 0.5 (3.4.19) T h e exam ple given ab ove suggests that w e can determ ine the coefficients A \, A i , . . . , Afj , by m ultiplying b oth sides o f (3.4.15) by each o f the term s (z - Pk). k = 1 , 2 , , . . , N , and evaluating the resulting exp ression s at the corresp on d ing pole p osition s, p \ , p i .........P n ■ T h u s w e have, in general, (Z- Pl)X(;) = (z-wM.i+ ... + /lt+,..+ fa-P»)^ z z - PI (3420) z - Pn C onsequently, w ith z = Pk, (3.4.20) yield s the Jtth coefficient as Ak = ( z ~ ^ )X (; )i z k = 1, 2. . N (3.4.21) \z-pl Exam ple 3.4.6 Determ ine the partial-fraction expansion of 1 17- ^ 0 .5 ,- ,3A22) Sec. 3.4 191 inversion of the z-Transform Solution To eliminate negative powers o f ; in (3.4.22), we multiply both num erator and denom inator by Thus X(z) z+ 1 The poles of X(z) are complex conjugates Px = \ + J i Pi = \ ~ j \ z2 - ; + 0.5 and Since p\ ^ p 2- we seek an expansion of the form (3.4.15). Thus * (:) ; + l A] Ai z (z-p i)(:-p 2) z-P\ z-pi To obtain A , and A2, we use the formula (3,4.21), Thus we obtain (z-pi)X(z) At = ----------- ; + 1 I - P ( z - p 2)X(z) A- = ------------ 2 \ ^ P1 Pi ! 1 ; + l - ?+ 3+ J5-5+./5 1 :=P2 T h e ex p a n sio n (3,4.15) a n d the fo rm u la (3.4.21) h o ld fo r b o th real a n d c o m ­ p lex p o les. T h e o n ly c o n s tra in t is th a t all p o les be d istin ct. W e also n o te th at A; = A*. It can b e easily seen th a t th is is a c o n s e q u e n c e o f th e fact th a t p 2 = p ' . In o th e r w o rd s, comp l ex- conj ugat e pol es result in c o mpl ex- con j ugat e coefficients in the part ial-fraction expansi on. T h is sim ple resu lt will p ro v e v ery u se fu l la te r in o u r d iscu ssio n . M u ltip le - o rd e r p o l e s . If X U) h a s a p o le o f m u ltip lic ity /, th a t is, it co n ta in s in its d e n o m in a to r th e fa c to r (z - pk)1, th e n th e e x p a n s io n (3.4.15) is n o lo n g er tru e. In th is case a d iffe re n t ex p an sio n is n e e d e d . F irst, w e in v e stig a te th e case of a d o u b le p o le (i.e., 1 = 2). Exam ple 3.4.7 D eterm ine the partial-fraction expansion of Solution First, we express (3.4,23) in terms of positive powers of in the form * ( ;) = z2 : (z + 1)(; - l ) 2 X (z) has a simple pole at p\ = - 1 and a double pole pi = p$ = 1. In such a case the appropriate partial-fraction expansion is ™ = ______ t ______ = + z (z + l)(z - 1)2 z+ 1 z - l (z -1 )2 The problem is to determ ine the coefficients A 1, A2, and A3. (3424) 192 The z-Transform and Its Application to the Analysis of LTI Systems Chap. 3 We proceed as in the case of distinct poles. T o determ ine Aj, we multiply both sides of (3.4.24) by (z + 1) and evaluate the result at z = - 1 . Thus (3.4.24) becomes (z + l)X (z) z+ 1 z+ 1 z z-1 ( z - 1)2 ------------------ = Ai + ------ - A 2 + ------- r - z A i which, when evaluated at z = - 1 , yields 1 4 (z + 1)X(z) A i = ------------------ z Next, if we multiply both sides of (3.4.24) by (z - l ) 2, we obtain = Z + + <3.4.25, z+ 1 Now, if we evaluate (3.4.25) at z = 1, we obtain A 3. Thus (z — l) 2X(z) I = 1 * Li 2 The remaining coefficient Az can be obtained by differentiating both sides of (3.4.25) with respect to z and evaluating the result at z = 1. Note that it is not necessary formally to carry out the differentiation of the right-hand side of (3.4.25), since all term s except A2 vanish when we set z = 1. Thus d A2 = — dz (z — l ) 2X(z) T h e gen eralization o f the p rocedure in the exam p le ab ove to the case o f an /th-order p ole ( z — p k)! is straightforward. T h e partial-fraction expansion must contain the terms Mk ■Alt Z - Pk ( z - Pk)2 (z - Pk)1 T h e coefficients {A,*} can b e evalu ated through d ifferen tiation as illustrated in E xam p le 3.4.7 for / = 2. N ow that w e have perform ed the partial-fraction exp an sion , w e are ready to take the final step in the inversion o f X (z). First, let us con sid er th e case in which X ( z ) contains distinct poles. F rom the partial-fraction exp an sion (3.4.15), it easily follow s that X ( z ) — A \ -------------r + A i -------------- + ■■•-)- A n --------------1 - P\Z~1 1 - PlZ (3.4.27) 1 - P n Z~ 1 T he inverse z-transform , x ( n ) = Z ~ i { X( z ) ) , can b e ob tain ed by inverting each term in (3.4.27) and taking the corresponding linear com b ination . From T ab le 3.3 it fo llo w s that these term s can be inverted using th e form ula ( p k)nu{n), - ( P k ) nu ( - n - 1), if RO C : |*| > Ip*J (causal signals) if RO C: |z| < \P k \ (anticausal sign als) „ Sec. 3.4 Inversion of the ^-Transform 193 If th e signal jc(n) is cau sal, the R O C is |r | > p max- w h e re p max = m ax{|/>i|, \p2\.........IpnII- In th is case all te rm s in (3.4.27) re su lt in causal signal c o m p o n e n ts an d th e signal x ( n ) is given by jr(/i) = (A i + A -Pz --------f" A Np nN )u(n) (3.4.29) If all p o le s a re real. (3.4.29) is th e d e sire d e x p ressio n fo r th e signal j («). T h u s a causal sig n al, h av in g a ; -tra n s fo rm th a t co n tain s real a n d d istin ct p o les, is a linear c o m b in a tio n o f re a l e x p o n e n tia l signals. S u p p o se n o w th a t all p o les a re d istin ct b u t som e o f th e m a re co m p lex . In this case so m e o f th e te rm s in (3.4.27) re su lt in com plex e x p o n e n tia l c o m p o n en ts. H o w e v e r, if th e signal x ( n) is real, w e sh o u ld b e ab le to re d u c e th e se te rm s in to real c o m p o n e n ts. If x ( n ) is real, th e p o ly n o m ials a p p e a rin g in X (z) have real co ­ efficients. In th is case, as w e h av e seen in S ectio n 3.3, if pj is a p o le , its com plex c o n ju g a te p j is also a p o le. A s w as d e m o n s tra te d in E x am p le 3.4.6, th e c o rre s p o n d ­ ing coefficien ts in th e p a rtia l-fra c tio n e x p an sio n a re also co m p lex co n ju g ates. T h u s th e c o n trib u tio n o f tw o c o m p lex -co n ju g ate p o les is of th e form x k (n) = \ A k {pt )n + A H p l )"]«(«) (3.4.30) T h e se tw o te rm s can be c o m b in ed to form a real signal c o m p o n e n t. F irst, we ex p re ss Aj an d Pj in p o la r form (i.e., a m p litu d e an d p h a se ) as A* = \ Ak \eja' (3.4.31) Pi: = (3.4.32) w h ere a k an d fik a re th e p h a s e c o m p o n e n ts o f A k a n d p k. S u b stitu tio n o f th ese re la tio n s in to (3.4.30) gives x k{n) = IAi ’ + e - -'(A"+“‘ l]u(n) or, eq u iv alen tly , x k(n) = 2|A *|r" c o s($ tn + a k)u(n) (3.4.33) T h u s w e co n clu d e th a t Z - 1 ( - — — — r + -— ~ — r ) = 2 \ A k \rR k c o s ( f tn + a k) u(n) \i - p kz ~ l i - p;z~ v (3.4.34) if th e R O C is |zj > \ pk \ = rk . F ro m (3.4.34) we o b se rv e th a t ea c h p a ir o f c o m p le x -c o n ju g a te p o le s in th e z -d o m ain resu lts in a causal sin u so id al signal c o m p o n e n t w ith an e x p o n e n tia l e n ­ v elo p e. T h e d ista n c e rk o f th e p o le fro m th e o rig in d e te rm in e s th e e x p o n e n tia l w eig h tin g (g ro w in g if r k > 1, d ecay in g if r k < 1, c o n s ta n t if rk = 1). T h e angle of th e p o le s w ith re sp e c t to th e p o sitiv e re a l axis p ro v id e s th e fre q u e n c y o f th e sin u ­ so id a l signal. T h e zero s, o r e q u iv alen tly th e n u m e ra to r o f th e ra tio n a l tran sfo rm , affect o n ly in d ire c tly th e a m p litu d e an d th e p h a se o f x k (n) th ro u g h A k. In th e case o f mul t i pl e p o les, e ith e r re a l o r co m p lex , th e in v erse tra n sfo rm o f te rm s o f th e fo rm A j ( z — p k)n is re q u ire d . In th e case o f a d o u b le p o le the 194 The 2 -Transform and Its Application to the Analysis of LTI Systems Chap. 3 fo llow ing tra n sfo rm p a ir (see T a b le 3.3) is q u ite useful: pz~x (1 - p z ] )2 = n p nu( n) (3.4.35) p ro v id e d th a t th e R O C is |z| > \p\. T h e g e n e ra liz a tio n to th e case o f p o le s w ith h ig h e r m u ltip licity is left as an exercise fo r th e re a d e r. Example 3.4.8 Determ ine the inverse z-transform of X U) = 1 1 - 1 .5 ;-' +0.5z~ 2 (a) RO C III > 1 (b) RO C Izl < 0.5 (c) RO C 0.5 < |z| < 1 Solution This is the same problem that we treated in Exam ple 3.4.2. The partialfraction expansion for X(z) was determined in Example 3.4.5. The partial-fraction expansion of X(z) yields = <3-4-36> To invert X(z) we should apply (3.4,28) for pi — 1 and p 2 = 0.5. However, this requires the specification of the corresponding ROC. (a) In case when the R O C is |z| > 1, the signal x(n) is causal and both term s in (3.4.36) are causal terms. According to (3.4.28), we obtain x(n) = 2 (l)n«(n) —(0.5)"u(n) = (2 — 0.5 ”)u(n) (3.4.37) which agrees with the result in Example 3.4.2(a). (b) When the R O C is |z| < 0.5, the signal x(n) is anticausal. Thus both term s in (3.4.36) result in anticausal components. From (3.4.28) we obtain x(n) = [—2 + (0.5)'I]u(—n — 1) (3.4.38) (c) In this case the ROC 0.5 < |z| < 1 is a ring, which implies that the signal x(n) is two-sided. Thus one of the term s corresponds to a causal signal and the other to an anticausal signal. Obviously, the given ROC is the overlapping of the regions (z| > 0.5 and |z| < 1. Hence the pole p 2 = 0.5 provides the causal part and the pole p\ = 1 the anticausal. Thus x(n) = -2 (1 ) "u( - n - 1) - (0.5)"«(n) Example 3.4.9 D eterm ine the causal signal jc(n) whose z-transform is given by (3.4.39) Sec, 3.4 Inversion of the z-Transtorm Solution 195 In Exam ple 3.4.6 we have obtained the partial-fraction expansion as where A, = Al = j - j and Pi = p ’ = i Since we have a pair of complex-conjugate poles, we should use (3.4.34). The polar forms of Aj and p, are Hence Example 3.4.10 D eterm ine the causal signal x(n) having the ;-transiorm X(z) = Solution (1 + ; - ’)(] From Example 3.4.7 we have X(Z) 3 + + T 41 41 .-1 + 2 ( 1 - ; - 1)2 By applying the inverse transform relations in (3.4.28) and (3.4.35), we obtain 1 3 1 f 1 x( n ) = - ( —l)"«(n) + t« (« ) + - n u ( n ) = t(-1) 4 4 2 4 3 w*l + - + u(n) 4 2 3.4.4 Decomposition of Rational z-Transforms A t th is p o in t it is a p p ro p ria te to discuss som e a d d itio n a l issues c o n c e rn in g th e d e c o m p o s itio n o f ra tio n a l z-tran sfo rm s, w hich will p ro v e v ery u se fu l in th e im p le­ m e n ta tio n o f d isc re te -tim e system s. S u p p o se th a t w e h ave a ra tio n a l z-tran sfo rm X ( z ) e x p re ss e d as X( z) = (3.4.40) 196 The z-T ransform and Its Application to the Analysis of LTI Systems Chap. 3 w h ere, fo r sim plicity, w e h av e a ssu m ed th a t ao = 1. If M > N [i.e., X ( z ) is im p ro p e r], w e c o n v e rt X (z) to a sum o f a p o ly n o m ial a n d a p r o p e r fu n c tio n M-H X ( z ) = J 2 c t z ~ k + X pA z ) k=o (3.4.41) If th e p o le s o f X pr( z ) are d istin ct, it can b e e x p a n d e d in p a rtia l fra c tio n s as pT(z) = A \ - ------------- + A 2 ------------- r + --- + ^ jv -------------- r l-p \z~ l l ~ P 2Z~l 1 - PnZ~1 (3.4.42) A s w e h av e a lre a d y o b se rv e d , th e re m ay b e so m e c o m p le x -c o n ju g a te p airs of p o le s in (3.4.42). S in ce we u su a lly d eal w ith real signals, w e sh o u ld av o id com plex co efficien ts in o u r d eco m p o sitio n . T h is can b e ach iev ed by g ro u p in g a n d co m b in in g te rm s co n ta in in g co m p lex -co n ju g ate p o les, in th e follow ing w ay: A — A p * z ~ l + A* - A * p z ~ l 1 - pz~] 1 - p z 1 - p*z ~' + PP*z ~2 1 — /5*z-1 (3.4.43) bo + b -iZ ~ l _ 1 + a i z ~ l + 02 z ~2 w h ere £>o = 2 R e ( A ) , a \ = —2 R e ( p ) b\ = - 2 Re (Ap*), a 2 = \ p \2 (3.4.44) a re th e d e sire d co efficients. O b v io u sly , a n y ra tio n a l tra n sfo rm o f th e fo rm (3.4.43) w ith co efficien ts given by (3.4.44), w hich is th e case w h en a 2 — 4 a 2 < 0, can be in v e rte d using (3.4.34). B y c o m b in in g (3.4.41), (3.4.42), a n d (3.4.43) w e o b ta in a p a rtia l-fra c tio n e x p a n sio n fo r th e z -tra n s fo rm w ith distinct p o les th a t co n ta in s real coefficients. T h e g e n e ra l re su lt is M—N Xiz) = K\ 1 ££ 3 C Z - * + E 1. 1 l. —1 + Et l l +, a/ u z 1f'l+ a u Z - 22 <3 A 4 S > w h ere K\ + 2 AS = N . O b v io u sly , if Af = TV, th e first te rm is ju s t a c o n stan t, a n d w h e n M < N , th is te rm v an ish es. W h e n th e r e a re also m u ltip le p oles, som e a d d itio n a l h ig h e r-o rd e r te rm s sh o u ld b e in clu d ed in (3.4.45). A n a lte rn a tiv e fo rm is o b ta in e d by ex p ressin g X ( z ) as a p r o d u c t o f sim ple te rm s as in (3.4.40). H o w e v e r, th e co m p le x -c o n ju g a te p o le s a n d z e ro s sh o u ld be co m b in e d to av o id co m p lex co efficien ts in th e d e c o m p o sitio n . S u ch c o m b in atio n s re su lt in se c o n d -o rd e r ra tio n a l te rm s o f th e follow ing form : (1 - Z*Z-1 )(1 - z*kz ~ ' ) 1 + b\kZ~l + b u z ~2 (1 - />*z- 1 ) ( l - p*kz ~ l ) 1 -I- a u z -1 + a u z ~2 (3.4.46) w h ere b\ k = - 2 R t ( z k ) , flu = —2 R e (p * ) b u = jz i l , 02* = \Pk\ (3.4.47) Sec. 3.5 The One-sided 2 -Transform 197 A ssu m in g fo r sim p licity th a t M = N, w e se e th a t X (z) can be d e c o m p o s e d in the follow ing way: 1 + a kz 1 1 + a u z 1+ axz 2 <3 -4 -48> w h ere N = K\ + 2 / ^ * W e will r e tu rn to th e s e im p o rta n t fo rm s in C h a p te rs 7 a n d 8. 3.5 THE ONE-SIDED Z-TRANSFORM T h e tw o -sid ed z -tra n sfo rm re q u ire s th a t th e c o rre sp o n d in g signals be specified fo r th e e n tire tim e ran g e —oo < n < oo. T his re q u ire m e n t p re v e n ts its u se for a v ery u se fu l fam ily o f p ra c tic a l p ro b lem s, n am ely th e e v a lu a tio n o f th e o u tp u t o f n o n re la x e d system s. A s we recall, th e s e system s a re d e sc rib e d by d ifferen ce e q u a tio n s w ith n o n z e ro initial c o n d itio n s. Since th e in p u t is a p p lie d a t a finite tim e, say n ()l b o th in p u t a n d o u tp u t signals are specified fo r n > no, b u t by no m e a n s a re z e ro fo r n < no- T h u s th e tw o -sid ed z-tran sfo rm c a n n o t b e used. In this se c tio n w e d e v e lo p th e o n e -sid e d z-tra n sfo rm w hich can be u se d to solve differen ce e q u a tio n s w ith in itial c o n d itio n s. 3.5.1 Definition and Properties T h e one- si ded o r unilateral z -tra n sfo rm o f a signal x ( n ) is d efin ed by CC * + (;) n=0 W e also u se th e n o ta tio n s Z +{x(n)} a n d *{n ) X + (z) T h e o n e -sid e d z -tra n sfo rm d iffers fro m th e tw o -sid ed tra n sfo rm in th e low er lim it o f th e su m m a tio n , w hich is aiw ays z e ro , w h e th e r or n o t th e signal x ( n ) is zero fo r n < 0 (i.e., cau sal). D u e to th is choice o f lo w er lim it, th e o n e -sid e d z-tran sfo rm h as th e fo llow ing ch aracteristics: 1. It d o e s n o t c o n ta in in fo rm a tio n a b o u t th e signal jc(n) fo r n e g a tiv e v alu es o f tim e (i.e., fo r n < 0). 2. It is un i q u e o n ly fo r ca u sa l signals, becau se only th ese signals a re z e ro for n < 0. 3. T h e o n e -sid e d z -tra n s fo rm A,+(z) o f x( n ) is id en tical to th e tw o -sid ed ztra n s fo rm o f th e signal x( n) u( n) . S ince x ( n ) u ( n ) is causal, th e R O C o f its tra n sfo rm , a n d h en c e th e R O C of X + {z), is alw ays th e e x te rio r o f a circle. T h u s w h en w e d e a l w ith o n e-sid ed z-tran sfo rm s, it is n o t n ecessa ry to re fe r to th e ir R O C . 198 The /-T ran sform and Its Application to the Analysis of LTI Systems Chap. 3 Example 3.5.1 Determ ine the one-sided z-transform of the signals in Exam ple 3.1.1. Solution From the definition (3.5.1), we obtain x,(n) = {1, 2 ,5 ,7 ,0 ,1 } t X f ( z ) = 1 + 2 ; ' 1 + 5z~2 + 7z~3 + ;~ 5 x 2 (n) = {1.2, 5, 7, 0,1} t Jt:+ (z) = 5 + 7z ~l + z ~3 x 3(n) = (0 ,0 ,1 ,2 , 5,7, 0,1} t xA(n) = {2,4, 5, 7 ,0 ,1 ) t X^(z ) = z ~2 + 2z"3 + 5z~4 + l z ' s + z~7 X4+ (z) = 5 + 7 ; ' 1 + z’ 3 x 5(n) ~ S(n) -*-1- *• X+(z) = 1 x6(n) = 6(n - A), k > 0 -e—*• *700 = <S(k -I- k), k > 0 (z) = z~k Xy (z) = 0 Note that for a noncausal signal, the one-sided z-transform is not unique. Indeed, X 2 (z) = X^(z) but X2 (n) ^ x 4(n). Also for anticausal signals, (z) is always zero. A lm ost all properties we have studied for the tw o-sid ed z-transform carry o ver to the on e-sid ed z-transform with the excep tion of the shi ft i ng property. Shifting Property C a se 1: T im e D e la y If x(n) « X +(z) then k X (n - k ) X * z~*[Ar+(z) + ] [ ] j c ( - n ) z n] k> 0 (3.5.2) n=l In case jc(n) is causal, then x{n ~ k ) « z~k X +(z) (3.5.3) Proof. F rom the definition (3.5.1) w e have Z +{x(n - k)} = z~ f S ( 0 z - ' + Y t x( l ) z -k By changing the in d ex from / to n = — t he result in (3.5.2) is easily obtained. Sec. 3.5 199 The One-sided z-Transform Example 3.5.2 Determ ine the one-sided ^-transform of the signals (a) x( n ) = a nu(n) (b) Ai(n) = xin — 2) where x( n) = a " Solution (a) From (3.5.1) we easily obtain (b) We will apply the shifting property for k = 2. Indeed, we have Z +{ x ( n ~ 2)1 = ; " 2[X + ( ; ) + j : ( - 1 ) ; + j : ( - 2 ) - 2] = r 2^ + (:) + J T ( - l) ;- 1 + * ( -2 ) Since x( —1) = a ~ '. x ( —2) = a~2. we obtain ^ 1 - az ~l + <T2 T h e m e a n in g o f th e shifting p ro p e rty can be in tuitively ex p la in e d if w e w rite (3.5.2) as follow s: Z +[x (?i — &)} = [jc (—k) x ( —£ + 1 ); ' + + 1 ); *+* ] (3.5.4) + :.~kX +(.z) k> 0 T o o b ta in x { n - k ) ( k > 0) fro m ;t(r?), w e sh o u ld shift x ( n ) by k sa m p le s to th e right. T h e n k “ n e w ” sa m p le s, x ( - k ) , x { —k + 1), — * ( - 1 ) , e n te r th e p o sitiv e tim e axis w ith x ( —k) lo c a te d at tim e zero . T h e first te rm in (3.5.4) sta n d s fo r th e z-tran sfo rm o f th e s e sam p les. T h e “o ld ” sa m p les o f x( n — k) a re th e sa m e as th o se o f .r(n) sim ply sh ifted by k sa m p le s to th e right. T h e ir z-tra n sfo rm is o b v io u sly z _i’X + (z), w hich is th e se co n d te rm in (3.5.4). Case 2: Time advance If xin) X +(z) th e n X+( z ) - Y x ( n ) z - n k > 0 x ( n + k) «— ►z (3.5.5) Proof . F ro m (3.5.1) we h ave oc Z +[x(n + *)} = oc + k)z~n = zk Y m z ~ l n=0 l= k w h e re w e h a v e c h a n g e d th e in d ex o f su m m atio n fro m n t o 1 = n + k. N o w , from 200 The z-Transform and Its Application to the Analysis of LTI Systems Chap. 3 (3.5.1) w e o b ta in * + (z) = j r * ( / ) : “ ' = Y x { l ) z ~l + /=o i=0 i=t By co m b in in g th e last tw o re la tio n s, w e easily o b ta in (3.5.5). Exam ple 3.5.3 With x(n), as given in Example 3.5.2, determ ine the one-sided ^-transform of the signal xi (n) = x(n + 2 ) Solution obtain We will apply the shifting theorem for k = 2. From (3.5.5), with k = 2, we Z +{x(n + 2)| = -2X+(z) - x (0 );2 - *(1); But jc(0) = 1, jc(1) = a. and X + (z) = 1/(1 - a ; -1). Thus ,2 Z +{x(n + 2)) = -— ----- - - z 2 - az 1 —az~ T h e case o f a tim e ad v an ce can be in tu itiv e ly e x p la in e d as follow s. T o o b tain x( n- i - k) , k > 0, we sh o u ld shift jc (n) by k sa m p le s to th e left. A s a re su lt, th e sam ples * (0 ). * ( 1 ) , ___x ( k — 1) “ le a v e ” th e p o sitiv e tim e axis. T h u s w e first re m o v e th e ir co n trib u tio n to th e X +(z), an d th e n m u ltip ly w h at re m a in s by z k to co m p e n sa te fo r th e shifting o f th e signal by k sam p les. T h e im p o rta n c e o f th e shifting p ro p e rty lies in its a p p lic a tio n to th e so lu tio n of d ifferen ce e q u a tio n s w ith c o n s ta n t co efficien ts a n d n o n z e ro in itial co n d itio n s. T h is m a k e s th e o n e-sid ed z -tra n sfo rm a v ery useful to o l fo r th e an aly sis o f recu rsiv e lin e a r tim e -in v a ria n t d isc re te -tim e system s. A n im p o rta n t th e o re m useful in th e analysis o f signals a n d system s is th e final v alu e th e o re m . F in al V a lu e T h e o re m . If x{n) X +{z) th e n lim x( n ) = lim (z - l ) X + (z) n-» 00 7-»l (3.5.6) T h e lim it in (3.5.6) exists if th e R O C o f (z - l)A '+ (z) in clu d es th e u n it circle. T h e p ro o f o f th is th e o re m is left as an ex ercise fo r th e re a d e r. T h is th e o re m is u sefu l w h en w e a re in te re s te d in th e a s y m p to tic b e h a v io r of a signal x( n) a n d w e k n o w its z -tra n sfo rm , b u t n o t th e signal itself. In such cases, esp ecially if it is co m p licated to in v e rt X + (z), w e can u se th e final v alue th e o re m to d e te rm in e th e lim it o f x{n) as n goes to infinity. Sec. 3.5 201 The One-sided z-Transform Example 3.5.4 The impulse response of a relaxed linear time-invariant system is k(n) = a"u(n), |« | < 1. D eterm ine the value of the step response of the system as n —►oo. Solution The step response of the system is y{n) = h(n) * x(n) where Jt(n) = u(n) Obviously, if we excite a causal system with a causal input the output will be causal. Since h(n), x(n), v(n) are causal signals, the one-sided and two-sided z-transforms are identical. From the convolution property (3.2.17) we know that the z-transforms of h(n) and *(n) must be multiplied to yield the z-transform of the output. Thus = . ■— , . - , = 7----- tt? ------- r 1 - az 1 1 - z 1 (z - l ) ( z - cr) ROC: |z| > |ar| Now (z - l)y (z) - Z —a ROC: |z| > |a| Since |a | < 1 the R O C of (z - l)K(z) includes the unit circle. Consequently, we can apply (3.5.6) and obtain lim v(n) = lim —-— = ——— n—oc' 1 —a 3.5.2 Solution of Difference Equations T he on e-sid ed z-transform is a very efficient tool for the solu tion of d ifference eq u a tio n s w ith n on zero initial conditions. It ach ieves that by reducing the dif­ feren ce eq u ation relating the tw o tim e-d om ain signals to an eq u ivalen t algebraic eq u ation relating their on e-sid ed z-transform s. T h is eq u ation can b e easily solved to obtain the transform o f the desired signal. T he signal in the tim e dom ain is o b ta in ed by inverting the resulting z-transform . W e will illustrate this approach with tw o exam ples. Exam ple 3-5.5 The well-known Fibonacci sequence of integer num bers is obtained by computing each term as the sum of the two previous ones. The first few terms of the sequence are 1 ,1 ,2 , 3,5. 8 ,... D eterm ine a closed-form expression for the n th term of the Fibonacci sequence. Solution Let y(n) be the nth term of the Fibonacci sequence. Clearly, y(n) satisfies the difference equation y (n ) = y(n - 1) + y(n - 2) (3.5.7) 202 The z -Transform and Its Application to the Analysis of LTI System s Chap. 3 with initial conditions v(0) = v(—11 + v(—2) = 1 (3.5.8a) y (l) = y(0) + V(-1) = 1 (3.5.8b) From (3.5.8b) we have y (—1) = 0. Then (3.5.8a) gives v(—2) = 1. Thus we have to determ ine y(n), n > 0, which satisfies (3.5.7), with initial conditions y (—1) = 0 and y(—2) = 1. By taking the one-sided ^-transform of (3.5.7) and using the shifting property (3.5.2). we obtain y+(z) = [ ; - 'y +(-) + y (—1) ] + [z ~2Y ^ ( z ) + y (-2 ) + . v ( - l ) ; - 1] or 1 K + (c) = " (3.5.9) where we have used the fact that y{ —1) = 0 and v(—2) = 1. We can invert K+(;) by the partial-fraction expansion m ethod. The poles of y'+(;) are 1 -I- V5 P2 = Pi - l-V s and the corresponding coefficients are A i = p i/V 5 and A 2 = -/> ;/V 5 . Therefore, v(n) = 'l + V5 / 1 + v'S \ " 1 - V5 / I - n / 5 \ ’" 2V5 u(rt) 2 ^5 or, equivalently. u{n) (3.5.10) Example 3.5.6 Determ ine the step response of the system v(n) = ay(n — 1) + x(rt) — 1< a < 1 (3.5.11) when the initial condition is y (—1) = 1. Solution By taking the one-sided ^-transform of both sides of (3.5.11), we obtain K+(;) = a [ ;- 'y * (c ) + v (- D ] + X +(z) Upon substitution for v ( - l ) and X+(;) and solving for y + (;). we obtain the result Y+(z) = 1 —a ; -1 1 (1 —a ; - l )(l - ; _l) (3.5.12) By performing a partial-fraction expansion and inverse transform ing the result, we have y(n) = a" ,u(n) + —;-------1 —or"+I u(n) 1 —a ( l - a " +2) u ( n ) 1 —a ( 3 .5 . 13) Sec. 3.6 Analysis of Linear Tim e-Invariant Systems in the z-D om ain 203 3.6 ANALYSIS OF LINEAR TIME-INVARIANT SYSTEMS IN THE Z-DOMAIN In S e ctio n 3.4.3 w e in tro d u c e d th e sy stem fu n ctio n o f a lin e a r tim e -in v a ria n t sys­ tem a n d re la te d it to th e u n it sa m p le re sp o n se a n d to th e d iffe re n c e e q u a tio n d e sc rip tio n o f sy stem s. In th is sectio n w e d escrib e th e use o f th e sy stem fu n c­ tio n in th e d e te rm in a tio n o f th e re sp o n s e of th e system to so m e ex c ita tio n signal. F u rth e rm o re , w e e x te n d th is m e th o d o f a nalysis to n o n re la x e d sy stem s. O u r a tte n ­ tio n is fo c u se d o n th e im p o rta n t class o f p o le - z e r o sy stem s r e p re s e n te d by lin e a r c o n s tan t-co efficien t d iffe re n c e e q u a tio n s w ith a rb itra ry in itial co n d itio n s. W e also c o n s id e r th e to p ic o f sta b ility o f lin e a r tim e -in v a ria n t sy stem s an d d esc rib e a test fo r d e te rm in in g th e sta b ility o f a sy stem b a s e d o n th e co efficien ts o f th e d e n o m in a to r p o ly n o m ial in th e system fu n c tio n . F in ally , w e p ro v id e a d e ta ile d an aly sis o f se c o n d -o rd e r system s, w hich fo rm th e b asic b u ild in g b lo ck s in th e re a liz a tio n o f h ig h e r-o rd e r system s. 3.6.1 Response of Systems with Rational System Functions L e t us c o n s id e r a p o le - z e r o system d e s c rib e d by th e g e n e ra l lin e a r c o n s ta n tc o efficien t d iffe re n c e e q u a tio n in (3.3.7) a n d th e c o rre sp o n d in g system fu n ctio n in (3.3.8). W e r e p re s e n t H ( z ) as a ra tio o f tw o p o ly n o m ials B ( z ) / A ( z ) , w h ere B (z) is th e n u m e r a to r p o ly n o m ia l th a t c o n ta in s th e z e ro s o f H( z ) , a n d A ( z ) is the d e n o m in a to r p o ly n o m ia l th a t d e te rm in e s th e p o le s o f H ( z ) . F u rth e rm o r e , let us a ssu m e th a t th e in p u t signal x ( n ) h as a ra tio n a l z -tra n sfo rm X (z) o f th e fo rm X(z) = — Q( z) (3.6.1) T h is a s su m p tio n is n o t o v erly restrictiv e, since, as in d ic a te d p rev io u sly , m o st signals o f p ra c tic a l in te re s t h av e ra tio n a l z -tran sfo rm s. If th e sy stem is in itially re lax ed , th a t is, th e in itia l c o n d itio n s fo r th e d iffe re n c e e q u a tio n are z e ro , y ( —1) = y ( —2) = • ■■ = y ( —N ) = 0, th e z -tra n s fo rm o f th e o u tp u t o f th e sy stem h a s th e fo rm Y(z) = H ( z ) X ( z ) = Mz)Q(z) (3.6.2) N o w su p p o s e th a t th e sy stem c o n ta in s sim ple p o le s p \ , p j .........p s a n d th e ztra n sfo rm o f th e in p u t signal co n ta in s p o le s <71, qt, ■■■, q u w h e re p t ^ qm fo r all it = 1, 2 a n d m = 1, 2 , . . . , L. In a d d itio n , w e a ssu m e th a t th e z e ro s o f th e n u m e r a to r p o ly n o m ia ls B( z ) a n d N ( z ) d o n o t co in cid e w ith th e p o les {p t } an d {<7i}, so th a t th e re is n o p o le - z e r o c a n c e lla tio n . T h e n a p a rtia l-fra c tio n ex p an sio n o f K(z) yield s t o 1 - PkZ 1 *-* 1 - qkZ 1 204 The z-Transform and Its Application to the Analysis of LTI Systems Chap. 3 T h e in v erse tra n sfo rm o f ^ (z ) y ield s th e o u tp u t signal fro m th e sy stem in th e form N L y (n ) = Y A t ( P k ) n u ( n ) + 5 2 £2*0?*)'1n (n) *=i *-i (3.6.4) W e o b se rv e th a t th e o u tp u t se q u e n c e y( n) can b e su b d iv id e d in to tw o p a rts. T he first p a r t is a fu n ctio n o f th e p o les {pt} o f th e system an d is called th e natural response o f th e sy stem . T h e in flu e n ce o f th e in p u t signal o n th is p a r t o f th e re sp o n s e is th ro u g h th e scale facto rs {A*}. T h e se c o n d p a r t o f th e re sp o n se is a fu n ctio n o f th e p o le s {qk} o f th e in p u t signal an d is called th e f o r c e d response of th e sy stem . T h e in flu e n ce o f th e sy stem o n th is re sp o n s e is e x e rte d th ro u g h th e scale facto rs { Qk } W e sh o u ld e m p h asize th a t th e scale fa c to rs {A*} an d { Q k } a re fu n ctio n s o f b o th se ts o f p o le s {pk } a n d { ^ ) . F o r e x am p le, if AXz) = 0 so th a t th e in p u t is zero , th e n K(z) = 0, a n d c o n s e q u e n tly , th e o u tp u t is z e ro . C lea rly , th e n , th e n a tu r a l re sp o n se o f th e sy stem is zero . T h is im p lies th a t th e n a tu ra l re sp o n se of th e sy stem is d iffe re n t fro m th e z e ro -in p u t re sp o n se . W h en X (z) a n d H ( z ) h av e o n e o r m o re p o les in c o m m o n o r w h e n X (z) a n d /o r H{ z ) c o n ta in m u ltip le -o rd e r p o les, th e n K(z) will h av e m u ltip le -o rd e r poles. C o n se q u e n tly , th e p a rtia l-fra c tio n ex p a n sio n o f Y( z ) will c o n ta in fa c to rs o f th e form 1/(1 - p / z ~ l )t , k = 1, 2 , . . . , m, w h ere m is th e p o le o rd e r. T h e in v ersio n o f th ese facto rs will p ro d u c e te rm s o f th e fo rm n k~ xp* in th e o u tp u t y( n ) o f th e system , as in d ic a te d in S ectio n 3.4.2. 3.6.2 Response of Pole-Zero Systems with Nonzero Initial Conditions S u p p o se th a t th e sig n al x ( n ) is a p p lie d to th e p o le - z e r o sy stem at n = 0. T hus th e sign al x ( n ) is a ssu m ed to be cau sal. T h e effe cts o f all p re v io u s in p u t signals to th e system a re reflec te d in th e in itial c o n d itio n s y ( —1), y ( ~ 2 ) .........y ( —N ) . Since th e in p u t x ( n ) is ca u sa l a n d since w e a re in te re s te d in d e te rm in in g th e o u tp u t y ( n ) fo r n > 0, w e can u se th e o n e -sid e d z-tra n s fo rm , w hich allow s us to d e a l w ith th e in itial co n d itio n s. T h u s th e o n e -sid e d z -tra n s fo rm o f (3.4.7) b e c o m e s ■ f t) — E akz Y +{z) + Y j y (' - n ) z '' + £ f c * z - * X + (z) (3.6.5) S ince x ( n) is cau sal, we can se t X + (z) = X (z). In an y case (3.6.5) m ay b e e x p ressed as 52 ^ Y +(z) = *=0 s -X(z)- 1+52<: = H(z)X(z) + akz No(z) A (z) (3.6.6) Sec. 3.6 Analysis of Linear Tim e-Invariant Systems in the z-D om ain 205 w h e re N k No(z) = - 5 Z a *z_,t k= 1 n=l (3.6.7) F ro m (3.6.6) it is a p p a r e n t th a t th e o u tp u t o f th e sy stem w ith n o n z e ro initial c o n d itio n s can b e su b d iv id e d in to tw o p a rts. T h e first is th e z e ro -sta te re sp o n se of th e sy stem , d e fin ed in th e z -d o m ain as Ya (z) = H ( z ) X ( z ) (3.6.8) T h e se c o n d c o m p o n e n t c o rre sp o n d s to th e o u tp u t re su ltin g fro m th e n o n z e ro initial co n d itio n s. T h is o u tp u t is th e z e ro -in p u t re sp o n se o f th e system , w hich is defined in th e z -d o m ain as (z) = TTT A(z) a 6 ’9) H e n c e th e to ta l re sp o n se is th e su m o f th ese tw o o u tp u t c o m p o n e n ts , w hich can b e e x p ressed in th e tim e d o m a in by d e te rm in in g th e in v erse z -tra n s fo rm s o f Kzs(;) a n d Y A z ) s e p a ra te ly , a n d th e n ad d in g th e resu lts. T h u s y ( n) = >zs(«) + >'zi(n) (3.6.10) S ince th e d e n o m in a to r of Fz|( z ) , is A(z), its p o le s are p i , P 2 ........ Ps- C o n se ­ q u e n tly , th e z e ro -in p u t re sp o n se h a s th e form N >'zi(n) = 52 (3.6.11) T h is can b e a d d e d to (3.6.4) a n d th e te rm s involving th e p o les {/?*} can be co m b in ed to yield th e to ta l re sp o n s e in th e form y( n) = N L k= 1 k=\ 52 A k' ( Pk) nu( n) + 51 Q k i q k T u ( n ) (3.6.12) w h e re , by d efin itio n , A'k = + Dk (3.6.13) T h is d e v e lo p m e n t in d icates clearly th a t th e effect o f th e initial co n d itio n s is to a lte r th e n a tu ra l re sp o n s e o f th e system th ro u g h m o d ifica tio n o f th e scale f a c to rs {Ak}. T h e re a re n o n ew p o le s in tro d u c e d by th e n o n z e ro in itial co n d itio n s. F u rth e rm o r e , th e r e is no effect on th e fo rce d re sp o n s e o f th e system . T h ese im p o rta n t p o in ts a re re in fo rc e d in th e follow ing e x am p le. Exam ple 3.6.1 D eterm ine the unit step response of the system described by the difference equation y{n) = 0.9y(n —1) - 0.81y(n - 2) + x( n) under the following initial conditions: (a) y ( - l ) = > (-2 ) = 0 (b) y ( - 1) = y ( - 2 ) = 1 206 The z-Transform and Its Application to the Analysis of LTI Systems Solution Chap. 3 The system function is H {z) = 1 1 - 0 . 9 : - 1 + 0 .8 1 ;- 2 This system has two complex-conjugate poles at P 2 = G. 9e- jn/i p l = Q.9e^° The z-transform of the unit step sequence is 1 X(z) = 1-z -1 Therefore, 1 (1 - 0 . 9 e j ”^ z - l K l - 0 . 9 e - j ”'1z -'l ) ( l - z ~ ' ) 0.542 - /0 .0 4 9 1 - 0 .9 e ^ f h ~ l 0.542 + y0.049 + :---- — r + 1 - 0 .9e->nPz - 1 1.099 1 - z~l and hence the zero-state response is y^(n) = £l.099 + 1.088(0.9)" cos ( ~ n - 5.2C) J u ( n ) (a) Since the initial conditions are zero in this case, we conclude that v(n) = >'is(fl). (b) For the initial conditions v ( - l ) = v (-2 ) = 1, the additional com ponent in the z-transform is Mi(z) A(z) I'ziW 0.09 - 0.S ir " 1 1 - 0 . 9 ; - ' + 0.81r“2 0.026 + j0.4936 i 0.026 - jO.4936 “ 1 - 0 H e i ' f i z - 1 + 1 - 0 . 9 e - '* P z ~ ' Consequently, the zero-input response is yzi(n) = 0.988(0.9)'' cos ^ ~ n + 87°^J u(n) In this case the total response has the z-transform y (z ) = J ^ w + y^ u ) 1.099 0.568 + y'0.445 0.568 - /0.445 + :---- „ r + 1 - z "1 1 - Q.9eJ*Vz- 1 1 - 0.9e“' ff/3; -1 The inverse transform yields the total response in the form y(n) = 1.099u(n) + 1.44(0.9)" cos ( ^ n + 3 8 ^ u (n) 3.6.3 Transient and Steady-State Responses A s w e h av e seen fro m o u r p re v io u s d iscussion, th e re sp o n se o f a sy ste m to a given in p u t can b e se p a ra te d in to tw o c o m p o n e n ts , th e n a tu r a l re sp o n s e a n d th e fo rce d Sec. 3.6 Analysis of Linear Tim e-Invariant Systems in the z-Dom ain 207 re sp o n se . T h e n a tu ra l re sp o n s e o f a cau sal system h a s th e fo rm N >’nr(n) = 52 A k i p k ) nu{ n) (3.6.14) *=1 w h e re {pk), k = 1, 2, N a re th e p o le s o f th e sy stem a n d {A*} a re sc ale fac­ to rs th a t d e p e n d o n th e in itial c o n d itio n s an d on th e c h a ra c te ristic s o f th e in p u t se q u en ce. If |/>*| < 1 fo r all k, th e n , y nT(n) d ecay s to z e ro as n a p p ro a c h e s infinity. In such a case w e re fe r to th e n a tu ra l re sp o n se of th e system as th e t ransient response. T h e ra te a t w hich >'nr(n) d ecay s to w a rd z e ro d e p e n d s on th e m a g n itu d e o f th e p o le p o sitio n s. I f all th e p o le s h av e sm all m a g n itu d e s, th e d ec a y is v ery ra p id . O n the o th e r h a n d , if o n e o r m o re p o le s a re lo c a te d n e a r th e u n it circle, th e c o rre sp o n d in g te rm s in >’nr(n) w ill d e c a y slow ly to w a rd z e ro a n d th e tra n s ie n t will p ersist fo r a relativ ely lo n g tim e. T h e fo rc e d re sp o n s e o f th e system h as th e fo rm i Vfr(«) = 5 2 <2*(<?*)"«(«) k=\ (3.6.15) w h e re {^t), k = 1, 2 , . . . , L a re th e p o le s in th e forcing fu n c tio n a n d { Qk } a re scale fa c to rs th a t d e p e n d o n th e in p u t se q u e n c e an d o n th e c h a ra c te ristic s o f th e system . If all th e p o le s o f th e in p u t signal fall in sid e th e u n it circle, ^ ( n ) will d ecay to w a rd z e ro as n a p p ro a c h e s infinity, ju st as in th e case o f th e n a tu ra l resp o n se. T h is sh o u ld n o t b e su rp risin g since th e in p u t signal is also a tra n s ie n t signal. O n th e o th e r h a n d , w h e n th e cau sal in p u t signal is a sin u so id , th e p o le s fall o n th e unit circle a n d c o n s e q u e n tly , th e fo rce d re sp o n se is also a sin u so id th a t p ersists fo r all n > 0. In th is case, th e fo rce d re sp o n se is called th e steady-state respons e o f th e system . T h u s, fo r th e sy stem to sustain a ste a d y -s ta te o u tp u t fo r n > 0, th e in p u t sig n al m u st p e rsist fo r all n > 0. T h e fo llo w in g ex a m p le illu stra te s th e p re se n c e o f th e s te a d y -s ta te resp o n se. Exam ple 3*6.2 D eterm ine the transient and steady-state responses of the system characterized by the difference equation >{n) = 0.5;y(n - 1) + jc(n) when the input signal is x ( n ) = 10cos(jrn/4)u(n). The system is initially at rest (i.e., it is relaxed). Solution The system function for this system is and therefore the system has a pole at z = 0.5. The z-transform of the input signal is (from Table 3.3) 10(1 — ( l/y / 2 ) z ~ 1) X (z ) ---------------f ---------------1 - y / 2 £_1 + Z~1 208 The z-Transform and Its Application to the Analysis of LTI S ystem s Chap. 3 Consequently. K (o = H (:)X (z ) 10(1 - ( l / v '2 ) ; - 1) (1 —0.5~-‘ )(1 - e - w 4; - 1)!! 6.78e~J2&1 6.3 1 - 0.5;- 1 ‘ ,—"T 1- i) 6.7&ej2K1 1 - e-J*iAz~x The natural or transient response is ynr(n) = 6.3(0.5)"u(«) and the forced or steady-state response is Vfr (n) = +6. 1&eJ2*J e - inn!A]u(},) = 13.56cos (^~^n —2 8 . 7 w(«) Thus we see that the steady-state response persists for all n > 0. just as the input signal persists for all n > 0. 3.6.4 Causality and Stability A s d efin ed p rev io u sly , a causal lin e a r tim e -in v a ria n t system is o n e w hose unit sa m p le resp o n se h (n ) satisfies the co n d itio n h (n ) = 0 n < 0 W e h av e also show n th at the R O C o f th e ;;-tra n sfo rm o f a cau sal se q u e n c e is the e x te rio r o f a circle. C o n se q u e n tly , a lin e a r t im e -in v a r ia n t sy ste m is c a u s a l i f an d o n ly i f the R O C o f the system f u n c t io n is the e x te rio r o f a c ir c le o f ra d iu s r < 00, in c lu d in g the p o in t z — d o . T h e stab ility o f a lin ear tim e -in v a ria n t system can also be e x p re ss e d in term s o f th e ch a ra c te ristic s o f th e system fu n ctio n . A s w e recall fro m o u r prev io u s d iscu ssio n , a n ecessa ry an d sufficient co n d itio n fo r a lin e a r tim e -in v a ria n t system to b e B IB O sta b le is 52 n=- x In tu rn , this c o n d itio n im plies th a tt H ( z ) m u st c o n ta in th e u n it circle w ith in its R O C . musi In d e e d , since OC H (z) = h (n)z it follow s th a t OC OC n ——oc n= —oc W h en e v a lu a te d o n th e u n it circle (i.e., |z| = 1), OC \ h (z )\ < 52 Sec. 3.6 Analysis of Linear Tim e-Invariant Systems in the 7 -Domain 209 H en ce, if the system is B IB O stable, the unit circle is con tained in the R O C o f H(z)- T h e con verse is also true. T h erefore, a linear tim e-in va ria n t sy stem is B IB O stable i f a n d o n ly i f th e R O C o f the sy stem fu n c tio n includes the u n it circle. W e should stress, how ever, that the con d ition s for causality and stability are d ifferent and that o n e d oes not im ply the other. F or exam p le, a causal system m ay b e stable or unstable, just as a noncausal system m ay b e stable or unstable. Sim ilarly, an unstable system m ay be eith er causal or n oncausal, just as a stable system m ay be causal or noncausal. For a causal system , h ow ever, the con d ition on stability can be narrowed to so m e exten t. In d eed , a causal system is characterized by a system function H ( z ) having as a R O C the exterior o f som e circle o f radius r. For a stable system , the R O C m ust include the unit circle. C on sequ en tly, a causal and sta­ ble system m ust have a system function that con verges for |z| > r < 1. Since the R O C cannot contain any p oles o f H ( z ) , it follow s that a causal linear tim ein va ria n t sy stem is B I B O stable i f a n d o n ly i f all the p o le s o f H ( z ) are inside the u n it circle. Example 3.63 A linear tim e-invariant system is characterized by the system function 3 - 4 z-' H(z) ~ 1 - 3.5z-> + 1.5: ' 2 1 " 2 l - ' i z - 1 + 1 - 3 z- 1 Specify the R O C of H(z) and determ ine h(n) for the following conditions: (a) The system is stable. ( b ) The system is causal. (c) The system is anticausal. Solution T he system has poles at z = 5 and z = 3. (a) Since the system is stable, its R O C must include the unit circle and hence it is \ < \z\ < 3. Consequently, h(n) is noncausal and is given as h(n) = (i)"n(«) - 2(3)-it ( - n - 1) (b) Since the system is causal, its R O C is jz| > 3. In this case /i(n) = ( i r « ( n)+ 2 (3 )"u (n ) This system is unstable. (c) If the system is anticausal, its R O C is |z| < 0.5. Hence h{n) = - { ( \ y + 2 ( 3 T ) u ( - n - l ) In this case the system is unstable. 210 The z - T ransform and Its Application to the Analysis of LTI Systems Chap. 3 3.6.5 Pole-Zero Cancellations W h en a z -tra n sfo rm h as a p o le th a t is a t th e sam e lo catio n as a z e ro , th e pole is ca n c e le d by th e z e ro an d , c o n s e q u e n tly , th e te rm c o n ta in in g th a t p o le in the in v erse z-tra n sfo rm v an ish es. S uch p o le - z e r o c a n ce llatio n s a re v ery im p o rta n t in th e an alysis o f p o le - z e r o system s. P o le -z e ro c a n ce llatio n s can o c c u r e ith e r in th e sy stem fu n c tio n itself o r in th e p ro d u c t o f th e sy stem fu n ctio n w ith th e z -tra n sfo rm o f th e in p u t signal. In the first case w e say th a t th e o r d e r o f th e sy stem is re d u c e d by o n e . In th e la tte r case w e say th a t th e p o le o f th e system is su p p re s se d by th e z e ro in th e in p u t signal, o r vice v ersa. T h u s, by p ro p e rly se lectin g th e p o sitio n o f th e ze ro s o f th e in p u t signal, it is p o ssib le to su p p re ss o n e o r m o re sy stem m o d es (p o le fa c to rs) in th e re sp o n se o f th e sy stem . S im ilarly, by p r o p e r se le c tio n o f th e z e ro s o f th e system fu n ctio n , it is p o ssib le to su p p re s s o n e o r m o re m o d e s o f th e in p u t signal fro m the re sp o n se o f th e system . W h e n th e z e ro is lo c a te d v ery n e a r th e p o le b u t n o t ex actly a t th e sa m e loca­ tio n , th e te rm in th e re sp o n se h as a v ery sm all a m p litu d e . F o r e x a m p le , n o n ex act p o ie - z e r o c an ce llatio n s can o ccu r in p ra c tic e as a re su lt o f in su ffician t n u m erical p recisio n u sed in re p re se n tin g th e co efficien ts o f th e system . C o n s e q u e n tly , one sh o u ld n o t a tte m p t to stab ilize an in h e re n tly u n sta b le system by p lacing a z e ro in th e in p u t signal at th e lo catio n o f th e pole. Example 3.6.4 Determ ine the unit sample response of the system characterized by the difference equation v(n) = 2.5 v(n —1) —>’(n —2) + jr(n) —5jr(n — 1) + 6x(n — 2) Solution The system function is 1 - 5*-1 + 6z ' 2 (1 - i z - ') ( l - 2 z - ‘ This system has poles at p\ = 2 and p x = ~, Consequently, at first glance it appears that the unit sample response is Y(z) = H( z) X( z) = 1 - 5 z ~ ' + 6z“2 (1 - j z _ ,)(l - 2z_l By evaluating the constants at z = j and z = 2, we find that A = * B =0 The fact that 5 = 0 indicates that there exists a zero at z = 2 which cancels the pole at z = 2. In fact, the zeros occur at z = 2 and z = 3. Consequently, H{z) Sec. 3.6 Analysis of Linear Tim e-Invariant Systems in the z-Dom ain 211 reduces to H(z) = 1 - 3 : -1 1- k -1 2 .5 ;-1 = 1and therefore h(rt) = S{n) - 2 .5 ( 5)" ~ ^ The reduced*order system obtained by canceling the common pole and zero is char­ acterized by the difference equation y(n) = iy(n - 1) + x(n) - 3x{n - 1) Although the original system is also BIBO stable due to the pole-zero cancellation, in a practical im plementation of this second-order system, we may encounter an instability due to imperfect cancellation of the pole and the zero. Example 3.6.5 D eterm ine the response of the system v(n) = jjy(>i - 1) - £y(n - 2) + x(n) to the input signal x{n) = S(n) — ^&(n — 1). Solution The system function is 1 WU) = (1 - (1 - 1 c-1) This system has two poles, one at z = ^ and the other at : = the input signal is The ^transform of X {z ) = 1 - j i ' 1 In this case the input signal contains a zero at ; = i which cancels the pole at ; = Consequently, Y(z) = HU) X( z ) m - i r p and hence the response of the system is y(n) = ( 5)n«(n) Clearly, the m ode ( |)" is suppressed from the output as a result of the pole-zero cancellation. 3.6.6 Multiple-Order Poles and Stability A s w e h a v e o b se rv e d , a n ecessa ry an d sufficient c o n d itio n fo r a causal lin e a r tim ein v a ria n t sy stem to b e B IB O sta b le is th a t all its p o le s lie in sid e th e u n it circle. T h e in p u t sig n al is b o u n d e d if its z -tra n s fo rm c o n ta in s p o le s {qk}, k = 1 , 2 — , L, 212 The z-Transform and Its Application to the Analysis of LTI Systems Chap. 3 w hich satisfy th e c o n d itio n \qk \ < 1 fo r all k. W e n o te th a t th e fo rc e d re sp o n se of th e system , given in (3.6.15). is also b o u n d e d , ev en w h e n th e in p u t signal contains o n e o r m o re d istin ct p o les on th e u n it circle. In view o f th e fact th a t a b o u n d e d in p u t signal m ay h av e p o le s on th e unit circle, it m ight a p p e a r th a t a sta b le system m ay also h av e p o le s on th e u n it circle. T his is n o t th e case, h o w ev er, since such a sy stem p ro d u c e s an u n b o u n d e d resp o n se w h en ex cited by an in p u t signal th a t also has a p o le a t th e sa m e p o sitio n o n the u n it circle. T h e follow ing ex a m p le illu stra te s th is p o in t. Example 3.6.6 D eterm ine the step response of the causal system described by the difference equation v(n) = y{n - 1) + x{n) Solution The system function for the system is We note that the system contains a pole on the unit circle at c = 1. The ^-transform of the input signal x(n) = u{n) is which also contains a pole at ; = 1. Hence the output signal has the transform K(=) = H {z)X {z) 1 “ (1 - ; - 1)2 which contains a double pole at z = 1. The inverse z-transform of Y(z) is >-(«)= (n + l)n(B) which is a ramp sequence. Thus y(n) is unbounded, even when the input is bounded. Consequently, the system is unstable. E x am p le 3.6.6 d e m o n s tra te s clearly th a t B IB O stab ility r e q u ire s th a t th e sys­ tem p o le s b e strictly in side th e u n it circle. If th e sy stem p o les a re all inside th e unit circle an d th e e x c ita tio n se q u e n c e x ( n ) c o n ta in s o n e o r m o re p o le s th a t coincide w ith th e p o les o f th e sy stem , th e o u tp u t Y(z ) w ill c o n ta in m u ltip le -o rd e r poles. As in d ic a te d p rev io u sly , such m u ltip le -o rd e r p o les re su lt in an o u tp u t se q u e n c e th at co n tain s term s o f th e form A kn b( p k)nu(n) w h ere 0 < b < m — 1 an d m is th e o r d e r o f th e p o le. If |p*| < 1, th e s e te rm s decay to z e ro as n a p p ro a c h e s infinity b e c a u s e th e e x p o n e n tia l f a c to r (pk) n d o m in ates th e te rm n b. C o n se q u e n tly , n o b o u n d e d in p u t signal can p r o d u c e an u n b o u n d e d o u tp u t signal if th e sy stem p o les a re all in sid e th e u n it circle. Sec. 3.6 Analysis of Linear Tim e-Invariant Systems in the z - D o m a in 213 F in ally , w e sh o u ld s ta te th a t th e o n ly u sefu l system s w h ich c o n ta in p o les on th e u n it circle a re th e d ig ital o sc illato rs discussed in C h a p te r 4. W e call such sy stem s mar gi nal l y stable. 3.6.7 The Schur-Cohn Stability Test W e h av e sta te d p rev io u sly th a t th e sta b ility o f a sy stem is d e te rm in e d by th e p o sitio n o f th e p o les. T h e p o les o f th e system are th e ro o ts o f th e d e n o m in a to r p o ly n o m ia l o f H ( z ), n am ely , A(z) = 1 + a \ z 1 + Q-2Z 2 + ■• • + QpfZ ^ (3.6.16) W h en th e sy stem is cau sal all th e ro o ts o f A (z) m u st lie inside th e u n it circle fo r th e sy stem to b e sta b le . T h e re a re se v e ra l c o m p u ta tio n a l p ro c e d u re s th a t aid u s in d e te rm in in g if any o f th e ro o ts o f A (z) lie o u tsid e th e u n it circle. T h e se p ro c e d u re s a re called stability criteria. B e io w w e d esc rib e th e S c h u r-C o h n test p ro c e d u re fo r th e sta b ility o f a sy stem c h a ra c te riz e d by th e system fu n c tio n H( z ) = B ( z ) / A { z). B e fo re w e d e sc rib e th e S c h u r-C o h n te st w e n e e d to e sta b lish so m e useful n o ta tio n . W e d e n o te a p o ly n o m ia l o f d e g re e m by Am(z) = £ a m(* )z - A i=0 a m(0) = l (3.6.17) T h e reci procal o r reverse p o l y n o m i a l Bm(z) o f d e g ree m is d e fin e d as Bm(z) = z-') (3.6.18) UmV"‘ — k k*=0 W e o b se rv e th a t th e coefficients o f B m( z) are th e sa m e a s th o se o f Am(z), b u t in re v e rse o rd e r. In th e S c h u r-C o h n sta b ility te s t, to d e te rm in e if th e p o ly n o m ia l A (z) has all its r o o ts in sid e th e u n it circle, w e c o m p u te a set o f coefficients, called reflection coefficients, K \ , K i .........K n fro m th e p o ly n o m ials A m(z). F irst, w e set A N (z) = A( z ) and (3.6.19) ATjV = a # ( N ) T h e n w e c o m p u te th e lo w e r-d e g re e p o ly n o m ials Am(z), m = N , N — 1, N — 2 , . . . , 1, a c c o rd in g to th e rec u rsiv e e q u a tio n A ^ ^m (z) — K mB m(z) A m- i ( z ) = --------1 -------- ^ c (3.6.20) w h e re th e c o effic ie n ts K m a re d e fin ed as Km = am{m) (3.6.21) 214 The z-Transform and Its Application to the Analysis of LTI Systems Chap, 3 T h e S c h u r-C o h n sta b ility test sta te s th a t the p o l y n o m i a l A (;) gi en by (3.6.16) has all its roots inside the unii circle i f a n d onl y i f the coefficients K m satisfy the condit i on \Km \ < 1 f o r all m — 1, 2 ........ N. W e shall n o t p ro v id e a p r o o f o f th e S c h u r-C o h n te s t at th is p o in t. The th e o re tic a l ju stificatio n fo r th is te s t is given in C h a p te r 11. W e illu stra te th e com ­ p u ta tio n a l p ro c e d u re w ith th e follow ing exam ple. Example 3.6.7 Determ ine if the system having the system function is stable. Solution We begin with A ;(;), which is defined as A 2 (z ) = 1 - lz~] - k " 2 Hence Now #>(:) = and /\2(r) 1 - K; Therefore. Ki = - I Since |ATi | > 1 il follows that the system is unstable. This fact is easily estab­ lished in this example, since the denom inator is easily factored to yield the two poles at pi = —2 and p 2 — However, for higher-degree polynomials, the Schur-Cohn test provides a simpler test for stability than direct factoring of //(- ) . T h e S c h u r-C o h n sta b ility te s t can b e easily p ro g ra m m e d in a d igital c o m p u ter an d it is very efficien t in te rm s o f a rith m e tic o p e ra tio n s. S pecifically, it req u ires o n ly N 2 m u ltip lic a tio n s to d e te rm in e th e co efficien ts {Km}, m = 1 , 2 .........N. The recu rsiv e e q u a tio n in (3.6.20) can b e e x p ressed in te rm s o f th e p o ly n o m ial coef­ ficients by e x p a n d in g th e p o ly n o m ia ls in b o th sides o f (3.6.20) a n d e q u a tin g the co efficien ts c o rre sp o n d in g to e q u a l p o w ers. In d e e d , it is easily e s ta b lis h e d that (3.6.20) is e q u iv a le n t to th e follow ing alg o rith m : Set a N (k) = ak it = 1 ,2 .........N (3.6.23) Kfj = a f j ( N) T h e n , fo r m = N , N — 1 , . . . , 1, c o m p u te K m = a m(rn) (3.6.22) <jm_ i(0 ) = l Sec. 3.6 Analysis of Linear Tim e-Invariant Systems in the z-D om ain 215 it = 1, 2 , . . . , m — 1 (3.6.24) an d w h ere bm(k) = am(m — k) k = 0,1,...,m (3.6.25) T h is recu rsiv e a lg o rith m fo r th e c o m p u ta tio n o f th e c o effic ie n ts {ATm} finds a p p lic a tio n in v a rio u s signal p ro cessin g p ro b le m s, especially in sp e e c h signal p r o ­ cessing. 3.6.8 Stability of Second-Order Systems In th is se c tio n w e p ro v id e a d e ta ile d an aly sis o f a sy stem h av in g tw o p o les. A s w e sh all se e in C h a p te r 7, tw o -p o le system s fo rm th e b asic b u ild in g b lo ck s fo r th e r e a liz a tio n o f h ig h e r-o rd e r system s. L e t us c o n s id e r a cau sal tw o -p o le sy stem d e s c rib e d by th e s e c o n d -o rd e r dif­ fe re n c e e q u a tio n y (n ) = - a ^ y ( n - I) - a 2y ( n - 2) + b 0x ( n ) (3.6.26) T h e sy stem fu n ctio n is X (z) 1 4- a i r 1 + a 2z ~ : (3.6.27) boz2 z 2 + a \z + «2 T h is sy stem h a s tw o z ero s at th e origin a n d p o les a t (3.6.28) T h e sy stem is B IB O sta b le if th e p o le s lie in sid e th e u n it circle, th a t is, if |P i| < 1 a n d \ p2\ < 1. T h e se c o n d itio n s can b e re la te d to th e v alu es o f th e co effic ie n ts a\ a n d a 2. In p a rtic u la r, th e ro o ts o f a q u a d ra tic e q u a tio n satisfy th e re la tio n s fil = —(P5 + pi ) (3.6.29) (3.6.30) F ro m (3.6.29) a n d (3.6.30) w e easily o b ta in th e c o n d itio n s th a t a\ a n d a 2 m u st satisfy fo r sta b ility . F irst, aj m u st satisfy th e c o n d itio n \ai\ = \ p\ pi \ - \p\Wpi\ < 1 (3.6.31) T h e c o n d itio n fo r a\ can b e e x p re sse d as 1 1 < 1 + «2 (3.6.32) 216 The z-Transform and Its Application to the Analysis of LTI Systems Chap. 3 T h e c o n d itio n s in (3.6.31) a n d (3.6.32) can also be d e riv e d fro m th e S c h u rC o h n stab ility te st. F ro m th e recu rsiv e e q u a tio n s in (3.6.22) th r o u g h (3.6.25), we find th a t (3.6.33) an d K 2 = 02 (3.6.34) T h e sy stem is sta b le if a n d o n iy if [AT]| < 1 an d lA^I < 1. C o n s e q u e n tly , —1 < «2 < 1 o r eq u iv a le n tly \a%\ < 1, w hich a g rees w ith (3.6.31). A lso, or, eq u iv alen tly , ai < 1 ~b 02 d\ > —1 — a 2 w hich a re in a g re e m e n t w ith (3.6.32). T h e re fo re , a tw o -p o le sy stem is sta b le if and only if th e co efficien ts a\ a n d a ; satisfy th e c o n d itio n s in (3.6.31) a n d (3.6.32). T h e stab ility c o n d itio n s given in (3.6.31) an d (3.6.32), d efin e a reg io n in the co efficien t p lan e (o i. ai), w hich is in th e fo rm o f a tria n g le , as sh o w n in Fig. 3.15. T h e sy stem is sta b le if an d only if th e p o in t (o j, q t) lies inside th e tria n g le , w hich w e call th e stability triangle. T h e ch a ra c te ristic s o f th e tw o -p o le system d e p e n d o n th e lo catio n o f the p o les o r. eq u iv alen tly , on th e lo catio n o f th e p o in t (e i, 02) in th e sta b ility triangle. T h e p o le s o f th e sy stem m ay be re a l o r co m p lex c o n ju g a te , d e p e n d in g on the v alu e o f th e d isc rim in a n t A = a* — Aa2- T h e p a ra b o la a 2 = a \ f 4 splits th e stability Figmre 3 .15 Region of stability (stability triangle) in the ( a i, a?) coefficient plane for a second-order system. Sec. 3.6 Analysis of Linear Tim e-Invariant Systems in the ^-D om ain 217 tria n g le in to tw o reg io n s, as illu stra te d in Fig. 3.15. T h e re g io n b elo w th e p a ra b o la (,a\ > 4 d 2 ) c o rre sp o n d s to re a l an d d istin ct poles. T h e p o in ts o n th e p a ra b o la ( af = 4*22) re su lt in re a l a n d e q u a l (d o u b le ) poles. F inally, th e p o in ts ab o v e th e p a ra b o la c o rre sp o n d to co m p lex -co n ju g ate poles. A d d itio n a l in sig h t in to th e b e h a v io r o f th e system can be o b ta in e d fro m th e u n it sa m p le re sp o n s e s fo r th e s e th re e cases. Real and distinct poles (af = 4a2)- Since p 1 , system fu n c tio n can b e ex p re sse d in th e fo rm A\ , 1 - Piz 1 pi are re a l a n d p\ ^ p2. th e A2 (3.6.35) 1 - P 2Z' 1 w h ere koPi Ai ~ -boP2 (3.6.36) P 1 - P2 Pi - P2 C o n se q u e n tly , th e u n it sa m p le re sp o n se is b° (3.6.37) ' ( P T ' - P ? l )u(n) Pi — P 2 T h e re fo re , th e u n it sa m p le re sp o n se is th e d ifferen ce of tw o d e c ay in g e x p o n e n tia l se q u en ces. F ig u re 3.16 illu stra te s a ty p ical g rap h for h( n) w h en th e p o les are distinct. Real and equal poles (af = 4a2). In th is case p\ P 2 — p = —a \ / 2. T he system fu n ctio n is ( 1 - p z - 1)2 (3.6.38) an d h e n c e th e u n it sa m p le re sp o n se o f th e system is h{n) = b0(n + 1 ) p nu(n) h(n) Figure 3.16 Plot of h(n) given by (3.6.37) with p\ = 0.5, pz = 0.75; h(n) = ~ P2)](P”+1 - P 2 +I)u(n). (3.6.39) 218 The z-Transform and Its Application to the Analysis of LTI Systems Chap. 3 h(n) Figure 3.17 Plot of h(rr) given by (3.6.39) with p = ti(n) = (n + 1 W e o b serv e th a t h( n) is th e p ro d u c t o f a ra m p se q u e n c e a n d a real decaying e x p o n e n tia l se q u en ce. T h e g ra p h o f h( n) is show n in Fig. 3.17. Complex-conjugate poles (af < 4a2). Since the p o le s a re co m p lex c o n ­ ju g a te , th e system fu n ctio n can be fa c to re d and ex p re sse d as A A’ 1 — p : -1 + A 1 - re^'z' 1 1 — p*z~l (3.6.40) A' + 1 - r e ~ )tUi' z ~x w h ere p = r e Jai an d 0 < coq < tt. N o te th a t w hen th e p o le s are co m p lex co n ju g ates, th e p a ra m e te rs a\ a n d 02 a re re la te d to r an d a>o acco rd in g to a\ = —2 r cos coo (3.6.41) az = r T h e c o n stan t A in th e p a rtia l-fra c tio n ex p an sio n o f H( z ) is easily sh o w n to be A = bo p boreJW" p — p* r ( e i ™0 — e~JW0) b 0eJ<I* (3.6.42) j 2 sin ti>o C o n seq u en tly , th e u n it sa m p le re sp o n se o f a system w ith c o m p ie x -c o n ju g a te poles is h{n) = sin coo born sin coo 2j -«(n) (3.6.43) sin(rt -t- l)cuou(n) In this case h ( n ) h a s an o sc illato ry b e h a v io r w ith an e x p o n e n tia lly decaying e n v elo p e w hen r < 1. T h e an g le wo o f th e p o les d e te rm in e s th e fre q u e n c y of o scillatio n an d th e d istan c e r o f th e p o le s from th e origin d e te rm in e s th e ra te of Sec. 3.7 Summ ary and References 219 ft(n) Figure 3.18 Plot of h(n) given by (3.6.43) with bo = 1, a*> = n/4, r = 0.9; sin[(n + l)twn)u(n). h(n) = [fcor"/(sin decay . W h e n r is clo se to u n ity , th e d ecay is slow . W h en r is close to th e origin, th e d ecay is fast. A typical g ra p h o f h(n) is illu stra te d in Fig. 3.18. 3.7 SUMMARY AND REFERENCES T h e z -tra n s fo rm p lay s th e sa m e ro le in d isc re te -tim e signals a n d sy stem s as th e L a p la c e tra n sfo rm d o e s in c o n tin u o u s-tim e signals a n d system s. In th is c h a p te r we d e riv e d th e im p o rta n t p ro p e rtie s o f th e z-tra n sfo rm , w hich a re e x tre m e ly useful in th e an aly sis o f d isc re te -tim e system s. O f p a rtic u la r im p o rta n c e is th e co n v o lu tio n p ro p e rty , w hich tra n sfo rm s th e c o n v o lu tio n o f tw o se q u e n c e s in to a p ro d u c t o f th e ir z-tran sfo rm s. In th e c o n te x t o f L T I system s, th e co n v o lu tio n p ro p e rty re su lts in th e p ro d u c t o f th e z -tra n s fo rm X ( z ) o f th e in p u t signal w ith th e sy stem fu n c tio n H ( z ) , w h e re th e la tte r is th e z -tra n s fo rm o f th e u n it sa m p le re sp o n s e o f th e sy stem . T his re la tio n sh ip allo w s u s to d e te rm in e th e o u tp u t o f an L T I sy stem in re s p o n s e to an in p u t w ith tra n s fo rm X ( z ) b y c o m p u tin g th e p ro d u c t Y ( z ) = H ( z ) X ( z ) a n d th e n d e te rm in in g th e in v e rse z -tra n sfo rm of Y ( z ) to o b ta in th e o u tp u t se q u e n c e y(n). W e o b se rv e d th a t m an y signals o f p ra c tic a l in te re s t h a v e r a tio n a l z-tran sfo rm s. M o re o v e r, L T I sy stem s c h a ra c te riz e d b y c o n s tan t-co efficien t lin e a r d ifferen ce 220 The z-Transform and Its Application to the Analysis of LTI Systems Chap. 3 e q u a tio n s , also p o ssess r a tio n a l system fu n ctio n s. C o n s e q u e n tly , in determ in in g th e in v erse z -tran sfo rm , w e n a tu ra lly e m p h a siz e d th e in v ersio n o f ra tio n a l trans­ fo rm s. F o r such tra n sfo rm s, th e p a rtia l-fra c tio n ex p an sio n m e th o d is relatively easy to apply, in c o n ju n ctio n w ith th e R O C , to d e te rm in e th e c o rre sp o n d in g se­ q u e n c e in th e tim e d o m ain . T h e o n e-sid ed z -tra n sfo rm w as in tro d u c e d to solve for th e resp o n se o f cau sal system s ex cited by causal in p u t signals w ith n o n z e ro initial co n d itio n s. F inally, w e c o n s id e re d th e c h a ra c te riz a tio n of L T I sy stem s in th e z-transform d o m a in . In p a rtic u la r, w e re la te d th e p o le - z e r o lo catio n s of a sy stem to its timed o m a in c h a racteristics an d re sta te d th e re q u ire m e n ts fo r sta b ility a n d cau sality of L T I sy stem s in te rm s o f th e p o le lo catio n s. W e d e m o n s tra te d th a t a causal system h as a system fu n ctio n H( z ) w ith a R O C |z| > w h e re 0 < r\ < oc. In a stable an d cau sal system , th e p o les o f H( z ) lie inside th e u n it circle. O n th e o th e r hand, if th e system is n o n cau sal, th e c o n d itio n for stab ility re q u ire s th a t th e u n it circle be c o n ta in e d in th e R O C o f H( z ) . H en ce a n o n cau sal sta b le L T I sy stem has a system fu n c tio n w ith p o les b o th in sid e an d o u tsid e th e u n it circle w ith an a n n u la r R O C th a t in clu d es th e u n it circle. T h e S c h u r-C o h n test fo r th e sta b ility o f a causal LTI sy stem w as d escrib ed and th e stab ility o f se c o n d -o rd e r system w as co n sid e re d in so m e d etail. A n ex cellen t c o m p reh en siv e tre a tm e n t o f the z -tra n s fo rm a n d its application to th e analysis o f L TI system s is given in the tex t by Ju ry (1964). T h e S churC o h n test for sta b ility is tr e a te d in se v era l texts. O u r p r e s e n ta tio n w as given in th e c o n tex t o f reflec tio n co efficien ts w hich are used in lin e a r p re d ic tiv e cod in g of sp e ech signals. T h e te x t by M a rk e l an d G ra y (1976) is a go o d re fe re n c e for the S c h u r-C o h n te st a n d its a p p licatio n to sp e ech signal processing. PROBLEMS 3.1 Determ ine the z-transform of the following signals, (a) x(n) = {3. 0. 0. 0, 0, 6, 1. —4} (} )\ » > 5 0. n <4 3.2 D eterm ine the z-transforms of the following signals and sketch the corresponding pole-zero patterns. (a) x ( n ) = (1 + n ) u ( n ) (b) x ( n ) = (a" + a ' ”) u( n) , a real (b) x(n) = (c) W) (e ) (I) x ( n ) = ( —1 )n2 -n u (r) x ( n ) = ( n a " sina»on)w(rc) x ( n ) = (na" CQSwon) u( n) x (n) = Ar " c o s (w^n + <j>)u(n). 0 < r < 1 (g) *(n) = j( n : i ~ 1) (h) jr(rt) = ( i ) n[«(n) - u(n - 10)] Chap. 3 221 Problems 33 Determine the z-transforms and sketch the ROC of the following signals. f(i)\ n> _0 “ 1 ( f) " " . "< (a) x,(n) ( i ) B- 2 \ 0, (c) *j(«) = x 1(n + 4 ) <d) x4(n) = j t , ( - n ) (b) x 2(n) = n >0 n < 0 3.4 D eterm ine the z-transform of the following signals. (a) x(n) = n(—l)"w(n) (b) x(n) = n2u(n) (c) x(n) = —nanu( —n — 1) (d) x(n) = (-1 )" (cos ~n) u(n) <e) x(n) = (—l)"u(n) (f) jr(n) = ( 1 ,0 .- 1 ,0 . 1 ,- 1 , . . . } t 3.5 D eterm ine the regions of convergence of right-sided, left-sided, and finite-duration two-sided sequences. 3.6 Express the z-transform of y(n) = Y x(k) k=*—oc in term s of X (-). [Him: Find the difference y(n) - y(n - 1).] 3.7 Com pute the convolution of the following signals by m eans of the z-transform. *i(n) = f (£)". n >0 1 (£)"". n<0 *2 (n) = ( j ) nH(n) 3.8 Use the convolution property to: (a) Express the z-transform of y(n) = 5 2 x tt-oc in terms of X(z). (b) Determine the z-transform of x(n) = (n + l)u(n). [Hint. Show first that x ( n ) = u(n) * n(n).] 3.9 The z-transform X(z) of a real signal x(n) includes a pair of complex-conjugate zeros and a pair of complex-conjugate poles. What happens to these pairs if we multiply x(n) by eJW°nl (Hint. Use the scaling theorem in the z-domain.) 3.10 Apply the final value theorem to determine jt( oo ) for the signal 1, 10, if n is even otherwise 3.11 Using long division, determine the inverse z-transform of 1 + 2Z-1 1 - 2z 1 + z 2 if (a) jr(n) is causal and (b) x(n) is anticausal. 222 The z-Transform and Its Application to the Analysis of LTI Systems 3.12 Determ ine the causal signal Chap. 3 having the z-transform 1 *(z) = ( l - Z z - ' H l - z - 1)2 3.13 Let ;t(n) be a sequence with z-transform X(z)- Determ ine, in terms of X(z), the z-transforms of the following signals. i,n (a) j:i(n) = even II if n odd 0, (b) x2(n) = x(2n) 3.14 D eterm ine the causal signal x (n) if its z-transform X(z) is given by: l+ 3 z -’ (a) 1 + 3 z-‘ + 2 z-2 1 (b) 1 - z - ' + ^ z -2 II * >< II (d) >< II z -6 + z^7 (c) (e) X(z) = (0 X(z) = 1 1 + 6z“ ‘ + z " 2 4 (1 - 2 ; - 1 + 2 z '2)(l - O.Sz"1) 2 — 1.5z-1 1 - 1.5--1 + C.5z^: 1 + 2z“ ‘ + z-2 II * (g) 11 + 2z-2 1+ :-2 II (j) * II 1 + 4z_1 + 4z-2 (h) X(z) is specified by a pole-zero p atten 1- k -1 (i) 1 - a z -1 Figure P3.14 3.15 Determ ine all possible signals x(n) associated with the z-transform X U ) = {1 - 2 z - ') ( 3 - z - ]) 3.16 Determ ine the convolution of the following pairs of signals by means of the ztransform. Chap. 3 223 Problems (a) x\(ft) = (b) X i ( n ) = u ( n ) , - 1), x 2(n) = [1 + jc2(n) = 5(n) + (i)"u (n ) (c) x\ (n) = ( i ) nM(n), (d) ari(n) = nu(n), *2(71) = c-Osnnu(n) x 2(n) = 2 "u(n — 1) 3.17 Prove the final value theorem for the one-sided z-transform. 3.18 If X(z) is the z-transform of x(n), show that: (a) Z { x m(n)} = X ' ( z ' ) (b) Z{Re[jr(n}]} = j[X (z) + X*(z*)] (c) Z{Im[jr(«)]l = |[X (z) - **(=*)] (d) If * * („ )= { * (? )• 1 0, if " A integer otherwise then X t U) = X (z k) (e) = X(ze~Jw°) 3.19 By first differentiating X(z) and then using appropriate properties of the z-transform. determ ine x(n) for the following transforms. (a) X(z) = l o g ( l —2 z), \z\<{ (b) X(z) = log(l - z-1), |z! > 5 3.20 (a) Draw the pole-zero pattern for the signal jcj(n) = (r" sin a>on)u(fi) 0 < r < 1 (b) Com pute the z-transform A^tz), which corresponds to the pole-zero pattern in part (a). (c) Com pare X]{z) with X 2(z). Are they indentical? If not. indicate a m ethod lo derive Xi(z) from the pole-zero pattern. 3.21 Show that the roots of a polynomial with real coefficients are real or form complexconjugate pairs. The inverse is not true, in general. 3.22 Prove the convolution and correlation properties of the z-transform using only its definition. 3.23 D eterm ine the signal x(n) with z-transform X (z) = e: + e l/z |z|^0 3.24 D eterm ine, in closed form, the causal signals x(n) whose z-transforms are given by: (a) X(z) = T T T 5 ^ T o3 P (b) X(Z) = 1 - 0.5z~! + 0.6z “2 Partially check your results by computing *(0), x (l), *(2), and jt( oo) by an alternative m ethod. 3.25 D eterm ine all possible signals that can have the following z-transforms. 1 224 The z - T ransform and Its Application to the Analysis of LTI Systems Chap. 3 3.26 Determ ine the signal x(n) with z-transform XU) = + z- 2 1- if X(z) converges on the unit circle. 3 .2 7 Prove the complex convolution relation given by (3.2.22). 3.28 Prove the conjugation properties and Parse val’s relation for the z-transform given in Table 3.2. 3.29 In Example 3.4.1 we solved for .r(n), n < 0, by perform ing contour integrations for each value of n. In general, this procedure proves to be tedious. It can be avoided by making a transform ation in the contour integral from z-plane to the uj = 1/z plane. Thus a circle of radius R in the z-plane is mapped into a circle of radius 1/ R in the wplane. As a consequence, a pole inside the unit circle in the z-plane is mapped into a pole outside the unit circle in the m-plane. By making the change of variable w = 1/z in the contour integral, determ ine the sequence x ( n ) for n < 0 in Example 3.4.1, 3.30 Let *(n), 0 < n < N — 1 be a finite-duration sequence, which is also real-valued and even. Show that the zeros of the polynomial X(z) occur in mirror-image pairs about the unit circle. That is. if z = rej/> is a zero of X(z), then z = (1 / r ) e J" is also a zero. 3.31 Compute the convolution of the following pair of signals in the time domain and by using the one-sided z-transform. (a) .v,(n) = {1. 1. 1. 1. 1). x 2(n) = (1. 1. 1) t t (b) Xi (n) = ( j)"u(h). x 2(n) = (i)"u(n) (c) .ii(n) = (1.2, 3.4}. x 2(n) = (4, 3, 2. 1} t t (d) *,(«) = {1.1. 1.1.1}. Jr2 ( « ) = {1.1,1} t t Did you obtain the same results by both methods? Explain. 3.32 D eterm ine the one-sided z-transform of the constant signal x ( n ) = 1. —oo < n < 00 . 3 .3 3 Prove that the Fibonacci sequence can be thought of as the impulse response of the system described by the difference equation ,y(/i) = v(n - 1) + y ( n - 2) 4- x(n). Then determ ine h(n) using z-transform techniques. 3 .3 4 Use the one-sided z-transform to determ ine y(n), n > 0 in the following cases. (a) y(n) + \ y( n - 1) - \ y( n - 2) = 0; y ( - l ) = y (-2 ) = 1 (b) y(n) - 1.5y(n - 1) + 0.5y(n - 2) = 0; y ( - l ) = 1. v(—2) = 0 (c) v(n) = \ y ( n - 1) + x ( n ) x ( n ) = (±)"u(rt). y(-l) = 1 (d) _v(r) = j v(n - 2) + x(n) x ( n ) = u{n) >’(—1) = 0; y(—2) = 1 3.3 5 Show that the following systems are equivalent. (a) y ( n ) = 0 .2 y (n - 1) + x { n ) - 0.3.r(n - 1) + 0.02jt(n - 2) (b) _y{«) = x ( n ) - 0 .1 x (n - 1) Chap. 3 225 Problems 3.36 Consider the sequence xin) = ci"uin). —1 < a < 1. D eterm ine at least two sequences that are not equal to xin) but have the same autocorrelation. 3.37 Com pute the unit step response of the system with impulse response f3\ n < 0 n >0 3.38 Com pute the zero-state response for the following pairs of systems and input signals. (a) hin) = ,v(h) = <j)"^cos w r j ;<('?) (b) h(n) = ( | Y‘u Oi ). xi n) = { \ ) ’‘u{n) + ( \ r " u ( - n - 1) (c) yin) = —0.1 yin — 1) + 0.2y(>i - 2) + xin) + xin - 1) ,v ( / i) = ( ^ V m (i i ) (d) yin) = |.v(») - — 1) x{n) = lO^Cos —n'ju(n) (e) yin) = —yin —2 ) + lOjr(n) ,v(/7) = lO^cos —n^jnin) (f) h{n) = i ^ Y ’ii(n). x i n ) — i/ln) — it in — 7) (g) hin) = (|V'if(H). xin) = ( —1)", —3C < n < x (h) hin) = U) ' ‘i f = in + 1)(j)"h<h) 3.39 Consider the system 1 - 2 r ' + 2:~: ----------;---- ----------- :-----------------( 1 - 0 . 5 ; - ‘) ( l - 0. 2: - ' ) H(Z) = ROC: 0.5 < |d < l (a) Sketch the pole-zero pattern. Is the system stable? (b) D eterm ine the impulse response of the system. 3.40 Com pute the response of the system ytn) = 0.7v(n - 1) — 0.12y(n - 2) + x(n — 1) + xin —2) to the input v(/?) = nuin), Is the system stable? 3.41 D eterm ine the impulse response and the step response of the following causal systems. Plot the pole-zero patterns and determ ine which of the systems are stable. (a ) y i n ) = j v(« - 1) - jr v( n - 2) + x ( n ) (b) y(n) = vin — 1) —0.5y(n - 2) + x(n) + xin — I ) ; ~ ' f l + (c> ™ = (d) v(n) = 0.6y(n —1) —0.08v(n —2) -f- x(n) (e) v(«) = 0.7y(n — 1) —0.1y(/3 —2) + 2xin) — x(n —2) 3.42 Let xin) be a causal sequence with ;-transform X(z) whose pole-zero plot is shown in Fig. P3.42. Sketch the pole-zero plots and the R O C of the following sequences; (a) Xt(n) = x ( ~ n -)- 2) (b) x 2(n) = eim/iu,x(n) 226 The z-Transform and Its Application to the Analysis of LTI Systems Chap. 3 Im(z) Re(;) Figure P3.42 3.43 W e want to design a causal discrete-time LTI system with the property that if the input is x( n ) = ( l ) nu ( n) - - 1) then the output is V(lt) = (|)"tt(n) (a) D eterm ine the impulse response h(n) and the system function H(z) of a system that satisfies the foregoing conditions. (b) Find the difference equation that characterizes this system. (c) D eterm ine a realization of the system that requires the minimum possible amount of memory. (d) D eterm ine if the system is stable. 3 .4 4 D eterm ine the stability region for the causal system H{z) = 1 1 + o ir -1 + a2z~2 by computing its poles and restricting them to be inside the unit circle. 3.45 Consider the svstem H{z) = _L J?i-r-2 I1 _ l --1 + Determine: (a) The impulse response (b) The zero-state step response (c) The step response if y(—1) = 1 and y ( -2 ) = 2 3 .4 6 D eterm ine the system function, impulse response, and zero-state step response of the system shown in Fig P3.46. 3 .4 7 Consider the causal system y in ) = - a i y i n - 1) + b0x(n) + b^xin - 1) Determine: (a) The impulse response Chap. 3 227 Problems Xi.fl) y(n) a Figure P3.46 (b) The zero-state step response (c) The step response if y ( —1) = A / 0 (d) The response to the input x (n ) ~ CO S a> u f! 0 < n < oo 3.48 Determ ine the zero-state response of the system y(n) = i v(h - 1) + 4*(n) + 3x(n — 1) to the input jt(n) = em 'nu{n) W hat is the steady-state response of the system? 3.49 Consider the causal system defined by the pole-zero pattern shown in Fig. P3.49. (a) Determ ine the system function and the impulse response of the system given that W U )U i = 1. (b) Is the system stable? (c) Sketch a possible im plementation of the system and determ ine the corresponding difference equations. Im(;) 3.50 An FIR LTI system has an impulse response h(n), which is real valued, even, and has finite duration of 2/V + 1. Show that if ;i = rejaJa is a zero of the system, then d = ( l / r ) e j a *> is also a zero. 3.51 Consider an LTI discrete-time system whose pole-zero pattern is shown in Fig. P3.51. (a) D eterm ine the R O C of the system function H(z) if the system is known to be stable. 228 The z-Transform and Its Application to the Analysis of LTI Systems Chap. 3 Im(;) Re<z) -0 .5 Figure P3.51 (b ) It is possible for the given pole-zero plot to correspond to a causal and stable system? If so, what is the appropriate ROC? (c) How many possible systems can be associated with this pole-zero pattern? 3.52 Let x(n) be a causal sequence. (a) What conclusion can you draw about the value of its z-transform A’(c) at ; = oo? (b ) Use the result in part (a) to check which of the following transform s cannot be associated with a causal sequence. 3.53 A causal pole-zero system is BIBO stable if its poles are inside the unit circle. Con­ sider now a pole-zero system that is BIBO stable and has its poles inside the unit circle. Is the system always causal? [Hint: Consider the systems h\(n) = anu(n) and ti2 (n) = anu{n + 3), |a| < 1.] 3 3 4 Let *(/i) be an anticausal signal [i.e., x (n) = 0 for n > 0]. Form ulate and prove an initial value theorem for anticausal signals. 3.55 The step response of an LTI system is J(w) = + 2) (a) Find the system function H(z) and sketch the pole-zero plot. (b ) D eterm ine the impulse response ft(n). (c) Check if the system is causal and stable. 3 3 6 Use contour integration to determ ine the sequence jc(n) whose z-transform is given Chap. 3 229 Problems ; —a 1 —a: 1- (c) X'U) = --------<d) A'C) 3.57 Let ,v(h) be a sequence with c-transform X d = —--- --------- — (1 - t;r)(l - a ; " 1) R O C : a < |;| < 1ja with 0 < a < 1. Determ ine ,v(«) by using contour integration 3.58 The ^-transform of a sequence .v(n) is given by X(;> = (: - i ) ( ; - 2)5<- + ?): (r + 3) Furthermore it is known that X (:) converges for |;| = 1. (a ) Determ ine the R O C of X(c). (b) Determ ine xin ) at n = -18. {Hint: Use contour integration.) 34 Frequency Analysis of Signals and Systems T h e F o u rie r tra n sfo rm is o n e o f se v e ra l m a th e m a tic a l to o ls th a t is useful in the an alysis an d d esign o f L T I system s. A n o th e r is th e F o u rie r se ries. T h ese signal re p re se n ta tio n s basically involve th e d e c o m p o sitio n o f th e sig n als in te rm s o f sinu­ so id al (o r co m p lex e x p o n e n tia l) c o m p o n e n ts. W ith such a d e c o m p o s itio n , a signal is said to be re p re se n te d in th e f r e q u e n c y domai n . A s w e shall d e m o n s tra te , m ost signals o f p ractical in te re st can be d eco m p o sed in to a sum o f sin u so id al signal c o m p o n e n ts. F o r th e class of p e rio d ic signals, such a d eco m p o sitio n is called a Fouri er series. F o r th e class o f finite e n e rg y signals, the d eco m p o sitio n is called th e Fouri er t ransf orm. T h e se d e c o m p o s itio n s are ex trem ely im p o rta n t in th e an aly sis o f L T I system s becau se th e re sp o n se o f a n L T I system to a sin u so id al in p u t signal is a sin u so id o f th e sam e freq u e n c y b u t o f d iffe re n t am pli­ tu d e a n d p h ase. F u rth e rm o re , th e lin e a rity p ro p e rty o f th e L T I sy stem im plies th a t a lin ear sum o f sin u so id al c o m p o n e n ts at th e in p u t p ro d u c e s a sim ilar lin e a r sum o f sin u so id al c o m p o n e n ts a t th e o u tp u t, w hich d iffer only in th e a m p litu d e s and p h ases fro m th e in p u t sin u so id s. T h is c h a ra c te ristic b e h a v io r o f L T I sy stem s ren ­ d e rs th e sin u so id al d e c o m p o sitio n o f signals v ery im p o rta n t. A lth o u g h m an y o th er d e c o m p o sitio n s o f signals a re p o ssib le, only th e class o f sin u so id al (o r co m p lex ex­ p o n e n tia l) signals p o ssess th is d e sira b le p ro p e rty in passin g th ro u g h an L T I system . W e begin o u r stu d y o f fre q u e n c y analysis o f signals w ith th e re p re se n ta tio n o f co n tin u o u s-tim e p e rio d ic a n d a p e rio d ic signals by m e a n s of th e F o u rie r series an d th e F o u rie r tra n sfo rm , resp ec tiv ely . T h is is follow ed by a p a ra lle l tre a tm e n t o f d isc rete-tim e p erio d ic a n d a p e rio d ic signals. T h e p r o p e rtie s o f th e F o u rie r tra n sfo rm a re d e sc rib e d in d e ta il an d a n u m b e r of tim e -fre q u e n c y d u alities are p re se n te d . 4.1 FREQUENCY ANALYSIS OF CONTINUOUS-TIME SIGNALS It is w ell k n o w n th a t a prism can be u sed to b re a k u p w h ite light (su n lig h t) in to the co lo rs o f th e ra in b o w (see Fig. 4.1a). In a p a p e r su b m itte d in 1672 to th e R oyal Society, Isaac N e w to n u se d th e te rm spe ct r um to d escrib e th e c on t i n u o u s b an d s 230 Sec. 4.1 231 Frequency Analysis of Continuous-Time Signals Glass prism Figure 4.1 (a) Analysis and ( b ) sy n th e sis o f th e w h ite light (s u n lig h t) u sin g glass p rism s. o f co lo rs p ro d u c e d by this a p p a ra tu s. T o u n d e rsta n d this p h e n o m e n o n , N ew to n p laced a n o th e r p rism u pside-dow rn w ith resp ec t to th e first, an d sh o w ed th a t th e co lo rs b le n d e d back into w hite light, as in Fig. 4.1b, By in se rtin g a slit b etw een the tw o p rism s a n d blo cking o n e o r m o re colors from h ittin g the se co n d prism , he sh o w ed th a t th e rem ix ed light is no lo n g er w hite. H e n c e th e light passing th ro u g h th e first p rism is sim ply an aly zed into its c o m p o n e n t co lo rs w ith o u t any o th e r ch an g e. H o w e v e r, o n ly if we mix again all o f th ese c o lo rs d o we o b ta in the o rig in a l w hite light. L a te r, Jo s e p h F r a u n h o f e r ( 1 7 8 7 - 1 8 2 6 ) . in m a k in g m e a s u r e m e n ts o f lig h t e m itt e d b y th e su n a n d s ta r s , d is c o v e r e d th a t th e s p e c tr u m o f th e o b s e r v e d lig h t c o n s is ts o f d is tin c t c o l o r lin e s . A fe w y e a r s la te r ( m i d - ] 8 0 0 s ) G u s ta v K i r c h h o f f a n d R o b e r t B u n s e n fo u n d th a t e a c h c h e m ic a l e le m e n t, w h e n h e a te d to in c a n d e s c e n c e , r a d ia te d its o w n d is tin c t c o lo r o f lig h t. A s a c o n s e q u e n c e , e a c h c h e m ic a l e le m e n t c a n b e id e n tifie d b y its o w n lin e sp e ctru m . F r o m p h y s ic s w e k n o w th a t e a c h c o lo r c o r r e s p o n d s to a s p e c ific f r e q u e n c y o f th e v is ib le s p e c tr u m . H e n c e th e a n a ly sis o f lig h t in to c o lo r s is a c tu a lly a f o r m o f fr e q u e n c y a n a ly s is . F r e q u e n c y a n a ly s is o f a s ig n a l in v o lv e s th e r e s o lu tio n o f th e s ig n a l in to its fr e q u e n c y ( s in u s o id a l) c o m p o n e n ts . In s te a d o f lig h t, o u r s ig n a l w a v e fo r m s a re b a s ic a lly fu n c tio n s o f tim e . T h e r o le o f th e p ris m is p la y e d b y th e F o u r i e r a n a ly sis to o ls th a t w e w ill d e v e lo p : th e F o u r ie r s e r ie s a n d th e F o u r i e r t r a n s f o r m . The r e c o m b in a tio n o f th e s in u s o id a l c o m p o n e n ts to r e c o n s tr u c t th e o r ig in a l s ig n a l is b a s ic a lly a F o u r i e r s y n th e s is p r o b le m . T h e p r o b le m o f s ig n a l a n a ly s is is b a s ic a lly th e s a m e fo r th e c a s e o f a s ig n a l w a v e fo rm a n d f o r th e c a s e o f th e lig h t f r o m h e a te d c h e m ic a l c o m p o s itio n s . J u s t a s in th e c a s e o f c h e m ic a l c o m p o s itio n s , d if f e r e n t s ig n a l w a v e fo r m s h a v e d iffe r e n t s p e c tr a . T h u s th e s p e c tr u m p r o v id e s a n “ id e n tity ” 232 Frequency Analysis of Signals and Systems Chap. 4 o r a s ig n a tu r e f o r th e s ig n a l in th e s e n s e t h a t n o o t h e r s ig n a l h a s th e s a m e sp e c tru m . A s w e w ill s e e , th is a ttr ib u te is r e la te d to th e m a th e m a tic a l t r e a t m e n t o f fre q u e n c y d o m a in te c h n iq u e s . I f w e d e c o m p o s e a w a v e fo r m in to s in u s o id a l c o m p o n e n ts , in m u c h th e sa m e w ay t h a t a p ris m s e p a r a te s w h ite lig h t in to d iffe r e n t c o lo r s , th e su m o f th e s e s in u s o id a l c o m p o n e n ts re s u lts in th e o r ig in a l w a v e fo r m . O n th e o t h e r h a n d , if any o f th e s e c o m p o n e n ts is m is s in g , th e r e s u lt is a d if f e r e n t s ig n a l. I n o u r tr e a t m e n t o f fr e q u e n c y a n a ly s is , w e w ill d e v e lo p th e p r o p e r m a th e ­ m a tic a l to o ls ( “ p r is m s ” ) f o r th e d e c o m p o s itio n o f s ig n a ls ( “ l i g h t ” ) in to s in u so id a l f r e q u e n c y c o m p o n e n ts ( c o l o r s ) . F u r t h e r m o r e , th e t o o ls ( “ in v e r s e p r is m s " ) f o r sy n ­ th e s is o f a g iv e n s ig n a l f r o m its f r e q u e n c y c o m p o n e n ts w ill a ls o b e d e v e lo p e d . T h e b a s ic m o t iv a tio n f o r d e v e lo p in g th e fr e q u e n c y a n a ly s is to o ls is to p ro v id e a m a th e m a tic a l a n d p ic to r ia l r e p r e s e n t a t io n f o r th e f r e q u e n c y c o m p o n e n ts th a t a re c o n ta in e d in a n y g iv e n s ig n a l. A s in p h y s ic s , th e te r m s pe ct r um is u s e d w h e n r e f e r ­ rin g t o th e fr e q u e n c y c o n t e n t o f a s ig n a l. T h e p r o c e s s o f o b ta in in g th e s p e c tru m o f a g iv e n sig n a l u sin g th e b a s ic m a th e m a tic a l t o o ls d e s c r ib e d in th is c h a p te r is k n o w n a s f re q u e n c y o r spectral analysis. In c o n tr a s t, th e p r o c e s s o f d e te r m in in g th e s p e c tr u m o f a s ig n a l in p r a c tic e , b a s e d o n a c tu a l m e a s u r e m e n ts o f th e sig n a l, is c a lle d spect rum estimation. T h is d is tin c tio n is v e r y im p o r ta n t. In a p r a c tic a l p r o b le m th e s ig n a l to b e a n a ly z e d d o e s n o t le n d it s e lf to a n e x a c t m a th e m a tic a l d e s c r ip tio n . T h e s ig n a l is u s u a lly s o m e i n f o r m a tio n - b e a r in g s ig n a l fr o m w h ich we a r e a tte m p tin g t o e x t r a c t th e r e le v a n t in f o r m a tio n . I f th e in f o r m a tio n th a t w e wish to e x t r a c t c a n b e o b ta in e d e i t h e r d ir e c tly o r in d ir e c tly fr o m th e s p e c tr a l c o n te n t o f th e s ig n a l, w e c a n p e r fo r m spe ct rum est imation o n th e in f o r m a t io n - b e a r in g sig n a l, a n d th u s o b ta in a n e s tim a te o f th e s ig n a l s p e c tr u m . In f a c t, w e c a n v iew s p e c tra l e s tim a tio n as a ty p e o f s p e c tr a l a n a ly s is p e r fo r m e d o n s ig n a ls o b t a i n e d f r o m p h y si­ ca l s o u r c e s (e .g ., s p e e c h , E E G , E C G , e t c .) . T h e in s tr u m e n ts o r s o f tw a r e p r o g ra m s u se d t o o b ta in s p e c tr a l e s tim a te s o f s u c h s ig n a ls a r e k n o w n a s sp e c t r u m analyzers. H e r e , w e w ill d e a l w ith s p e c tr a l a n a ly s is . H o w e v e r , in C h a p t e r 12 w e sh all t r e a t th e s u b je c t o f p o w e r s p e c tr u m e s tim a tio n . 4.1.1 The Fourier Series for Continuous-Time Periodic Signals In th is s e c tio n w e p r e s e n t th e f r e q u e n c y a n a ly s is to o ls fo r c o n tin u o u s - tim e p e ­ r io d ic s ig n a ls . E x a m p le s o f p e r io d ic s ig n a ls e n c o u n te r e d in p r a c t i c e a r e s q u a re w a v e s , r e c ta n g u la r w a v e s , tr ia n g u la r w a v e s , a n d o f c o u r s e , s in u s o id s a n d c o m p le x e x p o n e n tia ls . T h e b a s ic m a th e m a tic a l r e p r e s e n ta tio n o f p e r io d ic s ig n a ls is th e F o u r i e r s e ­ r ie s , w h ic h is a lin e a r w e ig h te d su m o f h a r m o n ic a lly r e la te d s in u s o id s o r c o m p le x e x p o n e n tia ls . J e a n B a p t is t e J o s e p h F o u r i e r ( 1 7 6 8 - 1 8 3 0 ) , a F r e n c h m a th e m a tic ia n , u se d s u c h t r ig o n o m e t r ic s e r ie s e x p a n s io n s in d e s c r ib in g th e p h e n o m e n o n o f h ea t c o n d u c tio n a n d te m p e r a tu r e d is tr ib u tio n th r o u g h b o d ie s . A lth o u g h h is w o r k was m o t iv a te d b y th e p r o b le m o f h e a t c o n d u c tio n , th e m a th e m a tic a l te c h n iq u e s th a t Sec. 4.1 Frequency Analysis of C ontinuous-Tim e Signals 233 h e d e v e lo p e d d u rin g th e e a r ly p a r . o f th e n in e t e e n t h c e n tu r y n o w fin d a p p lic a ­ tio n in a v a r ie ty o f p r o b le m s e n c o r r .r \ is s in g m a n y d if f e r e n t f ie ld s , in c lu d in g o p tic s , v ib r a tio n s in m e c h a n ic a l s y s te m s , s y s t e m th e o r y , a n d e le c t r o m a g n e t ic s . F r o m C h a p t e r 1 w e r e c a ll t h .i : a lin e a r c o m b in a t io n o f h a r m o n ic a lly r e la te d c o m p le x e x p o n e n tia ls o f th e fo r m x {r) = Y cke j 2 * kF»‘ ( 4 .1 .1 ) i = -3C is a p e r io d ic s ig n a l w ith f u n d a m e n t a l p e r io d Tp = 1/Fo. H e n c e w e c a n th in k o f th e e x p o n e n t ia l s ig n a ls { e i i x k p k = Q ± i i± 2 l a s th e b a s ic “ b u ild in g b lo c k s ” f r o m w h ic h w e c a n c o n s t r u c t p e r io d ic s ig n a ls o f v a r io u s ty p e s b y p r o p e r c h o ic e o f t h e fu n d a m e n ta l f r e q u e n c y a n d th e c o e f f ic ie n ts ( q ). F o d e te r m in e s th e f u n d a m e n ta l p e r i o d o f x ( t ) a n d th e c o e f f ic ie n t s { } s p e c ify th e s h a p e o f th e w a v e fo rm . S u p p o s e th a t w e a r e g iv e n a p e r io d i c s ig n a l x { i) w ith p e r io d Tp . W e ca n r e p r e s e n t th e p e r io d ic sig n a l by t h e s e r ie s ( 4 .1 .1 ) , c a lle d a F o u r ie r series, w 'here th e f u n d a m e n ta l fr e q u e n c y Fo is s e l e c t e d to b e th e r e c ip r o c a l o f th e g iv e n p e r io d Tp . T o d e te r m in e th e e x p r e s s io n t o r th e c o e f f i c i e n t s ( q ) , w e firs t m u ltip ly b o th sid e s o f ( 4 .1 .1 ) b y th e c o m p le x e x p o n e n t i a l Fltl! w h e r e I is a n in t e g e r an d th e n in t e g r a t e b o th s id e s o f th e r e s u ltin g e q u a tio n o v e r a s in g le p e r io d , s a y fr o m 0 to T r , o r m o r e g e n e r a lly , fr o m fo to r0 + T p, w h e r e i o is a n a r b itr a r y b u t m a th e m a tic a lly c o n v e n i e n t s ta r t in g v a lu e . T h u s w e o b ta in fh>+Tr J' r'o+Tr x ( t ) e - j2*IF,''dt = J' I g- j t oi Kt / oc \ cke+J2nkF"' J di (4.1.2) T o e v a lu a te th e in te g r a l o n th e r ig h t- h a n d s id e o f ( 4 .1 .2 ) , w e in te r c h a n g e th e o r d e r o f th e s u m m a tio n a n d in te g r a tio n a n d c o m b in e th e tw o e x p o n e n tia ls . H e n c e rl sc £ ,, + r . c* I OC ei2* F»{k-'"dt = £ i = —oc k= —oc p j27rF < M -hl Ck - |'n + r , J l n F o i k - /)_ ( 4 .1 .3 ) F o r k ^ I, th e r ig h t-h a n d s id e o f ( 4 .1 .3 ) e v a lu a te d a t th e lo w e r a n d u p p e r lim its , Zo a n d t0 + Tp , r e s p e c tiv e ly , y ie ld s z e r o . O n th e o t h e r h a n d , if k = /, w e h a v e fJtn di — i Consequently, (4.1.2) reduces to '■‘o+Tp fJ /ft x ( t ) e - j2 * ,Fo'd t = c ,T p Frequency Analysis of Signals and System s 234 Chap. 4 a n d t h e r e f o r e th e e x p r e s s io n f o r th e F o u r i e r c o e f fic ie n ts in t e r m s o f th e g iv e n p e r io d ic s ig n a l b e c o m e s fto+TP I c, = — x ( l ) e - jlw,F"'dt Tp S in c e fo is a r b itr a r y , th is in te g r a l c a n b e e v a lu a te d o v e r a n y i n te r v a l o f le n g th Tp, th a t is, o v e r a n y in te r v a l e q u a l t o th e p e r io d o f th e s ig n a l jr ( r ) . C o n s e q u e n tly , th e in te g r a l fo r th e F o u r i e r s e r ie s c o e f f ic ie n t s w ill b e w r itte n as c, = — f x ( t ) e ~ j2nlF,>'d t ( 4 .1 .4 ) Tp J t„ A n im p o r ta n t is s u e th a t a r is e s in th e r e p r e s e n ta tio n o f th e p e r io d ic s ig n a l x ( t ) b y th e F o u r ie r s e r ie s is w h e t h e r o r n o t th e s e r ie s c o n v e r g e s t o * ( f ) f o r e v e ry v a lu e o f r, th a t is, if th e s ig n a l x (t ) a n d its F o u r ie r s e r ie s r e p r e s e n t a t io n OC c ke j2 * kFtt' £ ( 4 .1 .5 ) A=-oc a r e e q u a l a t e v e r y v a lu e o f t. T h e s o -c a lle d D ir ic h le t c o n d it io n s g u a r a n te e th a t th e s e r ie s ( 4 .1 .5 ) w ill b e e q u a l to x ( t ), e x c e p t a t th e v a lu e s o f i f o r w h ich jc (r ) is d is c o n tin u o u s . A t th e s e v a lu e s o f r, ( 4 .1 .5 ) c o n v e r g e s t o th e m id p o in t (a v e r a g e v a lu e ) o f th e d is c o n tin u ity . T h e D i r ic h l e t c o n d itio n s a r e : 1 . T h e s ig n a l .r ( f ) h a s a fin ite n u m b e r o f d is c o n tin u itie s in a n y p e r io d . 2 . T h e sig n a l x ( t ) c o n ta in s a fin ite n u m b e r o f m a x im a an d m in im a d u rin g an y p e rio d . 3 . T h e s ig n a l x (t ) is a b s o lu te ly in te g r a b le in a n y p e r io d , t h a t is. f \x (t )\d t < oo ( 4 .1 .6 ) J Tr A lt p e r io d ic s ig n a ls o f p r a c tic a l i n te r e s t s a tis fy th e s e c o n d itio n s . T h e w e a k e r c o n d itio n , t h a t th e s ig n a l h a s fin ite e n e r g y in o n e p e r io d , j \x ( t ) \2d i < o c ( 4 .1 .7 ) J tp g u a r a n te e s th a t th e e n e r g y in th e d if f e r e n c e s ig n a l OC e (t) = x { t ) - Ckej2”kF"' k=—oc is z e r o , a lth o u g h * ( ; ) a n d its F o u r i e r s e r ie s m a y n o t b e e q u a l f o r a ll v a lu e s o f t. N o te th a t ( 4 .1 .6 ) im p lie s ( 4 .1 .7 ) , b u t n o t v ic e v e r s a . A l s o , b o t h ( 4 .1 .7 ) a n d th e D ir i c h le t c o n d itio n s a r e s u f fic ie n t b u t n o t n e c e s s a r y c o n d itio n s ( i .e ., th e r e a r e s ig ­ n a ls t h a t h a v e a F o u r ie r s e r ie s r e p r e s e n t a t i o n b u t d o n o t s a tis fy t h e s e c o n d itio n s ) . In s u m m a r y , i f x ( t ) is p e r io d ic a n d s a tis fie s th e D i r ic h l e t c o n d itio n s , it ca n b e r e p r e s e n te d in a F o u r i e r s e r ie s a s in ( 4 .1 .1 ) , w h e r e th e c o e f f i c i e n t s a r e s p e c ifie d b y ( 4 .1 .4 ) . T h e s e r e la t io n s a r e s u m m a r iz e d b e lo w . Sec. 4.1 Frequency Analysis of Continuous-Time Signals 235 FR E Q U E N C Y A N A LY S IS O F C O N T IN U O U S -TIM E PE R IO D IC S IG N A LS Synthesis equation -vU) = ^ Analysis equation ct = y j 1r Jrp (4.1.8) cke,2~kl'"' (4.1.9) In g e n e r a l, th e F o u r i e r c o e ff ic ie n ts c k a r e c o m p le x v a lu e d . e a s ily sh o w n t h a t if th e p e r io d ic s ig n a l is r e a l, c k a n d M o r e o v e r , it is a r e c o m p le x c o n ju g a te s . A s a r e s u lt, if ct = \ck\e}b‘ th e n C-U ~~ C o n s e q u e n tly , th e F o u r i e r s e r ie s m ay a ls o b e r e p r e s e n te d in t h e fo r m rv a (M = 2 (-•(, + k i I c o s 0 - 7 1 k F()t + 6k ) ( 4 .1 .1 0 ) n-i w h e r e t,, is r e a l v a lu e d w h e n x ( i) is r e a l. F in a lly , w e s h o u ld in d ic a te th a t y e t a n o th e r fo r m f o r th e F o u r ie r s e r ie s ca n b e o b ta in e d by e x p a n d in g th e c o s in e fu n c tio n in ( 4 .1 .1 0 ) as c o s ( 2 jt A / v + 0k) — c o s 2 n k F o i c o s 0t — s i n l n k F ^ r s in fy C o n s e q u e n tly , w e c a n re w r ite ( 4 .1 .1 0 ) in th e fo rm 3t ji ( r ) — ao + Y 2 ( a ic c o $ 2 n k F o t — bk s i n 2 -n k F o i) ( 4 .1 .1 1 ) 1=1 w h ere <3() = Co fl* = 2|C|- [ c o s 0k bk = 2|q| sin # * T h e e x p r e s s io n s in ( 4 .1 .8 ) , ( 4 ,1 .1 0 ) , a n d ( 4 .1 ,1 1 ) c o n s t itu te t h r e e e q u iv a le n t fo r m s f o r th e F o u r i e r s e r ie s r e p r e s e n ta tio n o f a re a l p e r io d ic s ig n a l. 4.1.2 Power Density Spectrum of Periodic Signals A p e r io d ic s ig n a l h a s in fin ite e n e r g y a n d a fin ite a v e r a g e p o w e r , w h ic h is g iv e n a s Px = ~ f P •'T . \x ( t ) \2d t ( 4 .1 .1 2 ) Frequency Analysis of Signals and Systems 236 Chap. 4 I f w e ta k e th e c o m p le x c o n ju g a te o f ( 4 .1 .8 ) an d s u b s t itu te f o r * * ( / ) in ( 4 .1 .1 2 ) . we o b ta in OC ( 4 .1 .1 3 ) DC = E k~ —3C T h e r e f o r e , w e h a v e e s ta b lis h e d th e r e la tio n ( 4 .1 .1 4 ) w h ich is c a lle d P a r s e v a l's re la tio n fo r p o w e r s ig n a ls . T o illu s tr a te th e p h y s ic a l m e a n in g o f ( 4 .1 .1 4 ) , s u p p o s e th a t .v(r) c o n s is ts o f a s in g le c o m p le x e x p o n e n tia l x (t) = c , e j27!tFn' In th is c a s e , all th e F o u r ie r s e r ie s c o e f f ic ie n ts e x c e p t c* a r e z e r o . C o n s e q u e n tly , th e a v e r a g e p o w e r in th e sig n a l is It is o b v io u s th a t |q |: r e p r e s e n ts th e p o w e r in th e Ath h a r m o n ic c o m p o n e n t o f th e sig n a l. H e n c e th e to ta l a v e r a g e p o w e r in th e p e r io d ic sig n a l is s im p ly th e su m o f th e a v e r a g e p o w e r s in a ll th e h a r m o n ic s . I f w e p lo t th e |q|2 as a fu n c t io n o f th e f r e q u e n c ie s kF o, k = 0 , ± 1 , ± 2 ..........th e d ia g r a m th a t w e o b ta in sh o w s h o w th e p o w e r o f th e p e r io d ic s ig n a l is d is tr ib u te d a m o n g th e v a r io u s f r e q u e n c y c o m p o n e n ts . T h is d ia g r a m , w h ic h is illu s tr a te d in F ig . 4 .2 , is c a lle d th e p o w e r d e n sity sp e ctru m * o f th e p e r io d ic s ig n a l x ( t ). S in c e th e Pow er density spectrum - 4 F 0 - 3 F 0 —2Fn —F0 Figure 4.2 lct P 0 Fn 2F0 3F0 4F0 Frequency. F Pow er density spectrum of a continuous-tim e periodic signal. ‘ This function is also called the power spectral density or. simply, the power spectrum. 237 Frequency Analysis of Continuous-Time Signals Sec. 4.1 p o w e r in a p e r io d ic s ig n a l e x is ts o n ly at d is c r e te v a lu e s o f f r e q u e n c ie s ( i .e .. F — 0. ± F o . ± 2 F q . . . . ) . th e s ig n a l is s a id to h a v e a lin e sp e ctru m . T h e s p a c in g b e tw e e n tw o c o n s e c u tiv e s p e c tr a l lin e s is e q u a l to th e r e c ip r o c a l o f th e fu n d a m e n ta l p e rio d Tp . w h e r e a s th e s h a p e o f th e s p e c tr u m ( i.e .. th e p o w e r d is tr ib u tio n o f th e s ig n a l), d e p e n d s o n th e tim e -d o m a in c h a r a c t e r is t ic s o f th e sig n a l. A s in d ic a te d in th e p r e c e d in g s e c t i o n , th e F o u r ie r s e r ie s c o e f f ic ie n ts ( q ) a re c o m p le x v a lu e d , th a t is. th e y c a n b e r e p r e s e n te d as Ck = \ck\eJhL w h ere 6k = 4-Q In s te a d o f p lo ttin g th e p o w e r d e n sity s p e c tr u m , w e c a n p lo t th e m a g n itu d e v o lta g e s p e c tr u m {|ot|} a n d th e p h a s e s p e c tr u m {(?*} as a fu n c tio n o f f r e q u e n c y . C le a r ly , th e p o w e r s p e c tr a l d e n s ity in th e p e r io d ic s ig n a l is s im p ly th e s q u a r e o f th e m a g n itu d e s p e c tr u m . T h e p h a s e in fo r m a tio n is to ta lly d e s tr o y e d ( o r d o e s n o t a p p e a r ) in th e p o w e r s p e c tr a l d e n s ity . I f th e p e r io d ic sig n a l is re a l v a lu e d , th e F o u r ie r s e r ie s c o e f f ic ie n ts { c * } sa tis fy th e c o n d itio n c -k = C o n s e q u e n tly . Ki|: = |q|: . H e n c e th e p o w e r s p e c tru m is a s y m m e tr ic fu n c tio n o f f r e q u e n c y . T h i s c o n d itio n a ls o m e a n s th a t th e m a g n itu d e s p e c tr u m is s y m m e tr ic ( e v e n f u n c t io n ) a b o u t th e o rig in an d th e p h a s e s p e c tru m is a n o d d fu n c tio n . As a c o n s e q u e n c e o f th e s y m m e tr y , it is s u ffic ie n t to s p e c ify th e s p e c tr u m o f a re a l p e r io d ic sig n a l f o r p o s itiv e f r e q u e n c ie s o n ly . F u r th e r m o r e , th e to ta l a v e r a g e p o w e r c a n b e e x p r e s s e d as Px — + 2 1q | ( 4 .1 .1 5 ) ( 4 .1 .1 6 ) w h ich fo llo w s d ir e c t ly fro m th e r e la tio n s h ip s g iv e n in S e c t io n 4 .1 .1 a m o n g { aa }, {bn }. a n d ( q ) c o e f fic ie n ts in th e F o u r ie r s e r ie s e x p r e s s io n s . Example 4.1.1 Determ ine the Fourier series and the power density spectrum of the rectangular pulse train sienal illustrated in Fie. 4.3. x(t) -T„ Figure 4 J Continuous-time periodic tram of rectangular pulses. 238 Chap. 4 Frequency Analysis of Signals and System s Solution The signal is periodic with fundam ental period Tp and. clearly, satisfies the Dirichlet conditions. Consequently, we can represent the signal in the Fourier series given by (4.1.8) with the Fourier coefficients specified by (4.1.9). Since x(t) is an even signal [i.e.. x(t) = * ( - ;) ] , it is convenient to select the integration interval from ~ T p/2 to Tp/2. Thus (4.1.9) evaluated for k = 0 yields (4.1.17) The term c(I represents the average value (dc com ponent) of the signal .r (r). For k ^ 0 we have Tp l ~j2TTkFn\ _ jri ej*yf-i,r _ A tt F»kTp A t sin TrkF^r Tp (4.1.18) )2 k = ± 1 .± 2 . ... n k F\\T It is interesting to note that the right-hand side of (4.1.18) has the form (sin 4>)/4>, where <p = n k F ^ . In this case <t>takes on discrete values since F(, and r are fixed and the index k varies. However, if we plot (sin $)/</> with 0 as a continuous param eter over the range —oc < <t> < oc, we obtain the graph shown in Fig. 4.4. We observe that this function decays to zero as 0 —<■ ± x . has a maximum value of unity at <p = 0, and is zero at multiples of tt (i.e., at < p= mn. m = ±1, ± 2 ,...) . It is clear that the Fourier coefficients given by (4.1.18) are the sample values of the (sin <p)/<p function for <$>— xkFut and scaled in amplitude by A t / T p. Since the periodic function x{t) is even, the Fourier coefficients c* are real. Consequently, the phase spectrum is either zero, when c* is positive, or t t when c k is negative. Instead of plotting the m agnitude and phase spectra separately, we may sim­ ply plot |c*} on a single graph, showing both the positive and negative values ck on the graph. This is commonly done in practice when the Fourier coefficients {c*} are real. Figure 4.5 illustrates the Fourier coefficients of the rectangular pulse train when Tp is fixed and the pulse width t is allowed to vary. In this case Tp = 0.25 second, so that F() = \ j T p = 4 Hz and t = 0.057),, t = 0.17},, and r = 0.27),. We observe that the effect of decreasing r while keeping Tp fixed is to spread out the signal power over the frequency range. The spacing between adjacent spectral lines is F{) = 4 Hz, independent of the value of the pulse width r. sin <p - I n —6n -57T —4n —3jt —2n —n n 2n 3n 0 Figure 4.4 The function (sin <p)/<p. 4k 5n bn In <j> Sec. 4.1 ck ,mTrnit» 239 Frequency Analysis of Continuous-Time Signals “J lU jii " vfffilllll I l k , t = 0.1 Tp u -itrnrm-i. JJiLLUTT j ct F T = 0.05 Tr ..................rrnTfniniiin|fnijnnfiiifiii........... ... F 0 and the pulse width r varies. On the other hand, it is also instructive to fix t and vary the period Tp when Tp > r. Figure 4 .6 illustrates this condition when T,, ~ 5r. Tr = lOr. and Tp = 2 0 t . In this case, the spacing between adjacent spectral lines decreases as Tp increases. In the limit as Tr oc, the Fourier coefficients q approach zero due to the factor of Tp in the denom inator of (4 .1 .1 8 ). This behavior is consistent with the faci that as Tp —<■ oc and r remains fixed, the resulting signal is no longer a power signal. Instead, Cl ...... ...................IMn 1’' ..,.((111111 lllllllli,.. 0 Tp = 20r 'M illin '" F Figure 4.6 Fourier coefficient of a rectangular pulse train with fixed pulse width t and varying period Tp . 240 Frequency Analysis of Signals and Systems Chap. 4 it becomes an energy signal and its average power is zero. The spectra of finite energy signals are described in the next section. We also note that if k / 0 and sm(7ikFnx) = 0. then ct = 0. The harmonics with zero power occur at frequencies kF0 such that n{kFG)r = m n , m = ±1, ± 2 ,. o r at JtF0 = m jx. For example, if F() = 4 Hz and t = Q.2TP, it follows that the spectral components at ±20 Hz, ± 40 H z , . .. have zero power. These frequencies correspond to the Fourier coefficients k = ±5, ±10, ± 15........O n the other hand, if r = 0.1Tp, the spectral components with zero power are k = ±10, ±20, ± 3 0 ........ The power density spectrum for the rectangular pulse train is 4.1.3 The Fourier Transform for Continuous-Time Aperiodic Signals In Section 4.1.1 w e d evelop ed the Fourier series to represent a periodic signal as a linear com bination o f harm onically related com p lex exp on en tials. A s a con­ seq u en ce o f the periodicity, w e saw that these signals possess line spectra with equidistant lines. T h e line spacing is equal to the fundam ental frequency, which in turn is the inverse o f the fundam ental period of the signal. W e can view the fundam ental period as providing the num ber o f lin es per unit o f frequency (line d en sity), as illustrated in Fig. 4.6. W ith this interpretation in m ind, it is apparent that if w e allow the period to increase w ithout limit, the line spacing tends toward zero. In the limit, when the period b eco m es infinite, the signal b eco m es aperiodic and its spectrum becom es continuous. This argum ent suggests that the spectrum of an ap eriod ic signal will b e the en v elo p e o f the line spectrum in the corresponding p eriod ic signal obtained by repeating the aperiodic signal with som e period Tp. L et us consider an aperiodic signal x ( t ) with finite duration as show n in Fig. 4.7a. From this aperiodic signal, w e can create a periodic signal * , , ( 0 with p e­ riod Tp, as shown in Fig. 4.7b. Clearly, x r (t) = x ( t ) in the limit as Tp oo, that is, x{t) = lim x p(t) This interpretation im plies that w e should be able to obtain the spectrum of * (/) from the spectrum o f x p(i) sim ply by taking the limit as Tp -*■ oo. W e begin with the Fourier series representation o f x p(t). xp{t) = £ ckej l ^ ' 1 F0 = y (4.1.20) where (4.1.21) Sec. 4.1 241 Frequency Analysis o1 Continuous-Time Signals ,r(n - T„ -TJ2 TJ2 0 TJ2 i Figure 4.7 (a) Aperiodic signal ,v(/) and (b) periodic signal xr U) constructed bv repeating x(t) with a period Tr . (h) S in c e x p (t) — x (/ ) f o r ~ T r f 2 < t < Tp/ 2 , ( 4 .1 .2 1 ) c a n b e e x p r e s s e d as 1 'Tr /2 = — / x ( t ) e ~ )27' kF'', d t Tp J-Trfl ( 4 .1 .2 2 ) It is a ls o tr u e th a t .* (r ) = 0 fo r |r| > Tpj2 . C o n s e q u e n tly , th e lim its o n th e in te g r a l in ( 4 .1 .2 2 ) c a n b e r e p la c e d b y —o c an d o c . H e n c e ct = — f x { t ) e ~ j2 * kF"’ d t ( 4 .1 .2 3 ) Tp J-oc L e t us n o w d e fin e a fu n c tio n X ( F ) , c a lle d th e F o u r ie r tra n sfo rm o f * { / ) , as X (F) = f x (t)e ~ lln F , dt ( 4 .1 .2 4 ) J-oc A' ( F ) F q. is a fu n c t io n o f th e c o n tin u o u s v a r ia b le F . I t d o e s n o t d e p e n d o n Tp o r H o w e v e r , i f w e c o m p a r e ( 4 .1 .2 3 ) a n d ( 4 .1 .2 4 ) , it is c l e a r th a t th e F o u r ie r c o e f f ic ie n t s ct c a n b e e x p r e s s e d in te r m s o f X ( F ) as c* = ^ X ( k F o ) 1p o r e q u iv a le n tly . Tpc k = X ( k F 0) = X ( 4 A .2 5 ) T h u s th e F o u r i e r c o e ff ic ie n ts a r e s a m p le s o f X ( F ) ta k e n a t m u ltip le s o f f o a n d s c a le d b y F 0 (m u ltip lie d b y \ / T p). S u b s titu tio n f o r c t f r o m ( 4 .1 .2 5 ) in to ( 4 .1 .2 0 ) y ie ld s V O = ^r 'jh x ( ^ r ) er M (4 .1 .2 6 ) 242 Frequency Analysis of Signals and Systems W e w ish to ta k e th e lim it o f ( 4 .1 .2 6 ) a s T r a p p r o a c h e s in fin ity . Chap, 4 F i r s t , w e d e fin e A F = 1/7},. W ith th is s u b s t itu tio n , ( 4 .1 .2 6 ) b e c o m e s xpU ) = Y2 X (k & F )e JlxkAFi ( 4 .1 .2 7 ) k=-x I t is c l e a r th a t in th e lim it as Tp a p p r o a c h e s in fin ity , x p {t) r e d u c e s to jc(/ ). A ls o , A F b e c o m e s th e d iff e r e n tia l d F a n d k A F b e c o m e s th e c o n tin u o u s f r e q u e n c y v a ria b le F. In tu r n , th e s u m m a tio n in ( 4 .1 .2 7 ) b e c o m e s a n in te g r a l o v e r th e fr e q u e n c y v a r ia b le F . T h u s ( 4 .1 .2 8 ) T h is in te g r a l r e la tio n s h ip y ie ld s x ( t ) w h e n X ( F ) is k n o w n , a n d it is c a lle d th e in erse F o u r ie r tra n sfo rm . T h is c o n c lu d e s o u r h e u r is tic d e r iv a tio n o f th e F o u r i e r tr a n s f o r m p a ir g iv e n b y ( 4 .1 .2 4 ) an d ( 4 .1 .2 8 ) f o r an a p e r io d ic s ig n a l x ( t ). A lth o u g h th e d e r iv a tio n is n o t m a th e m a tic a lly rig o r o u s , it le d to th e d e s ir e d F o u r i e r t r a n s f o r m re la tio n s h ip s w ith r e la tiv e ly s im p le in tu itiv e a r g u m e n ts . In s u m m a r y , th e f r e q u e n c y a n a ly s is o f c o n tin u o u s -tim e a p e r io d ic s ig n a ls in v o lv e s th e fo llo w in g F o u r i e r tr a n s f o r m p a ir. FR EQ U EN C Y ANALYSIS O F C O N T IN U O U S -T IM E A P ER IO DIC SIGN ALS Synthesis equation inverse transform (4 .1 .2 9 ) Analysis equation direct transform ( 4 .1 .3 0 ) I t is a p p a r e n t th a t th e e s s e n tia l d if f e r e n c e b e tw e e n th e F o u r i e r s e r ie s a n d th e F o u r i e r tr a n s fo r m is th a t th e s p e c tr u m in th e l a t t e r c a s e is c o n tin u o u s a n d h e n c e th e s y n th e s is o f an a p e r io d ic s ig n a l fr o m its s p e c tr u m is a c c o m p lis h e d b y m e a n s o f in te g r a tio n in s te a d o f s u m m a tio n . F in a lly , w e w ish to in d ic a te th a t th e F o u r ie r t r a n s f o r m p a ir in ( 4 .1 .2 9 ) and ( 4 .1 .3 0 ) c a n b e e x p r e s s e d in te r m s o f th e r a d ia n fr e q u e n c y v a r ia b le Q = 2nF. S in c e d F = d S l / l n . ( 4 .1 .2 9 ) a n d ( 4 .1 .3 0 ) b e c o m e ( 4 .1 .3 1 ) ( 4 .1 .3 2 ) T h e s e t o f c o n d itio n s th a t g u a r a n te e th e e x is t e n c e o f th e F o u r i e r tr a n s f o r m is th e Sec. 4.1 Frequency Analysis of Continuous-Time Signals 243 D ir ic h le t c o n d it io n s , w h ich m a y b e e x p r e s s e d as: 1 . T h e s ig n a l v (r) h as a fin ite n u m b e r o f fin ite d is c o n tin u itie s . 2 . T h e s ig n a l x ( t ) h a s a fin ite n u m b e r o f m a x im a a n d m in im a . 3 . T h e s ig n a l x ( t ) is a b s o lu te ly in te g r a b le , th a t is. \x (t )\d t < o c i: ( 4 .1 .3 3 ) T h e th ir d c o n d itio n fo llo w s e a s ily fr o m th e d e fin itio n o f th e F o u r i e r tr a n s f o r m , g iv e n in ( 4 .1 .3 0 ) . In d e e d . \ X(F)\ = jj x ( t ) e - J2” F ,dt < j \x ( t )\d t H e n c e ] X ( F ) ! < o c if ( 4 .1 .3 3 ) is s a tis fie d . A w e a k e r c o n d itio n f o r th e e x is te n c e o f th e F o u r i e r t r a n s f o r m is th a t x {t) h a s fin ite e n e r e v ; th a t is. |.v(/)|^r < o c ( 4 .1 .3 4 ) N o te th a t if a s ig n a l x ( i) is a b s o lu te ly in te g r a b le . it w ill a ls o h a v e fin ite e n e rg y . T h a t is. if £ |.v(/)!^r < o c J —CM th e n rx |.v(/)i“^/ < o c H o w e v e r , th e c o n v e r s e is n o t tr u e . ( 4 .1 .3 5 ) T h a t is. a s ig n a l m a y h a v e fin ite e n e r g y b u t m a y n o t b e a b s o lu te ly in te g r a b le . F o r e x a m p le , th e s ig n a l sin 2 n t x {t) = — -— 7 ( 4 .1 .3 6 ) Tt is s q u a r e in te g r a b le b u t is n o t a b s o lu te ly in te g r a b le . T h is s ig n a l h a s th e F o u r i e r tr a n s fo r m f1 * ( F ) = { o ; \FI < 1 (4 -1 .3 7 ) S in c e th is s ig n a l v io la te s ( 4 .1 .3 3 ) , it is a p p a r e n t th a t th e D i r i c h l e t c o n d itio n s a re s u ffic ie n t b u t n o t n e c e s s a r y f o r th e e x is te n c e o f th e F o u r i e r tr a n s f o r m . In a n y c a s e , n e a r ly all fin ite e n e r g y s ig n a ls h a v e a F o u r ie r tr a n s f o r m , s o t h a t w e n e e d n o t w o rry a b o u t th e p a th o lo g ic a l s ig n a ls , w h ich a r e s e ld o m e n c o u n t e r e d in p r a c tic e . 4.1.4 Energy Density Spectrum of Aperiodic Signals L e t x (t ) b e a n y fin ite e n e r g y s ig n a l w ith F o u r i e r t r a n s fo r m X ( F ) . Its e n e r g y is 244 Frequency Analysis of Signals and Systems Chap. 4 w hich, in turn, may be expressed in term s o f X ( F ) as follows: Ex - f x ( t ) x '( i) d t J —OC 1oo X '( F ) d F \ r /*oc / x { t ) e ~ j2 n F 'd t 'OC \ X ( F ) \ 2d F T h erefore, w e con clu d e that (4.1.38) This is P a r s e v a l’s re la tio n for aperiodic, finite energy signals and expresses the principle o f conservation of energy in the tim e and frequency dom ains. T he spectrum X ( F ) o f a signal is in general, com p lex valued. C onsequently, it is usually expressed in polar forms as X ( F ) = | X ( F ) | ^ W(f) where |X ( F ) | is the m agnitude spectrum and © (F ) is the phase spectrum . © (F ) - i U ( F ) O n the other hand, the quantity SXX( F ) = \X ( F ) |2 (4.1.39) which is the integrand in (4.1.38), represents the distribution of en ergy in the signal as a function o f frequency. H en ce SXX( F ) is called the e n e rg y d e n sit y s p e ctru m of x ( t ). T he integral o f S XX( F ) over all freq u en cies gives the total en ergy in the signal. V iew ed in another way, the energy in the signal x ( t ) over a band o f frequencies F \ < F < F [ + A F is From (4.1.39) w e observe that S XX( F ) d o es not con tain any p h ase inform ation [i.e., SXX( F ) is purely real and n on n egative]. Since the phase spectrum of ;t(r) is not contained in SXX( F ) , it is im possible to reconstruct the signal given S XX( F ) . Finally, as in the case of Fourier series, it is easily show n that if the signal x (t ) is real, then \X ( -F ) \ = ± X { -F ) \X ( F ) \ (4.1.40) = -* X (F ) (4.1.41) Sec. 4.1 Frequency Analysis of Continuous-Time Signals 245 By com bining (4.1.40) and (4.1.39), w e obtain (4.1.42) SXX( ~ F ) = S xA F ) In other words, the energy density spectrum o f a real signal has even sym m etry. Exam ple 4.1.2 D eterm ine the Fourier transform and the energy density spectrum of a rectangular pulse signal defined as and illustrated in Fig. 4.8(a). Solution Clearly, this signal is aperiodic and satisfies the Dirichlet conditions. Hence its Fourier transform exists. By applying (4.1.30), we find that (4.1.44) We observe that X( F) is real and hence it can be depicted graphically using only one diagram, as shown in Fig. 4.8(b). Obviously, X( F) has the shape of the (sin0)/<? function shown in Fig. 4.4. Hence the spectrum of the rectangular pulse is the en­ velope of the line spectrum (Fourier coefficients) of the periodic signal obtained by A 0 T r ~> 2 (a) X<F) Ar F (b) Figure 4.8 (a) R ectangular pulse and (b) its F ourier transform . 246 Frequency Analysis of Signals and System s Chap. 4 periodically repeating the pulse with period Tp as in Fig. 4.3. In other words, the Fourier coefficients ck in the corresponding periodic signal xp{t) are simply samples of X( F) at frequencies kF0 = k/ Tp. Specifically, From (4.1.44) we note that the zero crossings of X( F ) occur at multiples of 1 /r. Furtherm ore, the width of the main lobe, which contains most of the signal en­ ergy, is equal to 2/z. As the pulse duration t decreases (increases), the main lobe becomes broader (narrow er) and m ore energy is moved to the higher (lower) frequencies, as illustrated in Fig. 4.9. Thus as the signal pulse is expanded (com­ pressed) in time, its transform is compressed (expanded) in frequency. This be­ havior, between the time function and its spectrum, is a type of uncertainty principle that appears in different forms in various branches of science and engi­ neering. Finally, the energy density spectrum of the rectangular pulse is , /sm 7 rj S „ ( F ) = ( A t )1 ( " ~ ' ^ T ) } ( ttF- (4.1.46) *(r) X 0 I 2 2 x (r) X(F) A - L 0 1 2 2 V X(l) A Figure 4.9 F o u rier transform of a re d a n g u la r pulse for various w idth values. Sec. 4.2 Frequency Analysis of Discrete-Time Signals 247 4.2 FREQUENCY ANALYSIS OF DISCRETE-TIME SIGNALS In Section 4.1 we d ev elop ed the Fourier series representation for continuous-tim e periodic (pow er) signals and the Fourier transform for finite energy aperiodic signals. In this section we repeat the d evelop m en t for the class o f discrete-tim e signals. A s we have ob served from the discussion o f Section 4.1, the Fourier series representation o f a con tinu ou s-tim e periodic signal can consist o f an infinite num ­ ber o f frequency com p onents, where the frequency spacing b etw een tw o successive harm onically related freq u en cies is 1 / T p, and w here Tp is the fundam ental period. Since the frequency range for continuous-tim e signals exten d s from —oo to oc, it is p ossib le to have signals that contain an infinite num ber o f frequency com p o­ nents. In contrast, the frequency range for discrete-tim e signals is unique over the interval ( - r t . T i ) or (0 .2 ^ ). A discrete-tim e signal o f fundam ental period N can consist o f frequency co m p on en ts separated by 2n / N radians or / = 1/jV cycles. C onsequently, the Fourier series representation o f the discrete-tim e periodic signal will contain at m ost N frequency com ponents. This is the basic d ifference b etw een the Fourier series representations for continuous-tim e and discrete-tim e periodic signals. 4.2.1 The Fourier Series for Discrete-Time Periodic Signals Suppose that w e are given a periodic sequ en ce a (/ i ) with period N , that is, x i n ) = x(n + N ) for all n. T he Fourier series representation for x(h) consists o f N har­ m onically related exp on en tial functions k = 0 A ........ N — 1 and is expressed as A'-l X („) = Y ^ c kejlKkn/N *=o (4.2.1) where the {<:*) are the coefficients in the series representation. T o derive the expression for the Fourier coefficients, w e use the follow ing formula: = ( I 0, 1 y '1 n=0 * = 0. ± N , ± 2 N, . . . otherw ise 2 2 N o te the sim ilarity o f (4.2.2) with the con tinu ou s-tim e counterpart in (4.1.3). T he p roof o f (4.2.2) follow s im m ediately from the application of the geom etric sum ­ m ation form ula jv-i f a = l 248 Frequency Analysis of Signals and System s Chap. 4 T h e e x p r e s s io n f o r th e F o u r i e r c o e f f ic ie n ts c* c a n b e o b t a i n e d b y m u ltip ly in g b o th s id e s o f ( 4 .2 .1 ) b y th e e x p o n e n tia l e ~ j2nin//v a n d s u m m in g th e p r o d u c t fro m « = 0 t o n = yV — 1. T h u s N —1 A’- ] A'-l ^ 2 x ( n ) e ~ il!rln /N c ke J2n<k~ l)n/N n=(J (4 .2 .4 ) n=0 t=0 I f w e p e r fo r m th e s u m m a tio n o v e r n first, in th e r ig h t-h a n d s id e o f (4 .2 .4 ) , w e o b ta in y ^ (fj2.TU-/)n/A' _ k - I = 0, ± N , ± 2 N , . . . o th e r w is e | N, I 0, w h e r e w e h a v e m a d e u se o f ( 4 .2 .2 ) . (4 2 5) T h e r e f o r e , th e rig h t-h a n d s id e o f ( 4 .2 .4 ) r e d u c e s to N c / a n d h e n c e j A'-l q = - J ' x ( n ) e ~ J2*‘" /tl 1 = 0. 1 .......... N - 1 (4 .2 .6 ) /T = (J T h u s w e h a v e th e d e s ir e d e x p r e s s io n fo r th e F o u r i e r c o e f f ic ie n t s in te r m s o f th e s ig n a l x ( « ) . T h e r e la tio n s h ip s ( 4 .2 .1 ) a n d ( 4 .2 .6 ) fo r th e f r e q u e n c y a n a ly s is o f d is c r e te * tim e s ig n a ls a r e s u m m a r iz e d b e lo w . FR E Q U E N C Y ANALYSIS O F D IS C R E TE -TIM E P E R IO D IC SIGN ALS Synthesis equation iW l -1 % II Analysis equation A'-l X(/! ) = ^ Ck(j2jTt"!r' *=0 (4.2.7) (4.2.8) E q u a t i o n ( 4 .2 .7 ) is o ft e n c a lle d th e d isc re te -tim e F o u r ie r s e rie s ( D T P S ) . T h e F o u r i e r c o e ff ic ie n ts {c* }. k = 0 . 1 .......... N — 1 p r o v id e th e d e s c r ip tio n o f jc ( « ) in th e f r e q u e n c y d o m a in , in th e s e n s e th a t c k r e p r e s e n t s th e a m p litu d e a n d p h a s e a s s o c ia t e d w ith th e fr e q u e n c y c o m p o n e n t sk(n) = e ^ kn^ ' = e jWtB w h e r e to* = 2 n k / N . W e re c a ll f r o m S e c tio n 1 .3 .3 th a t th e f u n c t io n s s k (n ) a r e p e r i o d i c w ith p e r io d N . H e n c e sk(n) = sk {n + N ) . In v iew o f th is p e r io d ic ity , it fo llo w s t h a t th e F o u r ie r c o e f f ic ie n ts c k, w h e n v ie w e d b e y o n d th e r a n g e k ~ 0 , 1 , ____A ' - l , a ls o s a tis fy a p e r io d ic ity c o n d itio n . In d e e d , fro m ( 4 .2 .8 ) , w h ich h o ld s f o r e v e r y v a lu e o f k , w e have Ck+ N = ^ J ^ x ( n ) e - ^ (k+N)n/N = ~ J 2 x { n ) e - ^ kn/N = c t n=0 ™ n=0 ( 4 .2 .9 ) Sec. 4.2 249 Frequency Analysis of Discrete-Time Signals T h e r e f o r e , th e F o u r i e r s e r ie s c o e f f ic ie n ts { q } fo r m a p e r io d ic s e q u e n c e w h e n e x ­ te n d e d o u ts id e o f t h e r a n g e k = 0 , 1 ..........jV — 1. H e n c e Ck+N = <^k th a t is , { c t } is a p e r io d ic s e q u e n c e w ith f u n d a m e n ta l p e r io d N. T hu s the s p e ctru m o f a signa l x(n ), w h ich is per iod ic with p e r i o d N , is a p er io d ic s e qu en ce with p e r io d N . C o n s e q u e n tly , a n y N c o n s e c u tiv e s a m p le s o f th e s ig n a l o r its s p e c tr u m p r o v id e a c o m p le t e d e s c r ip tio n o f th e s ig n a l in th e tim e o r f r e q u e n c y d o m a in s . A lth o u g h th e F o u r i e r c o e f fic ie n ts fo r m a p e r io d ic s e q u e n c e , w e w ill fo c u s o u r a tte n tio n o n th e s in g le p e r io d w ith ra n g e k = 0 , 1 .......... N — 1. T h i s is c o n v e n ie n t, s in c e in th e f r e q u e n c y d o m a in , th is a m o u n ts to c o v e r in g th e f u n d a m e n ta l ra n g e 0 < a>t = 2 n k /N < 2 n , fo r 0 < k < N — 1. In c o n t r a s t , th e f r e q u e n c y ra n g e —it < a)* = 2 7 i k / N < j t , c o r r e s p o n d s to —N / 2 < k < N / 2 , w h ic h c r e a t e s an in c o n v e n ie n c e w h e n N is o d d . C le a r ly , i f w e u se a s a m p lin g f r e q u e n c y F s , th e r a n g e 0 < k < N — 1 c o r r e s p o n d s to th e f r e q u e n c y ra n g e 0 < F < F , . Example 4.2.1 D eterm ine the spectra of the signals (a) jr(») = cos -Ji nn (b) x(n) = cos nn/ 3 (c) x( n ) is periodic with period N = 4 and x(n) = {1, 1.0.0} T Solution (a) For m = J i n , we have /« = 1j - Jl . Since f , is not a rational number, the signal is not periodic. Consequently, this signal cannot be expanded in a Fourier series. N evertheless, the signal does possess a spectrum. Its spectral content consists of the single frequency component at id = wo = -Jin. (b) In this case / (l = | and hence x{n) is periodic with fundam ental period N = 6. From (4.2.8) we have 5 It = 0 . 1 ........5 However, x(n) can be expressed as x(n) = cos — " r— = + \ e~i2*nib 6 * which is already in the form of the exponential Fourier series in (4.2.7). In comparing the two exponential terms in x{n) with (4.2.7), it is apparent that ci = j. The second exponential in x(n) corresponds to the term Jt = —1 in (4.2.7), However, this term can also be written as - j ’2 j r n / 6 _ ^ j2jr (5 n> /6 which means that c_i = c$. But this is consistent with (4.2.9), and our previous observation that the Fourier series coefficients form a periodic sequence of 250 Chap. 4 Frequency Analysis of Signals and Systems period N . Consequently, we conclude that = C\ = f 4 = 0 C(, = c, = ^ i (c) From (4.2.8). we have 1 A-= 0 . 1 ,2 ,3 Ck or Ct = l ( l + e - i ^ ) A-= 0 . 1.2.3 For k = 0, 1, 2, 3 we obtain f'l — j ( l — j ) C'd = S f'2 = 0 Cl = j { l + j } The m agnitude and phase spectra are K'd I ki 4-Co = 0 4 f| = -- 2tr- = undefined 4_o = — 4 4 Figure 4.10 illustrates the spectral content of the signals in (b) and (c). 4.2.2 Power Density Spectrum of Periodic Signals T h e a v e r a g e p o w e r o f a d is c r e te - tim e p e r io d ic sig n a l w ith p e r io d N w as d efin ed in ( 2 .1 .2 3 ) as P, = - £ M » )| ( 4 .2 .1 0 ) W e s h a ll n ow d e riv e a n e x p r e s s io n fo r P x in te r m s o f th e F o u r i e r c o e f f ic ie n t {c<J. I f w e u se th e r e la tio n ( 4 .2 .7 ) in ( 4 .2 .1 0 ) , w e h a v e j v -i Pi = — T x(rt)x*(n) n = () A'-l N N o w . w e c a n in te r c h a n g e t h e o r d e r o f th e tw o s u m m a tio n s a n d m a k e u s e o f ( 4 .2 .8 ) , o b ta in in g p * = Y , ct *=<j IV—1 A'-l , A-i - y x ( n ) e - j2”kn/N -i A —I ( 4 . 2 . 11 ) Sec. 4.2 Frequency Analysis of Discrete-Tim e Signals 251 (a) Zc t Jr "4 -3 5 1 - 2 - 1 0 ... t 2 3 4 71 4 Figure 4.10 Spectra of the periodic signals discussed in Example 4.2.1 (b) and (c). (c) which is the desired exp ression for the average p ow er in the p eriod ic signal. In other w ords, the average pow er in the signal is th e sum o f th e pow ers o f the individual frequency com p onents. W e view (4.2.11) as a P arseval’s relation for d iscrete-tim e period ic signals. T h e seq u en ce | a |: for k = 0, 1 , — N - 1 is the distribution o f p ow er as a function o f freq u en cy and is called the p o w e r density spectrum o f the periodic signal. If w e are interested in the energy o f th e se q u en ce Jt(n) o v er a single period, (4.2.11) im plies that /V—I N -l n=0 k—() (4.2.12) which is consistent with our p reviou s results for con tin u ou s-tim e p eriodic signals. If the signal x ( n ) is real [i.e., x ‘ (n) = jr(n)], then, p roceed in g as in S ec­ tion 4.2.1, w e can easily sh ow that ct = c . k (4.2.13) 252 Frequency Analysis of Signals and Systems Chap. 4 or equivalently, |c_*| = |c * f - 4 c_t = (even sym m etry) (4.2.14) (odd sym m etry) (4.2.15) T h ese sym m etry properties for the m agnitude and phase spectra o f a periodic sig­ nal, in conjunction with the periodicity property, have very im portant im plications on the frequency range o f discrete-tim e signals. In d eed , by com bining (4.2.9) with (4.2.14) and (4.2.15), w e obtain Iq I = 4-c* = (4.2.16) and — (4.2.17) M ore specifically, w e have = \c N p \ ~ k jV /2 |, A -c N[2 k (/V -l)/2 = k ( A f + l)/2 l< 4-C (N -1)/2 * O II |c il 4 .c 0 = 4 - c' l = - % - c' n - 0 — % -C N -l (4.2.18) = if N is even o = ~ 4 - C ( /V + l)/2 if N is odd Thus, for a real signal, the spectrum c*, k = 0, 1 ,. . . , N [ 2 for N even, or k = 0. 1........ ( N — l ) / 2 for N odd, com p letely specifies the signal in the frequency dom ain. Clearly, this is consistent with the fact that the highest relative frequency that can be represented by a discrete-tim e signal is eq u al to n . In d eed , if 0 < a>k = 2 n k / N < jt, then 0 < k < N f 2. By m aking use o f these sym m etry p roperties o f the Fourier series coefficients o f a real signal, the F ourier series in (4.2.7) can also be exp ressed in the alternative forms x ( n ) = co + 2 £ = ao + ^ lc*l cos (4.2.19) ( ^ k cos — kn - b k sin — kn 'j (4.2.20) w here a0 = c0. <*k = 2 [ct|co s0 * . bk = 2|c*|sin 0*, and L = N [2 if N is even and L — ( N ~ l ) / 2 if N is odd. F inally, we n o te that as in the case o f continuous-tim e signals, the power density spectrum |ct |2 d oes n ot contain any phase inform ation. Furtherm ore, the spectrum is discrete and periodic with a fundam ental period eq u al to that o f the signal itself. Example 4.2.2 Periodic “Square-Wave” Signal Determ ine the Fourier series coefficients and the power density spectrum of the periodic signal shown in Fig. 4.11. Sec. 4.2 253 Frequ ency A nalysis of Discrete-Time Signals 0 L Figure 4.11 Discrete-time periodic square-wave signal. n A' Solution By applying the analysis equation (4.2.8) to the signal shown in Fig. 4.11. we obtain = 1 L~l = -L Y Ae- P^n/ AJ i—/ 1 A j— k = 0. 1. N - 1 which is a geom etric sum mation. Now we can use (4.2.3) to simplify the summation above. T hus we obtain AL TT’ A 1 - e- j2*kL/s I N 1' k= 0 k = 1.2. N - 1 The last expression can be simplified further if we note that 1 _ e -j2xkL;S 1 - <- -jzk L tN I.ikl/K e -ink;'\ ( rrl. \ _ ,-jxkl.\ _ -jxHt.-u.'K sin(xkL. /N ) s in (7 r£ /A / T herefore. AL k = 0. +A'. ± 2 N , A , s i ni n kL/ N) sin(7zk/N) I A' (4.2.21) otherwise The pow er density spectrum of this periodic signal is / AL_ k*l" = k = 0, +N. ± 2 A'. V N A V / sinnkL/N Ar / V s i n n k / N (4.2.22) otherwise Figure 4.12 illustrates the plots of jct |2 for L = 5 and 7, A' = 40 and 60. and A = 1. 4.2.3 The Fourier Transform of Discrete-Time Aperiodic Signals Just as in the case o f con tinu ou s-tim e aperiodic energy signals, the frequency anal­ ysis o f d iscrete-tim e aperiodic finite-energy signals in volves a Fourier transform of the tim e-d om ain signal. C on sequ en tly, th e d evelop m en t in this section parallels to a large ex ten t, that given in Section 4.1.3. 254 Frequency Analysis of Signals and Systems Chap. 4 L = 5, N = 40 I 1II I 1. . I I I I ■ _xlJ -2 0 -1 0 0 10 20 L = 7, N = 60 LJ i l -3 0 - 20 -1 0 0 10 20 30 = 5. N = -3 0 - 20 —10 0 10 20 30 Figure 4.12 Plot of the pow er density spectrum given by (4.2.22). T he Fourier transform o f a finite-energy discrete-tim e signal x ( n ) is defined as OC X (co) = x ( n ) e ~ Jwr (4.2.23) FI — “ OC Physically, X(co) represents the frequency con ten t o f the signal x ( n ) . In other words. X{(o) is a d ecom p osition o f x ( n ) into its frequency com p onents. W e observe tw o basic d ifferen ces b etw een the Fourier transform of a discrete­ tim e finite-energy signal and the F ourier transform o f a finite-energy analog signal. First, for continuous-tim e signals, the Fourier transform , and h en ce the spectrum o f the signal, have a frequency range o f {—0 0 , 0 0 ). In contrast, the frequency range for a discrete-tim e signal is unique over the frequency interval o f (—n , n) or, equivalently, (0. 2 tt). T h is property is reflected in the Fourier transform o f the Sec. 4.2 Frequency Analysis of Discrete-Time Signals 255 signal. In d eed . X(co) is period ic with period 2 n . that is. X(a> + 2 7 T k )= 22 j{u>^-27ik)u x { n ) e 'i{w^ 7' k)n —cc oc = J 2 x ( n ) e - ' ame - JZ7,kn (4.2.24) /l = —OC OC = 2 2 x ( n ) e - , Mn = X(w) H en ce X ( t o ) is p eriod ic with period 2 t t . B u t this property is just a con seq u en ce of the fact that the frequency range for any discrete-tim e signal is lim ited to (—n , n ) or (0 , 27r). and any frequency outside this interval is eq u ivalen t to a frequency within the interval. T h e secon d basic d ifference is also a con seq u en ce o f the discrete-tim e nature o f the signal. Since the signal is discrete in tim e, the Fourier transform o f the signal in v o lv es a sum m ation o f term s instead o f an integral, as in the case of continuous-tim e signals. Since X (w ) is a periodic function o f the frequency variable a), it has a Fourier series exp an sion , provided that the con d ition s for the existen ce o f the Fourier series, described previously, are satisfied. In fact, from th e definition o f the Fourier transform X (co) o f the sequ en ce x(n), given by (4.2.23), w e ob serve that X (a >) has the form o f a Fourier series. T he Fourier coefficients in this series expansion are the valu es o f the seq u en ce x ( n ) . T o dem onstrate this point, let us evaluate the seq u en ce x ( n ) from X(co). First, we m ultiply both sides (4.2.23) by ej<um and integrate over the interval ( —tt, t t ) . Thus w e have (4.2.25) The integral on the right-hand side o f (4.2.25) can be evaluated if w e can inter­ change the order o f sum m ation and integration. This interchange can be m ade if the series N X N (a>) = 2 2 x ( n ) e - llon n=-N con verges uniform ly to X(o)) as A1 ->• oc. U niform con vergen ce m ean s that, for every w, Xh((d) —*■ X(ca), as /V -*• oo. T he con vergen ce o f the Fourier transform is discussed in m ore detail in the follow in g section. For the m om en t, let us as­ sum e that the series con verges uniform ly, so that w e can interchange the order of sum m ation and integration in (4.2.25). Then 256 Frequency Analysis of Signals and Systems Chap. 2:Tx(m). 0. (4.2.26) C onsequently, £ x{n) rj = — OC n'da) = fJ —71 By com bining (4.2.25) and (4.2.26). w e obtain the desired result that 1 x (n ) — — fn I ±.7T J —jt X ( o j) e J do) (4.2.27) If w e com pare the integral in (4.2.27) with (4,1.9), we n o te that this is just the expression for the Fourier series coefficient for a function that is periodic with period 2 n . The only difference b etw een (4.1.9) and (4.2.27) is the sign on the exp on en t in the integrand, which is a con sequ en ce o f our definition o f the Fourier transform as given by (4.2.23). T h erefore, the Fourier transform of the sequence x ( n ) , defined by (4.2.23), has the form o f a Fourier series expansion. In summary, the Fourier tra nsform p a ir f o r discrete-time signals is as follows. FR EQ U EN C Y ANALYSIS OF DtS C R E TE -TIM E AP ER IO D IC S IG N A LS Synthesis equation inverse transform x( Analysis equation direct transform X {io )= (4 .2 .2 8 ) X < w ) i ’ lu ' ' ' d w OC 2 2 (4.2.29) x ( n ) e ~ , w '1 4.2.4 Convergence of the Fourier Transform In the derivation o f the inverse transform given by (4.2.28), w e assum ed that the series Xjv(cw) = 22 xWe~ (4.2.30) converges uniform ly to X(a>), given in the integral o f (4.2.28), as N -* oc. By uniform convergence w e m ean that for each lim { s u p X (oj) ~ X s (>>)'} = 0 (4.2.31) N—> * <*> U niform convergence is guaranteed if ;c(/j) is ab solu tely sum m able. Indeed, if DC 2 2 |j c )i < oc (4.2.32) n=-oc then |X M l = 22 x (n )e ' < 2 2 < 00 H en ce (4.2.32) is a sufficient condition for the existen ce o f the d iscrete-tim e Fourier transform. W e n o te that this is the discrete-tim e counterpart of th e third Dirich- Sec. 4.2 257 Frequency Analysis of Discrete-Time Signals let condition for the Fourier transform o f con tinu ou s-tim e signals. T he first two conditions d o n ot apply due to the discrete-tim e nature o f [*(«)}. S om e se q u en ces are not absolutely sum m able, but they are square sum m able. That is, they have finite energy OC Ex = ^ |jc(n ) |2 < oo (4.2.33) n = —DC which is a w eak er condition than (4.2.32). W e w ould like to d efine the Fourier transform o f finite-energy sequ en ces, but w e m ust relax the con d ition o f uniform con vergen ce. For such seq u en ces w e can im pose a m ean-square con vergen ce co n ­ dition: lim f |X M - X N ((ti)\2dto = 0 Af—<* J-71 (4.2.34) Thus the energy in the error X(a>) - X/v(oj) tends toward zero, but the error |X (w ) - Xw(a))j d o es not necessarily tend to zero. In this way w e can include finite-energy signals in the class o f signals for which the Fourier transform exists. Let us con sid er an exam p le from the class o f finite-energy signals. Suppose that X M = ( 1’ [ U. H ^ ‘|< 7 r (4-2.35) < ja>| < 7T T he reader should rem em ber that X(a>) is periodic with p eriod 2 n . H en ce (4.2.35) represents only on e period o f X(co). The inverse transform o f X { cj) results in the sequence i jr(«) = — = 1 -~ In r I X { w ) e ja>nda) I eJ sin<u,-n dm = ------------ n^O Jin For n = 0, w e have *( 0 ) H en ce x (n ) = n (j)c sin a)cn n cocn n = 0 (4.2.36) n 0 This transform pair is illustrated in Fig. 4.13. S om etim es, the seq u en ce {*(«)) in (4.2.36) is exp ressed as sin cocn x ( n ) = ---------- — oo < n < oo (4.2.37) 258 Frequency Analysis of Signals and Systems Chap. 4 X(w) 1 1 -JT — UJt 0 (i), 7T (b) Figure 4.13 Fourier transform pair in (4.2.35) and (4.2.36j. with the understanding that at n = 0, x ( n ) = w j n . W e should em p hasize, however, that (sina)(7i)/jrfi is not a con tinu ou s function, and hence L ’H osp ital's rule cannot be used to determ ine jr(0 ). N ow iet us consider the determ ination o f the Fourier transform o f the se­ q uence given by (4.2.37), T he seq u en ce {jr(n)j is not absolutely sum m able. H ence the infinite series (4.2.38) does not converge uniform ly for all w. H ow ever, the seq u en ce {jc(«)} has a finite energy E x = o)c/ tc as will be show n in Section 4.3. H en ce the sum in (4.2.38) is guaranteed to converge to the X (a>) given by (4.2.35) in the m ean-square sense. T o elaborate on this point, let us con sid er the finite sum X N (a>)= (4.2.39) Figure 4.14 show s the function X N{w) for several values of N . W e n ote that there is a significant oscillatory oversh oot at co = coc, in d ep en dent o f the value o f N . As Sec. 4.2 259 Frequency Analysis of Discrele-Ttme Signals x , s(w) ^50<“) A"7o(ul) Figure 4.14 Illustration of convergence of the F ourier transform and the G ibbs phenom enon at the point of discontinuity N increases, the oscillation s b ecom e m ore rapid, but the size o f the ripple rem ains the sam e. O ne can sh ow that as N -*■ oo, the oscillations con verge to the point o f the discontinuity at to — a>t . but their am plitude d oes not go to zero. H ow ever, (4.2.34) is satisfied, and therefore converges to X ( w ) in the m ean-square sense. T he oscillatory behavior o f the approxim ation X^ic o) to the function X(a>) at a point o f discontinuity o f is called the G ib b s p h e n o m e n o n . A sim ilar effect is ob served in the truncation o f the F ourier series o f a con tinu ou s-tim e periodic signal, given by the syn th esis eq u ation (4.1.8). For exam ple, the truncation o f the Fourier series for the period ic square-w ave signal in E xam ple 4.1.1, gives rise to the sam e oscillatory behavior in the finite-sum approxim ation o f x ( t ) . T he G ibbs ph en om en on will be en cou n tered again in the design o f practical, discrete-tim e FIR system s considered in C hapter 8 . 260 Frequency Analysis of Signals and Systems Chap. 4 4.2.5 Energy Density Spectrum of Aperiodic Signals R ecall that the energy o f a discrete-tim e signal x ( n ) is defined as OC Ex = 2 2 l*(n )l2 n=—oc (4.2.40) Let us n o w e x p r e s s th e e n e r g y E x in te r m s o f th e s p e c tr a l c h a r a c t e r i s t i c X (w). F irst we have Ex = 00 22 x(n)x*(n)= n ------- -v I" J rJT 2 2 x(n) — X* n— —-v _ J —JT If we interchange the order o f integration and sum m ation in the equation above, we obtain dw |X (co)\~du> T h erefore, the energy relation b etw een x ( n ) and X(a>) is E,= oc \ 2 2 \x^)\2 = — n=-oc fn \X (c o )l2dco (4.2.41) This is Parseval's relation for discrete-tim e aperiodic signals with finite energy. T he spectrum X(a>) is, in general, a com p lex-valu ed function of frequency. It may be expressed as X(u>) = \X ( c u ) \e J* M (4.2.42) where Q(co) - ^ X ( c o ) is the phase spectrum and \X (a > )\ is the m agnitude spectrum . A s in the case o f continuous-tim e signals, the quantity S„(o>) = | X M |2 (4.2.43) represents the distribution of energy as a function o f frequency, and it is called the ener gy density sp ectrum o f x ( n ) . Cleariy, Sxx(a>) d oes not contain any phase inform ation. Suppose now that the signal x ( n ) is real. T hen it easily follow s that X*(o>) = X ( - oj) (4.2.44) or equivalently, |X (—ti>)| = |X(tt>)| (even symmetry) (4.2.45) Sec. 4.2 261 Frequency Analysis of Discrete-Time Signals (4.2.46) (4.2.47) From these sym m etry properties we con clu d e that the frequency range of real d iscrete-tim e sign als can be lim ited further to the range 0 < co < n (i.e., on e-half o f the p erio d ). Indeed, if we know X ( a >) in the range 0 < w < n , we can d eterm in e it for the range - n < co < 0 using the sym m etry p roperties given above. A s w e have already ob served , sim ilar results hold for discrete-tim e periodic signals. T h erefo re, the frequency-dom ain description o f a real discrete-tim e signal is co m p letely sp ecified by its spectrum in the frequency range 0 < co < n . U su a lly , w e w ork with the fundam ental interval 0 < a > < 7r o r 0 < F < F J 2, exp ressed in H ertz. W e sketch m ore than half a period only w hen required by the specific application. Example 4.2.3 D eterm ine and sketch the energy density spectrum 5,,r (w) of the signal = a"u(/i) —1 < a < 1 Solution Since \a\ < 1. the sequence x(n) is absolutely summable, as can be verified by applying the geometric summation formula. H ence the Fourier transform of x(n) exists and is obtained by applying (4.2.29). Thus Since \ae~J,Jl = |a| < 1. use of the geom etric summation formula again yields The energy density spectrum is given by Sl x(w) = |X(w)|2 = X(a>)X'(w) = (1 —ae~Ju,)( 1 —aeJW) or, equivalently, as 1 1 —2a cos a>+ a■ Note that S „(-o> ) = Ss i (w) in accordance with (4.2.47). Figure 4.15 shows the signal *(«) and its corresponding spectrum for a = 0.5 and a = -0 .5 . Note that for a = -0 .5 the signal has more rapid variations and as a result its spectrum has stronger high frequencies. Frequency Analysis of Signals and Systems 262 Chap. 4 x(n) - (-0.5)"u(«! Figure 4.15 spectra. (a) Sequence .\in) = and mii I = i — Figure 4.16 pulse. (b) ih eir energy density D iscrete-tim e rectangular Example 4.2.4 Determ ine the Fourier transform and the energy density spectrum of the sequence xin) = 0 < n <L otherwise (4.2.48) which is illustrated in Fig. 4.16. Solution Before computing the Fourier transform, we observe that Hence xin) is absolutely summable and its Fourier transform exists. Furthermore, we note that Jt(n) is a finite-energy signal with = \A\: L, The Fourier transform of this signal is Sec. 4.2 Frequency Analysis of Discrete-Time Signals 263 1 - e~’uL = Ae- ' ,u/2'a - 11 s m( w / 2 ) (4.2.49) For w = 0 the transform in (4.2.49) yields X(0) = AL, which is easily established by setting w = 0 in the defining equation for X(a>), or by using L ’H ospital’s rule in (4.2.49) to resolve the indeterm inate form when w = 0. The m agnitude and phase spectra of ;t(n) are f \A\L, |X<«)I = w= 0 sin(«L /2) sin(aj/2) otherwise w 2 sin(ctiZ./2) '■ sin(w/2) (4-2.50) and $X (a>) = $ A - - ( L - l ) + $ (4.2.51) where we should rem em ber that the phase of a real quantity is zero if the quantity is positive and n if it is negative. The spectra |X(o>)| and ^.X(w) are shown in Fig. 4.17 for the case A — 1 and L = 5. The energy density spectrum is simply the square of the expression given in (4.2.50). T here is an interesting relationship that exists b etw een the F ourier transform o f the constant am plitude pulse in E xam p le 4.2.4 and the period ic rectangular lX(w)l Figure 4.17 Magnitude and phase of Fourier transform of the discrete-time rectangular pulse in Fig. 4.16. 264 Frequency Analysis of Signals and Systems Chap. 4 w ave considered in E xam ple 4.2.2. If w e evaluate the F ourier transform as given in (4.2.49) at a set o f equally spaced (harm onically related) freq u en cies w e obtain (4.2.52) If w e com pare this result with the expression for the F ourier series coefficients given in (4.2.21) for the period ic rectangular w ave, w e find that k = 0. 1 , . . . , N — 1 (4.2.53) T o elab orate, w e have established that the Fourier transform o f the rectangular p ulse, which is identical with a single p eriod o f the period ic rectangular pulse train, evaluated at the freq u en cies co = I n k / N , k = 0, 1 , ___ N — 1, which are identical to the harm onically related frequency com p onents u sed in the Fourier series representation o f the periodic signal, is sim ply a m ultiple o f the Fourier coefficients f a ) at the corresponding frequencies. T he relationship given in (4.2.53) for the F ourier transform o f the rectangular pulse evaluated at co — 2 n k / N , k = 0. 1........ A ' - l , and the F ourier coefficients o f the corresponding periodic signal, is not only true for these tw o signals but, in fact, holds in general. This relationship is d evelop ed further in Chapter 5. 4.2.6 Relationship of the Fourier Transform to the z-Transform T h e z-transform o f a seq u en ce * («) is defined as OC RO C: r2 < \z\ < r\ w here ri < |;) < rj is the region o f con vergen ce o f X (z). com plex variable z in polar form as (4.2.54) L et us express the (4.2.55) where r = |z| and co = 4 ;. T h en , w ithin the region o f con vergen ce of X (z), we can substitute z = r e jai into (4.2.54), T his yields (4.2.56) From the relationship in (4.2.56) w e n ote that X ( z ) can be interpreted as the Fourier transform o f the signal seq u en ce x ( n ) r ~ ”. T he w eigh tin g factor r ~ n is growing with n if r < 1 and decaying if r > 1 . A ltern atively, if X ( z ) con verges for Sec. 4.2 Frequency Analysis of Discrete-Time Signals 265 1-1 = 1 , then X (:)U , = X H = 2 2 x { , ! ) e - 1,0,1 (4.2.57) T h erefore, the Fourier transform can be view ed as the z-transform o f the sequ en ce evaluated on the unit circle. If X ( z ) d oes not converge in the region |z| — 1 [i.e.. if the unit circle is n o t contained in the region o f con vergen ce o f X (z)], the Fourier transform X ( i o ) d o es not exist. W e should n o te that the existen ce of the z-transform requires that the s e ­ quence {jr (« )r—"} be ab solu tely sum m able for som e value o f r. that is. OC 22 | < oc (4.2.58) n~-oc H en ce if (4.2.58) con verges only for values o f r > ro > 1. the z-transform exists, but the Fourier transform d oes not exist. This is the case, for exam p le, for causal seq u en ces o f the form jr(rc) = a " u(n ), where jo > 1 . T here are seq u en ces, how ever, that do not satisfy the requirem ent in (4.2.58). for exam p le, the seq u en ce sin avrc x ( n ) — ---------- ~ oo < n < oc (4.2,5^) Tin This seq u en ce d o es not have a .--transform. Since it has a finite energy, its Fourier transform con verges in the m ean-square sense to the d iscon tin uou s function X {(jo ). defined as M <*v [ (J, (4 2 6 0 ) <w( < \ a>\ < 71 In con clu sion , the existen ce of the z-transform requires that (4,2.58) be sat­ isfied for so m e region in the z-plane. If this region contains the unit circle, the Fourier transform X(cu) exists. H ow ever, the existen ce o f the Fourier transform, which is defined for finite energy signals, d oes not n ecessarily ensure the existence o f the z-transform . 4.2.7 The Cepstrum Let us con sid er a seq u en ce {jc(/j)} having a z-transform X (z). W e assum e that (jr(n)) is a stable seq u en ce so that X ( z ) con verges on the unit circle. The c o m p l e x ce pstru m o f the seq u en ce {jc(«)} is defined as the seq u en ce (cr(n)}, which is the inverse z-transform o f Cjj(z), w here Cjciz) = In X (z) (4.2.61) T h e com p lex cepstrum exists if C^tz) con verges in the annular region n < \z\ < n , w here 0 < r\ < 1 and r2 > 1. W ithin this region o f con vergen ce, C t (z) can be represen ted by the Laurent series Cx(z) = In X (z) = c^ z ~n (4.2.62) 266 Frequency Analysis of Signals and Systems Chap. 4 where cAn) = f In X ( z ) z n' 1d z Jc (4.2.63) C is a closed contour about th e origin and lies w ithin the region o f convergence. Clearly, if C, (z) can be rep resen ted as in (4.2.62), the com plex cepstrum sequence {cr(rt)} is stable. F urtherm ore, if the com p lex cepstrum exists, Cx (z) converges on the unit circle and hence w e have CC CAat) = lnX(cu) = 2 2 c A n ) e ~ JU,n (4.2.64) n—-OC where (cv(/i)} is the sequ en ce ob tain ed from the inverse F ourier transform of In X(to). that is, 1 r c r(n) = — / ln X (a >)eJwnd w 2tt J _ n (4.2.65) If w e express X(co) in term s of its m agnitude and p h ase, say X(a>) = \X (co)\eJf>iw) (4.2.66) in X(co) = In |X(ct))| + jd(a>) (4.2.67) th en By substituting (4.2.67) into (4.2.65), w e obtain the com plex cepstrum in the form 1 fn cx (n) — — I [In |X ( a >)| + j6(cL>)]eJU,ndco 2jt J _ n (4,2.68) W e can separate the inverse F ourier transform in (4.2.68) into the inverse Fourier transforms o f In |X (w )| and 9(a>)\ cm(n) = 2 - j ln\X(a>)\eJl^dcL> (4.2.69) ce(n) = - ^ J 6(co)eJa>ndco (4.2.70) In som e applications, such as sp eech signal processing, only the com p onent c„(n) is com puted. In such a case the phase o f X (a>) is ignored. T h erefore, the sequence {*(«)} cannot b e recovered from {cm(n)j. That is, the transform ation from (jr(n)} to {cm(n)} is not invertible. In speech signal p rocessing, the (real) cepstrum has b een used to separate and thus to estim ate the spectral con ten t o f the sp eech from the pitch frequency of the speech. T he com plex cepstrum is used in practice to separate signals that are con volved . T h e process o f separating tw o con volved signals is called d e c o n ­ volution and the use o f the com p lex cepstrum to perform the separation is called h o m o m o r p h i c d econ vo lutio n. T his topic is discussed in Section 4.6. Sec. 4.2 Frequency Analysts of Discrete-Time Signals 267 4.2.8 The Fourier Transform of Signals with Poles on the Unit Circle A s was show n in Section 4.2.6, the Fourier transform o f a seq u en ce jc(h) can be determ ined by evaluating its z-transform X (z) on the unit circle, provid ed that the unit circle lies within the region o f con vergen ce o f X (z). O therw ise, the Fourier transform d o es not exist. T h ere are som e aperiodic sequ en ces that are neither ab solu tely sum m able nor square sum m able. H en ce their Fourier transform s do not exist. O n e such seq u en ce is the unit step seq u en ce, which has the z-transform A n oth er such seq u en ce is the causal sinusoidal signal seq u en ce x ( n ) = (coscoon) u(n). T his seq u en ce has the z-transform y , , _ 1 - Z ~ ‘ COS (at) 1 - 2 z _ i cosojo + z -2 N o te that both o f these seq u en ces have p oles on the unit circle. For seq u en ces such as these tw o exam ples, it is som etim es useful to extend the Fourier transform representation. T his can be accom plished, in a m ath em ati­ cally rigorous w ay, by allow ing the Fourier transform to contain im pulses at certain frequencies corresponding to the location o f the p oles o f X ( z ) that lie on the unit circle. T he im pu lses are functions o f the con tinu ou s frequency variable co and have infinite am plitude, zero width, and unit area. A n im pulse can be view ed as the lim iting form o f a rectangular pulse of height 1 /a and width a, in the limit as a -+ 0. Thus, by allow ing im pulses in the spectrum of a signal, it is p ossible to exten d the Fourier transform representation to som e signal seq u en ces that are neither absolutely sum m able nor square sum m able. T h e follow in g exam ple illustrates the exten sion of the F ourier transform rep­ resentation for three sequ en ces. Exam ple 4.2.5 D eterm ine the Fourier transform of the following signals. (a) x i(n) = u(n) (b) jr2(n) = (-l)" « (n ) (c) jc3(n) = (coswon)u(n) by evaluating their z-transforms on the unit circle. Solution (a) From Table 4.3 we find that XiU) = r - t - j = - ^ r ROC: |c| > 1 1 - z '1 z -1 Xi(z) has a pole, p\ = 1, on the unit circle, but convenges for |z| > 1. 268 Frequency Analysis of Signals and Systems Chap. 4 If we evaluate A'l (:i on the unit circle, except at : = 1. we obtain X \ ( w ) = ------ :------------ = - —:---------— e “ 2i/ sin(w/2> to =£ 2 r r k 2sm(«j/2) k = 0 . J . . .. At a) = 0 and multiples of 2,t , A’|( w ) contains impulses of area .t . Hence the presence of a pole at ; = 1 (i.e.. at w = 0) creates a problem only when we want to compute A'i(w) at w = 0 .because |A’](tu)i —*■ oc as to —> 0. For any other value of to. X \ (to) is finite (i.e.. well behaved). Although, at first glance one might expect the signal to have zero-frequency components at all frequencies except at as = 0. this is not the case. This happens because the signal .\|(n) is not a constant for all —oc < « < oc. Instead, it is turned on at n = 0. This abrupt jump creates all frequency com ponents existing in the range 0 < t o < tt. Generally, all signals which start at a finite time have nonzero-frequency com ponents everywhere in the frequency axis from zero up to the folding frequency. (b ) From Table 3.3 we find that the .'-transform of a''uin) with a = —1 reduces to 1 XA:) = ---------- r = 1+ : ! — — ;+ l R O C : |;i > 1 which has a pole at : = - 1 = c-n . The Fourier transform evaluated at frequen­ cies other than a> = tt and multiples of 2tt is A'lfw) = - — —------- — 2 cos (to/2) a> * 2 , t (k r 0. 1. . . . |) k = TT ^ = 0 . 1 . . . . In this case the impulses occurs at w = tt + 2rrk. Hence the magnitude is I X-> ( t o ) | = — — — -------- -- 2[ cos(to/2) t!) 2 tZ k + and the phase is X; (to) = ^ if cos — < 0 Note that due to the presence of the pole at a = —1 (i.e.. at frequency w = tt), the m agnitude of the Fourier transform becomes infinite. Now \X(w)\ —* oc as w —> ■n. We observe that (—])nu(n) = (cosTrn)u(n), which is the fastest possible oscillating signal in discrete time. (c) From the discussion above, it follows that A?(w) is infinite at the frequency com ponent w = too. Indeed, from Table 3.3. we find that : 1 —C_1 COS to,) 1 - 2: ~‘ cos wo + ) = (coStonfi)tt(n) <— ► A-i(;) = --- -— ------------ R O C : |-| > 1 The Fourier transform is 1 - e ' 1"’ cos cuo X 3 (to) - —--------- :------------------------------(1 - „ . to ^ ito o 4- 27tk k = 0. 1 . . . . Sec. 4.2 Frequency Analysis of Discrete-Time Signals 269 The magnitude of X3 M is given by |1 —e~,<u cos tool w ±wu -I- 2 n k k = 0, 1 .... Now if w = —cm or w = tuo. |X 3 (a>)| becomes infinite. For all other frequencies, the Fourier transform is well behaved. 4.2.9 The Sampling Theorem Revisited T o p rocess a con tinu ou s-tim e signal using digital signal processing techniques, it is necessary to convert the signal into a seq u en ce o f num bers. A s w as discussed in Section 1.4, this is usually d on e by sam pling the analog signal, say x a(t), periodically every T secon ds to produce a discrete-tim e signal x ( n ) given by — 00 < n < 00 x ( n ) = x a( n T ) (4.2.71) T h e relationship (4.2.71) describes the sam pling process in the tim e dom ain. A s discussed in C hapter 1, the sam pling frequency Fs = l / T m ust be selected large enough such that the sam pling d oes not cause any loss o f spectral inform ation (no aliasing). In d eed , if the spectrum of the analog signal can be recovered from the spectrum o f the discrete- tim e signal, there is no loss of inform ation. C onsequently, w e investigate the sam pling p rocess by finding the relationship b etw een the spectra o f signals x a(t) and x ( n ). If x a (t) is an aperiodic signal with finite energy, its (voltage) spectrum is given by the F ourier transform relation (4.2.72) w hereas the signal x a (i) can be recovered from its spectrum by the inverse Fourier transform (4.2.73) N o te that u tilization o f all frequency com p on en ts in the infinite frequency range —00 < F < 00 is necessary to recover the signal x„(t) if the signal x„(t) is not bandlim ited. T h e spectrum o f a discrete-tim e signal x ( n ) , ob tain ed by sam pling x a (t), is given by the Fourier transform relation OO (4.2.74) or, equivalently, OO X (f) = 2 2 x ( n ) e - ^ n dc (4.2.75) 270 Frequency Analysis of Signals and Systems Chap. 4 The sequ en ce x(n) can be recovered from its spectrum X(a>) or X ( / ) by the inverse transform -*{«) - — f 2 tt J . x X(co)eJU,ndco (4.2.76) = / X { f ) e j2nJnd f J-\/2 In order to determ ine the relationship b etw een the spectra of the discrete­ time signal and the analog signal, w e n ote that period ic sam pling im poses a rela­ tionship betw een the in d ep en dent variables t and n in the signals x a {t) and x(n), respectively. That is, r = nT = — F, (4.2.77) This relationship in the tim e dom ain im plies a corresponding relationship betw een the frequency variables F and / in Xa(F) and X( f ) . respectively. Indeed, substitution o f (4.2.77) into (4.2.73) yields x(n) = xa( " T ) = f Xtl(F)ej2,TnF/F'd F (4.2.78) If we com pare (4.2.76) with (4.2.78), we conclude that r• 1/2 1/2 f oc X ( f ) e j2nf " d f = / X u ( F ) e )2nnFlFd F (4.2.79) J -oc \a From the d evelop m en t in C hapter 1 w e know that periodic sam pling im poses a relationship b etw een the frequency variables F and / of the corresponding analog and discrete-tim e signals, respectively. That is, / = — (4.2.80) With the aid o f (4.2.80), w e can m ake a sim p le change in variable in (4.2,79), and obtain the result y j ^ X ^ - 0 ej2”nF/F' d F = J X a ( F ) e j2,,nF/F- d F (4.2.81) W e now turn our atten tion to the integral on the right-hand side o f (4.2.81)T he integration range of this integral can be divided into an infinite num ber of intervals o f width F,. Thus the integral over the infinite range can be expressed as a sum o f integrals, that is, / oc 3C X a ( F ) e J2,TnF/F' d F = x [{k+XflsF, / Jt= -o c J ( k - \ f l ) F s X a ( F ) e J2jrnF/F’d F (4.2.82) Sec. 4.2 271 Frequency Analysis of Discrete-Time Signals W e o b serve that X a {F) in the frequency interval (k — I ) F t to (k + ~)FS is identical to X a( F — k F s) in the interval —Fs/ 2 to Fs/2. C onsequently. oc V p{k+\l2)F, / x. X a( F ) e i27TnF/F' d F = Jk=-oc J ^ —\fl\Fs Y2 * F\ :2 X a ( F - k F , ) e p^ nF!f d F / k=-?c 'FJ2 J2 X a( F - k F < ) ■' ~"r ! d F J-FJ2 (4.2.83) where w e have used the p eriodicity of the exp on en tial, nam ely. e j 2 n n { F + k F s )/Ft _ ^jTnnF/F, Com paring (4.2.83). (4.2.82), and (4.2.81), w e conclude that X ( t ) = F' T . X A F - k F . ) ' *t k=--XL (4.2.84) or, equivalently. OC X(f) = F X a [ ( f - k ) F s] (4.2.85) This is the desired relationship betw een the spectrum X ( F / F , ) or X ( f ) o f the discrete-tim e signal and the spectrum X a( F) o f the analog signal. The righl-hand side o f (4.2.84) or (4.2.85) consists o f a periodic repetition of the sealed spectrum Fs X a( F) with period F,. This periodicity is necessary because the spectrum X ( f ) or X ( F / F ,) o f the discrete-tim e signal is periodic with period f p = 1 or Fp = Fs . For exam p le, su p p ose that the spectrum o f a band-lim ited analog signal is as sh ow n in Fig. 4.18(a). T h e spectrum is zero for [FI > B. N ow . if the sam ­ pling frequency Fs is selected to be greater than 2 5 . the spectrum X ( F / F S) of the discrete-tim e signal will appear as show n in Fig. 4.18(b). Thus, if the sam pling frequency is selected such that Fv > 2 B. where 2 B is the N yquist rate, then = FsX a(F ) |f | < F J 2 (4.2.86) In this case there is no aliasing and therefore, the spectrum o f the discrete-tim e signal is identical (w ithin the scale factor F,) to the spectrum o f the analog signal, within the fundam ental frequency range |F | < Fsf 2 or [ f \ < O n the other hand, if the sam pling frequency Fs is selected such that Fs < 2 B, the periodic continuation o f X a( F ) results in spectral overlap, as illustrated in Fig. 4.18(c) and (d). T h u s the spectrum X { F / F S) o f the discrete-tim e signal contains aliased frequency com p onents o f the analog signal spectrum X a(F). The end result is that the aliasing which occurs prevents us from recovering the original signal x „(r) from the sam ples. G iven the discrete-tim e signal x(n) with the spectrum X ( F / F S), as illustrated in Fig. 4.18(b ), w ith no aliasing, it is n ow p ossible to reconstruct the original analog Figure 4.18 Sampling of an analog bandlimited signal and aliasing of spectral components. Sec. 4.2 Frequency Analysis of Discrete-Time Signals 273 signal from the sam ples j ( n ) . Since in the absence of aliasing *.<»-(£*(£)■ m s F (4.2.87) ’r - \ F \ > F 5/ 2 lo , and by the Fourier transform relationship (4.2.75). f )- £ / (4.2.88) n= -o c the inverse Fourier transform o f X a ( F ) is xAD = f F' p- / X a ( F ) e s~*F ' d F (4.2.89) Let us assum e that F s = 2 B . W ith the substitution o f (4.2.87) in to (4.2.89), we have Xa(t) = i r F, J - F J y x { n ) e ~ j2 * Fn/F‘ dF (4.2.90) s\n(n/T )(t - nT) (ir/T W -n T ) where x (n ) = x a( n T ) and w here T = \ / F s — 1 /2 B is the sam pling interval. This is the reconstruction form ula given by (1.4.24) in our discussion o f the sam pling theorem . T h e reconstruction form ula in (4.2.90) in volves the function i KO = s in (jr /7 ); s in 2 ^ B f (n/T)t 2n B t (4.2.91) appropriately shifted by n T , n = 0 , ± 1 , ± 2 ........ and m ultiplied or w eigh ted by the corresponding sam ples x „ (n T ) o f the signal. W e call (4.2.90) an in terp ola­ tion form ula for reconstructing x a U) from its sam ples, and g (f). given in (4.2.91), is the interpolation function. W e note that at t = k T , the in terp olation function g(t — n T ) is zero excep t at k = n. C onsequently. xa (t) evalu ated at t = k T is simply the sam ple x 0{k T ). A t all other tim es the w eigh ted sum o f the tim e shifted versions o f the interpolation function com b ine to yield exactly x a (t). T his com b ination is illustrated in Fig. 4.19. T he form ula in (4.2.90) for reconstructing the analog signal xa (t) from its sam ples is called the ideal interpolation fo rm u la . It form s the basis for the sa m p lin g theorem, which can b e stated as follow s. Sam pling T h eo rem . A bandlim ited con tinu ou s-tim e signal, with highest fre­ quency (bandw idth) B H ertz, can be uniquely recovered from its sam ples provided that the sam pling rate Fs > 2 B sam ples per second. 274 Frequency Analysis of Signals and Systems Chap, 4 A ccordin g to the sam pling theorem and the reconstruction form ula in (4.2,90), the recovery o f x a(t) from its sam ples ;c(«), requires an infinite num ber o f sam­ ples. H ow ever, in practice w e use a finite num ber o f sam ples o f the signal and deal with finite-duration signals. A s a con seq u en ce, w e are con cern ed only with reconstructing a finite-duration signal from a finite num ber o f sam ples. W hen aliasing occurs due to to o low a sam pling rate, the effect can be de­ scribed by a m ultiple folding o f the frequency axis o f the frequency variable F for the analog signal. Figure 4.20(a) show s the spectrum X a(F ) o f an analog signal. A ccordin g to (4.2.84), sam pling of the signal with a sam pling frequency Fs results in a periodic repetition o f X a( F ) with period Fs . If Fs < 2 B , the shifted replicas of X g {F) overlap. T he overlap that occurs within the fundam ental frequency range — F.J2 < F < Fs/2, is illustrated in Fig. 4.20(b ). T h e corresponding spectrum of the discrete-tim e signal w ithin the fundam ental frequency range, is obtained by adding all the shifted portions within the range | / | < j , to yield the spectrum shown in Fig. 4.20(c). A careful inspection of Fig. 4.20(a) and (b) reveals that the aliased spectrum in Fig. 4.20(c) can be obtained by folding the original spectrum lik e an accordian with pleats at every odd m ultiple o f Fs/2. C on sequ en tly, the frequency F J 2 is called the f o l d i n g fre q u e n c y , as indicated in C hapter 1. Clearly, then, periodic sam pling autom atically forces a folding o f the frequency axis o f an analog signal at odd m ultiples o f Fs/2, and this results in the relationship F = f Fs b etw een the frequencies for con tinu ou s-tim e signals and discrete-tim e signals. D u e to the fold­ ing o f the frequency axis, the relationship F — f F, is not truly linear, but piecew ise linear, to accom m odate for the aliasing effect. T his relationship is illustrated in Fig. 4.21. If the analog signal is bandlim ited to B < Fs/2, the relationship betw een / and F is linear and o n e-to-on e. In other words, there is no aliasing. In practice, prefiltering with an antialiasing filter is usually em p loyed prior to sam pling. This ensures that frequency com p onents o f the signal above F > B are sufficiently attenuated so that, if aliased, they cause n egligib le distortion on th e desired signal. T h e relationships am ong the tim e-d om ain and freq u en cy-d om ain functions x a (t), x ( n ) , X „ ( F ), and X ( f ) are sum m arized in Fig, 4.22. T h e relationships for Sec. 4.2 Frequency Analysis of Discrete-Time Signals XJFi 0 (a) o T T (c) Figure 4.20 Illustration of aliasing around the folding frequency. / Figure 4.21 R elationship betw een frequency variables F and / . 275 276 Frequency Analysis of Signals and Systems Chap. 4 XJF)= Fourier transform pair Xa(t) \. . Xa(F) xa(t) = j ~ Xa(F )ei -^' dF a:0(F) Reconstruction: = £ tfrt) F, IFI < - j sin 7r(r - nT)!T 7r(t - nT)!T Sampling-, x(n) - x a(nT) x(n) T X (/) Fourier transform pair x(n) = J Figure 4.22 X(f)eill,f"df Time-domain and frequency-domain relationships for sampled sig­ nals. recovering the con tinu ou s-tim e functions, x 0{t) and X a{F ), from th e discrete-tim e quantities x ( n ) and X ( f ) , assum e that the analog signal is bandlim ited and that it is sam pled at the N yquist rate (or faster). T h e follow in g exam p les serve to illustrate the problem o f the aliasing of frequency com ponents. Example 4.2.6 Aliasing in Sinusoidal Signals The continuous-time signal xa(r) ~ cos 2nF^t LgjZxFai has a discrete spectrum with spectral lines at F = ± F U> as shown in Fig. 4.23(a). The process of sam pling this signal with a sam pling frequency Fs introduces replicas of the spectrum about multiples of Fs. This is illustrated in Fig. 4.23(b) fo r Fs/2 < F0 < F,To reconstruct the continuous-time signal, we should select the frequency com­ ponents inside the fundam ental frequency range \F\ < Fs f l . The resulting spectrum Sec. 4.2 277 Frequency Analysis of Discrete-Time Signals Spectrum _| 0 -Fo F0 F U) Spectrum ' it -F t Fu - Fs 0 F,. - F0 (b) Spcctrum 1 F, -<FS- /■(,) f-,~F0 ^ 2 (c) Spectrum 1 2T\ - F q - Fs —Fs F, - F0 0 F0 - F, F, (d) Spectrum 2 F, -y 0 f3 T (e) Figure 4.23 1 F 0 + F, A liasing of sinusoidal signals. 278 Frequency Analysis of Signals and Systems Chap. 4 is shown in Fig. 4.23(c). The reconstructed signal is * „ ( /) = c o s 2 j t ( F , - F (t)i Now. if Fv is selected such that Fs < F(l < 3F 5/2, the spectrum of the sampled signal is shown in Fig. 4.23(d). The reconstructed signal, shown in Fig. 4.23(e). is xu(t) = cos2jr(F (1 - Fs)i In both cases, aliasing has occurred, so that the frequency of the reconstructed signal is an aliased version of the frequency of the original signal. E x a m . e 4.2.7 S am p lin g a N o n b a n d lim ited Signal Consider the continuous-time signal *„(/) = e - AI,i A>0 whose spectrum is given hv X J F ) = — ----- -------A- 4- (2;r F Y Determ ine the spectrum of the sampled signal ,r(n) = xu{nT). Solution If we sample x„(t) with a sampling frequency F, = 1/7", we have jr(n) — xuinT) — e~A1'"' = (e~A1 —oc < n < oc The spectrum of x(n) can be found easily if we use a direct com putation of the Fourier transform. We find that F\ F, J 1 - e~1AT 1 - 2e~A1 cos I n FT + e~2AT T = 1 Fs Clearly, since c o s 2 x F T = c o s 2 t t ( F/ Fs ) is periodic with period Fs, so is X ( F / F S), Since X a(F) is not bandlim ited. aliasing cannot be avoided. The spectrum of the reconstructed signal i„(r) is ™ i - i . \F\<!± ( t. Xa(F) = [o . I F I > J Figure 4.24(a) shows the original signal xa(t) and its spectrum X a( F ) for A = 1The sampled signal x(n) and its spectrum X ( F / F S) are shown in Fig. 4.24(b) for = 1 Hz. The aliasing distortion is clearly noticeable in the frequency domain. The reconstructed signal xa(r) is shown in Fig. 4.24(c). The distortion due to aliasing can be reduced significantly by increasing the sampling rate. For example, Fig. 4.24(d) illustrates the reconstructed signal corresponding to a sampling rate Fs = 20 Hz. It is interesting to note that in every case xa( nT) = xa(nT), but x„{t) / xa(t) at other values of time. Sec. 4.2 279 Frequency Analysis of Discrete-Time Signals x „(n : .*,,(/) = e~A>11 .A = I 14 A - + (2 ttF) 2 (al 1.0 T -2 ! -1 0 1 t [ . <b) (c } (d) Figure 4.24 (a) A nalog signal xa(i ) and its spectrum Xa(Fy. (b) xin i = x a ( ti T) and the spectrum of *(n) for A = 1 and F, = 1 Hz; (c) reconstructed signal x„(i) for F, - 1 Hz: (dj reconstructed signal i aU) for Fs = 20 Hz. 4.2.10 Frequency-Domain Classification of Signals: The Concept of Bandwidth Just as w e have classified signals according to their tim e-dom ain characteristics, it is also desirable to classify signals according to their frequency-dom ain character­ istics. It is com m on practice to classify signals in rather broad terms according to their frequency content. In particular, if a p ow er signal (or energy signal) has its p ow er density sp ec­ trum (or its energy density spectrum ) concentrated about zero frequency, such a signal is called a low -freq ue ncy signal. Figure 4.25(a) illustrates the spectral characteristics o f such a signal. O n the other hand, if the signal p ow er density Frequency Analysis of Signals and Systems 280 Xa{F) Chap. 4 X{a>) fa) X(w) Xa(F) (b) XJF) X(oj) (c) Figure 4.25 (a) Low-frequency, (b) high-frequency, and (c) medium-frequency signals. spectrum (or the energy density spectrum ) is concentrated at high frequencies, the signal is called a h igh -fr eq uency signal. Such a signal spectrum is illustrated in Fig. 4.25(b). A signal having a p ow er density spectrum (or an energy density spectrum ) concentrated som ew h ere in the broad frequency range b etw een low fre­ q uencies and high frequencies is called a m e d i u m - f r e q u e n c y signal or a bandpass signal. Figure 4.25(c) illustrates such a signal spectrum . In addition to this relatively broad frequency-dom ain classification o f signals, it is often desirable to express q uantitatively the range o f freq u en cies over which the p ow er or energy density spectrum is concentrated. This q u an titative m easure is called the b a n d w i d t h o f a signal. For exam p le, su p p ose that a con tinu ou s­ tim e signal has 95% o f its p ow er (or energy) density spectrum con cen trated in the frequency range F\ < F < F 2. T hen the 95% bandw idth o f the signal is F2 — F 1 . In a sim ilar m anner, w e may define the 75% or 90% or 99% bandw idth o f the signal. Sec. 4.2 Frequency Analysis of Discrete-Time Signals 281 In the case o f a bandpass signal, the term n a r r o w b a n d is used to describe the signal if its bandw idth Fz - F\ is m uch sm aller (say, by a factor o f 10 or m ore) than th e m edian frequency {Fi + F \) f2. O therw ise, the signal is called wideband. W e shall say that a signal is b a n d lim ite d if its spectrum is zero ou tsid e the freq u en cy range > B. For exam ple, a con tinu ou s-tim e finite-energy signal x (t) is bandlim ited if its Fourier transform X ( F ) = 0 for m > B. A d iscrete-tim e finite-en ergy signal x ( n ) is said to be (periodically) b a n d lim ited if for a>o < M < x jX(ti>)| = 0 Sim ilarly, a p eriod ic co n tinu ou s-tim e signal x p (r) is p eriodically bandlim ited if its F ourier coefficien ts c* = 0 for |£| > M , w here M is som e p ositive integer. A p erio d ic discrete-tim e signal w ith fundam ental period N is periodically bandlim ited if the Fourier coefficients ck = 0 for kG < |£j < N . Figure 4.26 illustrates the four types o f bandlim ited signals. B y exploiting the duality b etw een the frequency dom ain and the tim e dom ain, we can provide sim ilar m ean s for characterizing signals in the tim e dom ain. In particular, a signal x ( t ) will be called tim e- lim ited if x(r) = 0 |f| > t If the signal is p eriod ic with period Tn, it will be called periodic ally time- lim ited if x p it) = 0 r < \t\ < T p f l If w e have a d iscrete-tim e signal x( n ) o f finite duration, that is, .r(n) = 0 In I > N it is also called tim e-lim ited. W hen the signal is period ic with fundam ental period it is said to be p eriod ically tim e-lim ited if x(n} = 0 Figure 4 J 6 no < )n\ < N Some exam ples of bandlim ited signals. 282 Frequency Analysis of Signals and Systems Chap. 4 W e state, w ithout proof, that no sign al can be time-lim ited a n d ban dlimited sim ultaneously. Furtherm ore, a reciprocal relationship exists b etw een the time duration and the frequency duration o f a signal. T o elaborate, if w e have a shortduration rectangular pulse in the tim e dom ain, its spectrum has a width that is inversely proportional to the duration o f the tim e- dom ain pulse. T he narrower the pulse b eco m es in the tim e dom ain, the larger the bandwidth of the signal b ecom es. C onsequently, the product o f the tim e duration and the bandwidth of a signal cannot be m ade arbitrarily sm all. A short-duration signal has a large bandwidth and a sm all bandwidth signal has a lon g duration. T hus, for any signal, the tim e-b an dw id th product is fixed and cannot b e m ade arbitrarily small. Finally, w e n o te that w e have discussed frequency analysis m eth od s for peri­ odic and aperiodic signals with finite energy. H o w ev er, there is a family o f deter­ m inistic aperiodic signals with finite pow er. T h ese signals consist o f a linear super­ p osition o f com plex exp on en tials with nonharm onically related frequencies, that is, M x{n) = Y l A ke ^ n k= 1 w here &>i, a s , . . . , a >m are nonharm onically related. T h ese signals have discrete spectra but the distances am ong the lin es are nonharm onically related. Signals with discrete nonharm onic spectra are som etim es called quasi-periodic. 4.2.11 The Frequency Ranges of Some Natural Signals T he frequency analysis tools that w e have d ev elo p ed in this chapter are usually applied to a variety o f signals that are en cou n tered in practice (e.g., seism ic, b io lo g ­ ical, and electrom agn etic signals). In gen eral, the frequency analysis is perform ed for the purpose o f extracting inform ation from the ob served signal. For exam ple, in the case o f biological signals, such as an E C G signal, the analytical tools are used to extract inform ation relevant for d iagn ostic purposes. In th e case o f seism ic signals, w e may b e interested in detectin g th e p resen ce o f a nu clear exp losion or in d eterm ining the characteristics and location o f an earthquake. A n electrom agnetic signal, such as a radar signal reflected from an airplane, con tains inform ation on the p osition o f the plane and its radial velocity. T h ese param eters can be estim ated from observation o f the received radar signal. In processing any signal for the p urpose o f m easuring param eters or ex ­ tracting other types o f inform ation, o n e m ust know approxim ately the range o f freq u en cies contained by the signal. For referen ce, T ables 4.1, 4.2, and 4.3 give approxim ate lim its in the frequency d om ain for b iological, seism ic, and electro­ m agnetic signals. 4.2.12 Physical and Mathematical Dualities In the p revious section s o f the chapter w e have introduced several m eth od s for the frequency analysis o f signals. Several m eth od s w ere n ecessary to accom m odate the Sec. 4.2 Frequency Analysis of Discrete-Time Signals TABLE 4.1 283 FR EQ U E N C Y R A NG ES OF SO M E BIO LOG ICAL SIGN ALS F requency R ange (Hz) Type of Signal 0-20 0-20 E lectroretinogram 8 Electronystagtnogram h P neum ogram ' Electrocardiogram (EC G ) E lectroencephalogram (E E G ) Electrom yogram d Sphygm om anogram e Speech 0-40 0-100 0-100 10-200 0-200 100-^000 "A graphic recording of retina characteristics. ’’A graphic recording of involuntary m ovem ent of the eyes. CA graphic recording of respiratory activity. dA graphic recording of m uscular action, such as m uscular contraction. CA recording of blood pressure. TABLE 4.2 FR E Q U E N C Y R A NG ES OF SO M E S E IS M IC SIGNALS Type o f Signal F requency R ange (Hz) W ind noise Seismic exploration signals E arthquake and nuclear explosion signals Seismic noise TABLE 4.3 100-KXX) 10-11X1 (1.01-1(1 0.1-1 F R E Q U E N C Y RANGES O F E L E C T R O M A G N ETIC SIGN ALS W avelength (m ) F requency R ange (Hz) 10M 02 io-’- i o - : 3 x lO4^ x JO6 3 x 1(^-3 x 10U1 Type of Signal R adio broadcast S hortw ave radio signals R adar, satellite com m unications. space com m unications. com m on-carrier microwave Infrared Visible light U ltraviolet G am m a rays and x-rays 2 3.9 x 1-10 u rM o ^ 6 10_7-8.1 10~7 10 -7-]O - 8 u r M o - 10 X 3 x 10^-3 x 1010 3 x 10 11—3 x I0 i4 3.7 x 10w-7.7 x 1014 3 x 1015-3 x lO16 3 x 1017—3 x 101K differen t types o f signals. T o sum m arize, the follow in g frequency analysis tools have b een introduced: 1. T he F ourier series for con tinu ou s-tim e p eriod ic signals. 2. T he F ourier transform for con tinu ou s-tim e ap eriod ic signals. 3. T he F ourier series for discrete-tim e periodic signals. 4. T he F ourier transform for discrete-tim e aperiodic signals. 284 Frequency Analysis of Signals and Systems Chap. 4 Figure 4.27 sum m arizes the analysis and synthesis form ulas for these types of signals. A s w e have already indicated several tim es, there are two tim e-dom ain char­ acteristics that determ ine the type of signal spectrum w e obtain. T h ese are whether the tim e variable is con tinu ou s or discrete, and w h eth er the signal is periodic or aperiodic. Let us briefly sum m arize the results o f the previous sections. Continuous-time signals have aperiodic spectra. A close inspection of the F ourier series and Fourier transform analysis form ulas for continuous-tim e signals d o es not reveal any kind of periodicity in the spectral dom ain. This lack of p eriodicity is a con sequ en ce of the fact that the com p lex ex p on en tial exp(y2jr Ft) is a function o f the continuous variable t, and hence it is not p eriod ic in F . Thus the frequency range o f continuous-tim e signals exten d s from F = 0 to F = 0 0 . Discrete-time signals have periodic spectra. In d eed , both the Fourier series and the Fourier transform for discrete-tim e signals are p eriod ic with period co = 2n . A s a result o f this periodicity, the frequency range o f d iscrete-tim e signals is finite and exten d s from co = —1r to w — tt radians, where w = n corresponds to the highest p ossible rate o f oscillation. Periodic signals have discrete spectra. A s we have ob served , periodic signals are described by m eans o f Fourier series. T h e Fourier series coefficients provide the “lines" that constitute the discrete spectrum . T h e line spacing A F or A f is equal to the inverse o f the period Tp or N , resp ectiveiy, in the time dom ain. That is. A F = 1/7,, for continuous-tim e period ic signals and A f = 1 / N for discrete-tim e signals. Aperiodic finite energy signals have continuous spectra. This prop­ erty is a direct con seq u en ce o f the fact that both X ( F ) and X ( w ) are functions o f exp { j 2 n F t ) and exp {jeon), respectively, which are con tinu ou s functions o f the variables F and co. The continuity in frequency is necessary to break the harmony and thus create aperiodic signals. In sum m ary, w e can conclude that periodic ity with “p e r i o d ” a in o n e domain automatically im plies discretization with “s p a c i n g " o f 1 jot in the o th e r do m ain , and vice versa. If w e k eep in m ind that “p eriod ” in the frequency d om ain m eans the fre­ quency range, “spacing'' in the tim e dom ain is the sam pling p eriod T , line spacing in the frequency dom ain is A F , then a = Tp im plies that 1 /a = \ j T p = A F , a = N im plies that A f = \ / N , and a = Fs im plies that T = 1 /F S. T h ese tim e-frequency dualities are apparent from observation o f Fig. 4.27. W e stress, how ever, that the illustrations u sed in this figure do n ot correspond to any actual transform pairs. Thus any com parison am ong them sh ou ld be a v o i d e d . A careful in sp ection o f Fig. 4 .2 7 also reveals som e m athem atical s y m m e tr ie s and dualities am ong the several frequency analysis relationships. In particular, Figure 4.27 Summary of analysis and synthesis form ulas. 286 Frequency Analysis of Signals and Systems Chap. 4 we observe that there are dualities b etw een the follow in g analysis and synthesis equations: 1. T he analysis and synthesis eq u ation s o f the con tinu ou s-tim e Fourier trans­ form. 2. T he analysis and synthesis eq u ation s of the discrete-tim e F ourier series. 3. T he analysis eq u ation o f the con tinu ou s-tim e F ourier series and the synthesis equation o f the discrete-tim e Fourier transform. 4. T he analysis equation o f the discrete-tim e F ourier transform and the synthesis equation o f the continuous-tim e Fourier series. N o te that all dual relations differ on ly in the sign of the exp on en t of the corresponding com p lex exp on en tial. It is interesting to note that this change in sign can be thought o f either as a folding of the signal or a folding o f the spectrum , since e - j 2 n Fl _ e j 2n( - FU _ If w e turn our atten tion now to the spectral density o f signals, w e recall that we have used the term ener gy density sp e ctru m for characterizing finite-energy aperiodic signals and the term p o w e r density sp e ctru m for period ic signals. This term inology is con sistent with the fact that periodic signals are p ow er signals and aperiodic signals w ith finite energy are energy signals. 4.3 PROPERTIES OF THE FOURIER TRANSFORM FOR DISCRETE-TIME SIGNALS The Fourier transform for aperiodic finite-energy discrete-tim e signals described in the preceding section p ossesses a num ber of properties that are very useful in reducing the com p lexity o f frequency analysis problem s in m any practical appli­ cations. In this section w e d evelop the im portant p roperties o f the Fourier trans­ form. Similar p roperties hold for the Fourier transform of ap eriod ic finite-energy continuous-tim e signals. For co n v en ien ce, w e adopt the notation OC X(a>) = F {x{«)} = x ( n ) e ~ Jcun (4.3.1) X{u>)ejmndoo (4.3.2) /J —— CC for the direct transform (analysis eq u ation ) and x ( n ) = F ~ 1{X(tv)] = — [ 2 * J 2n for the inverse transform (syn thesis eq u ation ). W e also refer to x ( n ) and X(o)) as a Fourier tra nsfo rm p a i r and d en ote this relationship with the n otation Sec. 4.3 Properties of the Fourier Transform for Discrete-Time Signals 287 R ecall that X (a>) is periodic with period 2 n . C on sequ en tly, any interval o f length 2 n is sufficient for the specification o f the spectrum . U sually, we plot the spectrum in the fundam ental interval [—jr. tt J. W e em p hasize that all the spectral inform ation contained in the fundam ental interval is necessary for the co m p lete d escription or characterization o f the signal. For this reason, the range o f integration in (4.3.2) is always 2jt, in d ep en dent o f the specific characteristics o f the signal w ithin the fundam ental interval. 4.3,1 Symmetry Properties of the Fourier Transform W hen a signal satisfies som e sym m etry p roperties in the tim e dom ain, these prop­ erties im pose so m e sym m etry conditions on its Fourier transform . E xp loitation of any sym m etry characteristics leads to sim pler form ulas for both the direct and inverse F ourier transform. A discussion o f various sym m etry properties and the im plications o f these properties in the frequency dom ain is given here. Suppose that both the signal x(n) and its transform X(co) are com plex-valued functions. T hen they can be expressed in rectangular form as jr(n) = x K(n) + jX f(n ) (4.3.4) X'(co) = X k {(o ) + j X [ ( co) (4.3.5) By substituting (4.3.4) and e~>w — cosu> - / s in co into (4.3.1) and separating the real and im aginary parts, we obtain OC Xk(lo) = 22 costu/i -f- xj{n) sin con] (4.3.6) ft = — OC SC X/(a>) = — 2 2 [*jfOO sin a>n—.*/(«) cos&inj n=-oc (4.3.7) In a sim ilar m anner, by substituting (4.3.5) and eJm = cos co + j s m u > into (4.3.2), w e obtain x R(n) = - — f [X/?(a>) cosam — X/(co) sin con]dco 2 n J2n (4.3.8) X/(n) — — (4.3.9) f [X ft (co) sincon + X/ ( w) cos con]dco "T J2k N o w , let us in vestigate som e special cases. Real signals. If x(n) is real, then x/t(n) = x(n) and xi(n) = 0. (4.3.6) and (4.3.7) reduce to H en ce OC X R(co) — 2 2 x ( n ) cos con (4.3.10) Frequency Analysis of Signals and System s 288 Chap. 4 and X i { w) = — * (« )s in o jrt (4.3.11) Since c o s (—con) = cos ton and sin (—con) = —sin cun, it follow s from (4.3.10) and (4.3.11) that X R( - w ) = X R(co) (ev en ) (4.3.12) X, ( -co) = -X /(o > ) (o d d ) (4.3.13) If w e com bine (4.3.12) and (4.3.13) into a single eq u ation , w e have X*(co) = X ( - w ) (4.3.14) In this case we say that the spectrum o f a real signal has H e r m itia n sy m m etry. W ith the aid o f Fig. 4.28, w e observe that the m agnitude and phase spectra for real signals are X(to)\ = J X\{co) + Xj(co) (4.3.15) (4.3.16) 4 _X|oj| = tan X r ( co) A s a con sequ en ce o f (4.3.12) and (4.3.13), the m agnitude and p h ase spectra also p ossess the sym m etry properties |,Y(co)| = \ X { —co)\ (ev en ) (4.3.17) liX (-co) = -& X (to ) (od d ) (4.3.18) In the case o f the inverse transform o f a real-valued signal [i.e., Jt(n) = jcj?(n)], (4.3.8) im plies that (n) = — f [X/f(a>) cosa>n — X /(a>)sinam ]dw (4.3.19) Jin R(co) Since both products X R (to) cos ton and X /( oj) sin con are even fun ction s o f co, we have 1 r = — I [X^(cu) cos con — X/(co) sin con]dco x Ja Imaginary axis functions. (4.3.20) Sec. 4.3 Properties of the Fourier Transform for Discrete-Time Signals 289 Real and even signals. If .*■<«) is real an d ev e n [i.e., x ( ~ n ) = * (« )], th en jf(/i)cosw ?i is ev en a n d x ( n )s in w n is od d . H e n c e , fro m (4.3.10). (4.3.11). an d (4.3.20) w e o b ta in Xff(a>) = x (0 ) + 2 x(n)coswn (e v e n ) (4.3.21) X i ( w) = 0 (4.3.22) jr(n) = j f * X R(o>) cos cun da> (4.3.23) T h u s real a n d ev en signals po ssess real-v a lu e d sp e c tra , w hich, in ad d itio n , a re even fu n ctio n s o f th e freq u e n cy v ariab le a>. Real and odd signals. If x(/i) is real an d o d d [i.e., x ( —n) = - x ( « ) ] , th e n x ( n )c o s w n is o d d an d .vODsinwn is even. C o n se q u e n tly . (4.3.10). (4.3.11) and (4.3.20) im ply th a t A'k(oi) = 0 (4.3.24) (o d d ) (4.3.25) (4.3.26) T h u s re a l-v a lu e d o d d signals possess p u rely im ag in arv -v alu ed sp e ctral c h a ra c te ris­ tics. w hich, in a d d itio n , a re o d d f unct i ons o f th e freq u e n cy v ariab le co. Purely imaginary signals. In th is case x K(n) = 0 an d x ( n ) - j x f (n). T h u s (4.3.6). (4.3.7), a n d (4.3.9) re d u c e to (o d d ) (4.3.27) (ev en ) (4.3.28) (4.3.29) If x / ( n ) is o d d [i.e., x / ( —n) = —x/ (n)], th e n (o d d ) X/(a>) = 0 (4.3.30) (4.3.31) (4.3.32) 290 Frequency Analysis of Signals and Systems Chap. 4 S im ilarly, if xj ( n) is ev en [i.e.. x / ( —n) — .v/(«)]. we h ave X *M - 0 (4.3.33) X X [ ( oj) = x /(0 ) + 2 Y ^ x i ( n ) cos con (ev en ) (4.3.34) n= 1 1 r x ; ( n) = — I X Jo X 1 (co) cos cun d w (4.3.35) A n a rb itra ry , possibly co m p lex -v alu ed signal x (n ) can be d e c o m p o s e d as x ( n ) = Xfi(n) + j x i ( n ) = x R e (n) + x ‘^ ( n) + j [ x ] ( n ) + *"(« )] (4.3.36) = Ar (/i) + Jr„(rt) w h ere, by d efin itio n , x f (n) = x K f ( n) - h j Xf ( n ) = j[at(«) + jr* (- n )] x„(n) = x'x(n) + j x/ ( r i ) - |[ jr( n ) - x * ( - n ) ] T h e su p e rscrip ts e a n d o d e n o te th e even an d o d d signal c o m p o n e n ts , respectively. W e n o te th a t x e(n) — x e(—n) a n d x r,(—n) = - a :„(«). F ro m (4.3.36) a n d the F o u rie r tra n sfo rm p ro p e rtie s e s tab lish ed ab o v e, w e o b ta in th e follow ing relatio n sh ip s: x{n) = [*£(«) + j x l (n)\ + [.i*(/0+y'A'/(n)] ] ■ xito) = [x(R(co) + j x f u o ) 1 + ' (4.3.37) + j x ) \ w) ] T h e se sy m m e try p ro p e rtie s of th e F o u rie r tra n sfo rm are su m m a riz e d in T a ­ ble 4.4 an d in Fig. 4.29. T h ey a re o ften used to sim plify F o u rie r tra n sfo rm calcu ­ latio n s in p ractice. Example 4.3.1 Determ ine and sketch X R(w), X , ( w ), l^ioOi. and ^X(co) for the Fourier transform X(a>) = 1 ■■ - 1< a < 1 (4.3.38) 1 — a e ~ ,w Solution By multiplying both the num erator and denom inator of (4 .3 .3 8 ) by the complex conjugate of the denom inator, we obtain 1 —ae!w 1 — a co s co —j a sin co X(w) - ----------------------------- = ------------------ ------— (1 — a e ~ }U,) ( 1 - a e JU>) 1 — 2a c o s o j + a " This expression can be subdivided into real and imaginary parts. Thus we obtain 1 —a cos co X r (w ) — 1 — 2 a cos o j + a1 a sin w X,(u>) = -■ 1 — 2a cos co + a 2 Substitution of the last two equations into (4.3.15) and (4.3.16) yields the mag­ nitude and phase spectra as |X(<u)i - ■■■■ 1 - ■= = v l — 2a cos co a2 (4.3.39) Sec. 4.3 Properties of the Fourier Transform for Discrete-Time Signals TABLE 4.4 SYMMETRY PROPERTIES OF THE DISCRETE-TIME FOURIER TRANSFORM Sequence DTFT xin) A' (w) X’i-w) X ’ (a>) x ’ (n ) j 'l - n ) J«(n) ^ "I- —^)] A'/jlo)) =: ^[X(t^) — -V*(—aj)j jx /[n ) A>(n) = 4 [ j r ( n } + a ' ( —n ) ] X R\.u» x„(n) = - , v ’ (— n)] j X, { t o) Real Sienals A n y real signal x (n ) X (w ) = X ' ( - u i ) X r (w ) = X r { —id) Xfiuj) — — IX ( oj)| = ] X ( —<y)| \ t.(n) i (a (>>) ,r( —n )] (r e a l an d e v e n ) x.An) — i|.r(n) - r l — n)] (r e a l a n d o d d ) F igure 4.29 = -iX (-w ) An(to) (real and even) ]X (imaginary and odd) Sum m ary of symmetry properties for the F o u rier transform . 291 Frequency Analysis of Signals and Systems 292 Chap, 4 and XrX(w) = - tan (4.3.40) 1 1 — a cos w Figures 4.30 and 4.31 show the graphical representation of these spectra foT a = 0.8. The reader can easily verify that as expected, all symmetry properties for the spectra of real signals apply to this case. Example 4.3.2 D eterm ine the Fourier transform of the signal | A. —M < n < M 1 0, elsewhere (4.3.41) Solution CleaTly, x { —n) = x{n). Thus *(«) is a T e a l and even signal. From (4.3.21) we obtain X(a>) = X K(a>) = A I 1 4- 2 ^ c o s Xg((i>) (a) (b) Figure 4 J 0 G raph of X r ( o>) and X / ( w ) for the transform in Exam ple 4,3.1. Sec. 4.3 Properties of the Fourier Transform for Discrete-Time Signals 293 IXlcoM (a) ^X{w) Figure 4.31 Magnitude and phase spectra of the transform in Example 4.3.1. If we use the identity given in Problem 4.13, we obtain the simpler form X(u>) = A sinfAf + l)oj . - -J sin(tu/2) Since X (a>) is real, the magnitude and phase spectra are given by sin(Af + IX M I = A sin(a)/2) I | (4,3.42) and 0, jt, Figure 4,32 shows the graphs for X(w). if X{w) > 0 if X(a>) < 0 (4.3.43) 294 Frequency Analysis of Signals and Systems Chap. 4 X(n) - MOM X(u>) IXMI ZX(w) 4.3.2 Fourier Transform Theorems and Properties In th is se ctio n w e in tro d u c e se v era l F o u rie r tra n sfo rm th e o re m s a n d illu stra te th eir u se in p ra c tic e b y ex am p les. Linearity. If Sec. 4,3 295 Properties of the Fourier Transform for Discrete-Time Signais an d F X2 (n) *— » X ;(a/) th en (4.3.44) Sim ply sta te d , th e F o u rie r tra n sfo rm a tio n , view ed as an o p e ra tio n on a signal jt(rt), is a iin e a r tra n sfo rm a tio n . T h u s th e F o u rie r tra n sfo rm o f a lin e a r c o m b in a tio n o f tw o o r m o re signals is eq u al to th e sam e lin e a r co m b in a tio n o f th e F o u rie r tra n sfo rm s o f th e in d iv id u al signals. T h is p ro p e rty is easily p ro v e d by using (4.3.1). T h e lin earity p ro p e rty m a k e s th e F o u rie r tra n sfo rm su ita b le fo r th e stu d y o f lin ear system s. Example 4.3.3 Determ ine the Fourier transform of the signal (4.3.45) Beginning with the definition of the Fourier transform in (4.3.1), we have Xi(a>) = 22 ■M'Oe- -""" = 22a ’'e i=D = The summation is a geometric series that converges to 1 — ae~)w provided that \ae ""I = Icij • |e ""| = \a] < 1 which is a condition that is satisfied in this problem. Similarly, the Fourier transform of X j i n ) is 296 Frequency Analysis of Signals and Systems Chap, 4 By combining these two transforms, we obtain the Fourier transform of x(n) in the form X ((i>) = l _ a: 1 - (4.3.46) 2a co so j + a 2 Figure 4.33 illustrates *(n) and X(w) for the case in which a = 0.8. Time shifting. If X (a)) x (n ) th e n x ( n - k) « e - ja,kX ( w ) (4.3.47) T h e p ro o f o f th is p ro p e rty follow s im m e d ia te ly from (he F o u rie r tra n sfo rm of x ( n — k) by m ak in g a change in th e su m m a tio n index. T h u s F[x{n - k ) } = X(a>)e~J<uk = \X(aj )\ej[^ Xuu]- <,,k] X(a>) Figure 4.33 Sequence x I n ) and its F ourier transform in Exam ple 4.3.3 with Sec. 4.3 Properties of the Fourier Transform for Discrete-Time Signals 297 T h is re la tio n m ean s th a t if a signal is sh ifted in th e tim e d o m a in by k sam ­ p les, its m a g n itu d e sp e c tru m re m a in s u n c h a n g e d . H o w e v e r, th e p h ase sp e c tru m is ch an g ed by an a m o u n t -cok. T his re su lt can easily b e e x p la in e d if w e recall th a t th e fre q u e n c y c o n te n t o f a signal d e p e n d s only on its sh a p e. F ro m a m a th e m a tic a l p o in t o f view , w e can say th a t shifting by k in th e tim e d o m a in , is e q u iv a le n t to m u ltip ly in g th e sp e c tru m by e~i'ok in th e fre q u e n c y d o m ain . T im e r e v e r s a f . If j:(«) X(co) x(-n) X ( - a >) th e n (4.3.48) T h is p ro p e rty can be e s tab lish ed by p e rfo rm in g th e F o u rie r tra n sfo rm a tio n o f jt ( —n) an d m ak in g a sim ple ch an g e in th e su m m a tio n in d ex . T h u s OC F (x (-n )j = 22 x ( l '>e>Wi = f= —OC If x ( n ) is real, th e n from (4.3.17) an d (4.3.18) w e o b ta in F ( * ( - n ) | = X{-a>) = = \ X( w) \ e ~ / ^ XiM' T h is m e a n s th a t if a signal is folded a b o u t th e origin in tim e, its m a g n itu d e sp e ctru m re m a in s u n c h a n g e d , a n d th e p h a se sp e c tru m u n d e rg o e s a c h a n g e in sign (p h ase re v e rsa l). C o n v o lu tio n t h e o r e m . If F x\ (n) 4— ►X ](w) an d x 2 (n) X 2 {oj) th e n x (n ) = Xi (h) * X2 (n) X(co) = X] (a))X 2 (&>) (4.3.49) T o p ro v e (4.3.49), w e recall th e co n v o lu tio n fo rm u la OC x ( n ) = ^ i(n ) * x 2 (n) = Y x \ ( k ) x 2 (n - k) k=—oc B y m u ltip ly in g b o th sides o f this e q u a tio n by th e e x p o n e n tia l e x p ( —jeon) a n d su m m in g o v e r all n, w e o b ta in OC X(a>)= ^ x ( n ) e ~ Jwn = OC ^ " OC ^ x \ { k ) x 2(n — k) e~]a>n 298 Frequency Analysis of Signals and Systems Chap. 4 A fte r in te rc h a n g in g th e o rd e r o f th e su m m a tio n s a n d m ak in g a sim ple ch an g e in th e su m m atio n in d ex , th e rig h t-h a n d side o f this e q u a tio n re d u c e s to th e p ro d u ct Xi(a>)X 2 (io). T h u s (4.3.49) is estab lish ed . T h e co n v o lu tio n th e o re m is o n e o f th e m o st p o w erfu l to o ls in lin e a r system s analysis. T h a t is, if w e co nvolve tw o signals in th e tim e d o m a in , th e n this is e q u iv a le n t to m u ltip ly in g th e ir sp e c tra in th e fre q u e n c y d o m ain . In la te r c h ap ters we will see th a t th e co n v o lu tio n th e o re m p ro v id es an im p o rta n t c o m p u tatio n al to o l fo r m an y d ig ital signal p ro cessin g ap p licatio n s. Example 4.3.4 By use of (4.3.49). determ ine the convolution of the sequences A'l(/1) = A:(h ) = {1. 1. 1) t Solution By using (4.3.21). we obtain X i ((o) = X 2(w ) = 1 + 2 cos w Then X (co) = A't (cijjASfa)) = (1 + 2coso>)‘ = 3 + 4 cos w -i- 2 cos ho = 3 4- 2 (c"" + (■“ "") + ic' 2"' + Hence the convolution of with is .v (ii) = ( 1 2 3 2 1 ) T Figure 4.34 illustrates the foregoing relationships. The correlation theorem. If x i(n ) X \(a>) A‘;(« ) Xzito)) an d th en ri,x2(m ) S „ ,; (w) = X \ ( c d) X 2 (—oj) (4.3.50) T h e p ro o f o f (4.3.50) is sim ilar to th e p ro o f o f (4.3.49). In th is case, w e have X r^xAn) = ^ x ] ( k ) x 2( k - n ) k=~-'X. B y m u ltip ly in g b o th sides o f this e q u a tio n by th e e x p o n e n tia l ex p (—jeon) and su m m in g o v er all n , w e o b ta in OC Sxll2(w) = X oc x i ( k )x 2(k - n ) e ~ JmR X2M Figure 4 3 4 Graphical representation of the convolution property. F in ally , w e in te rc h a n g e th e o rd e r o f th e su m m a tio n s an d m a k e a ch an g e in th e su m m a tio n in d ex . T h u s w e find th a t th e rig h t-h a n d sid e o f th e e q u a tio n above re d u c e s to X \ ( u ) ) X 2 ( —a>). T h e fu n ctio n SXlX2(a)) is called th e cross-energy density s pe c t r um o f th e sig n a ls x\ (n) an d x 2 (n). The W iener-Khintchine theorem. rxz(l) L e t jc(n) be a re a l signal. T h e n s„(a) (4-3.51) T h a t is, th e e n e rg y sp e c tra l d en sity o f an en erg y signal is th e F o u rie r tra n sfo rm o f its a u to c o rre la tio n se q u e n c e . T h is is a sp ecial case o f (4.3.50). T h is is a v ery im p o rta n t resu lt. It m ean s th a t th e a u to c o rre la tio n se q u e n c e o f a sig n al a n d its en e rg y sp e c tra l d e n sity c o n tain th e sam e in fo rm a tio n a b o u t th e signal. S ince, n e ith e r o f th e s e c o n ta in s any p h ase in fo rm a tio n , it is im p o ssib le to u n iq u e ly re c o n stru c t th e signal fro m th e a u to c o rre la tio n fu n ctio n o r th e en erg y d e n sity sp e ctru m . Example 4JJ D eterm ine the energy density spectrum of the signal x(n) = tf^ufn) - 1<a < 1 300 Chap. 4 Frequency Analysts of Signals and Systems Solution signal is From Example 2.6.2 we found that the autocorrelation function for this f a il) = --------- oc < / < oo 1 —a* By using the result in (4.3.46) for the Fourier transform of a 1'1, derived in Exam­ ple 4.3.3. we have = ----- — —----- - 1 —2a cos w + a- 1 —0“ Thus, according to the W iener-K hintchine theorem , 1 1 —2a cos w + a 2 Sxx(w) = Frequency shifting. If x( n) < F > X( u) ) th en e i<onnx ( n ) « X(cu-m ) (4.3.52) T h is p ro p e rty is easily p ro v e d by d ire c t s u b s titu tio n in to th e analysis e q u a tio n (4.3.1). A cco rd in g to this p ro p e rty , m u ltip lic a tio n o f a se q u e n c e x( n) by e iu>-)n is eq u iv a le n t to a fre q u e n c y tra n sla tio n o f th e sp e c tru m X(co) by co<>. T h is freq u e n cy tra n sla tio n is illu stra te d in Fig. 4.35. S ince th e s p e c tru m X(co) is p e rio d ic, th e shift a\) ap p lies to th e sp e c tru m o f th e signal in every p erio d . The modulation theorem. If x( n) < F > X (a>) X(u>) * _2 1 2 0 w (a) X( uj- cjq) - 2w - 2* + wo 2i 2» + cjo « (b) Figure 4 3 5 form. Illustration of the frequency-shifting property of the Fourier trans­ Sec. 4.3 Properties o f the Fourier Transform for Discrete-Time Signals 301 th e n + cuo) + X(w — c^o)] x ( n ) cos coqt i (4.3.53) T o p ro v e th e m o d u la tio n th e o re m , w e first ex p ress th e signal coswo'J as + e - J^'") cos won = U p o n m u ltip ly in g x (n ) by th e se tw o e x p o n e n tia ls a n d using th e freq u e n cy -sh iftin g p ro p e rty d e sc rib e d in th e p re c e d in g sectio n , w e o b ta in th e d e sire d re su lt in (4.3.53). A lth o u g h th e p ro p e rty given in (4.3.52) can also be v iew ed as (com plex) m o d u la tio n , in p ractice w e p re fe r to use (4.3.53) b ecau se th e signal j (h ) c o s a ^ ? is real. C learly , in th is case th e sy m m etry p ro p e rtie s (4.3.12) and (4.3.13) are p re se rv e d . T h e m o d u la tio n th e o re m is illu stra te d in Fig. 4.36, w hich c o n ta in s a plot of th e sp e c tra o f th e signals jr(/;). vi(n) = ;c (n )c o s 0 .5 ;rn an d y ifn ) = .* (« )cos7n;. 2 (a) 2 2 (b) 2 2 (c) Figure 4.36 G raphical representation of the m odulation theorem . 302 Frequency Analysis of Signals and Systems Parseval’s theorem. Chap. 4 If jri(n) an d X 2 (a>) X2 (n) th en oc Y 1 / ' ,7 xi(n)jL*(n) = — - / X\((i>)X* (4.3.54) 2jr J - * ‘ T o p ro v e this th e o re m , w e use (4.3.1) to elim in a te X\(<o) on th e rig h t-h an d side o f (4.3.54). T h u s we h ave h i T , X](n)e' X^i^dto x = i r 22 f n= -3 c *' 2n- ^ ( w ) e ~ Jujnda> = 22 n —~ oc In th e special case w h ere x 2 (n) = X](/i) = x ( n) , P a rse v a l’s re la tio n (4.3.54) red u ces to yx 1 k (« )| 2 = r — /f \X (a > )\2dw (4.3.55) 2 TT J 2, W e o b se rv e th a t th e le ft-h a n d side o f (4.3.55) is sim ply th e e n e rg y E x o f th e signal x(fj). It is also e q u a l to th e a u to c o rre la tio n o f * (« ), rxx(l), e v a lu a te d a t / = 0. T h e in te g ra n d in th e rig h t-h a n d side o f (4.3.55) is e q u a l to th e en erg y density sp e c tru m , so th e in te g ra l o v e r th e in terv al —it < a> < it y ields th e to ta l signal en erg y . T h e re fo re , w e co n clu d e th a t E x = r xA ® ) = °° y i \x ( n )\2 = — 2jt r l — J2n\X(a))\ 2d w = 2it cn Ss x (w)da> Multiplication of two sequences (Windowing theorem). (4.3.56) If x\ ( n) <— ►Xi(cu) an d x 2 (n) <— ►X 2 (co) then f i x j i n ) = x \ { n ) x 2 {n) ■*— ►X j ( w) = — r / X] ( k ) X 2 (a) - k ) d k J_n (4.3.57) Sec. 4.3 Properties of the Fourier Transform f o r Discrete-Time Signals 303 T h e in te g ra l on th e rig h t-h a n d side of (4.3.57) re p re se n ts th e co n v o lu tio n of the F o u rie r tra n sfo rm s Xi(cl>) a n d X 2(w). T h is re la tio n is th e d u a l o f th e tim e-d o m ain c o n v o lu tio n . In o th e r w ords, th e m u ltip lic atio n o f tw o tim e -d o m a in se q u en ces is e q u iv a le n t to th e co n v o lu tio n of th e ir F o u rie r tran sfo rm s. O n th e o th e r h a n d , the co n v o lu tio n o f tw o tim e -d o m a in se q u e n c e s is e q u iv a le n t to th e m u ltip lic a tio n o f th e ir F o u rie r tran sfo rm s. T o p ro v e (4.3.57) we b egin w ith th e F o u rie r tra n sfo rm o f (n) = jci(rt)x 2(n) an d u se th e fo rm u la fo r th e in v erse tra n sfo rm , nam ely, T h u s, w e h av e CC X3(oj) = CC Y x 3(n)e Jwn = J X\(k) 2 2 x ' ( n )x 2 (n )e — k)d k T h e co n v o lu tio n in teg ral in (4.3.57) is kn o w n as th e per i od i c convol ut i o n o f Xi(o>) a n d X 2 (to) b e c a u se it is th e co n v o lu tio n o f tw o p e rio d ic fu n ctio n s h av in g th e sam e p e rio d . W e n o te th a t th e lim its o f in te g ra tio n e x te n d o v e r a single p erio d . F u rth e rm o re , w e n o te th a t d u e to th e p erio d icity o f th e F o u rie r tra n sfo rm fo r d isc re te -tim e signals, th e re is no “p e rfe c t" d u ality b e tw e e n th e tim e an d freq u e n c y d o m a in s w ith re sp e c t to th e c o n v o lu tio n o p e ra tio n , as in th e case o f c o n tin u o u s­ tim e signals. In d e e d , co n v o lu tio n in th e tim e d o m ain (a p e rio d ic su m m a tio n ) is e q u iv a le n t to m u ltip lic a tio n o f co n tin u o u s p e rio d ic F o u rie r tra n sfo rm s. H o w ev er, m u ltip lic a tio n o f a p e rio d ic se q u e n c e s is e q u iv a le n t to p e rio d ic co n v o lu tio n o f th e ir F o u rie r tra n sfo rm s. T h e F o u rie r tra n sfo rm p a ir in (4.3.57) will p ro v e u se fu l in o u r tr e a tm e n t of F IR filter d esign b a se d on th e w indow te c h n iq u e . Differentiation in the frequency domain. If F x( n) «— ►X(a>) then f nx(n) . ii X( ( o) da) (4.3.58) 304 Frequency Analysis of Signals and System s Chap. 4 T o p ro v e this p ro p e rty , we use th e d efin itio n o f the F o u rie r tra n sfo rm in (4.3.1) an d d iffe re n tia te th e series te rm by te rm w ith resp ec t to w. T h u s we o b ta in d X ( u>) d doj du> 7 2 n x ( n ) e Ju N ow w e m u ltip ly b o th sides of th e e q u a tio n bv j to o b ta in th e d esired resu lt in (4.3.58). T h e p ro p e rtie s d eriv ed in this section are su m m a riz e d in T a b le 4.5, which serv es as a co n v e n ie n t refe ren ce . T ab le 4.6 illu stra te s som e useful F o u rie r tran s­ form p a irs th a t will be e n c o u n te re d in la te r c h a p te rs. TABLE 4.5 PR O P E R TIE S OF TH E FO U R IE R T R A N S F O R M FOR D IS C R E TE -TIM E S IG N ALS Property Notation Linearity Time shifting Time reversal Convolution C orrelation W iener-Khm tchine theorem Frequency shifting M odulation Time Domain Frequency Domain ,v(«) A](ii) x2(n) a\X] (n) + x(rt ~ k) x(~n) x \ { n ) * x 2 (n) r llt,(/) = ^, (/) * j z( - / ) r„ (/) A'(co) X](w) A'iUu) a\X](a)) + 02 X 2 (01) e_ ""l X(«) X ( —a>) Xi(u>)X;(oj) 5,,.,, iw) = X, ( w)X2(-to) —- A j (ul>)X ■,(iu) [if X2 (h) is real] -S.t.r (w) eja,0"x(n) x(n) cosa>nr X( w — o^j) \ X ( w + tut,) +■ i X ( w - wn) Multiplication D ifferentiation in the frequency domain Conjugation 1 f” — I X |(/.)X ’ (w —X)dk 2jr d X (u») du> J-n nx(n) x*{n) X ’ ( - w) X\ ( w) X*(io)doj Sec. 4.4 Frequency-Domain Characteristics of Linear Tim e-Invariant Systems 305 TABLE 4.6 SO M E U S EFU L F O U R IE R TR A N S FO R M PAIRS FO R D IS C R E TE -TIM E A P ER IO D IC SIGNALS 4.4 FREQUENCY-DOMAIN CHARACTERISTICS OF LINEAR TIME-INVARIANT SYSTEMS In th is se ctio n w e d e v e lo p th e c h a ra c te riz a tio n o f lin e a r tim e -in v a ria n t system s in th e fre q u e n c y d o m a in . T h e basic e x c ita tio n signals in th is d e v e lo p m e n t a re th e co m p lex e x p o n e n tia ls a n d sin u so id al fu n ctio n s. T h e c h a ra c te ristic s o f th e system a re d e s c rib e d by a fu n ctio n o f th e fre q u e n c y v a ria b le co called th e fre q u e n c y r e ­ sp o n se, w hich is th e F o u rie r tra n sfo rm o f th e im p u lse re sp o n s e h( n) o f th e system . T h e fre q u e n c y re sp o n s e fu n ctio n c o m p le te ly c h a ra c te riz e s a lin e a r tim ein v a ria n t sy stem in th e fre q u e n c y d o m a in . T h is allow s us to d e te rm in e th e 306 Frequency Analysis of Signals and System s Chap. 4 ste a d y -s ta te re sp o n se o f th e system to an y a rb itra ry w eig h ted lin e a r co m b in atio n o f sin u so id s o r co m p lex e x p o n en tials. Since p e rio d ic se q u e n c e s, in p a rtic u la r, lend th em se lv e s to a F o u rie r series d e c o m p o sitio n as a w eig h te d sum o f h a rm o n ically re­ lated co m p lex e x p o n e n tia ls, it b eco m es a sim ple m a tte r to d e te rm in e th e response o f a lin e a r tim e -in v a ria n t system to this class o f signals. T his m e th o d o lo g y is also a p p lied to a p e rio d ic signals since such signals can b e view ed as a su p e rp o s itio n of infin itesim al size co m p lex ex p o n en tials. 4.4.1 Response to Complex Exponential and Sinusoidal Signals: The Frequency Response Function In C h a p te r 2, it w as d e m o n s tra te d th a t th e re sp o n se o f any re la x e d lin e a r tim ein v arian t sy stem to an a rb itra ry in p u t signal jr(n), is given by th e c o n v o lu tio n sum fo rm u la X yin)- ft(k)x(n-k) (4.4.1) £— — OC In th is in p u t- o u tp u t re la tio n sh ip , th e sy stem is c h a ra c te riz e d in th e tim e dom ain by its u n it sam p le re sp o n s e {h ( n ). - o c < n < oo}. T o d ev e lo p a fre q u e n c y -d o m a in c h a ra c te riz a tio n o f th e sy stem , let us excite th e sy stem w ith th e co m p lex e x p o n e n tia l — 00 < n < cc jr(n) = A e Jam (4.4.2) w h ere A is th e a m p litu d e and a> is an y a rb itra ry fre q u e n c y c o n fin ed to th e freq u en cy in terv al [ - t t . j t ] . By su b stitu tin g (4.4.2) in to (4.4.1), w e o b ta in th e re sp o n se v(n) = 22 h ( k ) [ A e Jb,in- k}] X k~ ~ X OC = A (4.4.3) 2 2 h ( k ) e ~ Juk W e o b se rv e th a t th e te rm in b ra c k e ts in (4.4.3) is a fu n ctio n o f th e freq u en cy v ariab le a>. In fact, th is te rm is th e F o u rie r tra n sfo rm o f th e u n it sa m p le resp o n se h{k) o f th e system . H e n c e w e d e n o te th is fu n ctio n as 00 H(w)= 22 h ( k ) e ~ ja>k (4.4.4) C learly , th e fu n ctio n H(co) exists if th e sy stem is B IB O sta b le , th a t is, if OC y |/i(rc)| < 00 n =-oc W ith th e d efin itio n in (4.4.4), th e re sp o n se o f th e system to th e com plex e x p o n e n tia l giv en in (4.4.2) is y(n) = AH(oo)eJwn (4.4.5) Sec. 4.4 Frequency-Domain Characteristics of Linear Tim e-Invariant Systems 307 W e n o te th a t th e re sp o n se is also in th e fo rm o f a co m p lex e x p o n e n tia l w ith the sam e fre q u e n c y as th e in p u t, b u t a lte re d by th e m u ltip lic ativ e fa c to r H ( m ). A s a re su lt o f th is c h a ra c te ristic b e h a v io r, th e e x p o n e n tia l signal in (4.4.2) is called an ei genf unct i on o f th e system . In o th e r w o rd s, an eig e n fu n c tio n o f a system is an in p u t signal th a t p ro d u c e s an o u tp u t th a t differs fro m th e in p u t by a c o n s ta n t m u ltip lic ativ e facto r. T h e m u ltip lic ativ e fa c to r is called an ei genval ue o f th e system . In th is case, a c o m p lex e x p o n e n tia l signal o f th e fo rm (4.4.2) is an e ig en fu n ctio n of a lin e a r tim e -in v a ria n t system , a n d H(u>) e v a lu a te d at th e fre q u e n c y o f the in p u t signal is th e c o rre sp o n d in g eig en v alu e. Example 4.4.1 D eterm ine the output sequence of the system with impulse response (4.4.6) k{n) = (iY ‘u(/i) when the input is the complex exponential sequence xin) = Ac^"' - — oo < n < oc Solution First we evaluate the Fourier transform of the impulse response hin), and then we use (4.4.5) to determ ine v(n). From Example 4.2.3 we recall that (4.4.7 > At ui = 7t/2, (4.4.7) yields and therefore the output is (4.4.8) —oc < n < oc T h is ex a m p le clearly illu stra te s th a t th e only effe ct o f th e system on th e in p u t signal is to scale th e a m p litu d e by 2 /\/5 a n d shift th e p h ase by - 2 6 .6 “. T h u s th e o u tp u t is also a co m p lex e x p o n e n tia l o f fre q u e n c y n / 2 , a m p litu d e 2 A / v /5. an d p h a se - 2 6 .6 C. If w e a lte r th e fre q u e n c y of th e in p u t signal, th e effe ct o f th e system on th e in p u t also c h an g es a n d h en c e th e o u tp u t ch an g es. In p a rtic u la r, if th e in p u t se q u e n c e is a c o m p lex e x p o n e n tia l o f fre q u e n c y tt. th a t is, x(n) = A e ^ n — oo < n < oc then, at co = jr. 1 2 3 (4.4.9) 308 Frequency Analysts of Signals and Systems Chap. 4 an d th e o u tp u t o f th e sy stem is v(n) = 5 A e jnn — 00 < n < 00 (4.4.10) W e n o te th a t H ( n ) is p u re ly real [i.e., th e p h a se a s so ciated w ith H{u>) is zero at co — t t ] . H e n c e , th e in p u t is scaled in a m p litu d e by th e fa c to r H ( n ) = =, b u t the p h ase shift is zero . In g e n e r a l H(co) is a co m p lex -v alu ed fu n ctio n o f th e fre q u e n c y variable w. H e n c e it can b e e x p ressed in p o la r form as H(to) = \H(a>)\eJH{w) (4.4.11) w h ere |//(a> )| is th e m ag n itu d e o f H(a>) and @(w) — ^ H (c o) w hich is th e p h a se shift im p a rte d on th e in p u t signal by the system at th e fre­ quen cy CO. Since H( w) is th e F o u rie r tra n sfo rm o f i/i(£)}, it follow s th a t H(to) is a peri­ od ic fu n ctio n w ith p e rio d 2 n . F u rth e rm o re , w e can view (4.4.4) as th e ex ponential F o u rie r series ex p an sio n for H(co), w ith h( k) as th e F o u rie r se rie s coefficients. C on­ se q u e n tly , th e u n it im p u lse h( k) is re la te d to H(co) th ro u g h th e in te g ra l expression 1 h( k) = — H( t o) elwkdco (4.4.12) F o r a lin ear tim e -in v a ria n t system w ith a re a l-v a lu e d im p u lse resp o n se, the m ag n itu d e an d p h a s e fu n ctio n s possess sy m m etry p ro p e rtie s w h ich are d eveloped as follow s. F ro m th e d efin itio n o f H(co). w e have H(co) = h( k)e' — 52 ju / k h(k) coscok — j 5 2 k——Dc h (jt)s in w £ (4 4 13) k=—oc = H R{io) -f j H 1 (to) = y j H l i t o ) + H f ( c o ) e J tan- 1["/<")/"*<-)] w h ere H K(to) an d Hi(co) d e n o te th e real a n d im ag in aary c o m p o n e n ts o f H(a>), d e­ fined as DC Hn(co) = 52 h ( k ) c os c ok (4.4.14) H/(co) = — 5 2 h( k) sin cok k = -x It is c lear from (4.4.12) th a t th e m a g n itu d e an d p h a s e o f H(co), ex p re sse d in term s o f H r (co) an d Hi(co), are \H(co)\ = J H 2r(co) + Hf(co) (4.4.15) ©(w ) = tan --------H R(to) Sec. 4.4 Frequency-Domain Characteristics of Linear Tim e-Invariant Systems 309 W e n o te th a t H R (a>) = H R( - t o ) a n d Hi {a>) = —/ / / ( —oj). so th a t H r ( c o ) is an ev en fu n c tio n o f oj a n d Hi (co) is an o d d fu n ctio n o f w. A s a c o n s e q u e n c e , it follow s th a t is an ev en fu n ctio n of w an d 0(o>) is an o d d fu n c tio n o f a>. H e n c e , if w e k n o w j / f ( a > ) J a n d 0 ( a > ) fo r 0 < w < n . w e also k n o w th e s e fu n c tio n s for —jr < w < 0. Example 4.4.2 Moving Average Filter D eterm ine the m agnitude and phase of H(w) for the three-point moving average (MA) system y ( n ) = ^fjc(n + 1) + x( n ) + x( n - 1)] and plot these two functions for 0 < a> < n. Solution Since h{n) = [ i i i } t it follows that H(co) = ^ + 1 + = 1 ( 1 2cos<w) + Hence i 11 + 2 cos a) IW M I ' 0. B ( w ) = (4.4.16) 0 < a> < 2?r/3 2 jt / 3 < w < jt Figure 4.37 illustrates the graphs of the m agnitude and phase of H(w). As indicated previously, |W(w)| is an even function of frequency and C-)(a>) is an odd function of 3tt 4 Figure 4.37 Magnitude and phase responses for the M A system in Example 4.4.2. 310 Frequency Analysis of Signals and Systems Chap. 4 frequency. It is apparent from the frequency response characteristic H(u>) that this moving average filter smooths the input data, as we would expect from the inputoutput equation. T h e sy m m etry p ro p e rtie s satisfied by th e m a g n itu d e a n d p h a se fu n ctio n s of H ( u >), an d th e fact th a t a sinusoid can be e x p re sse d as a su m o r d ifferen ce of tw o co m p lex -co n ju g ate e x p o n e n tia l fu n ctio n s, im ply th at th e re sp o n s e o f a linear tim e -in v a ria n t sy stem to a sin u so id is sim ilar in fo rm to th e re sp o n se w hen the in p u t is a co m p lex e x p o n e n tia l. In d e e d , if th e in p u t is Jfi (n) — Ae-' w'’ th e o u tp u t is vi(«) = A \ H( o j ) \ e j<rnw' eilM' O n th e o th e r h a n d , if th e in p u t is j::(« ) = th e re sp o n se o f th e system is y : ( / j) = A\H{~ — A \ H (aj)\e~j H ""' e ~J'l>" w h ere, in th e last ex p ressio n , w e h av e m a d e use of the sy m m etry p ro p e rtie s \H(to)\ = \ H ( —cd)\ an d (~)(a;) = —(-)(—co). N ow , by ap p ly in g the su p e rp o sitio n p ro p e rty o f th e lin e a r tim e -in v a ria n t system , w e find th at th e re sp o n se o f th e sys­ tem to th e in p u t — i[jt] (n) + _V2 (/;)] = A cos con is }’(>0 = j[ v , (n) + \’2(/r)] (4.4.17) y i n ) = A \ H( c o) \ cosjw/? + (-)(o>)] Sim ilarly, if th e in p u t is x i n ) = —r[jf |(n ) —jt-*(/t) 1 = A sin ton J2 th e resp o n se o f th e system is v W = i [ v l( ,, ) (4 4 1 8 ) v(h) = A \ H { w ) \ sin[cu« + 0 (tn )] I t is a p p a r e n t fro m th is discussion th a t H{co), o r e q u iv a le n tly . |//(c u )| and 0(cw), co m p le te ly c h a ra c te riz e the effect o f th e system on a sin u so id a l in p u t signal o f any a rb itra ry freq u e n cy . In d e e d , w e n o te th a t \H(a>)\ d e te rm in e s th e am plifi­ catio n ( | / / M | > 1) o r a tte n u a tio n (\H(co)\ < 1) im p a rte d by th e system o n the in p u t sin u so id . T h e p h a se @(co) d e te rm in e s th e a m o u n t o f p h a s e shift im p a rte d Sec. 4.4 Frequency-Domain Characteristics of Linear Tim e-Invariant Systems 311 by th e sy stem o n th e in p u t sinusoid. C o n se q u e n tly , by k n o w in g H{aj), w e are ab le to d e te rm in e th e re sp o n s e o f the system to an y sin u so id a l in p u t signal. Since H ( w ) specifies th e re sp o n s e o f th e sy stem in th e fre q u e n c y d o m a in , it is called th e f r e q u e n c y response o f th e system . C o rre sp o n d in g ly , \H{to) \ is called th e ma g ni t ude respons e a n d 0(o>) is c a lle d th e phas e response o f th e system . I f th e in p u t to th e sy stem co n sists o f m o re th a n o n e sin u so id , th e s u p e rp o ­ sitio n p ro p e rty o f th e lin e a r system can b e u se d to d e te rm in e th e re sp o n se . T h e fo llo w in g e x a m p le s illu stra te th e use o f th e su p e rp o s itio n p ro p e rty . Exam ple 4.43 D eterm ine the response of the system in Example 4.4.1 to the input signal ;c(n) = 10 —5 sin —n + 2 0 co snn 2 Solution — oc < n < oc The frequency response of the system is given in (4.4.7) as H(w) = ------*— 1- The first term in the input signal is a fixed signal com ponent corresponding to w = 0. Thus H( 0) = The second term in response of the system is =2 has a frequency jr/2. At this frequency the frequency Finally, the third term in x ( n ) has a frequency w = t t , At this frequency H { tt) = | Hence the response of the system to *(n) is 10 . / jt \ 40 y (n ) = 2 0 — — j= . sm ^ 2^ — 2 6 .6 J + — co sttw — o c < n < oc Example 4.4.4 A linear tim e-invariant system is described by the following difference equation: y(n) = ay(n —1) + bx(n) 0 < a < 1 (a) D eterm ine the magnitude and phase of the frequency response H(w) of the system, (b ) Choose the param eter b so that the maximum value of \H{u>)\ is unity, and sketch fH(<d)\ and 4 . H( w) for a = 0,9. Frequency Analysis of Signals and Systems 312 Chap. 4 (c) D eterm ine the output of the system to the input signal x (n ) Solution = + 12 sin 5 —2 0 cos ( ^ z n + —^ The impulse response of the system is h(n) = ba"u(n) Since |a| < 1. the system is BIBO stable and hence H(co) exists, (a) The frequency response is oc H (w) = 22, h ^ e ~iam b 1 —ae~JW Since 1 —ae~,‘“ = (1 —a cos co) 4- j a sin co it follows that [1 —ae J'“’| = ^ /(l —a cos co)2 4- (a sin co)2 = y/\ + a2 —2a cos co and 4 (1 - ae J“’) = tan osinct) 1 —a cos co T herefore, \b\ \H(co)\ = V l 4- a2 — 2a cos 1u ^H(co) = &(co) = 4-b - tan 1 a sin co 1 —a cos ( (b) Since the param eter a is positive, the denom inator of \H(w)\ attains a minimum at w = 0. Therefore, |//(a>)| attains its maximum value at a> = 0. A t this frequency we have 1*1 |ff(0)| = r U - = ' l 1 —a which implies that b = ±(1 —a). We choose b = 1 —a, so that l —o |W M I - ■J\ + a 2 —2a cos and &(w) = — tan" , asinoj 1 — a cos co The frequency response plots for |tf(co)| and 0(o>) are illustrated in Fig. 4.38. W e observe that this system attenuates high frequency signals. Sec. 4.4 Frequency-Domain Characteristics of Linear Tim e-Invariant Systems 313 Figure 4.38 Magnitude and phase responses for the system in Example 4.4.4 with a = (c) The input signal consists of components of frequencies to = 0. tt/2, and n. For co = 0. |//(0)| = 1 and 0 (0) = 0. For to = jr/2, 0.1 1 —a ¥ (-)l = _________ ______ = 0.074 V2 / 1 y/\ -f a 2 -s/1.81 © -- - tan-1 a = - 4 2 For co = tt, 1 -a 0.1 \H(n)\ = — — = — = 0.053 l+ o 1.9 0(7r) = 0 Therefore, the output of the system is y(n ) = 5|ff(0)| + 1 2 | / / ( | ) | s i i i | j « + e ( ! ) ] — 2 0 | / / ( j t ) | cos ^ 7 rn + — + 0 ( 7 r ) j = 5 + 0.888sin —42°^ —1.06 cos ^jrn + —^ —oc < n < oc 314 Frequency Analysis ol Signals and Systems Chap. 4 In th e m o st g e n e ra l case, if th e in p u t to th e system co n sists o f an arbitrary lin ear co m b in a tio n o f sinusoids o f th e form L x ( n ) = 5 2 A, cos(co,n 4• 4>i) — oc < « < oc 1=1 w h ere (A, | an d {<£,} a re th e am p litu d e s a n d p h ases o f th e c o rre sp o n d in g sinusoidal c o m p o n e n ts, th e n th e re sp o n s e of th e sy stem is sim ply L v{n) = 5 2 Aj \ H{ a),)| cos[oj,« 4- <p, 4- 0(ci>,)] (4.4.19) 1= 1 w h ere \H(u>i)\ an d ©(oj,) are th e m a g n itu d e an d p h a se , re sp e c tiv e ly , im p a rte d by th e system to th e in d iv id u al fre q u e n c y c o m p o n e n ts o f th e in p u t signal. It is clear th a t d e p e n d in g on th e fre q u e n c y re sp o n se H ( uj) o f th e system , input sinu soid s o f d iffe re n t fre q u e n c ie s will be affe c te d d ifferen tly by th e system . F o r ex­ am p le, so m e sin u so id s m ay be co m p letely su p p re sse d by th e sy stem if H ( w ) = 0 at th e fre q u e n c ie s o f th e s e sinusoids. O th e r sin u so id s m ay receiv e n o a tte n u a tio n (or p e rh a p s, som e am p lifica tio n ) by th e system . In effect, w e can view th e lin ear timein v arian t system fu n c tio n in g as a filter to sin u so id s o f d iffe re n t fre q u e n c ie s, passing som e o f th e fre q u e n c y c o m p o n e n ts to th e o u tp u t a n d su p p re s sin g o r preventing o th e r freq u e n cy c o m p o n e n ts fro m re ach in g th e o u tp u t. In fact, as discussed in C h a p te r 8, th e basic dig ital filter design p ro b le m involves d e te rm in in g th e p a ra m e ­ ters o f a lin e a r tim e -in v a ria n t system to achieve a d e sire d fre q u e n c y re sp o n s e H (co). 4.4.2 Steady-State and Transient Response to Sinusoidal Input Signals In th e discu ssio n in th e p re ced in g sectio n , w e d e te rm in e d th e re s p o n s e o f a linear tim e -in v a ria n t sy stem to e x p o n e n tia l a n d sin u so id al in p u t sig n als a p p lied to the system at n = —oc. W e usually call such signals e te rn a l e x p o n e n tia ls o r etern al sin u so id s, b ecau se th e y w ere a p p lied at n = - o c . In such a case, th e re sp o n se that w e o b se rv e a t th e o u tp u t o f th e system is th e ste a d y -s ta te re s p o n s e . T h e re is no tra n sie n t re sp o n se in th is case. O n th e o th e r h a n d , if th e e x p o n e n tia l o r sin u so id al signal is a p p lie d a t som e finite tim e in sta n t, say at n = 0, th e re sp o n se of th e sy stem co n sists of tw o term s, the tra n sie n t re sp o n se a n d the ste a d y -sta te re sp o n se . T o d e m o n s tra te this b ehavior, let us co n sid er, as an e x am p le, th e sy stem d e sc rib e d by th e firs t-o rd e r d ifferen ce e q u a tio n y( n) = av( n — 1 )4- j:(/i) (4.4.20) T his sy stem w as c o n s id e re d in S ectio n 2.4.2. Its re sp o n se to an y in p u t x ( n) applied at n = 0 is given by (2.4.8) as y( n) = a n+ly ( - l ) + J 2 a kx ( n - k) *=0 w h ere y ( —1) is th e in itial co n d itio n . n> 0 (4.4.21) Sec. 4.4 Frequency-Domain Characteristics of Linear Tim e-Invariant Systems 315 N o w , let us assu m e th a t th e in p u t to th e system is th e c o m p le x e x p o n e n tia l x ( n ) - A e Jan n> 0 (4.4.22) a p p lied a t n = 0. W h e n w e s u b s titu te (4.4.22) in to (4.4.21), w e o b ta in n v(n) = a " +1y ( —1) + = a v ( —1) + A k=0 1 _ gn+le ~juiUi +\) = o "+1v ( - l ) + A ----- --------------------e jmn 1 -ae-J” A/jn^ (4.4.23) n > 0 A = an+' v ( - l ) ---------- : ---eJua + ------ - e ia* 1 — a e ~ JW 1 ~ a e JW n>0 W e recall th a t th e system in (4.4.20) is B IB O sta b le if |a | < 1 . In th is case th e tw o te rm s in v o lv in g ^ " +1 in (4.4.23) d ecay to w a rd z e ro as n a p p ro a c h e s infinity. C o n s e q u e n tly , w e a re left w ith th e ste a d y -s ta te re sp o n se Vss(n) = = A i„ hm v(«) = ------------ —e1 l-ae-J* (4.4.24) AH(a))eJwn T h e first tw o te rm s in (4.4.23) c o n stitu te th e tra n s ie n t re s p o n s e o f th e svstem , th a t is, Aan + ' I Vlr(n) = a n+1 v ( - l ) ------- ;----------- :----- e JU,n n > 0 (4.4.25) 1 - a e ~ JW w hich d e c a y to w a rd z e ro as n a p p ro a c h e s infinity. T h e first te r m in th e tra n s ie n t re sp o n se is th e z e ro -in p u t re sp o n se o f th e system an d th e se c o n d te rm is th e tra n s ie n t p ro d u c e d by th e e x p o n e n tia l in p u t signal. In g e n e ra l, all lin e a r tim e -in v a ria n t B IB O system s b e h a v e in a sim ilar fashion w h e n e x c ite d by a co m p lex e x p o n e n tia l, o r by a sin u so id a t n = 0 o r at so m e o th e r finite tim e in sta n t. T h a t is, th e tra n s ie n t re sp o n s e d ecay s to w a rd z e ro as n —►oo, leav in g o n ly th e s te a d y -s ta te re sp o n s e th a t w e d e te rm in e d in th e p re c e d in g section. In m an y p ractical a p p lic a tio n s, th e tra n s ie n t re sp o n se of th e sy ste m is u n im p o rta n t, a n d th e r e fo r e it is u su ally ig n o re d in d e a lin g w ith th e re sp o n s e o f th e system to sin u so id al in p u ts. 4.4.3 Steady-State Response to Periodic Input Signals S u p p o se th a t th e in p u t to a sta b le lin e a r tim e -in v a ria n t system is a p e rio d ic signal x ( n ) w ith fu n d a m e n ta l p e rio d N. S ince such a signal exists fro m —co < n < oc, th e to ta l re sp o n s e o f th e sy stem a t an y tim e in s ta n t n, is sim p ly e q u a l to the s te a d y -s ta te resp o n se. 316 Frequency Analysis of Signals and Systems Chap. 4 T o d e te rm in e th e resp o n se v(n) o f th e system , we m a k e use o f th e Fourier se ries re p re s e n ta tio n of th e p e rio d ic signal, w hich is A’- l jr(n) = 5 2 c ^ j27rkn/N k=0 k = 0, 1........ N - 1 (4.4.26) w h e re th e {c*} are th e F o u rie r se ries coefficients. N ow th e re sp o n s e of th e system to th e co m p lex e x p o n e n tia l signal Xk (n) - ckej27rkn/N k = 0 , 1 ............ N - 1 is v* ( n ) = t \ H k^j v fc = 0. 1.........A ' - l / Ink \ H ( — J = H ( w ) L = 2, i7A- k = 0. 1 ........ A ' - l (4.4.27) w h ere B y u sin g th e su p e rp o s itio n prin cip le fo r lin e a r system s, w e o b ta in th e resp o n se of th e system to th e p erio d ic signal x( n) in (4.4.26) as A—1 v(«) = 5 2 / ?t k \ gjlxknlf* — oc < 7; < OC (4.4.28) T his resu lt im p lies th a t th e re sp o n se of th e system to th e p e rio d ic in p u t signal x ( n ) is also p e rio d ic w ith th e sam e p e rio d N . T h e F o u rie r se rie s coefficients for y( n) a re dk = ckH ( ^ ^ j * = 0 , 1 .........A ' - l (4.4.29) H e n c e , th e lin e a r system can ch an g e th e sh a p e o f th e p e rio d ic input signal by scaling th e a m p litu d e an d shifting th e p h ase o f th e F o u rie r se rie s c o m p o n en ts, but it d o e s n o t affe ct th e p e rio d of the p e rio d ic in p u t signal. 4.4.4 Response to Aperiodic Input Signals T h e c o n v o lu tio n th e o re m , given in (4.3.49). p ro v id e s th e d e s ire d freq u e n cy -d o m ain re la tio n sh ip fo r d e te rm in in g the o u tp u t of an L T I system to an ap e rio d ic finiteen erg y signal. If {jt(n)} d e n o te s th e in p u t se q u e n c e , (v(n)} d e n o te s th e o u tp u t se q u e n c e , an d (/?(«)} d e n o te s th e u n it sa m p le re sp o n se o f th e system , th e n from th e co n v o lu tio n th e o re m , w e have Y(w) = H(a>)X(w) (4.4.30) w h e re Y(to), X (o j), an d H(co) are th e c o rre sp o n d in g F o u rie r tra n sfo rm s o f {v(«)J. (*(«)}, an d {h( n) ), resp ectiv ely . F ro m th is re la tio n sh ip w e o b se rv e th a t th e sp e c­ tru m o f th e o u tp u t signal is e q u a l to th e sp e c tru m o f th e in p u t signal m ultiplied by th e fre q u e n c y resp o n se o f th e system . Sec. 4.4 Frequency-Domain Characteristics of Linear Tim e-Invariant Systems 317 If w e e x p re ss K(cu), an d X(o>) in p o la r fo rm , th e m a g n itu d e a n d p h ase o f th e o u tp u t signal can b e ex p re sse d as |y M ! = I / / M I I X M 1 (4.4.31) 4-Y (o>) — (4.4.32) + 4 - H ( co) w h ere |//(a> )| a n d a re th e m a g n itu d e an d p h ase re sp o n s e s o f th e system . B y its v ery n a tu r e , a fin ite-en erg y a p e rio d ic signal c o n ta in s a c o n tin u u m of fre q u e n c y c o m p o n e n ts . T h e lin e a r tim e -in v a ria n t system , th ro u g h its fre q u e n c y re sp o n s e fu n c tio n , a tte n u a te s so m e fre q u e n c y c o m p o n e n ts of th e in p u t signal an d am p lifies o th e r fre q u e n c y co m p o n e n ts. T h u s th e system acts as a filter to th e in p u t signal. O b s e rv a tio n o f th e g ra p h o f \H(to)\ show s w hich fre q u e n c y c o m p o n e n ts a re am p lified a n d w h ich a re a tte n u a te d . O n th e o th e r h a n d , th e angle o f H(a>) d e te rm in e s th e p h a s e sh ift im p a rte d in th e c o n tin u u m o f fre q u e n c y c o m p o n e n ts of th e in p u t signal as a fu n c tio n o f freq u e n cy . If th e in p u t signal s p e c tru m is ch an g ed by th e sy stem in an u n d e s ira b le way, we say th a t th e system h a s cau sed mag ni t ude a n d p h a s e distortion. W e also o b se rv e th a t the o ut put o f a linear ti me-i nvariant sy s t em c annot c o n ­ tain f r e q u e n c y c o m p o n e n t s that are n o t cont ai ned in the input signal. It tak es e ith e r a lin e a r tim e* v aria n t sy stem o r a n o n lin e a r system to c re a te fre q u e n c y c o m p o n e n ts th a t a re n o t n ecessa rily c o n ta in e d in th e in p u t signal. F ig u re 4.39 illu stra te s th e tim e-d o m ain an d fre q u e n c y -d o m a in relatio n sh ip s th a t can b e u se d in th e an aly sis o f B IB O -s ta b le L T I system s. W e o b se rv e th a t in tim e -d o m a in an aly sis, w e d eal w ith th e co n v o lu tio n o f th e in p u t signal w ith th e im p u lse re sp o n s e o f th e system to o b ta in th e o u tp u t s e q u e n c e o f th e system . O n th e o th e r h a n d , in fre q u e n c y -d o m a in analysis, w e deal w ith th e in p u t signal sp e c tru m X(a)) a n d th e fre q u e n c y re sp o n s e H(co) o f th e sy stem , w hich a re re la te d th ro u g h m u ltip lic a tio n , to yield th e sp e c tru m o f th e signal a t th e o u tp u t o f th e system . W e c a n u se th e re la tio n in (4.4.30) to d e te rm in e th e sp e c tru m Y( u>) o f th e o u tp u t signal. T h e n th e o u tp u t se q u e n c e {v(«)} can b e d e te rm in e d fro m th e in v erse F o u rie r tra n sfo rm (4.4.33) H o w e v e r, th is m e th o d is se ld o m used. In ste a d , th e z -tra n s fo rm in tro d u c e d in C h a p te r 3 is a s im p le r m e th o d fo r solving th e p ro b le m o f d e te rm in in g th e o u tp u t se q u e n c e {y(n)}. X(n) X( w) Input Linear time-invariant system hin), H(a>) Output v(n) = h(n)+x(n) KM = ma>)X(a>) F,g“re 4 3 9 Tlm e' and frequency-domain inpul-output relationships in LTI systems. 318 Frequency Analysis of Signals and Systems Chap. 4 L e t us r e tu rn to th e b asic in p u t-o u tp u t re la tio n in (4,4.30) a n d c o m p u te the s q u a re d m a g n itu d e o f b o th sides. T h u s w e o b ta in \Y(co)\2 = \H(oj)\ 2 \X(co )\2 (4.4.34) Syy(u}) = \ H{ co)\2S xx {0>) w h ere Sxx(oo) a n d S vv(cu) a re th e en erg y d en sity sp e c tra o f th e in p u t a n d o u tp u t signals, resp ec tiv ely . By in te g ra tin g (4.4.34) o v e r th e fre q u e n c y ran g e ( - n , n ) , we o b ta in th e e n e rg y o f th e o u tp u t signal as r i (cu)da> (4.4.35) - — r H ( co) |2 S j x ( co) d co 27r J-y, Example 4.4.5 A linear time-invariant system is characterized by its impulse response h( n ) = (y)" u (n ) Determ ine the spectrum and the energy density spectrum of the output signal when the system is excited by the signal *(«) = ( j )"«(«) Solution The frequency response function of the system OC H(w) = 1 1 - \e-^ Similarly, the input sequence U(n)) has a Fourier transform 1 X(w) = 1 — - e ~ JUI Hence the spectrum of the signal at the output of the system is Y (co) = H( w) X( c o ) 1 (1 - 1- The corresponding energy density spectrum is = \Y(<o)\2 = \H(o>)\2\X(o>)\2 1 ( j - coso))(j| - 1 cosa>) Sec. 4.4 Frequency-Domain Characteristics of Linear Tim e-Invariant Systems 319 4.4.5 Relationships Between the System Function and the Frequency Response Function F ro m th e d iscu ssio n in S ectio n 4.2.6 w e k now th a t if th e system fu n ctio n H( z ) co n v erg es on th e u n it circle, w e can o b ta in th e freq u e n c y re sp o n s e o f th e system by e v a lu a tin g H ( z ) o n th e u n it circle. T h u s (4.4.36) In th e case w h e re H ( z ) is a ra tio n a l fu n ctio n of th e fo rm H{ z ) = B ( z ) / A ( z ) . w e have (4.4.37) M (4.4.38) ]~~[U - pk? /<") w h e re th e (fli) a n d {£>*} a re real, b u t {ct } and {pk} m ay be c o m p lcx -v alu cd . It is so m e tim e s d e s ira b le to ex p ress th e m a g n itu d e s q u a re d o f H(a>) in term s o f H( z ) . F irst, w e n o te th a t |f f( a O r = H{ w) H*( u>) F o r th e ra tio n a l sy stem fu n ctio n given by (4.4.38). we have M ft (4.4.39) It fo llo w s th a t H*( w) is o b ta in e d by e v a lu a tin g H*( 1/ z*) on th e unit circle, w h ere fo r a ra tio n a l sy stem fu n ctio n . M (4.4.40) *=i H o w e v e r, w h e n {*(«)} is re a l or, e q u iv alen tly , th e coefficients {a*} and {bk} a re real, c o m p lex -v alu ed p o le s a n d z e ro s o ccu r in c o m p le x -c o n ju g a te pairs. In this 320 Frequency Analysis of Signals and Systems case. H*{ 1/;* ) = H ( z ~ l ). C o n se q u e n tly , H'(a>) = Chap. 4 an d | H(co )\2 = H{oj)H*{oj) = H ( w ) H ( - o > ) = (4.4.41) A cc o rd in g to th e c o rre la tio n th e o re m fo r th e z -tra n sfo rm (see T a b le 3.2), the fu n ctio n H ( z ) H ( z ~ l ) is th e z -tra n sfo rm o f th e a u to c o rre la tio n se q u e n c e {rhh( m)} o f th e u n it sa m p le re sp o n se (/i(n)J. T h e n it follow s fro m th e W ie n e r-K h in tc h in e th e o re m th a t \ H { w )\2 is th e F o u rie r tra n sfo rm o f Sim ilarly, if H ( z ) = B ( z ) / A ( z ) , th e tra n sfo rm s D( z ) = B tz J B tz - 1 ) an d C( z) = /4 (;)A (c “ ') are th e z-tra n sfo rm s o f th e a u to c o rre la tio n s e q u e n c e s {c/} an d \di\, w h ere \rhh(m)}. N - |J i akak+i Q = —N < I < N (4.4.42) t=o M - \t\ d, = 2 2 bkbk+i ~ M < / <M (4.4.43) Jk=0 Since th e system p a ra m e te rs (at) a n d {£*} a re re a l valu ed , it follow s th a t c, — c_/ an d di = d-i . B y using th is sy m m etry p ro p e rty , \ H( u >)\2 m ay be ex p ressed as do + 2 2^2 dk cos kco \H(co )\2 = ----------^ -------------(4.4.44) ri co 4- 2 ^ ' c'jt cos k.u) i =1 F inally, w e n o te th a t c o s k w can be e x p re ss e d as a p o ly n o m ia l fu n ctio n of cosoj. T h a t is, t cos kco = ^ / U c o s a , ) " (4.4.45) m=0 w h ere [j3m] a re th e coefficients in th e ex p an sio n . C o n s e q u e n tly , th e n u m e ra to r an d d e n o m in a to r o f \H(u ))\2 can b e v iew ed as p o ly n o m ial fu n c tio n s o f coso;. T he fo llow ing e x am p le illu stra te s th e fo reg o in g re la tio n sh ip s. Example 4.4.6 Determ ine for the system y(n) = —0.1 v(n —1) + 0.2 y(n — 2 ) + x (n) + x(n — 1) Solution The system function is 1 4 :~l H(Z) ~ 1 4 0 . 1 - “ - 0 . 2 : - 2 and its R O C is |z| > 0.5. Hence H{ od) exists. Now 1 + z“ ‘ 1+ z 1 + 0 .1 Z '1 - 0 .2 z - 2 1 4- O.lz - 0.2z2 2 4- z + z 1 1.05 + 0.08(z 4- z_1) - 0.2(z~2 + z-2) Sec. 4.4 Frequency-Domain Characteristics of Linear Tim e-Invariant Systems 321 By evaluating H{z)H(z~' ) on the unit circle, we obtain 2 -j- 2 cos w \H(u>)~ = --------------------------------------1.0^ -i- 0.16 cos w —0.4 cos 2w However, cos2w = 2cos: w — 1. Consequently. | H(u>)\2 may be expressed as 2(1 cos u>) 1.45 4 0.16cosw - 0 .8 cos: W e n o te th a t given H ( z ), it is stra ig h tfo rw a rd to d e te rm in e H ( z ~ l ) an d th e n |//{ w ) |2. H o w e v e r, th e inverse p ro b lem o f d e te rm in in g H( z ) given 1/ / (cu)]2 or th e c o rre sp o n d in g im p u lse resp o n se {/?(«))- is n o t stra ig h tfo rw a rd . Since |//(a > )l: d o es n o t c o n tain th e p h ase in fo rm atio n in H(a>), it is n o t p o ssible to u n iq u ely d e te rm in e H (:). T o e la b o ra te on th e p oint, let us assum e th a t th e N p o les an d M ze ro s of H{z) are [pk] an d {;.*). respectively. T h e c o rre sp o n d in g p o les and zero s o f H ( z ~ ]) are (1 j p^ j an d ll/c*. }, respectively. G iv en \ H( u >)\2 o r, eq u iv a le n tly . H ( z ) H ( z ~ l ). w e can d e te rm in e d iffe re n t system fu n ctio n s H( z ) by assigning to H( z ) . a pole pt o r its recip ro c al 1f p k . an d a z e ro zt o r its recip ro c al 1 fzk- F o r ex am p le, if A" = 2 a n d M = 1. th e p o les an d z ero s of H l z ) H ( : _ l ) are [ p j. p z , 1/ p \ , l / p z ) an d (~ i, 1 /c i }. If p i a n d pz are real, th e possible p o les for H(z.) a re {pi. 1. U /P i • 1 /P :K i / 'i • 1/ / ’:}. a n d [/52. 1//>]} an d th e possible ze ro s are {~i) o r {1 / - 1 }, T h e re fo re , th e re are eight p o ssib le ch o ices o f sy stem functions, all o f w hich re su lt in th e sam e j//(a> )|: . E ven if we restrict th e p o les of H( z ) to be inside th e unit circle, th e re a re still tw o d iffe re n t ch o ices for H( z ) . d e p e n d in g on w h e th e r w e pick th e zero j;i} o r { l/:.i). T h e re fo re , we c a n n o t d e te rm in e H{z ) u n iq u ely given only th e m a g n itu d e resp o n se \H(w)\. 4.4.6 Computation of the Frequency Response Function In e v a lu a tin g th e m a g n itu d e re sp o n se an d th e p h a s e re sp o n se as fu n c tio n s o f f r e ­ q u en cy , it is c o n v e n ie n t to ex p ress H ( oj) in te rm s o f its p o le s an d zeros. H e n c e we w rite H(co) in fa c to re d form as M n H(co) = a - z t e - i wk ) -------------------- (4.4.46) f ] ( 1 - p ke->°*) k=1 or, e q u iv alen tly , as M H M = b0eJU’^ - M) ------------------]"~[(eJ“ - p k) (4.4.47) Frequency Analysis of Signals and Systems 322 Chap. 4 L e t us ex p re ss th e c o m p lex -v alu ed facto rs in (4.4.47) in p o la r form as ej a - Z k = Vk (co)ejB*M (4.4.48) e J0J - p k = Uk (a>)e] * k(m) (4.4.49) an d w h ere V*(w) s \eJW - z*|, &k (co) = 4. (eJW - zk) (4.4.50) Uk(co) = \eJ“ - p kI, = %.(eJW - p k) (4.4.51) an d T h e m a g n itu d e o f H ( w ) is eq u al to th e p ro d u c t o f m a g n itu d e s of all te rm s in (4.4.47). T h u s, u sin g (4.4.48) th ro u g h (4.4.51), w e o b ta in Vi(£») ■• ■VM(co) - ■ V\ (co)U2 ((o) ■■■Un(co) |fr0l------ — ------- \H(co)\ = (4.4.52) ’ since th e m a g n itu d e o f eJM(N~M) is 1. T h e p h ase o f H(to) is th e sum o f th e p h a s e s o f th e n u m e r a to r facto rs, m i­ n us th e p h ases o f th e d e n o m in a to r facto rs. T h u s, by co m b in in g (4.4.48) th ro u g h (4.4.51), we h av e 2^ H ( c o ) — 4-bo + co(N - M ) + 0 i (co) + 0T(dti) + • ■ ■ + &m(oj) (4.4.53) — [<t>i(a>) + <I>2(^) + ■• ■+ $>(o>)] T h e p h ase o f th e gain te rm is z e ro o r jt, d e p e n d in g on w h e th e r bo is po sitiv e or n eg ativ e. C learly , if w e k n o w th e z ero s an d th e p o les o f th e sy ste m fu n ctio n H(z), we can ev a lu a te th e fre q u e n c y re sp o n se fro m (4.4.52) an d (4.4.53). T h e re is a g e o m e tric in te r p re ta tio n of th e q u a n titie s a p p e a rin g in (4.4.52) a n d (4.4.53). L e t us c o n sid e r a p o le p k a n d a z e ro z* lo c a te d a t p o in ts A a n d B o f th e z-p lan e, as sh o w n in Fig. 4 .40(a). A ssu m e th a t w e w ish to c o m p u te H{io) a t a specific v alu e o f fre q u e n c y co. T h e given v alu e o f co d e te rm in e s th e an g le of ejw w ith th e p o sitiv e real axis. T h e tip o f th e v e c to r e specifies a p o in t L o n the u n it circle. T h e e v a lu a tio n o f th e F o u rie r tra n sfo rm fo r th e g iv en v alue of co is e q u iv a le n t to e v a lu a tin g th e z -tra n sfo rm at th e p o in t L o f th e co m p lex p la n e . L et us d raw th e v ecto rs A L a n d B L from th e p o le an d z e ro lo c a tio n s to th e p o in t L, at w hich w e w ish to c o m p u te th e F o u rie r tra n sfo rm . F ro m Fig. 4 .4 0 (a) it follow s th at CL = CA + A L an d CL = CB + BL H o w ev er, C L = ej<u, C A = p k a n d C B = zk. T h u s AL = ej* - p k (4.4.54) BL = e JW - z k (4.4.55) an d Sec. 4.4 Frequency-Domain Characteristics of Linear Tim e-Invariant Systems 323 ImU) (a) im(r) Figure 4.40 Geom etric interpretation of the contribution of a pole and a zero to the Fourier transform (1) magnitude: the factor V* / Vk, (2) phase; the factor ©* - <t>*B y c o m b in in g th e s e re la tio n s w ith (4.4.48) a n d (4.4.49), w e o b ta in A L = eJ<u - p k = Uk {co)eJ* kM (4.4.56) BL = eJ* — Zk = Vk (aj)ejStUu) (4.4.57) T h u s Uk(a>) is th e len g th o f AL, th a t is, th e d istan c e o f th e p o le p k fro m th e p o in t L c o rre sp o n d in g to e }w, w h e re a s Vk(cu) is th e d ista n c e o f th e z e ro z k fro m th e sam e p o in t L. T h e p h a se s <!>*(&>) a n d Q*(a>) a re th e an g les o f th e v e c to rs A L an d BL 324 Frequency Analysis of Signals and Systems Chap. 4 Im(c) Pt = e>^‘ Zt = mz) Figure 4.41 A zero on the unit circle causes |f/((u)| - 0 and w = 4-Zk- In contrast, a pole on the unit circle results in \H{w)\ = 0 0 at w = 4-Pt- w ith th e p o sitiv e re a l axis, resp ec tiv ely . T h e s e g e o m e tric in te r p re ta tio n s a re show n in Fig. 4.40(b). G e o m e tric in te rp re ta tio n s are very useful in u n d e rs ta n d in g how th e location o f p o le s an d ze ro s affects th e m ag n itu d e an d p h a s e o f th e F o u rie r tran sfo rm . S u p p o se th a t a zero , say z*. an d a pole, say p k, a re o n th e u n it circle as sh o w n in Fig. 4.41. W e n o te th a t at w = 4 z* , Vk (co) an d c o n s e q u e n tly | H(co)\ b eco m e zero. S im ilarly, at to = 4-pk th e len g th Uk(w) b eco m es z e ro a n d h e n c e \H(co)\ b ecom es infinite. C learly , th e e v a lu a tio n o f p h a s e in th e s e case s h a s n o m ean in g . F ro m th is discu ssion we can easily see th a t th e p re se n c e o f a ze ro close to th e u n it circle cau ses th e m a g n itu d e o f th e fre q u e n c y re sp o n s e , a t freq u e n cies th a t c o rre sp o n d to p o in ts o f th e u n it circle close to th a t p o in t, to b e sm all. In c o n tra st, th e p re se n c e o f a p o le close to th e u n it circle c au ses th e m a g n itu d e of th e fre q u e n c y re sp o n s e to b e larg e a t fre q u e n c ie s close to th a t p o in t. T h u s poles h av e th e o p p o site effe ct o f zero s. A lso , p lacin g a z e ro close to a p o le cancels th e effe ct o f th e p o le, an d vice v ersa. T h is can b e also se en fro m (4.4.47), since if Zk = Pk, th e te rm s eJW - z* an d ejb> — pk cancel. O b v io u sly , th e p re se n c e of b o th p o les an d z e ro s in a tra n sfo rm resu lts in a g r e a te r v a rie ty o f sh a p e s for \H(to)\ a n d ^ H( c o ) . T his o b se rv a tio n is very im p o rta n t in th e desig n o f digital filters. W e co n clu d e o u r discussion w ith th e follow ing ex a m p le illu stra tin g th ese co n cep ts. Example 4.4.7 Evaluate the frequency response of the system described by the system function Sec. 4.4 Frequency-Domain Characteristics of Linear Tim e-Invariant Systems Clearly. H(z) has a zero at ; = 0 and a pole at p = 0.8. frequency response of the system is S o lu tio n H (w) = 325 Hence the el- - 0.8 The m agnitude response is | H (to) j = 1 \e-lw - 0.8| Vl-64 — 1.6cose and the phase response is B(co) = ui — tan sin oj cos oj - 0.8 The magnitude and phase responses are illustrated in Fig. 4.42. Note that the peak of the m agnitude response occurs at a s = 0. the point on the unit circle closest to the pole located at 0.8. If th e m a g n itu d e re sp o n se in (4.4.52) is ex p ressed in d ecib els, M \ \H(co)\lllt = 2 0 lo g ,(l |/j()| + 2 0 5 2 l°g.jci v/a M - 2 o 5 2 logui A=1 i-l (4.4.58) T h u s th e m a g n itu d e resp o n se is ex p ressed as a sum o f th e m ag n itu d e facto rs in | H i w )!. 4.4.7 Input-Output Correlation Functions and Spectra In S ectio n 2.6.5 w e d e v e lo p e d several c o rre la tio n re la tio n sh ip s b etw een the input an d th e o u tp u t se q u e n c e s o f an L TI system . S pecifically, w e d eriv ed th e follow ing e q u a tio n s: r vv(m) = rhh(m) * r xx(m) (4.4.59) ryx( m ) = h( m) * rxx(m) (4.4.60) w h ere rxx(m) is th e a u to c o rre la tio n se q u e n c e of th e in p u t signal {-*(/?)), ryv(m) is th e a u to c o rre la tio n se q u e n c e o f th e o u tp u t {.y(n)K rhh(m ) is th e a u to c o rre la tio n se ­ q u e n c e o f th e im p u lse re sp o n se {Ai(/t)}. a n d ryx(m) is th e c ro ss c o rre la tio n se q u e n c e b e tw e e n th e o u tp u t an d th e in p u t signals. Since (4,4.59) an d (4.4.60) involve th e co n v o lu tio n o p e ra tio n , th e z-tra n sfo rm o f th e s e e q u a tio n s yields Svvf;) = 5 m ( : ) 5 „ ( c ) (4.4.61) = H ( z ) H ( z ~ 1 )Sxx(z) S VJr(z) = H ( z ) S „ ( z ) (4.4.62) If we su b s titu te z = e JW in (4,4.62), we o b tain S y jc M = H(os)Sxx(oj) (4.4.63) = H(o>)\X(o>)\2 326 Frequency Analysis of Signals and Systems - T _ t 2 o I 2 r Chap. 4 Figure 4.42 Magnitude and phase of system with H(z) = 1/(1 - 0 .8 ; - 1). w h ere Syx(u>) is th e cro ss-en e rg y d en sity sp e c tru m o f [y(n)} a n d (jc(/7)}. Sim ilarly, ev alu atin g Svv(z) o n th e u n it circle yields th e en erg y d e n sity s p e c tru m o f th e o u tp u t signal as S v v M = | / / ( w ) |2S „ M (4.4.64) w h ere Sxx(a>) is th e en erg y d en sity sp e c tru m o f th e in p u t signal. S ince ryy(m) an d Syy(co) a re a F o u rie r tra n sfo rm p air, it fo llo w s th at ryy(m) = ~ j Syy(co)ejumdco (4.4.65) Sec. 4.4 Frequency-Domain Characteristics of Linear Tim e-Invariant Systems 327 T h e to ta l e n erg y in th e o u tp u t signal is sim ply Ey — --- f Syy{CO)dlO = T,.v(0 > ~jT i r = — I \ H(to)\' S xx(cv)dcv J-* (4.4.66) T h e re su lt in (4.4.66) m ay be used to easily p rove th a t £ v > 0. F in ally , we n o te th a t if the in p u t signal has a flat sp e c tru m [i.e.. 5 v., (w) = £ , = c o n s ta n t fo r n < co < — t t ] , (4.4.63) red u ces to 5 , v(oj) = H { w ) E x (4.4.67) w h ere £ , is th e c o n s ta n t v alu e o f the sp e ctru m . H e n c e H ( w ) = — 5’vv(w) (4.4.68) h(n) — — r yxim) (4.4.69) E\ o r . e q u iv a le n tly . T h e re la tio n in (4,4.69) im plies th at Inn) can be d e te rm in e d by exciting th e input to th e system by a sp e ctrally flat signal ja («)), and c ro ssc o rre la tin g th e in p u t w ith th e o u tp u t o f th e system . T his m e th o d is usef ul in m e a su rin g th e im pulse resp o n se o f an u n k n o w n svstem . 4.4.8 Correlation Functions and Power Spectra for Random Input Signals T his d e v e lo p m e n t p a ra lle ls th e d e riv a tio n s in S ection 4.4.7, w ith th e e x cep tio n th a t we no w d e a l w ith sta tistical m o m e n ts o f th e in p u t an d o u tp u t signals o f an L TI system . T h e v ario u s sta tistical p a ra m e te rs are in tro d u c e d in A p p e n d ix A . L et us c o n s id e r a d isc re te -tim e lin e a r tim e -in v a ria n t sy stem w ith u n it sam ple re sp o n se (/z(n)} an d fre q u e n c y re sp o n se H ( f ) . F o r this d e v e lo p m e n t w e assum e th a t {/?(«)} is real. L et _*•(«) be a sam ple fu n ctio n of a sta tio n a ry ra n d o m process X ( n ) th a t ex cites th e system an d let y(/;) d e n o te th e re sp o n se o f th e system to xi n) . F ro m th e c o n v o lu tio n su m m atio n th a t re la te s th e o u tp u t to th e in p u t w e have OC v(n) = 5 2 h ( k ) x ( n — k) (4.4.70) Jt = - oc S ince jc(n) is a ra n d o m in p u t signal, th e o u tp u t is also a ra n d o m se q u en ce. In o th e r w o rd s, fo r each sa m p le se q u e n c e x ( n ) o f th e p ro cess X ( n ), th e r e is a c o rre sp o n d in g sa m p le se q u e n c e v(n) o f th e o u tp u t ra n d o m p ro c e ss Y(n) . W e w ish to relate th e sta tistical c h a ra c te ristic s o f th e o u tp u t ra n d o m p ro cess Y( n) to th e statistical c h a ra c te riz a tio n o f th e in p u t p ro c e ss a n d th e c h aracteristics o f th e system . 328 Frequency Analysis of Signals and Systems Chap. 4 T h e ex p e c te d v alu e o f th e o u tp u t y(n) is OC m v s= £ [y (n )] = E[ 22 h(k)x{rt — fc)] k ~ —rx. oc 22 A ( * ) £ 0 ( n - * ) ] = (4.4.71) A=^oc cc 22 h( k) my = mx k ——oc F ro m th e F o u rie r tra n sfo rm re la tio n sh ip CC H{u>)= 22 * (*)*"-'“* (4.4.72) k = - oc we have OC 22 h (*) H ( 0) = (4.4.73) A — — DC w hich is th e dc gain o f th e system . T h e re la tio n sh ip in (4.4.73) allow s us to express th e m e a n v alu e in (4.4.71) as m y = m xH{ 0) (4.4.74) T h e a u to c o rre la tio n se q u en ce fo r th e o u tp u t ra n d o m p ro c e ss is yyy(m) — £ [ y * ( n ) y ( « + m ) ] -- E = 2 2 h( k)x*(n ~ k) Y 2 _k——OQ OC OC 22 V . + m - j) (4.4.75) h ( k ) h ( j ) E [ x * { n - k)x(rt -f- m - _/)] £ = — C C _/ = —OC OC = cc 22 Y2 h(k'>hU)Yxx(k - j + m) k= —co cc T h is is th e g en eral fo rm fo r th e a u to c o rre la tio n o f th e o u tp u t in term s of the a u to c o rre la tio n o f th e in p u t a n d th e im p u lse re sp o n s e o f th e system . A sp ecial fo rm o f (4.4.75) is o b ta in e d w h en th e in p u t ra n d o m p ro c e ss is w hite, th a t is, w h en m , = 0 an d Yxx(m) = o’j S ( m ) (4.4.76) w h ere o x = ^ j(O ) is th e in p u t signal p o w er. T h e n (4.4.75) re d u c e s to OC Yyy(m) = <72 22 h{k) h{k + m) (4.4.77) t= -o c U n d e r th is co n d itio n th e o u tp u t p ro cess h a s th e a v e ra g e p o w e r MO) = ^ £ h ^ n) = n=-e» w h ere w e h av e a p p lie d P a rse v a l’s th e o re m . (4-4.78) J - 1/2 Sec. 4.4 Frequency-Domain Characteristics of Linear Tim e-invariant Systems 329 T h e re la tio n sh ip in (4.4.75) can b e tra n sfo rm e d in to th e fre q u e n c y d o m ain by d e te rm in in g th e p o w e r d e n sity sp e c tru m of yvv(m ). W e h ave r vvM = 22 /vv = E E E h ( k ) h ( l ) Y, A k - I + m) k ^ —o o i =■—dc (4.4.79) E E V h{k)h(l ) Yxx(k — I + m) e k = — CC I = — DC OC = r r, ( / ) 2 2 h{k) eJwk £ h { l ) e - ]wl ^k= - c c = tw (tu )|-r^ .v(w) T h is is th e d e sire d re la tio n sh ip fo r th e p o w e r d en sity sp e c tru m o f th e o u tp u t p r o ­ cess, in te rm s o f th e p o w e r d en sity sp e c tru m o f th e in p u t p ro cess an d th e freq u e n cy re sp o n s e o f th e system . T h e e q u iv a le n t e x p ressio n fo r co n tin u o u s-tim e system s w ith ra n d o m in p u ts is r vv( F ) = \ H{ F ) \ 2 r xA F ) (4.4.80) w h ere th e p o w e r d e n sity s p e c tra T w ^ ) and T „ ( F ) are th e F o u rie r tra n sfo rm s o f th e a u to c o rre la tio n fu n c tio n s y v v ( T ) a n d yJ t ( r ) , resp ec tiv ely , a n d w h e re H { F ) is th e fre q u e n c y re sp o n s e of th e system , w hich is re la te d to th e im p u lse re sp o n se by th e F o u rie r tra n sfo rm , th a t is. H(F) - J-C f h( t ) e - j 2n Fi dt (4.4.81) A s a final ex ercise , w e d e te rm in e th e c ro ssc o rre la tio n o f th e o u tp u t v(n) w ith th e in p u t signal jcOi). If w e m u ltip ly b o th sides o f (4.4.70) by x*(n — m) a n d ta k e th e e x p e c te d v a lu e , w e o b ta in y £ [ v (n )-**(« — wz)] = E h( k)x*{n — m ) x ( n — k) = —OC y VJ(m) = 2 2 h( k) E[ x * ( n — m ) x ( n — k)] (4.4.82) = —CC OC = 22 h ( k ) Y x x ( m - k) Since (4.4.82) h as th e fo rm o f a c o n v o lu tio n , th e fre q u e n c y -d o m a in e q u iv a le n t e x p re ssio n is r„(w ) = ff(<u)r„(<u) (4.4.83) In the special case where x ( n ) is white noise, (4.4.83) reduces to r y, M = a x2 H { a > ) (4.4.84) 330 Frequency Analysis of Signals and Systems Chap. 4 w h ere a 2 is th e in p u t n o ise p o w er. T h is re su lt m e a n s th a t an u n k n o w n sy stem w ith fre q u e n c y resp o n se H ( w ) can be id en tified by exciting th e in p u t w ith w h ite noise, c ro ssco rrelatin g th e in p u t se q u e n c e w ith th e o u tp u t se q u e n c e to o b ta in y Vjr(m ), and finally, c o m p u tin g th e F o u rie r tra n sfo rm o f yyx(m). T h e re su lt o f th e s e c o m p u ta ­ tio n s is p ro p o rtio n a l to H{co). 4.5 LINEAR TIME-INVARIANT SYSTEMS AS FREQUENCY-SELECTIVE FILTERS T h e te rm filter is co m m o n ly used to d escrib e a d ev ice th a t d isc rim in a te s, a c co rd ­ ing to so m e a ttr ib u te o f th e o b jects a p p lied at its in p u t, w h at passes th ro u g h it. F o r ex am p le, an a ir filter allow s a ir to p ass th ro u g h it b u t p re v e n ts d u st p a r­ ticles th a t are p r e s e n t in th e a ir from passing th ro u g h . A n oil filter p erfo rm s a sim ilar fu n ctio n , w ith th e e x cep tio n th a t oil is th e su b sta n c e allo w ed to pass th ro u g h th e filter, w h ile p a rtic le s o f dirt are c o llected a t th e in p u t to th e filter a n d p re v e n te d fro m p assin g th ro u g h . In p h o to g ra p h y , an u ltra v io le t filter is of­ ten u sed to p re v e n t u ltra v io le t light, w hich is p re s e n t in su n lig h t a n d w hich is not a p a rt o f visible light, from passin g th ro u g h an d affe ctin g th e chem icals on the film. A s w e h av e o b se rv e d in th e p re c e d in g se ctio n , a lin e a r tim e -in v a ria n t system also p e rfo rm s a ty p e o f d isc rim in atio n o r filtering am o n g th e v ario u s freq u e n cy c o m p o n e n ts a t its in p u t. T h e n a tu re o f th is filtering actio n is d e te rm in e d by the fre q u e n c y re sp o n se c h a ra c te ristic s H{co), w hich in tu r n d e p e n d s o n th e ch o ice of th e sy stem p a ra m e te rs (e.g., th e coefficients (at ) a n d [bk ] in th e d iffe re n c e e q u a tio n ch a ra c te riz a tio n o f th e sy stem ). T h u s, by p r o p e r selectio n o f th e coefficients, we can d esig n freq u e n cy -selectiv e filters th a t p ass signals w ith fre q u e n c y co m p o n e n ts in so m e b an d s w h ile th e y a tte n u a te signals co n ta in in g fre q u e n c y c o m p o n e n ts in o th e r fre q u e n c y b an d s. In g e n eral, a lin e a r tim e -in v a ria n t system m odifies th e in p u t signal sp e c­ tru m X((o) a cco rd in g to its fre q u e n c y re sp o n s e H(co) to yield an o u tp u t signal w ith sp e c tru m Y(to) = H(o>)X(cl>). In a sense, H(co) acts as a wei ghti ng f u n c ­ tion o r a spectral s h a pi ng f un c t i o n to th e d iffe re n t fre q u e n c y c o m p o n e n ts in th e in p u t signal. W h e n v iew ed in th is c o n te x t, any lin e a r tim e -in v a ria n t system can b e c o n sid e re d to b e a fre q u e n c y -sh a p in g filter, ev en th o u g h it m ay n o t n ecessa r­ ily c o m p letely b lo ck a n y o r all fre q u e n c y c o m p o n e n ts. C o n s e q u e n tly , th e term s “ lin e a r tim e -in v a ria n t sy stem ” a n d “filte r” a re sy n o n y m o u s a n d a re o fte n used in terch an g eab ly . W e use th e te r m filter to d escrib e a lin e a r tim e -in v a ria n t system u se d to p e rfo rm sp e c tra l sh a p in g o r freq u e n cy -selectiv e filtering. F ilte rin g is u se d in dig­ ital sig n al p ro cessin g in a v a rie ty o f w ays. F o r e x am p le, re m o v a l o f u n d e sira b le n o ise fro m d e s ire d signals, sp e c tra l sh a p in g such as e q u a liz a tio n o f c o m m u n icatio n c h a n n e ls, signal d e te c tio n in r a d a r, so n a r, a n d c o m m u n ic a tio n s, a n d fo r p e rfo rm in g sp e c tra l an aly sis o f signals, a n d so on. Sec. 4.5 Linear Tim e-Invariant Systems as Frequency-Selective Filters 331 4.5.1 Ideal Filter Characteristics F ilters a re usu ally classified acco rd in g to th e ir fre q u e n c y -d o m a in ch aracteristics as low pass, h ig h p ass. b a n d p a ss, and b a n d s to p o r b a n d -e lim in a tio n filters. T he id eal m a g n itu d e re sp o n s e ch a ra c te ristic s o f th ese ty p e s o f filters are illu strated in Fig. 4.43. A s sh o w n , th ese ideal filters h ave a c o n sta n t-g a in (usually ta k e n as u n itv -g a in ) p a ssb a n d c h a ra c te ristic an d z e ro gain in th e ir sto p b a n d . Lowpass IHu»)\ I Hiphpa* \HUo)I Bandpass -n — —a>0 — ai] 0 cu, iii(|Wi n t Bandstop ~o>„ 0 All-pass Figure 4.43 Magnitude responses for some ideal frequency-selective discrete-time filters. 332 Frequency Analysis of Signals and Systems Chap. 4 A n o th e r ch a ra c te ristic o f an id eal filter is a lin e a r p h ase re sp o n s e . T o dem on­ stra te this p o in t, let us assum e th a t a signal se q u e n c e (■*(/?)} w ith fre q u e n c y com­ p o n e n ts co n fin ed to th e fre q u e n c y ran g e coj < w < un is p a s se d th ro u g h a filter w ith freq u e n cy resp o n se H(co) = J [ (J, w h ere C an d JWnv' < co<c^ o th erw ise (4_5 a re c o n stan ts. T h e signal at th e o u tp u t o f th e filte r h as a spectrum Y( co) = X(co)H(co) u>\ < co < co2 - CX(co)e }tL""’ (4.5.2) By app ly in g th e scaling a n d tim e-sh iftin g p ro p e rtie s o f the F o u rie r tran sfo rm , we o b ta in th e tim e -d o m a in o u tp u t v(ri) = Cx ( n - h 0) (4.5.3) C o n se q u e n tly , th e filter o u tp u t is sim ply a d e la y e d an d a m p litu d e -s c a le d v ersio n of th e in p u t signal. A p u re d elay is usually to le ra b le a n d is n o t c o n s id e re d a distortion o f th e signal. N e ith e r is a m p litu d e scaling. T h e re fo re , ideal filters have a linear p h ase c h a ra c te ristic w ithin th e ir p a ssb a n d , th a t is. 0(a>) = —cori(i (4.5.4) T h e d eriv ativ e o f th e p h a se w ith re sp e c t to fre q u e n c y has th e u n its o f delay. H e n c e we can defin e th e signal d elay as a fu n ctio n o f fre q u e n c y as 1 ( o j) = d&(a>) --------- ---------- aco . (4.5.5) Zg(co) is usually called th e e nvel ope del ay o r th e g r o u p del ay o f th e filter. W e in te r p re t zg(co) as th e tim e d elay th a t a signal c o m p o n e n t o f fre q u e n c y co u n d erg o es as it p asses fro m th e in p u t to th e o u tp u t o f the system . N o te th a t w h en 0(co) is lin e a r as in (4.5.4), r s (a)) — no = c o n s ta n t. In th is case all fre q u e n c y co m p o n en ts o f th e in p u t signal u n d e rg o th e sam e tim e delay. In co n clu sio n , id eal filters h av e a c o n s ta n t m a g n itu d e c h a ra c te ristic an d a lin ear p h ase c h a ra c te ristic w ith in th e ir p assb an d . In all cases, such filters a re not p h ysically re a liz a b le b u t se rv e as a m a th e m a tic a l id e a liz a tio n o f p ra c tic a l filters. F o r ex am p le, th e id eal low pass filter h a s an im p u lse re sp o n se sin coc7Tn hip(n) — -----------nn — 00 < /7 < 00 (4.5.6) W e n o te th a t th is filter is n o t causal an d it is n o t a b so lu te ly su m m a b le an d th e re fo re it is also u n sta b le . C o n se q u e n tly , this id eal filter is physically u n re a liz a b le . N ev­ e rth e le ss, its fre q u e n c y re sp o n se c h a racteristics can be a p p ro x im a te d v ery closely by p ractical, ph y sically re a liz a b le filters, as will be d e m o n s tra te d in C h a p te r 8. In th e fo llo w in g d iscu ssio n , w e tr e a t th e design o f so m e sim p le d igital filters by th e p la c e m e n t o f p o les a n d zero s in th e z-p lan e. W e h a v e a lre a d y d escrib ed h o w th e lo catio n o f p o les a n d zero s affects th e fre q u e n c y re s p o n s e characteristics Sec. 4.5 Linear Tim e-Invariant Systems as Frequency-Selective Filters 333 o f th e system . In p a rtic u la r, in S ection 4.4.6 w e p re s e n te d a g ra p h ic a l m e th o d for c o m p u tin g th e fre q u e n c y re sp o n se c h a racteristics fro m th e p o le - z e r o p lo t. T his sam e a p p ro a c h can be u sed to design a n u m b e r o f sim ple b u t im p o rta n t digital filters w ith d e s ira b le freq u e n c y re sp o n se ch aracteristics. T h e basic p rin cip le u n d e rly in g th e p o le - z e r o p la c e m e n t m e th o d is to lo cate p o les n e a r p o in ts o f th e u n it circle c o rre sp o n d in g to fre q u e n c ie s to be em p h asized , a n d to p lace ze ro s n e a r th e fre q u e n c ie s to be d e e m p h a siz e d . F u rth e rm o re , the fo llo w in g c o n s tra in ts m ust be im posed: 1. A ll p o le s sh o u ld be p laced inside th e unit circle in o r d e r fo r the filter to be stab le. H o w e v e r, ze ro s can be p laced an y w h ere in th e z-p lan e. 2. A ll co m p lex zero s an d p o les m ust o ccu r in c o m p le x -c o n ju g a te p airs in o rd e r fo r th e filter coefficients to be real. F ro m o u r p re v io u s discussion w e recall th a t fo r a given p o le - z e r o p a tte rn , th e sy stem fu n ctio n H i : ) can be ex p ressed as (4.5.7) w h ere bi} is a jiain c o n sta n t selected to n o rm aliz e th e freq u e n cy re sp o n se at som e sp ecified freq u e n cy . T h a t is, bo is se le c te d such th at | H ( cl>o) | = 1 (4.5.8) w h ere is a fre q u e n c y in th e p a ssb a n d o f the filter. U sually, N is se le c te d to eq u al o r ex cee d M , so th a t th e filter h as m o re n o n triv ial p o le s th a n zeros. In th e n ex t se ctio n , we illu strate th e m e th o d o f p o le - z e r o p la c e m e n t in the d esig n o f so m e sim p le low pass. highpass. an d b an d p a ss filters, d igital re so n a to rs, a n d co m b filters. T h e d esign p ro c e d u re is facilita ted w h en c a rrie d o u t in te ra c tiv e ly on a d ig ital c o m p u te r w ith a g raphics term in a l. 4.5.2 Lowpass, Highpass, and Bandpass Filters In th e d esig n o f lo w pass digital filters, th e p oles sh o u ld be p la c e d n e a r th e unit circle at p o in ts c o rre sp o n d in g to low fre q u e n c ie s (n e a r cm = 0) and ze ro s sh ould b e p la c e d n e a r o r on th e u n it circle at p o in ts c o rre sp o n d in g to high freq u e n cies ( n e a r co = t t ) . T h e o p p o site h o ld s tru e fo r h ighpass filters. F ig u re 4.44 illu strates th e p o le - z e r o p la c e m e n t o f th re e low pass a n d th re e h ig h p ass filters. T h e m a g n itu d e an d p h a se re sp o n se s fo r th e sin g le-p o /e filter w ith sy stem fu n ctio n 334 Frequency Analysis of Signals and System s Chap. 4 Highpass Figure 4.44 Pole-zero patterns for several lowpass and highpass fillers. are illu stra te d in Fig. 4.45 fo r a = 0.9. T h e gain G w as se le c te d a s 1 — a, so th at th e filter h as u n ity gain a t co = 0. T h e gain of this filter a t h ig h fre q u e n c ie s is relativ ely sm all. T h e a d d itio n o f a ze ro a t z = —1 f u rth e r a tte n u a te s th e re s p o n s e o f th e filter a t high freq u e n cies. T h is lead s to a filter w ith a sy stem fu n ctio n H 2 (z) = 1- ~ ~ ~ ~l~~' . 2 1 — az~ (4.5.10) an d a freq u e n cy re sp o n se c h a ra c te rstic th a t is also illu stra te d in Fig. 4.45. In this case th e m ag n itu d e o f H 2 (co) g o es to z e ro a t co = n. S im ilarly, w e can o b ta in sim p le h ig h p ass filters by reflec tin g (fo ld in g ) the p o le -z e ro lo catio n s o f th e low pass filters a b o u t th e im ag in ary axis in th e z-plane. T h u s w e o b tain th e sy stem fu n ctio n H i ( z ) = -l ~ a \ 2 1 -f a z ~ [ (4.5.11) w hich has th e freq u e n cy re sp o n s e c h a ra c te ristic s illu stra te d in Fig. 4.46 fo r a = 0.9. Example 4.5.1 A two-pole lowpass filter has the system function W(z) = b0 (1 - pz -')2 Sec. 4.5 Linear Tim e-invariant Systems as Frequency-Selective Filters 335 Figure 4.45 Magnitude and phase response of (1) a singie-pole filter and (2) a one-pole, one-zero filter; Wi(;) = (1 - a ) /( 1 — a ; ' 1), H j(z) = [(1 —a )/2 ][(l + r ~ * )/(l - a ; - 1 )] and a = 0.9. D eterm ine the values of h{>and p such that the frequency response H(w) satisfies the conditions H(0) = 1 and I / K \ I2 1 r W I =2 Solution A t o) = 0 we have H( 0) = (1 - p )2 Hence bo = (1 - p Y = 1 336 Chap. 4 20 log|0]HM| Frequency Analysis of Signals and Systems Figure 4.46 Magnitude and phase response of a simple highpass fitter; H(C) = [(1 - a )/2 ][(l - z - ' ) / ( l + a z - 1)] with a = 0.9. At w = tt/4. (1 ) = (1 ~ P? v4 / (1 —pe~i*/4)2 (1 ~ P )2 (1 - p cos(;r/4) + j p sin (tt/4))2 (1 - P ) 2 (1 - pj s / 2 + jp/ ^/ 2)2 Hence (1 - p t [(1 - p / - j2 ) 2 + p 212]2 1 2 Sec. 4.5 Unear Tim e-Invariant Systems as Frequency-Selective Filters 337 or, equivalently. V ^d - p y = 1 + p1 - y'lp The value of p = 0.32 satisfies this equation. Consequently, the system function for the desired filter is 0.46 H( z) (1 - 0.32c 1)= T h e sam e p rin cip le s can be a p p lied fo r th e desig n of b a n d p a s s filters. B asi­ cally, th e b a n d p a s s filter sh o u ld c o n tain o n e o r m o re p airs o f co m p lex -co n ju g ate p o les n e a r th e u n it circle, in the vicinity of th e freq u e n cy b a n d th a t c o n stitu te s the p assb a n d o f th e filter. T h e follow ing ex am p le serves to illu strate th e basic ideas. E x a m p le 4.5.2 Design a two-pole bandpass filler that has the center of its passband at w = n72. zero in its frequency response characteristic at w = 0 and at = n . and its magnitude response is 1 /V 2 at w = 4w /9 . S o lu tio n Clearly, the filter must have poles at Pl : = r i b ­ and zeros at — 1 and : = —1. Consequently, the system function is /z o = a (: - 1)<: + 1) (: - j r)(: + j r) = c- - 1 The gain factor is determ ined by evaluating the frequency response H(w) of the filler at u> = jr/2. Thus we have " ( § ) - cr b - > G _ 1 - r2 The value of r is determ ined by evaluating H( w) at w = 4tt/9. Thus we have 4tt \ (1 - r1)2 9 /| 4 2 - 2 c o s ( 8 7 t/9 ) 2r2 c o s ( 8 jt/9 ) 1 4- r4 + 1 2 or. equivalently, 1.94(1 - r 1)1 = 1 - 1 .8 8 r2 + r 4 The value of r2 = 0.7 satisfies this equation. Therefore, the system function for the desired filter is "<:l = a,5IT5& Its frequency response is illustrated in Fig. 4.47. 338 Frequency Analysis of Signals and Systems _ T x ~2 q r 2 t Chap. 4 Figure 4.47 Magnitude and phase response of a simple bandpass filter in Example 4.5.2; H(z) = 0.15[(1 - z ~ 2) / a + 0 . 7 ; - 2)]. It sh o u ld b e e m p h a siz e d th a t th e m ain p u rp o se of th e fo re g o in g m eth o d o lo g y fo r d esig n in g sim p le digital filters b y p o le - z e r o p la c e m e n t is to p ro v id e insight in to th e effect th a t p o les a n d z e ro s have on th e fre q u e n c y re sp o n s e characteristic o f system s. T h e m e th o d o lo g y is n o t in te n d e d as a goo d m e th o d fo r designing d igital filters w ith w ell-specified p a s sb a n d an d sto p b a n d ch aracteristics. System atic m e th o d s fo r th e d esig n of so p h is tic a te d d ig ital filters fo r p ra c tic a l ap p lic a tio n s are d iscussed in C h a p te r 8. A simple lowpass-to-highpass filter transformation. S u p p o se th a t we h av e d esig n ed a p r o to ty p e low pass filter w ith im p u lse re sp o n se h\p(n). B y us- Sec. 4.5 Linear Tim e-Invariant Systems as Frequency-Selective Filters 339 ing th e fre q u e n c y tra n sla tio n p ro p e rty o f th e F o u rie r tra n sfo rm , it is p o ssib le to co n v ert th e p ro to ty p e filter to e ith e r a b a n d p a ss or a h ig h p ass filter. F re q u en cy tra n sfo rm a tio n s fo r c o n v ertin g a p ro to ty p e low pass filter in to a filter of a n o th e r ty p e are d e sc rib e d in d etail in S ection 8.3. In th is sectio n w e p re se n t a sim plefre q u e n c y tra n sfo rm a tio n fo r co n v e rtin g a low pass filter in to a h ig h p ass filter, and vice v ersa. If /i|p(n) d e n o te s th e im p u lse resp o n se of a low pass filter w ith freq u e n cy re sp o n se H\r (co). a h ighpass filter can be o b ta in e d by tra n sla tin g H]P(a>) by t t rad ian s (i.e., rep lacin g co by co — n ) . T h u s ^ h p ( ^ ) — H\p(co TT ) (4.5.12) w h e re H hP(w) is th e fre q u e n c y re sp o n se o f th e h ig h p ass filter. Since a freq u e n cy tra n sla tio n o f t t ra d ia n s is e q u iv a le n t to m u ltip lic atio n o f th e im pulse resp o n se /iip(;i) by e 177", th e im p u lse resp o n se o f th e highpass filter is /ihp(n) — (p 7't )''/7|p (/7) = ( —1 )"/ ii p(« ) (4.5.13) T h e re fo re , th e im p u lse resp o n se of th e h ig h p ass filter is sim ply o b ta in e d from the im pulse re sp o n se o f the low pass filter by ch an g in g th e signs o f th e o d d -n u m b e re d sa m p le s in inp(n). C o n v ersely . = ( - 1 )"/ihp(«) (4.5.14) If th e lo w pass filter is d e sc rib e d by th e d ifferen ce e q u a tio n (4.5.15) its fre q u e n c y re sp o n s e is M k—0 (4.5.16) N ow , if w e re p la c e co by co — n , in (4.5.16). th en M tfhpM = -------------- (4.5.17) 1 + £ ( - 1 )kake ~ iak w hich c o rre sp o n d s to th e d iffe re n c e e q u a tio n ( 4 . 5 . 18 ) Frequency Analysis of Signals and Systems 340 Chap. 4 Example 4.5.3 Convert the lowpass filter described by the difference equation v(n) = 0.9v(n — 1) + 0 .1 x 0 ) into a highpass filter. Solution The difference equation for the highpass filter, according to (4.5.18), is y(n) = -0.9v(n - 1) + 0.1x(n) and its frequency response is 0.1 - 1+ Q9e_ju The reader may verify that H^((o) is indeed highpass. 4.5.3 Digital Resonators A digital resonat or is a sp ecial tw o-pole b a n d p a ss filter w ith th e p a ir o f com plexc o n ju g ate p o les lo c a te d n e a r th e u n it circle as show n in Fig. 4 .4 8 (a). T h e m ag n itu d e of th e fre q u e n c y re sp o n se of th e filter is show n in Fig. 4 .48(b). T h e n am e re so n a to r re fe rs to th e fact th a t th e filter has a large m a g n itu d e re sp o n se (i.e., it re so n a te s ) in th e v icinity o f th e p o le lo catio n . T h e a n g u lar p o sitio n of th e p o le d e te rm in e s th e re so n a n t freq u e n c y o f th e filter. D igital re so n a to rs are useful in m a n y applications, in clu d in g sim p le b a n d p a ss filterin g an d sp e ech g e n e ra tio n . In th e d esig n o f a digital r e s o n a to r w ith a re so n a n t p e a k at o r n e a r to — o>o, w e se lect th e c o m p lex -co n ju g ate p o les at Pi .2 = r e ±ja* 0 < r < 1 In a d d itio n , we can select u p to tw o zeros. A lth o u g h th e re a re m an y possible choices, tw o cases a re o f special in terest. O n e choice is to lo cate th e z ero s a t the origin. T h e o th e r ch o ice is to locate a z e ro a t z = 1 an d a z e ro a t z = —1. T his choice co m p letely e lim in a te s th e re sp o n s e o f th e filter a t fre q u e n c ie s co = 0 and co = n , an d it is u se fu l in m an y p ractical a p p licatio n s. T h e sy stem fu n ctio n o f th e digital r e s o n a to r w ith ze ro s a t th e origin is H ( z ) = ----------- :------ r ~ -----------:-------r (1 — r e ^ z )(1 — re -'“ "z- 1 ) (4.5.19) H ( z ) = ------- ----------(4.5.20) 1 — (2 r coscwo);-1 + r 2z ~2 S ince \H(co)\ h as its p e a k at o r n e a r co = coo, w e select th e gain bo so th a t |W(too)I = 1- F ro m (4.5.19) w e o b ta in b0 H{(Oo) = ---------:------- ----- ^-----------:------- :---(1 - r e j<*,e -J°*>)0. - r e - w e - w ) _______________ (1 — r ) ( l — r e - -'2'00) an d h e n c e bo \H(coo)\ = ------;---I — •- === = 1 (1 — r)V 1 + r 2 — 2 r cos2a)o (4 5 21) Sec. 4.5 Linear Tim e-Invariant Systems as Frequency-Selective Filters 2 341 2 (b) —tt _ n 0 2 £r 2 (c) Tt Figure 4.48 (a) Pole-zero pattern and (b) the corresponding magnitude and phase response of a digital resonator with (1) r — 0.8 and (2) r = 0.95. 342 Frequency Analysis of Signals and System s Chap. 4 T h u s th e d esired n o rm a liz a tio n fa c to r is i?o = (1 — r ) > /l + r 2 — 2r cos2a>o (4.5.22) T h e freq u e n cy re sp o n se o f th e r e s o n a to r in (4.5.19) can b e e x p re ss e d as bo \H(a>)\ = ----------------Ux(to)U2 ((o) (4.5.23) © (w ) = 2 to — <J>i (tfj) — <t>2 (co) w h ere U\ (w) a n d 1/ 2 (01) are th e m a g n itu d e s of th e v e c to rs fro m p\ an d p 2 to the p o in t w in th e u n it circle a n d <t>i(<w) an d <J>2 (£d) a re th e c o rre sp o n d in g angles of th e se tw o v ecto rs. T h e m a g n itu d e s Ui(to) a n d U2 (co) m ay be e x p re ss e d as Ui(co) = J \ + r 2 — 2 r cos(a>o — to) (4.5.24) U 2 (<o) = y / 1 + r 2 — 2 r c o s (w q + co) F o r any v alu e o f r , U\(to) ta k e s its m in im u m v alu e (1 — r ) a t to = too- T he p ro d u c t U\((o)U2 ({o) re a c h e s a m in im u m v alu e at th e fre q u e n c y air = co s-1 coswo^j (4.5.25) w hich defin es p recisely th e r e s o n a n t fre q u e n c y o f th e filter. W e o b se rv e th a t w hen r is very close to u n ity , tor a>o, w hich is th e a n g u la r p o sitio n o f th e p o le. W e also o b se rv e th a t as r a p p ro a c h e s unity, th e re so n a n c e p e a k b ec o m e s s h a rp e r becau se U\(to) ch an g es m o re rap id ly in relativ e size in th e vicinity o f ojo- A q u a n tita tiv e m e a su re o f th e sh a rp n e s s o f th e re so n a n c e is p ro v id e d by th e 3-dB b a n d w id th A w o f th e filter. F o r v alu es o f r close to u nity. Aw % 2(1 - r ) (4.5.26) F ig u re 4.48 illu stra te s th e m a g n itu d e a n d p h a s e o f d igital re s o n a to rs w ith coq = n / 3 , r = 0.8 an d too ~ *73, r = 0.95. W e n o te th a t th e p h a se resp o n se u n d erg o es its g re a te st ra te o f c h a n g e n e a r th e re s o n a n t freq u e n cy . If th e zero s o f th e digital r e s o n a to r a re p laced a t z = 1 an d z = — 1, th e re s o n a to r has th e sy stem fu n ctio n H(z) = G = G (1 - z - ' X l + z " 1) (1 — re>aK,z ~ l )( 1 — r e - -'a*»2 -1 ) (4.5.27) 1 -z -2 1 — (2r coscdo)z-1 + r 2z ~2 an d a fre q u e n c y re sp o n s e c h a ra c te ristic H{ w) = b° [ \ _ («*-->][! _ r e - n » o +*>)J (4.5.28) W e o b se rv e th a t th e z e ro s a t z = ± 1 affe ct b o th th e m a g n itu d e a n d p h a se resp o n se o f th e re so n a to r. F o r ex a m p le , th e m a g n itu d e re sp o n s e is \H(to)\=b0 U\(to)U2(to) ( 4 -5 ’2 9 ) Sec. 4.5 Linear Tim e-Invariant Systems as Frequency-Selective Filters 343 Figure 4.49 Magnitude and phase response of digital resonator with zeros at 10 = 0 and - t and ( I ) r = O.N and (2) r = 0.95. to= w h ere N { oj) is d efin ed as N ( w) — 7 2 (1 - cos2a>) D u e to th e p re se n c e o f th e zero fa c to r, th e re s o n a n t fre q u e n c y is a lte re d from th at given by th e ex p ressio n in (4.5.25). T h e b a n d w id th of th e filter is also a lte re d . A lth o u g h ex act v alu es for th e s e tw o p a ra m e te rs are ra th e r te d io u s to d eriv e, we can easily c o m p u te th e fre q u e n c y re sp o n se in (4.5.28) an d c o m p a re th e re su lt with th e p re v io u s case in w hich th e zeros a re lo c a te d at th e origin. F ig u re 4.49 illu strates th e m a g n itu d e an d p h a s e c h a ra c te ristic s fo r o>q — n / 3 . r = 0.8 an d a>o — tt/ 3, r = 0.95. W e o b se rv e th a t th is filter h a s a slightly sm a ller b a n d w id th th a n th e re s o n a to r, w hich h as zero s a t th e origin. In a d d itio n , th e re a p p e a rs to be a v ery sm all shift in th e re so n a n t fre q u e n c y d u e to th e p re se n c e of th e zero s. 4.5.4 Notch Filters A n o tc h filter is a filter th a t c o n ta in s o n e o r m o re d e e p n o tc h e s o r, ideally, p e rfe c t nulls in its fre q u e n c y re sp o n se ch a ra c te ristic . F ig u re 4.50 illu stra te s th e freq u e n cy re sp o n se c h a ra c te ristic o f a n o tc h filter w ith nulls a t fre q u e n c ie s cl>o an d . N otch filters are useful in m an y a p p lic a tio n s w h e re specific fre q u e n c y c o m p o n e n ts m ust be elim in a te d . F o r ex am p le, in stru m e n ta tio n a n d re c o rd in g sy stem s re q u ire th a t th e p o w er-lin e fre q u e n c y o f 60 H z a n d its h a rm o n ic s b e e lim in ated . 344 Frequency Analysis of Signals and System s Chap. 4 Figure 4,50 Frequency response characteristic of a notch filter. T o c re a te a null in th e fre q u e n c y re sp o n se o f a filter at a fre q u e n c y ojo, we sim ply in tro d u c e a p a ir of c o m p lex -co n ju g ate ze ro s on th e u n it circle at an angle too. T h a t is, S,.2 = f ± j“° T h u s th e system fu n ctio n fo r an F IR n o tch filter is sim ply H( z ) = boQ - eJlo" z ~] Ml (4.5.30) — bo (1 — 2 C O S tr>()c ' z ~) A s an illu stratio n . Fig. 4.51 show s th e m a g n itu d e re sp o n se fo r a n o tc h filter having a null a t a> = tt/4 . T h e p ro b lem w ith th e F IR notch filter is th a t th e n o tch has a relativ ely large b an d w id th , w hich m ean s th a t o th e r fre q u e n c y c o m p o n e n ts a ro u n d th e d esired null are se v ere ly a tte n u a te d . T o re d u c e th e b an d w id th o f th e null, w e can re so rt to a m o re so p h isticated , lo n g er F IR filter d esig n ed acco rd in g to c rite ria describ ed in C h a p te r 8. A lte rn a tiv e ly , w e could, in an ad h o c m a n n e r, a tte m p t to im prove on th e freq u e n cy re sp o n se ch a ra c te ristic s by in tro d u c in g p oies in th e system func­ tion. S u p p o se th a t w e p lace a p a ir o f c o m p lex -co n ju g ate p o les at Ph2 = r e ±i m T h e effect o f th e p o les is to in tro d u c e a re so n a n c e in th e vicinity o f th e null and th u s to red u ce th e b a n d w id th o f th e n o tch . T h e sy stem fu n ctio n fo r th e resulting filter is 1 - 2 cos wo; 1 + z~ H ( c ) = bo1 - 2 r cosojoZ-1 + r 2z ~2 (4.5.31) T h e m ag n itu d e re sp o n se \H(u>)\ o f th e filter in (4.5.31) is p lo tte d in Fig. 4.52 for coo = t t /4 , r = 0.85, an d fo r ti>o = n / 4 , r = 0.95. W h en c o m p a re d w ith the freq u e n cy resp o n se o f th e F IR filter in Fig. 4.51, w e n o te th a t th e effect o f the p o les is to red u ce th e b an d w id th o f th e no tch . In a d d itio n to red u cin g th e b a n d w id th o f th e n o tc h , th e in tro d u c tio n o f a p o le in th e vicinity o f th e null m ay re su lt in a sm all rip p le in th e p a s sb a n d o f th e filter d u e to th e re so n a n c e c re a te d by th e pole. T h e effe ct o f th e rip p le can be re d u c e d by in tro d u c in g a d d itio n a l p o le s a n d /o r ze ro s in th e sy ste m fu n c tio n o f the n o tch filter. T h e m a jo r p ro b le m w ith th is a p p ro a c h is th a t it is b a sic a lly an ad hoc, tria l-a n d -e rro r m e th o d . Sec. 4.5 Linear Tim e-Invariant Systems as Frequency-Selective Filters 345 Figure 4.51 Frequency response characteristics of a notch filter with a notch at co = n / 4 or / = 1/8; H(z) = G[1 - 2cos£ooz-1 + z-2 ]- 4.5.5 Comb Filters In its sim p lest fo rm , a c o m b filter can be v iew ed as a n o tc h filter in w h ich th e n u lls o c c u r p e rio d ic a lly ac ro ss th e fre q u e n c y b a n d , h e n ce th e an a lo g y to an o rd i­ n a ry c o m b th a t h as p erio d ically sp a ced te e th . C o m b filters find ap p lic a tio n s in a w ide ra n g e o f p ra c tic a l sy stem s such as in th e re je c tio n o f p o w e r-lin e h arm o n ics, in th e se p a ra tio n o f so la r a n d lu n a r c o m p o n e n ts fro m io n o sp h e ric m e a s u re m e n ts o f e le c tro n c o n c e n tra tio n , a n d in th e su p p re ssio n o f c lu tte r fro m fixed o b je c ts in m o v in g -ta rg e t-in d ic a to r (M T I) ra d a rs. 346 Frequency Analysis of Signals and Systems Chap. 4 Figure 4.52 Frequency response characteristics of two notch filters with poles at ( I ) r = 0,85 and 12) r — (1.95: H(z) = />n|(l - - cos to u r'1 2r cosgju:-1 + r2z ~~)]. r " ")/(1 - T o illu strate a sim ple form of a co m b filler, c o n sid er a m oving a v erag e (F IR ) filter d escrib ed by th e d ifferen ce e q u a tio n xin - k ) v(«) = — (4.5.32 T h e system fu n ctio n o f this F IR filter is Hiz + * Jt=0 1 [ l - c - * ^ 11] M + 1 ( 1 - - - ’) (4.5.33) an d its freq u e n cy re sp o n se is S]na)( « j d ) H(a>) = (4.5.34) M + 1 sin(w /2) F ro m (4.5.33) we o b se rv e th a t th e filter has ze ro s on th e u n it circle at k = 1 , 2 . 3 .........M (4.5.35) N o te th a t th e p o le a t ; = 1 is actu ally can ce le d by th e zero at ; = 1, so th a t in effect th e F IR filter d o e s n ot c o n tain p o le s o u tsid e z = 0. A p lo t o f th e m ag n itu d e c h a ra c te ristic o f (4.5.34) clearly illu stra te s th e ex­ isten ce o f th e p erio d ically sp a c e d zero s in fre q u e n c y at cot = 2 n k / ( M + 1) for £ = 1 , 2 , -----M. F ig u re 4,53 sh o w s \ H( w) \ fo r M = 10. Sec. 4.5 Linear Tim e-Invariant Systems as Frequency-Selective Filters 347 Figure 4.53 Magnitude response characteristic for the comb filter given by (5,4.32) with M = 10. In m o re g e n eral te rm s, w e can c re a te a com b filter by ta k in g an F I R filter w ith sy stem fu n ctio n M H( z ) = 2 2 h ( k ) z ~ k (4.5.36) k=0 an d rep la c in g z by z L, w h ere L is a po sitiv e in teg er. T h u s th e new F IR filter has a sy stem fu n ctio n H l (z ) = Y , h ( k ) z (4.5.37) If th e fre q u e n c y re sp o n se of th e original F IR filter is //(w ), th e freq u e n c y resp o n se o f th e F IR in (4.5.37) is M H l (u>) = 2 2 h ( k ) e ~ jkLa (4.5.38) k=I) = H(Lco) C o n s e q u e n tly , th e fre q u e n c y re sp o n se c h a ra c te ristic H l {oj) is sim ply an L -o rd e r re p e titio n o f H(co) in th e ra n g e 0 < co < 2 n . F ig u re 4.54 illu stra te s th e re la tio n sh ip b e tw e e n H l ( c o) a n d H (w) fo r L — 5. N o w , su p p o se th a t th e o rig in al F I R filter w ith system fu n ctio n H ( z ) h as a sp e c tra l n ull (i-e -, a z e ro ), at so m e fre q u e n c y coo. T h e n th e filter w ith system fu n ctio n H L(z) h a s p erio d ically sp a ced nulls a t av = coo + I n k j L , k = 0, 1 , 2 , . . . , L — 1. A s an illu stra tio n , F ig. 4.55 show s an F IR co m b filter w ith Af = 3 an d L = 3. T h is F IR filter can b e v iew ed as an F IR filter o f le n g th 10, b u t only fo u r o f th e 10 filter coefficients are n o n zero . L e t us no w r e tu rn to th e m oving a v erag e filter w ith system fu n ctio n given by (4.5.33). S u p p o se th a t we re p la c e z by z L. T h e n th e re su ltin g co m b filter h as th e sy stem fu n ctio n 1 1_ 1) Hl(z) = T 7~~r / (4-5.39) M + 1 l-z~ L and a frequency response H l ( co) = 1 sin[a>L(M + l ) /2 ] M + 1 sin(coL/2) (4.5.40) 348 Frequency Analysis of Signals and Systems Chap. 4 H (u > ) (a) Hl (co) 5 5 5 5 (b) Figure 4.54 Comb fiJter with frequency response W/Joi) obtained from H(a>). Figure 4.55 Realization of an FIR comb filter having M = 3 and L ~ 3. T his filter has zero s on th e u n it circle at Zk = e j 2* k / L l M+ h (4.5.41) fo r alt in te g e r v alu es o f k e x cep t k — 0, L, 2 L .........M L . F ig u re 4.56 illu strates \ H l {(d )\ fo r L = 5 an d M = 10. T h e co m b filter d esc rib e d by (4.5.39) finds a p p lic a tio n in th e s e p a ra tio n of so la r a n d lu n a r sp e c tra l c o m p o n e n ts in io n o sp h e ric m e a s u re m e n ts o f e le c tro n c o n ­ c e n tra tio n as d e sc rib e d in th e p a p e r by B e rn h a rd t e t al. (1976). T h e so la r p e rio d is Ts = 24 h o u rs an d resu lts in a so la r c o m p o n e n t o f o n e cycle p e r d ay a n d its h arm o n ics. T h e lu n a r p e rio d is Tl = 24.84 h o u rs a n d p ro v id e s sp e c tra l lin es at 0.96618 cycle p e r d ay an d its h arm o n ics. F ig u re 4.57a show s a p lo t o f th e p o w e r d en sity sp e c tru m o f th e u n filtered io n o sp h e ric m e a s u re m e n ts o f th e e le c tro n con- Sec. 4.5 Linear Time-Invariant Systems as Frequency-Selective Filters 349 Figure 4.56 Magnitude response characteristic for a comb filter given by (4.5.40). with L — 3 anti M = II). c e n tra tio n . N o te th a t th e w eak lu n a r sp e ctral c o m p o n e n ts are alm o st h id d en by th e stro n g so la r sp e c tra l co m p o n en ts. T h e tw o se ts o f sp e c tra l c o m p o n e n ts can be se p a ra te d by th e use o f com b filters. If w e w ish to o b ta in th e so lar co m p o n e n ts, we can use a co m b filter w ith a n a rro w p a s sb a n d a t m u ltip le s of o n e cycle p e r day. T h is can be ach iev ed by selectin g L such th a t Fs/ L = 1 cycle p e r day. w h ere Fs is th e c o rre sp o n d in g sa m p lin g freq u e n cv . T h e resu lt is a filter th a t has p e a k s in its freq u e n cy resp o n se at m u ltip le s o f o n e cycle p e r day. By se lectin g M = 58. the filter will h ave nulls at m u ltip le s o f ( F J L ) I ( M + 1) = 1/59 cycle p e r day. T h e se nulls a re very close to th e lu n a r c o m p o n e n ts a n d result in good rejectio n . F ig u re 4.57(b) illu strates Freq ue ncy (cycles/day) <c) Figure 4.57 (a) Spectrum of unfiltered electron content data; (b) spectrum of out­ put of solar filter; (c) spectrum of output of lunar filter. [From paper by Bernhardt et al. (1976). Reprinted with permission of the American Geophysical Union.] Frequency Analysis of Signals and Systems 350 Chap. 4 the p ow er spectral density of the output o f the com b filter that isolates the solar com ponents. A com b filter that rejects the solar com p onents and passes the lunar com ponents can be d esigned in a sim ilar m anner. Figure 4.57(c) illustrates the pow er spectral density at the output o f such a lunar filter. 4.5.6 All-Pass Filters An all-pass filter is defined as a system that has a constant m agnitude resp onse for all frequencies, that is. |ff{oj)l = l 0<o><7r (4.5.42) The sim plest exam ple o f an all-pass filter is a pure delay system with system func­ tion H(z) = z~k This system passes all signals w ithout m odification except for a d elay of k sam ples. This is a trivial all-pass system that has a linear phase response characteristic. A m ore interesting all-pass filter is described by the system function a x + a /v '-i" ^ 1 + ■■■+ a \ Z ; n(z) = - 1 + 0\Z ,. = ' + • ■ ■ + Qn Z N n (4.5.43) .- N + k ----- IT a° = 1 where all the filter coefficients \ak ) are real. If w e define the polyn om ial /\(~) as A (;) = Y ^ a kz k k=U an — 1 then (4.5.43) can be expressed as H(z) = z ~ n M ‘ ] (4.5.44) A(z) Since \H(a>)\2 = = 1 the system given by (4.5.44) is an all-pass system . Furtherm ore, if zo is a pole o f H( z ) . then 1/zu is a zero o f H ( z ) (i.e., the p oles and zeros are reciprocals of o n e another). Figure 4.58 illustrates typical p o le -z e r o patterns for a single-pole, single-zero filter and a tw o-p ole, tw o-zero filter. A plot o f the p h ase characteristics o f these filters is shown in Fig. 4.59 for a = 0.6 and r = 0.9, too = tt/4. The m ost genera! form for the system function o f an all-pass system with real coefficients, expressed in factored form in term s of p oles and zeros, is Nr H, f ^ - T T - _____ - 1J i - n Pk l \ a - A z - ’ x i - P i z ~ x) (4 5 45) (4 ’5 ' where there are N R real p o les and zeros and N c com p lex-con ju gate pairs o f poles and zeros. For causal and stable system s w e require that - 1 < a* < 1 and |/S*| < 1. Sec. 4.5 Linear Time-Invariant Systems as Frequency-Selective Filters 351 (a) Figure 4.58 Pole-zero patterns of (a) a first-order and (b) a second-order all-pass filter. 10 20 tog I H M I 0 -10 -20 -3 0 0(u) -4 0 Figure 4.59 Frequency response characteristics of an all-pass filter with system functions (1) H(z) = (0.6 + z - ') / ( l + 0 . 6 Z '1), (2) H(z) = (r2 - 2tcoswqz~1 + Z ~ 2 ) / (1 —2rcoscuoz-i + r2z~2), r = 0.9, (jo — n/A. 352 Frequency Analysis of Signals and Systems Chap. 4 E xp ression s for the phase response and group delay o f all-pass system s can easily be obtained using the m ethod described in Section 4.4.6. For a single p o lesingle zero all-pass system w e have Manioc) ‘— Ju H en ce r sin(a) — 6} C-)ap(w) = —cd — 2 tan' — r COS(w - 6 ) 1 and di~).Ap(ct>) 1 - r2 ciaj 1 + i - — 2r cosiw — 0) (4.5.46) W e n ote that for a causal and stable system , r < 1 and hence rt, (w) > 0. Since the group delay o f a higher-order p o le-zero system consists o f a sum o f positive terms as in (4.5.46), the group delay will always be positive. A ll-pass filters find application as phase equalizers. W hen placed in cascade with a system that has an undesired phase response, a phase eq u alizer is designed to com pensate for the poor phase characteristics of the system and therefore to p roduce an overall linear-phase response. 4.5.7 Digital Sinusoidal Oscillators A digital si nusoi dal oscillator can be view ed as a lim iting form o f a tw o-p ole res­ onator for which the com plex-conjugate p oles He on the unit circle. From our previous discussion o f secon d-ord er system s, we recall that a system with system function H ( z ) = -----------------------1 + a j z " 1 + ai z (4.5.47) and param eters a i = —2rcosa>o and a2 = r 2 (4.5.48) has com plex-conjugate poles at p = r e ± m \ and a unit sam ple response h(n) = —~ — sin(n + l)fDow(n) sin cun (4.5.49) If the p oles are placed on the unit circle (r = 1) and bo is set to A sincuo, then h(n) = A s i n ( n + l)u>ou(n) (4.5.50) Thus the im pulse response o f the second-order system with com plex-conjugate poles on the unit circle is a sinusoid and the system is called a digital sinusoidal oscillator or a digital si nusoi dal generator. A digital sinusoidal gen erator is a basic com ponent o f a digital frequency synthesizer. Sec. 4.5 Linear Time-Invariant Systems as Frequency-Selective Filters 353 T h e block diagram representation o f the system function given by (4.5.47) is illustrated in Fig. 4.60. The corresponding difference equation for this system is v ( n) = —a i y0? — 1) — y( n — 2) + boS(n) (4.5.51) w here the param eters are a\ = —2cosa>o and bo = Asincwo, and the initial con d i­ tions are y ( —1) = v (—2) = 0. By iterating the differen ce eq u ation in (4.5.51), we obtain y (0) = ^ sin w o y ( l ) = 2cos<woy(0) - 2 A sin too cos tt>o = Asin2tL>o y(2) — 2costL>oy(l) - y(0) = 2 A cos a»o sin 2wo — A sin loq - A {4 cos2 coq — 1) sin wq — 3 A sin too ~ 4 sin 3 coq = A sin Ixoq and so forth. W e n ote that the application of the im pulse at n = 0 serves the purpose o f beginning the sinusoidal oscillation. T hereafter, th e oscillation is selfsustaining b ecau se the system has no dam ping (i.e., r = 1). It is in terestin g to note that the sinusoidal oscillation ob tain ed from the sys­ tem in (4.5.51) can also be ob tain ed by setting the input to zero and setting the initial co n d ition s to y ( - l ) = 0, v (—2) = -A sin a> o. Thus the zero-input response to the secon d-ord er system described by the h om ogen eou s differen ce equation y{n) = - a i y ( n - 1) - y( n - 2) (4.5.52) with initial con d ition s y ( - l ) — 0 and >■(—2) = —A sin two, is exactly the sam e as the resp onse o f (4.5.51) to an im pulse excitation. In fact, the d ifferen ce equation in (4.5.52) can b e ob tain ed directly from the trigonom etric identity a +8 a - B sin a + sin fi = 2 sin — - — cos — - — (4.5.53) w here, by definition, or = (n + !)&*>, 0 = (n — l)^ o , and y( n) = s i n( n + l)a>o- 354 Frequency Analysts of Signals and Systems Chap. 4 In som e practical applications involving m odulation of tw o sinusoidal carrier signals in phase quadrature, there is a need to generate the sinusoids A sin ojqn and A cosaion. T hese signals can be gen erated from the so-called coupl ed- f orm oscillator, which can be ob tain ed from the trigonom etric form ulas co s(a + ft) = cos a cos ft — sin a sin ft sin (a + ft) = sin a cos ft + cos a sin ft where, by definition, a = ft = u>o, and yr (n) = COsnajoK(rc) (4.5.54) y , (n ) = sinna>t)U(fj) (4.5.55) Thus we obtain the tw o cou p led d ifference equations )'(■(») = (COS a>o)}■<■(« - 1) - (s in a jo )y , (« - 1) (4.5.56) y.,(«) = (sin o>o)yt-(n - 1) + (cosw o)yr(n - 1) (4.5.57) which can also be expressed in matrix form as yAn) _vt(n) _ cos co{) sin too sin £t?o cos lo{) yt.(n - 1) (4.5.58) yAn ~ T h e structure for the realization of the coupled-form oscillator is illustrated in Fig. 4.61. We note that this is a tw o-output system which is not driven by any input, but which requires the initial con d ition s y<( —]) = /Icosaio and y.f ( —1) = -A sin a> o in order to begin its self-sustaining oscillations. Finally, it is interesting to note that (4.5.58) corresponds to vector rotation in the tw o-dim ensional coordinate system with coordinates yc(n) and y.T(n). A s a con sequ en ce, the coupled-form oscillator can also be im plem en ted by use o f the so-called C O R D IC algorithm [see the b ook by K ung et al. (1985)]. Figure 4.61 Realization of the coupled-form oscillator. Sec. 4.6 inverse Systems and Deconvolution 355 4.6 INVERSE SYSTEMS AND DECONVOLUTION A s we have seen , a linear tim e-invariant system takes an input signal v(/j) and produces an output signal y (n ), which is the con volu tion of * (« ) with the unit sam ple response h{n) of the system . In m any practical applications w e are given an output signal from a system w hose characteristics are unknow n and we are asked to determ ine the input signal. For exam p le, in the transm ission of digital inform ation at high data rates over telep h on e channels, it is w ell known that the channel distorts the signal and causes intersym bol interference am ong the data sym bols. T h e intersym bol interference m ay cause errors when w e attem pt to re­ cover the data. In such a case the problem is to design a corrective system which, w hen cascaded with the channel, produces an output that, in som e sense, corrects for the distortion caused by the channel, and thus yields a replica of the desired transm itted signal. In digital com m unications such a corrective system is called an equalizer. In the general con text of linear system s theory, how ever, w e call the corrective system an inverse s y s t e m , because the corrective system has a fre­ quency resp onse which is basically the reciprocal o f the frequency response o f the system that caused the distortion. F urtherm ore, since the distortivc system yields an output y i n ) that is the con volu tion of the input x ( n ) wiih the im pulse response h(n). the inverse system operation that takes y(/i) and produces a ( / i ) is called deconvol ut i on. If the characteristics o f the distorlive system are unknow n, it is often nec­ essary, when p ossib le, to excite the system with a known signal, observe the output, com pare it with the input, and in som e m anner, determ in e the charac­ teristics o f the system . For exam ple, in the digital com m unication problem just described, w here the frequency response of the channel is unknow n, the m ea­ surem ent o f the channel frequency response can be accom p lish ed by transm itting a set o f equal am plitude sinusoids, at different freq u en cies with a specified set o f phases, within the frequency band o f the channel. The channel will atten ­ uate and phase shift each o f the sinusoids. By com paring the received signal with the transm itted signal, the receiver obtains a m easu rem en t o f the channel frequency resp onse which can be used to design the inverse system . The pro­ cess o f determ ining the characteristics of the unknow n system , either h( n) or H(co), by a set o f m easurem ents perform ed on the system is called syst em identi­ fication. T h e term “decon volu tion " is often used in seism ic signal p rocessing, and m ore generally, in geophysics to describe the op eration of separating the input signal from the characteristics o f the system which w e wish to m easure. T h e decon volu tion operation is actually in tend ed to identify the characteristics o f the system , which in this case, is the earth, and can also be view ed as a system id en ­ tification problem . T he “inverse system ,” in this case, has a frequency response that is the reciprocal o f the input signal spectrum that has b een used to excite the system . 356 Frequency Analysis of Signals and Systems Chap. 4 4.6.1 Invertibility of Linear Time-Invariant Systems A system is said to be invertible if there is a o n e-to -o n e corresp on d en ce betw een its input and output signals. This definition im plies that if w e know the output sequ en ce y(n), —oc < n < oc, of an invertible system T , w e can un iqu eiv determ ine its input A(n), —oc < n < oo. T he inverse syst em with input v(«) and output x{n) is d en oted by T ~ l . Clearly, the cascade con n ection o f a system and its inverse is equivalent to the identity system , since w( n) = 7 1[>'(«)] = T ~ x [T[x{n)]) - x(n ) (4.6.1) as illustrated in Fig. 4.62. For exam ple, the system s defined by the input-output relations y{n) = ax ( n ) and y( n) = x ( n — 5) are invertible, w h ereas the input-output relations y( n) = x 2(n) and y{n) = 0 represent noninvertible system s. A s indicated above, inverse system s are im portant in m any practical appli­ cations. including geop h ysics and digital com m unications. Let us begin by con­ sidering the problem of determ ining the inverse o f a given system . W e limit our discussion to the class o f linear tim e-invariant discrete-tim e system s. N ow . suppose that the linear tim e-invariant system T has an im pulse response h(n) and let h t (n) d en ote the im pulse response o f the inverse system T _ l . Then (4.6.1) is equivalent to the con volu tion equation U’(n) = h / ( n) * h( n) * x ( n ) = x( n) (4.6.2) h(n) * h/ ( n) = S(n) (4.6.3) But (4.6.2) im plies that The convolution equation in (4.6.3) can be used to solve for h/ ( n) for a given h(n). H ow ever, the solution o f (4.6.3) in the tim e dom ain is usually difficult. A sim pler approach is to transform (4.6.3) into the z-dom ain and so lv e for T _1. Thus in the z-transform dom ain, (4.6.3) becom es H{z )H, (z) = 1 and therefore the system function for the inverse system is *,(:)=^ (4.6.4) If H ( z ) has a rational system function H( z) = (4.6.5) /1(c) Identity system v( n ) T T -i Direct system Inverse system n '(n ) = x(n) Figure 4.62 System T in cascade with its inverse T _1. Sec. 4.6 357 Inverse Systems and Deconvolution then (4.6.6) Thus the zeros o f H ( z ) b ecom e the p oles of the inverse system , and vice versa. Furtherm ore, if H{ z ) is an F IR system , then Hi ( z) is an all-p ole system , or if H{z ) is an all-p ole system , then H s {z) is an F IR system . Example 4.6.1 Determine the inverse of the system with impulse response h(n) = UyuOO Solution The system function corresponding to h(n) is H(z) - 1- This system is both causal and stable. Since H(z) is an all-pole system, its inverse is FIR and is given by the system function h ,{ z) = i - h-1 Hence its impulse response is = &(n) — — 1) Example 4.6.2 Determine the inverse of the system with impulse response h(n) = <5(n) — j<5(h — 1) Solution This is an FIR system and its system function is H(z) = 1 - k ~ ' ROC: |z| > 0 The inverse system has the system function Thus H/ ( z) has a zero at the origin and a pole at z = j- In this case there are two possible regions of convergence and hence two possible inverse systems, as illustrated in Fig. 4.63. If we take the ROC of Hi(z) as |j| > j, the inverse transform yields which is the impulse response of a causal and stable system. On the other hand, if the ROC is assumed to be |j| < | , the inverse system has an impulse response In this case the inverse system is anticausal and unstable. 358 Frequency Analysis of Signals and Systems Chap. 4 Figure 4.63 Two possible regions of convergence for H (z) = z/(z - Y>- (b) W e observe that (4.6.3) cannot be solved uniquely by using (4.6.6) unless we specify the region of con vergen ce for the system function o f the inverse system. In som e practical applications the im pulse response h(n) d o es not possess a z-transform that can be expressed in closed form. A s an alternative w e may solve (4.6.3) directly using a digital com puter. Since (4.6.3) d oes not. in general, possess a unique solution, we assum e that the system and its inverse are causal. Then (4.6.3) sim plifies to the equation h(k)hi(rt — k) — S(/i) ^ (4.6.7) By assum ption, h/ ( n) = 0 for n < 0. For n = 0 we obtain h,(0 ) = l / h ( 0 ) (4.6.8) T he values o f hi {n) for n > 1 can be ob tain ed recursively from the equation ^ h(k)h/(n-k) = ~£ mo) — , n21 This recursive relation can easily be program m ed on a digital com puter. ( A -6 ) Sec. 4.6 359 Inverse Systems and Deconvolution T here are two problem s associated with (4.6.9). First, the m ethod d oes not work if h(0) = 0. H ow ever, this problem can easily be rem ed ied by introducing an appropriate delay in the right-hand side o f (4.6.7), that is, by replacing <50) by S(n — m) , where m = 1 if *(0) = 0 and /i( l) ^ 0, and so on. Second, the recursion in (4.6.9) gives rise to rou n d -off errors which grow with n and, as a result, the num erical accuracy o f h(n) d eteriorates for large n. Example 4.6.3 D eterm ine the causal inverse of the FIR system with impulse response h(n) = S(n) — aS(n — 1) Solution Since /i(0) = 1. h(1) = —a, and h(n) = 0 for n > a , we have MO) = 1/MO) = 1 and h/(n) = a M n _ 1 ) n —1 Consequently, M l) = a . M 2) = a 2.......... h,(n) =a" which corresponds to a causal IIR system as expected, 4.6.2 Minimum-Phase, Maximum-Phase, and Mixed-Phase Systems T h e invertibility o f a linear tim e-invariant system is intim ately related to the char­ acteristics o f the phase spectral function o f the system . T o illustrate this point, let us consider tw o FIR system s, characterized by the system functions H\ {z) = 1 + j ; -1 = z_1(z + \ ) (4.6.10) Hj i z ) = (4,6.11) — z ! ( |z + 1) The system in (4.6.10) has a zero at z = and an im pulse response fc(0) = 1, /i(l) = 1/2. T h e system in (4.6.11) has a zero at z = —2 and an im pulse response h(0) = 1/2, /i(1) = 1, which is the reverse of the system in (4.6.10). This is due to the reciprocal relationship b etw een the zeros o f H\ ( z) and In the frequency dom ain, the tw o system s are characterized by their fre­ quency response functions, which can be expressed as |ffi(<y)| = |H 2(o))! = y | + cos to (4.6.12) , sin w -j------------| + cos OJ (4.6.13) _i sin to ------------2 + cos to (4.6.14) and ©i((w) = —to + tan © 2 (cl>) = —to + tan The m agnitude characteristics for the tw o system s are identical becau se the zeros o f Hi ( z ) and Hi ( z ) are reciprocals. 360 Frequency Analysis of Signals and Systems Chap. 4 fr|I co) 94a.) i (b) Figure 4.64 Phase response charactcnslics for the systems in (4.6.10) and (4.6.11). The graphs o f 0 ] (co) and (~)2 (cv) are illustrated in Fig. 4.64. W e observe that the phase characteristic 0i(cd ) for the first system begin s at zero phase at the fre­ quency w = 0 and term inates at zero phase at the frequency cv — 7t. H en ce the net phase change, 0 i( ;r ) - 0i(O ) is zero. On the other hand, the p h ase characteristic for the system with the zero outside the unit circle undergoes a n et phase change 0 ;(;r ) — ©2(0) = n radians. A s a con seq u en ce o f these different p h ase character­ istics, w e call the first system a m i n i mu m - p h a s e s y s t e m and the secon d system is called a m a x i mu m - p h a s e system. Th ese definitions are easily exten d ed to an F IR system o f arbitrary length. T o be specific, an F IR system o f length M + 1 has M zeros. Its frequency response can be expressed as H(co) = bQ(\ - z \ e ~ iw)( 1 - z 2e ~ n • • ■ ( ! - z Me ~ J“) (4.6.15) where {;,} d en ote the zeros and bo is an arbitrary constant. W h en all the zeros are inside the unit circle, each term in the product o f (4.6.15), corresponding to a real-valued zero, will undergo a net phase change o f zero b etw een a> = 0 and (*) = n . A lso , each pair of com p lex- conjugate factors in H(a>) will undergo a net phase change o f zero. T herefore, ^ H ( n ) - ^H(O) = 0 (4.6.16) and h en ce the system is called a m inim um -phase system . O n the o th er hand, when all the zeros are outside the unit circle, a real-valued zero will con trib ute a net Sec. 4.6 361 Inverse Systems and Deconvolution phase change o f tt radians as the frequency varies from w = 0 to co — it. and each pair o f com p lex-con ju gate zeros will contribute a net phase change of 2 tt radians over the sam e range o f ai. T herefore. iL H ( jt ) - ^ H ( O ) = M tt (4.6.17} which is the largest possible phase change for an FIR system with M zeros. H ence the svstem is called m axim um phase. It follow s from the discussion above that 4- Hmax{7T) > 4 tf m,n(jr) (4.6.18) If the FIR system with M zeros has som e o f its zeros inside the unit circlc and the rem aining zeros ou tsid e the unit circle, it is called a mi x e d - p h a s e system or a n o n m i n i m u m - p h a s e syst em. Since the derivative o f the phase characteristic o f the system is a m easure of the tim e d elay that signal frequency com p onents undergo in passing through the system , a m inim um -phase characteristic im plies a m inim um delay function, while a m axim um -phase characteristic im plies that the delay characteristic is also m axim um . N ow suppose that we have an FIR system with real coefficients. .Then the m agnitude square value of its frequency response is |t f ( w ) |: = )|r^ ,- (4.6.19) This relationship im plies that if we replace a zero o f the system by its inverse 1 /zk- the m agnitude characteristic o f the system d oes not change. Thus if we re­ flect a zero zt that is inside the unit circle into a zero I/:* ou tsid e the unit circle, we se e that the m agnitude characteristic o f the frequency response is invariant to such a change. It is apparent from this discussion that if \ H ( c o ) \ 2 is the m agnitude square frequency resp onse o f an F IR system having M zeros, there are 2 M possible con ­ figurations for the M zeros, som e of which are inside the unit circle and the re­ m aining are ou tsid e the unit circle. Clearly, one configuration has all the zeros inside the unit circle, which corresponds to the m inim um -phase system . A sec­ ond configuration has all the zeros outside the unit circle, which corresponds to the m axim um -phase system . T h e rem aining 2 W — 2 configurations correspond to m ixed-phase system s. H ow ever, not all 2 M - 2 m ixed-phase configurations n ec­ essarily correspond to F IR system s with real-valued coefficients. Specifically, any pair o f com p lex-con ju gate zeros result in on ly two possib le configurations, w hereas a pair o f real-valued zeros yield four possib le configurations. Example 4.6.4 D eterm ine the zeros for the following FIR systems and indicate whether the system is minimum phase, maximum phase, or mixed phase. tf,(z) = 6 + z_1 - z~2 H 2{ z ) = 1 - r 1 - 6 ;" 2 362 Frequency Analysis of Signals and Systems Chap. 4 H:Az) = 1 - ^c"1 - $z~z HAZ) = Solution 1+ f r ' - By factoring the system functions we find the zeros for the four systems are H]{z) — *■ Ci.: = —*■ { — *■ minimum phase H 2 (z ) -— » ci,: = - 2 , 3 — ► maximum phase H:,(z) — *■ ci.: = - J. 3 — * mixed phase Hi\z) — *■Ci.: = —2, t — *• mixed phase Since the zeros of the fouT systems are reciprocals of one another, it follows that all four systems have identical m agnitude frequency response characteristics but different phase characteristics. The m inim um -phase property o f F I R system s carries over to I I R system s that have rational system functions. Specifically, an I I R system with system function B(z) H( z ) = — (4.6.20) A (c ) is called m i n i m u m p h a s e if all its poles and zeros are inside the unit circle. For a stable and causal system [all roots of A (c) fall inside the unit circle] the system is called m a x i m u m pha s e if all the zeros are outside the unit circle, and m i x e d phase if som e, but not all. o f the zeros are ou tsid e the unit circle. This discussion brings us to an im portant point that should be em phasized. That is. a stable p o le-zero system that is m inim um phase has a stab le inverse which is also minim um phase. The inverse system has the system function = d(z) (4 -6 -21) H en ce the m inim um -phase property of H ( z ) ensures the stability o f the inverse system H ~ l (z) and the stability o f H( z ) im plies the m inim um -phase property of H ~ \ z ) . M ixed-phase system s and m axim um -phase system s result in unstable in­ verse system s. D ecom p osition of n on m in im u m -p h ase p o le -z e r o sy stem s. Any nonm inim um -phase p o le -z e r o system can be expressed as « (z) = /W z)tfa p (z) (4.6.22) w here is a m inim um -phase system and / / ap(z) is an all-pass system . We dem onstrate the validity o f this assertion for the class o f causal and stable systems w-ith a rational system function H ( z ) = B ( z ) / A ( z ) . In general, if B(z) has one or m ore roots ou tsid e the unit circle, w e factor B(z) in to the product B i( z ) # 2 (z)> w here B i(z) has all its roots inside the unit circle and B 2(z) has all its roots outside Sec. 4.6 Inverse Systems and Deconvolution the unit circle. T h en m inim um -phase system 363 has all its roots inside the unit circle. W e define the B i i - J B j i z - 1) Mz) and the all-pass system Hw (z) = Biiz) B 2(z - 1) Thus H ( z ) — Fiminiz)Hap(z)■ N ote that / / ap(z) is a stable, all-pass, m axim um -phase system . Group delay of nonminimum-phase system. B ased on the d ecom p osi­ tion o f a nonm inim um -phase system given by (4.6.22), w e can express the group delay o f H( z ) as Tg(o>) = r™in(co) + ^apM (4,6.23) Since r “r (u>) > 0 for 0 < to < n , it follow s that 1 ^( 0;) > r™n(o;), 0 < a>< tt. From (4.6.23) w e co n clu d e that am ong all p o le -z e r o system s having the sam e m agnitude response, the m inim um -phase system has the sm allest group delay. Partial energy o f nonminimum-phase system. T he partial energy o f a causal system with im pulse response h(n) is defined as £Cn) = £ W * ) I 2 t=u (4.6.24) It can be show n that am ong all system s having the sam e m agnitude response and the sam e total en ergy £ ( 0 0 ), the m inim um -phase system has the largest partial energy [i.e., E min(n) > E( n) , where Emj„(n) is the partial energy o f the m inim um phase system ]. 4.6.3 System Identification and Deconvolution Suppose that w e excite an unknow n linear tim e-invariant system with an input se ­ quen ce x ( n ) and w e observe the output seq u en ce y( n). From the output sequ en ce w e wish to determ ine the im pulse resp onse o f the unknow n system . This is a prob­ lem in s y s t em identification, which can be solved by deconvol ut i on. Thus w e have y(n) = h( n) * *(n) ^ (4-6.25) h( k ) x ( n — k) = k=—oo A n analytical solution o f the d econ volu tion problem can b e obtained by w orking with the z-transform o f (4.6.25). In the z-transform dom ain w e have Y( z ) = H( z ) X( z ) 364 Frequency Analysis of Signals and Systems Chap, 4 an d h en ce K(;) HrJ = - — * (;) (4.6.26) X u ) and are th e ^ -tra n sfo rm s of the av ailab le in p u t signal x(/;) a n d the o b se rv e d o u tp u t signal yi n) , resp ectiv ely . T his a p p ro a c h is a p p r o p ria te only w hen th e re are clo sed -fo rm ex p ressio n s fo r X ( z ) an d F (c). Example 4.6.5 A causal system produces the output sequence n=0 n= 1 otherwise f 1. yin) = | . I 0. when excited by the input sequence n= 0 (1 . x(n) = i H i' I 0, otherwise Determ ine its impulse response and its input-outpul equation. Solution The system function is easily determ ined by taking the .--transforms of ,v(n) and yin). Thus we have no H( z ) = —----- = — — 1 + 77,:" 1 - 17i- -------:----- 7 + i7>"~ 1-r (1 - )(1 - Since the system is causal, its ROC is |;| > i. The system is also stable since its poles lie inside the unit circle. The input-output difference equation for the system is y i n ) = -jj;y(/i - 1 ) - ^ y i n - 2 ) + ,r(«) + y^.v(n - 1 ) Its impulse response is determined by performing a partial-fraction expansion of H(z) and inverse transforming the result. This com putation yields hin) = [4(i)" - 3({ )n]u(n) W e observe that (4.6.26) d eterm in es the unknow n system uniquely if it is known that the system is causal. H ow ever, the exam ple above is artificial, since the system response {>(«)} is very likely to be infinite in duration. C onsequently, this approach is usually im practical. A s an alternative, we can deal directly with the tim e-dom ain expression given by (4.6.25). If the system is causal, w e have n y( n) = ^ h{ k) x( n — k) n> 0 *=o Sec. 4.6 365 Inverse Systems and Deconvolution and h ence n-l y { n ) - Hn) = (4.6.27) - y ~ ^ h ( k ) x ( n k ) n > x(0) 1 This recursive solu tion requires that jr(0) ^ 0. H ow ever, we n ote again that w hen (/i(n)) has infinite duration, this approach m ay not be practical unless w e truncate the recursive solu tion at sam e stage [i.e., truncate {/z(«)}]. A n o th er m eth od for identifying an unknow n system is b ased on a crosscor­ relation technique. R ecall that the in p ut-ou tp u t crosscorrelation function derived in Section 2.6.5 is given as oc r y x ( r 77) = ^ h ( k ) r ( X ( m - = k ) h ( n ) * r x ! ( m ) (4.6.28) t=0 where r y x ( m ) is the crosscorrelation seq u en ce o f the input {x(^)J to the system with the output {>’(«)} o f the system , and r x x { m ) is the autocorrelation sequ en ce o f the input signal. In the frequency dom ain, the corresponding relationship is S vx((d) = J-!(io)S.fX (co) = H ( c o ) \X (u >)\2 H en ce Svi(a>) H ( w ) = — ---------- = SX i ( w ) 5 Vj(w ) - 1 - — r \ X ( a >)\2 (4.6.29) T h ese relation s suggest that the im pulse response (/?(k)1 or the frequency re­ sp on se o f an unknow n system can be determ ined (m easu red ) by crosscorrelating the input seq u en ce {*(«)} with the output seq u en ce (y(n)}, and then solvin g the d econ volu tion problem in (4.6.28) by m eans o f the recursive eq u ation in (4.6,27). A ltern atively, w e cou ld sim ply com pute the Fourier transform o f (4.6.28) and d e ­ term ine the freq u en cy response given by (4.6.29). Furtherm ore, if w e select the input seq u en ce (jc(n)} such that its autocorrelation seq u en ce { ^ ( n ) } , is a unit sam ­ ple seq u en ce, or eq u ivalen tly, that its spectrum is flat (con stan t) over the passband o f H(a>), the valu es o f the im pulse resp onse {/?(«)} are sim ply equal to the values o f the crosscorrelation seq u en ce {rVJ(«)}. In general, the crosscorrelation m eth od described above is an effective and practical m eth od for system identification. A n oth er practical approach based on least-squares optim ization is described in C hapter 8. 4.6.4 Homomorphic Deconvolution T h e com p lex cepstrum , introduced in Section 4.2.7, is a useful to o l for perform ing d econ volu tion in so m e applications such as seism ic signal processing. T o describe this m eth od , let us su p p ose that {>>(«)} is the output seq u en ce o f a linear timeinvariant system w hich is excited by the input seq u en ce (x(n )f. Then Y( z) = X{ z ) H( z ) (4.6.30) 366 Frequency Analysis of Signals and Systems Chap. 4 w here H( z ) is the system function. T h e logarithm o f Y ( z ) is C A z ) = In Y (c) = in X (c) + In H( z ) (4.6.31) = C ,(c) + C>,U) C onsequently, the com plex cepstrum o f the output sequence (y(n)} is expressed as the sum o f the cepstrum o f |x(n )} and {/i(n)J, that is, c y( n) = cx (n) + ch(n) (4.6.32) Thus w e observe that con volu tion of the tw o seq u en ces in the tim e dom ain corre­ sponds to the sum m ation o f the cepstrum seq u en ces in the cepstral dom ain. The system for perform ing these transform ations is called a h o m o r m o r p h i c sy s t em and is illustrated in Fig. 4.65. In som e applications, such as seism ic signal processing and speech signal processing, the characteristics of the cepstral sequ en ces (c,(/j)} and {c>(n)} are suf­ ficiently different so that they can be separated in the cepstral dom ain. Specifically, suppose that {c* (/?)} has its main com p on en ts (m ain energy) in th e vicinity o f small values o f n, w hereas |c r(n)} has its com p on en ts concentrated at large values of n. W e m ay say that |c„(n)} is “lowpass" and {cx(«)l is “highpass.” W e can then sepa­ rate {cy,(n)} from {c,(r;)) using appropriate “low p ass” and “h igh pass” w indow s, as illustrated in Fig. 4.66. Thus ch(n) = c v(rt)wir (rr) (4.6.33) cx (n) = c_v(n )Whp(n) (4.6.34) and z-Transform logarithm c j.) ;-iransform Figure 4.65 Homomorphic system for obtaining the cepstrum (cv(n)} of the se­ quence (y(n)l- F igure 4.66 S ep aratin g th e two cepstral com ponents by “low pass" and “ highpass” windows. Sec. 4.7 367 Summary and References w here U ’) p ( J l) = 1. 0. < N, otherw ise (4.6.35) 0, l«l < N\ \n\ > (4.6.36) U’hpO) = 1.1 O nce w e have separated the cepstrum sequ en ces ( o ,( « ) } and (c,-(n)} by w indow ing, the seq u en ces {x(n)} and {/i(n)( are obtained b y p a ssin g (o ,(» )| and (c.v(n)) through the inverse hom om orphic system , shown in Fig. 4.67. In practice, a digital com puter w ould be used to com p ute the cepstrum o f the seq u en ce {v(«)}. to perform the w indow ing functions, and to im plem ent the inverse h om om orphic system shown in Fig. 4.67. In place o f the --transform and inverse z-transform . we w ould substitute a special form of the Fourier transform and its inverse. T his special form , called the discrete Fourier transform, is described in C hapter 5. C,<M) C,(.v) .--Transform XO Com plex exponential W(c) | .v(n) Inverse ■ "-rnmt l^nT> ( ir i /iijn . Figure 4.67 Inverse homomorphic system for recovering the sequences {.kii )| mid |/j(«)) from the corresponding cepstru. 4.7 SUMMARY AND REFERENCES T he Fourier series and the Fourier transform are the m athem atical tools lor an­ alyzing the characteristics o f signals in the frequency dom ain, T he Fourier series is appropriate for representing a periodic signal as a w eigh ted sum of harm oni­ cally related sinusoidal com p onents, w here the w eighting coefficients represent the strengths o f each o f the harm onics, and the m agnitude squared of each w eighting coefficient represents the pow er of the corresponding harm onic. A s we have in­ dicated, the Fourier series is on e o f m any possible orthogonal series expansions for a p eriodic signal. Its im portance stem s from the characteristic behavior o f LTI system s, as we shall see in Chapter 5. T h e Fourier transform is appropriate for representing the spectral charac­ teristics o f aperiodic signals with finite energy. T he im portant properties of the F ourier transform were also presented in this chapter. There are m any excellen t texts on Fourier series and Fourier transforms. F or reference, w e include the texts by B racew ell (1978), D avis (1963), Dvm and M cK ean (1972). and P apoulis (1962). In this chapter w e also considered the frequency-dom ain characteristics o f LTI system s. W e show ed that an LTI system is characterized in the frequency d om ain by its frequency response function H ( ai), w hich is the Fourier transform 368 Frequency Analysis of Signals and Systems Chap. 4 o f the im pulse response o f the system . W e also observed that the frequency response function d eterm ines the effect o f the system on any input signal. In fact, by transform ing the input signal into the frequency dom ain, w e ob served that it is a sim ple matter to determ ine the effect of the system on the signal and to determ ine the system output. W hen view ed in the frequency dom ain, an LTI system performs spectral shaping or spectral filtering on the input signal. The design o f som e sim ple IIR filters was also considered in this chapter from the view point o f p o le-zero placem ent. B y m eans o f this m eth od , we w ere able to design sim ple digital resonators, notch filters, com b filters, ail-pass filters, and digital sinusoidal generators. T h e design o f m ore com p lex IIR filters is treated in detail in Chapter 8. which also includes several references. D igital sinusoidal gen­ erators find use in frequency synthesis applications. A com p reh en sive treatm ent of frequency synthesis tech n iqu es is given in the text edited by G orski-P op iel (1975). Finally, w e characterized LTI system s as either m inim um -phase, maximumphase, or m ixed-phase, d ep en d ing on the p osition o f their p o les and zeros in the frequency dom ain. U sing these basic characteristics of LTI system s, w e considered practical problem s in inverse filtering, d econ volu tion , and system identification. W e concluded with the description o f a d econ volu tion m eth od based on cepstral analysis o f the output signal from a linear system . A vast am ount o f technical literature exists on the topics o f inverse filter­ ing. d econ volu tion , and system identification. In the context o f com m unications, svstem identification, and inverse filtering as they relate to channel equalization are treated in the book by Proakis (1995). D econ volu tion tech n iqu es are widely used in seism ic signal processing. For reference, w e suggest the papers by W ood and Treitel (1975), P eacock and T reitel (1969), and the b ook s by R obinson and Treitel (1978, 1980). H om om orphic d econ volu tion and its ap p lication s to speech processing is treated in the book by O p p en heim and Schafer (1989). PROBLEMS 4.1 Consider the full-wave rectified sinusoid in Fig. P4.1. (a ) Determine its spectrum X a(F). (b) Compute the power of the signal. Xa( ! ) Figure P4.1 Chap. 4 369 Problems (c) Plot the power spectral density. (d) Check the validity of Parseval's relation for this signal. 4.2 Com pute and sketch the m agnitude and phase spectra tor the following signals (a > 0). Ae~a' , i > 0 la) V- , ' , = '0 . ,< 0 (b) xu(t) = Ae~“'r 4.3 Consider the signal 1 - ^ l r |h . |r | < t ' 0. elsewhere (a) Determ ine and sketch its magnitude and phase spectra. |X „(F)| and 2^ X a(F), respectively. ( b) Create a periodic signal x,.(t) with fundam ental period Tr > 2r. so that ,v(/) = .v,,(n for |f| < T;,/2. What are the Fourier coefficients ci for the signal x;,u)? (c) Using the results in p an s (a) and (b). show that a = (1/X;,)X „(k/Tr ). 4.4 Consider the following periodic signal: xin) = { ..., I. (I. 1.2. 3.2. 1.0. I. . . ,| t (a) Sketch the signal vt/i) and its magnitude and phase spectra. ( b) Using the results in pari (a), verily Parseval's relation by computing the power in the time and frequency domains. 4.5 Consider the signal rr/i nn 1 3nn xin ) = 2 -f- 2 cos ------Hcos — h— c o s ----4 2 2 4 (a) Determ ine and sketch its power density spectrum. ( b) Evaluate the power of the signal. 4.6 Determ ine and sketch the magnitude and phase spectra of the following periodic signals. n(n - 2) (a) ,v<(t)=4sin 3 In . In (b) ,v(n) = cos — n + sin — n 3 ^ 2n . 2n (c) x(n) = cos — n sin — n (d) x( n) = { . . . , - 2 . - 1 . 0 . 1 . 2 . - 2 . - 1 . 0 . 1 . 2 . . . . ) t ( e) x i n ) = ( . . . . - 1 . 2 . 1. 2. - 1 . 0 . - 1 . 2 . 1 . 2 . . . . J (f) x (n) = ( . . . . 0 , 0 . 1 . 1 . 0 . 0 . 0 . 1. 1 . 0 . 0 , . . . ) t (g) x i n) = 1 . —oc < n < oc ( h) x(n) = ( - 1 ) " . - o c < n < oc 4.7 D eterm ine the periodic signals * 0 ), with fundam ental period N = 8. if their Fourier coefficients are given by: kn 3kn 370 Frequency Analysis of Signals and Systems Chap. 4 kn (b) c * = { Slny - Q < k <6 k= 7 0, (c) {c*} = { . . . . O . i . i . l . 2 . 1 . i , i . O . t 4.8 Two DT signals. j*(«) and s{(n), are said to be orthogonal over an interval [N\, A^] if k =t Y2st ( n) s ?( n) = j 0 *' k / I If At = 1. the signals are called orthonorm al, (a) Prove the relation N ' ej2*kn/* = ' N, 0. k = 0, ±jV, ±2N, otherwise (b) Illustrate the validity of the relation in part (a) by plotting for every value of k ~ 1 ,2 ........ 6. the signals st (n) = eJI2,,/('}k" , n = 0, 1 ,___ 5. [Aro/e: For a given k, n the signal can be represented as a vector in the complex plane.] (c) Show that the harmonically related signals i*(n) = ejan,K'kB are orthogonal over any interval of length N. 4.9 Compute the Fourier transform of the following signals. (a) x(n) = u(n) —u(n —6) (b) x(n) = 2"u{-n) (c) x(n) = (j)"u(n + 4) (d) x(n) = (a" sin a>on)u(n) |a | < 1 (e) x(n) = laTsiniuiin jar| < 1 (f) x(n) = 2 -U )n . 0, |«| 5 4 elsewhere (g) xin) = { - 2 . - 1 . 0. 1 . 2 ) t \ n\ <M ^ . U (2 A / + l - | n | ) . (h) x(n) = | 0. . . |n| > M Sketch the magnitude and phase spectra for parts fa), (f), and (g). 4.10 D eterm ine the signals having the following Fourier transforms. 0, 0 < \a>| < <U() (a) X(a>) = , I. W() < \a>\ < 7T (b) X (u>) = cos2 a> (n\ Yt \ - \ O* - &i»/2 < M < O*) + to /2 W 1 0, elsewhere (d) The signal shown in Fig. P4.10. 4 .11 Consider the signal x{n) = {1 , 0,- 1 ,2 .3 } t Chap. 4 371 Problems Xitu) 3tt jt 0 7r 3n 6 jt 7tt tt Figure P4.10 with Fourier transform Xtw) = X's (ct>) + j ( X t (a>)). D eterm ine and sketch the signal y(n) with Fourier transform Y(w) = X,(o>) + X R( ^) ei2,il 4.12 Determ ine the signal jc(h ) if its Fourier transform is as given in Fig. P4.12. 8k 10 0 (a) X(ai) (b) X(u>) (c ) Figure P4.12 8rr 971 10 To 7T 372 Frequency Analysis of Signals and Systems Chap. 4 4.13 In Example 4.3.3. the Fourier transform of the signal -M < n < M otherwise 1, 0. x (n) = was shown to be M X (a>) = 1 + 2 2 2 cos am f!=1 Show that the Fourier transform of X|(n) = 1. 0. 0< n <M otherwise and x 2(n) = 1. 0, —M < n < —1 otherwise are, respectively. ] _ I Xi(a>) = X 2{to) = Thus prove that X (to) -— X 1 (tt>) + X 2 (tt)} sin(M + \) w sintw /2) and therefore. coswn = sin(M + \ ) w sin(a»/2 j 4.14 Consider the signal x(n) = ( - 1 ,2 , - 3 ,2 , -1} t with Fourier transform X((u). Compute the following quantities, without explicitly computing X(a>): (a) X(0) (b) AX(co) (c) f * n X(w) dw (d) X (jt) (e) f *JX( co ) \ 2 dco 4.15 The center of gravity of a signal x(w) is defined as T , nx(n) yx(n) 7I = —OC and provides a measure of the “time delay” of the signal. Chap. 4 373 Problems Xui» 2 Figure P4.15 2 (a) Express c in terms of X{<o). (b) Compute c for the signal x(n) whose Fourier transform is shown in Fig. P4.15. 4.16 Consider the Fourier transform pair a"u(n) |ti) < 1 -----------1 — at’ Use the differentiation in frequency theorem and induction to show that < « + /-!> ! i 1 _v(/i) = --------------- a ‘u(n} -— * \ Uo) — ----------------/i!(f-l)! (1 - f 4.17 Let vUil he an arbitrary signal, not necessarily real-valued, with Fourier transform Express the Fourier transforms of the following signals in terms of X(a>). (a) _v‘ i«) (h) x ' ( - n ) (f) yin) = vf/1 ) - ,v(/; - 1 ) (d) v(fi I = ' y xik i (L‘) V|H)=.V(2«) _ I x(n/2). n even (0 v(n) = L ,. ( 0. n odd 4.18 Determ ine and sketch the Fourier transforms Xiiw), X 2(co). and Xi(a>) of the following signals. (a) -V!(fi) = (1. 1. 1. 1.1) (b) x2(n) = ( 1. 0. 1 . 0. 1 , 0. 1 . 0, 1 ) (c) x:j n ) = (1 . 0. 0. 1 . 0. 0. 1 . 0. 0, 1 , 0. 0. 1 ) t (d) Is there any relation between Xi(w). X:(g;). and X3(w)? What is its physical meaning? (e) Show that if **(«) = then | , ( r ). if n j k integer 0. otherwise Xt(a>) = X (ka>) 4.19 Let x(n) be a signal with Fourier transform as shown in Fig. P4.19. D eterm ine and sketch the Fourier transform s of the following signals. Frequency Analysis of Signals and Systems 374 2 Chap. 4 Figure P4.19 2 (b ) A;(n) = x(n) sin(jrn/2) (d) a4(/7) = x(n) cos nn (a ) jri(fl) = jr(n) cos(;rn/4) (c) xy(n) = x( n)cos(nn/2) Note that these signal sequences are obtained by amplitude modulation of a carrier co swrn or sinw,,/! by the sequence x(n). 4.20 Consider an aperiodic signal *(n) with Fourier transform X(u>). Show that the Fourier series coefficients CA ' of the periodic signal are eiven bv c; I . N — k N k = 0. 1........A '- l 4.21 Prove that X v (w ) — ^ ' £—' n=~ N sin w,n nn may be expressed as X v (o j ) 1 = ^ r ° ‘ sinf(2A^ + 1 ){w — 8f lj \ db - 0)/2\ .L , 4.22 A signal jfn ) has the following Fourier transform: 1 X (oj) = --------------- 1 - ae~JW Determine the Fourier transforms of the following signals: (b) e*nf2x(n + 2 ) (b) x { —2n) (d) x(n) cos(0.37rn) (c) jt(«) * x(n —1 ) (0 x(n) * x (—n) 4.23 From a discrete-time signal x ( n ) with Fourier transform X(cv), shown in Fig. P4.23, determine and sketch the Fourier transform of the following signals: , „ 1 x(n). n even ( a )v i( n ) = I 0, n odd (b) yiiri) - x(2n) [ x( nj 2 ). n even (c) y,(«) = „ ,, I 0, n odd Note that vj (n) = x(n)s(n), where s(n) = {... 0, 1. 0, 1. 0. 1. 0. 1. ...} t (a) x(2n + \ ) Chap. 4 Problems 375 Xlw) ai Figure P4.23 4 4 4.24 The following inpul-output pairs have been observed during the operation of various svstems: (C) .t(H) — C‘ ‘ --- *• V(IJ) = _V' " ' ■ a s , (d) .v(u) = e n ■u(ii) — ►yin) — j r ' " 7* (e) ,v(/i» = ,v(/i + Ar’i ) —— vin) = yin 4- N21 A', A;. A't. N2 prime Determ ine their frequency response if each of the above systems is LTI. 4.25 (a) D eterm ine and sketch the Fourier transform W/ffw) of the rectangular sequence [I. 1 0. (I < n < M otherwise (b) Consider the triangular sequence ( ) < / i < M/2 Mj2 < 2 < M otherwise Determ ine and sketch the Fourier transform Wr (a)) of u'70)) by expressing it as the convolution of a rectangular sequence with itself. (c) Consider the sequence «■, in) = ^ (l -t- cos ^f-) u'R{n) Determ ine and skctch Wricu) by using 4.26 Consider an LTI system with impulse response h i n ) = u(n). (a) Determ ine and skctch the magnitude and phase response \H(co)\ and respectively. (b) D eterm ine and sketch the magnitude and phase spectra for the input and output signals for the following inputs: (2) jr(n) = ( . . . . 1.0.0. 1. 1. 1.0. 1. 1. 1,0, 1. ...} r 4.27 D eterm ine and sketch the magnitude and phase response of the following systems: (a) y(n) = ^[.v(/i) + xin - 1 )] (b) yfn) = 4[v(/i) - xin - 1 )] (c) v(n) = + 1) - x(n - 1)] 376 Frequency Analysis of Signals and Systems (d) y(n) = Chap. 4 + 1 ) + x(n - 1 )] (e) v (n )= i[jr(rt) + jc(/t - 2 ) ] (f) y(n) = - x(n - 2 )] (g) v(n) = j[jr(n) + x(n - 1 ) + x{n - 2 )] (h) y(n) = x(n) — x(n — 8) (i) y(n) = 2x(n —1 ) —x(n — 2 ) (j) v(n) = + x(n - 1) + x(n - 2) + x(« - 3)] (k) y(«) = + 3x(n - 1) + 3x(n - 2) + x(n - 3)] (I) y(n) = x(n - 4) (m) y(n) = x(n + 4) (n) y(n) = j[x(n) - 2x(n - 1 ) + xin - 2 )] 4.28 An FIR filter is described by the difference equation y(n) = x(n) + xin - 10) (a) Compute and sketch its magnitude and phase response. (b) Determ ine its response to the inputs „ TT . / TT IT ' (1) x(n) = cos — n + 3sm \ ^- n + — ^ (2 ) jr(n) = 10 + 5 cos ( ^ - n + y —oc < n < oc —OO < < oc 4.29 D eterm ine the transient and steadv-statc responses of the FIR filler shown in Fig. P4.29 to the input signal A(n) = 10ejr"',~uin). Let b = 2 and v ( - l ) = v (-2 ) = v(—3) = v(—4) = 0. Figure P4.29 4.30 Consider the FIR filter v(n) = x ( n ) + x ( n - 4) (a) Compute and sketch its m agnitude and phase response. (b) Compute its response to the input x (n) = cos —n + cos —n 2 4 —oc < n < oc (c) Explain the results obtained in part (b) in terms of the m agnitude and phase responses obtained in part (a). 4.31 Determ ine the steady-state and transient responses of the system y(n) = j [•*(«) — x ( n - 2)] Chap. 4 377 Problems to the input signal x(n) = 5 + 3 cos — oo < n < oc + 60“^ 4.32 From our discussions it is apparent that an LTI system cannot produce frequencies at its output that are different from those applied in its input. Thus, if a system creates “new" frequencies, it must be nonlinear and/or time varying. D eterm ine the frequency content of the outputs of the following systems to the input signal 4 (a) v (/i) = .v(2n) (b) y(n) = x 2(n) <c) y(n) = (cos nn)x(n) 4.33 D eterm ine and sketch the m agnitude and phase response of the systems shown in Fig. P4.33(a) through (c). (a) (b) 8 —l (c) Figure P4J3 4.34 Determ ine the magnitude and phase response of the m ultipath channel y( n) = x (n) + xfn —M) A t what frequencies does H(co) = 0? 4.35 Consider the filter v(«) = 0.9v(n - 1) + bx(n) (a) D eterm ine b so that |H (0)| = 1. (b) D eterm ine the frequency at which j/ / (cu)| = l/%/2. 378 Frequency Analysis of Signals and Systems Chap. 4 (c) Is this filter lowpass, bandpass, or highpass? (d) Repeat parts (b) and (c) for the filter v(n) = —0.9y(n - 1) + O.l.r(n). 4.36* Harmonic distortion in digital sinusoidal generators An ideal sinusoidal generator produces the signal x(n) = cos 2nf)n — oc < n < cc which is periodic with fundam ental period N if /<i = ki,/N and ky, N are relatively prime numbers. The spectrum of such a “pure" sinusoid consist of two lines at k = ko and k = N — ka (we limit ourselves in the fundam ental interval 0 < k < N - 1). In practice, the approximations made in com puting the samples of a sinusoid of relative frequency f t result in a certain am ount of power falling into other frequencies. This spurious power results in distortion, which is referred to as harmonic distortion. Harmonic distortion is usually m easured in terms of the total harmonic distortion (TH D), which is defined as the ratio THD = spurious harmonic power total power (a) Show that iQn t2 T H D == 1 - 2 —— P, where *-j n = (I (b) By using the Taylor approximation COS 0 = 1 -------- ---------— 2! 4! 6! compute one period of jr(n) for / 0 = 1/96, 1/32, 1/256 by increasing the number of terms in the Taylor expansion from 2 to 8. (c) Compute the THD and plot the power density spectrum for each sinusoid in part (b) as well as for the sinusoids obtained using the com puter cosine function. Comment on the results. 4.37* Measurement o f the total harmonic distortion in quantized sinusoids Let x(n) be a periodic sinusoidal signal with frequency fo = k / N , that is, x(n) = sin 2jr/on (a) Write a computer program that quantizes the signal x(n) into b bits or equivalently into L = 2h levels by using rounding. The resulting signal is denoted by xq(n). (b) For f a = 1/50 compute the THD of the quantized signals xq(n) obtained by using b = 4, 6, 8, and 16 bits. (c) Repeat part (b) for /« = 1/100. (d) Comment on the results obtained in parts (b) and (c). 438* Consider the discrete-time system y(n) = ay(n — 1 ) + (1 —a)x(n) where a — 0.9 and y(—1) = 0. n > 0 Chap. 4 379 Problems (a) Compute and sketch the output y, (n) of the system to the input signals .v ,(n ) = s in 2 jT /,n 0 £ ft < 100 where / , = ./? = (b) Compute and sketch the magnitude and phase response of the system and use these results to explain the response of the system to the signals given in part (a). 4.39* Consider an LTI system with impulse response h{n) = ( t )1"1 (a) Determ ine and sketch the magnitude and phase response Hi m) and respectively. (b) D eterm ine and sketch the magnitude and phase spectra for the input and output signals for the following inputs: 3,t ii ( 1 ) .v(n ) = cos — . —rc < n < cc (2) .xin) = (....-1, 1. - 1 . 1 . - 1 . 1 . - 1 . 1 . - I . 1, - 1 . 1...-I T 4.40* Time-domain sampling (a) (b) (c) (d) (e) Consider the continuous-time signal Compute analytically the spectrum X„(F) of a „ U ) Compute analytically the spectrum of the signal a (/?> = x„{nT). T = 1 /F ,. Plot the magnitude spectrum |X „(F)| for Ft, = K) Hz. Plot the magnitude spectrum (X(F)I for F, = 10. 20, 40. and 100 Hz. Explain the results obtained in part (d) in terms ol the aliasing effect. 4.41 Consider (he digital filter shown in Fig. P4.41. (a) Determ ine the input-output relation and the impulse response h(n). (b) Determ ine and sketch the magnitude ]W(w)| and the phase response 2^ H ( a » of the filter and find which frequencies are completely blocked by the filter. (c) When w,, = t / 2 , determ ine the output yin) to the input .v(n) = 3 cos + 30 ^ 1 ---- —( + y(n> -*—— u - - 2 cos aif, — cc < n < oc Figure P4.41 4.42 Consider the FIR filter y(n) = xin) - xin - 4 ) (a) Compute and sketch its m agnitude and phase response. (b) Com pute its response to the input n n x ( n ) = cos —n + cos —n — c c < n < oc 2 4 Frequency Analysts of Signals and Systems 380 Chap. 4 (c) Explain the results obtained in part (b) in terms of the answer given in part (a). 4.43 Determ ine the steady-state response of the system y(n) = i[.v(n) - x(n - 2 )] to the input signal —oc < n < oc 4.44 Recall from Problem 4.32 that an LTI system cannot produce frequencies at its output that are different from those applied in its input. Thus if a system creates “new” frequencies, it must be nonlinear and/or time varying. Indicate w hether the following systems are nonlinear and/or time varying and determ ine the output spectra when the input spectrum is (a) _v(n) = j:(2nt (b) y ( « ) = x : (n) (c) v(n) = (cos nn)xin) 4.45 Consider an LTI svstem with impulse response (a) Determ ine its system function H(z). (b) Is it possible to implement this system using a finite number of adders, multipliers, and unit delays? If yes. how? (c) Provide a rough sketch of \ H(w)| using the pole-zero plot. (d) Determine the response of the system to the input x(n) = ( 4.46 An FIR filter is described by the difference equation yin) = x(n) — xin — 10) (a) Compute and sketch its m agnitude and phase response. (b) Determ ine its response to the inputs —oc < n < oc — oc < n < oc4.47 The frequency response of an ideal bandpass filter is given by Chap. 4 381 Problems (a) D eterm ine its impulse response (b) Show that this impulse response can be expressed as the product of cos(n7t / 4) and the impulse response of a lowpass filter. 4.48 Consider the system described by the difference equation v(n) = jy(n — I ) + .r(n) 4- |.r(n - 1 > (a) D eterm ine its impulse response. (b) D eterm ine its frequency response: (1) From the impulse response (2) From the difference equation (c) D eterm ine its response to the input I TT x {n > = cos y — r + .T \ j - oc < n < oc 4.49 Sketch roughly the m agnitude |A"u<>)! of the Fourier transforms corresponding to the pole-zero patterns given in Fig. P4.49. Figure P4.49 4.50 Design an F IR filter that completely blocks the frequency a*, = rr/4 and then compute its output if the input is x(n) = ^sin j u(n) for n = 0, 1 , 2, 3, 4. Does the filter fulfill your expectations? Explain. 382 Frequency Analysis of Signals and Systems Chap. 4 4.51 A digital filter is characterized by the following properties: (1) It is highpass and has one pole and one zero. (2) The pole is at a distance r = 0.9 from the origin of the ; -plane. (3) Constant signals do not pass through the system. (a) Plot the pole-zero pattern of the filtei and determ ine its system function H(z). (b) Compute the m agnitude response \H(cu}\ and the phase response ^ H( t n) of the filter, (c) Normalize the frequency response H( cd) so that = 1. (d) Determ ine the input-output relation (difference equation) of the filter in the time domain. (e) Compute the output of the system if the input is — ex: < n < oc (You can use either algebraic or geom etncal arguments.) 4.52 A causal first-order digital filter is described by the system function (a) Sketch the direct form I and direct form II realizations of this filter and find the corresponding difference equations. (b) For a = 0.5 and b — —0.6, sketch the pole-zero pattern, is the system stable? Why? (c) For a = —0.5 and b = 0.5, determ ine bu. so that the maximum value of \H(w)\ is equal to 1 . (d) Sketch the m agnitude response \H{co)\ and the phase response 2t//(o>) of the filter obtained in part (c). (e) In a specific application it is known that a — 0.8. Does the resulting filter amplify high frequencies or low frequencies in the input? Choose the value of b so as to improve the characteristics of this filter (i.e., m ake it a better lowpass or a better highpass filter). 4.53 Derive the expression for the resonant frequency of a two-pole filter with poles at Pi = r e ’6 and p 2 = p*x. given by (4.5.25). 4.54 Determ ine and sketch the magnitude and phase responses of the Hanning filter char­ acterized by the (moving average) difference equation y(n) ~ jx (n ) + \ x( n - 1 ) + j*(« - 2 ) 4.55 A causal LTI system excited by the input x(rt') = (j)"«(n) + u( —n - 1) produces an output v(n) with r-transform _ 3 „-l (a) D eterm ine the system function H(z) and its ROC. (b) Determ ine the output y(n) of the system. (Hint: Pole cancellation increases the original ROC.) Chap. 4 383 Problems 4.56 Determ ine the coefficients of a linear-phase FIR filter v(n) = b^x(n) + btx(n —1) + thx(n — 2) such that: (a) It rejects completely a frequency com ponent at a* = 2jt/3. (b) Its frequency response is normalized so that H{0) ~ 1. (c) Compute and sketch the magnitude and phase response of the filter to check if it satisfies the requirements. 4.57 D eterm ine the frequency response H(w) of the following moving average filters. -v(") = 2F t t X > - * ) 1 1 J (b) y(ff) = —r-x(n + Af) + — Y x(n - k) + ~r~rzx(n - M) AM 2M k=- M + i AM Which filter provides better smoothing? Why? 4.58 The convolution *(r) of two continuous-time signals *((/) and x2(t), from which at least one is nonperiodic, is defined by x(t) = X] (/) * xj(t) — j x\ {X)x2(t — k)dk (a) Show that X(F) = X\ ( F) X2(F), where X, (F) and X 2(F) are the spectra of *1 (r) and a:(/), respectively. = ( I' < X p' ■ 10. elsewhere (c) Determ ine the spectrum of x(t) using the results in part (a). <b> Com pute .r(r) if jrt(r) = 4.59 Com pute the magnitude and phase response of a filter with system function H(z) = l + c“ ‘ If the sampling frequency is F, = 1 kHz, determ ine the frequencies of the analog sinusoids that cannot pass through the filter. 4.60 A second-order system has a double pole at p li2 = 0.5 and two zeros at Z\.2 = e±s3*,A Using geom etric arguments, choose the gain G of the filter so that |tf(0 )| = 1. 4.61 In this problem we consider the effect of a single zero on the frequency response of a system. Let ; = re’9 be a zero inside the unit circle (r < 1). Then H,(w) = 1 —re]0e~iu> = 1 —r cos(a) —B) + j r sin(ti) —(?) (a) Show that the m agnitude response is \HZ((D)\ = [ 1 - 2 r cosito - 6 ) + r 2f n or, equivalently, 201og10 |//:(cd)| = 101og10[l —2r cos{ct> —6) + r2] 384 Frequency Analysis of Signals and Systems Chap. 4 (b) Show that the phase response is given as 0 : (ct>) = tan -i rsin(w - 8) ------------------1 - r cos(ct) - (c) Show that the group delay is given as r - rcos(w - 8) 1 + r1 — 2r COS(oj —■ (d) Plot the magnitude («)]dB. the phase ©( oj) and the group delay and 0 = 0, n j 2, and n. for r = 0.7 4.62 In this problem we consider the effect of a single pole on the frequency response of a system. Hence, we let «'•<»> = ' ■=1 Show that [Wr (a>)ljB = ~ |W-(fi))|dD 4 //„ (u > ) = - Z - H . ( c o ) where H:(<x>) and are defined in Problem 4.61. 4.63 In this problem we consider the effect of complex-conjugate pair of poles and zeros on the frequency response of a system. Let H.{u>) = (1 - reJ*'e~J'")(l - re~il'e~-"“) (a) Show that the magnitude response in decibels is | W - M | d B — 1 0 1 o g 1()[ l + - 2 r c o s ( o ) - # ) ] + 101og,„[l + r 2 - 2r cos(a) + 6)] (b) Show that the phase response is given as ®: (co) = tan ' rsinUo —8) l-r c o s (tu -# ) _■ Asin(w + fi) l- r c o s ( o > + 0) (c) Show that the group delay is given as r2 — r cos(o> — 8) r2 — r c o s ( c j + 8) = — — r— — — ------ — + 1 + r 2 - 2r cos(to — 9 ) 1 4- r2 - 2r cos(a> + (d) If Hp(w) = l / H : (a>), show that &p(w) - -© .(oj) Tg(a>) = (e) Plot ®p(ci>) and (w) for r = 0.9, and 8 — 0, jt/2. Chap. 4 385 Problems 4.64 D e te rm in e th e 3-dB b a n d w id th o f the filte rs (0 < a < 1) Which is a better lowpass filter? 4.65 Design a digital oscillator with adjustable phase, that is. a digital filter which produces the signal y(n) = cos(<W|,« + ft)u(n) 4.66 This problem provides another derivation of the structure for the coupled-form os­ cillator by considering the system y i n ) = av(ri — 1 ) 4 xi / i ) for a — e' “". Let xi/i) be real. Then yi n} is complex. Thus yin) = + ./'/(«) (a) Determ ine the equations describing a system with one input x i n) and the two outputs y t i U t ) and y f Ui ) . (b) Determ ine a block diagram realization (c) Show that if ,v(«) = bin), then y^in) = (cosw()'i ii/tn I y/ {ti) = (sin mull )u(n) (d) Compute ynin), \/in). n = 0. 1....... 9 for &j(, = tt/6. Compare these with the true values of the sine and cosine, 4.67 Consider a filter with system function (1 - 1 - H(Z) = h\ —--------:------j--- ;-------------- —r( 1 —reJU I"z )(1 —re~,w"z ) (a) Sketch the pole-zero pattern. <b) Using geom etric arguments, show that for r ^ 1, the system is a notch filter and provide a rough sketch of its m agnitude response if ttx> = 60 . (c) For (i>n = 60 , choose bo so that the maximum value of \Hia>)\ is 1. (d) Draw a direct form II realization of the system (e) D eterm ine the approximate 3-dB bandwidth of the system. 4.68* Design an FIR digital filter that will reject a very strong 60-Hz sinusoidal interference contaminating a 200-Hz useful sinusoidal signal. Determ ine the gain of the filter so that the useful signal does not change amplitude. The filter works at a sampling frequency F, = 500 samples/s. Compute the output of the filter if the input is a 60-Hz sinusoid or a 200-Hz sinusoid with unit amplitude. How does the perform ance of the filter compare with your requirem ents? 4.69 Determ ine the gain bo for the digital resonator described by (4.5.28) so that I//(«n) I = 1. 386 Frequency Analysis of Signals and Systems Chap. 4 4.70 D em onstrate that the difference equation given in (4.5.52) can be obtained by apply­ ing the trigonometric identity a + [i a — cos or + cos p = 2 cos —-— cos —-— where a — (n-t-Dwu, ~ (n — l)a>o, and v(n) = coswon. Thus show that the sinusoidal signal x(n) — A co sco^n can be generated from (4.5.52) by use of the initial conditions v(—1) = A cos an) and y (—2) = j4cos2a>o. 4.71 Use the trigonometric identity in (4.5.53) with a = na>o and (i = (n —2)a^t to derive the difference equation for generating the sinusoidal signal y(n) = A sin no*,. Determine the corresponding initial conditions. 4.72 Using the --transform pairs 8 and 9 in Table 3.3. determine the difference equations for the digital oscillators that have impulse responses h(n) = A cosna>it«(n) and h(n) = A sin ncDf>u(n), respectively. 4.73 Determ ine the structure for the coupled-form oscillator by combining the structure for the digital oscillators obtained in Problem 4.72. 4.74 Convert the highpass filter with system function H(z) = —az a < 1 into a notch filter that rejects the frequency a*, = tt/ 4 and its harmonics. (a) Determ ine the difference equation. (b) Sketch the pole-zero pattern. (c) Sketch the magnitude response for both filters. 4.75 Choose L and M for a lunar niter that must have narrow passbands at (k ± AF) cycles/dav. where k = i. 2, 3 ,... and A F = 0.067726. 4.76 (a) Show that the systems corresponding to the pole-zero patterns of Fig. 4.58 are all-pass. (b) What is the number of delays and multipliers required for the efficient implemen­ tation of a second-order all-pass system? 4.77 A digital notch filter is required to remove an undesirable 60-Hz hum associated with a power supply in an ECG recording application. The sampling frequency used is Fs = 500 samples/s. (a) Design a second-order FIR notch filter and (b) a secondorder pole-zero notch filter for this purpose. In both cases choose the gain by so that \H(w)\ = 1 for w = 0. 4.78 Determ ine the coefficients {/?(«)} of a highpass linear phase FIR filter of length M = 4 which has an antisymmetric unit sample response h{n) = —h(M - I - n) and a frequency response that satisfies the condition 4.79 In an attem pt to design a four-pole bandpass digital filter with desired magnitude response 0, elsewhere Chap. 4 Problems 387 we select the four poles at />,, = 0 .8 e-MT" and four zeros at (a) Determ ine the value of the gain so that HDb (b) Determ ine the system function H(:). (c) Determ ine the magnitude of the frequency response H(a>) for 0 < a> < tt and compare it with the desired response \Hd(w)[. 4.80 A discrete*time system with input and output v ( n ) is described in the frequency domain by the relation V(oj) — v dXiuj) ~ 1 X (as) -t- — — •— das (a) Compute the response of the svstem to the input x i n ) = (b ) C heck if the system is LTI and stable. 4.81 Consider an ideal lowpass filter with impulse response It in) and frequency response I 1. K"! 5 a), I 0, CIJ, Hiw) = | < |< D | < TT What is the frequency response of the iiher defined by X<n) = h f). , n ev e n n odd 4.82 Consider the system shown in Fig. P4.S2. Determ ine its impulse response and its frequency response if the system H(a>) is: (a) Lowpass with cutoff frequency w,. (b) Highpass with cutoff frequency o j , . xi n ) Hiw) I' 1 4.83 Frequency inverters have been used for many years for speech scrambling. Indeed, a voice signal x(n) becomes unintelligible if we invert its spectrum as shown in Fig. P4.S3. (a) Determ ine how' frequency inversion can be perform ed in the time domain. (b) Design an unscrambler. (Hint: The required operations are very simple and can easily be done in real time.) 388 Frequency Analysis of Signals and Systems Chap. 4 X(a>) -x n 0 (b) Figure P4.83 (a) Original spectrum; (b) frequency-inverted spectrum. 4.84 A lowpass filter is described by the difference equation v(n) = 0.9v(/i - 1) + 0.1x(n) (a) By performing a frequency translation of n f l . transform the filter into a bandpass filter. (b) What is the impulse response of the bandpass filter? (c) What is the major problem with the frequency translation m ethod for transform­ ing a prototype lowpass filter into a bandpass filter? 4.85 Consider a system with a real-valued impulse response h(n) and frequency response H(w) = \H (a>)\em -’' The quantity D = 2 2 ” 2^ ( n ) n = ~ oc provides a m easure of the “effective duration” of h(n). (a) Express D in terms of H(w). (b) Show that D is minimized for 0(a>) = 0. 4.86 Consider the lowpass filter v(n) = a y { n — 1) + fejr(n) 0 < a < 1 (a) D eterm ine b so that |//{0)| = 1. (b) D eterm ine the 3-dB bandwidth an, for the normalized filter in part (a). (c) How does the choice of the param eter a affect uyf! <d) Repeat parts (a) through (c) for the highpass filter obtained by choosing - 1 < a < 0. 4.87 Sketch the magnitude and phase response of the m ultipath channel y (n ) = x ( n ) + a jr(n — M ) fo r a < < 1. a > 0 Chap. 4 389 Problems 4.88 Determ ine the system functions and the pole-zero locations for the systems shown in Fig. P4.88(a) through (c). and indicate w hether or not the systems are stable. l lc) Figure P4.88 4.89 D eterm ine and sketch the impulse response and the magnitude and phase responses of the FIR filter shown in Fig. P4.89 for b = 1 and b = -1 . 4.90 Consider the system v(n) = x(n) - 0.95.r(fl - 6) (a) Sketch its pole-zero pattern. (b) Sketch its magnitude response using the pole-zero plot. (c) D eterm ine the system function of its causal inverse system. (d) Sketch the magnitude response of the inverse system using the pole-zero plot. 4.91 Determ ine the impulse response and the difference equation for all possible systems specified by the system functions 390 Frequency Analysis of Signals and Systems Chap. 4 (a) H( Z) = 1 _ rZ_ ' _ ,_2 0 » " W = ! _ eL z-4 0< « < 1 4.92 D eterm ine the impulse response of a causal LTI system which produces the response v(n) = {1. - 1 .3 . - 1 ,6 ) t when excited by the input signal x(n) = (1,1,2} t 4.93 The system y(n) = i_v(n - 1) + x(n) is excited with the input x(n) = (j)"«(n) Determ ine the sequences aj t (/), rhh(l), r,y(i). and rvy(l). 4.94 Determ ine if the following FIR systems are minimum phase. (a) h(n) = {10,9. - 7 , - 8 , 0 , 5 . 3} r (b) h(n) = (5,4, - 3 . - 4 , 0 ,2 ,1 ) t 4.95 Can you determ ine the coefficients of the all-pole svstem *=i if you know its order N and the values /?(0), /i(l)........h ( L - l ) of its impulse response? How? W hat happens if you do not know N1 4.96 Consider a system with impulse response h(n) = baS(n) + bi$(n — D) + ^<5(n —2D) (a ) Explain why the system generates echoes spaced D samples apart. (b) Determ ine the m agnitude and phase response of the system. (c) Show that for \b0 + b2\ < < |£>]|, the locations of maxima and minima of \H(a>) are at k w = ± —n k = 0. 1, 2. . . . D (d) Plot |//(w )| and for b$ — 0.1, b\ = 1, and b2 = 0.05 and discuss the results. 4.97 Consider the pole-zero system B(z) 1 + bz * v—' W(z) = A(z) = T 1T + -----a z 1r = Y “ l h^ z (a) Determine >i(0), >i(l), h(2), and h(3) in terms of a and b. (b) Let rhH(l) be the autocorrelation sequence of h(n). D eterm ine rkh{0), /-^(l), rw,(2), and r/,h(3) in terms of a and b. Chap. 4 391 Problems 4.98 Let be a real-valued minimum-phase sequence. Modify xin I to obtain another real-valued minimum-phase sequence y(/i) such that y(0) = x(0) and y(n) = |jr(n)|. 4.99 The frequency response of a stable LTI system is known to be real and even. Is the inverse system stable? 4.100 Let h(n) be a real filter with nonzero linear or nonlinear phase response. Show that the following operations are equivalent to filtering the signal x(n) with a zero-phase filter. (a) g(n) — Ji(n) * ,v(n) / (h ) = h (/ t ] * g t - i i ) yon = f( ~n) (b) g(n) — h(n) * / (r?) = h{n) * x ( —n) y(nl = ain) + / ( - i i ) (Hint: D eterm ine the frequency response of the composite system _v(/i) = //[.v(«)].) 4.101 Cheek the validity of the following statements: (a) The convolution of two minimum-phase sequences is always mimmum-phase se­ quence. (h) The sum of two minimum-phase sequences is always minimum phase. 4.102 Determ ine the minimum-phase syslem whose squared magnitude response is given by: - cos w ^ (a) i H(</)}'- = (b ) I H (u>)',: = (i a - ) - 2a cos w 4.103 Consider an FIR syslem with the following system function: H(z) = (1 - 0 . 8 r '7V ' K l - l..v " T,V 1HI - L S ^ ' V 1) (a) Determ ine all systems that have the same magnitude response. minimum-phase system? (b) Deierm ine the impulse response of al) systems in part (a). (c) Plot the partial energy Which is the i=t> for every system and use il lo identify the minimum- and maximum-phase systems. 4.104 The causal system //(.-) = ,v 392 Frequency Analysis of Signals and Systems Chap, 4 (a) Show that by properly choosing A we can obtain a new stable system. (b) What is the difference equation describing the new system? 4.105* Given a signal x(n), we can create echoes and reverberations by delaying and scaling the signal as follows >’(«) = 22 Skx (n ~ kD) where D is positive integer and gk > g i —i > 0. (a) Explain why the comb filter H(z) = 1-az-° can be used as a reverberator (i.e.. as a device to produce artificial reverberations). (Hint: Determ ine and sketch its impulse response.) (b) The all-pass comb filter H(z) = -a 1 - a z - 1’ is used in practice to build digital reverberators by cascading three to five such filters and properly choosing the param eters a and D. Com pute and plot the impulse response of two such reverberators each obtained by cascading three sections with the following parameters. UNIT 1 UNIT 2 Seclion I) a Section D a 1 2 3 50 40 32 0.7 0.665 0.63175 1 2 3 50 17 6 0.7 0.77 0.847 (c) The difference between echo and reverberation is that with pure echo there are clear repetitions of the signal, but with reverberations, there are not. How is this reflected in the shape of the impulse response of the reverberator? Which unit in part (b) is a better reverberator? (d) If the delays D\, D2, Dj in a certain unit are prime numbers, the impulse response of the unit is more “dense." Explain why. (e) Plot the phase response of units 1 and 2 and comm ent on them. (f) Plot h(n) for D |, D2, and being nonprime. W hat do you notice? More details about this application can be found in a paper by J. A. M oorer, “Signal Processing Aspects of Com puter Music: A Survey," Proc, IEEE, vol. 65, No. 8, Aug. 1977, pp. 1108-1137. 4.106* By trial-and-error design a third-order lowpass filter with cutoff frequency at wc = Jt/9 radians/sample interval. Start your search with (a) zi = Z2 = Z3 = 0, pi = r, p2J = re±,tu' . r = 0.8 (b) r = 0.9, zi = Z2 = Z3 = - 1 Chap. 4 393 Problems 4.107* A speech signal with bandwidth B = 10 kHz is sampled at F2 = 20 kHz. Suppose that the signal is corrupted by four sinusoids with frequencies F, = 10, 000 Hz. F3 = 7778 Hz F2 = 8889 Hz, F4 = 6667 Hz (a) Design a FIR filter that eliminates these frequency components. (b) Choose the gain of the filter so that |H (0)| = 1 and then plot the log m agnitude response and the phase response of the filter. (c) Does the filter fulfill your objectives? Do you recom m end the use of this filter in a practical application? 4.108* Com pute and sketch the frequency response of a digital resonator with co = t t / 6 and r = 0.6, 0.9, 0.99. In each case, compute the bandwidth and the resonance frequency from the graph, and check if they are in agreem ent with the theoretical results. 4.109* The system function of a communication channel is given by H(z) = (1 - 0 . 9 f - 'u4'T;;-1)(l - 1.5^'afor; - 1)(l - 1.5<’- '" tez - 1) D eterm ine the system function Ht.(;) of a causal and stable compensating system so that the cascade interconnection of the two systems has a flat magnitude response. Sketch the pole-zero plots and the m agnitude and phase responses of all systems in­ volved into the analysis process. [Hint: Use the decomposition H(z) = Wap(;) Wn,in(;)-] The Discrete Fourier Transform: Its Properties and Applications F requency analysis o f discrete-tim e signals is usually and most con ven ien tly per­ form ed on a digital signal processor, which may be a general-purpose digital com ­ puter or specially d esigned digital hardware. T o perform frequency analysis on a d iscrete-tim e signal w e convert the tim e-dom ain sequ en ce to an equivalent frequencv-dom ain representation. We know that such a representation is given by the Fourier transform X(cu) of the seq u en ce |a(>;)). H ow ever, A'u<j) is a contin­ uous function o f frequency and therefore, it is not a com p utationally convenient representation o f the sequence {.v(/i)). In this section we consider the representation o f a sequ en ce by sam ples o f its spectrum X ( uj). Such a frequency-dom ain representation lead s to the discrete Fourier transform (D F T ), which is a pow erful com putational tool for perform ing frequency analysis o f discrete-tim e signals. 5.1 FREQUENCY DOMAIN SAMPLING: THE DISCRETE FOURIER TRANSFORM B efore w e introduce the D F T , w e consider the sam pling of the F ourier transform of an aperiodic discrete-tim e sequ en ce. Thus, w e establish the relationship betw een the sam pled Fourier transform and the D FT. 5.1.1 Frequency-Domain Sampling and Reconstruction of Discrete-Time Signals W e recall that aperiodic finite-energy signals have con tinu ou s spectra. Let us consider such an aperiodic discrete-tim e signal x ( n ) with Fourier transform (5.1.1) 394 Sec. 5.1 Frequency Domain Sampling: The Discrete Fourier Transform 395 S uppose that w e sam ple X(a>) periodically in frequency at a spacing o f Sco radians b etw een successive sam ples. Since X(a>) is period ic with period 2tt, only sam ples in the fundam ental frequency range are necessary. For con ven ien ce, w e take N equidistant sam ples in the interval 0 < w < 2tt with spacing Sco = 2 ttf N , as shown in Fig. 5.1. First, w e consider the selection of N , the num ber o f sam ples in the frequency dom ain. If w e evaluate (5.1.1) at u> = 2 n k / N , w e obtain (5.1.2) T h e sum m ation in (5.1.2) can be subdivided in to an infinite n um ber of sum m ations, where each sum con tains N term s. Thus -i oc N-1 IN + N - 1 -)2nkn/\ }=-~yL f}=i A‘ If we change the index in the inner sum m ation from n to n — I N and interchange the order o f the sum m ation, we obtain the result (5.1.3) for k = 0, 1, 2 .........N — 1. T h e signal OC (5.1.4) ob tain ed by the periodic repetition o f x{n) every N sam ples, is clearly periodic with fundam ental period N. C onsequently, it can be expanded in a Fourier 0 F igure 5.1 kSa) tt Swh Frequency-dom ain sam pling of the F ourier transform . 396 The Discrete Fourier Transform: Its Properties and Applications Chap. 5 series as A '-l x p (n) = Y ^ c ke,2nkn/N n = 0 , 1 .........N - 1 (5.1.5) k=Q with Fourier coefficients l A '-l k = 0 , 1 ........ N — 1 ck = - - ' £ x p ( n ) e - j2,rkn/N N n=0 (5.1.6) U p on com paring (5.1.3) with (5.1.6), we conclude that 1 f 2* \ ck = — X l — k ) N \ N J k = 0 . 1.........A ' - l (5.1.7) J T herefore, 1 ^ ~ ^ / ^7T \ x.,(n) = — ' y * ( — * ) e llnkntN \ N / n = 0, 1........ A ' - l (5.1.8) The relationship in (5.1.8) provides the reconstruction of the periodic signal x r (u) from the sam ples of the spectrum X ( oj). H ow ever, it d o es not imply that we can recover X(u>) or x{n) from the sam ples. T o accom plish this, we need to consider the relationship betw een x p (n) and j:(«). Since x p(n) is the periodic exten sion of x{n) as given by (5.1.4). it is clear that x (/ j) can be recovered from x p (n) if there is no aliasing in the tim e domain, that is, if x( n) is tim e-lim ited to less than the period N of x p(n). This situation is illustrated in Fig. 5.2, w here without loss of generality, we consider a finite-duration rtn) 0 Hitt,.... L xp(n) N > L ITIitttt IITIt t t .. JTTTTttt 0 L N N< L • IT- I TNt t t O I TN T t TTTt 1- Figure 5.2 Aperiodic sequence x(n) of length L and its periodic extension for N > L (no aliasing) and N < L (aliasing). Sec. 5.1 Frequency Domain Sampling: The Discrete Fourier Transform 397 sequ en ce x( n) , which is n on zero in the interval 0 < n < L — 1. W e ob serve that when N > L. x(ti) = Xp(n) 0 < n < N —1 so that x ( n ) can be recovered from x r (n) w ithout am biguity. On the other hand, if N < L, it is not possib le to recover from its periodic exten sion due to timed o m a i n aliasing. Thus, w e conclude that the spectrum of an aperiodic discrete-tim e signal with finite duration L . can be exactly recovered from its sam ples at frequen­ cies tot: = 2j rk/ N. if N > L. The procedure is to com pute x p (n). n = 0, 1.........N - 1 from (5.1.8); then 0 < n < N elsew h ere and finally, X(io) can be com p uted from (5.1.1). A s in the case o f con tinu ou s-tim c signals, it is p ossible to express the spectrum X ( w ) directly in term s o f its sam ples X Q n k / N ) , k = 0. 1........ N — 1. T o derive such an interpolation formula for X{co), we assum e that N > L and begin with (5.1.8). Since x( n) = x,,(n) for 0 < /; < A' - 1, A k ] ()<//< N - I (5.1.1(1) If w e use (5.1.1) and substitute for v(/;), we obtain A'-I X(a>) = n = (l (5.1.11) A '-l = 2> The inner sum m ation term in the brackets o f (5.1.11) represents the basic interpolation function shifted by 2 ttk / N in frequency. Indeed, if w e define v/tuA-' N 1 - e-J°‘ sin(o>Ar/2 ) N sin(w /2) then (5.1.11) can be expressed as jiuiN (5.1.12) 398 The Discrete Fourier Transform: Its Properties and Applications Chap. 5 The interpolation function P(co) is not the familiar ( si n 8 ) / 6 but instead, it is a periodic counterpart of it, and it is due to the periodic nature of A’(co). The phase shift in (5.1.12) reflects the fact that the signal j:(n) is a causal, finite-duration seq u en ce o f length N. The function sln( a>N/ 2)/ ( N sin(a>/2)) is plotted in Fig. 5.3 for N = 5. We observe that the function P(to) has the property 0 k = * = 1 .2 .........A ' - l (5.1.14) C onsequently, the interpolation form ula in (5.1,13) gives exactly the sam ple val­ ues X ( 2 j r k / N ) for oj = 2 i r k / N . A t all other freq u en cies, the form ula provides a properly w eighted linear com bination o f the original spectral sam ples. T h e follow ing exam ple illustrates the frequency-dom ain sam pling of a discrete-tim e signal and the tim e-dom ain aliasing that results. Example 5.1.1 Consider the sisinal xin ) = a"uin) 0 < a < 1 The spectrum of this signal is sampled at frequencies a>t = l i r k / S . k — 0. 1....... A '- l. Determ ine the reconstructed spectra for a = 0.8 when A' = 5 and N = 50. Solution The Fourier transform of the sequence x(n) is Suppose thai we sample X(w) at N equidistant frequencies w*. = 2 x k / N , k = 0, A' - 1. Thus we obtain the spectral samples Xiw) 1.0 JV= 5 Figure S.3 Plot o f the function [sin(ct>W/2)]/[jty sin(tu/2)]. Sec. 5.1 Frequency Domain Sampling: The Discrete Fourier Transform 399 The periodic sequence xp(n), corresponding to the frequency samples X ( 2 n k / N ) , k = 0, 1 , . . . . N — 1, can be obtained from either (5.1.4) or (5.1.8). Hence 0 oc x p(n) = ^ jc(n - IN) = ^ a”~IN 0 <n < N - 1 where the factor 1/(1 - a N) represents the effect of aliasing. Since 0 < a < 1, the aliasing error tends toward zero as N -+ oo. For a = 0.8, the sequence x(n) and its spectrum X{w) are shown in Fig. 5,4a and b, respectively. The aliased sequences xp(n) for N = 5 and N = 50 and the corresponding spectral samples are shown in Fig. 5.4c and d, respectively. We note that the aliasing effects are negligible for N = 50. If we define the aliased finite-duration sequence x(n) as xp{n), 0, 0 < n < N —1 otherwise then its Fourier transform is X(w) = y ^ i ( n ) e 1 1 —a N 1 1 —ae~,w Note that although X(ou) ^ X(a>), the sample values at a>t = I n k f N are identical. That is, 1 1- a N 1-a N l - a e - ' 2”1" 5.1.2 The Discrete Fourier Transform (DFT) The d ev elo p m en t in the preceding section is concerned with the frequency-dom ain sam pling o f an aperiodic finite-energy sequ en ce j:(n). In general, the equally spaced freq u en cy sam ples X (2n k / N ) , k = 0 , 1 ___ _ N — 1, do n ot uniquely represent the original seq u en ce x ( n ) when x(n) has infinite duration. Instead, the frequency sam ples X ( 2 n k / N ) , k = 0, 1........ N - I, correspond to a period ic seq u en ce x p(n) o f period N , w here x p (n) is an aliased version o f *{«), as indicated by the relation in (5.1.4), that is, (5.1.15) W hen the seq u en ce x ( n ) has a finite duration o f length L < N , then x p{n) is sim ply a periodic repetition o f x ( n ) , w h ere x p (n) over a single period is 400 The Discrete Fourier Transform: Its Properties and Applications Chap. 5 IAWH 1.0? Tfrrmnx. (a) (b) T x(n) 1.0* x \ f k) 1W 50 50 (1 fdi Figure 5.4 (a) Plot of sequence xin) = (0.X)"h (h ): (b) its Fourier transform (magnitude only): (c) effect of aliasing with A' = 5: (d) reduced effect of aliasing with A' = 50. given as x r (n) = x( n) . 0. 0 < n < L —1 L < n < N —1 (5.1.16) C onsequently, the frequency sam ples X ( 2 i r k / N ) , k = 0. 1.........N — 1, uniquely represent the finite-duration seq u en ce *{/;)■ Since x ( n ) = x p (n) over a single pe­ riod (padded by N — L zeros), the original finite-duration seq u en ce x ( n ) can be obtained from the frequency sam ples \ X ( 2 n k / N \ by m eans o f the formula (5.1.8)It is im portant to n ote that zero p a d d i n g d oes not provide any additional inform ation about the spectrum X(a>) o f the seq u en ce \x(n)}. T he L equidis- Sec. 5.1 Frequency Domain Sampling: The Discrete Fourier Transform 401 tant sam ples o f X(u>) are sufficient to reconstruct X(co) using the reconstruction form ula (5.1.13). H o w ever, padding the seq u en ce {jc(« )} with N — L zeros and com puting an A'-point D F T results in a “better display" of the Fourier transform X(o>). In sum m ary, a finite-duration seq u en ce x( n ) o f length L [i.e., x(n ) = 0 for n < 0 and n > L\ has a Fourier transform JL—1 X(u>) = ^ 2 x ( n ) e ~ Jwn n=0 0 < a> < 2jt (5.1.17) where the upper and low er indices in the sum m ation reflect the fact that x ( n ) = 0 outside the range 0 < n < L — 1. W hen w e sam ple X{a>) at equally spaced freq u en cies u>k = 2 n k / N . k ~ 0, 1, 2 ........ N — 1, where N > L. the resultant sam ples are X(k) = X = J 2 x ( n ) e ^ j27,k"/N N_ ) N 7 "=° X(k) = y x ( n ) e - p^ h,IN (5.1.18) k = 0, 1, 2, , . . , N - 1 n=<l where for co n v en ien ce, the upper index in the sum has been increased from L — 1 to /V - 1 since x ( n ) = 0 for n > L. T he relation in (5.1.18) is a form ula for transform ing a seq u en ce {jc(«)} of length L < N in to a seq u en ce o f frequency sam ples ( X(£)) o f length N . Since the frequency sam ples are ob tain ed by evaluating the Fourier transform X (a>) at a set o f N (eq ually spaced) discrete frequencies, the relation in (5.1.18) is called the discrete Fouri er t rans f or m (D F T ) o f jc(«). In turn, the relation given by (5.1.10), which allow s us to recover the seq u en ce jr(n) from the frequency sam ples 1 A'-l x ( n ) = - £ X f c ) e ,23tknlN n = 0 . 1 .........N ~ 1 (5.1.19) is called the i nverse D F T (ID F T ). Clearly, when x ( n ) has length L < N , the Ap­ point ID F T yield s x (n ) = 0 for L < n < N — 1. T o sum m arize, the form ulas for the D F T and ID F T are DFT A'-l X ( k ) = J ^ x ( n ) e - j2nkn/N ^7—0 k = 0 , 1, 2, (5.1.18) IDFT , A'-l x( n) = — Y * X ( k ) e JZnkn/N N *=o n = 0 , 1 , 2 .........N - 1 (5.1.19) 402 The Discrete Fourier Transform: Its Properties and Applications Chap. 5 Example 5.1.2 A finite-duration sequence of length L is given as x(n) — I 1 0, 0 < n <L -l otherwise Determine the /V-point DFT of this sequence for N > L. Solution The Fourier transform of this sequence is £-1 L-l The magnitude and phase of X (w) are illustrated in Fig. 5.5 for L = 10. The Appoint DFT of x (n) is simply X(w) evaluated at the set of N equally spaced frequencies wt = 2it k / N , k = 0, 1........N — 1. Hence p-jkrkLiN sm(*kL/N) , - j x k l L - 1 I/A/ sm(i t k/ N) IX(w)l 1" 2 7C — 2 2n W |H 0 0(a>) TT ID Figure SS Magnitude and phase characteristics of the Fourier transform for signal in Exam ple 5.1.2. Sec. 5.1 Frequency Domain Sampling: The Discrete Fourier Transform 403 If N is selected such that N = L, then the D FT becomes L, * (* ) = 10. k =0 * = 1 .2 ........L - l Thus there is only one nonzero value in the DFT. This is apparent from obser­ vation of X(w), since X(a>) = 0 at the frequencies an = I n k f L , k ^ 0. The reader should verify that x(n) can be recovered from X(k) by perform ing an Z.-point IDFT. Although the L-point D FT is sufficient to uniquely represent the sequence x{ n) in the frequency domain, it is apparent that it does not provide sufficient detail to yield a good picture of the spectral characteristics of x(n). If we wish to have better picture, we must evaluate (interpolate) X(a>) at more closely spaced frequencies, say wt, = 2n k / N , where N > L. In effect, we can view this com putation as expanding the size of the sequence from L points to N points by appending A '- L zeros to the sequence x ( n ). that is, zero padding. Then the A*-point DFT provides finer interpolation than the L-point DFT. Figure 5.6 provides a plot of the Appoint DFT, in magnitude and phase, for L = 10, N = 50, and N = 100. Now the spectral characteristics of the sequence are more clearly evident, as one will conclude by comparing these spectra with the continuous spectrum XUo). 5.1.3 The DFT as a Linear Transformation T he form ulas for the D F T and ID F T given by (5.1.18) and (5.1.19) m ay be ex ­ pressed as N -1 X ( k ) = J ^ j r O i) ^ " FT—(I ] JV-1 x( n) = — J ] x a ) ^ in ^ k=o A- = 0 , 1 , . . . , A/ — 1 n = 0 , 1 .........N - 1 (5.1.20) (5.1.21) w here, by definition, W N = e ~ ^ IN (5.1.22) which is an N th root o f unity. W e n o te that the com putation o f each point o f th e D F T can be accom plished by N com p lex m ultiplications and ( N ~ 1) com plex additions. H en ce the W-point D F T valu es can b e com p uted in a total o f N 2 com p lex m ultiplications and N ( N —1) com p lex additions. It is instructive to view the D F T and ID F T as linear transform ations on seq u en ces {jc(«)} and {X(fc)}, respectively. Let us d efine an Af-point vector %N o f th e signal se q u en ce x( n) , n — 0, 1 , . . . , N — 1, an N -p oin t vector X N o f frequency 404 The Discrete Fourier Transform: Its Properties and Applications Chap. 5 Figure 5.6 Magnitude and phase of an N-poini DFT in Example 6.4.2; (a) L = N = 50; (b) L = 10, N = 100. sam ples, and an N x N m atrix as - *(0) X* = ■ 1 x(l) X,v = , 1 1. .. 1 1 w* K ••• w* ■■■ W%N~ 0 ••• .1 < _1 -I - X ( N - 1 ). '1 1! 3 * .x(N-l). x(0) X ( l) (5.1.23) N y y 2 ( N — 1) (* -!)< A '-l) Sec. 5.1 Frequency Domain Sampling: The Discrete Fourier Transform 405 W ith th ese definitions, the W-point D F T m ay b e exp ressed in matrix form as X* = (5.1.24) w h ere is the m atrix o f the linear transform ation. W e ob serve that Wjv is a sym m etric matrix. If w e assum e that the inverse o f W * exists, then (5.1.24) can be inverted by prem ultiplying both sid es by W ^1. T hus w e ob tain x/v = (5.1.25) B u t this is just an exp ression for the ID F T . In fact, th e ID F T as given by (5.1.21), can b e exp ressed in m atrix form as ** = N (5.1.26) The Discrete Fourier Transform: Its Properties and Applications 406 where d en o tes the com p lex conjugate o f the m atrix W A. (5.1.26) with (5.1.25) leads us to con clu d e that Chap. 5 C om parison of W *1 = -W * w (5.1.27) W „W ;, = N l N (5.1.28) w hich, in turn, im plies that w here I * is an N x N identity matrix. T h erefore, the m atrix in the trans­ form ation is an orthogonal (unitary) m atrix. F urtherm ore, its inverse exists and is given as W *n / N . O f course, the existen ce o f the inverse o f W,v w as established p reviously from our derivation o f the ID FT . Example 5.L3 Compute the D FT of the four-point sequence 1 x(n) = (0 2 3) Solution The first step is to determ ine the matrix W4. By exploiting the periodicity property of W4 and the symmetry property = -v v ‘ the matrix W4 may he expressed as ~w" w" W< = w" < 1 w1 1. w44 w 9 w; w Wl -W« -1 1 1 .1 1 -j -1 j 1 - 1 1 '1 1 1 J 1 w4‘ W; w* 1 M'i W? I" W4- 1“ j -1 -j - Then T X4 = W 4X4 = 6 -2 + 2; -2 L-2-2JJ The IDFT of X4 may be determ ined by conjugating the elements in W 4 to obtain WJ and then applying the formula (5.1.26). T h e D F T and ID F T are com putational to o ls that play a very im portant role in m any digital signal processing applications, such as frequency analysis (spectrum analysis) o f signals, p ow er spectrum estim ation , and lineaT filtering. T h e im por­ tance o f the D F T and ID F T in such practical ap p lication s is du e to a large extent on the ex isten ce o f com putationally efficient algorithm s, know n co llectiv ely as fast Sec. 5.1 Frequency Domain Sampling: The Discrete Fourier Transform 407 F ourier transform (F F T ) algorithm s, for com puting the D F T and ID F T . T his class o f algorithm s is d escrib ed in Chapter 6. 5.1.4 Relationship of the DFT to Other Transforms In this d iscu ssion w e h ave indicated that the D F T is an im portant com putational to o l for perform ing frequency analysis o f signals on digital signal p rocessors. In v iew o f the other frequency analysis to o ls and transform s that w e have d e v e l­ o p ed , it is im portant to establish the relationships b etw een the D F T to th ese other transform s. Relationship to the Fourier series coefficients of a periodic sequence. A p eriod ic se q u en ce F ourier series o f th e form with fundam ental period N can b e represented in a iV~l x p (n) — ^ £kei2l,nk,N t=o — oo < n < oo (5.1.29) w h ere the F ourier series coefficients are given by the expression 1 A'-l Ct = ~ J 2 XP(/1 )r~j2”"k/N ^ n=(l Jt = 0 , 1 .........AT - 1 (5.1.30) If w e com p are (5.1.29) and (5.1.30) with (5.1.18) and (5.1.19), w e ob serve that the form ula for the F ourier series coefficients has the form o f a D F T . In fact, if we d efine a se q u en ce x(rt) = x p(n), 0 < n < N - 1 , the D F T o f this se q u en ce is sim ply X(k) = Nc k (5.1.31) F urtherm ore, (5.1.29) has the form o f an ID F T . T hus th e N -p oin t D F T provid es the exact line spectrum o f a p eriod ic seq u en ce with fundam ental period N. Relationship to the Fourier transform of an aperiodic sequence. W e have already sh ow n that if -t(n) is an aperiodic finite en ergy seq u en ce w ith Fourier transform X(a>), w h ich is sam pled at N eq u ally spaced freq u en cies = 2n k / N , k = 0 , 1 , . . . , N — 1, the spectral com p onents OO X(k) = = £ x ( n ) e - j2* nk,N k = 0,1,..., N - 1 (5.1.32) n « —oo are th e D F T coefficien ts o f the period ic seq u en ce o f period N , given by OO J;p (n) = ^ x(n-lN ) (5.1.33) /* —OO Thus x p (n) is d eterm in ed by aliasing {jc(n)J o ver th e interval 0 < n < N - 1. T h e finite-duration seq u en ce 408 The Discrete Fourier Transform: Its Properties and Applications Chap. 5 bears no resem blance to the original seq u en ce {x(n )), u nless ;c(n) is o f finite dura­ tion and length L < N, in which case x( n) = x{n) 0 < n < N —1 (5.1.35) O nly in this case will the ID F T o f {X(jfc)} yield the original seq u en ce {*(«)}. Relationship to the z*transform. Let us consider a seq u en ce x( n) having the ^-transform (5.1.36) with a R O C that includes the unit circle. If X ( z ) is sam pled at the N equally spaced points on the unit circle zt = e i2*k/ N, 0, 1, 2 , . . . , N — 1, w e obtain X( k ) = X(z)U=, i»«t » k = 0, 1 , . . . , N - 1 (5.1.37) = £ x ( n ) e ~ j2nnk/N T he expression in (5.1.37) is identical to the Fourier transform X(io) evalu ated at the N equally spaced freq u en cies <ot = 2 n k / N , k = 0, 1 , ___ N ~ 1, which is the topic treated in Section 5.1.1. If the seq u en ce x( n) has a finite duration o f length N or less, the seq u en ce can be recovered from its /V-point D F T . H en ce its z-transform is un iqu ely determ ined by its N -p oin t D F T . C onsequently, X ( z ) can be expressed as a function o f the D F T fX (k)} as follow s N~ 1 * (Z ) = ^ * ( « ) 2 “ n n=0 /V-l X(z) = £ n=0 L N *=0 -N N- 1 X ( Z) = N (5.1.38) X( k) ej2*k/Nz - i W hen evaluated on the unit circle, (5.1.38) yield s the F ourier transform o f the finite-duration seq u en ce in term s o f its D F T , in th e form k=0 1 T his expression for th e Fourier transform is a p olyn om ial (L agrange) interpolation form ula for X ( w ) exp ressed in term s o f the valu es {X (Jt)) o f th e polyn om ial at a set o f equally spaced d iscrete freq u en cies <ok = 2 n k / N , k = 0, 1.........N - 1. With Sec. 5.2 Properties of the DFT 409 so m e algebraic m anipulations, it is p ossib le to reduce (5.1.39) to the interpolation form ula given p reviously in (5.1.13). Relationship to the Fourier series coefficients of a continuous-time signal. S uppose that xa (t) is a con tinu ou s-tim e periodic signal with fundam ental p eriod Tp = 1 /F 0. T he signal can be expressed in a Fourier series OC xaU) = CteJ2,TkF" t = —3C (5-1-40) w here { q ) are the Fourier coefficients. If we sam ple xc,(t) at a uniform rate Fs = N / T p = 1 / T , w e obtain the discrete-tim e sequ en ce x ( n ) = x a( nT) = y Cl;ej2,rkF"’,T = ckej2nt,l/N k=—'\, k=—cc N - 1 J 2 x k n /N - E E l~~CX. It is clear that (5.1.41) is in the form o f an ID F T form ula, where rv X{ k) = N j 2 Ck-iN = N c t /=--v and •V Q = y t'k-iN /=-ac (5.1.42) (5.1.43) T hus the {q } seq u en ce is an aliased version o f the seq u en ce (cA}. 5.2 PROPERTIES OF THE DFT In S ection 5.1.2 w e introduced the D F T as a set o f N sam p les {X(Jt)} of the F ourier transform X(a>) for a finite-duration seq u en ce |jr(n)} o f length L < N. T h e sam pling o f X (to) occurs at the N equally spaced freq u en cies cd* = 2 n k / N , k — 0, 1, 2 .........N — 1. W e dem onstrated that the N sam p les (X(A)} uniquely represent the seq u en ce (;c(n)} in the frequency dom ain. R ecall that the D F T and inverse D F T (ID F T ) for an //-p o in t seq u en ce {*(«)} are given as N- 1 DFT: X( k ) = J ^ x ^n ) W N n=0 * - 0 , 1 .........A ' - l (5.2.1) 1 N- 1 ID FT: jc(n) = — £ X ( k ) W ~ kn i=0 n = 0 , 1 .........N - 1 (5.2.2) where Wn is defined as WN = e~ j2n,N (5.2.3) 410 The Discrete Fourier Transform: Its Properties and Applications Chap. 5 In this section w e present the im portant p rop erties o f the D F T . In view o f the relationships estab lish ed in Section 5.1.4 b etw een the D F T and Fourier series, and Fourier transform s and --transform s o f d iscrete-tim e signals, w e exp ect the p roperties o f the D F T to resem ble the properties o f these o th er transform s and series. H ow ever, som e im portant d ifferen ces exist, o n e o f w hich is the circular con v o lu tio n property derived in the follow in g section . A good understanding of these properties is extrem ely helpful in the application o f the D F T to practical p roblem s. T h e notation used b elow to d en o te the N -point D F T pair x ( n ) and AT(Jt) is *(„) S N x(k) 5.2.1 Periodicity, Linearity, and Symmetry Properties Periodicity. If x(n) and X (k ) are an Af-point D F T pair, then x(n + N) = x( n) for all n (5.2.4) X( k + N) = X( k ) for all k (5.2.5) T h ese periodicities in .r(n) and A' (A:) follow im m ed iately from form ulas (5.2.1) and (5.2.2) for the D F T and ID FT , respectively. W e previously illustrated the periodicity property in the seq u en ce x (n) for a given D FT. H ow ever, we had not p reviously view ed the D F T X( k ) as a periodic seq u en ce. In so m e applications it is ad van tageou s to do this. Linearity. If DFT * ,(„ ) «— X l (k) N and x 2(n) K N X 2(k) then for any real-valued or com p lex-valu ed con stan ts a\ and a2, DFT a\ X] ( n) + a 2x 2(n) <— + a {X\ ( k) + a2X 2(k) (5.2.6) This property follow s im m ediately from the definition o f the D F T given by (5.2.1). Circular Symmetries of a Sequence. A s w e h ave seen , the Appoint D FT o f a finite duration seq u en ce, x(n) o f length L < N is eq u ivalen t to the W-point D F T o f a periodic seq u en ce xp (n), o f period N, w hich is ob tain ed by periodically exten d ing jc(n), that is, OO xp (n) = £ x( n - I N) /=—OO (5.2.7) Sec. 52. Properties of the DFT 411 N o w su p p ose that w e shift the periodic seq u en ce x p (n) by k units to the right. Thus w e obtain a n oth er period ic sequ en ce OC x'p (n) = x p (n - k) = ^ x( n - k - IN) /=-OC T h e finite-duration seq u en ce 1 0, otherw ise (5.2.8) (5.2.9) is related to the original seq u en ce x ( n ) by a circular shift. T h is relationship is illustrated in Fig. 5.7 for N = 4. In gen eral, th e circular shift of the seq u en ce can b e rep resen ted as the index m o d u lo N . T h u s w e can w rite x'(n) = x(n — k, m odu lo N ) (5.2.10) s x((n ~ k) ) N For exam p le, if k = 2 and N = 4, w e have x'(n) = * ((« - 2))4 which im plies that jc'(0) = x ( ( - 2 ) ) 4 = x ( 2 ) x' { l ) = jc ( ( - 1))4 = ;c ( 3 ) * '( 2 ) = jt<(0))4 = j (0) x '( 3 ) = j t ( ( 1))4 = j t (1 ) H en ce x'(n) is sim ply x (n) shifted circularly by tw o units in tim e, w here the cou n ­ terclock w ise direction has b een arbitrarily selected as the p ositive direction. Thus w e con clu d e that a circular shift o f an -point seq u en ce is eq u ivalen t to a linear shift o f its p eriod ic ex ten sion , and vice versa. T h e in h eren t p eriod icity resulting from the arrangem ent o f the Af-point se ­ q u en ce o n th e circum ference o f a circle dictates a differen t definition o f even and od d sym m etry, and tim e reversal o f a sequ en ce. A n Af-point seq u en ce is called circularly even if it is sym m etric ab ou t the p oin t zero on th e circle. T h is im plies that x ( N —n ) = x ( n ) 1 < n < N —1 (5.2.11) A n W -point seq u en ce is called circularly o d d if it is antisym m etric ab ou t the point zero o n the circle. T h is im plies that x ( N — n) = —x( n) 1 < n < N —1 (5.2.12) T h e tim e reversal o f an Af-point seq u en ce is attained by reversing its sam ples about the p o in t ze r o on the circle. T h u s th e seq u en ce jc((—n ) ) # is sim ply given as * ((-« ))* = x ( N - n ) 0 < n < N - l (5.2.13) T h is tim e reversal is eq u ivalen t to plottin g j:(/i ) in a clock w ise direction on a circle. 412 The Discrete Fourier Transform: Its Properties and Applications 4< j(n) 3 2t '± <a) 4' xM 41 4 3 ‘ T2J -4 r l l ' . . ■t’ -3 - 2 - I 0 I 2 3 4 6 5 7 (b) Jr,,(n - 2) 4< 3 < 4' 4' ■- t6 ’- 5I - 4 - 3 ,- -2 t- I" l0 1i m2 ’ i3 ’I4 5 (O 4 3 ■TI *(0) *'(2) <e) Figure 5.7 Circular shift o f a sequence. Chap. 5 Sec. 5.2 Properties of the DFT 413 A n eq u ivalen t definition o f even and od d seq u en ces for th e associated peri­ odic seq u en ce x p (n) is given as follow s even: x„(n) = = x p( N - n) odd: x p (n) = - x p( —n) - - x p ( N - n) (5.2.14) If the periodic seq u en ce is com p lex-valu ed , w e have conjugate even: x „(n) = x U N — n) P x p (n) = —x * ( N — n ) conjugate odd: (5.2.15) T h ese relationships suggest that w e d ecom p ose the seq u en ce x p (n) as xp (n) = xP'(n) + x ^ i n ) (5.2.16) xPAn) = \ [ x p (n) + x p( N - n)] , P x p„{n) = \ [ x P(n) - x * ( N - n ) ] (5.2.17) w here Symmetry properties of the DFT. T h e sym m etry properties for the D F T can be o b tain ed by applying the m eth od ology p reviously used for the Fourier transform . Let us assum e that the N -p oin t seq u en ce jc(n) and its D F T are both com plex valued. T h en the seq u en ces can be exp ressed as jr(n) = XR(n) + j x / ( n ) 0 < n < N —1 (5.2.18) X( k ) = Xg ( k ) + j X , ( k ) 0 < k < N - 1 (5.2.19) B y substituting (5.2.18) in to the expression for the D F T given by (5.2.1), w e obtain * * (* ) = £ j*J?(") cos X,(k) = “ E + x , ( n ) sin j (5.2.20) [•**(" )sin ~ J p ' — -*■/(«) cos n=0 L (5-2.21) J Sim ilarly, by substituting (5.2.19) into the expression for the ID F T given by (5.2.2), w e obtain x K(n) = i 1 * /(n ) = — £ [”* * ( * ) cos *=0 L f Real-valued sequences. . - X ,( fc ) s in ^ ^ j J . 2nkn sin —^ — h 2n kn "I cos —^ —J (5.2.22) (5.2.23) If the seq u en ce jc(n) is real, it follow s directly from (5.2.1) that X ( N - k ) = X m(k) = X(-Jfc) (5.2.24) 414 The Discrete Fourier Transform: Its Properties and Applications Chap. 5 C onsequently, \ X ( N ~ jfc)| = |AT(A:)| and I X ( N - k) = —l X ( k ) . Furtherm ore, xi (n) = 0 and therefore ;r(rj) can b e d eterm in ed from (5.2.22). which is another form for the ID F T . Real and even sequences. If x (n) is real and even , that is, x(n ) — x ( N — n) 0 < n < N —1 then (5.2.21) yield s X / ( k ) = 0. H en ce the D F T reduces to Cy 2nkn X ( k ) = y x ( n ) c o s ------- ^ 0 < k < N —\ (5.2.25) N which is itself real-valued and even . reduces to Furtherm ore, since X / ( k ) = 0, the ID FT jc («) — — ^ X (k ) c o s -------*=o Real and odd sequences. 0 < n < N —1 (5.2.26) If x ( n ) is real and odd, that is, x ( n ) = —x ( N — n) 0 < n < N ~ 1 then (5.2.20) yields X R(k) = 0. H en ce X( k ) — —j Y x ( n ) sin t z o < k < N —1 (5.2.27) N which is purely im aginary and odd. Since X K(k) = 0, the ID F T reduces to * (« ) = j ~ y X (k ) sin N 0 < n < N - 1 (5.2.28) N Purely imaginary sequences. In this case, x( n) = j x f (n). C onsequently, (5.2.20) and (5.2.21) reduce to **< *) - E n=0 x >(k) - JC,(n)sin (5.2.29) N £ * / ( " ) 0 0 8 —77n=0 (5.2.30) W e ob serve that Xn( k) is odd and X } (k) is even. If x / ( n ) is odd, then X / ( k ) = 0 and h en ce X(Jt) is purely real. O n th e other hand, if x r (n ) is ev en , then X * (Jt) = 0 and h en ce X(i fc) is purely im aginary. Sec. 5.2 Properties of the DFT TABLE 5.1 415 SYMMETRY PROPERTIES OF THE DFT yV-Point Sequence x(n). 0< n < N - 1 /V-Point DFT X(k) X ’ ( N —k) X' ( k) x(n) x*(n) x*( N - n ) xx(n) X t, *)] X,-,„<*) = HX( k ) - X ' ( N - *)] X K(k) JXj (n) xcf(n) = i[jr(n) + x*(N - «)] xcJ n ) = |[T (n) - x*( N - /j)] j X/ ( k ) Real Signals X(k) = X*( N - k ) X K(k) = X „ W - k ) X, (k) = - X , i N - k ) \X(k)\ = \ X( N - k ) \ I X( k) = - I X { N - k) X K{k) jX/tt) A ny real signal jr{n) x, An) = j[* (n ) + x ( N - n)] x„.(n) = 5(a-(») - x( N - »)] T h e sym m etry properties given ab ove may be sum m arized as follow s: Mu) - xjf(n) + x 'kOi ) + j x j‘{n) + jx'/in) I ’ \ x(k) = x H ‘ (k) + x ;‘ (k) + j x ;t (k) + j x l<,(k) (5-2-3D AH the sym m etry properties o f the D F T can easily be d ed u ced from (5.2.31). For exam p le, the D F T o f the seq u en ce x pr(n) = j ^ f n ) + x * ( N - n)] is * * ( * ) = X'K(k) + X°K(k) T h e sym m etry p rop erties of the D F T are sum m arized in T able 5.1. E x­ p loitation o f th e se properties for the efficient com putation o f the D F T o f special se q u en ces is con sid ered in so m e o f the problem s at the end o f the chapter. 5.2.2 M ultiplication o f Two DFTs and Circular C on volu tion S u p pose that w e have tw o finite-duration seq u en ces o f length N, Jti(n) and T h eir resp ective Appoint D F T s are JV-1 X, (k ) = Y L jc, (n)e~i2* HklN iV-1 X 2(k) = Y x 2( n ) e - j2*nk/N n=0 k = 0,1,..., N —1 (5.2.32) k = 0,1,..., N - 1 (5.2.33) The Discrete Fourier Transform: Its Properties and Applications 416 Chap. 5 If w e m ultiply the tw o D F T s togeth er, the result is a D F T , say o f a se­ quen ce jf3(n) o f length N. L et us determ in e the relationship b etw een x3(n) and the sequ en ces X] ( n) and jr2(n). W e have Xi ( k) = X t ( k ) X2(k) k = 0 , 1 .........N - 1 (5.2.34) T h e ID F T o f {X3(Jt)} is 1 N-1 x 3 (m) = ~ X j ( k ) e i2* km/N *=o E (5.2.35) A'-l Suppose that we substitute for X\ ( k ) and X 2(k) in (5.2.35) using the D F T s given in (5.2.32) and (5.2.33). T hus w e obtain — j27rkn/N k=0 -j2nkl/N „j2nkm/N /=0 (5.2.36) Af-l T he inner sum in the brackets in (5.2.36) has the form « -i f N. a = 1 (5.2.37) y > A= l l - a " *-« 0751 w here a is defined as Q _ e j2n(m-n-l)/N W e observe that a = 1 w hen m — n — I is a m ultiple o f N. O n the other hand, a N = 1 for any value o f a =£ 0. C on sequ en tly, (5.2.37) reduces to /V- 1 E ks=0 t a , I N, 1 0, 1 I = m - n + p N = ((m - n ) ) N, otherw ise p an in teger 2 381 If w e substitute the result in (5.2.38) in to (5.2.36), w e obtain the desired expression for ^ ( m ) in the form xi ( m) = Y x \ ( n) x 2((m - n ) ) N m = 0,1,..., N - 1 (5.2.39) T h e expression in (5.2.39) has th e form o f a con volu tion sum . H ow ever, it is not the ordinary linear con volu tion that w as introduced in C hapter 2, which relates the output seq u en ce y( n) o f a linear system to th e input seq u en ce x( n) and the im pulse response h(n). Instead, the con volu tion sum in (5.2.39) in volves the index Sec. 5.2 417 Properties of the DFT ((m —fl))w and is called circular co nvolution. Thus w e con clu d e that m ultiplication o f the D F T s o f tw o seq u en ces is eq u ivalen t to the circular con volu tion o f the tw o seq u en ces in the tim e dom ain. T h e fo llow in g exam p le illustrates the op eration s in volved in circular con vo­ lution. Example Si.1 Perform the circular convolution of the following two sequences: *!(«) = { 2,1,2( 1} t x 2(n) = {1,2,3,4} t Solution Each sequence consists of four nonzero points. For the purposes of illus­ trating the operations involved in circular convolution, it is desirable to graph each sequence as points on a circle. Thus the sequences x\{n) and x 2(n) are graphed as illustrated in Fig. 5.8(a). We note that the sequences are graphed in a counterclock­ wise direction on a circle. This establishes the reference direction in rotating one of the sequences relative to the other. Now, xi(m) is obtained by circularly convolving jci<«) with J 2(«) as specified by (5.2.39). Beginning with m = 0 we have jrj(O ) = y ^ j r i ( n ) j r 2( ( - n ) ) y n=U jc2((—«)>4 is simply the sequence x 2(n) folded and graphed on a circle as illustrated in Fig. 5.8(b). In other words, the folded sequence is simply xz(n) graphed in a clockwise direction. The product sequence is obtained by multiplying jci(h) with * j( ( - n ) ) 4, point by point. This sequence is also illustrated in Fig. 5.8(b). Finally, we sum the values in the product sequence to obtain *3(0) = 14 For m = 1 we have 3 *3(1) = ^ x l ( n ) x 2( ( l - « » 4 «*0 It is easily verified that *2((1 —n ))4 is simply the sequence * 2((~ n ))4 rotated coun­ terclockwise by one unit in time as illustrated in Fig. 5.8(c). This rotated sequence multiplies x\ (n) to yield the product sequence, also illustrated in Fig. 5.8(c). Finally, we sum the values in the product sequence to obtain *3(1). Thus * 3d) = 16 F or m = 2 we have 3 *3(2) = E Xl (n )*2((2 - n ))« n«0 Now *2 ((2 —n ))4 is the folded sequence in Fig. 5.8(b) rotated two units of time in the counterclockwise direction. The resultant sequence is illustrated in Fig. 5.8(d) *|0) = 1 jr2( l) = 2 * ,(0) = 2 jri(2> - 2 ■*2(2) = 3 *2( 0 ) =1 (a) jc2 ( 2 ) 2 * 2( 0 ) = 1 =3 jc2(I) = 2 Folded sequence Product sequence (b) x2(0) = 1 jr2(3 )= 4 4 x2(l) = 2 jc2(2> = 3 Folded sequence rotated by one unit in time (c) x 2( l ) = 2 *2(2)= 3 *2(0) = 1 6 *2(3) = 4 Folded sequence rotated by two units in time (d) *j(2) = 3 *2(3) = 4 *j(0)=l Folded sequence rotated by three units in time Figure 5.8 Product sequence (e) Circular oonvolutioa o f tw o sequences. Sec. 5.2 Properties of the DFT 419 along with the product sequence x l (n)xi((2 - n))A. By summing the four term s in the product sequence, we obtain * j ( 2 ) = 14 For m = 3 we have 3 X30 ) = y^xi(n)x;((3 - n ) ) 4 i,=Q The folded sequence X2((—n))4 is now rotated by three units in time to yield jc2(<3—n))4 and the resultant sequence is multiplied by *j(n) to yield the product sequence as illustrated in Fig. 5.8(e). The sum of the values in the product sequence is x 3( 3) = 16 We observe that if the com putation above is continued beyond m = 3, we simply repeat the sequence of four values obtained above. Therefore, the circular convolution of the two sequences x \ ( n ) and x2(n) yields the sequence xi(n) = {14,16,14,16) t From this exam p le, w e observe that circular con volu tion involves basically the sam e four step s as the ordinary linear co n vo lu tio n introduced in C hapter 2: fo l d i n g (tim e reversing) on e seq u en ce, shifting the fold ed seq u en ce, m u ltip ly in g the tw o seq u en ces to obtain a product seq u en ce, and finally, s u m m i n g the valu es o f the product seq u en ce. T h e basic d ifference b etw een th ese tw o types o f con volu tion is that, in circular con v olu tion , the foldin g and shifting (rotatin g) op eration s are p erform ed in a circular fashion by com puting the index o f o n e o f the seq u en ces m o d u lo N . In linear co n volu tion , there is n o m odu lo N op eration . T h e reader can easily sh ow from our previous d evelop m en t that eith er on e o f the tw o seq u en ces m ay b e fold ed and rotated w ithou t changing the result o f the circular con volu tion . Thus N- 1 x$(m) = Y ' X 2 ( n )x i ( ( m — n ) ) s m = 0 , 1 , ... t N — 1 (5.2.40) n=0 T h e fo llo w in g exam p le serves to illustrate the com p utation o f x 3 (n) by m eans o f the D F T and ID F T . Exam ple SJJ1 By m eans of the D FT and IDFT, determ ine the sequence xj(n) corresponding to the circular convolution of the sequences x\ (n) and X2 (n) given in Exam ple 5.2.1. Solution xi(n) is First we com pute the DFTs of xi(n) and * 2(0 ). T he four-point D FT of 3 Xi<*) = Y Xl ft-0 k = 0 ,1 ,2 ,3 420 The Discrete Fourier Transform: Its Properties and Applications Chap. 5 Thus *1(0) = 6 JCid) = 0 Jlf,(2) = 2 A'1(3) = 0 The D FT o f Jt2(n) is 3 X 2(.k) = Y fl«0 k = 0 ,1 ,2 ,3 = 1 + 2 e - iltkri + 3e~>*k + 4e~J^ kri Thus X2(0) = 10 X 2a ) = - 2 + j 2 X2( 2 ) = - 2 X 2Q) = - 2 - j 2 When we multiply the two DFTs, we obtain the product X3(*) = X t (k)X 2(k) or, equivalently, X3(0) = 60 * 3(1) = 0 X3( 2 ) = - 4 Xj (3) = 0 Now, the ID FT of X 3(k) is jr3(n) = Y X3(Jt)cj7,rn*/4 £*41 n = 0, 1, 2, 3 = j(6 0 - 4eJ”n) Thus j 3(0> = 14 jc3(1) = 16 x3(2) = 14 ;c3(3) = 16 which is the result obtained in Exam ple 5.2.1 from circular convolution. W e conclude this section by form ally stating this im portant property o f the DFT. Circular co n v o lu tio n . If * i(n ) DFT x m and then DFT *1 (H) (g> * 2 (n) ^ (*)X 2(Jt) (5.2.41) w here x\ (n) (N) x2(n) d en o te s th e circular con volu tion o f the se q u en ce x i(n ) and x%(n). Sec. 5.2 Properties of the DFT 421 42) *6) *(6) jt(2) Figure 5.9 Tim e reversal of a sequence. 5.2.3 Additional DFT Properties Time reversal of a sequence. If DFT th e n x((-n))v = x ( N - n ) X ( ( - k ) ) N = X ( N - k) (5.2.42) H e n c e re v e rsin g th e /V-point se q u e n c e in tim e is e q u iv a le n t to rev ersin g th e D F T values. T im e rev ersal of a s e q u e n c e x(rt) is illu stra te d in Fig. 5.9. Proof . F ro m th e d efin itio n of th e D F T in (5.2.1) w e h a v e JV-I D F T { * W - «)} = £ x ( N ~ n ) e ~ j2nkn/N n=0 I f w e c h a n g e th e in d ex fro m n to m = N - n, th e n N -l D F T [ x ( N - n ) } = £ x ( m ) < T j7,r*(* - m)/,v =o A '-l = Y , x ( m ) e > 2*kmIN m=0 = Y x ( m ) e - i2*m(N- k)/N = X ( N — k) m=0 W e n o te th a t X ( N - k) = X { ( - k ) ) N, 0 < k < N - l . Circular time shift of a sequence. If 422 The Discrete Fourier Transform: Its Properties and Applications Chap. 5 th e n * « n - l))N « X ( k ) e ~ j2* k!/N (5.2.43) Proof. From the definition o f the D F T w e have N- 1 D F T { * ((# i- / ) ) * } = £ * ( ( n - / ) ) „ e - ' ' 2ir*"/N n=0 = £ > ( ( « - l ) ) Ne ~ * * k”/N n=0 + Y x ( n - l ) e - j ”kn/N n=l B ut x( (n - 1)) h = x ( N - l + n). C onsequently, ~ 1 + n ) e ' j2jrkn/N £ x ( ( n - l ) ) Ne~j2*kn/N = ] T n—0 rr=s() = £ x ( m ) e ' ^ k^ m=N-l N F urtherm ore, y x { n - l ) e - J2,Tkn/N = /»=/ Y x ( m ) e - j2”kim+IWN T herefore, N~ 1 DFT{jc((« - / ) ) } = ^ x{m)e~-'2xk(m+,)/N m=0 = X ( k ) e ' ^ u/N Circular freq u en cy sh ift. If DFT x( n) « X( k) then x ( n ) e j2*In/N £ 5 - X ( ( k - / » * (5.2.44) H en ce, the m ultiplication o f the seq u en ce jc(/i) w ith the com p lex exp on en tial se­ quence eP***1* is eq u ivalen t to th e circular shift o f the D F T by I u n its in frequency. This is th e dual to the circular tim e-shifting p roperty and its p r o o f is sim ilar to the latter. Sec. 5.2 Properties of the DFT 423 C o m p lex -co n ju g a te p roperties. If X(k) jr(n) K th e n DFT x\n) « * * ( ( - * ) ) * = * * ( * - k) N (5.2.45) T h e p r o o f o f th is p r o p e rty is left as an ex ercise fo r th e re a d e r. T h e ID F T o f X m(k) is — Y X * ( k ) e J2nkn/N = — £ x ( J k ) e ' 2**(A'- " )' A' ^ *=o T h e re fo re , x * ( ( - n ) ) N = x+( N - b) « Circular correlation. A/ X'(k) (5.2.46) In g e n e ra l, fo r c o m p le x -v a lu e d se q u e n c e s x ( n ) and V(n), if DF!' x(n) « /v X(A-) an d v(«) N y<*) th e n FJV(/) « n R „ ( k ) = X ( k ) Y r (k) (5.2.47) w h ere r ,,.(/) is th e (u n n o rm a liz e d ) c irc u la r c ro ssc o rre la tio n se q u e n c e , d efin e d as N- 1 ^ v (0 = ^ * ( n ) / ( ( n - l))N F r o o / W e c a n w rite f*v(/) as th e circ u la r co n v o lu tio n o f x ( n ) w ith y*(—n), th a t is, T h e n , w ith th e a id o f th e p r o p e rtie s in (5.2.41) a n d (5.2.46), th e W -point D F T o f rxy(l) is R i y (k) = X (k)F *(k) In th e sp e c ia l case w h e re y (n ) = x ( n ) , w e h a v e th e c o rre sp o n d in g e x p ressio n fo r th e c irc u la r a u to c o r re la tio n o f x ( n ) , 424 The Discrete Fourier Transform: Its Properties and Applications Multiplication of two sequences. Chap. 5 If jr,(n ) « * ,( * ) x 2(n) « X 2(k) and then x A n ) x 2(n) K ^ X ,( J t ) ( N ) X 2(*) (5.2.49) This property is the dual o f (5.2.41). Its p ro o f follow s sim ply by interchanging the roles o f tim e and frequency in the exp ression for the circular con volu tion of tw o sequ en ces. Parseval’s theorem. For com p lex-valu ed seq u en ces * (n ) and _y(n), in gen­ eral, if and then A N- 1 /V — 1 /V — 1 £ Jt(n)y*(n) = - £ X ( J t ) r (/:) N *=0 n=0 (5-2 ‘50) Proof. T h e property follow s im m ed iately from the circular correlation prop­ erty in (5.2.47). W e have N-1 ^ x ( n ) y * ( n ) = r JV(0) and k~0 H en ce (5.2.50) fo llo w s by evalu atin g the ID F T at I = 0. T he exp ression in (5.2.50) is th e gen eral form o f P arseval’s theorem . In th e sp ecial case w h ere ;y(n) = x ( n ) , (5.2.50) red u ces to £ /11=0 \x{n)\2 = i £ JtseO |X ( * ) | 2 (5.2.51) Sec. 5.3 Linear Filtering Methods Based on the DFT TABLE 5.2 425 PROPERTIES OF THE DFT Time Dom ain Frequency Domain Notation Periodicity Linearity Time reversal Circular time shift Circular frequency shift Complex conjugate Circular convolution x(n), yOi) x (n) =s x(rt + iV) a]Xi(n) + a2x 2(n) x ( N —n) *((" - D) n x(n)ei2jr,n/N x "(n) xi (n )@ jr2(n) *<*), Y(k) X( k) = X( k + N) 0\ Xi ( k) + a2X 2(k) X(N - k ) X(k)e~J2*kl/N X ((k-l))N X*(N — k) xm xiik) Circular correlation x (n )® y * (-n ) X(k) Y' ( k) Multiplication of two sequences jri(n)x2(n) /V—1 Property Parseval’s theorem n=(! *3=0 w hich ex p resses the energy in the finite-duration seq u en ce x ( n) in term s o f the frequency co m p o n en ts {X(£)l T h e properties o f the D F T given ab ove are sum m arized in T able 5.2. 5.3 LINEAR FILTERING METHODS BASED ON THE DFT Since the D F T provides a discrete frequency rep resen tation o f a finite-duration seq u en ce in the frequency dom ain, it is in terestin g to exp lore its use as a com ­ p utational to o l for linear system analysis and, especially, for linear filtering. W e have already estab lish ed that a system with freq u en cy resp on se H { w ) y w hen e x ­ cited with an input signal that has a spectrum X(a>), p o ssesses an output spectrum Y(a>) = X ( oj) H ( w ). T he output seq u en ce y ( n) is d eterm in ed from its spectrum via the inverse F ourier transform . C om putationally, the p rob lem with this frequencydom ain approach is that X(a>), H(a>), and Y(a>) are fun ction s o f the continuous variable o>. A s a con seq u en ce, the com p utations can n ot be d o n e on a d igital com ­ puter, since th e com puter can on ly store and perform com p utations on quantities at discrete frequencies. O n the other hand, th e D F T d o es len d itself to com p utation on a digital com puter. In th e discussion that follow s, w e d escrib e h ow th e D F T can b e used to perform lin ear filtering in the frequency dom ain. In particular, w e p resent a com p utational p rocedure that serves as an alternative to tim e-d om ain co n v o ­ lution. In fact, the frequency-dom ain approach b ased o n the D F T , is com pu­ tationally m ore efficien t than tim e-dom ain con volu tion d u e to the existen ce o f efficient algorithm s for com p utin g the D F T . T h ese algorithm s, w hich are d e ­ scribed in C hapter 6, are collectively called fast F ourier transform (FFT ) algo­ rithms. 426 The Discrete Fourier Transform: Its Properties and Applications Chap. 5 5.3.1 Use of the DFT in Linear Filtering In the p receding section it w as d em onstrated that the product o f tw o D F T s is equivalent to th e circular con volu tion o f the corresponding tim e-d om ain sequ en ces. U nfortunately, circular con volu tion is o f no use to us if our ob jectiv e is to deter­ m ine th e output o f a linear filter to a given input seq u en ce. In this case w e seek a frequency-dom ain m eth od ology eq u ivalen t to lin ear con volu tion . S u ppose that w e have a finite-duration seq u en ce x( n) o f length L which excites an F IR filter o f length Af. W ithout loss o f generality, let jc(n) = 0, n < 0 and n > L h(n) = 0, n < 0 and n > M where h(n) is the im pulse resp onse o f the F IR filter. The output seq u en ce y ( n ) o f the FIR filter can be exp ressed in the tim e dom ain as the con volu tion o f x( n) and h(n), that is y(n) = M- 1 h(k) x( n — k ) (5.3.1) Since h(n) and jc(n) are finite-duration seq u en ces, their con volu tion is also finite in duration. In fact, the duration o f y( n) is L + M — 1. T h e frequency-dom ain equivalent to (5.3.1) is Y(co) = X( w) H( ( o ) (5.3.2) If the seq u en ce y (n ) is to be represented u n iqu ely in the freq u en cy dom ain by sam ples o f its spectrum Y (to) at a set o f d iscrete freq u en cies, th e n um ber o f distinct sam ples m ust equal or exceed L + M - 1. T h erefore, a D F T o f size N > L + M —I, is required to represent [y(n)\ in the frequency dom ain. N ow if Y(k) = Y{a>)\m 2 ,tkfN = X M H M U h t /N k = 0 , 1 ,. . . , N — 1 it = 0 ,1 ....... N - 1 then Y(k) = X ( k ) H ( k ) Jfc = 0 , l , . . . , t f - 1 (5.3.3) w h ere {X(Jfc)} and {f/(Jt)} are the N -p oin t D F T s o f th e corresp on d ing sequences x( n) and h (n), resp ectively. Since the seq u en ces x ( n) and h ( n ) have a duration less than N , w e sim ply pad th ese seq u en ces w ith zeros to in crease their length to N. T his increase in th e size o f the seq u en ces d o e s n ot alter their spectra X(o>) and H(a>), which are con tin u ou s spectra, sin ce the seq u en ces are ap eriod ic. H ow ever, by sam pling their spectra at N equally sp aced p oin ts in freq u en cy (com p u ting the JV-point D F T s), w e have increased the num ber o f sam p les that represent these seq u en ces in the frequency dom ain b eyon d the m inim um n u m b er (L or M, re­ sp ectively). Sec. 5.3 427 Linear Filtering Methods Based on the DFT Since the N = L + M — 1-point D F T o f the output seq u en ce y ( n ) is sufficient to represent y ( n ) in the frequency dom ain, it follow s that the m ultiplication o f the N -point D F T s X( k ) and H{ k) , according to (5.3.3), follow ed by the com putation o f the Appoint ID F T , m ust yield the seq u en ce {,v(n)J. In turn, this im plies that the Appoint circular con volu tion o f x( n) with h(n) m ust b e eq u ivalen t to th e linear con v o lu tio n o f x ( n ) with h(n). In other words, by increasing th e length o f the seq u en ces x( n) and h(n) to N points (by appending zeros), and then circularly con volvin g the resulting seq u en ces, w e obtain the sam e result as w ou ld have b een ob tain ed with linear con volu tion . Thus with zero padding, the D F T can b e used to perform linear filtering. T h e follow in g exam p le illustrates the m eth od ology in the u se o f the D F T in linear filtering. Example 5.3.1 By m eans of the D FT and IDFT, determine the response of the FIR filter with impulse response h(n) = 11.2.3} t to the input sequence x(n) = |1. 2, 2.1) t Solution The input sequence has length L = 4 and the impulse response has length M = 3. Linear convolution of these two sequences produces a sequence of length N = 6. Consequently, the size of the DFTs must be at least six. For simplicity we com pute eight-point DFTs. We should also m ention that the efficient com putation of the DFT via the fast Fourier transform (FFT) algorithm is usually perform ed for a length N that is a power of 2. Hence the eight-point D FT of jr(n) is 7 Jkn/8 = 1 + 2e~W + le->*k’2 -I- e~‘**k,A This com putation yields X (4) = 0 X to -i+ J XC7 + k = 0 .1 ........7 The Discrete Fourier Transform: Its Properties and Applications 428 Chap. 5 The eight-point DFT of h(n) is 7 H(k) = = 1 + 2e~J*k/* + 3>e- jnkr2 Hence H(0) = 6, H (l) = l + V 2 - > (3 + V 5 ) , H( 2 ) = - 2 - j 2 HO) = 1 - ^ 2 + > (3 - V 2 ) , H( 4) = 2 H(5) = 1 - 7 2 - y (3 - J 2 ) , H( 6) = ~2 + >2 W(7) = 1 + V2 + j ( 3 + J 2 ) The product of these two DFTs yields Y{k), which is Y (0) = 36, y (l) = - 1 4 .0 7 -> 1 7 .4 8 y(4) = 0, V(5) = 0.07 —y 0.515 Y (2) = >4 Y( 6) = ~ j 4 X(3) = 0.07 + ,0.515 Y(7) = -14.07 + >17.48 Finally, the eight-point ID FT is 7 v(n) = Y y(k)ej2nk"/H n = 0, 1........7 *=■0 This computation yields the Tesult >(«) = (1 ,4 ,9 ,1 1 .8 ,3 ,0 ,0 } t We observe that the first six values of y(rt) constitute the set of desired output values. The last two values are zero because we used an eight-point D FT and IDFT, when, in fact, the minimum number of points required is six. A lthough the m ultiplication o f tw o D F T s corresp on d s to circular convolution in the tim e dom ain, w e have ob served that padding the seq u en ces x ( n ) and h(n) with a sufficient num ber o f zeros forces the circular con volu tion to yield the sam e output sequ en ce as linear con volu tion . In the case o f the F IR filtering problem in E xam p le 5.3.1, it is a sim ple m atter to d em onstrate that the six-point circular convolution o f the sequ en ces h( n) = {1, 2 , 3 , 0 , 0, 0} t (5.3.4) x ( n ) = {1 ,2 , 2 , 1 , 0 , 0} t (5.3.5) results in the output sequ en ce y ( n) = {1, 4, 9 , 1 1 , 8 , 3} t w hich is the sam e seq u en ce ob tain ed from linear con volu tion . (5.3.6) Sec. 5.3 Linear Filtering Methods Based on the DFT 429 I t is im p o rta n t f o r u s to u n d e rs ta n d th e aliasing th a t re su lts in th e tim e d o m a in w h e n th e size o f th e D F T s is sm a lle r th a n L + M —I. T h e fo llo w in g e x am p le focuses o n th e aliasin g p ro b le m . Exam ple 5.3.2 D eterm ine the sequence v(n) that results from the use of four point DFTs in Exam­ ple 5.3.1. Solution The four-point D F T of h(n) is t*)jre.-jink*!* H(k) = ^ A (fi n\ ' ff-0 H(k) = \ + 2 e - ink/1 + 3 e - ikn k = 0 ,1 ,2 , 3 Hence H(0) = 6, H( \ ) = - 2 - j 2 , H( 2) = 2, H ( 3 ) = - 2 + j2 The four-point DFT of x («} is X(k) = \ + 2c ~jnk/2 + 2e~,7,k + 3e ~J%7,t/2 k = 0, 1, 2, 3 Hencc *(()) = 6, X (l) = - l - j , X(2) = 0, Jf(3) = —1 + y The product of these two four-point DFTs is K(0) = 36, f ( l ) = ;4 , Y( 2) = 0. K(3) = ~ j 4 The four-point ID FT yields y(n) = \ Y ^ k^eJ2xk”,A *=o « = 0 , 1 ,2 ,3 = 1(36 + j 4e Jn"^ - j 4e J1*na) Therefore, v(n) = {9,7, 9,11} t The reader can verify that the four-point circular convolution of h(n) with x(n) yields the same sequence y(n). I f w e c o m p a re th e re su lt y (n ), o b ta in e d fro m fo u r-p o in t D F T s w ith th e s e ­ q u e n c e y (n ) o b ta in e d fro m th e use o f e ig h t-p o in t (o r six -p o in t) D F T s, th e tim ed o m a in aliasin g effe cts d e riv e d in S ectio n 5.2.2 a re clearly e v id e n t. In p a rtic u la r, >(4) is a liased in to y (0) to yield y (0) = y((» + y ( 4) = 9 S im ilarly, _y(5) is a liased in to _y(l) to yield ?(1) = ? (!) + ?(5) = 7 430 The Discrete Fourier Transform: Its Properties and Applications Chap. 5 A ll other aliasing has n o effect since y(n ) = 0 for n > 6 . C on sequ en tly, w e have y ( 2) = y ( 2) = 9 y(3) = y(3) = 1 1 T h erefore, on ly the first tw o p oints o f y ( n ) are corrupted by th e effect o f aliasing [i.e., y(0) 7^ y(0) and v( l ) ^ y (l)]. T his observation has im portan t ram ifications in the discussion o f the follow in g section , in which w e treat th e filtering o f long sequ en ces. 5.3.2 Filtering of Long Data Sequences In practical applications involving linear filtering o f signals, the input sequ en ce x ( n ) is often a very long sequ en ce. T his is especially true in so m e real-tim e signal processing applications concerned with signal m onitorin g and analysis. Since linear filtering perform ed via the D F T in volves op eration s on a block o f data, w hich by necessity m ust be lim ited in size due to lim ited m em ory o f a digital com puter, a long input signal seq u en ce m ust be se g m en ted to fixed-size blocks prior to processing. Since the filtering is linear, su ccessive blocks can be p rocessed on e at a tim e via the D F T and the output blocks are fitted togeth er to form the overall output signal sequ en ce. W e now d escribe tw o m eth od s for linear F IR filtering a lon g seq u en ce on a block-by-block basis using the D F T . T h e input seq u en ce is segm en ted in to blocks and each block is p rocessed via the D F T and ID F T to prod u ce a block o f output data. T h e output blocks are fitted togeth er to form an overall output sequ en ce which is identical to the seq u en ce ob tain ed if the lon g block had b een processed via tim e-dom ain con volu tion . T h e tw o m eth od s are called the overlap-save m e t h o d and the o verlap-a dd m eth o d . For b oth m eth od s w e assum e that the F IR filter has duration M . The input data seq u en ce is segm en ted in to blocks o f L points, w h ere, by assum ption, L » M w ithout lo ss o f generality. Overlap-save method. In this m eth od the size o f the in p ut data blocks is N — L 4- M — 1 and th e size o f the D F T s and ID F T are o f len gth N . E ach data block consists o f the last M - 1 data points o f the p reviou s data b lock follow ed by L new data p oin ts to form a data seq u en ce o f len gth N = L 4- M — 1. A n N -point D F T is com p uted for each data block. T h e im pulse resp onse o f the F IR filter is increased in length by appending L - l zero s and an Appoint D F T o f the sequ en ce is com p uted on ce and stored. T h e m ultiplication o f the tw o Af-point D F T s {//(Jt)} and {Xm(Jt)} for the m th b lock o f data yields Ym(k) = H ( k ) X m(k) k = 0 , 1 .........N - 1 (5.3.7) T hen the Appoint ID F T yield s the result L ( n ) = { ^ (0 )y ffl(l) • • ■ym(M - 1)ym{M ) • ■■ym(N - 1)} (5.3.8) Sec. 5.3 Linear Filtering Methods Based on the DFT 431 Sin ce the data record is o f length N, the first Af — 1 p oin ts o f >m(n) are corrupted by aliasing and m ust be discarded. T h e last L p oints o f y„( n) are exactly the sam e as the result from linear con volu tion and, as a con seq u en ce, >«(n) = y»( n) , n = M, M + 1.........N - 1 (5.3.9) T o avoid lo ss o f data du e to aliasing, the last Af —1 p oin ts o f each data record are saved and th ese p oin ts b ecom e the first Af — 1 data p oin ts o f the subsequent record, as indicated above. T o begin the processing, the first Af — 1 p oints o f the first record are set to zero. Thus the blocks o f data seq u en ces are jci(n) = (0, 0 ........ 0, x(0), x ( l ) .......... x ( L - 1)} (5.3.10) M —1 points x2(n) = {x ( L - M + 1).........x ( L — 1 ) , x ( L ) , . . . , x ( 2 L - l) j M - 1 data points from i|(n) x3(rt) = {x ( 2 L - M + l ) .........x ( 2 L — 1), x ( 2 L ) .......... x ( 3 L - l } ) M - 1 data points from (5.3.11) L new data points (5.3.12) I new data points and so forth. T h e resulting data sequ en ces from the ID F T are given by (5.3.8), w here the first M — 1 points are discarded due to aliasing and the rem aining L p oin ts con stitute the d esired result from linear con volu tion . T h is segm en tation o f th e input data and the fitting o f the output data blocks togeth er to form the output seq u en ce are graphically illustrated in Fig. 5.10. Overlap-add method. In this m eth od the size o f the input data block is L p oin ts and the size o f th e D F T s and ID F T is N ~ L + Af - 1. T o each data block w e append Af — 1 zeros and com p ute the N -point D F T . T h u s the data b lock s may be rep resen ted as jti(n) = {jc(0), jc(1 )......... jc( £ - 1 ) , 0 , 0 _____0} M -l (5.3.13) zeros X2(n) = [ x( L) , x ( L + 1), • . . , X(2L - 1), 0, 0 , . . . , 0} (5.3.14) M-1 zeros jt3(n) = { x ( 2 L ) .........x( 3 L - 1), 0 , 0 , . . . , 0) M -\ (5.3.15) zeros and so on . T h e tw o Appoint D F T s are m ultiplied togeth er to form Ym(k) = H ( k ) X m(k) * = 0 , 1 .........N - 1 (5.3.16) T h e ID F T y ield s data blocks o f length N that are free o f aliasing sin ce the size o f th e D F T s and ID F T isW = Z, + Af —1 and the seq u en ces are increased to N -p oin ts b y ap p en d in g zero s to each block. 432 The Discrete Fourier Transform: Its Properties and Applications Chap. 5 Output signal points / Discard P°ints Figure 5.10 L in ear F IR filtering by the overlap-save m ethod. Since each data block is term inated with M — 1 zeros, the last M — 1 points from each output block m ust be overlap p ed and added to the first M - 1 p oin ts of the succeeding block . H en ce this m eth od is called th e overlap-add m ethod. This overlapping and adding yields the output seq u en ce y (« ) = {y i(0 ), ^ i ( l ) , . . . , y \ ( L - l ) , y i ( L ) + y2(0 ), ^ ( L + 1) + (5.3.17) >■2( 1 ) .........y \ ( N - 1) + y i ( M — 1), y 2 ( M ) , . . . } T he segm en tation o f the input data in to b lock s and th e fitting o f th e output data blocks to form the output seq u en ce are graphically illustrated in F ig. 5.11. A t this poin t, it m ay appear to the reader that th e use o f th e D F T in linear F IR filtering is n ot o n ly an indirect m eth od o f com puting the o u tp u t o f an FIR filter, b ut it m ay a lso be m ore exp en sive com p utationally since th e input data must first b e converted to the frequency d om ain via th e D I T , m ultip lied by th e D F T o f th e F IR filter, and finally, converted back to th e tim e d om ain via the ID FT. O n th e contrary, h ow ever, by using the fast F ourier transform algorithm , as will b e show n in C hapter 6, th e D F T s and ID F T require few er com p utations to com ­ pu te th e output seq u en ce than th e direct realization o f the F IR filter in the time Sec. 5.4 Frequency Analysis of Signals Using the DFT 433 Input data \ MA Output data M-1 point.*;/ PZJ add — V/y together M-l points^ add — together Figure 5.11 Linear FIR filtering by the overlap-add method. dom ain. This com putational efficiency is the basic advantage o f using the D F T to com p ute the output o f an F IR filter. 5.4 FREQUENCY ANALYSIS OF SIGNALS USING THE DFT T o com p ute the spectrum o f either a con tinu ou s-tim e or d iscrete-tim e signal, the valu es o f the signal for all tim e are required. H ow ever, in practice, w e observe signals for on ly a finite duration. C on sequ en tly, the spectrum o f a signal can on ly b e approxim ated from a finite data record. In this section w e exam ine the im plications o f a finite data record in frequency analysis using the D F T . If the signal to b e analyzed is an analog signal, w e w ou ld first pass it through an an tialiasing filter and th en sam ple it at a rate F, > 2 5 , w h ere B is the band­ width o f the filtered signal. T h u s th e highest frequency that is contained in the sam pled signal is Fs f l . F inally, for practical purposes, w e lim it the duration o f the signal to th e tim e interval To — L T , w h ere L is the num ber o f sam ples and T The Discrete Fourier Transform: Its Properties and Applications 434 Chap. 5 is the sam ple interval. A s w e shall ob serve in the follow in g d iscu ssion , the finite observation interval for the signal places a limit on the freq u en cy resolution; that is, it lim its our ability to distinguish tw o frequency com p on en ts that are separated by less than 1 /To = 1/Z-7" in frequency. L et {*(«)} d en o te the seq u en ce to b e analyzed. L im iting th e duration o f the seq u en ce to L sam ples, in the interval 0 < n < L — 1, is eq u ivalen t to m ultiplying {jc(/i)} by a rectangular w indow w ( n ) o f length L. That is, x (n) = x ( n ) w ( n ) (5.4.1) w h ere u;w = {J ; , v,, 0 < n < L - 1 otherw ise (5.4.2) N ow su p p ose that the sequ en ce x ( n ) consists o f a single sin u soid , that is, x( n ) = coscoon (5.4.3) Then the Fourier transform o f the finite-duration seq u en ce x ( n ) can be expressed X(£u) = $[W '(cu-<u0) + W 'to + wo)] (5.4.4) where W(a>) is the Fourier transform o f the w indow seq u en ce, w h ich is (for the rectangular w indow ) W{0}) = D/2 sin(df/ 2 ) (5.4.5) T o com pute X(a>) w e use the D F T . B y padding the seq u en ce x ( n ) w ith N — L zeros, we ca n c o m p u te the N -point D F T o f the truncated (L p oin ts) seq u en ce {Jt(n)J. T he m agnitude spectrum |A W I = |X(£t»*) | for o* = 2 n k / N , k = 0, l , . . . , A f , is illustrated in Fig. 5.12 for L = 25 and N = 2048. W e n ote that the w indow ed spectrum X((o) is n ot localized to a single frequency, but instead it is spread out over the w h ole frequency range. Thus the p ow er o f the origin al signal sequence {jr(n)} that was concentrated at a single frequency has b een spread by the window into the entire freq u en cy range. W e say that the p ow er has “lea k ed o u t” in to the entire frequency range. C onsequently, this p h en om en on , which is a characteristic o f w indow ing the signal, is called leakage. Frequency Figure 5.12 Magnitude spectrum for I = 25 and n = 2048, illustrating the occurrence of Leakage. Sec. 5.4 435 Frequency Analysis of Signals Using the DFT W in d o w in g n o t o n ly d isto rts th e sp e ctral e stim a te d u e to th e le a k a g e effects, it also re d u c e s s p e c tra l re so lu tio n . T o illu stra te th is p ro b le m , let us c o n s id e r a signal s e q u e n c e co n sistin g o f tw o fre q u e n c y co m p o n e n ts, x ( n ) = cos co\ n + c o s a ^ n (5.4.6) W h e n th is se q u e n c e is tr u n c a te d to L sam ples in th e ra n g e 0 < n < L — 1, th e w in d o w e d s p e c tru m is X ( w ) — \ [ W (to — u>i) + W (a> — a>2 ) + W((o + ati) + W(a> + a>2)] (5.4.7) T h e s p e c tru m W (to) o f th e re c ta n g u la r w indow se q u e n c e h as its first z e ro crossing a t co = 2 n / L . N o w if |<yi — a ^ l < 2n / L , th e tw o w in d o w fu n c tio n s W(co — a>\) a n d V/(o) — an) o v e rla p a n d , as a co n se q u e n c e , th e tw o sp e c tra l lin es in x ( n ) a re n o t d istin g u ish a b le . O n ly if (a>\ — a>i) > 2 n / L will w e se e tw o s e p a ra te lo b es in th e sp e c tru m X(a>). T h u s o u r a b ility to reso lv e sp e c tra l lines o f d iffe re n t fre q u e n c ie s is lim ite d b y th e w in d o w m ain lo b e w idth. F ig u re 5.13 illu s tra te s th e m a g n itu d e sp e c tru m |X (a»)|, c o m p u te d via th e D F T , fo r th e se q u e n c e + cosa^n (5.4.8) Magnitude x ( n ) = costuo n + cos Frequency Frequency (a) <b) (c) Figure 5.13 Magnitude spectrum for the signal given by (5.4.8), as observed through a rectangular window. 436 The Discrete Fourier Transform: Its Properties and Applications Chap. 5 w here ato = 0.2n , = 0. 22n, and coi = 0.6jt. T h e w indow len gth s selected are L = 25, 50, and 100. N o te that o>o and are not resolvab le for L = 25 and 50, but th ey are resolvab le for L = 100. T o reduce leak age, w e can select a data w indow w( n) that h as low er sid elob es in the frequency d om ain com pared with the rectangular w in d ow . H ow ever, as we d escribe in m ore detail in Chapter 8, a reduction o f the sid elo b es in a w indow W( w) is obtained at the ex p en se o f an increase in the width o f th e m ain lo b e o f W(a>) and h en ce a loss in resolution. T o illustrate this point, let us consider the H anning w indow , w hich is specified as w( n ) = ^(1 - cos jTTj-n), 0 < n < i. — 1 0, otherw ise (5.4.9) Figure 5.14 show s |A"(<y)| for the w indow o f (5.4.9). Its sid elo b es are significantly sm aller than th o se o f the rectangular w in d ow , but its m ain lob e is approxim ately tw ice as w ide. Figure 5.15 sh ow s the spectrum o f the signal in (5.4.8), after it is w indow ed by the H anning w indow , for L = 50, 75, and 100. T h e reduction o f the sid elo b es and th e d ecrease in the resolu tion , com pared with the rectangular w indow , is clearly evident. For a general signal seq u en ce ljr(n)}, the frequency-dom ain relationship be­ tw een the w indow ed seq u en ce i ( n ) and the original seq u en ce x ( n ) is given by the con volu tion form ula (5.4.10) T h e D F T o f the w in d ow ed seq u en ce x( n) is the sam pled version o f the spectrum X(a>). T hus w e have X( k ) = X ( » ) U W (5.4.11) k = 0,1,..., N - 1 Just as in the case o f th e sinusoidal seq u en ce , if the spectrum o f th e w indow is relatively narrow in w idth com pared to the spectrum X (to) o f th e signal, the win­ dow function has o n ly a sm all (sm ooth in g) effect on the spectrum X (w). O n the other hand, if the w in d ow function has a w ide spectrum com pared to the w idth of 6 25 0 — r r 2 0 Frequency r 2 Figure 5.14 Magnitude spectrum of tbe Hanning window. 437 Frequency Analysis of Signals Using the DFT Magnitude Sec. 5.4 9 8 L = 100 7 «; 6 -r - T 0 2 I 2 * Frequency (O Figure 5.15 Magnitude spectrum of the signal in (5.4.8) as observed through a Hanning window. X(a>), as w ould b e the case w hen the num ber o f sam ples L is sm all, the w indow spectrum m asks the signal spectrum and, con sequ en tly, the D F T o f the data re­ flects th e spectral characteristics o f the w in d ow function. O f course, this situation should b e avoided. Example 5.4.1 The exponential signal *..(0 H r t >o t <0 is sampled at the rate F, = 20 samples per second, and a block of 100 samples is used to estimate its spectrum. Determine the spectral characteristics of the signal x„(t) by computing the DFT of the finite-duration sequence. Compare the spectrum of the truncated discrete-time signal to the spectrum of the analog signal. Solution The spectrum of the analog signal is Xa(F) = 1 1 + ;2 jtF The exponential analog signal sampled at the rate of 20 samples per second yields 438 The Discrete Fourier Transform: Its Properties and Applications Chap. 5 the sequence x(n) = <r"r = c - '/ 20, n > 0 Now, let 0 < n < 99 (0.95)", 0, otherwise The A/-point D F T of die L = 100 point sequence is 99 X(k) = Y i<-n '>e~i2*k/N * = 0 ,1 ........A ' - l To obtain sufficient detail in the spectrum we choose N = 200. This is equivalent to padding the sequence x ( n) with 100 zeros. The graph of the analog signal xa(t) and its magnitude spectrum |Xa(F )| are illustrated in Fig. 5.16(a) and (b), respectively. The truncated sequence xin) and its N = 200 point D FT (m agnitude) are illustrated in Fig. 5.16(c) and (d), respectively. 1.0 0.8 0.6 0.4 0.2 0 0 2 3 5 4 (a) _■ -5 0 ■ -4 0 ■ -3 0 ■ -2 0 -1 0 JL 0 10 20 i ■ 30 40 ■ F 50 (b) Figure 5.1ti Effect o f windowing (truncating) the sampled version o f the analog signal in Example 5.4.1. Sec. 5.4 Frequency Analysis of Signals Using the DFT 439 (d) (*) Figure 5.16 Continued In this case the D FT {X (Jt)} bears a close resem blance to the spectrum of the analog signal. The effect of the window function is relatively small. O n the other hand, suppose that a window function of length L = 20 is selected. T hen the truncated sequence x(n) is now given as .£(„) _ [ ( ° - 95)"1 0, 0 < n < 19 otherwise 440 The Discrete Fourier Transform: Its Properties and Applications Chap. 5 Its N = 200 point DFT is illustrated in Fig. 5.16(e). Now the effect of the wider spectral window function is dearly evident. First, the main peak is very wide as a result of the wide spectral window. Second, the sinusoidal envelope variations in the spectrum away from the main peak are due to the large sidelobes of the rectangular window spectrum. Consequently, the DFT is no longer a good approximation of the analog signal spectrum. 5.5 SUMMARY AND REFERENCES T h e m a jo r focus o f th is c h a p te r w as o n th e d isc re te F o u rie r tra n s fo rm , its p ro p e rtie s an d its ap p licatio n s. W e d e v e lo p e d th e D F T by sa m p lin g th e sp e c tru m X (&>) o f th e se q u en ce x(n'). F re q u e n c y -d o m a in sa m p lin g o f th e sp e c tru m o f a d is c re te -tim e signal is p a r­ ticu larly im p o rta n t in th e p ro cessin g o f d ig ital signals. O f p a r tic u la r significance is th e D F T , w hich w as show n to u n iq u e ly re p re s e n t a fin ite -d u ra tio n se q u e n c e in th e fre q u e n c y d o m a in . T h e ex iste n ce o f c o m p u ta tio n a lly efficien t a lg o rith m s fo r th e D F T , w hich a re d e sc rib e d in C h a p te r 6, m a k e it p o ssib le to d ig itally p ro cess sig n als in th e fre q u e n c y d o m a in m u ch fa ste r th a n in th e tim e d o m a in . T h e p ro ­ cessin g m e th o d s in w hich th e D F T is esp ecially su ita b le in clu d e lin e a r filtering as d e sc rib e d in th is c h a p te r a n d c o rre la tio n , an d sp e c tru m an aly sis, w h ich a re tre a te d in C h a p te rs 6 a n d 12. A p a rtic u la rly lucid an d co n cise tre a tm e n t o f th e D F T and its ap p licatio n to fre q u e n c y an aly sis is given in th e b o o k by B rig h a m (1988). PROBLEMS 5.1 The first five points of the eight-point DFT of a real-valued sequence are (0.25, 0.125 - j 0.3018, 0, 0.125 - y0.0518, 0}. Determine the remaining three points. 5.2 Compute the eight-point circular convolution for the following sequences. (a) *,(«) = (1,1,1,1,0,0,0,0} . 3jt x2(n) = sin — -n 8 „ _ 0 < n < 7 0 <n <7 3n . _ *2(n) = cos — n 0< n < 7 O (c) Compute the DFT of the two circular convolution sequences using the DFTs of *i(n) and X2 (n). (b) *,(») = (i)" S 3 Let X (Jt), 0 < Jt < N —1, be the Appoint DFT of the sequence *(n), 0 < n < N —1. We define y /ia _ f 0 < k < k c, N - k c < k < N - 1 {) 1 0, kc < k < N —ke and we compute the inverse //-point DFT of X(k), 0 < k < N - 1. What is the effect of this process on the sequence x («)? Explain. Chap. 5 441 Problems 5.4 F or the sequences jci(n) = cos ^ - n N jc2(«) = sin N n 0 <n <N - 1 determ ine the N -point: (a) Circular convolution jc^n) (N)x 2(n) (b) Circular correlation of *i(n) and x 2(n) (c) Circular autocorrelation of xi(n) (d) Circular autocorrelation of x 2(n) 5.5 Com pute the quantity N-l y ^ x ](n)x 2(n) »=0 for the following pairs of sequences. (a) JC](n) = x 2 (n) = cos ~ n N 0 < n < N —1 x 2(n) = sin — n 0 < n < N —1 N N (c) *](n) = 6(n) + 5(n - 8) *2(«) = « ( « ) - u(n - N) (b) Xi (n) = cos — n 5.6 D eterm ine the A/-point D FT of the Blackman window if(n) = 0.42 —0.5 cos —— - -I- 0.08c o s ------ Ar — 1 A '- l 0 < n < N —1 5.7 If X (Jt) is the D FT of the sequence *(n), determ ine the Af-point D FTs of the sequences 2nkn xc(n) — x(n) c o s ------N . . . 0< n < N - 1 . 2nkn x,(n) = x ( n ) sin —— Ar 0 < n < N —1 and in terms of X (Jt). 5.8 Determine the circular convolution of the sequences *i(n) = {1,2,3,1} t x2(n) = {4,3,2,2} t using the time-domain formula in (5.2.39). 5.9 Use the four-point DFT and IDFT to determine the sequence X3(n) = *i(n)(§)*2(*) where xi(n) and x 2(n) are the sequence given in Problem 5.8. 5.10 Compute the energy of the N -point sequence 442 The Discrete Fourier Transform: Its Properties and Applications Chap. 5 5.11 Given the eight-point D FT of the sequence *(«) = 1. 0, 0 <n < 3 4 <n < 7 compute the D FT of the sequences: 1, n= 0 (a) x\(n) = 0, 1< n < 4 1. 5 <n < 7 0, 0 <n < 1 (b) jr2(n) = 1 , 2 <n < 5 0, 6< n < 7 5.12 Consider a finite-duration sequence jc(n) = {0 ,1 .2 ,3 .4 ) t (a) Sketch the sequence .t(n) wilh six-poini DFT £(*) = Wj’ XOfc) k = 0 .1 ........6 (b) D eterm ine the sequence y(n) with six-point D FT K(jt) = Re |X(A)|. (c) Determ ine the sequence u(w) with six-point D FT V(k) = Im |X(A-)|. 5.13 Let x p(n) be a periodic sequence with fundamental period N. Consider the following DFTs: DFT x p(n) *— *• *,(*) N x („) D FT 3^ X ,(k) (a) W hat is the relationship between Xi(^) and XiOt)? (b) Verify the result in part (a) using the sequence xp(n) = {■■• 1. 2 ,1 ,2 ,1 ,2 ,1 .2 - ■] t 5.14 Consider the sequences X] (n) = {0,1, 2,3,4} t x 2(n) = {0 ,1 ,0 ,0 .0 ] t s(n) = {1. 0, 0 .0 ,0 ) t and their 5-point DFTs. (a) Determine a sequence y( n ) so that Y(k) = A-! fJt). (b) Is there a sequence x3(n) such that S(k) = X^(k)X^(k)'! 5.15 Consider a causal LTI system with system function The output y(n) of the system is known for 0 < n < 63. Assuming that H(z) is available, can you develop a 64-point DFT method to recover the sequence x{n), 0 < n < 63? Can you recover all values of x(n) in this interval? 5.16* The impulse response of an LTI system is given by h(n) = S(n) - ji(n - /to). To determine the impulse response g(n) of the inverse system, an engineer computes the Af-point D FT H(k), N = 4ko, of h(n) and then defines g(n) as the inverse DFT of Chap. 5 443 Problems G (k) = 1j H ( k ), k = 0, 1, 2 , . . . , A' - l . Determine g(n) and the convolution h(n)*g(n), and comment on whether the system with impulse response g(n) is the inverse of the system with impulse response h(n). 5.17* Determine the eight-point DFT of the signal *(«) = [ 1 , 1 , 1 . 1 . 1 , 1 , 0 , 0 } and sketch its magnitude and phase. 5.18 A linear time-invariant system with frequency response H(u>) is excited with the periodic input OO jc(n) = ^ S(n —kN) *=-oo Suppose that we compute the Af-point DFT Y(k) of the samples >■(«), 0 < it < N - 1 of the output sequence. How is ^(Jt) related to //(w)? 5.19 D F T o f real sequences with special symmetries (a) Using the symmetry properties of Section 5.2 (especially the decomposition prop­ erties), explain how we can compute the DFT of two real symmetric (even) and two real antisymmetric (odd) sequences simultaneously using an W-point DFT only. (b) Suppose now that we are given four real sequences *,(«), i = 1, 2, 3, 4, that are all symmetric [i.e., X j ( n ) = x j ( N — n ), 0 < n < N — 1], Show that the sequences j,-(n) = X j ( n + 1) — X j ( n — 1) are antisymmetric [i.e., s, (n) = —s;(N - n) and 5, (0 ) = 0 ]. (c) Form a sequence *(/i) using Jti(n), JC2 (n), ^(n), and ^(n) and show how to compute the DFT Xj(k) of x,(n), i = 1, 2, 3, 4 from the N-point DFT X(k) of x(n). (d) Are there any frequency samples of X, (k) that cannot be recovered from X(k)? Explain. 5.20 D F T o f real sequences with o dd harmonics only Let x(n) be an A'-point real sequence with Af-point DFT X(k) (N even). In addition, x(n) satisfies the following symmetry property: / N \ x ( n + y j = -x (n ) N n = 0 , 1 ........y - 1 that is, the upper half of the sequence is the negative of the lower half. (a) Show that X (k) = 0 k even that is, the sequence has a spectrum with odd harmonics. (b) Show that the values of this odd-harmonic spectrum can be computed by evaluat­ ing the A”/2-point DFT of a complex modulated version of the original sequence x(n). 5.21 Let x„(t) be an analog signal with bandwidth B = 3 kHz. We wish to use a N = 2"point DFT to compute the spectrum of the signal with a resolution less than or equal to 50 Hz. Determine (a) the minimum sampling rate, (b) the minimum number of required samples, and (c) the minimum length of the analog signal record. 444 The Discrete Fourier Transform: Its Properties and Applications Chap. 5 5.22 Consider the periodic sequence 2x — oo < n < oo x p(n) = COS — n with frequency /o = ^ and fundamental period N = 10. Determine the 10-point DFT of the sequence x ( n ) = x p(n), 0 < n < Af - 1. 5.23 Compute the W-point DFTs of the signals (a) ■>:(") = ^(«) (b) x ( n) = S(n — no) (c) Jt(n) = a " (d) x(n) 0 < fiq < N 0 < n < N — 1 1, , Q 0 < n < N/ 2 - l ( N even) N p.< n< N (e) x(n) = e’a*IN)k<> 0 < n < N - 1 2x (I) x(n) = cos — kon 0 < n < N —1 N (g) j:(/i) = sin -j^kort 0< n < N - 1 i I n even ) ^ 10, « odd 0 < n < Af —1 5.24 Consider the finite-duration signal x(n) = {1, 2, 3, 1} (a) Compute its four-point DFT by solving explicitly the 4-by-4 system of linear equations defined by the inverse DFT formula. (b) Check the answer in part (a) by computing the four-point DFT, using its defini­ tion. 5.25 (a) Determine the Fourier transform X (tu) of the signal x(n) = { 1 ,2 ,3 ,2 ,1 ,0 1 t (b) Compute the 6-point DFT V (k) of the signal i»(n) = { 3 ,2 ,1 ,0 ,1 ,2 } (c) Is there any relation between X(w) and V(Jt)? Explain. 5.26 Prove the identity Y & ( n + l N ) = ± Y eJQ*/,'*K J—OC kmC (Hint: Find the DFT of the periodic signal in the left-hand side.) 5 J 7 Computation o f the even and odd harmonics using the DFT sequence with an Appoint DFT X(k) ( N even) (a) Consider the time-aliased sequence x ( n + I M ), Let x(n) be an Appoint 0 < n < M —1 fv-00 0, elsewhere What is the relationship between the Af-point DFT K(Jt) of y(/i) and the Fourier transform X(w) of x(n)? Chap. 5 Problems 445 (b) Let 0 < n < N —1 — J x (n ) + x ( n + ~ l ' (-*?)■ I 0, elsewhere and y(n) DFT K(Jt) N/l Show that AT(Jt) = Y(k/2), k = 2, 4 , . . . , N - 2. (c) Use the results in parts (a) and (b) to develop a procedure that computes the odd harmonics of X(k) using an jV/2-point DFT. 5•28"' Frequency-domain sampling Consider the following discrete-time signal C( n ) = h ' " ' } 0, |n| > L where a = 0.95 and L = 10 (a) Com pute and plot the signal x(n). (b) Show that x(n)e X (w )= = x(0) + 2 ^ ^ x(n) cos wn Plot X{i») by computing it at w = jri/1 0 0 , k = 0, 1........100. (c) Com pute N \N ) for N = 30. (d) D eterm ine and plot the signal x(n) = *=o W hat is the relation between the signals x(n) and x ( n)l Explain. (e) Com pute and plot the signal ii(n ) = X x(n - IN), - L < n < L for N = 30. Com pare the signals x(rt) and X](n). (f) R epeat parts (c) to (e) for N = 15. 5.29* Frequency-domain sampling The signal x(n) = a 1"1, - 1 < a < 1 has a Fourier transform X(w) = 1— 1 —2a cos <o + a2 (a) Plot X(w) for 0 < w < 2jt, a = 0.8. Reconstruct and plot X(w) from its samples X Qj r k / N) , 0 < k < N - 1 for: (b) N = 20 (c) N = 100 (d) Com pare the spectra obtained in parts (b) and (c) with the original spectrum X(a>) and explain the differences. (e) Illustrate the time-domain aliasing when N = 20. 446 The Discrete Fourier Transform: Its Properties and Applications 5 J0 * Frequency analysis o f amplitude-modulated discrete-time signal Chap. 5 T he discrete-time (a) Sketch the signals jr(n), xc(/i), and *»m(n), 0 < n < 255. (b) Com pute and sketch the 128-point D FT of the signal 0 < n < 127. (c) Compute and sketch the 128-point D FT of the signal xtm(n), 0 < n < 99. (d) Com pute and sketch the 256-point D FT of the signal jcani{n), 0 < n < 179. (e) Explain the results obtained in parts (b) through (d), by deriving the spectrum of the am plitude-m odulated signal and comparing it with the experim ental results. 5.31* The sawtooth waveform in Fig. P5.31 can be expressed in the form of a Fourier series as ) (a) D eterm ine the Fourier series coefficients c*. (b) Use an N -point subroutine to generate samples of this signal in the time domain using the first six term s of the expansion for N « 64 and N = 128. Plot the signal x(f) and the samples generated, and com m ent on the results. Figure P531 5 3 2 Recall that the Fourier transform of x (r) = eJ0* is X ( j i 2) = 2jtS(£2 - i2o) and the Fourier transform of 0 < t < To otherwise is e-jOT<i/l (a) D eterm ine the Fourier transform Y ( j n ) of y(r) = p(t)eja°' and roughly sketch |K0 '£2)| versus £2. Chap. 5 Problems 447 (b) Now consider the exponential sequence jr(n) = where <uo is some arbitrary frequency in the range 0 < ojo < tt radians. Give the most general condition that a>o must satisfy in order for x(n) to be periodic with period P (P is a positive integer). (c) Let y(n) be the finite-duration sequence v (n ) = x ( n ) w N ( n ) = e i w ° " u i s ( n ) where w^( n) is a finite-duration rectangular sequence of length N and where x(n) is not necessarily periodic. D eterm ine Y(a)) and roughly sketch \Y(a>)\ for 0 < to < 2n. W hat effect does N have in | y ( o j ) | ? Briefly com ment on the similarities and differences between jY(a>)\ and ]y(j'S2)|. (d> Suppose that *(n) = e>{1' ! p)n p a positive integer and y(n) = w N(n)x(n) where N = IP, I a positive integer. Determ ine and sketch the N-point D FT of y(n). R elate your answer to the characteristics of |K{w)|. Is the frequency sampling for the D FT in part (d) adequate for obtaining a rough approxim ation of |K(w)| directly from the magnitude of the D FT sequence |K(/t)|? If not. explain briefly how the sampling can be increased so that it will be possible to obtain a rough sketch of |K(£o)| from an appropriate sequence |y (Jt) | . Efficient Computation of the DFT: Fast Fourier Transform Algorithms A s w e h av e o b se rv e d in th e p reced in g c h a p te r, th e D isc re te F o u rie r T ra n sfo rm (D F T ) play s an im p o rta n t ro le in m an y a p p lic a tio n s o f digital signal processing, in clu d in g lin e a r filterin g , c o rre la tio n an aly sis, a n d sp e c tru m analysis. A m ajor re a so n fo r its im p o rta n c e is th e ex isten ce o f efficient a lg o rith m s fo r c o m p u tin g the DFT. T h e m ain to p ic o f this c h a p te r is th e d e sc rip tio n o f c o m p u ta tio n a lly efficient a lg o rith m s fo r e v a lu a tin g th e D F T . T w o d iffe re n t a p p ro a c h e s a re d e sc rib e d . O n e is a d iv id e -a n d -c o n q u e r a p p ro a c h in w hich a D F T o f size N , w h e re jV is a c o m p o site n u m b e r, is re d u c e d to th e c o m p u ta tio n o f sm a lle r D F T s fro m w hich th e larg er D F T is co m p u te d . In p a rtic u la r, w e p r e s e n t im p o rta n t c o m p u ta tio n a l alg o rith m s, called fast F o u rie r tra n sfo rm (F F T ) a lg o rith m s, fo r c o m p u tin g th e D F T w h en the size N is a p o w e r o f 2 a n d w h e n it is a p o w e r o f 4. T h e se co n d a p p ro a c h is b a s e d o n th e fo rm u la tio n o f th e D F T as a lin ear filterin g o p e ra tio n o n th e d a ta . T h is a p p ro a c h le a d s to tw o a lg o rith m s, th e G o ertzel alg o rith m an d th e ch irp -z tra n sfo rm a lg o rith m fo r co m p u tin g th e D F T via linear filterin g o f th e d a ta se q u e n c e . 6.1 EFFICIENT COMPUTATION OF THE DFT: FFT ALGORITHMS In th is sectio n w e p re s e n t se v e ra l m e th o d s fo r c o m p u tin g th e D F T efficiently. In view o f th e im p o rta n c e o f th e D F T in v a rio u s d ig ital sig n a l p ro cessin g ap ­ p licatio n s, such as lin e a r filtering, c o rre la tio n an aly sis, a n d s p e c tru m analysis, its efficien t c o m p u ta tio n is a to p ic th a t h a s re c e iv e d c o n s id e ra b le a tte n tio n by m any m a th e m a tic ia n s, e n g in e e rs, a n d a p p lie d scien tists. B asically , th e c o m p u ta tio n a l p ro b le m fo r th e D F T is t o c o m p u te th e se q u en ce {X(*)} o f N c o m p lex -v alu ed n u m b e rs g iv en a n o th e r se q u e n c e o f d a ta (x(n)} of 448 Sec. 6.1 Efficient Computation of the DFT: FFT Algorithms 449 le n g th N , a c c o rd in g to th e fo rm u la N- 1 * (* ) = V Jt(n) W N kn 0 < k < N -l (6.1.1) w h ere WN = e - }7* ,N (6.1.2) In g e n e ra l, th e d a ta se q u e n c e x ( n ) is also a s su m e d to b e c o m p lex v alu ed . S im ilarly , th e I D F T b ec o m e s 1 n -i jr(n ) = — ^ X ( J k ) W ^ " * ^ *=o 0 < n < N —I (6.1.3) Since th e D F T a n d ID F T involve b asically th e sa m e ty p e o f c o m p u ta tio n s, o u r d iscu ssio n o f efficien t c o m p u ta tio n a l a lg o rith m s fo r th e D F T a p p lie s as w ell to th e efficien t c o m p u ta tio n o f th e ID F T . W e o b se rv e th a t fo r each v alu e o f k , d ire c t c o m p u ta tio n o f X ( k ) involves N co m p lex m u ltip lic a tio n s ( 4 N real m u ltip lic a tio n s) a n d N — 1 co m p lex a d d itio n s (4 JV -2 re a l a d d itio n s). C o n se q u e n tly , to c o m p u te all N v alu es o f th e D F T re q u ire s jV2 c o m p lex m u ltip lic atio n s a n d N 2 — N c o m p lex ad d itio n s. D ire c t c o m p u ta tio n o f th e D F T is b asically in efficien t p rim a rily b e c a u se it d o e s n o t e x p lo it th e sy m m etry a n d p e rio d ic ity p ro p e rtie s o f th e p h a s e fa c to r WV In p a rtic u la r, th e s e tw o p r o p e rtie s are: S y m m etry p ro p e rty : Wk N+N/2 = —W N L (6.1.4) P e rio d ic ity p ro p e rty : W#+N = W N k (6.1.5) T h e c o m p u ta tio n a lly efficient a lg o rith m s d e s c rib e d in th is se c tio n , k n o w n collec­ tiv ely as fa st F o u rie r tra n sfo rm (F F T ) a lg o rith m s, e x p lo it th e s e tw o b asic p ro p e rtie s o f th e p h a s e facto r. 6.1.1 Direct Computation of the DFT F o r a co m p le x -v a lu e d se q u e n c e x ( n ) o f N p o in ts, th e D F T m a y b e ex p re sse d as X R{k) = Y |* * ( n ) c o s ^ ~ p - + x / ( n ) s i n ^ ^ - j Xi(k) = - Y |x ,f ( n ) s in - x , ( n ) co s T h e d ire c t c o m p u ta tio n o f (6.1.6) a n d (6.1.7) re q u ire s : L 2 N 2 e v a lu a tio n s o f trig o n o m e tric fu n ctio n s. 2. 4 N 2 re a l m u ltip lic atio n s. (6.1.6) (6.1.7) 450 Efficient Computation of the DFT: Fast Fourier Transform Algorithms Chap. 6 3. AN ( N — 1) real additions. 4. A num ber o f indexing and addressing op eration s. T hese operations are typical o f D F T com putational algorithm s. T he operations in item s 2 and 3 result in the D F T values X K(k) and X i ( k ) . T h e indexing and addressing op eration s are necessary to fetch the data x(n'), 0 < « < Ar — 1, and the phase factors and to store th e results. T h e variety o f D F T algorithm s optim ize each o f these com p utational p rocesses in a different way. 6.1.2 Divide-and-Conquer Approach to Computation of the DFT T h e d evelop m en t o f com p utationally efficient algorithm s for the D F T is m ade pos­ sible if w e adopt a divide-and-conquer approach. T his approach is based on the d ecom p osition o f an Af-point D F T in to su ccessively sm aller D F T s. T his basic ap­ proach leads to a fam ily o f com putationally efficient algorithm s k n ow n collectively as FFT algorithm s. T o illustrate the basic n otion s, let us consider the com p utation o f an Appoint D F T , where N can be factored as a product o f tw o integers, that is, N = LM (6.1.8) T h e assum ption that N is not a prim e num ber is n ot restrictive, sin ce w e can pad any sequ en ce with zeros to ensure a factorization o f the form ( 6 . 1 .8 ). N o w the seq u en ce j ( n ) , 0 < n < N — 1, can be stored in either a one­ dim ensional array in d exed by n or as a tw o-d im en sion al array in d exed by I and m, w here 0 < / < L — 1 and 0 < m < A / - l a s illustrated in Fig. 6.1. N o te that / is the row index and m is the colum n index. T hus, the se q u en ce x (n ) can b e stored in a rectangular array in a variety o f w ays, each o f which d ep en d s on the mapping o f index n to the in d exes (/, m). For exam p le, su p p ose that w e select the m apping n = Ml + m (6.1.9) T his leads to an arrangem ent in which the first row consists o f th e first M elem ents o f x ( n ) , the secon d row consists o f the n ext M elem en ts o f x ( n ) , and so on, as illustrated in Fig. 6.2 (a ). O n the other hand, the m apping n — l + mL (6.1.10) stores the first L elem en ts o f x ( n ) in the first colu m n, the n ext L elem en ts in the second colum n, and so on , as illustrated in Fig. 6.2(b ). A sim ilar arrangem ent can be u sed to store th e com p u ted D F T valu es. In particular, the m apping is from the in d ex it to a pair o f in d ices (p , q), where 0 < p < L — 1 and 0 < q < M — 1. If w e se lect the m apping k — Mp + q (6 .1 .1 1 ) Sec. 6.1 Efficient Computation of the DFT: FFT Algorithms n ---------- 0 1 m x(\) ... M2) 451 N - 1 JcCW-1) (a) column index row index K 0 1 0 *(0,0) x(0,1) 1 * 1 .0 ) * 1 ,1 ) 2 *(2,0) *2,1) Af-1 L- 1 (b) Figure 6.1 N -l. T w o dim ensional data array for storing the sequence x ( n ) . 0 < n £ the D F T is stored on a row -w ise basis, w here the first row contains the first M elem en ts o f the D F T X ( k ) , the second row contains the next set of M elem en ts, and so on . O n the other hand, th e m apping (6 . 1. 12) k = qL + p results in a colu m n-w ise storage o f X (Jt), w here the first L elem en ts are stored in the first colu m n, th e secon d se t o f L elem en ts are stored in the secon d colum n, and so on. N o w su p p ose that x ( n) is m apped in to the rectangular array x ( l , m ) and X( k ) is m app ed in to a corresp on d ing rectangular array X ( p , q). T h en the D F T can be exp ressed as a d o u b le sum o ver th e elem en ts o f the rectangular array m ultiplied b y th e corresp on d ing p h ase factors. T o b e specific, let us ad op t a colum n-w ise m apping fo r x ( n ) g iven by (6.1.10) and th e row -w ise m apping for the D F T given by (6.1.11). T hen (6.1.13) X ( p , q) = Y Y x{1' m ) W <“ p+qHmL+t) rrtacO 1=0 But p+ q){m L+ i) _ ^M Lrnp^m Lq H o w ev er, W%mp = 1, W%*L = W $ L = W**, and W * pl = W?' (6.1.14) = W[l 452 Efficient Computation of the DFT: Fast Fourier Transform Algorithms Row-wise Chap. n = Ml + m M- 1 0 *0) 1 MM) MM 2 M 2M ) M 2M + *2) M M - M M + 2) M2M M D + 1) 1) M 2M + 2) L - 1 x( (L- IW) M(L - 1 )Af + 1) x «L -l)M + 2) 1) - 1) M 'iM - 1) x{L M - 1) (a) Column-wise M- 1 0 MO ) ML) 1 jt(1) M L+ 2 M2) M L + 2) L -l x(L - I) M U - x ( ( M — 1) L ) M 2L) 1) 1) x(2L + 1) M 2 L + 2) M IL - 1) x((M - I )L + 1) M (M -l)L + 2 ) MLM - 1) (b) Figure <L2 Two arrangements for the data arrays. W ith th ese sim p lification s, (6.1.13) can be exp ressed as L- l X( p, q) = Y /■*0 (6.1.15) ^|R«0 The expression in (6.1.15) in volves the com p utation o f D F T s o f length M and length L. T o elab orate, let us subdivide th e com p utation into th ree steps: L First, w e com p ute th e M -point D F T s M-l F(l,q) = £ x ( / ,m ) W ^ \ for each of the rows I = 0 ,1 ........ L - l . 0 < q < M - 1 ( 6 .1 .1 6 ) Sec. 6.1 Efficient Computation of the DFT: FFT Algorithms 453 2 . S econ d , w e com p ute a new rectangular array G ( l , q ) defined as (6.1.17) 3. F inally, w e com p ute the L -point D F T s L-l X ( p , q ) = J 2 G ^l ' ^ WL (6.1.18) for each colum n q = 0 , 1 , . . . , M — 1, o f the array G (l, q). O n the surface it m ay appear that the com putational procedure outlined above is m ore com p lex than the direct com p utation o f the D F T . H ow ever, let us evalu ate the com putational com p lexity o f (6.1.15). T h e first step in volves the com p utation o f L D F T s, each o f M points. H en ce this step requires L M 2 com ­ plex m ultiplications and L M { M — 1) com p lex additions. T h e secon d step requires L M com p lex m ultiplications. Finally, the third step in the com p utation requires M L 2 com p lex m ultiplications and M L ( L — 1) com p lex additions. T h erefore, the com p utational com plexity is C om plex m ultiplications: N ( M + L + 1) C om plex additions: N ( M + L — 2) (6.1.19) w here N = M L . T hus the num ber o f m ultiplications has b een reduced from N 2 to N ( M + L + 1 ) and the num ber o f additions has b een reduced from N ( N — 1) to N ( M + L — 2). For exam p le, suppose that N = 1000 and w e select L = 2 and M = 500. T h en , instead o f having to perform 106 com p lex m ultiplications via direct com pu­ tation o f the D F T , this approach leads to 503,000 com p lex m ultiplications. This rep resents a reduction by approxim ately a factor o f 2. T h e num ber o f additions is also red u ced by ab ou t a factor o f 2. W h en N is a highly com p osite num ber, that is, N can be factored in to a product o f prim e num bers o f th e form N = r\ r 2 ■■- r v (6.1.20) then the d ecom p osition ab ove can b e rep eated (v - 1 ) m ore tim es. T his procedure results in sm aller D F T s, w hich, in turn, lead s to a m ore efficient com putational algorithm . In effect, th e first segm en tation o f th e seq u en ce x ( n ) in to a rectangular array o f M colu m ns w ith L elem en ts in each colu m n resu lted in D F T s o f sizes L and M . Further d eco m p o sitio n o f th e data in effect in volves th e segm en tation o f each row (or colu m n ) into sm aller rectangular arrays w hich result in sm aller D F T s. This p roced u re term inates w h en N is factored in to its prim e factors. Example 6.1.1 To illustrate this computational procedure, let us consider the computation of an N = 15 point DFT. Since N = 5 x 3 = 15, we select L = 5 and M = 3. In other 454 Efficient Computation of the DFT: Fast Fourier Transform Algorithms Chap. 6 words, we store the 15-point sequence *(n) column-wise as follows: Row 1: Row 2: Row 3: Row 4: Row 5: *(0, 0) = *(0) *(1,0) = * (1 ) *(2,0) = * ( 2 ) *(3,0) = * (3 ) * (4,0) = * ( 4 ) *(0.1) = * ( 5 ) *(1, 1) = jc(6) x ( 2 , 1) = x(7) *(3,1) = * ( 8 ) *(4,1) = * ( 9 ) *(0, 2) = *(10) *(1,2) = *(11) x(2,2)=x(12) *(3,2) = .r{13) *(4,2) = *(14) Now. we com pute the three-point DFTs for each of the five rows. This leads to the following 5 x 3 array: F(0, 0) F a , o) F( 2. 0) F(3, 0) F(4. 0) F (O .l) F O .l) F( 2,1) FO. 1) F (4.1) F( 0.2) F (1.2) F( 2.2) FO- 2) F( 4.2) The next step is to multiply each of the terms F(l, q) by the phase factors = M/jj. 0 < / < 4 and 0 < q < 2. This computation results in the 5 x 3 array: Column 1 Column 2 Column 3 G (0.0) G (1,0) G(2, 0) G (3.0) G (4 .0) C(0. 1) C ( l.l) C(2. 1) G (3 ,1) G (4 .1) C (0.2) G (l. 2) C ( 2 .2) G (3 .2) G (4.2) The final step is to com pute the five-point DFTs for each of the three columns. This com putation yields the desired values of the D FT in the form X (0.0) = X(0) X (1,0) = X(3) X (2.0) = X (6) X (3,0) = X (9) X (4,0) = X (12) X (0 ,1) = X (l) X (1.1) = X (4) X (2 .1) = X(7) X (3,1) = X(10) X (4,1) = X (13) X (0,2) = X(2) X (1,2) = X(5) X (2,2) = X(8> X (3 ,2) = X ( ll) X (4 ,2) = X(14) Figure 6.3 illustrates the steps in the computation. It is interesting to view the segm ented data sequence and the resulting D FT in term s of one-dim ensional arrays. When the input sequence x(n) and the output DFT X(jfc) in the two-dimensional arrays are read across from row 1 through row 5, we obtain the following sequences: IN PU T A R R A Y *(0) x{5) *(10) *(1) *(6) *(11) x(2) *(7) *(12) *(3) *(8) *(13) x(4) *{9) *(14) O U T PU T A R R A Y X(0) X (l) X(2) X(3) X(4) X(5) X(6) X(7) X(8) X(9) X(10) X ( ll) X(12) X(13) X(14) W e observe that the input data sequence is shuffled from the norm al order in the com putation of the D FT. On the other hand, the output sequence occurs in norm al order. In this case the rearrangem ent of the input data array is due to the Sec. 6.1 455 Efficient Computation of the DFT: FFT Algorithms Figure 63 DFTs. Computation of N = 15-point DFT by means of 3-point and 5-point segm entation of the one-dim ensional array into a rectangular array and the order in which the D FTs are com puted. This shuffling of either the input data sequence or the output D FT sequence is a characteristic of most FFT algorithms. T o sum m arize, the algorithm that w e have introduced in volves the follow in g com putations: Algorithm 1 1. S tore the signal colu m n-w ise. 2. C om pute the Af-point D F T o f each row. 3. M ultiply the resulting array by the p h ase factors 4. C om p ute the L -point D F T o f each colum n 5. R ea d the resulting array row -w ise. A n additional algorithm with a sim ilar com putational structure can b e o b ­ tained if th e input signal is stored row -w ise and the resulting transform ation is. colu m n-w ise. In this case w e select as n = Ml + m k (6.1.21) = qL + p This ch o ice o f in d ices lead s to the form ula for the D F T in the form X {p ,q ) = £ £ * (/, msO 1*0 (6. 1.22) M- l = E > c Thus w e obtain a secon d algorithm . urmp WN 456 Efficient Computation of the DFT: Fast Fourier Transform Algorithms Chap. 6 A lg o rith m 2 1. S to re th e sig n al row -w ise. 2. C o m p u te th e L -p o in t D F T a t each co lu m n . 3. M u ltip ly th e re su ltin g a rra y by th e fa c to rs W%m. 4. C o m p u te th e A f-point D F T o f e a c h row . 5. R e a d th e re su ltin g a rra y colum n-w ise. T h e tw o a lg o rith m s given a b o v e h a v e th e sa m e c o m p lex ity . H o w e v e r, they d iffer in th e a rra n g e m e n t o f th e c o m p u ta tio n s. In th e follow ing se c tio n s w e exploit th e d iv id e -a n d -c o n q u e r a p p ro a c h to d e riv e fast a lg o rith m s w h e n th e size o f the D F T is re stric te d to b e a p o w e r o f 2 o r a p o w e r o f 4. 6.1.3 Radix-2 FFT Algorithms In th e p re c e d in g se ctio n w e d e sc rib e d fo u r a lg o rith m s fo r efficien t c o m p u ta tio n of th e D F T b ased o n th e d iv id e -a n d -c o n q u e r a p p ro a c h . S uch an a p p ro a c h is applica­ b le w h en th e n u m b e r N o f d a ta p o in ts is n o t a p rim e . In p a rtic u la r, th e a p p ro ach is v ery efficien t w h en N is highly c o m p o s ite , th a t is, w h en N can b e fa c to re d as N = r\r2ry • ■■rv, w h e re th e {r,} are prim e. O f p a rtic u la r im p o rta n c e as th e case in w hich r i = r2 — ■■• = r v = r , so th at N = r ' \ In such a case th e D F T s a re o f size r , so th a t th e c o m p u ta tio n o f the N -p o in t D F T h a s a re g u la r p a tte rn . T h e n u m b e r r is called th e rad ix o f th e F F T alg o rith m . In th is se c tio n w e d escrib e rad ix -2 a lg o rith m s, w hich a re by far th e m ost w idely u sed F F T alg o rith m s. R ad ix -4 a lg o rith m s a re d e sc rib e d in th e follow ing sectio n . L e t us c o n s id e r th e c o m p u ta tio n o f th e N — 2 V p o in t D F T by th e dividea n d -c o n q u e r a p p ro a c h specified by (6.1.16) th ro u g h (6.1.18). W e select M = N / 2 a n d L = 2. T h is se lectio n re su lts in a sp lit o f th e N -p o in t d a ta se q u e n c e in to two // /2 - p o in t d a ta se q u e n c e s f \ ( n ) a n d f 2(ri), c o rre sp o n d in g to th e ev en -n u m b ered a n d o d d -n u m b e re d sa m p le s o f x ( n ), resp ec tiv ely , th a t is, / i ( n ) = x ( 2 n) f i ( n ) = x (2n + 1), N n = 0 ,1 ,..., — ~ 1 (6.1.23) T h u s f i ( n ) a n d f j ( n ) a re o b ta in e d by d e c im a tin g x ( n) b y a f a c to r o f 2, a n d hence th e re su ltin g F F T a lg o rith m is called a d e c im a tio n -in -tim e a lg o rith m . N o w th e Af-point D F T c a n b e e x p re ss e d in te rm s o f th e D F T s o f th e deci­ m a te d se q u e n c e s as follow s: A'-l X(k) = Y x ^ n*0 wn * = 0 ,1 ,..., A f-1 Sec. 6.1 Efficient Computation of the DFT: FFT Algorithms = £ x (n )H # + 5 3 n even (6.1.24) n odd <W/2)-l (Af/2)-l J ! x ( 2 m ) W ] f k 4- 5 3 *(2m + l)W * (2'n+1> m=0 m=0 = B ut 457 = W ^/ 2- W ith this su b stitu tio n , (6.1.24) c a n b e e x p re ss e d as (N/Zi-i x(k)= 5 3 (N/2)—l M m )w *ra + K = fi(Jfc) + W * f 2(*) £ it = 0 , 1 , . . . , W - l w h e re F i(it) a n d F2 (k) a re th e N /2 -p o in t D F T s o f th e se q u e n c e s f \ ( m ) an d f 2 (m), resp ec tiv ely . S ince F\ ( k) a n d F 2 (k) a re p e rio d ic, w ith p e rio d N f l , w e h a v e F](A -f N / 2) = F i(* ) a n d /^(jfc + N f l ) = / i t * ) - 1° a d d itio n , th e fa c to r W ^ Nfl = —Wfa. H e n c e (6.1.25) can b e ex p re sse d as X ( k ) = f i(J t) + W* F2(fc) * = 0 , 1 .........~ — 1 (6.1.26) = F , ( * ) - < F 2(/:) * = 0 , 1 ....... y - 1 (6.1.27) + W e o b se rv e th a t th e d ire c t c o m p u ta tio n o f F\ ( k) re q u ire s ( N /2 )2 com plex m u ltip lic a tio n s. T h e sa m e a p p lie s to th e c o m p u ta tio n o f F2 (k). F u rth e rm o r e , th e re a re N f l a d d itio n a l co m p lex m u ltip lic a tio n s re q u ire d to c o m p u te W kN F 2 (k). H en ce th e c o m p u ta tio n o f X ( k ) re q u ire s 2 ( N f l )1 4- N f l = N 2/ 2 + N f l c o m p lex m u ltip li­ c a tio n s. T h is first s te p resu lts in a re d u c tio n o f th e n u m b e r o f m u ltip lic a tio n s from N 2 to N 1 f l + N f l , w h ich is a b o u t a fa c to r o f 2 fo r N large. T o b e c o n s iste n t w ith o u r p rev io u s n o ta tio n , w e m ay define </!(*) = F l(* ) * = 0 ,l,...,y - l G 2 (k) = W N l F2 (k) * = 0 , l , . . . , y —1 T h e n th e D F T X (it) m ay b e ex p re sse d as X ( k ) = G x(k) + G 2 (k) it = 0 , 1 ____ y - 1 (6.1.28) X(k + j ) = G x( k ) - G 2 (k) * = 0 , 1 .........y - 1 T h is c o m p u ta tio n is illu stra te d in Fig. 6.4. H a v in g p e rfo rm e d th e d e c im a tio n -in -tim e o n ce, w e c a n r e p e a t th e p ro cess fo r e a c h o f th e se q u e n c e s f \ ( n ) a n d f 2 (n). T h u s f \ ( n ) w o u ld re s u lt in th e tw o 458 Efficient Computation of the DFT: Fast Fourier Transform Algorithms * 0 ) x{2) x(4) Chap. 6 JrW -2) Figure 6.4 F irst step in the decim ation-in-tim e algorithm . /V /4-point se q u e n c e s v n (n ) = / ] ( 2n) N « = 0 , 1 ................... 1 4 v\ 2 (n) = f \ Q n + 1) n = 0, 1.........j (6.1.29) - 1 an d f 2 (n) w o u ld yield V2\(n) = f 2 (2 n) N n = 0, 1.........— - 1 4 V22(n) = /2(2n + 1) N n = 0 , 1.........— - 1 (6.1.30) B y co m p u tin g jV /4-point D F T s , w e w o u ld o b ta in th e ///2 - p o in t D F T s Fi(Jfc) and F2 (k) fro m th e re la tio n s FiOfc) = V„(Jfc) + W k Nf2 Vn (k) k = 0 ,1 , 1 (6.1.31) Fx (* + t ) = Vl1{k) - KpynW F 2 (k) = V21(*) + W N k / 2 V22(k) k= 1..... 7 - 1 k = 0 ,1 ,..., J - 1 (6.1.32) F2 ( * + j ) = V2i (*) - N k = 0, . , , , j - l where the (Vi; (jt)} are the ///4 -p o in t D F T s o f th e seq u en ces {u,;(n)}. Sec. 6.1 Efficient Computation of the DFT: FFT Algorithms 459 COMPARISON OF COMPUTATIONAL COMPLEXITY FOR THE DIRECT COMPUTATION OF THE DFT VERSUS THE FFT ALGORITHM TABLE 6.1 Number of Points, N Complex Multiplications in Direct Computation, N2 Complex Multiplications in FFT Algorithm, (JV/2) log2 N Speed Improvement Factor 4 8 16 32 64 128 256 512 1,024 16 64 256 1,024 4,096 16,384 65,536 262.144 1,048,576 4 12 32 80 192 448 1,024 2,304 5,120 4.0 5.3 8.0 12.8 21.3 36.6 64.0 113.8 204.8 W e o b se rv e th a t th e c o m p u ta tio n o f {V(J(*)} re q u ire s 4{W /4)2 m u ltip lic a tio n s a n d h e n c e th e c o m p u ta tio n o f F\ ( k) a n d F 2(Jt) can b e a c c o m p lish ed w ith N 2/ 4 + N f l c o m p lex m u ltip lic a tio n s. A n a d d itio n a l N f l co m p lex m u ltip lic a tio n s a re re ­ q u ire d to c o m p u te X ( k ) fro m F i(it) a n d Fi{k), C o n se q u e n tly , th e to ta l n u m b e r o f m u ltip lic a tio n s is re d u c e d a p p ro x im a te ly by a fa c to r o f 2 ag ain to N 2/ 4 + N. T h e d e c im a tio n o f th e d a ta se q u e n c e can b e re p e a te d ag ain a n d ag ain until th e re su ltin g se q u e n c e s a re re d u c e d to o n e -p o in t se q u en ces. F o r N = 2 V, this d e c im a tio n can b e p e rfo rm e d v = log2 N tim es. T h u s th e to ta l n u m b e r o f co m p lex m u ltip lic a tio n s is re d u c e d to { N f l ) log2 N . T h e n u m b e r o f co m p lex a d d itio n s is N log2 N . T a b le 6.1 p re s e n ts a c o m p a riso n o f th e n u m b e r o f co m p lex m u ltip lic a­ tio n s in th e F F T a n d in th e d ire c t c o m p u ta tio n o f th e D F T . F o r illu stra tiv e p u rp o se s , Fig. 6.5 d e p ic ts th e c o m p u ta tio n o f an N = 8 p o in t D F T . W e o b se rv e th a t th e c o m p u ta tio n is p e rfo rm e d in th r e e stag es, b eg in n in g w ith th e c o m p u ta tio n s o f fo u r tw o -p o in t D F T s, th e n tw o fo u r-p o in t D F T s , an d Figure <L5 Three stages in the computation o f an N = 8-point DFT. 460 Efficient Computation of the DFT: Fast Fourier Transform Algorithms Stage Stage 2 Chap. 6 Stage 3 X (0 ) X(l) X(2) X(3) X(4) X{5) *(6) X p ) finally, o n e eigh t-p oin t D F T . T he com bination o f the sm aller D F T s to form the larger D F T is illustrated in Fig. 6. 6 for N = 8 . O bserve that the basic com putation perform ed at every stage, as illustrated in Fig. 6 .6 , is to take tw o com p lex num bers, say th e pair (a, b), m ultiply b by W N r, and then add and subtract the product from a to form tw o new com p lex numbers (A, B ). This basic com putation, which is show n in Fig. 6.7, is called a butterfly b ecau se the flow graph resem bles a butterfly. In general, each butterfly involves on e com p lex m ultiplication and tw o com ­ plex additions. F or N = 2 V, there are N f l butterflies per stage o f th e com putation p rocess and log 2 N stages. T h erefore, as previously indicated th e total num ber of com plex m ultiplications is ( N f l ) log 2 N and com p lex additions is Arlog 2 N . O nce a butterfly operation is perform ed on a pair o f com p lex num bers (a, b) to p roduce ( A , B ) , there is no n eed to 'sa v e the input pair ( a , b ) . H en ce w e can >A = a + W^b B=a-Wt/b F igure 6.7 Basic butterfly com putation in th e decim ation-in-tim e F FT algorithm . Sec. 6.1 Efficient Computation of the DFT: FFT Algorithms 461 store th e result (A , B ) in the sam e location s as ( a , b ) . C on sequ en tly, w e require a fixed am ount o f storage, n am ely, 2 N storage registers, in order to store the results ( N com p lex num bers) o f the com p u tation s at each stage. Since th e sam e 2 N storage loca tio n s are used throughout the com p utation o f the JV-point D F T , w e say that the c o m p u ta tio n s are d o n e in place. A secon d im portant observation is con cern ed with the ord er o f the input data seq u en ce after it is d ecim ated (v - 1 ) tim es. For exam p le, if w e consider the case w h ere N = 8 , w e know that th e first d ecim ation yield s the seq u en ce jc(0), x ( 2 ) , x (4 ), * ( 6 ), * (1 ), Jt(3), jr(5), jc(7), and the secon d d ecim ation results in the seq u en ce jc(0), x (4 ), x (2 ), x ( 6 ), jt(1), x (5 ), jc(3), jc(7). T h is sh u fflin g o f the input data seq u en ce has a w ell-d efin ed order as can b e ascertained from observing Fig. 6 .8 , w hich illustrates the d ecim ation o f th e eigh t-p oin t seq u en ce. B y expressing the in d ex n, in the seq u en ce x ( n ) , in binary form , w e n o te that th e order o f the d ecim ated d ata seq u en ce is easily ob tain ed by reading the binary representation o f th e index n in reverse order. T hus the data p oin t jt(3) = *(011) is placed in position m = 110 or m = 6 in the d ecim ated array. Thus w e say that the data x ( n ) after d ecim ation is stored in bit-reversed order. W ith th e input data seq u en ce stored in bit-reversed order and the butterfly com p utations perform ed in p lace, the resulting D F T seq u en ce X ( k ) is ob tain ed in natural order (i.e., k = 0 , 1 , . . . , N — 1). O n the oth er hand, w e should indi­ ca te that it is p ossib le to arrange the F F T algorithm such that the input is left in natural order and the resulting output D F T will occur in bit-reversed order. Furtherm ore, w e can im pose the restriction that b oth the input data x ( n ) and the output D F T X ( k ) be in natural order, and d erive an FFT algorithm in which the com p utations are not d on e in place. H en ce such an algorithm requires additional storage. A n o th e r im portant radix-2 FFT algorithm , called th e decim ation -in-freq u en cy algorithm , is o b tain ed by using the divide-and-conquer approach described in S ec­ tion 6.1.2 w ith th e ch oice o f M = 2 and L = N f l . T his ch oice o f param eters im plies a colu m n-w ise storage o f the input data seq u en ce. T o d erive the algo­ rithm, w e begin by splitting the D F T form ula in to tw o sum m ations, o n e o f which in v o lv es the sum over the first N t 2 data p oin ts and th e secon d sum in volves the last N I 2 data points. Thus w e obtain W 2 > -1 X (k) = £ N- 1 x( n)W *? + Y x(n)W % (6.1.33) Since W„N/2 = (—1)*, the exp ression (6.1.33) can b e rew ritten as (6.1.34) 462 Efficient Computation of the DFT: Fast Fourier Transform Algorithms Chap. 6 Data decimation 1 Memory Memory address (decimal) (binary) 0 000 (ninino) - (/To"2« () — (nnn in ;) (0 0 0) (0 0 1) (0 1 0) (0 1 1) (1 0 0) (1 0 !) (1 1 0) (1 1 1) -» —*■ -► -► -*> -*> —4 (0 0 0 ) (1 0 0 ) (0 0 1) (1 0 1 ) (0 10) (1 1 0 ) (0 1 1) (1 1 1 ) -► -► -► ”* -► -► (0 0 0 ) (1 0 0) (0 10) (t 10) (0 0 1) (1 0 1) (0 1 1) (1 1 )) (b) Figure 6Jt Shuffling of the data and bit reversal. N ow , let us split (d e c im a te ) X ( k ) in to th e ev en - a n d o d d - n u m b e re d sam p les. Thus w e o b ta in (W /2)-l r x(n) + x v tr k n K N/2 ) k = Q, 1 , . . . , y - 1 (6.1.35) an d (A 72)-l X{2k + \) = £ , r / JV \"1 + "“ ° w h ere w e h av e u se d th e fact th a t Wf, = 'Wsp.- 1 N * = 0 , 1 ......y - 1 (6.1.36) Sec. 6.1 Efficient Computation of the DFT: FFT Algorithms 463 If w e d e fin e th e N /2 -p o in t se q u e n c e s gi ( n) a n d gz(n) as g i( n ) = * ( « ) + * (6.1.37) g 2 (n) = |* ( n ) - x + y^) n = 0 , 1 , 2 .........J K - 1 th e n (N/2)-l x ( 2 k) = Y s m K )2 n=0 (6.1.38) (AT/2)—1 & W WN/2 X (2* + l ) = n=0 T h e c o m p u ta tio n o f th e s e q u e n c e s g i(n ) a n d g 2 (n) a c co rd in g to (6.1.37) a n d th e su b s e q u e n t u se o f th e s e se q u e n c e s to c o m p u te th e N /2 -p o in t D F T s a re d e p ic te d in Fig. 6.9. W e o b se rv e th a t th e b asic c o m p u ta tio n in th is figure in v o lv es th e b u tte rfly o p e r a tio n illu stra te d in Fig. 6.10. T h is c o m p u ta tio n a l p ro c e d u re can b e re p e a te d th ro u g h d e c im a tio n o f th e N /2 -p o in t D F T s , X ( 2 k ) a n d X ( 2 k + 1). T h e e n tire p ro cess in v o lv es v = log2 N 464 Efficient Computation of the DFT: Fast Fourier Transform Algorithms Chap. 6 A = a + b wi, B = ( a — b)W f/ - Figure 6.10 Basic butterfly com putation in the decim ation-in-frequency F FT algorithm . 1 stages o f decim ation , w here each stage in volves N t l butterflies o f the type shown in Fig. 6.10. C onsequently, the com putation o f the Af-point D F T via the decim ationin-frequency FFT algorithm , requires ( N / 2) iog 2 N com p lex m ultiplications and N lo g 2 N com p lex additions, just as in the d ecim ation -in-tim e algorithm . For il­ lustrative purposes, the eight-point d ecim ation-in-frequency algorithm is given in Fig. 6.11. W e observe from Fig. 6.11, that the input data x ( n ) occurs in natural order, but the output D F T occurs in bit-reversed order. W e also n ote that the com puta­ tions are perform ed in place. H ow ever, it is p ossib le to reconfigure the decim ationin-frequency algorithm so that the input seq u en ce occurs in bit-reversed order w hile the output D F T occurs in norm al order. F urtherm ore, if w e abandon the requirem ent that the com putations b e d on e in place, it is also p ossib le to have both the input data and the output D F T in norm al order. Figure 6.11 N = 8-point decimation-in-frequency FFT algorithmn. Sec. 6.1 Efficient Computation of the DFT: FFT Algorithms 465 6.1.4 Radix-4 FFT Algorithms W h e n th e n u m b e r o f d a ta p o in ts N in th e D F T is a p o w e r o f 4 (i.e., N = 4 l ), w e can , o f c o u rse, alw ays use a radix-2 a lg o rith m fo r th e c o m p u ta tio n . H o w e v e r, fo r th is case, it is m o re efficien t c o m p u ta tio n a lly to em p lo y a rad ix -4 F F T alg o rith m . L e t u s b eg in by d escrib in g a rad ix -4 d e c im a tio n -in -tim e F F T a lg o rith m , w hich is o b ta in e d by se lectin g L = 4 an d M = N / 4 in th e d iv id e -a n d -c o n q u e r a p p ro a c h d e s c rib e d in S ectio n 6.1.2. F o r this ch o ice o f L a n d M , w e h av e /, p — 0 ,1 , 2, 3: m, q = 0, 1.........N J4 - 1; n = 4m + /; a n d k = ( N / 4) p + q. T h u s w e sp lit o r d e c im a te th e W -point in p u t se q u e n c e in to f o u r su b s e q u e n c e s, x ( 4 n ), jc(4n + 1), x( 4n + 2), x ( 4 n -f 3), n = 0, 1.........N / 4 — 1By a p p ly in g (6.1.15) w e o b ta in 3 * ( /> .« ) = £ [w ^F il'q ^W ? 0 ,1 .2 .3 (6.1.39) w h ere F ( I . q ) is giv en by (6.1.16), th a t is. (iV/4 |—! F(l.q)= £ mq x ( l - n i ) W N/A I = 0 .1 , 2. 3. N .........4 - 1 « = (6.1.40) an d x(l . m ) = x ( 4 m -j- /) (6.1.41) (N X(p.q) = X / — p + q (6.1.42) T h u s, th e fo u r ///4 -p o in t D F T s o b ta in e d fro m (6.1.40) a re c o m b in e d a cco rd in g to (6.1.39) to yield th e W -point D F T . T h e ex p re ssio n in (6.1.39) fo r co m b in in g th e ///4 -p o in t D F T s d efin es a rad ix -4 d e c im a tio n -in -tim e b u tterfly , w hich can be e x p re ss e d in m atrix fo rm as ~X( Q , q ) ‘ X(\,q) X (2,q) -X(3,q)J - 1 1 1 1 1 ' j -1 W °F(0,<7) j 1 - 1 1 - 1 Li j -i - j W«F(Lq) W % F(2 ,q) (6.1.43) w l qF { X q ) T h e ra d ix -4 b u tte rfly is d e p ic te d in Fig. 6 .1 2 (a) a n d in a m o re co m p a c t fo rm in Fig. 6 .1 2 (b ). N o te th a t since W® = 1, e a c h b u tte rfly in v o lv es th r e e co m p lex m u ltip lic a tio n s , a n d 12 c o m p lex a d d itio n s. T h is d e c im a tio n -in -tim e p ro c e d u re can b e re p e a te d recu rsiv ely v tim es. H e n c e th e re su ltin g F F T alg o rith m co n sists o f v sta g es, w h e re e a c h sta g e c o n ta in s A74 b u tte rflie s . C o n s e q u e n tly , th e c o m p u ta tio n a l b u r d e n fo r th e a lg o rith m is 3 v N / 4 = (3jV /8) lo g ; N c o m p lex m u ltip lic a tio n s a n d O N f l ) log2 N co m p lex a d d itio n s. W e n o te th a t th e n u m b e r o f m u ltip lic a tio n s is re d u c e d by 2 5 % , b u t th e n u m b e r o f a d d itio n s h a s in c re a se d b y 50% fro m N log2 N to O N f l ) log2 N . 466 Efficient Computation of the DFT: Fast Fourier Transform Algorithms Chap. 6 Figure 6.12 Basic butterfly computation in o radix-4 FFT algorithm. It is in te re stin g to n o te , h o w ev er, th a t by p e rfo rm in g th e a d d itio n s in tw o step s, it is p o ssib le to re d u c e th e n u m b e r o f a d d itio n s p e r b u tte rfly fro m 12 to 8. T h is can b e acco m p lish ed by e x p ressin g th e m atrix o f th e lin e a r tra n s fo rm a tio n in (6.1.43) as a p ro d u c t o f tw o m atric es as follow s: • m ? n X ( l,9 ) X ( 2,q) -1 0 1 .0 0 1 0 1 1 0 -1 0 0 -j 0 j - ‘1 1 0 .0 0 0 1 1 1 -1 0 0 0 0 1 -1 w jjm g ) WqF(\,q) W % F ( 2 .q) (6.1.44) lW *F(3,q). N ow ea c h m atrix m u ltip lic a tio n involves fo u r a d d itio n s fo r a to ta l o f e ig h t ad d i­ tio n s. T h u s th e to ta l n u m b e r o f co m p lex a d d itio n s is re d u c e d to N log2 N , w hich is id en tical to th e ra d ix -2 F F T a lg o rith m . T h e c o m p u ta tio n a l sa v in g s re su lts from th e 25% re d u c tio n in th e n u m b e r o f co m p lex m u ltip lic atio n s. A n illu stra tio n o f a rad ix -4 d e c im a tio n -in -tim e F F T a lg o rith m is sh o w n in Fig. 6.13 fo r N = 16. N o te th a t in th is a lg o rith m , th e in p u t se q u e n c e is in norm al o r d e r w h ile th e o u tp u t D F T is shuffled. In th e rad ix -4 F F T a lg o rith m , w here th e d e c im a tio n is b y a f a c to r o f 4, th e o r d e r o f th e d e c im a te d se q u e n c e can be d e te rm in e d b y re v e rsin g th e o r d e r o f th e n u m b e r th a t re p re s e n ts th e in d ex n in a q u a te rn a ry n u m b e r sy stem (i.e., th e n u m b e r sy stem b a s e d o n th e digits 0, 1, 2, 3). A rad ix -4 d e c im a tio n -in -fre q u e n c y F F T a lg o rith m can b e o b ta in e d by se lect­ ing L = N / 4 , M = 4; /, p = 0, 1.........N / 4 - 1; m, q = 0, 1, 2, 3; n = {N / 4 ) m + /; a n d k = 4 p + q. W ith th is ch o ice o f p a ra m e te rs , th e g e n e ra l e q u a tio n g iven by Efficient Computation of the DFT: FFT Algorithms 467 Figure 6.13 Sixteen-point radix-4 decimation-in-time algorithm with input in nor­ mal order and output in digit-reversed order. (6.1.15) can be exp ressed as (A y 4 )- l X(p,q) = Ip C ( l , q) W' NfA l £ (6.1.45) 1=0 w here q = 0 , 1 , 2, 3 G ( l , q ) = w ‘ hF (l, q) (6.1.46) i - 0 . 1 .........£ - 1 4 and q =0,1,2,3 F(l,q) = Y x ( l , m ) W ? N / = 0 , 1 , 2 , 3 .........- - 1 4 (6.1.47) W e n o te that X ( p , q ) = X ( 4 p + q ), q = 0, 1, 2, 3. C on sequ en tly, the Af-point D F T is d ecim a ted into four N /4 -p o in t D F T s and h en ce w e have a decim ationin -frequency F F T algorithm . T h e com putations in (6.1.46) and (6.1.47) define 468 Efficient Computation of the DFT: Fast Fourier Transform Algorithms Chap. 6 Figure 6.14 Sixteen-point, radix-4 decimation-in-frequency algorithm with input in normal order and output in digit-reversed order. the basic radix-4 butterfly for the d ecim ation-in-frequency algorithm . N o te that the m ultiplications by the factors W% occur after the com b ination o f the data p oin ts x (/, m), just as in the case o f th e radix-2 decim ation -in-freq u en cy algo­ rithm. A 16-point radix-4 decim ation -in-freq u en cy F F T algorithm is show n in Fig. 6.14. Its input is in norm al order and its output is in digit-reversed order. It has exactly the sam e com putational com p lexity as the d ecim ation -in-tim e radix4 F F T algorithm . For illustrative purposes, let us rederive the radix-4 decim ation-in-frequency algorithm by breaking the jV-point D F T form ula in to four sm aller D F T s. We have N- 1 X( k) = T x ( n ) W N kn n=0 = JV/4-1 N/Z-1 3N/4-1 fif-l £ x { n ) W kNn + £ x{n)W%' + £ * (* )< " + £ x(n)W N kn n=0 n=N/4 n=Nfi n=JN/4 Sec. 6.1 469 Efficient Computation of the DFT: FFT Algorithms /A» 74/ * ♦ - 1J = h= (I «=o A'/4 —1 + < E*(" A’// 4t -- iI A £ ,< „ ,< ■ + < « V/2 E / / A/ N + t ' \i \ * (« + y ) < N / A —\ + < A'/4 E / 'l \ ! \ A (" + t ) (6.1.48) F ro m th e d efin itio n o f th e tw id d le facto rs, w e h av e lNk/4 w\N (6.1.49) (jf A fte r su b s titu tio n o f (6.1.49) in to (6.1.48). we o b ta in N/ 4-1 xa)= E x(») + ( (6.1.50) N + { -1 f x [ n + - J + ( ;) W\ T h e re la tio n in (6.1.50) is n o t an N /4 -p o in t D F T b e c a u se th e tw id d le facto r d e p e n d s o n N a n d n o t on N / 4 . T o c o n v ert it in to an A '/4-point D F T , wc su b d iv id e th e D F T se q u e n c e in to four /V /4-point su b se q u e n c e s, X ( 4 k ) . X ( 4 k + !), X (4£ + 2), an d X { 4 k + 3), k — 0, 1........ N / 4 — 1. T h u s we o b ta in th e rad ix -4 d ecim atio n -in fre q u e n c y D F T as x ( n ) + .v (6.1.51) ■ +? ) +a(', + i ) +j:(" + t ) X (4k + l ) = 0 urkn w"w N r r N /4 (6.1.52) ■*(” ) ~ i x ( ” + " j } E IV " w kn N w yv/4 X ( 4 k + 2) = T ; 1r ( n \ E * (« )“ * ( « + j J - K r X ( 4 k + 3) = E M (6.1.53) kn ' + t ) W 2" ww Nf4 / x (n '>+ J x ( " + n \ (6.1.54) J ~ x ( n ~h j ) - Jx (b+ t ) ] w^ kn S/4 470 Efficient Computation of the DFT: Fast Fourier Transform Algorithms Chap. 6 w h ere w e h av e u se d th e p ro p e rty W^ kn = W^"4. N o te th a t th e in p u t to ea c h N/ 4p o in t D F T is a lin e a r co m b in a tio n o f fo u r signal sa m p le s sc aled by a tw id d le factor. T h is p ro c e d u re is r e p e a te d v tim es, w h ere v = log,, N. 6.1.5 Split-Radix FFT Algorithms A n in sp e ctio n o f th e radix-2 d e c im a tio n -in -fre q u e n c y flo w g rap h show n in Fig. 6.11 in d icates th a t th e e v e n -n u m b e re d p o in ts o f th e D F T can b e c o m p u te d in d e p e n ­ d en tly o f th e o d d -n u m b e re d p o in ts. T h is suggests th e p o ssib ility o f using d ifferen t c o m p u ta tio n a l m e th o d s fo r in d e p e n d e n t p a rts o f th e a lg o rith m w ith th e ob jectiv e o f re d u c in g th e n u m b e r o f c o m p u ta tio n s. T h e sp lit-ra d ix F F T (S R F F T ) alg o rith m s ex p lo it th is id ea by u sing b o th a radix-2 a n d a radix-4 d e c o m p o s itio n in th e sam e F I T alg o rith m . W e illu stra te th is a p p ro a c h w ith a d e c im a tio n -in -fre q u e n c y S R F F T alg o rith m d u e to D u h a m e l (1986). F irst, w e recall th a t in th e rad ix -2 d ec im a tio n -in -fre q u e n c y F F T alg o rith m , th e e v e n -n u m b e re d sa m p le s o f th e /V -point D F T a re given as N o te th a t th ese D F T p o in ts can b e o b ta in e d fro m an N /2 -p o in t D F T w ith o u t any a d d itio n a l m u ltip lic atio n s. C o n se q u e n tly , a radix-2 suffices fo r th is c o m p u ta tio n . T h e o d d -n u m b e re d sa m p le s {X{2k + 1)) o f th e D F T re q u ire th e p re m u ltip li­ catio n o f th e in p u t se q u e n c e w ith th e tw id d le fa c to rs W N n . F o r th e s e sa m p les a rad ix -4 d eco m p o sitio n p ro d u c e s so m e c o m p u ta tio n a l efficiency b e c a u se th e fourp o in t D F T h as th e larg est m u ltip lic a tio n -fre e b u tterfly . I n d e e d , it can b e show n th a t usin g a rad ix g r e a te r th a n 4, d o e s n o t re su lt in a significant re d u c tio n in com ­ p u ta tio n a l co m p lex ity . I f we u se a rad ix -4 d e c im a tio n -in -fre q u e n c y F F T a lg o rith m fo r th e oddn u m b e re d sa m p le s o f th e /V -point D F T , w e o b ta in th e fo llo w in g N /4 -p o in t D FTs: N/4-1 (6.1.56) - j [ x ( n + N / 4 ) - x( n + 3 N / 4 )]} A74-1 (6.1.57) + j [ x ( n + N / 4 ) - x{ n + 3 N / 4 ) ] } W ^ T h u s th e N -p o in t D F T is d e c o m p o se d in to o n e N /2 -p o in t D F T w ith o u t ad d itio n al tw id d le facto rs a n d tw o N /4 -p o in t D F T s w ith tw id d le facto rs. T h e /V-p o in t D F T is o b ta in e d by su ccessiv e u se o f th e s e d e c o m p o s itio n s u p to th e la st stag e. T hus w e o b ta in a d e c im a tio n -in -fre q u e n c y S R F F T alg o rith m . F ig u re 6.15 sh o w s th e flow g ra p h fo r a n in -p la ce 3 2 -p o in t d ecim atio n in -freq u en cy S R F F T a lg o rith m . A t stag e A of th e c o m p u ta tio n fo r N = 32, the Sec. 6.1 471 Efficient Computation of the DFT: FFT Algorithms A B Figure 6,15 L ength 32 split-radix F F T algorithm s from p ap er by D uham el (1986); rep rin ted w ith perm ission from the IE E E . to p 16 p o in ts c o n s titu te th e se q u e n c e go(«) = x ( n ) + x ( n + N / 2) 0 < n < 15 (6.1.58) T h is is th e s e q u e n c e re q u ire d fo r th e c o m p u ta tio n o f X ( 2 k ) . T h e n e x t 8 p o in ts c o n s titu te th e se q u e n c e gi(n) = x(n) - x(n + N/ 2) 0<n<7 (6.1.59) 472 Efficient Computation of the DFT: Fast Fourier Transform Algorithms Chap. 6 T h e b o tto m e ig h t p o in ts c o n s titu te th e se q u e n c e j g 2 (71). w h ere 82 (n) = x ( n + N / 4 ) — x ( n + 3 N / 4 ) 0 < « < 7 (6.1.60) T h e se q u e n c e s gj ( n) a n d gi ( n) a re u sed in th e c o m p u ta tio n o f X ( 4 k 4 - 1) and A'( 4 * + 3). T h u s, a t stag e A w e h ave c o m p le te d th e first d e c im a tio n fo r th e radix-2 c o m p o n e n t o f th e alg o rith m . A t sta g e B , th e b o tto m eig h t p o in ts c o n stitu te the c o m p u ta tio n o f [# i(n ) + 7 ( ” )]^32 ->0 < /i < 7, w hich is u sed to c o m p u te X (4A -f 3), 0 < k < 7. T h e n ex t eig h t p o in ts fro m th e b o tto m c o n s titu te th e c o m p u ta tio n of [tfi(n) — j g 2(h)] VVjj, 0 < n < 7, w hich is u se d to c o m p u te X ( 4 k 4 -1 ), 0 < k < 7. T h u s a t stag e B , w e h av e c o m p le te d th e first d e c im a tio n fo r th e ra d ix -4 alg o rith m , w hich resu lts in tw o 8 -p o in t se q u e n c e s. H e n c e th e b asic b u tte rfly c o m p u ta tio n fo r th e S R F F T a lg o rith m h a s th e “L -s h a p e d ” form illu stra te d in Fig. 6.16. N ow w e r e p e a t th e ste p s in th e c o m p u ta tio n a b o v e. B e g in n in g w ith th e to p 16 p o in ts a t stag e A , w e r e p e a t th e d e c o m p o s itio n f o r th e 1 6 -p o in t D F T . In o th e r w o rd s, w e d e c o m p o se th e c o m p u ta tio n in to an e ig h t-p o in t, rad ix -2 D F T an d tw o fo u r-p o in t, rad ix -4 D F T s. T h u s a t sta g e B , th e to p eig h t p o in ts c o n s titu te the se q u e n c e (w ith N = 16) g'o(*) = 8o(n) + go(n 4- N / 2) 0 <n < 7 (6.1.61) an d th e n ex t eig h t p o in ts c o n s titu te th e tw o fo u r-p o in t se q u e n c e s g[(n) a n d jg'2(n), w h ere g[ (n) = go(n) ~ go(n + N f l ) 0 < n < 3 (6.1.62) 82 («) = 8o(n + N / 4 ) - g0(n + 3 N / 4 ) 0 < n < 3 T h e b o tto m 16 p o in ts o f sta g e B a re in th e fo rm o f tw o e ig h t-p o in t D F T s. H en ce ea c h e ig h t-p o in t D F T is d e c o m p o s e d in to a fo u r-p o in t, rad ix -2 D F T a n d a fourp o in t, rad ix -4 D F T . In th e final stag e, th e c o m p u ta tio n s in v o lv e th e co m b in atio n o f tw o -p o in t se q u en ces. T a b le 6.2 p r e s e n ts a c o m p a riso n o f th e n u m b e r o f nont ri vi al re a l m u ltip li­ ca tio n s a n d a d d itio n s re q u ire d to p e rfo rm a n jY -point D F T w ith co m p lex -v alu ed Sec. 6 .1 473 Efficient Computation of the DFT: FFT Algorithms TABLE 6.2 NUMBER OF NONTRIVIAL REAL MULTIPLICATIONS AND ADDITIONS TO COMPUTE AN N-POINT COMPLEX DFT Real M ultiplications Radix R adix 4 24 88 264 712 1,800 4.360 10.248 20 N 16 32 64 128 256 512 1,024 208 Radix 8 204 1.392 3.204 7,856 Real A dditions Split Radix Radix 2 Radix 4 20 68 196 516 1.284 3.076 7,172 152 408 1.032 2.504 5,896 13.566 30.728 148 976 R adix 8 972 5,488 12,420 28.336 Split Radix 148 388 964 2308 5.380 12.292 27,652 Source: E xtracted from D uham el (1986). d a ta , using a rad ix -2 , ra d ix -4, radix-8, a n d a sp lit-ra d ix F F T . N o te th a t th e S R F F T alg o rith m re q u ire s th e lo w est n u m b e r o f m u ltip lic a tio n a n d a d d itio n s. F o r this re a so n , it is p re fe ra b le in m an y p ra c tic a l a p p licatio n s. A n o th e r ty p e o f S R F F T a lg o rith m has b e e n d e v e lo p e d by P rice (1990). Its re la tio n to D u h a m e l’s a lg o rith m d e sc rib e d p rev io u sly can b e seen by n o tin g th a t th e rad ix -4 D F T te rm s X ( 4 k 4- 1) an d X ( 4 k + 3) involve th e N /4 -p o in t D F T s o f th e se q u e n c e s [g i(n ) a n d [ # i( '0 + ,/£ 2(« )]W $ \ resp ec tiv ely . In effect, th e se q u e n c e s g i(/i) a n d g 2 (n) are m u ltip lie d by th e fa c to r (v e c to r) (1, —j ) = (1, H ^ ) an d by WJJ fo r th e c o m p u ta tio n o f X ( 4 k + 1), w hile th e c o m p u ta tio n o f X (4k + 3) in v o lv es th e fa c to r (1 , j ) = (1, W{2*) an d W j f . In s te a d , o n e can r e a rra n g e th e c o m p u ta tio n so th a t th e fa c to r fo r X ( 4 k + 3) is ( —j , —1) = —(W £ 8, 1). A s a resu lt o f th is p h a s e ro ta tio n , th e tw id d le fa c to rs in th e c o m p u ta tio n o f X (4k -f 3) b eco m e ex actly th e sam e as th o se fo r X ( 4 k + 1), e x cep t th a t th e y o c c u r in m irr o r im age o rd e r. F o r e x am p le, at sta g e B o f Fig. 6.15, th e tw id d le fa c to rs W21, W 18, . . . , W3 a re re p la c e d by (V1, W 2, . . . , W 1, resp ec tiv ely . T h is m irro r-im a g e sy m m etry occurs a t ev ery s u b s e q u e n t sta g e o f th e alg o rith m . A s a c o n s e q u e n c e , th e n u m b e r o f tw id d le facto rs th a t m u st b e c o m p u te d a n d s to re d is r e d u c e d by a fa c to r o f 2 in c o m p a riso n to D u h a m e l’s a lg o rith m . T h e re su ltin g a lg o rith m is called th e “m irr o r ” F F T (M F F T ) alg o rith m . A n a d d itio n a l facto r-o f-2 savings in sto ra g e o f tw id d le fa c to rs can be o b ta in e d b y in tro d u c in g a 90° p h a s e o ffset a t th e m id p o in t o f ea c h tw id d le a rra y , w hich can b e re m o v e d if n ecessa ry a t th e o u tp u t o f th e S R F F T c o m p u ta tio n . T h e in co r­ p o r a tio n o f th is im p ro v e m e n t in to th e S R F F T ( o r th e M F F T ) re su lts in a n o th e r a lg o rith m , also d u e to P ric e (1990), c a lle d th e “p h a s e ” F F T (P F F T ) alg o rith m . 6.1.6 Implementation of FFT Algorithms N o w th a t w e h av e d e s c rib e d th e b asic rad ix -2 a n d rad ix -4 F F T a lg o rith m s, let us c o n s id e r so m e o f th e im p le m e n ta tio n issues. O u r r e m a rk s ap p ly d ire c tly to 474 Efficient Computation of the DFT: Fast Fourier Transform Algorithms Chap. 6 rad ix -2 a lg o rith m s, a lth o u g h sim ilar c o m m e n ts m ay b e m a d e a b o u t rad ix -4 a n d h ig h er-rad ix alg o rith m s. B asically, th e rad ix -2 F F T a lg o rith m co n sists o f ta k in g tw o d a ta p o in ts a t a tim e fro m m e m o ry , p e rfo rm in g th e b u tte rfly c o m p u ta tio n s a n d r e tu rn in g th e r e ­ su ltin g n u m b e rs to m em o ry . T h is p ro c e d u re is r e p e a te d m an y tim e s ( ( N log2 N) [ 2 tim es) in th e c o m p u ta tio n o f an JV-point D F T . T h e b u tterfly c o m p u ta tio n s re q u ire th e tw id d le fa c to rs {W^} a t v a rio u s stages in e ith e r n a tu ra l o r b it-re v e rse d o rd e r. In an efficien t im p le m e n ta tio n o f th e algo­ rith m , th e p h ase fa c to rs a re c o m p u te d o n ce a n d s to re d in a ta b le , e ith e r in n o rm a l o r d e r o r in b it-re v e rse d o rd e r, d e p e n d in g o n th e specific im p le m e n ta tio n o f th e alg o rith m . M e m o ry re q u ire m e n t is a n o th e r fa c to r th a t m u st b e c o n s id e re d . If th e c o m ­ p u ta tio n s a re p e rfo rm e d in p lace, th e n u m b e r o f m e m o ry lo c a tio n s re q u ire d is 2 N since th e n u m b e rs a re com plex. H o w e v e r, w e can in ste a d d o u b le th e m e m o ry to 4N , th u s sim p lifying th e in d ex in g a n d c o n tro l o p e r a tio n s in th e F F T a lg o rith m s. In th is case w e sim p ly a lte rn a te in th e use o f th e tw o se ts o f m e m o ry lo c a tio n s from o n e sta g e o f th e F F T a lg o rith m to th e o th e r. D o u b lin g o f th e m e m o ry also allow s us to h av e b o th th e in p u t se q u e n c e a n d th e o u tp u t se q u e n c e in n o rm a l o rd e r. T h e re are a n u m b e r o f o th e r im p le m e n ta tio n issues re g a rd in g ind ex in g , bit rev ersal, an d th e d e g re e o f p arallelism in th e c o m p u ta tio n s. T o a larg e ex ten t, th e se issues a re a fu n ctio n o f th e specific a lg o rith m a n d th e ty p e o f im p le m e n ta ­ tio n , n am ely , a h a rd w a re o r so ftw are im p le m e n ta tio n . In im p le m e n ta tio n s b ased o n a fix ed -p o in t a rith m e tic , o r flo atin g -p o in t a rith m e tic o n sm a ll m a ch in es, th e re is also th e issue o f ro u n d -o ff e rro rs in th e c o m p u ta tio n . T h is to p ic is co n sid e re d in S ectio n 6.4. A lth o u g h th e F F T a lg o rith m s d e sc rib e d p re v io u sly w e re p re s e n te d in th e c o n te x t o f co m p u tin g th e D F T efficiently, th e y can also b e u s e d to c o m p u te th e ID F T , w hich is j A '- l * (") = 7 T ] C * ( *=0 (6' ll63) T h e o n ly d iffe re n c e b e tw e e n th e tw o tra n sfo rm s is th e n o rm a liz a tio n fa c to r l / N a n d th e sign o f th e p h a se fa c to r WN. C o n s e q u e n tly , a n F F T a lg o rith m fo r co m ­ p u tin g th e D F T , c a n b e c o n v e rte d to an F F T a lg o rith m fo r c o m p u tin g th e ID F T by ch an g in g th e sign o n all th e p h a se fa c to rs a n d d iv id in g th e final o u tp u t o f th e alg o rith m by N. In fact, if w e ta k e th e d e c im a tio n -in -tim e a lg o rith m t h a t w e d e sc rib e d in S ectio n 6.1.3, re v e rse th e d ire c tio n o f th e flow g ra p h , c h a n g e th e sign o n th e p h ase facto rs, in te rc h a n g e th e o u tp u t a n d in p u t, a n d finally, d iv id e th e o u tp u t by N , w e o b ta in a d e c im a tio n -in -fre q u e n c y F F T a lg o rith m fo r c o m p u tin g th e ID F T . O n th e o th e r h a n d , if w e b eg in w ith th e d e c im a tio n -in -fre q u e n c y F F T a lg o rith m d escrib ed in S ectio n 6.1.3 a n d r e p e a t th e ch an g es d e s c rib e d a b o v e , w e d b ta in a d ecim atio n in -tim e F F T a lg o rith m fo r c o m p u tin g th e ID F T . T h u s it is a sim p le m a tte r to devise F F T a lg o rith m s fo r co m p u tin g th e ID F T . Sec. 6.2 Applications of FFT Algorithms 475 F in ally , w e n o te th a t th e em p h asis in o u r discussion o f F F T a lg o rith m s w as o n rad ix -2 , rad ix -4 , a n d sp lit-ra d ix a lg o rith m s. T h e se are by fa r th e m o st w idely u se d in p ra c tic e . W h e n th e n u m b e r o f d a ta p o in ts is n o t a p o w e r o f 2 o r 4. it is a sim p le m a tte r to p a d th e se q u e n c e x ( n ) w ith zero s such th a t /V = 2 1’ o r N = 4 '. T h e m e a s u re o f co m p lex ity fo r F F T alg o rith m s th a t w e h av e e m p h a siz e d is th e r e q u ire d n u m b e r o f a rith m e tic o p e ra tio n s (m u ltip lic a tio n s an d a d d itio n s). A lth o u g h this is a v ery im p o rta n t b e n c h m a rk fo r c o m p u ta tio n a l co m p lex ity , th e re a re o th e r issues to b e c o n s id e re d in p ractical im p le m e n ta tio n o f F F T a lg o rith m s. T h e se in clu d e th e a rc h ite c tu re o f th e p ro cesso r, th e av ailab le in stru c tio n set, th e d a ta s tru c tu re s fo r s to rin g tw id d le facto rs, an d o th e r c o n sid e ra tio n s. F o r g e n e ra l-p u rp o s e c o m p u te rs, w h e re th e cost o f th e n u m e ric a l o p e ra tio n s d o m in a te , rad ix -2 , rad ix-4, an d sp lit-ra d ix F F T a lg o rith m s a re go o d c a n d id a te s. H o w e v e r, in th e case o f sp e c ia l-p u rp o se digital signal p ro c e ss o rs , fe a tu rin g sin g le­ cycle m u ltip ly -a n d -a c c u m u la te o p e ra tio n , b it-re v e rse d ad d re ssin g , a n d a high d e ­ g ree o f in stru c tio n p a ra lle lism , th e stru c tu ra l re g u la rity o f th e a lg o rith m is eq u ally im p o rta n t as a rith m e tic co m p lex ity . H e n c e fo r D S P p ro c e sso rs, rad ix -2 o r radix4 d e c im a tio n -in -fre q u e n c y F F T a lg o rith m s are p re fe ra b le in te rm s o f sp e e d an d a ccu racy . T h e irre g u la r stru c tu re o f th e S R F F T m ay r e n d e r it less su ita b le fo r im p le m e n ta tio n o n d ig ital signal pro cesso rs. S tru c tu ra l re g u la rity is also im p o rta n t in th e im p le m e n ta tio n o f F F T a lg o rith m s on v e c to r p ro c e sso rs, m u ltip ro c e sso rs, a n d in V L SI. I n te rp ro c e s s o r co m m u n icatio n is an im p o rta n t c o n s id e ra tio n in such im p le m e n ta tio n s o n p a rallel pro cesso rs. In co n clu sio n , we h av e p re s e n te d several im p o rta n t c o n s id e ra tio n s in th e im p le m e n ta tio n o f F F T a lg o rith m s. A d v an ce s in digital signal p ro cessin g te c h n o l­ ogy, in h a rd w a re a n d so ftw are, will c o n tin u e to influence th e ch o ice a m o n g F F T a lg o rith m s fo r v a rio u s p ractical ap p licatio n s. 6.2 APPLICATIONS OF FFT ALGORITHMS T h e F F T a lg o rith m s d e sc rib e d in th e p re c e d in g se ctio n find a p p lic a tio n in a v ariety o f a re a s , in clu d in g lin e a r filtering, c o rre la tio n , a n d s p e c tru m analysis. B asically, th e F F T a lg o rith m is u sed as a n efficient m e a n s to c o m p u te th e D F T a n d th e ID F T . In th is se c tio n w e c o n s id e r th e u se o f th e F F T a lg o rith m in lin e a r filterin g a n d in th e c o m p u ta tio n o f th e c ro ssco rrelatio n o f tw o se q u e n c e s. T h e use o f th e F F T in s p e c tru m an aly sis is c o n sid e re d in C h a p te r 12. In a d d itio n w e illu strate h o w to e n h a n c e th e efficiency o f th e F F T a lg o rith m by fo rm in g co m p le x -v a lu e d se q u e n c e s fro m re a l-v a lu e d se q u e n c e s p rio r to th e c o m p u ta tio n o f th e D F T . 6.2.1 Efficient Computation of the DFT of Two Real Sequences T h e F F T a lg o rith m is d esig n e d to p e rfo rm co m p lex m u ltip lic a tio n s a n d a d d itio n s, ev en th o u g h th e in p u t d a ta m ay b e re a l v alued. T h e b asic re a s o n fo r th is s itu a tio n is 476 Efficient Computation of the DFT: Fast Fourier Transform Algorithms Chap. 6 th a t th e p h a se fa c to rs a re co m p lex a n d h e n c e , a fte r th e first sta g e o f th e alg o rith m , all v a riab les a re b asically co m p lex -v alu ed . In view o f th e fact th a t th e a lg o rith m can h a n d le c o m p le x -v a lu e d in p u t se­ q u en ces, w e c a n ex p lo it th is cap ab ility in th e c o m p u ta tio n o f th e D F T o f tw o re a l-v a lu e d se q u e n c e s. S u p p o se th a t * i(n ) a n d x 2(n) are tw o re a l-v a lu e d se q u e n c e s o f len g th N , and let x( n ) b e a co m p le x -v a lu e d se q u e n c e d efin ed as x ( n ) = X] (n) + j x 2 (n) 0 < n < N —1 (6.2.1) T h e D F T o p e ra tio n is lin e a r a n d h en ce th e D F T o f x ( n ) can be ex p re sse d as X ( k ) = X ](k) + j X 2(k) (6.2.2) T h e se q u e n c e s ^ i(« ) an d J 2 OO can be ex p re sse d in te rm s o f x ( n ) as follow s: , 4 ac(H) + J:*(n) * i(« ) = -------- 2-------- (6.2.3) x(n)-x*(n) •*:(«) = ------- tt.-------- (6.2.4) H e n c e th e D F T s o f jri(n ) an d x 2(n) are -] \ D F T [ x { n ) } + D F T [ x \ n ) } ) (6.2.5) X 2(k) = j - \ D F T [ x ( n )] - DF T [ x * ( n ) ] ) (6.2.6) * ,( * ) = R ecall th a t th e D F T o f x*( n) is X * ( N — k). T h e re fo re , X] (k) = i[X (* r) + X * ( N - jt)] (6.2.7) X 2(k) = -^ [X (* > - X * ( N - *)] ;2 (6.2.8) T h u s, by p e rfo rm in g a single D F T o n th e co m p le x -v a lu e d se q u e n c e x ( n ), we h av e o b ta in e d th e D F T o f th e tw o re a l se q u e n c e s w ith only a sm all a m o u n t of a d d itio n a l c o m p u ta tio n th a t is involved in co m p u tin g Xi (Jt) a n d X 2 (k) fro m X(k) by u se o f (6.2.7) a n d (6.2.8). 6.2.2 Efficient Computation of the DFT of a 2/V-Point Real Sequence S u p p o se th a t g( n) is a re a l-v a lu e d se q u e n c e o f 2 N p o in ts. W e n o w d e m o n s tra te h o w to o b ta in th e 2 N -p o in t D F T o f g( n) fro m c o m p u ta tio n o f o n e A ppoint D F T involving c o m p le x -v a lu e d d a ta . F irst, w e define * i(n ) = g(2 n) (6.2.9) *2(n) = g ( 2 n + 1) Sec. 6.2 477 Applications of FFT Algorithms T h u s w e h a v e su b d iv id e d th e 2 N -p o in t re a l se q u e n c e in to tw o W -point real se ­ q u e n c e s. N o w w e can ap p ly th e m e th o d d escrib ed in th e p re c e d in g sectio n . L et jc(n) b e th e A7-p o in t c o m p lex -v alu ed se q u e n c e A-(n) = * i ( n ) + j x i i n ) (6 .2 .10) F ro m th e re su lts o f th e p re c e d in g se ctio n , w e h av e x m = ^ [* (* ) + * * ( * - * ) ] j (6.2.11) X 2(k) = — [ X( k) - X * ( N - k)] F inally, w e m u st ex p re ss th e 2/V -point D F T in te rm s o f th e tw o /V -point D F T s, Xi(A) a n d X 2(k). T o acco m p lish this, w e p ro c e e d as in th e d e c im a tio n -in -tim e F F T a lg o rith m , n am ely , N -1 N-1 C( k ) = £ s < 2 h ) H $ * + J 2 s ( 2 n + ^ W7 N ^ k n=tl n=0 N- l N-1 «=() n=() C o n s e q u e n tly , G( k ) = X t (k) + W i N X 2(k) k = 0 . 1 ..........N - 1 ( 6 . 2 . 12 ) G( k + N ) = X i ( k ) - W%N X 2(k) k = Q . \ ..........N - l T h u s w e h av e c o m p u te d th e D F T o f a 2/V -point real se q u e n c e from o n e jV-point D F T an d so m e a d d itio n a l c o m p u ta tio n as in d icated by (6.2.11) an d (6.2.12). 6.2.3 Use of the FFT Algorithm in Linear Filtering and Correlation A n im p o rta n t ap p lic a tio n o f th e F F T a lg o rith m is in F IR lin e a r filterin g o f lo n g d a ta se q u e n c e s. In C h a p te r 5 w e d e sc rib e d tw o m e th o d s, th e o v e rla p -a d d an d th e o v e rla p -sa v e m e th o d s fo r filterin g a lo n g d a ta se q u e n c e w ith an F I R filter, b a s e d o n th e u se o f th e D F T . In th is se ctio n w e c o n sid e r th e u se o f th e s e tw o m e th o d s in c o n ju n c tio n w ith th e F F T a lg o rith m fo r co m p u tin g th e D F T an d th e ID F T . L e t h( n), 0 < n < M - 1 , b e th e u n it sa m p le re sp o n s e o f th e F IR filter an d let x ( n ) d e n o te th e in p u t d a ta se q u e n c e . T h e block size o f th e F F T alg o rith m is N , w h e re N = L + M — 1 an d L is th e n u m b e r o f new d a ta sa m p le s b e in g p ro cessed by th e filter. W e a ssu m e th a t fo r a n y given v alu e o f Af, th e n u m b e r L o f d a ta sa m p le s is se le c te d so th a t N is a p o w e r o f 2. F o r p u rp o se s o f th is discussion, w e c o n s id e r o n ly rad ix -2 F F T alg o rith m s. T h e /V -point D F T o f h(n), w hich is p a d d e d b y L — 1 z e ro s, is d e n o te d as H( k ) . T h is c o m p u ta tio n is p e rfo rm e d o n c e via th e F F T an d th e re su ltin g N co m p lex n u m b e rs a r e sto re d . T o be specific w e a ssu m e th a t th e d e c im a tio n -in -fre q u e n c y 478 Efficient Computation of the DFT: Fast Fourier Transform Algorithms Chap. 6 F F T a lg o rith m is u se d to c o m p u te H( k ) . T h is y ields H ( k ) in b it-re v e rse d o rd e r, w hich is th e w ay it is s to re d in m em ory. In th e o v e rlap -sav e m e th o d , th e first M —1 d a ta p o in ts o f e a c h d a ta b lo ck are th e last M — 1 d a ta p o in ts o f th e p rev io u s d a ta b lo ck . E a c h d a ta b lo c k c o n ta in s L new d a ta p o in ts, su ch th a t N = L + M — 1. T h e N -p o in t D F T o f ea c h d a ta block is p e rfo rm e d by th e F F T alg o rith m . If th e d e c im a tio n -in -fre q u e n c y alg o rith m is e m p lo y ed , th e in p u t d a ta b lo ck re q u ire s n o shuffling a n d th e v a lu e s o f th e D F T o ccu r in b it-re v e rse d o rd e r. S ince th is is ex actly th e o r d e r o f H ( k ) . w e can m ultiply th e D F T o f th e d a ta , say Xm(fc), w ith //(Jt) a n d th u s th e re su lt Ym(k) = H ( k ) X m(k) is also in b it-re v e rse d o rd e r. T h e in v erse D F T (ID F T ) can b e c o m p u te d by use o f an F F T alg o rith m th a t ta k e s th e in p u t in b it-re v e rse d o r d e r a n d p ro d u c e s an o u tp u t in n o rm al o rd er. T h u s th e r e is n o n e e d to shuffle any b lo ck o f d a ta e ith e r in c o m p u tin g th e D F T o r th e ID F T . If th e o v e rla p -a d d m e th o d is used to p e rfo rm th e lin e a r filterin g , th e co m p u ­ ta tio n a l m e th o d u sin g th e F F T a lg o rith m is basically th e sa m e. T h e only differen ce is th a t th e N -p o in t d a ta b lo ck s consist o f L new d a ta p o in ts a n d M — 1 a d d itio n a l zero s. A fte r th e I D F T is c o m p u te d fo r ea c h d a ta b lo ck , th e W -point filtered blocks a re o v e rla p p e d as in d ic a te d in S ectio n 5.3.2, a n d th e M - 1 o v e rla p p in g d a ta p o in ts b e tw e e n successive o u tp u t re c o rd s a re a d d e d to g e th e r. L et u s assess th e c o m p u ta tio n a l co m p lex ity o f th e F F T m e th o d fo r lin e a r fil­ terin g . F o r th is p u rp o se , th e o n e -tim e c o m p u ta tio n o f H ( k ) is in sig n ifican t an d can b e ig n o red . E ach F F T re q u ire s ( N / 2) log2 N co m p lex m u ltip lic a tio n s an d N Iog2 N a d d itio n s. Since th e F F T is p e rfo rm e d tw ice, o n ce fo r th e D F T a n d o n ce fo r th e ID F T , th e c o m p u ta tio n a l b u rd e n is N log2 N co m p lex m u ltip lic a tio n s an d 2 N log2 N a d d itio n s. T h e re a re also N co m p lex m u ltip lic a tio n s a n d N — 1 a d d itio n s re q u ire d to c o m p u te ym(Jfc). T h e re fo re , w e h av e ( N \ o g 2 2 N ) / L co m p lex m u ltip lic a tio n s p er o u tp u t d a ta p o in t a n d a p p ro x im a te ly ( 2 N \ o g 2 2 N ) / L a d d itio n s p e r o u tp u t d ata p o in t. T h e o v e rla p -a d d m e th o d re q u ire s an in c re m e n ta l in c re a se o f ( M — \ ) / L in th e n u m b e r o f ad d itio n s. B y w ay o f c o m p a riso n , a d ire c t fo rm re a liz a tio n o f th e F I R filter involves M real m u ltip lic atio n s p e r o u tp u t p o in t if th e filter is n o t lin e a r p h a s e , a n d M / 2 if it is lin e a r p h ase (sy m m etric ). A lso , th e n u m b e r o f a d d itio n s is M - 1 p e r o u tp u t p o in t (see Sec. 8.2). I t is in te re stin g to co m p a re th e efficiency o f th e F F T a lg o rith m w ith th e direct fo rm re a liz a tio n o f th e F IR filter. L e t us focus o n th e n u m b e r o f m ultip lic atio n s, w h ich a re m o re tim e co n su m in g th a n a d d itio n s. S u p p o se th a t M = 128 = 27 an d N = 2 V. T h e n th e n u m b e r o f co m p lex m u ltip lic a tio n s p e r o u tp u t p o in t fo r an F F T size o f N = 2 V is Sec. 6.3 A Linear Filtering Approach to Computation of the DFT TABLE 6.3 479 COMPUTATIONAL COMPLEXITY Size of FFT i) —log2 N f(v) Number of Complex Multiplications per Output Point 9 10 11 12 14 13.3 12.6 12.8 13.4 15.1 T h e v alu es o f c( v) fo r d iffe re n t v alu es o f i> are given in T a b le 6.3. W e o b se rv e th a t th e re is an o p tim u m v a lu e o f i< w h ich m in im iz es c(u ). F o r th e F IR filter of size M = 128, th e o p tim u m o ccu rs at d = 10. W e sh o u ld e m p h asize th a t c ( f ) r e p re s e n ts th e n u m b e r o f co m p lex m u ltip lic a­ tio n s fo r th e F F T -b a se d m e th o d . T h e n u m b e r o f re a l m u ltip lic a tio n s is fo u r tim es th is n u m b e r. H o w e v e r, ev en if th e F IR filter has lin e a r p h a s e (see Sec. 8.2), th e n u m b e r o f c o m p u ta tio n s p e r o u tp u t p o in t is still less w ith th e F F T -b a se d m eth o d . F u rth e rm o r e , th e efficiency o f th e F F T m e th o d can be im p ro v e d by c o m p u tin g th e D F T o f tw o successive d a ta b lo ck s sim u lta n e o u sly , ac c o rd in g to th e m eth o d ju st d e sc rib e d . C o n s e q u e n tly , th e F F T -b a se d m e th o d is in d e e d su p e rio r from a c o m p u ta tio n a l p o in t o f view w h en th e filter len g th is re lativ ely large. T h e c o m p u ta tio n o f th e cross c o rre la tio n b e tw e e n tw o se q u e n c e s by m e a n s o f th e F F T a lg o rith m is sim ilar to th e lin e a r F IR filtering p ro b le m ju st d esc rib e d . In p ractical a p p lic a tio n s involving c ro ssc o rre la tio n , a t least o n e o f th e se q u e n c e s has finite d u ra tio n an d is a k in to th e im p u lse re sp o n s e o f th e F IR filter. T h e seco n d s e q u e n c e m ay be a lo n g se q u e n c e w hich c o n ta in s th e d e s ire d se q u e n c e c o rru p te d b y a d d itiv e n o ise. H e n c e th e se co n d se q u e n c e is a k in to th e in p u t to th e F I R filter. B y tim e rev e rsin g th e first se q u e n c e a n d co m p u tin g its D F T , w e h av e r e d u c e d th e cro ss c o rre la tio n to an e q u iv a le n t co n v o lu tio n p ro b le m (i.e.. a lin e a r F I R filtering p ro b le m ). T h e re fo re , th e m e th o d o lo g y w e d e v e lo p e d fo r lin e a r F IR filterin g by u se o f th e F F T a p p lie s directly. 6.3 A LINEAR FILTERING APPROACH TO COMPUTATION OF THE DFT T h e F F T alg o rith m ta k e s N p o in ts o f in p u t d a ta a n d p ro d u c e s an o u tp u t se q u e n c e o f N p o in ts c o rre sp o n d in g to th e D F T o f th e in p u t d a ta . A s w e h a v e show n, th e rad ix -2 F F T a lg o rith m p e rfo rm s th e c o m p u ta tio n of th e D F T in ( N f l ) log2 N m u ltip lic a tio n s a n d N log2 N a d d itio n s fo r a n N -p o in t se q u e n c e . T h e re a re so m e a p p lic a tio n s w h e re o n ly a se le c te d n u m b e r o f valu es o f th e D F T a re d e s ire d , b u t th e e n tire D F T is n o t re q u ire d . In such a case, th e F F T a lg o rith m m ay n o lo n g e r be m o r e efficien t th a n a d ire c t c o m p u ta tio n o f th e d e s ire d v alu es o f th e D F T . In fact, w h e n th e d e s ire d n u m b e r o f valu es o f 480 Efficient Computation of the DFT: Fast Fourier Transform Algorithms Chap. 6 th e D F T is less th a n log2 N , a d ire c t c o m p u ta tio n o f th e d e s ire d v alu es is m o re efficient. T h e d irect c o m p u ta tio n o f th e D F T can b e fo rm u la te d as a lin e a r filtering o p e ra tio n o n th e in p u t d a ta se q u en ce. A s w e will d e m o n s tra te , th e lin e a r filter ta k e s th e fo rm o f a p a ra lle l b a n k o f re so n a to rs w h e re ea c h r e s o n a to r se lects o n e o f th e fre q u e n c ie s a>k = 2 n k / N , k = 0, 1 , . . . , N — 1, c o rre sp o n d in g to th e N fre q u e n c ie s in th e D F T . T h e re a re o th e r a p p lic a tio n s in w hich w e re q u ire th e e v a lu a tio n o f th e ztra n sfo rm o f a fin ite -d u ra tio n se q u e n c e a t p o in ts o th e r th a n th e u n it circle. If th e se t o f d e sire d p o in ts in th e z-p lan e po ssesses so m e re g u la rity , it is possible to also ex p ress th e c o m p u ta tio n o f th e z -tra n s fo rm a s a lin e a r filte rin g o p e ra tio n . In th is c o n n e c tio n , w e in tro d u c e a n o th e r alg o rith m , called th e c h irp -z tra n sfo rm alg o rith m , w hich is su ita b le fo r e v a lu a tin g th e z -tra n s fo rm o f a se t o f d a ta o n a v ariety o f c o n to u rs in th e z-p lan e. T h is alg o rith m is also fo rm u la te d as a lin ear filtering o f a set o f in p u t d a ta . A s a co n se q u e n c e , th e F F T a lg o rith m can b e used to c o m p u te th e ch irp -z tra n sfo rm a n d th u s to e v a lu a te th e z -tra n s fo rm at various c o n to u rs in th e z -p la n e , in clu d in g th e u n it circle. 6.3.1 The Goertzel Algorithm T h e G o e rtz e l a lg o rith m ex p lo its th e p erio d icity o f th e p h ase fa c to rs {W£} an d allow s us to ex p re ss th e c o m p u ta tio n o f th e D F T as a lin e a r filterin g o p e ra tio n . Since W # kN = 1, w e can m u ltip ly th e D F T by th is fa c to r. T h u s (6.3.1) W e n o te th a t (6.3.1) is in th e fo rm of a c o n v o lu tio n . se q u e n c e yk(n) as In d e e d , if w e d efin e the (6.3.2) m=0 th e n it is c le a r th a t » ( n ) is th e co n v o lu tio n o f th e fin ite -d u ra tio n in p u t se q u en ce x( n ) o f len g th N w ith a filter th a t h as an im pulse re sp o n s e h k(n) = W ~ knu ( n ) (6.3.3) T h e o u tp u t o f th is filter a t n = N y ields th e v alu e o f th e D F T a t th e freq u e n cy an = h r k / N . T h a t is, X ( k ) = >*(n)|n=JV (6.3.4) as can b e verified b y c o m p a rin g (6.3.1) w ith (6.3.2). T h e filter w ith im p u lse re s p o n s e h k (n) h a s th e sy stem fu n c tio n (6.3.5) Sec. 6.3 A Linear Filtering Approach to Computation of the DFT 481 T h is filter h as a p o le o n th e u n it circle a t th e fre q u e n c y cd* = 2n k / N . T h u s, the e n tire D F T can b e c o m p u te d by passin g th e block o f in p u t d a ta in to a p a ra l­ lel b a n k o f N sin g le-p o le filters (re s o n a to rs), w h ere each filter h as a p o le at the c o rre sp o n d in g fre q u e n c y o f th e D F T . I n s te a d o f p e rfo rm in g th e c o m p u ta tio n o f th e D F T as in (6.3.2), via co n v o lu ­ tio n , w e can use th e d iffe re n c e e q u a tio n c o rre sp o n d in g to th e filter given by (6.3.5) to c o m p u te y k(ir) recu rsiv ely . T h u s we h av e y t (n) = W ^ kyt ( n - 1) + x i n ) V i-(-l) = 0 (6.3.6) T h e d e sire d o u tp u t is X ( k ) = y k( N) , fo r k = 0, 1 , . . . , N — 1. T o p e rfo rm this c o m p u ta tio n , w e can c o m p u te o n ce a n d sto re th e p h a s e facto rs W # k. T h e co m p lex m u ltip lic a tio n s an d a d d itio n s in h e re n t in (6.3.6) can be av o id ed by co m b in in g th e p airs o f re so n a to rs p o ssessin g c o m p le x -c o n ju g a te p oles. T his lead s to tw o -p o le filters w ith system fu n c tio n s o f th e form ] _ iy* HkL ) ~ 1 - 2 c o s ( 2 t i k / N ) : ~ l + C ' 2 (6'3 '7) T h e d irect form II re a liz a tio n o f th e system illu stra te d in Fig. 6.17 is d e sc rib e d by th e d iffe re n c e e q u a tio n 2:rk v k(n) = 2 cos — N v*.(zi — 1) - vk(n - 2) + x( i t ) Vi(h) = vk in) - W N k vk (n - 1) (6.3.8) (6.3.9) w ith in itial c o n d itio n s iv - ( - l) = vk{ - 2 ) = 0. T h e recu rsiv e re la tio n in (6.3.8) is ite ra te d for n = 0, 1.........N , b u t th e e q u a ­ tio n in (6.3.9) is c o m p u te d o n ly o n ce a t tim e n = N. E ach ite ra tio n re q u ire s o n e real m u ltip lic a tio n a n d tw o a d d itio n s. C o n se q u e n tly , fo r a re a l in p u t se q u e n c e x ( n) . th is a lg o rith m re q u ire s N + 1 re a l m u ltip lic a tio n s to yield n o t o n ly X ( k ) b ut also, d u e to sy m m etry , th e v a lu e o f X ( N — k). T h e G o e rtz e l alg o rith m is p a rtic u la rly a ttra c tiv e w h en th e D F T is to b e c o m ­ p u te d at a re lativ ely sm all n u m b e r M o f values, w h e re M < Iog2 N . O th erw ise, th e F F T a lg o rith m is a m o re efficient m e th o d . Figure 6.17 Direct form It realization of two-pole resonator for computing the DFT. 482 Efficient Computation of the DFT: Fast Fourier Transform Algorithms Chap. 6 6.3.2 The Chirp-z Transform Algorithm T he D F T o f an W -point data seq u en ce x(n ) has b een view ed as the z-transform o f x i n ) evaluated at N equally spaced p oin ts on the unit circle. It has also been view ed as N equally spaced sam ples o f the Fourier transform o f th e data sequ en ce x (n ). In this section w e consider the evaluation o f X ( z ) on other contours in the z-plane, including th e unit circle. S u ppose that w e wish to com p ute the values o f the z-transform o f jc(n) at a set o f p oints {z*}. T hen, A '- l X i z k) = J 2 x ( n ) z r * = 0 , 1 .........L - 1 (6.3.10) n=0 For exam ple, if the contour is a circle o f radius r and the z* are N equally spaced points, then Zk = r e j 2”*"/" 2=1 X ( z k) = J 2 i x M r ~n}e n=0 , k = 0 1,2 ..... N - 1 (6.3.11) n/N k = 0 , 1 , 2 .........N - 1 In this case the FFT algorithm can be applied on the m odified seq u en ce x { n ) r ~ n. M ore generally, suppose that the p oin ts z* in the z-plane fall on an arc which begins at som e point Zo = r0eJlk’ and spirals either in toward the origin or out away from the origin such that the points are defined as zk = rQe je°(Roei *‘)i k = 0 ,1 ,..., L - 1 (6.3.12) N o te that if R0 < 1, the points fall on a con tour that spirals tow ard th e origin and if R0 > 1, the contour spirals away from the origin. If Ro — 1, the con tou r is a circular arc o f radius ro. If r0 = 1 and Ro = l , the con tour is an arc o f th e unit circle. The latter contour w ould allow us to com p ute the frequency con ten t o f the sequence x ( n ) at a dense set o f L freq u en cies in the range covered by the arc w ithout having to com pute a large D F T , that is, a D F T o f the seq u en ce x ( n ) pad d ed with many zeros to obtain the desired resolution in frequency. Finally, if r0 = Ro = 1, = 0, 0o = 2n / N , and L = N , the contour is the entire unit circle and the frequencies are those o f the D F T . T h e various contours are illustrated in Fig. 6.18. W hen points {z*J in (6.3.12) are substituted in to the exp ression for the ztransform, w e obtain * ( z t ) = X ! -* ( ” > z r i n=0 n=° N-1 = j > ( n ) ( r 0e j * ) ~ ”V (6.3.13) Sec. 6.3 A Linear Filtering Approach to Computation of the DFT lm(r) ImU) lm (;l Im(;) 483 n=0 Figure 6.18 Some examples of contours on which we may evaluate the ztransform. w here, by definition. V = R veJ^ (6.3.14) W e can exp ress (6.3.13) in the form o f a con volu tion , by n oting that nk = j[n 2 + k 2 — (k — n) 2] (6.3.15) Substitution o f (6.3.15) into (6.3.13) yield s N- 1 X(C*) = V - l ' Z /2 J 2 [ x ( n ) ( r 0eJlk' ) - nV - n2f2] V (k- n)2fZ (6.3.16) Let us define a n ew seq u en ce g ( n ) as g (n) = x ( n )( r ^ e j<hr n V - n^ (6.3.17) T h en (6.3.16) can b e exp ressed as X ( z k) = V - k2/2y g ( n ) V {k-',)1/2 (6.3.18) 484 Efficient Computation of the DFT: Fast Fourier Transform Algorithms Chap. 6 T he sum m ation in (6.3.18) can be interpreted as the con volu tion o f the sequ en ce g (n) with the im pulse resp onse h (n) o f a filter, where h(n) = V n2/2 (6.3.19) C onsequently, (6.3.18) m ay b e expressed as X(zt) = V -*Vy(k) (6.3.20) w here y(Jt) is the ou tp u t o f the filter s —1 y ( k ) = Y ' g ( n ) h ( k — n) n=0 k = 0. 1.........L — 1 (6.3.21) W e observe that b oth h (n) and g(n) are com p lex-valu ed seq u en ces. T he sequ en ce h (n) with R 0 = 1 has the form o f a com plex exp on en tial with argum ent (on = n 2<(>o /2 = (n 0 o /2 )n. T h e quantity rep resents the frequency o f the com plex exp on en tial signal, which increases linearly with tim e. Such signals are used in radar system s and are called chi rp signals. H en ce th e z-transform evaluated as in (6.3.18) is called the chi rp-z t ransf orm. T h e linear con volu tion in (6.3.21) is m ost efficien tly d on e by use o f the FFT algorithm . T he seq u en ce g( n) is o f length N . H ow ever, h{n) has infinite du­ ration. Fortunately, only a portion h{n) is required to co m p u te the L values o f X (z). Since w e will com p ute the con volu tion in (6.3.1) via the F FT, let us consider the circular con volu tion o f the W-point seq u en ce g{n) with an M -p oint section of /i(n), w here M > N . In such a case, w e k n ow that the first N — 1 p oin ts contain aliasing and that the rem aining M — N + 1 p oints are identical to the result that would b e obtained from a linear con volu tion o f h( n) with g(n). In view o f this, we should select a D F T o f size M - L + N - 1 which would yield L valid p oin ts and N - 1 points corrupted by aliasing. T he section o f h(n) that is n eed ed for this com putation corresp on d s to the values o f h{ri) for —( N - 1) < n < (L — 1), which is o f length M = L + N — 1, as observed from (6.3.21). Let us define the seq u en ce h \{n ) o f length M as /ii(n ) = h(n — N -f 1) n — 0 , 1 .........M — 1 (6.3.22) and com p ute its Af-poin t D F T via the FFT algorithm to obtain H \ ( k ) . F rom x (n ) w e com p ute g ( n ) as specified by (6.3.17), pad g(n ) w ith L — 1 zeros, and com ­ pute its Af-point D F T to yield G(Jfc). T h e ID F T o f th e product y i(* ) = G ( k ) H \( k ) yields the Af-point seq u en ce > i(n ), n = 0, 1 , . . . , Af — 1. T h e first N — 1 p oints of y i(« ) are corrupted by aliasing and are discarded. T h e desired valu es are yi(n) f o r N — 1 < n < M — 1, w hich correspond to the range 0 < n < L — l i n (6.3.21), Sec. 6.3 A Linear Filtering Approach to Computation of the DFT 485 that is, y(n) = y t ( n + N — 1) n = 0, 1.........L — 1 (6.3.23) A ltern atively, w e can define a seq u en ce ft 2 (n) as h 2(n) = h (n), h ( n ~ N - L + l), 0 < n < L —1 L < ti < M — 1 (6.3.24) The A f-point D F T o f h 2{n) yields H2(k), which w hen m ultiplied by G( k ) yields Y2(k) = G( k ) Hz ( k ) . T he ID F T o f Y2(k) yield s the seq u en ce y2( n) for 0 < n < A f - 1 . N o w the desired valu es o f >’2 (") are in the range 0 < n < L — 1, that is, y ( n ) = y 2(n) n = 0, 1 , . . . , L — 1 (6.3.25) Finally, the com p lex valu es X(Zi) are com p uted by dividing y( k) by h ( k ), k = 0, 1.........L — 1, as specified by (6.3.20). In gen eral, the com p utational com p lexity o f the chirp-z transform algorithm described ab ove is o f the order of Af log 2 M com plex m ultiplications, where M = N + L ~ 1. T h is num ber should be com pared with the product, N ■L, the num ber o f com p utations required by direct evaluation o f the z-transform . Clearly, if L is sm all, direct com p utation is m ore efficient. H ow ever, if L is large, then the chirp-z transform algorithm is m ore efficient. T h e chirp-z transform m eth od has b een im plem ented in hardware to com pute the D F T o f signals. For the com putation of the D FT, w e select ro = /?(i = 1, 6\j = 0, </>o = 2n / N , and L = N. In this case y-ir/2 _ e -jjin -/N nn2 . Tin2 = c o s --------- j s i n ------N N <6 '3 '26 > T he chirp filter with im pulse response h( n) = V nlfl t2 . nn2 = c o s -------i n ----— (- j/ ssin — N N (6.3.27) = h r(n) + jh , { n ) has b een im p lem en ted as a pair o f F IR filters w ith coefficients h r (n) and A,(n), resp ectively. B o th su rface acous tic w av e (SAW ) d evices and charge co u p l e d d e ­ vices (C C D ) h ave b een u sed in practice for the F IR filters. T h e cosine and sine seq u en ces given in (6.3.26) n eed ed for the prem ultiplications and postm ultiplica­ tion s are usually stored in a read-only m em ory (R O M ). Furtherm ore, w e n ote that if o n ly the m agnitu d e o f the D F T is desired, the postm ultiplications are u n n eces­ sary. In this case, |X (z*)l = \y(k)\ k = 0 ,1 ,..., n - 1 (6.3.28) as illustrated in Fig. 6.19. T hus the linear F IR filtering approach using th e chirp-z transform has b een im p lem en ted for the com putation o f the D F T . 486 Efficient Computation of the DFT: Fast Fourier Transform Algorithms Chap. 6 Chirp Fillers Figure 6.19 Block diagram illustrating the implementation of the chirp-z transform for com­ puting the DFT (magnitude only). 6.4 QUANTIZATION EFFECTS IN THE COMPUTATION OF THE DFT* A s w e have ob served in our p reviou s discussions, the D F T plays an im portant role in m any digital signal p rocessing applications, including F IR filtering, the com pu­ tation o f the correlation betw een signals, and spectral analysis. For this reason it is im portant for us to kn ow th e effect o f quantization errors in its com puta­ tion. In particular, w e shall consider the effect o f rou n d -off errors due to the m ultiplications perform ed in the D F T with fixed-point arithm etic. T h e m odel that w e shall adopt for characterizing rou n d -off errors in m ulti­ plication is the additive w hite n oise m o d el that w e use in the statistical analysis o f Tound-off errors in IIR and F IR filters (see Fig. 7.34). A lth ou gh the statistical *It is recommended that the reader review Section 7.5 prior to reading this section. Sec. 6.4 487 Quantization Effects in the Computation of the DFT analysis is perform ed for rounding, the analysis can be easily m odified to apply to truncation in tw o's-com p lem en t arithm etic (see Sec. 7.5.3). O f particular interest is the analysis o f rou n d -off errors in the com putation o f the D F T via the FFT algorithm . H ow ever, w e shall first establish a benchm ark by determ ining the round-off errors in the direct com p utation o f the D F T . 6.4.1 Quantization Errors in the Direct Computation of the DFT G iven a finite-duration seq u en ce (jt(n)], 0 < n < N — 1, the D F T o f {jc(h)1 is defined as A/-1 * (* ) = Y l x ( n ) w "' j,=0 £ = 0 , 1 ........ N - 1 (6.4.1) w here IVyv = c ~ )2r,/N. W e assum e that in general, {*(«)] is a com p lex-valu ed se ­ quence. W e also assum e that the real and im aginary com p on en ts o f {a (h)I and {VV^"] are represented by b bits. C onsequently, the com putation o f the product requires four real m ultiplications. Each real m ultiplication is rounded from 2b bits to b bits, and hence there are four quantization errors for each com p lex-valu ed m ultiplication. In the direct com putation o f the D F T , there are N com p lex-valu ed m ultiplica­ tions for each point in the D FT. T herefore, the total num ber o f real m ultiplications in the com putation o f a single point in the D F T is 4 N. C on sequ en tly, there are 4 N quantization errors. Let us evaluate the variance o f the quantization errors in a fixed-point com ­ putation o f the D F T . First, w e m ake the follow in g assum ptions about the statistical properties o f the quantization errors. 1. T h e quantization errors due to rounding are uniform ly distributed random variables in the range (—A /2 , A /2 ) where A = 2~ b. 2. T h e 4 N quantization errors are m utually uncorrelated. 3. T h e 4 N quantization errors are uncorrelated with the seq u en ce |jc{«}}. Since each o f the quantization errors has a variance A 2 7~2b " ' = 1 2 = 1 2 <6A2> the variance o f the quantization errors from the 4 N m ultiplications is <r2 = 4 N o ] (6A3) 3 H en ce the variance o f the quantization error is p roportional to the size o f D FT. N o te that w hen Af is a p ow er o f 2 (i.e., N = 2 1’), the variance can be expressed 488 Efficient Computation of the DFT: Fast Fourier Transform Algorithms 2 —2(h—1*/2» a ] = ------------- Chap. 6 (6.4.4) This expression im plies that every fourfold increase in the size N o f the D F T requires an additional bit in com putational precision to offset the additional quan­ tization errors. T o prevent overflow , the input seq u en ce to the D F T requires scaling. Clearly, an upper bound on | X (A:) | is A '- l [* (£)! < Y |*(n )| (6.4.5) n=0 If the dynam ic range in addition is ( - 1 , 1 ) , then |X (/:)| < 1 requires that A '-l Y |jr(/i)| < 1 (6.4.6) n=0 If U (/i)| is initially scaled such that |a (/j)| < 1 for all n, then each point in the seq u en ce can be divided by N to ensure that (6.4.6) is satisfied. T h e scaling im plied by (6.4.6) is extrem ely severe. For exam p le, su p p ose that the signal seq u en ce {*(«)} is white and. after scaling, each valu e |.r(n)l o f the seq u en ce is uniform ly distributed in the range (-1 /7 V , I/ N ) . T h en the variance of the signal sequ en ce is <2 / * > 2 = —1 o ,2 = ---------- 3N1 12 tzA-n (6.4.7) > and the variance o f the output D F T coefficients |Jf(/t)l is al = N a2 1 (6.4.8) ~ 3 ~N Thus the signal-to-noise p ow er ratio is (6.4.9) W e observe that the scaling is responsible for reducing th e S N R by N and the com bination o f scaling and quantization errors result in a total reduction that is proportional to N 2. H en ce scaling the input seq u en ce (j(n )} to satisfy (6.4.6) im poses a severe p en alty on the signal-to-noise ratio in the D F T . Exam ple 6.4.1 Use (6.4.9) to determ ine the num ber of bits required to com pute the D FT of a 1024point sequence with a SNR of 30 dB. Solution The size of the sequence is N = 210. Hence the SNR is Sec. 6.4 Quantization Effects in the Computation of the DFT 489 For an SNR o f 30 dB, we have 3(2* - 20) = 30 b = 15 bits N ote that the 15 bits is the precision for both multiplication and addition. Instead o f scaling the input sequ en ce {Jt(n)}, suppose w e sim ply require that |x(n)l < 1. T h en w e m ust provide a sufficiently large dynam ic range for addition such that |* ( * ) l < N . In such a case, the variance o f the seq u en ce {|jc(n)|) is a 2 = 5 , and h en ce th e variance o f |X (* )| is (6.4.10) C on sequ en tly, the S N R is (6.4.11) If w e repeat the com putation in E xam ple 6.4,1, w e find that the num ber o f bits required to a ch ieve a S N R o f 30 dB is b = 5 bits. H ow ever, w e n eed an additional 1 0 bits for the accum ulator (th e adder) to accom m odate the increase in the dynam ic range for addition. A lthou gh w e did not ach ieve any reduction in the dynam ic range for addition, we have m anaged to reduce the p recision in m ultiplication from 15 bits to 5 bits, which is highly significant. 6.4.2 Quantization Errors in FFT Algorithms A s w e have sh ow n , the F F T algorithm s require significantly few er m ultiplications than the direct com p utation o f the D F T . In view o f this w e m ight con clu d e that the com p utation o f the D F T via an FFT algorithm w ill result in sm aller quantization errors. U n fortu n ately, that is n ot the case, as w e will dem onstrate. L et us con sid er the use o f fixed-point arithm etic in th e com putation o f a radix-2 F F T algorithm . T o be specific, w e select the radix-2, decim ation-in-tim e algorithm illustrated in Fig. 6.20 for the case N = S. T h e results on quantiza­ tion errors that w e ob tain for this radix-2 FFT algorithm are typical o f th e results o b ta in ed w ith o th er radix - 2 and higher radix algorithm s. W e o b serv e that each butterfly com putation in volves o n e com plex-valued m ultiplication or, eq u ivalen tly, four real m ultiplications. W e ignore the fact that so m e butterflies con tain a trivial m ultiplication by ± 1 . If w e consider th e but­ terflies that affect the com p utation o f any on e valu e o f the D F T , w e find that, in gen eral, there are N /2 in the first stage of the FFT , N / 4 in the secon d stage, N / 8 in the third state, and so on , until the last stage, w here there is on ly on e. C on sequ en tly, th e num ber o f butterflies per output point is 2 " - '+ 2 " - 2 + --- + 2 + l = 2v“ ‘ [ l + ( ! ) + ■ • + ( j ) ” '] = 2 ”[ l - ( j n = W -l 490 Efficient Computation of the DFT: Fast Fourier Transform Algorithms Stage 1 Stage 2 Chap. 6 Stage 3 For exam ple, the butterflies that affect the com p utation o f A"(3) in the eight-point FFT algorithm o f Fig. 6.20 are illustrated in Fig. 6.21. T h e quantization errors introduced in each butterfly propagate to the output. N o te that the quantization errors introduced in the first stage p ropagate through (v - 1 ) stages, th ose introduced in the second stage propagate through (v - 2 ) stages, and so on. A s these quantization errors propagate through a num ber of su bsequent stages, th ey are phase shifted (ph ase rotated) by th e phase factors W^n. T h ese phase rotations do not change the statistical p rop erties o f the quan­ tization errors and, in particular, the variance o f each q uantization error remains invariant. If w e assum e that the quantization errors in each butterfly are uncorrelated with the errors in other butterflies, then there are 4(W - 1 ) errors that affect the output o f each point o f the FFT. C on sequ en tly, th e variance o f the total quanti­ zation error at the output is A 2 f f| = 4 (A r- ! ) — « — A 2 (6.4.13) Sec. 6.4 Quantization Effects in the Computation of the DFT Figure 6.21 491 Butterflies that affect the computation o f X (3). w here A = 2 h. H en ce a2= j ■2"“ (6.4.14) T his is exactly the sam e result that w e ob tain ed for the direct com p utation o f the DFT. T h e result in (6.4.14) should n ot b e surprising. In fact, the FFT algorithm d o es not reduce the num ber o f m ultiplications required to com p ute a single point o f the D F T . It d o es, h ow ever, exp loit the p eriod icities in W^n and thus reduces the num ber o f m ultiplications in the com p utation o f the entire block o f N points in the D F T . A s in the case o f the direct com p utation o f the D F T , w e m ust scale the input seq u en ce to prevent overflow . R ecall that if |jc(n) | < \ / N , 0 < n < N — 1, then |X (* )| < 1 for 0 < k < N — 1. T hus overflow is avoided. W ith this scaling, the relation s in (6.4.7), (6.4.8), and (6.4.9), ob tain ed previously for the direct com p utation o f the D F T , apply to the F F T algorithm as w ell. C onsequently, the sam e S N R is o b tain ed for the FFT. Since the F F T algorithm consists o f a seq u en ce o f stages, w h ere each stage con tains butterflies that in volve pairs o f points, it is p ossib le to d evise a differ­ en t scaling strategy that is n ot as severe as dividing each input p oin t by N . This 492 Efficient Computation of the DFT: Fast Fourier Transform Algorithms Chap. 6 alternative scaling strategy is m otivated by the observation that the in term edi­ ate values [Xn(/r)| in the n = 1, 2,..., u stages o f th e F F T algorithm satisfy the conditions (see P roblem 6.35) m ax[|X n+1 ( * ) U X n+1(/)|] > m ax[|X n( * ) U X B( 0 |] (6.4.15) m ax [|X n+1 ( * ) |,|X B+1(/)|] < 2 m ax[jX „(Jt)|,|X n(/)|] In view o f th ese relations, w e can distribute the total scalin g o f 1 / N in to each o f the stages o f the F F T algorithm . In particular, if |jr(n)| < 1, w e apply a scale factor o f 5 in the first stage so that |jr(n)| < T h en the output o f each subsequent stage in the FFT algorithm is scaled by | , so that after v stages w e have achieved an overall scale factor o f ( j ) 1' = 1 //V. Thus overflow in the com p utation o f the D F T is avoided. This scaling procedure d o es not affect the signal level at the output o f the FFT algorithm , but it significantly reduces the variance o f the quantization errors at the output. Specifically, each factor o f ^ reduces the variance o f a quantization error term by a factor o f Thus the 4 ( N / 2 ) quantization errors introduced in the first stage are reduced in variance by (^ V - 1 , the 4 ( N / 4 ) quantization errors introduced in the second stage are reduced in variance by ( j ) 1’- 2 . and so on. C on­ sequ en tly, the total variance o f the quantization errors at the output o f the FFT algorithm is w here the factor (^ )tJ is negligible. W e now o b serve that (6.4.16) is n o longer proportional t o N . O n th e other hand, the signal has th e variance a \ = 1 /3 N , as given in (6.4.8). H e n c e the S N R is f l = _ L .2 ^ 2N (6.4.17) _ 22b—v—\ Thus, by distributing th e scaling o f l / N uniform ly throughout th e FFT algorithm , w e have achieved an S N R that is inversely proportional to N in stead o f N 2. Example 6.4.2 Determine the number of bits required to compute an FFT of 1024 points with an SNR of 30 dB when the scaling is distributed as described above. Sec. 6.5 Summary and References Solution 493 The size of the FFT is N = 210. Hence the SNR according to (6.4.17) is 101°gio 22h~v~l = 30 3(2b - 11) = 30 b = bits) This can be com pared with the 15 bits required if all the scaling is perform ed in the first stage of the FFT algorithm. 6.5 SUMMARY AND REFERENCES T h e fo cu s o f this chapter w as on the efficien t com putation o f the D F T . W e d em on ­ strated that by taking advantage o f the sym m etry and p eriodicity p roperties o f the ex p on en tial factors W#", w e can reduce the num ber o f com p lex m ultiplications n eed ed to com p ute the D F T from N 2 to N log 2 N w hen Af is a p ow er o f 2. A s w e indicated, any seq u en ce can be augm ented with zeros, such that N — 2''. For d ecad es, FFT -type algorithm s were o f interest to m athem aticians w ho w ere con cern ed w ith com p utin g values o f F ourier series by hand. H ow ever, it w as not until C o o ley and T u k ey (1965) published their w ell-k now n paper that the im pact and significance o f the efficient com putation o f the D F T was recognized. Since then the C o o le y -T u k e y FFT algorithm and its various form s, for exam ple, the algorithm s o f S in gleton (1967, 1969), have had a trem en dou s influence on the use o f the D F T in con v olu tion , correlation, and spectrum analysis. For a historical p erspective on the F FT algorithm , the reader is referred to the paper by C ooley et al. (1967). T h e split-radix FFT (SR F F T ) algorithm d escribed in Section 9.3.5 is due to D u h a m el and H ollm an n (1 9 8 4 ,1 9 8 6 ). T he “m irror” F F T (M FF T ) and “p h ase” F F T (PF FT ) algorithm s w ere described to the authors by R. Price. T he exp loitation o f sym m etry p rop erties in the data to reduce the com putation tim e are described in a paper by Sw arztrauber (1986). O ver the years, a num ber o f tutorial papers have b een published on FFT algorithm s. W e cite the early papers by Brigham and M orrow (1967), Cochran et al. (1967), B ergland (1969), and C ooley et al. (1967, 1969). T h e reco g n itio n that the D F T can b e arranged and com p uted as a linear con volu tion is also highly significant. G o ertzel (1968) indicated that the D F T can b e com p uted via linear filtering, although the com p utational savings o f this approach is rath er m odest, as w e have observed. M ore significant is the work o f B lu estein (1 9 7 0 ), w ho d em onstrated that the com p utation o f the D F T can be form u lated as a chirp linear filtering operation. T his w ork led to the d evelop m en t o f th e chirp-z transform algorithm by R ab in er et al. (1969). In addition to the F F T algorithm s describ ed in this chapter, there are other efficien t algorithm s for com p utin g the D F T , som e o f w hich further reduce the 494 Efficient Computation of the DFT: Fast Fourier Transform Algorithms Chap. 6 num ber o f m ultiplications, but usually require m ore additions. O f particular im ­ portance is an algorithm due to R ader and B renner (1976), the class o f prim e factor algorithm s, such as the G o o d algorithm (1971), and the W inograd algorithm (1976, 1978). For a d escription o f these and related algorithm s, the reader m ay refer to the text by Blahut (1985). PROBLEMS 6.1 Show that each of the numbers eja*/NH o < /t < W - 1 corresponds to an Wth root of unity. Plot these numbers as phasors in the complex plane and illustrate, by m eans of this figure, the orthogonality property -ja ir/N M n _ n=<) N, I 0, I | if k ~ 1 if k ^ l 1 6.2 (a) Show that the phase factors can be com puted recursively by W$ = (b) Perform this com putation once using single-precision floating-point arithmetic and once using oniy four significant digits. Note the deterioration due to the accumulation of round-off errors in the later case. (c) Show how the results in part (b) can be improved by resetting the result to the correct value - j . each time gl = N/4. 6 3 Let x(n) be a real-valued N -point (N = 2' ) sequence. Develop a method to compute an N -point D FT X ’(k), which contains only the odd harmonics [i.e., X'(k) = 0 if Jt is even] by using only a real A,/2-spoint DFT. 6.4 A designer has available a num ber of eight-point FFT chips. Show explicitly how he should interconnect three such chips in order to com pute a 24-point DFT. 6.5 The ^-transform of the sequence x(n) = u(n) - u(n - 7) is sampled at five points on the unit circle as follows x(k) = X(z) 1- = eJ'2jr*/5 Jt* 0,1 ,2 ,3 ,4 Determ ine the inverse D FT x'(n) of X (Jt). Com pare it with *(/t) and explain the results. 6.6 Consider a finite-duration sequence x(n), 0 < n < 7, with z-transform X(z). We wish to com pute X (:) at the following set of values: zk = 0.8ejf|(2)r*/*,+(’' /8)] 0 < Jfc < 7 (a) Sketch the points {z*} in the complex plane. D eterm ine a sequence s ( n ) such that its D F T provides the desired samples of ( b ) *(z). Chap. 6 495 Problems 6.7 Derive the radix-2 decimation-in-time FFT algorithm given by (6.1.26) and (6.1.27) as a special case of the more general algorithmic procedure given by (6.1.16) through (6.1.18). 6.8 Com pute the eight-point D FT of the sequence 1. I 0, X^ 0 < n < 7 otherwise by using the decimation-in-frequency FFT algorithm described in the text. 6.9 Derive the signal flow graph for the N = 16 point, radix-4 decimation-in-time FFT algorithm in which the input sequence is in norm al order and the computations are done in place. 6.10 D erive the signal flow graph for the N = 16 point, radix-4 decimation-in-frequency FFT algorithm in which the input sequence is in digit-reversed order and the output D FT is in normal order. 6.11 Com pute the eight-point DFT of the sequence x{n) = U . i 1,0. 0,0.0 12 2 2 2 using the in-placc radix-2 dccimation-in-time and radix-2 decimation-in-frequency al­ gorithms. Follow exactly the corresponding signal flow graphs and keep track of all the interm ediate quantities by putting them on the diagrams, 6.12 Com pute the 16-point D FT of the sequence x(n) = cos 0 < n < 15 using the radix-4 decimation-in-time algorithm. 6.13 Consider the eight-point decimation-in-tim e (D IT) flow graph in Fig. 6.6. (a) What is the gain of the “signal p ath ” that goes from x(7) to X(2)7 (b) How many paths lead from the input to a given output sample? Is this true for every output sample? (c ) Com pute X (3) using the operations dictated by this flow graph. 6.14 Draw the flow graph for the decimation-in-frequency (D IF) SRFFT algorithm for N = 16. W hat is the num ber of nontrivial multiplications? 6.15 D erive the algorithm and draw the N = 8 flow graph for the D IT SRFFT algorithm. Com pare your flow graph with the D IF radix-2 FFT flow graph shown in Fig. 6.11. 6.16 Show that the product of two complex numbers (a + j b ) and ( C + j d ) can be perform ed with three real multiplications and five additions using the algorithm x R = (a - b ) d + (c - d ) a xi = (a - b)d + (c + d ) b where X = x R + jx , = (a + j b ) ( c + j d ) 6.17 Explain how the D FT can be used to com pute N equispaced samples of the ztransform , of an iV-point sequence, on a circle of radius r. 496 Efficient Computation of the DFT: Fast Fourier Transform Algorithms Chap. 6 6.18 A real-valued A/-point sequence Jt(n) is called D FT bandlim ited if its D FT X(k) = 0 for ko < k < N —An. We insert (L — 1)N zeros in the middle of A'(Jt) to obtain the following L N -point DFT X(k), X'(k) = { 0, X(k + N - LN) . 0 < i < Ao — 1 Jt0 < Jk < L N - kt, L N - J t „ + 1 < Jt < L N — 1 Show that Lx'(Ln) = x(n) 0 < n < N —1 where x\n) X (k) LN Explain the meaning of this type of processing bv working out an example with N = 4, L = 1. and A ( J t ) = { 1 , 0 . 0 . 1 ) . 6.19 Let X(k) be the A'-point DFT of the sequence .v(n). 0 < n < A’ - 1. What is the A-point DFT of the sequence s(n) = X(n). 0 < n < N - 1? 6.20 Let X(k) be the A-point DFT of the sequence \(n ), (I < » < N — 1. We define a 2 N -point sequence _v(«) as V{;I) 1-v^V ««--vcn n odd Express the 2 Appoint DFT of y(n) in terms of X(k). 6.21 (a) Determ ine the ^-transform W (-) of the Hanning window w («) = (1 - cos fl. (b) Determ ine a formula to compute the JV-point DFT X„(k) of ihe signal .r„.(n) = w(n)x(n)< 0 < n < N — 1. from the JV-point DFT A'(A ) of the signal .r(n). 6.22 Create a DFT coefficient table that uses only N/4 memory locations to store the first quadrant of the sine sequence (assume N even). 6.23 D eterm ine the com putational burden of the algorithm given by (6.2.12) and compare it with the com putational burden required in the 2N -point DFT of g(n). Assume that the FFT algorithm is a radix-2 algorithm. 6.24 Consider an IIR system described by the difference equation S' v(n) = - ^ M ai-v<n ~ + y , b k x ( n - k) *= 1 Describe a procedure that com putes the frequency response H Jt = 0, 1........ A ' - l using the FFT algorithm ( N = 2‘). 6.25 Develop a radix-3 decimation-in-time FFT algorithm for N = 3’ and draw the corre­ sponding flow graph for N = 9. W hat is the num ber of required com plex multiplica­ tions? Can the operations be perform ed in place? 6.26 Repeat Problem 6.25 for the D IF case. 6.27 FFT input and output pruning In many applications we wish to com pute only a few points M of the Appoint D FT of a finite-duration sequence of length L (i.e., M « N and I < < N). Chap. 6 Problems 497 (a) Draw the flow graph of the radix-2 D IF FFT algorithm for N = 16 and eliminate [i.e., prune] all signal paths that originate from zero inputs assuming that only jc(0) and jc(1) are nonzero. (b) R epeat part (a) for the radix-2 D IT algorithm. (c) Which algorithm is better if we wish to com pute all points of the D FT? What happens if we want to compute only the points X (0), X (l), X (2), and X (3)? Establish a rule to choose between D IT and D IF pruning depending on the values of M and L. (d) Give an estim ate of saving in computations in term s of M, L, and N. 6.28 Parallel computation o f the D F T Suppose that we wish to com pute an N = 2P2V point D FT using 2P digital signal processors (DSPs). For simplicity we assume that p = v = 2. In this case each DSP carries out all the com putations that are necessary to com pute 2V D FT points. (a) Using the radix-2 D IF flow graph, show that to avoid data shuffling, the entire sequence x(n) should be loaded to the memory of each DSP. (b) Identify and redraw the portion of the flow graph that is executed by the DSP that com putes the D FT samples X(2), X(10), X(6), and X(14). (c) Show that, if we use M = 2'' DSPs, the com putation speed-up S is given by S= M log-, N log2 N - log, M + 2(M - 1) 6.29 Develop an inverse radix-2 D IT FFT algorithm starting with the definition. Draw the flow graph for com pulation and com parc with the corresponding flow graph for the direct FFT. Can the IFFT flow graph be obtained from the one for the direct FFT? 6.30 R epeat Problem 6.29 for the D IF case. 6.31 Show that an FFT on data with H erm itian symmetry can be derived by reversing the flow graph of an FFT for real data. 6.32 D eterm ine the syslem function H(z) and the difference equation for the system that uses the G oertzel algorithm to compute ihe DFT value X ( N - k). 6.33 (a) Suppose that x(n) is a finite-duration sequence of N = 1024 points. It is desired to evaluate the z-transform X (;) of the sequence at the points Zk = eiQ * * ™ * k = 0 . 100,200 ......1000 by using the most efficient m ethod or algorithm possible. Describe an algorithm for perform ing this com putation efficiently. Explain how you arrived at your answer by giving the various options or algorithms that can be used. (b) R epeat part (a) if X (z) is to be evaluated at zt = 2(0.9) V '1(2,r/5000*+’r/21 k = 0 ,1 ,2 ........999 634 R epeat the analysis for the variance of the quantization error, carried out in Sec­ tion 6.4.2, for the decimation-in-frequency radix-2 FFT algorithm. 635 The basic butterfly in the radix-2 decimation-in-time FFT algorithm is *„+,<*) = Xn( * )+ W” X„(l) 498 Efficient Computation of ttie DFT: Fast Fourier Transform Algorithms Chap. 6 (a) If we require that !X„(Jt)| < j and |Jf„(/)| < 5 , show that |Re[X „+,(*)]| < 1, |/te[X n+1(/)]| < 1 | I m [ X „ + 1 (*)]l < | / m [ A B + 1 (/)]| < 1, 1 Thus overflow does not occur. (b) Prove that max[|X,,+i(A)|. |X„+i(/)|] > m ax[|Xn(*)l.l*,,(/)|] max[|X„+1(*)UX,,+1(/)|] < 2 m ax [|X „(* )|.|* n (/)l] 636* Computation o f the D F T Use an FFT subroutine to compute the following DFTs and plot the m agnitudes |X(Jt)| of the DFTs. (a) The 64-point D FT of the sequence n = 0 ,1 ........15 otherwise , , [1 , x(n) = I 10, (Ni ~ 16) (b) The 64-point D FT of the sequence 1, 10, n = 0 ,1 ........... 7 otherwise (N\ = 8) (c) The 128-point DFT of the sequence in part (a). (d) The 64-point D FT of the sequence | 10f >'*/*>", x (n) — { J 0. „ = 0 ,1 ........63 otherwise (Ni = 64) Answer the following questions. (1) What is the frequency interval between successive samples for the plots in parts (a), (b). (c), and (d)? (2) What is the value of the spectrum at zero frequency (dc value) obtained from the plots in parts (a), (b), (c), (d)? From the formula X(k) = Y ^ x (n ) e ' compute the theoretical values for the dc value and check these with the com puter results. (3) In plots (a), (b), and (c), what is the frequency interval betw een successive nulls in the spectrum ? W hat is the relationship between N 1 of the sequence x( n ) and the frequency interval between successive nulls? (4) Explain the difference between the plots obtained from parts (a) and (c). 637* Identification o f pole positions in a system difference equation Consider the system described by the y(n) = —r2y(n —2) + x(n) (a) Let r = 0.9 and x(n) = &(n). G enerate the output sequence y(n) for 0 < n < 127. Compute the N = 128 point D FT [ I'M ) and plot {|y(Jt)t). Chap. 6 Problems 499 (b) Com pute the N = 128 point DFT of the sequence ui(n) = (0.92)- " v(n) where y(/t) is the sequence generated in part (a). Plot the D FT values | W (t)|. W hat can you conclude from the plots in parts (a) and (b)? (c) Let r = 0.5 and repeat part (a). (d) R epeat part (b) for the sequence ui(n) = (0.55)~nv(n) where y( n) is the sequence generated in part (c). W hat can you conclude from the plots in parts (c) and (d)? (e) Now let the sequence generated in part (c) be corrupted by a sequence of “mea­ surem ent" noise which is Gaussian with zero mean and variance a 2 = 0.1. Repeat parts (c) and (d) for the noise-corrupted signal. Implementation of Discrete-Time Systems The focus o f this chapter is on the realization o f linear tim e-invariant discrete­ tim e system s in eith er softw are or hardware. A s w e noted in C h ap ter 2, there are various configurations or structures for the realization o f any F IR and IIR discrete­ tim e system . In C hapter 2 w e described the sim plest o f these structures, nam ely, the direct-form realizations. H ow ever, there are other m ore practical structures that offer som e distinct advantages, especially w hen q uantization effects are taken into consideration. O f particular im portance are the cascade, parallel, and lattice structures, which exhibit robustness in finite-w ord-length im plem en tation s. A lso described in this chapter is the frequency-sam pling realization for an F IR system , which often has the advantage o f being com putationally efficient w hen com pared with alternative FIR realizations. O ther im portant filter structures are ob tain ed by em ploying a state-sp ace form ulation for linear tim e-invariant system s. A n analysis o f system s characterized by th e state-variable form is p resen ted in both the tim e and frequency dom ains. In addition to describing the various structures for the realization o f discrete­ tim e system s, w e a lso treat problem s associated with q uantization effects in the im plem en tation o f digital filters using finite-precision arithm etic. T his treatm ent includes the effects on the filter frequency response characteristics resulting from coefficient quantization and the round-off noise effects inherent in the digital im­ p lem entation o f d iscrete-tim e system s. 7.1 STRUCTURES FOR THE REALIZATION OF DISCRETE-TIME SYSTEMS Let us consider the im portant class o f linear tim e-invariant d iscrete-tim e system s characterized by the general linear constant-coefficient d ifferen ce eq u ation N M (7.1.1) 500 Sec. 7.1 Structures for the Realization of Discrete-Time Systems 501 A s w e have sh ow n by m eans o f the z-transform , such a class o f linear tim e-invariant d iscrete-tim e system s are also characterized by the rational system function M H(z) = N (7.1.2) which is a ratio o f tw o polyn om ials in z - 1 . From the latter characterization, we obtain the zero s and p o les o f the system function, which d ep en d on the ch oice o f the system p aram eters {£>*} and {a*} and which determ ine the frequency response characteristics o f the system . O ur fo cu s in this chapter is on the various m eth od s o f im plem en ting (7.1.1) or (7.1.2) in eith er hardware, or in softw are on a program m able digital com puter. W e shall sh ow that (7.1.1) or (7.1.2) can be im plem en ted in a variety o f ways d ep en d ing on the form in which th ese tw o characterizations are arranged. In g en eral, w e can view (7.1.1) as a com putational p rocedure (an algorithm ) for determ in in g the output seq u en ce v(/t) o f the system from the input sequ en ce x ( n ) . H o w ev er, in various ways, the com putations in (7.1.1) can be arranged into eq u ivalen t sets o f d ifferen ce equations. Each set o f eq u ation s defines a com pu­ tational procedure or an algorithm for im plem enting the system . From each set o f eq u ation s w e can construct a block diagram consisting o f an interconnection o f d elay elem en ts, m ultipliers, and adders. In Section 2.5 w e referred to such a block diagram as a realization o f the system or, equivalently, as a structure for realizing the system . If the system is to be im plem en ted in softw are, the block diagram or, eq u iv­ alently, the set o f eq u ation s that are obtained by rearranging (7.1.1), can be co n ­ verted in to a program that runs on a digital com puter. A ltern atively, the structure in block diagram form im plies a hardware configuration for im plem enting the system . Perhaps, the o n e issue that m ay not be clear to the reader at this point is w hy w e are con sid erin g any rearrangem ents o f (7.1.1) or (7.1.2). W hy not just im plem en t (7.1.1) or (7.1.2) directly w ithout any rearrangem ent? If either (7.1.1) or (7.1.2) is rearranged in som e m anner, what are the benefits gained in the corresponding im plem en tation ? T h ese are the im portant q u estion s which are answ ered in this chapter. A t this p oin t in our d ev elop m en t, w e sim ply state that the m ajor factors that influ­ en ce our ch o ice o f a specific realization are com putational com p lexity, m em ory requirem ents, and finite-w ord-length effects in the com putations. C o m p u t a t i o n a l c o m p le x ity refers to the num ber o f arithm etic op eration s (m u l­ tiplications, d ivisions, and additions) required to com p ute an output valu e y (n ) for the system . In the past, th ese w ere the on ly item s used to m easure com putational com p lexity. H o w ev er, w ith recent d evelop m en ts in the design and fabrication o f rather sop h isticated program m able digital signal p rocessin g chips, oth er factors, 502 Implementation of Discrete-Time Systems Chap. 7 such as the num ber o f tim es a fetch from m em ory is p erform ed or the num ber of tim es a com parison betw een tw o num bers is perform ed per output sam ple, have b ecom e im portant in assessing the com putational com p lexity o f a given realization o f a system . M e m o r y requ irem ents refers to the num ber o f memory locations required to store the system param eters, past inputs, past outputs, and any interm ediate com puted values. F inite- wor d-length effects or finite-precision effects refer to the quantization effects that are inherent in any digital im plem en tation o f the system , either in hardware or in softw are. T h e param eters o f the system m ust necessarily be repre­ sented with finite precision. T h e com p utations that are p erform ed in the process o f com puting an output from the system must be rounded- o ff or truncated to fit within the lim ited precision constraints o f the com p uter or the hardware used in the im plem en tation . W hether the com p utations are perform ed in fixed-point or floating-point arithm etic is an oth er consideration. A ll these p rob lem s are usually called finite-w ord-length effects and are extrem ely im portant in influencing our ch oice o f a system realization. W e shall see that different structures o f a system, which are equivalent for infinite precision, exhibit different behavior when finiteprecision arithm etic is used in the im plem entation. T h erefore, it is very important in practice to select a realization that is not very sensitive to finite-w ord-length effects. A lthou gh these three factors are the major o n e s in influencing our ch oice o f the realization o f a system o f the type described by either (7.1.1) or (7.1.2), other factors, such as w hether the structure or the realization len d s itself to parallel processing, or w h eth er the com p utations can b e pip elined, m ay play a role in our selection o f the specific im plem entation. T h ese additional factors are usually im portant in the realization o f m ore com p lex digital signal processin g algorithm s. In our discussion o f alternative realizations, w e con cen trate on the three m ajor factors just outlined. O ccasionally, w e will include som e additional factors that m ay be im portant in som e im plem entations. 7.2 STRUCTURES FOR FIR SYSTEMS In general, an F IR system is described by the differen ce equation Af-1 bkx (n ~ k) y(n) = (7.2.1) *=0 or, equivalently, by the system function A f-1 H{z)=*YibkZ~k *=o {122) Furthermore, the unit sample response of the FIR system is identical to the coef- Sec. 7.2 Structures for FIR Systems 503 ficients {£>*}, that is, ,, , \ b„, 'K’,) = | o . 0 < n < Af — 1 ,7 , , , otherwise <7-2 '3> T h e length o f the F IR filter is selected as M to conform w ith the established n otation in the technical literature. W e shall present several m eth od s for im plem en ting an F IR system , b egin ­ ning w ith the sim p lest structure, called the direct form. A secon d structure is the cascade-form realization. T h e third structure that w e shall d escribe is the frequency-sam pling realization. Finally, w e present a lattice realization o f an FIR system . In this discussion w e follow the con ven tion often used in the technical literature, which is to use for the param eters o f an F IR system . In addition to the four realizations indicated ab ove, an F IR system can be realized by m eans o f the D F T , as described in S ection 6.2. From on e point o f view, the D F T can be considered as a com putational procedure rather than a structure for an F IR system . H ow ever, when the com putational procedure is im plem ented in hardw are, there is a corresponding structure for the F IR system . In practice, hardware im plem en tation s o f the D F T are based on the use o f the fast Fourier transform (FFT ) algorithm s described in C hapter 6 . 7.2.1 Direct-Form Structure T he direct-form realization follow s im m ed iately from the nonrecursive difference eq u ation given by (7.2.1) or, equivalently, by the con volu tion sum m ation M- 1 y ( n ) = ^ h ( k ) x ( n - k) t=o (7.2.4) T h e structure is illustrated in Fig. 7.1. W e o b serve that this structure requires Af — 1 m em ory locations for stor­ ing th e Af — 1 previous inputs, and has a com p lexity o f Af m ultiplications and M — 1 additions p er output point. Since the output con sists o f a w eigh ted linear com b ination o f Af — 1 past values o f the input and the w eigh ted current value o f th e input, th e structure in Fig. 7.1, resem b les a tapped d elay line or a transversal Figwre 7.1 Direct-form realization of FIR system. 504 Implementation of Discrete-Time Systems Chap. 7 Figure 7.2 Direct-form realization of linear-phase FIR system (Af odd). system . C on sequ en tly, the direct-form realization is often called a transversal or tapped-delay-line filter. W hen the F IR system has linear phase, as described in S ection 8.2, the unit sam ple response o f the system satisfies either the sym m etry o r asym m etry condition h(n) = ± h ( M - 1 - n) (7.2.5) For such a system the num ber o f m ultiplications is reduced from M to M f l for Af even and to (Af — l ) / 2 for M odd. For exam p le, the structure that takes advantage o f this sym m etry is illustrated in Fig. 7.2 for the case in which M is odd. 7.2.2 Cascade-Form Structures T he cascade realization follow s naturally from the system fun ction given by (7.2.2). It is a sim ple m atter to factor H ( z ) into secon d-ord er F IR system s so that K 0-2.6) fl(z) = [] fl* ( z ) *=i where H k (z) = bk0 + bk]Z~l + bk2z~ 2 * = 1 ,2 .........K (7.2.7) and K is the in teger part o f ( M + l ) /2 . T h e filter param eter bo m ay be equally distributed am ong the K filter section s, such that bo = biobw ■• ■b Ka or it m ay be assigned to a sin gle filter section . T h e zeros o f H ( z ) are grou p ed in pairs to pro­ d uce the secon d-ord er F IR system s o f the form (7.2.7). It is alw ays desirable to form pairs o f com p lex-con ju gate roots so that th e coefficien ts \bki} in (7.2.7) are real valued. O n th e other hand, real-valued roots can b e paired in any arbitrary m anner. T h e cascade-form realization alon g with th e basic secon d -ord er section are sh ow n in Fig, 7.3. Sec. 7.2 505 Structures for FIR Systems jr(n)=jr,(n) H](z) >'[(") = Vjr(n) = ,Y(n) >'2<n) = H2(z) *2<” ) jr,(n) (a) Figure 7.3 Cascade realization of an FIR system. In the case o f linear-phase F IR filters, the sym m etry in h (n) im plies that the zeros o f H ( z ) a lso exhibit a form o f sym m etry. In particular, if Zk and z*k are a pair o f co m p lex-con ju gate zeros then 1 f z t and 1 / z \ are also a pair o f com plex-conjugate zero s (see Sec. 8.2). C on sequ en tly, w e gain som e sim plification by form ing fourthorder section s o f the FIR system as follow s Hk(z) = c« ,( l - z / t z - ’ K l - c ^ ' K l - z ~ l / z k )(\ - z - ' / z V , (7.2.8) = Q o + Q - l t " 1 + Ck2Z~ " + Q t Z - ’’ + Z ~ A w here the coefficien ts {ct i } and (c^ f are functions o f zt- Thus, by com bining the tw o pairs o f p o les to form a fourth-order filter section , w e have reduced the n um ber o f m ultiplications from six to three (i.e., by a factor o f 50% ). Figure 7.4 illustrates the b asic fourth-order F IR filter structure. Figure TA Fourth-order section in a cascade realization o f an FIR system. 506 Implementation of Discrete-Time Systems Chap. 7 7.2.3 Frequency-Sampling Structures* T he frequency-sam pling realization is an alternative structure for an F IR filter in which the param eters that characterize the filter are the valu es o f the desired frequency resp onse instead o f the im pulse response h(n). T o d erive the frequencysam pling structure, w e specify the desired frequency response at a set o f equally spaced frequencies, nam ely 2 tt cot = — (.k + a ) M M - 1 A: = 0 , 1 , . . . , — - — 2 M od d M A: = 0, 1 , . . . , -------1 M even 2 a = 0 or j and so lv e for the unit sam ple response h( n) from these equally spaced frequency specifications. Thus we can write the frequency response as M- 1 h ( n ) e ~ jum n —0 and the values o f H(a>) at freq u en cies a>t = ( 2 n / M ) { k + a ) are sim ply H (k + a ) = H + cr)^ (7.2.9) = £ h (n )e -j2*lk+aWM k _ 0< 1____ A/ - 1 T he set o f values { //(£ -(-a )} are called the frequency sam ples o f H(a)). In the case w here a = 0, j//(Jt)} corresponds to th e M -point D F T o f (A(n)}. It is a sim ple m atter to invert (7.2.9) and express h(n) in term s o f the fre­ quency sam ples. T he result is i M- 1 h(n) = — J ' H ( k + a ) e j2*(i+a)n/M n = 0, 1 , . . . , M - 1 (7.2.10) W hen a = 0, (7.2.10) is sim ply the ID F T o f {//(& )}. N ow if w e use (7.2.10) to substitute for h (n) in the z-transform H ( z ) , w e have u- \ H( z ) = £ > ( " ) ; ■ " n=0 M- 1 -L ■i u - 1 — Y \ H ( k + a ) e j2* il'H' )"/" M *=0 (7.2.11) ^The reader may also refer to Section 8.2.3 for additional discussion o f frequency-sampling FIR filters. Sec. 7.2 507 Structures for FIR Systems B y interchanging the order o f the tw o sum m ations in (7.2.11) and perform ing the sum m ation over the index n w e obtain I M-1 ^ ^ej2n(i+a)/M „ - \ y H( z ) = ^ H ( k + a) (7.2.12) } - Z- Mej2na y l 2. 1 M H ( k + a) _ e j2nik+a)/M z - 1 Thus the system function H ( z ) is characterized by the set o f frequency sam ples (W(Jt-t-cr)j instead o f {h(«)). W e v iew this F IR filter realization as a cascade o f tw o filters [i.e., H { z ) = / / i ( z ) / / 2 (s)]- O ne is an all-zero filter, or a com b filter, with system function H x(z) = — (1 - r wf y2l“ ) M (7.2.13) Its zeros are located at equally spaced points on the unit circle at Zt = jt = 0 , 1 .........A f - 1 T he second filter with system function Af —1 H l i z ) — 2 ^ -J _ Jt=0 j2n(t+a)/M (7.2.1 ) *■ consists o f a parallel bank o f sin gle-p ole filters with resonant frequencies Pl = e}2* ik+ayM k = 0 , l .........M - 1 N o te that the p o le locations are identical to the zero locations and that both occur at a)k = 2 k (k + a ) / M , which are the freq u en cies at which the desired fre­ quency resp onse is specified. T he gains o f the parallel bank o f resonant filters are sim ply the com p lex-valu ed param eters \ H ( k + a )}. T h is cascade realization is illustrated in Fig. 7.5. W hen the desired frequency resp onse characteristic o f the F IR filter is nar­ row band, m ost o f the gain param eters \ H ( k + a )) are zero. C on sequ en tly, the corresponding resonant filters can be elim inated and on ly the filters with nonzero gains n eed be retained. T h e n et result is a filter that requires few er com p uta­ tion s (m ultiplications and additions) than the corresponding direct-form realiza­ tion. Thus w e ob tain a m ore efficient realization. T h e frequency-sam pling filter structure can be sim plified further by exploiting the s y m m e t r y in H ( k + a ) , nam ely, H ( k ) = H * ( M — k) for a = 0 and H (* + i ) = H* ( M - k - | ) for a = \ T h ese relations are easily deduced from (7.2.9). A s a result o f this sym m etry, a pair o f sin g le-p o le filters can b e com b ined to form a sin gle tw o -p o le filter with 508 Implementation of Discrete-Time Systems Chap. 7 real-valued param eters. Thus for a = 0 the system function Hz (z) reduces to H ( 0) , fiiiz) = t _ — l + H i 0) ^ t=1 2 A ik ) + B(lc)z- 1 — — ----- 7 2 c o s { 2 n k / M ) z ~ ' + z~2 . , H iM /2) , lM^ ~ ] H^ > = r r p r + T T P - + £ A{k) + B { k ) z ~ x ~ 2cos(2;rfc/Af)z -1 + z ~ 2 w M odd M even (7.2.15) Sec. 7.2 509 Structures for FIR Systems w h ere, by definition, A( k ) = H ( k ) + H ( M - k ) (7.2.16) B( k) = H { k ) e ~ i2nklM + H ( M Sim ilar exp ression s can b e ob tain ed for a = Example 7.2.1 Sketch the block diagram for the direct-form realization and the frequency-sampling realization of the M = 32, a = 0, linear-phase (symmetric) F IR filter which has frequency samples 1, ■(f)- * = 0 ,1 ,2 5- 4= 3 0, * = 4 . 5 ........15 Compare the computational complexity of these two structures. Solution Since the filter is symmetric, we exploit this symmetry and thus reduce the num ber of multiplications per output point by a factor of 2, from 32 to 16 in the direct-form realization. The number of additions per output point is 31. The block diagram of the direct realization is illustrated in Fig. 7.6. We use the form in (7.2.13) and (7.2.15) for the frequency-sampling realization and drop all terms that have zero-gain coefficients |H(k)}. T he nonzero coefficients are H(k) and the corresponding pairs are H( M - k), for k = 0 ,1 , 2, 3. The block diagram of the resulting realization is shown in Fig. 7.7. Since H( 0) = 1, the single­ pole filter requires no multiplication. The three double-pole filter sections require three multiplications each for a total of nine multiplications. The total num ber of additions is 13. Therefore, the frequency-sampling realization of this FIR filter is computationally more efficient than the direct-form realization. Figure 7.6 Direct-form realization of Af = 3 2 FIR filter. 510 Implementation of Discrete-Time Systems Figare 7.7 Frequency-sampling realization for the FIR filter in Exam ple 7.2.1. Chap. 7 Sec. 7.2 Structures for FIR Systems 511 7.2.4 Lattice Structure In this sectio n w e introduce an oth er F IR filter structure, called the lattice filter or lattice realization. Lattice filters are used exten sively in digital sp eech processing and in the im plem en tation o f adaptive filters. L et us b egin the d evelop m en t by considering a seq u en ce o f F IR filters with system functions Hm(z) = A m(z) m = 0 . 1 , 2 .........M - 1 w here, by definition, A m(z) is the polyn om ial m A m(z) = 1 + £ a m(k)z~ k *=i m > 1 (7.2.17) (7.2.18) and /lo(^) = !• T he unit sam ple resp onse o f the m th filter is /j„,(0) = 1 and h m{k) = a m(k), k = 1, 2 , . . . , m. T he subscript m on the p olyn om ial Am(c) d en otes the d egree o f the polynom ial. For m athem atical con ven ien ce, w e define a,„ (0) = 1. If (*(n)} is the input seq u en ce to the filter A,„{z) and (y(n )( is the output seq u en ce, w e have m v(«) = -*(«) + ^ o r m(A:)A-(?f — k) (7.2.19) *■=l T w o direct-form structures o f the F IR filter are illustrated in Fig. 7.8. Figure 1A Direct-form realization of the FIR prediction filter. 512 Implementation of Discrete-Time Systems Chap. 7 In C hapter 11, w e show that the F IR structures sh ow n in Fig. 7.8 are inti­ m ately related w ith the topic o f linear prediction, w here m x ( n ) = ~ ^ 2 a m( k )x (n - k) *=i (7.2.20) is the o n e-step forward predicted value o f x (n), based on m past inputs, and y ( n ) = x (n) — x (n ), given by (7.2.19), rep resents the p red iction error sequ en ce. In this context, the top filter structure in Fig. 7.8 is called a p re d ictio n er ror filter. N o w suppose that w e have a filter of order m = 1. T h e ou tp u t o f such a filter is >-(«) = x ( n ) - f a i( l)j r ( n - 1) (7.2.21) This output can also be ob tain ed from a first-order or sin gle-stage lattice filter, illustrated in Fig. 7.9, by exciting both o f the inputs by x ( n ) and selectin g the output from the top branch. Thus the output is exactly (7.2.21), if w e select /li = ori (1). T he param eter K i in the lattice is called a reflection coefficient and it is identical to the reflection coefficient introduced in the S ch u r-C ohn stability test described in Section 3.6.7. N ext, let us consider an FIR filter for w hich m = 2. In this case the output from a direct-form structure is y (n ) = x ( n ) + ff;>(l)jr(/i - 1 ) + ct2(2)x (n - 2 ) (7.2.22) By cascading tw o lattice stages as show n in Fig. 7.10, it is p ossib le to obtain the sam e output as (7.2.22). Indeed, the output from the first stage is f i (fl) = -*(n) + K]X{n - 1) (7.2.23) £ i(n ) = K {x ( n ) + x ( n - 1 ) T h e output from the secon d stage is flin ) = f\(n ) + - 1 ) (7.2.24) g 2(n) = K 2f i ( n ) + g i ( n - 1) /o(") = &>(") =■*(«) /i(«) =/o(") + *i£o{n - 1) = *00 + X , x ( n - 1) j,{n) = tf,/oOO + SoO1 - 1) = fCix(n) + x(n - 1) Figirc 7.9 Single-stage lattice filter. Sec. 7.2 Structures for FIR Systems 513 Figure 7.10 Two-stage lattice filter. If w e focus our atten tion on f 2{n) and substitute for f \ ( n ) and g\ ( n — 1) from (7.2.23) in to (7.2.24), w e obtain f 2(n) = jr(n) + K \ x ( n - 1) + - 1) + x ( n - 2)] (7.2.25) = x ( n ) + ^ i ( l + K 2) x( n - 1) + K 2x {n — 2) N o w (7.2.25) is identical to the output of the direct-form F IR filter as given by (7.2.22), if w e eq u ate the coefficients, that is, a 2 (2) = K 2 a 2( l) = ATi(l + K 2) (7.2.26) or, eq u ivalen tly, K 2 = a 2(2) Kx = 1 + a 2(2) (7.2.27) Thus the reflection coefficients K\ and K 2 o f the lattice can be ob tain ed from the coefficien ts {am(£)} o f th e direct-form realization. B y con tinu in g this process, o n e can easily d em onstrate by induction, the eq u iv a len ce b etw een an m th-order direct-form FIR filter and an w -ord er or m stage lattice filter. T h e lattice filter is gen erally d escribed by the follow in g set o f order-recursive equations: /o (n ) = gain) = x ( n ) (7.2.28) U i n ) = / ffl_ j(« ) + K mgm- X{n - 1) m = 1 ,2 .........M - 1 (7.2.29) g m(n) = ^ / B- i W + i . - i ( i i - l ) m = 1,2,..., M — 1 (7.2.30) T h en the ou tp u t o f th e (A f—l)-sta g e filter corresponds to the output o f an (A f—1)order F IR filter, that is, y (n ) = Figure 7.11 illustrates an (Af - l)-sta g e lattice filter in b lock diagram form along w ith a typical stage that show s the com p utations sp ecified by (7.2.29) and (7.2.30). A s a co n seq u en ce o f the eq u ivalen ce b etw een an F IR filter and a lattice filter, th e ou tp u t f m(n) o f an m -stage lattice filter can b e exp ressed as m f m( n) = £ <xm( k) x( n - k) *=o «m(0) = 1 (7.2.31) Sin ce (7.2.31) is a con v olu tion sum , it follow s that th e z-transform relationship is Fm(z) = Am(z)X(z) Implementation of Discrete-Time Systems 514 Chap. 7 (a) Figure 7.11 (Af —l)-stage lattice filter. or, equivalently, 7} F (?) F X(z) Fo(z) A m(z) = ( (7.2.32) T h e other output com p on en t from the lattice, nam ely, g m(n), can also be exp ressed in the form o f a con volu tion sum as in (7.2.31), by using another set o f coefficients, say {^m(Jt)}. T hat this in fact is the case, b ecom es apparent from ob servation o f (7.2.23) and (7.2.24). From (7.2.23) w e n ote that the filter coeffi­ cients for the lattice filter that produces / i ( n ) are {1 , A’l} = { 1 , ofi( 1 )} w hile the coefficients for the filter with output g \ ( n ) are (AT], 1} = | a i ( l ) , 1}. W e n ote that these tw o sets o f coefficients are in reverse order. If w e con sid er the tw o-stage lattice filter, with th e output given by (7.2.24), w e find that g 2 (n) can be expressed in the form g 2(n) = K 2f \ ( n ) + £ i(n - 1) = K 2[x in) + K \ x { n — 1)] + K \ x { n - 1) + x{ n — 2) = K 2x{ n ) + K \ ( l + K 2)x{n - 1) -I- x i n - 2) = cr2 ( 2 )jc(n) + £*2 ( 1 ) * (n - 1 ) + xin - 2 ) C onsequently, the filter coefficients are {a 2 (2), a 2 ( l ) , 1}, w h ereas the coefficients for the filter that produces the output f i i n ) are {1, a 2( \ ) , a 2 (2)}. H ere, again, the tw o sets o f filter coefficients are in reverse order. F rom this d ev elo p m en t it follow s that the ou tp u t gm{n) from an m -stage lattice filter can b e exp ressed by the con volu tion sum o f the form m gmin) = £ A *(*M « - k) (7.2.33) Sec. 7.2 Structures for FIR Systems 515 w h ere the filter coefficients {& ,(*)} are associated with a filter that produces f m(n) = y ( n ) but op erates in reverse order. C onsequently, f}m (k) = a m (m — k) * = 0 , 1 .........m (7.2.34) with p m(m) = 1 . In the co n tex t o f linear prediction, su p p ose that the data x(n), x{n - 1), . . . , x ( n —m + 1) is u sed to linearly predict th e signal valu e x ( n —m ) by u se o f a linear filter w ith coefficients {—fim(k)}. Thus the predicted value is m-l (7.2.35) Since the data are run in reverse order through the predictor, the prediction per­ form ed in (7.2.35) is called b a c k w a r d predictio n. In contrast, the F IR filter with system function Am(z) is called a f o r w a r d predictor. In the z-transform dom ain, (7.2.33) b ecom es G m(z) = B m( z ) X ( z ) (7.2.36) or, eq u ivalen tly, (7.2.37) w here Bm(z) represents the system function o f the F IR filter with coefficients {& ,(*)}, that is, (7.2.38) 4=0 Since fim(k) = a m(m — *), (7.2.38) m ay b e exp ressed as m ffl (7.2.39) m T h e relationship in (7.2.39) im plies that the zeros o f the F IR filter w ith system function B m(z) are sim ply the reciprocals o f the zeros o f A „ ( z ) . H en ce B m(z) is called the reciprocal or reverse p olyn om ial o f A m(z). N o w that w e have estab lish ed th ese interesting relationships b etw een the direct-form F IR filter and th e lattice structure, let us return t o th e recursive lattice eq u a tio n s in (7.2.28) through (7.2.30) and transfer them to th e z-dom ain. Thus 516 Implementation of Discrete-Time Systems Chap. 7 w e have (7.2.40) F0(z) = G 0(z) = X ( z ) Fm(z) = Fm_ i(z ) + J:mz - 1 Gm_ i(z ) m = 1, 2 , . . . , M - 1 (7.2.41) G m(z) = m = 1 , 2 , . . . , M —1 (7.2.42) + If w e divide each eq u ation by X (z), w e obtain the desired results in the form (7.2.43) A0(z) = B0(z) = 1 A m{z) = A m- X(z) + K „ z ~ } Bm- i ( z ) m = 1 , 2 .........M - 1 (7.2.44) Bm(z) = K n A n - i W + z - ' B ^ i z ) m = l,2 ,...,M -l (7.2.45) T hus a lattice stage is described in the z-dom ain by the m atrix equation (7.2.46) B efo re concluding this discussion, it is desirable to d ev elo p the relationships for converting the lattice param eters that is, the reflection coefficients, to the direct-form filter coefficients (a m(Jt)), and vice versa. Conversion of lattice coefficients to direct-form filter coefficients. The direct-form F IR filter coefficients {am(Jk)} can b e obtained from the lattice coeffi­ cien ts {AT;} by using the follow ing relations: (7.2.47) A 0 (z) = B 0(z) = 1 A m(z) = A m- \ ( z ) + K mz ~ xBm~\(z) Bm(z) = Z- mA m(z~ l ) m = 1,2- - - M - m = 1 ,2 .........M - 1 1 (7.2.48) (7.2.49) T h e solu tion is o b tain ed recursively, beginning with m = 1 . Thus w e obtain a seq u en ce o f (M — 1) F IR filters, o n e for each valu e o f m. T h e procedure is best illustrated by m eans o f an exam ple. Example 12J2 Given a three-stage lattice filter with coefficients AT] = j, K 2 = 5 , Ky = 5 , determine the FIR filter coefficients for the direct-form structure. Solution We solve the problem recursively, beginning with (7.2.48) for m = 1. Thus we have Ai(z) = A„<z) + tfiZ ^ B oW = 1 + K n - 1 = 1 + Jz "1 Hence the coefficients of an FIR filter corresponding to the single-stage lattice are ori(0) = 1 , ari(l) = Ki = j. Since Bm(z) is the reverse polynomial of A„(z), we have Sec. 7.2 517 Structures for FIR Systems Next we add the second stage to the lattice. For m = 2 , (7.2.48) yields ■AjU) = ^ i(i) + KiZ~* B\(z) — 1 4- J - -1 4- 1 ,- 2 — 1 + Rc T 2'- Hence the FIR filter param eters corresponding to the two-stage lattice are £*2(0) = 1, “ 2(1) = | , £*2(2) = Also, *2(z) = J + i = +z-2 Finally, the addition of the third stage to the lattice results in the polynomial M( z ) = * z (;)+ * :3 z _ ,ft(z ) = 1+ z _1 + %z~2 + | z -3 Consequently, the desired direct-form FIR filter is characterized by the coefficients £*3(0) = 1 a 3(l) = g of3(2) = 2 o3{3) = i A s this exam ple illustrates, the lattice structure with param eters K \ , K i ......... K m, corresp on d s to a class o f m direct-form F IR filters with system functions A\ (z), y4i ( z) , . . . , A„,(z). It is interesting to note that a characterization o f this class o f m FIR filters in direct form requires m( m + l ) / 2 filter coefficients. In contrast, the lattice-form characterization requires on ly the m reflection coefficients {A',}. T he reason that the lattice provides a m ore com pact representation for the class o f m F IR filters is sim ply du e to the fact that the addition o f stages to the lattice d o es n ot alter the param eters o f the previous stages. O n the other hand, the addition o f the mth stage to a lattice with ( m - 1 ) stages results in a F IR filter with system function A m(z) that has coefficients totally d ifferent from the coefficients o f the low er-order F IR filter with system function Am_ i(z ). A form ula for determ ining the filter coefficients [am(Jt)} recursively can be easily d erived from p olyn om ial relationships in (7.2.47) through (7.2.49). From the relationship in (7.2.48) w e have Am(z) = Am_ i(z ) + K mz ~ l B m- i ( z ) m »_i m-t ^ a m (k ) z ~ k = ^ a m-] (k)z~ k + K m ^ a m- \ ( m - 1 - k ) z (i+1) k=0 k=0 (7.2.50) *=0 B y eq u atin g the coefficients o f equal pow ers o f z - 1 and recalling that a m(0) = 1 for m = 1, 2 .........M - 1, w e obtain the desired recursive eq u ation for the F IR filter coefficients in the form £*m(0) = 1 (7.2.51) a m(m) = K m a m(k) = ctm- \ ( k ) + (7.2.52) - *) = £*m—i(k) + a m(rn)am-i(rn - k) ^ (7-2. 53) Implementation of Discrete-Time Systems 518 Chap. 7 W e n o te that (7.2.51) through (7.2.53) are sim ply the L ev in so n -D u rb in recursive equations given in Chapter 11. Conversion of direct-form FIR filter coefficients to lattice coefficients. S u p pose that w e are given the F IR coefficien ts for the direct-form realization or, equivalently, the polyn om ial A m(z), and w e w ish to determ in e the corresponding lattice filter param eters { £ ,} . For the m -stage lattice w e im m ed iately obtain the param eter K m = a m (m). T o obtain K m- \ w e n eed the p olyn om ials Am_ i(z ) since, in general, K m is ob tain ed from the p olyn om ial A m (z) for m = M —1, Af —2 , . . . , 1. C onsequently, w e need to com p ute the p olyn om ials A m(z) starting from m = Af —1 and “stepping d o w n ” su ccessively t o m = 1 . T h e d esired recursive relation for the polyn om ials is easily determ ined from (7.2.44) and (7.2.45). W e have A m(z) = A m- \ ( z ) + K mz ~ x B m- \ { z ) = A m- \ ( z ) + K m[Bm(z) - ^ mAm_ i( ;) ] If w e solve for Am_i (z), w e obtain A m- i ( z ) = m = M - h M - 2 .........1 -*"*"■<*> (7.2.54) which is just the step-dow n recursion used in the S ch u r-C ohn stability test d e­ scribed in S ection 3.6.7. T hus w e com p ute all low er-d egree p olyn om ials A m(z) beginning with A M- \ ( z ) and obtain the desired lattice coefficien ts from the rela­ tion K m = a m(m). W e ob serve that th e procedure works as lon g as \ Km \ 1 for m = 1, 2 .........A f - 1 . Example 7.23 Determ ine the lattice coefficients corresponding to the FIR filter with system function H(z) = A3(z) = 1 -ISolution First we note that -I- f z “2 -I- ±z-J = a 3(3) = | . Furtherm ore, # 3 (z) = 5 + jU- 1 + z~2 + z~y The step-down relationship in (7.2.54) with m = 3 yields A2(z) = A3(z) - K i B ^ z ) 1- K = l + f z - ^ z1 , - 2 Hence K2 — a 2(2) = 5 and B i (z) = recursion in (7.2.51), we obtain , , , 5 + | z _1 + z_1- By repeating the step-down A i b ) ~ K2B2(z ) Sec. 7.3 519 Structures for HR Systems From the step -d ow n recursive eq u ation in (7.2.54), it is relatively easy to obtain a form ula for recursively com puting K m, begin n ing with m = M — 1 and stepping dow n to m = 1. For m = M — 1, M — 2 , . . . , 1 w e h ave K m = a m( m ) Qfm—l (0) = 1 (7.2.55) a m(k) - K mfim(k) — J __ g 2 a m(k) - otm ( r n ) a m ( m - k) 1 -al(m ) 1 5 k < m —1 (7.2.56) w hich is again the recursion w e introduced in the S ch u r-C oh n stability test. A s indicated ab ove, the recursive eq u ation in (7.2.56) breaks dow n if any lattice param eters | Armj = 1. If this occurs, it is ind icative o f the fact that the polyn om ial A m- \ ( z ) has a root on the unit circle. Such a root can b e factored out from Am_](z) and the iterative p rocess in (7.2.56) is carried out for th e reducedorder system . 7.3 STRUCTURES FOR IIR SYSTEMS In this section w e consider different IIR system s structures d escribed by the dif­ ference eq u ation in (7.1.1) or, eq u ivalen tly, by the system function in (7.1.2). Just as in the case o f F IR system s, there are several types o f structures or realizations, including direct-form structures, cascade-form structures, lattice structures, and lattice-ladder structures. In addition, IIR system s lend th em selv es to a parallelform realization. W e begin by describing tw o direct-form realizations. 7.3.1 Direct-Form Structures T h e rational system function as given by (7.1.2) that ch aracterizes an IIR system can be v iew ed as tw o system s in cascade, that is, H ( z ) = H i (z ) H 2( z ) (7.3.1) w h ere Hi (z) con sists o f th e zeros o f H ( z ) , and H z (z ) con sists o f the p o les o f H {z), M H l (z ) = Y ! f bkZ~k *=o (7-3.2) H 2 ( z ) = ------- -- --------- (7.3.3) and 1+ X > z"* *=i In S ection 2.5.1 w e describe tw o different direct-form realizations, character­ ized by w h eth er H \{z) p reced es H j i z ) , or vice versa. Since H \ ( z ) is an F IR system , its direct-form realization w as illustrated in Fig. 7.1. B y attaching th e all-p ole 520 Implementation of Discrete-Time Systems All-zero system Chap. 7 All-pole system Figure 7.12 Direct form I realization. system in cascade with H\ ( z) , w e obtain the direct form I realization d epicted in Fig. 7.12. T his realization requires M + N + 1 m ultiplications, M + N additions, and M + N + 1 m em ory locations. If th e all-p ole filter f y i z ) is placed b efore th e all-zero filter H i(z), a m ore com pact structure is ob tain ed as illustrated in S ection 2.5.1. R ecall that the differ­ en ce eq u ation for th e all-pole filter is N w(n) = - ^ ai(W{n - k) + jr(n) (7.3.4) Since w ( n ) is the input to the all-zero system , its ou tp u t is M yW = bk w (n - k) (7.3.5) *=o W e n o te that both (7.3.4) and (7.3.5) in volve d elayed versions o f the sequ en ce (u>(n)}- C on sequ en tly, on ly a single d elay line or a sin gle set o f m em ory locations is required for storing the past values o f {u>(n)}. T h e resulting structure that im plem en ts (7.3.4) and (7.3.5) is called a direct form II realization and is depicted in Fig. 7.13. T his structure requires M + N + 1 m ultiplications, M + N additions, Sec. 7.3 Structures for IIR Systems Figure 7.13 521 D irect form II realization ( N — Af). and the m axim um o f {M, N } m em ory locations. Since the direct form II realization m inim izes the num ber o f m em ory locations, it is said to b e canonic. H ow ever, w e should indicate that other IIR structures also p ossess this property, so that this term in ology is perhaps unjustified. T h e structures in Figs. 7.12 and 7.13 are both called “direct form ” realiza­ tions b ecau se th ey are ob tain ed directly from the system function H ( z ) w ithout any rearrangem ent o f H ( z ) . U n fortu n ately, both structures are extrem ely sen si­ tive to param eter quantization, in gen eral, and are not recom m en d ed in practical applications. T his to p ic is discussed in detail in Section 7.6, w h ere w e dem onstrate that w h en N is large, a sm all change in a filter coefficient d u e to param eter quan­ tization, results in a large change in the location o f th e p o les and zeros o f the system . 7.3.2 Signal Flow Graphs and Transposed Structures A signal flow graph provides an alternative,Nbut eq u ivalen t, graphical rep resen ­ tation to a b lock diagram structure that w e have b een using to illustrate various system realization s. T h e basic elem en ts o f a flow graph are branches and n od es. A signal flow graph is basically a set o f directed branches that con n ect at n od es. B y d efinition , th e signal ou t o f a branch is equal to th e branch gain (system func­ tio n ) tim es the signal in to the branch. Furtherm ore, the signal at a n od e o f a flow graph is eq u al to the sum o f the signals from all branches con n ectin g to the node. T o illustrate th e se basic n otion s, let us con sid er the tw o -p o le and tw o-zero IIR system d ep icted in b lock diagram form in Fig. 7.14a. T h e system block 522 Implementation of Discrete-Time Systems Chap. 7 (a) Source node Sink node 5 (b) Fignre 7.14 Second-order filter structure (a) and its signal flow graph (b). diagram can be converted to the signal flow graph show n in F ig. 7.14b. W e note that the flow graph contains five n od es lab eled 1 through 5. T w o o f the nodes ( 1 ,3 ) are sum m ing n od es (i.e., they contain ad d ers), w hile the other three nodes represent branching points. Branch transm ittances are ind icated for the branches in the flow graph. N o te that a d elay is indicated by the branch transm ittance z- 1 . W h en the branch transm ittance is unity, it is left u n lab eled . T h e input to the system originates at a so ur ce n o d e and the ou tp u t signal is extracted at a sink node. W e observe that the signal flow graph con tains th e sam e b asic inform ation as the block diagram realization o f the system . T h e on ly ap p aren t d ifference is that b o th branch p oints and adders in the b lock diagram are rep resen ted by nodes in th e signal flow graph. T h e subject o f linear signal flow graphs is an im portant o n e in the treatm ent o f netw ork s and m any interesting results are available. O n e b asic n otion involves the transform ation o f o n e flow graph in to a n oth er w ithout changing the basic in p u t-ou tp u t relationship. Specifically, o n e tech n iq u e that is usefu l in deriving new system structures for F IR and IIR system s stem s from th e transposition or flo w - g ra p h reversal theorem. T his th eorem sim ply states that if w e reverse the Sec. 7.3 523 Structures for IIR Systems directions o f all brancb transm ittances and interchange the input and output in the flow graph, the system function rem ains unchanged. T h e resulting structure is called a transposed s tructure or a tran sp osed f o r m . F or exam p le, the transposition o f the signal flow graph in Fig. 7.14b is illus­ trated in Fig. 7.15a. T h e corresponding b lock diagram realization o f the transposed form is d ep icted in Fig. 7.15b. It is interesting to n ote that the transposition o f the original flow graph resulted in branching n od es b ecom in g ad d er n od es, and vice versa. In Section 7.5 w e p rovid e a p ro o f o f the transposition theorem by using state-sp ace techniques. L et us apply the transposition theorem to the direct form II structure. First, w e reverse all the signal flow d irections in Fig. 7.13. Second, w e change n od es into adders and adders into n od es, and Anally, w e interchange the input and the output. T h ese op eration s result in the transposed direct form II structure show n in Fig. 7.16. T his structure can b e redrawn as in Fig. 7.17, which show s the input on the left and the output on the right. ~ ai s^\ — (b) h Figure 7.15 Signal flow graph of transposed structure (a) and its realization (b). 524 Implementation of Discrete-Time Systems Chap. 7 Figure 7.16 Transposed direct form II structure. T h e transposed direct form II realization that w e have ob tain ed can be d e­ scribed by the set o f d ifference equations (7.3.6) y ( n ) = wr f n - l ) + b o x ( n ) Wt(n) = wt+i(n - 1) + b kx(n) Jt = 1 ,2 ......... N - 1 w N(n ) = bNx(n) - a Ny(n) (7.3.7) (7.3.8) W ithout loss o f generality, w e have assum ed that Af = W in w riting equ ation s. It is also clear from observation o f Fig. 7.17 that this set o f d ifferen ce eq u ation s is equ ivalen t to the sin gle differen ce equation y ( n ) = ~ ^ 2 a ky (n - k ) + ^ b kx ( n - k ) (7.3.9) Sec. 7.3 525 Structures for IIR Systems Figure 7.17 Transposed direct form II structure. Finally, w e o b serv e that th e transposed direct form II structure requires the sam e n um ber o f m ultip lication s, additions, and m em ory locations as the original direct form II structure. A lth o u g h our discussion o f transposed structures has b een concerned with the general form o f an IIR system , it is interesting to n o te that an F IR system , ob tain ed from (7.3.9) by setting the a* = 0, k = 1, 2 , . . . , N , also has a transposed direct form as illustrated in Fig. 7.18. T his structure is sim ply ob tain ed from Fig. 7.17 by settin g a* = 0, k = 1, 2 , . . . , N . T his transposed form realization m ay Figure 7.18 Transposed FIR structure. 526 Implementation of Discrete-Time Systems Chap. 7 be described by the set o f differen ce eq u ation s w M(n) = b t f x ( n ) (7.3.10) u>*(/i) = u>*+i(n — 1) + bkx(n) k = M — 1, M ~ 2, . . . , 1 y ( n ) = w i ( n - 1) +/>&*(«) (7.3.11) (7.3.12) In sum m ary, T ab le 7.1 illustrates the direct-form structures and the corresponding d ifference eq u ation s for a basic tw o-p ole and tw o-zero IIR system with system function x b0 + b i z ~ l + b 2z ~ 2 H ( z ) = ----------- ------------ 3 - 1 + fli z 1 +azz 1 (7.3.13) This is th e basic building block in the cascade realization o f h igh-order IIR system s, as described in the follow in g section. O f the three direct-form structures given in T ab le 7.1, th e direct form II structures are p referable due to the sm aller number o f m em ory locations required in their im plem entation. Finally, w e n o te that in the z-dom ain, the set o f d ifferen ce eq u ation s describ­ ing a linear signal flow graph con stitute a linear set o f equations. A n y rearrange­ m ent o f such a set o f eq u ation s is equ ivalen t to a rearrangem ent o f the signal flow graph to obtain a n ew structure, and vice versa. 7.3.3 Cascade-Form Structures Let us con sid er a high-order IIR system with system function given by (7.1.2). W ithout loss o f generality w e assum e that N > M . T h e system can be factored into a cascade o f secon d-ord er subsystem s, such that H (z) can b e exp ressed as K *=i w here K is the in teger part o f (N + l ) /2 . Hk (z) has th e general form rr , , bto + b u z ' 1 + bk2Z ' 2 Hk (z) = — --------------------- 3 5 1 + fljtiz 1 + a k2z 2 (7.3.15) A s in the case o f F IR system s b ased on a cascad e-form realization, the param eter bo can be distributed equally am ong the K filter se ctio n s so that bo = £>1 0 ^ 2 0 • ■■bxoT he coefficients {a*j} and {*>*, }in the secon d -ord er su b system s are real. This im plies that in form ing th e secon d-ord er su b system s or quadratic factors in (7.3.15), w e should group to g eth er a pair o f com p lex-con ju gate p o les and w e should group togeth er a pair o f com p lex-con ju gate zeros. H ow ever, th e pairing o f tw o com plexconjugate p o les with a pair o f com p lex-con ju gate zeros or real-valu ed zeros to form a subsystem o f the type given by (7.3.15), can b e d o n e arbitrarily. Furtherm ore, any tw o real-valued zeros can b e paired to g eth er to form a quadratic factor and, likew ise, any tw o real-valued p o les can b e paired togeth er to form a quadratic factor. C on sequ en tly, th e quadratic factor in th e num erator o f (7.3.15) m ay consist TABLE 7.1 SOME SECOND-ORDER MODULES FOR DISCRETE-TIME SYSTEMS Structure Implementation Equations System Function xin) v(n) = fc().t(n) +fc]X(n - I) -I- i>2.t(rt - 2) - oi v(n - 1) —<t2\(n —2) H( z) = bft + bjZ 1 +biz 2 1 + a u -1 +aiz~2 H( Z) = bp + bjZ 1 +bjz 1 + a u _1 +aiz~2 H( Z) bp -t-fri? 1 +bjz 2 1 + c u - * +aiz~2 x<n) u.’( n ) = ~ d i w ( n — I ) — a 2 w ( n — 2) + x(n) ,v(n) = bow(n) -+- fcj utr(»» —1) + b2U)(n —2) x<n) v(n) = bu.x(n) + wt (n - 1) = ht x( n) —ai_v(n) 527 w 2 (n) = -t- w 2 ( n - 1) b ix(n) - a 2y ( n ) 528 Implementation of Discrete-Time Systems Chap. 7 o f either a pair o f real roots or a pair o f com p lex-con ju gate roots. T h e sam e statem ent applies to the den om in ator o f (7.3.15). If N > M , so m e o f the secon d-ord er subsystem s h ave num erator coefficients that are zero, that is, eith er bk2 = 0 or bk\ = 0 or b oth bk2 = bk\ = 0 for som e k. Fur­ therm ore, if N is odd, o n e o f the subsystem s, say Hk (z), m ust h ave a k2 = 0, so that the subsystem is o f first order. T o p reserve the m odularity in th e im plem en tation o f H ( z ) , it is o ften preferable to use the basic secon d-ord er su b system s in the cas­ cade structure and h ave som e zero-valu ed coefficients in so m e o f the subsystem s. E ach o f the secon d-ord er subsystem s with system function o f the form (7.3.15) can be realized in eith er direct form I, or direct form II, or tran sp osed direct form II. Since there are m any w ays to pair the p oles and zeros o f H (z ) into a cascade o f secon d-ord er section s, and several w ays to order the resulting subsystem s, it is p ossib le to obtain a variety o f cascade realizations. A lth ou gh all cascade realiza­ tions are equ ivalen t for infinite precision arithm etic, the various realizations may differ significantly w hen im plem en ted with finite-precision arithm etic. T he general form o f th e cascade structure is illustrated in Fig. 7.19. If we use the direct form II structure for each of the subsystem s, the com putational algorithm for realizing the IIR system with system function H ( z ) is described by the follow in g set o f equations. >>o(n) = x ( n ) (7.3.16) w k(n) = - a ki w k(n - 1) - a k2w k (n - 2) + y*_i(n) k = 1 ,2 ...........K (7.3.17) y k(n) = bk0w k(n) + bt i w k(n - 1) -I- bk2w t (n - 2) k = 1 ,2 ..........K (7.3.18) y (n ) = ytcin) (7.3.19) (a) **0 -«*l S ~ \ > '* ( * ) = X t + 1 ( n ) ^ -0 0 - (b) Ftg*rc 7.19 Cascade structure of second-order systems and a realization of each second-order section. Sec. 7.3 529 Structures for IIR Systems Thus this set o f eq u ation s p rovides a com p lete description o f the cascade structure based on direct form II section s. 7.3.4 Parallel-Form Structures A parallet-form realization o f an IIR system can be ob tain ed by p erform ing a partial-fraction expansion o f H( z ) . W ithout loss o f generality, w e again assum e that N > M and that the p o le s are distinct. T hen, by perform ing a partial-fraction expansion o f H( z ) , w e obtain the result N Ai H ( z ) = C + V ------- — r t t 1 - P*z~' (7.3.20) w here {p*} are the p oles, {A t \are the coefficients (residues) in the partial-fraction exp an sion , and the constant C is defined as C = b s / a s i . T h e structure im plied by (7.3.20) is sh ow n in Fig. 7.20. It consists o f a parallel bank o f sin gle-p ole filters. In gen eral, som e o f the p oles o f H ( z ) may be com plex valued. In such a case, the corresp on d ing coefficients A t are also com plex valued. T o avoid m ultiplica­ tions by com p lex num bers, w e can com b ine pairs o f com p lex-con ju gate p oles to form tw o -p o le subsystem s. In addition, w e can com b ine, in an arbitrary m anner, c Figure 7.20 Parallel structure of IIR system. 530 Implementation of Discrete-Time Systems Figure 7*21 Chap. 7 Structure of second-order section in a parallel IIR system realization. pairs o f real-valued p o les to form tw o-p ole subsystem s. Each o f th ese subsystem s has the form Hk{z) = 1 (7.3.21) + a kiz ] + a k2r w here the coefficients {bk,} and (at;] are real-valued system param eters. T he over­ all function can n ow be expressed as (7.3.22) H( z) = C + J 2 h*<*> w here K is the in teger part o f ( N + 1)/2. W hen N is odd, on e o f the H k (z) is really a sin gle-p ole system (i.e., bk\ = a k 2 = 0 ). T h e individual second-order section s which are th e basic b uilding blocks for H ( z ) can be im plem en ted in eith er o f the direct form s or in a transposed direct form. T h e direct form II structure is illustrated in Fig. 7.21. W ith this structure as a basic building block, the parallel-form realization o f the F IR system is described by the follow in g set o f equations wk(n) = —aki w k(n - 1) - ak2wk(n - 2) + x(n) * = 1,2,..., (7.3.23) yt(n) = bk0wk(n ) + bktwt (n - 1) k = 1 ,2 .........K (7.3.24) K y(n) = Cx ( n ) + ^ y t ( n ) (7.3.25) Example 7.3.1 Determine the cascade and parallel realizations for the system described by the system function 10(1 - H(z) = 1)(1 — l z - 1 ) ( l + 2 z-1) (1 - |z _1)(l - 5Z-1)[1 - (j + ; j ) z -1][l - (5 - Sec. 7.3 Structures for IIR Systems 531 Solution The cascade realization is easily obtained from this form. One possible pairing of poles and zeros is 1 - lz~* = i _ 2 .- i + 2, z- 2 1 8' T 32 ‘ l + l z - '- z " 2 H2<c) = i1 - z ~ l— + \rz~~2; and hence H(z) = 10//,(z)Jfe(z) The cascade realization is depicted in Fig. 7.22a. To obtain the parallel-form realization, H(z) must be expanded in partial frac­ tions. Thus we have Ai Ai " (2 ) = ■+ 1-fz-1 1-iz-1 i - ( i + yi)z-i i - ( l - y i );-i where j4t , A 2, A 3, and A j are to be determ ined. A fter some arithmetic we find that A { = 2.93, A, = -17.68, A3 = 12.25 - yl4.57, A\ = 12.25 + >14.57 upon recom bining pairs of poles, we obtain „ % —14.75 —12.90z_l 24.50 + 26.82;"' — ;----- 5— i— I- 1 _ -- I -L J.--2 H (z) — -------1 1 _ Z--1 _1_ 2 . 7 - 1 x*- + 324 *■ 2^ The parallel-form realization is illustrated in Fig. 7.22b. 7.3.5 Lattice and Lattice-Ladder Structures for IIR Systems In Section 7.2.4 w e d ev elop ed a lattice filter structure that is eq u ivalen t to an F IR system . In this sectio n w e exten d the d evelop m en t to IIR system s. L et us b egin with an all-p ole system with system function H (z) = ------- ^ ----------- =■ — A t a n (z ) 1+ ^cis(k)z k=l (7. 3. 26) T h e direct form realization o f this system is illustrated in Fig. 7.23. T h e difference eq u ation for this IIR system is N y( n ) = ~ ^ a N (k) y( n - k) + x { n) *=i (7.3.27) It is in terestin g to n ote that if w e interchange the roles o f input and output [i.e., interchange x ( n ) w ith y(n ) in (7.3.27)], w e obtain x(n) = - ^ T a N(k)x(n - k) 4- y(ri) Implementation of Discrete-Time Systems 532 Chap. 7 (a) (b) Figure 7.22 Cascade and parallel realizations for the system in Example 7.3.1. or, equivalently, N y ( n ) = x ( n ) 4- ^ a w(fc)*(n - k) *=i (7.3.28) W e n o te that the eq u ation in (7.3.28) describes an F IR system having the system function H ( z ) = A N (z), w h ile the system describ ed by th e differen ce equa­ tion in (7.3.27) rep resen ts an IIR system with system function H ( z ) = lM w(z)* Sec. 7.3 533 Structures for IIR Systems yi.n) *(«) Figure 7.23 Direct-form realization of an all-pole system. O n e system can b e o b tain ed from the other sim ply by interchanging th e roles o f th e input and output. B ased on this o b servation , w e shall use the all-zero (F IR ) lattice describ ed in S ection 7.2.4 to ob tain a lattice structure for an all-p ole IIR system by interchanging the ro les o f the input and output. First, w e take the all-zero lattice filter illustrated in Fig. 7.11 and th en redefine the input as x ( n ) = f N(n) (7.3.29) v(n) = fo(n) (7.3.30) and the ou tp u t as T h ese are exactly the o p p osite o f the definitions for the all-zero lattice filter. T h ese d efinitions d ictate that the qu an tities { / m(n)l be com p uted in d escen din g ord er [i.e., / v ( n ) , / v _ i ( n ) , . . . ) . T h is com p utation can be accom plished by rearranging the recursive eq u ation in (7.2.29) and thus solvin g for / m_\ (n) in term s o f f m(n ), that is, K mgm- i ( n - 1 ) / m - i ( n ) = f m( n) - m = N, N - 1 ,..., 1 T h e eq u a tio n (7.2.30) for gm(n) rem ains unchanged. T h e result o f th ese ch an ges is th e set o f equations f s ( n ) = x (n) (7.3.31) f m - \ ( n ) = f m(n) - K mgm. ] ( n - 1) gm(n) = K mf m- i ( n ) + g m- \ ( n - 1) m = N , N - 1,. (7.3.32) m = N , N - 1, (7.3.33) y ( n ) = /o (n ) = go(n) w hich corresp on d to the structure sh ow n in Fig. 7.24. Input Figure 7.24 Lattice structure for an all-pole IIR system. (7.3.34) Implementation of Discrete-Time Systems 534 Chap. 7 T o d em onstrate that the set o f eq u ation s (7.3.31) through (7.3.34) represent an all-pole IIR system , let us con sid er th e case w h ere N = 1. T h e eq u ation s reduce to * (n ) = /i( n ) fain) = h i n ) - K\goin - 1) g i(n ) = ATi/o(n) + go(n - 1) (7.3.35) ?(«) = foin) = xin ) - K \yin - 1 ) Furtherm ore, the eq u ation for g i(/i) can be exp ressed as £ i(n ) = ATi^n) + y in - 1) (7.3.36) W e observe that (7.3.35) represents a first-order all-p ole IIR system w hile (7.3.36) represents a first-order F IR system . T h e p o le is a result o f the feed b ack introduced by the solution o f th e ( / m(n)} in descen din g order. T his feed b ack is dep icted in Fig. 7.25a. Forward (a) Forward Reverse (b) Figure 125 Single-pole and two-pole lattice system. Sec. 7.3 535 Structures for IIR Systems N ex t, let us con sid er the case N = 2, which corresponds to the structure in Fig. 7.25b. T h e eq u ation s corresponding to this structure are f 2(n) = x (n) f i ( n ) = f 2(n) - K 2g i(n - 1) g2(n) = K 2f i ( n ) + g i(n - 1 ) (7.3.37) /o (n ) = / i ( n ) - K igo in - 1 ) gi (n) = K ifo (n ) + g o ( n - l ) y (n ) = /o (n ) = go(«) A fter so m e sim ple substitutions and m anipulations w e obtain y (n ) = + K 2)y (n — 1) - K 2y (n - 2) + x ( n ) g2(n) = K 2v(n ) + K XQ + K 2)y (n - 1) + v(n - 2) (7.3.38) (7.3.39) C learly, the differen ce equation in (7.3.38) represents a tw o-p ole IIR system , and the relation in (7.3.39) is the in p u t-ou tp u t equation for a tw o-zero F IR system . N o te that the coefficients for the F IR system are identical to th ose in the IIR system excep t that they occu r in reverse order. In general, th ese con clu sion s hold for any N . Indeed, with the definition of Am( i) given in (7.2.32). the system function for the all-p ole IIR system is „ , , Y (z) Fo(z) 1 Ha (z) = -------= ----------= ---------X (z ) Fm(z) Am( z) 7 , ,, (7.3.40) Sim ilarly, the system function o f the all-zero (F IR ) system is H b(z) = Y (z ) G 0(Z) = B m(z) = z~ mA m( z ~ l ) (7.3.41) w h ere w e used the p reviously established relationships in (7.2.36) through (7.2.42). Thus the coefficients in the F IR system H b(z) are identical to the coefficients in Am(z), excep t that they occur in reverse order. It is interesting to n o te that the all-p ole lattice structure has an all-zero path with input go(n) and output g x ( n ), w hich is identical to its counterpart all-zero path in th e all-zero lattice structure. T h e polynom ial Bm (z), w hich represents the system function o f the all-zero path com m on to b oth lattice structures, is usually called the b a c k w a rd sy stem fu n c tio n , b ecau se it provid es a backward path in the a ll-p ole lattice structure. From this discussion th e reader should ob serve that the all-zero and all-pole lattice structures are characterized by th e sam e set o f lattice param eters, nam ely, K \, K 2, . . K n . T h e tw o lattice structures differ on ly in the in tercon n ection s o f their signal flow graphs. C on sequ en tly, the algorithm s for con vertin g b etw een the system param eters (a m(fc)} in th e direct form realization o f an F IR system , and the p aram eters o f its lattice counterpart apply as w ell to the all-p ole structure. 536 implementation of Discrete-Time Systems Chap. 7 W e recall that the roots o f the polynom ial A N (z) lie in sid e th e unit circle if and o n ly if the lattice param eters | ^ m| < 1 for all m = 1, 2 .........N . T h erefore, the all-p o le lattice structure is a stable system if and on ly if its param eters \K m\ < 1 for all m. In practical applications the all-pole lattice structure has b een used to m odel the hum an vocal tract and a stratified earth. In such cases the lattice param eters, {K m) have the physical significance o f b ein g identical to reflection coefficients in the physical m edium . T his is the reason that the lattice param eters are o ften called reflection coefficients. In such applications, a stable m od el o f the m edium requires that the reflection coefficients, obtained by perform ing m easu rem en ts o n output signals from the m edium , b e less than unity. T h e all-p ole lattice provides the basic b uilding block for lattice-type structures that im plem en t IIR system s that contain both p oles and zeros. T o d evelop the appropriate structure, let us consider an IIR system with system function M H (z ) = -------------------------= A , 1 + J 2 a N(k)z ~ L k= 1 * n (z ) (1 3 A 2 ) w here the notation for the num erator polynom ial has b een changed to avoid con­ fusion with our previous develop m en t. W ithout loss o f generality, w e assum e that N > M. In the direct form II structure, the system in (7.3.42) is described by the difference equations N w (n ) = — ^ a tf(fc )u > (n — k) + x (n ) *=i M y (n ) = £ c M(fc)w(n - k) *=o (7.3.43) (7.3.44) N o te that (7.3.43) is the in p ut-ou tp u t o f an all-p ole IIR system and that (7.3.44) is the in p u t-o u tp u t o f an all-zero system . Furtherm ore, w e ob serve that the output of the all-zero system is sim ply a linear com bination o f delayed ou tp u ts from the all­ p o le system . This is easily seen by observing th e direct form II structure redrawn as in Fig. 7.26. Since zeros result from form ing a linear com bination o f previous outputs we can carry o ver this observation to construct a p o le -z e r o IIR system using the all­ p ole lattice structure as the basic building block. W e have already observed that gm(n ) is a linear com bination o f present and past outputs. In fact, the system Hh(z) = = Bm(z) Y (z) Sec. 7.3 537 Structures for IIR Systems 0> ^ - 0 - ------0 -------0 w (n ) w(n - 1 ) w(n - 2) w(n - Af + 1) ------ w ( n - M) t - M ------------- ------ e« 0 ) c*<2 ) cu ( M - 1) c^M) yirt) 0 — - 0 - -------0 ------- 0 ^ Figure 7.26 D irect form II realization of IIR system. is an all-zero system . T h erefore, any linear com bination o f {gm(n)} is also an all-zero system . Thus w e begin with an all-p ole lattice structure with param eters K m, 1 < m < N , and w e add a la dder part by taking as the output a w eigh ted linear com bination o f (£ * (n )}. T h e result is a p o le-zero IIR system w hich has the latticela d d e r structure show n in Fig. 7.27 for M = N . Its output is M (7.3.45) msrO w here (um) are the param eters that determ ine the zeros o f the system . T h e system Figure 7.27 Lattice-ladder structure for the realization o f a p ole-zero system. Implementation of Discrete-Time Systems 538 Chap. 7 function corresponding to (7.3.45) is H(z) = Y (z ) X (z) (7.3.46) G m(z) -Z> X { z ) Since X ( z ) = F N(z) and fb (z) = G q( z ), (7.3.46) can be written as rr/ ^ H(z) = G m{z) Fq( z ) > u m— — — 7 ^ G 0 (z) FN (z) Bm{z) a n (z ) (7.3.47) M y , vmBm{z) A \(z) If w e com pare (7.3.41) with (7.3.47), w e con clu d e that M C M(z) = ' £ / vmBm(z) m=0 (7.3.48) T his is the desired relationship that can be used to determ in e the w eighting coef­ ficients {um). Thus, w e have dem onstrated that the coefficients o f the num erator polyn om ial C*f(z) determ in e the ladder param eters {um}, w h ereas the coefficients in the d en om in ator polyn om ial A ^(z) determ ine the lattice p aram eters {Km\. G iven the polyn om ials C « (z ) and A n ( z ), w here N > M , th e param eters of the all-pole lattice are d eterm ined first, as described p reviou sly, by the conver­ sion algorithm given in Section 7.2.4, which con verts the direct form coefficients in to lattice param eters. B y m ean s o f the step -d ow n recursive relations given by (7.2.54), w e obtain the lattice param eters {Km} and th e p olyn om ials Bm(z), m = 1, 2 ,..., N. T h e ladder p aram eters are d eterm in ed from (7.3.48), w hich can be expressed as TO—1 C m( z) = £ vk B k(z) + vmB m(z) (7.3.49) or, equivalently, as C m(z) = Cm_ ,(z ) + vmB m( z) (7.3.50) Thus Cm(z) can b e com p uted recursively from the reverse p olyn om ials Bm(z), m = 1 , 2 , . . . , M . Since — 1 for all m, th e param eters vm, m = 0, 1 , . . . , M can be determ ined by first noting that vm = cm(m) m = 0,1,..., M (7.3.51) Sec. 7.4 State-Space System Analysis and Structures 539 T h en , by rew riting (7.3.50) as Cm- \ (z) = Cm (z ) - iv, Bm(z) (7.3.52) and running this recursive relation backward in m (i.e., m = M , M — 1 , . , , , 2 ), w e o b tain cm(m ) and therefore the ladder param eters according to (7.3.51). T h e lattice-ladder filter structures that w e h ave p resen ted require the m in­ im um am ount o f m em ory but not the m inim um num ber o f m ultiplications. A l­ thou gh lattice structures w ith only on e m ultiplier per lattice stage exist, the tw o m ultiplier-per-stage lattice that w e have described, is by far th e m ost w idely used in practical applications. In con clu sion , th e m odularity, the built-in stability charac­ teristics em b o d ied in the coefficients {ATm}, and its robustness to finite-w ord-length effe cts m ake th e lattice structure very attractive in m any practical applications, including sp eech processing system s, adaptive filtering, and geophysical signal pro­ cessing. 7.4 STATE-SPACE SYSTEM ANALYSIS AND STRUCTURES U p to this point our treatm ent o f linear tim e-invariant system s has b een lim ited to an in p u t-o u tp u t or external description of the characteristics o f the system . In other w ords, the system was characterized by m athem atical eq u ation s that relate the input signal to the output signal. In this section w e introduce the basic concepts in the state-sp ace description o f linear tim e-invariant causal system s. A lth ou gh the state-space or in tern a l description of the system still in volves a relationship betw een the input and output signals, it also in volves an additional set o f variables, called state variables. Furtherm ore, the m athem atical eq u ation s describing the system , its input, and its output are usually divided into tw o parts: 1. A set o f m athem atical eq u ation s relating th e state variables to the input signal. 2. A seco n d set o f m athem atical eq u ation s relating the state variables and the current input to the output signal. T h e state variables provide inform ation ab ou t all th e internal signals in the system . A s a result, the state-sp ace description provides a m ore d etailed descrip­ tion o f the system than the in p u t-ou tp u t description. A lth o u g h our treatm ent o f state-sp ace analysis is confined prim arily to sin gle in p u t-sin g le output linear tim einvariant causal system s, the state-sp ace tech n iqu es can also b e applied to non­ linear system s, tim e-variant system s, and m ultip le in p u t-m u ltip le ou tp u t system s. In fact, it is in the characterization and analysis o f m ultip le in p u t-m u ltip le output system s that th e p ow er and im portance o f state-sp ace m eth od s are clearly evident. B o th in p u t-o u tp u t and state-variable descriptions o f a system are useful in practice. T h e description w e use d ep en d s on the p rob lem , the available inform a­ tion, and the q u estion s to b e answ ered. In our p resen tation , the em phasis is on 540 Implementation of Discrete-Time Systems Chap. 7 the use o f state-sp ace tech n iqu es in system analysis, and in the d evelop m en t o f state-sp ace structures for th e realization o f discrete-tim e system s. 7.4.1 S ta te -S p a ce D e sc rip tio n s o f S y s te m s C haracterized by D ifference E qu ations A s w e have already o b served , the determ ination o f the output o f a system requires that w e know the input signal and the set o f initial con d ition s at th e tim e the input is applied. If a system is n ot relaxed initially, say at tim e no, th en k n ow led ge o f the input signal x ( n ) for n > n Q is not sufficient to un iqu ely d eterm in e the output y(n) for n > no- T h e initial con d ition s o f the system at n = no m ust also b e know n and taken in to account. T his set o f initial con d ition s is called th e state o f the system at n = no- H en ce we defin e the state o f a sy ste m a t tim e no a s the a m o u n t o f in fo rm a tio n that m u s t be p r o v id e d at tim e n0, w hich, together w ith th e in p u t signal x ( n ) f o r n > no, u n iq u e ly d eterm in e the o u tp u t o f th e sy stem f o r a ll n > noFrom this definition w e infer that the con cep t o f state lead s to a d ecom p o­ sition o f a system in to tw o parts, a part that contains m em ory, and a m em oryless com p onent. T he inform ation stored in the m em ory co m p on en t con stitu tes the set o f initial conditions and is called the state o f the system . T h e current ou tp u t o f the system then b eco m es a function o f the current value o f the input and the current state. T hus, to d eterm in e the output o f the system at a given tim e, w e n eed the current value o f the state and the current input. Since the current value o f the input is available, w e only n eed to provide a m echanism for upd atin g the state o f the system recursively. C on sequ en tly, the state o f the system at tim e no + 1 should d epend on the state o f the system at tim e n 0 and the value o f th e input signal x (n) at n = noT h e follow in g exam p le illustrates the approach in form ulating a state-space description o f a system . L et us con sid er a linear tim e-invariant causal system described by the d ifferen ce equation 3 3 (7.4.1) T h e direct form II realization for the system is show n in Fig. 7.28. A s state variables, w e u se the con ten ts o f the system m em ory registers, cou n t­ ing them from the b o ttom , as show n in Fig. 7.28. W e recall that th e output o f a delay elem en t rep resen ts the present value stored in th e register and the input represents the next v alu e to b e stored in th e m em ory. C on seq u en tly, with the aid o f Fig. 7.28, w e can w rite t>i(n + 1 ) = V2 (n) v i (n + 1 ) = U3 («) v$(n + 1 ) = - a 3U i(n ) - 0 2 « 2 (n ) - o m 3( n ) + x(n) (7.4.2) Sec. 7.4 541 State-Space System Analysis and Structures <*> o - © -« l v2(«) 0 ■6 - U,(«) "« 3 3 Figure 7.28 Direct form II realization of system described by the difference equa­ tion in (7.5.1). It is in terestin g to n o te that the state-variable form ulation for the third-order system o f (7.4.1) in v o lv es three first-order difference eq u ation s given by (7.4.2). In general, an n th-order system can be described by n first-order differen ce equations. T h e ou tp u t eq u ation , w hich exp resses y ( n ) in term s o f the state variables and the presen t input v alu e x (n ), can also be ob tain ed by referring to Fig. 7.28. W e have y (n ) = i>oVi(n + 1 ) + />3 Ui(n) + b2v2 (n) + 6 it>3 (/i) W e can elim in a te v$(n + 1 ) by using the last equation in (7.4.2). Thus w e obtain the desired ou tp u t eq u ation y (n ) = (f >3 - boa2) v i (n ) + (£ 2 — boa2) v2(n) + (b\ - i>o<ai)u3 (n) + b0x ( n ) (7.4.3) If w e put (7.4.2) and (7.4.3) in to m atrix form w e have ’ V[(n + 1 )- V2 (n + 1) = _ v 3 (n + 1 ) . ■ ‘ t>] ( n ) - 0 1 0 0 0 .-0 3 -a 2 1 -a \. - V2 (n) -i> 3 (n )- and y ( n ) = [(b3 - b0a 3) ( ^ - M 2 ) (i>i ~ M l ) ] -0 0 + x(n) (7.4.4) .1 . ~ v i(n ) ’ v2(n) ■+■box(n) (7.4.5) -V 3 ( * ) - T h e eq u a tio n s (7.4.4) and (7.4.5) provide a com p lete description o f the sys­ tem . F urtherm ore, th e variables v i(n ), V2 (n), and 113( 0 ), w hich sum m arize all the n ecessary past inform ation, are the state variables o f the system . W e also observe that as in d icated previou sly, eq u ation s (7.4.4) and (7.4.5) split the system in to tw o co m p o n en t parts, a dynam ic (m em ory) subsystem and a static (m em oryless) sub­ system . W e say that this se t o f eq u ation s provides a state-space description o f the system . Implementation of Discrete-Time Systems 542 Chap. 7 B y generalizing the previous exam p le, it can easily be se en that the A'th-order system described by N Af ,( « ) = - £ a ty(n ~ *=i bkX^n ~ k) + (7.4.6) Jt=0 can be expressed as a linear tim e-invariant state-space realization by the relations State equation v(n -j- 1 ) = Fv(n) + q x(n ) (7.4.7) >■(«) = gf v ( n ) + d x ( n ) (7.4.8) Output equation w here the elem en ts o f F, q, g, and d are con stan ts (i.e., they d o n ot change as a function o f the tim e index n ), given by • - “ 0 1 0 • 0 0 1 0 0 0 0 1 .-a s ~a„ -1 -a2 ~a\ . - 0 "0 " 0 0 q= F = (7.4.9) 0 b N — boaN b fj - 1 — bo a n-\ g= b\ — boa\ A n y discrete-tim e system w h ose input x (n ), ou tp u t y( n ) , and state v{n), for all n > no, are related by the state-sp ace eq u ation s ab ove, w h ere F, q, g, and d are arbitrary but fixed quantities, will be called linear and tim e invariant. If at least o n e o f the quantities in F, q, g, or d d ep en d s on tim e, the system b ecom es time variant. W e will refer to (7.4.7) through (7.4.8) as the linear tim e-in va rian t state-space m o d el, which can b e represented by the sim ple vector-m atrix block diagram in Fig. 7.29. In this figure the d ou b le lin es represent vector qu an tities and the blocks represent the v ector or m atrix coefficients. Example 7.4.1 Determine the state-space equations for the transposed direct form II structure shown in Fig. 7.30. Solution The validity of this structure can be seen if we rewrite (7.4.1) as y(n) = - k) - aky(n - * )] + box(n) Sec. 7.4 State-Space System Analysis and Structures 543 Figure 7.29 General state-space description of a linear time-invariant system. *(«) Figure 7JO State-space realization for the system described by (7.4.1). Due to the linearity and time invariance of the system, instead of first delaying the signals x(n) and y(n) and then computing the terms bkx(n - k) — aky(n — k) as in Fig. 7.28, we first compute the terms bkx(n) — at y(n) and then delay them. If we use the state variables indicated in Fig. 7.30, we obtain 'v i(n + 1 )" Vi (n + 1 ) = . v3(n + 1 ) . ‘0 0 1 0 .0 1 y(n) = [0 0 ’ 'M n )‘ ‘ bi —boaj " -a 2 i>2 (n) = * 2 - M 2 x(n) -b\ — bod\ . - a i . .t>B(n). — 03 (7.4.10) Di(n) 1 ] l> 2 (fl) -f box(n) (7.4.11) V3(n) J T h e state-sp ace description specified by (7.4.4) and (7.4.5) is know n as a ty p e 1 state-sp ace realization, w h ereas the o n e described by (7.4.10) and (7.4.11) is ca lled a typ e 2 state-sp ace realization. 7.4 .2 S o lu tio n o f th e S ta te -S p a ce E q u ation s T h ere are several m eth od s for solvin g the state-sp ace eq u ation s. H ere w e discuss a recursive solu tion w hich m akes u se o f th e fact that the state-sp ace eq u ation s are a se t o f linear first-order differen ce equations. 544 Implementation of Discrete-Time Systems Chap. 7 For the jV-dim ensional state-sp ace m odel v(« + 1) = F v(/i) + qjr(n) (7.4.12) y(n) = g'v(n) + d x(n ) (7.4.13) and given the initial co n d ition v (« 0), we have for n > n0, v(n 0 + 1) = Fv(n0) + q*(n) v(no + 2 ) = F v(n 0 + 1 ) + qjr(n0 + 1 ) = F 2 v(n0) + F q j(« o ) + q-^(«o + 1) w here F 2 represents the matrix product FF and Fq is the product o f the m atrix F and the vector q. If w e continue as in the on e-dim en sion al case, w e obtain, for n > n0, (7.4.14) The matrix F° is defined as the N x N identity matrix, having unity on the main diagonal and zeros elsew h ere. T he m atrix F'- -' is often d en o te d as 4>(/ - j ) , that is, * (/ - j) = F ~ J (7.4.15) for any p ositive in tegers i > j . T his m atrix is called the state transition matrix of the system . T h e output o f the system is obtained by substituting (7.4.14) in to (7.4.13). T he result o f this substitution is y(n) = g'F" nov(n0) + £ g'F" 1 kq x ( k ) + d x { n ) *=«0 (7.4.16) n- 1 = - floM no) + ^ 2 - 1 - &)q*(*) + d x ( n ) From this general result, w e can determ ine the output for tw o special cases. First, the zero-input resp onse o f the system is yzM ) = g'F" n“v(n0) = g '$ ( n - floM no) (7.4.17) O n the other hand, the zero-state response is n—1 yzs(n) = g' $ { n - 1 - fc)q*(/:) + d x ( n ) (7.4.18) Clearly, the A'-dim ensional state-sp ace system is zero-in p u t linear, zero-state linear, and since y ( n ) = y Zi(n) + y zs(n), it is linear. F urtherm ore, sin ce any system described by a linear con stan t-coefficien t d ifferen ce eq u ation can be put in the state-space form, it is linear, in agreem en t with the results ob tain ed in S ection 2.4. Sec. 7.4 State-Space System Analysis and Structures 545 7.4.3 Relationships Between Input-Output and State-Space Descriptions From our p reviou s discussion w e h ave seen that there is n o unique ch oice for the state variables o f a causal system . Furtherm ore, d ifferent ch o ices for th e state vecto r lead to differen t structures for the realization o f the sam e system . H en ce, in g en eral, the in p u t-o u tp u t relationship d oes not un iqu ely d escrib e the internal structure o f th e system . T o illu strate these assertions, let us consider an N -dim en sion al system with the sta te-sp a ce rep resen tation v(n + 1) = Fv(rt) 4- qjf(n) (7.4.19) y(n ) = g'v(n) -1- d x ( n ) (7.4.20) L et P b e any N x N matrix w h ose inverse m atrix P-1 exists. W e d efine a new state v ecto r v(n) as (7.4.21) (7.4.22) (7.4.23) (7.4.24) N o w , w e d efine a n ew system param eter matrix F and the vectors q and g as F = PFP-1 (7.4.25) W ith th ese d efinition s, th e state eq u ation s can b e exp ressed in term s o f th e new system qu an tities as v(rt 4 1) — Fv(n) 4 - q *(n ) (7.4.26) y ( n ) = §fv(n) -j- d x ( n ) (7.4.27) If w e com p are (7.4.19) and (7.4.20) with (7.4.26) and (7.4.27), w e ob serve that by a sim p le linear transform ation o f the state variables, w e have gen erated a n ew set o f sta te eq u ation s and an output eq u ation , in w hich th e input x ( n ) and the ou tp u t y ( n ) are unchanged. Since there is an infinite n um ber o f ch oices o f the transform ation m atrix P, there is also an infinite num ber o f state-sp ace eq u ation s Implementation of Discrete-Time Systems 546 Chap. 7 and structures for a system . S om e o f these structures are different, w hile som e others are very sim ilar, differing o n ly by scale factors. A ssociated with any state-sp ace realization o f a system is the con cep t o f a m i n i m a l realization. A state-sp ace realization is said to b e m i n i m a l if the d im ension o f the state sp a ce (th e num ber o f state variab les) is th e sm allest o f all p ossible realizations. Since each state variable rep resen ts a quantity that m ust be stored and updated at every tim e instant n , it fo llo w s that a m inim al realization is o n e that requires the sm allest num ber o f d elays (storage registers). W e recall that the direct form II realization requires the sm allest num ber o f storages registers, and con sequ en tly, a state-sp ace realization based on the con ten ts o f the d elay elem en ts results in a m inim al realization. Sim ilarly, an F IR system realized as a direct form structure leads to a m inim al state-sp ace realization if th e valu es o f the storage registers are defined as the state variables. O n the other hand, the direct form I realization o f an IIR system d oes n ot lead to a m inim al realization. N o w , let us determ in e the im pulse resp on se o f the system from the statespace realization. T he im pulse resp onse provid es o n e o f the links betw een the in p u t-o u tp u t and state-space description o f system s. B y definition the im pulse resp onse h ( n ) o f a system is the zero-state re­ sponse o f the system to the excitation x ( n ) = 6 (n). H e n c e it can be obtained from equation (7.4.16) if w e set no = 0 (th e tim e w e apply th e input), v(0) = 0, and x ( n ) — S(n). T hus the im pulse resp onse o f the system describ ed by (7.4.19) and (7.4.20) is given by h (n) — g, Fn~ 1 q«(n — 1) + d 8(n) (7.4.28) = g '$ ( n — l)qw (n — 1 ) + d 8 ( n ) G iven a state-sp ace description, it is straightforward to d eterm in e the im pulse re­ sp on se from (7.4.28). H ow ever, the inverse is n ot easy since there is an infinite number o f state-sp ace realizations for the sam e in p u t-o u tp u t description. The transpose system. T h e transpose o f a m atrix F is ob tain ed by inter­ changing its colum ns and rows, and it is d en oted by F . F or exam p le, ■ f\N ' r /n /12 • /21 /2 2 • ■ -/v 1 fs2 f2N • fsN - F* = r /11 /21 /12 /2 2 • • • ■ /V 2 -flN flN • • f NN - fm ' N o w define the tra nspose s y s t e m (7 .4 .1 9 )-(7 .4.20) as v'tn + 1) = F v * (rt) + g x ( n ) (7.4.29) y '( n ) = q V (n ) - \-d x ( n ) (7.4.30) A ccording to (7.4.28), the im pulse resp on se o f this sy stem is given as t i ( n ) = qr(F')"-1 g«(n - 1) + d S ( n ) (7.4.31) Sec. 7.4 State-Space System Analysis and Structures 547 From m atrix algebra w e know that (F )" 1 = ( F -1 )'- H en ce h '( n ) ~ q ' ( F _ 1 ), gw(n - 1 ) + d5(n) W e claim that h'(n) = h(n). In d eed , the term q ' ( F -1 )'g is a scalar. H en ce it is eq u al to its transpose. C onsequently, [ q ' ( F - 1 )'g]' = g'(F y - ' q S ince this is true, it fo llow s that (7.4.31) is identical to (7.4.28) and, therefore, h '(n) = h (n). T hus a single in p ut-sin g le o u t p u t sy stem a n d its trans po se have i d e n ­ tical im p u lse respons es a n d h en ce the s a m e i n p u t - o u t p u t relationship. T o support this claim further, w e n ote that the type 1 and type 2 state-sp ace realizations, d escribed by (7.4.3), (7.4.4), (7.4.10), and (7.4.11) are transpose structures, which stem from the sam e in p ut-ou tp u t relationship (7.4.1). W e have introduced the transpose structure b ecau se it provides an easy m eth o d for generating a new structure. H ow ever, som etim es this new structure m ay either differ trivially or be identical to the original on e. The diagonal system. A closed -form solu tion o f the state-space equations is easily ob tain ed w hen the system m atrix F is diagonal. H en ce, by finding a m atrix P so that F = P F P - 1 is diagonal, the solu tion of the state eq u ation s is sim plified considerably. T h e d iagonalization o f the m atrix F can be accom plished by first d eterm ining the eigen valu es and eigen vectors o f the matrix. A num ber A is an eigenvalue o f F and a n on zero vector u is the associated eigen vecto r if Fu = Au (7.4.32) T o determ ine the eigen valu es o f F, w e n ote that (F - Xl)u = 0 (7.4.33) T his eq u ation has a (nontrivial) non zero solu tion u if the m atrix F - XI is singular [i.e., if (F — Al) is n oninvertible], which is the case if the determ inant o f (F — /.I) is zero, that is, if d et (F - XI) = 0 (7.4.34) This determ inant in (7.4.34) yield s the characteristic p o l y n o m i a l o f the m atrix F. For a n N x N m atrix F, the characteristic polyn om ial o f F is degree N and h en ce it has jV roots, say X,, i = 1, 2 .........N . T h e roots m ay b e distinct or som e roots m ay b e repeated. In any case, for each root A,, w e can d eterm ine a vector u (, called the eigen vector corresponding to the eigen valu e X,, from the equation FU; = X(U; T h ese eigen vectors are orthogonal, that is, uju, = 0, for i ^ j . If w e form a m atrix U w h ose colum ns consist o f the eigen vectors {u, }, that is, U = f t t Ul U2 - 1 1 t ■ ••• UjV i J 548 Implementation of Discrete-Time Systems Chap. 7 then the m atrix F = U -1 F U is diagonal. Thus w e have solved for the m atrix that diagonalizes F. T h e follow in g exam ple illustrates the procedure o f d iagon alizin g F. Example 7.4.2 The Fibonacci sequence, which is the sequence {1,1,2, 3, 5 ,8 .1 3 ....} , can be gener­ ated as the impulse response of the system that satisfies the state-space equations v ( « + 1) = j j v < n ) + j ^ J .x ( n ) y(rt) = [ 1 1 ] v ( n ) + x(n) Determine the impulse response {/»(«)} of the system. Solution Now we wish to determine an equivalent system v(n + 1) = Fv(n) + qx(n) y(n) = g'v(n) + dx(n) such that the matrix F is diagonal. From (7.4.25) we recall that the two systems are equivalent if F = PFP“' q = P? g '= g 'P " 1 Given F. the problem is to determine a matrix P such that F = PFP - 1 is a diagonal matrix. First, we compute the determinant in (7.4.34). We have d e t(F -A l) = d e t [ “ j —X — 1 = 0 or 1 + V5 2— x, = - 1 - Vs X2 = - 1 - To find the eigenvector U] corresponding to A.], we have [? °r »'=[i] Similarly, we obtain We observe that ur,u 2 = 1 + = 0 (i.e., the eigenvectors are orthogonal). Now matrix U, whose columns are the eigenvectors of F, is Then the matrix U -1FU is diagonal. Indeed, it easily follows that Xj 0 1 Sec. 7.4 State-Space System Analysis and Structures 549 and since the transformation matrix is P = U -1, we have p = __ !__ r ^ -M A.2 —A.i L—A-i 1 J Thus the diagonal matrix F has the form M o':] where the diagonal elements are the eigenvalues of the characteristic polynomial. Furthermore, we obtain _1_ vl q = Pq = L 'V 5 J and r = '3 + V s 3 - V 5 2 2 The impulse response of this equivalent diagonal system is fi(n) = g'Fqu(n - 1) +d&(n) (^K^y m u(n - 1 ) + 5(n) m which is the general formula for the Fibonacci sequence. An alternative expression can be found by noting that the Fibonacci sequence can be considered as the zero-input response of the system described by the difference equation y(n) = y(n - 1 ) + y(n - 2 ) + x (n) with initial conditions j><—1) = 1, y (—2) = —1. From the type 1 state-space realization, we note that U](0) = y { - 2 ) = - 1 and t^(0) = ;y (-l) = 1. Hence r * (° n Lt>2 (0 ) J p r ^ n Lv2 <0 )J zi 5 r - 3 + V5 n 2 3 + VS and the zero-input response is y n(") = r ^ ^ ( 0 ) (») This is the more familiar form for the Fibonacci sequence, where the first term of the sequence is zero, that is, the sequences is {0 , 1 , 1 , 2 , 3 , 5 , 8 , . . .)• 550 Implementation of Discrete-Time Systems Chap. 7 This exam ple illustrates the m eth od for diagonalizing the matrix F. The diagonal system y ield s a set o f N d ecou p led , first-order linear d ifferen ce equations that are easily solved to yield the state and the ou tp u t o f the system . It is im portant to n ote that the eigen valu es o f the matrix F are identical to the roots o f the characteristic polynom ial, which are ob tain ed from th e h om ogen eou s d ifferen ce eq u ation that characterizes the system . F or exam p le, the system that g en erates the F ibonacci seq u en ce is characterized by the h o m o g e n e o u s difference equation y(n) - y(n - I) - y{n - 2) = 0 (7.4.35) R ecall that the solu tion is ob tain ed by assum ing that the h o m o g e n e o u s solution has the form yh(n) = kn Substitution o f this solu tion into (7.4.35) yield s the characteristic polynom ial A2 - / - 1 = 0 B ut this is exactly the sam e characteristic polynom ial ob tain ed from the determ i­ nant o f (F - XI). Since the state-variable realization o f the system is not u n iq u e, the matrix F is also not unique. H ow ever, the eigen valu es o f the system are unique, that is, they are invariant to any nonsingular linear transform ation o f F. C onsequently, the characteristic polynom ial o f F can be determ in ed eith er from evaluating the determ inant o f ( F - A l ) or from the d ifferen ce eq u ation characterizing the system . In conclusion, th e state-sp ace description provides an alternative character­ ization o f the system that is eq u ivalen t to the in p u t-ou tp u t description. O n e ad­ vantage o f the state-variable form ulation is that it provid es us with the additional inform ation concerning the internal (state) variables o f the system , inform ation that is not easily ob tain ed from the in p u t-ou tp u t description. Furtherm ore, the state-variable form ulation o f a linear tim e-invariant system allow s us to represent the system by a set o f (usually cou p led ) first-order differen ce eq u ation s. T he d e­ coupling o f the eq u ation s can be ach ieved by m eans o f a linear transform ation that can b e ob tain ed by solvin g for the eigen valu es and eigen vectors o f the system . The d ecou p led eq u ation s are then relatively sim ple to solve. M ore im portant, how ever, the state-space form ulation provides a pow erful, yet straightforward m eth od for d ealing with system s that have m ultiple inputs and m ultiple ou tp u ts (M IM O ). A l­ though w e have n ot con sid ered such system s in our study, it is in the treatm ent of M IM O system s w h ere the true p ow er and the b eau ty o f the sp ace-sp ace form ula­ tion can be fully appreciated. 7.4.4 State-Space Analysis in the z-Domain T h e state-sp ace analysis in th e previous section s has b een perform ed in the time d om ain. H o w ev er, as w e have ob served previously, the analysis o f linear timeinvariant discrete-tim e system s can also b e carried ou t in the z-transform Sec. 7.4 State-Space System Analysis and Structures 551 d om ain , often w ith greater ease. In this section w e treat the state-sp ace rep­ resen tation o f linear tim e-invariant d iscrete-tim e system s in the z-transform d o ­ main. L et us con sid er the state-sp ace eq u ation v(rt + 1) = Fv(n) + <pr(n) (7.4.36) If w e define the v ecto r V (z) as * \(z ) 1 V2(z) V (z) = (7.4.37) LVV(z). then (7.4.36) can b e ex p ressed in m atrix form as zV (z) = F V (z) + q * ( z ) (7.4.38) T h e tw o term s in volving V(z) can be collected togeth er and the resulting equation can b e used to so lv e for V(z). Thus (zi - F)V(z) = q*(z) (7.4.39) V(z) = ( z I - F r V ( z ) T h e inverse z-transform o f (7.4.39) yield s the solu tion for the state equations. N ex t, w e turn our atten tion to the output eq u ation , which is given as j (n ) = g*v (n ) + d x ( n ) (7.4.40) y ( z ) = g ' V ( z ) + d X (z) (7.4.41) T h e z-transform o f (7.4.40) is B y using the solu tion in (7.4.39) w e can elim in ate th e state vector V (z) in (7.4.41). Thus w e obtain y (z ) = [g, ( z I - F ) ~ 1q + d ]X (z) w hich is the z-transform o f the zero-state resp onse o f th e system . fun ction is easily ob tain ed from (7.4.42) as H (z ) = — y = g ' ( z I - F ) - 1q + <f (7.4.42) T h e system (7.4.43) T h e state eq u ation given by (7.4.39), th e ou tp u t eq u ation given by (7.4.42) and the system function given by (7.4.43) all h ave in com m on the factor (z i — F )- 1 . This is a fun d am en tal quantity that is related to the z-transform o f the state transition m atrix o f th e system . T h e relationship is easily estab lish ed by com puting the 552 Implementation of Discrete-Time Systems Chap. 7 z-transform o f the im pulse resp on se h (n), which is g iv en by (7.4.28). T hus w e have 00 H (z) = X > (« )z ~ " n=0 oc - 1) + d i ( n ) \ z ~ n = (7.4.44) T h e term in p a ren theses in (7.4.44) can b e w ritten as 00 = z - H l + F z ” 1 + F 2 z - 2 + ---) (7.4.45) = z -H l-F z " 1)" 1 = ( z I - F ) ' 1 If w e substitute the result in (7