Author: Richard Lyons  

Tags: digital signal processing  

ISBN: 0-201-63467-8

Year: 2001

Text
                    

.
-
;

I J :
f

b':'rWIl
-""'

Understanding Digital ',.. ,
Signal Processing


Richard G. Lyons


.


PRENTICE HALL РТА


А Prentice Hall РТА PubIication
Upper Saddle River, NJ 07458
WWW.phptr.com





Many о! the designations used Ьу manufacturers and sellers to distinguish their products are c!aimed as trademarks. Where those designations appear in this book and AddisonWes!ey was aware о! а trademark c!aim, the designations have been printed with initia! capital!etters. The publisher offers discounts оп this book when ordered in quantity Еor specia! sa!es. For more information, p!ease contact: Corporate Sa!es Department Prentice НаН PТR 1 Lake Street Upper Sadd!e River, NJ 07458 Library о! Congress саtаlоgiпg-iпрuыiаtiоnn Data Lyons, Richard G., 1948 Understanding digita! signa! processing / Richard G. Lyons. р. ст. Inc!udes bibliographica! references and index. ISBN 0-2016З4678 1. Signa! processingDigita! techniques. TK5102.9.L96 1997 621.З82'2dс20 1. Tit1e. 9И8818 CIP Copyright 2001 Ву Prentice НаН PТR. АН rights reserved. No part of this publication тау Ье repro duced, stored in а retrieva! system, or transmitted, in any form or Ьу any means, e!ectronic, mechanica!, photocopying, recording, or otherwise, without the prior written permission о! the риЬ- lisher. Printed in the United States of America. Published simu! taneous!y in Canada. 02016З4678 8 9MA01 Eighth Printing, Арп! 2001 
I DEDICATION I 1 dedicate this book to ту two daughters Julie and Meredith, 1 wish 1 could go with уои; to ту mother Ruth for making те finish ту home work; to ту father Grady who didn't know what he started when he bui1t that workbench in the basementi to ту brother Ray for improving us аП; to ту brother Ken who succeeded where 1 failedi to ту sister Nancy for running interference for us; to JoOO Lennon for not giving ир; to Dr. Laura Schlessinger for keeping us honesti to ту advisor Glenn Caldwel1 and to the Iron Riders Motorcycle Club (Niles, СА) who keep те alive. Final1y to 5igi Pardula, without your keeping the place running this book wouldn't exist. 
ICONTENTSI Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi DISCRETE SEQUENCES AND SYSТEMS ........................ 1 1.1 Discrete Sequences and Тheir Notation ...................... 2 1.2 Signa! Amplitude, Magnitude, Power . . . . . . . . . . . . . . . . . . . . . . . . 8 1.3 Signa! Processing Operationa! Symbo!s .....................10 1.4 Introduction to Discrete Linear ТimeInvariant Systems . . . . . . . . 12 1.5 Discrete Linear Systerns ..................................13 1.6 ТimeInvariant Systems .................................. 18 1.7 Тhe Commutative Property о! Linear ТimeInvariant Systems .. 20 1.8 Ana!yzing Linear ТimeInvariant Systerns . . . . . . . . . . . . . . . . . . . 20 2 PERIODIC SAMPLING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 2.1 Aliasing: Signa! Ambiquity in the Frequency Domain ......... 23 2.2 Sampling LowPass Signa!s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 2.3 Sampling Bandpass Signa!s .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 2.4 Spectra1 Inversion in Bandpass Samp!ing . . . . . . . . . . . . . . . . . . . . 43 3 ТНЕ DISCREТE FOURIER TRANSFORM. . . . . . . . . . . . . . . . . . . . . . . . . 49 3.1 Understanding the DFТ Equation . .. . . . . . . . . . . . . . . . . . . . . . . .50 3.2 DFТ Symmetry. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 3.3 DFТ Linearity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 3.4 DFТ Magnitиdes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 3.5 DFТ Frequency Axis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 3.6 DFТ Shifting Тheorem ................................... 68 3.7 Inverse DFТ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 3.8 DFТ Leakage ........................................... 71 3.9 Windows. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 3.10 DFТ Scalloping Loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 3.11 DFТ Reso!ution, Zero Stиffing, and FrequencyDoтain Sampling .............................................. 89 3.12 DFТ Processing Gain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .93 3.13 Тhe DFТ о! Rectangи1ar Functions ......................... 97 3.14 Тhe DFТ Frequency Response to а Сотр!ех Input . . . . . . . . . . . 119 3.15 Тhe DFT Frequency Response to а Rea! Cosine Input . . . . . . . . . 123 3.16 Тhe DFТ Sing!eBin Frequency Response to а Rea1 Cosine Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 vii 
viii Uпderstaпdiпg D/gita/ Sigпa/ Processiпg 4 ТНЕ FAST FOURIER TRANSFORM ............................ 129 4.1 Re!ationship о! the FFТ to the DFТ . . . . . . . . . . . . . . . . . . . . . . . . 130 4.2 Hints оп Using FFTs in Practice . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 4.3 FFТ Software Programs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 4.4 Derivation о! the Radix2 FFТ A!gorithm . . . . . . . . . . . . . . . . . . . 136 4.5 FFT Input/Output Data Index Bit Reversa! . . . . . . . . . . . . . . . . . 145 4.6 Radix2 FFТ Butterf1y Structures . . . . . . . . . . . . . . . . . . . . . . . . . . 146 5 FINITE IMPULSE RESPONSE FILTERS . . . . . . . . . . . . . . . . . . . . . . . . . . 157 5.1 An Introduction to Finite Impu!se Response FIR Filters . . . . . . . 158 5.2 Convo!ution in FIR Filters ............................... 163 5.3 LowPass FIR Fi1ter Design ..............................174 5.4 Bandpass FIR Fi1ter Design ..............................191 5.5 Highpass FIR Filter Design ..............................193 5.6 Remez Exchange FIR Fi1ter Design Method . . . . . . . . . . . . . . . . . 194 5.7 Ha1fBand FIR Fi!ters ...................................197 5.8 Phase Response о! FIR Filters ............................199 5.9 А Generic Description of Discrete Convo!ution . . . . . . . . . . . . . . 204 6 INFINITE IMPULSE RESPONSE FILTERS. . . . . . . . . . . . . . . . . . . . . . . .219 6.1 An Introduction to Infinite Impulse Response Fi1ters .........220 6.2 The Lap!ace Transform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223 6.3 'Пlе zTransform .......................................238 6.4 Impu!se Invariance IIR Filter Design Method. . . . . . . . . . . . . . . . 254 6.5 Bilinear Transform IIR Fi!ter Design Method . . . . . . . . . . . . . . . . 272 6.6 Optimized IIR Filter Design Method . . . . . . . . . . . . . . . . . . . . . . . 284 6.7 Pitfalls in Bui!ding IIR Digita! Filters. . . . . . . . . . . . . . . . . . . . . . . 286 6.8 Cascade and Paralle! Combinations о! Digita! Filters .. . . . . . . . 290 6.9 А Brief Comparison о! IIR and FIR Filters .................. 292 7 ADVANCED SAMPLING TECHNIQUES ...................... 297 7.1 Quadrature Sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .297 7.2 Quadrature Samp!ing with Digita! Мixing . . . . . . . . . . . . . . . . . . 301 7.3 Digita! Resampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303 8 SIGNAL AVERAGING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .319 8.1 Coherent Averaging ....................................320 8.2 Incoherent Averaging .......... . . . . . . . . . . . . . . . . . . . . . . . . . 327 8.3 Averaging Multip!e Fast Fourier Transforms . . . . . . . . . . . . . . . . 330 8.4 Filtering Aspects о! TimeDomain Averaging . . . . . . . . . . . . . . . . 340 8.5 Exponentia! Averaging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .341 
Coпteпts 9 DIGITAL DATA FORMATS AND THEIR EFFECTS . . . . . . , , , . , . , . .349 9.1 FixedPoint Binary Formats , . . . , . . , . , , . . . . . . . . . , . . . , . , . . . 349 9.2 Binary Number Precision and Dynarnic Range '........, , . , .356 9,3 Effects о! Finite FixedPoint Binary Word Length ..,...,.,... 357 9.4 F!oatingPoint Binary Formats . . . . . . , . . . . . . , , . , , . , . , . , . , , . 375 9.5 B!ock F!oatingPoint Binary Format. . . , . . . . . , . . . . . , . . . , . . , . 381 10 DIGITAL SIGNAL PROCESSING TRICKS '.'.'.'.'...".'..'..385 10.1 Frequency Trans!ation without Mu!tiplication . , . . , , . . . , . , . . . 385 10.2 HighSpeed VectorMagnitude Approximation . , , . , . . . . . . . . , 400 10,3 Data Windowing Tricks ".........,...,........"....... 406 10.4 Fast Multip!ication of Сотр!ех Numbers . , . , . . . . , . . . , . , . , , .411 10.5 Efficient!y Performing the FFТ о! Rea! Sequences , . , . . , , , . . . , 412 10.6 Calculating the Inverse FFТ Using the Forward FFТ . . . , , . , , , . 425 10.7 Fast FFТ Averaging . . , . , . . . . . . . . . , . . . , . , . . . . . , , . . . . . , , . , 429 10.8 Simp!ified FIR Fi!ter Structure . , . . . . . . . . . , . . . , . . , . , . , . . . . , 430 10.9 Accurate A/D Converter Testing Technique ."..'.".......432 10.10 Fast FIR Fi!tering Using the FFТ. . . , . . . , . . . . . . . . . , . . . , , . . . ,435 10.11 Calcu!ation о! Sines and Cosines о! Consecutive Ang!es ......436 10.12 Generating Normally Distributed Random Data . . , . . . , . , . . . . 438 APPENDIX А. ТНЕ ARITHMETIC OF COMPLEX NUMBERS ..,..,...., 443 А.1 Graphica! Representation о! Rea! and Сотр!ех Numbers . , , . , 443 А.2 Arithmetic Representation о! Сотр!ех Numbers ,........... 444 А.З Arithmetic Operations о! Сотр!ех Numbers '..,......,..,. 446 А.4 Some Practica! Imp!ications о! Using Сотр!ех Numbers . , . . , . 453 APPENDIX В. CLOSED FORM OF А GEOMEТRIC SERIES , . . . . , . . . . . . 455 APPENDIX С. COMPLEX SIGNALS AND NEGATIVE FREQUENCY. . , . 458 с.1 Deve!opment о! Imaginary Numbers . . , . . . . , , . , . . . , . , . , . . ,460 с.2 Representing Rea! Signa!s Using Сотр!ех Phasors , , . . . , . , . , . 462 с.3 Representing Rea! Signa!s Using Negative Frequencies .,...., 467 с.4 Сотр!ех Signa!s and Quadrature Mixing. , . . , , . . , . . , , , . , . . , 471 APPENDIX D. MEAN, VARIANCE, AND STANDARD DEVIATION ....'476 D.1 Statistica! Measures . . . . . , . , . . . , . . . , . , . , . . . , . . , . , , . , . , . . . 476 D.2 Standard Deviation, or RMS, о! а Continuous Sinewave ..,.., 480 D.3 Тhe Mean and Variance о! Random Functions . , . , , . , . . , . , , . , 481 D.4 Тhe Norma! Probabi!ity Density Function ., , . . , . , , . . , . . , . . . 484 
х Uпderstaпdiпg Digital Sigпal Processiпg APPENDIX Е. DECIBELS (dB AND dBm) ...........................486 Е.l Using Logarithms to Determine Relative Signa! Power ....... 486 Е.2 Some Usefu! Decibe! Numbers ........................... 492 Е.3 Absolute Power Using Decibels . . . . . . . . . . . . . . . . . . . . . . . . . . . 493 APPENDIX F. DIGITAL FILTER TERMINOLOGY . . . . . . . . . . . . . . . . . . . . . . . 494 Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .507 
I PREFACE I Learning Digital Signal Processing Learning the fundашеntа1s, and how to speak the language, of digital sig nal processing does not require profound analytical skills or an extensive background in mathematics. АН уои need is а litt1e experience with ele mentary algebra, knowledge of what а sinewave is, this book, and enthu siasm. This тау sound hard to believe, particularly if you've just f1ipped through the pages of this book and seen figures and equations that appear rather complicated. The content here, уои say, looks suspiciously like the material in technical journals and textbooks, material that is difficu1t to understand. Wel1, this is not just another book оп digital signal processing. This book's goal is to gent1y provide explanation fol1owed Ьу illUstra tion, not so that уои тау understand the material, but that уои must Ul1derstand the material.+ Remember the first time уои saw two people playing chess? The game probably appeared to Ье mysterious and con fusing. As уои now know, по individual chess move is complicated. Given а litt1e patience, the various chess moves are easy to learn. The game's complexity comes from deciding what combinations of moves to make and when to make them. 50 it is with understanding digital signal processing. First we learn the fundamental rиles and processes and, then, practice using them in combination. If learning digital signal processing is so easy, then why does the sub ject have the reputation of being difficult to understand? The answer lies partial1y in how the material is typical1y presented in the literatиre. It's difficult to convey technical information, with its mathematical subtleties, in written form. It's one thing to write equations, but it's another matter altogether to explain what those equations really теan from а practical standpoint, and that's the goal of this book. Тоо often, written explanation of digital signal processing theory appears in one of two forms: either mathematical miracles occиr and уои are simply given а short and swect equation without fиrther explanation, or уои are engulfed in а flood of complex variable equations and phrases t "Here we have the opportиnity of expounding more clearly what has already Ьееп said" (Rene Descartes). xi 
xii Uпderstaпdiпg D/g/ta/ Sigпa/ Processiпg such as "it is obvious that," "such that W(f) ;:: о V f," and "with judicious application of the homogeneity property." Authors usually do provide the needed information, but, too often, the reader must grab а pick and shovel, put оп а miner's helmet, and try to dig the information out of а moиntain of mathematical expressions. (This book presents the resu1ts of several fruitfиl mining expeditions.) How many times have уои followed the derivation of an equation, after which the author states that he or she is going to illustrate that equation with а physical exampleand this tиrns out to Ье another equation? A1though mathematics is necessary to describe digital signal processing, I've tried to avoid overwhelming the reader because а recipe for technical writing that's too rich in equations is hard for the beginner to digest.+ The intent of this book is expressed in а popular quote from Е. В. White in the introduction of his Elemeпts о! Style (New York: Macmillan Publishing,1959): Will (Strunk) felt that the reader was in serious trouble most о! the time, а тап f10undering in а swamp, and that it was the duty оЕ any one attempting to write English to drain the swamp quickly and get his man ир оп dry ground, or at least throw him а rope. I've attempted to avoid the traditional instructorstudent relationship, but, rather, to make reading this book like talking to а friend while walk ing in the park. I've used just enough mathematics to develop а fиnda mental understanding of the theory, and, then, illustrate that theory with examples. The Journey Learning digital signal processing is not something уои accomplish; it's а joиrney уои take. When уои gain an understanding of some topic, ques tions arise that cause уои to investigate some other facet of digital signal processing. Armed with more knowledge, you're likely to begin exploring fиrther aspects of digital signal processing much like those shown in the following diagram. Тhis book is yoиr toиr guide dиring the first steps of yoиr journey. You don't need а computer to learn the material in this book, but it would help. Digital signal processing software allows the beginner to ver t "We need elucidation of the obvioиs more than investigation of the obscure" (Oliver Wendell Holmes). 
Preface xiii Perlodic sampllng How сап the spectra 01 sampled signals Ье analyzed? How сап the effective sample rates 01 discrete signals Ье changed? How сап spectral noise Ье reduced (о enhance signal "' \ How сап the noise reduction еНесш 01 averaging Ье analyzed? Signal averaglng Figure P-l Ну signal processing theory through trial and error.+ In particular, soft ware routines that plot signal data, perform the fast Fourier transform, and analyze digital fi1ters would Ье very usefиl. As уои go through the material in this book, don't Ье discouraged if your иnderstanding comes slowly. As the Greek mathematician Menaechmus t "One mиst learn Ьу doing the thing; for though you think you know it, you have по cer tainty until you try it" (Sophocles). 
xiv Uпderstaпdiпg Digita/ Sigпa/ Processiпg curt1y remarked to Alexander the Great, when asked for а quick explana tion of mathematics, "There is по royal road to mathematics." Menaechmus was confident in telling Alexander that the only way to learn mathematics is through carefиl study. The same applies to digital signal processing. Also, don't worry if уои have to read some of the material оосе. While the con cepts in this book are not as complicated as qиantum physics, as mysteri ous as the lyrics of the song "Louie Louie," or as puzz1ing as the assembly instructions of а metal shed, they do get а litt1e involved. They deserve yoиr attention and thought. 50 go slow and read the material twice if уои have to; уои'Н Ье glad уои did. If уои show persistence, to quote а phrase from 5usan В. Anthony, "Pai1иre is impossible." Coming Attractions Chapter 1 of this book begins Ьу establishing the notation used through out the remainder of oиr study. In that chapter, we introduce the concept of discrete signal sequences, show how they relate to continuous signals, and Шиstrаtе how those sequences сап Ье depicted in both the Нте and frequency domains. In аddШоn, Chapter 1 defines the operational sym bols we'll use to build our signal processing system block diagrams. We conclude that chapter with а brief introduction to the idea of linear sys tems and see why linearity enables us to use а number of powerful math ematical tools in oиr analysis. Chapter 2 introduces the most frequent1y misиnderstood process in digital signal processing, periodic sampling. A1though it's straightfor ward to grasp the concept of sampling а continuous signal, there are mathematical subtleties in the process that require thoughtful attention. Beginning gradually with simple examples of lowpass sampling and progressing to the interesting subject of bandpass sampling, Chapter 2 explains and quantifies the frequencydomain ambiguity (aliasing) asso ciated with these important topics. The discussion there high1ights the power and pitfalls of periodic sampling. Chapter 3 is devoted to one of the foremost topics in digital signal pro cessing, the discrete Foиrier transform (DFT). Coverage begins with detailed examples illustrating the important properties of the DFT and how to interpret DFT spectral resu1ts, progresses to the topic of windows used to reduce DFТ leakage, and discusses the processing gain afforded Ьу the DFТ. The chapter concludes with а detailed discussion of the vari ous forms of the transform of rectangular fиnctions that the beginner is likely to encoиnter in the literature. That last topic is included there to clarify and illustrate the DFТ of both real and complex sinusoids. 
Preface xv Chapter 4 covers the innovation that made the most profoиnd impact оп the field of digital signal processing, the fast Fourier transform (FFТ). Тhere we show the relationship of the popular radix2 FFТ to the DFТ, quantify the powerful processing advantages gained Ьу using the FFТ, demonstrate why the FFT fиnctions as it does, and present various FFT implementation structures. Chapter 4 also includes а list of recommenda tions to help us when we use the FFТ in practice. Chapter 5 ushers in the subject of digital fi1tering. Beginning with а simple lowpass finite impulse response (FIR) filter example, we care fully progress through the analysis of that fi1ter's frequencydomain magnitude and phase response. Next we learn how window functions affect and сап Ье used to design FIR fi1ters. The methods for converting lowpass FIR fi1ter designs to bandpass and highpass digital fi1ters are presented, and the popular Remez Exchange (Parks McClellan) FIR ш ter design technique is introduced and illustrated Ьу example. In that chapter we acquaint the reader with, and take the mystery out of, the process called convolution. Proceeding through several simple convolu tion examples, we conclude Chapter 5 with а discussion of the powerful convolution theorem and show why it's so useful as а qualitative tool in understanding digital signal processing. Chapter 6 introduces а second class of digital fi1ters, infinite impulse response (ПR) fi1ters. In discussing several methods for the design of ПR fi1ters, the reader is introduced to the powerful digital signal pro cessing analysis tool called the ztransform. Because the ztransform is so closely related to the continuous Laplace transform, Chapter 6 starts Ьу gently guiding the reader from the origin, through the properties, and оп to the utility of the Laplace transform in preparation for learn ing the ztransform. We'll see how IIR fi1ters are designed and imple mented, and why their performance is so different from FIR fi1ters. То indicate under what conditions these fi1ters should Ье used, the chap ter concludes with а qualitative comparison of the key properties of FIR and ПR fi1ters. Chapter 7 discusses two important advanced sampling techniques prominent in digital signal processing, quadrature sampling and digital resampling. In the chapter we discover why quadrature sampling is so useful when signal phase must Ье analyzed and preserved, and how this special sampling process сan circumvent some of the limitations of tradi tional periodic sampling techniques. Our introduction to digital resam pling shows how we сап, and when we should, change the effective sample rate of discrete data after the data has already been digitized. We've delayed the discussion of digital resampling to this chapter 
xvi Uпderstaпd/пg D/gita/ Sigпa/ Processiпg because some knowledge of lowpass digital filters is necessary to under stand how resampling schemes operate. Chapter 8 covers the important topic of signal averaging. There we learn how averaging increases the accuracy of signal measurement schemes Ьу reducing measurement background noise. This accuracy enhancement is called processing gain, and the chapter shows how to pre dict the processing gain associated with averaging signals in both the time and frequency domains. In addition, the key differences between coherent and incoherent averaging techniques are explained and demonstrated with examples. То complete the chapter, the popular scheme known as exponential averaging is covered in some detai1. Chapter 9 presents an introduction to the various binary nиmber for mats that the reader is likely to encounter in modern digital signal pro cessing. We establish the precision and dynamic range afforded Ьу these formats along with the inherent pitfalls associated with their use. Our exploration of the critical subject of binary data word width (in bits) natu rally leads us to а discussion of the nиmerical resolution limitations of ana log to digital (A/D) converters and how to determine the optimиm A/D converter word size for а given application. Тhe problems of data value overflow roиndoff errors are covered along with а statistical introduction to the two most popular remedies for overflow, truncation and roиnding. We end the chapter Ьу covering the interesting subject of floatingpoint binary formats that allow us to overcome most of the limitations induced Ьу fixedpoint binary formats, particularly in reducing the ill effects of data overflow. Chapter 10 provides а collection of tricks а! the trade that the profes sionals often use to make their digital signal processing algorithms more efficient. Тhose techniques are compiled into а chapter at the end of the book for two reasons. First, it seems wise to keep our collection of tricks in one chapter so that we'll know where to find them in the future. Second, таnу of these schemes require an understanding of the material from the previous chapters, so the last chapter is an appropriate place to keep our collection of clever tricks. Exploring these techniques in detail verifies and reiterates many of the important ideas covered in previous chapters. The appendices include а nиmber of topics to help the beginner иnder stand the mathematics of digital signal processing. А comprehensive description of the arithmetic of complex numbers is covered in Appendix А, while Appendix В derives the often used, but seldom explained, closed form of а geometric series. Appendix С strives to clarify the troubling top ics of complex signals and negative frequency. The statistical concepts of 
Preface xvi mean, variance, and standard deviation are introduced and illustrated in Appendix D, and Appendix Е provides а discussion of the origin and util ity of the logarithmic decibel scale used to improve the magnitude reso lution of spectral representations. In а slight1y different vein, Appendix F provides а glossary of the terminology used in the field of digital filters. Acknowledgments How do 1 sufficient1y thank the people who helped те write this book? 1 do this Ьу stating that any quality existing herein is due to the following talented people: for their patient efforts in the unpleasant task of review ing early versions of the manuscript, 1 ат gratefиl to Sean McCrory, Paul Chestnut, Paul Капе, John Winter, Terry Daubek, and Robin Wiprud. Special thanks go to Nancy Silva for her technical and literary guidance, and encouragement, without which this book would not have been writ ten. For taking time to help те understand digital signal processing, 1 thank Frank Festini, Harry Glaze, and Dick Sanborn. 1 owe уои people. Gratitude goes to the reviewers, under the auspices of Addison Wesley, whose suggestions improved much of the material. They are Mark Sullivan, David Goodman, Satyanarayan Namdhari, James Kresse, Ryerson Gewa1t, David Cullen, Richard Herbert, Мaggie Carr, and anony mous at A1catel ВеН. Finally, (acknowledge ту good fortune in being аЫе to work with those talented folks at Addison Wesley: Rosa Aimee Gonzalez, Simon Yates, and Tara Herries. If you're still with те this far into the Preface, 1 end Ьу saying that 1 had а ЬаН writing this book and hope уои get some value out of reading it.
CHAPTER ONEI ';:'1" ".J:,I Discrete Sequences and Systems Digital signal processing has never been more prevalent or easier to per- form, It wasn't that long ago when the fast Fourier transform (РРТ), а topic we'll discuss in Chapter 4, was а mysterious mathematical process used only in industrial research centers and universities. Now, amazingly, the РРТ is readily ауаНаЫе to us аll. It's even а bui1t-in function provided Ьу inexpensive spreadsheet software for home computers, The availabil ity of more sophisticated commercial signal processing software now allows us to analyze and develop complicated signal processing app1ica- tions rapidly and re1iably, We сап now perform spectral analysis, design digital fi1ters, develop voice recognition, data communication, and image compression processes using software that's interactive in both the way algorithms are defined and how the resulting data are graphically dis- played, Since the mid-1980s the same integrated circuit technology that led to affordable home computers has produced powerful and inexpen- sive hardware development systems оп which to implement our digital signal processing designs. t Regardless, though, of the ease with which these new digital signal processing development systems and software сап Ье applied, we still need а so1id foundation in understanding the basics of digital signal processing, The purpose of this book is to build that foundation, In this chapter we'l1 set the stage for the topics we'll study throughout the remainder of this book Ьу defining the tепninоlоgу used in digita1 signal t During а television interview in the early 1990s, а leading computer scientist stated that had automobile technology made the same strides as the computer industry, we'd аН have а car that would go а ha1f million miles per hour and get а ha1f million miles per gaHon, Тhe cost of that car would Ье so low that it would Ье cheaper to throw it away than рау for оnе day's parking in San Francisco, 
2 Discrete Sequeпces aпd Systeтs processing, illustrating the various ways of graphically representing discrete signals, estab1ishing the notation used to describe sequences of data values, presenting the symbols used to depict signal processing operations, and briefly introducing the concept of а linear discrete system, 1.1 Discrete Sequences and Their Notation In general, the term sigпal processiпg refers to the science of analyzing timevarying physical processes, As such, signal processing is divided into two categories, analog signal processing and digital signal process- ing, The term aпalog is used to describe а waveform that's continuous in time and сап take оп а continuous range of amplitude values. An ехат- ple of an analog signal is some voltage that сап Ье applied to an oscillo- scope resulting in а continuous display as а function of Нте. Analog signals сап also Ье applied to а conventional spectrum analyzer to deter- mine their frequency content. The term aпalog appears to have stemmed from the analog computers used prior to 1980. Тhese computers solved linear differential equations Ьу means of connecting physical (electronic) differentiators and integrators using old-style telephone operator patch cords, That way, а continuous voltage or currentin the actual circuit was aпalogous to some variable in а differential equation, such as speed, tem perature, air pressure, etc. (Although the flexibility and speed of modem day digital computers have since made analog computers obsolete, а good description of the short-lived utility of analog computers сап Ье found in reference [1],) Because present-day signal processing of continu- ous radio-type signals using resistors, capacitors, operational amplifiers, etc., has nothing to do with analogies, the term aпalog is actually а mis nomer, The more correct term is coпtiпuous sigпal processiпg for what is today so commonly called analog signal processing, As such, in this book we'll minimize the use of the term aпalog sigпals and substitute the phrase coпtiпuous sigпals whenever appropriate. The term discrete-tiтe sigпal is used to describe а signal whose inde- pendent time variable is quantized so that we know only the value of the signal at discrete instants in time. Тhus а discrete-time signal is not repre- sented Ьу а continuous waveform but, instead, а sequence of values, In addition to quantizing time, а discrete-time signal quantizes the signal amplitude, We сап il1ustrate this concept with an example. Think of а con- tinuous sinewave with а peak amplitude of 1 at а frequency 10 described Ьу the equation хи) = sin(21tfot) . (Н) 
Discrete Sequeпces aпd Their Notatioп 3 Тhe frequency 10 is measured in hertz (Нz), (In physical systems, we usu- аllу measure frequency in units of hertz, One Hz is а single oscillation, or cycle, per second, One ki10hertz (kHz) is а thousand Hz, and а megahertz (MHz) is one million Hz,t) With t in Eq, 1-1 representing time in seconds, the lot factor has dimensions of cycles, and the complete 2rtfot term is an angle measured in radians, Plotting Eq, (1-1), we get the venerable continuous sinewave curve shown in Figure 11(a), If our continuous sinewave represents а physical vo1tage, we could sarnple it once every t s seconds using an analogto-digital converter and represent the sinewave as а sequence of discrete values. Plotting those individual values as dots would give us the discrete wave form in Figure 11(b), We say that Figure 1-1(Ь) is the "discretetime" ver sion of the continuous signal in Figure 11(a), Тhe independentvariable t in Eq, (1-1) and Figure 11(a) is continuous. Тhe independent index variable п in Figure 1-1(Ь) is discrete and сап have only integer values, Тhat is, index п is used to identify the individual elements of the discrete sequence in Figure И(Ь). Do not Ье tempted to draw lines between the dots in Figure 11(b). For some reason, people (particularly those engineers experienced in working with continuous signals) want to connect the dots with straight lines, or the stairstep 1ines shown in Figure 1-1(с). Don't faH into this innocent looking trap, Connecting the dots сап mislead the beginner into forgetting that the х(п) sequence is nothing more than а list of numbers, Remember, х(п) is а discrete-time sequence of individual values, and each value in that sequence plots as а single dot, It's not that we're ignorant of what 1ies between the dots of х(п); there is nothing between those dots, We сan reinforce this discretetime sequence concept Ьу 1isting those Figure 1-1(Ь) sampled values as follows: х(О) = О х(1) = 0.31 х(2) = 0,59 х(3) = 0.81 (1st sequence value, index п = О) (2nd sequence value, index п = 1) (3rd sequence value, index п = 2) (4th sequence value, index п = 3) and so оп, (1 2) t The dimension for frequency used to Ье cycles/second; that' s why the tuning dials of old radios indicate frequency as kilocycles/second (kcps) or megacycles/second (Mcps). In 1960 the scientific community adopted hertz as the unit of measure for frequency in honor of the German physicist, Heinrich Hertz, who first demonstrated radio wave transmission and reception in 1887, 
4 Discrete Sequeпces aпd Systeтs Con!;nous х(  0.5 (а) О .5 1 Continuous time variabIe, t (Ь) j Dlscre!e х(п) )«7) _t time 7t s seconds 1 ._."../ .8. . ...... . . . 05 .. . 1113151719 313335 0 j . I I 11 11 1 1 1 . 11 11 1 1 11 1 . 11 1 1 I 1 11 1 . 11 11 I 13579 212з252729 .. . 5 .. . . . . 1 _.а 8. ..........-Jo1! t s 37 39 1 1 ......... Oiscrete time · index, п (е) ........ Discrete time index, п Figure 1-1 А time-doтoin sinewove: (а) eontinuous woveform representotion; (Ь) diserete sample representotion; (е) dlserete somples wlth eonneetlng iines, where п represents the time index integer seqиence О, 1, 2, 3, etc., and t s is some constant time period, Those sample valиes сап Ье represented col lectively, and concisely, Ьу the discrete-time expression х(п) = sin(21tfoпts) . (lЗ) (Here again, the 21tfoпts term is ап angle measиred in radians.) Notice that the index п in Eq, (1-2) started with а valиe of О, instead of 1. There's noth- ing sacred aboиt this; the first valиe of п coиld jиst as wel1 have Ьееп 1, bиt we start the index п at zero oиt of habit becaиse doing so al10ws иs to 
Discrete Sequeпces aпd Their Notatioп 5 х(О), х(1), х(2), х(З), ' , , Discrete у(О), у(1), у(2), у(З), ,"  (а) System (Ь) х(п) Discrete  у(п) System Flgure 1-2 With an input applled, а discrete system provldes an output: (а) the Input and output are sequences of Indivldual values; (Ь) Input and output using the abbreviated notation of х(п) and у(п), describe the sinewave starting at time zero. The variable х(п) in Eq, (13) is read as "the sequence х of п." Equations (11) and (13) describe what are a1so referred to as tiтedoтain signals because the independent variables, the continuous time t in Eq. (11), and the discrete-time nt s values used in Eq. (13) are measures оЕ time. With this поНоп of а discretetime signal in mind, let's say that а dis crete system is а соllесНоп of hardware components, or software routines, that operate оп а discretetime signal sequence. For example, а discrete system could Ье а process that gives us а discrete output sequence у(О), у(l), у(2), etc" when а discrete input sequence of х(О), х(l), х(2), etc., is applied to the system input as shown in Figure 12(a), Again, to keep the notation concise and still keep track of individual elements of the input and output sequences, ап abbreviated notation is used as shown in Figure 12(b) where п represents the integer sequence 0,1,2,3, etc, Thus, х(п) and у(п) are general variables that represent two separate sequences of nит bers, Figure 12(b) allows us to describe а system's output with а simple expression such as у(п) = 2х(п)  1 , (1-4) Шustrаting Eq. (14), if х(п) is the fiveelement sequence: х(О) = 1, х(l) = 3, х(2) = 5, х(3) = 7, and х(4) = 9, then у(п) is the fiveelement sequence у(О) = 1, у(l) = 5, у(2) = 9, у(3) = 13, and у( 4) = 17, The fundamental difference between the way time is represented in continuous and discrete systems leads to а very important difference in how we characterize frequency in continuous and discrete systems, То illustrate, let's reconsider the continuous sinewave in Figure ll(a). If it represented а vo1tage at the end of а саЫе, we could measure its 
6 Discrete Sequeпces aпd Systeтs frequency Ьу applying it to an oscilloscope, а spectrum analyzer, or а fre qиency coиnter, We' d have а problem, however, if we were merely given the list of valиes from Eq. (1-2) and asked to determine the freqиency of the waveform they represent. We' d graph those discrete valиes, and, sure enough, we'd recognize а single sinewave as in Figure 1-1(Ь). We сап say that the sinewave repeats every 20 samples, bиt there's по way to deter- mine the exact sinewave freqиency from the discrete seqиence valиes alone, Уои сап probably see the point we're leading to 11ere, If we knew the time between samplesthe sample period tswe'd Ье аЫе to deter- mine the absolиte freqиency of the discrete sinewave, Given that the t s sample period is, say, 0,05 mil1iseconds/sample, the period of the sinewave is , ' d 20 samples 0,05 milliseconds 1 ' 11 ' d sшеwаvе реrю = .  тl lsecon, (1-5) period sample Веса иse the freqиency of а sinewave is the reciprocal of its period, we now know that the sinewave's absolиte freqиency is 1/(1 ms), or 1 kНz, on the other hand, if we found that the sample period was, in fact, 2 milliseconds, the discrete samples in Figure 1-1(Ь) woиld represent а sinewave whose period is 40 mil1iseconds and whose freqиency is 25 Hz, The point here is that, in discrete systems, absolиte freqиency dеtепrunаtiоп in Hz is depen- dent оп the sample freqиency fs = 1/ t s ' We'l1 ье reminded of this dependence throughoиt the rest of this book. In digital signal processing, we often find it necessary to characterize the freqиency content of discrete-time domain signals, When we do so, this freqиency representation takes place in what's called the frequency doтain, Ву way of example, let's say we have а discrete sinewave sequence х 1 (п) with an arbitrary freqиency fo Hz as shown оп the left side of Figure 1-3(а). We сап also describe х 1 (п) as shown оп the right side of Figиre 1-3(а) Ьу indicating that it has а freqиency of 1, measиred in иnits offo' and по other freqиency content. Althoиgh we won't dwell in it jиst now, notice that the freqиency-domain representations in Figure 1-3 are themselves discrete, То illиstrate our time- and frequency-domain representations further, Figure 1-3(Ь) shows another discrete sinewave х 2 (п), whose peak атрН- tиde is 0,4, with а freqиency of 2fo, The discrete sample valиes of xz{n) are expressed Ьу the eqиation х 2 (п) = 0.4 . sin(21t2fonts) , (1-6) 
Diserete Sequeпees aпd Their Notatioп 7 J, : .. : ::: ... ' ::: . . : . ain t .., " .,.20 25 зо (а) О j . /l11 11 1111/1/1 1" /1 , /1/1 11 /l11! .. 5 10 15.' :aTime(n) . . .5 .. . . . . 1 .....  Х2 (п) in the time domain 0.5 ...8. ..... . ' . 10 15 . . 25 зо (Ь) О j++H-t++.+++++t+.++++н+. 11 1 1 1 11 .. 1 5 ....... 20 ....... Time (п) ...{).5 j х sum (п) . ;" . the tlme domain 1.5 . .-. 1 . 8. . . 0.5 . : - е.. 20 25 за (с) О 1 . 11/1 11 [ 111/1 1 " .oi ol 11 1 .. ' 1 '. ' 1 .... 11/1 .. . 1 '. 11  5 10 15 8' , ' .". Tlme (п) ,5 . . ; ; ; ; . . - Ii 1 ..... 1.5 j х,(т) amplltude in the trequency domain 1 . 0.5 ' О ........-+-----.I!I \. ..,. о 'о 2fo Зf о 4fo 510 Frequency r Х2(т) amplitude in the 1 trequency domain 0.5 . 04 О .Ii"""""""'.Ii1i l .... о  2fo Зf о 4fo 5'0 Frequency j X"m(т) aтpli1ude 1" the 1. frequency dоmаlП 05 o....  .... о 'о 2 Зf о 4 510 Frequency Figure 1-3 Time- ond frequency-domoin graphleol representotions: (о) sinewove of frequeney fo: (Ь) reduced ompiitude sinewove of frequency 2fo: (е) sum of the юо sinewoves, When the two sinewaves, x1(n) and х 2 (п), are added to produce а new waveform xsum(n), its time-domain equation is Xsum(n) = x1(n) + х 2 (п) = sin(21tfont.} + 0,4 . sin(21t2font s ) , (1-7) and its time- and frequency-domain representations are those given in Figure 13(c), We interpret the Xsum(m) frequency-domain depiction, the spectrum, in Figure 1-3(с) to indicate that Xsum(n) has а frequency сотро- nent of 10 Hz and а reducedamplitude frequency component of 210 Hz, Notice three things in Figure 1-3, First, time sequences use lowercase variable names like the "х" in x1(n), and uppercase symbols for frequency domain variables such as the "Х" in X1(m), The term X1(m) is read as "the spectral sequence Х sub one of т," Second, because the X 1 (т) frequency domain representation of the x1(n) time sequence is itse1f а sequence (а list 
8 D/screte Sequeпces aпd Systeтs of numbers), we use the index "т" to keep track of individual elements in Х 1 (т), We can list frequency-domain sequences just as we did with the time sequence in Eq, (1-2), For example Хэит(т) is listed as Хэит(О) = О Х эит (1) = 1,0 Х эит (2) = 0.4 Х эит (3) = О (1st Хэит(т) value, index т = О) (2nd Хэит(т) value, index т = 1) (3rd Хэит(т) value, index т = 2) (4th Хэит(т) value, index т = 3) and so оп, where the frequency index т is the integer sequence 0,1,2,3, etc. Тhird, because the х 1 (п) + х 2 (п) sinewaves have а phase shift of zero degrees rel ative to each other, we didn't really need to bother depicting this phase relationship in Хэит(т) in Figure 1-3(с), In genera1, however, phase rela- tionships in frequency-domain sequences are important, and we'll cover that subject in Chapters 3 and 5, А key point to keep in mind here is that we now know three equivalent ways to describe а discrete-time waveform, Mathematically, we can use а time-domain equation like Eq. (1-6) for example. We can also represent а time-domain waveform graphically as we did оп the left side of Figure 1-3, and we can depict its correspondin discrete, frequency-domain equiva- lent as that оп the right side of Figure 1-3. As it turns out, the discrete-time domain signals we're concemed with are not only quantized in time; their amp1itude values are also quantized. Because we represent аН digital quantities with binary numbers, there's а limit to the resolution, or granularity, that we have in representing the val- ues of discrete numbers, Although signa1 amplitude quantization can Ье an important considerationwe cover that particular topic in Chapter 9 we won't worry about it just now. 1.2 Signal Amplitude, Magnitude, Power Let' s define two important terms that we'H Ье using throughout this book: amplitude and magnitude. It's not surprising that, to the layman, these terrns are typically used interchangeably, When we check our thesaurus, we find that they are synonymous. t In engineering, however, they mean t Of course, layman are "other people," То the engineer, the brain surgeon is the layman, То the brain surgeon, the engineer is the layman. 
Sigпa/ Amplitude, Magпitude, Power 9 i I I I I I Flgure 1-4 Mognitude somples, I xj(п) 1, of the time woveform in Flgure 1-3(0). j IX 1 (n ",, )1 1 """'..... . . . . 0.5 · : ;  : : '  : i! i, '1 0 1 . 111111111111 5 10 O,5 ..... . . . . .' . . .   i ' . II I! i 11 i I i I i 11111 i ...... 15 20 25 30 Time (n) two different things, and we must keep that difference clear in our dis- cussions, Тhe amplitude of а variable is the measure of how far, and in what direction, that variable differs from zero. Thus, signal amplitudes сап Ье either positive or negative, The time-domain sequences in Figure 1-3 presented the sample value amplitudes of three different waveforms, Notice how some of the individual discrete amplitude values were posi tive and others were negative, The magnitude of а variable, оп the other hand, is the measure of how far, regardless of direction, its quantity differs from zero, 50 magnitudes are always positive values, Figure 1-4 illustrates how the magnitude of the x1(n) time sequence in Figиre 1-3(а) is equal to the amplitude, but with the sign always being positive for the magnitude. We use the modulus symbol (1 1) to represent the magnitude of x 1 (п), Occasionally, in the 1iter ature of digital signal processing, we'll find the term magnitude referred to as the abso/ute va/ue, When we examine signals in the frequency domain, we'll often Ье interested in the power level of those signals, The power of а signal is pro- portional to its amplitude (or magnitude) squared, If we assume that the proportionality constant is опе, we сап express the power of а sequence in the time or frequency domains as xpw/n) = х(п)2 = I х(п) 12 , (1-8) or Xpw/m) = Х(т)2 = I Х(т) 12 , (1-8') Very often we'll want to know the difference in power levels of two sig- nals in the frequency domain. Because of the squared nature of power, 
1 О Discrete Sequeпces aпd Svsteтs t Xsum(m) amplltude 'п the l' frequency domain 0,5 . 0,4 О, I I ''' '\. .. о 'о 2'0 З'о 4'0 5'0 Frequency t Xsum(m) power in the 1 I frequency domain 0,5 . 0,16 О, I I ,,, '\. .. о 'о 2'0 З'о 4'0 5(" Frequency Flgure '-5 Frequency-domaln amplltude and frequencydomain power of the xsum(n) time waveform In Flgure l-З(с), two signals with moderately different amp1itudes will have а much larger difference in their relative powers, In Figure 1-3, for example, signal x1(п)'s amp1itude is 2.5 times the amp1itude of signal х 2 (п), but its power level is 6.25 that of x 2 (п)'s power level. Тhis is illustrated in Figure 1-5 where both the amp1itude and power of Xsum(m) are shown. Because of their squared nature, plots of power values often involve showing both very large and very smal1 values оп the same graph. То make these plots easier to generate and evaluate, practitioners usual1y employ the decibel scale as described in Appendix Е. 1.3 Signal Processing Operational Symbols We'll Ье using block diagrams to graphically depict the way digital signal processing operations are implemented. Тhose block diagrams will сот- prise an assortment of fundamental processing symbols, the most common of which are illustrated and mathematical1y defined in Figure 16. Figure 1 6(a) shows the addition, element for element, of two discrete sequences to provide а new sequence. If our sequence index п begins at О, we say that the first output sequence value is equal to the sum of the first element of the Ь sequence and the first element of the с sequence, or а(О) = Ь(О) + с(О), Likewise, the second output sequence value is equal to the sum of the second element of the Ь sequence and the second element of the с sequence, or а(l) = Ь(I) + с(I). Equation (1-7) is an example of adding two sequences, Тhe subtraction process in Figure 1-6(Ь) generates an output sequence that's the element-forelement difference of the two inpиt sequences, There are times when we must ca1culate а sequence whose elements are the sum of more than two values. Тhis operation, illustrated in Figure 1-6(с), is cal1ed summation and is very common in 
Sigпa/ Processiпg Operatioпa/ Syтbois 11 Adder: (а) ь(п) a(n) с(п) а(п) = ь(п) + с(п) (Ь) Subtractor: ь(п)  а(п) а(п) = ь(п)  с(п) с(п) (с) b(n)  Summation: п+З Ь(n+1) , J'. + а(п) а(п) = L b(k) = Ь(п) + Ь(п+1) + Ь(п+2) + Ь(п+З) Ь(п+2) ... k=n Ь(n+З)  (d) Multiplication: ь(п)  а(п) а(п) = Ь(п)с(п) = Ь(п),с(п) [Sometime5 we "5е а ", " 10 5ignify m"ltiplicalion.] с(п) (е) Unit Delay: Ь(П) ............... а(п) а(п) = b(rr--1) b(n)a(n) Figure 1-6 Terminology aпd symbols used in digital signal processing bIock dlagrams. digital signal processing, Notice how the lower and upper limits of the summation index k in the expression in Figure 1-6(с) tell us exact1y which elements of the Ь sequence to sum to obtain а given а(п) value, Because we'l1 encounter summation operations so often, let's make sure we understand their notation, If we repeat the summation equation from Figure 1-6(с) here we have П+З а(п) = I,b(k) , k=п (1-9) 
12 Discrete Sequeпces oпd Systems This means that when п = О, index k goes from О to 3, so when п = 1, index k goes from 1 to 4, so when п = 2, index k goes from 2 to 5, so when п = 3, index k goes from 3 to 6, so а(О) = Ь(О) + b(l) + Ь(2) + Ь(3) a(l) = b(l) + Ь(2) + Ь(3) + Ь(4) а(2) = Ь(2) + Ь(З) + Ь( 4) + Ь(5) а(3) = Ь(3) + Ь(4) + Ь(5) + Ь(6) and so оп, (ИО) We'll begin using summation operations in eamest when we discuss dig- ital fi1ters in Chapter 5, ТЬе multip!ication of two sequences is symbolized in Figure 16(d), Multip!ication generates an output sequence that's the e!ementfor-element product of two input sequences: а(О) = Ь(О)с(О), a(l) = b(l)c(l), and so оп, The last fundamental operation that we'll Ье using is called the unit delay in Figure 1-6(е), Whi!e we don't need to appreciate its importance at this point, we'll merely state that the unit delay symbol signifies an operation where the output sequence а(п) is equa! to а delayed version of the Ь(п) sequence, For example, а(5) = Ь(4), а(6) = Ь(5), а(7) = Ь(6), etc, As we'll see in Chapter 6, due to the mathematical techniques used to analyze digital fil- ters, the unit delay is very often depicted using the term r 1 , ТЬе symbols in Figure 16 remind us of two important aspects of digi tal signal processing, First, our processing operations are always per formed оп sequences of individua! discrete values, and second, the elementary operations themselves are very simple, It's interesting that, regardless of how complicated they appear to Ье, the vast majority of dig ital signal processing a!gorithms сan Ье performed using combinations of these simp!e operations, If we think of а digital signal processing algo- rithrn as а recipe, then the symbols in Figure 1 6 are the ingredients. 1.4 Introduction to Discrete Linear Time-Invariant Systems In keeping with tradition, we'll introduce the subject of linear time-invari ant (LТI) systems at this early point in our text. Although аn appreciation for LТI systems is not essential in studying the next three chapters of this book, when we begin exploring digital filters, we'll build оп the strict def- initions of linearity and time invariance. We need to recognize and under stand the notions of linearity and time invariance not just because the vast majority of discrete systems used in practice are LТI systems, but also 
Discrete Liпear Systeтs 13 because LТI systems are very accommodating when it comes to their analysis, That's good news for us because we сап use straightforward methods to predict the performance of any digital signal processing scheme as long as it's linear and time invariant. Бесаusе linearity and time invariance are two important system characteristics having very special properties, we'll discuss them now, 1.5 Discrete Linear Systems Тhe term /inear defines а special class оЕ systems where the output is the superposition, or sum, оЕ the individual outputs had the individual inputs been applied separately to the system. For example, we can say that the application of an input х 1 (п) to а system results in an output Уl(п). We symbolize this situation with the following expression: х 1 (п) resultsin) Уl(п) (1-11) Given а different input х 2 (п), the system has а У2(п) output as Х2(п) resultsin) У2(п) , (1-12) For the system to Ье linear, when its input is the sum х 1 (п) + х 2 (п), its out put must Ье the sum of the individual outputs so that Хl(п)+Х2(п) resultsin) Уl(п)+У2(п) , (1-13) One way to paraphrase expression (1-13) is to state that а linear system's output is the sum of the outputs оЕ its parts, Also, part of this description of linearity is а proportionality characteristic, Тhis means that if the inputs are scaled Ьу constant factors С 1 and С 2 then the output sequence parts are also scaled Ьу those factors as С1Хl(п) + С2 Х 2(п) results in ) С 1 Уl(п)+С 2 У2(п) . (1-14) In the literature, this proportionality attribute of linear systems in expression (1-14) is sometimes called the hoтogeneity property. With these thoughts in mind, then, let's demonstrate the concept of system linearity, 
14 Diserete Sequeпees oпd Systems 1.5.1 Example 01 а Linear System То illustrate systern linearity, let's say we have the discrete systern shown in Figure 1-7(а) whose output is defined as ( ) x(п) у п :=, 2 (1-15) that is, the output sequence is equal to the negative of the input sequence with the arnplitude reduced Ьу а factor of two. If we apply an x 1 (п) input sequence representing а 1 Hz sinewave sarnpled at а rate of 32 sarnples (а) Linear Discrete System Inpu! х(n) (Ь) ! х,(n) t y,(n) 1 ,,"jl,l!'r. 1 .,.;:', . 0.5 ;.: ,! ,i,': : i ,.. 0.5 ..II':I,r.r. 8" :;.::: ,,:', . Ii:; "",'" о f 8f+НIЖЖ+Ж. lII . ' .. 1 . 1 . 1 . 111 .. 1 .. 11 . 1 . 1 .. о ...'tЖ++tttt++';I .... . . .. IIIIIIIIIIII'" .i:"":.:.',:.nme t r.::,.,. ,," Tlme .5 .i: ::: ' ' i .: --0.5 rlj'liL LIi ".!,:.8 1 'i.LIi 1 ,,) :: 5 ! f ;;:::!i, . . : . ,Д;Ъ 1' . .I . '  1 ; 8 1.ii11! i r:m . ""V. 'i .' < : '. --0.5. . Ii 1 .. . .. 1 (d) 2 1 ХЗ(n) = х, (n) .. "2(n) .. .... 1 .!: ' i:!. 1'1: [,. "'! о f l!Ж,!'..81tЖ' ., . .. . ..1 i i ,.1i'8., ,: ,!. Тime 1 :'. . ...8 r.. 8 2 I Уз(n) 2 1 а!.. ". .:8 Ii;. О  .' ..,""" "ili.L!\'oI!o;... fТ'Т"П"-.!.!"! 8rтттr. . . rТТТТТ""'II" !' '.." .,,!j'. Тiтe 1 ..... r.. 8 -2 Ou!pu! у(n) = x(n)/2 t YI (т) 0.5 , О .., ...I!J...I!.....,.I!I..,..,..,... ,., i '2 4 б 8 10 12 14  ....().5 . t Y2 (т) 0.5 3 О ............................. ... 1 0 . 2 .  .  '1; '12 '14' --0.5 . t Уз(т) 0.5 1 3 О ..,+.,.I!I.I!I.I!I..,.I!I..,.I!I..,.I!I.,.I!I 1 0 2 4 8 8 10 12 14 --О.Б . . Figure 1-7 Liпear system iпput-to-output relotioпships: (а) system bIoek dlogram where у(п) = x(п)/2: (Ь) system iпput oпd output with а l-Hz siпewove opplied: (е) with а 3-Hz siпewove opplied: (d) wlth the sum of l-Hz oпd 3-Hz siпewoves oppiied, 
Discrete Liпear Systeтs 15 per cycle, we'llhave а Yl(n) output as shown in the center ofFigure 1-7(Ь), The frequency-domain spectral amplitude of the Yl(n) output is the plot оп the right side of Figure 1-7(Ь) indicating that the output comprises а single tone of peak amplitude equal to o.5 whose frequency is 1 Hz, Next, applying an х 2 (п) input sequence representing а 3-Hz sinewave, the system provides а У2(п) output sequence, as shown in the center of Figure 1-7(с), The spectrum of the У2(п) output, У 2 (т), confirming а single 3-Hz sinewave output is shown оп the right side of Figure 1-7(с), Finally here's where the linearity comes inН we apply an хз(п) input sequence that's the sum of а 1-Hz sinewave and а 3-Hz sinewave, the уз(п) output is as shown in the center of Figure 1-7(d), Notice how уз(п) is the sample- for-sample sum of Yl(n) and У2(п). Figure 1-7(d) also shows that the out- put spectrum Уз(т) is the sum of Y1(т) and У 2 (т), That's linearity, 1.5.2 Example о' а Nonlinear System It's easy to demonstrate how а nonlinear system yields an output that is not equal to the sum of Yl(n) and У2(п) when its input is x1(n) + х 2 (п), А simple example of а nonlinear discrete system is that in Figure 1-8(а) where the output is the square of the input described Ьу у(п) = [х(п)]2 , (1-16) We'll use а well-known trigonometric identity and а little algebra to pre- dict the output of this nonlinear system when the input comprises simple sinewaves. Following the form of Eq. (1-3), let's describe а sinusoidal sequence, whose frequency 10 = 1 Hz, Ьу X 1 (п) = sin(21tfonts) = sin(21t . 1 . nt s ) . (1-17) Equation (1-17) describes the x1(n) sequence оп the left side of Figure 1-8(Ь). Given this x1(n) input sequence, the Yl(n) output of the nonlinear system is the square of а 1-Hz sinewave, or Yl(n) = [X 1 (n)]2 = sin(21t . 1 . nt s ) . sin(21t . 1 . nt s ) . (1-18) We сап simplify our expression for Yl(n) in Eq. (1-18) Ьу using the follow- ing trigonometric identity: , ( ) . (fЗ) cos(a  fЗ) cos(a + fЗ) sш а .sш =  2 2 (1-19) 
16 Discrete Sequeпces aпd Systeтs (а) Input>(n) о: t:iTh.. (Ь) -о: f .К++IIIЖ+IЖ. 111IТ'111  . 1 ..r..L". 1 t:C:. :. o.5 1 i)i. "!ij 'i (с) : f .. ''!I''ill!l!l  .,. 1 ... r. 8 L8 (d) 2 I Х .. З(П) ... .8. 1 ';. . .':, i". О [.; ;j....::.:. . f """". !IЖI-.. t'НtI . "'. .. . . , .ili 8!::.Тime 1 : . . .... ". 8 -2 Nonlinear Discrete System Output у(п) = [>(п)] 2 j Y 1(n) 1 "'. 0.8 IHi 0.6 81'1:':' 0.4 ::!' !,. 0.2 8 1 i!, ::;, ii ,;!;! I!I;!, i: >,. 8i" <:: ;,". О "!,ж++-ж-ж+-.-:-,,,ЖТН+Ж+h'" Тi.,. df. .! - ; :;-. l У1 (т) 1 / zero Н: component 0.5 . 2 О !.."t...,.........,.I!I..,.....,.1!I ,..... -О.5 ! . 4 6 8 10 12 104 ;:z1 -1 j Y 2(n) '.'!'.... 08 '!'. ; i. 8! ! . о:в 1 . . . . .: .  . . . :' . : ' . ' . ' , . i ... i . <. О:,' 8';,' . ::,': . 0.4 : -, :: .:' ! .' ;:С: .! ;.:1 ': :8 0.2 ti'\.-ii. :i:\ :i! .-:. i:i о I!I)i.h"Жn'Н+:I!lнt.'ж+"ни... Time 1 t У2(т) 05.' 6 О "1JI'1JI"+""'1I!I'1!I'"1[I''''''' -о 5 ! 2 4 . 8 10 12 14 Freq . (н.) -1 2.5 I з(п) .. . t Уз(m) 1.. 1.52 ',1 8;1. .:. 8. 05 t . 4 . 1 i . :. 8 . ' : . 1 :! :. . о о ."t.+.+......,...... ,.... 0.5 -1.':\. .':::,i1!. .I ! 2 8 10 12 14  О .ЖIН'I.IIН+..ннr... FJgure ) -8 Nonlinear system inpuHo-оutрut relatlonships: (а) system bIoek diagram where у(п) = (х(п))2; (Ь) system input and output with а '-Hz slnewave applled; (е) wlth а 3-Hz sinewave applled; (d) wlth the sum 01 '-Нz and 3-Hz sinewaves app//ed, Using Eq, (119), we сап express Yl(n) as cos(21t . 1. nt  2л .1. nt ) Yl (п) = s s 2 cos(21t .1. nt s + 2л .1. nt s ) 2 = cos(O)  cos(41t .1. nt s ) 2 2 1 cos(21t . 2. nt.) 2 2 (1-20) which is shown as the аН positive sequence in the center ofFigure 18(b), Because Eq, (1-19) resu1ts in а frequency sum (а + ) and frequency dif ference (а  ) effect when mи1tiplying two sinиsoids, the Yl(n) oиtput 
Discrete Liпear Systeтs 17 sequence will Ье а cosine wave оЕ 2 Hz and а peak amplitude оЕ O.5, added to а constant value оЕ 1/2. Тhe constant value оЕ 1/2 in Eq. (120) is interpreted as а zero Hz frequency component, as shown in the Yj(т) spectrum in Figure 18(b), We could go through the same algebraic exer cise to determine that, when а ЗНz sinewave х 2 (п) sequence is applied to this nonlinear system, the output У2(п) would contain а zero Hz com ponent and а 6 Hz component, as shown in Figure 18(c), System nonlinearity is evident if we apply аn хз(п) sequence compris ing the sum оЕ а 1 Hz and а ЗНz sinewave as shown in Figure 1-8( d). We сan predict the frequency content оЕ the уз(п) output sequence Ьу using the algebraic relationship (а+Ь)2 = а 2 +2аь+ь 2 , (1 21) where а and Ь represent the lHz and ЗНz sinewaves, respectively, From Eq. (119), the а 2 term in Eq. (121) generates the zero-Hz and 2-Hz output sinusoids in Figure 18(b), Likewise, the Ь 2 term produces in уз(п) another zeroHz and the 6Hz sinusoid in Figure 1-8(с), However, the 2аЬ term yields additiona12Hz and 4-Нz sinusoids in уз(п), We сan show this alge- braically Ьу using Eq, (119) and expressing the 2аЬ term in Eq. (1-21) as 2аЬ = 2. sin(21t .1. пt s ) . sin(21t . З. пt s ) = 2 cos(21t .1. пt s  2п. 3 . пt s ) 2 2 cos(21t .1. пt s + 2п. 3 . пt s ) 2 = cos(21t. 2. пt s )  cos(21t. 4. пt s ) t (1-22) Equation (1-22) tells us that two additional sinusoidal components wi11 Ье present in уз(п) because of the system's nonlinearity, а 2Hz cosine wave whose amplitude is +1 and а 4-Hz cosine wave having аn amplitude оЕ 1, Тhese spectral components are i11ustrated in Уз(т) оп the right side оЕ Figure 18(d). Notice that, when the sum оЕ the two sinewaves is applied to the non linear system, the output contained sinusoids, Eq. (1-22), that were not present in either оЕ the outputs when the individual sinewaves alone were applied. Тhose extra sinusoids were generated Ьу аn interaction оЕ the t The first term in Eq, (1-22) is cos(21t. nt, БIt, пt,) =cos(41t. пt,) = cos(21t . 2 ' пt,), However, because the cosine function is even, cos(--a) = cos(ct), we сап express that fjrst term аз cos(21t . 2. пt,), 
18 D/screte Sequeпces aпd Systeтs two input sinusoids due to the squaring operation, That's nonlinearity; expression (1-13) was not satisfied, (E1ectrica1 engineers recognize this effect of internally generated sinusoids as interтodulation distortion,) A1though non1inear systems are usually difficult to ana1yze, they are осса- sionally used in practice. References [2], [3], and [4], for examp1e, describe their application in non1inear digita1 filters. Again, expressions (1-13) and (1-14) state that а 1inear system's output resulting from а sum of individ- ual inputs, is the superposition (sum) of the individua1 outputs, Тhey a1so stipu1ate that the output sequence Уl(п) depends on1y оп х 1 (п) combined with the system characteristics, and not оп the other input xz(n), i.e., there's по interaction between inputs х 1 (п) and xz(n) at the output of а 1in- ear system. 1.6 Time-Invariant Systems А time-invariant system is one where а time delay (or shift) in the input sequence causes а equiva1ent time de1ay in the system's output sequence, Keeping in mind that п is just an indexing variable we use to keep track of our input and output samp1es, 1et's say а system provides an output у(п) given an input of х(п), or х(п) results in ) у(п) . (1-23) For а system to Ье оте invariant, with а shifted version of the origina1 х(п) input applied, х'(п), the following applies: х' (п) = х(п + k) results in ) у' (п) = у(п + k) , (1-24) where k is some integer representing k samp1e period оте de1ays, For а system to Ье time invariant, expression (1-24) must ho1d true for any inte- ger va1ue of k and any input sequence. 1.6.1 Example о' а Time-Invariant System Let's look at а simp1e examp1e of оте invariance illustrated in Figure 1-9, Assume that our initia1 х(п) input is а unity-amplitude 1-Hz sinewave sequence with а у(п) output, as shown in Figure 1-9(Ь), Consider а differ- ent input sequence х'(п), where х'(п) = х(п+4) , (1-25) 
Тiтe-/пvariaпt Systeтs Tlme-Invariant (а) Input х(п) Discrete  Output У(п) = x(п)/2 System t*) lу(п) 1 .... о.: "'" 0.5 .'i11Ij!:j. . ',i,:i!i :1:8 1821242730 О 3 6 9 12 15 .! i [ ; [! : .. (Ь) о , IIIIIIIIIIIIIII  I! "! I ! ! I! ! I !  о f" J 1" 1 !!! !! IIJ4  'IIIIIIIIIIIII  о з 6 9 12 15 .! f i, ! ! i :! '. Тiтe ...0.5 ...Ii.. 18 21 24 27 30 Time ..0.51 а';;:; -' -' j 1. iI i! i !! '. 1 ...I... -, +. х'(п) 1 1 (п) 1 .... о.: "'" 05 f;;::::::1I  I ! (- ,! i i -' ! : .12 15 18 21 24 27 . О 3 6 9 ._,',!! ,'i":. 30 (с) о' · .  III 1111 ""IIII  о 1i1'1!,"II , llllilllllll  о з 6 9 .11 ' i ! ' ! i : i i ! i.. 30 Тlmе .;!, '!' !..12 15 18 21 2427 -. Time ...0.51 .: i: -' i:: i:. ...0.5 I....... .;: i ,! '. 1 ....... -, Flgure 1-9 Тiтe/пvarioпt systeт iпрuНо-оutрut re/otioпships: (а) systeт bIoek diograт where у(п) = x(п)/2; (Ь) systeт iпput ond output wlth а 1-Hz siпewove opplied; Се) systeт lпput ond output when а 1-Hz siпewove, de/oyed Ьу four soтples, Is opplied. Wheп х'(п) = х(п+4), then, у' (п) = у(п+4) , Equation (1-25) tells us that the input sequence х'(п) is equal to sequence х(п) shifted four samples to the left, that is, х'(О) = х(4), х'(l) = х(5), х'(2) = х(6), and so оп, as shown оп the left of Figure 1-9(с), The discrete system is time invariant because the у'(п) output sequence is equal to the у(п) sequence shifted to the left Ьу four samples, or у'(п) = у(п+4). We сап see that у'(О) = у(4), y'(l) = у(5), у'(2) = у(6), and so оп, as shown in Figure 1-9(с). For time-invariant systems, the у time shift is equal to the х time shift. Some authors succurnb to the urge to define а time-invariant system as one whose parameters do not change with time. That definition is incom- plete and Сan get us in trouble if we're not careful, We'll just stick with the formal definition that а time-invariant system is one where а time shift in an inpиt sequence results in an equal time shift in the oиtput seqиence, Ву the way, time-invariant systems in the literature are often called shift- invariant systems. t t An example of а discrete process that's nо! tirne-invariant is the downsampling, or deci- rnation, process described in Section 7.3, 
20 Discrete Sequeпces aпd Systeтs Input х(п) LTI System #1 п) LTI System #2 Output у(п)  (а) /nput х(п) LTI System #2 тп) LTI System # 1 Output у(п)  (Ь) Figure 1-10 Linear time-invariont (LTI) systems in series: (о) bIock diogram of two LTI systems; (Ь) swopping the order of the two systems does not chonge the resultont output у(п), 1.7 The Commutative Property о' Linear Time- Invariant Systems Although we don't substantiate this fact until we reach Section 6.8, it's not too early to realize that LТI systems have а useful commutative property Ьу which their sequential order can Ье rearranged with по change in their final output. This situation is shown in Figure 1-10 where two different LТI вув- tems are configиred in series. Swapping the order of two cascaded systems does not alter the final output, Although the intепnеdiаtе data sequences f( п) and g(n) will ивиаllу not Ье equal, the two pairs of LТI systems will have identical у(п) output sequences, This commutative characteristic соmев in hand у for designers of digital filters, ав we'll вее in Chapters 5 and 6, 1.8 Analyzing Linear Time-Invariant Systems Ав previously stated, LТI systems can Ье analyzed to predict their perfor mance, Specifically, if we know the unit impulse response of an LТI system, we сап calcu1ate everything there is to know about the system; that is, the system's unit impulse response completely characterizes the system. Ву unit impulse response, we mean the system's timedomain output sequence when the input is а single unity-valued sample (иnit impulse) preceded and followed Ьу zero-valued samples ав shown in Figure 1-11(Ь). Клоwing the (unit) impulse response of an LТI system, we сап deter mine the system's output sequence for any input sequence Ьесаиве the output is equal to the convolution of the input sequence and the system's impulse response, Moreover, given an LТI system's time-domain impulse 
Refereпces 2 Linear (а) Input х(п) Time-Invariant  Output У(п) Discrete System 1'" '""" ,,.. t У(п) impulse response 1 . . (Ь) :: "unity-vaiued ..mpie t .. : i, ... о .. ............................ .. о ."'!"""'!"'..""""'I"""!.-.:..e............... -з о з 6 . 12 l' 18 21 24 Tlme О :: i .... Time I I . Flgure 1-11 LTI system uпit impulse respoпse sequeпces: (о) system bIock diogram; (Ь) Impulse lпput sequeпce Х(п) ond Impulse respoпse output sequence у(п), response, we сап find the system' s frequeпcy respoпse Ьу taking the Fourier transform in the form of а discrete Fourier traпsforт of that impulse response[5]. Don't Ье alarmed if you're not exact1y sure what is meant Ьу convolu- tion, frequency response, or the discrete Fourier transform, We'll intro duce these subjects and define them slowly and carefully as we need them in later chapters, The point to keep in mind here is that LТI systems сап Ье designed and analyzed using а number of straightforward and power- ful analysis techniques. These techniques will Ьесоmе tools that we'll add to ош signal processing toolboxes as we joumey through the subject of digital signal processing. References [1] Karplus, W, J" and Soroka, W, W, Analog Methods, Second Edition, McGraw-Нill, New York, 1959, р, 117, [2] Mikami, N" Kobayashi, М" and Yokoyama, У, "А New DSPOriented Algorithm for Ca1culation оЕ the Square Root Using а Nonlinear Digita! Filter," IЕЕЕ Trans, оп Signal Processing, Vol, 40, No, 7, July 1992, [3] Heinen, Р" and Neuvo, У. "FIR-Median Hybrid Filters," IЕЕЕ Trans, оп Acoust, Speech, and Signal Processing, Vol, ASSP-35, No, 6, June 1987, [4] Oppenheim, А., Schafer, R" and Stockham, Т, "Nonlinear Filtering оЕ Multiplied and Convo!ved Signals," Proc, IЕЕЕ, Vol, 56, August 1968, [5] Pickerd, John, "Impulse-Response Testing Lets а Single Test Оо the Work of Thousands," EDN, April27, 1995, 
I CHAPTER TWO I Periodic Sampling Periodic sampling, the process of representing а continuous signal with а sequence of discrete data values, pervades the field of digital signal pro cessing. In practice, sampling is performed Ьу applying а continuous sig nal to an analog-to-digital (A/D) converter whose output is а series of digital values, Because sampling theory plays an important role in deter- mining the accuracy and feasibility of any digital signal processing scheme, we need а solid appreciation for the often misunderstood effects of periodic sampling. With regard to sampling, the primary concern is just how fast must а given continuous signal Ье sampled in order to preserve its information content, We сап sample а continuous signal at any sample rate we wish, and we'l1 get а series of discrete valuesbut the question is how well do these values represent the original signal? Let's learn the answer to that question and, in doing so, explore the various sampling techniques used in digital signal processing. 2.1 Aliasing: Signal Ambiguity in the Frequency Domain Тhere is а frequency-domain ambiguity associated with discrete-time sig nal samples that does not exist in the continuous signal world, and we сап appreciate the effects of this uncertainty Ьу understanding the sampled nature of discrete data. Ву way of example, suppose уои were given the fol1owing sequence of values, х(О) = О x(l) = 0,866 х(2) = 0.866 х(З) = О х(4) = O,866 х(5) = 0.866 х(6) = О, 23 
24 Periodic Soтpliпg (а) ошf ) . ...... Time . (Ь) Figure 2-1 Frequency ambIgulty: (а) dlscrete-time sequence of values; (Ь) two dlfferent slnewaves that pass through the polnts of the dlscrete sequence, and were told that they represent instantaneous values of а time-domain sinewave taken at periodic intervals. Next, уои were asked to draw that sinewave. You'd start Ьу plotting the sequence of values shown Ьу the dots in Figure 2-1(а). Next, you'd Ье Iikely to draw the sinewave, Шus- trated Ьу the solid line in Еgше 2-1(Ь), thatpasses throиgh the points rep- resenting the original sequence, Another person, however, might draw the sinewave shown Ьу the shaded line in Figure 2-1(Ь). We see that the original sequence of values could, with equal validity, represent sampled values of both sinewaves. Тhe key issиe is that, if the data sequence represented periodic samples of а sinewave, we cannot unambiguously determine the frequency of the sinewave from those sample values alone, Reviewing the mathematical origin of this frequency ambiguity enables us not only to deal with it, but to use it to our advantage, Let's derive аn expression for this frequency-domain ambiguity and, then, look at а few specific examples. Consider the continuous time-domain sinusoida1 signa1 defined as 
Affas/пg: S/gпaf Ambigu/ty 'п the Frequeпcy Domaiп 2Б x(t) = sin(21tfot) , (2-1) Тhis x(t) signal is а garden variety sinewave whose frequency is 10 Hz. Now let's sample x(t) at а rate of 15 samples/ s, i,e" at regular periods of t s seconds where t s = 1/1., If we start samp1ing at time t = О, we wi11 obtain samples at times Ot s ' 1t s ' 2t s ' and so оп, 50, from Eq, (21), the first п suc- cessive samples have the values Oth sample: 1st sample: 2nd sample: х(О) = sin(21t/oOt.) х(l) = sin(21t/он.) х(2) = sin(21t/02ts) nth sample: х(п) = sin(21tlonts) , (2-2) Equation (22) defines the value of the nth sample of our х(п) sequence to Ье equal to the original sinewave at the time instant nt s ' Because two values of а sinewave are identical if they're separated Ьу an integer mul tiple of 2п radians, i.e., sin(e) = sin(e+21tm) where m is any integer, we сап modify Eq, (2-2) as х(п) = sin(21tf,nt s ) = sin(21tl o nt s + 2пт) = sin(21t(fo + .!!2...)nt s ) (2-3) nt s If we let m Ье an integer multiple of п, m = kn, we сап replace the т/ п ratio in Eq, (23) with k so that х(п) = sin(21t(fo +! )nt s ) t s (2-4) Because 1. = 1/ t s , we can equate the х(п) sequences in Eqs, (2-2) and (2-4) as х(п) = sin(21tlonts) = sin(21t(fo +kfs)nt s ) , (2-5) Тhe 10 and (10 +kfs) factors in Eq, (2-5) are therefore equal, The imp1ication of Eq. (2-5) is critical, It means that an х(п) sequence of digital sample values, representing а sinewave of 10 Hz, also exactly represents sinewaves at other frequencies, namelY, lo + kfs, This is one of the most important relationships in the field of digital signal processing, It's the 
26 Period/c Saтpllпg thread with which аН sampling schemes are woven. In words, Eq. (25) states that When sampling at а rate of Is samples/s, if k is any positive or neg- ative integer, we cannot distinguish between the sampled values of а sinewave of 10 Hz and а sinewave of <10 +kl s ) Hz. It's true. No sequence of values stored in а computer, for example, can unambiguously represent one and only one sinusoid without additional inforrnation, Тhis fact applies equally to A/D-converter output samples as well as signal samples generated Ьу computer software routines, Тhe sampled nature of any sequence of discrete values makes that sequence also represent an infinite number of different sinusoids. Equation (25) influences аН digital signal processing schemes, It's the reason that, although we've only shown it for sinewaves, we'll see in Chapter 3 that the spectrum of any discrete series of sampled values con tains periodic replications of the original continuous spectrum. Тhe period between these replicated spectra in the frequency domain will always Ье 1., and the spectral replications repeat аН the way from DC to daylight in both directions of the frequency spectrum, Тhat's because k in Eq. (25) can Ье any positive or negative integer. (In Chapters 5 and 6, we'lllearn that Eq, (25) is the reason that аН digital filter frequency responses are period ic in the frequency domain and is crucial to analyzing and designing а popular type of digital filter known as the infinite impulse response filter,) То illustrate the effects of Eq. (25), let's build оп Figure 2-1 and con sider the sampling of а 7kНz sinewave at а sample rate of 6 kHz, Anew sample is determined every 1/6000 seconds, or once every 167 microsec onds, and their values are shown as the dots in Figure 2-2(а), Notice that the sample values would not change at аН Н, instead, we were sampling а 1 kНz sinewave, In this example f. = 7 kНz,J. = 6 kHz, and k = 1 in Eq. (25), such thatfo+kf. = [7+Н.6)] = 1 kHz, Our problem is that по processing scheme can determine if the sequence of sampled values, whose amplitudes are represented Ьу the dots, сате from а 7kНz or а lkHz sinusoid, If these amplitude values are applied to а digital process that detects energy at 1 kHz, the detector output would indicate energy at 1 kHz, But we know that there is по lkHz tone there-----our input is а spectrally pure 7kНz tone, Equation (2-5) is causing а sinusoid, whose name is 7 kHz, to go Ьу the alias of 1 kHz. Asking someone to deterrnine which sinewave frequency accounts for the sample values in Figure 22(a) is like asking them "When 1 add two numbers 1 get а sum of four, What are the two numbers?" Тhe answer is that there are an infinite number of number pairs that сап add up to four. 
Aliasiпg: Sigпai Aтbiguity iп the Frequeпcy Doтaiп 2j (а) Time (Ь) 2 kHz Time , Spectral band  I  ofintere5t  (с) 3 2 (/2) о 3 4 (/2) 6 7 ('5) Freq (kHz) Figure 2-2 Frequeney ambIguity effeets of Eq, (2-5): (а) sampling а 700kHz sinewave at а sample rate of 6 kHz; (Ь) sampling а 400kHz sinewave at а sample rate of 6 kHz; (е) speetral relatioпships showing aliasing of the 7- and 4-kНz slnewaves, Figure 22(b) shows another example of frequency ambiguity, that we'll саН aliasiпg, where а 4kHz sinewave could Ье mistaken for а 2-kНz sinewave. In Figure 22(b),fo = 4 kHz,f, = 6 kHz, and k = 1 in Eq, (2-5), so thatfo+kf. = [4+(1 . 6)] = 2 kHz. Again, if we examine а seqиence of numbers representing the dots in Figиre 2-2(Ь), we could not determine if the sampled sinewave was а 4kНz tone or а 2-kНz tone. (Althoиgh the 
28 Periodic Sampliпg concept of negative frequencies might seem а bit strange, it provides а beautifully consistent methodology for predicting the spectral effects of sampling. Appendix С discusses negative frequencies and how they relate to real and complex signals.) Now, if we restrict our spectral band of interest to the frequency range of tfsl2 Hz, the previous МО examples take оп а special significance. The frequency 1./2 is an important quantity in sampling theory and is rеfепеd to Ьу different names in the literature, such as critical Nyquist, half Nyquist, and folding frequency. А graphical depiction of our мо frequen су aliasing examples is provided in Figure 22(c). We're interested in signal components that are aliased into the frequency band between f./2 and +1./2, Notice in Figure 2-2(с) that, within the spectral band of interest (:tЗ kНz, because fs = 6 kНz), there is energy at 2 kНZ and +1 kНz, aliased from 4 kНZ and 7 kНz, respectively. Note also that the vertical positions of the dots in Figure 22(c) have по amplitude significance but that their hor izontal positions indicate which frequencies are related through aliasing. А general illustration of aliasing is provided in the shark's tooth pattem in Figure 2З(а). Note how the peaks of the pattem are located at integer multiples of fs Нz. The pattem shows how signals residing at the inter section of а horizontalline and а sloped line will Ье aliased to all of the intersections of that horizontalline and all other lines with like slopes, Ро! example, the pattem in Figure 2З(Ь) shows that our sampling of а 7kНz ;..., Band 01 .....'.... R l ' .....i4....... R l ' .....;..., R l ' .....'  interest  ер Ica........... 1 . ер Ica.........,.. ер Ica! (а) !\/. 1./2 о 1./2 1. 21. 31. Freq (Ь) Л&У/.  о 1 3 6 7 12 13 18 19 Freq (kHz) Flgure 2.3 Shark's tooth pattern: (а) aliasing at multlples of the sampling frequency; (Ь) aliaslng ofthe 7-kНz slnewave to 1 kHz, 13 kHz, and 19 kHz, 
Saтpfiпg Low-Pass Sigпafs 29 sinewave at а sample rate of 6 kHz wil1 provide а discrete sequence of nurnbers whose spectrum ambiguously represents tones at 1 kНz, 7 kНz, 13 kHz, 19 kНz, etc. Let's pause for а moment and let these very impor- tant concepts soak in а bit, Again, discrete sequence representations of а continuous signal have unavoidable ambiguities in their frequency domains, These ambiguities must Ье taken into account in аН practical digital signal processing algorithms, ОК, let's review the effects of sampling signals that are more interest ing than just simple sinusoids, 2.2 Sampling Low-Pass Signals Consider sampling а continuous real signal whose spectrum is shown in Figure 24(a), Notice that the spectrum is symmetrical about zero Hz, and the spectral amplitude is zero above +В Hz and below B Hz, i.e" the signal is baпd-liтited. (From а practical standpoint, the term baпd-liтited sigпal merely implies that any signal energy outside the range of :!:В Hz is below the sensitivity of our system.) Given that the signal is sampled at а rate of fs samples/ s, we сап see the spectral rep1ication effects of sam- pling in Figure 24(b), showing the original spectrum in addition to an infinite number of replications, whose period of rep1ication is fs Hz, (Although we stated in Section 1.1 that frequencydomain representa- tions of discrete-time sequences are themselves discrete, the rep1icated spectra in Figure 24(b) are shown as continuous lines, instead of discrete dots, merely to keep the figure from looking too cluttered. We'H cover the fuH imp1ications of discrete frequency spectra in Chapter 3,) Let's step back а moment and understand Figure 2-4 for аН it's worth, Figure 24(a) is the spectrum of а continuous signal, а signal that сап only exist in one of two forms, Either it's а continuous signal that сап Ье sam- pled, through A/D conversion, or it is merely an abstract concept such as а mathematical expression for а signal, It caппot Ье represented in а digi tal machine in its current band1imited form, Once the signal is represent- ed Ьу а sequence of discrete sample values, its spectrum takes the rep1i- cated form of Figure 2-4(Ь). The replicated spectra are not just figments of the mathematics; they exist and have а profound effect оп subsequent digital signal processing,t The rep1ications тау appear harmless, and it's natural to ask, "Why care about spectral replications? We're only interested in the frequency band t Toward the end of Section 5,9, ав аn example of using the convolution theorem, another derivation of репофс sampling's replicated spectrums will Ье presented, 
30 Periodie 8aтpiiпg Continuous spectrum (а) B о в Freq Discrete spectrum (Ь) 2f. Freq 2f. --2f. 2f. Freq (с) Flgure 2-4 Spectral replieotions: (о) originol continuous signol spec1rum; (Ь) spec1ro\ replleotlons of the sampled signol when f./2 > В; (е) frequency overlop ond olloslng when the samp\lng rate is too low becouse './2 < В, within -z.f/2." Well, if we perform а frequency translation operation or induce а change in sampling rate through decimation or interpolation, the spectral replications wil1 shift up or down right in the middle of the frequency range of interest -z.fs/2 and could cause prob1ems[l]. Let's see how we сап control the locations о! those spectral replications, In practical A/D conversion schemes, fs is always greater than 2В to separate spectral replications at the foldiпg frequeпcies of Ifs/2. Тhis very important relationship of fs  2В is known as the Nyquist criterion, То illustrate why the term folding frequency is used, let's lower our sam- pling frequency to fs = 1.58 Hz, Тhe spectral result of this uпdersaтpliпg is illиstrated in Figure 2-4(с), The spectral replications are now overlap- ping the original baseband spectrum centered about zero Hz, Limiting our attention to the band -z.f/2 Нz, we see two very interesting effects. First, the lower edge and upper edge of the spectral replications centered 
Sampliпg LowPass Sigпa/s 3 1 at +1. and 1. now Не in our band of interest, This situation is equivalent to the original spectrum folding to the left at +1./2 and folding to the right at f/2, Portions of the spectral replications now combine with the original spectrum, and the result is aliasing errors, The discrete sampled values associated with the spectrum оЕ Figure 2-4(с) по longer truly rep- resent the original input signal. The spectral information in the bands of 8 to 8/2 and 8/2 to 8 Hz has been corrupted, We show the amplitude of the aliased regions in Figиre 24(c) as dashed lines because we don't really know what the amplitudes will Ье if aliasing occurs, The second effect illustrated Ьу Figure 2-4(с) is that the entire spec- tral content оЕ the original continuous signal is now residing in the band of interest between 1./2 and +1./2, This key property was true in Figure 24(b) and will always Ье true, regardless of the original signal or the sample rate, Тhis effect is particularly important when we're dig- itizing (A/D converting) continuous signals, It warns us that any sig- nal energy located above +8 Hz and below 8 Hz in the original con- tinuous spectrum of Figure 24(a) will always end ир in the band of interest after sampling, regardless of the sample rate. For this reason, continuous (analog) lowpass filters are necessary in practice. We illustrate this notion Ьу showing а continuous signal оЕ bandwidth 8 accompanied Ьу noise energy in Figиre 2-5(а). Sampling this composite continuous signal at а rate that's greater than 28 prevents replications of the signal оЕ interest from overlapping each other, but аН of the noise energy still ends ир in the range between 1./2 and +1./2 of our discrete spectrum shown in Figиre 25(b), Тhis problem is solved in practice Ьу (а) Noise Signal 01 Noise A /I'Z " K B О В ... Freq (Ь) /i ft  N . 11 . H>i, .  I о I  fs/2 '5/2 (5 ... Freq :, 1 Figure 2-5 Spectral replications: (а) original continuous signal plus noise spectrum: (Ь) discrete spectrum with nolse contaminating the signal of interest, 
32 Per/odic Saтp/iпg Noise Noise A / 11\ \ А1  ''' /\ 11\ /\ /\ " B О В Freq I О I r 'э 's/2 's/2's 2'э req Original \ Analog Low-Pass Filtered \ Dlscrete continuous continuous signal A/D samples signal ............. Filter (cutoff frequency = В Hz) I Converter Ж  B О В Freq Flgure 2-6 Low-pass analog Illtering prior to sampling at а rate 01 " Hz, иsing an analog low-pass aпti-aliasiпg filter prior to A/D conversion to attenuate апу иnwanted signal energy above +В and below B Hz as shown in Figиre 2-6, An example lowpass filter response shape is shown as the dotted line sиperimposed оп the original continиoиs signal spec- trит in Figиre 2-6. Notice how the oиtpиt spectrum of the low-pass filter has Ьеen band-limited, and spectral aliasing is avoided at the oиtpиt of the A/D converter. Тhis completes the discussion of simple low-pass sampling, Now let's go оп to а more advanced sampling topic that's proven so иseful in practice, 2.3 Sampling Bandpass Signals Althoиgh satisfying the majority of sampling reqиirements, the sampling of low-pass signals, as in Figиre 2-6, is not the only sampling scheme иsed in practice. We can иse а techniqиe known as baпdpass saтpliпg to sample а continиoиs bandpass signal that is centered aboиt some freqиency other than zero Hz. When а continиoиs inpиt signal's bandwidth and center frequency permit иs to do so, bandpass sampling not оnlу redиces the speed reqиirement of A/D converters below that necessary with tradi- tionallowpass sampling; it also redиces the amount of digital memory necessary to captиre а given time interval of а continиoиs signal, Ву way of example, consider sampling the bandlimited signal shown in Figиre 2-7(а) centered atfc = 20 MHz, with а bandwidth В = 5 MHz, We иse the term bandpass sampling for the process of sampling continиoиs signals whose center freqиencies have Ьеen translated ир from zero Hz. What we're calling bandpass sampling goes Ьу varioиs other names in the 
Sampliпg Baпdpass Sigпa/s 33 Bandpass signal spectrum (continuous) I В= !5MHzl (а) fc о (с = Freq 20 MHz  = fc 812 = 17,5 MHz Bandpass signal spectrum (discrete) (Ь) Freq »- ; -< fs fs 1< .fs fs Flgure 2.7 Baпdpass signal sampllng: (а) original continuous slgnal spectrum; (Ь) sampled signal spectrum replications when sample rate is 17,5 MНz, literature, such as IF sampling, harmonic sampling[2], subNyquist sam pling, and undеrsаmрling[З], In bandpass sampling, we're more con cemed with а signal's bandwidth than its highest frequency component. Note that the negative frequency portion оЕ the signal, centered at fc' is the mirror image оЕ the positive frequency portionas it must Ье for real sig nals. Our bandpass signal's highest frequency component is 22.5 MHz. Conforming to the Nyquist criterion (sampling at twice the highest fre quency content оЕ the signal) implies that the sampling frequency must Ье а minimum оЕ 45 MHz. Consider the effect if the sample rate is 17.5 MHz shown in Figure 27(b). Note that the original spectral components remain located at ffc' and spectral replications are located exactly at baseband, i,e" butting up against еат other at zero Hz, Figure 27(b) shows that sam pling at 45 MHz was unnecessary to avoid aliasinginstead we've used the spectral replicating effects of Eq. (25) to our advantage. Bandpass sampling performs digitization and frequency translation in а single process, often called saтpliпg traпslatioп, The processes оЕ sam pling and frequency translation are intimately bound together in the world оЕ digital signal processing, and every samp1ing operation inherently results in spectral rep1ications. The inquisitive reader тау ask, "Сап we sample at some stilllower rate and avoid aliasing?" The answer is yes, but, to find out how, we have to grind through the derivation of an important bandpass sampling relationship. our reward, however, will Ье worth the trouble because here's where bandpass sampling really gets interesting. 
34 Periodic Saтpliпg ! ( I 21с- В  'C-B/2 !yl I p с; D1 rYl -1,' о 1,' 21" ) iB 6 'в' I r(I. 'с 41 Freq саrrlе, frequency (а) Щl i Y1 -41" -I c -21" 1 . 21с-В )! (Ь)  (.1 [::]  f::1 1 ffJl н 1 f::1 l н ' r;1 rfl -I c О 'с .. Freq :( , 21с+ В (с)  1 (11) (тi J r1PIl rc;f! 1 (Т' " 1 1 rl1 1  -I c -31," -21." -1," О 1,. 21,,, 31." 'с ) ; ! . Freq Flgure 2-8 Bondposs soтpllng frequency Ilтits: (о) soтple rate (" = (2f c  8)/6; (Ь) soтple rate Is less thon (,,; (с) тlnlтuт soтple rate (" < (", Let's assume we have а continuous input bandpass signal of band width В, Its carrier frequeпcy is fc Hz, i,e" the bandpass signa1 is centered at fc Hz, and its sampled value spectrum is that shown in Figure 28(a). We сап sample that continuous signal at а rate, say fs, Hz, so the spectral repli cations of the positive and negative bands, Р and Q, just butt ир against each other exactly at zero Hz, Тhis situation, depicted in Figure 28(a), is reminiscent of Figure 27(b), With an arbitrary nиmber of replications, say т, in the range of 2fc  В, we see that 2{ B т!s,=2!cB or J.'=....i.L........ S т (26) In Figure 28(a), т = 6 for il1ustrative purposes only. Of coиrse т can Ье any positive integer so long as fs, is never less than 2В, If the sample rate fs, is increased, the origina1 spectra (bold) do not shift, but аН the replica tions will shift. At zero Hz, the Р band will shift to the right, and the Q band will shift to the left. Тhese replications will overlap and aliasing occиrs, Тhus, from Eq, (2-6), for an arbitrary т, there is а frequency that the sample rate must not exceed, or {, < 2!с  в Js  т or 2!с  В !S' , т (27) 
Sampliпg Baпdpass Slgпals 35 If we reduce the sample rate below the 1.. value shown in Figure 2-8(а), the spacing between replications will decrease in the direction of the arrows in Figure 28(b), Again, the original spectra do not shift when the sample rate is changed, At воте new sample rate 1..., where 1... < 1.., the replication Р' will just butt ир against the positive original spectrum centered at fc ав shown in Figure 2-8(с). In this condition, we know that 2!с + В (т + l)fs.. = 2!с +В or fs.. =  , т+1 (28) Should 1... Ье decreased in value, Р' will shift further down in frequency and start to overlap with the positive original spectrum at fc and aliasing occurs. Therefore, from Eq. (2-8) and for т+ 1, there is а frequency that the sample rate must always exceed, or j;.. > 2!с +В s  т+ 1 (2-9) We сап now сотЫnе Eqs. (27) and (29) to вау that fs тау Ье chosen any where in the range between 1... and 1.. to avoid aliasing, or 2!cB fs 2!c+B , т т+1 (2 10) where т is аn arbitrary, positive integer ensиring that 1.  2В. (For this type of periodic sampling of real signals, known ав real or firstorder ват- pling, the Nyquist criterionl.  2В must still Ье satisfied,) То appreciate the important relationships in Eq, (2 10), let's retиrn to our bandpass signal example, where Eq, (2 10) enables the generation of Table 2-1. This table tells ив that oиr sample rate сап Ье anywhere in the range of 22.5 to 35 MHz, anywhere in the range of 15 to 17.5 MНz, or anywhere in the range of 11,25 to 11,66 MHz, Anу sample rate below 11.25 MHz is иnac ceptable Ьесаиве it will not satisfy Eq, (2-10) ав well ав 1.  2В, The spectra resulting from several of the sampling rates from Table 2 1 are shown in Figиre 29 for oиr bandpass signal example, Notice in Figure 2-9(f) that when 1. equals 7.5 MHz (т = 5), we have aliasing problems Ьесаиве neither the greater than relationships in Eq. (2-10) nor 1.  2В have Ьееn satisfied. The т = 4 condition is also иnacceptable Ьесаиве 1.  2В is not satisfied, The last column in Table 2-1 gives the optimum sampling frequency for each acceptable т value. Optimum sampling frequency is defined here ав that 
36 Periodic Saтp/iпg ТаЫе 2-1 Equatlon (2-1 О) Applled to the Bandpass Slgnal Example m (2EcB)/m (2Е с +В)/(m+l) Optimum Sampliпg Rate 1 35,0 MHz 22,5 мнz 22.5 MHz 2 17.5 MHz 15,0 MHz 17,5 MHz 3 11,66 МНz 11,25 MHz 11,25 МНz 4 8,75 MHz 9,0 MНz  5 7,0 MHz 7,5 MHz  frequency where spectral replications do not butt up against each other except at zero Hz, For example, in the т = 1 range of permissible sampling frequencies, it is much easier to perform subsequent digital filtering or other processing оп the signal samples whose spectrum is that of Figure 2-9(Ь), as opposed to the spectrum in Figure 2-9(а), The reader mау wonder, "Is the optimum sample rate always equal to the minimum permissible value for!. using Eq, (2-10)?" Тhe answer depends оп the specific applicationperhaps there are certain system соn- straints that must Ье considered, For example, in digital telephony, to sim- plify the follow-on processing, sample frequencies are chosen to Ье integer multiples of 8 kНz[4]. Another application-specific factor in choosing the optirnum!. is the shape of analog anti-aliasing filters[5]. Often, in practice, highperformance A/D converters have their hardware components fiпe tuпed during manufacture to ensure maximum linearity at high frequen- cies (>5 MHz), Тheи use at lower frequencies is not recommended. An interesting way of Шustrаting the nature of Eq, (2-10) is to plot the minimum sampling rate, (2fc+B)/(т+1), for various values ofm, as а {unc tion of R defined as R = highest signal frequency component = !с + в /2 (2-11) bandwidth В If we normalize the minimum sample rate from Eq, (2-10) Ьу dividing it Ьу the bandwidth В, we get а curve whose axes are normalized to the bandwidth shown as the solid curve in Figure 210. This figure shows us the minimum normalized sample rate as а function of the normalized highest frequency component in the bandpass signal, Notice that, regardless of the value of R, the minimum sampling rate need never exceed 4В and approaches 2В as the carrier frequency increases, Surprisingly, the minimum acceptable sampling frequency actually decreases as the bandpass signal's carrier frequency increases. We сап 
Sompliпg Boпdposs Sigпo/s 37 fs = 35,0 MHz (а) 25,O 20,O 15,O 10,O 5,O О 5,0 10,0 15,0 20,0 25,0 MHz (Ь) 25,O 20,O 15,O 10,O 5,O О 5,0 10,0 15,0 20,0 25,0 MHz т=2 (с) 25,O 20,O 15,O 1O,O --5,0 О 5,0 10,0 15,0 MHz 20,0 25,0 (d) 25,O 20,O 15,O 10,O 5,O о 5,0 10,0 15,0 20,0 (е) 25,O 20,O 15,O 10,O 5,O о 5,0 10,0 15,0 20,0 (1) 25,O 20,O 15,O 10,O --5,0 о 5,0 10,0 15,0 20,0 25,0 Flgure 2-9 Vorious speetrol replleotions from ТаЫе 2 1: (о) " = 35 MHz; (Ь) " = 22,5 MHz; (е) " = 17,5 MHz; (d) " = 15 MHz; (е) " = 11,25 MHz; (f) " = 7,5 MHz, interpret Figure 210 Ьу reconsidering our bandpass signal example from Figure 27 where R = 22.5/5 = 4.5. Тhis R value is indicated Ьу the dashed 1ine in Figure 2 10 showing that т = 3 and f/ в is 2.25. With В = 5 MHz, then, the minimumfs = 11,25 MHz in agreement with ТаЫе 2-1. The leftmost line in Figure 2-10 shows the lowpass sampling case, where the sample rate fs must Ье twice the signal's highest frequency component. So the norma1ized sample rate f/ в is twice the highest fre quency component over В or 2R. Figure 210 has been prominent in the 1iterature, but its normal pre sentation enables the reader to jump to the false conclusion that any 
38 Periodic Samp//пg 3.0 This line corresponds 10 Ihe lowpass sampllng саэе, Ihal is, fs= 2ис+ 812) =l Minimum fs/B 4,0 3,5 2.5 2,25 2,0 ;j " 'ш z ..' ,(>--у "'?- "' 1 d Z...z..... 1,5 1 4 4,5 5 6 7 8 Ralio: highesl frequency component/bandwidlh 10 R Figure 2-10 Minimum bandpass sampling rate from Eq, (2 10), sample rate above the minimum shown in the figure will Ье an accept- аЫе sample rate[612], There's а clever way to avoid any misunder- stаnding[lЗ], If we plot the acceptable ranges of bandpass sample fre quencies from Eq, (2-10) as а function of R we get the depiction shown in Figure 211. As we saw from Eq, (210), ТаЫе 21, and Figure 29, acceptable bandpass sample rates are а series of frequency ranges sepa rated Ьу unacceptable ranges of sample rate frequencies, that is, an acceptable bandpass sample frequency must Ье above the minimum shown in Figure 210, but cannot Ье just any frequency above that min imum. Тhe shaded region in Figure 2-11 shows those normalized band pass sample rates that willlead to spectral aliasing, 5ample rates within the white regions of Figure 2-11 are acceptable. 50, for bandpass sam pling, we want our sample rate to Ье in the white wedged areas associ- ated with some value of т from Eq. (210), Let's understand the signifi саnсе of Figure 2-11 Ьу again using our previous bandpass signal example from Figure 27, Figure 2-12 shows our bandpass signal example R value (highest fre quency component/bandwidth) of 4.5 as the dashed verticalline. Because that line intersects just three white wedged areas, we See that there are only three frequency regions of acceptable sample rates, and this agrees with our results from ТаЫе 2-1, Тhe intersection of the R = 4.5 line and the borders of the white wedged areas are those sample rate frequencies list- ed in ТаЫе 21, 50 Figure 211 gives а depiction of bandpass sampling restrictions much more realistic than Figure 2-10, 
Saтpliпg Baпdpass Sigпa/s 39 Sampling rate ('s/8) 14 8 12 10 6 4 2 о 1 234 5 6 7 8 9 Ratio: highest Irequency component/bandwidth 10 R Flgure 2-11 Reglons 01 acceptabIe bandpass sampllng rates Irom Eq, (2-10), normallzed to the sample rate over the signal bandwldth и,; В), A1though Figures 2-11 and 2-12 indicate that we сап иse а sample rate that lies оп the boиndary between а white and shaded area, these sample rates should Ье avoided in practice, Nonideal analog bandpass fi1ters, sample rate clock generator instabilities, and slight imperfections in avail- аЫе A/D converters make this idea/ case impossible to achieve exact1y. It's prudent to keep fs somewhat separated from the boиndaries, Consider the bandpass sampling scenario shown in Figure 213, With а typical (non- ideal) analog bandpass filter, whose frequency response is indicated Ьу the dashed line, it's prudent to consider the filter's bandwidth not as В, but as В ь in our equations. Тhat is, we create а gиard band оп either side of our fiYter so that there сап Ье а small amoиnt of aliasing in the discrete spectrum withoиt distorting our desired signal, as shown at the bottom of Figure 2-13. We can relate this idea of using guard bands to Figure 2-11 Ьу looking more c10sely at one of the white wedges. As shown in Figure 2 14, we' d like 
40 Perlodic Saтpllпg Sampling rate (1,/8) з " 8 = 4,5, 80 (,= 22.5 MHz 8 7 6 5 4 (, 8=3' so t.=15MHz 2 '. В = 2.25, 80 '.= 11,25 MHz о 1 2 3 4 Ratio: highest frequency component/bandwidth 5 R Flgure 2.12 AcceptabIe sample rates for the bandpass slgnal example (В = 5 MHz) with а value of R = 4.5, to set oиr sample rate as far down toward the vertex of the white area as we canlower in the wedge теans а lower sampling rate. However, the clos er we operate to the boundary of а shaded area, the more naпоw the guard band must Ье, requiring а sharper analog bandpass filter, as well as the tighter the tolerance we must impose оп the stability and accиracy of our A/D clock generator. (Remember, operating оп the boundary between а white and shaded area in Figиre 2-11 causes spectral replications to butt ир agamst еаф other.) 50, to Ье safe, we operate at some intermediate point away from any shaded boundaries as shown in Figиre 214. Further analy sis of how guard band widths and A/D clock parameters relate to the geometry of Figure 2-14 is available in reference [13]. For this discussion, we'll just state that it's а good idea to ensure that oиr selected sample rate does not lie too close to the boundary between а white and shaded area in Figure 2 11. There are а couple of ways to make sure we're not operating near а boundary. One way is to set the sample rate in the middle of а white wedge for а given value of R. We do this Ьу taking the average between the maximum and minimum sample rate terms in Eq. (2 10) for а partic ular value of т, that is, to center the sample rate operating point within а wedge we use а sample rate of 
Sampliпg Baпdpass Sigпa/s 41 L о ).. Noise  в  Fllter ,езропзе ""'- I""т,  \ >Л;  Noise ?1 и l C   Bgb  >  Guard band  Freq  ; с l [\ Bgb ---------------; r Freq Origlnal continuous signal Bandpass Filter ЛI 7 AlIl!Islng Digital samples Filtered continuous slgnal Aliaslng ''"'" ..---'о ....L..L I ' ]  I о fs ; >i< lrx ! fs j .\  Freq "'", . >' Flgure 2-13 Bandpass sampling with aliasing occurring only in the fiiter guard bands, Guard band width } AJD clock tolerance Ideal operating point Flgure 2-14 Typical operating point for (, to compensate for nonideal hardware, 
42 Period/c Sampllпg !s =.!., [ 2!с B + 2!с +В ] = !С B/2 + !С +В/2 , "", 2 m т+1 m т+1 (2-12) Another way to avoid the boundaries of Figure 214 is to use the follow- ing expression to determine an intermediate fs, operating point: 1 t. = 4!с " modd' (2 13) where modd is an odd integer[14], Of course the choice of modd must ensure that the Nyquist restriction of fs' > 2В Ье satisfied. We show the resu1ts of 1 Eqs. (2-12) and (213) for our bandpass signal example in Figure 2-15. Sampling rate ('slв) 2 "cnt' = 28,75 MHz 8 7 6 5 4 (.cn!,= 16,25 MHz з '. cn!r = 11,46 MHz о 2 3 4 Ratio: highest frequency component/bandwidth 4,5 5 R Flgure 2-15 Intermediate "1 and "cntr operating points. from Eqs, (2-12) and (2-1 З). to avoid operating at the shaded boundaries for the bandpass signal example, В = 5 MHz and R = 4,5, 
Spectro//пversioп iп Boпdposs Soтpliпg 43 2.4 Spectrallnversion in Bandpass Sampling Some оЕ the permissible fs values from Eq, (2-10) will, although avoiding aliasing problems, provide а sampled baseband spectrum (located near zero Hz) that is inverted from the original positive and negative spectral shapes, that is, the positive baseband will have the inverted shape оЕ the negative half from the original spectrum, This spectral inversion hap- pens whenever т, in Eq. (2-10), is an odd integer, as illustrated in Figures 29(b) and 29(e), When the original positive spectral bandpass components are symmetrical about the fc frequency, spectral inversion presents по problem and any nonaliasing value for f. from Eq, (210) тау Ье chosen, However, if spectral inversion is something to Ье avoid ed, for example, when single sideband signals are being processed, the minimum applicable sample rate to avoid spectral inversion is defined Ьу Eq. (2-10) with the restriction that т is the largest even integer such thatf.  2В is satisfied. t Using our definition of optimum sampling rate, the expression that provides the optimum noninverting sampling rates and avoids spectral replications butting ир against each other, except at zero Hz, is ; = 2!cB Js ' о т even (214) where т еуеп = 2, 4, 6, etc. For our bandpass signal example, Eq. (2-14) and т = 2 provide an optimum noninverting sample rate оЕ fs = 17.5 MHz, as о shown in Figure 29(c), In this case, notice that the spectrum translated toward zero Hz has the same orientation as the original spectrum cen tered at 20 MHz. Then again, if spectral inversion is unimportant for your application, we сап determine the absolute minimum sampling rate without having to choose various values for т in Eq. (2-10) and creating а table like we did for Table 2-1. Considering Figure 216, the question is "How many replications оЕ the positive and negative images of bandwidth В сап we squeeze into the frequency range оЕ 2fc + В without overlap?" That num ber of replications is R = frequency span  2!с + В = !с + в / 2 twice the bandwidth 2В В (2-15) t Single sideband signals are discussed in Section с.4 of Appendix С. 
44 Periodic Saтp//пg 1 -< 2fc+ В >- 1 i 18 8 1  L \\\ fc о fc Freq Flgure 2.16 Frequency span of а contlnuous bandpass slgnal, То avoid overlap, we have to make sure that the number of replications is an integer less than or equal to R in Eq, (2-15), 50, we can define the inte- gral number of replications to Ье Rmt where R int S; R < R int + 1 , or !с +В/2 R int S; < R int + 1 , В (2 16) With R int replications in the frequency span of 2fc + В, then, the spectral repetition period, or minimum sample rate f Smin' is f, = 2!с + В '",", R int ' (217) In our bandpass signal example, findingf Smin first requires the appro priate value for l\n! in Eq, (2-16) as R < 22.5 R 1 in!  < in! + , 5 so R iлt = 4. Then, from Eq, (217),fsmiл = (40+5)/4 = 11.25 MНz, which is the sample rate il1ustrated in Figures 29(e) and 2-12,50, we сап use Eq, (2 17) and avoid using various values for т in Eq. (2 10) and having to cre ate а table like ТаЫе 21, (Ве careful though, Eq. (217) places our sampling rate at the boundary between а white and shaded area of Figure 2 12, and we have to consider the guard band strategy discussed above,) То recap the bandpass signal example, sampling at 11,25 MHz, from Eq, (2-17), 
Spectra//пversioп iп Baпdpass Saтpliпg 4 avoids aliasing and inverts the spectrum, while sampling at 17.5 MHz, from Eq, (2-14), avoids aliasing with по spectral inversion, Now here's some good news, With а little additional digital process- ing, we сап sample at 11,25 MHz, with its spectral inversion and easily reinvert the spectrum back to its original orientation. Тhe discrete spec- trum of any digital signal сап Ье inverted Ьу multiplying the signal's dis- crete-time samples Ьу а sequence of alternating plus ones and minus ones (1, 1, 1, 1, etc,), indicated in the literature Ьу the succinct expres sion (l)п, This scheme aHows bandpass sampling at the lower rate of Eq, (217) while correcting for spectral inversion, thus avoiding the necessity of using the higher sample rates from Eq, (214), Although mu1tiplying time samples Ьу (l)п is explored in detail in Section 10,1, аН we need to remember at this poirit is the simple rule that multiplication of real sig- nal samples Ьу (1)п is equivalent to multiplying Ьу а cosine whose fre quency is 1./2, In the frequency domain, this multiplication flips the pos- itive frequency band of interest, from zero to +1./2 Hz, about 1./ 4 Hz, and flips the negative frequency band of interest, from 1./2 to zero Hz, about 1./4 Hz as shown in Figure 217, Тhe (l)п sequence is not only used for inverting the spectra of bandpass sampled sequences; it сап Ье used to invert the spectra of low-pass sampled signals, Ве aware, however, that, in the lowpass sampling case, any DC (zero Hz) component in the orig inal continuous signal wШ Ье translated to both +1./2 and 1./2 after mu1tiplication Ьу (l)п, Band 01 Band 01 interest interest ,О ll  12 ',/4 О ',/4 ',/2 Freq r:=:>   (Ь) ...:......... ..................i<.... ................<..//> ',/2 ',/4 О ',/4  12 Freq Flgure 2-17 Spectrallnversion through mu\tlplicotion Ьу (l)П: (о) origlno\ spectrum of о time-domoin sequence; (Ь) new spectrum of the product of orlginol time sequence ond the (l)П sequence, 
46 Periodic Sampliпg B B.  " , '.'" "', "о, "" " '. ". ". ". '. '. " "'. " . ..,. , . "."' ", " .. " " " " ' .' ",' ", "" ! i .  ' " , //:. /'::',<::':" .::' . . . . . .. >:"'..::.",: ,/. :'.':':,:<--.'.. .." ,,'., . // . t 'с t 'c 812 'с + 812 .. Freq 'c о Figure 2-18 Coпtlпuous sigпai spectrum where baпdpass sampliпg is пot possibIe because r;,  8/2 < 8, Now that we have an understanding of bandpass sampling, we' d bet ter remind ourselves of the situation where bandpass sampling is not pos- sible, If а continuous bandpass signal's lowest frequency component is less than the bandwidth, we can't use bandpass sampling, This condition is shown in Figure 218 wherefc  В/2 < В. There's по way to squeeze any spectral replications betweenfc  В/2 and zero Hz with bandpass sam pling, In this case, we'd have to lowpass sample the signal in Figure 2-17 at а rate of at least twice the highest frequency component, or fs ;:: 2ifc + В/2), We conclude this topic Ьу consolidating in Table 2-2 what we need to know about bandpass sampling. ТаЫе 2-2 Bandpass Sampling Relationships i Requiremeпt Sample Rate Expressioп Coпditioпs Acceptable ranges of 2!с  Б > J; > 2!с + Б т = any positive integer so fs for bandpass sam- that fs?:: 28, pling: Eq, (2-10) m  s  т+l Samp!e rate in the !сБ/2 !с +Б/2 т = any positive integer so midd!e of the accept- !scl1tr =+ tha t fs cntr ?:: 28, аЫе samp!e rate m т+l bands: Eq, (2-12) Samp!e rate at an J; = 4!с т odd = any positive odd intermediate point in integer so that fs,?:: 28 , the acceptable samp!e ' modd (Spectra! inversion occurs rate bands: Eq, (2-13) when т odd = 3, 7, 11, etc,) Optimum samp!e rate = 2fc  Б m even = any even positive to avoid spectra! fs, integer so that fs o ?:: 28, inversion: Eq, (2-14) т еуеп I Abso!ute minimum fs = 2!с + Б where I to avoid aIiasing: Eq, !Smil1 R int !с + в /2 (2-17) R int   < R int + 1 I в 
Refereпces 47 References [1] Crochiere, R.E, and Rabiner, L,R. "ОрНmиm PIR Digital Implementations for Decimation, Interpolation, and Narrowband Filtering," IЕЕЕ Trans, оп Acoust, Speech, and Sigпal Proc" Vol, ASSP23, No, 5, October 1975, [2] Steyskal, Н, "Digital Beamforming Antennas," Microwave Journal, January 1987, [3] Hill, с. "Тhe Benefits of Undersampling," Electronic Design, July 11, 1994, [4] Уаm, Е" and Redman, М, "Development of а 60-channel FDM-TDM Trans- multiplexer," COMSAT Technical Review, Vol, 13, No, 1, Spring 1983, [5] Ployd, Р., and Taylor, J, "Dual-Channel Space Quadrature-Interferometer System," Microwave System Designer's Handbook, Fifth Edition, Microwave Systems News, 1987, [6] Lyons, R. С, "How Fast Must Уои Sample," Test and Measurement World, November 1988, [7] Stremler, F. Introduction to Communication Systeтs, Chapter 3, Second Edition, Addison Wesley Publishing Со., Reading, Massachusetts, р, 125, [8] Webb, R. С. "IF Signal Sampling Improves Receiver Detection Accuracy," Microwaves & RF, March 1989, [9] Haykin, 5, Communications Systems, Chapter 7, John Wiley and Sons, New York, 1983, р, 376, [10] Feldman, С. В" and Bennett, W. R "Bandwidth and Transmission Performance," Веи Systeт Tech, Jourпal, Vol, 28, 1989, р, 490. [11] Panter, Р, F. Modulation Noise, and Spectral Analysis, McGraw-Нi11, New York, 1965, р, 527, [12] Shanmugam, К. 5, Digital and Analogue Communications Systems, John Wiley and Sons, New York, 1979, р. 378, [13] Vaughan, R., Scott, N, and White, о. "Тhe Тheory of Bandpass Sampling," IЕЕЕ Trans, оп Sigпal Processing, Vol, 39, No, 9, September 1991, pp,19731984. [14] Xenakis В" and Evans,A. "Vehicle Locator Uses Spread Spectrum Technology," RF Desigп, October 1992, 
I CHAPTER THREE I The Discrete Fourier Transform 'Пlе discrete Fourier transform (DFТ) is one of the two most common, and powerful, procedures encountered in the field of digital signal processing, (Digital filtering is the other.) 'Пlе DFТ enables us to analyze, manipиlate, and synthesize signals in ways not possible with continuous (analog) signal processing. Even though it' s now used in almost every field of engineering, we'll see applications for DFТ continue to flourish as its utility becomes more widely understood. Because of this, а solid understanding of the DFТ is mandatory for anyone working in the field of digital signal processing. The DFТ is а mathematical procedure used to determine the harmonic, or frequency, content of а discrete signal sequence. Although, for our pur poses, а discrete signal sequence is а set of values obtained Ьу periodic sampling of а continuous signal in the time domain, we'll find that the DFТ is useful in analyzing any discrete sequence regardless of what that sequence actually represents. 'Пlе DFТ's origin, of course, is the continu ous Fourier transform Х(!) defined as  Х(f) = f x(t)ej21tftdt , (3-1) where x(t) is some continuous timedomain signaU In the field of continuous signal processing, Eq, (3-1) is used to transform an expression of а continuous time--domain fиnction x(t) into а continuous frequency-domain fиnction X(fJ. Subsequent evaluation of the Х(!) expres sion enables us to determine the frequency content of any practical signal of interest and opens up а wide array of signal analysis and processing t Fourier is pronounced 'for-ya, In engineering school, we called Eq, (3-1) the "four-year" transform because it took about four years to do оnе homework problem, 49 
50 The Discrete Four/er Traпsforт possibilities in the fields of engineering and physics, One could argue that the Fourier transform is the most dominant and widespread mathematical mechanism available for the analysis of physical systems, (А prominent quote from Lord Kelvin better states this sentiment: "Fourier's theorem is not only one of the most beautiful results of modem analysis, but it тау Ье said to fumish an indispensable instrument in the treatment of nearly every recondite question in modem physics," Ву the way, the history of Fourier's original work in harmonic analysis, relating to the problem of heat condиc tion, is fascinating. References [1] and [2] are good places to start for those interested in the subject,) With the advent of the digital computer, the efforts of early digital pro-- cessing pioneers led to the development of the DFТ defined as the discrete frequencydomain sequence Х(т), where DFТ equation (exponential Еоrш):  NJ Х(т) = Lx(n)ej21tпm/N п=О (32) For our discussion of Eq, (32), х(п) is а discrete sequence of timedomain sampled values of the continиous variable хи), Тhe "е" in Eq, (32) is, of course, the base of naturallogarithms and j = Д. 3.1 Understanding the DFТ Equation Equation (32) has а tangled, almost unfriendly, look about it, Not to worry. After studying this chapter, Eq, (32) will Ьесоmе one of our most familiar and powerful tools in understanding digital signal processing, Let's get started Ьу expressing Eq, (32) in а different way and examining it care fully, From Euler's relationship j", = COS(0) jSin(0), Eq, (32) is equivalent to DFТ equation NJ (rectanguIar Еоrш):  Х(т) = Lx(n)[cos(21tnm / N)  j sin(21tnm / N)] , (33) п=О We have separated the complex exponential of Eq, (32) into its real and imaginary components where Х(т) = the mth DFТ oиtput component, i,e., Х(О), Х(l), Х(2), Х(3), etc., т = the index of the DFT output in the frequency domain, т = О, 1, 2, 3,. , "Nl, х(п) = the sequence of input samples, х(О), х(l), х(2), х(3), etc" 
Uпderstaпdlпg the OFТ Equatioп 51 п = the timedomain index оЕ the input samples, п = 0,1,2,3, ' , "N 1, j = Н, and N = the number of samples of the input sequence and the number of frequency points in the DFT oиtput. Although it looks more complicated than Eq, (3-2), Eq, (3-3) tums out to Ье easier to understand, (Н you're not too comfortable with it, don't let the j = н concept bother you too much. It's merely а convenient abstraction that helps иs compare the phase relationship between vari ous sinusoidal components of а signal. Appendix С discusses the j oper- ator in some detail.)t Тhe indices for the input samples (п) and the DFT output samples (т) always go from О to Nl in the standard DFT nota- tion, Тhis теаns that with N input time-domain sample values, the DFТ determines the spectral content оЕ the input at N equaHy spaced fre quency points. The valиe N is an important parameter because it deter- mines how many input samples are needed, the resolution of the frequency-domain results, and the amount of processing time necessary to calculate an Npoint DFТ. It's usefиl to see the structure ofEq. (3-3) Ьу eliminating the summation and writing out аН the terms, For example, when N = 4, п and т both go from О to 3, and Eq, (3-3) becomes з Х(т) = Lx(n)[coS(2тim/ 4) jSin(2т-zm/ 4)] п=О (3-4а) Writing out аН the terms for the first DFТ output term corresponding to т=О, Х(О) = х(О) cos(21t. О. О / 4)  jx(O) sin(21t. О. О / 4) + х(l) cos(21t .1. 0/ 4)  jx(l) sin(21t .1. О / 4) + х(2) cos(21t. 2. О / 4)  jx(2) sin(21t. 2. 0/4) + х(3) cos(21t. 3. О / 4)  jx(3) sin(21t. 3. 0/4), (3-4Ь) For the second DFT output term corresponding to т = 1, Eq. (3-4а) becomes t Instead of the letter j, Ье aware that mathematicians often use the letter i to represent the .[:i operator, 
52 The Discrete Foиrier Traпsforт Х(l) = х(0)СОБ(2п. О .1/ 4)  jx(0)sin(21t. О .1/ 4) + х(l) СОБ(2п .1.1/ 4)  jx(l) sin(21t .1.1/4) + х(2) СОБ(2п . 2.1/ 4)  jx(2) sin(21t . 2.1/4) + х(3) СОБ(2п' 3.1/ 4)  jx(3) sin(21t. 3.1/4), (34c) For the third output term corresponding to т = 2, Eq, (34a) ЬесотеБ Х(2) = х(0)СОБ(2п. 0.2/ 4)  jx(O) sin(21t. 0.2/4) + х(l) СОБ(2п .1. 2 / 4)  jx(l) sin(21t .1. 2/4) + х(2) cos(21tv2. 2/ 4)  jx(2) sin(21t . 2.2/4) + х(3) СОБ(2п . 3.2/ 4)  jx(3) sin(21t . 3.2/4). (34d) Finally, for the fourth and last output term corresponding to т = 3, Eq, (3-4а) ЬесотеБ Х(3) = х(О) СОБ(2п. 0.3/ 4)  jx(O) sin(21t. 0.3/4) + х(l) СОБ(2п .1. 3 / 4)  jx(l) sin(21t .1. 3/4) + х(2) СОБ(2п' 2.3/ 4)  jx(2) sin(21t. 2.3/4) + х(3) СОБ(2п . 3.3/ 4)  jx(3) sin(21t. 3.3/4), (3-4е) The above multiplication symbol "." in Eq, (34) is used merely to separate the factors in the sine and cosine terms, The pattem in Eq, (34b) through (34e) is apparent now, and we сап certainly Бее why it's convenient to use the summation sign in Eq, (33), Each Х(т) DFТ output term is the Бит of the poiпt for poiпt product between an input sequence of signal values and а complex sinusoid of the form СОБ(0)  jSin(0), The exact frequencies of the different sinusoids depend оп both the sampling rate fs, at which the orig inal signal was sampled, and the number of samples N, For example, if we are sampling а continuous signal at а rate of 500 samples/s and, then, per forrn а 16point DFТ оп the sampled data, the fundamental frequency of the sinusoids is fs/N = 500/16 or 31,25 Hz, The other Х(т) analysis fre quencies are integral multiples of the fundamental frequency, i.e" Х(О) = 1st frequency term, with analysis frequency = О . 31,25 = О Hz, Х(l) = 2nd frequency term, with analysis frequency = 1 . 31.25 = 31.25 Нz, Х(2) = 3rd frequency term, with analysis frequency = 2 . 31,25 = 62.5 Нz, Х(3) = 4th frequency term, with analysis frequency = 3 . 31,25 = 93,75 Нz, Х(15) = 16th frequency term, with analysis frequency = 15 . 31,25 = 468,75 Нz, 
Uпderstaпdiпg the OFТ Equatioп 5 Imaginary axis о) Ximag(m)  Xmag(m) # "  This point represents the complex number Х(т) = X'eal(m) + jX1mag(m), о X'eal(m) Аеа\ axis Flgure 3-1 Trlgonometrlc relatlonships of an indlvldual OFТ Х(т) complex output value, The N separate DFТ analysis frequencies are mfs fanalysis(m)="N ' (35) 50, in this example, the Х(О) DFТ term tells из the magnitude of any O-Hz ("ОС") component contained in the input signal, the Х(l) term зресiПез the magnitude of any Зl,25Нz component in the input signal, and the Х(2) term indicates the magnitude of anу 62.5Hz component in the input signal, etc. Moreover, аз we'll soon show Ьу example, the DFT output terms also determine the phase relationship between the various analysis frequencies contained in an input signal, Quite often we're interested in both the magnitude and the power (magnitude squared) contained in each Х(т) term, and the standard def initions for right triangles apply here аз depicted in Figure 3-1, If we represent an arbitrary DFТ output value, Х(т), Ьу its real and imaginary parts Х(т) = X real (т) + jXimag(m) = Xmag(m) at an angle of Хе(т) , (36) the magnitude of Х(т) is Xmag(m) = IХ(т)1 =  Xreal(т)2+Ximag(m)2 (37) Ву definition, the phase angle of Х(т), Хе (т), is [ Х. (т) ] Хе(т) = tan l lmag , X rea1 (т) (38) 
54 The Discrete Fourier Traпsforт Тhe power of Х(т), referred to as the power spectrurn, is the magnitude squared where Xps(m) = X ma i m )2 = X reai (m)2 + X imag (m)2 , (3-9) 3.1.1 DFТ Example 1 Тhe above Eqs. (3-2) and (33) will Ьесоте more meaningful Ьу way of an example, so, let's go through а simple one stepby-step, Let's say we want to sample and perform an 8point DFT оп а continuous input signal con- taining components at 1 kНz and 2 kHz, expressed as Xin(t) = sin(21t.1000.t) + 0.5sin(21t.2000.t+31t/4), (3-10) То make our example input signal xin(t) а little mOre interesting, we have the 2-kНz term shifted in phase Ьу 1350 (3п/4 radians) relative to the 1-kНz sinewave, With а sample rate of fs, we sample the input every 1/ fs = t s sec- onds, Because N = 8, we need 8 input sample values оп which to perform the DFТ. 50 the 8-element sequence х(п) is equal to xin(t) sampled at the nt s instants in tiше so that х(п) = xin(nt s ) = sin(21t.1000.nt s ) + 0.5sin(21t.2000.nt s +3п/ 4) , (3-11) If we choose to sample xin(t) at а rate of fs = 8000 samples/ s from Eq, (3-5), our DFТ results wШ indicate what signal amplitude exists in х(п) at the analysis frequencies of mfs/ N, or О kНz, 1 kНz, 2 kHz, ' , " 7 kНz, With fs = 8000 samples/s, our eight х(п) samples are х(О) = 0.3535, х(l) = 0,3535, х(2) = 0,6464, х(3) = 1.0607, х(4) = 0.3535, х(5) = 1.0607, х(6) = 1,3535, х(7) = ,3535 . (3 11 ') These х(п) sample values are the dots plotted оп the solid continuous xin(t) curve in Figure 32(a), (Note that the sum of the sinusoidal terms in Eq. (310), shown as the dashed curves in Figure 3-2(а), is equal to xin(t).) Now we're ready to apply Eq, (3-3) to determine the DFТ of our х(п) input, We'll start with m = 1 because the m = О case leads to а special resu1t that we'll discuss short1y, 50, for m = 1, or the lkНz (mf/N = 1.8000/8) DFТ frequency term, Eq, (33) for this example becomes 
Uпderstaпdiпg the оп Equatioп 55 7 Х(l) = LX(n)cos(21tn/8) jX(n)sin(21tn/8) n=о (И2) Next we multiply х(п) Ьу successive points оп the cosine and sine curves of the first analysis frequency that have а single cycle over our 8 input samples, In our example, for т = 1, we'll sum the products of the х(п) sequence with а lkHz cosine wave and а 1-kНz sinewave evaluated at the angular values of 2пп/8. Тhose analysis sinusoids are shown as the dashed curves in Figure 32(b). Notice how the cosine and sinewaves have т = 1 complete cycles in our sample interval, 5ubstituting our х(п) sample values into Eq. (312) and listing the cosine terms in the left column and the sine terms in the right column, we have Х(l) = 0,3535 . 1,0 + 0,3535 . 0,707 + 0,6464 . 0.0 + 1.0607 . 0.707 + 0,3535 . 1.0  1,0607 . O,707  1,3535.0.0  0,3535 . 0,707 0.3535 + 0,250 + 0.0  0.750  0.3535 + 0.750 +0,0  0.250  j(O,3535 . 0,0) t-- this is the п = О term  j(0.3535 . 0,707) t-- this is the п = 1 term  j(O,6464 . 1,0) t-- this is the п = 2 term  j(l,0607 . 0.707)  j(O,3535 . 0.0)  jH,0607 . O,707)  k1.3535 . 1.0)  j(0.3535 . O,707) t-- this is the п = 7 term + jO,O  jO,250  jO,6464  jO,750  jO.O  jO,750  j1,3535  jO.250 0.0  j4.0 = 4 L 900, 50 we now see that the input х(п) contains а signal component at а fre quency of 1 kНz. Using Eq. (37), Eq, (38), and Eq. (39) for our Х(l) resu1t, X mag (l) = 4, X ps (1) = 16, and X(l)'s phase angle relative to а lkHz cosine is Х,,(l) = 900, For the т = 2 frequency term, we correlate х(п) with а 2kHz cosine wave and а 2kНz sinewave. Тhese waves are the dashed curves in Figure 32(c), Notice here that the cosine and sinewaves have т = 2 complete cycles in our 
56 The Discrete Fourier Traпsforт (а) 1'5 ! SIn(21t1000t) / X1n(t) 1 ,.    ;:-<:""k 0,5 ./......--/ >_... . \. .. ,,'" '." о . -'о , .' .... .."-..--.\ " " О,5sin(21t2000t+З"'4) ....',--_... /,:",," ..--./ " "'(),5 1 1,5 о 1'5 ! т=1 1 _'О. ;:-<. 0,5 ><, ......... ........ ...........,..... ...... . о / . ...... п ... (Ь) 1 / / >/./ 5 в 7 п ...(),5 (с) o 4 1'5 ! т=2 1 О" /" /. Х '--О" /... " 'о. ,'?" O,5:...L-..c.... '1' \ 8/ ,. \ /. " \ о' , , 1 / / / ./ ...(),5 1 \ \ ,". " .. \, / ''.0 У ' ,". // .  ,  '-. ./ .  1,5 о п 1'5 ! m=З " .............'.... ......., '/ '\ /,,' ',/  O,5...:': { / о ' \ ' 1 \' / ", ,,'\,,, f I \. / / ',IIi,' 1 7 ' 'у' / / ., / ."-.......... - - . ,  5 в 7 п (d) ...(),5 1,5 о Flgure 3-2 OFТ Example 1: (а) the input slgnal; (Ь) the Input signal and the т = 1 sinusolds; (е) the Input signal and the т = 2 sinusolds; (d) the Input slgnal and the т = 3 slnusolds, 
Uпderstaпdiпg the DFT Equatioп 5: sample interval in Figure 32(c). Substituting our х(п) sample values in Eq, (3--3), for т = 2, gives Х(2) = 0,3535 . 1.0 + 0,3535 . 0.0 + 0.6464 . 1.0 + 1,0607 .0.0 + 0.3535 . 1.0 l,0607 ' 0.0 1,3535 'l,O 0.3535 . 0,0 = 0,3535 +0.0  0,6464 o.o + 0.3535 + 0,0 + 1.3535 o,o  j(0.3535 . 0.0)  j(0.3535 . 1.0)  j(O,6464 . 0,0)  j(l,0607 . l,O)  j(0.3535 . 0.0)  k1.0607 . 1,0)  jH.3535 . 0.0)  kO,3535 . l,O) + jO.O  jO,3535  jO.O + j1,0607  jO.O + j1,0607  jO,O  jO.3535 1.414 + j1.414 = 2 L 450, Here our input х(п) contains а signal at а frequency of 2 kНz whose rela tive amplitude is 2, and whose phase angle relative to а 2kHz cosine is 450, For the т = 3 frequency term, we correlate х(п) with а 3kHz cosine wave and а 3kНz sinewave, Тhese waves are the dashed curves in Figure 32(d). Again, see how the cosine and sinewaves have т = 3 complete cycles in our sample interval in Figure 32(d). Substituting our х(п) sam- ple values in Eq. (33) for т = 3, gives Х(3) = 0.3535 . 1.0 + 0,3535 . O,707 + 0.6464 . 0,0 + 1,0607 . 0.707 + 0,3535 . 1.0  1.0607 . 0.707  1.3535 ' 0,0  0,3535 . 0.707  j(O,3535 . 0,0)  j(0.3535 . 0,707)  j(0.6464 ' l,O)  j(l,0607 . 0,707)  j(O,3535 . 0,0)  jH.0607 . 0.707)  jH , 3535 . 1.0)  kO,3535 ' O,707) 
58 The Discrete Fourier Troпsform + jO,O  jO,250 + jO,6464  jO.750  jO,O  jO,750 + j1,3535  jO,250 0.0  jO.O = О L 00. 0,3535  0,250 + 0,0 + 0.750  0,3535  0,750 + 0,0 + 0,250 Our DFТ indicates that х(п) contained по signal at а frequency of 3 kHz, Let's continue our DFТ for the т = 4 frequency term using the sinusoids in Figure 3-3(а), So Eq, (3-3) is Х(4) = 0.3535 . 1.0 + 0,3535 . l,O + 0.6464.1,0 + 1,0607 . 1.0 + 0.3535 . 1,0  1.0607 . 1.0  1.3535 . 1,0  0,3535 . 1.0 0,3535  0.3535 + 0,6464  1.0607 + 0,3535 + 1.0607  1.3535 + 0,3535  j(0.3535 . 0,0)  j(O,3535 . 0,0)  j(0.6464 . 0,0)  j(l,0607 . 0,0)  j(O,3535 . 0.0)  jH,0607. 0.0)  k1.3535 . 0.0)  kO,3535 . 0.0)  jO,O  jO.O  jO.O  jO,O  jO.O  jO,O  jO.O  jO,O = 0,0  jO,O = О L 00, Ош DFТ for the т = 5 frequency term using the sinusoids in Figure 3-3(Ь) yields Х(5) = 0,3535. 1.0 + 0,3535 . 0.707 + 0.6464 . 0.0 + 1.0607 . 0.707  j(O,3535 . 0,0)  j(O,3535 . O,707)  j(O,6464 . 1.0)  j(1.0607 . 0.707) 
Uпderstaпdiпg the OFТ Equatioп 59 "(),5 1'5 1 т=4 1 ,А ".  .. "'" " (', '/ \ " х \ ,"; \ " '( \ 0,5 '/ \ . ; \ \ " '. 1', \ ( ' \ .. ,( \ ,., О " , ',\" \ '; :, \,' " 1, \'; \ 1, ".,' , , у, ,,)', \ J / :' ; ',,' \../ ',,' \/ .,' \ / '..' \,,1 . 5 6 7 п.... 1 (а) (Ь) 1,5 о 1'5 1 т=5 1 ' ( '" '_,/',...............  .."\... ,\ 'у х ", \ 0,5 ,', \ . 1 " '" . \ . "\ " 1, · о' " , , ,\ , \: , ' \,' / \ \ " \ ' \ ' ,  / " ,\ J " ' , ' ,1 , .....J  ........ " v ,r,(\ " " \ / ", \ :' r : f... \ " \ , " \ 1 I ,\, I \ , \ \,' У .' \: I , ,\ J " ,\ I ..'- '.'" 5 в 7 п.... "(),5 1,5 о "(),5 1.5 1 т=6 1 ',/ \ :..,;..... ; /I\ ,"'/\ 0,5 f : (,..).. " ), \ "'\ f, \ " ' \ ..\ " I \ :.", \ " ,', \ О \, ,\ " " , \ ' , ' , \ ' , '\" \:} \:, \ \ '1 \ \ :1 " У ,". , ' 'J"" ' , ,\' ,:' ','\ " 1 J ',\' '. \; . 1; .' J "." '.' . 5 в 7 1 (с) (d) 1,5 о 1'5 1 т=7 1 -., "! ....,.........  /' .,  "' 1 ' 'J ' ,\ /.' 1 ' \ " ,( \ "\ 0,5 1', \ ,'.: }', \', " (.\, '1' \ : ", \ .,. ,\ , " \' ' , : 1 " , \ ' '" \ О ,\ I " ' ' : ' , \,' , ' \' , "', ' , ' '" '' \ , :' } ", \/ " )! '" \.: . " " ,'\ '. " 1 " v ...... " .. 5 в 7 п ..... ,', f'. ,  \ : }', \ 1 " \,' " \,' " ,\/ "(),5 1,5 о п ..... Flgure 3-3 OFТ Example 1: (о) the Input slgnal and the m = 4 sinusolds: (Ь) the Input and the m = 5 sinusolds; (с) the input and the m = 6 sinusoids; (d) the input and the m = 7 slnusoids, 
60 The Discrete Fourier Traпsforт + 0.3535 . 1,O  1.0607 .0,707  1.3535 . 0,0  0.3535 . 0.707 = 0.3535  0.250 + 0,0 + 0,750  0.3535  0.750 + 0,0 + 0,250 = 0.0  j.O = О LO°,  j(0.3535 . 0,0)  k1,0607. 0.707)  k1.3535 . 1.0)  k0.3535 . 0,707)  jO,O + jO.250  jO.6464 + jO.750  jO.O + jO,750  j1.3535 + jO.250 For the rn = 6 frequency term using the sinusoids in Figure 33(c), Eq, (33) is Х(6) =0.3535 . 1.0 + 0.3535 . 0.0 + 0,6464 . 1,O + 1.0607 . 0,0 + 0.3535 . 1,0  1,0607. 0.0  1.3535 . 1.0  0.3535 . 0,0 = 0.3535 + 0,0  0,6464 + 0,0 + 0.3535 + 0.0 + 1.3535 + 0,0  j(0.3535 . 0.0)  j(0.3535 . 1,O)  j(0.6464 . 0.0)  j(1,0607 .1,0)  j(0.3535 . 0.0)  k1,0607 . 1.0)  k1.3535 . 0.0)  k0.3535 . 1,0)  jO,O + j0.3S35  jO.O  j1.0607  jO,O  j1,0607  jO,O + j0.3535 1,414  j1.414 = 2 L 450, For the rn = 7 frequency term using the sinusoids in Figure 33(d), Eq. (33) is Х(7) = 0.3535 . 1.0 + 0.3535.0.707 + 0.6464 . 0,0 + 1.0607 . O,707  j(0.3535 ' 0.0)  j(0.3535 . 0.707)  j(O.6464 . 1,O)  j(1,0607 . O,707) 
+ 0,3535 . 1.0  1.0607 . 0.707  1.3535 . 0,0  0.3535 . 0,707 0.3535 + 0,250 + 0.0  0.750  0.3535 + 0,750 + 0,0  0,250 Uпderstaпdiпg the DFТ Equatioп 61  j(0.3535 . 0.0)  k1,0607 . 0,707)  k1.3535 . 1.0)  kO,3535 . 0,707) + jO.O + jO,250 + jO.6464 + jO.750  jO,O + jO,750 + j1,3535 + jO,250 0,0 + j4.0 = 4 L 900, If we plot the Х(т) output magnitudes as а function of frequency, we get the magnitude spectrum of the х(п) input sequence, shown in Figure 34(a), Тhe phase angles of the Х(т) output terms are depicted in Figure 3-4(Ь), Hang in there, we're almost finished with our example. We've saved the calculation of the m = О frequency term to the end because it has а spe cial significance. When m = О, we correlate х(п) with cos(O)  jsin(O) so that Eq. (33) becomes Nl Х(О) = L x(n)[cos(O)  j sin(O)] , n=о (3 13) ! Example 1: МаgПltudе 01 Х(т) 4 " 3 2 " 1 (а) О   I 045 6 i Example 1: Phase 01 Х(т) '" degroes, Х.(т) 00 " 45 1 " 6 ' (Ь) О т " , . ! I т -45 i 4 5 7 (kHz) 90 " i 7 (kZ) j Example 1: Aeal ра" 01 Х(т) 1.5. . 1 0.5 (с) o............ о 1 2 3 4 5 6 7 (kZ)  Example 1: Imaginary part 01 Х(т) 4 " 2 1" 6 ' (d) о i " I i . I i  2 ,2 4 5 · 7 (kZ) -4 " Flgure 3-4 DFТ results from Example 1: (а) magnitude of Х(т); (Ь) phase of Х(т); (е) real part of Х(т); (d) imaginary part of Х(т), 
62 The Discrete Fourier Traпsforт Because cos(O) = 1, and sin(O) = О, Nl Х(О) = LX(n) , n=о (3 13') We сan see that Eq, (3-13') is the sum of the х(п) samples. Тhis sum is, of course, proportional to the average of х(п), (5pecifically, Х(О) is equal to N times x(n)'s average value). Тhis makes sense because the Х(О) frequency term is the nontime-varying (ОС) component of х(п), If Х(О) were nonzero, this woиld tel1 us that the х(п) sequence is riding оп а DC bias and has some nonzero average value. For our specific example input from Eq. (310), the sum, however, is zero, The input sequence has по DC component, so we know that Х(О) will Ье zero, But let's not Ье lazywe'l1 calcиlate Х(О) anу way just to Ье sure. Evaluating Eq. (33) or Eq. (:И3') for т = О, we see that Х(О) = 0,3535 . 1,0 + 0.3535 . 1,0 + 0,6464 . 1,0 + 1,0607 . 1,0 + 0,3535 . 1,0  1,0607 . 1.0  1,3535 . 1,0  0.3535 . 1,0 Х(О)= 0.3535 + 0,3535 + 0,6464 + 1.0607 + 0,3535  1.0607  1.3535  0,3535  1'(0,3535 . 0,0)  1'(0.3535 . 0.0)  1'(0.6464 . 0,0)  1'(1.0607 . 0,0)  1'(0.3535 . 0.0)  1'(l,0607 . 0,0)  1'H.3535 . 0,0)  1'(O,3535 . 0.0)  1'0.0  jO.O  jO.O  jO,O  1'0.0  1'0,0  jO.O  1'0,0 0.0  1'0,0 = О L 00, 50 our х(п) had по DC component, and, thus, its average value is zero. Notice that Figure 34 indicates that xin(t), from Eq. (3-10), has signal components at 1 kHz (т = 1) and 2 kHz (т = 2). Moreover, the lkHz tone has а magnitude twice that of the 2-kНz tone, The DFT results depicted in Figure 34 tel1 us exact1y what's the spectral content of the signal defined Ьу Eqs, (3-10) and (311). 
DFT Syттefry 63 The perceptive reader should Ье asking two questions at this point, First, what do those nonzero magnitude values at т = 6 and т = 7 in Figure 3-4(а) теan? Alsо, why do the magnitudes seem four times larger than we would expect? We'll answer those good questions shortly. The above 8-point ОРТ example, although adm.ittedly simple, illustrates two very important char- acteristics of the ОРТ that we should never forget. First, anу individual Х(т) output value is nothing more than the sum of the term-by-term products, а correlation, of an input signal sample sequence with а cosine and а sinewave whose frequencies зrе т complete cycles in the total sample interval of N samples. тhis is true по matter what the fs sample rate is and по matter how large N is in an N-point ОП The second important characteristic of the ОРТ of real input sarnples is the symmetry of the ОРТ output terms. 3.2 DFT Symmetry Looking at Figure 3-4(а) again, there is аn obvious symmetry in the ОРТ resu1ts. Although the standard ОРТ is designed to accept complex input sequences, most physical ОРТ inputs (such as digitized values of some continuous signal) are referred to as real, that is, real inputs have nonzero real sample values, and the imaginary sample values are assumed to Ье zero. When the input sequence х(п) is real, as it will Ье for аП of our ехат- ples, the complex ОРТ outputs for т = 1 to т = (N /2)  1 are redundant with frequency output values for т > (N /2), The mth ОРТ output wi11 have the same magnitude as the (Nm)th ОРТ output, The phase angle of the OPТ's mth output is the negative of the phase angle of the (Nm)th ОРТ output. 50 the mth and (Nm)th outputs are related Ьу the following: Х(т) =1 Х(т) 1 at Х,,(т) degrees =1 X(N  т) 1 at X,,(N  т) degrees. (3-14) We сап state that when the ОРТ input sequence is real, Х(т) is the сот- plex conjugate of X(Nm), or Х(т) = X'(N т) ,+ (3-14') where the superscript' symbol denotes conjugation, t Using our notation, the complex conjugate of х = а + jb is defined as х' = а  jb; that is, we merely change the sign of the imaginary part of х, In an equivalent fon1\, if х= ei", thenx' = ej", 
64 The Discrete Four/er Traпsforт In our example аЬоуе, notice in Figures 3-4(Ь) and 34(d), that Х(5), Х(б), and Х(7) are the complex conjugates of Х(3), Х(2), and Х(l), respec tively, Like the DFТ's magnitиde symmetry, the real part of Х(т) has what is called eveп symmetry, as shown in Figure 3--4(с), while the DFТ's imagi nary part has odd symmetry, as shown in Figure 3-4(d), Тhis relationship is what is meant when the DFТ is called conjugate symmetric in the litera tиre, It mеаns that, if we perform an Npoint DFТ оп а real input sequence, we'll get N separate complex DFТ output terms, but оnlу the first N /2 terms are independent. 50 to obtain the DFТ of х(п), we need оnlу compute the first N /2 values of Х(т) where О  т  (N /2)  1; the X(N /2) to X(N 1) DFТ output terms provide по additional information about the spectrum of the real sequence х(п). Although Eqs. (3-2) and (33) are equivalent, expressing the DFТ in the exponential form of Eq. (32) has а terrific advantage over the form of Eq, (33). Not оnlу does Eq, (32) save реп and paper, Eq. (32)'s exponentials are so much easier to manipulate when we're trying to analyze DFТ rela tionships. Using Eq. (32), products of terms Ьесоmе the addition of ехро- nents and, with due respect to Euler, we don't have all those trigonometric relationships to memorize. Let's demonstrate this Ьу prov ing Eq, (314) to show the symmetry of the DFТ of real input sequences. 5ubstitиting Nm for т in Eq, (32), we get the expression for the (Nm)th component of the DFТ: Nl Nl X(N  т) = Lx(n)ej21tп(Nm)/ N = Lx(n)ej21tпN /N ej21tп(m)/ N пO пO Nl = Lx(n)ej21tпej21t11m/N. пO (3 15) Because ej21tп = cos(21tn) jsin(21tn) = 1 for all integer values of п, Nl X(N  т) = Lx(n)e j21tпm/N. пO (3 15') We see that X(Nm) in Eq. (315') is merely Х(т) in Eq, (32) with the sign reversed оп X(m)'s exponentand that's the definition of the complex conjugate, This is illustrated Ьу the DFТ output phaseangle plot in Figure 34(b) for oиr DFТ Example 1. Try deriving Eq, (3-15') using the 
DFТ Uпearity 65 cosines and sines of Eq. (33), and уои'll see why the exponential form of the DFT is so convenient for analytical purposes. There's an additional symmetry property of the DFT that deserves mention at this point. In practice, we're occasionally required to deter- mine the DFТ of real input functions where the input index п is defined over both positive and negative values. If that real input function is even, then Х(т) is always real and even; that is, if the real х(п) = x(п), then, Xreal(m) is in general nonzero and Ximag(m) is zero, Conversely, if the real input function is odd, х(п) = x(п), then Xrea1(m) is always zero and Ximag(m) is, in general, nonzero. тhis characteristic of input function sym- metry is а property that the DFТ shares with the continuous Fourier trans form, and (don't worry) we'll cover specific examples of it later in Section 3.13 and in Chapter 5. 3.3 DFT Linearity Тhe DFТ has а very important property known as liпearity, Тhis property states that the DFТ of the sum of two signals is equal to the sum of the transforms of each signal; that is, if an input sequence х 1 (п) has а DFT Х 1 (т) and another input sequence х 2 (п) has а DFТ Х 2 (т), then the DFТ of the sum of these sequences xsиm(п) = х 1 (п) + х 2 (п) is Xsum(m) = Х 1 (т) + Х 2 (т) . (3 16) Тhis is certainly easy enough to prove, If we plug xsиm(п) into Eq. (3-2) to get Xsum(m), then Nl Xsum(m) = L[Xl(п) + x2(п)]ej21tпт/N п=О Nl Nl = LXl(п)ej21t11т/N + LX2(п)ej21t11т/N =Х 1 (т)+Х 2 (т). п=О п=О Without this property of linearity, the DFТ would Ье useless as an analy tical tool because we could transform only those input signals that contain а single sinewave. Тhe real-world signals that we want to analyze are much more complicated than а single sinewave, 
66 The Discrete Foиrier Traпsforт 3.4 DFT Magnltudes The DFT Example 1 results of I Х(l) I = 4 and I Х(2) I = 2 mау puzzle the reader because our input х(п) signal, from Eq. (3 11), had peak amplitudes of 1.0 and 0,5, respectively. There's an important point to keep in mind regarding DFТs defined Ьу Eq. (3-2). When а real input signal contains а sinewave component of peak amp1itude Ао with an integral number of cycles over N input samples, the output magnitude of the DFТ for that particular sinewave is М ' where M r =AP/2 . (3 17) If the DFT input is а complex sinusoid of magnitude Ао (i,e., Ai 21tfl ) with an integral number of cycles over N samples, the output magnitude of the DFТ is Мс where Мс = AoN . (3 17') As stated in relation to Eq, (313'), if the DFТ input was riding оп а DC value equal to Do' the magnitude of the DFТ's Х(О) output will Ье DoN, Looking at the real input case for the 1000 Hz component of Eq. (311), Ао = 1 and N = 8, so that M rea1 = 1.8/2 = 4, as our example shows. Equation (317) mау not Ье so important when we're using software or floating point hardware to perform DFТs, but if we're implementing the DFТ with fixed-point hardware, we have to Ье aware that the output сап Ье as large as N /2 times the peak value of the input. This means that, for real inputs, hardware memory registers mиst Ье аЫе to hold values as large as N 12 times the maximum amp1itude of the input sample values, We discuss DFТ output magnitudes in further detai11ater in this chapter. The DFТ magnitude expressions in Eqs. (317) and (3-17') are why we occasional1y see the DFТ defined in the literature as 1 Nl . Х' (т) = N Lx(n)e/21tItт/N, п=О (3-18) The l/N scale factor in Eq, (3-18) makes the amp1itudes of Х'(т) equal to half the timedomain input sinusoid's peak value at the expense of the additional division Ьу N computation. Thus, hardware or soft- ware implementations of the DFT typical1y use Eq, (3-2) as opposed to Eq, (3-18). Of course, there are always exceptions, There are commercial software packages using 
DFТ Frequeпcy Axis 67 Nl Х"(т) = lN Ix(n)ej21tnт/N, п:О and Nl х(п) =..l.... IX"(m)ej21tптl N .JN п:О (3-18') for the forward and inverse DFTs. (In Section 3.7, we discuss the теan- ing and significance of the inverse DFт.) Тhe 1/.JN scale factors in Eqs, (318') seem а little strange, but they're used so that there's по scale change when transforming in either direction. When analyzing signal spectra in practice, we're normally more interested in the relative magni tudes rather than absolute magnitudes of the individual DFT outputs, so scaling factors aren't usually that important to us. 3.5 DFT Frequency Axis Тhe frequency axis m of the DFТ result in Figure 34 deserves our attention once again. Suppose we hadn't previously seen our DFТ Example 1, were given the eight input sample values, from Eq, (11 '), and asked to реrfопn an point DFТ оп them, We' d grind through Eq, (3-2) and get the Х(т) val ues shown in Figure 4. Next we ask, "What's the frequency of the highest magnitude component in Х(т) in Нz?" Тhe answer is not "1." Тhe answer depends оп the original sample rate 1.. Without prior knowledge, we have по idea over what tiше interval the samples were taken, so we don't know the absolute scale of the Х(т) frequency юds. Тhe correct answer to the question is to take 1. and plug it into Eq, (35) with m = 1. Тhщ if 1. = 8000 samples/ s, then, the frequency associated with the largest DFТ magnitude tепn is m/S 1. 8000 fanalysis(m) =N = fam.1YSis(1) =  = 1000 Hz, If we said the sample ratef. was 75 samples/s, we'd know, from Eq, (35), that the frequency associated with the largest magnitude term is now 1.75 fanalysis(l) = 8 = 9.375Hz. ОК, enough of thisjust remember that the DFТ's frequency spacing (res- olution) is f.! N. То recap what we've learned БО far: 
68 The Discrete Fourier Traпsforт · each DFT output term is the sum of the termbyterm products of аn input timedomain sequence with sequences representing а sine and а cosine wave, · for real inputs, an Npoint DFТ's output provides only N /2 indepen dent terms, · the DFТ is а linear operation, · the magnitude of the DFT resu1ts are direct1y proportional to N, and · the DFТ's frequency resolution is fs/N. It's also important to realize, from Eq. (35), that X(N /2), when m = N /2, cor- responds to half the sample rate, i.e. the folding (Nyquist) frequency М2. 3.6 DFT Shifting Theorem There's аn important property of the DFТ known as the shifting theorem, It states that а shift in Нте of а periodic х(п) input sequence manifests itself as а constant phase shift in the angles associated with the DFT results. (We won't derive the shifting theorem equation here because its derivation is included in just about every digital signal processing text book in print,) If we decide to sample х(п) starting at п equals some inte- ger k, as opposed to п = О, the DFТ of those timeshifted sample values is Xshifteim) where Xshifteim) = ej21tkm/N Х(т) . (3 19) Equation (319) tells us that, if the point where we start samp1ing х(п) is shifted to the right Ьу k samples, the DFТ output spectrum of Xshifted(m) is Х(т) with each of X(m)'s complex terms mu1tip1ied Ьу the linear phase shift ei 2пkт / N , which is merely а phase shift of21tkm/Nradians or 360km/N degrees. Conversely, if the point where we start sampling х(п) is shifted to the left Ьу k samples, the spectrum of Xshifted(m) is Х(т) mu1tip1ied Ьу ej2xkт/N, Let's illustrate Eq, (319) with an example, 3.6. 1 DFТ Example 2 Suppose we sampled our DFТ Example 1 input sequence later in time Ьу k = 3 samples. Figure 35 shows the original input Нте function, xin(t) = sin(21t1000t) + 0.5sin(21t2000t+31t/4) . 
DFТ Shiftlпg Theoreт 69 Тhe DFТ in Example 1 was taken over these eight sample values, I 'f .. /;"(tl / i (Ш'/ \\ /. 1,5 i '-..... --3 2 1 о 2 3 4 5 6 7 п..... The DFТ in Example 2 is taken over these eight sample values, Flgure 3-5 Comparlson of sampling tlmes between DFT Example 1 and OFТ Example 2, We сап see that Figure 3-5 is а continuation of Figure 3-2(а), Our new х(п) sequence becomes the values represented Ьу the so1id black dots in Figure 3-5 whose values are х(О) = 1,0607, х(2) = l,0607, х(4) = O,3535, х(6) = 0,3535, х(l) = 0,3535, х(3) = 1.3535, х(3) = 0.3535, х(7) = 0.6464 , (320) Performing the DFТ оп Eq. (3-20), Xshifted(т) is X'hifte/ m) = m X'hifte/m)'S X'hifte/ m)' s X'hifte/m)'s X'hifte/m)'S тagnitude phase real part iтagтary part О О О О О 1 4 +45 2,8284 28284 2 2 45 1,4142 1.414 3 О о о о 4 О О О О 5 О О О О 6 2 +45 1.4142 1.4142 7 4 45 2.8284 2,828 (321) 
70 The Diserete Fourier Traпsform j Example 2' МаgПl!udе 01 Х shlhed (т) 4 . . з (а) 2' · ' 1 О" """"""" I ..... m О 3 4 5 7 (kHz) t Example 2: 45 . 2 (Ь) 0' 1  I --45 Phas" 01 X Sh11ted (т) in d"g,e"s .. 4 i 6 ! Example 2 3 . 2 (с) ! О. О Real ра'! 01 Xshihed (т) . I '''''''''''. з 4 5 .. m (kHz) 7 1'- m i (kHz) . 4t Exa.mPle 2' Imaglnary ра,! 01 X shlfted (т) 2t 2 . 7 (d) О' I I ... I .- ! 1 · 3 4 5 '" (kZ) Figure 3-6 OFТ results from Example 2: (а) magnitude of Xshlf1ed(m): (Ь) phase of XShlf1ed(m); (е) real part of XShlf1ed(m); (d) Imaginary part of Xshif1ed(m), The values in Eq, (321) are illustrated as the dots in Figure 3-6. Notice that Figure 36(a) is identical to Figure 34(a), Equation (319) told us that the magnitude of Xshifted(m) should Ье unchanged from that of Х(т), That's а comforting thought, isn't it? We wouldn't expect the DFТ magnitude of our original periodic xin(t) to change just because we sampled it over а dif ferent time interval, The phase of the DFТ result does, however, change depending оп the instant at which we started to sample xin(t), Ву looking at the т '= 1 component of Xshifted(m), for example, we сап doublecheck to see that phase values in Figure 36(b) are correct, Using Eq. (319) and remembering that Х(l) from DFТ Example 1 had а magni tude of 4 at а phase angle of 90 (or п/2 radians), k '= 3 and N = 8 so that X shifted (l) = ej21tkm/N . Х(l) = ej2.1/8. 4ej1t12 = 4ej(61t/841t/8) = 4e j1t / 4 , (322) 50 Xshifted(l) has а magnitude of 4 and а phase angle of те/ 4 or +450, which is what we set out to prove using Eq, (319), З.7 Inverse DFT Although the DFТ is the major topic of this chapter, it's appropriate, now, to introduce the inverse discrete Fourier transform (IDFТ). Typically we think of the DFT as transforming timedomain data into а frequency- domain representation, Well, we сап reverse this process and obtain the original time-domain signal Ьу performing the IDFT оп the Х(т) fre- queI1cy-dоmain values. The standard expressions for the IDFT are 
DFTLeakage 71 Nl х(п) =  LX(m)ei21tтnIN т=О (3-23) and equally, Nl х(п) =  L X(m)[cos(21tmn / N) + j sin(21tmn / N)] т=О (3-23') Remember the statement we made in Section 3,1 that а discrete time- domain signal сап Ье considered the sum of various sinusoidal analytical frequencies and that the Х(т) outputs of the DFТ are а set of N complex val- ues indicating the magnitиde and phase of each analysis frequency сот- prising that sum, Equations (3-23) and (3-23') are the mathematical expressions of that statement. It's very important for the reader to under- stand this concept, If we perform the IDFТ Ьу plugging our results from DFТ Example 1 into Eq. (3-23), we'll go from the frequency-domain back to the time-domain and get our original real Eq, (3-11') х(п) sample values of х(О) = 0,3535 + jO,O х(2) = 0,6464 + jO,O х(4) = 0,3535 + jO.O х(6) = 1,3535 + jO,O х(l) = 0.3535 + jO.O х(3) = 1.0607 + jO.O х(3) = l,0607 + jO.O х(7) = O,3535 + jO.O , Notice that Eq, (323)'s IDFТ expression differs from the DFТ's Eq. (3-2) only Ьу а 1/ N scale factor and а change in the sign of the exponent, Other than the magnitude of the results, every characteristic that we've covered, thus far, regarding the DFТ, also applies to the IDFТ, 3.8 DFT Leakage Hold оп to your seat now. Here's where the DFТ starts to get really inter- esting, The two previous DFT examples gave us correct results because the input х(п) sequences were very carefиlly chosen sinusoids, As it tums out, the DFТ of sampled realworld signals provides frequencydomain results that сап Ье misleading. А characteristic, known as leakage, causes our DFТ results to Ье only аn approximation of the true spectra of the original input signals prior to digital sampling. Although there are ways to minimize leakage, we can't eliminate it entirely, Thus, we need to understand exactly what effect it has оп our DFT results, 
72 The D/screte Fourier Traпsforт Let's start from the beginning, DFTs are constrained to operate оп а finite set of N input values sampled at а sample rate of f s ' to produce ап N-point transform whose discrete outputs are associated with the indi vidиal analytical frequencies f analysis(т), with fanalysis(т) = т;; ,where т = 0,1,2,...,N  1, (324) Equation (3-24), illustrated in DFТ Example 1, тау not seem like а prob lem, but it is, Тhe DFT produces correct results оnlу when the input data seqиence contains energy precisely at the analysis frequencies given in Eq, (324), at integral multiples of our fundamental frequency f.lN. If the inpиt has а signal component at some intermediate frequency between our analytical frequencies of тfs/N, say l,5f.lN, this input signal will show ир to some degree in аll of the N output analysis frequencies of our DFТ! (We typicaHy say that input signal energy shows ир in аН of the DFТ's output biпs, and we'H see, in а moment, why the phrase "output bins" is appropriate,) Let's understand the significance of this problem with another DFТ example. Assume we're taking а 64-point DFТ of the sequence indicated Ьу the dots in Figure 37(a), The sequence is а sinewave with exactly three cycles contained in our N = 64 samples, Figure 37(b) shows the first half of the DFT of the input sequence and indicates that the sequence has an average value of zero (Х(О) = О) and по signal components at апу fre quency other than the т = 3 frequency, No surprises so far. Figure 37(a) also shows, for example, the т = 4 sinewave analysis frequency, super- imposed over the input sequence, to remind us that the analytical fre quencies always have ап integral number of cycles over our total sample interval of 64 points, Тhe sum of the products of the input sequence and the т = 4 analysis frequency is zero, (Or we can say, the correlation of the input sequence, and the т = 4 analysis frequency is zero.) The sum of the products of this particular threecycle input sequence and апу analysis frequency other than т = 3 is zero, Continuing with our leakage exaт ple, the dots in Figure 3-8(а) show ап input sequence having 3,4 cycles over our N = 64 samples, Because the input sequence does not have ап integral number of cycles over our 64-sample interval, input energy has leaked into аН the other DFТ output Ьins as shown in Figure 38(b). Тhe т = 4 Ьin, for example, is not zero because the sum of the products of the input sequence and the т = 4 analysis frequency is по longer zero, This is leakageit causes апу input signal whose frequency is not exactly at а DFТ Ып center to leak into аН of the other DFТ output bins, Moreover, 
DFTLeakage 73 (а) т = 4 analysis frequency ... r / :i1 j \ . ... . ! , ' .I i. \ !i! i i ;;;; I .\ l! [! \8 \ l' i : I 11 \ .1 i <! I i i. . i!;:::I'!: .1 ... ' . ' \ "' ... : .. !: . ' Time ;:::! i 1- .' j\:! j j i! \:!, i8 ' \ : : ' ; 8! ,,1 i .. DFT output magnitude . (Ь) 35 30 25 20 15 10 5 о .-..-.+.......................................................................................... о 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 (Fq) Flgure 3-7 64-point OFТ: (а) \nput sequence of three cycles and the m = 4 analysls frequency sinusold: (Ь) OFТ output magnitude, leakage is an unavoidable fact of lifе when we perform the DFT оп real world finite-length time sequences, Now, as the English philosopher Douglas Adams would say, "Don't panic." Let's take а quick look at the cause of leakage to learn how to pre- dict and minimize its unpleasant effects. То understand the effects of leak age, we need to know the amplitude response of а DFТ when the DFТ's input is an arbitrary, real sinusoid, A1though Sections 3,14 and 3,15 dis- cuss this issue in detail, for our purposes, here, we'll just say that, for а real cosine input having k cycles in the N-point input time sequence, the amplitude response of an N-point DFТ Ьin in terms of the Ьin index т is approximated Ьу the sinc function Х(т) '" N . sin[1t(k  т)] 2 1t(k  т) (325) 
74 The D/screte Four/er Traпsforт (а) т = 4 analysis frequency Time за DFТ output magnitude 25 . 20 15 i I I I i 10 i i 5.,.ill. uш . I \. !! l ' 1 . 1 ...... о I I I I . ., .....,.,.,..,..,.,..,..,..,..,..,..,-,...,.J!I-I!I..... О 2 4 6 8 10 12 14 16 18 20 22 24 26 28 ЗО т (Freq) (Ь) Flgure 3-8 64-polпt DFТ: (а) 3,4 cycles input sequence and the т = 4 analysls frequency slnusold; (Ь) DFТ output magnltude, We'll use Eq. (3-25), Шustrаtеd in Figure 3-9(а), to help us determine how much leakage occurs in DFTs. We сап think of the curve in Figure 39(a), comprising а main 10Ье and periodic peaks and valleys known as sidelobes, as the continuous positive spectrum of аn Npoint, real cosine time sequence having k complete cycles in the N-point input Нте inter val. Тhe DFТ's outputs are discrete samples that reside оп the curves in Figure 39; that is, our DFT output wi11 Ье а sampled version of the соn- tinuous spectrum. (We show the DFTs magnitude response to а real input in terms of frequency (Hz) in Figure 3-9(Ь).) When the DFTs input sequence has exact1y аn integral k number of cycles (centered exactly in the т = k Ьin), по leakage occurs, as in Figure 39, because when the angle in the numerator of Eq, (325) is а nonzero integral mu1tiple of п, the sine of that angle is zero. 
OFТ Leakage 75 (а) N 2" Continuous, positive, frequency spectrum 01 а discrete cosine sequence  Discrete DFТ sequence defined Ьу N sin [ 1t ( k --m)] Х(т) = 2"' 1t(k--m) /1/ jj . V .  .'- .....  ...............  , ,............. Freq " ( m=k k k1 k+1 k+З k+5 N . 2" .. . АА/""'.../"'.. II!I ... .. Freq (Hz) (Ь)  /"'./\ kfslN (k--З)fslN (k1)fslN (k+1)fs/N (k+З)fs/N (k+5)fslN Flgure 3-9 DFТ posltlve frequency response due to оп N-point input sequence contolning k cycles of о reol cosine: (о) omplitude response os о functlon of bin Index т; (Ь) mognltude response os о function of frequency In Hz, Ву way of example, we can Шustrаtе again what happens when the input frequency k is not located at а bin center, Assume that а real 8-kНz sinusoid, having unity amplitude, has been sampled at а rate of fs = 32,000 samples/s, If we take а 32-point DFT of the samples, the DFТ's frequency resolution, or bin spacing, is f/N = 32,000/32 Hz = 1,0 kHz, We сап pre- dict the DFТ's magnitude response Ьу centering the input sinusoid's spec- tral curve at the positive frequency of 8 kНz, as shown in Figure 3-10(а), Тhe dots show the DFТ's output bin magnitudes, Again, here's the important point to remember: the DFT output is а sampled version of the continuous spectral curve in Figure 3 10(а), Тhose sampled values in the frequencydomain, located at тf/N, are the dots in Figure 3-10(а), Because the input signal frequency is exactly at а DFT 
76 The Discrete Fourier Traпsform (а) ,\16 '''''' ''''" - ш"' / I \  /'...... /". /\ I ' /'-...  ............. .......---.. 'м................'' I .................. 3 4 5 6 7 8 9 10 11 12 13 Freq (kHz) (\ ''''"''''''''''' - о.. .. J , ." I ' ..  1 i . ...... ,.............1.....'/1 V I i j V 1"-/"1............., ....... 4 5 б 7 8 9 10 11 12 13 (Ь) .. Freq (kHz) . 3 ( "  14.05 Input frequency = 8,75 kHz i' 5,15.. i -'"" l' ' · V' I . . (с) . 345 б 7 8 9 10 11 12 13 Freq (kHz) Flgure 3-10 DFТ bIn posltlve frequency responses: (о) DFТ input frequency = 8,0 kHz; (Ь) DFТ input frequency = 8,5 kHz; (с) DFТ Input frequency = 8,75 kHz, Ып center, the DFT results have only one nonzero value. Stated in another way, when an input sinusoid has an integral number of cycles over N timedomain input sample values, the DFf outputs reside оп the continuous spectrum at its peak and exactly at the curve's zero crossing points. From Eq. (325) we know the peak output magnitude is 32/2 = 16, (Н the rea1 input sinusoid had an amp1itude of 2, the peak of the response curve would Ье 2 . 32/2, or 32,) Figure 310(b) i11ustrates DFf leakage where the input frequency is 8.5 kНz, and we see that the frequency- domain samp1ing resu1ts in nonzero magnitudes for a11 DFf output bins. An 8.75-kНz input sinusoid would resu1t in the leaky DFf output shown in Figure 310(c). If we're sitting at а computer studying leakage Ьу plot ting the magnitude of DFf output values, of course, we'll get the dots in Figure 310 and won't see the continuous spectral curves. At this point, the attentive reader should Ье thinking: "If the continuous spectrиms that we're sampling are symmetrical, why does the DFf output in 
DFT Leakage 77 Figure з..8(Ь) look so asymmetrical?" In Figure 38(b), the Ьins to the right of the third Ьin are decreasing in amp1itude faster than the Ьins to the left of the third Ьin, "And another thing, evaluating the continuous spectrиm's X(тfs) function at an abscissa value of 0,4 gives а magnitude scale factor of 0.75, Applying this factor to the DFТ's maximum possible peak magnitude of 32, we should have а third Ьin magnitude of approximately 32 . 0,75 = 24but Figure з..8(Ь) shows that the thirdbin magnitude is s1ight1y greater than 25, What's going оп here?" We answer this Ьу remembering what Figure 38(b) really represents, When examining а DFТ output, we're normally interested Оnlу in the т = О to т = (N/2l) Ьins. Thus, for our 3.4 cycles per sample interval example in Figure з..8(Ь), only the first 32 Ьins are shown, WeU, the DFТ is periodic in the frequency domain as illustrated in Figure 311, Upon examining the DFТ's output for higher and higher frequencies, we end up going in circles, and the spectrиm repeats itself forever, The more conventional way to view а DFT output is to uпwrap the spectrum in Figure 311 to get the spectrum in Figure 312. Figure 312 shows some of the additional replications in the spectrum for the 3.4 cycles per sample interval example, Concerning our DFT output asymmetry problem, as some of the input 3.4-cycle signal amp1itude leaks into the 2nd Ьin, the 1st Ьin, and the Oth Ьin, leakage continues into the  1st bin, the 2nd Ьin, the 3rd Ьin, etc, Remember, the 63rd bin is the  1st Ьin, the 62nd Ьin is the 2nd Ьin, and so оп, These bin equivalencies allow '! . . , . \ т=ЗЗ . . / m..Э2 ._.-.......... ../ .........  т:: 31 -....... .. .. . . ., . . . . .. . .... 10 ./ т  (Fr.q) 4 Flgure 3-11 Cyclic representation of the DFТ's spectral replication when the DFТ input is 3,4 cycles per sample interval, 
78 The Discrete Fourier Traпsforт Input signal 8150 shows Up 8t ( О  3.4 = --3.4 cycl"slint"rval Input signal is 8t 3.4 . .( cycleslinterval Input signaJ 8150 shows Up 8t 64  3.4 = 60.6. and 64 + 3.4 = 67.4 cycles/interval r. ) Spectтums repealln Spectrums repealln thls dlrectlon 8. . ' Ihis dlrection ....-- . 1 :.., . .8! :.. i.  ... rTii 111111 i i 1 i I i 1 i"'H PfТii 111111111 i 11 i i',',  12 10   ---4 2 О 2 4 6 8 10 12 52 54 56 58 60 62 64 66 68 70 72 74 76 т (Freq) Figure 3-12 Spectral replicatlon when the DFТ input 15 3,4 cycles per sample interval, 'i' . DFТ output magnitude (with input = 3,4 cycleslinterval) . т=О.. ..... . . ,. :. ..I!I, ',: : ;!'.. ''TT 111 i 1111111 i I i 11 i"' 50 52 54 56 56 60 62 О 2 4 6 6 10 12 14 H4)H2)(10)(..s) (--6) (--4) (2)  .; (а) .- т (Fr"q) . . DFТ output magnitude (with input = 28,6 cycleslinterval) (Ь) т = N/2 . = 32 . J . '!'  . .. : . I " ' .. ........ 1:,,:;:. '....... I . 1 1 I I I I I I I , I , I I I I I , I I I I I 1 1 . I ... 16 20 22 24 26 26 за 32 з4 36 36 40 42 44 46 т (Fr"q) Figure 3-13 DFТ output magnltude: (а) when the DFТ input i5 3.4 cycle5 per sample Interval; (Ь) when the DFТ Input 15 28,6 cycle5 per sample Interval, иs to view the DFТ oиtpиt bins as if they extend into the negative fre quency range, as shown in Figиre ЗlЗ(а). Тhe resиlt is that the leakage wraps arouпd the т = О freqиency Ьin, as well as aroиnd the т = N fre- quency Ьin. Тhis is not sиrprising becaиse the т = О freqиency is the т = N 
DFТ Leakage 79 frequency. Тhe leakage wraparound at the m = О frequency accounts for the asymmetry about the DFТ's m = 3 bin in Figure 38(b). Recall from the DFT symmetry discussion, when а DFT input sequence х(п) is real, the DFТ outputs from m = О to m = (N/2l) are redundant with frequency bin values for m > (N /2), where N is the DFT size, The mth DFT output will have the same magnitude as the (Nm)th DFТ output. That is, I Х(т) I = I X(Nm) I , What this means is that leak- age wraparound also occurs about the m = N /2 bin, Тhis сап Ье illus trated using an input of 28.6 cycles per sample interval (32  3.4) whose spectrum is shown in Figure 3-13(Ь). Notice the similarity between Figure 3IЗ(а) and Figure 3IЗ(Ь), So the DFТ exhibits leakage wrap- around about the m = О and m = N /2 bins. Minimum leakage asymme- try will occur near the N/4th bin аБ shown in Figure 314(a) where the full spectrum of а 16,4 cycles per sample interval input is provided. Figure 3-14(Ь) shows а close-up view of the first 32 bins of the 16,4 cycles per sample interval spectrum. DFТ ou!pu! magni!ude (wi!h inpu! = 16.4 cycleslin!erval) 25 . . 20 . .: 15 (а) 10 .: i. .i!1I!I 5 .lI!i'ii-:. .II!I!!:\;. .... i ' i; , , : : :I!"""'I"""" : i : i ! : i i 1.... О '"""IIII' 1 '11111111111111111111111 IIIIIIIIIIIIIIIII'""" ... О 4 8 12 16 20 24 26 32 36 40 44 46 52 56 60 (:.:u 25 DFТ ou!pu! magni!ude (wi!h inpu! = 16.4 cycleslin!erval) . 20 15 . (Ь) 10 .' . 5 . " . .... ;:: i............ о ,.,-, , т ,  ,  т I I I I I I I I I I I I I I I I I I I I I I ... О 2 4 6 6 10 12 14 16 18 20 22 24 26 28 30 т  (Fr.q) m= Nl4= 16 Flgure 3-14 DFТ output magnitude when the DFT input is 16,4 cycles per sample interval: (а) full output spectrum view; (Ь) close-up view showing minimlzed leakage asymmetry at frequency т = N/4, 
80 The D/screte Four/er Traпsforт Уои сan read about leakage all day, However, the best way to appreci ate its effects is to sit down at а computer and use а software program to take DFТs, in the form of fast Fourier transforms (FFТs), of your personaHy generated test signals like those in Figures 37 and 38, Уои сап, then, experiment with different combinations of input frequencies and various DFr sizes. You'll Ье аЫе to demonstrate that DFТ leakage effect is trouble- some because the bins containing lowlevel signals are corrupted Ьу the sidelobe levels from neighboring bins containing highamplitude signals. Although there's по way to eliminate leakage completely, an important technique known as wiпdowiпg is the most common remedy to reduce its unpleasant effects. Let's look at а few DFТ window examples, 3.9 Windows Windowing reduces DFT leakage Ьу minimizing the magnitude of Eq, (325)'s sinc function's sin(x)/x sidelobes shown in Figure 39. We do this Ьу forcing the amp1itude of the input time sequence at both the beginning and the end of the sample interval to go smootbly toward а single common amp1itude value. Figure 3 15 shows how this process works, If we consider the infiniteduration time signal shown in Figure 315(a), а DFТ сап on1y Ье performed over а finitetime sample intervallike that shown in Figure 315(c). We сan think of the DFТ input signal in Figure 3-15(с) as the prod uct of an input signal existing for all time, Figure 315(a), and the rectan gular window whose magnitude is 1 over the sample interval shown in Нgше 3-15(Ь), Anytime we take the DFТ of а finite-extent input sequence we are, Ьу default, multiplymg that sequence Ьу а window of аН ones and effectively multiplymg the input values outside that window Ьу zeros, As it tums out, Eq. (3--25)'s sinc function's sin(x)/x shape, shown in Figure 39, is caused Ьу this rectangular window because the continuous Fourier transform of the rectangиlar window in Figure 3-15(Ь) is the sinc function. As we'l1 soon see, it's the rectangular window's abrupt changes between one and zero that are the cause of the sidelobes in the the sin(x)/x sinc function, То minimize the spectralleakage caused Ьу those sidelobes, we have to reduce the sidelobe amplitudes Ьу using window functions other than the rectangular window. Imagine if we multiplied our DFТ input, Figure 3-15(с), Ьу the triangular window function shown in Figure 315(d) to obtain the windowed input signal shown in Figure 315(e), N otice that the values of our final input signal appear to Ье the same at the beginning and end of the sample interval in Figure 315(e). Тhe reduced discontinuity decreases the level of relatively high frequency components in our overall DFТ output; that is, our DFТ Ьin sidelobe levels are reduced in magnitude using а triangu1ar window. Тhere are other window func- 
Windows 81 tions that reduce leakage even more than the triangular window, such as the Hanning window in Figure 3-15(f), Тhe product of the window in Figure 3-15(Е) and the input sequence provides the signal shown in Figure 315(g) as the input to the DFТ. Another common window fиnction is the Hamming window shown in Figure 315(h), It's much like the Hanning window, but it's raised оп а pedesta/. Sampl. ! Interval / / Time (е) I Tlme (а)  'O   ..........., J : RectangUIar "'ndow , Sample 1 interval""""""'" 1,0 (Ь) (1)  Time Time I  Sampl& ; lntervaJ! I . Tlme (g) (о) ./  t: " 1.0 1,0  : (h) (d)  Тiтe Time Flgure 3.15 Minimlzing sample Interval endpoint dlseontinuities: (а) Infinite duration input sinusoid: (Ь) reetangular wlndow due to finite-time sample interval; (е) produet of reetangular window and Infinlte-duratlon Input slnusoid; (d) trlangular wlndow funetlon; (в) produet of triangular wlndow and Inflnlte-duration Input slnusold; (О Hanning wlndow funetlon: (ф produet of Hanning wlndow and Infinite-duration input s\nusoid; (h) Hammlng window funetlon, 
82 The Discrete Fourier Troпsform Вefore we see exact1y how well these windows minimize DFТ leakage, let's define them mathematically. Assummg that ош original N inри! signal sam.ples are indexed Ьу п, where О S; п S; Nl, we'll call the N time--domain window coefficients w(n); that ш, an inри! sequence х(п) is multiplied Ьу the сопеsропding window w(n) coefficients before the DFТ is perfonned. So the DFТ of the windowed х(п) inри! sequence, Xw(m), takes the fonn of Nl Хю(т) = Lro(n).x(n)ej27t11m!N. п=О (326) То use window functions, we need mathematical expression о! them in terms о! п. The following expressions define our window function coefficients: Rectangular window: w(n) = 1, for п = 0,1,2, . . ., Nl. (3-27) (also called the unifonn, or boxcar, window) Triangular window: п (very similar to the ro(п) =  ,for п = О, 1, 2,...,N / 2, and Bartlett[3], and N/2 Parzen[4,5] windows) =2.....!!........ N/2' for п =N /2+1,N /2+2,...,N 1. (3-28) Hanning window: w(n) = 0.5 0.5соs(21tnIN-1), (also called the raised for п = 0,1,2,. . ., Nl. (3-29) cosine, Нann, or von Нann window) Hamrning window: w(n) = 0.54  0.46cos(21tnIN1), for п = О, 1, 2, . . ., Nl. (30) lf we plot the w(n) values from Eqs. (3-27) through (330), we'd get the corresponding window functions like those in Figшеs 315(b), 315(d), 315Щ, and 315(h).t t In the literature, the equations for window functions depend оп the range of the sample index п, We define п to Ье in the range О < п < N  1, Some authors define п to Ье in the range N /2 < п < N/2, in which case, for example, the expression for the Hanning window would have а sign change and Ье ш(п) = 0.5 + O,5cos(21t11/N-1), 
Windows 83 Тhe rectangular window's amplitude response is the yardstick we nor- mally use to evaluate another window function's amplitude response; that is, we typically get an appreciation for а window' s response Ьу comparing it to the rectangular window that exhibits the magnitude response shown in Figure 3-9(Ь). Тhe rectangular window's sin(x)/x magnitude response, I W(m) 1, is repeated in Figure 316(a). Also included in Figure 316(a) are the Hamming, Hanning, and triangular window magnitude responses, (Тhe frequency axis in Figure 3 16 is such that the curves show the response of а single Npoint DFТ bin when the various window functions are used.) We сап see that the last three windows give reduced sidelobe levels relative to the rectangular window. Because the Hamrning, Hanning, and triangu- lar windows reduce the timedomain signallevels applied to the DFТ, their main lobe peak values are reduced relative to the rectangular window, (Because of the nearzero w(n) coefficients at the Ьеgiлning and end of the sample interval, this signallevelloss is called the processing gain, or loss, of а window.) Ве that as it тау, we're primari1y interested in the windows' sidelobe levels, which are difficult to see in Figure 316(a)'s linear scale. We will avoid this difficulty Ьу plotting the windows' magnitude responses оп а logarithmic decibel scale, and normalize each plot so its main lobe peak values are zero dB. (Appendix Е provides а discussion of the origin and utiIity of measuring frequencydomain responses оп а logarithmic scale using decibels.) Defining the log magnitude response to Ье I WdB(m) 1, we get I WdB(m) I Ьу using the expression ( IW(m) 1 ) IW dB (m)I=20.10g 1o IW(O)I . (3-31) (Тhe I W(O) I term in the denominator of Eq. (3-31) is the value of W(m) at the peak of the main lobe when m = О.) Тhe I WdB(m) I curves for the var ious window functions are shown in Figure 316(b). Now we сап really see how the various window sidelobe responses compare to each other, Looking at the rectangular window's magnitude response we see that its main lobe is the most narrow, f/N, However, unfortunately, its first sidelobe level is only  13 dB below the main lobe peak, which is not so good, (Notice that we're only showing the positive frequency portion of the window responses in Figure 316,) The triangular window has reduced sidelobe levels, but the price we've paid is that the triangular window' s main lobe width is twice as wide as that of the rectangular win dow's. Тhe various nonrectangular windows' wide main lobes degrade the windowed DFT's frequency resolution Ьу almost а factor of two. However, as we'll see, the important benefits of leakage reduction usually outweigh the loss in DFТ frequency resolution, 
84 Тhe Discrete Fourier Troпsform Linear-scale window magnitude responses, IW(m)1 1" ' Rectangular (dolted) (а) Hanning (solid) ...... ..... ..8 . ,.... ..... -. .. ,..... fs/N 2fs/N 4fs/N Freq Logarithmic-scale window magnitude responses, IW dB (m)1 'п dB Rectangular (dotted) Hanning (solid) .10 -20 (Ь) -30 " ;;'. " -40 " .'. "  -50 , I , -60 fs/N 2fs/N 4fs/N Freq Flgure 3-16 Wiпdow magnitude respoпses: (а) I W(m) I оп а lIпear scale; (ь) I WdB(m) I оп а normalized logarithmic scale, Notice the further reduction of the first sidelobe level, and the rapid side lobe rol1-off of the Hanning window. Тhe Hamming window has even lower first sidelobe levels, but this window's sidelobes roll оН slowly rela- tive to the Нanning window. Тhis mеans that leakage three or four bins away from the center Ьin is lower for the Hamming window than for the Hanning window, and leakage а half dozen or so bins away from the сen- ter Ьin is lower for the Hanning window than for the Hamming window, 
  , \ i; \ . I . 5 .,  1; 1\ I l j t : I : '- I i 1,,: ----...... ... ! ! I : ""'."..'..JIJI",     " о " '..-1.t-"';;;"';;;"'::;"';;;A"""" 0123456789101112131415161718 2728293031 т (Fr"q) Windowed input signal (а) 1 / 0.8 /.. 0,6 //: i: 04 /, ,1; . // 1']: II!I 0,2/' 1!il! . i ...... . II : I Ц i , !. : ,! ' :! ,.. ., 1;. --{),4 ... --{),6 --{),8 1 OFТ output magnitudes 25 . 20 15 (Ь) 10 Windows 85 ", Hanning ..' wlndow function .;ij; I : ! : j i '" ! i i i.;1 "" i:: 1: : i , .. """ "__ . i : ! i i ! I ...!!!.......... и!.i 1.1 п ... (rlme) 1 :: , ' , "" , . i-lll. )'1 it! i!il' .. i i 1. J«п) - [0.5  0.500.(2."'64)1' [.ln(21tЗ.4r>'64)]  ' window function З.4-сусlе slnewave · Rectangular window response  Hanning window response Flgure 3-17 Hanning window: (а) 64-sample product of а Hanning wlndow and а 3,4 cycles per sample intervallnput slnewave; (Ь) Hanning DFТ output response vs, rectangular window DFТ output response, When we apply the Hanning window to Figure 3-8(a)'s 3,4 cycles per sample interval example, we end ир with the DFТ input shown in Figure 317(a) under the Hanning window envelope, Тhe DFТ outputs for the windowed waveform are shown in Figure 317(b) along with the DFТ results with по windowing, i,e" the rectangu1ar window, As we expected, 
86 The Discrete Fourier Traпsforт the shape of the Hanning window's response looks broader and has а lower peak amplitude, but its sidelobe leakage is noticeably reduced from that of the rectangular window, We сап demonstrate the benefit of using а window function to help us detect а lowlevel signal in the presence of а nearby high-level signal, Let's add 64 samples of а 7 cycles per sample interval sinewave, with а peak amplitude of only 0.1, to Figure 3-8(a)'s unityamplitude 3.4 cycles per sample sinewave, When we apply а Hanning window to the sum of these sinewaves, we get the time--domain input shown in Figure 318(a). Had we not windowed the input data, our DFТ output would Ье the squares in Figure 3-18(Ь) where DFТ leakage causes the input signal сот- ponent at т = 7 to Ье barely discernible. However, the DFТ of the win dowed data shown as the triangles in Figure 3 18(Ь), makes it easier for us to detect the presence of the т = 7 signal component. From а practical standpoint, people who use the DFТ to perform real-world signal detec tion have learned that their overall frequency resolution and signal sensi tivity are affected much more Ьу the size and shape of their window function than the mere size of their DFТs. As we Ьесоте more experienced using window functions оп our DFТ input data, we'll see how different window functions have their own indi vidual advantages and disadvantages. Furthermore, regardless of the window function used, we've decreased the leakage in our DFТ output from that of the rectangular window, Тhere are тапу different window functions described in the literature of digital signal processingso many, in fact, that they've been named after just about everyone in the digital signal processing business, It's not that clear that there's а great deal of difference among тапу of these window functions, What we find is that window selection is а trade-off between main lobe widening, first side-- lobe levels, and how fast the sidelobes decrease with increased frequency, The use of any particular window depends оп the app1ication[5], and there are тапу app1ications. Windows are used to improve DFT spectrum analysis accuracy[6], to design digital filters[7,8], to simulate antenna radiation patterns, and even in the hardware world to improve the performance of certain mechanical force to vo1tage conversion devices[9]. 50 there's plenty of window information available for those readers seeking further knowl- edge, (The Mother of аН technical papers оп windows is that Ьу Harris[10]. А useful paper Ьу Nuttall corrected and extended some por tions of Harris's paper[l1].) Again, the best way to appreciate window ing effects is to have access to а computer software package that contains DFI, or FFТ, routines and start analyzing windowed signals, (Ву the way, 
Windows 87 Windowed input signal Window function З.4 and 7  le sinewaves 0.8 0.6 0.4 0.2 х(п) '" [0.5  O.5cos{2nnl64)j. [siп{2хЗ.4f)'64) +0 1siп{2п7f)'б4)) ../ .. . ';. '. (а) о .... ..... .. .2 .. i ia .4 · ... . ' '. .8.8... ........... . n . . . · (Time) ... .6 ,8 1 1.2 . .. DFТ output magnitudes 25 . Rectangular window response ... Hanning window response 20 j: 10 , I . У ", ! 1' ..... . . \ .... SigntC:p;ent 5 '. 1 ' . / .1 }.( ,. '.y<. ..... ..... ... . о .+.......  I I I I I I i"  +.:...:=..:::..=.:4.t--;::.=............... о 1 2 3 4 5 6 7 8 9 10111213141518171819 282930 31 (Fq) 15 (Ь) Flgure 3-18 Increased signal detection sensltivlty afforded using windowing: (а) 64. sample product of а Hanning window and the sum of а 3,4 cycles and а 7 cycles per sample Interva/ sinewaves; (Ь) reduced leakage Hannlng OFТ output response vs, rectangular window OFТ output response, while we delayed their discussion unti1 Section 5.3, there are two other commonly used window functions that сап Ье used to reduce DFТ leak- age, They're the Chebyshev and Kaiser window functions, that have adjustable parameters, enabling us to strike а compromise between widening таin lobe width and reducing sidelobe levels.) 
88 The Discrete Foиr/er Traпsform 3.10 DFT Scalloping Loss Scalloping is the пате used to describe fluctuations in the overall mаgni tude response of an Npoint DFf. Although we derive this fact in Section 3,16, for now we'll just say that when по input windowing function is used, the sin(x)/x shape of the sinc function's magnitude response app1ies to еаф DFf output Ьin, Figure 3-19(а) shows а DFf's aggregate mаgni tude response Ьу superimposing several sin(x)/x bin magnitude responses. t (Because the sinc function's sidelobes are not key to this dis cussion, we don't show them in Figure 319(a).) Notice from Figure 319(b) that the overa11 DFf frequencydomain response is indicated Ьу the bold envelope curve. Тhis rippled curve, a1so called the picket fence effect, illus- trates the processing 10ss for input frequencies between the Ьin centers, (а) rr:r:fW\\  1 (f. l (+ 1 e (m+-1)f s (m+-3)f s (m+-5)f s N N N (Ь) ':f: t t t mfs (m+-2)f s (m+-4)f s N N N .. Freq Flgure 3-19 OFТ bIn mognitude response curves: (а) Indlvlduol sln(x)/x responses for eoch OFТ bIn; (Ь) equivolent overoll OFТ mognitude response, t Perhaps Figure 3 19(а) is why individua! DFf outputs are cal!ed "Ьins," Anу signa! energy under а sin(x) / х curve will show ир in the eпc/osed storage compartтeпt of that DFf' s output sample, 
DFТ Reso/ution, Zero Sfuffiпg, aпd Frequeпcv-Doтaiп Saтp/iпg 89 From Figure 319(b), we сап determine that the magnitude оЕ the DFf response fluctuates from 1,0, at Ьin center, to 0.637 halfway between bin centers, If we're interested in DFf output power levels, this envelope rip- рlе exhibits а scalloping 10ss оЕ almost 4 dB halfway between bin cen- ters, Figure 319 illustrates а DFT output when по window (i.e" а rectangular window) is used, Because nonrectangular window functions broaden the DFf's main 10Ье, their use results in а scalloping 10ss that will not Ье as severe as the rectangular window[10,12]. That is, their wider таin 10bes overlap more and ЕШ in the valleys оЕ the envelope curve in Figure 3-19(Ь), For ехатрlе, the scalloping 10ss оЕ а Hanning window is approximately 0.82, or  1,45 dB, halfway between Ьin centers, Scalloping 10ss is not, however, а severe problem in practice. Real-world signals normally have bandwidths that span many frequency bins so that DFf magnitude response ripples сап go almost unnoticed, Let's 100k at а scheme called zero stuffiпg that's used to both alleviate scalloping 10ss effects and to improve the DFT's frequency resolution, 3.11 DFТ Resolution, Zero Stuffing, and Frequency-Domain Sampling One popular method used to improve DFf frequency resolution is known as zero stuffiпg, or zero paddiпg, Тhis process involves the addition оЕ zero- valued data samples to an original DFf input sequence to increase the total number of input data samples. Investigating this zero stuffing tech- nique illustrates the DFf's important property оЕ frequency-domain sam- pling al1uded to in the discussion оп leakage. When we sample а continuous time-domain function, having а continuous Fourier transform (CFf), and take the DFf оЕ those samples, the DFf results in а frequency domain sampled approximation оЕ the CFf, The more points in our DFT, the better our DFf output approximates the CFf. То illustrate this idea, suppose we want to approximate the CFf оЕ the continuous f(t) function in Figure 320(a). Тhis f(t) wаvеfопn extends to infinity in both directions but is nonzero only over the time interval оЕ Т seconds, If the nonzero portion оЕ the time fиnction is а sinewave оЕ three cycles in Т seconds, the magnitude оЕ its CFf is shown in Figure 320(b), (Because the CFf is taken over an infinitely wide time interval, the CFf has infinitesimally small frequency resolution, resolution so finegrained that it's continuous.) It's this CFf that we'll approximate with а DFT Suppose we want to use а 16point DFf to approximate the CFf оЕ f(t) in Figure з..20(а), The 16 discrete samples off(t), spanning the three periods оЕ f(t)'s sinusoid, are those shown оп the left side оЕ Figure 3-21(а), Applying 
90 The D/screte Fourier Traпsforт OQ OQ (а) ... Continuous time (Ь) 11Т 2JT З/Т 4/Т 51Т Continuous freque псу Flgure 3-20 Continuous Fourier transform: (а) continuous timedomain f(t) of а truncated sinusoid of frequency 3/Т: (Ь) continuous Fourler transform of f(t), those пте samples to а 16-point DFf results in discrete frequencydomain samples, the positive frequency of which are represented Ьу the dots оп the right side of Figиre 3-21(а), We сап see that the DFf output samples Figuтe 3-20(b)'s СУТ, If we append (or zero stuff) 16 zeros to the input sequence and take а 32point DFf, we get the output shown оп the right side of Figure 321(b), where we've increased our DFf frequency sampling Ьу а factor of two, Our DFf is sampling the input function's CFf more often now, Adding 32 more zeros and taking а 64-point DFf, we get the output shown оп the right side of Figure 3-21(с), The 64-point DFf output now begins to show the true shape of the CFf, Adding 64 more zeros and taking а 128point DFf, we get the output shown оп the right side of FigUIe 3-21(d), Тhe DFf frequency-domain sampling characteristic is obvi- ous now, but notice that the Ьin index for the center of the таin lobe is dif- ferent for each of the DFf outputs in Figure 3-21, Does this mean we have to redefine the DFf's frequency axis when using the zero-stuffing technique? Not really, If we perform zero stuffing оп L nonzero input samples to get а total of N пте samples for an N-point DFr, the zero-stuffed DFf output bin center frequencies are related to the original fs Ьу our old friend Eq. (3-5), or center frequency of the mth Ьin = m/S . N (3-32) 
OFТ Reso/ufioп Zero Stuffiпg, aпd Frequeпcy-Oomaiп Sampliпg 91 j' 1 . . . . 05  (а) о. I I I I 1 111 I I I I I I I . J 9 10' 11 12 131. 15 Тiтe О 1 2 3 4 5 7 . . . 5t 1 . .' (Ь) 1 j :npu! a:Plitud: . . 0.5 : . . O,++++++t"+++++++II!I.""..II!I'IfIl!lIl!l.".II!II!I о '3 5 9 12' 15 18 21 24 27 зо Time .5 t .. · 1 . · .:E[ (с) о ,iItI-!!*+*I , ... о ! 5 10 15 20 25 за 35 40 45 50 55 во Tlme :, (: .. .. j 'при! amplitude 11.1!1 1'::, 05 f. 1. (d) O f .:." 5, .. 1 j8. '"  121 Time OFТ magnitude "',' \ О ,,'I' О 1 2 . 4 ....... 6 Freq OFТ magnitud. ., ,. .' OIl!l1I!I о 1 2 3 4 . I ".I!I 7 8 9 10 11 12 Freq OFТ magnitud. .' . 8. .8, .-. ,. . .-. о II!I+++++++++++++I!I+++'I!I о 2 4 6 8 10 12 1. 16 18 20 22 24 Freq OFТ magnrtud. ,.. . . . . . 2 ..... .'. ....r...ra ..  .. 8. ........ О 1I/НЖ-,.!IНЖ.жннt+ItЖI.жнr..iжh\'. о 4 8 12 16 20 24 28 32 36 40 44 48 Freq Figure 3-21 OFТ frequeпeydomaiп samp/iпg: (а) 16 iпput data samp/es aпd N = 16; (Ь) 16 iпput data samples, 16 stuffed zeros, aпd N = 32; (е) 16 iпput data samples, 48 stuffed zeros, aпd N = 64; (d) 16 iпput data samples, 112 stuffed zeros, and N = 128, 50 in our Figure 321(a) example, we use Eq. (3-32) to show that, although the zero-stuffed DFT output Ып index of the main lobe changes as N increases, the zero-stuffed DFТ output frequency associ- ated with the main lobe remains the same, Тhe fol1owing list shows how this works: 
92 Тhв Discrete Fourier Transforт Мain lobe peak Frequeпcy о! main lobe Figure No, located at m = L= N= peak relative to fs = Figure Иl(а) 3 16 16 3//16 Figure 3-21(Ь) 6 16 32 6.//32 = 3//16 Figure 3-21(с) 12 16 64 12.//64 = 3//16 Hgure И1(d) 24 16 128 24.//128 = 31./16 Do we gain anything Ьу appending more zeros to the input sequence and taking larger DFТs? Not really, because our 128point DFТ is sam- pling the input's CFТ sufficiently now in Figure 3-21(d). Sampling it more often with а larger DFТ won't improve our understanding of the input's frequency content. The issue here is that adding zeros to an input sequence will improve our DFТ's output resolution, but there's а practi- callimit оп how much we gain Ьу adding more zeros. For our example here, а 128point DFТ shows us the detailed content of the input spec trum. We've hit а law о! diтiпishiпg returns here. Performing а 256point or 512-point DFТ, in our case, would serve little purpose. t Тhere's по rea son to oversaтple this particular input sequence's CFТ. Of course, there's nothing sacred about stopping at а 128-point DFI. Depending оп the number of samples in some arbitrary input sequence and the sample rate, we might, in practice, need to append any number of zeros to get some desired DFТ frequency resolution. There are two final points to Ье made concerning zero stuffing. First, the DFТ magnitude expressions in Eqs, (3-17) and (317') don't apply if zero stuffing is being used, If we perform zero stuffing оп L nonzero samples of а sinusoid whose frequency is located at а bin center to get а total of N input samples for an Npoint DFТ, we must replace the N with L in Eqs. (3-17) and (317') to predict the DFТ's output magnitude for that particular sinewave, Second, in practical situations, if we want to perform both zero stuffing and windowing оп а sequence of input data samples, we must Ье careful not to apply the window to the entire input including the appended zerovalued samples. The window function must Ье applied only to the original nonzero time samples, otherwise the stuffed zeros wШ zero out and distort part of the window function, t Notice that the DFТ sizes (N) we've discussed are powers of 2 (64, 128, 256, 512), That's ЬесаUБе we actually perforrn DFТs using а special algorithrn known as the fast Fourier ааns- forrn (FFТ), As we'll see in Chapter 4, the typical implemel1tation of the FFТ requires that N Ье а power of 2, 
OFТ Processiпg Goiп 93 leading to erroneous results. (Section 4.5 gives additional practical pointers оп performing the ОРТ using the РРТ algorithm to analyze real wor1d signals.) То digress slightly, now's а good time to деfinе the term discrete-tiтe Fourier traпsforт (OТFТ) that the reader тау encounter in the literature, Тhe OТFТ is the continuous Foиrier transform of an Lpoint discrete time- дотаin sequence; some authors use the OТFТ to describe many of the digital signal processing concepts we've covered in this chapter. We can't perform the ОТРТ оп а computer because it has an infinitely fine fre quency resolutionbut we could, if we wished, approximate the OТFТ Ьу performing an Npoint DFT оп an L-point discrete time sequence where N> L, Тhat is, in fact, what we did in Figure 3-21 when we zero stuffed the original 16point time sequence, While we don't emphasize the ОТРТ in this book, keep in mind that when N = L the OТFТ approxi- mation is identical to the ОРТ. 3.12 DFТ Processing Gain Тhere are two types of processing gain associated with DPТs. People who use the ОРТ to detect signal energy етЬеддед in noise often speak of the DPТ's processiпg gaiп because the ОРТ can риН signals out of background noise. Тhis is дие to the inherent сопеlаtiоп gain that takes place in any Npoint ОРТ. Beyond this natural processing gain, additional iпtegratioп gaiп is possible when multiple ОРТ outputs are averaged. Let's look at the DPТ's inherent processing gain first. 3.2.1 Processing Gain 01 а Single DFТ Тhe concept of the ОРТ having processing gain is straightforward if we think of а particular ОРТ Ьin output as the output of а narrowband filter. Because а ОРТ output bin has the amplitude response of the sin(x)/x function, that bin's outpиt is primarily дие to inpиt energy residing under, or very near, the bin's таin lobe. It's valid to think of а ОРТ bin as а kind of baпdpass filter whose band center is located at тfs/N. We know from Eq. (317) that the maximum possible ОРТ output magnitude increases as the number of points (N) in а ОРТ increases, Also, as N increases, the OFТ output Ьin таin lobes Ьесоте more narrow, So а OFТ output Ьin can Ье treated as а bandpass filter whose gain can Ье increased and whose bandwidth сап Ье reduced Ьу increasing the value of N. Decreasing а bandpass filter's bandwidth is usefиl in energy detection 
94 The Discrete Fourier Traпsforт о 5 (а) 10 15 20 25 О 5 I 10 15 20 DFТ Ып number 25 30 т о 5 10 (Ь) 15 20 25 O 35 О 20 40 60 80 DFТ Ып number 100 120 т о Bin power in dB 10 t SNR  (с) 20 O --40 О 100 200 300 DFТ Ып number 400 500 т Flgur& 3-22 Single OFТ proeessing goln: (а) N = 64; (Ь) N = 256; (е) N = 1024, becaиse the frequency resolution improves in addition to the filter's abil- ity to minimize the amount оЕ background noise that resides within its passband, We сап demonstrate this Ьу looking at the DFr оЕ а spectral tone (а constant frequency sinewave) added to random noise, Figure 3-22(а) is 
DFТ Processiпg Gaiп 95 а logarithmic plot showing the first 32 outputs of а 64-point DFT when the input tone is at the center of the DFTs т = 20th bin, The output power levels (DFT magnitude squared) in Figure 3-22(а) are normal- ized so that the highest bin output power is set to О dB. Because the tone's original signal power is below the average noise power level, the tone is а bit difficu1t to detect when N = 64. (The timedomain noise, used to generate Figure 3-22(а), has an average value of zero, i,e" по DC bias or amplitude offset,) If we quadruple the number of input samples and increase the DFT size to N = 256, we сап now see the tone power raised аЬоуе the average background noise power as shown for т = 80 in Figure 3-22(Ь), Increasing the DFT's size to N = 1024 provides additional processing gain to риН the tone further ир out of the noise as shown in Figure 3-22(с). То quantify the idea of DFf processing gain, we сan define а signal-to- noise ratio (5NR) as the DFf's output sigпal-power level over the average output пoisepower level. (In practice, of course, we 1ike to have this ratio as large as possible,) For several reasons, it's hard to say what any given sin- gle DFT output 5NR wi11 Ье. That's because we can't exact1y predict the energy in any given N samples of random noise. Also, if the input signal frequency is not at bin center, leakage wi11 raise the effective background noise and reduce the DFf's output 5NR. In addition, anу window being used wi11 have some effect оп the leakage and, thus, оп the output 5NR. What we'l1 see is that the DFf's output 5NR increases as N gets larger because а DFT bin's output noise standard deviation (rтs) value is pro- portional to Щ, and the DFf's output magnitude for the Ьin containing the signal tone is proportional to N, More general1y for real inputs, if N> N', an N-point DFT's output SNR N increases over the N'point DFT SNR N , Ьу the fol1owing relationship: SNR N = SNR N , + 20 .10glO( Ш ). (333) If we increase а DFf's size from N' to N = 2N', from Eq. (3-33), the DFf's output 5NR increases Ьу 3 dB. 50 we say that а DFf's processing gain increases Ьу 3 dB whenever N is doubled. Ве aware that we тау double а DFf's size and get а resu1tant processing gain of less than 3 dB in the presence of random noise; then again, we тау gain s1ight1y more than 3 dB. That's the nature of random noise, If we perform many DFfs, we'l1 see an average processing gain, shown in Figure 3-23(а), for various input signal 5NRs, Because we're interested in the slope of the curves in Figure 
96 Тhe Discrete Fourier Troпsform 40 OFТ output SNR (dB) L Inpu! SNR 35  +6 dB 30 i OdB . 25 6dB (а) 20 -12 dB 15  . . .". ....0. -18 dB 10 5 О О 200 400 600 800 1000 N 40 OFТ output SNR (dB) Input SNR  = 15 30 25 (Ь) 20 10 . . 5 ..:;:........-..!'.....;' О 1 10 100 1000 N Flgure 3.23 DFТ processlng galn vs, number of DFТ points N for various Input signal- to-nolse ratlos: (а) Ilnear N axls; (Ь) logarithmlc N axls, 3-2З(а), we plot those curves оп а logarithmic scale for N in Figure 3-23(Ь) where the curves straighten out and Ьесоте linear, Looking at the slope of the curves in Figure 3-23(Ь), we сап now see the 3 dB increase in pro cessing gain as N doubles so long as N is greater than 20 or 30 and the sig- nal is not overwhelmed Ьу noise, There's nothing sacred about the absolute values оЕ the curves in Figures 323(a) and 323(b), Тhey were generated through а simulation of noise and а tone whose frequency was at а DFТ bin center, Had the tone's frequency been between bin centers, the processing gain curves would have been shifted downward, but their 
Тhe OFТ of Rectaпgufar Fuпctioпs 97 shapes would still Ье the same,t that is, Eq. (333) is still valid regardless of the input tone' s frequency. 3.12.2 Integration Gain Due to Averaging Multiple DFTs Тheoretically, we could get very large DFТ processing gains Ьу increasing the DFТ size arbitrarily. Тhe problem is that the number of necessary OFТ multiplications increases proportionally to N2, and larger DFТs Ьесоте very computationally intensive. Бесаusе addition is easier and faster to perform than multiplication, we Сan average the outputs of multiple DFТs to оЫаin further processing gain and signal detection sensitivity, Тhe sub ject of averaging mu1tiple OFТ outputs is covered in Section 8,3, 3.13 The DFТ of Rectangular Functions We conclude this chapter Ьу providing the mathematical detai1s of two important aspects of the DFТ. First, we obtain the expressions for the DFТ of а rectangular function (rectangular window), and then we'll use these resu1ts to illustrate the magnitude response of the DFТ. We're interested in the DFТ's magnitude response because it provides an a1temate view- point to understand the leakage that occurs when we use the DFТ as а sig nal analysis tool, One of the most prevalent and important computations encountered in digital signal processing is the DFТ of а rectangular function, We see it in sampling theory, window functions, discussions of convolution, spectral analysis, and in the design of digital filters. As common as it is, however, the literature covering the DFТ of rectangular functions сап Ье confusing for several reasons for the digital signal processing beginner, Тhe stan- dard mathematical notation is а bit hard to fol1ow at first, and sometimes the equations are presented with too little explanation, Compounding the problem, for the beginner, are the various expressions of this particular DFТ. In the 1iterature, we're 1ikely to find any one of the following forms for the DFТ of а rectangular function: DFТ sin(x) sin(x) sin(Nx / 2) rect.function = sin(x / N) , or ,or sin(x / 2) . (334) t The curves would Ье 5hifted downward, indicating а lower SNR, Ьесаи5е leakage would rai5e the average noise-power level, and 5calloping 1055 would reduce the ОРТ Ьin'5 output power level, 
98 The Dlscrete Four;er Traпsform In this section we'll show how the forms in Eq. (334) were obtained, see how they're related, and create а kind of Rosetta stone table allowing us to move back and forth between the various DFf expressions. Take а deep breath and let's begin our discussion with the definition of а rectan gular function. 3.13.1 DFT of а Gвnвral Rвctangular Function А general rectangular function х(п) can Ье defined as N samples contain ing К unityvalued samples as shown in Figure 324, The full Npoint sequence, х(п), is the rectangular function that we want to transform. We саll this the general fопn of а rectangular function because the К unity samples Ьеgin at а arbitrary index value of пo. Let's take the DFf of х(п) in Figure 324 to get our desired Х(т). Using т as our frequencydomain sample index, the expression for an N-point DFf is N/2 Х(т) = L x(п)ej2"пт/ N. n=--{N / 2)+1 (3-35) With х(п) being nonzero only over the range of пo ::; п ::; пo +(K 1), we can modify the summation limits of Eq. (335) to express Х(т) as пo+(K1) Х(т) = L1'ej2"пт/N, п=пo (336) because only the К samples contribute to Х(т), That last step is important because it allows us to eliminate the х(п) terms and make Eq. (336) easier to handle. То keep the following equations from being too messy, let's use the dummy variable q = 2тcm/N, Х(п) I < к >- 1............. ! : : !. ,1 i! : ..............................-.  о : ............................. +  п п=пo+(K1) Ю2 + т+1 п=пo F/gure 3-24 Rectangular functioп of width К samples defined over N samples where К < N, 
Тhe OFТ о( Rectaпgu/ar Fuпctioпs 99 ОК, here's where the algebra comes in. Over our new limits of sum mation, we eliminate the factor of 1 and Eq, (336) becomes lI,+(Kl) X(q) = >jqll п=пo = ejq(lI,) + ejq(lI, +1) + ejq(lI, +2) +.., + ejq(lI, +(K1)) = ejq(lI')ejOq + ejq(п')ejlq + ejq(п')ej2q +.., + ejq(п, )ejq(Kl) =ejq(п,) '[ejOq +ejlq +ej2q +...+ejq(Kl)] . (3-37) Тhe series inside the brackets of Eq. (337), allows the use of а summation, such as Kl X(q)=ejq(lI,)>jpq , р=О (338) Equation (338) certainly doesn't look any simpler than Eq, (336), but it is, Equation (3-38) is а geoтetric series and, from the discussion in Appendix В, it сап Ье evaluated to the closed form of Kl 1 jqK L jpq   е е  . 1  е}q р=О (339) We сап now simplify Eq, (3-39)here' s the clever step, If we multiply and divide the numerator and denominator of Eq, (339)'s right-hand side Ьу the appropriate halfangled exponentials, we break the exponentials into МО parts and get Kl . ejqK/2(ejqK/2 ejqK/2) '" е Ipq = L.J ejq/2 ( ejq/2 ejq/2 ) р=о ( e1qK/2 е}qК/2 ) = elq(K1)/2 .  (e1q/2  е}q/2) (3-40) 
100 The D/screte Fourler Traпsforт Let's pause for а moment here to remind ourselves where we're going, We're trying to get Eq. (3-40) into а usable form because it's part о! Eq. (З38) that we're using to evaluate Х(т) in Eq. (336) in our quest for ап understandable expression for the DFT of а rectangular function, Equation (340) looks even more complicated than Eq, (3-39), but things сап Ье simplified inside the parentheses, From Euler's equation: sin(,,) = (&О  c j 0)/2j, Eq, (340) becomes Iejpq = ejq(K1)/2 . 2j sin(qK /2) р=О 2jsin(q/2) = ejq(K1)/2. sin(qK /2) , sin(q /2) (341 ) 5ubstituting Eq. (341) for the summation in Eq, (3-38), our expression for X(q) becomes X(q) = ejq(п,) . eiq(K1)/2 . sin(qK /2) sin(q /2) = eiq(n,(K1)/2). sin(qK /2) , sin(q /2) (3-42) Returning our dummy variable q to its original value of 2rcm/N, Х(т) = ei(21tm/N)(п,(K1)/2) . sin(2rcmK /2N) , 01 sin(2rcm /2N) Genera1 form of the Dirich1etkemel:.... Х(т) = e j (21tm/ N)(п,(K1)/2) . sin(rcmK / N) . sin(rcm / N) (3-43) 50 there it is (Whew!). Equation (343) is the general expression for the DFТ of the rectangи1ar function as shown in Figure 324. Our Х(т) is а 
,-",.,.. Тhв ОП 01 Rectangu/ar Jffn6t1ons 1. complex expression (pun intended) where а ratio of sine terxts is the amplitude of Х(т) and the exponential term is the phase angle дf )((т),; Тhe ratio of sines factor in Eq. (3-43) lies оп the periodic curve shоwn,ф," Figure 325(a), and like аН N-point DFf representations, the periodicity of Х(т) is N. тhis curve is known as the Dirichlet kerne/ (or the aliased siпc fuпctioп) and has been thorougbly described in the literature[10,13,14], (It's named after the nineteenth-century German mathematician Peter Diricblet (pronounced dee-ree-klay'), who studied the convergence of trigonometric series used to represent arbitrary functions,) We сап zoom in оп the curve at the т = О point and see more detail in Figure 3-25(Ь). Тhe dots are shown in Figure 3-25(Ь) to remind us that the DFf of our rectangular function results in discrete amplitude values that lie оп the curve. So when we perform DFfs, our discrete results are sampled values оЕ the continuous sinc function's curve in Figure 3-25(а), As we'll show later, we're primarily interested in the absolute value, or magnitude, of the Diricblet kemel in Eq. (3-43). Тhat magnitude I Х(т) I is shown in Figure 3-25(с). Although we first saw the sinc function's curve in Figure 39 in Section 3,8, where we introduced the topic of DFT leakage, we'H encounter this curve often in our study of digital signal processing, For now, there are just а few things we need to keep in mind concem- ing the Diricblet kemel, First, the DFf of а rectangular function has а таin lobe, centered about the т = О point. Тhe peak amplitude of the таin lobe is К. Тhis peak value makes sense, right? Тhe т = О sample of а DFf Х(О) is the sum of the original samples, and the sum of К unityvalued samples is К. We can show this in а more substantial way Ьу evaluating Eq. (3-43) for т = О, А difficulty arises when we plug т = О into Eq. (3-43) because we end ир with sin(O)/sin(O), which is the indeterminate ratio О/О, Well, hardcore mathematics to the rescue here. We can use L'Hospital's rule to take the derivative of the numerator and the denominator of Eq. (3-43), and theп set т = О to determine the peak value of the magnitude оЕ the Diricblet kemel. tt We proceed as t N was an even number in Figure 3-24 depicting the х(n), Had N been an odd number, the limits оп the summation in Eq, (3-35) would have been(NI)/2n  (NI)/2, Using these altemate limits would have led us to exactly the saтe Х(т) as in Eq, (3-43), tt L'Hospital is pronounced 'lб-рё-tOl, like ЬаЬу doll, 1\:, " ,,' )'0 :;./ . 
102 The D/serete Four/er Traпsform I Х(т) I =.!!.... Х(т) = d[sin(1tmK / N)] / dm т'" О dm d[sin(1tm/ N)]/ dm cos(1tmK / N) . d(1tmK / N) / dm cos(1tm / N) d(1tm / N) / dm = cos(O) . пК / N = 1. К = К , cos(O) 1t / N (344) which is what we set out to show, (We could have been clever and evalu- ated Eq. (3-35) with т = О to get the result of Eq. (3-44), Try it, and keep in mind that e jO = 1,) Had the amplitudes of the nonzero samples of х(п) been Х(т) (а) Х(т) ,., !  ., ! . / i [\ . ; '! \ н.. Л: i i 8, . . .8"8 /8. " :, : F ;, /8 .. ..- .:.;....!+.ТНo.+++. / . I I I I I I i "'t'++:'.-+++."""""""'.."" .8.8 .,,' t о t \>.' '....,.' т т",--N/К т'" N/К к (Ь) 1,0 0,8 0,6 0.4 0,2 О --0,2 (с) 1.0 ..'. к 0.8 Main! [\ 0,6 lobe !! i !\ 0.4 f I \ .; . ,. 0.2 _8. ._8 .н.'. ,'' }1 \ i 1 ; \ /'i'. .'... ,.. о .,.,.,..-++++++\ I I I I i i I \'++-+-'.++-+-'I!I , 1"' I!I ,+---- 2N/K I m  Side )))) lobes Figure 3-25 The Diriehlet kernel of Х(т): (а) periodle eontlnuous eUNe оп whieh the Х(т) samples Ile; (Ь) Х(т) amplitudes about the m = О sample; (е) I Х(т) I magnltudes about the m = О sample, 
The OFТ of Recfaпgu/a( Fuпcfioпs 103 different than unity, say some amplitude Ао, then, of course, the peak value of the Dirichlet kernel would Ье АоК instead of just К. The next important thing to notice about the Dirichlet kernel is the таin lobe's width, The first zero crossing of Eq, (343) occurs when the numerator's argument is equal to п, Тhat is, when 7tmK/N = п, 50 the value of т at the first zero crossing is given Ьу 7tN N тfirst zero crossing = пК = К (345) as shown in Figure 325(b), Тhus the таin lobe width 2N/K as shown in Figure 325(c), is inversely proportional to к.+ Notice that the таin lobe in Figure 325(a) is surrounded Ьу а series of oscillations, called sidelobes, as in Figure 325(c), These sidelobe magni tudes decrease the farther they're separated from the таin lobe, However, по matter how far we look away from the main lobe, these sidelobes never reach zero magnitude-----and they cause а great deal of heartache for practitioners in digital signal processing, These sidelobes cause high amplitude signals to overwhelm and hide neighboring lowamplitude signals in spectral analysis, and they complicate the design of digital fil ters. As we'll see in Chapter 5, the unwanted ripple in the passband and the poor stopband attenuation in simple digital filters are caused Ьу the rectangular function's DFT sidelobes, (Тhe development, analysis, and application of window functions сате about to minimize the ill effects of those sidelobes in Figure 325,) Let's demonstrate the relationship in Eq, (345) Ьу way of а simple but concrete example, Assume that we're taking а 64-point DFТ of the 64-sample rectangular function, with eleven unity values, shown in Figure 326(a), In this example, N = 64 and К = 11, Taking the 64point DFT of the sequence in Figure 326(a) resu1ts in an Х(т) whose real and imaginary parts, Xrea1(m) and Ximag(m), are shown in Figure 326(b) and Figure 3-26(с) respectively, Figure 326(b) is а good illustration of how the real part of the DFT of а real input sequence has even symmetry, and Figure 3-26(с) confirms that the imaginary part of the DFT of а real input sequence has odd symmetry, (These symmetry properties were introduced in 5ection 3,2 and are discussed further in Appendix С, 5ection с.3,) t Тhis is а fundamental characteristic of Fourier transforms. Тhe narrower the function in оnе domain, the wider its transform will Ье in the other domain. 
104 The Discrete Fourier Traпsform K 1 t х(п)  . " " · П " :  . ! , ' "  ,, ' , -:. 0.5 ! ' 1: ;: i : : i i i!:! 1 o",.,.,...""",.""",, ! i i 1 1II1 I i " """""",.""""", 28 24 20 1б 12  -4 О 4 8 12 1б 20 24 28 32 п (а) (Ь) 12 [ 'eel(m J . 10 .I. 8 , ' б.' I . ;,,: I I 4 .1 I 1: 18 2  . I ::: 1. 8 . I I j '1 . О .tt:t.,....."..,., ".t+++-..++tI.",., ,.''''IIJI.trtt. 2 20 1б 12 ... -4 О 4 ... 12 1б 20 m К=11 2 t Х; (т) · 1 5 mag . II!' . . 1 . I i 1. · : :' . : I i ;  111 , I : i I · i' 0.5 .".. 20.[iii.  ii:l' 4.il!'12 1681i!i24 28 (с) 0 i . шt+++t I I ! 1  i 11 1 1 1 ! ! ! , 1  I 11 i i , l ' ,, ' " ' I I i I 11  ! I ! I  I i 11 l'  !! ф "'''' 5 28 24.!1 16 8!!:, ...-4 о, I! 8 1:[1 20 ..8 m 1 8. I : i. . ,1 . : :. 1.5 . .i .. 4 . Flgure 3.26 DFТ of а reetangular funetion: (а) origlnol funetlon >«п); (Ь) real port of the DFТ of >«п). X,eai(m); (е) Imaglnary part of the DFТ of >«п). Ximag(m), (а)  ! IX(m) I ... 11 8  I l ' ,. б .' · l' I ' 4 · I 1:- . I I L I i I . 2 .8 . . I I 1 1.. 8. .. ... ... .... ] i I I I I ... .-. .-. . O++4''' lill"IIII  llIlilll I . 11 I'ТIIII ''t+Щ, 28 24 20 1б 12  -4 О 4 8 12 1б 20 24 28 m 1 · -'<0(т) и..... (Ь) ,... 1! 28 28 m 2  ...... Flgure 3-27 DFТ of а generollzed reetangulor funetion: (а) magnltude I Х(т) 1; (Ь) phose ongle In rodions, Although Xrea1(m) and Ximeg(m) tell us everything there is to know about the DFТ of х(п), it's а bit easier to comprehend the true spectral nature of Х(т) Ьу viewing its absolute magnitude. Тhis magnitude, fron Eq. (37), is provided in Figure 3-27(а) where the main and sidelobes are 
The DFr of Rectoпgu/or Fuпct/oпs 105 clearly evident now, As we expected, the peak value of the main lobe is 11 because we had К = 11 samples in х(п). The width of the main lobe from Eq, (345) is 64/11, or 5.82. Thus, the first positive frequency zero crossing location lies just below the т = 6 sample of our discrete I Х(т) I represented Ьу the squares in Figure 327(a). The phase angles associated with I Х(т) I , first introduced in Equations (36) and (3-8), are shown in Figure 327(b), То understand the nature of the DFT of rectangular functions more fully, let's discuss а few more examples using less general rectangular functions that are more common in digital signal processing than the х(п) in Figure 324. 3.13.2 DFТ of а Symmetrical Rectangular Function Equation (3-43) is а bit comp1icated because our original function х(п) was so general, In practice, special cases of rectangu1ar functions lead to sim- pler versions of Eq. (343), Consider the symmetrical х(п) rectangular function in Figure 328, As shown in Figure 3-28, we often need to deter- mine the DFf of а rectangular function that's centered about the п = О index point, In this case, the К unityvalued samples begin at п = пo = (K1)/2. 50 substituting (K1)/2 for по in Eq. (343), yields Х(т) = ei(21tт/ N)«Kl)/HKl)/2) . sin(1tmK / N) sin( пт / N) = e i (2mп/N)(O). sin(1tmK / N) sin( пт / N) (346) Because ei° = 1, Eq, (346) becomes Symmetrical form of the Dirich1et kemel:  Х(т) = sin(1tmK / N) . sin( пт / N) (347) ...с: к > 1 . . .. . . . . . .. . . x(n) т ,l ii! JJ I iii'i .._...._.._. I i i' ,; I i   о  -N/2 +1 -п о = -(К-1)/2 п о = (К-1)/2 .....-........-.............  n N/2 Flgure 3.28 Rectangular х(п) wlth К samples centered about п = О, 
1 06 The D/screte Fourier Traпsform Equation (З47) indicates that the DFТ of the syrnmetrical rectangular function in Figure 328 is itse1f а real function; that is, there's по cornplex exponential in Eq, (3-47), so this particular DFТ contains по imaginary part or phase terrn. As we stated in Section 3.2, if х(п) is real and even, х(п) = x(п), then Xrea1(m) is nonzero and X ima (т) is always zero, We demonstrate this Ьу taking the 64-point DFТ 01 the sequence in Figure 3-29(а), Our х(п) is 11 unity-valued sarnples centered about the п = О index, Here the DFТ resu1ts in an Х(т) whose real and imaginary parts are shown in Figure 3-29(Ь) and Figure 3-29(с), respectively, АБ Eq, (3-47) predicted, (а) 1 t Х(п) .......... 05 ' , , 0.......................... 1111 j i I IIII ........................... 28 24 2a 16 1'2 -8 4 О 4 8' 12 1'6 20 24 28 32 п (Ь) 12 i xr e al(т) 10 8 6 4 . . 2 ._. 20 .... ....g. . 8 ._. ._. о ...4+++,.itrt.'1+++i++++ allllllllll , .++++tЩ'.ttli.'..  i 28 24 16 12 ....  о 4 .... 12 16 26 28 3!! т ... . . 11 (с) 0.5 ! Ximag(т) 0.4 0.3 0.2 0.1 О ..""""..,.,.,.,.",.,...,...,.."..,,..,...,...,.""..",, 28 24 2a 16 -12 -8  О 4 8 12 16 20 24 28 т (d) 12 1 IX (т)1 10 8 6 4 . ' 1. 2.. ._. ... .... ,.... '. .... .... ._. ... о .н.,,, IIIIT 1111 , 1111111111" 1111" IIII ''' 28 24 2a -16 12 -8  О 4 8 12 16 20 24 28 т 11 (е) 4 Т JI0(т) з ... ...... ...... 1t  r \....L\....L\........1...ч...:'..:...t...... = 28.24";al'1.612'.:.;I"........ \ \ /\ /'\ т з  ..".,,__ ..... ...... ..  Figure 3-29 OFТ of а reetangular funetlon eentered about п = о: (а) orlglnal Х(п) ; (Ь) eal(m); (е) X/mag(m); (d) magnltude of Х(т); (е) phase angle of Х(т) In radlans, 
The DFТ о' Rectaпgu/ar Fuпctioпs 107 Xrea1(m) is nonzero and Ximag(m) is zero. Тhe magnitude and phase of Х(т) are depicted in Figure 329(d) and Figure 329(e), Notice that the magnitudes in Figure 327(a) and Figure 329(d) are identical. This verifies the very important shifting theorem of the DFТ; that is, the magnitude I Х(т) I depends only оп the number of nonzero samples in х(п), К, and not оп their position relative to the п = О index value. Shifting the К unityvalued samples to center them about the п = О index merely affects the phase angle of Х(т), not its magnitude. Speaking of phase angles, it's interesting to realize here that even though Ximag(m) is zero in Figure 329(c), the phase angle of Х(т) is not always zero, In this case, X(m)'s individual phase angles in Figure 329(e) are either +Л, zero, or л radians. With +л and л radians both being equal to 1, we could easily reconstruct Xrea1(m) from I Х(т) I and the phase angle Х..(т) if we must. Xrea1(m) is equal to I Х(т) I with the signs of I Х(т) I 's a1temate sidelobes reversed. t То gain some further appreciation of how the DFТ of а rectangular function is а sampled version of the Diricblet kernel, let's increase the number of our nonzero х(п) samples. Figure 330(a) shows а 64point х(п) where 31 unityvalued samples are centered about the п = О index location. Тhe magnitude of Х(т) is pro vided in Figure 330(b), Ву broadening the х(п) function, i,e., increasing К, we've narrowed the Diricblet kemel of Х(т). This follows from Eq. (345), right? Тhe kemel's first zero crossing is inversely proportional to К, so, as we extend the width of К, we squeeze I Х(т) I in toward т = О, In this 1 Т х(n) ' . .'. .. . ' . ' ..  .. ' '8 .. i ..  . .  . ' .. ! . 8 ..  .. ' .. '  . .,. . .  . п. (а) 05 т I ! ! i i i I i ! i , I ! ! , i '! i !!; i i , 1 ! i о".,...,...,..., I i i j 1 i 11111 , i i 1111 i i 11 i I i i I j i 1 i ,...,...,...,...,.... 28 24 2O 16 12 -8 -4 О 4 8 12 16 20 24 28 32 п  ! IX(m)1 i\ Ь 20 .. () 15 I \ 10 I \ 5 ,. ,. f8\J \,.\ 8, '. О "'T""""""""4''+',,,,,+,;,.,""""'""""" 28 24 20 16 12 -8 4 О 4 8 12 16 20 24 28 m 31 Flgure 3-30 DFТ of а symmetricol rectongular function with 3 1 unlty volues: (о) origiпal х(п); (Ь) magпitude of Х(т), t The particular pattem of +It and It values in Figure З-29(е) is an artifact of the software used to generate that figure, А different software package тау show а different pattern, but as long as the nonzero phase samples are either +It or --1t, the phase resu1ts will ье correct, 
108 Тhe Discrete Foиrier Troпsforт example, N = 64 and К = 31. From Eq. (3-45) the first positive zero cross- ing о! Х(т) occurs at 64/31, Or just slightly to the right о! the т = 2 sam ple in Figure 330(b), Also notice that the peak value of I Х(т) I = К = 31, as mandated Ьу Eq. (344). 3.13.3 DFТ of ап АН Qnes Rectangular Functlon Тhe DFf of а special form о! х(п) is routinely called for, leading to yet another simplified form of Eq. (3--43), In the literature, we often encounter а rectangular function where К = N; that is, аН N samples of х(п) are nonzero, as shown in Figure 3-31, In this case, the N unityva1ued samples Ьеgin at п = пo = N1)/2, We obtain the expression for the DFf of the function in Figure 3--31 Ьу substituting К = N and по = (N1)/2 in Eq. (3--43) to get Х( )  j(21tm / N)[(N  1) / 2(N  1) / 2] sin( 1tmN / N) m e . sin(1tm / N) ] '(2пт/ N)(O ) sin(1tm) =е . or sin( 1tm / N) , АН Ones form of the Dirichlet kernel (Туре 1):  Х(т) = sin(1tm) . sin(1tm/N) (3-48) Equation (348) takes the first form of Eq. (334) that we alluded to at the beginning о! tbls Section 3,13.+ Figure 332 demonstrates the mеаn- ing о! Eq, (348). Тhe DFT magnitude of the аН ones function, х(п) in -< K=N х(п) 1 -По= -(N-1 )/2 о n Figure 3-3' Rectangular functlon with N unlty-valued samples, t Ву the way, there's nothing official about calling Eq. (3-48) а Туре 1 Dirichlet kernel, We're using the phrase Туре 1 merely to distinguish Eq. (3-48) from other mathematical expres- sions for the Dirichlet keme] that we're about to encounter, 
Тhe DFr of Reetaпgu/ar Fuпetioпs 1 01 х(п) 1.......,............ (8) 0.5 i i \ i I i ' i i 11 i!! i i о .................................. i: I . - 1" ; i 28 24 20 16 12 ...s 4 о 4 8 12 16 20 24 28 32 п  j IX(m) I  .. 64 50 11 40 1 \ (Ь) 30 I  J o...........................ltl......................... 8 2 o -1'6 ;2 ..8.  о   /2 1  2 28 m ; L X(m), /"\ \ (с) за / 20 У \ 19 ,c yY"{  ......,........yyyy ; -5 4 ..з 2 1 О 1 2 3 4 5 64 ... m Flgure 3-32 AII ones funetion: (о) reetongular function with N = 64 unity-volued somples; (Ь) DFТ mognitude of the 011 ones time funetion; (с) elose-up view of the DFТ mognitude of оп 011 ones time funetion, Figure 332(a), is shown in Figure 3-32(Ь) and Figure 332(c). Take note that if т was continuous Eq. (348) describes the shaded curves in Figure 332(b) and Figure 3-32(с). If т is restricted to Ье integers, then Eq, (348) represents the dots in those figures. Тhe Diricblet kemel of Х(т) in Figure 332(b) is now as narrow as it сап get. Тhe main lobe's first positive zero crossing occurs at the т = 64/64 = 1 sample in Figure 3-32(Ь) and the peak value of I Х(т) I = N = 64, With х(п) being аН ones, I Х(т) I is zero for аН т :;с О, Тhe sinc function in Eq. (348) is of utmost importancs we'H see at the end of this chapter, it defines the overaH DFТ frequency response to an input sinusoidal sequence, and it's also the amplitude response of а single DFТ Ьin. Тhe form of Eq, (348) aHows us to go one step further to identify the most common expression for the DFТ of an аН ones rectangular function found in the literature. То do this, we have to use an approximation prin ciple found in the mathematics of trigonometry that уои тау have heard before, It states that when а is smaH, then sin( а) is approximately equal to а, i,e" sin(a) '" а, Тhis idea comes about when we consider а pieshaped 
11 О The Discrete Fourier Traпsforт (а) (Ь) ь а а Figure 3-33 Relotlonships between оп ongle а, line а = sln(a), ond a's chord Ь: (о) Large ongle ос (Ь) Smoll ongle а, section of а circle whose radius is 1 as shown in Figure 3-33(а). Тhat sec- tiOI1 is defined Ьу the length of the arc а measured in radians and а' s chord Ь. If we draw а right triangle inside the section, we сап say that а == sin( а). As а gets smaHer the long sides of our triangle Ьесоте almost paraHel, the length of chord Ь approaches the length of arc а, and the length of line а approaches the length of Ь. 50, as depicted in Figure 3-33(Ь), when а is smaH, а '" Ь '" а == sin(a), We use this sin(a) '" а approx- imation when we look at the denominator of Eq. (3-48). When 1tm/N is small, then sin(1tm/N) is approximately equal to 1tm/N, 50 we сап, when N is large, state АН Ones Еопn оЕ the Dirichlet kemel (Туре 2):  Х(т) '" sin(1tm) = N . sin(1tm) . mп/N 1tm (3-49) It has been shown that when N is larger than, say, 10 in Eq, (3-48), Eq, (349) accurately describes the OFТ's output,t Equation (3-49) is often normalized Ьу dividing it Ьу N, so we сап express the normalized OFТ of an аН ones rectangular function as t We сап Ье comfortable with this resuIt because, if we let К = N, we'l1 see that the peak value of Х(т) in Eq, (3-49), for т = О, is equal to N, which agrees with Eq, (3-44), 
The OFТ of Rectaпgи/ar Fипctioпs 111 АН Ones form of the DirichIet kemel (Туре 3):  Х(т) '" sin(1tm) . пт (350) Equation (350), taking the second form of Eq. (334) that is so often seen in the literature, also has the DFТ magnitude shown in Figure 3-32(Ь) and Figure 332(c), 3.13.4 Time and Frequency Axes Associated with Rectangular Functlons Let's establish the physical dimensions associated with the п and т index values. 50 far in our discussion, the п index was merely an integer enabling us to keep track of individual х(п) sample values. If the п index represents instants in time, we сan identify the time period separating adjacent х(п) samples to establish the time scale for the х(п) axis and the frequency scale for the Х(т) axis, Consider the time-domain rectangular function given in Figure 334(a). That function comprises N time samples obtained t s seconds apart, and the full sample interval is Nt s seconds. Each -с: Nt. > i (а) t. ' , ' . '"" >(9) . "'п ) """" time = 9t. seconds ' ....\ ....... + ' .............. ' . ............ о 9 t. .econds fs/2 Hz ("" /2 = ---rt'.) [---rt] ,', Amplitude 01 Х(т) i \ 1/(Nt,;) = './N = (2"'./М / \ : . = (",,/М = [",/N] . \  !<'-- . "- . / . '.., .. '. ..., ,,8.. ..... ':;,+;>' ,,_Р ++-+',,,,, III I I I I ''--+++' ,ц., '"  ' I . ;H Z '..8 о 8..' ! , Hz t >' ("'./М (2"'. ="': radianslsec) I ,"/2 Hz ["' /N] ["' = 2" radians] ("'. /2 = "'.) т=7 [,,] Ireq, = 7 'JN Hz (Ireq, = 7",. /N radianslsec) [normalized angle = 7", / N radlans] (Ь) ''< Flgure 3-34 DFТ time ond frequency oxls dlmensions: (а) tlme-domoln oxls uses tlme index п: (Ь) vorlous representotions of the DFT's frequency oxls, 
112 The Discrete Foиr/er Traпsforт ТаЫе 3-1 Characterlstlcs of Varlous OFТ Frequency Axls Representatlons DFT Frequency Х(m) Repetition Frequency Axis Frequency Reso/ution Interva/ о! Аш Representation Variable о! Х(m) Х(m) Range Frequency in нz тl/N fs!N 1. //2 to 1/2 Frequency in т(J)/N or (J)/Nor Ф. or 21tf s ./2 to Ф./2 radians 21tтM N 21tf s /N or 1tfs to rif. Nonnalized angle 21tт/N 21t/N 21t --те to 1t in radians х(п) sample occurs at nt. seconds for some value of п. For example, the п = 9 sample value, х(9) = О, occurs at 9t. seconds, The frequency axis of Х(т) can Ье represented in а number of different ways. Тhree popular types of DFf frequency axis labeling are shown in Figure 334(b) and listed in ТаЫе 31. Let's consider each representation individuaHy. 3.13,4,1 OFТ Frequency Axis in Hz If we decide to relate Х(т) to the time sample period t., or the sample ratef. = l/t., then the frequency axis variable is m/Nt. = mf/N. So each Х(т) sample is associated with а сусНс frequency of mf/N Hz. In this case, the resolution of Х(т) isf/N. The DFТ repetition period, or peri- odicity, is fs Hz, as shown in Figure 334(b). If we substitute the сусНс frequency variable mf/N for the generic variable of m/N in Eq. (3-47), we obtain аn expression for the DFT of а symmetrical rectangular func- tion, where К < N, in terms of the sample rate f. in Hz. Тhat expression is Х(т!.) = sin(п;т!.К/ N) , sin( п;т!. / N) (3-51) For аn аН ones rectangular function where К = N, the amp1itude normal ized sin(x) / х approximation in Eq. (3-50) can Ье rewritten in terms of sam ple rate f. in нz as X(m f ) '" sin(п;т!.) . J · п;тfs (352) 
Тhe OFТ о' Rectaпgu/ar Fuпctioпs 113 3,13.4,2 OFТ Frequency Axis in Radians/Second We сап measure X(m)'s frequency in radians/s Ьу defining the time domain sample rate in radians/s as 0). = 21tfs' 50 each Х(т) sample is asso- ciated with а radian frequency оЕ mO)/N = 21tmf/Nradians/s. In this case, X(m)'s resolution is O)/N = 21tf/N radians/s, and the DFT repetition period is o)s = 21tf. radians/s, as shown Ьу the expressions in parenthesis in Figure 3-З4(Ь). With 0). = 21tf., then 1tf. = 0)/2. If we substitute 0).12 for rif. in Eq. (3-51), we obtain an expression for the DFI оЕ а symmetrical rectan- gular function, where К < N, in terms оЕ the sample rate 0). in radians/s: Х( ) = sin(тюsК / 2N) тю s ' sin(тю. /2N) (3-53) For an аН ones rectangular function where К = N, the arnplitude normal- ized sin(x)/x approximation in Eq. (3-50) сап Ье stated in terms оЕ а sarn- ple rate Ю. in radians/s as Х( ) '" 2 sin(тю. /2) тю. . тю. (3-54) 3.13,4,3 OFТ Frequency Axis Using а Normalized Angle VariabIe Маnу authors simplify the notation оЕ their equations Ьу using а normal- ized variable for the radian frequency Ю. = 21tfs' Ву normalized, we теаn that the sample rate f. is assumed to Ье equal to 1, and this establishes а normalized radian frequency Ю. equal to 2х. Тhus, the frequency axis оЕ Х(т) now becomes а normalized angle Ю, and each Х(т) sample is asso- ciated with аn angle оЕ тю/N radians. Using this convention, X(m)'s res- olution is ю/N radians, and the DFI repetition period is ю = 2х radians, as shown Ьу the expressions in brackets in Figure 3-34(Ь). Unfortunately the usage оЕ these three different representations of the DFTs frequency axis is sometimes confusing for the beginner. When reviewing the literature, the reader can leam to convert between these fre- quency axis notations Ьу consulting Figure 3-34 and Table 3-1. 3.13.5 Alternate Form of the DFТ of аn AII Ones Rectangular Function Using the normalized radian angle notation for the DFI axis from the bot tom row of Table 3-11eads to another prevalent form оЕ the DFI оЕ the аН 
114 The Discrete Fourier Traпsforт ones rectangular function in Figure 331, Letting our normalized discrete frequency axis variable Ье <От = 21tm/N, then лт = N<Om/2, Substituting the term N<Om/2 for лт in Eq, (348), we obtain АН Ones form of the Dirich1et kemel (Туре 4):  Х(ю) = sin(Nm m /2) , sin(m m /2) ТаЫе 3-2 OFТ of Varlous Rectangular Functions Descriptioп Expressioп DFf of а genera! rectangular function, where Х(т)= sin(!tmK/N) К < N, in terms of the integra! frequency т variable sin(!tm/N) 'e i (2''''1 N)(",(K1)/2) DFf of а symmetrica! rectangu!ar function, Х(т) = sin(1tmK/N), where К < N, in terms of the integra! frequency sin(!tm / N) variable т DFf of an аН ones rectangu!ar function in terms sin(!tm) of the integer frequency variable т (Dirich1et Х(т)= sin(!tm/N) keme! Туре 1) DFf of an аН ones rectangu!ar function in terms Х(т) = N sin(!tm). of the integer frequency variable т (Dirich1et 1tm keme! Туре 2) Amplitude norma!ized DFf of аn аН ones Х(т) = sin(!tm) , rectangu!ar fиnction in terms of the integra! 1tm frequency variable т (Dirich1et keme! Туре З) DFf of а symmetrica! rectangu!ar fиnction, Х(тД = sin( !tm fs K / N), where К < N, in terms of the samp!e rate fs in нz sin(!tmj, / N) Amplitude normalized DFf of аn аН ones X(mj,) = sin(1tmf,) , rectangu!ar fиnction in terms of the samp!e 1tmj, rate fs in Hz DFf of а symmetrica! rectangular fиnction, Х( )  sin( тro,К / 2N) where К < N, in terms of the samp!e rate ю s тro,  sin(mro, /2N) . in radians/s Amp1itude normalized DFf of an аН ones Х( ) = 2sin(mro, /2) rectangu!ar function in terms of the samp!e тro, ' rate ю s in radians/s тro, DFT of an аН ones rectangu!ar function in Х(ro) = sin(Nro т /2), terms of the normalized discrete frequency sin(ro", /2) variable Ют (Dirich1et keme! Туре 4), (355) (346) (347) (348) (3-49) (3-50) (351 ) (352) (353) (3-54) (355) 
The OFТ of Rectoпgu/or Fuпct/oпs 11 ! Equation (3-55), taking the third form of Eq, (334) sometimes seen in the literature, also has the DFT magnitude shown in Figure 332(b) and Figure 332(c). We've covered so тапу different expressions for the DFT of various rectangular functions that it's reasonable to compile their various forms in Table 32. 3.13.6 Inverse DFT 01 а General Rectangular Function Let's think now about computing the inverse DFТ of а rectangular fre- quencydomain function; that is, given а rectangular Х(т) function, find а timedomain function х(п). We сап define the general form of а rectan- gular frequencydomain function, as we did for Figure 3-24, to Ье that shown in Figure 3-35, The inverse DFТ of the rectangular function Х(т) in Figure 335 is 1 N /2 х(п)= N LX(m)ei27tmп/N, m=N / 2)+1 (3-56) The same algebraic acrobatics we used to arrive at Eq. (343) сап Ье applied to Eq. (356), guiding us to ( )  J '(27tп/N )( m  ( K1 ) /2) 1 sin(nnK/ N) хп=е ' .. N sin(nn / N) , (357) for the inverse DFT of the rectangular function in Figure 335, The descriptions we gave for Eq. (3-43) apply equally well to Eq, (357) with the exception of а 1/ N scale factor term and а change in the sign of Eq, (343)'s phase angle, Let's use Eq. (3-57) to take а 64point inverse DFТ of the 64sample rectangular function shown in Figure 336(a), The -< к >- 1 . . . . . . . . . . . . . Х(т) , i ! ; ................ i +  о N12 + 1 т = тo + т=тo+(K1) ............  т Ю2 Flgure 3-35 General rectangular frequencydomain function of width К sampies deftned over N samples where К < N. 
116 The Discrete Fourier Traпsform (а) 1 Т Х(т) · 05 Т 0.""""""""""""" 1 -28 -24 20 16 12   . ... 11 I ."._,.,.,....,...,...,...,.. 8 12 16 20 24 28 32 m 0.2 0.15 0.1 (Ь) 0.05 О .05 x,eal (п) ... 0,172 . i  . i: i. l' . 1; I  i i : i: i i. 8 .'ii1t.....".".",.tt+t.  111 J i I i ; I i .!t11.,,,.,..,.,......i1ii' 20 -16 12 ...  О 4 ... 12 16 20 n : f Xima9(n) ... .1". .[11. .П. 0.01 28 2Ч i ,16 . , !:  о  ' : : 8 : i ! ! 20.. n (с) Ь '.. lJ ' iJoiT ll'l 11 iJi'llll( 1 i 11 ' 111 :j I i j]1l1l.JJ i71: i .. I 1. ...о,аз · Ii .. Flgure 3-36 Inverse DFТ of а generol reetongulorfunetion: (а) orlglnol funetion Х(т); (Ь) reol port, x,eol(п); (е) imoglnory part, X;mog(п), о 2 1 ,x (n), ... 0172 015 .: . 01 · (а) о 05  ' 1. .. ... .... .... .. 81 '  . ... .... .... ... . 0+i4.+h4.++-t+" 1111'1111 ' 1111111111 "IIII"IIII ''' I -28 24 -20 16 -12   О 4 8 12 16 20 24 28 n (Ь) :+ х,,(п) 1 t 28  f'\ ..... -з1 . Figure 3-37lnverse DFТ of а generalized reetongulor funetlon: (а) mognltude I х(п) I ; (Ь) phase ongle of х(п) In radlons, inverse DFT of the sequence in Figure 3-36(а) resu1ts in an х(п) whose real and imaginary parts, x rea1 (n) and Ximag(n), are shown in Figure 336(b) and Figure 3-36(с), respectively, With N = 64 and К = 11 in this example, we've made the inverse DFT functions in Figure 3-36 easy to compare 
Тhe OFТ of Rectaпgu/ar Fuпct/oпs 11 : with those forward DFT functions in Figure 3-26. 5ее the similarity between the real parts, Xreal(m) and xrea1(n), in Figure 326(b) and Figure 3-36(Ь)? Also notice the sign change between the imaginary parts in Figure 3-26(с) and Figure 336(c), Тhe magnitude and phase angle of х(п) are shown in Figure 3-37(а) and Figure 337(b), Note the differences in main lobe peak magnitude between Figure 327(a) and Figure 337(a). Тhe peak magnitude value in Figure 337(a) is K/N = 11/64, or 0,172. Also notice the sign change between the phase angles in Figure 327(b) and Figure 337(b). Тhe illus- trations in Figures 326, 327, 336, and 337 are good examples of the fun damental duality relationships between the forward and inverse DFТ. 3.13.7 Inverse DFТ of а Symmetrical Rectangular Function The inverse DFT of the general rectangular function in Figure 3-36 is not very common in digital signal processing, However, in discussions concerning digital fi1ters, we will encounter the inverse DFТ of sym metrical rectangular functions, This inverse DFT process is found in the window design method of what are called low-pass finite impulse response (FIR) digital fi1ters. That method begins with the definition of а symmetrical frequency function, Н(т), such as that in Figure 3-38, The inverse DFT of the frequency samples in Figure 338 is then taken to determine the timedomain coefficients for use in а lowpass FlR fil ter. (TimeDomain FlR fi1ter coefficients are typically denoted h(n) instead of х(п), so we'll use h(n) throughout the remainder of this inverse DFT discussion,) In the case of the frequency domain Н(т) in Figure 3-38, the К unity- valued samples Ьеgin at т = тo = (K1)/2, 50 plugging (K1)/2 in for то in Eq. (357), gives h(n) = e j (27m! N)((K1)!2(K1)!2) ..l. sin(1tnK / N) N sin( пп / N) = e j (21tп! N)(O) . .l. sin( ltпK / N) , N sin(1tn / N) (358) Again, because e jO = 1, Eq, (358) becomes h(n) =.l. sin(1tnK / N) , N sin(1tn / N) (359) 
118 Тhe Diserete Fourier Traпsform -< к .........I!I. >- .. Н(т) ...............................   о N'2+1 т=ПЬ=К1)/2 ................................. + + т т= (K1)12 М2 Figure 3-38 Frequeney-domain reetangular funetion of width К samples defined over N samples, (а) о i Н(т) ........... о.............,.......,.... , J 111 J 111 J , .....,......................       о 4       т (Ь) о 2 [ h real (n) 015 01 005 · · ._. .... 8. . 8 .... . о ..................'.ffi.'тж-Т;-н++. IIIIIIIIIII .4нtТ+++t'.t++i'.'.. 1 · 16 12 .... 4 О 4 .... 12 16 .. 26 28 3 n -<J05l. ... . . 0.172 (о) 0.4 1 himag (n) 0.3 0.2 0.1 0111111' "'II!II!I" ",'IIII!I' .,. 'II!II!I .,.,."", .,.",.",..,...., IIII!I''''IJII!I'' ...., I!II!II!I 28 24 20 16 12   о 4 8 12 16 20 24 28 n (d) о 2 j lh(n)1 01 01 .' . 00 .. .-. .-. .... ..... . .... .... .-. .-. . о ,,, IIII' 1111 ' 1111111111" IIII'T 1111 ,'t+++t' I 28 24 20 16 12   о 4 8 12 16 20 24 28 n ... . . 0172 (е)  [ ''" . ...... :] ..  28 -24 20 16 12   о I I I о l ...+r+-I-++....+++Ж l ......'....'. ...,. = \ I \ 4 8 12 16 20 24 28 n з... ...... ...... 7t l Figure 3-39 Inverse OFТ of а rectangular funetion eentered about т = о: (а) orlglпal Н(т); (Ь) h,eal(п); (е) himag(п); (d) magпitude of h{п); (е) phase of h{п) in radians, 
The OFТ Frequeпcv Respoпse to а Сотр/ех /пput 119 Equation (359) te11s us that the inverse DFТ of the symmetrical rectan- gular function in Figure 338 is itself а real function that we can i11ustrate Ьу example, We'll реrfопn а 64--point inverse DFТ of the sequence in Figure 339(a). Our Н(т) is 11 unityvalued samples centered about the т = О index. Here the inverse DFТ results in an h(n) whose real and imaginary parts are shown in Figure 339(b) and Figure 339(c), respectively, As Eq, (347) predicted, hreal(n) is nonzero and himag(n) is zero. Тhe magnitude and phase of h(n) are depicted in Figure 3-39(d) and Figure 339(e), (Again, we've made the functions in Figure 339 easy to compare with the forward DFТ function in Figure 329,) It is h(n)'s real part that we're really after here, Тhose values of hreal(n) are used for the timedomain filter coefficients in the design of FIR lowpass filters that we'll discuss in Section 5.3. 3.14 The DFT Frequency Response to а Complex Input In this section, we'll determine the frequency response to an Npoint DFT when its input is а discrete sequence representing а complex sinusoid expressed as хс(п). Ву frequency response we mean the DFТ output sam ples when а complex sinusoidal sequence is app1ied to the DFТ, We begin Ьу depicting an хс(п) input sequence in Figure 3-40. Тhis time sequence is of the fопn Аеаl part 01 хс(п) (а) о 1 . ... \. . ':. , ,. · i · .: i:. .' '. ... .I!I .:' .... .. i '.. ,.}.., Time (п) ... t Imа9iП . ary part 01 хс(п) 1 .... ... ... . .: ; · . .I!I , · . 1 0 + . 1111 j II I!I !! 11 ! IIJI IIIIIII I1J1 III . .lll  . ' : :. .: : .. Т1те (п) 1 ... ... (Ь) Flgure 3-40 Complex tlme-domain sequeпce хс(п) = eJ2ппk/N haviпg two complete cycles (k = 2) over N samples: (а) real part 01 хс(п); (Ь) imaglnary part 01 хс(п), 
120 The Discrete Fourier Traпsforт хс(п) = ej21tnk/N , (360) where k is the number of complete cycles occurring in the N samples. Figure 340 shows xin) if we happen to let k = 2, If we denote our DFТ output sequence as Хс(т), and apply our хс(п) input to the DFТ expression in Eq, (32) we have Nl Nl Хс(т) = Lxc(n)ej21tnт/N = Lеj2"пk/N'еj21!пт/N п=О п=О Nl = Lej21tn(kт)/N, п=О (361) If we let N = К, п = р, and q = 21t(km)/N, Eq. (3--61) becomes Kl Хс(т) = LejPq р=о (362) Why did we make the substitutions in Eq, (361) to get Eq, (3-62)? Because, happily, we've already solved Eq. (362) when it was Eq, (3--39). Тhat closed form solution was Eq. (341) that we repeat here as Хс(т) = Iejpq = ejq(K1)/2. sin(qK /2) , р=о sin(q / 2) (3--63) Replacing our original variables from Eq, (361), we have our answer: DFf ()f а complex sinusoid:  Х ( )  j[1t(kт)1t(kт)/NJ sin[1t(k  т)] m e . с sin[1t(k  т) / N] (364) Like the Diricblet kemel in Eq, (3-43), the Хс(т) in Eq. (364) is а сот- plex expression where а ratio of sine terms is the amplitude of Хс(т) and the exponential term is the phase angle of Хс(т), At this point, we're inter ested only in the ratio of sines factor in Eq, (364), Its magnitude is shown in Figure 3--41, Notice that, because хс(п) is complex, there are по negative frequency components in Хс(т) , Let's think about the shaded curve in 
The ОП Frequeпcy Respoпse fo а Сотр/ех /пpuf 121 Figure 3-41 for а moment. That curve is the continuous Fourier transform of the complex хс(п) and сan Ье thought of as the continuous spectrum of the х/п) sequence. t Ву continuous spectrum we mеаn а spectrum that's defined at аН frequencies, not just at the periodic 1./ N analysis frequen- cies of аn N-point DFТ. The shape of this spectrum with its main lobe and sidelobes is а direct and unavoidable effect of analyzing anу finitelength time sequence, such as our хс(п) in Figure 340, We сап conceive of obtaining this continuous spectrum analytically Ьу taking the continuous Fourier transform of our discrete хс(п) sequence, а process some authors саН the discretetime Fourier transform (DТFr), but we can't actually calculate the continuous spectrum оп а computer, That's because the DТFr is defined only for infinitely long time sequences, and the DТFr's frequency variable is continuous with infinitely fine-grained resolution. What we сап do, however, is use the DFT to calculate аn approximation of xc(п)'s continuous spectrum, The DFТ outputs repre- sented Ьу the dots in Figure 341 are а discrete sampled version of xc(п)'s continuous spectrum, We could have sampled that continuous spectrum more often, i.e" approximated it more closely, with а larger DFT Ьу appending additional zeros to the original хс(п) sequence, We actually did that in Figиre 3-21, Figure 3-41 shows us why, when аn input sequence's frequency is exactly at the т = k Ыn center, the DFТ output is zero for аН bins except where т = k, If our input sequence frequency was k+O,25 cycles in the sample interval, the DFТ will sample the continuous spectrum shown in Figure 342 where аН of the DFT output Ыns would Ье nonzero, This effect is а demonstration of DFТ leakage described in Section 3,8, IХс(т)1 OFТ , response This curve is the continuous Fourier translorm 01 x(n) = ej2xпklN !!\ / ' ,\ f \ I i \ I , \ '''1 /'",r-,/"v/"V! [ \f'\/"\,,,__,,,- i'i'ii'i'i О k5 k-4 k--З 1f-2 k 1 k k+ 1 k+2 k+3 k+4 k+5 m N I k Figure 3-41 N-point DFТ frequency тagnitude response to а coтplex sinusoid having integral k cycles in the N-point time sequence хс(п) = eJ2xпk/N t Just as we used L'Hospita!'s ru!e to find the peak уа!ие of the Dirich1et kerne! in Eq, (344), we cou!d a!so eva!uate Eq, (3-64) to show that the peak of Хс(т) is N when т = k, 
122 The Discrete Fourier Traпsforт IХс(т)1 DFТ response k m о Flgure 3-42 N-poiпt DFТ frequeпcy magпltude respoпsв showlпg spectralleakage ot а complex slпusold havlпg k+O,25 cycles lп the N-poiпt tlme sequeпce хс(п), Again, just as there are several different expressions for the DFr of а rectangular function that we listed in ТаЫе 32, we сап express the ampli- tude response of the DFr to а complex input sinusoid in different ways to arrive at ТаЫе 3-3. ТаЫе 3-3 Varlous Forms ot the Amplitude Response ot the DFТ to а Complex lпput Sinusoid Having k Cycles (п the Sample lпteNal Descriptioп Expressioп Сотр!ех input OFf amplitude Х (т)= sin[1t(km)] response in terms of the integra! frequency variable т [From Eq, (З64)] с sin[1t(km)/N] Altemate form of the complex input OFf Х (т)= Nsin[1t(km)] arnplitude response in terms of the integra! ' 1t(km) frequency variable т [based оп Eq, (3-49)] Amplitude normalized сотр!ех input OFf Х (т)= sin[1t(km)] response in terms of the integral frequency с 1t(km) variable т Сотр!ех input OFf response in terms Х mj,)= Nsin[1t(km)fs] of the samp!e rate f. in Hz с( s 1t(k  m)f, Amplitude normalized сотр!ех input OFf Х (mj,) = sin[1t(k  m)f,] response in terms of the sample rate f. in Hz с s 1t(km)fs Amplitude normalized сотр!ех input OFf Х (тю)= 2sin[(kт)юs/2] response in terms of the sample rate (о. с s (kт)юs (3-65) (3-66) (3-67) (3-68) (3-69) (370) 
The OFТ Frequeпcy Respoпse to а Reaf Cosiпe fпput 123 At this point, the thoughtfиl reader тау notice that the DFТ' s response to а complex input of k cycles per sample interval in Figure 3-41100ks sus- piciously like the DFТ's response to an а11 ones rectangular function in Figure 332(c). Тhe reason the shapes of those two response curves look the same is because their shapes are the same. If our DFТ input sequence was а complex sinusoid of k = О cycles, i.e., а sequence of identical con- stant values, the ratio of sines term in Eq, (3-64) becomes sin[1t(O  т)] sin[1t(O  т) / N] = sin(1tт)  sin( хт / N) sin( хт) sin(1tт / N) , which is identical to the а11 ones form of the Dirich1et kernel in Eq, (3-48). Тhe shape of our Хс(т) DFТ response is the sinc function of the Dirich1et kemel. 3.15 The DFT Frequency Response to а Real Cosine Input Now that we know what the DFT frequency response is to а complex sinusoidal input, it's easy to determine the DFТ frequency response to а real input sequence. Say we want the DFT's response to а real cosine sequence, like that shown in Figure 3-40(а), expressed as Xr(п) = cos(21tпk/N) , (3-71) where k is the integral number of complete cycles occurring in the N sam- ples, Remembering Euler's relationship COS(I2I) = (e io + eio)/2, we сап show the desired DFТ as Х,(т) where Nl Nl Xr(т) = LXr(п)ei2Itnт/ N = L cos(21tпk / N). ei2Itnт/ N п=О п=О Nl = L(ei2Itnk/N +ei2Itnk/N)/2'ei2"nт/N п=О Nl Nl =  Lei21tn(kт)/N +  Lei2"n(k+т)/N , п=О п=О (372) 
124 The D/screte Four/er Traпsforт F ortunately, in the previous section we just finished determining the closed form of а summation expression like those in Eq. (3-72), so we сап write the closed form for Х/m) as DFr of а rea! cosine: --7 Х (т) = ej[1t(kтHt(kт)/ N] ..! sin[1t(k  т)] r 2sin[1t(km)/N] J '[1t(k+т)1t(k+т ) /N] 1 sin[1t(k + т)] +е . 2 sin[1t(k + т) / N] (3-73) We show the magnitude of those мо ratio of sines terms as the sinc functions in Figure 343, Here again, the DFT is sampling the input cosine sequence's continuous spectrum and, because k = т, оnlу опе DFf Ьin is nonzero. Because the DFf's input sequence is real, Х/m) has both positive and negative frequency components. The positive frequency portion of Figure 3-43 corresponds to the first ratio of sines term in Eq. N Т /\ f \ i , /\ I ' \ /\ "",,/ V \ /'-J"" 'i'ii'i,--1: --4--1<--I<2--1<' --1< --1<+,--1<+2--1<+з--1<+4 О IХ,(т)1 DFТ response N "2 Тhis curve, 810ng wh its -- / ' i\ negative Irequency I ре"/оп, is the continuous I \ j / Fourier tr8nslorm 01 ( х(п) = cos(21tпk/1l/), L /'..rJV ! /\/\/'.. ,,)'\........ l\'i'ii'i' k--4 k k k'. k k+' k+2 k+З k+4 m Flgure 3-43 N-point OFТ frequency magnitude response to о reol cosine havlng integrol k cycles in the N-point tlme sequence х,(п) = cos(21tпk/N), IX,(m)1 DFТ response N N Т ' ( \ , 1 ,\ т j 1\ " i , i \ ! ,1  11'f i\'i'i'l '" \ T'j"Yi i I Y1 V Y'T  --1<--4 --I< --I<--2--1<' t-* --1<+,--1<+2 --I<+З --1<+4 О k--4 k k--2 k' k k+ 1 k+2 k+З k+4 m k,25 k+O,25 Flgure 3-44 N-point OFТ frequency magnitude rвsponse showing spectrolleokoge of о reol cosine hoving k+Q,25 cycles in the N-point tlme sequence х,(п), 
Тhв OFТ S/пg/e-Biп Frequeпcy Respoпse to а Rea/ Cos/пe /пput 125 ТаЫе 3-4 Various Forms of the Positive Frequeпcy Amplltude Response of the OFТ to а Real Coslпe lпput Hav;пg k Cycles iп the Sample lпterval Descriptioп Expressioп Real input DFТ amplitude response in Х (т) = sin[1t(k  т)] terms of the integral frequency variable т r 2sin[1t(km)/N] [From Eq. (3-73)] AItemate form of the real input DFТ Х (т)  N sin[1t(k  т)] amplitude response in terms of the integral r 21t(km) frequency variable т [based оп Eq, (3-49)] Amplitude normalized real input Xr(m) sin[1t(km)] DFТ response in terms of the integral frequency variable т 21t(km) Real input DFТ response in terms of X,(m!s)  Nsin[1t(k  m)!s] the sample rate fs in Hz 21t(k  m)f, Amplitude normalized real input Xr(mfs)  sin[1t(k m)!sJ DFТ response in terms of the sample rate fs in нz 21t(k  m)f, Amplitude normalized real input Х (тш )  sin[(k т)ш, /2] DFТ response in terms of the sample rate W s in radians / s " (km)w, (3-74) (3-75) (3-76) (3-77) (3-78) (3-79) (3.73) and the second ratio of sines term in Eq. (3-73) produces the nega. tive frequency components of Х,(т). DFТ leakage is again demonstrated if our input sequence frequency were shifted from the center of the kth Ьin to k+O,25 as shown in Figure 3-44. (We used this concept of real input DFT amp1itude response to introduce the effects of DFТ leakage in Section 3.8.) In Table 3.4, the various m.athem.atical expressions for the (positive fre. quency) amplitude response of the DFf to а real cosine input sequence are simply those expressions in Table 3.3 reduced in amplitude Ьу а factor of 2. 3.16 The DFТ Single-Bin Frequency Response to а Real Cosine Input Now that we understand the DFТ's overal1 N.point (or N-bin) frequency response to а real cosine of k cycles per sample interval, we conclude this chapter Ьу determining the frequency response of а siпgle DFТ Ьin. We can think of а single DFТ Ьin as а kind of bandpass filter, and this useful notion is used, for example, to describe DFТ scalloping 10ss (Section 3.10), employed in the design of frequency.domain filter banks, and applied in 
126 Тhe D/screte Four/er Traпsform а telephone frequency multiplexing technique known as transmultiplex- ing[15]. То determine а DFI singlebin's frequency response, consider applying а real х.(п) cosine sequence to а DFI and monitoring the output magnitude of just the т = k Ыn. Let's say the initial frequency of the input cosm.e sequence starts at а frequency of k<т cycles and increases up to а frequency of k>т cycles in the sample interval. If we measure the DFT's Output (\ с=с> magnitude 01 the mth Ып ! \ (а) I \ '\, / о т--1 Output magnitude 01 the mth Ып (Ь) о т--1 пн-1 Output magnitude 01 the mth Ып (с) О Single-bin magnilude responSe (d) о k k '" k This curve is lhe COnlinuous frequency magnilude response 01 а OFТ'. m!h Ып when the OFТ Input is reai. Input Irequency k Flgure 3-45 Determinlng the output magnitude 01 the тth Ыn 01 оп N-point DF1": (а) when the real х,(п) has k = т--2,5 cycles In the tlme sequence; (Ь) when the real Х,(п) has k = т--l,5 cycles in the tlme sequence; (е) when tt1e real Х,(п) has k = т eyeles In the tlme sequenee; (d) the DF1" slngle-bin frequeney magn\tude response 01 the т = k Ыn, 
Refereпces 127 т = k Ьin during that frequency sweep, we'll see that its output magni- tude must track the input cosine sequence's continuous spectrum, shown as the shaded curves in Figure 3-45, Figure 3-45(а) shows the т = k bin's output when the input xr(п)'s fre quency is k = m2.5 cycles per sample interval, Increasing xr(п)'s fre- quency to k = m1.5 cycles per sample interval results in the т = k bin's output, shown in Figure 3-45(Ь), Continuing to sweep xr(п)'s frequency blgher Figure 3-45(с) shows the т = k bin's output when the input fre- quency is k = т, Тhroughout our input frequency sweeping exercise, we сап see that the т = k bin's output magnitude must trace out the cosine sequence's continuous spectrum, shown Ьу the solid curve in Figure 3-45(d), This means that а DFTs single-bin frequency magnitude response, to а real input sinusoid, is that solid sinc function curve defined Ьу Eqs. (3-74) through (3-79). References [1] Bracewell, R. "Тhe Fourier Transform," Scientific American, June 1989, [2] Struik, О. А Concise Нistory о/ Мathematics, Dover Pиblications Inc" New York, 1967, р. 142. [3] Williams, С. 5, Designing Digital Filters, Section 8,6, Prentice-Hall, Englewood Cliffs, New Jersey, 1986, р, 122, [4] Press, W" et аl, Numerical RecipesТhe Art o/Scientific Computing, Cambridge University Press, 1989, р, 426, [5] Geckin1i, N, с., and Yavuz, О, "Some Novel Windows and а Concise Tиtorial Comparison оЕ Window Families," IЕЕЕ Trans, оп Acoust, Speech, and Sigпal Proc" Vol, ASSP26, No, 6, December 1978, (Ву the way, оп page 505 оЕ this paper, the phrase "sиch that W(f) ;:: о '<1 Е" indicates that W(f) is never nega- tive, Тhe symbol '<1 means "for all,") [6] O'Donnell, J, "Looking Тhroиgh the Right Window Improves Spectral Analysis," EDN, November 1984, [7] Kaiser, J, F. "Digital Filters," in System Analysis Ьу Digital Computer, Ed, Ьу F, F. Кио and J, F, Kaiser, John Wiley and Sons, New York, 1966, рр, 218---277' [8] Rabiner, L, R., and Gold, В, The Theory and Application о/ Digital Signal Processing, Prentice-Hall, Englewood Cliffs, New Jersey, 1975, р, 88, [9] Schoenwald, J, "Тhe Sиrface Acoиstic Wave Filter: Window Functions," RF Design, March 1986, [10] Harris, F, "On the Use оЕ Windows for Harmonic Analysis with the Discrete Fourier Transform," Proceedings о/ the IЕЕЕ, Vol, 66, No. 1, Janиary 1978, 
128 Тhв D/screte Four/er Traпsform [11] Nиttall, А. Н, "Some Windows with Very Good Side!obe Behavior," [ЕЕЕ Traпs, оп Acoust, Speech, aпd Signa/ Proc., Vo!, ASSP-29, No, 1, Febrиary 1981. [12] Yanagimoto, У. "Receiver Design for а Combined RF Network and Spectrum Analyzer," HewlettPackllrd lourпa/, October, 1993, [13] Gul!emin, Е, А. The Мathematics о! Circuit Aпa/ysis, John Wiley and Sons, New York, 1949, р. 511. [14] Lanczos, С. Discourse оп Fourier Series, Chapter 1, Hamer Pиblishing Со" New York, 1966, р. 747, [15] Freeny, 5, "TDM/FDM Trans!ation As аn Application оЕ Digita! Signal Processing," [ЕЕЕ Commuпicatioпs Мagaziпe, Janиary 1980. 
!CHAPTER FOURI The Fast Fourier Transform Although the DFf is the most straightforward mathematical procedure for determining the frequency content of а timedomain sequence, it's ter ribly inefficient, As the number of points in the DFf is increased to hun dreds, or thousands, the amount of necessary number crunching becomes excessive. In 1965 а paper was published Ьу Cooley and Tukey describing а very efficient algorithrn to implement the DFf[l]. Тhat algorithrn is now known as the fast Fourier transform (FFf).t Before the advent of the FFf, thousandpoint DFfs took so long to perform that their ше was restricted to the larger research and university computer centers. Тhanks to Cooley, Tukey, and the sem.iconductor industry, 102point DFfs can now Ье per formed in а few seconds оп home computers. Volumes have been written about the FFf, and, like по other innоуа tion, the development of this algorithrn transformed the discipline of dig ital signal processing Ьу making the power of Fourier analysis affordable, In this chapter, we'll show why the most popular FFf algorithrn (called the radix2 FFf) is superior to the classical DFf algorithrn, present а series of recommendations to enhance our use of the FFf in practice, and pro vide а list of sources for FFf routines in various software languages. We conclude this chapter, for those readers wanting to know the internal details, with а derivation of the radix2 FFf and introduce several differ- ent ways in which this FFf is implemented. t Actual1y, the FFf has an interesting history. While analyzing X-ray scattering data, а сои- ple of physicists in the 1940s were taking advantage of the syrnmetries of sines and cosines using а mathematical method based оп а technique published in the early 1900s, Remarkably, over 20 years passed before the FFf was (re)discovered, Reference [2] tel1s the Мl story. 129 
130 The Fast Four/er Traпsform 4.1 Relationship о, the FFT to the DFТ Although тапу different FFТ algorithms have Ьееп developed, in this section we'll see why the radix2 FFТ algorithm is so popular and leam how it's related to the classical DFТ algorithm. Тhe radix2 FFТ algorithm is а very efficient process for performing DFTs under the constraint that the DFI size Ье ап integral power of two, (Тhat is, the number of points in the transform is N = 2 k , where k is some positive integer,) Let's see just why the radix-2 FFI is the favorite spectral analysis technique used Ьу signa1processing practitioners. Recall that our DFI Example 1 in Section 3.1 illustrated the number of redundant arithmetic operations necessary for а simple point DFI. (For example, we ended ир calculating the product of 1.0607' 0,707 four sepa rate times.) on the other hand, the radix2 FFТ eliminates these redundan cies and great1y reduces the number of necessary arithmetic operations, То appreciate the FFТ's efficiency, let's consider the number of complex multi plications necessary for our old friend, the expression for an Npoint DFI, Nl Х(т) = Lx(п)ej21tnт/N, п=О (4-1) For an 8point DFI, Eq. (41) tells us that we'd have to perform N'2 or 64 complex multiplications. (Тhat's because, for each of the eight X(m)s, we have to sum eight complex products as п goes from О to 7.) As we'll ver Ну in later sections of this chapter, the number of complex multiplications, for an Npoint FFI, is approximately N .10g2 N. 2 (4-2) (уУе say approximately because some multiplications tum out to Ье mul- tiplications Ьу +1 or 1, which amount to mere sign changes,) Well, this (N /2)10g2N value is а significant reduction from the N'2 complex multipli cations required Ьу Eq. (41), particularly for large N. То show just how significant, Figure 4 1 compares the number of complex multiplications required Ьу DFIs and radix2 FFТs as а function of the number of input data points N, When N = 512, for example, the DFI requires 200 times more complex multiplications than those needed Ьу the FFT, When N = 8192, the DFI must calculate 1000 complex multiplications for each complex multiplication in the FFТ! 
H/пts оп Usiпg FFТs iп Pract/ce 131 109 108 107 106 105 104 103 102 101 101 Number of complex multiplications у ./ OFТ / f"""" .......  FFТ ,......, ...r--"i-"'"  102 1(/ 1()" 1ff' N Figure 4-1 Number of complex multlplications 'п the OFТ and the radlx-2 FFТ 05 а function of N, It's appropriate now to make clear that the PFТ is not an approximation to the DFТ. It's exactly equal to the DFT; it is the DFТ. Moreover, аН of the performance characteristics of the DFТ described in the previous chapter, output symmetry, linearity, output magnitиdes, leakage, scaHoping loss, etc., also describe the behavior of the PFТ. 4.2 Hints оп Using FFTs in Practice Based оп how usefиl FFТs are, here's а list of practical pointers, or tips, оп acquiring input data samples and using the radix2 FFT to analyze real world signals or data, 4.2.1 Sample Fast Enough and Long Enough When digitizing continuous signals with an A/D converter, for ехат- ple, we know, from Chapter 2, that our sampling rate must Ье greater than twice the bandwidth of the continuous A/D input signal to pre vent frequency-domain aliasing. Depending оп the application, practi tioners typicaHy sample at 2,5 to four times the signal bandwidth, If we know that the bandwidth of the continuous signal is not too large rela tive to the maximum sample rate of our A/D converter, it's easy to avoid aliasing, If we don't know the continuous A/D input signal's 
132 The Fost Fourier Traпsforт bandwidth, how do we tell if we're having aliasing problems? Well, we shou1d mistrust any РРТ results that have significant spectra1 сотро- nents at frequencies near half the samp1e rate, Ideally, we' d like to work with signa1s whose spectra1 amplitudes decrease with increasing fre quency, Ве very suspicious of aliasing if there are any spectra1 сотро- nents whose frequencies appear to depend оп the samp1e rate, If we suspect that aliasing is occurring or that the continuous signa1 contains broadband noise, we'll have to use an ana10g 10w-pass filter prior to А/О conversion, The cutoff frequency of the 10w-pass filter must, of course, Ье greater than the frequency band of interest but 1ess than half the samp1e rate, Although we know that an N-point radix-2 FFf requires N == 2 k input samp1es, just how many samp1es must we collect before we perform our FFf? Тhe answer is that the data collection time interval must Ье 10ng enough to satisfy Our desired FFf frequency resolution for the given sam- ple rate f s ' Тhe data collection time interva1 is the reciproca1 of the desired FFf frequency resolution, and the longer we sample at а fixed fs sample rate, the finer our frequency reso1ution will Ье; that is, the tota1 data co1- lection time interva1 is N/fs seconds, and our N-point FFf bin-to-bin fre- quency resolution is f/N Hz, 50, for examp1e, if we need а spectra1 resolution of 5 Hz, then,fs/N = 5 Hz, and N = !s = ь.. = О,2!,. desired reso1ution 5 s (4-3) In this case, iffs is, say, 10 kНz, then N must Ье at least 2,000, and we'd choose N equal to 2048 because this number is а power of 2, 4.2.2 t,,1anipulatlng the Time Data Prior to Transformation When using the radix-2 РРТ, if we don't have control over the length of our timedomain data sequence, and that sequence length is not an integral power of two, we have two options, We could discard enough data samples so that the remaining РРТ input sequence length is some integra1 power of two, Тhis scheme is not recommended because ignor- ing data samples degrades our resu1tant frequency-domain resolution, (The larger N, the better our frequency resolution, right?) А better approach is to append enough zerovalued samples to the end of the Нте data sequence to match the number of points of the next largest radix2 РРТ. For examp1e, if we have 1000 time samples to transform, rather than analyzing only 512 of them with а 512-point FFf, we should 
H/пts оп Us/пg FFТs /п Practice 133 add 24 trailing zero-valued samples to the original sequence and use а 1024point FFT, (This zerostuffiпg technique is discussed in more detail in Section 3,11,) FFТs suffer the same ill effects оЕ spectralleakage that we discussed for the DFr in Section 3.8. We сап multiply the time data Ьу а window func tion to al1eviate this leakage problem, Ве prepared, though, for the fre quency resolution degradation inherent when windows are used. Ву the way, if appending zeros is necessary to extend а time sequence, we have to make sure that we append the zeros after mu1tiplying the original time data sequence Ьу а window function, Applying а window function to the appended zeros wi11 distort the resu1tant window and worsen our FFr leakage problems. Although windowing will reduce leakage problems, it wi11 not elimi nate them a1together, Even when windowing is employed, highlevel spectral components can obscure nearby lowlevel spectral components, Тhis is especial1y evident when the original time data has а nonzero aver age, i,e., it's riding оп а ос bias, When the FFr is реrfопnеd in this case, а largeamplitude DC spectral component at О Hz will overshadow its spectral neighbors, We сап eliminate this problem Ьу calculating the aver age оЕ the time sequence and subtract that average value Етот each sam ple in the original sequence, (Тhe averaging and subtraction process must Ье performed before windowing,) Тhis technique makes the new time sequence's average (mean) value equal to zero and eliminates any high level, OНZ component in the FFТ resu1ts, 4.2.3 Enhanclng FFТ Results If we're using the FFr to detect signal energy in the presence оЕ noise and enough timedomain data is available, we сап improve the sensitivity оЕ our processing Ьу averaging mu1tiple FFrs. Тhis technique, discussed in Section 10,7, сап Ье implemented very efficient1y to detect signal energy that's actual1y below the average noise level; that is, given enough time domain data, we сап detect signal components that have negative signal- to-noise ratios, If our original timedomain data is real-valued only, we сап take advantage оЕ the 2NPoint Real FFr technique in Section 10.5 to speed ир our processing; that is, а 2N-point real sequence сап Ье trапsfопnеd with а single N-point complex radix2 FFr, Тhus we сап get the frequency res- olution оЕ а 2Npoint FFr for just about the computational price оЕ per forming а standard N-point FFr, Another FFТ speed enhancement is the possible use of the frequencydomain windowing technique discussed in 
134 The Fast Fourier Traпsforт 5ection 10.3. If we need the FFТ of unwindowed timedomain data and, at the same time, we also want the FFТ of that same tirne data with а win dow function applied, we don't have to perform two separate FFТs. We сап perform the FFТ of the unwindowed data, and then we can perform frequency-domain windowing to reduce spectralleakage оп any, or аН, оЕ the FFТ Ьin outputs. 4.2.4 Interpretlng FFТ Results Тhe first step in interpreting PFТ results is to compute the absolute fre quency оЕ the individual FFТ Ьin centers, Like the DFТ, the FFТ Ьin spac ing is the ratio оЕ the sampling rate (f.) over the number оЕ points in the FFТ, or f/N. With our PFТ output designated Ьу Х(т), where т = О, 1, 2, 3, ' . ., Nl, the absolute frequency оЕ the mth bin center is mfs/N, If the FFТ's input tirne samples are real, only the Х(т) outputs from т = О to т = N /2 are independent. 50, in this case, we need determine only the absolute FFТ Ьin frequencies for т over the range оЕ О S; т S; N /2. If the PFТ input samples are complex, аН N оЕ the FFТ outputs are independent, and we should compute the absolute FFТ Ьin frequencies for т over the full range of О S; т S; Nl. If necessary, we can determine the true amplitude оЕ tirnedomain sig nals from their FFТ spectral results. То do so, we have to keep in mind that radix2 PFТ outputs are complex and оЕ the form Х(т) = Xrea1(m) + jXimag(m) , (44) AIso, the FFТ output magnitude samples, Xmag(m) =1 Х(т) 1=  XreaJ(m)2 + X imag (m)2 , (45) are all inherent1y multiplied Ьу the factor N /2, as described in Section 3.4, when the input samples are real. If the FFТ input samples are complex, the scaling factor is N. 50 to determine the correct amplitudes оЕ the time domain sinusoidal components, we' d have to divide the FFТ magnitudes Ьу the appropriate scale factor, N /2 for real inputs and N for complex inputs. If а window function was used оп the original tirne-domain data, some оЕ the FFТ input samples will Ье attenuated. Тhis reduces the resultant FFТ output magnitudes from their true unwindowed values. То calculate the correct amplitudes оЕ various timedomain sinusoidal components, then, we'd have to further divide the FFТ magnitudes Ьу the appropriate 
H/пts оп Us/пg FFТs /п Pract/ce 135 processing 10ss factor associated with the window function used, Processing 10ss factors for the most popular window fиnctions are listed in Reference [3]. Should we want to determine the power spectrum Xps(m) of an РП result, we'd calculate the magnitudesquared va1ues using Xps(m) = 1 Х(т) 12 = X real (m)2 + X imag (m)2, (4-6) Doing So wou1d allow us to compute the power spectrum in decibe1s with XdB(m) = 10 .10g10 ( I Х(т) 12) dB. (4-7) Тhe normalized power spectrum in decibe1s сап Ье calculated using , ( 1 Х(т) 12 ) norma1lzed XdB(m) = 10 . log 10 2 ' (1 Х(т) Imax) (4-8) or , ( I Х(т) I ) normal1Zed XdB(m) = 20 .10glO ' 1 Х(т) 'тах (4-9) In Eqs, (4-8) and (4-9), the term I Х(т) 1 тах is the 1argest PFТ output mag- nitude samp1e. In practice, we find that p10tting XdB(m) is very informa- tive because of the enhanced 10wmagnitude reso1ution afforded Ьу the 10garithmic decibe1 sca1e, as described in Appendix Е. If either Eq, (4-8) or Eq, (49) is used, по compensation need Ье performed for the above mentioned N or N /2 РП sca1e or window processing 10ss factors, Normalization through division Ьу (1 Х(т) 1 таУ or 1 Х(т) 1 тах elimi nates the effect of any abso1ute PFТ or window sca1e factors. Кnowing that the phase ang1es Х,,(т) of the individua1 FFТ oиtputs are given Ьу Х",(т) = tanl ( Ximag(m) ) , X real (т) (410) it's important to watch out for Xreal(m) values that are equal to zero, Тhat would invalidate our phase ang1e calculations in Eq, (4-10) due to division 
136 The Fost Four/er Troпsforт Ьу а zero condition. In practice, we want to make sure that our calculations (or software compiler) detect осcuпеnсеs of Xreal(m) = О and set the corre-- sponding Хе(т) to 900 if Ximaim) is positive, set Хе(т) to 00 if Ximaim) is zero, and set Хе(т) to 900 if Ximag(m) is negative. While we're оп the subject of FFf output phase angles, Ье aware that FFf outputs containing signifi cant noise components can cause large f1uctuations in the computed Хе(т) phase angles, This mеans that the Х/т) samples are only meaningful when the corresponding I Х(т) I is well above the average FFf output noise level, 4.3 FFТ Software Programs For readers seeking actual FFТ software routines without having to Ьиу those highpriced signal processing software packages, риЬНс domain radix2 FFТ routines are readily available, References [4---7] provide stan- dard FFТ program listings using the FORТRAN language. Reference [8] presents an efficient FFT program written in FORTRAN for realonly input data sequences. Reference [9] provides а standard FFТ program written in HP BASICTM, and reference [10] presents an FFТ routine writ ten in Applesoft BASICTM. Readers interested in the Ada language сап find FFТrelated subroutines in reference [11]. 4.4 Derivation о, the Radix2 FFТ Algorithm тhis section and those that follow provide а detailed description of the internal data structures and operations of the radix2 FFТ for those read- ers interested in developing software FFТ routines or designing FFf hard- ware. То see just exact1y how the FFТ evolved from the DFТ, we retum to the equation for an Npoint DFТ, Nl Х(т) = x(n)ej211пт!N, п=О (1l) А straightforward derivation of the FFТ proceeds with the separation of the input data sequence х(п) into two parts, When х(п) is segmented into its even and odd indexed elements, we сап, then, break Eq, (411) into two parts as (N /2Н (N /2Н Х(т)= x(2n)ej211(2п)т!N + x(2n+1)ej211(2п+l)т!N, (412) п=О п=О 
Der/vat/oп of the Radix-2 FFТ A/gor/thm 137 Pulling the constant phase angle outside the second summation, (N/2H (Nl Х(т) = Lx(2n)ej27t(2n)т/N + ej27tm/N LX(2n + 1)ej27t(2n)m/N. (4-13) п=О п=О Well, here the equations get so long and drawn out that we'll use the standard notation to simplify things. We'll define W N = ej27t/N to repre sent the complex phase angle factor that is constant with N. 50 Eq. (4-13) becomes (N/2H (N/2H Х(т) = L-x(2n)wnm + W!J L-x(2n + l)Wnm . п=О п=О (4-14) Because W = ej27t2/(N) = ej27t/(N/2), we сап substitute W N /2 for  in Eq. (4-14), as (N/2)1 (N/2)1 Х(т) = L-х(2n)Wi2 + W!'l L-x(2n + 1)Wi2 . п=О п=О (15) 50 we now have two N /2 summations whose results can Ье combined to give us the N-point DFТ. We've reduced some of the necessary number crnnching in Eq, (15) relative to Eq. (4-11) because the W terms in the two summations of Eq. (4-15) are identical. Тhere's а further benefit in breaking the N-point DFТ into two parts because the upper half of the DFТ outputs are easy to calculate. Consider the X(m+N/2) output. If we plug m+N/2 in for т in Eq. (4-15), then (N/2H Х(т + N / 2) = '" X(2n)W n (m+N /2)  N/2 п=О (m+N /2) (N /2)1 + W '" Х ( 2п + l ) W n (m+N /2) N  N /2 п=О (4-16) It looks like we're complicating things, right? Well, just hang in there for а moment. We сап now simplify the phase angle terms inside the sum- mations because 
138 The Fost Foиrier Troпsforт W п (m+N/2) =W пm W пN / 2 =Wпm ( ej2"п2N/2N ) N/2 N/2 N/2 N/2 = W;J/2(1) = W;J/2' (4-17) for anу integer n, Looking at the so-called twiddle factor in front оЕ the sec ond summation in Eq. (416), we сап simplify it as Wm+N /2) = WNW/J /2 = WN(ej27tN /2N) = WNH) = WN' (4--18) ОК, using Eqs, (4--17) and (4--18), we represent Eq. (416)'s X(m+N/2) as (N/2H (N/2H X(m+N /2)= LX(2n)W;J/2 WN LX(2n+1)W;J/2' (4-19) п=О п=О Now, let's repeat Eqs, (4--15) and (4-19) to see the similarity; (Nl (N/2H Х(т)= Lx(2п)W;J/2 +W N LX(2n+1)W;J/2' п=О п=О (4--20) and (Nl (Nl X(m+N /2)= Lx(2n)W/2 W;'J LX(2n+1)W N / 2 . п=О п=О (4-20') 50 here we are, We need not perform аnу sine or cosine multiplications to get X(m+N/2). We just change the sign оЕ the twiddle factor W N and use the results of the two summations from Х(т) to get X(m+N /2), ОЕ course, т goes from О to (N /2) 1 in Eq. (4-20) which means, for аn N-point ОРТ, we perform an N /2-point ОРТ to get the first N /2 outputs and use those to get the last N/2 outputs, For N = 8, Eqs. (420) and (4--20') are imple mented as shown in Figure 42. If we simplify Eqs. (4-20) and (4-20') to the form Х(т) = А(т) + W N В(т) , (4-21) and 
DerivQtioп о' the RQdix2 FFТ A/gorithт 13«; х(6) Х(З) х(О) Х(О) 4-point OFТ х(2) Х(1) з L nт х(2n) W 4 х(4) О Х(2) х(1) Х(4) Х(З) Х(5) х(5) Х(6) х(7) Х(7) Flgure 4-2 FFТ Implementotlon of оп 8-polnt DFТ uslng two 4-point DFТs, X(m+N/2) = А(т)  W;:; В(т) , (421') we сап go further and think about breaking the two 4point DFTs into four 2-point DFТs. Let's see how we сап subdivide the upper 4point DFT in Figure 4-2 whose four outputs are А(т) in Eqs, (421) and (421'), We segment the inputs to the upper 4-point OFТ into their odd and even components 
140 The Fost Four/er Traпsforт (N/2H (NH (NH А(т) = Lx(2п)Wi2 = Lx(4п)WJ'i + LX(4п + 1)wt 4 i;1)т , п=О 2п=О 2п=О or (Nl (N-l А(т)= Lx(4п)WJ'i +W/J/2 Lx(4п+1)WJ'i 2п=О 2п=О (422) If we let р = 2п, the index of the sumrnations in Eq. (422) can Ье simpli fied to give А(т) the more familiar form of (Nl (Nl А(т)= Lx(2p)W4 +W/J/2 Lx(2p+1)W4' р=О р=О (4-23) Notice the similarity between Eq. (423) and Eq. (+20). This capability to subdivide ап N /2point DFТ into two N / +point DFТs gives the FFТ its capacity to greatly reduce the number of necessary mu1tiplications to imple ment DFТs. (We're going to prove this shortly.) Following the same steps that we used to obtain А(т), we can show that Eq. (+21)'s В(т) is given Ьу (Nl (Nl В(т)= Lx(2p)W4W/J/2 Lx(2p+1)W4' р=О р=О (+24) For our N = 8 example, Eqs. (+23) and (424) are implemented as shown in Figure 4-3. The FFTs wellknown butterfly pattem of signal flows is cer tain1yevident, and we see the fиrther shuffling of the input data in Figure 43. The twiddle factor Wfj/2 in Eqs. (423) and (424), for our N = 8 exaт ple, ranges from W to Wl because the т index, for А(т) and В(т), goes from О to 3. For апу Npoint DFТ, we can break each of the N /2-point DFТs into two N/4point DFТs to fиrther reduce the number of sine and cosine multiplications, Eventually, we wou1d arrive at ап array of 2point DFТs where по fиrther computational savings could Ье realized. Тhis is why the number of points in our FFТs are constrained to Ье some power of 2 and why this FFТ algorithm is referred to as the radix2 FFТ. Moving right along, let's go опе step further, and then we'll Ье fin ished with our N = 8 point FFТ derivation. The 2point DFТ fиnctions in 
х(О).......... 2-polnt DFT х(4) ....... Derlvatfoп of the Radlx-2 FFТ Algorlthm 141 А(О) Х(О) Х(1) х(2)....... Х(2) 2-polnt DFТ х(б)....... Х(З) х( 1) ........ )«4) 2-polnt DFТ х(5)....... X(S) Х(З) ....... 2-point DFТ х(7) .......... В(З) Х(6) Х(7) Flgure 4-3 FFТ implementotlon of оп 8-polnt DFТ 05 two 4-polnt DFТs ond four 2-polnt DFТs, Figure 43 cannot Ье partitioned into smaller partswe've reached the end of our DFT reduction process arriving at the butterfly of а single 2point DFT as shown in Figure 44. From the definition of W N , W = ej21t01N = 1 and WiJ/2 = ej21tN 12N = j1t = 1, 50 the 2point DFТ blocks in Figure 3 сап Ье replaced Ьу the butterfly in Figure 4 to give us а full 8point PFТ implementation of the DFТ as shown in Figure 45. 
142 The Fost Four/er Troпsforт x(k) x(k+N/2) Figure 4-4 Single 2-point DFТ butterf\y. ОК, we've gone through а fair amount of algebraic foot shuff1ing here. То verify that the derivation of the РРТ is valid, we сап apply the 8-point data sequence of Chapter 3's DFT Example 1 to the 8point РРТ represented Ьу Figure 4-5. The data sequence representing х(п) = sin(21t1000nt s ) + O,5sin(21t2000nt s +3п/ 4) is х(О) = 0,3535, х(2) = 0.6464, х(4) = 0,3535, х(6) = 1.3535, х(l) = 0.3535, х(3) = 1,0607, х(5) = l,0607, х(7) = O,3535. (425) We begin grinding through this example Ьу applying the input values from Eq. (425) to Figure 4-5, giving the data values shown оп left side of Figure 4-6, The outputs of the second stage of the FFf are А(О) = 0.707 +  (0.707) = 0.707 + (1 + jO)(0.707) = О + jO, А(l) = 0,0 + wl (1.999) = 0,0 + (О  j1)(1.999) = О  j1,999, А(2) = 0,707 + vq (0.707) = 0.707 + Н + jO)(O,707) = 1,414 + jO, А(3) = 0,0 + wl (1.999) = 0,0 + (О + j1)(1.999) = О + j1.999, 8(0) = O,707 +  (0.707) = 0.707 + (1 + jO)(O,707) = О + jO, 8(1) = 1.414 + wl (1.414) = 1.414 + (О  j1)(1.414) = 1.414  j1,414, 8(2) = 0.707 + vq (0,707) = O,707 + Н + jO)(0.707) = 1.414 + jO, and В(3) = 1.414 + wl (1,414) = 1.414 + (О + j1)(1.414) = 1.414 + j1.414 , Ca1culating the outputs of the third stage of the FFf to arrive at our final answer 
Der/vatloп of the Radix-2 FП A/gorithm 143 Х(О) А(О) Х(О) х(4) Х(1) х(2) Х(2) х(6) Х(З) х(1) Х(4) х(5) Х(5} х(З) Х(6} х(7) Х(7) Flgure 4-5 Full decimotlon-in-tlme FFТ Implementotlon of оп 8-polnt DFТ. Х(О) = А(О) +  В(О) = О + jO + (1 + jO)( О + jO) = О + jO + О + jO = О LO°, Х(l) = А(l) +  В(l) = О  j1.999 + (0,707  jO,707)(l,414  j1,414) = О  j1.999 + О  j1.999 = О  j4 = 4 L90° Х(2) = А(2) +  В(2) = 1.414 + jO + (О  j1)( 1.414 + jO) = 1,414 + jO + О + j1,4242 = 1.414 + j1,414 = 2 З50, Х(З) = А(З) +  В(З) = О + j1.999 + (O,707  jO.707)(l,414 + j1,414 ) = О + j1.999 + О  j1,999 = О LO°, 
144 The Fast Fourier Traпsform х(2) Z O'6464 "'{),707 1 х(6)  1,3535  1 1.999 Х(О) Х(1) Х(2) Х(З) Х(4) Х(5) Х(6) х(7) "'{),3535 I 1 1 51 Stage 1.414 11 I 2nd Stage В(З) 11 Х(7) 1 зrd Stage Figure 4-6 8-polnt FFТ of Example 1 f10m Sectlon 3,1, Х(4) = А(О) + W В(О) = О + jO + Н + jO)(O + jO) = О + jO + О + jO = О LO°, Х(5) = А(l) + wg В(l) = О  j1.999 + (0.707 + jO.707)(l,414  j1.414) = О  j1.999 + О + j1.999 = О LO°, Х(6) = А(2) + wg В(2) = 1,414 + jO + (О + тН,414 + jO) = 1,414 + jO + О  j1,414 = 1.414  j1.414 = 2 L45°, and Х(7) = А(3) +  В(3) = О + j1.999 + (0.707 + jO.707)(1.414 + j1.414) = О + j1.999 + О + j1.999 = О + j4 = 4 L90°, 
FFТ lпput/Output Data lпdex Bit Reversal 145 6 3 W 8 =W 4 4 2 W 8 = W 4 7 W 8 о о W =W 8 4 з W 8 1 W 8 2 1 W 8 = W 4 Flgure 4-7 Cycllc redundancles In the twlddle factors of an 8-polnt FFТ, 50, happily, the FFТ gives us the correct results, and again we remind .the reader that the FFТ is not an approximation to а DFТ; it is а DFТ with а reduced number о! necessary arithmetic operations, You've seen from the above example that the 8point FFТ example required less effort than the 8point DFТ Example 1 in Section 3.1. Some authors like to explain this arithmetic reduction Ьу the redundancies inherent in the twiddle factors W N . Тhey illustrate this with the starburst pattern in Figure 4--7 showing the equivalencies о! some о! the twiddle factors in an 8point DFТ. 4.5 FFТ Input/Output Data Index Bit Reversal ок, let's look into some оЕ the special properties оЕ the FFT that are important to FFT software developers and FFT hardware designers, Notice that Figure 45 was titled "Ful1 decimationintime FFТ imple mentation о! an 8point DFT." The deciтatioпiпtiтe phrase refers to how we broke the DFТ input samples into odd and even parts in the derivation о! Eqs. (4--20), (423), and (424). Тhis time decimation leads to the scrambled order оЕ the input data's index п in Figure 45. Тhe pattern оЕ this shuffled order сап Ье understood with the help о! ТаЫе 41. Тhe shuffling о! the input data is known as bit reversal because the scrambled order о! the input data index сап Ье obtained Ьу reversing the bits оЕ the binary representation о! the normal input data index order, 50unds con fusing, but it's real1y notTable 4-1 illustrates the input index bit rever- sal for our 8point FFТ example. Notice the nопnаl index order in the left 
146 The Fast Four/er Traпsforт ТаЫе 4-1 Input Index Bit Reversal for оп 8point FFТ Normal order Biпary bits Reversed bits Bitreversed о/ iпdex n о/ iпdex n о/ iпdex n order о/ iпdex n о 000 000 о 1 001 100 4 2 010 010 2 3 011 110 6 4 100 001 1 5 101 101 5 6 110 011 3 7 111 111 7 colurnn of Table 4-1 and the scrambled order in the right colurnn that cor- responds to the final decimated input index order in Figure 4-5. We've transposed the original binary bits representing the normal index order Ьу reversing their positions. Тhe most significant bit becomes the least significant bit and the least significant bit becomes the most significant bit, the next to the most significant bit becomes the next to the least sig- nificant bit, and the next to the least significant bit becomes the next to the most significant bit, and so on,+ 4.6 Radix-2 FFТ Butterfly Structures Let' s explore the butterf1y signal f10ws of the decimation-in-time PFТ а bit further. То simplify the signal f1ows, let's replace the twiddle factors in Figure 4-5 with their equivalent values referenced to W N , where N = 8. We сап show just the exponents m of W N , to get the FFТ structure shown in Figure 4-8, Тhat is, Wl from Figure 4-5 is equal to Wl and is shown as а 2 in Figure 4-8, WJ from Figure 4-5 is equal to W: and is shown as а 4 in Figure 4-8, etc. Тhe ls and ls in the first stage of Figure 4-5 are replaced in Figure 4-8 Ьу Os and 4s, respectively. Other than the twiddle factor nota- tiOIl, Figure 4-8 is identical to Figure 4-5. We сап shift around the signal nodes in Figure 4-5 and апivе at an 8-point decimation-in-time PFТ as shown in Figure 4-9, Notice that the input data in Figure 4-9 is in its nor- mal order and the output data indices are bit-reversed. In this case, а bit- reversal operation needs to Ье performed at the output of the РРТ to unscramble the frequency-domain results, t Маnу that are first shall Ье last; and the last first, [Mark 10:31] 
Rad/x-2 FFТ Butterffy structures 147 Х(О) Х(О) Х(1) Х(2) Х(З) Х(4) Х(5) Х(6) Х(7) Х(О) Х(4) Х(2) ,...... Х(6) Х(1) Х(5) Х(З) Х(7) Figure 4-10 shows аn FFТ signalflow structure that avoids the bit- reversal problem altogether, and the graceful weave of the traditional FFf butterflies is replaced with а tangled, but effective, configuration, Not too long ago, hardware implementations of the FFТ spent most of their time (clock cycles) performing multiplications, and the bitreversal process necessary to access data in memory wasn't а significant portion of х(4) х(2) х(6) х(1) х(5) х(З) х(7) Flgure 4-8 8-point decimation-In-time FFТ with biHeversed inputs, Х(О) х(1) х(2) х(З) х(4) х(5) х(6) х(7) Figure 4.9 8-point decimatlon-in-tlme FFТ with biHeversed outputs, 
148 The Fost Four/er Troпsforт Х(О) Х(О) х(1) Х(1) х(2) Х(2) Х(З) Х(З) х(4) Х(4) х(5) Х(5) х(6) Х(6) х(7) Х(7) Flgure 4-10 8-point decimatlon-in-tlme FFТ wlth inputs and outputs in normal order. the overall РРТ computational problem, Now that highspeed multi plier/accumulator integrated circuits can multiply two numbers in а Бin gle clock cycle, PFТ data multiplexing and memory addressing have Ьесоте тиш more important, This has led to the development of еШ cient algorithms to perform bit reversal[12lS]. There's another derivation for the PFТ that leads to butterfly struc tures looking like those we've already covered, but the twiddle factors in the butterflies are different, This altemate FFТ technique is known аБ the decimation-infrequency algorithm. Where the decimation-in-time PFТ algorithm is based оп subdividing the input data into its odd and even components, the decimation-infrequency РРТ algorithm is founded upon calculating the odd and even output frequency samples separately. The derivation of the decimationin-frequency algorithm is straightfor ward and included in тапу tutoriaI papers and textbooks, БО we won't go through the derivation here[4,S,lS,16]. We will, however, illustrate decimationinfrequency butterfly structures (analogous to the structures in Figures 4-8 through 4-10) in Figures 4--11 though 4-13. 50 an equivalent decimationin-frequency PFТ structure exists for each decimation-intime PFТ structure. It's important to note that the number of necessary multiplications to implement the decimationin-frequency PFТ algorithms is the Бате аБ the number necessary for the decimation intime PFТ algorithms, There are БО тапу different PFТ butterfly struc tures described in the literature, that it' s еаву to Ьесоте confused about 
Rad/x-2 FFТ 8utterfly Structures 149 х(О) Х(О) х(4) Х(1) х(2) Х(2) х(6) Х(3) О х(1) 4X(4) О х(5) 4X(5) О х(3) 4X(6) О х(7) 4X(7) Flgure 4.11 8-polnt declmatlon-in-frequency FFТ with bIt-rеvеrsеd inputs х(О) Х(О) х(1)  Х(4) х(2) Х(2) х(з) Х(6) х(4) Х(1) х(5)  Х(5) х(6) Х(3) х(7) Х(7) Flgure 4.12 8-polnt declmatlon-In-frequency FFТ with bit-reversed outputs, wblch structures are decimation-in-time and which are decimationin frequency, Depending оп how the material is presented, it's easy for а beginner to fall into the trap of believing that decimationintime FFТs always have their inputs bitreversed and decimation-infrequency FFТs always have their outputs bitreversed. This is not true, as the аЬоуе fig ures show, Decimation-intime or frequency is determined Ьу whether 
150 The Fast Fourier Traпsforт х(О) Х(О) х(1 ) Х(1) х(2) Х(2) х(З) Х(З) О х(4) 4X(4) О х(5) 4X(5) О х(6) 4X(6) О х(7) 4X(7) Flgure 4-13 8-point decimation-In-frequency FFТ with inputs and outputs in normai order, the DFT inputs or outputs are partitioned when deriving а particular PFТ butterfly structure from the DFТ equations, Let's take one more look at а single butterfly, Тhe FFТ butterfly struc tures in Figures 48, 49, 411, and 412 are the direct result of the deriva tions of the decimationintime and decimation-infrequency algorithms, Although it's not very obvious at first, the twiddle factor exponents shown in these structures do have а consistent pattern, Notice how they always take the general forms shown in Figure 414(a),t То implement the decimationintime butterfly of Figure 414(a), we'd have to perform two complex mu1tiplications and two complex additions, Well, there's а better way. Consider the decimation-intime butterfly in Figure 4 14(а), If the top input is х and the bottom input is у, the top butterfly output would Ье х' = х + W у , (4-26) and the bottom butterfly output would Ье у' = х + W+N/2 у. (4-27) t Remember, for simplicity the butterfly structures in Figures 4-8 through 4 13 show only the twiddle factor exponents, k and k+N /2, and nо! the еnШе complex twiddle factors, 
Radix-2 FFТ 8utterfly Struetures 151 Decimation in time Decimation in frequency х х' х х" (а) W k у у' У W k +N/2  " N У   х х' х х" (Ь) У у' У   х х' х х" (с) k k y........W N у' У Wy" Flgure 4-14 Deelmation-in-time and deeimation-in-frequeney butterfly structures: (а) original form; (Ь) simplifted form; (е) optimized form, Fortunately, the operations in Eqs, (426) and (4-27) сап Ье simplified because the two twiddle factors are related Ьу wt+ N /2 = wtwй /2 = wt(еj2пN /2N) = wtH) = wt, (4-28) So we сап replace the W+N/2 twiddle factors in Figure 4-14(а) with wt to give us the simplified butterflies shown in Figure 4-14(Ь). Rea1izing that the twiddle factors in Figure 4-14(Ь) differ only Ьу their signs, the optimized butterflies in Figure 4-14(с) сап Ье used, Notice that these optiтized butterflies require two complex additions but only 
152 Тhe Fast Four/er Traпsforт one complex multiplication, thus reducing our computational work- load,+ We'll often see the optimized butterfly structures of Figure 414(c) in the literature instead of those in Figure 4--14(а), Тhese optimized butter- flies give us an easy way to recognize decimationintime and decimation- in-frequency algorithms, When we do соте across the optimized butterflies from Figure 4-14(с), we'll know that the algorithm is decima tionin-time if the twiddle factor precedes the  1, or else the algorithm is decimation-in-frequency if the twiddle factor follows the 1, 50metimes we'll encounter FFТ structures in the literature that use the notation shown in Figure 415 [5, 17], Тhese wingless butterflies are equiv- alent to those shown in Figure 414(c), The signalflow convention in Figure 4-15 is such that the plus output of а circle is the sum of the two samples that enter the circle from the left, and the minus output of а cir- cle is the difference of the samples that enter the circle, 50 the outputs of the decimation-intime butterflies in Figure 4-14(с) and Figure 4-15(а) are given Ьу х' = х + wt у' and у' = х   у . (4-29) The outputs of the decimation-in-frequency butterflies in Figure 414(c) and Figure 4 15(Ь) are " d " W k ( ) W k W k Х =х+у,an у = N xy = NX NY' (4--30) х х' х у" у у' у (а) (Ь) Flgure 4-15 Alternate FFТ butterfly nototlon: (о) declтatlon-In-tlтe; (Ь) declтotlon-In-frequency, + It's because there are (N/2)log2N butterf1ies in an N-point FFТ that we said the number of complex multiplications perform.ed Ьу an FFТ is (N /2)log2N in Eq, (42), 
Radix-2 FFТ Butterfly Structures 153 So which FFf structure is the best one to use? It depends оп the appli cation, the hardware implementation, and convenience. If we're using а software routine to perform FFТs оп а generalpurpose computer, we usu аllу don't have а lot оЕ choices, Most folks just use whatever existing FFf routines happen to Ье included in their commercial software package. Тheir code mау Ье optimized for speed, but you never know, Examination оЕ the software code mау Ье necessary to see just how the FFf is imple mented. If we feel the пeed for speed, we should check to see if the software calculates the sines and cosines each time it needs а twiddle factor, Trigonometric calculations normally take many machine cycles, It mау Ье possible to speed up the algorithm Ьу calculating the twiddle factors ahead оЕ time and storing them in а table. Тhat way, they сап Ье looked ир, instead ofbeing calculated each time they're needed in а butterf1y. Ifwe're writing our own software routine, checking for butterf1y output data overf1ow and careful magnitude scaling mау allow our FFf to Ье per- formed using integer arithmetic that сап Ье faster оп some machines.+ Care must Ье taken, however, when using integer arithmetic; some Reduced Instruction Set Computer (RISC) processors actually take longer to perform integer calculations because they're specifically designed to operate оп f1oatingpoint numbers. If we're using commercial array processor hardware for our calcula tions, the code in these processors is always optimized because their pur pose in life is high speed. Array processor manufacturers typicaHy publicize their products Ьу specifying the speed at which their machines perform а 1024point FFf, Let's look at some оЕ our options in selecting а particular FFf structure in case we're designing specialpurpose hard ware to implement an FFf. The FFT butterf1y structures previously discussed typically ЕаН into one оЕ two categories: inplace FFT algorithms and doublememory FFf algorithms. An inplace algorithm is depicted in Figure 45, The output оЕ а butterf1y operation сап Ье stored in the same hardware memory locations that previously he1d the butterf1y's input data, No intermediate storage is necessary, This way, for an N-point FFT, only 2N memory locations are needed, (Тhe 2 comes from the fact that each but- terf1y node represents а data value that has both а real and an imagi- nary part.) Тhe rub with the inplace algorithms is that data routing and memory addressing is rather complicated, А doublememory FFT t Overflow is what happens when the result о! an arithmetic operation has too тапу bits, or digits, to Ье represented in the hardware registers designed to contain that result, FFТ data overflow is described in Section 9,3, 
154 Тhe Fast Four/er Traпsforт structure is that depicted in Figure 410. With this structure, intermedi ate s torage is necessary because we по longer have the standard but terflies, and 4N memory locations are needed. However, data routing and memory address control is much simpler in doublememory FFT structures than the inplace technique. The use of highspeed, floating- point integrated circuits to implement pipelined FFT architectures takes better advantage of their pipelined structure when the double memory algorithm is used[18], There' s another class of FFТ structures, known as constantgeometry algorithms, that make the addressing of memory both simple and con stant for each stage of the FFr. Тhese structures are of interest to those fo1ks who build specialpurpose FFf hardware devices[4,19]. From the standpoint of general hardware the decimationintime algorithms are optimum for real input data sequences, and decimationinfrequency is appropriate when the input is complex[8], When the FFf input data is symmetrical in time, special FFI structures exist to eliminate unnecessary calcиlations. Тhese special butterfly structures based оп input data sym metry are described in the literature[20], For twodimensional FFT applications, such as processing photo graphic images, the decimationinfrequency algorithms appear to Ье the optimum choice[21]. Your application тау Ье such that FFf input and output bit reversal is not an important factor. Some FFT applications aHow manipulating а bitreversed FFf output sequence in the frequency domain without having to unscramble the FFf's output data, Тhen an inverse transform that' s expecting bit-reversed inputs will give а time domain output whose data sequence is correct, Тhis situation avoids the need to perform any bit reversals at аН, Multiplying two FFf outputs to implement convolution or correlation are examples of this possibility,t As we сan see, finding the optimum FFf algorithm and hardware architec ture for an FFf is а fairly complex problem to solve, but the literature pro vides guidance[4,22,23], References [1] Cooley, J, and Tukey, J, "An Algorithm for the Machine Calculation оЕ Complex Fourier Series," Мath, Coтput., Vol, 19, No, 90, Apr, 1965, рр, 297301, [2] Cooley, J" Lewis, р" and We1ch, р, "Historical Notes оп the Fast Fourier Transform," IEEE Traпs, оп Audio aпd E/ectroacoustics, Vol, AU-15, No, 2, June 1967, t See Section 10,10 for an example of using the PFТ to perform convolution, 
Refereпces 155 [3] Harris, F. J, "On the Use оЕ Windows for Harmonic Analysis with the Discrete Fourier Transform," Proceediпgs о/ the IEEE, Vol, 66, No, 1, рр. 54, Janиary 1978, [4] Oppenheim, А, V., and Schafer, R. W, Discrete-Tiтe Sigпa/ Processiпg, Prentice-Hall, Englewood Cliffs, New Jersey, 1989, рр, 608. [5] Rabiner, L, R, and Gold, В, тпеоту aпd AppIicatioп о/ Digita/ Signa/ Processiпg, Prentice-Hall, Englewood Cliffs, New Jersey, 1975, рр, 367, [6] Steams, S. Digita/ Sigпa/ Aпa/ysis, Hayden Book Со" Rochelle Park, New Jersey, 1975, рр, 265, [7] Prograтs /оу Digita/ Sigпa/ Processiпg, Chapter 1, IEEE Press, New York, 1979, [8] Sorenson, Н. V" Jones, D, L" Heideman, М. т., and Burrиs, С. 5, "Real-Valиed Fast Fourier Transform Algorithms," IEEE Traпs, оп Acoust. Speech, aпd Signa/ РУос" Vol. ASSP35, No, 6, June 1987. [9] Bracewell, R. тпе Fourier Traпsforт aпd [t's AppIicatioпs, 2nd Edition, Revised, McGraw-Нill, New York, 1986, рр, 405. [10] СоЬЬ, F. "Use Fast Fourier Transform Programs to Simplify, Enhance Filter Analysis," EDN, 8 March 1984, [11] Carlin, F. "Ada and Generic FFТ Generate Routines Tailored to Yoиr Needs," EDN, 23 April1992, [12] Evans, D, "An Improved Digit-Reversal Permиtation Algorithm for the Fast Foиrier and Hartley Transforms," IEEE Traпs, оп Acoust, Speech, aпd Sigпa/ РУос" Vol. ASSP-35, No, 8, Aиgust 1987. [13] Bиrrus, С. 5, "Unscrambling for Fast DFТ Algorithms," IEEE Traпs, оп Acoust, Speech, aпd Signa/ Рroс" Vol, 36, No, 7, July 1988, [14] Rodriguez, J. J, "An Improved FFТ Digit-Reversal Algorithm," IEEE Traпs, оп Acoust, Speech, aпd Signal Рroс" Vol, ASSP37, No, 8, August 1989, [15] Land, А. "Bit Reverser Scrambles Data for FFТ," EDN, March 2, 1995, [16] JG-AE Sиbcommittee оп Measиrement Concepts, "What Is the Fast Foиrier Transform?," IEEE Traпs, оп Audio aпd E/ectroacoustics, Vol. AU-15, No, 2, Jиne 1967, [17] Cohen, R" and Perlman, R, "500 kНz SingleBoard FFТ System Incorporates DSP-Optimized Chips," EDN, 31 October 1984, [18] Eldon, J" and Winter, G, Е. "Floatingpoint Chips Carve Oиt FFТ Systems," E/ectroпic Design, 4 Aиgust 1983. [19] Lamb, К. "CMOS Bиilding Blocks Shrink and Speed Up FFT Systems," E/ectroпic Design, 6 Aиgust 1987, [20] Markel, J, О, "FFТ Pruning," IEEE Tyaпs, оп Audio aпd E/ectroacoustics, Vol, AU-19, No, 4, December 1971, 
156 Тhe Fast Foиrier Traпsforт [21] Wu, Н, R., and Раоl0ni, F. J, "The Structure оЕ Vector Radix Fast Fourier Transforms," IЕЕЕ Trans, оп Acoиst, Speech, and Sigпa/ Proc" Vol, ASSP-37, No, 8, August 1989, [22] АН, Z, М, "Нigh Speed FFТ Processor," IЕЕЕ Trans, оп Coттиnications, Vol. СОМ-26, No, 5, Мау 1978, [23] Беrglаnd, G, "Fast Fourier Transform Hardware ImplementationsAn Overview," IЕЕЕ Trans, оп Aиdio and E/ectroacoиstics, Vol, AU-17, June 1969, 
I CHAPTER FIVE I Finite Impulse Response Filters Тhe filtering of digitized data, if not the most fundamental, is certainly the oldest discipline in the field of digital signal processing. Digital filtering's origins go back forty years. Тhe growing availability of digital computers in the early 1950s led to efforts in the smoothing of discrete sampled data and the analysis of discrete data control systems. However it wasn't until the early to mid1960s, around the time the Beatles сате to Arnerica, that the analysis and development of digital equivalents of analog filters began in earnest. Тhat's when digital signal processing experts realized that computers could go beyond the mere analysis of digitized signals into the domain of actually changing signal characteristics through filter ing. Today, digital filtering is so widespread that the quantity of literature pertaining to it exceeds that of any other topic in digital signal processing. In this chapter, we introduce the fundamental attributes of digital filters, learn how to quantify their performance, and review the principles asso ciated with the design of finite impulse response digital filters, 50 let's get started Ьу illustrating the concept of filtering а time--domain signal as shown in Figure 51, In general, filtering is the processing of а time--domain signal resulting in some change in that signal's original spectral content, Тhe change is usually the reduction, or filtering out, of some unwanted input spectral components; that is, filters allow certain frequencies to pass while attenu ating other frequencies. Figure 51 shows both analog and digital versions of а filtering process. Where an analog filter operates оп а continuous sig nal, а digital filter processes а sequence of discrete sample values. Тhe digital filter in Figure 51(b), of course, сап Ье а software program in а computer, а programmable hardware processor, or а dedicated integrated circuit. Traditionallinear digital filters typically соте in two flavors: finite 157 
158 Fiп/te /mpи/se Respoпse Fllters /\/\. V V Time 1\ 1\  V V Time Input signal Ou!put signal (а) , . .. : :! " .,. . . . t i . r т . , . : . ... 1. . . .. ' ' I i I . .. . ... Тiтa :  11  .  . t t . ,. i ' . . .' .. Тiтe . . Inpu! sequence Outpu! sequence (Ь) Flgure 5.1 Fllters: (о) оп onolog filter wlth о nolsy tone input ond о reduced-nolse tone output; (Ь) the dlgitol equlvolent of the onolog filter, impulse response (FIR) filters and infinite impulse response (IIR) fi1ters. Бесаusе FIR fi1ters are the simplest type of digital filter to analyze, we'll ехаminе them in this chapter and cover IIR fi1ters in Chapter 6, 5.1 An Introduction to Finite Impulse Response FIR Filters First of аН, FIR digital filters use only current and past input samples, and попе of the fi1ter's previous output samples, to obtain а current output sample value, (Тhat's also why FIR fi1ters are sometimes caHed nonrecur sive filters.) Given а finite duration of nonzero input values, the effect is that an FIR filter will always have а finite duration of nonzero output val- ues and that's how FIR fi1ters got their name. 50, if the FIR filter's input suddenly becomes а sequence of all zeros, the filter's output will eventu аНу Ье аН zeros. While not sounding аН that unusual, this characteristic is however, very important, and we'll soon find out why, as we learn more about digital filters. FIR fi1ters use addition to ca1culate their outputs in а manner much the same as the process of averaging uses addition, In fact, averaging is а kind of FIR fi1ter that we сап illustrate with an example, Let's say we're counting the number of cars that pass over а bridge every minute, and we need to know the average number of cars per minute over five- minute intervals; that is, every minute we'H calculate the average num- 
Ап /пtroductioп to Fiпite /mpu/se Respoпse F/R Filters 159 ТаЫе 5-1 Values for the Averaging Example Numьer о/ Numьer о/ cars/minute Minute cars/minute over averaged over the index the /ast minute /ast five minutes 1 10  2 22  3 24  4 42  5 37 27 6 77 40.4 7 89 53,8 8 22 53,4 9 63 57,6 10 9 52 ber of cars/minute over the last Нуе minutes, If the results of оur car counting for the first ten minutes are those values shown in the center column of Table 51, then the average number of cars/minute over the previous Нуе one-minute intervals is listed in the right column of the table, We've added the number of cars for the first Нуе one-minute inter- vals and divided Ьу Нуе to get our first fiveminute average output value, (10+22+24+42+37)/5 = 27, Next we've averaged the number of cars/minute for the second to the sixth one-minute intervals to get our second fiveminute average output of 40.4, Continuing, we average the number of cars/minute for the third to the seventh one-minute intervals to get our third average output of 53,8, and so оп, With the number of cars/minute for the one-minute intervals represented Ьу the dashed Нnе in Figure 5-2, we show our five-minute average output as the solid line, (Figure 5-2 shows cars/minute input values beyond the first ten min- utes listed in Table 5-1 to Шustrаtе а couple of important ideas to Ье dis cussed shortly,) There's much to learn from this simple averaging example. 1n Figure 52, notice that the sudden changes in our input sequence of cars/minute are flattened out Ьу our averager, The averager output sequence is соn- siderably smoother than the input sequence. Кnowing that sudden tran sitions in а time sequence represent high frequency components, we сап say that our averager is behaving like а low-pass filter and smoothing sudden changes in the input, Is our averager аn FIR filter? It sure isno previous averager output value is used to determine а current output 
160 Fiпite /mpu/se Respoпse F//ters Number 01 cars :: : : : : : : : : : : : l\/ ? i:1:-::e  : : : : : : : ; - I 70 - - .. . - .. - . t - . -1- - - . - - -. carslm.nule over lasl five - -9. - - - - - . - . - . - . - . 60 - - - - - - . - - -, . - -.i:'-f -j/'- п!е_ - - - - . - -. - . - . f\- - - . - - - - - . - - - - : ::iIч-r;\:д<j;,!с: :::::::::: : :-A:::?::i:'j:::\j:::_ ::: " ----------1--------------- ---\ о .............. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1920 21 22 2324 25 Minules Figure 5-2 Averaging the number of cars/minute, The dashed line shows the indivlduai cars/minute, and the soiid Ilne is the number of cars/minute averaged over the iast five minutes, value; only input values are used to calculate output values, In addition, we see that, if the bridge were suddenly closed at the end оЕ the 19th minute, the dashed line immediately goes to zero cars/minute at the end оЕ the 20th minute, and the averager's output in Figure 52 approaches and settles to а value оЕ zero Ьу the end of the 24th minute, Figure 52 shows the first averager output sample occurring at the end оЕ the 5th minute because that's when we first have five input samples to calculate а valid average. Тhe 5th output of our averager can Ье denoted as у ave(5) where 1 Уауе(5) = [x(l) + х(2) + х(З) + х(4) + х(5)] 5 (51) In the general case, if the kth input sample is x(k), then the nth output is 1 1 п Уаvе(n)=[х(n4)+х(nз)+х(n2)+х(п1)+х(n)]= Lx(k) . (52) 5 5 k=п4 Look at Eq. (52) carefully now, It states that the nth output is the average of the nth input sample and the four previous input samples, We can formalize the digital filter nature оЕ our averager Ьу creating the block diagram in Figure 5З showing how the averager calculates its output samples. 
Ап /пtroductioп to F/п/te /mpu/se Respoпse F/R F/lters 161 fifth output = 27 1/5 Flgur. 5-3 Averaglng fllter bIock dlagram when the flfth Input 5ample value, 37,15 applied, This block diagram, referred to as the filter structure, is а physical depiction оЕ how we might calculate our averaging filter outputs with the input sequence оЕ values shifted, in order, from left to right along the top оЕ the filter as new output calculations are performed, Тhis structure, implementing Eqs. (51) and (52), shows those values used when the first five input sample values are available. Тhe delay elements in Figure 53, called ипа delays, merely indicate а shift register arrangement where input sample values are temporarily stored during an output calculation. In averaging, we add five numbers and divide the sum Ьу five to get our answer. In а conventional FIR filter implementation, we сап just as well multiply each оЕ the five input samples Ьу the coefficient 1/5 and then perform the summation as shown in Figure 54(a). ОЕ course, the two methods in Figures 5-3 and 5-4(а) are equivalent ЬесаuБe Eq, (52) describing the structure shown in Figure 53 is equivalent to 1 1 1 1 1 Yave(n) = sх(п 4) + sх(п 3) + sх(п 2) +sх(п 1) + sх(п) n 1 = L Sx(k) k=n4 (53) that describes the strиcture in Figure 54(a).t Let's make sure we understand what's happening in Figure 54(a). Each оЕ the first five input values are multiplied Ьу 1/5, and the five products are summed to give the 5th filter output value, Тhe left to right t We've used the venerable distributive law for multiplication and addition of scalars, a(b+c+d) = ab+ac+ad, in moving Eq, (5-2)'s factor of 1/5 inside the summation in Eq. (53), 
162 Fiп/te /mpu/se Respoпse Filters 37 (а) 1/5 5th output = 27 77 6th output = 40.4 (Ь) 1/5 89 7th output = 53,8 (с) 1/5 Figure 5-4 Alternote overaging fllter strueture: (а) Input volues used for the 5th output volue; (Ь) input volues used for the 6th output volue; (е) input volues used for the 7th output volue, sample shifting is i1lustrated in Figures 54(b) and 54(c). То calculate the filter's 6th output value, the input sequence is right shifted discard ing the 1st input value of 10, and the 6th input value 77 is accepted оп the left, Likewise, to calculate the filter's 7th output value, the input sequence is right shifted discarding the 2nd value of 22, and the 7th input value 89 arrives оп the left. 50, when а new input sample value is applied, the filter discards the oldest sample value, multiplies the sam- ples Ьу the coefficients of 1/5, and sums the products to get а single new output value, The filter's structure using this bucket brigade shifting process is often са1lед а transversal filter дие to the crossdirectional flow of the input samples. Because we tap off five separate input sample 
Coпvo/utioп iп F/R Fi!ters 163 values to ca1culate an output value, the structure in Figure 54 is called а 5tap FIR fi1ter in digital fi1ter vemacular, One important and, perhaps, most interesting aspect of understanding FIR fi1ters is leaming how to predict their behavior when sinusoidal sam ples of various frequencies are applied to the input, i,e., how to estimate their frequencydomain response, Two factors affect an FIR fi1ter's fre- quency response: the number of taps and the specific values used for the multiplication coefficients, We'll explore these two factors using our aver- aging example and, then, see how we сап ше them to design FIR filters, Тhis brings us to the point where we have to introduce the С word: con volution, (Actually, we already slipped а convolution equation in оп the reader without saying so, It was Eq. (53), and we'll ехаminе it in more detaillater, ) 5.2 Convolution in FIR Filters ок, here's where we get serious about understanding the mathematics behind FIR fi1ters. We can graphically depict Eq. (53)'s and Figure 54's ca1culations as shown in Figure 55. Also, let's Ье formal and use the stan dard notation of digital fi1ters for indexing the input samples and the ш ter coefficients Ьу starting with an initial index value of zero; that is, we'll саН the initial input value the Oth sample х(О), Тhe next input sample is represented Ьу the tепn х(l), the following input sample is called х(2), and so оп, Likewise, our five coefficient values will Ье indexed from zero to fощ h(O) through h(4), (Тhis indexing scheme makes the equations describing our example consistent with conventional filter notation found in the literature,) In Eq. (53) we used the factor of 1/5 as the fi1ter coefficients mиlti plied Ьу our averaging fi1ter's input samples, The left side of Figure 5-5 shows the alignment of those coefficients, black squares, with the fi1ter input sample values represented Ьу the white squares, Notice in Figure 5-5(а) through 55(e) that we're marching the input samples to the right, and, at each step, we ca1culate the fi1ter output sample value using Eq. (53), The output samples оп the right side of Figure 5-5 match the first five values represented Ьу the black squares in Figure 5-2, The input samples in Figure 5-5 are those values represented Ьу the white squares in Figure 52, Notice the time order of the inputs in Figure 55 has been reversed from the input sequence order in Figure 52! That is, the input sequence has been f1ipped in the time domain in Figure 5-5, This time order reversal is what happens to the input data using the filter struc- ture in Figure 5-4, 
164 F/п/te /mpu/se Respoпse FlIters 1;1 I;J Flrst Input ssmpl., >(0) Зuт 01 the first 1;1 I tive products 9 1;1 / (а) 1;1 1;1 о I !1J Compute )1(4) 11 I c::t> I . Statlonary  , 11 11 11 '!' 4 п coofficlonts О 2 4 Output, )l(п) 1;1 I;J Зиm 01 the 88COnd 1;1 1;1 о 1;1 [] '!'  flvo products (Ь) О Compute )1(5) 11 =с> I . 11 11 11 11 11 4 5 п i Output, )l(п) О 2 4 [] [] , [] i [] 1;1 11 I 1;1 а [] 1;1 Compute )1(6) (е) 11 i =с> . 11 11 11 11 11 4 5 6 п О 2 4 Output, )l(п) [] !1J 11 11 1;1 [] [] 11 [] а о 1;1 Compute )1(7) (d) =с> 11 11 11 11 11 11 4 5 6 7 . п О 2 4 Output, )l(п) О Flfth Input ssmpl., >(4) 11 1;1 []/I;I '!' 11 1;1 I [] а 11 i I;J 1;1 Compute )1(8) (е) =с> 11 . 11 11 11 11 11 4 5 6 7 8 п О 2 4 Output, )l(п) Flgure 5-5 Averaging fllter eonvolutlon: (а) flrst flve input samples aligned with the statlonary fllter eoeffieients. index п = 4; (ь) input samples shift to the right and index п = 5; (е) Index n = 6; (d) Index п = 7; (е) Index n = 8, Repeating the first part of Eq. (5-3) and omitting the subscript оп the output term, our original FIR filter's y(п)th output is given Ьу 1 1 111 у(п) = sx(n  4) +sx(n 3) +sx(n 2) + sx(n  1) + sx(n) (5-4) 
Coпvo/ut/oп /п F/R F//ters 165 Because we'll explore filters whose coefficients are not all the same value, we need to represent the individual filter coefficients Ьу а variable, such as the terrn h(k), for example, Тhus we сап rewrite the averaging filter's output from Eq. (54) in а more general way as у(п) = h( 4)х(п  4) + h(3)x(n  3) + h(2)x(n  2) + h(1)x(n  1) + h(O)x(n) 4 = )(k)x(nk) , k=O (5-5) where h(O) through h(4) all equal1/5. Equation (5-5) is а concise way of describing the filter structure in Figure 5-4 and the process illustrated in Figиre 55. Let's take Eq. (55) one step further and say, for а general Mtap FIR fil ter, the nth output is Ml у(п)= Lh(k)x(nk) k=O (56) Well, there it is. Eq. (56) is the infamous convolution equation as it applies to digital FIR filters. Beginners in the field of digital signal pro- cessing often have trouble understanding the concept of convolution. It need not Ье that way. Eq. (56) is merely а series of multiplications fol lowed Ьу the addition of the products. The process is actually rather sim ple. We just flip the time order of an input sample sequence and start step ping the flipped sequence across the filter's coefficients as shown in Figиre 55. For each new filter input sample, we sum а series of products to compute а single filter output value. Let's pause for а moment and introduce а new terrn that's important to keep in mind, the iтpulse response. Тhe impulse response of а filter is exact ly what its name implieit's the filter's output timedomain sequence when the input is а single unityvalued sample (impulse) preceded and followed Ьу zerovalued samples. Figиre 56 il1ustrates this idea in the same way we deterrnined the filter's output sequence in Figиre 55. Тhe left side of Figure 56 shows the alignrnent of the filter coefficients, black squares, with the filter input impulse sample values represented Ьу the white squares. Again, in Figure 5-6(а) through 56(e) we're shifting the input samples to the right, and, at each step, we calculate the filter output sample value using Eq. (54), Тhe output samples оп the right side of 
166 Fiпite /mpu/se Respoпse F//ters  lтpul,e 'nput $uт о( thв flrst 1[] Compute у( 4) . flve products (а)  =с>  Statlonary .....> · . . . . 4 n coefflcients О 2 4 Impulse responsв, у(п) 1[]  $um о( the '8Cond Compute у(5) . . ffve producta (Ь)  =с> . . .  . . 4 5 n О 2 4 Impulse response, у(п) (с) 19    . . . Compute у(6) =с> .  I!I 4 5 6 .n Impulse response, у(п) о 2 4 (d) 1 []  . . . . . Compute у(7) =с> . . . . i 4 5 6 7 .n Impulse responsв, у(п) о 2 4 (е) Compute у(8) .....J"-o.... ...  1 О ..... о 2 4 . 45678 n Impulse response, у(п) Figure 5-6 Convolution of fllter eoeffielents and оп Input Impulse to obtain the fllter's output Impulse response: (а) impulse sample aligned with the flrst fllter eoeffieient, index п = 4; (Ь) impulse sample shlfts to the rlght and ;пdex п = 5; (е) ;пdex п = 6; (d) ;пdex п = 7; (е) ;ndex п = 8, Figure 5-6 are the filter's impulse response, Notice the key point here: the FIR filter's impulse response is identical to the five fi1ter coefficient values. For this reason, the tепns FIR filter coefficieпts and impulse response are syn- onyrnous, Тhus, when someone refers to the impu1se response of an FIR filter, they're also talking about the coefficients, Returning to our averaging fi1ter, recall that coefficients (or impulse response) h(O) through h(4) were all equal to 1/5, As it tums out, our fil- ter's performance сап Ье improved Ьу using coefficients whose values are not аН the same, Ву реrfопnаnсе we mean how well the fi1ter passes desired signals and attenuates unwanted signals, We judge that perfor- mance Ьу determining the shape of the filter's frequency-domain response that we obtain Ьу the convolution property of linear systems, То describe this concept, let's repeat Eq. (5-6) using the abbreviated notation of 
Coпvo/utioп iп F/R Filters 167 у(п) = h(k) * х(п) (57) where the * symbol means convolution. (Equation 5-7 is read as "у of п equals the convolution of h of k and х of п,") Тhe process of convolution, as it applies to FIR filters is as follows: Тhe discrete Fourier transform (DFT) of the convolution of а filter's impulse response (coefficients), and an input sequence is equal to the product of the spectrum of the input sequence and the DFТ of the impulse response. Тhe idea we're trying to convey here is that if two timedomain sequences h(k) and х(п) Ьауе DFTs of Н(т) and Х(т), respectively, then the DFT of у(п) = h(k) * х(п) is Н(т) 'Х(т). Making this point in а more compact way, we state this rela tionship with the expression OFТ у(п) = h(k) * х(п)  Н(т). Х(т), IDFТ (58) With ЮРТ indicating the inverse DPТ, Eq, (8) indicates that two sequences resulting from h(k) *х(п) and Н(т).Х(т) ате Fourier transform pairs. 50 tak ing the DPТ of h(k) *х(п) gives us the product Н(т).Х(т) that is the Бресtrшn of our ffiter output У(т). Likewise, we can determine h(k) *х(п) Ьу taking the inverse DPТ of Н(т)'Х(т). тhe very important conclusion to learn from Eq, (5-8) is that convolution in the time--domain is equivalent to multiplication in the frequency-domain, То help us appreciate this principle, Figure 5-7 sketches the relationship between convolution in the time domain and mul tiplication in the frequency domain. Тhe process of convolution with regard to linear systems is discussed in more detail in Section 5.9, Тhe beginner is encouraged to review that material to get а general idea of why and when the convolution process can Ье used to analyze digital ffiters. Equation (58) and the relationships in Figure 57 tell иБ what we need to do to determine the frequency response of an FIR filter. Тhe product Х(т). Н(т) is the DPТ of the ffiter output. Because Х(т) is the DFТ of the filter's input sequence, the frequency response of the filter is then defined аБ Н(т), the DFТ of filter's impulse response h(k),t Getting back to our original problem, we сап determine our averaging filter's frequency- domain response Ьу taking the DFТ of the individual filter coefficients (impulse response) in Eq, (54). If we take the five h(k) coefficient values of 1/5 and append 59 zeros, we have the sequence depicted in Figure 5-8(а). Performing а 64point DPТ оп that sequence, and normalizing the t We use the terт iтpиlse respoпse here, instead of coefficieпts, because this concept a!so applies to ПR fi!ters, ПR filter frequency responses are a!so equa! to the DFf of their impulse responses, 
168 F/п/te /тpu/Se Respoпse Fllters Input х(п) Coefficients h(k) Time domain t t Х(т) Frequency domain Filter output sequence in the Irequency domain, У(т) = Н(т) . Х(т) Flgure 5-7 Relationshlps 01 convolutioп 05 applied to FIR dlgltal fllters, DFl' magnitudes, gives us the filter's frequency magnitude response I Н(т) I in Figure 58(b) and phase response shown in Figure 58(c).t Н(т) is our old friend, the sin(x) / х function from Section 3.13. Let's relate the discrete frequency response samples in Figures 5-8(Ь) and 8(c) to the physical dimension of the sample frequency fs. We know, frorn Section 3.5 and our experience with the DFТ, that the т = N /2 dis- crete frequency sample, т = 32 in this case, is equal to the folding fre- quency, or half the sample rate, fs/2. Keeping this in mind, we сan convert the discrete frequency axis in Figure 5-8 to that shown in Figure 5-9, In Figure 5-9(а), notice that the filter's magnitude response is, of course, peri odic in the frequency domain with а period of the equivalent sample rate fs, Because we're primarily interested in the filter's response between О and half the sample rate, Figure 9(c) shows that frequency band in greater t Тhere's nothing sacred about using а 64-point ОРТ here, We could just as well have appended on1y enough zeros to take а l or 32-point FFТ, We chose 64 points to get а fre- quency resolution that would make the shape of the response in Figure 5-8(Ь) reasonably smooth, Remember, the more points in the FFТ, the finer the frequency resolutionright? 
Coпvo/иt/oп iп F/R Filters 169 (а) . h(k) :,:liI11 о ................ о 1 3 5 7 9 11 13 15 17 59 61 63 k (Ь) . 'Н(т)' 1 . 0 0,: i i 'r. . . . , i . ,. : , ' . ; . ' ,. ; , ; , i i ,!. ,  \1 j  1 \ 1 i [:; i 11'r. .П1П. ..Пi... .iiШ.. i.i' ': i: i i О . 1111 JI J 111 J , ,, 11111 IIIIIJ '" 1 i 11 i 111111 " 1 IIJ 11111111  о 3 6 912151821 М V м   a    м M  т 0,4 0,2 (с) : ! (т) .. 90 ".. -.. ... 45 3" .... ..;. T!"...'" ...--{ ..... "! .... о . , IIIIIIIIIII! 1 Т 1 ' 1 1111 J 11 , 1 1"1 ,  , 11111 1111"11 , . , 1 11111111'111 i . -45 t !..IL. 9." .15-j....24i2Z .3Q...39..А2.4!i,шм."..54....5Z60ш63 т -..: 8. :: 8. =: =.::  .. l:.-...:':::::.::.::::...ш........ ........... ''" Figure 5-8 Averaging FIR fllter: (а) fllter eoeffieient sequenee h(k) wlth appended zeros; (Ь) norma//zed d/serete freqиeney magпitиde response I Н(т) I of the h(К) fllter eoeffielents; (е) phase-angle response of Н(т) In degrees, detai1 affirming the notion that averaging behaves Шее а lowpass filter. It' s а relatively poor lowpass filter compared to an arbitrary, ideal low-pass filter indicated Ьу the dashed lines in Figure 5-9(с), but our averaging fil ter will attenuate higher frequency inрии relative to its response to low- frequency input signals, We сап demonstrate this Ьу way оЕ example, Suppose we applied а lowfrequency sinewave to the averaging FIR fШеr, as shown in Figure 510(a), and that the input sinewave's frequency is 1/32 and its peak amplitude is unity, Тhe filter output in this case would Ье а sinewave of frequency 1/32, but it's peak amplitude would Ье reduced to а value of 0.96, and the output sinewave's first sample value is delayed Ьу а phase 
170 Fiпite /mpu/se Respoпse F//ters lН(m)1 0,8 0,6 (а) 0,4 0,2 О '5/8 /4 /2 13S 90 4S (Ь) О --4S '5 Freq O 13S (с) 0,8 0,6 0,4 0,2 О '-/8 '5/4 f. 12 Freq 5 Flgure 5-9 Averogiпg FIR fllter frequency response shown os continuous curves: (о) normollzed frequency mognltude response, I Н(т) 1; (Ь) phose ongle response of Н(т) in degrees; (с) the fllter's mognitude response between zero Hz ond holf the somple rote, ',/2 Hz, angle of 22.50, Next, if we applied а higher frequency sinewave of 3//32 to the FIR filter as shown in Figure 5-10(Ь), the filter output would, then, Ье а sinewave of frequency 31.132, but it's peak amplitude is еуеп fur- ther reduced to а value of 0,69. In addition, the Figure 5-10(Ь) output sinewave's first sample value has ап even larger phase angle delay of 67.50, Although the output amplitudes and phase delays in Figure 5-10 were measured values from actually performing а 5-tap FIR filter process оп the input sinewave samples, we could have obtained those amplitude and phase delay values directly from Figures 5-8(а) and 5- 8(Ь), The emphasis here is that we don't have to implement ап FIR filter and apply various sinewave inputs to discover what its frequency 
Coпvo/ufioп 'п F/R Fiiters 171 1 ,1,1 1 ". ;:;.il,1I!I Fr8quencyof  3iiiiililll;\I;il7  IIt.!..8 ''',f'  li: \'J 1!1 !II щi Т,.; delay = 22.5 ...! j j" 1.. (а) .. "' .8 r. .. .i ; : :. Frequency of ',,, .::. m=6,оrЗI.1З2 . "и., I i IT' " . Т ilи ii, н. ---т:. .:: 8 Н'. r. 8 .Т ,ji. 8;; ..' 1 .НН. . rиi. .LL i iji 8 8! Time .ij . :. '. .8 0.69" .. ! ". (Ь) 'ii i .i. . ili,; ;'. '1'. t il: Phase ' " delay .. = 67,50 r. .' L 8 Flgure 5-10 Averaging FIR fllter Input and output responses: (а) with an input sinewave of frequency '. /32; (ь) with an input sinewave of frequency 3'. /32, response will Ье. We need merely take the DFТ of the FIR fi1ter's соеЮ cients (impulse response) to determine the filter's frequency response as we did for Figure 5-8. Figure 5 11 is another depiction of how weH our 5tap averaging FIR filter performs, where the dashed line is the fi1ter's magnitude response I Н(т) 1, and the shaded line is the IX(m) I magnitude spectrum of the ш ter's input values (the white squares in Figure 52), The solid line is the magnitude spectrum of the filter's output sequence which is shown Ьу the black squares in Figure 52, 50 in Figure 5--11, the solid output spec trum is the product of the dashed filter response curve and the shaded input spectrum, or IX(m). Н(т) 1. Again, we see that our averager does indeed attenuate the higher frequency portion of the input spectrum. Let's pause for а moment to let аН of this soak in а litt1e, 50 far we've gone through the averaging filter example to establish that · FIR fi1ters perform timedomain convolution Ьу summing the prod ucts of the shifted input samples and а sequence of filter coefficients, · an FIR filter's output sequence is equal to the convolution of the input sequence and а fi1ter's impulse response (coefficients), 
172 Fiпite /mpu/se Respoпse Fi/ters 0.2 Filter Input, lX(m)1 1,0 0,8 0,6 0,4 о fJ8 fJ4 Freq fJ2 Flgure 5-11 Averaging FIR filter Input magnitude spectrum, frequency magnltude response, and output magnitude spectrum, · ап FIR filter's frequency response is the DFf of the filter's impulse response,t · ап FIR fi1ter's output spectrum is the product of the input spectrum and the fi1ter's frequency response, and · convolution in the time domain and multiplication in the frequency domain are Fourier transform pairs. ОК, here's where FIR fi1ters start to get really interesting. Let's change the va1ues of the five fi1ter coefficients to modify the frequency response of our 5-tap, lowpass filter. In fact, Figure 5-12(а) shows our original five filter coefficients and two other arbitrary sets of 5tap coefficients, Figure 512(b) compares the frequency magnitude responses of those tЩее sets оЕ coefficients, Again, the frequency responses are obtained Ьу taking the DFf of the tЩее individual sets of coefficients and plotting the magni- tude of the transforms, as we did for Figure 5-9(с). 50 we see tЩее impor tant characteristics in Figure 512, First, as we expected, different sets of coefficients give us different frequency magnitude responses. Second, а t In Section 6,3, while treating an FIR filter as а special сзse of an ПR filter, we'n arrive at а math- ematica! expression for an FIR filter's frequency response in terms of its coefficient values, . 
Coпvo/utioп /п F/R Filters 173 0,2  0,2 -  ! 0,2 - (а) 0,1 0,1 . 0,1 . I!I : о о 2 о ......... о 2 4 о ........... 024 Filter magnitude response, 'Н(m)' 0,8 0,2, 0,2, 0,2, 0,2, 0,2 0,1,0,2,0,2,0,2,0,1 0,6 (Ь) 0,4 0,2 о 'в/д 'в/4 fsl2 Freq Flgure 5-12 Three sets of 5-top low-poss fllter coefficients: (о) sets of coefficients; 0,2,0,2,0,2,0,2,0,2; 0,],0,2,0,2,0,2, О,]; oпd 0,04, 0,]2, 0,2, 0,]2, 0,04; (Ь) frequeпcy mognitude response of three low-poss FIR fllters using those sets of coefficlents, sudden change in the values of the coefficient sequence, such as the 0.2 to О transition in the first coefficient set, causes ripples, or sidelobes, in the frequency response. Тhид, if we minimize the suddenness of the changes in the coefficient values, such as the third set of coefficients in Figure 5- 12(а), we reduce the sidelobe ripples in the frequency response. However, redIJcing the sidelobes results in increasing the таin lobe width of our low-pass fi1ter, (As we'H see, this is exactly the saтe effect encountered in the discussion of window fиnctions used with the DFТ in Section 3.9.) То reiterate the fиnction of the fi1ter coefficients, Figиre 5-13 shows the 5-tap FIR fi1ter structure using the third set of coefficients from Figиre 5-12, Тhe implementation of constant-coefficient transversal FIR filters does not get any more complicated than that shown in Figиre 513, It's that simple, We сап have а filter with more than five taps, but the input sig nal sample shifting, the multiplications Ьу the constant coefficients, and the summation are аН there is to it, (Ву constant coefficients, we don't mean coefficients whose values are аН the same; we mean coefficients whose values remain unchanged, or timeinvariant. Тhere is а class of 
174 Fiпite /тpu/se Respoпse Filters Х(п) h(O) = 0,04 Flgure 5-13 Five-tap, low-pass FIR fi/ter Implementatlon usiпg the coefficlents 0,04, 0.12,0,2,0,12, and 0,04. digital filters, called adaptive filters, whose coefficient values are period ical1y changed to adapt to changing input signal parameters, While we won't discuss these adaptive filters in this introductory text, their descriptions are available in the literature[15],) So far, our description of an FIR filter implementation has been pre sented from а hardware perspective, In Figure 5-13, to calculate а sin- gle filter output sample, Нуе multiplications and Нуе additions must take place before the arrival of the next input sample value, In а soft- ware implementation of а 5tap FIR filter, however, аН of the input data samples would Ье previously stored in memory, Тhe software filter rou- tine's job, then, is to access different fivesample segments of the х(п) input data space, perform the calculations shown in Figure 5-13, and store the resulting filter у(п) output sequence in an array of memory loca tions, t Now that we have а basic understanding of what а digital FIR filter is, let's see what effect is had Ьу using more than five filter taps Ьу leaming to design FIR filters, 5.3 Low-Pass FIR Filter Design ОК, instead of just accepting а given set of FIR filter coefficients and ana lyziIlg their frequency response, let's reverse the process and design our t 'N reviewing the literature of FIR filters, the reader will often find the terrn zl replacing the delay fиnфоп in Figure 5-13, Тhis equivalence is explained in the nех! chapter when we study IIR filters. 
Low-Poss F/R FiJter Desigп 175 own low-pass FlR filter, Тhe design procedure starts with the determina tion of а desired frequency response followed Ьу calculating the filter соеЕ- ficients that will give us that response. Тhere are two predominant tech- niques used to design FIR filters, the window method, and the so-called optimum method. Let's discuss them in that order. 5.3.1 Window Design Method Тhe window method оЕ FIR filter design (also called the Fourier series method) begins with our deciding what frequency response we want for our lowpass filter. We сап start Ьу considering а continuous low-pass ы- ter, and simu1ating that filter with а digital filter. We'll define the соntin- uous frequency response Н(/) to Ье ideal, i.e., а lowpass filter with unity gain at low frequencies and zero gain (infinite attenuation) beyond some cutoff frequeпcy, as shown in Figure 514(a). Representing this не/) response Ьу а discrete frequency response is straightforward enough because the idea оЕ а discrete frequency response is essentially the same as а continuous frequency responswith оnе important difference. As described in Sections 2.2 and 3,13, discrete frequencydomain representa tions are always periodic with the period being the sample rate 1.. Тhe dis- crete representation оЕ our ideal, continuous low-pass filter Н(/) is the periodic response Н(т) depicted Ьу the frequencydomain samples in Figure 5-14(Ь), Fitter frequency response CUloff frequ"ncy (а) '. '';2 О './2 '. Freq (f) H(т) ...... .......1 .II!I....... (Ь) - .i:":: f ........,...,.T.,..........,.Цll..........'..'r..'.......... : i ' i : , ' ..... Freq m=N т=N12 т=О т=Nl2 m=N (т) Н.) Н,/2) (О) ('5/2) ('5)  'sl2 10 '512 inlerval  010 '5 inlerval r- : Flgure 5-14 Lowpass filter frequency responses: (а) contlnuous frequency response Н(f); (Ь) periodlc, dlscrete frequency response Н(т), 
176 Fiпlte /тpu/se Response Ff/ters "'< 1...... ! \ ! : I i .............._......_....."*... I  I +  +1 т=K1)12    . . .  Н(т) , I I I I i I : I ) I ."*....._.................... +  m т= (K1)12 М2 Flgure 5-15 ArbItrary, d/screte /ow-pass F/R ft/ter frequeпcy response deftпed over N trequeпcy-domain samples coverlпg the trequency raпge of '. Hz, We have two ways to determine our lowpass filter's timedomain coefficients. Тhe first way is algebraic: 1, Develop an expression for the discrete frequency response Н(т). 2. Apply that expression to the inverse DFТ equation to get the time domain h(k), 3. Evaluate that h(k) expression as а fиnction of time index k. Тhe second method is to define the individual frequencydomain samples representing Н(т) and then have а software routine perform the inverse DFТ оЕ those samples, giving us the FIR filter coefficients, In either method, we need only define the periodic Н(т) over а single period of!. Нz. As it turns out, defining Н(т) in Figure 514(b) over the frequency span fs/2 to 1./2 is the easiest form to analyze algebraical1y, and defining Н(т) over the frequency span О to 1. is the best representation if we use the inverse DFТ to obtain our filter's coefficients, Let's try both methods to determine the fi1ter's timedomain coefficients. In the algebraic method, we сап define an arbitrary discrete frequency response Н(т) using N samples to cover the fs/2 to !.12 frequency range and establish К unityvalued samples for the passband of our lowpass fil ter as shown in Figure 515, То determine h(k) algebraically we need to take the inverse DFТ of Н(т) in the form of N/2 h(k) =  LН(т)еi21tтk/N, т=N /2)+1 (5-9) where our time-domain index is k. Тhe solution to Eq, (59), derived in Se<:tion 3.13 аБ Eq. (359), is repeated here as 
Low-Pass F/R Filter Desigп 177 КfNШiii h( k) .   . . . . " 8 .j.. . .. . . I . . I. .... 8 ... 8 k Figure 5-16 Time-domaln h{k) coefficlents obtalned Ьу evaluatlng Eq, (5-1 О), h(k) = 2.. sin(rtkК / N) , N sin( 1tk / N) (5-10) If we evaluate Eq. (5 10) as а function of k, we get the sequence shown in Figure 516 taking the form of the classic sin(x)/x function. Ву reviewing the material in 5ection 3.13, it's easy to see the great deal of algebraic manipulation required to arrive at Eq. (5 10) from Eq, (5-9).50 much alge bra, in fact, with its тanу opportunities for making епоrs, that digital ш ter designers like to avoid evaluating Eq, (5-9) algebraically. Тhey prefer to use software routines to perform inverse DFTs (in the form of an inverse FFТ) to determine h(k), and so will we. We сап demonstrate the software inverse DFT method of FIR filter design with an example. Let's say we need to design а lowpass FIR ш ter simulating the continuous frequency response shown in Figure 517(a). The discrete representation of the filter's frequency response Н(т) is shown in Figure 517(b), where we've used N = 32 points to rep resent the frequencydomain variable Н(Л, Because it's equivalent to Figure 517(b) but avoids the negative values of the frequency index m, we represent the discrete frequency samples over the range О to 1. in Figure 517(c), as opposed to the fs/2 to +1./2 range in Figure 517(b), ОК, we're almost there, Using а 32point inverse РРТ to implement а 32-point inverse DFT of the Н(т) sequence in Figure 517(c), we get the 32 h(k) values depicted Ьу the dots from k = 15 to k = 16 in Figure 518(a),t We have one more step to perform. Because we want our final 31-tap h(k) filter coefficients to Ье symmetrical with their peak value in the center of the coefficient sample set, we drop the k = 16 sample and shift the k index to the left from Figure 5-18(а) giving us the desired t If уои want to use this FIR design method but on1y have а forward FFf software routine available, Section 10,6 shows а slick way to perfonn an inverse FFf with the forward FFf a1gorithm, 
178 F/п/te /три/5е Re5poпse F//ter5 Filter Irequency response  Н(') (а) / Cutoff frequency 's/2 's/4 'J8 о 'J8 's/4 , s/2 Freq 1 . . . .  .  Н(т) (Ь) ..............,...-....,..........f........... 15 12 8 --4 HJ4) HJ8) о 4 ('s/8) ,...........,............................. 16 т ('S/2) 8 ('s/4) Н(т) . . . . 1 .  I!' (с) I О .............................................,....-...................................... 4 8 1 16 ;0 ;4 ;8 31 I т ('s/8) ('s/4) ('s/2) (3's/4) ('s) Flgure 5-17 An Ideallow-pass fllter: (а) eontinuous Irequeney response нef); (Ь) diserete response нет) over the range 01 fs/2 to fs/2 Hz: (е) diserete response нет) over the range О to " Hz, 0.219 . . .' :. Inverse OFТ 01 Н(т)  . (а) .. --в I!' ............... 8--4 .. i. . .. ...  4 .   Ii 12. · 11 k .   h(k) = Shifted inverse .. !. OFТ 01 Н(т) .; i i :. (Ь)  ...l.l!.. . 8. .. 1.; ,. 22 .  .. за .. 4 . . ' . !. 12 15 18.  i ' .. ... k Flgure 5-18 Inverse OFТ 01 the dlserete response In Figure S-17(e): (а) normal inverse OFТ indexing lor 1<; (Ь) symmetrieal eoeffieients used for а Зl-tар low-pass FIR fllter, sin(x) I х form of h(k) as shown in Figure 5 18(Ь). This shift of the index k wi11 not change the frequency magnitude response of our FIR fi1ter, (Remember from our discussion of the DFT Shifting Тheorem in Section З.6 that а shift in the time-domain manifests itself only as а linear phase shift in the frequency domain with по change in the frequency domain magnitude.) The sequence in Figure 5-18(Ь), then, is now the соеШ 
Low-Poss F/R FJJter Desigп 179 cients we use in the convolution process of Figure 55 to implement а 10w-pass FIR fi1ter, It's important to demonstrate that the more h(k} terms we use as filter coefficients, the closer we'11 approximate our ideal 10w-pass fi1ter response, Let's Ье conservative, just use the center ninе h(k} coefficients, and see what our fi1ter response 100ks like. Again, our filter's magnitude response in this case wil1 Ье the DFf of those nine coefficients as shown оп the right side of Figure 519(a}, Тhe ideal filter's frequency response is also shown for reference as the dashed curve. (То show the details of its shape, we've used а continuous curve for I Н(т) I in Figure 519(a}, but we have to remember that I Н(т} I is rea11y а sequence of discrete values,} Notice that using nine coefficients gives us а 10wpass fi1ter, but it's cer tainly far from ideal. Using more coefficients to improve our situation, Figure 519(b} shows 19 coefficients and their corresponding frequency magnitude response that is beginning to 100k more like our desired rec- tangular response, Notice that magnitude fluctuations, or ripples, are evi dent in the passband of our Н(т} fi1ter response, Continuing, using а1131 . h(k) lН(т)1 lor а 9-tap lilter .: ,. ф Сщо" frequency (а) I!I : ;. 1\1 . . './8 './8 Freq .8J!11 h(k) I!I ; . : . lН(т)1 lor а 19-tap Illter (Ь) . ! . . i i l ' ф '/8 Freq  l . Ii . i. . Ii .- Ii .. ';8 lН(т)1 lor а 31-1ар Illter (с) './8 Freq Flgure 5-19 Coeffieients ond frequeney responses of three low-pass filters: (о) 9-top FIR filter; (Ь) о 19top FIR filter; (е) frequency response of the full 31-top FIR filter, 
180 Fiпite /mpи/se Respoпse F//ters of tbe h(k) values for our fi1ter coefficients resu1ts in the frequency response in Figure 519(c). Our fi1ter's response is getting better (approaching the ideal), but those conspicuous passband magnitude rip ples are still present. It's important that we understand why those passband ripples are in the low-pass FIR fi1ter response in Figure 519, Recall the above discus- sion of convolving the 5tap averaging fi1ter coefficients, or impulse response, with an input data sequence to obtain the averager' s output, We estaыshedd that convolution in the tirne domain is equivalent to mu1tipli cation in the frequency domain, that we symbolized with Eq, (58), and repeat it here as DFТ h(k)*x(n)  Н(т).Х(т). IDFТ (5 11) Тhis association between convolution in the timedomain and mu1tiplica tion in the frequency domain, sketched in Figure 57, indicates that, if two timedomain sequences h(k) and х(п) have DFfs of Н(т) and Х(т), respec tively, then the DFf of h(k) *х(п) is Н(т).Х(т), No restrictions whatsoev er need Ье placed оп what the timedomain sequences h(k) and х(п) in Eq. (5-11) actually represent. As detai1ed later in Section 5.9, convolution in one domain is equivalent to mu1tiplication in the other domain allowing us to state that mu1tiplication in the tirne domain is equivalent to convo lution in the frequency domain, or DFТ h(k).x(n)  Н(т)* Х(т) . IDFТ (12) Now we're ready to understand why the magnitude ripples are present in Figure 519, Rewriting Eq, (512) and replacing the h(k) and х(п) expressions with h(k) and w(k), respectively, DFТ h(k).w(k)  H(m)*W(m) IDFf (5-13) Let's say that h(k) represents an infinitely long sin(x)/x sequence of ideal low-pass FIR fi1ter coefficients and that w(k) represents а window sequence that we use to truncate the sin(x)/x terms as shown in Figure 520, Тhus, the w(k) sequence is а finitt71ength set of unity values and its DFf is W(m). Тhe length of w(k) is merely the number оЕ coefficients, or taps, we intend 
LowPoss F/R Filter Desigп 181 . . h(1<) . . . . . I!I  . .... . .. .. · i  1 . . . . . . . I!I I!I Иl(k) . .. . . . . . . .......................... · · k j   п . . ·  h(1<) : :  . , . I . . . . k Flgure 5-20 Infinlte h(k) sequence wlndowed Ьу w(k) to define the final filter coefficients h(k), to use to implement our lowpass FIR filter. With h(k) defined as such, the product h(k) . w(k) represents the truncated set of filter coefficients h(k) in Figures 519(a) and 5-19(Ь), 50, from Eq. (5-13), the FIR filter's true fre quency response Н(т) is the convolution Н(т) = H(т) * W(m) , (514) We depict this convolution in Figure 521 where, to keep the figure from being so busy, we show H(т) (the DFI of the h(k) coefficients) as the dashed rectangle. Кеер in mind that it's reaHy а sequence of constant amplitude sample values. Let's look at Figure 521(a) very carefully to see why аН three I Н(т) I s exhibit passband ripple in Figure 519, We сап view а particular sample value of the Н(т) = H(т) * W(m) convolution as being the sum of the products of H(т) and W(m) for а particular frequency shift of W(m). H(т) and the unshifted W(m) are shown in Figure 521(a,) With an assumed value of unity for аН of H(т), а particular Н(т) value is now merely the sum of the W(m) samples that overlap the H(т) rectangle, 50, with а W(m) frequency shift of О Нz, the sum of the W(m) samples that overlap the H(т) rectangle in Figure 521(a) is the value of Н(т) at О Hz. 
182 Fiпite /mpu/se Respoпse Filters (а) н'" (т) = DFТ 01 h (1<) , W(m) = DFТ 01  ... rectangular w(n)  . [ - . i" . ' .. } ... . . '_._ ] ' 1 .  : : : ;8 ... i: : :; , II!I". ..o....i...i... . ... .... 8.8 . О ..8 ...  Freq . LJm . '.. ==с> . . .. . ." . . . . . .".. . . ." . .! i : I!. ..... . i О. i . i . : .1 .",;. . .... .. ..  Freq (Ь) . [ i  . '. . .1i!I. О .  : i ... ,......L............. ·  .. .................... _.. .' , . 8.- .. 8.  Freq (с) . · . · с::::{>. L .I' .  : :8 О ...  '! j \ .1i!I. I .--'-0 ......,... ... ... . ... Freq (d) Figure 5-21 Convolutlon W(m)*H(m): (а) unshlfted W(m) and H(т); (Ь) shlft 01 W(m) leadlng to rlpples wlthin Н(m)'s posltive frequeney passband: (е) shift of W(m) eausing response roll-off near Н(m)'s positive eutoff frequeney; (d) shift of W(m) eauslng ripples beyond Н(m)'s pos/tlve eutoff frequeney. As W(m) is shifted to the right to give us additional positive frequency Н(т) va1ues, we can see that the sum оЕ the positive and negative values оЕ W(m) under the rectangle oscil1ate during the shifting оЕ W(m), As the convolution shift proceeds, Figure 5-21(Ь) shows why there ме ripples in the passband оЕ H(m)again, the sum of the positive and negative W(m) samples under the H(m) rectangle continue to vary as the W(m) function is shifted, The W(m) frequency shift, indicated in Figure 5-21(с), where the peak of W(m)'s таin lobe is now outside the H(m) rectangle, corresponds to the frequency where H(m)'s passband begins to roH off, Figure 521(d) shows that, as the W(m) shift continues, there will Ье ripples in Н(m) 
Low-Pass F/R Filter Desigп 183 IH(m)1 Transition region  r (а) '5/8 О '5/8 Freq IH(m)1 Transition region r (Ь) '5/8 о '5/8 Freq Flgure 5-22 Passband ripple and transition regions: (а) for а 3 '-tap lowpass filter; (Ь) for а 63-tap low-pass filter, beyond the positive cutoff frequency. t The point of all of this is that the rip- ples in Н(т) are caused Ьу the sideobes of W(m), Figure 522 helps us answer the question: How many sin(x)/x соеШ- cients do we have to use (or how wide must w(k) Ье) to get nice sharp falling edges and по ripples in our Н(т) passband? The answer is that we can't get there from here, It doesn't matter how many sin(x)/x coef- ficients (filter taps) we use, there will always Ье fi1ter passband ripple, As long as w(k) is а finite number of unity values (i.e" а rectangular win dow of finite width) there will Ье sidelobe ripples in W(m), and this wil1 induce passband ripples in the final Н(т) frequency response, То il1us trate that increasing the number of sin(x)/x coefficients doesn't reduce passband ripple, we repeat the 31-tap, low-pass fi1ter response in Figure 522(a). The frequency response, using 63 coefficients, is shown in t In Figure 5-21(Ь), had we started to shift W(т) to the left in order to determine the nega- tive frequency portion of Н(т), we would have obtained the mirror image of the positive fre- quency portion of Н(т), 
184 F/п/te /mpu/se Respoпse F//ters Figure 522(b), алd the раssЬалd ripple rеmаiлs, We сал make the ш- ter's trалsitiол rеgiол more лаrrоw usiлg аdditiолаI h(k) fiIter соеЮ- сiелts, but we cannot еIimiлаtе the раssЬалd ripple. Тhat ripple, kлоwл ав Gibbs' рhелоmелол, mалifеsts itseIf алуtimе а fuлсtiол (w(k) iл this саве) with а iлstалtалеоus disсолtiлuitу is rерrеsелtеd Ьу а Fourier series[68]. No fiлitе set of sinusoids wiП Ье аЫе to сhалgе fast елоugh to Ье exactly equal to ал iлstалtалеоus disсолtiлиity. Алоthеr way to state this Gibbs' diIemma is that, ло matter how wide our w(k) window is, its DFT of W(m) wiП always have sidelobe ripples, Ав shоwл iл Figure 5-22(Ь), we сал use more соеffiсiелts Ьу ехtелdiлg the width оЕ the rесtалgulаr w(k) to лаrrоw the fiIter trалsitiол rеgiол, bиt а wider w(k) does лоt eIiminate the fiIter раssЬалd ripple лоr does it еvел reduce their peakto-peak ripple mаgлitиdеs, ав lолg аБ w(k) has sиddел dis солtinuitiеs. 5.3.2 Windows Used in FIR Filter Deslgn ок. Тhe good леws is that we сал miлimizе FlR раssЬалd ripple with wiлdоw functions the вате way we miлimizеd DFТ Ieakage in Sесtiол 3.9. Here's how, Looking back at Figure 5-20, Ьу truncating the iлfinitеlу Iолg h(k) sеquелсе through multiрIiсаtiол Ьу the rесtалgulаr w(k), oиr final h(k) exhibited ripples in the frequелсу-dоmаin раssЬалd. Figure 5-21 shows us that the раssЬалd ripples were caused Ьу W(m)'s sidelobes that, in turл, were caused Ьу the suddел disсолtiлuitiеs from zero to оле алd оле to zero in w(k). If we thiлk of w(k) in Figure 520 ав а rесtалgи1аr win dow, thел, it is w(k)'s abrupt ampIitиde chалgеs that are the Boиrce of our fiIter раssЬалd ripple, Тhe wiлdоw FlR dеsigл method is the tесhлiquе оЕ reducing w(k)'s disсолtinuitiеs Ьу using window functions other thал the rectangular window. Consider Figure 523 to вее how а лолrесtалgulаr window funсtiол сал Ье used to dеsigл Iowripple FlR digital fiIters. Imagine if we replaced Figure 5-20'в rесtалgulаr w(k) with the Вlасkmал window funсtiол whose discrete values are defined as t (()(k)=0.420.5COS( 2: )+O,08COS(  } fork=0,1,2, .."Nl. (515) t As we mentioned in Section 3,9, specific expressions for window functions depend оп the range of the sample index k, Had we defined k to cover the range N /2, < k < N /2, for ехат- ple, the expression for the Blackman window would have а sign change and Ье w(k) = 0.42 + O,5cos(21tk/N) + O,08cos(41tk/N), 
LowPass F/R Fliter Des/gп 185 . I h(k) . . 0'0 ..  .....78................... . .....::. .... .. k Blackman window function 1 .. .... '" ./. ,. . i '.'. w(k)  ./,.../' . , ! '''. ./ : . '. ................ .......i... : j .................. ._........ k {7 (а)  · .. h(k)   . . . .......................-..... . ."""":"""':'................................... · · k Transltlon '891оп (Ь) x т)' 1  1[ .... '/8 О '/8 Freq 1 '' 1 Transition r89ion ' r (с) ] I .- I 'з/8 О '/8 Freq Flgure 5-23 Coeffleients and frequeney response of а ЗНар Blaekman-wlndowed FIR Fllter: (а) deflnlng the windowed fllter eoeffieients h(k); (Ь) lowripple ЗНар frequeney response; (е) low-ripple 6З-tар frequeney response, Тhis situation is depicted for N = 31 in Figure 5-23(а) where Eq, (5-15)'s w(k) looks very much like the Hanning window funсНоп in Figure 3-17(а), Тhis Blackman window function resu1ts in the 31 smooth1y tapered h(k) coefficients at the bottom of Figure 5-23(а), Notice two things about the 
186 F/п/te lmpulse Respoпse Fllters resulting Н(т) in Figure 523(b). First, the good news, Тhe passband rip ples are greatly reduced from those evident in Figure 522(a)so our Вlackman window function did its job. Second, the price we paid for reduced passband ripple is а wider Н(т) transition region. We сап get а steeper fi1ter response roll-off Ьу increasing the number of taps in our FIR fi1ter. Figure 5-23(с) shows the improved frequency response had we used а 63coefficient Вlackman window fиnction for а 63tap FIR filter, So иsing а nonrectangular window function reduces passband ripple at the expense of slower passband to stopband rolloff. А graphical comparison of the frequency responses for the rectangular and Бlасkman windows is provided in Figure 5-24. (Тhe curves in Figure 5-24 were obtained for the window fиnctions defined Ьу 32 discrete sam ples, to which 480 zeros were appended, applied to а 512point DFТ.) Тhe Linear window 'requency magnilude responses, IW(m)1 1 ', \ . ,Reclangular (dotled) 0,8  (а) 0,6 \ - -f> '...  .Iackman (dashed) 0,4 ;, .... . , \ ,..."... I ',..."':<....... ..... . -",..., ..... е. ......... ........ о ...... ....... 0,2 '.18 './4 './2 Freq Logarilhmic window 'requency magnilude responses, W dB (m) in dB -20 о ,, ....,  Rвctangular(dotled) '., -10 ,  /".', Blackman (dashed) :( \/?:;!.\/. ;. " \:. . . :: .. \ .е :. .' \.: ...""::..... .:: .';:" .. .. .:: ,. .... .1 :\ . .... . ." .. ' " . :...-1 .\. .. .. :. .'. :. \ " . " (Ь) -30 -40 ,  " , ....Т......-. I ... I \ I .\ .., I,..... I :' . \ .' .' -50 -60  , ! I :. I . , , /, '.18 "'14 './2 Freq Flgure 5-24 Rectangular vs, Blackman wlndow frequency magnltude responses: (а) I W(m) I оп а IInear scale; (Ь) normalized logarlthmic scale of WdB(m), 
Low-Pass F/R F/lter Des/gп 187 sidelobe magnitudes of the Вlackman window's I W(m) I are too small to see оп а linear scale. We сап see those sidelobe details Ьу plotting the two windows' frequency responses оп а logarithmic scale and normalizing each plot so that their main lobe peak values are both zero dB. For а given window function, we сап get the log magnitude response of WdB(m) Ьу using the expression ( 1 W(m) 1 ) W dB (m)=20.10g 10  I . W(O) I (516) (The 1 W(O) 1 term in Eq. (5-16) is the magnitude of W(m) at the peak of the main lobe when т = О.) Figure 5-24(Ь) shows us the great1y reduced side- lobe levels of the Вlackman window and how that window's main lobe is almost three times as wide as the rectangu1ar window' s main lobe. Of course, we could have used any of the other window functions, dis cussed in Section 3.9, for our lowpass FIR fi1ter. That's why this FIR fil- ter design technique is called the window design method. We pick а win dow function and mu1tiply it Ьу the sin(x) / х values from H(т) in Figure 523(a) to get our final h(k) fi1ter coefficients. It's that simple. Before we leave the window method of FIR filter design, let's introduce two other interesting window functions. A1though the Blackman window and those windows discussed in Section 3,9 are useful in FIR fi1ter design, we have little control over their frequency responses; that is, our only option is to select some window function and accept its corresponding frequency response, Wouldn't it Ье nice to have more flexibi1ity in trading off, or striking а compromise between, а window's main lobe width and sidelobe levels? Fortunately, there are two popular window functions that give us this opportunity, Called the Chebyshev and the Kaiser window functions, they're defined Ьу the following formidable expressions: w(k) = the Npoint inverse DFТ of СЬеЬузЬеу window: (also called the Dolph Chebyshev and the Tchebyschev window) со{ N. COSl[ а. cos( х  )]] 1 coshfN .cosh (а)1 where а = coshl  cosh 1 (lО У ») and т = О, 1,2,...,N  1, (517) 
188 F/п/te /тpи/se Respoпse F//ters Kaiser window: (a15O calJed the Kaise:rВessel window) +  ] ro(k)  Iоф) for k = О, 1, 2, . . ., Nl, and р = (N1)/2. (518) Two typical Chebyshev and Kaiser window functions and their fre quency magnitude responses are shown in Figure 525. For comparison, the rectangu1ar and Blackman window functions are a1so shown in that figure. (Again, the curves in Figure 525(b) were obtained for window Window lunctions о о 5 Blackman (da8hed) 0,6 ---------l---------..--- /1 Rectangular (dotled) I 1 / / I / I I / I 1 1 , 1 I 1 I I I // 0,8 (а) 0.4 0,2 10 15 20 25 зо k (Ь) 18/8 18/4 1812 Freq Flgure 5-25 Typical wlndow functlons used wlth dlgltal fllters: (а) wlndow coefflclents In the time domaln; (Ь) frequency-domaln magnltude responses In dB, 
Low-Pass F/R F//ter Desigп 189 functions defined Ьу 32 discrete samples, with 480 zeros appended, applied to а 512-point DFf.) Equation (5 17) was originally based оп the analysis of antenna arrays using the mathematics of Chebyshev polynomials[911]. Equation (5-18) evolved from Кaiser's approximation of prolate spheroid functions using zerothorder Bessel functions[1213], Don't Ье intimidated Ьу the coт plexity of Eqs. (517) and (5-18)at this point, we need not Ье concemed with the mathematical details of their development, We just need to real- ize that the coпtro/ parameters у and , in Eqs. (5 17) and (5-18), give us con- trol over the windows' таin lobe widths and the sidelobe levels, Let' s see how this works for Chebyshev window functions, having four separate values of у, and their frequency responses shown in Figure 5-26, FIR filter designers applying the window method typically use prede fined software routines to obtain their Chebyshev window coefficients, Commercial digital signal processing software packages allow the user to specify three things: the window function (Chebyshev in this case), the desired number of coefficients (the number of taps in the FIR filter), and the value of у. 5electing different values for у enables us to adjust the side-- lobe levels and see what effect those values have оп таin lobe width, а capability that we didn't have with the Blackman window or the window functions discussed in 5ection 3.9. Тhe Chebyshev window function's stopband attenuation, in decibels, is equal to Atte11cheb = 2(Jy , (519) 50, for example, if we needed our sidelobe levels to Ье по greater than --60 dB below the таin lobe, we use Eq. (5-19) to establish а у value of 3,0 and let the software generate the Chebyshev window coefficients,t Тhe same process applies to the Kaiser window, as shown in Figure 527. Commercial software packages allow us to specify  in Eq, (518) and provide us with the associated window coefficients. The curves in Figure 527(b), obtained for Kaiser window functions defined Ьу 32 dis- crete samples, show that we сап select the desired sidelobe levels and see what effect this has оп the main lobe width, Chebyshev or Kaiser, which is the best window to use? It depends оп the application, Retuming to Figure 5-25(Ь), notice that, unlike the con- stant sidelobe peak levels of the Chebyshev window, the Kaiser window's t Ву the way, some digita! signa1 processing software packages require that we specify Atten Cheb in decibe!s instead of у, That way, we don't have to bother using Eq, (5-19) at аН, 
190 Fiпite /три/5е Re5poп5e Filters 0,8 0,6 (а) 0.4 0,2 00 о -10 -20 (Ь) -30 -40 -50 -60 -70 Chebyshev window lunctions у = 1,5 (dotted) ,. ://. / у = 2,0 (da5hed) . /' "'Х / I 1 '/1" 1. .,/ I 11 \ ,/' /1 I '.,/ ,./ I , // / .;' .;' ... 5 10 15 k 20 25 30 Chebyshev window Irequency magnitude responses, W dS (т) у = 1,5 (dotted) \ У = 2,0 (da5hsd) ' .. ' ..  у = 2,5 (da5hdot) \\ \ \ У= 3.0 (50Iid) . , ; \ \  \ \  ,f'J ,"""'. " " ,"'\ I " I 1\ \ ",' ,1 \ I I  I I ' , \ I I I ,( \ I ':  "''': I \ ': 1.... ,\: I \ \I! I 1, 11 :'\ ( 1 / 1: I \:,' 1  l' " } '/:! 1; i.:!-..' '1. 1):/j,t ' 11 :: I \; f l,' I I I I ir I \ ........J 11 Т .\i I \ 15/8 15/4 15/2 Freq Figure 5-26 Chebyshev wlndow functlons for vorious 'у volues: (о) window coefficients in the time domoin; (Ь) frequency-domain mognltude responses in dB. sidelobes decrease with increased frequency. However, the Kaiser side- lobes are higher than the Chebyshev window's sidelobes near the main lobe, Our primary trade-off here is trying to reduce the sidelobe levels without broadening the main lobe too much, Digital filter designers typi- саНу experiment with various values of у and  for the Chebyshev and Kaiser windows to get the optimum WdB(т) for а particular application. (For that matter, the Вlackman window's very low sidelobe levels out- weigh its wide таin lobe in many applications.) Different window func- tions have their own individual advantages and disadvantages for FIR fil- ter design, Regardless of the nonrectangular window function used, they 
Baпdpass F/R Fi/fer Des/gп 191 Kai5er window coefficient5 О,В 0,6 (а) 0.4 0,2 00 5 10 15 20 25 3О k Kal5er window Irequency magnitude re5pon5e5, W dB (m) о '5/8 15/4 15/2 Freq -20 -40 (Ь) -60 -ВО -100 Flgure 5-27 Kaiser window functions for various  values: (а) window coefficients in the time domain; (Ь) frequency-domain magnitude responses In dB, always decrease the FIR filter passband ripple over that of the rectangu lar window, For the enthusiastic reader, а very thorough discussion of window functions сап Ье found in reference [14]. 5.4 Bandpass FIR Filter Design The window method of lowpass FIR filter design can Ье used as the first step in designing а bandpass FIR filter. Let's say we want а ЗНар FIR ш- ter with the frequency response shown in Figure 5-22(а), but instead of being centered about zero Hz, we want the filter's passband to Ье centered 
192 F/пite lтpuJse Respoпse F//ters . . . . /hIP(k) ; .  . I  . .....!....!...... .  . . . . ...... .... -k  .  . . / S-hlft(k)   i (а) .. . .......................L.T......L...........""""'!"""'......L..""""!"""".............k . ,; I . Ii . . .. ,; {7  h bp (k) . . .. :.- . ...."""...."""""".;..Т-"""""'."""""'...""."."'.k . (Ь) Originallowpass response IH 1p (т)1 "" (' I IHbp(m)1 r\ \ , ., '/2 '5/4 о '5/4 's /2 Freq Flgure 5-28 Bondposs filter with frequency response centered ot '/4: (о) generating Зl-tор filter coefflcients hbP(k); (Ь) frequency mognltude response I ньр(т) I ' aboиt f/ 4 Hz. If we define а lowpass FIR filter's coefficients as hip(k), our problem is to find the 1;,p(k) coefficients of а bandpass FlR filter. As shown in Figure 528, we сап shift Hip(т)'s frequency response Ьу multiplying the filter's hip(k) lowpass coefficients Ьу а sinusoid of fs/ 4 Нz, Тhat sinusoid is represented Ьу the sshift(k) sequence in Figure 528(a) whose values are а sinewave sampled at а rate of four samples per cycle. Our final Зltар 1;,p(k) FIR bandpass filter coefficients are 1;,p(k) = hip(k)'Sshift(k) , (5-20) 
Highpass F/R Fi/ter Desigп 193 whose frequency magnitude response I Ньр(т) I is shown as the solid curves in Figure 528(b), Тhe actual magnitude оЕ I Ньр(т) I is half that оЕ the original I Hip(т) I because half the values in hbp(k) are zero when SShift(k) corresponds exactly to f/ 4. Тhis effect has an important practical implication. It means that, when we design an Ntap bandpass FIR fi1ter centered at а frequency оЕ 1./4 Hz, we only need to perform approxi mately N /2 mu1tiplications for each fi1ter output sample. (There's по reason to multiply an input sample value, x(пk), Ьу zero before we sum аН the products from Eq. (56) and Figure 513, right? We just don't both- er to perform the unnecessary multiplications at аН,) ОЕ course, when the bandpass FIRfi1ter's center frequency is other thanf./4, we're forced to perform the ЕиН number оЕ N multiplications for each FIR fi1ter out put sample. Notice, here, that the hip(k) lowpass coefficients in Figure 528(a) have not been multip1ied Ьу anу window function. In practice, we'd use an hip(k) that has been windowed prior to implementing Eq. (520) to reduce the passband ripple. If we wanted to center the bandpass filter's response at some frequency other thanf./4, we merely need to modify sshift(k) to represent sampled values оЕ а sinusoid whose frequency is equal to the desired bandpass center frequency. Тhat new sshift(k) sequence would then Ье used in Eq, (5-20) to get the new hbp(k). 5.5 Highpass FIR Filter Design Going one step further, we сап use the bandpass FIR fi1ter design tech- nique to design а highpass FIR fi1ter, То obtain the coefficients for а high- pass fi1ter, we need only modify the shifting sequence sShift(k) to make it represent а sampled sinusoid whose frequency is 1./2. This process is shown in Figure 5-29. Our final31tap highpass FIR fi1ter's hhp(k) coeEH cients are hhp(k) = hip(k) -sshift(k) = h ip (k)-(l, 1, 1, 1, 1, 1, etc.) , (521) whose I Hhp(т) I frequency response is the so1id curve in Figure 529(b), Because sshift(k) in Figure 5-29(а) has a1temating plus and minus ones, we сan see that hh (k) is merely hip(k) with the sign changed for every other coefficient. Ucl1ke I Ньр(т) I in Figure 5-28(Ь), the I Hhp(т) I response in Figure 529(b) has the same amp1itude as the original I Hip(т) 1. 
'94 Fiпite /тpиise Respoпse F//ters . /h1p(k)  . I!I : 8 ........ . . ... . . . ...... . .. 8k . . 1 w /""" i  I!I .. I!I · .  i . . I . . (а) . oi . oi Ii . . k . . . . . . Ii . .. {7 .  hhp (k) . ...... . . Ii · Ii . I i . .........-.... .. .. k . . Ii . (Ь) Orlginallow-pass response IH1p(т)1 IHhP(т)1 ("'./ ! {'>} 's/2 's/4 о ,/4 , J2 Freq Flgure 5-29 Hlghpass filter wlth frequency response centered at '5/2: (а) generating 31-tap filter coefficlents hhp(k); (Ь) frequency magnltude response I HhP(т) I ' Again, notice that the h'p(k) lowpass coefficients in Figure 5-29(а) have not been modified Ьу anу window function. In practice, we' d use а win dowed h,pCk) to reduce the passband ripple before implementing Eq. (5-21), 5.6 Remez Exchange FIR Filter Design Method Let's introduce one last FIR filter design technique that has found wide acceptance in practice, Тhe Remez Exchange FIR filter design method (also called the ParksMcClellan, or Optimal method) is а popular tech 
Reтez Exchaпge F/R Filter Desigп Method 195 1 + 8 р ш.. JF ....шш. .....'" 1 8p 85 )/ о о 'pass k Passband ! 'stop !< '" '5/2 Freq .....05 Stopband ;.. ' Figure 5-30 Desired frequency response definition of а low-pass FIR filter using the Reтez Exchange design тethod, nique used to design highperformance FIR filters,t То use this design method, we have to visualize а desired frequency response Hd(m) like that shown in Figure 5ЗО, We have to establish а desired passband cutoff frequency f pass and the frequency where the attenuated stopband begins, fstop' In addition, we must establish the variables 8 р and 85 that define our desired passband and stopband ripple. Passband and stopband ripple, in decibels, are relat- ed to 8 р and 85 Ьу[15] Passband ripple = 20 .10glO(1 + 8 р ) , (5-22) and Stopband ripple = 20 .10glO(8 s ) , (5-22') (Some of the early joumal papers describing the Remez design method used the equally valid expression 20 . 10glO(8 p ) to define the passband ripple in decibels, However, Eq, (522) is the most cornrnon form used today,) Next, we apply these parameters to а computer software routine that generates the filter's N timedomain h(k) coefficients where N is the minimum number of filter taps to achieve the desired filter response, t Reтez is pronounced re-'ma, like "away," 
196 Fiп/te /три/sе Respoпse F//ters 4 Hd(т) 1...... I ; lIIi 11, 11 '. о о f pass ,.-....-...-.-. 'stop  /2 Freq !+ Passbandi-<- TranSition... Stopband : i I band i i Figure 5-31 Alternate method for deftniпg the desired frequency response of а low-pass FIR ftlter using the Remez Exchange technique, Оп the other hand, some software Remez routines assume that we want Ор and 05 to Ье as small as possible and require us only to define the desired values of the Hd(m) response as shown Ьу the solid black dots in Figure 5-31, The software then adjusts the values of the unde- fined (shaded dots) values of Hd(m) to minimize the error between our desired and actual frequency response while minimizing Ор and 05' The filter designer has the option to define some of the Him) values in the transition band, and the software ca1culates the remaining undefined Hd(m) transition band values, With this version of the Remez algorithrn, the issue of most importance becomes how we define the transition region. We want to minimize its width while, at the same time, mini- mizing passband and stopband ripple. So exactly how we design an FIR filter using the Remez Exchange technique is specific to the available ш- ter design software. Although the mathematics involved in the develop- men.t of the Remez Exchange method is rather complicated, we don't have to worry about that hеrе[lб-20], Just remember that the Remez Exchange design method gives us а Chebyshev-type fi1ter whose actual frequency response is as close as possible to the desired Hd(m) response for а given number of fi1ter taps, То i11ustrate the advantage of the Remez method, the solid curve in Figure 5-32 shows the frequency response of а 31-tap FIR designed using this technique. For comparison, Figure 5-32 also shows the frequency responses of two 31-tap FIR fi1ters for the same passband width using the 
Ha/f-Baпd F/R F//ters 197 Filter frequency magnitude responses (dB) о  Remez (solid) 10 20 --40 . .. ...бо 70 О 0,05'. 0,1' 0,15'. 0,2'. 0,25'. 0,3'. 0,35'. Freq Flgure 5-32 Frequency response comparison ot three 3 l-tap FIR fllters: Remez, Chebyshev wlndowed, and Kaiser windowed, Chebyshev and Кaiser windowing techniques. Notice how the three fH- ters have rougbly the same stopband sidelobe levels, near the main lobe, but that the Remez filter has the more desirable (steeper) transition band rolloff, 5.7 HalfBand FIR Filters Тhere's а specialized FIR filter that's proved useful in decimation appli cations[2125], Called а half-baпd FIRfilter, its frequency response is sym- metrical about the 1./ 4 point as shown in Figure 533(a), As such, the sum of Ipass and Istop is 1/2. Тhis symmetry has the beautiful property that the timedomain FIR impulse response has every other fHter coefficient being zero, except at the peak. тhis enables us to avoid approximately haIf the number of multiplications when implementing this kind of fi1ter. Ву way of example, Figure 533(b) shows the coefficients for а 31-tap haIfband fH ter where дf was defined to Ье approximately 1/32 using the Remez Exchange method. (То preserve further symmetry, the parameters Ор and 05 were specified to Ье equal to each other.) 
198 F/п/te /mpu/se Respoпse F//ters Idealized frequency response 1,0 'ра.. './4 './2 Freq 1 + Ор у (а) 0,5 о h(k) 1,0 . 0,6 (Ь) .  . I ! ! . I , ' . . . I I ; : I '" . о .....,.,Т.,---.,Т.,........'i''--т-'.........'Т''Т'.........'-............ 2 i 1 3 5 7 9 11,13 15 17 119 21 23 25 27 29 k , . .4 0.2 0,6 0.4 + IН(т)1 1,0 · i i . 1 i '  I ! i 1 i! ! ! I i 0,5 1 -1-1 Т. -,. 1- 1- r t ; 1 -1 -1. I , (с) 3 5 7 9 11 13 15 ! . . . ...-...........-............................ 17 19 21 23 25 27 29 31 Freq t './2 о './4 Flgure 5-33 Holf-Bond FIR ftlter: (о) ideolized continuous frequency response; (Ь) coefficients for о Зl-tор holf-bond FIR fllter; (с) discrete frequency mognltude response of о Зl-tор holf-bond FIR fllter, Notice how the altemating h(k) coefficients are zero, so we have to per- form only 17 multiplications for each filter output sample instead оЕ the expected 31 multiplications, For the general case оЕ an 5tap halfband FIR filter, we'll need perform only (5 + 1)/2 + 1 multiplications for each out- put sample,t Taking the DFТ оЕ those h(k) coefficients gives us the half- band FIR frequency response shown in Figure 533(c). t Section 10.8 shows а technique to further reduce the number of necessary multiplications for certain types of FIR filters including ha1f-band filters, 
Phase Respoпse о' F/R Filters 199 5.8 Phase Response о' FIR Filters Although we illustrated а couple of output phase shift examples for our original averaging FIR fi1ter in Figure 510, the subject of FIR phase response deserves additional attention, One of the dominant features of FIR fi1ters is their 1inear phase response that we сап demonstrate Ьу way of example, Given the 25 h(k) FIR fi1ter coefficients in Figure 5 34(а), we сап perform а DFT to determine the fi1ter's Н(т) frequency response. The norma1ized real part, imaginary part, and magnitude of о: t  . , i 0 r: . "Т+-+-. I I I i I . . "'{),5 2 4 6 8 10 12 1 ... .... .  . . . I!I . (а) j ! ! . . . i i i I .-+--+-Т" , I I .. · · k 14 16 18 20 22 24 0,75 . Аеаl part 01 Н(т) 0,5 [] lmaginary part 01 Н(т) 0,25 (Ь) О . т "'{),25 22 24 26 28 ЗО "'{),5 "'{),75 1,O (с) ! \Н(т)\ 1,0.. ... '''.... I I: О 75 . i I . I ': 1: . ,5 : I I ! I i 1 I 0,25 ..!' i . I ! ' о о 2 4 6 8 10 12 14 16 18 20 22 24 26 28 ЗО 16'8 '8 i . . 2 епсу = 128= 8 . ,..щ...#,........,..,...-. т  Passband ; >---; ; Flgure 5-34 FIR fllter frequency response Н(т): (о) h(k) fllter coefficlenfs; (Ь) reol ond Imoglnory ports of Н(т); (с) mognltude of Н(т), 
200 F/п/te /тpи/se Respoпse FiJters Н(т) are shown in Figures 5-34(Ь) and 5-34(с), respectively.t Being сот- plex values, each Н(т) sample value сап Ье described Ьу its real and imaginary parts, or equivalent1y, Ьу its magnitude I Н(т) I and its phase Н,,(т) shown in Figure 5-35(а). (а) j Н.(т) /п dвgrees 200 ., 100 ....... 2 4 ., 12 14 16 18 20 22 24 26 28 ЗО ° f '. · "'. ... 100 ".'8, 6 8 10 .'.... / '...., / '.'... 8'8, .,.  ,., .'. .'. .... OO · D/sconffnUity induced Ьу arctangent caJculation твthod m 27rf' (900) (Ь) 168,750 Н.(О) = 00 Не(6) 202,50 (157,5") 101,250 OO t Н.(т) ,п dвgrees 100 2 4 6 8 10 12 14 16 18 20 22 24 26 28 ЗО О . , 1 I 1 I 1 I I I I I I I I I I ., ., ., ., ., ., ., ., .'. '. '. '., ., ., . .. m 100 (с) 200 --400 500 LвgШmаtе disconffnuities 'пН.(т) --600  Passband= i  F/gure 5-35 F/R filter phase respoпse Н,,(т) /п degrees: (а) calculated Н,,(т); (ь) polar plot of H,,(т)'s flrst ten phase angles in degrees; (с) actual Н,,(т), t Anу ОРТ size greater than the h(k) width of 25 is sufficient to obtain Н(т), The h(k) sequence was padded with 103 zeros to take а 128-point ОРТ resulting in the Н(т) sample values in Figure 534, ... 
..,\ Phase Respoпse о( F/R$h"ters - 201 . [- . , t-'i'-:' The phase of а complex quantity is, of course, the arctangent (the imaginary part divided Ьу the real part, or IZJ = tan l(imag/real), Тhц ,_,\,)' the phase of Н",(т) is determined from the samples in Figure 534(b). " The phase response in Figure 535(a) certainly looks linear over select- ed frequency ranges, but what do we make of those sudden jumps, or dis- continuities, in this phase response? If we were to plot the angles of Н",(т) starting with the т = О sample оп а polar graph, using the nonzero real part of Н(О), and the zero-valued imaginary part of Н(О), we'd get the zeroangled Н",(О) phasor shown оп the right side of Figure 5-35(Ь), Continuing to use the real and imaginary parts of Н(т) to plot additional phase angles resu1ts in the phasors going clockwise around the circle in increments of 33,750, It's at the Н",(6) that we discover the cause of the first discontinuity in Figure 535(a), Taking the real and imaginary parts of Н(6), we'd plot our phasor oriented at an angle of 202.50, But Figure 5-35(а) shows that Н",(6) is equal to 157.50, The problem 1ies in the soft- ware routine used to generate the arctangent values plotted in Figure 5-35(а). The software adds 3600 to any negative angles in the range of 1800 > IZJ  3600, i,e., angles in the upper half of the circle, This makes IZJ а positive angle in the range of 00 < IZJ $; 1800 and that's what gets plotted, (This apparent discontinuity between Н",(5) and Hi6) is called phase wrap- piпg.) 50 the true Н",(6) of 202.50 is converted to а +157.50 as shown in parentheses in Figure 5-35(Ь), If we continue our polar plot for additional Н",(т) values, we'll see that their phase angles continue to decrease with an angle increment of 33,750, If we compensate for the software's behav- ior and plot phase angles more negative than 1800, Ьу uпwrappiпg the phase, we get the true Н",(т) shown in Figure 5-35(c),t Notice that Н",(т) is, indeed, linear over the passband of Н(т), It's at Н",(17) that our partic- ular Н(т) experiences а polarity change of its real part while its imaginary part remains negative-----this induces а true phase angle discontinuity that really is а constituent of Н(т) at т = 17, (Additional phase discontinuities occur each time the real part of Н(т) reverses polarity, as shown in Figure 5-35(с),) The reader mау wonder why we care about the linear phase response of Н(т), The answer, an important one, requires us to introduce the notion of group delay. Group delay is defined as the derivative of the phase with respect to fre- quency, or G = &:J/ N For FlR filters, then, group delay is the slope of the Н",(т) response curve, When the group delay is constant, as it is over the t When plotting fi1ter phase responses, if we encounter а phase angle sample '" that looks like an unusua1 discontinuity, it's а good idea to add 3600 to '" when '" is negative, or 3600 when '" is positive, to see if that compensates for any software anomalies. 
202 Fiпite /тpu/se Respoпse Fiiters раssЪand of all FIR filters having symmetrical coefficients, all frequency components of the filter input signal are delayed Ьу an equal amount of time G before they reach the filter's output, This means that по phase dis tortion is induced in the filter's desired output signal, and this is crucial in communications signals, For amplitude modulation (АМ) signals, con stant group delay preserves the time waveform shape of the signal's mod ulation envelope. That's important because the modulation portion of an АМ signal contains the signal' s information. Conversely, а nonlinear phase will distort the audio of АМ broadcast signa1s, blur the edges оЕ television video images, blunt the sharp edges оЕ received radar pulses, and increase data errors in digital communication signals. (Group delay is sometimes called eпve/ope delay because group delay was originally the subject оЕ analysis due to its affect оп the envelope, or modulation signal, of атрН- tude modulation АМ systems.) Of course we're not realIy concerned with the group delay outside the passband because signal energy outside the раssЪand is what we're trying to elirninate through fi1tering. Over the passband frequency range for an Stap FIR digital filter, group delay has Ьееn shown to Ье given Ьу G = (5  l)t s 2 ' (5-23) where t s is the sample period (l/fs).t This group delay is measured in sec- onds, Eliminating the t s factor in Eq. (523) would change its dimensions to samples, The value G, measured in samples, is always an integer for oddtap FIR filters, and а non-integer for еуеn tap-filters, Although we used а 128-point DFТ to obtain the frequency responses in Figures 534 and 5-35, we could just as well have used N = 32-point or N = 64-point DFТs. These smaller DFТs give us the phase response curves shown in Figure 5-36(а) and 5-36(Ь). Notice how different the phase response curves are when N = 32 in Figure 536(a) compared to when N = 128 in Figure 5-36( с). The phase angle resolution is much finer in Figure 536(c). The passband phase angle resolution, or increment.10, is given Ьу .10 c . 3600 N (5-24) t As derived in Section 3,4 of reference [15], and Section 5,7,3 of reference [19], 
Phase Respoпse of F/R F//ters 203 where N is the number оЕ points in the DFТ. 50, for our 5 = 25tap filter in Figure 534(a), G = 12, and Ае is equal to 12 .3600/32 = 1350 in Figure 536(a), and de is 33.750 in Figure 536(c). If we look carefully at the sam ple values in Figure 536(a), we'11 see that they're а11 included within the samples in Figures 536(b) and 536(c), Let's conclude this FIR phase discussion Ьу reiterating the meaning of phase response. Тhe phase, or phase delay, at the output оЕ an FIR filter is Н 0 (т) in degrees (а) 100 . . . . 50 / //\ // ']/ .. о · ... .. 50' .  . '//\ ;/ '\'I..' / . ..... .... т 1OO .... \ ../..\/ .!.. о о,, .. '.' .,. 150 .. I . 200 (Ь) 2001 Н 0 (т) in degrees  . :(\ "'c"':  f;XiA!frjAf A · .= Vl'i# ' · 1. m 200 f (с) 200 н.. (т) in degrees .. . 150  . . .. . . ................. '1 12&-point OFТ . , .  "1:' 1'1 50  · · t 1. ; f ' M '  J '  :. ·  , · · . н . . N 8 · \ .. .. \ · о, :'.". w . ... · :.+:. · :. :. · .... · · 50 f 8  J . t J ':  ' ... J J.\ ,. , ... .   "...   т . . .  ' . . , ". .. \ 100; 1. , \ :.. ... , 150 · '. .... о. .. . .... . "" ... .. ..... . .. 200 Flgure 5-36 FIR fllter phase response Н 0 (т) In degrees: (а) ealeulated uslng а 32-polnt DFТ; (Ь) uslng а 64-polnt DFТ; (е) using а 128-point DFТ, 
204 Fiп/te /mpu/se Respoпse Fi/ters ТаЫе 5-2 Values Used lп Eq, (5-25) for the Frequeпcy './32 DFT size, N Iпdex m H./mf/N) 32 1 1350 64 2 1350 128 4 1350 the phase of the first output sample relative to the phase of the filter's first inpиt sample, Over the passband, that phase shift, of course, is а linear function of frequency. Тhis will Ье Пuе only as long as the filter has sym metrical coefficients, Figure 5-10 is а good illustration of an FIR filter's output phase delay. For FIR filters, the output phase shift measured in degrees, for the pass band frequency f = mf/N, is expressed as m.C.3600 phase delay= H,,(m..€ jN)= m. = . N (5--25) We сап illustrate Eq. (5-25) and show the relationship between the phase responses in Figure 536, Ьу considering the phase delay associated with the &equency off/32 in ТаЫе 52. Тhe subject of group delay is described further in Appendix F where ап example of envelope delay distortion, due to а filter's nonlinear phase, is illustrated. 5.9 А Generic Description о' Discrete Convolution Although convolution was originally an analysis tool used to prove соп- tinuous signal processing theorems, we now know that convolution affects every aspect of digital signal processing. Convolution influences our results whenever we analyze or filter anу finite set of data samples from а linear timeinvariant system. Convolution not оnlу constrains DFТs to Ье just approximations of the continuous Fourier transform; it is the reason that discrete spectra are periodic in the frequency domain. It's interesting to note that, a1though we use the process of convolution to implement FIR digital filters, convolution effects induce frequency response ripple preventing us from ever building а perfect digital fi1ter. Its influence is so pervasive that, to repeal the law of convolution, quoting а 
А Geпeric Descriptioп о( Discrete Coпvoiutioп 205 N-1 Y j = I Pk"Oj-k , or k=O УО 00 °N-1 °N_2 01 РО У1 01 00 °N_1 02 Р 1 У 2 02 01 00 ОЗ Р 2 = Y N - 1 о N-1 О N-2 ОN_З 00 P N - 1 Theorem: if Pj f-- DFТ --7 Ап , О j f-- DFТ --7 Вп , and Yj f-- DFТ --7 сп then, Сп = N'An"8n Flgure 5-37 One very efficlent. but perplexlng. way of definlng convolutlon, phrase from Dr. Who, would "unravel the entire eausal nexus" of digital signal proeessing. Convolution has always Ьееп а somewhat difficu1t eoneept for the beginner to grasp. That's not too surprising for several reasons. Convolution's effeet оп diserete signal proeessing is not intuitively obvi ous for those without experienee working with diserete signals, and the mathematics of eonvolution does seem а litt1e puzzling at first. Moreover, in their sometimes justified haste, тanу authors present the eonvolution equation and abrupt1y start using it as an analysis tool without explaining its origin and meaning. For example, this author опее eneountered what was eal1ed а tutorial article оп the FFr in а professional journal that pro eeeded to define coпvolutioп merely Ьу presenting something like that shown in Figure 537 with по further explanation! Unfortunately, few beginners еan gain an understanding of the eonvo lution proeess from Figure 537 alone. Here, we avoid this dilemma Ьу defining the proeess of eonvolution and gent1y proeeed through а eouple of simple eonvolution examples. We eonelude this ehapter with а diseus sion of the powerful eonvolution theorem and show why it's so useful as а qualitative tool in diserete system analysis. 
206 Fiп/te /тpu/se Respoпse F//ters 5.9.1 Discrete Convolution in the Time-Domaln Discrete convolution is а process, whose input is two sequences, that pro vides а single output sequence, Convolution inputs сап Ье two time domain sequences giving а time--domain output, or two frequencydomain input sequences providing а frequency-domain result. (Although the two input sequences must both Ье in the same domain for the process оЕ con volution to have any practical meaning, their sequence lengths need not Ье the same,) Let's say we have two input sequences h(k) оЕ length Р and x(k) оЕ length Q in the time domain, Тhe output sequence у(п) оЕ the convolu tion оЕ the two inputs is defined mathematically as P+Q2 у(п)= )(k)x(nk), kO (526) Let's examine Eq. (5-26) Ьу way оЕ example using the h(k) and x(k) sequences shown in Figure 5-38. In this example, we сап write the terms for each у(п) in Eq. (5-26) as у(О) = h(O)x(OO) + h(1)x(Ol) + h(2)x(02) + h(3)x(03) + h(4)x(04) + h(5)x(05), у(l) = h(O)x(lO) + h(1)x(1I) + h(2)x(I2) + h(з)х(IЗ) + h(4)x(I4) + h(5)x(15), у(2) = h(0)x(20) + h(l)x(21) + h(2)x(22) + h(3)х(2З) + h(4)x(24) + h(5)x(25), у(З) = h(O)x(O) + h(l)x(I) + h(2)x(2) + h(3)x(3) + h(4)x(4) + h(5)x(5), у(4) = h(0)x(4---0) + h(l)x(4---1) + h(2)x(4---2) + h(з)х(4---3) + h(4)x(4---4) + h(5)x(4---5), and у(5) = h(O)x(S--О) + h(l)x(S--I) + h(2)x(S--2) + h(3)x(S--З) + h(4)x(S--4) + h(5)x(,5--.5). (527) With Р = 4 and Q = 3, we need evaluate only 4 + 3  1 = 6 individual у(п) terms, Because h(4) and h(5) are zero, we сап eliminate some оЕ the terms in Eq, (5-27) and evaluate the remaining x(nk) indices giving the follow- ing expressions for у(п) as у(О) = h(O)x(O) + h(l)xH) + h(2)x(2) + h(3)x(3) , y(l) = h(O)x(l) + h(l)x(O) + h(2)xH) + h(3)x(2) , у(2) = h(0)x(2) + h(l)x(l) + h(2)x(0) + h(3)xH) , у(3) = h(0)x(3) + h(1)x(2) + h(2)x(1) + h(3)x(0) , у(4) = h(0)x(4) + h(1)x(3) + h(2)x(2) + h(3)x(1) , and у(5) = h(0)x(5) + h(1)x(4) + h(2)x(3) + h(3)x(2) . (528) 
А Geпeric Descriptioп of Discrete coпvo/ut/oп 207 2 1 О . .  . J х(К) З 2 1 О . j h(К) ... 2  1 О 1 2 З 4 5 6 k . , : , i ... З2 1 О 1 2 З 4 5 6 k (а) (Ь) Flgure 5-38 Convolution example input sequences: (а) flrst sequence h(k) of length Р = 4; (Ь) second sequence x(k) of length Q = З, . х(К) з' 2 1 О x(К) . зА 2 1 О . ! . i ... . . . , ; ... 2  1 О 1 2 З 4 5 6  k З2  1 О 1 2 З 4 5 6 k (а) (Ь) Flgure 5-39 Convolution example input sequence: (а) second sequence x(k) of length З; (Ь) reflection of the second sequence about the k = О Index, Looking at the indices of the h(k) and x(k) terms in Eq. (5-28), we see two very important things occurring, First, convolution is merely the summa- tion of а series of productsso the process itself is not very complicated, Second, notice that, for а given у(п), h(k)'s index is increasing as x(k)'s index is decreasing. Тhis fact has led many authors to introduce а new sequence хНе), and use that new sequence to graphically illustrate the convolution process. Тhe x(k) sequence is simply our original x(k) ref1ect- ed about the О index of the k axis as shown in Figure 5-39. Defining x(k) as such enables us to depict the products and surnmations of Eq. (5-28)'s convolution as in Figure 5-40; that is, we can now align the x(k) samples with the samples of h(k) for а given п index to calcиlate у(п), As shown in Figure 5-40(а), the alignment of h(k) and x(пk), for п = О, yields у(о) = 1. Тhis is the result of the first line in Eq. (5-28) repeated оп the right side of Figure 5-40(а). Тhe calculation of y(l), for п = 1, is depicted 
208 Fiп/te /mpu/se Respoпse Filters (а) 1 r h(1c) .... о I I I I  I I : I I I 11"-  ...... --з --2 1 О 1 2 3 4 5 6 k  ! >«(}.OIC)  . 1 . < . о I I I J I I I I I  ...... --з --2 1 О 2 4 5 6 k (Ь) 1 r h(1c) .... О I I I I I i i I I I   4 --з --2 1 О 1 2 3 4 6 k 3 1 >(H" · 2 ' . 1  j . о I I I I I I I I I I 1" ...... --з --2 1 О 1 2 3 4 5 6 k (с) ' r h(1c) .... о I I I I I I I j I  ...... --з --2 1 О 1 2 3 4 3 + >(2-1<) . !! I I I f I :  I ...... --з 2 1 О 1 2 3 (d) ' I h(J(J .... о I I I I i ; I i I  ...... --з 2 1 О 1 2 3 4 3 1 >(3-1<) l I I I I I ...... --3--2 1 О . . 1 . t i I I I 1"- 123456. (е) 1 r h(k) · I!I   . , о I I I I I I I I I I 1'"  --4 --з --2 1 О 1 2 3 4 5 6 k 3 + >(....1<) . lt I I I I I I ; r  I ,. ...... --з --2 1 О 1 2 3 4 5 6 k (1) 1 r h(k) . О I I I I I I i I I I I  ........з --2 1 О 1 2 3 4 5 6 k 3 + >(5-1<) . 1:t I I I I I i 1  1" ...... --з 2 1 О 3 4 5 6 k convotutJon wIIh п_О =с> соnvoluUo" wlthп.1 =с> I ..- 5 6 k convolutlon wlthп-2 с::с> t ио) 8 1>(0)>(0) + h(11)(1) + 1>(2)>(--2) + 1>(3)>(--3) ;t/0+0+081 . О 1 I I I I I I I I .. 012345678 п i х1) 8 1>(0)>(1) + 1>(1)>(0) + 1>(2)>(1) + 1>(3)>(2) 6 _2+1.0+0_3 4 /' . 2 . . О I i I I I I I I I .. 012345678 п f и2) 8 1>(0)>(2) + 1>(1)>(1) + 1>(2)>(0) + 1>(3)>(1) 6 ..З+2+1+0.6 4 . 2 . 0 1 О i I I I I I I 2345678 .. п ' 6 k '1" 6 k convoIu1ion wIIhп_З с::с> f из) 8 1>(0)>(3) + 1>(1)>(2) + 1>(2)>(1) + 1>(3)>(0) 6 . ..О+З+2+1.6 4 2 · : . i О I i j I I I I I .. О 234 5 678 п f и4) = 1>(0)>(4) + 1>(1)>(3) + 1>(2)>(2) + 1>(3)>(') 6 .. #" ..0+0+3+2_5 . 4 2. , . 0 1 О i I I I I I I 2345678 .. п convotutlon wlthп_4 =с> convolution wIIh п_5 =с> ! и5) = 1>(0)>(5) + 1>(1)>(4) + 1>(2)>(3) + 1>(3)>(2) 6 .. ..0+0+0+3_3 4 · / . , . 2 О 1 I I I I I I I .. 02345 678 п Flgure 5-40 Graphlcal deplctlon of the convolutlon of h(k) and x(k) in Figure &38, in Figurе-З4(Ь) where x(пk) is shifted оnе element to the right, resulting in у(1) = 3, We continue this x(пk) shifting and incrementing п until we arrive at the last nonzero convolution resu1t of у(5) shown in Figure 5-40(f), 50, performing the convolution of h(k) and x(k) comprises 
А Geпer/c Descript/oп о' Discrete coпvo/ut/on 209 Step 1: plotting both h(k) and x(k), Step 2: flipping the x(k) sequence about the k = О value to get x(k), Step 3: summing the products of h(k) and x(Ok) for аН k to get у(О), Step 4: shifting x(k) one sample to the right, Step 5: summing the products of h(k) and x(lk) for all k to get у(l), and Step 6: shifting and summing products until there's по overlap of h(k) and the shifted x(nk), in which case all further y(n)s are zero and we're done. Тhe full convolution of our h(k) and x(k) is the у(п) sequence оп the right side of Figure 5-40(f). We've scanned the x(k) sequence across the h(k) sequence and summed the products where the sequences overlap. Ву the way, notice that the у(п) sequence in Figure 5-40(f) has six elements where h(k) had а length of four and x(k) was of length three. In the general case, if h(k) is of length Р and x(k) is of length Q, the length of у(п) will have а sequence length of L, where L = (Р + Q  1) . (5-29) At this point, it's {аи for the beginner to ask, "ок, so what? What does this strange convolution process have to do with digital signal process- ing?" Тhe answer to that question lies in understanding the effects of the convolution theorem. 5.9.2 The Convolution Тheorem Тhe convolution theorem is а fundamental constituent of digital signal pro- cessing, It impacts our results anytime we filter or Fourier transform dis- crete data. То see why this is true, let's simplify the notation of Eq. (5-26) and use the abbreviated form у(п) = h(k) * x(k) , (5-30) where, again, the "*" symbol mеаns convolution. Тhe convolution theo- rem mау Ье stated as follows: If two time-domain sequences h(k) and x(k) have DFТs of Н(т) and Х(т), respectively, then the OFТ of h(k) *x(k) is the product Н(т) .Х(т). Likewise, the inverse DFТ of Н(т) .Х(т) is h(k) *x(k). We сап represent this relationship with the expression DFr h(k)*x(k)  Н(т).Х(т). IDFr (5-31) 
21 О Fiп/te /три/sе Respoпse Filters Sequence x(k) Fourier transform pair \ Sequence h(k) Time domain t  Х(т) Frequency domain Figure 5-41 Relationships of the convolution theorem, Equation (5-31) tells us that two sequences resulting from h(k) * x(k) and Н(т) . Х(т) are Fourier trапsfопn pairs, 50, taking the DFТ of h(k) * x(k) always gives us Н(т) .Х(т). Likewise, we can detennine h(k) *x(k) Ьу taking the inverse DFТ of Н(т) .Х(т). The important point to learn from Eq. (31) is that convolution in the tirne domain is equivalent to multipJication in the frequency domain, (We won't derive the convolution theorem here ЬесаUБе it's derivation is readily available to the interested rеаdеr[2б-...29],) То help us appreciate this principle, Figure 541 sketches the relationship between con- volution in the tirne domain and multipJication in the frequency domain. We can easily illustrate the convolution theorem Ьу taking 8-point DFТs of h(k) and x(k) to get Н(т) and Х(т), respectively, and listing these values as in ТаЫе 53, (Of course, we have to pad h(k) and x(k) with zeros, so they both have lengths of 8 to take 8-point DFТs,) Tabulating the inverse DFТ of the product Н(т) . Х(т) allows us to verify Eq. (531), as listed in the last two columns of ТаЫе 5-3, where the acronym ШFТ again теans inverse DFТ, The values from ТаЫе 53 are shown in Figure 542. (For simplicity, only the magnitиdes of Н(т), Х(т), and Н(т) . Х(т) are shown in the figure,) We need to Ьесоте comfortable with convolution in the Нте domain ЬесаUБе, 
А Geпer/c Descr/ptloп о' D/screfe Coпvo/uf/oп 211 ТаЫе 5-3 Convo/ution Values of h(k) and x(k) from Figure 5-38, Iпdex DFT о! OFТ о! IDFT о! korm h(k) x(k) h(k) = Н(m) x(k) = Х(m) Н(m) , Х(m) Н(m)' Х(m) h(k) 'x(k О 1 1 4,0 + jO,O 6,0 + jO,O 24,0 + jO,O 1,0 + jO,O 1 1 1 2 1,00  j2.41 2,41  j4,41 ,24  j10,24 3,0 + jO,O 3 2 1 3 О 2,O  j2,O О 6,0 + jO,O 6 3 1 О 1,00  jO.41 O,41 + j1.58 0,24 + j1,75 6,0 + jO,O 6 4 О О О 2,0 + jO.o О 5,0 + jO,O 5 5 О О 1,00 + jO,41 O,41  j1.58 0,24  j1,75 3,0 + jO,O 3 6 О О О 2.()() + j2,oo О 0,0 + jO,O О 7 О О 1,00 + j2,41 2,41 + j4,41 ,24 + j10,24 0,0 + jO,O О S"QU""ce >(11) :1. . . о ,--+--+---'I!III!I,,,,,,, О 1 2 3 4 5 8 7 k S"qU""C" h(1I) ol   . о ''I!II!I. О 1 2 З .. 5 в 7 k хп) = h(1I).>(1I) : ,! . I!' . Co"volullon 1" th" time domain . . 1) 1 I I f ....... о 1 .. 5 6 :, п =Ш ,,1 Frequency , domaln : L 'IН(m)l . . 2 . i 1 ; . . : О .+,..----+.. о 1 2 3 .. 5 е 7 т "- [; ;: : :. о .. . о 1 2 3 .. 5 в 7 т Multiplication in the frequency domain : h I lН(т)'Х{т)1 10  . о \.. . .., ............""""t'"'-. О 1 2 3 .. 5 в 7 Flgure 5-42 Convolutlon relatlonshlps of h(k), x(k), Н(т), and Х(т) from Flgure 5-38, 
212 Fiпite /mpulse Respoпse Filters Sequence x(k) Fourier transform pair \ Sequence h(k) Time domain t  t Х(т) Frequency domain Convolution in the frequency domain = Н(т).Х(т) Flgure 5-43 Relatioпshlps of the convolution theorem related to multiplication in the time domain, as we've 1eamed, it's the process used in FIR ffiters. As detai1ed in Section 5,2, we perform discrete timedomain FIR ffitering Ьу conv01ving an input sequence, х(п) say, with the impи1se response x(k) of а ffiter, and, for FIR т- ters that impu1se response happens to a1so Ье the ffiter's coefficients,t The resu1t of that conv01ution is а ffitered time--domain sequence whose spec trum is modified (mu1tiplied) Ьу the filter's frequency response Х(т), Section 10.10 describes а c1ever scheme to perform FIR тtering efficient1y using the FFТ a1gorithm to imp1ement conv01ution. Because of the duality of the conv01ution theorem, we cou1d have swapped the time and frequency domains in our discussion of conv01u- tion and mu1tiplication being а Fourier transform pair, This means that, similar to Eq, (531), we can a1so write t As we'lI see in Chapter 6, the coefficients used for an infinite impulse response (IIR) fi!ter are not equa! to that filter's impulse response. 
А Geпeric Descriptioп of Discrete Coпvoiutioп 213 OFТ h(k). x(k)  Н(т)" Х(т) ЮFТ (532) 50 the convolution theorem сап Ье stated more generally as Convolution in опе domain is equivalent to multiplication in tfre other domain. Figure 543 shows the relationship between multiplication in the time domain and convolution in the frequency domain. Equation (532) is the iundamental relationship used in the process of windowing timedomain data to reduce DFТ leakage, as discussed in 5ection 3.9. 5.9.3 Applying the Convolution Theorem Тhe convolution theorem is useful as а qualitative tool in predicting the affects of different operations in discrete linear time-invariant systerns. For example, many authors use the convolution theorem to show why period ic sampling of continuous signals results in discrete samples whose spec tra are periodic in the frequency domain, Consider the real continuous timedomain waveform in Figure 5-44(а), with the onesided spectrum of bandwidth В, Being а real signa1, of course, its spectrum is symmetrica1 about О Нz. (In Figure 544, the large right-pointing shaded arrows repre sent Fourier transform operations,) 5ampling this waveform is equiva lent to multiplying it Ьу а sequence of periodically spaced impulses, Figure 544(b), whose values are unity. If we say that the sampling rate is/. samples/second, then the sample period t. = 1/1. seconds, The result of this multiplication is the sequence of discrete timedomain impulses shown in Figure 544(c). We can use the convolution theorem to help us predict what the frequencydomain effect is of this multipli- cation in the time domain. From our theorem, we now realize that the spectrum of the timedomain product must Ье the convolution of the original spectra. Well, we know what the spectrum of the original con tinuous waveform is, What about the spectrum of the timedomain impulses? It has Ьееп shown that the spectrum of periodic impulses, whose period is t. seconds, is also periodic impulses in the frequency domain with а spacing of/. Hz as shown in Figure 544(b) [30]. Now, аН we have to do is convolve the two spectra. In this case, con volution is straightforward because both of the frequencydomain func tions are symmetrica1 about the zeroНz point, and flipping опе of them about zero Hz is superfluous. 50 we merely slide опе of the functions across the other and plot the product of the two. Тhe convolution of the original waveform spectrum and the spectral impulses results in replica tions of the waveform spectrum every fs Hz, as shown in Figure 5-44(с). 
214 F/п/te /mpu/se Respoпse Filters (а) ..,  ..  <? Lb .. о Tlme --8:' 0'8 Frвquency  {} (с)  о /. Тlт. 'Jlll111111L <? "UlLL 0'\ Тlт. FT 21/. 1II. О 111. 211s Fr.qu.ncy /. V V ..  2f. f. О  2 Frequency (Ь) Figure 5-44 Using convolution to predict the spectral replication effects of periodic sampling, This discussion reiterates the fact that the DFТ is always periodic with а period of fs Hz. Here's another example of how the convolution theorem сап соте in handy when we try to understand digital signal processing operations. This author опсе used the theorem to resolve the puzzling result, at the time, of а triangular window fиnction having its first freqиency response null at twice the frequency of the first null of а rectangular window function. Тhe question was "Н а rectangular timedomain func tion of width Т has its first spectral null at l/Т Hz, why does а triangu lar time-domain function of width Т have its first spectral null at 2/Т Hz?" We сап answer this question Ьу considering convolution in the time domain, Look at the мо rectangular time-domain functions shown in Figures 545(a) and 545(b). Н their widths are each Т seconds, their spectra are shown to have nu11s at l/Т нz as depicted in the frequencydomain func tions in Figures 5-45(а) and 545(b). We know that the frequency magnitude 
А Geпeric Descriptioп of Discrete Coпvoiutioп 215 responses will Ье the absolute value of the classic sin(x)/x function,t If we convolve those two rectangu1ar time-domain functions of width Т, we'll get the triangu1ar function shown in Figure 545(c), Again, in this case, flipping оnе rectangular function about the zero time axis is unnecessary, То соn- volve them, we need only scan оnе function across the other and dеtепninе (а) ф v ф v   ,  ф (Ь) (с) (d)  Т12 О Т12   Time  1fT О 1fT Freq  1fT О 1fT Freq v 1fT О НТ Freq ( :tI\ 'lJТ О 21Т Fr.q Flgure 5-45 Uslng convolutlon to show that the Fourler transform of а triangular function has its first null at twlce the frequency of the Fourler transform of а rectangular function, t The sin(x)/x function was introduced in our discussion of window functions in Section 3.9 and is covered in grea ter detail in Section 3,13, 
216 F/п/te /тpи/se Respoпse F//ters the area of their overlap, The time shift where they overlap the most мр- реns to Ье а zero time shift. Thus, our resultant convolution has а peak at а time shift of zero seconds because there' s 100 percent overlap, If we slide one of the rectangular functions in either direction, theconvolution decreases linearly toward zero, When the time shift is Т /2 seconds, the rectangular functions have а 50 percent overlap, тhe convolution is zero when the time shift is Т seconds-----that' s when the two rectangular functions сеаБе to over lap, Notice that the triangular convolution result has а width of 2Т, and that's really the key to answering our question, Because convolution in the time domain is equivalent to multiplication in the frequency domain, the Fourier transform magnitude of our 2Т width triangular function is the I sin(x)/x I in Figure 5-45(а) times the I sin(x)/x I in Figure 5-45(Ь), or the (sin(x)/x)2 function in Figure 5-45(с), If а triangu- lar function of width 2Т has its first frequencydomain null at l/Т Hz, thел the same function of width Т must have its first frequency null at 2/Т Hz as shown in Figure 5-45(d), and that's what we set out to show, Cornparison of Figure 5-45(с) and Figure 5-45(d) illustrates а funda mелtаl Fourier transform property that compressing а function in the time domain results in an expansion of its corresponding frequency domain representation, References [1] Shynk, J, J, "Adaptive IIR Filtering," IЕЕЕ ASSP Magazine, April1989, [2] Laundrie, А. "Adaptive Filters Enable Systems to Track Variations," Microwaves & RF, September 1989, [3] Bul1ock, 5, R, "Нigh Frequency Adaptive Fi1ter," Microwave Journa/, September 1990, [4] Haykin, 5, 5, Adaptive Filter Theory, Prentice-Hall, Englewood Cliffs, New Jersey, 1986, [5] Goodwin, G, с., and Sin, К. 5, Adaptive Filtering Prediction аnа Contro/, Prentice-Hall, Eng1ewood Oiffs, New Jersey, 1984, [6] Gibbs, J, W, Nature, Vol. 59, 1899, рр, 606, [7] Stockham, Т, G, "Нigh-Speed Convolution and Сопеlаtiоn with АррliсаНоns to Digital Filtering," Chapter 7 in Digita/ Processing o/Signa/s, Ed, Ьу В, Gold et аl" McGraw-Нill, New York, 1969, рр, 20232, 
Refereпces 217 [8] Wait, J, V, "Digital Filters," in Active Filters: Luтped, Distributed, Integrated, Digital, and Paraтetric, Ed, Ьу L, Р, Huelsman, McGrawНill, New York, 1970, рр, 200277, [9] Dolph, С. L, "А Current Distribution for Broadside Arrays Which Optimizes the Relationship between Веаm Width and Side-Lobe Level," Proceedings о/ the IRE, Vol. 35, June 1946, [10] Barbiere, О, "А Method for Ca1culating the Current Distribution оЕ Chebyshev Arrays," Proceedings о/ the IRE, Vol, 40, January 1952, [11] Cook, С. Е" and Bemfeld, М. Radar Signals, Academic Press, New York, 1967, рр,178---180, [12] Kaiser, J, F. "Digital Filters," in Systeт Analysis Ьу Digital Coтputer, Ed, Ьу F. F. Кио and J, F. Kaiser, John Wiley and Sons, New York, 1966, рр. 218---277' [13] Williams, С. 5, Designing Digital Filters, Prentice-Hal1, Englewood Oiffs, New Jersey, 1986, рр, 117, [14] Harris, F. J, "On the Use оЕ Windows for Harmonic Analysis with the Discrete Fourier Transform," Proceedings о/ the IЕЕЕ, Vol, 66, No, 1, January 1978, [15] McClellan, J, Н" Parks, Т, W" and Rabiner, L, R, "А Computer Program for Designing ОрНmит FIR Linear Phase Digital Filters," IЕЕЕ Trans, оп Audio and Electroacoustics, Vol, AU21, No, 6, December 1973, рр, 515, [16] Rabiner, L, R and Gold, В, Тheory and Application о/ Digital Signal Processing, Prentice-Hall, Englewood Cliffs, New Jersey, 1975, рр. 136, [17] Parks, Т, W" and McC1ellan, J, Н "Chebyshev Approximation For Nonrecиrsive Digital Filters with Linear Phase," IЕЕЕ Trans, оп Circuit Тheory, Vol, CТ19, March 1972, [18] McOel1an, J, Н., and Parks, Т, W. "А Unified Approach to the Design оЕ ОрНmиm FIR Linear Phase Digital Fi1ters," IЕЕЕ Trans, оп Circuit Theory, Vol, СТ-20, November 1973, [19] Rabiner, L, R" McClellan, J, Н" and Parks, Т. W, "FIR Digital Filter Design Techniques Using Weighted Chebyshev Approximation," Proc, IЕЕЕ, Vol, 63, No, 4, April1975, [20] Oppenheim, А. V., and Schafer, R, W, Discrete-Tiтe Signal Processing, Prentice-Hall, Englewood Cliffs, New Jersey, 1989, рр, 478, [21] Funderburk, О, М" and Park, 5, "Implementation оЕ а C-QUAM AMStereo Receiver Using а General Purpose DSP Device," RF Design, June 1993, [22] Harris Semiconductor Inc, "А Digital, 16-Bit, 52 Msps Halfband Filter," Microwave Journal, September 1993, [23] Bal1anger, М, G, "Computation Rate and Storage Estimation in Multirate Digital Filtering with Half-Band Filters," IЕЕЕ Trans, оп Acoust, Speech, and Signal Proc" Уоl, ASSP25, No, 4, August 1977, 
218 Flпlte /mpu/se Respoпse FlJters [24] Crochiere, R. Е" and Rabiner, L, R. "Decimation and Interpolation of Digital Signals----A Tutorial Review," Proceedings о/ the IЕЕЕ, Vol. 69, No, 3, March 1981, рр, 318, [25] Ballanger, М, G., Daguet, J, L" and Lepagnol, G, Р, "Interpolation, Extrapolation, and Reduction of Computational Speed in Digital Filters," IЕЕЕ Ттаns. оп Acoиst, Speech, and Signal Ртос" Vol, ASSP-22, No. 4, August 1974. [26] Oppenheim, А. V" Wil1sky, А. 5" and Young, 1, Т, Signals and Systeтs, Prentice-Hall, Englewood Cliffs, New Jersey, 1983, рр, 212, [27] Steams, 5, Digital Signal Analysis, Hayden Book Со" Rochel1e Park, New Jersey, 1975, рр, 93. [28] Oppenheim, А. V" and Schafer, R, W, Discrete-Tiтe Signal Processing, Prentice-Hal1, Englewood Cliffs, New Jersey, 1989, рр, 58, [29] Rabiner, L, R., and Gold, В, Theory and Application о/ Digital Signal Processing, PrenticeHal1, Englewood Cliffs, New Jersey, 1975, рр, 59, [30] Oppenheim, А. V" Wil1sky, А. 5" and Young, 1, Т, Signals and Systeтs, Prentice-Hall, Englewood Cliffs, New Jersey, 1983, рр, 201, 
CHAPTER SIX Infinite Impulse Response Filters Infinite impulse response (IIR) digital filters are fundamentally different from FIR filters because practical ПR fi1ters always require feedback. Where FIR filter output samples depend only оп past input samples, each ПR filter output sample depends оп previous input samples and previous filter output samples, IIR filters' тeтory of past outputs is both а blessing and а curse. Like аН feedback systems, perturbations at the IIR fi1ter input could, depending оп the design, cause the fi1ter output to Ьесоmе unstable and oscil1ate indefinitely, This characteristic of possi Ыу having an infinite duration of nonzero output samples, even if the input becomes аН zeros, is the origin of the phrase infinite iтpu/se response. It's interesting at this point to know that, relative to FIR filters, IIR filters have more complicated structures (block diagrams), are harder to design and analyze, and do not have linear phase responses, Why in the world, then, would anyone use an IIR filter? Because they are very efficient, IIR filters require far fewer multiplications per filter output sample to achieve а given frequency magnitude response, From а hardware standpoint, this means that IIR fi1ters сап Ье very fast, allow- ing us to build real-time IIR fi1ters that operate over much higher sam ple rates than FIR fi1ters,+ То illustrate the utility of IIR filters, Figure 6 1 contrasts the frequency magnitude responses of what's called а fourthorder lowpass ПR filter and the 19-tap FIR fi1ter of Figure 519(b) from Chapter 5. Where the 19 tap FIR fi1ter in Figure 61 requires 19 multiplications per filter output sample, the fourthorder IIR fi1ter requires only 9 mu1tiplications for each filter output sample. Not only does the IIR filter give us reduced t At the end of this chapter, we briefly compare the advantages and disadvantages of IIR fil ters relative to FIR filters, 219 
220 /пfiпite /три/5е Re5poпse Fllter5 IH(т)1 for а 19-tap FIR filter  о 's/B Freq(т) ".........., , s/B Flgure 6-1 Comparison of the frequency magnltude responses of а 19-tap low-pass FIR filter and а 4th-order low-pass IIR filter, passband ripple and а sharper filter ro11-off; it does so with less than half the multiplication workload of the FIR filter, Reca11 from Section 5.3 that, to force an FIR fi1ter's frequency response to have very steep transition regions, we had to design an FIR fi1ter with а very long impulse response. Тhe longer the impulse response, the more ideal our fi1ter frequency response wi11 Ьесоmе, From а hardware stand- point, the maximum number of FIR fi1ter taps we can have (the length of the impulse response) depends оп how fast Our hardware can perforrn the required number of multiplications and additions to get а filter output value before the next fi1ter input sample arrives, IIR fi1ters, however, can Ье designed to have impulse responses that are longer than their number of taps! Тhus, IIR filters сап give us much better fi1tering for а given nшn ber of multiplications per output sample than FIR filters. With this in mind, let's take а deep breath, flex our mathematical muscles, and leam about IIR filters. 6.1 An Introduction to Infinite Impulse Response Filters IIR filters get their namе from the fact that some of the fi1ter's previous output samples are used to calculate the current output sample. Given а finite duration of nonzero input values, the effect is that an IIR fi1ter could have а infinite duration of nonzero output samples. 50, if the IIR fi1ter's input suddenly becomes а sequence of а11 zeros, the fi1ter's output could conceivably remain nonzero forever. Тhis peculiar attribute of IIR filters cornes about because of the way they're щlizеd, i,e., the feedback struc- ture of their delay units, multipliers, and adders. Understanding IIR filter 
Ап /пtrodисtiоп to /пflпite /трИ/5е Respoпse Filters 221 structures is straightforward if we start Ьу recalling the bиilding blocks о! an FIR filter. Figиre 62(a) shows the now familiar structure о! а Нар FIR digital filter that implements the time-domain FIR eqиation у(п) = h(O)x(n) + h(l)x(nl) + h(2)x(n2) + h(3)x(n3) + h(4)x(n--4). (6-1) Althoиgh not specifically called oиt as sиch in Chapter 5, Eq. (6-1) is known as а difference equation. То appreciate how past filter oиtpиt sam- ples are иsed in the structure о! ПR filters, let's begin Ьу reorienting our FIR strиcture in Figиre 6-2(а) to that о! Figиre 6-2(Ь). Notice how the structures in Figиre 6-2 are compиtationally identical, and both are imple mentations, or realizations, о! Eq, (6-1). (а) h(O) х(n) (Ь) h(З) у(n) у(n) Flgure 6-2 FIR digital filter structures: (а) traditiona\ FIR filter structure; (Ь) rearranged, but equiva\ent, FIR filter structure, 
222 /пfiпite /три/sе Respoпse Filters We can now show how past filter output samples are combined with past input samples Ьу using the IIR fi1ter structure in Figиre 63. Because IIR fi1ters havetwo sets of coefficients, we'll use the standard notation of the variables b(k) to denote the feed forward coefficients and the variables a(k) to indicate the feedback coefficients in Figure 63, ОК, the difference equation describing the lIR fi1ter in Figиre 63 is у(п) = Ь(О)х(п) + Ь(l)х(п  1) + Ь(2)х(п  2) + Ь(3)х(п  3) + а(l)у(п  1) + а(2)у(п  2) + а(3)у(п  3) , (62) Look at Figure 6-3 and Eq. (6-2) carefиl1y, It's irnportant to convince our selves that Figure 63 really is а valid irnplementation ofEq, (6--2) and that, conversely, difference equation Eq, (62) fиlly describes the IIR fi1ter struc- ture in Figure 6-3. Кеер in mind now that the sequence у(п) in Figure 6-3 is not the same у(п) sequence that's shown in Figure 62, The d(n) sequence in Figure 63 is equal to the у(п) sequence in Figиre 62. х(п) У(п) Ь(3) 8(3) Feed forward calculations Feedback calculations Ffgure 6-3 IIR dlgital filter structure showing feed forward and feedback calculations, 
The Lap/ace Traпsforт 223 Ву now you're probably wondering, "Just how do we determine those a(k) and b(k) ПR fi1ter coefficients if we actually want to design ап ПR fil ter?" Well, fasten your seat ЬеН because this is where we get serious about understanding IIR fi1ters, Recal1 from the last chapter conceming the win- dow method of low-pass FIR fi1ter design that we defined the frequency response of our desired FIR filter, took the inverse Fourier transform of that frequency response, and then shifted that transform resu1t to get the fi1ter's timedomain impulse response, Happily, due to the nature of transversal FIR filters, the desired h(k) filter coefficients tumed out to Ье exact1y equal to the impulse response sequence. Following that same pro- cedure with IIR fi1ters, we could define the desired frequency response of our ПR fi1ter and then take the inverse Fourier transform of that response to yield the filter's time-domain impulse response. The bad news is that there's по direct method for computing the ПR fi1ter's a(k) and b(k) соеЮ- cients from the impulse response! Unfortunately, the FIR fi1ter design techniques that we've learned so far simply cannot Ье used to design ПR fi1ters, Fortunately for us, this wrink1e can Ье ironed out Ьу using опе of several available methods of designing ПR fi1ters. Standard IIR fi1ter design techniques fall into three basic classes: the impulse invariance, bilinear transform, and optimization methods, These design methods use а discrete sequence, mathematical transformation process known as the ztransform whose origin is the Laplace transform traditionally used in the analyzing of continuous systems, With that in mind, let's start this ПR fi1ter analysis and design discussion Ьу briefly reacquainting ourselves with the fundamentals of the Laplace transform, 6.2 The Laplace Transform The Laplace transform is а mathematical method of solving linear differ- ential equations that has proved very useful in the fields of engineering and physics, This transform technique, as it's used today, originated from the work of the brilliant English physicist Oliver Heaviside,+ The funda mental process of using the Laplace transform goes something like the following: t Heaviside (18501925), who was interested in electrical phenomena, developed аn efficient algebraic process of solving differential equations, Не initially took а lot of heat from his contemporaries because they thought his work was not sufficiently justified from а mathe- matical standpoint, However, the discovered correlation of Heaviside's methods with the rigorous mathematical treatment of the French mathematician Marquis Pierre Simon de Laplace's (17491827) operational calculus verified the validity of Heaviside's techniques, 
224 /пflпffe /mpu/se Respoпse F/fters Step 1: А time-domain differentia1 equation is written that describes the input/output re1ationship of а physica1 system (and we want to find the output function that satisfies that equation with а given input). Step 2: Тhe differentia1 equation is Lap1ace transformed, converting it to an a1gebraic equation, Step 3: Standard a1gebraic techniques are used to determine the desired output function's equation in the Lap1ace domain. Step 4: Тhe desired Lap1ace output equation is, then, inverse Lap1ace transformed to yie1d the desired timedomain output function's equation. тhis procedure, at first, seems cumbersome because it forces us to go the loпg way arouпd, instead of just solving а differentia1 equation directly. Тhe justification for using the Lap1ace transform is that a1though solving dif ferentia1 equations Ьу c1assica1 methods is а very powerfu1 ana1ysis tech nique for а11 but the most simp1e systems, it can Ье tedious and (for some of us) errorprone. Тhe reduced comp1exity of using a1gebra outweighs the extra effort needed to perform the required forward and inverse Lap1ace transforrnations. Тhis is especia11y true now that tables of forward and inverse Lap1ace transforms exist for most of the commonly encountered time functions, Wellknown properties of the Lap1ace transform a1so allow practitioners to decompose comp1icated time functions into combinations of simp1er functions and, then, use the tables, (Tables of Lap1ace trans forrn.s allow us to trans1ate quickly back and forth between а time function and its Lap1ace transformana1ogous to, say, а GermanEnglish dictio nary if we were studying the German 1anguage. t) Let' s briefly 100k at а few of the more important characteristics of the Lap1ace transform that will рroуе usefu1 as we make our way toward the discrete z-transform used to design and ana1yze IIR digita1 filters. The Lap1ace transform of а continuous timedomain function f(t), where f(t) is defined оnlу for positive time (t > О), is expressed mathe та tica11y as  F(s) = f f(t)est dt о ( б-З) t Although tables of common1y encountered Laplace transforms are included in almost every system analysis textbook, very comprehensive tables are also аvаilаЫе[IЗ], 
The Lap/ace Traпsforт 225 F(s) is called "the Laplace transform off(t)," and the variable s is the сот- plex number s = а + jro . (6-4) А more general expression for the Laplace transform, called the bilateral or two-sided transform, uses negative infinity () as the lower liтН of integration, However, for the systems that we'll Ье interested in, where system conditions for negative tirne (t < О) are not needed in our analysis, the oпe-sided Eq. (6З) applies. Тhose systems, often referred to as causal systems, тау have initial conditions at t = О that must Ье taken into account (velocity of а mass, charge оп а capacitor, temperature of а body, etc,) but we don't need to know what the system was doing prior to t = О, ln equation (64), а is а real number and ro is frequency in radians/ second. Because е....! is dirnensionless, the exponent term s must have the dirnension of l/tirne, or frequency. Тhat's why the Laplace variable s is often called а complex frequency. То put Eq, (6З) into words, we can say that it requires us to multiply, point for point, the functionf(t) Ьу the complex fиnction e S ! for а given value of s. (We'll soon see that using the function е....! here is not acciden- tal; e--s! is used because it's the general form for the solution of linear dif ferential equations.) After the pointforpoint multiplications, we find the area under the curve of the functionf(t)e....! Ьу summing аВ the products. Тhat area, а complex number, represents the value of the Laplace trans- form for the particular value of s = а + jro chosen for the original multi- plications. If we were to go through this process for аВ values of s, we'd have а fиll description of F(s) for every value of s, 1 like to think of the Laplace transform as а continuous function, where the complex value of that function for а particular value of s is а correla tion of f(t) and а damped complex e--s! sinusoid whose frequency is ro and whose damping factor is а, What do these complex sinusoids look like? WeB, they are rotating phasors described Ьу j(J)! eS! = e(a+j(J)! = еЙ!еj(J)! =  еЙ! (6-5) From our knowledge of complex numbers, we know that ej(J)! is а unity magnitude phasor rotating clockwise around the origin of а complex plane at а frequency of ro radians per second. Тhe denominator of Eq. (6-5) is а real number whose value is one at tirne t = о. As t increases, the denom- inator еЙ! gets larger (when а is positive), and the complex e--s! phasor's 
226 /пfiп/te /mpu/se Respoпse Filters magnitude gets smaller as the phasor rotates оп the complex plane. Тhe tip of that phasor traces out а curve spiraling in toward the origin of the complex plane. One way to visualize а complex sinusoid is to consider its real and imaginary parts individually. We do this Ьу expressing the coт plex: e--s t sinusoid from Eq. (6-5) in rectangular form as st ej(J)t cos((Ot) ,sin((Ot) е ="""""Cit=J, е е е (6--5') Figure 64 shows the real parts (cosine) of several complex sinusoids with different frequencies and different damping factors, In Figure 6-4(а), the complex sinusoid's frequency is the arbltrary (о', and the damping factor is the arbltrary 0',50 the real part of F(s), at s = о' + j(O', is equal to the cor- relation of f(t) and the wave in Figure 64(a). For different values of s, we'll correlate f(t) with different complex sinusoids as shown in Figure 64, (As we'll see, this correlation is very much like the correlation off(t) with var- ious sine and cosine waves when we were calculating the discrete Fourier transform.) Again, the real part of F(s), for а particular value of s, is the correlation of f(t) with а cosine wave of frequency (О and а damping fac tor of о, and the imaginary part of F(s) is the correlation of f(t) with а sinewave of frequency (О and а damping factor of о. Now, if we associate each of the different values of the complex s vari- аЫе with а point оп а complex plane, rightfully called the splane, we could plot the real part of the F(s) correlation as а surface above (or below) that s-plane and generate а second plot of the imaginary part of the F(s) correlation as а surface above (or below) the splane, We can't plot the full complex F(s) surface оп paper because that would require four dimen sions. Тhat's because s is complex, requiring two dimensions, and F(s) is itself complex and also requires two dimensions, What we сап do, how ever, is graph the magnitude I F(s) I as а function of s because this graph requires only three dimensions, Let's do that as we demonstrate this notion of an I F(s) I surface Ьу illustrating the Laplace transform in а tan gible way, 5ау, for example, that we have the linear system shown in Figure 6--5, Also, let's assume that we can relate the x(t) input and the y(t) output of the linear time invariant physical system in Figure 6-5 with the following messy homogeneous constantcoefficient differential equation d 2 y(t) dy(t) dx(t) а2  + аl  + Qoy(t) = Ь 1  + box(t) dt dt dt (66) 
The Lap/ace Traпsforт 227 (а) r  00 = 00' "", """ . ....,'"...,. (1 = (1' -'. ..._....,-..щ \rv  .=00' ..--...'--.........,..... . "'" (1 = 2(1' /""", Щ", \../ Щ ..  Time  Time (Ь) (с) Time (d) Time Flgure 6-4 Real part (cosine) of various e'5t functions, where 5 = (! + jro, to Ье correlated with f(t), We'l1 use the Laplace transform toward our goal of figuring out how the system wi11 behave when various types of input functions are applied, i.e" what will the y(t) output Ье for any given x(t) input. Let's slow down here and see exactly what Figure 65 and Eq, (6-6) are telling us, First, if the system is time invariant, then the а п and Ь п соеШ- cients in Eq, (6-6) are constant, They mау Ье positive or negative, zero, real or complex, but they do not change with time, If the system is elec- trical, the coefficients might Ье related to capacitance, inductance, and resistance, If the system is mechanical with masses and springs, the coef- ficients could Ье related to rnass, coefficient of damping, and coefficient of 
228 /пfiпi1 /тpu/se Respoпse Fi/ters x(t) I  System уи)  Figure 6-5 Systeт descrlbed Ьу Eq. (6-6). The systeт's input and output are the continuous tiтe functlons x(t) and уи) respectively. resilience, Then, again, if the system is thermal with masses and insula- tors, the coefficients would Ье related to thermal сарасНу and thermal conductance. То keep this discussion general, though, we don't reaHy care what the coefficients actuaHy represent, ОК, Eq, (6-6) also indicates that, ignoring the coefficients for the moment, the sum of the y(t) output plus derivatives of that output is equal to tЬe sum of the x(t) input plus the derivative of that input. Our problem is to determine exact1y what input and output functions satisfy the elabo rate relationship in Eq. (66). (For the stout hearted, classical methods of solving differential equations could Ье used here, but the Laplace trans form makes the problem much simpler for our purposes,) Thanks to Laplace, the complex exponential time function of 1ft is the one we'H use. It has the beautifиl property that it сan Ье differentiated any number of times without destroying its original form, Тhat is d(e st ) = sest d 2 (e st ) = s2est d 3 (e st )  s3est dn(e st ) = sne st dt 'dt 2 'dТ ,.." dt n (6-7) If we let x(t) and уи) Ье functions of e st , x(e st ) and y(lf t ), and use the prop erties shown in Eq. (67), Eq. (66) becomes a2 s2 y(e st ) + a1sy(e st ) + aoy(e st ) = b 1 sx(e st ) + box(e st ), or (a 2 s 2 + al s + ao)y(e st ) = (b1s + bo)x(e st ) . (6-8) Although it's simpler than Eq, (66), we сап further simplify the rela tionship in the last line in Eq, (6-8) Ьу considering the ratio of y(lft) over x(e"t) as the Laplace transfer function of our system in Figиre 65, If we саН that ratio оЕ polynomials the transfer fиnction Н(s), 
The Laplace Traп5forт 229 н(s)= y(e st ) = b 1 s+b o x(e st ) a2 s2 +a 1 s+ao ' (6-9) То indicate that the origina1 x(t) and y(t) have the identical functional form of eS t , we can follow the standard Laplace notation of capitalletters and show the transfer function as Н( )  Y(s)  Ь 1 нЬ о S   2 X(S) a2s +als+aO ' (6-10) where the OUtput Y(S) is given Ьу ь s + Ь о Y(S) = X(S) 21 = Х(s)Н(s) a2 s +a 1 s+a O (61l) Equation (6--11) leads us to redraw the original system diagram in а form that high1ights the definition of the transfer function Н(s) as shown in Figure 66. Тhe cautious reader тау Ье wondering, "ls it really va1id to use this Laplace analysis technique when it's strict1y based оп the system's x(t) input being some function of eS t , or x(eS t )?" Тhe answer is that the Laplace analysis technique, based оп the complex exponential x(eS t ), is valid because аll practical x(t) input functions can Ье represented with complex exponentials. For example, · а constant, с = ceO t , · sinusoids, sin(rot) = (ei oot  ejoot)/2j or cos(rot) = (ei oot + ejoot)/2, · а monotonic exponential, e at , and · an exponentially varying sinusoid, e.... t cos(rot). )«s) .1 System H(s) Y(S)  Flgure 6-6 Unear 5Y5tem descrlbed Ьу Eq5, (6-10) and (6-11), The 5Y5tem's Input 15 the Laplace functlon Х(5), it5 output Is the Laplace functloп У(5), and the system transfer functlon 15 Н(5), 
230 /пf1пite /mрИ/sе Respoпse Fffters With that said, if we know а system's transfer function Н(s), we сап take the Laplace transform of any x(t) input to determine X(s), multiply that X(s) Ьу Н(s) to get Y(s), and then inverse Laplace transform Y(s) to yield the timedomain expression for the output y(t). In practical situa tions, however, we usual1y don't go through аН those analytical steps because it's the system's transfer function H(s) in which we're most inter- ested, Being аЫе to express H(s) mathematicaHy or graph the surface I H(s) I as а function of s will teH us the two most important properties we need to know about the system under analysis: Is the system stable, and if so, what is its frequency response? "But wait а minute," уои say. "Equations (610) and (61l) indicate that we have to know the Y(s) output before we сап determine Н(s)!" Not really, АН we reaHy need to know is the timedomain differential equation like that in Eq. (66). Next we take the Laplace transform of that differen tial equation and rearrange the terms to get the H(s) ratio in the form of Eq. (6-10), With practice, systems designers сап look at а diagram (block, circuit, mechanical, whatever) of their system and promptly write the Laplace expression for H(s), Let's use the concept of the Laplace transfer fиnction Н(s) to determine the stabi1ity and frequency response of simple continuous systems, 6.2.1 Poles and Zeros оп the s-plane and Stability Onе of the most important characteristics of any system involves the con- cept of stabi1ity, We can think of а system as stable Н, given any boooded input, the output will always Ье boooded, Тhis sounds like an easy con dition to achieve because most systems we encoooter in our dai1y lives are indeed stable. Nevertheless, we have аН experienced instability in а system containing feedback, Recal1 the annoying how/ when а public address system's microphone is placed too close to the loudspeaker, А sensational example of an unstable system occurred in western Washington when the first Тасоmа Narrows Bridge began oscillating оп the afternoon of November 7th, 1940. Тhose oscillations, caused Ьу 42 mph winds, grew in amplitude ootil the bridge destroyed itself. For IIR digital fi1ters with their bui1t-in feedback, instability would resu1t in а fil ter output that's not at аН representative of the fi1ter input; that is, our fil ter output samples would not Ье а filtered version of the input; they' d Ье sorne strange oscillating or pseudorandom values, А situation we' d like to avoid ifwe can, right? Let's see how. We сап determine а continuous system's stability Ьу examining sev era1 different examples of H(s) transfer fиnctions associated with linear 
The Lop/oce Troп5forт 231 time-invariant systems, Assume that we have а system whose Laplace transfer fиnction is of the form of Eq. (610), the coefficients are аН real, and the coefficients Ь 1 and а 2 are equal to zero. We'll саН that Laplace transfer function H 1 (s), where Н ( )  Ь о  Ь о / а 1 1 S  a 1 s+a O s+a o / а 1 (6-12) Notice that if s = ao/a1' the denominator in Eq. (6-12) equals zero and H 1 (s) would have аn infinite magnitude. This s = ao/a1 point оп the s-plane is called а pole, and that pole's location is shown Ьу the "х" in Figиre 67(a), Notice that the pole is located ехасНу оп the negative por- tion of the real (j axis, If the system described Ьу Н 1 were at rest and we disturbed it with an impulse like x(t) input at time t = О, its continuous timedomain y(t) output would Ье the damped exponential curve shown in Figure 67(b), We сап see that H 1 (s) is stable because its y(t) output approaches zero as Нте passes, Ву the way, the distance of the pole from the (j = о axis, а о / а 1 for our Н 1 (s), gives the decay rate of the y(t) impulse response. То illustrate why the term pole is appropriate, Figure 68(b) depicts the three-dimensional surface of I H 1 (s) I above the s-plane. Look at Figure 6-8(Ь) carefиlly and see how we've reoriented the splane axis, Тhis new axis orientation allows us to see how the H 1 (s) system's frequency magnitude response сап Ье determined from its three-dimensional s-plane surface. If we examine the I H 1 (s) I surface at (j = О, we get the bold curve in Figure 68(b). Тhat bold curve, the inter section of the vertical (j = о plane (the jm axis plane) and the I Н 1 (s) I sur- face, gives us the frequency magnitude response I Н 1 (т) I of the systemand that's one of the things we're after here, Тhe bold I Н 1 (т) I <1 = aO/a1 \ э-рlапе уи) = (bo/a,)e80/a1 t I jro cr о Time (а) (Ь) Flgure 6-7 Descrlptions of Н, (5): (о) pole locoted ot s = а + jro = OoIOl + jO оп the 5-plone; (Ь) tlme-domoln y(t) Impulse response of the system, 
232 /пl1n1te /mpu/se Respoпse F//ters jOJ (а) (J = aolal cr .. + (Ь) IH I (5)1 surface jOJ (с)  о jOJ Flgure 6-8 Further depletlons of H 1 (s): (а) pole /oeated at (J = ao/al оп the s-plane; (ь) I H)(s) I surfaee; (е) eurve showlng the Interseetion of the I H 1 (s) I surfaee and the vertleal (J = о plane, Тhls Is the eonventlonal depietion ofthe I Н 1 (ю) I frequency magnltude responsв, curve in Figure 68(b) is shown in а more conventional way in Figure 68(c), Figures 68(b) and 6-8(с) higblight the very important property that the Laplace transform is а more general case of the Fourier transform because if (1 = О, then 5 = j(j), In this case, the I Н) (5) I curve for 
The Lap/ace Traпsforт 233 cr = о above the splane becomes the I Н 1 (оо) I curve above the jm axis in Figure 6-8(с). Another common system transfer function leads to an impulse response that oscillates. Let's think about an alternate system whose Laplace transfer function is of the form of Eq, (6-10), the coefficient Ь о equals zero, and the coefficients lead to complex terms when the denom- inator polynomial is factored. We'll саll this particular second-order trans- fer fиnction H 2 (s), where Н ( )  b 1 s 2 S  2 a 2 s + al s + ао (Ь 1 / a 2 )s S2 +(al/ a 2)s+a O /a 2 (ИЗ) (Ву the way, when а transfer fиnction has the Laplace variable s in both the numerator and denominator, the order of the overall function is defined Ьу the largest exponential order of s in the denominator polyno- mial. 50 our H 2 (s) is а second-order transfer function.) То keep the fol lowing equations from becoming too messy, let's factor its denominator and rewrite Eq, (6IЗ) as As H 2 (s) = . (s+p)(s+p) ( 6-14) where А = Ь/а 2 , Р = Preal + jPirnag' and р' = P rea !  jPimag (complex conju gate of р). Notice that, if s is equal to P or p', one of the polynomial roots in the denominator of Eq. (6-14) will equal zero, and H 2 (s) will have an infinite magnitude. Тhose two complex poles, shown in Figure 6-9(а), are located off the negative portion of the real cr axis, If the Н 2 sys tem were at rest and we disturbed it with an impulselike хи) input at time t = О, its continuous time-domain y(t) output would Ье the damped sinusoidal curve shown in Figure 6-9(Ь), We see that H 2 (s) is stable because its oscil1ating уи) output, like а plucked guitar string, approaches zero as Нmе increases. Again, the distance of the poles from the cr = О axis (Prea!) gives the decay rate of the sinusoidal y(t) impulse response, Likewise, the distance of the poles from the jm = О axis (:tPimag) gives the frequency of the sinusoidal y(t) impulse response, Notice something new in Figure 69(a). When s = О, the numerator of Eq, (6-14) is zero, making the transfer fиnction H 2 (s) equal to zero. Any value of s where H 2 (s) = О is sometimes of interest and is usually plotted оп the s- plane as the litt1e circle, cal1ed а "zero," shown in Figure 69(a), At this point we're not very interested in knowing exactly what Р and р' are in 
234 /пflпlte /тpu/se Respoпse Filters s = Pr.., +jPimag jro x y(l) t y(l) = 2IAlePr.., COS(Pimag 1+ 6) "х 6=tan-'(A,m.g / ......') /Х s  Preal jpimag '\ cr 'zero"atl>"'O Time (а) (Ь) Flgure 6-9 Descriptlons of H 2 (s): (а) poles located at 5 = Р,ео! :!: JP;mag оп the s-plane; (Ь) tlme domaln y(t) Impulse response of the sysrem, terms of the coefficients in the denominator of Eq. (613). However, аn energetic reader could determine the values of р and р" in terms of ао, а 1 , and а 2 Ьу using the following well-known quadratic factorization for mula: Given the second-order polynomialf(s) = as 2 + bs + с, thenf(s) сап Ье factored as 2 [ ь  24ac ) [ Ь  24ac ) j(s) = as +bs+c = s++ 2. s+ 2 2а 4а 2а 4а . (6-15) Figure 6-10(Ь) illustrates the I H 2 (s) I surface аЬоуе the s-plane. Again, the bold I Н 2 (0)) I curve in Figure 6-10(Ь) is shown in the соn- ventional way in Figure 610(c) to indicate the frequency magnitude response of the system described Ьу Eq, (6-13). A1though the three dimensional surfaces in Figures 68(b) and 6-10(Ь) are informative, they're also unwieldy and unnecessary, We сап determine а system's stabllity merely Ьу looking at the locations of the poles оп the two dimensional s-plane. Т() further i11ustrate the concept of system stability, Figure 6-11 shows the splane pole locations of several example Laplace transfer functions and their corresponding time-domain impulse responses, We recognize Figures 6-11(а) and 6-11(Ь), from our previous discussion, as indicative of stable systems. When disturbed from their at-rest condition they respond and, at some later time, retum to that initial condition. Тhe sin gle pole location at s = О in Figure 6-11(с) is indicative of the l/s trans- fer function of а single element of а linear system, In аn electrical syst€m, this l/s transfer function could Ье а capacitor that was charged with аn impulse of current, and there's по discharge path in the circuit. 
The Lop/oce Troпsform 235 jw х (а) о' х  + (s)=O,ats=O  (Ь) (с) jw  о jw Flgure 6-10 Further deplctions of H 2 (s): (о) poles ond zero locotions оп the s--plone; (Ь) I H 2 (s) I surfoce; (с) I Н 2 (ro) I frequency mognitude response curve, For а mechanical system, Figure 6-11(c) would describe а kind of spring that's compressed with ап impulse of force and, for some reason, remains under compression, Notice, in Figure 6-11(d), that, if ап н(s) transfer function has conjugate poles located exact1y оп the jro axis 
236 /пffп/te /тpu/se Respoпse FI/ters +  I W ' ,  i W ' , + (а) +   ' -.-.----..."....,. А..ш... V "-../ ............. . ......;;; .. t .. t (Ь) (с) jro (d) .. t а 1 ,", / .............. /'Ccl\j\ .. t (е) (1) Figure 6-11 Various н(s) pole loeatloпs aпd their tlтe-doтaln lтpulse responses: (а) single pole at а < О; (Ь) eonjugate poles at а < О; (е) slngle pole loeated at а = О; (d) conjugate poles loeated at а = О; (е) slngle pole at а > О; (f) eonjugate poles at а > О, (а = О), the system will go into oscillation when disturbed from its ini tial condition, This situation, called conditional stability, happens to describe the intentional transfer function of electronic oscillators, Instability is indicated in Figures 6ll(е) and 6-11(f), Here, the poles lie to the right of the jro axis, When disturbed from their initial atrest condition 
The Lap/ace Traпsforт 237  Conditionally stabIe Flgure 6-12 The Laplace splane showlng the regions of stability and instabillty for pole locations for Ilпеш continuous systems, Ьу an impulse input, their outputs grow without bound,t 5ее how the value of 0', the real part of s, for the pole locations is the key here? When о' < О, the system is we11 behaved and stable; when о' = О, the system is conditiona11y stable; and when о' > О the system is unstable, 50 we сап say that, when о' is located оп the right half of the splane, the system is unstable, We show this characteristic of linear continuous systems in Figure 6 12. Кеер in mind that realworld systems often have more than two poles, and а system is on1y as stable as its least stable pole, For а sys tem to Ье stable, а11 of its transferfunction poles must Не оп the left half of the splane, То consolidate what we've learned so far: Н(s) is determined Ьу writing а linear system's timedomain differential equation and taking the Laplace transform of that equation to оЫаin а Laplace expression in terms of X(s), Y(s), s, and the system's coefficients. Next we rearrange the Laplace expression terms to get the Н(s) ratio in the form of Eq, (6-10). (The rea11y slick part is that we do not have to know what the timedomain x(t) input t Impulse response testing in а !aboratory сап Ье an important part of the system design process, The difficu!t part is generating а true impu!selike input, If the system is e!ectrica!, for ехатр!е, a!though somewhat difficu1t to imp!ement, the input x(t) impu!se wou!d Ье а very short duration vo!tage or current ри!Бе, If, however, the system were mechanica!, а whack with а hammer wou!d suffice as an x(t) impu!se inрщ. For digita! systems, оп the other hand, an impu!se input is easy to generate; it's а sing!e unity-va!ued samp!e preceded and followed Ьу all zero-va!ued samp!es, 
238 /пfiпite /тpu/se Respoпse Filters is to analyze а linear system!) We сап get the expression for the continuous frequency response of а system just Ьу substitutingjro for s in the H(s) equa tion. То determine system stability, the denominator polynomial of H(s) is factored to find each of its roots, Еат root is set equal to zero and solved for s to find the location of the system poles оп the splane. Any pole located to the right оЕ the jro axis оп the s-plane will indicate an unstable system, ок, returning to our original goal of understanding the z-transform, the process of analyzing IIR fi1ter systems requires us to replace the Laplace transform with the z-transform and to replace the s-plane with а z-plane, Let's introduce the z-transform, determinewhat this new z-plane is, discuss the stabi1ity of I1R filters, and design and analyze а few simple IIR fi1ters, 6.3 The z- Transform The z-transform is the discretetime cousin of the continuous Laplace transform,t WlU1e the Laplace transform is used to simplify the analysis of continuous differential equations, the z-transform facilitates the analy sis of discrete difference equations, Let's define the z-transform and explore its important characteristics to see how it's used in analyzing I1R d igi tal fil ters. The z-transform of а discrete sequence h(n), expressed as H(z), is defined as  H(z) = Lh(n)zп , (6 16) п=---оо where the variable z is complex. Where Eq, (6З) al10wed us to take the Laplace transform of а continuous signal, the z-transform is performed оп а discrete h(n) sequence, converting that sequence into а continuous function H(z) of the continuous complex variable z, Similarly, as the func- tion est is the general form for the solution of linear differential equa tions, zп is the general form for the solution of linear difference equations, Moreover, as а Laplace function F(s) is а continuous surface t In the ear!y 1960s, James Kaiser, after whom the Kaiser window function is named, con- solidated the theory of digita! filters using а mathematica! description known as the z-trаnsfоrm[4,S], Unti! that time, the use of the z-transform had generally been restricted to the fie!d of discrete contro! systems[9], I 
The z-Traпsforт 239 above the splane, the ztransform function H(z) is а continuous surface above а z-plane. То whet your appetite, we'll now state that, if H(z) rep- resents an IIR fi1ter's z-domain transfer function, evaluating the H(z) sur- [асе will give us the fi1ter's frequency magnitude response, and H(z)'s pole and zero locations wi1l determine the stabi1ity of the filter, We сап determine the frequency response of an IIR digital fi1ter Ьу expressing z in polar form as z = re jOJ , where r is а magnitude and ro is the angle. In this [опn, the z-transform equation becomes   Н(z)=Н(rе jOJ )= Lh(n)(rejOJ)п = Lh(n)rп(ejOJп) (6-17) п\XI п=oo Equation (6-17) can Ье interpreted as the Fourier transform of the product of the original sequence h(n) and the exponential sequence rп. When r equals one, Eq, (6-17) simplifies to the Fourier transform. Тhus оп the z-plane, the contour of the н(z) surface for those values where I z I = 1 is the Fourier transform of h(n), If h(n) represents а ffiter impulse response sequence, evaluating the H(z) transfer function for I z I = 1 yields the Пе- quency response of the fi1ter, 50 where оп the zplane is I z I = 1? It's а cir- cle with а radius of one, centered about the z = О point, This circle, so important that it's been given the name unit circle, is shown in Figure 6lЗ, Recall that the jro frequency axis оп the continuous Laplace s-plane was linear and ranged from --00 to +00 radians/s, Тhe ro frequency axis оп the complex z-plane, however, spans only the range пот п to +п radians, With this relationship between the jro axis оп the Laplace s-plane and the unit circle оп the z-plane, we сап see that the zplane frequency axis is Zimag At this point, / z= еiro Zreal Unit circle (where Izl = 1) Figure 6-13 Unit circle оп the сотр/ех z..plane, . 
240 /пfiпite /mpu/se Respoпse F//ters Figure 6-14 Mapping of the Laplace s--plane to the z--plane, АН frequency values are In radlans/s, equivalent tосоШng the s-plane's jO) axis about the unit circle оп the z-plane as shown in Figure 6-14, Then, frequency о) оп the zplane, is not а distance along а straight line, but rather an angle around а circle. With о) in Figure 6--13 being а general normalized angle in radians ranging from п to +п, we сап relate о) to an equivalent f. sampling rate Ьу defining а new frequency variable 0). = 2п!. in radians/ s. The periodicity of discrete frequency representations, with а period of 0). = 21tf. radians/ s or f. Hz, is indicated for the zplane in Figure 614, Where а walk along the jO) frequency axis оп the splane cou1d take us to infinity in either direction, а trip оп the о) frequency path оп the zplane leads us in circles (оп the unit circle), Figure 6 14 shows us that on1y the п!. to +п!. radians/s frequency range for о) can Ье accounted for оп the zplane, and this is another example of the universal periodicity of the discrete frequency domain, (Of course the 1tf. to +1tfs radians/s range corresponds to а сусliс frequency range of f.l2 to +f.l2.) With the perimeter of the unit circle being z = e jro , later, we'll show exactly how to substitute ejro for z in а fi1ter's н(z) transfer fиnction, giving us the fi1ter's frequency response. 6.3.1 Poles and Zeros оп the zplane and Stability One of the most important characteristics of the zplane is that the region of fi1ter stability is mapped to the inside of the unit circle оп the zplane. Given the н(z) transfer fиnction of а digital filter, we сап examine that fиnction's pole locations to determine filter stabi1ity. If аН poles are located inside the unit circle, the filter will Ье stable. on the other hand, if 
(а) (Ь) (с) (d) (е) Thв z-Troпsform 241 4 У (n) ''i:............ .1 у(п) 1 1Ifо . r > 2. ". , ...l....l.J"'"""7".. .", '"""' .:!...!..!:.ii" ;'-'.. ';j .. .. .'. . n  п 4 У (n) ti :...  ; 11 . 1. 'llшш ш . шш' E 1  .... п Y(n) ..' .. ,"1 I ....." "",' i ............. .: :' , ': ,:: :' ", .п l У(n)ш. ....... ..; ..."J!..!..I.iiirn..................... 1 .. .. ' . ' п .1 Ii F\gure 6-15 Various 1-/(1) pole loeations and their diserete time-domain impulse responses: (а) single pole inside the unit eirele; (Ь) eon]ugate poies loeated inside the unlt elrele; (е) eon]ugate poles loeated оп the unit eirele; (d) single pole outside the unit elrele; (е) eonJugate poles loeated outside the unit eirele, аnу pole is located outside the unit circle, Фе fi1ter will Ье unstable. Figure 6-15 shows the z-plane pole locations of several example z-domain tranS- fer functions and their corresponding discrete timedomain impulse responses. It' s а good idea for the reader to compare the z-plane and discrete-time responses of Figure 6-15 with the s-plane and the continuous time responses of Figure 611. Тhe у(п) outputs in Figures 6-15(d) and 
242 /пflпfte /mpUlse I<espoпse rflTers (е) show examples of how unstable filter outputs increase in amplitude, as time passes, whenever their х(п) inputs are nonzero. То avoid this sit uation, any IIR digital filter that we design should have an н(z) transfer fиnction with аll of its individual poles inside the unit circle. Like а chain that's only as strong as its weakest link, an IIR filter is only as stable as its least stable pole. The (00 oscillation frequency of the impulse responses in Figures 6-15(с) and (е) is, of course, proportional to the angle of the conjugate pole pairs from the zreal axis, or (00 radians/s corresponding to 10 = (О/2тс Hz. Because the intersection of the zreal axis and the unit circle, point z = 1, corresponds to 1t radians (or п!. radians/s = 1/2 Hz), the (00 angle of 'ТС/4 in Figure 6-15 means that 10 = 1/8 and our у(п) мll have eight samples per cycle ofl o ' 6.3.2 Using the z-transform to Analyze IIR Filters We have one last concept to consider before we can add the z-transform to our collection of digital signal processing too1s, We need to determine what the time delay operation in Figure 6-3 is relative to the ztransform. То do this, assume we have а sequence х(п) whose z-transform is X(z) and а sequence у(п) = x(пl) whose ztransform is Y(z) as shown in Figure 616. Тhe Hransform of у(п) is, Ьу definition,   Y(z) = Ly(n)zп = Lx(n  l)zп (6 18) п=---оо п=---оо Now if we let k = пl, then, Y(z) becomes   Y(z) = Lx(k)z(k+l) = Lx(k)zkZl , k==---oo k= (619) X(  I У(п) =х(п--1) Delay  X(z) Y(z) Flgure 6-16 Output sequence у(п) equal to а uп/t de/ayed version of the input х(п) sequence, 
The z- Traпsforт 243 which we can write аа  Y(Z) = Zl Lx(k)ZH) = Zl[X(Z)] k=oo (6-20) ТhиБ, the effect of а single unit of time delay is to mu1tiply the ztrапsfопn Ьу Zl. Interpreting а unit time delay to Ье equivalent to the r 1 operator leads иБ to the relationship shown in Figure 6-17, where we сап аау X(z)ZO = X(z) is the z-trапsfопn of х(п), X(z)r 1 is the ztrапsfопn of х(п) delayed Ьу опе sample, X(z)r 2 is the z-transform of х(п) delayed Ьу two samples, and X(z)Zk is the ztransform of х(п) delayed Ьу k samples, 50 а transfer function of Z-k is equivalent to а delay of kt s seconds from the instant when t = О, where t s is the period between data samples, or опе over the sample rate. 5pecifically, t s = 1/ fs. ВесаиБе а delay of опе sample is equivalent to the factor r 1 , the unit time delay symbol used in Figures 6-2 and 63 is usually indicated Ьу the r 1 operator, Let's раиБе for а moment and consider where we stand БО far, Oиr acquaintance with the Laplace trапsfопn with its splane, the concept оЕ stability based оп H(s) pole locations, the introduction of the z-trаnsfопn with its z-plane poles, and the concept of the r 1 operator signifying а аin- gle unit оЕ time delay has led иБ to our goal: the ability to inspect an IIR fi1ter difference equation or filter structure and immediately write the fil- ter's z-domain transfer function Н(z), Accordingly, Ьу evaluating an IIR filter's H(z) transfer function appropriately, we сап dеtепninе the filter's frequency response and its stability. With those ambitious thoughts in mind, let's develop the zdomain equations we need to analyze IIR filters, Using the relationships оЕ Figure 617, we redraw Figure 6-3 аа а gen- eral Mth-order IIR fi1ter using the Zl operator аа shown in Figure 6-18. (In hardware, those r 1 operations are shift registers holding successive filter Time domain Flgure 6-17 Correspondence of the delay operatlon In the tlтe doтaln and the Z-k operatlon in the z-doтain, 
244 /пfiп/te /mpu/se Respoпse F//ters input and output sample values, When implementing аn ПR fi1ter in а software routine, the r 1 operation merely indicates sequential memory locations where input and output sequences are stored.) The ПR fi1ter structure in Figure 6 18 is often called the Direct Farm 1 structure, The time-domain difference equation describing the general Mth-order ПR filter, having N feed forward stages and М feedback stages, in Figure 6-18 is у(п) = Ь(О)х(п) + Ь(l)х(п  1) + Ь(2)х(п  2) + ,., + b(N)x(n  N) r- +a(1)y(п1)+a(2)y(п2)+..,+a(M)y(пM) (621) Time domain expression for an Mth-order IIR filter In tЛе zdomain, that ПR fi1ter's output can Ье expressed Ьу Y(z) = b(O)X(z) + b(l)X(z)Zl + Ь(2)х(ф2 + ... + b(N)X(z)zN + a(l)Y(z)zl + a(2)Y(z)z2 + ..' + a(M)Y(z)zM , (6-22) where Y(z) and X(z) represent the ztransform of у(п) and х(п), Look Eqs. (621) and (622) over carefully and see how the unit time delays translate х(п) у(п) Ь(2} а(2} Ь(М а(М) Flgure 6.18 Generol (Dlrect Form 1) structure of оп Mth-order IIR fllter. hovlng N feed forword stoges ond М feedbock stoges. wlth the z  1 operotor indlcotlng о unlt time deloy, 
The z-Traпsforт 245 to negative powers of z in the zdomain expression. А more compact form for Y(z) is z-domain expression for an N М Mth-order IIR filter:  Y(z) = X(z) Lb(k)zk + Y(z) La(k)zk . (623) k=O k=l ок, now we've arrived at the point where we сап describe the transfer function of а general ПR fi1ter, Rеапаnging Eq. (623) to collect like terms, Y(Z{l a(k)zk]=X(Z)b(k)zk. (6-24) Finally, we define the fi1ter'sz-domain transfer functionasНCz) = Y(z)/X(z), where НCz) is given Ьу z.domain transfer function of an Mth-order IIR filter:  N Lb(k)zk НCz) = Y(z) = k=O X ( z ) М 1  La(k)zk k=1 (625) Gust like Laplace transfer functions, the order of our zdomain transfer function is defined Ьу the largest exponential order of z in the denominator, in this case М.) Equation (&-25) tel1s us all we need to know about an ПR ы- ter. We can evaluate the denominator of Eq. (&-25) to determine the posi- tions of the filter's poles оп the zplane indicating the filter's stability, Remember, now, just as the Laplace transfer function H(s) in Eq. (6-9) was а complex-valued surface оп the splane, H(z) is а complex-valued surface above, or below, the zplane. The intersection of that H(z) surface and the perimeter of а cylinder representing the z = &00 unit circle is the ш- ter's complex frequency response. This means that substituting ejOO for z in Eq. (6-25)'s transfer function gives us the expression for the filter's НпR(О)) frequency response as Frequency response of an Mth-order IIR filter filter (exponential form):  N Lb(k)ejkOO Н ПR (О)) = H(Z)!z=e i " = k= . (6-26) 1 La(k)ejkOO k=l 
246 /пfiпitе /mpu/se Respoпse F//ters Let's a1ter the form of Eq, (626) to obtain more useful expressions for Н1ш(оо)'s frequency magnitude and phase responses. Because а typical ПR fi1ter frequency response НпR(оо) is the ratio of two complex functions, we сап express НпR(оо) in its equivalent rectangular form as N 2,.b(k). [cos(koo) j sin(koo)] Н ( ) k=O ПR 00 = м 1  2,.a(k). [cos(koo)  j sin(koo)] k=l (6-27) or Frequency response of an Mth-order IIR filter (rectangular form):  N N 2,.b(k). cos(koo)  j2,.b(k). sin(koo) Н ( r,, )  k=O k=O ПRUI М М 1 2,.a(k).cos(koo)+ j2,.a(k).sin(koo) k=l k=l (6-28) H's usually easier and, certainly, more useful, to consider the complex frequency response expression in terms of its magnitude and phase. Let's do this Ьу representing the nиmerator and denominator in Eq. (628) as two complex functions of radian frequency 00, Calling the nиmerator of Eq, (6-28) Num(oo), then, Num(oo) = Numreai(oo) + jNumimag(oo) , (6-29) where N Numreai (00) = 2,.b(k). cos(koo) , k=O and N Numimag(oo) =  2,.b(k). sin(koo) k=O (6-30) Likewise, the denominator in Eq. (6-28) сап Ье expressed as Deп(oo) = Deпreai(oo) + jDeпimag(oo) , (6-31) 
The z-Troпsforт 247 where м Deпr.al(ro)=I La(k)oCOS(kro), k;l and м Denimag(ro) = La(k) о sin(kro) k;l (632) Тhese Num(ro) and Den(ro) definitions allow us to represent H IIR (ro) in the more sirnple forms of н (ro) = Num(ro) lIR Den(ro) Numrea!(ro)+ jNumimag(ro) Denrea!(ro)+ jDeпimag(ro) (6-33) = I Num(ro) I L0Num(ro) I Deп(ro) I L0Den(ro) (6-33') Given the form in Eq, (6--33) and the rules for dividing оnе complex пит- ber Ьу another, provided Ьу Eqs. (А-2) and (А-19') inAppendixA, the fre- quency magnitude response of а general IIR filter is I Num(ro) I  [Numreal (ro)] 1 + [Numimag(ro)] 1 I НпR(ro) 1= = (634) lDen(ro) I  [Denrea!(ro)] 1 + [Denimag(ro)] 2 Furthermore, the filter's phase response 0 пR (ro) is the phase of the numer ator minus the phase of the denominator, or в'ПR(ro) = 0Num(ro)0Den(ro) l ( NUmimag(ro) ) l ( Denimag(ro) ) = tan  tan Num rea ! (ro) Den rea ! (ro) ( 6--35) 
248 /пfiпi1e /тpи/se Respoпse Fllters То reiterate our intent here, we've gone through the above algebraic gym nastics to develop expressions for ап IIR filter's frequency magnitude response I H1IR(0)) I and phase response "'IIR(O)) in terms of the filter coef ficients in Eqs. (630) and (632), 5hortly, we'll use these expressions to anal yze ап actual IIR filter. Pausing а moment to gather our thoughts, we realize that we can use Eqs. (6-34) and (635) to compute the magnitude and phase response of IIR filters as а function of the frequency 00. And again, just what is О)? It's the I10rmalized radian frequency represented Ьу the angle around the unit circle in Figure 6-13, having а range о! 7t $; О) $; +7t, In terms of а discrete sampling frequency 0). measured in radians/s, from Figure &-14, we see that О) covers the range 0)./2 $; О) $; +0)/2, In terrns of ош old friend f. Нz, Eqs. (634) and (635) apply over the equivalent frequency range of fs/2 to +1./2 Hz. 50, for example, if digital data is arriving at the filter's input at а rate off s = 1000 samples/s, we could use Eq, (634) to plot the fi1ter's frequency magnitude response over the frequency range of 500 Hz to +500 Hz, Although the equations describing the transfer function НпR(О)), its magnitude response I H1IR(0)) 1, and phase response "'ПR(О)) look some what complicated at first glance, let's illustrate their simplicity and utility Ьу analyzing the simple secondorder lowpass IIR filter in Figure 619 whose positive cutoff frequency is 0)./10, Ву inspection, we can write the filter's timedomain difference equation as х(п) 0,0605 ....(),436 Flgure 6-19 Secondorder lowpass IIR filter example, 
The z-Traпsforт 24 у(п) = 0.0605. х(п) + 0.121. х(п  1) + 0,0605. х(п  2) +l,194'y(п1)O,436'y(п2) , (6--36) or the zdomain expression as Y(z) = 0.0605. X(z) + 0.121. X(Z)Z1 + 0,0605. X(z)z2 + 1.194. Y(Z)Z1  0.436. Y(z)z2 . (637) Using Eq. (625), we write the z-domain transfer function H(z) as н(z) = Y(z) = 0,0605. zO + 0.121. Z1 + 0.0605. z2 X(z) 1  1,194. Z1 + 0.436. Z2 (638) Replacing z with ei ro , we see that the frequency response of our example IIR fil ter is н  O,0605'ejoro +0.121'ejlro +O,0605.ej2ro ПR (оо)  1  1.194. ejlro + 0.436. ej2ro ( 639) We're a1most there, Remembering Euler's equations and that cos(O) = 1 and sin(O) = О, we сап write the rectangular form of НпR(ro) as н (00)= O,0605+0,121'cos(loo)+O,0605'cos(200) j[O,121,sin(lOO)+O,0605'sin(200)] , (6-40) ПR 1  1,194, cos(1ro) + 0,436' cos(2oo)+ j[l,194' sin(loo) 0,436 .sin(2oo)] Equation (640) is what we're after here, and if we calculate its magnitude over the frequency range of п::;; оо::;; п, we get the ! НпR(ro) I shown as the solid curve in Figure 620(a). For comparison purposes we also show а 5 tap lowpass FIR filter magnitude response in Figure 620(a). Although both filters require the same computational workload, five mu1tiplications per filter output sample, the 10wpass IIR filter has the superior frequency magnitude response, Notice the steeper rolloff and 10wer sidelobes of the IIR filter relative to the FIR fi1ter,t t То make this ПR and FIR filter comparison valid, the coeffidents used for both filters were chosen so that еасЬ filter would approximate the ideallow-pass frequency response shown in Figure 5-17(а), 
250 /пflпne /mpu/se Respoпse Filters (а)  IH 11R (w)1 for the IIR filter , IH F1R (т)1 for а 5-tap FIR filter \/ ,«,««А OJ=4t HJ2) OJ = --ТrJ2 (/4) о w =1tI4 OJ =1f12 ('s/8) (/4) OJ =1t OJ (f 5/2) (Ь) "'IR (т) for the 11 R filter у' "" ' I ',,- ; I ',- . " l "" OJ = 'JJ OJ = --ТrJ2 Hi 2 ) (/4) Degrees 180 90 (5 14 ) OJ =1f12 (fs/2) I"''P =1t  J I ! ' / "FIR (т) for а 5-tap FIR filter OJ 180 Flgure 6-20 Frequency responses of the example IIR filter (solid liпe) in Flgure 6-19 and а 5-tap FIR filter (dashed line): (а) magnitude responses; (Ь) phase responses, А word of waming here. It' s easy to reverse some of the signs for the terms in the denorninator of Eq. (6-40), so Ье careful if уои attempt these ca1culations at home. 50те authors avoid this problem Ьу showing the a(k) coefficients in Figure 18 as negative values, so that the summation in the denominator of Eq. (6-25) is always positive. Moreover, some сот- mercial software IIR design routines provide a(k) coefficients whose signs must Ье reversed before they сan Ье applied to the IIR structure in Figure  18. (Н, while using software routines to design or analyze IIR filters, your results are very strange or unexpected, the first thing to do is reverse the signs of the a(k) coefficients and see if that doesn't solve the problem.) The solid curve in Figure 6-20(Ь) is our IIR filter's "'ПR(ro) phase response, Notice its nonlinearity relative to the FIR filter's phase response. (Remember now, we're only interested in the filter phase responses over the low-pass filters' passband, 50 those phase discontinu- ities for the FIR filter are of по consequence.) Phase nonlinearity is inher- ent in IIR filters and, based оп the ill effects of non1inear phase introduced in the group delay discussion о! 5ection 5,8, we must carefully consider its implications whenever we decide to use an IIR fi1ter instead of an FIR 
The z- Traпsforт 251 filter in any given application. Тhe question anу filter designer must ask and answer, is "How тиф phase distortion сan 1 tolerate to realize the benefits of the reduced computationalload and high data rates afforded Ьу IIR filters?" We've arrived at an appropriate point to illustrate an important rela- tionship between IIR and FIR filters. We сап use our IIR analysis equa- tions to characterize FIR filters. Notice that, if there were по feedback coefficients in Figure 618, equivalent to setting а(l) through а(М) in Eq. (6-21) а11 to zero, we'd have an Ntap FIR filter. Тhis simplifies Eqs. (6-25) through (628) because their denominators would Ье equal to one. In addition, Den(O)) in Eq. (6-33) and I Den(O)) I in Eq. (6-34) would both Ье unity, and "'Оеn(О)) would Ье zero in Eq. (6-35). Тhus, for an FIR filter, with the a(k) coefficients in Figure 6 18 being а11 zeros, we сап rewrite Eqs. (6-26) and (6-28) as Frequency response of an N-stage FIR filter (exponential form):  N H FIR (О)) = Lb(k)ejkro, k=O (641) and Frequency response of an N-stage FlR filter (rectangular form):  N N H F1R (O)) = Lb(k)'cos(kO))jLb(k)'sin(kO)) . k=O k=O ( 6 42) Just as in Eqs. (6-34) and (6-35), the о) in Eqs. (6-41) and (6-42), is the normalized radian frequency represented Ьу the angle around the unit circle in Figure 6-13, having а range of л  о)  +Л, corresponding to the equivalent frequency range of fJ2 to +fJ2 Hz. 6.3.3 А" Improved IIR Fllter Structure Тhe structure of the I1R filter in Figure 6-18 сan Ье converted to а more efficient and popular form. It's easy to explore this idea Ьу assuming that there are an equal number of feed forward and feedback stages, letting М = N in Figure 6-18 and thinking of the feed forward and feedback stages as two separate filters, Specifica11y, the b(k) coefficients are used to calculate the sequence d(n) from х(п), and the a(k) coefficients are used to calculate the filter output у(п) sequence from d(n). Because the two halves of the filter are both linear, we сап swap them, as shown in Figure 621(a), with по change in the finаl у(п) output, Of course, after this reorientation, 
252 /пfiп/te /три/sе Respoпse FlJters а("" Ь("" (а) а("" Ь("" (Ь) Flgure 6.21 Rearranged Mhorder IIR fllter structure: (а) feed forward and feedback paths swapped from the structure in Figure 6-3: (Ь) flnal slmplifled Direct Form 11 fllter structure, а new seqиence that we'll call g(п) is generated, The two identical delay paths in Figиre 621(a) provide the motivation for this reorientation. Becaиse the seqиence g(п) is being shifted down along both delay paths in Figиre 6--21(а), we сan eliminate оnе of the paths and arrive at the sim- plified Direct Forт II filter structure shown in Figиre 6-21(Ь). Notice that eliminating а delay path simplifies the strиctиre, so that а hardware implementation would need only half the number of delay storage regis- ters reqиired Ьу the originallIR structиre in Figиre 6-18. Althoиgh the filter strиctиre depicted in Figure 6-21(Ь) is very popиlar, in the literatиre we'll also encoиnter the eqиivalent representation shown in Figure 6-22, It's interesting to compare Figиre 6--22's IIR structиre with the FIR strиcture in Figиre 6-2(а). If the feedback coefficients a(k) in Figиre 6-22 were all zeros, for example, then this ПR filter would Ье eqиivalent to the FIR filter in Figиre 6-2(а) as long as the b(k) I1R coefficients were equal to the h(k) FIR coefficients. It's very important to keep in mind that Eq. (6-21), associated with the IIR structure in Figиre 6-18, does not ехрНс- Юу describe the filter structures in Figures 6-21(Ь) and 6-22. However, the freqиency-domain expressions in Eqs. (6--25) through (6-35) сап Ье иsed to analyze the performance of the popиlar filter structиres in Figures 6-21(Ь) and 6-22, 
The z-Traпsforт 25, g(N) Flgure 6-22 Alternate depiction of the IIR fllter Dlrect Form 11 structure in Figure tr21 (Ь), Ву the way, because о! the feedback nature о! ПR filters, they're some- times rеfепеd to as recursive filters. Similarly, FIR filters are often called пoпrecursive filters. (Тhe term recursive originally signified filters with both poles and zeros оп the complex zplane whereas пoпrecursive signi fied filters with only zeros оп the z-plane.) We'll avoid the terms recursive and пoпrecursive, however, because it's been shown that filters with only zeros сап Ье designed with recursive structures and that filters with both poles and zeros оп the zplane сап Ье designed with nonrecursive struc tures[10]. So the terms recursive and пoпrecursive more correctly apply to the structures used to implement а digital filter, and the terms IIR and FIR better describe whether а filter has only zeros (FIR) or both poles and zeros (ПR) оп the z-plane[l1]. Now that we have а feeling for the performance and implementation structures о! I1R filters, let's briefly introduce three filter design tech- niques. Тhese I1R design methods go Ьу the impressive names of impulse iпvariaпce, biliпear traпsform, and optimized methods, Тhe first two methods use aпalytical techniques to design digital filters that approximate con- tinuous analog filters. t Тhe impulse invariance and bilinear transform I1R design methods both start with а closedform Laplace equation describing the desired analog filter and yield ztransform expressions for the approximating I1R digital filter, Тhe filter designer then solves the ztransform equations to obtain the a(k) and b(k) coefficients for use in the I1R structures in Figures 621(b) or 622, Because analog filter design t Due to its popularity, throughout the rest of this chapter we'lI use the phrase aпa/og fi/ter to designate those filters made ир of resistors, capacitors, and inductors, designed to operate оп continuous signals, 
254 /пfiпJte /тpu/se Respoпse F//ters methods are very well understood, designers сап take advantage of an abundant variety of analog fi1ter design techniques to design, say, а Butterworth fi1ter with its very f1at passband response or, perhaps, go with а Chebyshev fi1ter with its f1uctuating passband response and sharper passbandto--stopband cutoff characteristics, 6.4 Impulse Invariance IIR Filter Design Method Тhe impulse invariance method of IIR filter design is based upon the notion that we сап design а discrete fi1ter whose timedomain impulse response is а sampled version of the impulse response of а continuous analog fi1ter. If that analog fi1ter (often called the prototype filter) has some desired frequency response, then our IIR fi1ter will yield а discrete approximation of that desired response, The impulse response equiva- lence of this design method is depicted in Figure 6-23 where we use the conventional notation of о to represent an impulse function and hP) is the analog fi1ter's impulse response. We use the subscript "с" in Figure 623(a) to emphasize the continuous nature of the analog fi1ter, Figure 623(Ъ) il1ustrates the definition of the discrete fi1ter's impulse response: the filter's timedomain output sequence when the input is а single unity-valued sample (impulse) preceded and followed Ьу аН zerovalued samples. our goal is to design а digital blter whose impulse response is а sampled version of the analog blter's continuous impulse response.lmplied in the correspondence of the continuous and discrete impulse responses is the property that we can тар each pole оп the splane for the analog blter' s   f\ .. Analog \.../ Continuous (а) Filter time *)=0(1)   Hc(s) Impulse response output = hJ!) . :II!I, i . : . ................:............................ IIR Digital .-. . ...-..................... · '8 · Discrete (Ь)  Filter time ж(n) = б(n) H(z) Impulse response output = h(n) = hc(nls) Figure 6-23 Impulse invariance design equivalence of (а) analog filter continuous impulse response; (Ь) digital filter dlscrete impulse response, 
/mpu/se /пvarioпee IfR Filter Deslgп Method 255 Hc(s) transfer function to а pole оп the zplane for the discrete ПR filter's H(z) transfer function. What designers have found is that the impulse invariance method does yield useful ПR filters, as long as the sampling rate is high relative to the bandwidth оЕ the signal to Ье filtered. In other words, IIR fi1ters designed using the impulse invariance method are sиs ceptible to aliasing problems becaиse practical analog fi1ters cannot Ье perfect1y bandlimited. Aliasing wil1 occиr in an ПR filter's freqиency response as shown in Figure 624. From what we've learned in Chapter 2 aboиt the spectral replicating effects оЕ sampling, if Figure 64(a) is the spectrum оЕ the continиoиs hc(t) impиlse response, then the spectrиm оЕ the discrete hc(пt s ) sample seqиence is the replicated spectra in Figure 624(b). (а) А о ... m , (Ь) 2" (2'5) --1t о 1t  211 m (2'5) Н 5 ) ((5) , (с) 2" (2'5) --1t Н 5 ) о 1t  2" m (2'5) ('5) Flgure 6-24 Allosing In the Impulse invorlanee design method: (о) prototype onolog filter mognitude response; (Ь) replieoted mognltude responses where H11R(m) is the diserete Fourler tronsform of h(п) = hc(пt s ); (е) potentiol resu/tont IIR filter mognltude response wlth ollosing effeets, 
256 lпfiпife Impulse Respoпse Fllters In Figure 6-24(с) we show the possible effect of a1iasing where the dashed curve is а desired НпR(ro) frequency magnitude response. However, the actual frequency magnitude response, indicated Ьу the solid curve, сап occur when we use the impulse invariance design method. For this reason, we prefer to make the sample frequency fs as large as possible to minimize the overlap between the primary frequency response curve and its rep1icated images spaced at multiples of :r.fs Hz, То see how a1iasing can affect IIR filters designed with this method, let's 1ist the necessary impulse invariance design steps and then go through а т- ter design example, There are two different methods for designing IIR filters using impulse invariance, Тhe first method, which we'll саН Method 1, requires that an inverse Laplace transform as weH as а z-transform Ье performed[12,13], Тhe second impulse invariance design technique, Method 2, uses а direct substitution process to avoid the inverse Laplace and z-transformations at the ехреnsе of needing partial fraction expansion algebra necessary to handle polynomials[1417], Both of these methods seem comp1icated when described in words, but they're really not as difficult as they sound, Let's compare the two methods Ьу 1isting the steps required for each of them, Тhe impulse invariance design Method 1 goes like this: Method 1, Step 1: Design (or have someone design for уои) а prototype analog fi1ter with the desired frequency response,t Тhe result of this step is а continuous Laplace trans- fer function H/s) expressed as the ratio of two poly- nomials, such as, N L b(k)sk Н (s)= b(N)SN +b(Nl)SNl+..,+b(l)s+b(O)  k:O с a(M)sM + а(М  l)SM-l +... + a(l)s + а(О)  k k k.J а( )s k=O (6-43) which is the general form of Eq, (6-10) with N < М, and a(k) and b(k) are constants. Method 1, Step 2: Determine the analog filter's continuous time- domain impulse response hc(t) from the Hc(s) Laplace t In а low-pass filter design, for example, the filter type (Chebyshev, Butterworth, elliptic), fil- ter order (number of poles), and the cutoff frequency are parameters to Ье defined in this step, 
/тpиlse /пvariaпce J/R Fi/ter Desigп Method 257 transfer function. 1 hope, this сan Ье done using Laplace tables as opposed to actually evaluating an inverse Laplace transform equation, Method 1, Step 3: Determine the digital filter's sampling frequency 1., and calculate the sample period as t. = 1/1., The 1. sampling rate is chosen based оп the absolute fre quency, in Hz, оЕ the prototype analog filter, Because of the aliasing problems associated with this impulse invariance design method, later, we'll see why 1. should Ье made as large as practical, Method 1, Step 4: Find the ztransform оЕ the continuous hc(t) to obtain the IIR filter's zdomain transfer function H(z) in the form of а ratio оЕ polynomials in z. Method 1, Step 5: 5ubstitute the value (not the variable) t. for the con tinuous variable t in the H(z) transfer function obtained in 5tep 4, In performing this step, we are ensuring, as in Figure 6-23, that the IIR fiIter's dis crete h(n) impulse response is а sampled version of the continuous filter's hc(t) impulse response so that h(n) = hc(nt.), for О S; п S; 00. Method 1, Step 6: Our н(z) from 5tep 5 will now Ье оЕ the general form N Lb(k)zk н(z) = b(N)zN + b(N  l)Z(Nl) +... + b(l)zl + Ь(О) = k=O , (6-44) a(M)zM+ а(М  l)z(Ml) +... + a(l)zl + а(О)  k 1 ""La(k)z k=l Because the process of sampling the continuous impulse response results in а digital filter frequency response that's scaled Ьу а factor of l/t., тanу fiIter designers find it appropriate to include the t. factor in Eq. (6-44). 50 we сan rewrite Eq. (6-44) as N <Lb(k)Zk Н(z) = Y(z) = k=O X ( z ) М 1 La(k)Zk k=l (64S) 
258 /пfiп/te /mpu/se Respoпse FlJters 1ncorporating the value of ' . in Eq. (645), then, makes the 1IR fi1ter timeresponse scaling indepen dent of the sampling rate, and the discrete filter wi11 have the same gain as the prototype analog filter. t Method 1, Step 7: Because Eq. (644) is in the form of Eq. (6-25), Ьу .inspection, we сап express the filter' s timedomain difference equation in the general form of Eq. (621) as у(п) = Ь(О)х(п) + b(l)x(n 1) + Ь(2)х(п  2) + '.' + b(N)x(n  N) + a(l)y(n  1) +а(2)у(п  2) + ... + а(М)у(п  М) . (6--46) Choosing to incorporate t s ' as in Eq. (645), to make the digital filter's gain equal to the prototype analog filter's gain, Ьу multiplying the b(k) coefficients Ьу the sample period t s ' leads to an IIR filter time- domain expression of the [олn у(п) = t s . [Ь(о)х(п) + b(l)x(n  1) + Ь(2)х(п  2) + '" + b(N)x(n  N)] + а(l)у(п  1) + а(2)у(п  2) + ...н(М)у(п  М). (6--47) Notice how the signs changed for the a(k) соеШ cients from Eqs, (6-44) and (645) to Eqs. (646) and (б47). These sign changes always seem to cause problems for beginners, so watch out. AIso, keep in mind that the time-domain expressions in Eq, (6--46) and Eq. (647) apply only to the filter struc ture in Figure 6-18. The a(k) and b(k), or t s . b(k), coef- ficients, however, сап Ье applied to the improved ПR structure shown in Figure 622 to complete our design. Before we go through an actual example of this design process, let's dis cuss the other impulse invariance design method, t Some authors have chosen to include the t s factor in the discrete h(n) impuJse response in the above Step 4; that is, make h(n) = tЛ(пt s ) [14, 18], Тhe final result of this, of course, is the same as that obtaтed Ьу including t s as described in Step 5, - 
/тpu/se /пvariaпce I/R Filter Desigп Method 259 М-роlе a"alog prototype II"er хи) N r M Lb(k)sk :[B{k)sk О О уЩ n PartiaJ lractio" expa"d \1 ф Х(п) X(t) Perform substitutio" Х(п) n Algebraically сотЫ"е V t. b(k)zk/ f.B{k)zk о ;7 о М-роlе discrete НА filter у(п) Flgure 6-25 Mathematlcal ftow ot the impulse Invarlance design Method 2, The impulse invariance Design Method 2, also cal1ed the standard z-transfoпn method, takes а different approach, It mathematical1y parti- tions the prototype analog filter into mu1tiple singlepole continuous filters and then approximates each one of those Ьу а single-pole digital filter, The set of М single-pole digital filters is then algebraically combined to form an M-pole, Mth-ordered IIR filter, Тhis process of breaking the analog filter to discrete filter approximation into manageable pieces is shown in Figure 6 25, The steps necessary to perform an impulse invariance Method 2 design are Method 2, Step 1: Obtain the Laplace transfer function Hc(s) for the pro- totype analog filter in the [oпn of Eq, (643), (Same as Method 1, Step 1.) Method 2, Step 2: Se1ect an appropriate sampling frequency f. and cal- culate the sample period as t 5 = 1//5' (Same as Method 1, Step 3,) . 
260 /пfiпite /тpu/se Respoпse Filters Method 2, Step 3: Express the analog fi1ter's Laplace transfer function His) as the sum of single-pole filters, Тhis requires us to use partial fraction expansion methods to express the ratio of polynomials in Eq, (643) in the form of н (s) = b(N)sN + b(N  l)sNl + ...+ b(l)s + Ь(О) с a(M)sM +a(Ml)sMl +..,+a(l)s+a(O)  А А А А = =+.............L.+...+............м.., (648) k;l s+Pk s+Pl s+P2 s+PM where the individual Ak factors are constants and the kth pole is located at Pk оп the splane, We'll denote the kth single-pole analog filter as Hk(s), or А Hk(S)= . S+Pk (6--49) Method 2, Step 4: 5ubstitute 1  ePkt, Zl for s + Pk in Eq. (6-48). This mapping of each Hk(s) pole, located at s = Pk оп the s-plane, to the z = ePkt, location оп the z-plane is how we approximate the impulse response of each single-- pole analog filter Ьу а single--pole digital filter. (Тhe reader сап find the derivation of this 1  e-р'Zl sub stitution, illustrated in our Figure 625, in references [14] through [16].) 50, the kth analog single--pole filter Hk(s) is approximated Ьу а singlepole digital fi1ter whose z-domain transfer function is н ( z )  Ak k  1  Pk t 1 e 'Z ( 650) The final combined discrete fi1ter transfer function H(z) is the sum of the single--poled discrete filters, or м м А Н(z) = LHk(Z) = L pt, 1 ' (651) k;l k;l 1  е z 
/тpu/se /пvariaпce I/R Filter Desigп Method 261 Кеер in mind that the above н(z) is not а funetion of time, Тhe t s faetor in Eq. (651) is а eonstant equal to the discretetime sample period. Method 2, Step 5: Calculate the zdomain transfer ЕипеНоп of the sum of the М singlepole digital filters in the form of а ratio of two polynomials in z, Beeause the H(z) in Eq. (651) will Ье а series of fraetions, we'll have to еотЬinе those fraetions over а еоттоп denomina- tor to get а single ratio of polynomials in the [aтH iar form of N L b(k)z k Н(z) = Y(z) = k='h X(z) 1  L a(k)zk k=l (652) Method 2, Step б: Just as in Method 1 Step 6, Ьу inspeetion, we еап express thE! filter's time--domain equation in the gen eral form of у(п) = Ь(О)х(п) + Ь(1)х(п  1) + Ь(2)х(п  2) + ..' + b(N)x(n  N) + а(1)у(п  1) + а(2)у(п  2) +.., +а(М)у(п  М) . (653) Again, поНее the a(k) eoeffieient sign ehanges from Eq. (652) to Eq, (653), As deseribed in Method 1 Steps 6 and 7, if we ehoose to make the digital filter's gain equal to the prototype analog filter's gain Ьу multiplying the b(k) eoeffieients Ьу the sample period t., then the IIR filter's timedomain expression will Ье in the form у(п) = t. . [Ь(О)х(п) + Ь(1)х(п  1) + Ь(2)х(п  2) +.., + b(N)x(n  N)] +a(1)y(п1)+a(2)y(п2)+,.,+a(M)y(пM), (6--54) yielding а final Н(z) zdomain transfer funetion of 
262 /пfiпffe /три/5е Re5poп5e Filter5 N t s . Lb(k)zk н(z) = Y(z) = kO X ( z ) М 1 La(k)zk kl (654') Finally, we сап implement the improved IIR structure shown in Figure 622 using the a(k) and b(k) соеЮ cients from Eq. (653) or the a(k) and t s ' b(k) соеШ- cients from Eq, (654). То provide а more meaningful comparison between the two impulse invariance design methods, let's dive in and go through an I1R filter design example using both methods, 6.4. 1 Impulse Invarlance Design Method 1 Example Assиme that we need to design an I1R fi1ter that approximates а second- order Chebyshev prototype analog low-pass fi1ter whose passband ripple is 1 dБ, Our f. sampling rate is 100 Hz (ts = 0,01), and the fi1ter's 1 dБ cut off frequency is 20 Hz, Our prototype analog fi1ter will have а frequency magnitude response like that shown in Figure 626. Given the аЬоуе fi1ter requirements, assume that the analog prototype fi1ter design effort results in the Hc(s) Laplace transfer function of Hc(s) = 17410.145 s2 + 137.94536s + 17410.145 (655 ) It's the transfer function in Eq. (6-55) that we intend to approximate with our discrete ПR fi1ter, То find the analog fi1ter's impulse response, we'd IHdB(f)1 OdB о 20Нz 50Hz ((5/2) Freq Flgure 6-26 Frequency magnitude respoпse of the example prototype analog fllter, 
/тpи/se /пvor/oпce I/R Fllter Desigп Method 263 like to get Н с (5) into а form that allows us to use Laplace transform tables to find hc(t). Searching through systems analysis textbooks we find the fol- lowing Laplace transform pair: Х(5), Laplace traпsform о! x(t) : А<о (5 + ai + <02 x(t) : AelX! . sin( <о t) . (6-56) our intent, then, is to modify Eq. (6-55) to get it into the form оп the left side о! Eq. (656). We do this Ьу realizing that the Laplace transform expression in Eq. (656) сап Ье rewritten as А<о (5+ai +<02 А<о 52 +2а5+а.2 +<02 (6-57) If we set Eq. (6-55) equal to the right side о! Eq. (6-57), we сап solve for А, а, and <о. Doing that, н 5  17410,145 с( )  52 + 137.945365 + 17410.145 А<о 52 +2а5+а 2 +<02 (6-58) Solving Eq. (6-58) for А, а, and <о, we first find а = 137.94536 = 68.972680 ; 2 (659) а 2 + <02 = 17410,145 , (6-60) so <о = .,J 17410.145 a2 = 112.485173; (6-61) and А = 17410.145 = 154.77724 . <о (6-62 ) ок, we сап now express Н с (5) in the desired form о! the left side о! Eq. (6-57) as 
264 /пflnite /mpu/se Respoпse F//ters н 5  (154.77724)(112,485173) . с( )  (5 + 68.972680)2 + (112.48517з)2 (63) Using the Laplace transform pair in Eq. (&-56), the timedomain impulse response of the prototype analog filter becomes hc(t) = Aeal . sin(cot) = 154,77724e,9726801 . sin(112.485173t) . (664) OK we're ready to perform Method 1, Step 4, to determine the discrete IIR filter's zdomain transfer function н(z) Ьу performing the ztransform of hc(t). Again, scanning through digital signal processing textbooks or а good math reference book, we find the following z-transform pair where the timedomain expression is in the same form as Eq, (6-64)'s hc(t) impulse response: x(t) : X(z), z  transform of x(t) : Се a! . sin( ф t)z  1 12[eal 'СОS(фt)]zl +e2alz2 (6-65) Се a! . sin( фt) Remember now, the а and ф in Eq. (665) are generic and are not related to the а and ф values in Eq. (659) and Eq. (661). Substituting the con- stants from Eq. (664) into the right side of Eq. (665), we get the ztransform of the IIR fi1ter as н 154. 77724е 68,9726801 . sin(112.485173t)z 1 (z) = 1 2[e,9726801 . cos(112.485173t)]Z1 +e2'68'972680IZ2 (6-66) Performing Method 1, Step 5, we substitute the t s value of 0,01 for the con- tinuous variable t in Eq. (666), yielding the final н(z) transfer function of н 154.77724e,972680'O,Ol . sin(1l2.48S173. 0.01)Z1 (z) = 1  2[e68.972680,oт . cos(1l2,485173. O,Ol)]Zl +e2'68.972680'0.D1Z2 154.77724 е ..о,68972680. sin(l.l248517з)z1 = 1  2[е..о,68972680 . соs(1.1248517з)]z1 +e2'O,68972680z2  Y(z)  70.059517z1  X(z)  1O,43278805z1 +O,25171605z2 (&-67) 
/mpu/se /пvariaпce J/R Filter Desigп Method 265 ОК, hang in there, we're almost finished. Here are the final steps of Method 1, Because of the transfer function H(z) = Y(z)/X(z), we сап crOss- multiply the denominators to rewrite the bottom line of Eq, (6-67) as Y(z). (1  0.43278805z1 + 0.25171605z2) = X(z). (70,059517z1) , or Y(z) = 70,059517. X(Z)Zl + 0.43278805. Y(Z)Zl  0,25171605' y(z)z2, (668) Ву inspection of Eq, (668), we сап now get the time-domain expression for our IIR filter. Performing Method 1, Steps 6 and 7, we mu1tiply the x(пl) coefficient Ьу the sample period value of t s = 0,01 to allow for proper scaling as у(п) = 0,01.70,059517. х(п  1) + 0.43278805. у(п  1)  0,25171605' у(п  2) = 0,70059517. х(п  1) +0,43278805. у(п  1)O,25171605. у(п  2), (6-69) and there we (Нnаllу) are. The coefficients from Eq, (6-69) are what we use in implementing the improved I1R structure shown in Figure 6-22 to approximate the original secondorder Chebyshev analog low-pass filter, Let's see if we get the same resu1t if we use the impulse invariance design Method 2 to approximate the example prototype analog filter, 6.4.2 Impulse Invariance Design Method 2 Example Given the original prototype filter's Laplace transfer function as н 17410,145 с(5) = i + 137.945365 + 17410.145 ' (670) and the value of t s = 0.01 for the sample period, we're ready to proceed with Method 2's Step 3, То express Нс(5) as the sum of single-pole filters, we'll have to factor the denominator of Eq, (670) and use partial fraction expansion methods, For соnуеniеnсе, let's start Ьу replacing the constants in Eq, (6-70) with variables in the form of с нс(s) = 2 ' 5 + Ь5 + с (6-71) 
266 /пflпПе /mpu/se Respoпse F//ters where Ь::: 137.94536, and С::: 17410,145. Next, using Eq, (6-15) with а::: 1, we сап factor the quadratic denominator of Eq, (6-71) into He(s)::: [ ) С [ ) . ь ь 2  4с Ь ь 2  4с B+2+  4 . B+2 ) 4 (6-72) If we substitute the vaIues for Ь and С in Eq, (6-72), we'lI find that the quantity under the radicaI sign is negative, Тhis means that the factors in the denominator of Eq. (6-72) are compIex, Because we have lots of aIge- bra ahead of us, Iet's repIace the radicals in Eq. (6-72) with the imaginary termjR, wherej::: Н and R::: I (1J24c)/41, such that С Не(В) = (в+Ь/2+ jR)(s+b/2 jR) (6-73) ок, partial fraction expansion methods alIow us to partition Eq. (6-73) into two separate fractions of the form . С Н (В)= е (НЬ/2+ jR)(s+b/2 jR) К} К 2 = + , (в+Ь/2+ jR) (B+b/2 jR) (6-74) where the К} constant сan Ье found to Ье equaI to jc/2R and constant К 2 is the compIex conjugate of К}I or К 2 = jc/2R. (То Ieam the details of par- tiaI fraction expansion methods, the interested reader shouId investigate standard coIIege algebra or engineering mathematics textbooks.) Тhus, Не(в) сап Ье of the form in Eq. (6-48) or н s  jc/2R jc/2R е( ) (НЬ/2+ jR) + (B+b/2 jR) (6-75) We сап see from Eq. (6-75) that our second-order prototype fiIter has two poIes, опе Iocated at р} = b/2  jR and the other at Р2 ::: Ы2 + jR. We're now ready to тар those two poIes from the s-plane to the z-рIапе as caIled out in Method 2, Step 4. Making our 1  eP*',Z'"'} substitиtion for the S +Pk terms in Eq. (6-75), we have the foIIowing expression for the z-domain singIe-роIе digital filters, I 
/mpu/se /пvar/aпce //R F//ter Des/gп Method 267 Н J 'c/2R  J 'c/2R (z)  +  1e(b/2+jR)t'z1 1e(b/2JR)t,z1' (6-76) Our objective in Method 2, Step 5 is to massage Eq. (676) into the form of Eq. (652), so that We can determine the IIR filter's feed forward and feed- back coefficients. Putting both fractions in Eq. (676) over а common denominator gives us  ис /2R}(1  e(b/2jR)t, Z-I)  ис /2R)(l  e(b!2+jR)t, z-l) H(z) (1e(b/2+jR)t'z1}(1e(b/2jR)t'z1) , (6 77) Collecting like terms in the numerator and multiplying out the denomi nator gives us ис /2R}(1  e(b/2jR)t, Z1  1 + e(b!2+jR)t, ZI) H(z) = lе(Ь/2jR)t'z-1 e(b/2+jR)t'z1 +ebt,z-' (678) Factoring the exponentials and collecting like terms of powers of z in Eq. (678),  (jc /2R)(e(b!2+jR)t,  e(b/2jR)t, )Zl H(z)  1  (e(b/2jR)t, + e(b!2+jR)t, )Zl + eЫ, Z2 (6-79) Continuing to simplify our Н(z) expression Ьу factoring out the real part of the exponentials, (jc/2R)ebt, !2(ejRt, ejRt, )Zl Н(z)= " 1ebt,/2(eJRt, +eJRt, )Zl +ebt'z2 (680) We now have Н(z) in а form with all the like powers of z combined into sin gle terms, and Eq, (680) looks something like the desired form of Eq. (652), Кnowingthatthe final coefficients of our IIR filter must Ье real num- bers, the question is "What do we do with those imaginary j terms in Eq. (680)?" Once again, Euler to the rescue,+ Using Euler's equations for sinu soids, we can eliminate the imaginary exponentials and Eq. (80) becomes + From Euler, we know that sin(0) = (J0  ej0)/2j, and COS(0) = (ei'" + ej0)/2, I 
268 /nfJnite /тpu/se Respoпse F/lters ( J 'C / 2R ) ebt. /2[2 J ' sin ( Rt ) ]Zl н(z) == s 1 ebt. /2[2cos(Rts)Jz1 +eЫ. Z2  (С/ R)ebt./2[sin(Rts)Jz1  1  ebt. /2[2cos(Rts)Jz1 + eЫ. Z2 (&-81) If we plug the values С == 17410.145, Ь == 137.94536, R == 112.48517, aпd t s == 0.01 into Eq. (6-81), we get the following I1R filter transfer function: н (z) == (154.77724) (0.50171312) (0.902203655)z 1 1  (0.50171312) (0.86262058)z1 + 0.25171605z2 70.059517z1  1О,4З278805z1 +0.25171605z2 (682) Весаше the transfer function н(z) == Y(z)/X(z), we сап again crossmu1tiply the denominators to rewrite Eq. (&-82) as Y(z). (1  О,4З278805z1 +0.25171605z2) = X(z). (70.o59517z1) , or Y(z) == 70,059517 . х(ф1 + 0.43278805. Y(Z)Zl  0,25171605. у(ф2 . (683) Now we take the inverse ztransform of Eq. (683), Ьу inspection, to get the timedomain expression for our I1R fi1ter as у(п) == 70.059517. x(п 1) + 0.43278805. y(п 1)  0,25171605. у(п  2) , (&-84) Onе final step remains, То force the IIR fi1ter gain equal to the prototype analog fi1ter's gain, we mиlНрlу the x(пl) coefficient Ьу the sample period t s as suggested in Method 2, Step 6. In this case, there's only оnе х(п) coefficient, giving us у(п) == 0.01.70.059517' х(п  1) + 0.43278805. у(п  1)  0,25171605' у(п  2) == 0,70059517. х(п  1) + 0.43278805' у(п  1)  0.25171605. у(п  2), (&-85) . 
/три/5в /пvariaпce J/R FiJter De5/gп Method 269 plane z-plane Imag(s) Imag(Z) Stabl. Unstable region region * .,  +jR (а) -, Ы2 Real( s) ReaI(Z) )(. jR 'Н(I in dB о -2 -4 (Ь) -6 -8 О 20 Hz 50 Hz Freq (',12) Flgure 6-27 Impulse Invariance design example fllter characteristics: (а) s-plane pole locatlons of prototype analog fllter and z-plane pole locatlons of discrete IIR fllter: (ь) frequency magnltude response of the d;screte IIR fllter, that compares wel1 with the Method 1 result in Eq. (6-69). (1sn't it сот- forting to work а problem two different ways and get the same result?) Figure 6-27 shows, in graphical form, the result о! our ПR design ехат- ple, The s-plane pole locations о! the prototype filter and the z-plane poles о! the ПR filter are shown in Figure 6-27(а), Because the s-plane poles are to the left о! the origin and the z-plane poles are inside the unit circle, both the prototype analog and the discrete llR filters are stable, We find the prototype filter's s-plane pole locations Ьу evaluating Hc(s) in Eq, (6-75), When s = b/2  jR, the denominator о! the first term in Eq, (675) becomes zero and H/s) is infinitely large, That s = b/2  jR value is the location о! the lower s-plane pole in Figure 6-27(а). When s = b /2 + jR the denominator о! the second term in Eq, (6-75) becomes zero and s = b/2 + jR is the location о! the second s-plane pole, The 1IR filter's z-plane pole locations are found from Eq, (6-76). If we multiply the numerators and denominators о! Eq, (676) Ьу z, 
270 lпflnlte lтриlsе Respoпse Filters н(z),!..= z(jc/2R) + z(jc/2R) z z(1e(b/2+JR)t'z1) z(1e(bI2JR)t'z1) (jc/2R)z (jc/2R)z ze(bI2+jR)t, + ze(b/2jR)t, (6-86) In Eq, (6-86), when z is set equal to e(b!2 + jR)t" the denominator оЕ the first term in Eq, (6-86) becomes zero and н(z) becomes infinitely large. The value of z оЕ z=e(bI2+jR)t, =ebt,/2ejRt, =ebt,/2LRt radians s (6-87) defines the location оЕ the lower z-plane pole in Figure 6-27(а), SpecificalIy, this lower pole is located at а distance оЕ с Ы ,/2 = 0.5017 from the origin, at an angle оЕ е = Rts radians, or --64.450, Being conjugate poles, the upper z-plane роlе is located the same distance from the origin at an angle оЕ е = Rt s radians, or +64.450, Figure 6--27(Ь) illustrates the fre- quency magnitude response of the ПR filter in Hz, Two different implementations оЕ our I1R filter are shown in Figure 6-28, Figure 6-28(а) is an implementation оЕ our second-order I1R filter based оп the generallIR structure given in Figure 6-22, and Figure 6-28(Ь) shows the second-order IIR filter implementation based оп the alternate structure from Figure 6-21(Ь), Кnowing that the Ь(О) coefficient оп the left side оЕ Figure 6-28(Ь) is zero, we arrive at the simp1ified struc- ture оп the right side оЕ Figure 6-28(Ь), Looking carefulIy at Figure 6-28(а) and the right side оЕ Figure 6-28(Ь), we сап see that they are equivalent. Although both impulse invariance design methods are covered in the literature, we might ask, "Which one is preferred?" There's по definite answer to that question because it depends оп the HC<s) оЕ the prototype analog filter, Although our Method 2 ехатрlе аЬоуе required more algebra than Method 1, if the prototype filter's s-domain poles were located on1y оп the real axis, Method 2 would have been much simpler because there would Ье по сотрlех variables to manipulate, In general, Method 2 is more popular for two reasons: (1) the inverse Laplace and z-transformations, although straightforward in our Method 1 example, сап Ье very difficult for higher-order filters, and (2) unlike Method 1, Method 2 сап Ье coded in а software routine or а computer spreadsheet, Upon examining the frequency magnitude response in Figure 6-27(Ь), we сап see that this second-order IIR filter's roll-off is not particularly 
/тpu/se /пvariaпce J/R Filter Desigп Method 271 (а) Ь(1) (Ь) а(2) Ь(1) = 0.70059517 а(1) = 0.43278805 а(2) = -0,25171605 у(п) у(п) F/gure 6-28 lтpleтentations of the lтpulse invariaпce deslgn example filter, а(2) steep, This is, admittedly, а simple loworder filter, but it's attenuation slope is БО gradual that it doesn't appear to Ье оЕ much use аБ а lowpass filter,t We сan also Бее that the filter's passband ripple is greater than the desired value оЕ 1 dB in Figиre 626, What we'll find is that it's not the low order оЕ the fiIter that contributes to it's poor performance, but the sam pling rate used, Тhat secondorder IIR filter response is repeated аБ the shaded curve in Figure 629, If we increased the sampling rate to 200 Hz, we' d get the frequency response shown Ьу the dashed curve in Figure 6.29, Increasing the sampling rate to 400 Hz results in the тит improved frequency response indicated Ьу the solid linе in the figure, Sampling rate changes do not affect our filter order or implementation structure, Remember, if we change the sampling rate, only the sample period t s changes in our design equations, resulting in а different set оЕ filter t А piece of advice. Whenever уои encounter аnу frequency representation (ье it а digita! fil- ter magnitude response or а signa! spectrum) that has nonzero values at +1.12, Ье suspi- cious----be very suspicious----that aliasing is taking р!асе, 
. 272 /пffпlte /mpu/se Respoпse F/Jters IH(f)1 1 0,9 0.8 0,7 0,6 0,5 0.4 0,3 0,2 0,1 О О .,.....  >('  '8=100Hz ,  , "- " '8=200Hz  ,/ .----, " " " '.... .......................... ......................................... 20 Hz when '8= 400 Hz 20 Hz when '8= 100 Hz '8/2 Freq Figure 6-29 IIR fllter frequency magnitude response, оп а Ilnear scale, at three separate sampllng rates, Notice how the fllter's absolute cutoff frequency of 20 Hz shifts relative to the dlfferent 's sampling rates, coefficients for each new sampling rate. 50 we сап see that the smal1er we make t s (larger 1.) the better the resulting fi1ter when either impulse inуапаnсе design method is used because the replicated spectral overlap indicated in Figure 624(b) is reduced due to the larger fs sampling rate. The bottom linе here is that impulse invariance I1R filter design tech niques are most appropriate for narrowband filters; that is, lowpass fil ters whose cutoff frequencies are much smal1er than the sampling rate. Тhe second analytical technique for analog fi1ter approximation, the bilinear transform method, alleviates the impulse invariance method's aliasing problems at the expense of what's cal1ed frequency warping. 5pecifical1y, there' s а nonlinear distortion between the prototype analog filter' s frequency scale and the frequency scale of the approximating I1R filter designed using the bilinear transform. Let's see why. 6.5 Bilinear Transform IIR Filfer Design Mefhod There's а popular analytical IIR fi1ter design technique known as the ыип- ear traпsform method. Like the impulse invariance method, this design tech nique approximates а prototype analog filter defined Ьу the continuous Laplace transfer function H/s) with а discrete filter whose transfer function is H(z). However, the bilinear transform method has great utility ЬесаUБе . 
Blliпear Traпsforт I/R Fllter Des/gп Method 273 · it a1lows us to simply substitute а fиnction of z for s in Hc(s) to get H(z), thankfully, eliminating the need for Laplace and z-transformations as well as anу necessity for partial fraction expansion a1gebra; · it maps the entire s-plane to the zplane, enabling us to completely avoid the frequencydomain aliasing problems we had with the impulse invariance design method; and · it induces а nonlinear distortion of H(z)'s frequencyaxis, relative to the original prototype analog filter's frequencyaxis, that sharpens the final rolloff of digitallow-pass fi1ters. Don't worry, We'l1 explain each оnе of these characteristics and see exact1y what they теan to us as we go about designing аn I1R fi1ter, If the transfer fиnction of а prototype analog fi1ter is Hc(s), then we сап obtain the discrete I1R filter zdomain transfer fиnction н(z) Ьу substitut- ing the following for s in Hc(s) 2 ( 1Z1 ) s=t; 1+Z1 ' ( 688) where, again, t s is the discrete filter's sampling period (1//.). Just as in the impulse invariance design method, when using the bilinear transform method, we're interested in where the analog filter's poles end ир оп the zplane after the transformation, Тhis splane to zplane mapping behav- ior is exactly what makes the bilinear transform such аn attractive design technique,+ Let's investigate the major characteristics of the bilinear transform's splane to zplane mapping, First we'l1 show that аnу pole оп the left side of the s-plane will тар to the inside of the иnН circle in the zplane, It's easy to show this Ьу solving Eq, (6-88) for z in terms of s, Multiplying Eq. (688) Ьу (t/2)(1 + Zl) and collecting like terms of z leads us to 1 + (ts /2)s z= 1 (ts /2)s ( 689) + The bilinear transforrn is а technique in the theory of complex variables for mapping а fиnction оп the complex plane of оnе variable to the complex plane of another variable, It maps circles and straight lines to straight lines and circles, respectively, 
274 /пflпitе /mpuise Respoпse F//ters If we designate the real and imaginary parts of s as s = cr + jФ а ' (6-90) where the subscript in the radian frequency Фа signifies aпalog, Eq, (689) becomes z = 1 +CTt s /2+ jФ.ts /2 = (1 + cr t s /2) + jФаt s / 2 (691) lcтts /2 jФаt s /2 (lcrts /2) jФаt s /2 We Бее in Eq, (691) that z is complex, comprising the ratio of two complex expressions. As such, if we denote z as а magnitude at an angle in the form of z = 1 z 1 Le z ' we know that the magnitude of z is given Ьу 1 z 1= Magnumerator = (1 + ст t s /2)2 + (Ф.ts /2)2 MagdenonUnator (1  ст t s /2)2 + (Фаt s /2)2 (6-92) ОК, if cr is negative (а < О) the numerator of the ratio оп the right side of Eq. (692) will Ье less than the denominator, and I z 1 will Ье less than 1, Оп the other hand, if cr is positive (а > О), the numerator will Ье larger than the denominator, and I z I will Ье greater than 1. Тhis confirms that, when using the bilinear transform defined Ьу Eq. (688), any pole located оп the left side of the splane (а < О) will mар to а zplane location inside the unit circle. Тhis characteristic ensures that any stable s-plane pole of а prototype analog fi1ter will mар to а stable zplane pole for our discrete IIR filter. Likewise, any analog fi1ter pole located оп the right side of the splane (а > О) will mар to а zplane location outside the unit circle when using the bilinear transform, Тhis reinforces our notion that, to avoid fil- ter instability, during IIR filter design, we should avoid allowing any zplane poles to lie outside the unit circle, Next, let's show that the jФ а axis of the splane maps to the perimeter of the unit circle in the zplane. We сап do this Ьу setting cr = О in Eq, (6-91) to get 1 + jФ.ts /2 z= 1  jФаt s /2 (693 ) Here, again, we see in Eq. (693) that z is а complex number compris- ing the ratio of two complex numbers, and we know the magnitude of this z is given Ьу 
B/l/пear Traпsform I/R Filter Des/gп Method 275 I z '<1;0 = Magnumerator Magdenominator (1)2 + (йJat s /2)2 (1)2 + (йJat s /2)2 (6-94) The magnitиde of z in Eq, (694) is always 1, 50, as we stated, when using the bilinear transform, the jйJ a axis of the splane maps to the perimeter of the unit circle in the z-plane. However, this frequency mapping from the s-plane to the unit circle in the z-plane is not linear, It' s important to know why this frequency nonlinearity, or warping, occurs and to understand its effects, 50 we shall, Ьу showing the relationship between the splane fre quency and the z-plane frequency that we'll designate as йJ d . If we define z оп the unit circle in polar form as z = re--j(fJd as we did for Figиre 6-13, where r is 1 and йJ d is the angle, we can substitиte z = ej(fJd in Eq, (688) as 2 ( 1ej(fJd ) s=t; l+ej(fJd ' ( 695) If we show s in its rectangular form and partition the ratio in brackets into halfangle expressions, , 2 ej(fJd/2(ej(fJd/2ej(fJd/2) s = о' +]йJ =  . а t s ej(fJd!2(ej(fJd!2+ej(fJd!2) (6-96) Using Euler's relationships of sin(0) = (&О  ej0)/2j and COS(0) = (&О + e-- j 0)/2, we сап convert the right side of Eq, (6-96) to rectan- gиlar form as , 2 ej(fJd!2[2jsin(йJd/2)] s = о' +]йJ =  . , а t s eJ(fJd!2[2cos(йJd /2)] 2 2ej(fJd/2 jsin(йJd /2) = t;' 2ej(fJd!2 cos(йJd /2) '2 = Ltan(йJd /2). t s ( 697) If we now equate the real and imaginary parts of Eq, (6-97), we see that cr = О, and 
276 /пflпite /mpu/se Respoпse F//ters Q). = tan ( Q)d ) . t s 2 (6-98) Let's rearrange Eq. (98) to give us the useful expression for the zdomain frequency O)d' in terms of the s-domain frequency 0)., of  2t l ( Q).tS ) Q)d  an  , 2 (99) Тhe important relationship in Eq, (699), which accounts for the socalled frequency warping due to the bilinear transform, is illustrated in Figure 6-ЗО. Notice that, because tan1(0).t/2) approaches х/2 as 0). gets large, O)d must, then, approach twice that value, or Х. Тhis means that по matter how large 0). gets, the z-plane O)d will never Ье greater than х. Remember how we considered Figure  14 and stated that only the 1t/s to +1t/ s radians/s frequency range for 0). сап Ье accounted for оп the z-plane? Well, our new mapping from the bilinear transform maps the entire s-plane to the z-plane, not just the primary strip of the splane shown in Figure 14. Now, just as а wa1k along the jO). frequency axis оп the s-plane takes us to infinity in either direction, а trip ha1fway around the unit circle in а counterclockwise direction takes us from 0). = О to 0). == +00 radians/s. As such, the bilinear transform maps the s-plane's entire jO). axis onto the unit circle in the z-plane. We il1ustrate these bilin ear transform mapping properties in Figure 6-З1. О)а 1t Figure 6-30 Nonllnear relatlonship between the z-domaln frequency Ш d and the s-domain frequency Ша' 
Blliпear Traпsforт J/R FJ/ter Des/gп Method 277 Flgure 6.31 Billnear transform mapplng of the .rplane to the z-plane, То show the practical implications оЕ this frequency warping, let's relate the splane and z-plane frequencies to the more practical measure оЕ the 15 sampling frequency, We do this Ьу remembering the funda mental relationship between radians/s and Hz оЕ ro = 2пl and solving for 1 to get ro I= 2п Applying Eq, (&-100) to Eq, (&-99), (6-100) 21tld = 2tan1( 2t5 ) (6 101) Substituting l/fs for t 5 , we solve Eq, (&-101) forl d to get {  ( 2 ) 1 ( 2п!. / /S )  tan\1tJ. / /S) Jd   tan  , 2п 2 1t (&-102) Equation (&-102), the relationsblp between the splane frequency f. in Hz and the zplane frequency Id in Hz, is plotted in Figure &-32(а) as а func- tion оЕ the IIR filter's sampling ratefs, The distortion of the la frequency scale, as it translates to the Id frequency scale, is illustrated in Figure 632(b) where an s-plane bandpass frequency magnitude response I Наиа) I is subjected to 
278 /пfiпite lтpulse Respoпse FHters 'd ОЫ. 0,4'. 0.3'. (а) 0,2'. О,Н. О О 0,5'. '. 1,5'. 2'. 2,5'. 3,," 3,Ы. 4,," 4,Ы. ы.'. "   'd= tan 1 (1tf"/,.)/1t .; (Ь) ....."  ,H."." V О '. '"  '. Flgure 6-32 Nonlinear relatlonshlp between the f d and f с frequencles: (а) frequency warplng curve scaled In terтs of the IIR fllter's fs saтpllng rate; (Ь) s-doтaln frequency response Hc(fJ transforтation to а z-doтaln frequency responsв Hd(f d ), frequency compression as it is transformed to I Hd(fd) 1. Notice how the lowfrequency portion of the IIR filter's I Hd(fd) I response is reasonably linear, but the higher frequency portion has been squeezed in toward zero Hz. Тhat's frequency warping, Тhis figure shows why по IIR filter aliasing сап occur with the bilinear transform design method, No matter what the shape or bandwidth of the I Ha(fa) I prototype analog fi1ter, попе of its spectral content сап extend beyond ha1f the sampling rate of 
ВШпеаr Traпsforт IIR FiJter Des/gп Method 27 1./2 in I Hd(fd)and that's what makes the bilinear transform design method ав popular ав it is, The steps necessary to perform an IIR filter design using the bilinear transform method are ав follows: Step 1: Obtain the Laplace transfer function Hc(s) for the prototype ana- log filter in the form of Eq, (643), Step 2: Determine the digital filter's equivalent sampling frequency 1. and establish the sample period t s = 1/1.. Step з: In the Laplace Hc(s) transfer function, substitute the expression 2 ( lZl J t: 1 H1 (6-103) for the variable s to get the 1IR filter's H(z) transfer function, Step 4: Multiply the numerator and denominator of н(z) Ьу the appro priate power of (1 + r 1 ) and grind through the algebra to collect terms of like powers of z in the form N Lb(k)zk н(z) = k= 1 La(k)zk k=l (6-104) Step 5: Just as in the impulse invariance design methods, Ьу inspection, we Сan express the IIR filter's timedomain equation in the gen eral form of у(п) = Ь(О)х(п) + Ь(l)х(п  1) + Ь(2)х(п  2) +... + b(N)x(n  N) + а(l)у(п  1) + а(2)у(п  2) + '.. + а(М)у(п  М) . (6 105) Although the expression in Eq. (6-105) only applies to the filter structure in Figure 618, to complete our design, we сап apply the a(k) and b(k) coefficients to the improved IIR structure shown in Figure 6-22. 
280 /пflпfte /три/5е Re5poпse F/lters То show just how straightforward the bilinear transform design metЬod really is, let's use it to solve the ПR filter design problem first pre- sented for the impu1se invariance design method, 6.5. 1 Blllnear Transform Deslgn Example Again, our goal is to design an ПR filter that approximates the second- order Chebyshev prototype analog lowpass filter, shown in Figure 626, whose passband ripple is 1 dB, Тhe fs sampling rate is 100 нz и. = 0.01), and the filter's.1 dB cutoff frequency is 20 Нz, As before, given the origi nal prototype filter's Laplace transfer function as н 8  17410,145 с( )  82 + 137.945368 + 17410,145 ' (6106) and the value of t. = 0,01 for the sample period, we're ready to proceed with Step 3. For convenience, let's replace the constants in Eq. (106) with variables in the form of с Н с (8) = 2 ' 8 +Ь8+С (6107) where Ь = 137,94536 and с = 17410,145, Performing the substitution of Eq, (6-103) in Eq. (6107), с н(z)= 2 ( 2 1Z1 ) 2 ( 1Z1 ) . +b  +с t. 1 + Zl t s 1 + Zl (6108) То simplify our algebra а little, let's substitute the variable а for the frac- tion 2ft. to give с Н(z)= 2 ( 1 l ) ( 1 l ) а 2  z l + аЬ  z l + с 1+z 1+z (6109) Proceeding with Step 4, we mиltiply Eq, (109)'s numerator and denomi nator Ьу (1 + Z-1)2 to yield 
Biliпear Traпsforт I/R Filter Desigп Method 281 н(z)= а 2 (1  z1)2 + аЬ(l + Zl )(1  zl) + с(l + z1)2 с(l + z1)2 (б-11 О) Multiplying through Ьу the factors in the denominator of Eq. (б110), and collecting like powers of z, н(z) = с(1 + 2Z1 + Z2) (а 2 + аЬ + с) + (2с  2a2)z1 + (а 2 + с  ab)z2 (б-111) We're almost there. То get Eq. (б111) into the form of Eq. (б104) with а constant term of one in the denominator, we divide Eq. (б111)'s numera tor and denominator Ьу (а 2 + аЬ + с) giving us 2 С (1+2z1 +Z2) н(z) = (а + аЬ 2 +с) 2 1 (2c2a) 1 (а +cab) 2 + z + z (а 2 +аЬ+с) (а 2 +аЬ+с) (б-112) We now have H(z) in а form with all the like powers of z combined into sin- gle terms, and Eq. (б112) looks something 1ike the desired form of Eq, (б104), If we plug the values а = 2fts = 200, Ь = 137,9453б, and с = 17410,145 into Eq. (112) we get the following IIR filter transfer fиnction: н 0.20482712(1 + 2Z1 + Z2) (z) = 1  0.53153089 Zl + 0.35083938 Z2 0,20482712 +0.409б5424z1 + O,20482712z2 1  0,53153089 Zl + 0.35083938z2 (б113) and there we are. Now, Ьу inspection of Eq. (б-113), we get the time domain expression for our IIR filter as у(п) = 0.20482712 + 0.409б5424. х(п  1) + 0.20482712. х(п  2) + 0,53153089. у(п  1)  0,35083938. у(п  2) . (б114) The frequency magnitude response of our bi1inear transform IIR design example is shown as the dark curve in Figure б33(а), where, for 
282 /пfiпite /тpu/se Respoпse F//ters IHd('d)1 "  / mpulse inverience 0.6  design ...../ 0.4 J ". .....,'....... 0.2 Bilineer lransform design (а) 50 Hz 20 Hz О 20 Hz 50 Hz Freq ('./2) ((,,12) Degrees 180 140 100 60 (Ь) 20 --50 Hz 50 Hz Freq Hsl2) ('./2) Flgure 6-33 Comparison of the bIllnear transform and impulse invariance design IIR filters: (а) frequency magnltude responses; (Ь) phase of the bIllnear transform IIR filter, comparison, we've shown the resu1t оЕ that impulse invariance design example as the shaded curve. Notice how the bilinear transform designed filter's magnitude response approaches zero at the folding frequency оЕ 1/2 = 50 Hz, Тhis is as it should bthat's the whole purpose оЕ the bilin- ear transform design method. Figure 6-33(Ь) illustrates the nonlinear phase response оЕ the bilinear transform designed IIR filter. We might Ье tempted to think that not only is the bilinear transform design method easier to perform than the impulse invariance design method, but that it gives us а тисЬ sharper rol1-off for our low-pass filter, Well, the frequency warping оЕ the bilinear transform method does сот- press (sharpen) the rol1-off portion оЕ а low-pass filter, as we saw in Figure 6-32, but аn additional reason for the improved response is the price we рау in terms оЕ the additional complexity оЕ the implementation оЕ our IIR fi1ter, We see this Ьу examining the implementation оЕ our IIR filter as shown in Figure 6-34. Notice that our new filter requires five multiplica- tions per fi1ter output sample where the impulse invariance design fi1ter in Figure 6-28(а) required on1y three multiplications per fi1ter output sam- ple, Тhe additional mu1tiplications are, оЕ course, required Ьу the addi- tional feed forward z terms in the numerator of Eq, (6-113). Тhese added 
Biliпear Traпsforт I/R Filter Des/gп Method 283 1>(0) = 0.20482712 1>(1) = 0.40965424 1>(2) . 0.20482712 а(1).0.53153О89 а(2) . -О.З508З9З8 у(п) Flgure 6-34 Implementatlon of the bIllnear transform design example filter, b(k) coefficient terms in the H(z) transfer function сопеsроnd to zeros in the z-plane created Ьу the bilinear trаnsfопn that did not occur in the irnpulse invariance design method. Because our example prototype analog low-pass filter had а cutoff fre- quency that was 1.15, we don't see а great deal of frequency warping in the bilinear transform curve in Figure 6-33. (In fact, Kaiser has shown that, when 1. is large, the irnpulse invariance and bilinear transform design methods result in essentially identical H(z) transfer functions[19],) Had our cutoff frequency been а larger percentage of fs' bilinear trаnsfопn warping would have been more serious, and our resultant I Hif d ) I cutoff frequency would have been below the desired value. What the pros do to avoid this is to prewarp the prototype analog filter's cutoff frequency requirement before the analog Hc(s) transfer function is derived in Step 1, In that way, they compensate for the bilinear transfопn' s frequency warp- ing before it happens, We can use Eq. (6-98) to determine the prewarped pro- totype analog filter low-pass cutoff frequency that we want mapped to the desired ПR low-pass cutoff frequency. We plug the desired ПR cutoff fre quency ffid in Eq, (6--98) to calculate the prototype analog Юа cutoff frequency used to derive the prototype analog filter's HC<s) transfer function. Although we explained how the bilinear transform design method avoided the impulse invariance method's inherent frequency response aliasing, it' s irnportant to remember that we stШ have to avoid filter input data aliasing. No matter what kind of digital filter or filter design method is used, the original input signal data must always Ье obtained using а sampling scheme that avoids the aliasing described in Chapter 2, If the original input data contains errors due to sample rate aliasing, по filter сап remove those епоrs. 
284 /пfiпite /mpu/se Respoпse F//ters Oиr introdиctions to the impиlse invariance and bilinear transform design techniqиes have, Ьу necessity, presented only the essentials of those two design methods, Althoиgh rigoroиs mathematical treatment of the impиlse invariance and bilinear transform design methods is inap- propriate for an introdиctory text sиch as this, more detailed coverage is available to the interested reader[116], References [13] and [15], Ьу the way; have excellent material оп the varioиs prototype analog filter types иsed as а basis for the analytical ПR filter design methods, Althoиgh oиr examples of ПR filter design иsing the impиlse invariance and bilinear transform techniqиes approximated analog low-pass filters, it's important to remember that these techniqиes apply eqиally well to designing band- pass and highpass IIR filters, То design а highpass ПR filter, for example, we'd merely start oиr design with а Laplace transfer fиnction for the pro-- totype analog highpass filter, our ПR digital filter design woиld then pro ceed to approximate that prototype highpass filter. As we have seen, the impиlse invariance and bilinear transform design techniqиes are both powerful and а bit difficult to perform. The mathe- matics is intricate and the evalиation of the design eqиations is ardиoиs for аН bиt the simplest filters, As sиch, we'll introdиce а third class of ПR filter design methods based оп software roиtines that take advantage of iterative optimizatioп compиting techniques. In this case, the designer defines the desired filter freqиency response, and the algorithm begins generating sиccessive approximations until the ПR filter coefficients con- verge (hopefully) to an optimized design. 6.6 Optimized IIR Filter Design Method The final class of ПR filter design methods we'll introdиce are broadly cat- egorized as optimization methods. These ПR filter design techniqиes were developed for the situation when the desired ПR filter freqиency response was not of the standard low-pass, bandpass, or highpass form. When the desired response has an arbitrary shape, closed-form expressions for the filter's ztransform do not exist, and we have по explicit eqиations to work with to determine the ПR filter's coefficients. For this general ПR filter design problem, algorithms were developed to solve sets of linear, or non linear, eqиations оп а computer, These software roиtines mandate that the designer describe, in some way, the desired ПR filter freqиency response. The algorithms, then, assиme а filter transfer fиnction Н(z) as а ratio of polynomials in z and start to calcиlate the filter's freqиency response. Баsed оп some error criteria, the algorithm begins iteratively adjиsting the filter's coefficients to minimize the error between the desired and the асшаl filter freqиency response, The process ends when the error cannot 
Opt/mJzed I/R Filter Desigп Method 285 Ье fиrther minimized, or а predefined number of iterations has occurred, and the final filter coefficients are presented to the filter designer. Although these optimization algorithrns are too rnathernatically cornplex to cover in any detail here, descriptions of the rnost popular optirnization schernes are readily available in the literature[14,16,2025]. The reader rnау ask, "Н we're not going to cover optimization rnethods in any detail, why introduce the subject here at аШ" The answer is that if we spend rnuch tirne at аll designing IIR filters, we'll end ир using opti- rnization techniques in the forrn of cornputer software routines rnost of the tirne, The vast rnajority of cornmercially available digital signal pro-- cessing software packages include one or rnore IIR filter design routines that are based оп optirnization rnethods, When а cornputeraided design technique is available, fi1ter designers are inclined to use it to design the sirnpler lowpass, bandpass, or highpass forrns even though analytical techniques exist. With аll due respect to Laplace, Heaviside, and Kaiser, why plow through аll the ztransforrn design equations when the desired frequency response сап Ье applied to а software routine to yield accept able filter coefficients in а few seconds? As it turns out, using cornrnercially available optirnized IIR filter design routines is very straightforward, Although they соrnе in several flavors, rnost optirnization routines only require the designer to specify а few key arnplitude and frequency values, the desired order of the IIR filter (the nurnber of feedback taps), and the software cornputes the final feed forward and feedback coefficients, In specifying а lowpass, IIR filter for exarnple, а software design routine rnight require us to specify the values for Ор' 0''/1' andf2 shown in Figure 6З5. Sorne opti rnization design routines require the user to specify the order of the IIR IHd(f)1 i i v; Os j/ шш, 1  Ор о о l' '1 '2 's/2 Freq Flgure 6-35 Example low-pass IIR ftlter deslgn parameters requlred for the optimized IIR ftlter deslgn method, 
286 /пfiп/te /три/sе Respoпse F//ters fi1ter, Those routines then compute the fi1ter coefficients that best approach the required frequency response, Some software routines, оп the other hand! don't require the user to specify the fi1ter order, They compute the minimum order of the fi1ter that actua11y meets the desired frequency response, 6.7 Piffalls in Building IIR Digital Filters Тhere's аn old saying in engineering: "It's оnе thing to design а system оп paper, and another thing to actua11y build оnе and make it work." (Reca11 the Тасота Narrows Bridge episode!) Fabricating а working system based оп theoretical designs сап Ье difficu1t in practice, Let's see why this is often true for IIR digital fi1ters, Again, the IIR filter structures in Figures 6-18, 621(b), and 622 are ca11ed Direct Form implementations of an IIR fi1ter because they're а11 equivalent to direct1y implementing the general time-domain expression for an Mth-order IIR filter given in Eq, (6--21), As it turns out, there Сan Ье stability probIems and frequency response distortion errors when direct form implementations are used. Such probIems arise because we're forced to represent the IIR filter coefficients and the resu1ts of intermediate fi1ter ca1cи1ations with binary numbers having а finite number of bits, These finite word length effects are particularly serious if а direct form IIR filter's н(z) transfer function polynomial in z is of high order (i.e., а filter having а large number of delay elements), There are three major categories of finite word length errors that plagиe IIR filter implementations: coefficient quantization, overflow errors, and roundoff errors, Although Chapter 9 discusses the nature and effects of using finite word lengths in more detail, we'll briefly discuss those error types as they relate to ПR filters and see what precautions сап Ье taken to minimize their effects. Remember, а11 of our IIR filter ca1culations, thus far, have resu1ted in very accurate fi1ter coefficient values, In fact, the fractional coefficient val ues in our previous IIR design examples were accurate to eight decimal digits as indicated in Eq. (6 114), Кnowing that it takes four binary bits to store а single decimal digit, we сап say that the coefficient values in Eq. (6-114) require the equivalent of 32 bits of accuracy. Consider the situation where we try to actua11y build the IIR fi1ter in Figиre 6--34, but we're con strained to store our a(k) and b(k) coefficients in fourbit hardware regis ters, We11, we сan, indeed, represent the fractional coefficients with only оnе decimal digit, but they lose some of their precision. For example, we сап represent Eq, (61l4)'s original Ь(О) = 0,20482712 coefficient as Ь(О) = 0,2 and lose some accuracy due to coefficient quantization. 
PJtfa//s ;п Bu//d;пg //R Dlg;tal Filters 287 Limitedprecision coefficients will result in slight filter pole and zero shifting оп the z plane, and а frequency magnitude response that тау not meet our requirements. For example, if we used only fourbits (one decirn.al digit) to represent the coefficients in Figure 634, our reduced-accuracy filter magnitude response is shown Ьу the solid сшvе in Figure 6-36. For contrast, we've also shown the original high-accuracy coefficient response as the shaded curve in Figure 6-36. Sure enough, using fourbit coefficients distorted our original second-order IIR frequency response, Had our filter cutoff fre- quency (20 Hz) been higher relative to the sample rate (100 Hz), соет- cient quantization would resu1t in а frequency response that was even more skewed from the original, As it tums out, higher order filters are very sensitive to coefficient accuracy and, for them, coefficient quantiza- tion is more likely to cause unacceptable frequency response distortion. An even bigger problem сап occur in highorder polynomials of H(z) when quantized coefficients are rounded up to the nearest quantization level. After factoring а high-order errorcontaining н(z) polynomial into its single-order factors, this сап result in actually moving а pole outside the unit circle, yielding an unstable filter, Overflow, the second finite word length effect that troubles digital fil ters, is what happens when the resu1t of an arithmetic operation is too large to Ье represented in the fixedlength hardware registers designed to contain that result, Because we perform so many additions when we implement IIR filters, overflow is always а potential problem. With по precautions being made to handle overflow, large nonlinearity errors IHd('d)1 ''" Full accuracy / < coefficients Four-blt ' coefficients Four-bil coefficienls: Ь(О) = 0,2 Ь(1) = 0.4 Ь(2) = 0,2 а(1) =0,5 а(2) = О,З 0,8 0,6 0.4 0.2 о 20 Hz 50 Hz ('5/2) Freq Flgure 6-36 Comparlson of the billnear transform deslgned ftlter magnitude responses using full-accuracy coefficients (shaded curve) and four-bIt coefficients (solld си rve) , 
288 /пfiпite /тpuJse Respoпse Fllters сап result in our filter output samplesoften in the form of overflow oscil1ations, Thе most coinmon way of dealing with binary overflow errors is caHed roundoff, or rounding, where а data value is represented Ьу, or rounded оН to, the bbit binary number that's nearest the unrounded data value, It's usuaHy valid to treat roundoff errors as а random process, but condi- tions occur in ПR filters where rounding сап cause the filter output to oscillate forever, even when the filter input sequence is аН zeros. Тhis sit uation, going Ьу the names /iтit cyc/es and deadband effects, has been weH analyzed in the literature[26,27], We can demonstrate limit cycles Ьу con sidering the secondorder IIR filter in Figure 6З7(а) whose time-domain expression is у(п) = х(п) + l,Зу(п  1)  О,76у(п  2) , (6115) Let's assume that this filter rounds the adder's output to the nearest inte gral value, If the situation ever arises where y(2) = О, y(l) = 8, and х(О) and аН successive х(п) inputs are zero, the filter output goes into endless oscil1ation, as shown in Figure 6З7(Ь). If this filter were to Ье used in an audio application, when the input signal went silent, the listener could end ир hearing an audio tone instead of silence. The shaded line in Figure 6З7(Ь) shows the filter's stable response to this particular situation if по rounding is used. With rounding, however, this IIR filter certainly lives ир to its пате. There are several ways to reduce the ill effects of quantization errors and limit cycles. We can increase the word widths of the hardware regis- ters that contain the results of intermediate calculations, Because round- ОН lirnit cycles affect the least significant bits of an arithmetic result, larger word sizes diminish the impact of limit cycles should they occиr, То avoid filter input sequences of аН zeros, some practitioners add а dither sequence to the filter's input signal sequence. А dither sequence is а sequence of lowamplitude pseudorandom numbers that interferes with an ПR filter's roundoff error generating tendency, aHowing the filter output to reach zero should the input signal remain at zero. Dithering, however, decreases the effective signal-to--noise ratio of the filter output[l1J, FinaHy, to avoid limit cycle problems, we can just use an FlR filter. Because FIR filters, Ьу definition, have finitelength impulse responses and have по feedback paths, they cannot support output oscillations of any kind, As for overflow oscillations, we сап eliminate them if we increase the word width of hardware registers, so that overflow never takes place in the IIR filter. Altematively, it has been shown that the effects of overflow oscillations can Ье avoided Ьу modifying hardware adders so that their 
P/tfa//s /п Bu//diпg //R Dig/ta/ Fi/ters 289 (а) у(п) "(),76 i у(п) 108: 8 6 " 4 (Ь) 2 т- О 8; 2 ,; 4 8  '/ Response with по rounding .'.,/ .. .. " , , ...........  " . . ..... 18 .  24 Тiтe 8 8 Flgure 6-37 Limlt cycle osclllotlons due to rounding In оп IIR ftlter: (о) second- order IIR ftlter wlth rounding toking ploce following the odder; (Ь) one possibIe tlme-domoln response of the IIR ftlter, sum saturates to а fixed limit when an overflow condition is detected[28, 29]. It mау Ье usefиl for the reader to keep in mind that, when the signal data is represented in two's complement arithmetic, multiple summations resu1ting in intermediate overflow errors cause по prob1ems if we сап guarantee that the finаl magnitude of the sum of the numbers is not too large for the final accumulator register, тhis potential relief from overflow errors, as discussed under the data overflow topic in Section 9,3, is one reason for the popularity of the two' s complement format for binary num bers. Some digital filters incorporate additional control circuitry to detect overflow conditions and allow the designer to control (Ьу scaling down) the amplitudes оЕ signals at critical points in the system[14,17]. If your budget can afford floating-point hardware, it has been shown that both standard floatingpoint and block floatingpoint data formats сап greatly reduce the errors associated with overflow oscillations and limit cycles[30], (We discuss floating-point number formats in Section 9.4) Perhaps the most роршar technique for minimizing the епоrs associated with finite word widths is to design filters comprising а cascade string, or para1lel combination, of loworder filters. The next section tells us why 
290 /пflп/te /тpu/se Respoпse F//ters 6.8 CascaQe and Parallel Combinations о' DigitalFilters In practice, we're likely to encounter multiple digital filters connected in cascade or parallellike those in Figure 38, As indicated in Figиre 638(a), the resultant transfer function of two cascaded filter transfer functions is the product of those functions, or Hcascade(z) = H 1 (z)H 2 (z) , (116) If the filters in Figиre 38(a) are linear, we сan swap their order, having H 2 (z) precede H 1 (z), with по change in the Y(z) output. Ву the way, this property of the combined transfer function equaling the product of the two individualtransfer functions applies to any combination of linear time invariant IIR and FIR filters, As shown in Figиre 38(b), the coт bined transfer function of two parallel filters is the sum of their transfer functions, or Hparallel (z) = H 1 (z) + H 2 (z) , (117) Hardware filter designers routinely partition highorder digital filters into а string of lower order filters arranged in cascade because the cas caded system usually requires fewer multiplications for а given filter fre quency response, It's common practice to subdivide а high--order digital (а) Y(z) = Н 1 (z)(z)X(z) (Ь) X(z) Y(z) = [Н 1 (z) + (z)]X(z) Figure 6-38 CoтbInotions of two dlgltol fllters: (о) coscoded fllters; (Ь) porallel fllters, 
Cascade aпd Ратаllе! Coтbiпatioпs о, Digitai Fllters 291 filter into multiple secondorder building blocks Ьесаше secondorder ш ters are easier to design, are less susceptible to coefficient quantization and roundoff errors, and their implementations allow easier data word scaling to reduce the potential overflow effects of data word size growth. Optimizing the partitioning оЕ а highorder filter into multiple second order filter sections is а challenging task, however. For example, say we have the sixthorder filter in Figure 6--39(а) that we want to partition into three secondorder sections. In factoring the sixthorder filter's H(z) poly nomial, we could get ир to three separate sets of feedback coefficients in the factored H(z) numerator: а'(п), а"(п), and а'''(п), Likewise, we could have ир to three separate sets of feed forward coefficients in the factored Х(п) (а) (Ь) 0(6) Ь(6) n Partilio" i"IO seco"d-order filters \; 0'(2) Ь'(2) Ь'''(2) Flgure 6-39 IIR fllter partitlonlng: (а) original sixth-order IIR fllter; (Ь) three second- order sections, 
292 /пflпite /три/sе Respoпse Fllters denominator: Ь'(n), Ь"(n), and Ь'''(n), Because there are three second ordered sectioos, there are three factorial, or six, ways of pairing the sets of coefficients. Notice in Figure 6-39(Ь) how the first section uses the а'(n) and Ь'(n) coefficients, and the second section uses the а"(n) and Ь"(n) coef- ficients. We could just as well have interchanged the sets of coefficients so that the first second-order section uses the а'(n) and Ь"(n) coefficients, and the second section иses the а"(п) and Ь'(n) coefficiel1:ts. 50 there are six dif- ferent mathematically equivalent ways of combining the sets of соеШ- cients, Add to this the fact that, for each different combination of loworder sections, there are three factorially distinct ways those three separate second-order sections сап Ье апаngеd in cascade. Тhis means that if we want to partition а W-order IIR fi1ter into М dis- tinct second-order sections, there are М factorial squared, or (М!)2, ways to do so. As such, there are then (3!)2 = 36 different cascaded filters we coиld obtain when going from Figure 6-39(а) to 639(b).t То fиrther сот- plicate this fi1ter sectioning problem, the епоrs due to quantization wiII, in general, Ье different for each possible fiIter combination. Although this subject is oиtside the scope of this introductory text, ambitioиs readers сап find further material оп optimizing cascaded filter sections in refer- ences [19,27], and in part 3 of reference [31]. Тhere's а considerable amount of material in the literature concerning finite word effects as they relate to digital fi1ters. (References [14,16] and [19] discuss qиantization noise effects in some detail as well as providing extensive bibliographies оп the subject.) Although these books and papers provide useful guidelines in predicting and minimizing quantization errors, prudent designers eventually resort to computer simulations of ы- ter designs, This way they сап vary fi1ter hardware characteristics, such as coefficient word widths, accumulator register sizes, sequencing of cas- caded sections, and input signal sets. This experimental approach is attractive because it's both reliable and economical. 6.9 А Brief Comparison of IIR and FIR Filters The question natиraIly arises as to which filter type, IIR or FIR, is best suited for а given digital fi1tering application. That's not an easy ques- tion to answer, but we сап point out а few factors that should Ье kept in mind. First, we сап assume that the differences in the ease of design between the two fi1ter types are unimportant, There are usuaIly more imp()rtant performance and implementation properties to consider than t These combinations сап get very large, For example, there are (5!)2 = 14,400 ways to сот- Ыnе five second-order filters to implement а lO'h- or der IIR filter, . 
А Br/ef Coтpor/soп of J/R oпd F/R F//ters 293 design difficu1ty when choosing between an IIR and an FIR filter, One design consideration that тау Ье significant is the IIR filter's ability to simulate а predefined prototype analog fi1ter. FIR fi1ters do not have this design flexibility. From а hardware standpoint, with so many fundamental differences between IIR and FIR filters, our choice must Ье based оп those filter char acteristics that are most and least important to us, For example, if we needed а filter with exactly linear phase, then an FIR filter is the only way to go. on the other hand, if our design required that а filter accept very high data rates and slight phase nonlinearity is tolerable, we might lean toward IIR filters with their reduced number of necessary mu1tipliers per output sample. ТаЫе 6--1 presents а brief comparison between IIR and FIR filters based оп several different perfonnance and implementation properties. ТаЫе 6-1 IIR and FIR Fllter Characterlstlcs Comparison Characteristic IIR FIR Number of nece$sary Lea$t MO$t multiplications Sensitivity to filter Сan ье high for Very low coefficient quantization Direct Form" Probability of overflow Сan ье high for Very low error$ Direct Form" Stability Must Ье designed in Guaranteed Linear phase No Guaranteed "" Сan $imulate prototype Yes No analog filters Required hardware Lea$t MO$t memory Нardware filter control Moderate Simple complexity Avai1ability of design Good Very good $oftware ЕаБе of design or Moderately Simple complexity of design complicated $oftware Difficulty of quantization Most complicated Lea$t complicated noise analY$is Supports adaptive Yes Уе$ filtering " The$e problems сan Ье minimized though cascade or parallel implementation$, "" Guaranteed $0 long as the FIR coefficients are $ymmetrical, 
294 /пfiпite /тpu/se Respoпse Filters References [1] Churchi11, R. V. Moderп Operational Мatheтatics in Engineering, McGraw-НЩ New York, 1944, рр, 30734, . [2] Aseltine, J, А, Transform Method in Linear 5ystem Analysis, McGraw-Нill, New York, 1958, рр. 28792. [3] Nixon, F. Е, Handbook о! Laplace Transformation, Tables and Examples, Prentice-Hall, Englewood Cliffs, New Jersey, 1960, [4] Kaiser, J. F. "Digital Filters," in 5ystem Aпalysis ьу Digital Computer, Ed. Ьу F. F. Кио and J. F. Kaiser, JoOO Wiley and Sons, New York, 1966, рр, 218---77. [5] Kaiser, J, F. "Design Methods for Samp1ed Data Filters," Chapter 7, in 51963 Proc, 1st Allerton Confereпce, рр. 221-36, [6] Ragazzini, J, R, and Frank1in, G, F. 5ampled-Data Control 5ystems, McGraw-НШ, New York, 1958, рр, 52....s3. [7] Mi1ne-Тhomson, L, М, Тhe Calculus о! Finite Differences, Macmillan, London, 1951, рр, 23251, [8] Truxal, J, G, 1955, Automatic Feedback Confrol System Synthesis, McGraw-НШ, New York, 1955, рр, 283. [9] Blackman, R, В. Linear Data5moothing and Prediction in Theory and Practice, Addison-Wesley, Reading, Mass., 1965, рр, 81....s4. [10] Gold, В, and Jordan, К. L" Jr. "А Note оп Digital Filter Synthesis," Proceedings ofthe IЕЕЕ, Vol. 56, October 1968, рр. 1717, [111 Rabiner, L, R., et аl, "Terminology in Digital Signal Processing," IЕЕЕ Trans, оп Audio and Electroacoustics, Vo!, AU-20, No. 5, December 1972, рр. 327, [12] Stearns, 5, О, Digital 5igпal Analysis, Hayden Book Со, Inc., Rochelle Park, New Jersey, 1975, рр, 114, [13] Stanley, W. О" et аl" Digital 5ignal Processing, Reston Publishing Со, Inc" Reston, Virginia, 1984, рр, 191, [14] Oppenheim, А, V., and Schafer, R, W, Discrete-Time 5ignal Processing, Prentice-Hall, Englewood Cliffs, New Jersey, 1989, рр, 406, [15] WiШаms, С. S. Desigпing Digital Filters, Prentice-Hall, EngIewood Cliffs, New Jersey, 1986, рр, 16б....s6, [16] Rabiner, L, R., and Gold, В, Theory and Application о! Digital 5igпal Processing, PrenticeHall, Englewood Cliffs, New Jersey, 1975, рр. 216, [17] JoOOson, М, "Implement Stable IIR Filters Using Minimal Hardware," EDN, 14 April1983, [18] Oppenheim, А. V" WШskу, А, 5" and Yoиng, 1, Т, 5ignals and 5ystems, PrenticeHall, Englewood Cliffs, New Jersey, 1983, рр, 659. . 
Refereпces 295 [19] Kaiser, J, F. "Some Practical Considerations in the Realization оЕ Linear Digital Filters," Proc, Third Аппиа/ A/lerton Conference оп Circuit and System Theory, 1965, рр, 62133 [20] Deczky, А. G, "Synthesis оЕ Digital Recursive Filters Using the Мinimиm Р Епоr Criterion," IEEE Тrans, оп Audio aпd E/ectroacoustics, Vol, AU20, No, 2, October 1972, рр, 257. [21] Steiglitz, К. "Computer-Aided Design оЕ Recursive Digital Filters," IEEE Trans, оп Audio aпd E/ectroacoustics, Vol, 18, No, 2, 1970, рр, 123, [22] Richards, М, А. "Application оЕ Deczky's Program for Recursive Filter Design to the Design оЕ Recursive Decimators," IEEE Trans, оп Acoustics, Speech, aпd Sigпa/ Processing, Vol, ASSP-30, October 1982, рр, 811, [23] parks, Т. W" and Burrus, С. 5, Digita/ Fi/ter Desigп, John Wiley and Sons, New York, 1987, рр, 244, [24] Rabiner, L" Graham, У" and Helms, Н, "Linear Programming Design оЕ ПR Digital Filters with Arbitrary Magnitude Functions," IEEE Trans, оп Acoustics, Speech, and Sigпa/ Processing" Vol, ASSP-22, No, 2, April1974, рр, 117, [25] Friedlander, В" and Porat, В, "Тhe Modified Yule-Walker Method оЕ ARМA Spectral Estimation," IEEE Тrans, оп Aerospace E/ectronic Systems, Vol, AES-20, No, 2, March 1984, рр. 158-73, [26] Jackson, L, В. "On the Interaction оЕ Roundoff Noise and Dynатс Range and Dynamic Range in Digital Filters," Веи System Technica/ jourпa/, Vol, 49, February 1970, рр, 159-84, [27] Jackson, L, В, "Roundoff Noise Analysis for Fixed-Point Digital Filters Realized in Cascade or Parallel Form," IEEE Trans, Audio E/ectroacoustics, Vol, AU18, June 1970, рр, 107-22, [28] Sandberg, 1, W, "А Тheorem Conceming Limit Cycles in Digital Filters," Proc, Seventh Аппиа/ A/lerton Conference оп Circuit aпd System Theory, Monticello, Illinois, October 1969, [29] Ebert, Р, М" et аl, "Overflow Oscillations in Digital Filters," Веи Sys, Tech, jourпa/, Vol, 48, November 1969, рр, 29993020, [30] Oppenheim, А. V. "Realization оЕ Digital Filters Using Block Floating Point Arithmetic," IEEE Тrans, Audio E/ectroacoustics, Vol, AU-18, June 1970, рр, 130-36, [31] Rabiner, L, К, and Rader, С. м., Eds" Digita/ Sigпa/ Processing, ШЕЕ Press, New York, 1972, рр, 361, 
!CHAPTER SEVEN Advanced Sampling Techniques Беуопd the low-pass and bandpass sampling schemes discussed in Chapter 2 there are specialized sampling techniques that we're likely to encounter in practice. In this chapter we introduce several of those advanced sampling methods and show why and when they're used, 7.1 Quadrature Sampling Many digital signal processing applications use the complex data for mat with its real (in-phase) and imaginary (quadrature phase) parts. These applications [аН in the general category known as quadrature pro cessiпg. For example, the phase preservation characteristic of complex data representation is exploited in high data rate digital communica- tions systems, radar systems, and time difference of arrival (TDOA) processing in radio directionfinding schemes[1,2]. The enhanced phase measurement capabilities of quadrature processing are used in coher- ent pulse measurement systems, antenna beamforming applications, and single sideband mоdиlаtоrs[З6], Complex data representation al10ws us to realize additional processing power through the coherent measurement of the phase of sinusoids comprising an input signal, То obtain the timedomain representation of а continuous signal using complex notation, the signal must Ье digitized Ьу а technique cal1ed quadrature saтpliпg,t t Quadrature sampling goes Ьу various other names in the literature, such as vector demod- ulation, complex demodulation, complex down-conversion, quadrature heterodyning, I/Q sampling, and complex sampling[79), Care must Ье exercised here from а semantic view- point, There's а testing scheme referred to as cohereпt saтpliпg, used to characterize the dynamic performance of А/О converters, that is unrelated to quadrature sampling[10,1l), This clever A/D testing technique is discussed in Section 10,9, 297 
298 Advoпced Saтpllпg Techп/ques Quadrature-phase (imaginary) axis In-phase (real) axis Figure 7-1 In-phase /(t) aпd quadraturephase q(t) coтpoпeпts of а continuous signal >«t), То illustrate this idea, let's consider а continuous time-domain signal x(t) that has some instantaneous magnitude at а phase angle of 0(t), This signal сап, equally well, Ье defined Ьу its inphase i(t) and quadrature- phase q(t) components as shown in Figure 7-1, We could use the low-pass, or bandpass, sampling schemes in Chapter 2 to obtain discrete samples representing x(t) and then calculate the i(t) and q(t) components. Quadrature sampling, оп the other hand, allows us to obtain the discrete samples representing i(t) and q(t) direct1y, Тhus, quadrature sampling produces two separate sampled data sequences, one sequence represent ing the in-phase and one sequence representing the quadraturephase components of the original continuous signal x(t). Let's keep two things in mind as we begin our discussion of quadra ture sampling, First, in studying quadrature processing, we'll encounter frequencydomain spectra that are not symmetrical about the О нz axis, A1though frequencydomain symmetry is inherent in real signals, the complex nature of quadrature signals does not have this restriction. It's the lifting of this symmetry restriction that makes quadrature processing so powerful. Second, recall from Euler's relationships discussed in Appendix С that , ej21tft  ej21tft jej21tft jej21tft Sln ( 21t :ft) =   +  2j 2 2 (7-1) and ej21tft + ej21tft ej21tft ej21tft cos ( 21t :ft) = =  +  2 2 2' (7-2) 
Quadrature Saтpliпg 299 renUnding us that real sinusoids or cosinusoids can Ье represented as coт plex phasor quantities through the convention оЕ negative frequency, that is, negative exponentials. With these thoughts in mind, we view the hybrid processing known as I/Q demodulation (or Weaver demodulation for those readers with experience in communications theory), shown in Figure 72(a), : -< ContinU0U8 )O- i -< Dilcret.! , (а) x(t) } Цп)  jq(n) sin(2xf c t)  t X(f) ...........B (Ь)   fc О 'с Freq (с) l'    )I  2fc fc 8I2 О +812 'с 2fc Freq (d)  Filtered  8I2 О 812 Freq (е) j'-   )' 2fc I ......, F:q 2 с fc 'с   " Filtered (1)  Freq О 812 (g)  2fs fs  Iex spectrum 01 i(n)  jq(n)  8I2 О 812 f s 2' s Freq Flgure 7-2 Quadrature bandposs sompling: (о) sampiing bIock diagram; (Ь) contlnuous spectrum of contlnuous input x(t); (с) continuous in-phase component of x(t); (d) flltered In-phase component of X(t); (е) contlnuous quadrature-phase component of x(t); (f) flltered quadrature- phase component of x(t); (g) sampied sum of the flltered in-phase component аnd the flltered quodrature-phase component of x(t), 
300 Advaпced Saтpliпg Techпiqиes Consider а bandpass signal x(t), centered at carrier frequency fc Hz, that has the real spectrum Х(Л shown in Figure 72(b). When we mix x(t) with а cosine wave of fc Hz, the positive phasor portion of the cosine (that is, ei 21r N /2) will translate the spectral components located at fc (dashed curve) up to baseband centered at О Hz, resulting in what is sometimes called а zero-frequency IF format[4]. Likewise, the negative phasor por tion of the cosine (e-- i2 7tf,t /2) will translate the spectral components located at +f c (solid curve) down to baseband a1so centered at О Hz. The resultant continuous signal spectrum is shown as Х;(Л in Figure 7-2(с) where we show the two translated spectra as overlaid, not summed, to see their individuality. Х;и) is lowpass fi1tered Ьу an analog filter with а cutoff frequency slight1y greater than В/2 Hz, ca11ed the inphase component of x(t), and shown as the I(Л magnitude spectrum in Figure 72(d), (For the reader who's not at ease with the notion of negative frequencies, it's а good idea to review Appendix С to see why negative frequencies exist when we use complex signal notation.) The continuous heterodyned product оЕ x(t) and the sinewave of fc Hz is shown in Figure 72(e) where the spectra lying below the frequency axis result from the negative sign of the positive frequency jei21ifcl /2 сотро- nent in Eq. (71). This product is low-pass filtered and represents the quadraturephase component оЕ x(t), shown as the jQ(f) spectrum in Figure 72(Л. The origina1 real signal x(t) is now represented in а complex format as i(t)  jq(t). (ТО recover the real x(t), we need only multiply i(t) Ьу cos(21tfi), multiply q(t) Ьу sin(21tfct), and sum the two products.) Figure 7-2 helps remind us that real signa1s can Ье represented Ьу а sin gle sequence of sampled values and that their spectra show symmetry about zero Нz. Complex, or quadrature, signa1s must Ье represented Ьу two sequences of sampled values, оnе sequence for the inphase part and оnе for the quadrature part. Again, complex signa1 spectra are not required to Ье symmetrical about zero Нz. Retuming to Figure 72(a), the two sep arate, continuous signals, i(t) and q(t), are digitized Ьу an A/D coi1verter at а sample rate of fs samples / s. The resultant spectrum for the complex i(n)jq(п) is shown in Figure 72(g). Again, note the spectral replications every fs Нz. 50 what's the big deal here? In Figure 72(g), notice that the sample rate need only Ье greater than twice В /2 to avoid aliasing. Iл quadrature sampling fs need only Ье greater than the signal band width, as opposed to twice the signal bandwidth previously described in Chapter 2 for lowpass and bandpass sampling. This means that а given А/О converter can Ье used to sample signal bandwidths twice as wide with the quadrature sampling technique. Notice, however, that two low pass filters and two A/D converters are necessary with this scheme, 
Quadrature Samp/iпg with Dlgital Mixlng_ З What we have is two A/D converters operating at half the equivalJ:'Lt firstorder bandpass sampling rate, Are we violating the Nyquist crite.rf! rion? Not reallywe stШ have two discrete sample values being gener ated for every cycle in the bandwidth of our original signal, 50, when we need to digitize very wide bandwidths, the quadrature sampling вфете is attractive, particularly, when our goal is spectral analysis using the ррт. When the two data streams representing the inphase and quadrature phase components are applied to а complex radix-2 pFТ algorithm, the pFТ operates more efficient1y than when its inputs are real signаls[З,12], (Тhat particular topic is discussed in Section 10.5.) А""; 7.2 Quadrature Sampling with Digital Mixing То оЫаin quadrature samples in practice, the process shown in Figure 72(a) is difficu1t to implement without errors. Over moderately wide bandwidths, it's not еаву to configure two analog signal paths that have identical frequency responses (gain and phase)phase differences of а few degrees are соттоп. Moreover, large DC components are routinely induced Ьу the mixers in the xi(t) and xq(t) signals before fi1tering, Final1y, if the low-pass fi1ters are active devices, а kind of continuous noise known ав 1/f noise from the semiconductor components in the mixers/fi1ters induces increased noise energy near О Нz. Тhese disadvantages сап Ье avoided with digital mixers and fi1ters where the sample rate is four tiIПев the carrier frequency of the bandpass signаl[13--1б]. Тhis process is il1ustrated in Figure 7З(а). Тhe input signal x(t) from Figure 7-2(а), with the spectrum shown in Figure 7З(Ь), is digi tized at а sample rate of fs = 4fc providing the discrete samples x(nt s ) whose вресtrшn, Х(т), is shown in Figure 7З(с). Тhe quadrature mixing withfc = 1./4, to center the input signal's inphase and quadrature phase components about О Hz, is performed digitally with the results of the in phase replicated components depicted in Figure 7-З(d) and the low-pass fi1tered in-phase spectrum in Figure 7-З(е). Although the A/D converter must sample at four times the carrier frequency, the difficulties in signal path phase and amplitude matching are eliminated because only опе A/D converter is necessary. In addition, the DC Ыав problems associated with analog signal mixing to zero нz are avoided, Тhe real advantage of this technique is how еаву the quadrature mix- ing Ьу fc сап Ье perforrned digitally. For example, the input sampled val ues x(nt s ) сап Ье multiplied Ьу the repetitive fourelement sequence 1, О, 1, О, etc" to provide i(n). Likewise, x(nt s ) is mu1tiplied Ьу the four- element sequence О, 1, О, 1, to generate the q(n) samples, Тhe trick is that 
302 Advoпeed Samp/iпg reehпiques i..... Contlnl.ЮU8 ...: ( I I'(n) (а) x(t) cos(21tfcnt o ) q'(n) 10 = 41c=11to sln(21tf c nt o )  , X(I) B (Ь)  .. -Ic О 'с Freq r-;1  , IX(m)1 Sampled  (с) I I rj1  МaQ , I -41 с - 31 с - 2f c -Ic О 'с = 10/4 21с 31с 41с Freq II(m)1 --. Mag12 (d) О 'с =10/4 Freq (е) l:t1  g12  -10 О 10 Freq Figure 7-3 Quadrature bandpass sampling wlth digltal mixlng: (а) quadrature sampling bIoek diagram; (Ь) spectrum of contlnuous bandpass slgnal X(t); (е) dlscrete spectrum of sampled bandpass slgnal x(nt s ); (d) frвqueney-trans/ated ,/(т) I d/serete speetrum of /n-phase eomponent of x(nt s ); (е) low-pass filtered I (т) I speetrum of In-phase component, these two orthogonal ones sequences translate the input signal's spectrum Ьу exactly 1.14, and that' s why our origina11. was made equal to 4fc' Тhis clever technique enables complex sampling without multiplications because the mixing is implemented merely Ьу sign changes оп x(пt s ). If we implement this digital mixing process, we'll find that the spectral replication period in Figure 73(d) is half what is was in Figure 7-3(с). Тhis comes about from the convolution of the real cosine's positive and nega tive frequency components with ! Х(т)! in Figure 73(c), То use this dig ital mixing scheme, we must ensure that the condition В < Ic = 1./4 holds true. In addition to the reduced spectral replication periodicity, we also 
Dlgital Resaтpliпg 303 need to Ье aware that the DFТ magnitude о! the frequencytranslated i(n), I I(m) 1, is related to the DFТ magnitude о! x(nt s )' I Х(m) 1, Ьу IХ(m)1 I I(m) Il,O,l,O=  ' (73) This is indicated Ьу the Mag and Mag/2 factors in Figures 73(c) and (d), Likewise, the DFТ magnitude о! the frequencytranslated q(п), I Q(m) 1, is re1ated to the DFТ magnitude I Х(m) I , Ьу IХ(m)1 I Q(m) 10,1,o,1 = -----т---- (7-4) 50 what this аП means is that the i(n) and q(n) signals, after translation down to zero Hz, have been reduced in amplitude Ьу а factor о! 2, We сап find out why Figure 73(d)'s replication period and equations (73) and (74) are true Ьу reviewing 5ection 10.1, which discusses several different digital quadrature mixing sequences in more detail, Thus far, we've reviewed the fundamentals of, and an efficient tech nique for, quadrature bandpass samp1ing. Let's introduce three other advanced sampling topics, all о! which fall in the general category о! dig ital resampling. 7.3 Digital Resampling The useful and fascinating process of digital resampling is а scheme for changing the effective sampling rate of а discrete signal after the signal has already Ьееn sampled, As such, resampling has таnу applications; it's used to minimize computations Ьу reducing data rates when signal band widths are narrowed through lowpass filtering. Resampling is manda tory in real-time processing when а hardware,digital processor must accept data at а rate that differs from that processor's fundamental clock rate. (А simple example of this is when а digital processor сап accept input data at а lMHz rate and the incoming data is arriving at а rate of 1.5 MHz. In this саве, the incoming data rate must Ье converted from а l.5MHz rate to а lМНz sample rate with а minimum о! signal distor tion.) In satellite and medical image processing, digital resampling is nec essary for image enhancement, image scale change, and image rotation, Resampling is also used to reduce the computational complexity of cer- тin narrowband digital filters. 
304 Advonced Soтpling Techn/ques We сап define resampling as follows: Consider the process where а continuous signal ус has been sampled at а rate off o1d = 1/T o1d ' and the discrete samples are xo1ct<п) = yc(пT o1d ). Resampling is necessary when we need xnew(п) = Yc(пT new )' and direct sampling of the continuous ус at the rate of fnew = l/Т new is not possible, For example, imagine we have an ana logtodigital (A/D) conversion system supplying а sample value every TOld seconds. But our processor сап accept data only at а rate of one sam ple every Tnew seconds. How do we obtain xnew(п) directly from xo1d(п)? One possibility is to digitaHoanalog (D/ А) convert the xo1d(п) sequence to regenerate the continuous Ус and, then, A/D convert Ус at а sampling rate of fnew to obtain xnew(п). Due to the spectral distortions induced Ьу D / А followed Ьу A/D conversion, this technique limits our effective dynamic range and is typically avoided in practice, Fortunately, accurate alldigital resampling schemes have been developed, as we shall see. 7.3.1 Resampling Ьу Decimation 5ampling rate changes соте in two flavors: rate decreases and rate increases. Decreasing the sampling rate is known as decimation. (Тhe term decimatioп is somewhat of а misnomer because decimation originally meant to reduce Ьу а factor of ten, Currently, decimatioп is the term used for reducing the sample rate Ьу any integral factor,) When the sampling rate is being increased, the process is known as interpolation, i.e" esti mating intermediate sample values, Because it's the simplest of the two ratechanging schemes, let's explore decimation first. We сап decimate, or downsample, а sequence of sampled values Ьу а factor of D Ьу retaining every Dth sample and discarding the remaining samples, Relative to the original sample rate,fold' the new sample rate is J, = fold new D (7 5) For example, to decimate а sequence xo1d(п) Ьу а factor of D = З, we retain xo1d(0) and discard x o1d (1) and x o1d (2), retain хо1d(З) and discard x o1d (4) and x o1d (5), retain x o1d (6), and so оп. 50 xnew(п) = Хо1ct<Зn), where п = О, 1, 2, etc. Тhe result of this decimation process is identical to the resu1t of originally sam.pling at а rate of fnew = fо1d/З to obtain xnew(п). Тhe spectral implica tions of decimation are what we should expect, as shown in Figure 74, where the spectrum of an original bandlimited continuous signal is indi cated Ьу the solid lines. Figure 74(a) shows the discrete replicated spec trum of xo1d(п), Xo1d(m). With xnew(п) = Хо1ct<зп), the discrete spectrum 
D/g/to/ Resamp//пg 305 Xnew(m} is shown in Figure 7-4(Ь}, Two important features are illustrated in Figure 74, First, Xnew(m) could have been obtained direct1y Ьу sam pling the original continuous signal at а rate of f new ' as opposed to deci- mating xo1in} Ьу а factor of 3. And second, there is, of course, а limit to the amount of decimation that сап Ье performed relative to the band- width of the original signa1 В, We must ensure thatfnew > 2В to prevent aliasing after decimation, When an application requires that f new Ье less than 2В, then xo1in} must Ье low-pass filtered before the decimation process is performed. An exam.ple of the need for lowpass filtering before decimation is shown in Figure 7-4(с}. If the original signal has а band width В, and we're interested in retaining only the band В', the signal between В' and fnew/2 must Ье lowpass filtered before the decimation м Х (ш !у/1 B (а) i ! I I I ! I  I I fold О f 01d Freq fY1 h1 h1 ( Ш v1 \'у/1 ["т ! 1 I i , I : i I ' I (Ь) j . I .... --Зf new 2fnew fnew О f new 2' new 3' new Freq = fold Xo1d(m) (с)  I Freq fold f new /2 (d) . fnew B r   B' -::: l о f new /2 В , .... f nfNi Freq Flgure 7-4 Decimotion Ьу о foctor of three: (о) spectrum ond replicotions of orlginol slgnol; (Ь) spectrum of signol decimoted Ьу о foctor of three; (с) exomple where only the bondwldth В' from the orlginol bondwidth В Is to Ье retoined; (d) relationship of о low-poss fllter's cutoff frequency relotlve to the bondwidth 8', 
306 Advoпced SaтplJпg Techпiques process is performed. Figure 7-4(d) shows this in more detail where the frequency response of the low-pass fi1ter, shaded, must attenuate the sig nal amplitudeabove fnew/2. In practice, the direct form of FIR filters (the structure shown in Figure 5 13) is the prevailing choice for lowpass deci- тatioп filters because of the FIR filter's linear phase response[l7], When the desired decimation factor D is large, say D > 10, there is an important feature of the filter/decimation process to keep in mind, 5ignificant computational savings тау Ье had Ьу implementing decima- tion in multiple stages, Ву way of example, let's assume that we have input data arriving at а sample frequency of 400 kНz, and we must deci- mate Ьу а factor of D = 100 because our digital processor сan only accept data at а rate of 4 kНz. Also, let's assurne that the baseband frequency range of interest is from О to 1.8 kНz, 50, with fnew = 4 kНz, we must filter out anу signal above fnew/2 Ьу having our fi1ter transition band between 1.8 kHz andfnew/2 = 2 kНz. It's Ьееn shown that the number of stages 5 in the direct form of а FIR lowpass filter is proportional to the ratio of the original sample frequency over the filter transition band, N in Figure 7-4(d)[17,18]; that is, S=k. fold  k.k& (/new /2  В' ) N ' (76) where 2 < k < 4 depending оп the amount of filter passband and stop- band ripple that сап Ье tolerated, 50 for our case, if k is 3, for example, 5 = 6000, Тhink of it, а filter with 6000 stages! Fortunately there's а better way. Let's do something that appears to compound our problem and par- tition our decimation example into two stages: decimation Ьу 50 fol- lowed Ьу decimation Ьу 2, as shown in Figure 75(a), We'll assume that the original input signal spectrum extends from zero Hz to something greater than 100 kНz, as shown in Figure 7-5(Ь). If the first lowpass fil ter LPF 1 has а cutoff frequency of 1.8 kНz and its stopband is defined to begin at 6 kНz, the output of the D = 50 decirnator wil1 have а spectrum, as shown in Figure 75(c), where our 1.8-kНz band of interest is shaded. Notice that there is aliasing of the signal between 2 kHz and 4 kHznot to worry, LPF 2 will take care of this. When LPF 2 has а cutoff frequency of 1.8 kНz and its stopband is designed to Ье 2 kHz, the output of the D = 2 decimator will have our desired spectrurn, shown in Figure 7-5(d). Тhe point is that the total number of stages in the two low-pass filters, STotal' is greatly reduced from 6000, From Eq, (76) for the combined LPF 1 and LPF 2 filters, 
Digital Resampliпg 307 Xold(п) (а)  fOId = 400 kHz (Ь) 1 х.".,  I О 200 Xld (т LPF, frequency / response (с) О 1,8 2 4 Xnew(п) f new = 4 kHz r I .. 400 Freq (kHz) Reflection 01 LPF, frequency response centered аЬои! 8 kНz 6 8 Freq (kHz) (d) 1 (тl v I .. о 1,8 2 4 Freq (kHz) Flgure ]-5 Multlstoge declmatioп: (о) decimation bIock diogram; (Ь) spectrum of origlnal signal: (с) output of the D = SO decimotor; (d) output of the D = 2 declmator, 400 8 5Total :: 5 LPF + 5 LPF :: 3. + 3.  665 stages, (77) t 2 (41.8) (21.8) This is an irnpressive computational reduction. Reviewing Eq, (7-6) for each stage, in the first stage we see that, althoughf o1 d = 400 kНz remained constant, we increased I1f. In the second stage, both t:.f and fold were reduced. Тhe fact to remember in Eq. (7-6) is that the ratio f o1d / t:.f has а much more profound effect than k in determining the number оЕ stages necessary in а lowpass filter. Тhis ехатрlе, although somewhat exag- gerated, shows the kind of computational saving afforded Ьу mu1tistage decirnation, Isn't it interesting that adding more processing stages to our original D :: 100 decirnation problem actually decreased the necessary computational requirement? 
308 Advaпced Saтp/lпg Techп/ques А sensible way to evaluate FIR decimation fi1ter implementations or any filter implementation, for that matter, is to determine the necessary nиmber of multip1ications/second, Going back to oиr original D = 3 dec imation example, let's assume fol d = 60 kНz and our decimation filter need. have on1y S = 5 mu1tiplier stages, as shown in Figure 76(a), with the ш ter coefficients being ho to h 4 , Because the xo1d(п) samples are arriving at а rate of fOld' the lowpass filter requires C D multiplications/s where C D = Sfo1d = 5 . 60,000 = 300,000 multip1ications/s. (78) In Figure 7-6(а), our decimation Ьу three is symbolized Ьу а rotary switch that rotates clockwise 1200 each time an xo1ct<п) sample апivеs and on1y every third filter output sample is retained for xnew(п), Тhis strиcture is not 80 desirable becaиse, for every 15 multiplications, we use on1y 5 prod ucts, an inefficient arrangement even when D is small. Fortunately, the switching (decim.ation) сап Ье moved ahead of the mu1tip1iers, as illus trated in Figure 7-6(Ь), and we need perform on1y CD' mu1tip1ications/s where C D '= C D = Sfo1d = 100,000 mu1tiplications/s. D D (7-9) Ву moving the decimation process ahead of the multipliers, we give the multipliers D = 3 times as long to perform а mиltiplication, and xnew(п) is identical in the two filter structures, (Н our oddorder FIR filter coeffi cients are symmetrical, so that h(4) = h(O), and h(3) = h(l), there's а clever way to further reduce the number of necessary multiplications, as described in Section 10.8,) Let' s step back for а moment to make sure we иnderstand what' s going оп here, The rotating switches in Figure 76 are on1y conceptual, Again, the 8witch in Figure 76(a) means that we retain on1y every third output sample of x new ' In this case, the filter is operating at the input sample rate of fold and we discard two out of every three fi1ter output samples, In Figure 76(b), we don't even bother to calculate the two out of every three samples that are to Ье discarded; here, the fi1ter is operating at the reduced output sample rate offnew where we calculate on1y those output samples that we need, Ву the way, ПR filters cannot take advantage of the reduced computation scheme in Figure 7-6(Ь) because the various imple mentations of ПR fi1ters mandate that they must always operate at the input sample rate f01d' 
Dlgital Resaтpllпg 3()4 11(0) Swltch О (8) 11(0) (Ь) FJgure 7-6 Declтotloп fllter lтpleтentatlons: (о) flve-stage FIR dlgltol fllter: (Ь) deciтotlon toking ploce bвfore the fllter тultlpllcotlons, Before we leave the subject, it's interesting to rea1ize that decimation is опе of those rare processes that is not time invariant. From the very nature of its operation, we know that if we delay the input sequence Ьу опе sample, а downsampler wi1l generate an entirely different output sequence. For example, if we apply ап input sequence х(п) = х(й), x(l), х(2), х(3), х(4), etc., to а downsampler and D = 3, the output у(п) will Ье the sequence х(й), х(3), х(6), etc, Should we delay the input sequence Ьу опе sample, our delayed х'(п) input would Ье x(l), х(2), х(3), х(4), х(5), etc, In this case, the de1ayed output sequence у'(п) would Ье x(l), х(4), х(7), etc., which is not а delayed version of у(п), Тhus, а decimator (downsampler) is not time invariant. 7.3.2 Resampling Ьу Interpolation As we said before, decimation is only part of the digital resampling storylet's now consider interpolation, Sample rate increase Ьу interpo- lation is а bit more involved than decimation because, with interpolation, new sample values need to Ье ca1culated, Conceptually, interpolation . 
31 О Advaпced Saтpliпg Techп/ques comprises generating а continuous curve that passes through our Xo1in) sampled values, followed Ьу resampling that curve at the new sample rate fnew to obtain the sequence xnew(n), Of course, continuous curves can't exist inside а digital machine, so we'll just have to ()btain xnew(n) directly from xo1in), То increase а given sample rate or upsample Ьу а factor of и, we have to calculate U1 intermediate values between each sample in x o1d (11). Тhe process is beautifully straightforward and best understood Ьу way of an example. Let's assume that we have the sequence xo1d(n), part of which is shown in Figure 77(a), and we want to increase its sample rate Ьу а fac tor of 4, so, и::;: 4. The sequence's spectrum is provided in Figure 77(b) where only the signal spectrum between О Hz and 4fo 1 d is shown. То upsample xo1d(n), Ьу а factor of four, we must insert three zeros between each sample of xo1d(n) as shown in Figure 7-7(с), to create the new sequence x'new(n'), (This insertion of zeros is called zero padding,) Notice that X'new(n') = xo1d(n) , when n' = 4n ; (710) that is, the old sequence is now embedded in the new sequence. Тhe inser tion of the zeros establishes the sample index for the new sequence xnew(n') where the interpolated values will Ье assigned, Тhe spectrum of x'new(n'), X'new(m), is shown in Figure 77(d) where fnew = 4fold' In Figure 7-7(d), notice that xo1in)'s spectrum is replicated и = 4 times in the frequency range of zero Hz to f new ' Тhis shouldn't surprise us; xo1in)'s spectrum was already replicated 4 times between О Hz and fnew in Figиre 77(b), What we've done Ьу adding the zeros is merely increase the effective sample fre quency to fs = fnew in Figure 7-7(d). Likewise, we've also increased the new folding frequency Ьу а factor of 4 to 2fold' ТЬе final step in interpolation is to fi1ter the x'new(n') sequence with а lowpass digital filter whose frequency response about zero Hz and fnew Hz is shown as the dashed lines in Figure 77(d), Тhis low-pass filter is called Щl interpolation filter, and its output sequence is the desired xnew(n'), shown in Figure 7-7(е) while its output spectrum is given in Figure 7-7(f). Is that аН there is to interpolation? Well, not quitebecause we can't implement an ideallow-pass fi1ter, xnew(n') will not Ье an exact interpola tion of xo1d(n). Тhe error manifests itself as the unwanted images indicated Ьу the lowlevel replications in Figure 77и), With an ideal fi1ter, these images would not exist, We сап only approximate an ideal, lowpass fi1- ter, and the accuracy of our entire interpolation process depends оп the frequency response of our filter approximation! As with decimation, 
O/g/ta/ Resaтpllпg 311 (а) t XOld(п " I т.,'d Xo1d(т) " (Ь)  Time о f o1d (f s ) 2fold 3f o ld 4f o1d Freq 1 Xew (rt) (с) "" '..I1' Tnew Told " ! (d) f o1d 2f o1d 3f o1d f new Freq (f s ) ... ... Time (е) X new (rt) ...I!I.....T .. i' :: " t x...' ' о f o1d " .. , 2f o1d 3f  d'  f new Freq (fэ) т,;еw Id Time Figure 7-7 Interpolation Ьу а faetor of foШ: (а) origina/ sampled sequenee; (Ь) speetrum of orlglnal sequenee; (е) zeros inserted in orlglnai sequenee; (d) speetrum of sequenee with Inserted zeros; (е) output sequenee of interpo/ation filter; (f) output speetrum of interpolation interpolation сап Ье thought of as, fundamentally, а low-pass filter design exercise, and the choice of interpolation filter structure deserves attention, If the FIR interpolation filter design requires S filter stages, we need not perform S multiplications to get each of the Xnew(n') samples in Figure 77(e). Ву way of an example, retuming to our U == 4 interpolation case, let's assume we've decided that we need а low-pass filter with S == 19 stages. Our example uses an FlR filter with an odd number of stages because this is the орНmиm structure used for interpolation filters[19], The job of our low-pass filter is to convolve its impulse response with the x'new(n') sequence, Figure 7-8(а) shows the low-pass filter's impulse response being applied to а portion of the x'new(n') samples to calculate the ninth sample of xnew(n'), x new (9), The 19 filter coefficients are indi- cated Ьу the Xs in Figure 7-8(а), With the dots in Figure 7-8(а) represent- ing the x'new(n') sequence, we see that, although there are 19 Xs, only the bold Xs generate nonzero products that contribute to the convolution surn x new (9), The issue here is that we need not perform the multiplications associated with the zero-valued samples in x'new(n'), In our example, we need only perform five multiplications to get x new (9) , For the general case, 
312 Advaпced Saтpliпg Techпiques X new (9) j 1 х....х'>< / \ х х I \ i /1. ., b.Jt 1 J. I Jt ' Jc . .L .." ....X'-Х...Jt' \ 'Xx"'X . (а) R ....  Time п'=9 X new (9) (Ь) .". "Х....А...о / \ ,;0 0\ . .. : /' .\ i ...o c.:>A......O...O.JC....6 6.....00....  /6  Time Flgure 7-8 Nlneteen-stoge Interpolotion filter coefflclents: (о) Interpolotion filter's iтpulse response shlft posltlon to colculote x new (9); (ь) Xs тark the only filter coefficlents thot need Ье used to colculote x new (9}, the number of multiplications necessitated Ьу an oddorder symmetrical interpolation FIR filter, for each sample of Xnew(п'), сaлnоt Ье expressed in а closed {оrrn for all possible values of 5 and и, but it сan Ье shown that the minimum number of nonzero multiplications C Umin is C Umin = r  1 multiplications, U (7-11) where r 1 means "the largest integer contained in." C Umin is the number of x'new(п,) values that will Ье used in the interpolation to deterrnine each xnew(п,) sample. Тhe number of necessary multiplications/s is Cuminfnew' 50 the good news is that the number of interpolation ffiter multiplica tions necessary is approximately equal to S/U, and that's quite а reduc tion in computational complexity, Тhe bad news is that we still require that 5 = 19 filter coefficients Ье stored, and we can't take advantage of anу filter coefficient symmetry to reduce the number of multiplications Ьу а further factor of two as described in 5ection 10,8. Both of these minor 
Digital Resaтpliпg 313 problems are the price we must рау to take advantage оЕ Eq, (7-11), and they can Ье understood Ьу examining Figure 78(b). То illustrate our U = 4 example, in Figure 7-8(Ь), we use the filter coefficients indicated Ьу the Xs to calculate x new (9) , When we slide the filter's impulse response to the right one sample, we use the coefficients indicated Ьу the circles to calcu late x new (10) because the nonzero values of x'new(n') wi111ine ир under the circled coefficients. Likewise, when we slide the impulse response to the right one more sample to calculate x new (l1), we use the coefficients indi cated Ьу the diamonds. Finally, when we slide the impulse response to the right once more, we use the coefficients indicated Ьу the triangles to cal culate x new (12). 5liding the filter's impulse response once more to the right, we retum to using the coefficients indicated Ьу the Xs to calculate x new (13). Уои can see the pattem herthere are и, where U =' 4 in our example, different sets of coefficients that are used to calculate xnew(n') from the x'new(n') samples. Each time а new xnew(n') sample value is to Ье calculated, we rotate one step through the sets of coefficients and use the 11 coefficient set, when п' = О, 4, 8, 12, . . ., 4п, the Х coefficient set, when п' = 1, 5, 9, 13, . , ., 4п+ 1, the о coefficient set, when п' = 2, 6, 10, 14, . . ., 4п+2, and the О coefficient set, when п' = 3, 7, 11, 15, . . ., 4п+3. This rotation through U sets of coefficients, where each set contains approximately 5 I U coefficients, is why interpolation fi1ters are sometimes called timevarying, or po/yphase, filters. At different times, we use differ- ent filter coefficients. 50, even though we don't have to perform 5 = 19 multiplications for еаф xnew(n') value, we do have to have 5 = 19 fi1ter coefficients stored and available to calculate еаф xnew(n'). (During the calculation of any given xnew(n') sample, because the coefficients are not necessarily symmetrical, we can't take advantage of any symmetrical ffiter strncture to reduce the number of multiplications Ьу an additional factor of two as discussed in 5ection 10.8.) There's one finа1 important feature of the FIR filter's соеШ- cients indicated Ьу the triangles. For our example, when the filter's impulse response peak is aligned above one of the nonzero values of x'new(n'), notice that the other coefficients indicated Ьу the remaining tri angles have va1ues of zero. Тhis results in the agreeable characteristic that xnew(n') = x'new(n') = x'пew(4п), so that the output of the filter at the original sampling times is equal to the original samples. 
314 Advaпced Saтpllпg Techпiques 7.3.3 Gomblnlng Decimation and Interpolation While changing sampling rates through decimation or interpolation Ьу integer factors can Ье шеЫ, what can we do if we need а sample rate change that is not an integer? Тhe good news is that we can implement sample rate changes Ьу any rational fraction и/о with interpolation Ьу а factor о! и followed Ьу decimation Ьу а factor о! О. Весаше the fraction и/о can Ье obtained as accurately as we want with the сопесt choice о! integers и and О, we can change sample rates Ьу almost any factor in practice, For example, а sample rate increase Ьу а factor о! 7.125 сап Ье performed Ьу an interpolation о! и = 57 followed Ьу а decimation о! 0= 8, Ьесаше 7.125 = 57/8. This и/о sample rate change is illustrated Ьу the processes shown in Figure 7-9(а). The really neat part here is that the computational bur- den о! changing the sample rate Ьу the combination о! и/о is less than the sum о! an individual interpolation followed Ьу an individual deci mation because we сап сотЬinе the interpolation filter LPF u and the decimation filter LPF D into а single filter, shown as LPFU/D in Figure 7- 9(Ь)_ The process in Figure 7-9(Ь) is normally called а sample rate con- verter because, if и > о we have interpolation, and, when О > и, we have decimation. (The filter LPFU/D is sometimes referred to as an interpolation filter, regardless о! the ratio и/о, and sometimes it's called а тultirate filter,) LPFU/D serves two purposes for us now, First, it must sufficiently attenuate the interpolation images illustrated in Figure 7-7и), so that, after decimation, they don't contaminate our desired signal beyond acceptable limits. Second, it must have а cutoff frequency that prevents aliasing о! our desired signal images resulting from the final decimation, То illustrate these filter requirements, let's assume we need to resam ple an input sequence Ьу 4/3 or 1.333, so, и = 4, and О = 3, Тhe original sequence xo1d(n) has the spectrum shown in Figure 79(c). Тhe spectrum о! the intermediate sequence x'new(n') after upsampling Ьу 4 and lowpass filtering Ьу LPFU/D is shown in Figure 7-9(d), Тhe spectral result, after the 0= з decimation to obtain,the desired output sequence xnew(n"), is shown in Figure 7-9(е). Notice that the frequency response о! LPFU/D must Ье designed so that the stopband frequency, !stop' is less than !new/2 to avoid aliasing after the decimation. О! course LPFU/D is а timevarying filter as described above for Figure 7-8, Тhe attenuation о! LPFU/D beyond !stop must Ье great enough, so that the images (shown in Figure 79(d) at mul- tiples о! !old) do not induce intolerable levels о! noise when they're aliased Ьу decimation into the final band о! О to !MW/2 Нz. If the number о! mul 
Interpolation Digito/ Resoтpliпg 315 Dвclmation (а) xold(n) Xnew(n") Sample Rate Converter (Ь) xOld(n) (с) (d) 'Old ('s) 1] ne W(m) LPF  U/D .  . t  О 'stop 'Old (в) В\ ,тl о ! 'stop I \ 'new -т Lr i 'new ('s) /1 ! ) 1 2'old 3'Old 4'Old Freq  ' 1  . . ,,,  1 . ., Iб '" .. Freq "new (I S ) r  T /! 1"''> , ! .. Frвq 2, new Flgure 7-9 Samp/e rate eonversion Ьу а faetor of 4/3: (а) eombinatlon of Interpolatlon and deelmatlon; (Ь) sample rate eonverslon with а slngle lowpass fi/ter; (е) orlglnal dlserete Input sequenee speetrum; (d) speetrum of the low-pass filter output; (е) final diserete speetrum after deelmation Ьу а faetor of 3, tiplication stages in LPFU/D is 5, the computational complexity оЕ our interpolator/decimator implementation is given Ьу С и / о =  multiplications/output sample, UD (7-12) 
316 Advoпced Saтpllпg Techп/ques Because the input to LPFU/D is nonzero only for every uth filter input sample, so, for each filter output sample we need only perform S/U mul tiplications, Moreover, our decimator discards аll but every Dth filter out- put sample, so the actual number ofmultiplications necessary is (S/U)/D multiplications per decimator output sample, Again, our interpolator / decimator problem is an exercise in low-pass filter design, and аll the knowledge and tools we have to design low-pass filters сап Ье applied to this task. In software interpolator / decimator design, we want our lowpass filter algorithm to prevent aliasing images and Ье fast in execution time, For hardware interpolator / decimators, we strive to implement а design that optimizes the conflicting goals of high performance (minimum aliasing), simple architecture, high data through- put speed, and low power and parts COunt requirements, This introduction to digital resampling has, Ьу necessity, only touched the surface of this important signal processing technique, Fortunately for us, ilie excellent work of the first engineers and mathematicians to explore this subject is well documented in the literature. Тhe inquisitive reader сап probe further to learn how to choose the number of stages in а multi stage process[17,20], the interrelated considerations of designing opti mum FIR filters[17,21], the benefits of halfband FIR filters[18,22], when ПR filter structures тау Ье advantageous[21], what special considerations are applicable to resampling in image processing[2325], guidance in developing the controllogic necessary for hardware implementations of resarnpling algorithms[21], how resampling improves the usefulness of commercial test equipment[26,27], and software development tools for designing multirate filters[28], References [1] Floyd, Р., and Taylor, J. "Dual-Channel Space Quadrature-Interferometer System," Microwave Systeт Desigпer's Haпdbook, Fifth Edition, Microwave Systems News, 1987. [2] Hack, Т, "IQ Sampling Yields Flexible Demodulators," RF Desigп Мagaziпe, Aprill991, [3] Mirage Systems, "Automated-Radar-Measurement System for Pulsed I/Q Data Collection," Microwave Systeт News aпd Coттuпicatioпs Techпology, December 1987. [4] Chester, О, В" and РhiШрs, G, "Use DSP Filter Concepts in IF System Design," Electroпic Desigп, July 11, 1994, [5] Steyskal, Н, "Digital Beamforming Antennas," Microwave Jourпal, January 1987, 
Refereпces 317 [6] Maruta, R., and Tomozawa, А. "An Improved Method for Digital SSBFDM Modulation and Demodulation," IЕЕЕ Trans, оп Communications, Vol, СОМ-26, No, 5, Мау 1978, [7] Albaugh, N, "New ADCs for RF Signal Processing," RF Desigп, November 1987, [8] Oxaal, J, "DSP Hardware Improves Multiband Filters," EDN, March 1983. [9] Sigman, Е, "Simplified Digital Down-Converters," NASA Tech Briefs, July 1995, [10] Coleman, В" Meehan, Р" Reidy, J" and Weeks, Р, "Coherent Sampling Helps When Specifying DSP А/О Converters," EDN, October 1987, [11] Kester, W, "DSP Test Techniques Кеер Flash ADCs in Check," EDN Magazine, January 18, 1990, [12] Morris, G., Jr" and Wilck, Н, "JPL 220 Channel 330 MНz Bandwidth Digital Spectrum Analyzer," IЕЕЕ Proc" Int, Conference, Acoust" Speech, Signa/ Processing, 1978, [13] Considine, V, "Digital Соmрlех Sampling," Electronics Letters, 19,4 August, 1983, [14] Rader, С. М, "А Simple Method for Sampling InPhase and Quadrature Components," IЕЕЕ Trans, оп Aerospace and Electronic Systems, Vol. AES-20, No, 6, November 1984, [15] Юсе, О" and Wu, К. "Quadrature Sampling with Нigh Dynarnic Range," IЕЕЕ Trans, оп Aerospace and Electronic Systems, Vol, АЕ5-18, No. 4, November 1982, [16] Pellon, L, Е, "А ОоиЫе Nyquist Digital Product Detector for Quadrature Sampling," IЕЕЕ Trans, оп Signal Processing, Vol, 40, No, 7, July 1992. [17] Crochiere, R. Е., and Rabiner, L, R. "Optimum FlR Digital Implementations for Decimation, Interpolation, and Narrow-band Filtering," IЕЕЕ Trans, оп Acoust, Speech, and Signa/ Proc" Vol, ASSP-23, No. 5, October 1975, [18] Bal1anger, М, G, "Computation Rate and Storage Estimation in Multirate Digital Fi1tering with Half-Band Filters," IЕЕЕ Trans, оп Acoust, Speech, and Sigпal Proc" Vol. ASSP-25, No. 4, August 1977, [19] Schafer, R, W" and Rabiner, L. R, "А Digital Signal Processing Approach to Interpolation," Proceedings ofthe IЕЕЕ, Vol, 61, No, 6, June 1973, [20] Crochiere, R, Е" and Rabiner, L. R. "Decimation and Interpolation оЕ Digital Signals-----A Tutorial Review," Proceedings ofthe IЕЕЕ, Vol, 69, No, 3, Мзrch 1981, [21] Crochiere, R, Е" and Rabiner, L, R. "Further Considerations in the Design оЕ Decimators and Interpolators," IЕЕЕ Traпs, оп Acoust, Speech, and Signal Proc" Vol, ASSP-24, No, 4, August 1976, [22] Bal1anger, М, G" Daguet, J. L., and Lepagnol, G, Р, "Interpolation, Extrapolation, and Reduction оЕ Computational Speed in Digital Filters," IЕЕЕ Trans, оп Acoust, Speech, and Sigпal Proc" Vol, ASSP-22, No, 4, August 1974. 
31 в Advaпced Soтp/iпg Techпiques [23] Нои, Н, 5" and Andrews, Н, С. "СиЫс Splines for rmage Interpolation and Digital Filtering," IБЕЕ Trans, оп Acoust, Speech, and Signal Proc" Vol, ASSP-26, No, 6, Aиgust 1978. [24] Keys, R, G, "СиЫс Convolиtion Interpolation for Digital Image Processing," IЕЕЕ Trans, оп Acoust, Speech, and Signal Proc" Vol, ASSP-29, No, 6, Aиgust 1981, [25] Parker, J, А, Кеnуоn, R. V" and Troxel, О, Е, "Comparison оЕ Interpolating Methods for rmage Resampling," IЕЕЕ Тrans, оп Medical lтaging, Vol, МИ, No, 1, Aиgust 1983, [26] Вlие, К. J" et аl, "Vector Signal Analyzers for Difficu1t Measиrements ол Тime-Varying and Соmрlех Modиlated Signals," HewlettPackard Journal, December 1993. [27] Bartz, М" et аl" "Baseband Vector Signal Analyzer Hardware Design," Hewlett-Packard Journal, December 1993. [28] Mitchell, J, А "Mиltirate Fi1ters Alter Sampling Rates Even After Yoи've Captured the Data," EDN, Aиgиst 20, 1992, 
ICHAPTER EIGHTI Signal Averaging How do we determine the typical amount, а valid estimate, or the true value of some measured parameter? In the physical world, it's not so easy to do because unwanted random disturbances contaminate our measure- ments. Тhese disturbances are due to both the nature of the variable being measured and the fa11ibility of our measuring devices, Each time we try to accurately measure some physical quantity, we'll get а slight1y different value. Тhose unwanted f1uctuations in а measured value are ca1led пoise, and digital signal processing practitioners have learned to minimize noise through the process of averaging, In the literature, we сan see not only how averaging is used to improve measurement accuracy, but that aver aging also shows ир in signal detection algorithms as we1l as in lowpass fi1ter schemes, Тhis chapter introduces the mathematics of averaging and describes how and when this important process is used, Accordingly, as we proceed to quantify the benefits of averaging, we're compe1led to make use of the statistical measures known as the mеan, variance, and standard deviation, In digital signal processing, averaging often takes the {олn of summing а series of timedomain signal samples and then dividing that sum Ьу the number of individual samples, Mathematica1ly, the average of N samples of sequence х(п), denoted xave' is expressed as 1 N xave = N Lx(п) п=l х(l) + х(2) + х(3) +.,. + x(N) N (8-1) (What we саН the average, statisticians call the mеап.) In studying averag ing, а key definition that we must keep in mind is the variance of the sequence а 2 defined as 319 
320 Sigпal Averogiпg 2 1 N 2 (j == N :rx(n)  Xave] , п=l (82) == [х(l)  Xave]2 + [х(2)  Xave]2 + [х(3)  Xave]2 + .., + [x(N)  Xave]2 (82') N ' As explained in Appendix D, the а2 variance in Eqs, (82) and (82') gives us а well-defined quantitative measure of how much the values in а sequence fluctuate about the sequence's average. Тhat's because the x(l)  xave value in the bracket, for example, is the difference between the x(l) value and the sequence average x ave ' Тhe other important quantity that we'll use is the standard deviation defined as the positive square root of the variance, or 1 N (1= N )X(n)Xave]2 , п=l (8-3) То reiterate our thoughts, the average value xave is the constant level about which the individual sequence values тау vary. Тhe variance а2 indicates the sum of the magnitudes squared of the noise fluctuations of the individual sequence values about the xave average value. If the sequence х(п) represents а time series of signal samples, we сап say that xave specifies the constant, or DC, value of the signal, the standard devia tion (j reflects the amount of the fluctuatin or АС, component of the sig- nal, and the variance а2 is an indication of the power in the fluctuating component. (Appendix D explains and demonstrates the nature of these statistical concepts for those readers who don't use them оп а dai1y basis.) We're now ready to investigate two kinds of averaging, coherent and incoherent, to leam how they're different from each other and to see under what conditions they should Ье used. 8.1 Coherent Averaging In the coherent averaging process (also known as linear, predetection, or vector averaging), the key feature is the timing used to sample the origi nal signal; that is, we collect mu1tiple sets of signal plus noise samples, and we need the time phase of the signal in each set to Ье identical. For example, when averaging а sinewave embedded in noise, coherent aver- aging requires that the phase of the sinewave Ье the same at the beginning of each measured sample set. When this requirement is met, the sinewave 
Cohereпt Averagiпg 321 will average to its true sinewave amplitude value, Тhe noise, however, is different in each sample set and wil1 average toward zero,t The point is that coherent averaging reduces the variance of the noise, while preserv ing the amplitude of signals that are synchronous, or coherent, with the beginning of the sampling interval, With coherent averaging, we сап actu ally improve the signaltonoise ratio of а noisy signal, Ву way of ехаm- ple, consider the sequence of 128 data points plotted in Figure 8l(a), Тhose data points represent the time-domain sampling of а single pulse contaminated with random noise. (For illustrative purposes the pulse, whose peak amplitude is 2.5, is shown in the background of Figure 8-1,) It's very difficu1t to see а pulse in the bold pulse-plus-noise waveforrn in the foreground of Figure 81(a). Let's say we collect 32 sets of 128 pulse plusnoise samples of the forrn Sample Set 1 = х 1 (1), х 1 (2), Х 1 (3) , .." х 1 (128) , Sample Set 2 = Х/1), х 2 (2), Х 2 (3) , ..., х 2 (128) , Sample Se = Хз(l), х з (2), Х з (3) , ,." х з (128) , Sample Sеt З2 = х з2 (1), х з2 (2), Х з2 (3) , ..., х з1 (128) . (8-4) Here's where the coherent part comes in; the signal measurement times must Ье synchronized, in some manner, with the beginning of the pulse, so that the pulse is in а constant time relationship with the first sample of each sample set, Coherent averaging of the 32 sets of samples, adding ир the columns of Eq, (84), takes the form of 1 З2 xave(k) =  Lxn(k) = [Х 1 (k) + x2(k) + хз(k) +... + ХЗ2(k)] / 32 , 32 n=1 or Хауе (1) = [Х 1 (1) + Х 2 (1) + Хз (1) +... + Х З2 (1)] / 32 Х ауе (2) = [Х 1 (2) + х 2 (2) + х з (2) + .., + х з2 (2)]/ 32 Х ауе (3) = [х 1 (3) + Х 2 (З) + хз(З) + ." + Х З 2(3)]/ 32 Х ауе (128) = [Х 1 (128) + Х2(128) + х з (128) +... + х з2 (128)] / 32 (8-5) t Noise samples are assumed to Ье uncorrelated with each other and uncorrelated with the sample rate, If some component of the noise is correlated with the sample rate, that noise component will ье preserved after averagirlg, 
322 S/gпa/ Averag/пg . ... (а) i i .......... ...j.. о 1 20 40 , N=1 60 80 100 120 Time Amplitude 4 j ! i ) 3 . .,. ..".... .....ш.l,-l,. iJ..... J' .оМ f\f'I л J rI\ "".;;  .Л i 2 V iш YV V; VVT V '-' ! ' Yi'-'/Y'  , " (Ь) 1 1 20 40 : N=32 : 60 80 100 120 Тiтe Amplltude 4 , ' , ! Pulse falling ! .L Pulse rlsJng 3 / ' 9 iшшшшшJш , J+". (с) 1 1 20 40 iN=256: 60 80 100 120 Тiтe Figure 8.1 Slgnal pulse plus noise: (а) one sample set; (Ь) average of 32 sample sets; (е) average of 256 sample sets, If we perform 32 averages indicated Ьу Eq. (85) оп а noisy pulse like that in Figure 81(a), we'd get the 128point xave(k) sequence plotted in Figure 81(b), Here, we've reduced the noise fluctuations riding оп the pulse, and the pulse shape is beginning to Ьесоmе apparent, The coher ent average of 256 sets of pulse measurement sequences results in the plot shown in Figure 81(c), where the pulse shape is clearly visible now_ We've reduced the noise fluctuations while preserving the pulse amplitude, (An important concept to keep in mind is that summation 
Cohereпf Averagiпg 323 and averaging both reduce noise variance. Summation is merely imple- menting Eq, (85) without dividing the sum Ьу N = 32, If we perform summations and don't divide Ьу N, we merely change the vertical scales for the graphs in Figure 8-1(Ь) and (с), However, the noise Лис- tuations will remain unchanged relative to true pulse amplitude оп the new scale.) The mathematics of this averaging process in Eq. (8-5) is both straight- forward and important, What we' d like to know is the signal-to-noise improvement gained Ьу coherent averaging as а function of N, the num- ber of sample sets averaged, Let's say that we want to measure some con stant time signal with amplitude А, and еат time we actually make а measurement we get а slightly different value for А. We realize that our measurements are contaminated with noise such that the nth measure- ment result r(n) is У(n) =А + noise(n) , (8-6) where noise(n) is the noise contribution, our goal is to determine А when the r(n) sequence of noisy measurements is all we have to work with, For а more accurate estimate of А, we average N separate r(n) measurement samples and calculate а single average va1ue 'ауе' То get а feeling for the accuracy of rave' we decide to take а series of averages rave(k), to see how that series fluctuates with each new average; that is, rave(l) = [r(l) + r(2) + r(3) + ... + r(N)]/N ,  lstN-роiпt average r ave (2) = [r(N+1) + r(N+2) + r(N+З) +.., + r(2N)]/N, 2ndN.pointaverage rave(3) = [у(т+1) + r(2N+2) + r(2N+3) +... + r(ЗN)]/N, ЭrdN-роiпtаvеrаgе rave(k) = [r([kl] .N+1) + r([kl] .N+2) +r([k11.N+З) + ... +r(k. N)l/N , (8-7) or, more concisely, 1 N rave(k) = N Lr([kl]'N+n) п=l (8-8) То see how averaging reduces our measurement uncertainty, we need to compare the standard deviation of our rave(k) sequence of averages with the standard deviation of the original r(n) sequence, 
324 Sigпal Averaglпg If the standard deviation of our original series of measurements r(п) is 0in' it has been shown [1-5] that the standard deviation of our rave(k) sequence of N-point averages, Оауе' is given Ьу (Т, (Тауе == Ш (8-9) Equation (8-9) is significant because it tells us that the r ave(k) series of aver- ages will not fluctuate ав much about А as the original r(п) measurement values did; that is, the rave(k) sequence will Ье less noisy than any r(п) sequence, and the more we average Ьу increasing N, the more closely an individual rave(k) estimate will approach the true value of л. t In а different way, we сап quantify the noise reduction afforded Ьу averaging, If the quantity А represents the amplitude of а signal and Оin represents the standard deviation of the noise riding оп that signal атрН- tude, we сап state that the original signal-amplitude--to-noise ratio is А SNR in ==  (Т. m (8-10) Likewise, the signal-amplitude--to-noise ratio at the output of ал averag- ing process, SNR ave is defined ав SNR == rave ==  ауе (J ауе (J ауе (8-11) Continuing, the signal-to-noise ratio gaiп, SNR coh gain, that we've realized through coherent averaging is the ratio of SNR ave over SNR in , or SNR ' SNR ave g am coh  SNR. m А / (J ауе = (J in А / (Тin (J аУе (8-12) Substituting (Тауе from Eq. (8-9) in Eq, (8-12), the SNR gain becomes SNR coh gain == (Jin.JN ==.JN ' (Тin / N (8-13) t Equation (8-9) is based оп the assumptions that the average of the origtna! nоше is zero and that neither А nor а in change during the time we're perfonning our averages. 
Cohereпt Averagiпg 325 Тhrough averaging, we Сan realize а signaltonoise ratio improvement proportional to the square root of the number of signal samples averaged, In terms of signaHonoise ratio measured in decibe1s, we have а coherent averaging, or iпtegratioп, gain of SNR coh gain(dB) = 20.1og lO (SNR coh ) = 20.10g lO (#J) = 10.1og lO (N) , (814) Again, Eqs, (8lЗ) and (814) are valid if А represents the aтplitude of а sig nаl and O'in represents the original noise standard deviation, Another way to view the integration gain afforded Ьу coherent aver aging is to consider the standard deviation of the input noise, O'in and the probability of measuring а particular value for the Figиre 8-1 pulse ampli tude. Assume that we made тапу individual measurements of the pulse amplitude and created а finegrained histogram of those measиred values to get the dashed curve in Figиre 82(a), Тhe vertical axis of Figure 82(a) represents the probability of measuring а pulseamplitude value corr sponding to the values оп the horizontal axis, If the noise fluctuations fol low the wellknown пorтal, or Gaussian distribution, that dashed probability distribution curve is described Ьу р(х) = 1 e--(хJl)2 12(12 = Ke(xJl)2/2(12 0'$ (8 15) where о' = o'in and the true pulse amplitude is represented Ьу 11 = 2.5, We see from that dashed curve that аnу given measured value wil1 most likely (with highest probability) Ье near the actual pulseamplitude value of 2.5, Notice, however, that there's а nonzero probability that the тea sured value could Ье as low as 1.0 or as high as 4.0. Let's say that the dashed curve represents the probability curve of the pulse-plusnoise sig- nаl in Figure 81(a), If we averaged а series of 32 pulse-amplitude values and plotted а probability curve of our averaged pulse-amplitude теа- surements, we' d get the solid curve in Figure 8-2, Тhis curve characterizes the pulseplusnoise values in Figиre 8-1(Ь), From this solid curve, we see that there's а very low likelihood (probability) that а measured value, after 32point averaging, will Ье less than 2.0 or greater than 3.0. From Eq, (89), we know that the standard deviation of the result of averaging 32 signal sample sets 0" 0" о' =.......J!L=.......J!L ауе .J32 5.65 (8-16) 
326 Sigпol Averoglпg Р(Х) к О,2К ш '" I / О,ВК О,БК О.4К ш "- ... о о 1,0 2,0 3,0 4,0 Measured amplitude (Х) Flgure 8-2 Probobility density curves of meosured pulse omplitudes with по overaglng (N = 1) and wlth N = 32 overaglng, In Figure 8-2, we can see а statistical view of how an averager's output standard deviation is reduced from the averager's input standard devia- tion. Taking larger averages Ьу increasing Nbeyond 32 would squeeze the solid curve in Figure 82 even more toward its center value of 2.5, the true pulse amplitude,t Returning to the noisy pulse signal in Figure 81, and performing coherent averaging for various numbers of sample sets N, we see in Figure 83(a) that as N increases, the averaged pulse amplitude approaches the true amplitude of 2.5. Figure 83(b) shows how rapidly the variance of the noise riding оп the pulse falls off as N is increased, An alternate way to see how the noise variance decreases with increasing N is the noise power plotted оп а logarithmic scale as in Figure 8-3(с). In this plot, the noise variance is normalized to that noise variance when по averaging is performed, i.e., when N = 1. Notice that the slope of the curve in Figure 83(c) closely approximates that predicted Ьу Eqs. (813) and (814); that is, as N increases Ьу а factor of 10, we reduce the average noise power Ьу 10 dB. Although the test signal in this discussion was а pulse signal, had the signal been sinusoidal, Eqs. (8-13) and (814) would still apply, t The curves in Figure 8-2 are normaJized for convenient iJJustration, From Eq, (8-15) and assUlnmg that cr = 1 when N = 1, then К = 0,3989, When N = 32, the new standard deviation is cr' = crl ffi = 11 -J3i and К = 0,3989' -J3i = 2,23, 
/пcohereпt Averagiпg 327 2.60 Averaged pulse amplllude 2,55 . .... . ' (а) 2,50 ...\/.. . 2,45 . ........ ... .....;..... . . 2.40 О 100 200 зоо 400 500 N Averaged pulse-amplitude variance, а;уе 0,9 : . , 0.6 0,5 ... ......... ................ (Ь) 0.4 f.. о.зl . . . 0,2 \ . 0,1 .... О ...,,_.,... "'{},1 О 100 200 ЗОО 400 . 500 N  10 (с) 15 20 25 30 1 10 100 500 N Flgure 8-3 Results of overaging signol pulses plus nolse: (а) meosured pulse omplltude vs, N; (Ь) meosured vorlonee of pulse omplitude vs, N; (е) meosured pulse-omplitude noise power vs, N оп а logorithmlc seole. 8.2 Incoherent Averaging The process of incoherent averaging (also known as rms, postdetection, scalar, or video averaging) is the averaging of signal samples where по sample timing constraints are used; that is, signal measиrement time 
328 Sigпcl Averagiпg intervals are not synchronized in any way with the phase of the signal being measured. Think for а moment what the average would Ье of the noisy pulse signal in Figure 8-1(а) if we didn't in some way synchronize the beginning of the collection оЕ the individual signal sample sets with the Ъеginning of the pulse. The resu1t would Ье pulses that begin at а dif- fereI1t time index in each sample set. The averaging of multiple sample sets would then smear the pulse acrDSS the sample set, or just "average the pulse signal away." (For those readers fam.iliar with using oscillo- scopes, incoherent averaging would Ье like trying to view the pulse when the beginning of the scope sweep was not triggered Ьу the signal.) As such, incoherent averaging is not so useful in the time domain. t In the frequency domain, however, it's а different story because incoherent averaging can provide increased accuracy in measuring relative signal powers. lndeed, incoherent averaging is used in many test instruments, such as spectrum, network, and signal analyzers. In some analog test equipment, timedomain signals are represented in the frequency domain using а narrowband sweeping filter followed Ьу а power detector, These devices measure signal power as а function of fre quency. The power detector is necessary because the sweeping measure- ment is not synchronized, in time, with the signal being measured. Thus the frequency-domain data represents power only and contains по signal phase information. Although it's too late to improve the input's signal- amplitudetonoise ratio, incoherent averaging can improve the accuracy of signal power measurements in the presence of noise; that is, if the signalpower spectrum is very noisy, we can reduce the power estimation fluctuations and improve the accuracy оЕ signalpower and noise-power measurements. Figure 4(a) illustrates this idea where we see the power (magnitude squared) output of an FFТ of а fundamental tone and several tone harmonics buried in background noise. Notice that the noisepower levels in Figure 84(a) fluctuate Ьу almost 20 dB about the true average noise power indicated Ьу the dashed line at 19 dB. lf we take 10 FFТs, average the square of their output magnitudes, and normalize those squared values, we get the power spectrum shown in Figure 84(b). Here, we've reduced the vаriaщ:е оЕ the noise in the power spectrum but have not improved the tones' signalpowerto-noisepower ratios; that is, the average noisepower level remains unchanged. Averaging the output magnitudes squared оЕ 100 FFТs results in the spec- t Тhe term incoherent averaging is а bit of а misnomer, Averaging а set of data is just that, aver- agingwe add ир а set of data values and divide Ьу the number of samples in the set, lncoherent averaging should probably Ье called averaging data that's obtained incoherently, 
/пeohereпt Averagiпg 329 Power (dB) о N=1 5 (8) True average noise power 10 20 зо 40 50 60 Freq Power (dB) о (Ь) 5 10 20 30 40 50 60 Freq Power (dB) О .... 10 (с) 15... 20 25 О 10 20 30 40 50 60 Freq Figure 8-4 Results of averaging signal tones plus noise-power speetra: (а) по averaging, N= 1; (Ь) N= 10; (е) N= 100, trurn in Figure 8-4(с), which provides а more accurate measure of the rel ative power levels of the fundamental tone's harmonics. Just as we arrived at а coherent integration SNR gain expression in Eq, (8-14), we сап express аn incoherent integration gain, SNR incoh gain, in terms of SNR measured in dB as 
330 Sigпo/ Averagiпg Processing gain in dB 60 10 106 N 50 40 зо 20 Flgure 8-5 Tlme-domain ampiltude SNR processing gain from Eq, (8-14), and the frequency-domaln power SNR processlng galn from Eq, (8-17), as functlons of N, SNR incoh gain(dB) = 10 .10g10(-J.N) . (8-17) Equation (8-17) applies when the quantity being averaged represents the power of а signal. That's why we used the factor of 10 in Eq. (8-17) as opposed to the factor of 20 used in Eq, (8-14),t We сап relate the process ing gain effects of Eqs. (8-14) and (8-17) Ьу plotting those expressions in Figure 8-5. 8.3 Averaging Multiple Fast Fourier Transforms We discussed the processing gain associated with а single DFТ in Section 3,12 and stated that we сап realize further processing gain Ьу increasing the point size of аnу given N-point DFТ, Let's discuss this issue when the DFТ is implemented using the PFТ algoritlun. The problem is that large FFТs require а lot of number crunching. Because addition is easier and faster to perform than multiplication, we сап average the outputs of mul- tiple FFТs to obtain further PFТ signa1 detection sensitivity; that is, it's t Section Е,l of Appendix Е explains why the multiplymg factor is 10 for signal-power measurements and 20 when dealing with signal-amplitude values, 
Averaglпg Multlple Fast Fourier Traпsforms 331 easier and typically faster to average the outputs of four 128point FFТs than it is to ca1culate one 512point FFТ. The increased FFТ sensitivity, or noise variance reduction, due to multiple FFТ averaging is also called integration gain, 50 the random noise fluctuations in а FFT's output Ьins will decrease, while the magnitude of the FFT's signal Ып output remains constant when mu1tiple FFТ outputs are averaged. (Inherent in this argument is the assumption that the signal is present throughout the observation intervals for all of the FFТs that are being averaged and that the noise sample values are independent of the original sample rate,) There are two types оЕ FFТ averaging integration gain, incoherent and coherent. Incoherent integration, relative to FFТs, is averaging the corresponding bin magnitudes of multiple FFТs; that is, to incoherently average k FFТs, the zeroth Ьin of the incoherent FFf average Fincoh(O) is given Ьу 1Ft (0)1 + IF 2 (0)1 +IF з (о)1 + ... + IFk(O)1 F incoh (О) ::; k ' ( 18) where I Fп(O) I is the magnitude of the zeroth Ып from the пth FFT, Likewise, the first Ьin of the incoherent FFТ average, F incoh (l), is given Ьу I F t(1}1 + IF 2 (l)j +IF 3 (l)j + ,., + IF k (l)1 F incoh (1) ::; k ' (8-18') and, so оп, out to the last bin of the FFТ average, Fincoh(Nl), which is IFt(N 1)1+IF2(N l)l+IFз(N l)I+...+IFk(N 1)I " Fincoh(N  1)::; k (818 ) Incoherent integration provides additional reduction in background noise variation to augment а single FFТ's inherent processing gain, We сап demonstrate this in Figure 86(a) where the shaded curve is а single FFТ output of random noise added to а tone centered in the 16th bin of а 64-point FFf. Тhe solid curve in Figure 86(a) is the incoherent integration of 10 individual 64--point FFТ magnitudes. Both curves are normalized to their peak values, so that the vertical scales are referenced to О dB. Notice how the variations in the noise power in the solid curve have been reduced Ьу the averaging of the 10 FFТs, Тhe noise power values in the solid curve don't fluctuate as much as the shaded noisepower values. Ву 
332 Sigпol Averagiпg Power (dB)  ...."...."'...':...... . I ...}\I f \ i I Ш(Пе;=;ТШ ш 50 60 True average nolse power 10 (а) 15 20 25 --30 О 10 20 30 40 m Power (dB) о  --30 О 10 20 30 Ш\:/, Ili ... .v..........шШ.....ШIШШШШ... t Топе is Ьеlwее" i FFТ Ып centers 50 60 True average noise power 10 (Ь) 15 20 25 40 m Flgure 8-6 Single FFТ output magnltudes (shaded) and the average of 1 О FFТ output magnitudes (solld): (а) tone at Ыn center; (Ь) tone between Ыn centers, averaging, we haven't raised the power оЕ the tone in the 16th Ьin, but we have reduced the peaks оЕ the noisepower values. Тhe larger the number оЕ FFrs averaged, the closer the individual noisepower Ьin values will approach the true average noise power indicated Ьу the dashed horizon talline in Figure 86(a). When the signal tone is not at а Ьin center, incoherent integration still reduces fluctuations in the FFr's noisepower bins, Тhe shaded curve in Figure 86(b) is а single FFТ output оЕ random noise added to а tone whose frequency is halfway between the 16th and 17th bins оЕ the 64- point FFТ, Likewise, the solid curve in Figure 86(b) is the magnitude average оЕ 10 FFrs, Тhe variations in the noise power in the solid curve have again been reduced Ьу the integration оЕ the 10 FFrs. 50 incoherent integration gain reduces noise-power fluctuations regardless оЕ the fre 
Averagiпg Mu/t/p/e Fast Fourier Traпsforтs 333 quency location of апу signals of interest. As we would expect, the signal peaks are wider, and the true average noise power is larger in Figure 8-6(Ь) relative to Figure 86{a) because leakage raises the average noise power level and scalloping loss reduces the FFТ bin's output power level in Figure 8-6(Ь). Тhe thing to remember is that incoherent averaging of FFТ output magnitudes reduces the variatioпs in the background noise power but does not reduce the average background noise power. Equivalent to the incoherent averaging results in Section 8.2, the reduc- поп in the output noise variance[6] of the incoherent average of k FFТs rel- ative to the output noise variance of а single FFТ is expressed as 2 cr kFFfs 2 cr single FFf 1 k (8 19) Accordingly, if we average the magnitudes of k separate FFTs, we reduce the noise variance Ьу а factor of k, In practice, when mu1tiple FFТs are averaged and the FFТ inputs are windowed, an overlap in the timedomain sampling process is commonly used, Figure 87 Шustrаtеs this concept with 5.5Nt s seconds worth of time series data samples, and we wish to average ten separate N-point FFТs where t s is the sample period {l/fJ Because the FFТs have а 50 percent overlap in the time domain, some of the input noise in the N time samples for the first FFТ wШ also Ье contained in the second FFТ, Тhe question is Time -< series I 5.5Nt s seconds  '-.'-. I 1st FFТ I 2nd FFТ I Зrd FFТ I 4th FFТ Time  , N samples I . 10th FFТ I Flgure 8-7 Tlme relatlonshlp of multlple FFТs wlth 50 percent overlap, 
334 Signal Averagiпg "VVhat's the noise variance reduction when some оЕ the noise is соттоn to two FFТs in this averaging scheme?" Well, the answer depends оп the wir1.dow function used оп the data before the FFTs are performed. It's Ьееn shown that for the most соттоn window functions using an over lap оЕ 50 percent or less, Eq. (819) still applies as the level оЕ noise vari ancereduction[7]. Coherent integration gain is possible when we average the real parts of multiple PFТ bin outputs separately from the average оЕ the imaginary parts and then combine the single real average and the single imaginary average into а single complex Ьin output average value; that is, to coher ently average k separate FFТs, the zeroth Ьin оЕ the complex coherent PFТ average, Fcoh(O), is given Ьу F ( 0 ) = Fl(O)real +F 2 (0)real +...+Fk(O)real coh k , 11 (O)imag + [ 2 (O);mag +... + Fk (O)imag + J k (820) 'Пlе first bin оЕ the complex coherent РРТ average, F coo (l), is F ( 1 ) = F 1 (l)real + F 2 (l)real +... + Fk (1}real coh k , F 1 (1);mag + F 2 (1)imag + ...+ F k (l);mag + J k ' (820') and so оп out to the last Ьin of the complex PFТ average, Fcoh(Nl), which is F ( N  1 ) = FJ (N  l)real + [ 2 (N  1)real +... + Fk (N  l)real coh k , F 1 (N  l)imag + Р 2 (N  l)Unag +... + Fk (N  l)imag ( 820" ) + J k . Let's consider why the integration gain afforded Ьу coherent averaging is more useful than the integration gain from incoherent averaging Where incoherent integration does not reduce the background noise' 
Averag/пg Mu/t/p/e Fast Four/er Traпsforтs 335 power average 1eve1, it does reduce the variations in the averaged FFT's background noise power because we're dea1ing with magnitudes only, and аН FFr noise Ьin va1ues are positivthey're magnitudes. 50 their averaged noise Ьin magnitude va1ues will never Ье zero. Оп the other hand, when we average PFТ comp1ex bin outputs, those comp1ex noise Ьin values сап Ье positive о, negative. Тhose positive and negative values, in the rea1 or imaginary parts of multip1e РРТ Ьin outputs, will tend to cance1 each other. This means that noise Ьin averages can approach zero before we take the magnitude, while а sigJ;;la1 Ьin average will approach its Пuе nonzero magnitude. If we say that the coherent1y averaged PFТ signa1tonoise ratio is expressed Ьу SNR = 20.10 ( signa1 Ьin magnitude ) coh g10, Ь ' . d ' nOlse m magrutu е (821) we сап see that, should the denominator of Eq. (821) approach zero, then SNR coh сап Ье increased, Let' s 100k at an examp1e of coherent integration gain in Figure 88(a) where the shaded curve is а sing1e FFr output of ran dom noise added to а tone centered in the 16th Ьin of а 64point PFТ. Тhe solid curve in Figure 8-8(а) is the coherent integration of ten 64point FFTs, Notice how the new noisepower average has actuaHy been reduced.+ Тhat's coherent integration, Тhe 1arger the number of FFrs aver- aged, the greater the reduction in the new noisepower average. When the signa1 tone is not at bin center, coherent integration stiIl reduces the new noisepower average, but not as much as when the tone is at Ьin center, The shaded curve in Figure 8-8(Ь) is а sing1e PFТ output of random noise added to а tone whose frequency is ha1fway between the 16th and 17th bins of the 64point FFr, Likewise, the solid curve in Figure 88(b) is the coherent integration of 10 FFТs, Тhe new noisepower aver age has, again, been reduced Ьу the integration of the 10 FFТs. Coherent integration provides its maximum gain when the origina1 samp1e rate fs is an integra1 multip1e of the tone frequency we're trying to detect. Тhat way the tone will a1ways have the same phase ang1e at the beginning of the samp1e interval for each РРТ. 50, if possible, the fs samp1e rate should Ье t The sharp-eyed reader might say, "Wait а minute, Coherent integration seems to reduce the noise-power average, but it doesn't look like it reduces the noise-power variations," Well, the noise-power variations realiy are reduced in magnitude----remember, we're using а log- arithmic scale, The magnitude of а half-division power variation between 20 dB and зо dB is smalier than the magnitude of а half-division power variation between 10 dB and 20 dB, . 
336 Sigпol Averaglпg о 10 ..............шш.ш. ...! ................ ............. (а) 20 o 10 20 30 40 50 60 Power (dB) о 10 (Ь) 20 o --40 О 10 30 20 40 50 60 о 10 (с) 20 --(J() --40 о 10 20 30 40 50 60 Original average noise power New average noise power m Original average noise power New average noise power m New average noise power Original average noise power m Flgure 8-8 Single FFТ output magnltudes (shaded) and the eoherent Integratlon of 10 FFТ outputs (solld): (а) tone at bIn eenter; (Ь) tone between bIn eenters; (е) tone at bIn eenter wlth random phase shift Indueed prlor to the FFТ proeess, chosen to ensure that the tone of interest, assuming it's not drifting in fre- quency, will Ье ехасНу at а FFТ bin center, Кеер two thoughts in mind while using coherent integration of multi- ple FFТs, First, if the random noise contaminating the time signal does not have an average value of zero, there will Ье а nonzero DC term in the 
Averag/пg Mu/tip/e Fast Four;er Traпsforms 337 averaged FFI"s Рсоь(О) Ьin, Averaging, of course, will not reduce this DC level in the averaged FFТ РсоЬ(О) output. Second, coherent integration сап actually reduce the averaged FFI"s SNR if the tone being detected has а random phase at the beginning of each FFI' sample interval, Аn example of this situation is as follows: the shaded curve in Figure 88(c) is а single FFI' output of random noise added to а tone centered in the 16th Ьin of а 64point FFТ, Тhe solid curve in Figure 88(c) is the coherent integration of 10 individual 64point FFТs, However, for each of the 10 FFТs, а ran dom phase shift was induced in the fixedfrequency test tone prior to the FFI'. Notice how the averaged FFI"s new average noise power is larger than the original average noise power for the single FFI', When the tone has а random phase, we've actually lost rather than gained SNR because the input tone was по longer phase coherent with the analysis frequency of the FFТ Ыn. Тhere's а good way to understand why coherent integration behaves the way it does. If we look at the phasors representing the successive out puts of а FFI' Ьin, we сап understand the behavior of а single phasor rep resenting the sum of those outputs. But, first, let's refresh our memory for а moment concerning the vector addition of two phasors,t Because аn FFТ Ьin output is а complex quantity with а real and аn imaginary part, we сап depict а single FFТ Ьin output as а phasor, like phasor А shown in Figure 89(a). We сan depict а subsequent output from the same FFI' Ьin as phasor В in Figure 8-9(Ь). Тhere ме two ways to coherent1y add the two FFI' Ьin outputs, i.e" add phasors А and В, As shown in Figure 89(c), we сап add the two real parts and add the two imaginary parts to get the sum phasor С. А graphical method of summing phasors А and В, shown in Figure 89(d), is to position the beginning о! phasor В at the end of pha sor А. Тhen the sum phasor С is the new phasor пот the beginning of phasor А to the end of phasor В, Notice how the two С phasors in Figures 9(c) and 89(d) are identical. We'll use the graphical phasor summing technique to help us understand coherent integration о! FFI' Ьin outputs, Now we're ready to look at the phasor outputs of аn FFI' signal Ыn to see how а single phasor representing the sum of multiple signal Ьin pha sors behaves. Consider the three phasor combinations in Figure 810(a), Each phasor is а separate output о! the PFТ Ыn containing the signal tone we're trying to detect with coherent integration, Тhe dark arrows are the phasor components due to the tone, and the small shaded arrows are the phasor components due to random noise in the FFI' Ыn containing the tone, In this case, the original signal sample rate is а multiple о! the tone t Following the argиments put forth in Section А,2 of Appendix А, we'll use the term phasor, as opposed to the term vector, to describe а single, complex DFf output value, 
338 Sigпol Averaglпg Z haso'A l ' maglnary partol А Аеаl part 01 А Real part 01 В  Imaginary Phaso, В part 01 В (а) (Ь) (с) Imaginary part of А  . '   Imaglnary partolB Phaso' С Аеаl part 01 А Аеаl part 01 В Phaso'B Phaso, А ............... (d) / ............... Phaso, С Figure 8-9 Two ways to add phaso,s А aпd В, where phasor С = А + В, frequency, so that the tone phasor phase angle I?J is the same at the begin ning of the three FFТs, sample intervals, Тhus, the three dark tone pha- sors have а zero phase angle shift relative to one another, Тhe phase angles of the random noise components are random, If we add the three phasor combinations, as а first step in coherent integration, we get the actual phasor sum shown in Figure 8-10(Ь), The thick shaded vector in Figure 8-10(Ь) is the ideal phasor sum that would result had there been по noise components in the original three phasor combinations, Because the noise components are reasonably small, the actual phasor sum is not too different from the ideal phasor sum, Now, had the original signal samples been such that the input tone's phase angles were random at the beginning of the three FFТs, sample intervals, the three phasor combinations in Figure 810(c) could resu1t, Summing those three phasor combinations results in the actual phasor sum shown in Figure 8-10(d), Notice that the random tone phases, in Figиre 8-10(с), have resulted in an actual phasor sum magnitude (length) that's shorter than the dark lines of the phasor component due to the tone in Figure 8-10(с). What we've done here is degrade, rather than improve, 
Averag/пg Mu/t/p/e Fast Four/er Traпsforтs 339 (а) ""'W"""_ (с) t (Ь) ,,"  (d) Actual phasor sum Figure 8-10 FFТ bin outputs represented 05 phosors: (о) three outputs fюm the some bin when the input tone is ot bin center; (Ь) coherent integration (phasor additlon) of the three bin outputs; (с) three outputs fюm the some bin when input tone hos о random phose at the beglnning о' eoch FFТ; (d) coherent integration о' the three bin outputs when input tone hos random phose, 
. 340 Sigпa/ Averagiпg the averaged FFТ's output SNR when the tone has а random phase at the beginning of each FFТ sample interval, The thought to remember is that, although coherent averaging of FFТ outputs is the preferred technique for realizing integration gain, we're rarely lucky enough to work realworld signals with а constant phase at the beginning of every time--domain sample interval, 50, in practice, we're usu аНу better off using incoherent averaging, Of course, with either integration teclmique, the price we рау for improved FFТ sensitivity is additional coт putational complexity and slower system response times because of the additional surnmation ca1culations, (А slick way to reduce the computa- tional burden of averaging multiple FFТs is discussed in Section 10,7.) 8.4 Filtering Aspects of Time-Domain Averaging In Section 5,2 we introduced FIR fi1ters with an averaging example, and that's where we first leamed that the process of time-domain averaging performs lowpass filtering, In fact, successive timedomain outputs of an Npoint averager are identical to the output of аn (NlHap FIR fi1ter whose coefficients are аН equal to l/N, as shown in Figure 811, The question we'H answer here is "What is the frequency magnitude response of а generic Npoint averager?" We could evaluate Eq, (642), from Section 6.3, that describes the frequency response of а generic N stage FIR filter, In those expressions, we'd have to set аН the Ь(О) through b(N) coefficient values equal to l/N and ca1culate HFIR(ro)'s magnitude over the normalized radian frequency range of О  ro  п, Тhat range cor responds to an actual frequency range of О  f  fs/2 (where fs is the equiv alent data sample rate in Hz), А simpler approach is to recaH, from Section 5.2, that we сап ca1culate the frequency response of an FIR filter Ьу taking the DFТ of the fi1ter's coefficients. In doing so, we'd use аn Mpoint FFТ 1st 2nd (N--1)th 1/N Averager output Averager input Figure 8.11 An N-polnt averager deplcted as an FIR fllter, 
Expoпeпtial Averaglпg 341 Averagar frequency magnitude response 0,4 fJ8 fJ4 fJ2 0,8 0,6 0,2 Flgure 8.12 N-point overoger's frequency magnitude response os а functlon of N, software routine to transform а sequence of N coefficients whose values are al1 equal to l/N. Of course, М should Ье larger than N so that the вin(Х)/Х shape of the frequency response is noticeable. Following through оп this Ьу using а 128point PFТ routine, our N-point averager's fre- quency magnitude responses, for various values of N, are plotted in Figure 8--12. То make these curves more meaningfиl, the frequency axis is defined in terms of the sample ratefs in samples/s, 8.5 Exponential Averaging Тhere is а kind of time-domain averaging used in soте power measure- ment equipmentit's cal1ed exponential averaging[8---l1], This technique provides noise reduction Ьу multiplying аn input sample Ьу а constant and adding that product to the constant's ones complement multiplied Ьу the most recent averager output, Sounds complicated in words, but the equation for the exponential averager is the simple expression у(n) = ш(n) + (1  а)у(n  1), (8-22) where у(n) is the cuпеnt averager output sample, y(n1) is the previous averager output sample, and а is the weighting factor constant. The 
342 Sigпol Averagiпg. х(п) Averager output у(п) а Output Storage Register  la y(п1) Figure 8-13 Exponential averager, process described Ьу Eq. (8-22) is implemented as shown in Figure 8lЗ. The advantage of exponential averaging is that only one storage register is needed to hold the value y(пl) while waiting for the next input data sample х(п), ТЬе exponential averager's name stems from its timedomain impulse response. Let's assume that the input to the averager is а long string of zeros and we apply а single sample of value 1 at time t = О. Тhen the input returns again to а string of zero-valued samples. Now, if the weighting fac tor is а = 0.4, the averager's output is shown as the curve in Figure 8-14, When t = О, the input sample is multiplied Ьу а, so the output is 0.4, on the next clock cycle, the input is zero, and the old value of 0,4 is multiplied Ьу (1  0.4), or 0.6, to provide an output of 0.24, on the following clock cycle, the input is zero, and the old value of 0.24 is multip1ied Ьу 0,6 to pro vide an output of 0.144, Тhis continues with the averager's output, or impulse response, falling off exponentially because of successive multipli cations Ьу 0.6, А useful feature of the exponential averager is its capability to vary the amount of noise reduction Ьу changing the value of the а weighting fac- tor, If а equals one, input samples are not attenuated, past averager out- puts are ignored, and по averaging takes place. In this case, the averager output responds immediately to changes at the input. As а is decreased in value, input samples are attenuated, and past averager outputs begin to affect the present output. Тhese past values represent an exponentially weighted sum of recent inputs, and that summation tends to smooth out noisy signals. Тhe smaller а gets, the more noise reduction is realized, However, with smaller values for а, the slower the averager is in respond ing to changes in the input. We сап demonstrate this behavior Ьу looking 
Expoпeпtial Averagiпg З<t 4 Averager output ::"\ 0,25 . 0,20 ! 0.15 ! . 0,10 .. 0.05 i' .__________. ... о о 2 3 4 5 6 7 8 .,............. 9 Time Flgure 8-14 Exponential averager impulse response with <х = 0,4 , at the exponential averager's timedomain step response for various val- ues of а as shown in Figure 815,t 50 we have а tradeoff, The more the noise reduction, the more slug- gish the averager will Ье in responding to changes at the input. We сап see in Figure 8 15 that, as а gets smaller, affording better noise reduc- tion, the averager's output takes longer to respond and stabilize, 50те test instrumentation manufacturers use а clever scheme to resolve this noise reduction versus response time tradeoff. Тhey use а large value for а at the beginning of а measurement so that the averager's output responds immediately with а nonzero value, Then, as the measurement proceeds, the value of а is decreased to reduce the noise fluctuations at the input. Тhe exponential averager's noise variance reduction as а fиnction of the weighting factor а has been shown to Ье[9,lО), output noise variance = SNR а input noise variance ехр 2  а (823) t The step response is the averager's output when а string of аН zeros foHowed Ьу а string of аН ones is applied to the input. 
344 Sigпa/ Averog/пg 0,7 ,....................... ........--- .............. ..... .. .""" ...... ........  ........ 0,8 0,6 а=О,1 .' ---.....;7"..-. ./ O / OoOOoo__._.._oo_oo . -- -----.- . .L.o_. _...0....._0..0 / 0,1 ,"' 1 1 2 0,5 0,4 0,3 0,2 о 4 1 6 1 8 1 10 12 1 14 1 16 1 18 1'- Time Figure 8.15 Exponentlal averager output vs, а when а step Input Is appllвd at tlme t= О, Тhus, the exponential averager's noisepower reduction in dB is given Ьу SNR ex p = 10 'log10 (  ) , dB 2a (824) Equation (8-24) is plotted in Еgше 8 16 to illustrate the trade--off between noise reduction and averager response times. То demonstrate the exponential averager's noisepower reduction сараЬШtiеs, Figure 8-17 shows the averager's output with а cosine wave plus noise as an input. Тhe weighting factor <х starts out with а value of 1.0 and decreases linearly to а final value оЕ 0.1 at the 180th data input sample, Notice that the noise is reduced as а decreases. However, the cosine wave's peak amplitude шо decreases due to the smaller а value. The reader тау recognize the implementation of the exponential aver- ager in Еgше 8 13 as а one--tap infinite impu1se response (ПR) digital fil- ter[12]. 1ndeed it is, and, as such, we сап determine its frequency response. We do this Ьу remembering the general expression in Chapter 6 for the frequency response of an lIR filter, or Eq. (628) repeated here as 
Expoпeпtlal Averaglпg з45 N N Ib(k). cos(kO»)  j Ib(k). sin(kO») Н ( О» ) = k=O k=O ехр М М 1 Ia(k).cos(kO») + jL,a(k).sin(kO» k=l k=l (8-25) Noise power reduction in dB 16 14 12 i Slower response  . /. ..... ../.. ../ .,;::;-/. ....... ......117.......... ........ ................<. .................. 2 .. ,-.. ............... О . .....Т I I I .8  Faster response 10 8 6 4 ,9 ,7 .6 .5 .4 ,3 ,2 I ,1 ' CJ. Flgure 8-16 Exponential averager nolse--power reductlon аз а functlon of the weighting factor а, ; а=1 4( а = .45 .} а=.1 .} О 2 2 --4 1 45 90 135 180 225 Samples (Time) Flgure 8-17 Exponentlal averager output nolsв reduction аз а decreases. 
'346 Slgпol Averagiпg' From Figure 6-18, we modify Eq, (825) to set N = О, and М = 1, so that Н (О) = Ь(О). cos(OO)  jb(O). sin(OO) ехр 1  а(l)' cos(lO) + ja(l) . sin(lO) (8-26) Now with Ь(О) = а and а(l) = 1  а, our exponential averager' s frequency resp<>nse is the complex expression а Нехр(О)= l(la).cos(O)+ j(la).sin(O) (826') For now, we're interested only in the magnitиde response о! our filter, so we сап express it as 1Hex (0)1 = / I р 1  (1  а)' COS(O)+ j(l  а). sin(O) а =  [1  (1  а). cOS(0)]2 + [(1  а). sin(0)]2 а =  12.(1a)'cos(0)+(1a)2 (827) Evaluating Eq, (8-27) over the normalized angular range о! О::; 0)::; 1t (cor- responding to а frequency range о! О ::; f::; 1./2 Нz), the frequency mаgni tиde responses о! our exponential averaging filter for various values о! а are shown in Figure 818(a) using а normalized decibel scale. Notice that, as а decreases, the exponential averager behaves more and more like а lowpass filter. We сап get some practice manipulating complex nиmbers Ьу deriving the e:xpression for the phase о! an exponential averager, We know that the phase angle, as а function о! frequency, is the arctangent о! the ratio о! the imaginary part о! Нехр(О) over the real part о! Нехр(О), or l ( imaginary part о! Нехр(О) ] " х (О) = tan , е р real part о! Нехр(О) (8 27') То find those real and imaginary parts, knowing that Нехр(О) is itself а ratio, we determine what the variables are in Eq. (8--26') сопеsропding to the form о! Eq, (A20), from Appendix А, Doing that, we get 
Expoпeпtlol Averog/пg 347 Normalized magnitude response in dB о 0,9 --5 0,7 0,5 10 (а) 15 20 25 --30 О 's/8 Phase angle 'п degrees О 10 20 (Ь) --30 --40 --50 --50 70 0,3 ..,.......... а=О,1 . 's/4 f /2 Freq s 's/4 's/2 Freq Flgure 8-18 Exponentiol overager frequency response vs, CI. : (а) normolized mognitude response in dB; (Ь) phose response in degrees, R 1 = а, [1 = О, R 2 = 1  (1  а). cos(i), and [2 = (1  а). sin(i) , Substituting those variables in Eq. (А-20), yields Н (Ф) = а[l  (1  а). cos(i)]  Ла(1  а). sin(i)] ехр [1  (1  а). cos(i)]2 + [(1  а). sin(i)]2 (828) Representing the denominator of this messy Eq. (828) with the term Deп, we use Eq, (8--27) to express the phase angle of Нехр(Ф) as 
348 S/gпQI AveragJпg ( )  I ( a(la)'sin(ro)/Deп ) 0ех ro  tan р а(1  (1  а). cos(ro)]/ Deп I ( (1a),sin(ro) ) =tan , 1  (1  а). cos(ro) (8-29) Тhe very nonlinear phase of 0 ехр (ro) from Eq, (8-29) is calculated over the norrnalized angular range of О ::; ro ::; п, corresponding to а frequency range of О ::; 1::; 1/2 Нz, and plotted in Figure 8 18(Ь). References [1] Mil1er, 1" and Freund, ], Probabi1ity and Statistics /or Engineers, 2nd Ed., Prentice-Hall, Englewood Cliffs, New]ersey, 1977, рр, 118, [2] Bel1er, J" and РlеSБ, W, "А Modular All-Haul Optical Time-Domain Reflectometer for Characterizing Fiber Links," Hewlett-Packard Jourпal, February 1993, [3] Spiegel, М, R, Theory and ProbIems o/Statistics, Shaum's Outline Series, McGraw-Нi1l Book Со" New York, 1961, рр, 142, [4] Papou1is, А. ProbabiIity, Random VariabIes, aпd Stochastic Processes, McGraw- нill Book Со" New York, 1984, рр, 245, [5] Davenport, W, В" ]r., and Root, W, L. Random Signals aпd Noise, McGraw-Нill Бооk Со" New York 1958, рр, 81....s4, [6] Welch, Р. О, "Тhe Use оЕ Fast Fourier Transform for the Estimation оЕ Power Spectra: А Method Based оп Time Averaging over Short, Modified Periodograms," IЕЕЕ Transactions оп Audio and Electroacoust" Vol, AU-15, No, 2, June 1967 [7] Напis, F. J, "On the Use оЕ Windows for Нarmonic Analysis with the Discrete Fourier Transform," Proceedings о/ the lБЕЕ, Vol, 66, No, 1, January 1978, [8] Eooster, О, Н, et аl, "Design оЕ а Precision Optical LowCoherence Ref1ectometer," Hewlett-packard Jourпal, February 1993, [9] Witte, R. А. "Averaging Techniques Reduce Test Noise, Improve Accuracy," Microwaves & RF, February 1988, [10] Охааl, J, "Temporal Averaging Techniques Reduce Image Noise," EDN, March 17,1983, [11] Lymer, А. "Digital-Modulation Scheme Processes RF Broadcast Signals," Microwaves & RF,April1994, [12] Hayden, О, "limer Controls DSP-Filter Frequency Resolution," EDN, April13, 1995, 
ICHAPTER NINEI Digital Data Formats and Their Effects In digital signal processing, there are many ways to represent numerical data in computing hardware. These representations, known as data for- mats, have а profound effect оп the accuracy and ease of implementation of any given signal processing algorithm. The simpler data formats enable uncomplicated hardware designs to Ье used at the ехреnsе of а restricted range of number representation and susceptibility to arithmetic епоrs, The more elaborate data formats are somewhat difficult to implement in hardware, but they allow us to manipulate very large and very small numbers while providing immunity to тапу problems associated with digital arithmetic, The data format chosen for any given application can mean the difference between processing success and failurit's where our algorithmic rubber meets the road. ln this chapter, we'll introduce the most comm.on types of fixed-poiпt digital data formats and show why and when they're used. Next, we'll use analogto-digital (A/D) converter operation to establish the precision and dynamic range afforded Ьу these fixedpoint formats along with the inherent errors encountered with their use. Рinаllу, we'll cover the inter- esting subject ofjloatiпgpoiпt binary formats, 9.1 Fixed-Point Binary Formats Within digital hardware, numbers are represented Ьу binary digits known as bitsin fact, the term bit originated from the words Biпary 349 
350 Digital Data Formats aпd Тheir Effects digIТ, А single bit сап Ье in only оnе о! two possible states: either а оnе or а zero, t А sixbit binary number could, for example, take the form 101101, with the leftmost bit known as the тost sigпificaпt bit (msb), while the rightmost bit is called the least sigпificaпt bit (lsb), Тhe number о! bits in а binary number is known as the word lengthhence 101101 has а word length о! six. Like the decimal number system so familiar to us, the binary number system assumes а weight associated with each digit in the number, Тhat weight is the base оЕ the system (two for binary numbers and ten for decimal numbers) raised to аn integral power. То illustrate this with а simple example, the decimal number 4631 is (4 . 103) + (6 . 1()2) + (3 . 101) + (1 . l()О) = 4000 + 600 + 30 + 1 = 4631 , (9-1) The factors, 103, 102, 101, and 100 are the digit weights in Eq, (9-1), Similarly, the sixbit binary number 101101 is equal to decimal 45 as shown Ьу (1 . 25) + (О . 24) + (1 . 23) + (1 . 22) + (О . 21) + (1 . 20) = 32 + 8 + 4 + 1 = 45 , (92) Using subscripts to signify the base о! а number, we сап write Eq. (92) as 1011012 =: 4510' Equation (9-2) shows us that, like decimal numbers, binary numbers use the place value system where the position о! а digit signifies its weight. If we use В to denote а number system's base, the place value representation о! the fourdigit number аза1ао is (а з . В3) + (а 2 . В2) + (а 1 . В1) + (а о . ВО) , (93) In Eq_ (93), Вп is the weight multiplier for the digit а п , where о:::; а п :5: Bl, (Тhis place value system о! representing numbers is very old-----so old, in fact, that it' s origin is obscure, However, with its inherent positioning о! the deciInal or Ьinту point, this number system is so convenient aпd powerfи1 that its importaпce has Ьееn compared to that о! the alphabet[l].) t Binary numbers are used because early eIectronic computer pioneers quickIy reaIized that it was much more practical and reliable to use electrical devices (relays, vacuum tubes, transis- tors, etc,) that had on1y two states, оп or off. Thus, the on/off state of а device couJd represent а single binary digit, 
F/xed-Po/пt B/пary Forтats 351 9.1 .1. Octal Numbers As the use of minicomputers and microprocessors rapidly expanded in the 1960s, реорlе grew tired of manipulating 10ng strings of ones and zeros оп paper and began to use more convenient ways to represent binary nurn- bers, Onе way to express а binary nurnber is аn octal format with its base of eight, Converting from binary to octal is as simple as separating the binary nurnber into threebit groups starting from the right, For ехатрlе, the binary nurnber 101010012 сan Ье converted to octal format as 101010012..... 10 11011 001 = 2518 . Each of the three groups of bits above are easi1y converted from their binary formats to а single octal digit because, for threebit words, the octal and decimal formats are the same. Тhat is, starting with the left group of bits, 102 = 210 = 28' 1012 = 510 = 58' and 0012 = 110 = 18' Тhe octal format also uses the рlасе value system meaning that 2518 = (2 . 82 + 5 . 81 + 1 . 80), Octal format enables us to represent the eightdigit 101010012 with the threedigit 2518' of course, the only valid digits in the octal format are О to 7the digits 8 and 9 have по meaning in octal representation. 9.1.2. Hexadecimal Numbers Another popular binary format is the hexadecimal number format using 16 as its base, Converting from binary to hexadecimal is done, this time, Ьу separating the binary number into fourbit groups start ing from the right, Тhe binary number 101010012 is converted to hexa decimal format as 101010012..... 1010 11001 = А9 16 . If уои haven't seen the hexadecimal format used before, don't let the А9 digits confuse you,ln this format, the characters А, В, С, D, Е, and F rep- resent the digits whose decimal values are 10, 11, 12, 13, 14, and 15 respectively, We convert the two groups of bits above to two hexadeci mal digits Ьу starting with the left group of bits, 10102 = 1010 = Ан>, and 10012 = 910 = 916' Hexadecimal format numbers also use the рlасе value system, meaning that А9 16 = (А . 161 + 9 . 160). For convenience, then, we сап represent the eightdigit 101010012 with the twodigit number А916' ТаЫе 9llists the permissible digit representations in the number sys tems discussed thus far, 
352 Dig/to/ Doto Forтots oпd Their Effects ТаЫе 9-1 AllowabIe Dlgit Representotions VS, Number System Вase Decimal Binary Octal Decimal Hexadecimal Equivalent о о о о о 1 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 5 5 5 5 6 6 6 6 7 7 7 7 8 8 8 9 9 9 А 10 В 11 С 12 D 13 Е 14 F 15 9.1.3. Fractional Binary Numbers Fractions (numbers whose magnitudes are greater than zero and less than one) can al80 Ье represented Ьу binary numbers if we use а binary point identical in function to our familiar decimal point. In the binary numbers we've discussed so far, the binary point is assumed to Ье ftxed just to the right of the rightmost digit, Using the symbol О to denote the binary point, the sixbit binary fraction 110101 is equal to decima13,3125 as shown Ьу (1.21)+ (1. 20) + (О, т1) +(1. т2) +(0' ТЗ) +(1. т4) 1 1 1 1 = (1. 2) +(1.1)+(0. )+(1. )+(O. )+(1.) 2 4 8 16 = 2 + 1 +0 +0.25+ 0+0.0625 = 3.3125 , (94) 
F/xed-Poiпt B/пary Forтats 353 For the example in Eq. (94), the binary point is set between the second and third most significant bits, Having а stationary position for the binary point is why binary numbers are often cal1edfixed-poiпt binary, For some binary number formats (like the floating-point formats that we'll cover short1y), the binary point is fixed jиst to the left о! the most sig nificant bit. тhis forces the number valиes to Ье restricted to the range between zero and оnе. In this format, the largest and smallest valиes pos- sibIe for а b-bit fractional word are 12--b and 2--Ь, respectively, Taking а six- bit binary fraction, for example, the largest valиe is 01111112' or 0(1. т1) + (1. т2) +(1. ТЗ) +(1. 2--4) + (1. т5) + (1. 2--6) 1 1 1 1 1 1 =0 (1')+(1') +(1.)+(1.) +(1.) +(1.) 2 4 8 16 32 64 = 0.5 + 0.25 + 0,125 + 0,0625 + 0.03125 + 0.015625 = 0,984375 , (9-5) which is 12--6 = 1 1/64 in decimal. The smallest nonzero valиe is 00000012' eqиaling а decima1 1 / 64 = 0,01562510' 9.1.4. Sign-Magnltude Blnary Format For binary numbers to Ье at all usefи1 in practice, they mиst Ье аЫе to rep- resent negative valиes. Binary numbers do this Ьу dedicating оnе о! the bits in а binary word to indicate the sign о! а number. Let's consider а popиlar binary format known as sign-magnitиde. Here, we assume that а binary word's leftmost bit is а sign bit and the remaining bits represent the magnitиde о! а number which is always positive, For example, we сап say that the four-bit number 00112 is +310 and the binary number 10112 is eqиal to 310' or magnitude Ыtэ Н.!. 00112 = 310' i and magnitude Ыtэ Н.!. 10112 = 31O ' i sign Ы! of zero signiiies positive sign Ы! of one signiiies negative 
354 Digltol Data Forтats aпd Thelr Effects Of course, using one of the bits as а sign bit reduces the magnitude of the numbers we can represent, If an unsigned binary number's word length is Ь bits, the number of different values that can Ье represented is 2 Ь , An eightbit word, for example, can represent 28 = 256 different integral val ues. With zero being one of the values we have to express, а bbit unsigned bincuy word can represent integers пот О to 2bl, The largest value repre- sented Ьу an unsigned eightbit word is 281 = 25510 = 111111112' In the signmagnitude binary format а bbit word can represent only а таgni tude of :t2b-- C 1, so the largest positive or negative value we can represent Ьу al1 eight-bit sign-magnitude word, then, is :t28--11 = :t127, 9.1.5 Two's Complement Format Another common binary number scheme, known as the two's complemeпt format, also uses the leftmost bit as а sign bit, The two's complement for mat is the most convenient numbering scheme пот а hardware design standpoint and has been used for decades, It enables computers to per- form. both addition and subtraction using the same hardware adder logic. То get the negative version of а positive two's complement number, we merely complement (change а one to а zero and change а zero to а one) each bit and add а one to the complemented word, For example, with 00112 representing а decimal 3 in two's complement format, we obtain а nega tive decimal 3 through the fol1owing steps: +3 in two's complement ..... 0011 complement оЕ +3 ..... 1100 add оnе ..... + QJ)JU  in two's complement ..... 1101. In the two's complement format, а bbit word сап represent positive amplitudes as great as 2b--11, and negative amplitudes as large as 2b--l, ТаЫе 92 shows fourbit word examples of signmagnitude and two's complement binary formats. While using two's complement numbers, we have to Ье careful when adding two numbers of different word lengths. Consider the case where а fourbit number is added to а eight-bit number: +15 in two's complement ..... add +3 in two's complement ..... +18 in two's complement ..... 00001111 + QJLil 00010010, 
FixedPoiпt Biпary Forтats 355 ТаЫе 9-2 Exaтples of Blпary Nuтber Forтats Sigп- Тwo's Offset Deciтal Мagпitude Complemeпt Binary Equivaleпt 0111 0111 1111 7 0110 0110 1110 6 0101 0101 1101 5 0100 0100 1100 4 0011 0011 1011 3 0010 0010 1010 2 0001 0001 1001 1 0000 0000 1000 О 1001 1111 0111 1 1010 1110 0110 2 1011 1101 0101  1100 1100 0100 4 1101 1011 0011 ...s 1110 1010 0010 --6 1111 1001 0001 7  1000 0000 --8 No problem so [М, The trouble occurs when our four-bit number is nega tive. Instead о! adding а +3 to the +15, let's try to add а 3 to the +15: +15 in мо'. complement .... add а 3 in мо'. complement .... +28 in мо'. complement .... 00001111 + llJU 00011100 , .... Wrong an.wer The аЬоуе arithmetic error can Ье avoided Ьу performing what's cal1ed а sign-exteпd operation оп the fourbit number. This process, typically per formed automatically in hardware, extends the sign bit о! the four-bit neg ative number to the left, making it an eightbit negative number. If we sign-extend the 3 and, then perform the addition, we'l1 get the correct answer: +15 in мо'. complement.... О О О О 1 1 1 1 .dd а .ign-extended --З in мо'. complement .... + 1 1 1 1 1 1 О 1 +12 in мо'. complement....1 О О О О 11 О О i overflow Ы! is ignored .... ТЬаУ. better 
356 D/gita/ Data Forтats aпd Their Effects 9.1.6. Otfset Binary Format Another useful binary number scheme is known as the offset biпary format, While this format is not as common as two's complement, it still shows ир in some hardware devices. Table 9-2 shows offset binary fопnаt examples for four-bit words, Offset binary represents negative numbers Ьу subtract- ing 2Ь--1 from ап unsigned binary value, For example, in the second row of Table 92, the offset binary number is 11102' When this number is treated as ап unsigned binary number it's equivalent to 1410' For four-bit words Ь = 4 and 2Ь--1 = 8, so 1410  810 = 610 which is the decimal equivalent of 11102 in offset binary. Тhe difference between the unsigned binary equivalent and the actual decimal equivalent of the offset binary numbers in Table 92 is always .....g, Тhis kind of offset is sometimes referred to as а bIOS when the offset binary fопnаt is used, (Н тау interest the reader that we сan convert back and forth between the two's complement and offset binary fопnаts merely Ьу complementing а word's most significant bit,) УЬе history, arithmetic, and utility of the тапу available number for- mats is а very broad НеЫ of study. А thorough and very readable discus sion of the subject is given Ьу Кnuth in reference [2], 9.2 Binary Number Precision and Dynamic Range As we implied before, for апу binary number format, the number of bits in а data word is а key consideration, The more bits used in the word, the better the resolution of the number, and the larger the maximum value that сап Ье represented,+ Assuming that а binary word represents the amplitude of а signal, digital signal processing practitioners find it useful to qиantify the dynamic range of various binary number schemes, For а signed integer binary word length of Ь+1 bits (опе sign bit and Ь таgni- tude bits), the dynamic range in decibels is defmed Ьу d ' 20 1 ( largest possible word value ) ynатlC rangedB = . oglO smallest possible word value = 20 .10glO( 2 Ь 1 1 ) = 20 .loglO(2 b  1) , (96) t Some compиters иse 64-bit words, Now 264 is approximate!y eqиa! to 1,8 . 1019that's а pretty !arge nиmber, 50 !arge, in fact, that if we started incrementing а 64-bit coиnter оnсе per se<:ond at the beginning of the иniverse (=20 Ыlliоn years ago), the most significant foиr bits of this coиnter woи!d still Ье аН zeros today, 
Effects of F/п/te F/xedPo/пt B/пary Word Leпgth 357 When 2 Ь is much larger than 1, we can ignore the 1 in Eq, (9-6) and state that dynamic rangedB = 20.1og 10 (2 b ) = 20 .log10(2). Ь = 6.02. Ь dB , (9-6 ') Equation (9-6'), dimensioned in dB, te11s us that the dynamic range of our number system is direct1y proportional to the word length, Thus, an eight-bit two's complement word, with seven bits available to represent signal magnitude, has а dynamic range of 6,02 . 7 = 42,14 dB. Most people simplify Eq. (9-6') Ьу using the rule of thumb that the dynamic range is equal to "six dB per bit," 9.3 Effects 01 Finite Fixed-Point Binary Word Length The effects of fiлitе binary word lengths touches a1l aspects of d.igital signa1 processing, Using fiлitе word lengths prevents иs from representing values with infinite precision, increases the background noise in our spectral esti- mation techniques, creates nonideal d.igital filter responses, induces noise in analog-to--d.igital (A/D) converter outputs, and can (ifwe're not careful) lead to wildly inaccurate arithmetic results. The sma11er the word lengths, the greater these problems will Ье. Fortunately, these fiлitе, word.-length effects are rather well understood, We can predict their consequences and take steps to minimize any unpleasant surprises, The first fiлitе, word-length effect we'll cover is the errors that occur during the A/D conversion process, 9.3.1 A/D Converter Quantization Errors Practical A/D converters are constrained to have binary output words of finite length. Commercial A/D converters are categorized Ьу their output word lengths which are norma11y in the range from 8 to 16 bits. А typical A/D converter input analog voltage range is from  1 to + 1 volt, If we used such an A/D converter having eight-bit output words, the least signifi- cant bit would represent 1 Ь 1  fu11 vo1tage range  2 vo1ts  7 81 . 11 " 1 s уа иe dl gth  8 , nu lVO ts, 2 wor еn 2 (9-7) What this means is that we can represent continuoиs (analog) voltages perfect1y as long as they're integral multiples of 7,81 mil1ivo1tsany 
358 D/glto/ Dato Forтots oпd Тhe/r Effects intermediate input voltage will cause the A/D converter to output а best estirnate digital data value. Тhe inaccuracies in this process are called quaп- tizatioп errors because an A/D output least significant bit is an indivisible quалtity. We illиstrate this situation in Figиre 9-1(а) where the continuous waveform is being digitized Ьу an eight-bit A/D converter whose output is in the sign-rnagnitude format. When we start sampling at time t = О, the continuous waveform happens to have а value of 31.25 millivolts (mv), and our A/D output data word wШ Ье exactly correct for sample х(О). At Нте Twhen we get the second A/D output word for sample х(I), the con- tinuous voltage is between О and 7.81 тУ. In this case, the A/D converter outputs а sample value of 10000001 representing 7.81 ту, even though the continuous input was not quite as negative as 7,81mv. The 10000001 Slgnal amplitude in millivolts 31,25 х(О) 7,81 23,43 - 15,62 --- (а) О -7,81 -+ -15,62 " ,Х(6) trt j + I , : r -23.43 . ..,.". .J._"_ -31.25 О т 5Т 3Т 4Т 2Т (Ь) A/D quantization error in millivolts 7,811 r" О " 1 _ - __" ------- - '--- "-- ----- --,-,,""""-  -- -7,81 О Т ппп я п ND ou1put valu.. 00000100 00000011 00000010 00000001 00000000 10000001 10000010 10000011 10000100 6Т Time  00000001 } Quantization errOr range 10000001 Time  Figure 9.1 QuonHzat/on errors: (а) digitized х(п) volues of а contlnuous sigпol; (Ь) quontizatlon error between the octuol onolog signol volues ond the digltized signol volues, i 
Effects о( F/п/te F/xed-Po/пt B/пary Word Leпgth 359 A/D output word contains some quantization error. Each successive sample contains quantization error because the A/D's digitized output va1ues must lie оп а horizonta1 dashed line in Figure 91(a). Тhe differ ence between the actua1 continuous input voltage and the A/D con- verter's representation of the input is shown as the quantization error in Figure 9-1(Ь). For an ideal A/D converter, the quantization error, а kind of rouпdoff noise, сап never Ье greater than ::1:1/2 an lsb, or ::1:3.905 ту, While Figure 91(b) shows A/D quantization noise in the time domain, we сап a1so illustrate this noise in the frequency domain. Figure 92(a) depicts а continuous sinewave of one cycle over the sample interval shown as the dotted 1ine and а quantized version of the timdomain samples of that wave as the dots, Notice how the quantized version of the wave is constrained to have only integra1 values, giving it а stair step effect oscil 1ating аЬоуе and below the true unquantized sinewave. The quantization here is 4 bits, meaning that we have а sign bit and three bits to represent the magnitude of the wave, With three bits, the maximum peak values for the wave are ::1:7, Figure 92(b) shows the discrete Fourier transfопn (DFТ) of а discrete version of the sinewave whose timdomain sample values are not forced to Ье integers, but have high precision, Notice in this case that the DFТ has а nonzero va1ue only at m = 1, on the other hand, Figure 92(c) shows the spectrum of the 4-bit quantized samp1es in Figure 9-2(а) where quantization effects have induced noise components across the entire spectra1 band, If the quantization noise depictions in Figures 91(b) and 92(c) 100k random, that's because they are, As it tums out, even though A/D qиantization noise is random, we can still quantify its effects in а useful way, In the field of communications, peop1e often use the notion of output sig- naHonoise ratio, or SNR = (signa1 power)/(noise power), to judge the use- fulness of а process or device. We сап do likewise and оЫаin an important expression for the output SNR of an ideal A/D converter, SNR л / D , account- ing for finite word-1ength qиantization effects. Because quantization noise is random, we can't explicitly represent its power 1evel, but we can use its statistical equiva1ent of variance to define SNR AlD measured in decibels as SNR = 1 О .10 ( input signa1 variance ) А D gl "" / О A/D quantization n01se varlance ( 2 ) (1 signaJ = 10 .10g10 2 ' (1 А/О noise (98) I 
360 D/g/ta/ Data Forтats aпd Тhe/r Effects Slnewave amplltude 8 (а) ..........,.,.", continuous aI....wav. 8  ....' j 1.. '... "'-'/  /, 1 ' 1 1111'1' /" /. I : I 1 1 1 1 1 1; 11 1 1 1 1. 1 .' 4 .. 1 " 1 \ \ 1 t 1 .. .! 1 i 11 11 1 ' 1,: '1 II. 2 /.11:ilj' 11 11 !llllli" j . ". i 1 11 : 1, 1 11 1 11 ' 1 i , 1 1 ' 1 ,1 ' I ! I (:' зз 36 з9 42 45 48 51 54 57 80 6з 0,++1 111111 11111111111111111 . О 3 8 9 12 15 18 21 24 27 за ..1 I " ,1 , 11 [1 I (! .. n -2 ! ШШJ!, Ч t . !tITt,r' 1 11 ii/ -4 ..ji \11 11 1 [ i 11.1' .6 1... 1+ Ш" . '-11 " ....... .8 . DFТ 01 unquantlzed slnewave (dB) О -20 (Ь) .40 -60 .60 ...L...,_.,.,_.,.,.,._,....,.,...,.,.,.,.,..., О 2 4 6 8 10 12 14 18 18 20 22 24 26 28 за m DFТ 01 quanzed sinewave (dB) О , I -20 + (с) :: ........ ! . i f . r " ; i j l ij! 1 -80 ...L...L..................L,. .....I...................J......_.. .........,..L.......L.. О 2 4 8 8 10 12 1 1'6 1  2 2 2'6 28  m Figure 9.2 Quantlzatlon noise effects: (а) input sinewave applled to а 64-polnt DFТ; (Ь) theoretlcal DFТ magnltude of high-preclslon slnewave samples; (с) DFТ magnitude of а slnewave quantlzed to 4 bits, Next, we'll determine an A/D converter's quantization noise variance rel- ative to the converter's тaxiшшn input peak voltage V p ' If the full scale (Vp to +V p volts) continuous input range of а b-bit A/D converter is 2Vp, а single quantization level q is that voltage range divided Ьу the number of possible A/D output binary values, or q = 2V p /2 b , (In Figure 91, for example, the quantization level q is the lsb value of 7.81 ту.) А depiction of the likelihood of encountering any given quantization error value, called the probability density function р(е) of the quantization error, is shown in Figure 9З, 
Effects of Fiпite Fixed-Poiпt Biпary Word Leпgth 361 А/О quantization error probability 1 density function р(е) Т... ... q/2 О q/2 е (Error value) Flgure 9-3 Probability denslty functlon of A/D converslon roundoff error (noise). This simple rectangular function has much to tell иs, It indicates that there's an equal chance that any error value between ---q/2 and +q/2 сап OCcur. Ву definition, because probability density functions have an area of unity (i,e" the probability is 100 percent that the error wi1l Ье somewhere under the curve), the amplitude of the р(е) density function must Ье the area divided Ьу the width, or р(е) = l/q. From Figure D4 and Eq, (D12) in Appendix D, the variance of our uniform р(е) is q/2 ql2 2 .  J 2 ( )d  1 J 2 d  q2 о' А/О nOlБe  е р е е   . е е   q 12 -ql2 q/2 (9-9) We can now express the A/D noise error variance in terms of A/D para- meters Ьу replacing q in Eq. (99) with q = 2Vpl2 b to get 2 (2V p )2 о' А/О поШе = 12. (2 Ь )2 v 2 Р 3.2 2Ь (9-1 О) ОК, we're halfway to our goalwith Eq. (910) giving us the denomina- tor of Eq, (98), we need the numerator. То arrive at а general resu1t, let's express the input signal in terms of its root mean square (rms), the A/D converter's peak vo1tage, and а loading factor LF defined as LF = rms of the input signal O'signal . t V p V p (9-11) t Recall from Section О,2 that, although the variance 0'2 is associated with the power оЕ а signal, the standard deviation а is associated with the rms value of а signal. 
362 Digitol Doto Formots oпd Тhelr Effects With the loading factor defined as the input rms voltage over the A/D converter's peak input vo1tage, we square and rearrange Eq, (91l) to show the signal variance cr gna1 as 2 2 2 crsignal = (LF) V p (9-12) Substituting Eqs. (9-10) and (9 12) in Eq, (98), [ (LF)2V; J 2 2Ь SNR A / D =10.1og 1o 2 2Ь =10.1og lO [(LF) .(3.2 )] V p /(3.2 ) = 6.02. Ь + 4.77 + 20 .lOg10(LF) , (9-13) Eq. (913) gives us the SNR A / D of an ideal bbit A/D converter in terms of the loading factor and the number of bits Ь, Figure 94 plots Eq. (9 13) for various A/D word lengths as а function of the load.ing factor. Notice that the loading factor in Figure 94 is never greater than 3dB, Ьесаше the maximum continuous A/D input peak value must not Ье greater V p vo1ts, Тhus, for а sinusoid input, its rms value must not Ье greater than V p / fi vo1ts (3 dB below V p )' SNR ND 90 80 70 40 30 20 10 21 .., i 14-Ы! ..I j12-bit ш '11 О-Ы! 18-Ы! 60 50 6-Ы! 18 15 12 9 4)  Loading lactor (dB) Figure 9-4 SNRA/D 01 ideol A/D converters 05 а function 01 looding factor In dB, 
Effects of Fiпite Fixed-Poiпt Biпary Word Leпgth З6З When the input sinewave's peak amplitude is equal to the A/D con verter's fullscale voltage V Р' the ful1scale LF is V p / {i 1 LFfull scale =  = {i (9-14) Under this condition, the maximum A/D output 5NR from Eq, (913) is SNR A / D _ max = 6,02.Ь+ 4,77 + 20.10g lO (l/ {i) = 6,02. Ь + 4.77  зm = 6,02. Ь + 1,76 dB . (915) Тhis discussion of 5NR relative to A/D converters теans three important things to us: · An ideal A/D converter will have an SNR A / D defined Ьу Eq, (913), so апу continuous signal we're trying to digitize with а bbit A/D con verter wil1 never have ап SNRA/D greater than Eq. (913) after A/D conversion, For example, let's say we want to digitize а continuous signal whose 5NR is 55 dB, Using an ideal eight-bit A/D converter with its fullscale SNR A / D of 6,02. 8 + 1,76 = 49,9 dB from Eq, (915), the quantization noise wil1 contaminate the digitized values, and the resultant digital signal's SNR сап Ье по better than 49.9 dB. We'H have lost signal 5NR through the A/D conversion process, (А tenbit A/D, with its ideal SNR A / D '" 62 dB, could Ье used to digitize а 55 dB 5NR continuous signal to reduce the 5NR degradation caused Ьу quanti zation noise.) Equations (9 13) and (9 15) apply to ideal A/D convert ers and don't take into account such additional A/D noise sources as aperture jitter error, missing output bit pattems, and other nonlinear- ities, 50 actual A/D converters are likely to have 5NRs that are lower than that indicated Ьу theoretical Eq, (913). То Ье safe in practice, it's sensible to assume that SNRA/D_max is 3 to 6 dB lower than that indi- cated Ьу Eq, (915), · Equation (915) is often expressed in the literature, but it сan Ье а lit tle misleading because it's imprudent to force ап A/D converter's input to full scale, It's wise to drive an A/D converter to some level below fuH scale because inadvertent overdriving wil11ead to signal clipping and wil1 induce distortion in the A/D's output, 50 Eq. (9-15) is overly optimistic, and, in practice, A/D converter 5NRs wil1 Ье less 
364 DlgltQI Data Forтats aпd Thelr Effects than that indicated Ьу Eq. (915), The best approximation for an A/D's SNR is to determine the input signal's rms value that will never (or rarely) overdrive the converter input, and plug that value in Eq, (9-11) to get the loading factor value for use in Eq, (9-13).t Again, using an A/D converter with а wider word length will alleviate this problem Ьу increasing the available SNRA/D' . Remember now, real-world continuous signals always have their own inherent continuous SNR, so using an A/D converter, whose SNR A / D is а great deal larger than the continuous signal's SNR serves по purpose. In this case, we'd Ье using the A/D converter's extra bits to digitize the continuous signal's noise to а greater degree о! accuracy. А word о! caution is appropriate here conceming our analysis о! A/D converter quantization епоrs, The derivations о! Eqs. (9 13) and (9 15) are based upon three assumptions: · The cause о! A/D quantization errors is а stationary random process; that is, the performance о! the A/D converter does not change over time, Given the same continuous input vo1tage, we always expect an A/D converter to provide exact1y the same output binary code, · Тhe probability density function о! the A/D quantization error is uniform. We're assuming that the A/D converter is ideal in its oper- ation and аН possible errors between q/2 and +q/2 are equaHy likely. An A/D converter having stuck bits or missing output codes would violate this assumption. Highquality A/D converters being driven Ьу continuous signals that cross many quantization levels wi1l resu1t in our desired uniform quantization noise probabi1ity density function, · The A/D quantization errors are uncorrelated with the continuous input signal. If we were to digitize а single continuous sinewave whose frequency was harmonically related to the A/D sample rate, we' d end ир sampling the same input vo1tage repeatedly and the quantization error sequence would not Ье random, The quantization t Ву the way, some folks use the term crest factor to describe how hard аn А/О converter's input is being driven, The crest factor is the reciprocal of the loading factor, or CF = V PI (nns of the input signal), 
Effects of Flпlte F/xвd-Polпt Blпary Word Leпgth 365 error would Ье predictable and repetitive, and our quantization noise variance derivation would Ье invalid, In practice, complicated con- tinuous signals such as music or speech, with their rich spectral con- tent, avoid this problem. То conclude our discussion of A/D converters, let's consider one last topic. In the literature the reader is likely to encounter the expression Ь  SNR 1,76 eff  6,02 (9 16) Equation (916) is used Ьу test equipment manufacturers to specify the sensitivity of test instruments using а b eff parameter known as the num- ber of effective bits, or effective number of bits (ENOB) [38], Equation (9-16) is merely Eq. (9-15) solved for Ь. Test equipment manufacturers measure the actual SNR of their product indicating its ability to capture continuous input signals relative to the instrument's inherent noise char- acteristics. Given this true SNR, they use Eq, (916) to determine the b eff value for advertisement in their product 1iterature. Тhe larger b eff , the greater the continuous voltage that can Ье accurately digitized relative to the equipment's intrinsic quantization noise. 9.3.2 Data Overflow The next finite, word-length effect we'll consider is called overflow, Overflow is what happens when the resu1t of an arithmetic operation has too many bits, or digits, to Ье represented in the hardware registers designed to contain that result. We can demonstrate this situation to our- selves rather easily using а simple fourfunction, eightdigit pocket calcu- lator, Тhe sum of а decimal 9.9999999 plus 1,0 is 10.9999999, but оп an eightdigit calculator the sum is 10.999999 as 9,9999999 + 1,0000000 10 , 9 9 9 9 9 9 9 , l' this digit gets discarded Тhe hardware registers, which contain the arithmetic result, and drive the calcu1ator's display, сап hold only eight decimal digits; so the least sig nificant (of course) digit is discarded. Although the аЬоуе error is less 
366 D/gita/ Data Forтats aпd Тhe;r Effects than one part in ten million, overflow effects сan Ье striking when we work with large numbers. If we use our ca1culator to add 99,999,999 plus 1, iru;tead оЕ getting the correct result of 100 rnillion, we'll get а resu1t of 1. Now that's an authentic overflow error! Let's illustrate overflow effects with examples more closely related to our discussion of binary number formats. First, adding two unsigned binary numbers is as straightforward as adding two decimal numbers. Тhe sum of 42 plus 39 is 81, or +81 in unSigned binary 1 1 1 ..... carry ы.. 101010 .... + 100111 .... 1010001. +42 in unsigned binary .... +39 in unsigned binary In this case, two 6bit binary numbers required 7 bits to represent the resu1ts. Тhe general rule is the sum о/ m iпdividual b-bit biпary пumbers сап reqиire as тапу as [ь + logim)] bits to represeпt the results. 50, for example, а 24-bit result register (accumulator) is needed to accumulate the sum of sixteen 20bit binary numbers, or 20 + 10g2(16) = 24. Тhe sum of 256 eight bit words requires an accumulator whose word length is [8 + 10g2(256)], or 16 bits, to ensure that по overflow errors occur. In the preceding example, if our accumulator word length was 6 bits, an overflow error occurs as +42 in unSigned binary .... +39 in unsigned binary .... +17 in unsigned binary .... 111 .....canyЫ.. 101010 + 100111 1 О 1 О О О 1. ..... Overflowerror i an overflow out о! the sign Ы! is ignored, causing an overflow error Here, the most significant bit оЕ the result overflowed the 6bit accи mulator, and an error occurred. With regard to overflow errors, the two's complement binary format has two interesting characteristics. First, under certain conditions, over- flow during the summation оЕ two numbers causes по error. 5econd, with multiple summations, intermediate overflow errors cause по problems if the final magnitude of the sum of the b-bit two's complement numbers is less than 2b--l. Let's illustrate these properties Ьу considering the fourbit two's complement format in Figure 95, whose binary values are taken from ТаЫе 92. 
Effects о( Fiпite Fixed-Poiпt Biпary Word Leпgth 367 1000 1000 Flgure 9-5 Four-bIt two's complement bInary numbers, decimal equivalent ........... +7 .... ш +6 +5 +4 1010 1001 +3 +2 ........... +1 О 1 2 --з ....... .. --4 5 ш.  --6 7 ш. --6 Тhe first property оЕ two's complement overf1ow, which sometimes causes по errors, сап Ье shown Ьу the following examples: о 1 О .... сапу Ыь 5 in two's complement..... 1 О 1 1 +2 in two's complement  +.Q..Q..l.Q. 3 in two's complement ..... О 1 1 О 1 .... valid negative resu1t i zero overflow out of the sign Ы! 1 1 О .... сапу ЫЬ 2 in two's complement..... 1 1 1 О +6 in two's complement  + Q...Ll.Q +4 in two's complement ..... 1 О 1 О О .... va1id positive resu1t i overflow out of the sign Ы! ignored, по Ьаnn done Тhen again, the following examples show how two's complement over- f10w sometimes does cause errors: 
368 Digital Data Forтats aпd The/r Effects о о о +-- carry ЫЬ 7 in мо'" complement.... 1 О О 1 --6 in мо'" complement .... + 1Jl..1..Q +3 in мо'" complement .... 1 О О 1 1 +-- invalid po"itive rl!Sult t overflow out of the "Ign Ы! ignored, cau"ing overflow епоr 1 1 1 +-- carry Ыь +7 in мо'" complement.... О 1 1 1 +7 in мо'" complement.... Q..LU 2 in мо'" complement .... О 1 1 1 О +-- invaJid negative re"ult t zero overflow out of the "ign Ы! Тhe rule with two's complement addition is ifthe carry bit into the sigп bit is t'Ш same as the overflow bit out о/ the sigп bit, the overflow bit сап Ье igпored causing по errors; if the carry bit into the sigп bit is different from the overflow bit out о/ the sigп bit, the result is invalid, An even more interesting property оЕ two's complement numbers is that а series of bbit word sununations сап Ье perfonned where intennediate SUInS are invalid, but the final sшn will Ье сопесt if its magnitude is less than 2/J.-l. We show this Ьу the fol- lowing example. If we add а +6 to а +7, and then add а 7, we'l1 encoиnter an intermediate overflow error but ощ finаl sum wil1 Ье correct as +7 in мо'" complement .... 0111 +6 in мо'" complement .... + Q.J...l.Q 3 in мо'" complement .... 11 О 1 +-- overflow error here 7 in мо'" complement .... + l.QJU +6 in мо'" complement .... 10110 +-- valid po"itive resuJt t overflow ignored, with по harm done Тhe magnitude of the sum of the three fourbit nиmbers was less than 24--1 «8), so ощ resu1t was valid. If we add а +6 to а +7, and next add а 5, we'll encoиnter an intennediate overflow error, and ощ final sиm will also Ье in error because its magnitude is not less than 8. +7 in мо'" complement .... 0111 +6 in мо'" complement .... + Q...UJl 3 in мо'" complement .... 11 О 1 +--- overf]ow error here s in мо'" complement .... + 1.Q..U  in мо'" complement .... 11000 +-- invaJid negative resuJt . 
Effects of Fiп/te Fixed-Poiпt B/пary Word Leпgth 369 х х' k у....... W N l' Flgure 9-6 Slngle decimatlon-In-tlme FFТ butterfly. Another situation where overflow problems are conspicuous is dur ing the calculation о! the fast Fourier transform (РРТ) , It's difficult at first to imagine that mu1tiplying complex numbers Ьу sines and cosines сап lead to excessive data word growthparticularly, because sines and cosines are never greater than unity. Well, we сап show how РРТ data word growth occurs Ьу considering а decimationintime РРТ butterfly from Figиre 414(c) repeated here as Figure 96, and grinding through а 1itt1e algebra. Тhe expression for the х' output о! this PFТ butterfly, from Eq. (426), is x'=x+wt.Y , (917) Breaking ир the butterfly's х and У inputs into their real and imaginary parts and remembering that wt=c-j27rk!N, we сan express Eq, (917) as ,  ' ( j27rk!N ) . (" ' ) х  x real + JX irnag + r:: \!freal + JYirnag . (9 18) If we let а Ье the twiddle factor angle о! 21tk/N, and recall that c-ia = cos(a)  jsin(a), we сan simp1ify Eq, (918) as х' = XreaJ + jXimag + [cos(a) jsin(a)]'(Yreal + jYimag) = XreaJ +cos(a)YreaJ +sin(a)Yimag + j(Ximag +cOS(a)Yimag sin(a)Yrea1)' (9 19) If we look, for example, at just the real part о! the х' output, x'real' it coт prises the three terms x'real = x real + cos( a)Yreal + sin( a)Yirnag (920) . 
370 O/g/la/ Oata Forтats aпd Тhe/r Effects If x real ' Yreal' and Yimag are of unity value when they enter the butterfly and the twiddle factor angle а = 2rck/N happens to Ье 'ТС/4 = 450, then, x'real сan Ье greater than 2 as х' real = 1 + cos( 450) '1 + sin( 450) '1 = 1 + 0,707 + 0,707 = 2.414 . (921) So we see that the real part of а complex nurnber сan more than double in magnitude in а single stage of an PFТ. Тhe imaginary part of а complex number is equally likely to more than double in magnitude in а single PFТ stage. Without mitigating this word growth problem, overflow errors could render an FFТ algorithrn useless, ок, overflow problems are handled in one of two ways: Ьу truncation or rounding.........each inducing its own individual kind of quantization errors as we shall see. 9.3.3 Truncation Trullcatioп is the process where а data value is represented Ьу the largest quantization level that is less than or equal to that data value. If we're quantizing to integral values, for example, the real value 1,2 would Ье quantized to 1, An exam.ple of truncation to integral values is shown in Figure 9-7(а), where all values of х in the range of О  х < 1 are set equal to О, values of х in the range of 1  х < 2 are set equal to 1, х values in the range of 2  х < 3 are set equal to 2, and so оп, As we did with A/D converter quantization errors, we сап call upon the concept of probability density functions to characterize the errors induced Ьу truncation, Тhe probabllity density function of truncation errors, in terms of the quantization level, is shown in Figure 9-7(Ь). In Figure 97(a) the quantization level q is 1, so, in this case, we сan have truncation errors as great as 1, Drawing upon our results from Eqs. (D-l1) and (D12) in Appendix D, the теan and variance of our unllorm truncation probabl1ity density function are expressed as q .иtrunсаtiоn = 2 (9-22) and 
Effects of F/п/te F/xed-Po/пt B/пary Word Leпgth 371 Quantized х / // .. . 3 I ,;:..!.J . /, Truncation ...з 2 1 2 3 4 Х (а) . 2: л............... /! . . . --q Truncation error ] p,<>I>o>Ы11Iy ''''''''' т""""   о Error value 1 q т I (Ь) Figure 9-7 Truncatlon: (а) quantiZatlon nonllnearlties; (ь) error probabillty denslty functlon, 2 ,..2 ,q v truncation   12 (923) In а sense, truncation error is the price we рау for the privilege of using integer binary arithmetic. Оnе aspect of this is the error introduced when we use truncation to implement division Ьу some integral power of 2, We often speak of а quick way of dividing а binary value Ьу 2 Т is to shift that binary word Tbits to the right; that is, we're truncating the data value (not the data word) Ьу lopping off the rightmost Т bits after the shift, For example, let's say we have the value 31 represented Ьу the five- bit binary number 111112' and we want to divide it Ьу 16 through shift ing the bits Т = 4 places to the right and ignoring (truncating) those shifted bits. After the right shift and truncation, we' d have а binary quo- tient of 31/16 = 000012' Well, we see the significance of the problem because our quick division gave us аn answer of оnе instead of the 
372 Digita/ Data Forтats aпd The/r Effects correct 31/16 = 1.9375. Our division-bytruncation error here is almost 50 percent of the correct answer, Had our original dividend been а 63 rep resented Ьу the sixbit binary number 1111112' dividing it Ьу 16 through а fourbit shift would give us an answer of binary 0000112' or decimal three. The correct answer, of course, is 63/16 = 3.9375, In this case the percentage error is 0,9375/3.9375, or about 23.8 percent. 50, the larger the dividend, the lower the truncation епоr, If we study these kinds of errors, we'l1 find that the resulting trunca tion error depends оп three things: the number of value bits shifted and truncated, the values of the truncated bits (were those dropped bits ones or zeros), and the magnitude of the binary number left over after trunca tion_ Although а complete analysis of these truncation errors is beyond the scope of this book, we сап quantify the maximum error that сап occur with our division-by-truncation scheme when using binary integer arith metic. The worst case scenario is when аН of the Т bits to Ье truncated are ones. For binary integral numbers the value of Т bits, аН ones, to the right of the binary point is 1  2Т, If the resu1ting quotient N is smal1, the sig- nificance of those truncated ones aggravates the error. We сап normalize the maximum division error Ьу comparing it to the correct quotient using а percentage. 50 the maximum percentage error of the binary quotient N after truncation for а Tbit right shift, when the truncated bits are аН ones, is О, '  100 ' Correct quotient  Quotient after truncation ,оtrunсаtiоnепоrmах Correct quotient = 100. Truncation епоr  100' 1  тТ Correct quotient N + (1  Т Т) (924) Let' s plug а few numbers into Eq, (924) to understand its significance, In the first example above, 31/16, where Т = 4 and the resulting binary quotient was N = 1, the percentage епоr is 100. (1  0.0625)/(1 + 1  0.0625) = 100 . (0.9375/1.9375) = 48.4%, Plotting Eq, (9-24) for three different shift values as functions of the quotient, N, after truncation results in Figure 9-8, 50, to minimize this type of division епоr, we need to keep the result ing binary quotient N, after the division, as large as possible. Remember, Eq, (9-24) was а worst case condition where аН of the truncated bits 
Effects о( F/п/te F/xed-Po/пt Biпary Word Leпgth 373 Maximum % error 50 45 40 35 за 25 20 15 10 5 О 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 N Figure 9-8 Maximum error when data shifting and truncatlon are used to Implement divlslon Ьу 2Т' Т = 1 is dlvislon Ьу 2; Т = 2 Is division Ьу 4; and Т = 8 is dlvision Ьу 256, were ones. Оп the other hand, if аН of the truncated bits happened to Ье zeros, the error wi11 Ье zero. In practice, the errors will Ье some where between these two extremes, А practical example of how divi sionby-truncation сап cause serious numerical errors is given in reference [9], 9.3.4 Data Rounding Rouпdiпg is an altemate process of dealing with overflow errors where а data value is represented Ьу, or rounded ОН to, its nearest quantization level. If we're quantizing to integral values, the number 1,2 would Ье quantized to 1, and the number 1.6 would Ье quantized to 2, This is shown in Figure 9-9(а) where аН values of х in the range of 0.5 :;; х < 0.5 are set equal to О, values of х in the range of 0.5 :;; х < 1,5 are set equal to 1, х values in the range of 1.5 :;; х < 2.5 are set equal to 2, etc. The proba- bility density function of the error induced Ьу rounding, in terms of the quantization level, is shown in Figure 9-9(Ь), In Figure 99(a), the quanti- zation level q is 1, so, in this case, we can have truncation error mаgni tudes по greater than q/2, or 1/2. Again, using ош Eqs, (D-l1) and (D12) resu1ts from Appendix D, the mеап and variance of our unifопn roundoff probabi1ity density function are expressed as Ilroundoff = о , (9-25) and 
374 Digffa/ Data Formats aпd Тheir Effects . . Quantized х з  . 2  1.... , Roundoff (а) 1 3/2 5/2 7/2 х   . . . 1 q Roundoff error probability density function (Ь) о q/2 Error value Figure 9-9 Rouпdoff: (а) quaпtizatioп пoпliпearlties; (Ь) error probability deпsity fuпctioп, 2 q2 (j roundofl = 12 (926) ВесаиБе the mean (average) and maximиm error possibly indиced Ьу roundoff is less than that of trиncation, roиnding is generally preferred, in practice, to minimize overflow errors. In digital signal processing, statistical analysis of qиantization error effects is exceedingly complicated, Analytical resиlts depend оп the types of qиantization errors, the magnitude of the data being represented, the numerical format иsed, and which of the many PFТ or digital filter strиc- tиres we happen to иse. Ве that as it тау, digital signal processing experts have developed simplified error models whose analysis has proved иse-- fиl. Althoиgh discиssion of these analysis techniqиes and their resиlts is beyond the scope of this introdиctory text, many references are available for the energetic reader[1O18]. (Reference [11] has an extensive reference list of its own оп the topic of qиantization error analysis.) 
F/oatiпg-Po/пt Biпary Formats 37 Again, the overflow problems using fixedpoint binary formatsthat we try to alleviate with truncation or roundoffarise because so many digital signal processing algorithms comprise large numbers of additions or multiplications, This obstacle, particularly in hardware implementa tions of digital filters and the FFT, is avoided Ьу hardware designers through the use of floatingpoint binary formats. 9.4 Floating-Point Binary Formats Floatingpoint binary formats allow us to overcome most of the limita tions of precision and dynamic range mandated Ьу fixed-point binary for mats, particularly in reducing the ill effects of overflow [19], Floatingpoint formats segment а data word into two parts: а mantissa т and an exponent е, Using these parts, the value of а binary floatingpoint number п is evaluated as п = т . 2 е , (927) that is, the number's value is the product of the mantissa and 2 raised to the power of the exponent, (Maпtissa is а somewhat unfortunate choice of terms because it has а meaning here very different from that in the mathematics of logarithmsmaпtissa originally meant the deci mal fraction of а logarithm,+ However, due to its abundance in the lit- erature we'll continue using the term maпtissa here,) Of course, both the mantissa and the exponent in Eq. (9-27) сап Ье either positive or nega tive numbers. Let's assume that а b-bit floatingpoint number will use Ь е bits for the fixedpoint signed exponent and Ь т bits for the fixed-point signed man- tissa. The greater the number of Ь е bits used, the larger the dynamic range of the number, The more bits used for Ь т , the better the resolution, or precision, of the number, Early computer simulations conducted Ьу the developers of b-bit floatingpoint formats indicated that the best tradeoff occurred with Ь е "" Ь! 4 and Ь т "" 3Ь! 4. We'll see that, for typical 32-bit floatingpoint formats used today, Ь е "" 8 bits and Ь т "" 24 bits. То take advantage of а mantissa's full dynamic range, most implementa- tions of floatingpoint numbers treat the mantissa as а fractional fixed- t For example, the соттоn Iogarithm (log to the base 10) of 256 is 2.4082, Тhe 2 to the Ieft of the decimal point is caJled the characteristic of the Iogarithm and the 4082 digits are caJled the mantissa, Тhe 2 in 2.4082 does not теаn that we multiply ,4082 Ьу 102, Тhe 2 means that we take the antilog of ,4082 to get 2.56 and multiply that Ьу 102 to get 256, 
376 Digitol Doto Forтots aпd Тhe/r Effects pomt binary number, shift the mantissa bits to the right or left, so that its rnost significant bit is а one, and adjust the exponent accordingly. This convention is called пorтalizatioп, When normalized, the mantissa bits are typically called the fractioп of the floating-point number, instead of the mantissa, For example, the decimal value 3,687510 сап Ье repre sented Ьу the fractional binary number 11,10112' If we use а two-bit ехр onent with а six-bit fraction floating-point word, we сап just as well represent 11.10112 Ьу shifting it to the right two places and setting the exponent to two as 11.10112 exponent fraction .j, .j,  о 111 0111 . t binary point (9-28) The floating-point word above can Ье evaluated to retrieve our decimal number again as (0(1' 2-1) + (1. 2-2) + (1, ТЗ) + (0'2"'-4) +(1' т5) + (1' 2--6)], 22 1111 1 12 = [0(1' )+ (1') +(1,)+ (O.)+(l, )+ (1' H' 2 2 4 8 16 32 64 = [0.5 + 0.25 + 0.125 + 0,0625 + 0,03125 + 0,015625].22 = 0.921875.4 = 3,6875 . (9-29) After some experience using floating-point normalization, users soon realized that always having а one in the most significant bit of the fraction was wastefu1. That redundant one was taking ир а single bit position in аll data words and serving по purpose. 50 practical irnplementations of floating-point formats discard that one, assume its existence, and increase the useful number of fraction bits Ьу one, Тhis is why the term hiddeп bit is used to describe some floating-point formats. While increasing the frac- tion's precision, this scheme uses less тетоту because the hidden bit is merely accounted for in the hardware arithrnetic logic, Using а hidden bit, the fraction in Eq, (9-28)'s floating point number is shifted to the left one place and would now Ье 
FloatlпgPoiпt Biпary Forтats 377 11.10112 exponent fraction J. J. [II о 11 О 1 1 01 . t binary point (9-30) RecaH that the exponent and mantissa bits were fixed-point signed binary numbers, and we've discussed several formats for representing signed binary numbers, i.e., sign magnitude, two's complement, and off set binary. As it tums out, аН three signed binary formats are used in industry-standard f1oatingpoint formats. Тhe most соттоn f1oating- point formats, аН using 32bit words, are listed in ТаЫе 93. ТаЫе 9-3 FloatingPoint Number Formats IЕЕЕ Staпdard Р754 Format Bit 31 30 29 28 27 26 25 24 23 22 21 20 '., 2 1 О 15 27 26 25 24 23 22 21 20 21 2-2 23 ,.. 221 222 2231 Sign(5) .. Exponent (е) .... .. Fraction (п .... IВМ Forтat Bit 31 30 29 28 27 26 25 24 23 22 21 20 .. . 2 1 О r 5 26 25 24 23 22 21 20 21 22 2--3 24 '" 222 ;<23 2241 Sign(5) .. Exponent (е) .... .. Fraction и) .... DEC (Digital Equipтeпt Corp.) Forтat Bit 31 30 29 28 27 26 25 24 23 22 21 20 ... 2 1 О r 5 27 26 25 24 23 22 21 20 22 2--3 24 .., 222 223 2241 Sign (5) .. Exponent (е) .... .. Fraction (Л .... MILSTD 1750А Forтat Bit 31 30 29 . .. 11 10 9 8 7 6 5 4 3 2 1 О r 20 2-1 2-2 .. . 220 221 222 223 27 26 25 24 23 22 21 20 I .. Fraction (п .... .. Exponent (е) .... 
378 Dlgital Data Forтats aпd Тhelr Effects The IEEE Р754 floatingpoint fonnat is the most popu1ar because so many manufacturers of floating-point integrated circuits comply with this stan dard [8, 2022]. Its exponent е is offset Ьinary (biased exponent), and its frac tion is а signmagnitude binary number with а hidden bit that's assumed to Ье 20. The decimal value of а nonnalized IEEE Р754 floatingpoint number is evaluated as valuе ШЕЕ = (l)S . 101. 2e127. i hidden Ы! (931) The IВM floating point fonnat differs somewhat from the other float- ingpoint formats because it uses а base of 16 rather than 2, Its exponent is offset binary, and its fraction is sign magnitude with по hidden bit, Тhe decimal value of а norma1ized IВM floatingpoint number is eval- uated as value lBM = (l)S . 001' 16e64. (932) The DEC floatingpoint format uses an offset binary exponent, and its fraction is sign magnitude with а hidden bit that's assumed to Ье 21, The decimal value of а normalized DEC floatingpoint number is evaluated as value DEc = (l)S . 0011' 2e 128. i hidden Ы! (933) MILSTD 1750А is а United States Мilitary Airborne floatingpoint standard, Its exponent е is а two's complement binary number residing in the least significant eight bits, МIL-SТD 1750A's fraction is also а two's complement number (with по hidden bit), and that's why по sign bit is specificalIy indicated in Table 93, The decimal value of а MILSTD 1750А floatingpoint number is evaluated as value 1750A = 1. 2 е . (934) Notice how the floatingpoint formats in Table 93 аН have word lengths оЕ 32 bitsthis was not accidental. Using 32bit words makes these formats easier to handle using 8, 16-, and 32bit hardware proces sors, That fact not withstanding and given the advantages afforded Ьу floatingpoint number formats, these formats do require а significant 
F/oatiпg-Poiпt B/пory Forтots 379 amount of logical comparisons and branching to correct1y perform arith- metic operations. Reference [23] provides useful f10w charts showing what procedural steps must Ье taken when f1oating-point numbers are added and multip1ied. 9.4.1 Floating-Point Dynamic Range Attempting to determine the dynamic range of an arbitrary f1oating-point number format is а challenging exercise. We start Ьу repeating the expres- sion for а number system's dynamic range from Eq. (96) as d . 20 1 ( largest p ossible word value ) ynanuc rangedB = . oglO . smallest possibIe word value (935) When we attempt to determine the largest and sma1lest possible va1ues for а floatingpoint number format, we quickly see that they depend оп such factors as · the position of the binary point · whether а hidden bit is used or not (If used, its position relative to the binary point is important.) . the base value of the floatingpoint number format · the signed binary format used for the exponent and the fraction (For example, recall from ТаЫе 92 that the binary two's complement for- mat сап represent larger negative numbers than the signmagnitude format.) . how unnormalized fractions are handled, if at аН, (Unnormalized, also called gradual underf1ow, means а nonzero number that's less than the minimum normalized format but сап still Ье represented when the exponent and hidden bit are both zero.) . how exponents are handled when they're either аll ones or аll zeros, (For example, the ШЕЕ Р754 format treats а number having an аН ones exponent and а nonzero fraction as an inva1id number, whereas the DEC format handles а number having а sign = 1 and а zero expo nent as а special instruction instead of а valid number.) Trying to develop а dynamic range expression that accounts for аll the possible combinations of the above factors is impractical. What we can do 
380 O/gita/ Oata Forтats aпd Тheir Effects is derive а rule of thumb expression for dynamic range that's often used in practice[8,22,24], Let's assume the foHowing for our derivation: the exponent is а ь.bit offset binary number, the fraction is а normalized signmagnitude num ber having а sign bit and Ь т magnitude bits, and а hidden bit is used just left of the bmary point. Our hypothetical floatingpoint word takes the following form: Bit Ь т +Ь,l Ь т +Ь,2 Ь т +2 Ь т Ьтl Ьт2 О r 5 2ь....1 2 ь ,..2 21 20 2-1 2-2 2--bm+ 1 2--bm I Sign (5) .... Ехроnеn! (е) --+ .... Fraction (f) --+ First we'H determine what the largest value сап Ье for our floatingpoin.t word. The largest fraction is а оnе in the hidden bit, and the remaining Ь т fraction bits are аН ones, тhis would make fraction f = [1 + (1  2--Ь т )]. The first 1 in this expression is the hidden bit to the left of the binary point, and the value in parenthesis is аН Ь т bits equal to ones to the right of the binary point. The greatest positive value we сап have for the Ь.bit offset binary exponent is 2(2ь,11). 50 the largest value that сап Ье represented wi th the floatingpoint number is the largest fraction raised to the largest positive exponent or largest possible word value = [1 + (1  2bт )]. 2(2 Ь '-' 1) (936) тпе smaHest value we сап represent with our floatingpoint word is а оnе in the hidden bit times two raised to the exponent's most negative value, 22Ь.I), or (2 ь ,-1 ) smallest possible word value = 1 . 2 (9-37) Plиgging Eqs, (936) and (937) into Eq, (9З5), , [ [1 + (1  ТЬт)]. 2(2b,-11) J d yn amlc rangedB = 20 'IO g 10 ь ] 1.т(2' ) (938) Now here's where the thumb comes inwhen Ь т is large, say over seven, the 2--Ь т value approaches zero; that is, as Ь т increases, the аН ones fraction 
B/ock F/oat/пg-Poiпt B/пary Forтat 381 (1  2bт) value in the nurnerator approaches 1. Assuming this, Eq. (9-38) becomes ( [1 + 1]' 2(2"11» ) dynamic rangedB '" 20 '10g1o , 1 1,т(2' ) ( 2' 2(2,,-1  1) J ( 2(2,,-1) J = 20 '10g1o т(2,,-I) = 20 '10g1o т(2,,-I) = 20 '10g10(2' 2(2,,-1» = 20 '10g10(2(2"» = 6.02' 2 Ь ' , (939) Using Eq. (939) we сап estimate, for example, the dynamic range of the sing1e-precision IEEE Р754 standard floating-point format with its eight bit exponent: dynamic rangelEEEP754 = 6.02.28 = 1529 dБ. (940) Although we've introduced the major features of the most comтon floating-point formats, there are stil1 more details to leam about floating point nurnbers, For the interested reader the references given in this sec tion provide а good place to start. 9.5 Block Floating-Point Binary Format А marriage of fixedpoint and floating-point binary formats is known as block floatiпg poiпt. Тhis scheme is used, particularly in dedicated FFТ inte- grated cirruits, when large arrays, or blocks, of associated data are to Ье manipulated mathematicaHy. Бlосk floatingpoint schemes begin Ьу examining all the words in а block of data, normalizing the largestvalued word's fraction, and establishing the correct exponent. This normalization takes advantage of the fraction's fuH dynamic range. Next, the fractions of the remaining data words are shifted appropriately, so that they сап use the exponent of the largest word. In this way, аН of the data words use the same exponent va1ue to conserve hardware memory, In FFТ implementations, the arithmetic is performed treating the block normalized data values as fixedpoint binary. However, when an addi- tion causes an overflow condition, аН of the data words are shifted one bit to the right (division Ьу two), and the exponent is incremented Ьу 
382 Digital Data Formats aпd Тheir Effects one. As the reader тау have guessed, block floatingpoint formats have increased dynamic range and avoid the overflow problems inherent in fixedpoint formats but do not reach the performance level of true float ingpoint formats[8,25,26]. References [1] Neugebauer, О, "The History оЕ Ancient Astronomy," Jourпal ofNear Eastern Studies, Vol, 4, 1945, рр, 12, [2] Кnuth, D, Е, тhe Art о! Cornputer Prograrnrniпg: Serniпurnerical Methods, Vol, 2, Section 4.1, Addison-Wesley Publishing, Reading, Massachusetts, 1981, рр, 179, [3] Kester, W, "Peripheral Circuits Сап Make or Break Sampling-ADC Systems," EDN Мagaziпe, October 1,1992, [4] Grove, М, "Measuring Frequency Response and Effective Bits Using Digital Signal Processing Techniques," Hewlett-Packard Jourпal, February 1992, [5] Tektronix, "Effective Вits Testing Evaluates Dynamic Range Performance оЕ Digitizing Instruments," Tektroпix App/icatioп Note, No, 45W-7527, December 1989, [6] Ushani, R, "Subranging ADCs Operate at High Speed with Нigh Resolution," EDN Magaziпe, Aprill1, 1991, [7] Demler, М, "Timedomain Techniques Enhance Testing оЕ High-speed ADCs," EDN Magaziпe, March 30, 1992, [8] Hilton, Н. "А 10-МНz Analog-to-Digital Converter with 110-dВ Linearity," Hewlett-Packard Jourпal, October 1993, [9] Lyons, R. G, "Providing Software Flexibility for Optical Processor Noise Analysis," Cornputer Desigп, July 1978, рр, 95, [10] Кnuth, D, Е. тhe Art о! Cornputer Prograrnrniпg: Serniпurпerical Methods, Vol, 2, Section 4,2, Addison-Wesley Publishing, Reading, Massachusetts, 1981, рр. 198, [11] Rabiner, L, R., and Gold, В. Тheoтy aпd App/icatioп ofDigital Sigпal Processiпg, Chapter 5, Prentice-Hall, Englewood Cliffs, New Jersey, 1975, рр, 353, [12] Jackson, L, В, "An Analysis оЕ Limit Cycles Оие to Multiplicative Rounding in Recursive Digital Filters," Ртос, 7th Allertoп Соп! Circuit Systern Theory, 1969, рр, 6978, [13] Кап, Е, Р, F, and Aggarwal, J, к. "Error Analysis оЕ Digital Filters Employing Floating Point Arithmetic," IЕЕЕ Traпs, Circuit Тheoтy, Vol, СТ-18, November 1971, рр, 67в....s6, [14] Crochiere, R, Е. "Digital Ladder Structures and Coefficient Sensitivity," IЕЕЕ Traпs, Audio Electroacoustics, Vol, AU20, October 1972, рр, 24046, 
Refereпces 383 [15] Jackson, L, В, "On the Interaction оЕ Roundoff Noise and Dynamic Range in Digital Filters," Веи System Techпica/ Jourпa/, Vol, 49, February 1970, рр, 15984, [16] Roberts, R. А., and МuШs, С. Т. Digita/ Sigпa/ Processiпg, Addison-Wesley Publishing, Reading, Massachusetts, 1987, рр. 277. [17] Jackson, L, В. "Roundoff Noise Analysis for Fixed-Point Digital Filters Realized in Cascade or Parallel Form," IЕЕЕ Traпs, Audio E/ectroacoustics, Vol, AU-18, June 1970, рр, 10722. [18] Oppenheim, А. V" and Schafer, R. W, Discrete-Time Sigпa/ Processiпg, Sections 6,8 and 9,8, Prentice-Hall, Englewood Cliffs, New Jersey, 1989, рр, 335, [19] Larimer, J., and D. Chen, "Fixed or Floating? А Pointed Question in DSPs," EDN Magaziпe, August 3, 1995, [20] Ashton, С. "Floating Point Math Handles Iterative and Recursive Algorithms," EDN Magaziпe, January 9,1986, [21] Windsor, В" and Wilson, J, "Arithmetic Dио Excels in Computing Floating Point Products," E/ectroпic Desigп, Мау 17,1984, [22] Windsor, W, А. "IEEE Floating Point Chips Implement DSP Architectures," Computer Desigп, January 1985, [23] Texas Instruments Inc" Digita/ Sigпa/ Processiпg Applicatioпs with the TMS320 Family: ThEory, A/gorithms, aпd Imp/emeпtatioпs, SPRA012A, Texas Instruments, Dallas, ТХ, 1986, [24] Straиss, W, 1, "Integer or Floating Point? Making the Choice," Computer Desigп Magazine, April1, 1990, рр. 85, [25] Oppenheim and Weinstein. "Effects оЕ Finite Register Length in Digital Filtering and the Fast Fourier Transform," Proc, IЕЕЕ, August 1972, рр, 95776, [26] Woods, R. Е. "Transform-based Processing: "How Миф Precision Is Needed," ESD: ThE E/ectroпic System Desigп Magaziпe, February 1987, 
ICHAPTER TENI Digital Signal Processing Tricks As we study the literature of digital signal processing, we'l1 encounter some creative techniques that prolessioпals use to m.ake their algorithms more efficient, These techniques are straightforward examples of the phi- losophy "don't work hard, work smart" and studying them will give us а deeper understanding of the underlying rnathernatical subt1eties of digital signa1 processing, In this chapter, we present а col1ection of these clever tricks of the trade and explore several of them in detail, because doing so reinforces some of the lessons we've learned in previous chapters. 10.1 Frequency Translation without Multiplication Frequency translation is often cal1ed for in digital signal processing algo rithm.s. А filtering scheme cal1ed traпsтultiplexiпg (using the FFТ to eт cient1y implement а bank ofbandpass filters) requires spectral shifting Ьу half the sample rate, or 1/2[1]. Inverting bandpass sampled spectra and converting lowpass FIR filters to highpass fi1ters both саН for frequency translation Ьу half the sample rate. Conventional quadrature bandpass sampling uses spectral translation Ьу one quarter of the sample rate, or 1./4, to reduce unnecessary соmрutаtiоns[2,З], There are а couple of tricks used to perform discrete frequency translation, or тixiпg, Ьу 1./ 2 and 1./ 4 without actua1ly having to perform any multiplications. Let's take а look at these mixing schemes in detail. First, we'l1 consider а slick technique for frequency translating an input sequence Ьу 1./2 Ьу merely multiplying that sequence Ьу (1)n, or (l)O, (1)1, н)2, (l)З, etc. Better yet, this requires only changing the sign of every other input sample value because (1)n = 1, 1, 1, 1, etc. This process тау seem а bit mysterious at first, but it can Ье explained in а straightforward way if we review Figure 10-1. The figure shows us that 385 
386 Dlgltol Sigпal Processiпg Tricks . ] о 1 1 "-. " / " , (. \ Tlme "'о -"8 / / I -'о,. Flgure 10-1 Mixing sequeпce comprising Н)n; 1, 1, 1, 1, etc, multiplying а timedomain signal sequence Ьу the (l)п mixing sequence is equivalent to mu1tiplying the signal sequence Ьу а sampled cosinusoid where the mixing sequence values ахе shown as the dots in Figше 1O1. Because the mixing sequence' s cosine repeats every two sample values, its frequency isf/2. Let's look at this situation in detail, not only to under stand mixing sequences, but to il1ustrate the DFТ equation's analysis capabilities, to reiterate the nature of complex signals, and to reconfirm the important equivalence оЕ shifting in the time domain and phase shift- ing in the frequency domain, We can verify the (l)п mixing sequence's frequency translation off/2 Ьу taking the DFT of the mixing sequence expressed as Fl,l,1,l_.. (т) where Nl Fl,l,l,l,_Jm) = L (1,1, 1,1,...)ej211nm/N п=О (1O1) Using а 4point DFТ, we expand the sum in Eq. (10-1), with N = 4, to F (т) = ej21tOт/4  ej21iJ.т/4 + /:j2112т/4  /:j21t3 т /4 . 1,1,l,1 (1O2) Notice that the mixing sequence is embedded in the signs of the terms оЕ Eq. (10-2) that we eva1uate from т = О to т = 3 to get т = о: F 1,1,1,1 (О) = /:1'0  e--iO + /:jO  ejO = 1  1 + 1  1 = О , (1O3) т = 1: F ( 1 ) = /:jO  /:j211/4 + /:j411/4  /:jб11/4 = 1 + J 'l  1  J '1 = О ( 10-4 ) l,l,l,l ' т = 2: Fl lll (2) = /:jO  /:1'411/4 + /:1'811/4  ej1211/4 = 1 + 1 + 1 + 1 = 4, (10-5) 
Frequeпcy Тюпs/оt/оп W/thout Mu/t1p//COtloп 387 N t MagnitudeofH)" SBqB:: о . ....'...'. ..'" .,.....j.",.. .'".'.....",. о 2 4 6 6 10 12 14 16 18 20 22 24 26 28 30 п t Phase of (1) sвquence 100 50 о, .IJI"., ,...,., ,.,., ,",., '"' .... .,.,.,., ,",., ."..,., о 2 4 6 6 10 12 14 16 18 20 22 24 28 26 30 Flgure 10-2 Frequency-domain magnitude oпd phase of ап N-point (1)n sвquence, and m = 3: Fl,l,1,l (3) = ejO  e--j61t/4 + rj127t/4  rj187t/4 = 1 --11  1 + j1 = О . (1O6) See how the 1, 1, 1, 1 mixing sequence has а nonzero frequency compo nent only when m = 2 corresponding to а frequency of mfs/ N =2//4 = //2, 50, in the frequency domain the foursample 1, 1, 1, 1 mixing sequence is an fs/2 sinusoid with а magnitude of 4 and а phase angle of 00. Had our mixing sequence contained eight separate values, the resu1ts of ап 8-point DFТ would муе Ьееп аН zeros with the exception of the m = 4 frequency sample with its magnitude of 8 and phase angle of 00. In fact, the DFТ of N (1)n has а magnitude of N at а frequency 1./2, When N = 32, for eXaт ple, the magnitude and phase of а 32-point (1)n sequence is shown in Figиre 10-2. Let's demonstrate this (1)n mixing with an example. Consider the 32 discrete samples of the sum of 3 sinusoids comprising а real timedomain sequence х(п) shown in Figure 10-3(а) where 2п10п 2п11п 1t 2п12п 3п х(п) = cos('"32) + 0,5. cos( 4')+ 0.25.cos('"32 8) , (107) Тhe frequencies of the three sinusoids are 10/32 Hz, 11/32 Hz, and 12/32 Hz, and they each have an integra1 number of cycles (10, 11, and 12) over 32 samples of х(п). То show the magnitude and phase shifting effect of using the 1, 1, 1, 1 mixing sequence, we've added arbitrary phase shifts of п/4 (450) and 3п/8 (7.50) to the second and third tones, Using а 32point DFT results in the magnitude and phase of Х(m) shown in Figure 103(b), Let's notice something about Figure 103(b) before we proceed, Тhe magnitude of the m = 10 frequency sample I Х(10) I is 16. Remember why this is so? RecaH Eq. (317) from Chapter 3 where we leamed that, if а real input signal contains а sinewave component of peak amplitude Ао with 
388 Digita/ Sigпa/ Processiпg Tricks (а) 2 Т x(n) 1,' Ш .', .' . . 1(1) = C/OI) + O,5cos(2x11t-1tI4) + O::\5COS(2X12t-зItl8) i , . . ') 0511 .8 1\.\ 8\ j\ . , '.' I I О  I I 1 I I I I .. I ]1 1: I  J i I 1\ I .. 1;1 1,' I } I .05 f O. : ' , " ;; ' .;  'J \/  J ,31 Т1m. 1 : I  j i , '. I ,; 1. \: 15 · \8 .2 Negc::':nCY Phase of Х(т) il') degrees. 0(m) ! Magnitude 01 X(m)  100 t 16 . . 50 '. , 2 4 в 8 10 12 ! (Ь) 8 : . ' . . , . о ......,IIJI..IIJI...,+t . ,,,+i-,,,, 4 ; .. f / i 14 16 18 20 22 24 26 28 за О ....IIJI........+++........I!+++...IIJI"......, -50 о /8. О 2 4 6 В 10 12 14 16 18 20 22 24 26 28 за -100 ....5 l' .67.5 Figure 10-3 Discrete sigпal sequence х(п): (а) time-domain representation of х(п); (ь) frequency-domaln magnitude and phase of Х(т), ап integral number of cycles over N input samples, the output magnitude of the DFT for that particular sinewave is AoN 12, In our case, then, I Х(10) I = 1.3212 = 16, I Х(Щ I = 8, and I Х(12) I = 4, If we multiply х(п), sample Ьу sample, Ьу the (1)" mixing sequence, our new timedomain sequence Х 1 l(п) is shown in Figure 104(a), and the DFT of the frequency translted Х 1 1 is provided in Figure 1O4(b), (Remember now, we didn't really pe;form anу explicit multiplications the whole idea here is to avoid multiplicationswe merely changed the sign of altemating х(п) samples to get Xl.l(п),) Notice that the magnitude and phase of Xl.l(т) are the magnitude and phase of Х(т) shifted Ьу f./2, or 16 sample shifts, from Figиre 10-3(Ь) to Figure 104(b), Тhe negative fre quency components of Х(т) are shifted downward in frequency, and the positive frequency components of Х(т) are shifted upward in frequency resulting in Х 1 jm), It's а good idea for the reader to Ье energetic and prove that th magnitude of Xll(т) is the convolution of the (1)" sequence's spectral magnitude in Figure 1O2 and the magnitude of Х(т) in Figure 10-3(Ь), Another way to look at the Xl,l(т) magnitudes in Figиre 104(b) is to see that multiplication Ьу the (1)" mixing sequence f1ips the positive frequency band of Х(т) from zero to +//2 Hz about 1/4 нz and flips the negative frequency band of Х(т) from f./2 to zero Hz, about 
Freqиeпcy Traпs/atioп Withoиt Mи/tip//cat/oп 389 (а) ' Т,':":  " " ,О, 05 . О 01 I 1 :  i O ; , 1 , . -'5 '. :8 . :.  .: i ! i : : 1 11 1 i 1 I ! . i I  ! ' 11 ! 1  , ",. . .' . oi oi . 1 Magnitud. 01 х,,_,(т) 100 t Phase 01 x,,,(т) In degrees, "1,_, (т) 16. . (Ь)   1 i i 7 , : .,..::..,..,..,..,.....,..,..,..,..::.,.. о .....+++............................ ---50 1 2 .. 6 8 10 12 14 16 18 20 22 24 ., эо 0246810121416182022ииэо  1OO Flgure 10-4 Frequency tronslotion Ьу './2: (о) mlxed seqиence х, l(п) = (1)". х(п); (Ь) mognltude ond phose of frequency-tronsloted х;,_,(т), f/ 4 Нz. Тhis process сап Ье used to invert spectra when bandpass sam- pling is used, as described in Section 2.4. Another useful mixing sequence is 1,1,1,1, etc. It's used to translate spectra Ьу f/4 in quadrature sampling schemes and is illustrated in Figure 105(a). In digital quadrature mixing, we сап multiply an input data sequence х(n) Ьу the cosine mixing sequence 1,1,1,1 to get the in- phase component of x(n)what we'll саН i(n). То get the quadrature- phase product sequence q(n), we multiply the original input data sequence Ьу the sine mixing sequence of 1,1,1,1. This sine mixing sequence is out of phase with the cosine mixing sequence Ьу 900, as shown in Figure 1O5(b), If we multiply the 1,1,1,1 cosine mixing sequence and an input sequence х(n), we'll find that the i(n) product has а DFI' magnitude that's related to the input's DFI' magnitude Х(n) Ьу I I(т) 11 , 1 , 1 . 1  I Х(т) I  ..J2 (10-8) То see why, let's explore the cosine mixing sequence 1,1,1,1 in the fre quency domain, We know that the DFI' of the cosine mixing sequence, represented Ьу Fl.lA,1 (т), is expressed Ьу 
390 Digital Sigпal Processiпg Tricks -f2  - -  - - - - 1 ." . / \ (а) о 3 Time / 1 ., v2 - - - -   -  - 12  -  - -  -   1 . . (Ь) 2 3 О о i ! \ I i Time \ i i/ 1 . . -f2 - -  -  -  -  -    . Figure 10-5 Quadroture mixing sequences for downconversion Ьу ',/4: (о) cosine mixing sequence using 1, 1, 1'1....: (Ь) sine mlxing sequence uslng 1, 1, 1, 1....' Nl Fl,1,1.1(m)= L(l,l,l,l, ",)ej21tпт/N п=О (1O9) Бесаusе а 4-point DFТ is sufficient to evaluate Eq, (10-9), with N = 4, F (m ) =ej21tOт/4 ej21tlт/4 ej21t2т/4 +еj21tзт/4. (10-10) 1,1,1,1 Notice, again, that the cosine mixing sequence is embedded in the signs of the terms of Eq. (1010). Evaluating Eq, (10-10) for т = 1, correspond- ing to а frequency of l'fJN, or 1./4, we find т = 1: F ( 1) = ejO  ej1t/2  ej1t + еjЗ1t/2 1,1,1,1 =1+j1+1+j1=2+j2=  L450. (10-11) 
Freqиeпcy Trans/at/oп W/thoиt Mи/tip/icatioп 391 50, in the frequeney domain, the eosine mixing sequenee has an fs/ 4 rnag nitude оЕ 4/.fi at а phase angle оЕ 450. 5imilarly, evaluating Eq. (10-10) for т = 3, eorresponding to а frequeney оЕ / 4, we find m=3: F, (3)=еjОеjЗ1t/2еjЗ1t+еj91t/2 l,l,l,l = 1  j1 + 1  j1 = 2  j2 = Jz  L  450. (10-12) The energetie reader should evaluate Eq. (10-10) for т = О and т = 2, to eonfirm that the 1,1,1,! sequenee's DFТ eoefficients are zero for the fre- queneies оЕ О and fs/2. Beeause the 4point DFT magnitude оЕ ап аН positive ones mixing sequenee (1, 1, 1, 1) is 4 t , we see that the frequeney-dornain seale faetor for the 1,1,1,1 eosine mixing sequenee is expressed as I( ) 1 f eosine sequenee DFТ magnitude т 1 l ll sea е aetor = , , , аll ones sequenee DFТ magnitude  4/.fi  1  .fi ' (10-13) whieh eonfirms the relationship in Eq. (10-8) and Figиre 1O5(a), Likewise, the DFТ scale factor for the quadrature-phase mixing sequence (1,l,1, 1) is 1 Q(m) l l l l seale faetor = r;;; ' " , -..;2 thus IХ(m)1 IQ(m)1 11  l l= '" -..;2 (1014) 50 what this аН means is that ап input signal's speetral magnitude, after frequeney translation, will Ье redueed Ьу а faetor of .fi. There's reaHy по harm done, howeverwhen the inphase and quadrature-phase eomponents are eombined to find the magnitude оЕ а eomplex frequeney t We сап show this Ьу letting К = N = 4 in Eq, (3-44) for а fOUNample аП ones sequence in Chapter 3, 
392 D/gita/ S/gпa/ Process/пg Tr/cks sample Х(т), the fi scale factor is eliminated, and there's по overall magnitude loss because I scale factor I ==  (I(т) scale factor? + (Q(т) scale factor? ==  (l/fi?+(l/fi? =  (1/2)+(1/2) ==1. (10-15) We сап demonstrate this quadrature mixing process using the х(п) sequence from Eq. (10-7) whose spectrum is shown in Figure 10-3(Ь). If we multiply that 32-sample х(п) Ьу 32 samples of the quadrature mixing sequences 1,1,1,1 and 1,l,1,1, whose DFT magnitudes are shown in Figure 10-6(а) and (Ь), the new quadrature sequences wil1 have the f MagnltudeoI1'1'1'1 6О ! Рhasвot1,1,1,1 1т  . 40 "-...... I : , -45 () . . 20. 2' а ' : O..+............+.........IIJI.IIJI...I[I.....,.....'t...,."...,' 0'.'...."'..+'.'.......'1[1.."..."+.......'.. --20 1 2 " 6 8 10 12 ,4 ,8 18 20 22 f 26 28 30 О 2 " 6 8 10 12 ,4 16 18 20 22 24 28 28 за --40 ....,:J1" . -80 ..... 1 Magn/fude 01 1, 1, 1, 1 t Phasв 01 1. -1, 1, 1 1/-12. 60 I . 40 i (Ь) . 20 8 : о ,.,., "IJI.IIJI I!I+I!IIIJI.,., ,.... ,.,., ,.,., ,.'+IIJI.,.IIJI ....,.. о ....I!I."'.....+..,I!I,..".I!II!II!I..I!II!I...+I!I.,."...I!I  I 2 4 6 \ ,0 12 14 16 1620 22 24 26 28 за О 2 4 6 8 10 12 14 16 18 20 22 24 26 28 за --40 .- -80 1. r Megnitude ot Цт) 10 " . . . . i .. 161 . ' 150t Phase of Цт) in degrees . (с) 5 :   :   ., 1, 1(:+ 2 4 1". 20 \ \ . : !   i ! j'!' '!' : I о.,+н,.".II[I'''".'+1[I1,.'I[I'..'-++-+' о ....+++.......,.+++..,.+++.........-н....... --50 1 .:: 6 8 10 12 .. 18 18 22 24 26 26 за О 2 4 6 8 10 12 14 16 18 20 22 24 26 28 зо 100 .  -,50 1. ! Magnude 01 Q(m) 150 } Phase 01 Q(m).n degree8 10 · ..  161 I!' 100 . (d)." "" " i 50 " 4 1" " 18 20 30 . . . . I О .+...,................н.........+r+.............,.. о .-.+++..............+++...........щ.. 50 t 2 · 6 8 10 12 14 16. 22 24 26 28 . О 2 4 6 8 10 12 14 16 16 20 22 24 26 28 за 1OO .. -150 Flgure 10-6 Frequency translatlon Ьу ',/4: (а) normalized magnltude and phase of coslne 1,1,1, 1 sequence; (Ь) normalized magnltude and phase of sine 1, 1, 1,-1 sequence: (с) magnitude and phase of frequency- translated, Inphase /(т); (d) magnltude and phase of frequency translated, quadraturephase Q(m), 
Frequeпcy Traпs/Qtioп Without Mu/tip/icQtioп 393 frequencytranslated 1(т) and Q(m) spectra shown in Figure 10-6(с) and (d). (Remember now, we don't асшаllу perform any multiplications; we merely change the sign of appropriate х(п) samples to get the i(n) and q(n) sequences.) There' s а lot to learn from Figure 1O6. First, the positive frequency сот- ponents of Х(т) from Figure 1O3(b) are indeed shifted downward Ьу f/ 4 in Figure 106(c). Because our total discrete frequency span ifs Hz) is divided into 32 samples, f/4 is equal to eight, 50, for example, the Х(10) component in Figure 103(b) corresponds to the 1(10---8) = 1(2) component in Figure 106(c). Likewise, Х(11) corresponds to 1(11---8) = 1(3), and so оп, Notice, however, that the positive and negative components of Х(т) have each been repeated twice in the frequency span in Figure 106(c), This effect is inherent in the process of mixing any discrete time-domain signal with а sinusoid of frequency f/4. Verifying this gives us а good opportu- nity to pull convolution out of our toolbox and use it to see why the 1(т) spectral replication period is reduced Ьу а factor of 2 from that of Х(т), Recall, from the convolution theorern, that the DFТ of the time-domain product of х(п) and the 1,1,l,l mixing sequence 1(т) is the convolution of their individual DFТs, or 1(т) is equal to the convolution of Х(т) and the 1,1,l,l mixing sequence's magnitude spectrum in Figure 10-6(а). Н, for convenience, we denote the 1,1,1,1 cosine mixing sequence's magnitude spectrum as 5 с (т), we сап say that 1(т) = Х(т)*5/т) where the "*" symbol denotes convolution. Let's look at that particular convolution to make sure we get the Цт) spectrum in Figure 106(c). Redrawing Х(т) from Figure 10-3(Ь) to show its positive and negative frequency replications gives us Figure 10-7(а), We also redraw 5 с (т) from Figure 10-6(а) showing its positive and nega- tive frequency components in Figure 107(b). Before we perform the con- volution's shift and multiply, we realize that we don't have to flip 5 с (т) about the zero frequency axis because, due to its syrnmetry, that would have по effect, 50 now our convolution comprises the shifting of 5 с (т) in Figure 10-7(Ь), relative to the stationary Х(т), and taking the product of that shifted sequence and the Х(т) spectrum in Figure 107(a) to arrive at 1(т), No shift of 5 с (т) corresponds to the т = О sample of 1(т), The surns of the products for this zero shift is zero, so 1(0) = о. If we shift 5 с (т) to the right Ьу two sarnples, we'd have an overlap of 5/8) and Х(10), and that product gives us 1(2), Onе more 5 с (т) shift to the right results in an overlap of 5 с (8) and Х(l1), and that product gives us 1(3), and so оп. 50 shifting 5 с (т) to the right and summing the products of 5 с (т) and Х(т) results in 1(1) to 1(14). If we return 5 с (т) to its unshifted position in Figure 107(b), and then shift it to the left two samples in the negative frequency 
394 D/g/1Q/ S/gпQI Processlпg Trlcks Magnitude 01 Х(т) . Negallve tr'quency components ,............., . Positive frequency component&  . . (а) j . I!I ,  I!I I!I i ;.! .\ \, ;: ..........I!I+++....,. .,.+44.,.",.., ""., .,.....I!II!I.-+++III' ,.,. III"+++""' --28--26-24-22...2(H8...16 ...14-12 ...10-8 -84--2 О 2 4 6 8 10 12 14 '6 16 20 22 24 28 т I I './2  './2 Sc(m) = Spвctral magnitude "\/ 011,1,1, 1 . .  -------> (Ь) . . . . . . . . ...I!II!I.I!II!I..,....I!I., '111""'" ..III..I!I.'I!I+I!II!II!I.I!I.... ...16...14...12...10 -8 -8 4 --2 О 2 4 6 8 10 12 14 т Magnltude 01 /(т) {7 . . . . (с) . .. . .. . . '. . . '. . . . . . '. . . . . j. .:!. .! i 1. · : : : i. . i : .,.Ш. .'. ..'....н.+.'....н.+.'. ..'...+i+.. ...16...14...12...10-8 -84--2 О 2 4 6 8 10121416 т Тheм r.sult from shlfting Sc(т) to th. '-" Тheae result from shlttlng Sc(m) to the rlghl F/gu.e 10-7 Frеquепсу-dоmQlп coпvolutloп resultlпg lп /(т): (а) mQgпltude of Х(т); (Ь) spectral mQgnltude ofthe coslne's l,...l,l, 1 tlme-domalп sequeпce, Sc(m); thls Is the sequence we'lI shlft to the left Qnd rlght to perform the convolutloп; (с) convolutloп result: the mQgnltude of frequeпcy-traпslafed, In-рhQsе /(т), direction, we'd have an overlap of Sc(8) and X(10), and that product gives us I(2). One more Sc(m) shift to the left resu1ts in an overlap of SC() and X(11), and that product gives us Ц3), and so оп. Continuing to shift Sc(m) to the left determines the remaining negative frequency components I(4) to Ц14). Figure 1O-7(c) shows which I(m) samples resиlted from the left and right shifting of Sc(m). Ву using the convolu... tion theorem, we сап see, now, that the magnitudes in Figure 1O-7(c) and Figure 10-6(с) reaHy are the spectral magnitudes of the in-phase соmро- nent I(m) with its reduced spectral replication period. The upshot of аН of this is that we can change the signs of appropriate х(п) samples to shift x(n)'s spectrum Ьу one quarter of the sample rate 
Frequeпcy Traпs/Qtioп Without Mu/tiplicQtioп 395 without having to perform any explicit mu1tip1ications. Moreover, if we change the signs of appropriate х(п) samples in accordance with the mix ing sequences in Figure 1O5, we can get the inphase i(n) and quadrature- phase q(n) components of the original х(п). One important effect of this digital mixing Ьу f/4 is that the spectral replication periods of [(т) and Q(m) are ми the replication period of the origina1 X(m),t 50 we must Ье aware of the potential frequency aliasing problems that mау occur with this frequencytranslation method if the signal bandwidth is too wide rel- ative to the samp1e rate, as discussed in Section 7,3, Before we leave this particular frequencytranslation scheme, 1et's review two more issues, magnitude and phase. Notice that the untrans lated Х(10) magnitude is equal to 16 in Fire 103(b), and that the trans lated [(2) and Q(2) magnitudes are 16/..J2 = 11.314 in Figure 1O6. This validates Eq. (1O8) and Eq. (10-14). If we use those quadrature соmро-- nents [(2) and Q(2) to determine the magnitude of the corresponding fre- quency-trans1ated, соmр1ех spectra1 component from the square root of the sum of the squares relationship, we'd find that the magnitude of the peak spectral component is peak component magnitude =  (16/ .J2)2 +(16/ .J2)2 =.Ji56 = 16, (1016) verifying Eq. (10-15). 50 combining the quadrature components I(т) and Q(m) does not resu1t in any 10ss in spectra1 amplitude due to the fre quency translation. Finally, in performing the above convolution process, the phase angle samples of Х(т) in Figure 103(b) and the phase samples of the 1,1,l,1 sequence in Figure 1О-6(а) add a1gebraically. 50 the resul- tant [(т) phase ang1e samples in Figure 1О-6(с) result from either adding or subtracting 450 from the phase samples of Х(т) in Figure 1O3(b). Another easily implemented mixing sequence used for f/4 frequency translations to оЫаin [(т) is the 1, О, 1, О, etc" cosine sequence shown in Figure 1O8(a). This mixing sequence's quadrature companion О, 1, О, 1, Figure 10-8(Ь), is used to produce Q(m). То determine the spectra of these sequences, let's, again, usе а 4-point OFТ to state that Nl Fl,O,l,O(m) = L (1,0,1,0,...)ej21tпт/ N пO (10 17) t Recall that we saw this reduction in spectra1 replication period in the quadrature sampling resuIts shown in Figures 7-2(g) and 7-З(d), 
396 DigitQ/ S/gпQ/ Process/пg Tricks . :L. / (а) /  . о 1 " /3 Time 1 1 / ... 't .. . '" , , 3 (Ь) О " . I . о 2' / Time / 11 " I '.,.... Flgure 10-8 Quodrature mixing sequences for downconversion Ьу ',/4: (о) cosine mixing sequence using 1, О,  1, О, , , ,; (Ь) slne mlxlng sequence uslng О, 1, О,  1, ' , , WhenN= 4, F  (т) = ej21COm/4  ej21C2m/4 , 1,0, 1,0 (1O 18) Again, the cosine mixing sequence is ernbedded in the signs of the terrns of Eq. (1018), and there are only two terrns for our 4--point DFТ, We eval uate Eq. (1018) for т = 1, corresponding to а frequency off./4, to find that Fl,O,1.0(1) = ejO  ej1t = 1 + 1 = 2LO° , (1O 19) Evaluating Eq, (1O18) for т = 3, corresponding to а frequency of f./4, shows that F (3) jO jЗ1С 1 1 2LO ° 1,o,1,0 =е e = + = , (10-20) Using the approach in Eq. (1013), we сап show that the scaling factor for the 1, О, 1, О cosine mixing sequence is given as 
Freqиeпcy Troпs/otioп W/thoиt Mи/t/pllcQt/oп 397 2 1 1(т) 1 О 1 О scale factor =  =  " , 4 2 So IХ(т)1 I 1(т) Il,O,l,о=  ' (1O21 ) Likewise, if we went through the same exercise as above, we' d find that the scaling factor for the 0,1, О, 1 sine mixing sequence is given Ьу 1 Q(m)O,l,o,l scale factor = '2 So I Q( m) I = IX(m)1 O,l,O,l 2 (10-22) So these mixing sequences induce а 10ss in the frequencytranslated sig nal amplitude Ьу а factor of 2, Ву way of ехатрlе, let's show this scale factor 10ss again Ьу frequency translating the х(п) sequence from Eq, (1O7), whose spectrum is shown in Figure 10-3(Ь). If we multiply that 32-sample х(п) Ьу 32 samples of the quadrature mixing sequences 1, О, 1, О and О, 1, О, 1, whose DFr mag nitudes are shown in Figure 10-9(а) and (Ь), the resulting quadrature sequences wil1 have the frequencytranslated 1(т) and Q(m) spectra shown in Figure 10-9(с) and (d). Notice that the untranslated Х(10) magnitude is equal to 16 in Figure 1O3(b) and that the translated 1(2) and Q(2) magnitudes are 16/2 = 8 in Figure 1O6. This validates Eq. (1O21) and Eq. (1O22), If we use those quadrature components 1(2) and Q(2) to determine the magnitude of the corresponding frequencytranslated, сотрlех spectral component from the square root of the sum of the squares relationsblp, we'd find that the magnitude of the peak spectral component is peak component magnitude =  (1612)2 +(16/2)2 = (16)2 /2 =  ' (1O23) When the inphase and quadrature-phase components are combined to get the magnitude of а сотрlех value, а resultant ..fi scale factor, for the 1, О, 1, О and О, 1, О, 1 sequences, is not eliminated. An overa1l3 dB 10ss remains because we eliminated some of the signal power when we multi plied ha1f of the data samples Ьу zero, 
398 Digital Slgпal Proeesslпg Trieks t Magnilude 01 1, О, 1, О 112.  (а) '/4 '; i ' ., ".,.. '.'I!I." ,.,. ,.,.. ,..,.. ....1. ".,.. .'. о 246 810121416 18     t Phaseol1,O,I,O '00 о 50 I \ о ",." ,..,., .., ".,.. ,." ",.. ".,,,, IIJI."I!I"'"'' о 2 4 в 8 10 12 14 16 18 20 22 24 26 28 30 t Magnitude 01 О, 1, О, 1 '12   J PhasвoI0,1,O,1 (Ь) '/4: I ': 9O....> ' .",." "1111.."..",.",.",...1..".."., о 111" '.'II!Н";'.' ,.".,.., ""."..'"'II!I-II!I'." О 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 2 4 6 : 10 12 14 16 18 20 22 24 26 28 30 100 . ---90 t Magnitude 01 Цт) 8  7   loot Pha8e 01 I(m) in :egrees  (с)... . ;, .  50t 2 4 i  18 20 :. 2:   ! ; , , . ,! О.'-I!I-Н-,..,..,.,.4+".".IJ++,."."."-i+,, о ,..+Н--.,.".....+-f..+.,..+++.,..,....,++.+. ...БО f . 6 8 10 12 ,4 16 . 22 24 28 28 30 О 2 4 8 8 10 12 14 16 18 20 22 24 26 28 30. . -100 t Magnitude 01 Q(m) (d) 8   i 1 200t Phase 01 Q(m) indreвs : i    : i I i   1, l:t14,,,,,ll,,,,..,..;;. о ,.,+++".,II!I-II!I'.'+++'II!HI!I+H!I..".,..,+++, t 2 4 6 8 10 12 14 16 ,:' 22 24 26 .: О 2 4 6 8 10 12 1. 18 18 20 22 2. 28 28 эо 100 . . · -200 Flgure 10-9 Frequency translotion Ьу ',/4: (а) normollzed mognltude ond phose of eoslne 1, О,  1, О sequenee; (Ь) normolized mognitude ond phose of sine О. 1, О.  1 sвquenee; Се) magпitude ond phose of frequeney- transloted in-phose /(т); (d) mognitude ond phosв of frequency- transloted quodrature-phose Q(m), Тhe question is "Whywould the sequences 1, О, 1, О and 0,1, О, 1 ever Ье used if they induce а signal amplitude 10ss in i(n) and q(n)?" The answer is that the a1temating zerovalued samples reduce the amount оЕ followon processing performed оп i(n) and q(n), Let's say, for ехатрlе, tha t an application requires both i(n) and q(n) to Ье 10wpass fi1tered, When a1temating samples оЕ i(n) and q(n) are zeros, the digital fi1ters have only ha1f as тanу multiplications to perform because mu1tiplications Ьу zero are unnecessary, Another way to 100k at this situation is that i(n) and q(n), in а sense, have been decimated Ьу а factor оЕ 2, and the necessary followon processing rates (operations/second) are also being reduced Ьу а factor оЕ 2, If i(n) and q(n) are, indeed, applied to two separate FIR digital filters, we сan Ье clever and embed the mixing sequences' plus and minus ones and zeros into the 
Frequeпcy TrQпs/Qt/oп W/thout Mu/tip//cQt/oп 399 Demultiplexer [ """ "' ;':  j, Even samplвs  i(n)  х(п) cos=1,1J1J1,.. Odd samples q(n)  "' sin = 1 ,  1, 1,  1 , . . Flgure 10-1 О Quadrature downconversion Ьу f,l4 uslng а demultlplexer (demux) and the sequence 1. 1, 1. 1"", fi1ters' coefficient values and avoid actually perforrning any mu1tip1ica tions, Becaиse some coefficients are zero, they need not Ье иsed at all, and the number of actual mu1tip1iers иsed can Ье reduced. In that way, we'll have perforrned quadrature mixing and FIR filtering in the same process with а simpler filter, This technique al80 forces us to Ье aware of the poten- tial frequency a1iasing problems that mау occur if the input signal is not sufficient1y bandwidth 1imited relative to the original sample rate. Figиre 1O10 illustrates an interesting hybrid technique using thefs/2 mixing sequence (1, 1, 1, 1) to perforrn quadrature mixing and down conversion Ьу fs/ 4, Тhis scheme uses а demu1tiplexing process of routing a1temate input samples to one of the two mixer paths[]. Although both digital mixers use the same mixing sequence, this process is equivalent to mu1tiplying the input Ьу the two quadrature mixing sequences shown in Figиre 10-8(а) and 10-8(Ь) with their frequencydomain magnitudes indi- cated in Figure 109(a) and 109(b), Тhat's because a1temate samples are routed to the two mixers, Although this scheme can Ье used for the quad- rature sampling and demodulation described in Section 7,2, interpolation fi1ters must Ье used to remove the inherent ha1f sample time delay between i(n) and q(n) caused Ьу using the single mixing sequence of 1,1,l,1. ТаЫе 10-1 summarizes the effect of mu1tiplying timdomain signal sam- ples Ьу varioиs digital mixing sequences of ones, zeros, and minиs ones, А "yes" in the last column in ТаЫе 10-1 indicates that a1temating sam ples of i(n) and q(n) can Ье discarded with по adverse impact оп their spectra, al10wing а fol1ow-on processing data rate that's ha1f the original х(п) data rate, 
400 Dig/to/ S/gпo/ Process/пg Tr/cks ТаЫе 10-1 Dlgltol Mixlng Sequences Iпphase Quadrature Frequency Scale Fiпal sigпal Decimatioп sequence sequence traпslatioп ьу factor power loss сап occur 1,1, 1,1""  М2 1 OdB по 1,1,1, 1"" 1, 1,-1,1"" М4 1/ ..fi OdB yes 1, О, 1, О, .. , 0,1, О, 1, ' , , М4 1/2 3dB yes 1, 1, 1, 1,.. , 1, 1, 1, 1, ' , , f/ 4 1/2 3dB по (with demux) (with demux) 10.2 High-Speed Vector-Magnitude Approximation The quadrature processing techniques employed in spectrum analysis, computer graphics, and digital communications routinely require high- speed dеtелninаtiоn оЕ the magnitude оЕ а complex vector V given its real and imaginary parts; i.e., the in-phase part 1 and the quadrature-phase part Q[4]. Тhis magnitude calculation requires а square root operation because the magnitude оЕ V is I V 1= 12 +Q2 (10-24) Assuming that the sum 12 + Q2 is available, the problem is to efficiently perform the square root operation. Тhere are several ways to оЫаin square roots, but the optimum tech niqиe depends оп the capabilities оЕ the available hardware and software. For example, when performing а square root using а high-level software language, we employ whatever software square root function is available. Although accurate, software routines сап Ье very slow. In contrast, if а system must accomplish а square root operation in 50 nanoseconds, high- speed magnitude approximations are required[7,8]. Let's look at а neat magnitude approximation scheme that's particularly efficient. 10.2.1 aMax+BMln Algorlthm There is а technique called the аМах+Мin (read as "alpha mах plus beta min") algorithm for calculating the magnitude оЕ а complex vector. t It's а t А "Мах+Мin" algorithm had Ьееn in UБе, but in 1988 this author suggestecl expanding it to the aМax+!3Мin form, where а could Ье а value other than unity[9], 
HlghSpeed Vector-МQgпltudе ApproxlтQtioп " 4т  «.! "'4' '$1;}' ., , linear approximation to the vectormagnitude problem that requi, determining which orthogonal vector, I or Q, has the greater absolu':;:;;:' ' value, If the maximum absolute value of I or Q is designated Ьу Мах and" ", ':,:" the rninimum absolute value of either 1 or Q is Мin, аn approximation of I V I , using the aМax+Min algorithm, is expressed аБ IVI =a.Мax+Min. (10-25) There are several pairs for the а and  constants that provide varying degrees of vectormagnitude approximation accuracy to within O,ldB[7,10], The aМax+Мin algorithms in reference [10] dеtепninе а vec- tor magnitude at whatever speed it takes а system to реrfопn а magnitude comparison, two multiplications, and one addition, But, as а minimum, those algorithms require а 16-bit multiplier to achieve reasonably accurate results. However, if hardware mu1tipliers are not avai1able, аН is not lost. Ву restricting the а and  constants to reciprocals of integral powers of 2, Eq. (1025) lends itself wel1 to implementation in binary integral arith- metic. А prevai1ing application of the aМax+Min algorithm uses а= 1.0 and  = 0.5[11,12], The 0,5 multiplication operation is performed Ьу shift- ing the minimum quadrature vector magnitude, Мin, to the right Ьу 1 bit. We сап gauge the accuracy of anу vector magnitude estimation Ьу plotting its error аБ а function of vector phase angle. Let's do that. The a.Мax+Мin estimate for а complex vector of unity magnitude, using Мin IVI=Max+ 2 ' (1026) over the vector angular range of О to 900, is shown as the solid curve in Figure 1011. (The curves in Figure 10-11, of course, repeat every 900.) An ideal estimation curve for а unity magnitude vector would have an average value of one and an error standard deviation (о) of zero; that is, having а е = О means that the ideal curve is flatbecause the curve's value is one for all vector angles and its average error is zero, We'll иБе this ideal estimation curve аБ а yardstick to measure the merit of various aМax+Min algorithms, Let's make sure we know what the solid curve in Figure 1011 is teHing ш. It indicates that а unity magnitude vector ori- ented at an angle of approximately 260 will Ье estimated Ьу Eq, (10-26) to have а magnitude of 1.118 instead of the correct magnitude of one. The error then, at 260, is 11.8 percent, or 0,97 dB, Analyzing the entire solid curve in Figure 10-11 results in а е = 0.032 and an average error, over the О to 900 range, of 8.6 percent (0,71 dB), 
402 DigitQI SlgпQI Processiпg Trlcks Vector-magnitude estimate 1.15 1,1 О -' ..... 1,()5 1.00 0,90 "- , .. .., Мах + Minl4 / \ , , ,- " ,- / / / / / 0,95 0,85 О 10 20 ЗО 40 50 80 Vector phase angle (degrees) 70 80 90 Flgure 10-11 Normalized aMax+BMln estimates for а= 1, В = 1/2, and В = 1/4, То reduce the average error introduced Ьу Eq. (1O26), it is equally con venient to use а  value of 0.25, such as Min IVI",Max+ , 4 (10--27) Equation (10-27), whose  multiplication is realized Ьу shifting the digital valиe Min 2 bits to the right, results in the nonnalized magnitude approx imation shown as the dashed curve in Figure lOl1, Although the largest error of 11.6 percent at 450 is similar in magnitude to that realized from Eq, (10-26), Eq, (1O27) has reduced the average error to O,64 percent (0.06 dБ) and produced а slightly larger standard deviation of а е = 0.041, Though not as convenient to implement as Eqs, (1O26) and (10-27), а  valиe of 3/8 has been used to provide even more accurate vector mаgni tude estimates[13]. Using 3.Мin 'V'",Max+ 8 (1O27') provides the nonnalized magnitude approximation shown as the dotted curve in Figure 10-11, Equation (10-27') resu1ts in magnitude estimates, whose largest error is only 6,8 percent, and а reduced standard devia- tion of а е = 0.026. 
H/ghSpeed VectorMQgп/tude Approx/тQt/oп 403 Vector-magnitude estimate 1,10 1,05 15(Мах + Мln/2)11б ,.- :...,... .... ...... ---....;../. ... ", ,.-  ......... ...... ..... --   " ......, " ............ 1.00 0,95 0,90 0,85 О 10 20 30 40 50 60 Vector phase angle (degrees) 70 80 90 Flgure 10-12 a.Max+BMin estlmates for а. = 7/8, В = 7/16 and а. = 15/16, В = 15/32, Although the values for а and  in Figure 10-11 yield rather accurate vectormagnitude estimates, there are other values for а and  that deserve our attention because they result in smaller error standard devia- tions. Consider а = 7/8 and  = 7/16 where 7 7, 7 ( Мin ) IVI",Max+Mm= Max+ 8 16 8 2 (1028) Equation (1O28), whose norma1ized results are shown as the so1id curve in Figure 1O12, provides an average error of 5.01 percent and Cf e = 0,028. The 7/8ths factor app1ied to Eq. (1()",26) produces both а smaller Cf e and а reduced average епоrit lowers and flattens out the епоr cшvе from Eq. (1O26), А further improvement сап Ье obtained with а = 15/16 and  = 15/32 where 15 15, 15 ( Мin ) IVI",Max+Mm= Max+ . 16 32 16 2 (1029) Equation (1O29), whose norma1ized results are shown as the dashed curve in Figure 10 12, provides an average error of 1.79 percent and Cf e = 0.030, At the expense of а slightly larger Cf e ' Eq, (1029) provides an average error that is reduced below that provided Ьу Eq. (1028). Although Eq. (1029) appears to require two multiplications and one addition, its digital hardware implementation сan Ье straightforward, as 
404 Digitol Sigпol Processiпg Tricks 11' 15(Мах + Minl2) 16 IQI Мах + Мin12 16 10112 Flgure 10-13 Hordwore implementation of Eq, (10-29), shown in Figure 1O13. The diagonallines, \1 for example, denote а hard wired shllt оЕ 1 bit to the right to implement а divide--bytwo operation Ьу truncation. Likewise, the \4 8утЬоl indicates а right shift Ьу 4 bits to real ize а divideby 16 operation, The 111> I Q I controlline is ТRUE when the magnitude оЕ 1 is greater than the magnitude оЕ Q, 80 that Мах = I 1 I and мin = I Q I , This condition enables the registers to apply the value8 111 and I Q I /2 to the adder. When 111 > I Q I is FALSE, the registers apply the val- ues I Q I and 111/2 to the adder. Notice that the output оЕ the adder, Мах + Мin/2, is the re8ult оЕ Eq. (1026). Equation (1O29) is implemented via the subtraction оЕ (Мах + Мin/2)/16 from Мах + Мin/2. In Figure 10 13, аН impIied multiplications from Eq. (1029) are per formed Ьу hardwired bit shifting, and the total execution time is limited onIy Ьу the delay times as80ciated with the hardware components. 10.2.2 Overflow Errors In Figures Ю-ll and 1(}..12, поЬсе that we have а potential overflow problem with the results оЕ Eqs, (1(},,26), (1(},,27), and (1O29) because the estimates сan exceed the correct noпnalized vectormagnitude values; i.e" Боте таgni tude estimates are greater than опе. This теans that, although the correct magnitude value тау Ье within the system's fuHscale word width, the algorithm result тау exceed the word width of the system and cause over- flow епоrs, With etМax+Мin algorithms, the user must Ье certain that по true vector magnitude exceed8 the value that will produce an estimated magnitude greater than the maximum a110wable word width, For example, 
High-Speed Vector-МQgп/tиdе ApproxiтQtioп 405 when using Eq. (lO26), we mиst ensure that по Пuе vector magnitude exceeds 89.4 percent (1/1.118) of the maximum allowable work width. 10.2.3 Truncatlon Errors The penalty we рау for the convenience of having а and  as powers of two is the error induced Ьу the divisionbytruncation process; and, thus far, we haven't taken that error into account. The error curves in Figure 10 11 and Figиre 10 12 were obtained using а software simиlation with its floatingpoint accuracy and are useful in eva1uating different а and  val ues. However, the Пuе error introduced Ьу the aМax+Min algorithm will Ье somewhat different from that shown in Figиres 1O11 and 1O12 due to division errors when truncation is иsed with finНе word widths,t For аМах+Мin schemes, the truncation errors are а function of the data' s word width, the algorithm иsed, the values of both 111 and I Q I , and the vector's phase angle. (These errors due to truncation compound the errors already inherent in our aМax+Мin a1gorithms.) Thus, а сот- plete analysis of the truncation errors is beyond the scope of this book. What we сап do, however, is illustrate а few truncation error examples. Figure 1O14 shows the percent truncation errors using Eq. (lO29) for vector magnitudes of 4 to 512, Two vector phase angles were chosen to % Error 8 6 о 6c2=9 6_9_O_O.O9OOOOOOO 4 2 % о 2 --4 --в . 260 о 00 --в 10 4 85 165 245 325 405 485 v Flgure 10-14 Equatlon (10-29) truncaHon error vs, vector тagnitude I VI, t Errors associated with division-by-truncation are covered in more detail in Section 9.3, . 
406 D/g/ta/ S/gпQ/ Process/пg Tr/cks ТаЫе 10-2 а MQx+SMin Algorlthm CompQrisons Largest Largest Average Average Staпdard Мах AIgorithm error error error error deviatioп IVi IVi  (%) (dB) (%) (dB) а, (% F.S.) Мах + Мin/2 11,8% 0.97 dB 8,6% 0,71 dB 0,032 89,4% Мах + Мin/4 11,6% 1Ш dB O,64% O,06 dB 0,041 97,0% Мах + 3Мin/8 6,8% 0,57 dB 3.97% 0,34 dB 0,026 93,6% 7(Мах + Мin/2)/8 12,5% 1,16 dB 4,99% 0.45 dB 0,028 100% 15(Мах + Мin/2)/16 ,25% O,56 dB 1,79% 0,15 dB 0,030 95,4% illustrate these truncation errors, The first is 260 because this is the phase angle where the most positive algorithm error occurs, and the second is 00 because this is the phase angle that introduces the greatest negative algorithm error, Notice that, at small vector magnitudes, the truncation errors are as great as 9 percent, but for ап eightbit system (maximum vector magnitude = 255) the truncation error is less than 1 percent. As the system word width increases, the truncation errors approach О percent, This means that truncation errors add very little to the inherent aMax+Min algorithm errors, ТЬе relative реrfопnаnсе of the various algorithms is summarized in ТаЫе 102, The last column in ТаЫе 102 illustrates the maximum allow аЫе true vector magnitude as а function of the system's full-scale (Е5.) word width to avoid overflow errors. 50, the aМax+Мin algorithm enables highspeed, vectormagnitude computation without the need for math coprocessor or hardware mu1ti plier chips, Of course with the recent availability of highspeed, floating point multiplier integrated circuitswith their ability to multiply or divide Ьу nonintegral nurnbers in опе or two clock cycles and  mау not always need to Ье restricted to reciprocals of integral powers of two. It's also worth mentioning that this algorithm сап Ье nicely implemented in а single hardware integrated circuit (for example, а field programma Ые gate array) affording highspeed operation, 10.3 Data Windowing Tricks There are two usefиl schemes associated with using window fиnctions оп input data applied to а DFТ or ап FFТ. The first technique is an efficient implementation of the Hanning (raised cosine) and Hamming windows 
OQtQ Wiпdowlпg Trlcks 407 to reduce 1eakage in the FFf, Тhe second scheme is re1ated to minimizing the amplitude 10ss associated with using windows, 10.3.1 Windowing in the Frequency Domain Тhere's а c1ever technique for minimizing the calcu1ations necessary to imp1ement FFf input data windowing to reduce spectra11eakage, Тhere are times when we need the FFf о! unwindowed time-domain data, and at the same time, we a1so want the FFТ о! that same time data with а win- dow function applied, In this situation, we don' t have to perform two sep- arate FFfs, We сап perform the FFf о! the unwindowed data, and then we сап perform frequencydomain windowing оп that FFf result to reduce 1eakage, Let's see how, Recall from Section 3,9 that the expressions for the Hanning and the Hamming windows were wиап(п) = O,5O,5cos(21tn/N), and wиаm(п) = 0.54 O,46cos(21tn/N), respective1y. They both have the gen- era1 cosine function form о! W(n) = а  cos(21tn/N) , (10-30) for п = О, 1, 2, ' , " Nl, Looking at the frequency response о! the genera1 cosine window function, using the definition о! the DFf, the transform о! Eq, (10-30) is expressed Ьу Nl W(m) = )a ,В cos(21tn / N)]ej27tпт! N , п=О (10-31) ej27tп! N ej27tп! N Because cos(21tn / N) =  + , Eq, (10-31) сап Ье rewritten as 2 2 Nl R Nl R Nl W(m)= Laej27tпт!N  Lej27tп!Nej27tпт!N  Le-j27tп!Nеj27tпт!N п=О п=О п=О Nl N-l R N-l = Laej27tпт!N  Le-j27tп(т1)!N  Lej27tп(т+l)!N , (10-32) п=О п=О п=О Equation (10-32) 100kБ pretty complicated, but, using the derivation from Section 3,13 for expressions like those summations, we find that Eq, (10-32) mere1y results in the superposition о! three sin(x)/ х functions in the fre- quency domain, Тheir amplitudes are shown in Figure 10-15, 
408 DigitC11 Slgпol Processlпg rrlcks FrSQ т--1 т mt1 Flgure 10-15 General coslne window frequency-response amplltude, Notice that the two translated sin(X)/X funсНоns have sidelobes with phase opposite from that of the center sin(x) / х funсНоn. тhis mеаns that а tirnes the mth Ыn output, minus /3/2 times the (ml)th Ьin output, minus /3/2 times the (т+ l)th Ьin output will minimize the sidelobes of the mth Ьin. Тhis frequencydomain convolution process is equivalent to mul tiplying the input time data sequence Ьу the N-valued window funсПоn w(n) in Eq. (1030)[14,l5]. For example, let's say the output of the mth FFf Ьin is Х(т) = а т + jb m , and the outputs of its two neighboring ЫNS are X(m1) :::: al + jbl алd Х(т+l) = а+ 1 + jb+1' Тhen frequency-domain windowing for the mth Ьin of the иnwindowed Х(т) is as follows: Xwindowed(m):::: aX(т)x(т l)X(т+ 1) = а(а т + jb m )  (al + jbl)  (a+l + jb+ 1 ) ::::ал т (al +a+l)+ ЛаЬ т (bl +Ь+ 1 )] (10-33) То get а windowed Npoint FFТ, then, we сал apply Eq, (1(},,33), requiring 4N additions алd 3N mшНрНсаНоns, to the unwindowed FFТ result and avoid having to perform the N multiplications of time-domain windowing and а second PFТ with its Mog 2 N additions and WogjJ multiplications. . 
DQtQ Wiпdow/пg Tricks 409 The neat situation here is the а. and  values for the Hanning window, They're both 0.5, and the products in Eq, (10-33) сап Ье obtained in hard ware with binary shifts Ьу а single bit for а. and two shifts for /2, Тhus, по multiplications are necessary to implement the Hanning frequency- domain windowing scheme, Тhe issues that we need to consider are the window function best for the application and the efficiency оЕ availabIe hardware in реrfопning the frequency-domain multiplications, Along with the Hanning and Hamming windows, reference [15] describes а family оЕ windows known as Бlасkmаn and Бlасkmаn Harris windows that are also very useful for performing frequency- domain windowing. (Бе aware that reference [15] has two typographical errors in the 4-Term (74 dБ) window coefficients column оп its page 65, Reference [16] specifies that those coefficients shouId Ье 0.40217, 0.49703,0,09892, and 0,00188,) Let's finish our discussion оЕ frequency- domain windowing Ьу saying that this scheme сап Ье efficient because we don't have to window the entire set оЕ РРТ data, Frequency-domain windowing need Ье реrfопnеd only оп those РРТ bins that are оЕ inter est to us, 10.3.2 Minimlzing Wlndow-Processing Loss In Section 3.9, we stated that nonrectangular window functions reduce the overa11 signallevels applied to the PFТ, Recalling Figure 3-16(а), we see that the peak response оЕ the Hanning window function, for ехатрlе, is half that obtained with the rectangular window because the input sig- nal is attenuated at the beginning and end edges оЕ the window sample interval, as shown in Figure 10-16(а), In tепns оЕ signal power, this atten- uation results in а 6 dБ 10ss, Going beyond the signal-power 10ss, window edge effects сап Ье а probIem when we're trying to detect shortduration signals that тау occur right when the window function is at its edges, Well, some early digital signal processing practitioners tried to get around this probIem Ьу using dual window functions, Тhe first step in the dua1 window process is windowing the input data with а Hanning window function and taking the PFТ оЕ the windowed data. Тhen the same input data sequence is windowed against the inverse оЕ the Hanning, and another РРТ is performed, (The inverse оЕ the Hanning window is depicted in Figure 10-16(Ь),) Тhe two FFТ results are then averaged. Using the dual window functions shown in Figure 10-16 enabIes signal energy attenuated Ьу one window to Ье multiplied Ьу the Ыl gain оЕ the other window, Тhis technique seemed like а reasonabIe idea at the time, but, depending оп the original signal, there could Ье . 
41 О D/g/ta/ S/gпQI Process/пg Tr/cks (а) Hanning window: \li.ian (п) = 0,5  О,5соs(2пn'N) о L...........-,- Windowedge L..........,--- Window edge Time (Ь) Inverse 01 the Hanning window: w Han (п) = 0,5 + О,5соs(2пn'N) о  Window edge  Windowedge Time Flgure 10-16 Dual windows used to reduce windowed-slgnalloss, excessive leakage from the inverse window in Figure 10-16(Ь). Remember, the purpose of windowing was to ensure that the first and last data sequence samples, applied to an FFТ, had the same value. Тhe Hanning window guaranteed this, but the inverse window could not, Although this dual window technique made its way into the literature, it quickly fell out of favor, Тhe most common technique used today to minimize signal 1055 due to window edge effects is known as overlapped windows, The use of overlapped windows is depicted in Figure 1O17, It's а straightforward technique where а single good window function is applied multiple times to an input data sequence, Figure 10-17 shows аn N-point window function applied to the input time series data four times resulting in four separate Npoint data sequences. Next, four separate N- point FFТs are performed, and their outputs averaged, Notice that anу input sample value that's fully attenuated Ьу оnе window will Ье multi- plied Ьу the full gain of the following window, Тhus, all input samples will contribute to the finаl averaged FFТ results, and the window function keeps leakage to а minimum. (Of course, the user has to decide which particular window function is best for the application.) Figure 10-17 shows а window overlap of 50 percent where еат input data sample con tributes to the results of two FFТs, It's not uncommon to see an overlap of 
FQst Mu/tip//cQt/oп of Сотр/ех Nuтbers 411 Inpu! 1( !ime I series  1s!FFТ    2,5 N samples » I Time .. I N samples Flgure 10-17 Windows overlapped Ьу 50 percent to reduce windowed-signalloss, 75 percent being used where each input data sample would contribute to the results о! the three individual FFТs. О! course the 50 percent and 75 percent overlap techniques increase the amount о! total signal processing required, but, depending оп the application, the improved signal sensi- tivity mау justify the extra numЪеr crunching. 10.4 Fast Multiplication о' Complex Numbers Тhe multiplication о! two complex numbers is one о! the most common functions performed in digital signal processing, It's mandatory in аН dis- crete and fast Fourier transformation algorithms, necessary for graphics transformations, and used in processing digital communications signals. Не it in hardware or software, it's always to our benefit to streamline the processing necessary to perform а complex multiplication whenever we can. If the avai1able hardware сап perform three additions faster than а single multiplication, there's а way to speed ир а complex multiplication operation[17]. Тhe multiplication о! two complex numbers а + jb and с + jd, results in the complex product R + jI = (а + jb) . (с + jd) = (ас  bd) + j(bc + ad) . (10-34) We can see that Eq, (10-34) required four multiplications and two addi- tions. (From а computational standpoint, we'l1 assume that а subtraction 
412 D/g/tQI S/gпQ/ Process/пg Tr/cks is equivalent to an аddШоn,) Instead of using Eq, (1O34), we сan ca1culate the following intermediate values: k 1 = а(с + d) , k 2 = d(a + Ь) , and k3 = с(Ь  а) . (1035) Then we perform the fol1owing operations to get the final R and 1: R=klk2' and I=kl+kз, (1036) The reader is invited to plug the k values from Eq. (1035) into Eq. (1036) to verify that the expressions in Eq, (1(},36) are equivalent to Eq. (10-34), Тhe intermediate values in Eq. (1(},35) required three аddШоns and three multiplications, whereas the results in Eq. (10-36) required two more аddШоns. 50 we traded one of the multiplications required in Eq. (10-34) for three аddШоn operations needed Ьу Eq, (1035) and Eq, (1O36), If ощ hardware uses fewer clock cycles to perform three аddШоns than а single multiplication, we тау well gain overal1 processing speed Ьу using Eq. (1035) and Eq. (10-36) for complex multiplication, instead of Eq. (1O34), 10.5 Efficiently Performing the FFТ 01 Real Sequences Upon recognizing its linearity property and understanding the odd and even syrnmetries of the transform's output, the early investigators of the fast Fourier transform (FFT) rea1ized that two separate, real Npoint inpиt data sequences could Ье transformed using а single Npoint coт plex FFТ, Тhey also developed а technique using а single Npoint сот- plex FFТ to transform а 2Npoint real input sequence. Let's see how these two techniques work. 10.5.1 Performing Two NPoint Real FFТs The standard FFТ algorithms were developed to accept complex inputs; that is, the FFТ's normal input х(п) sequence is assumed to comprise real and imaginary parts, such as 
Efflcieпtly Perforтlпg the FFТ of Reol Seqиeпces 41 3 х(О) = хт(О) + jxi(O) , х(l) = Х т (1) + jx j (1) , х(2) = Х т (2) + jxP) , x(Nl) = xr(Nl) + jXi(Nl) . (10-37) In typical signal processing schemes, РРТ input data sequences are usuaHy real. Тhe most common example of this is the PFТ input samples coming from an A/D converter that provides real integer values of some continuous (analog) signal. In this case the FFTs imaginary xi(n)'s inputs are аН zero, 50 initial PFТ computations performed оп the xi(n) inputs represent wasted operations. Early FFТ pioneers recognized this inefficiency, studied the problem, and developed а technique where two independent Npoint, real input data sequences could Ье transformed Ьу а single N-point complex РРТ. We саН this scheme the Two NPoint Real FFTs algorithm. The derivation of this technique is straightforward and described in the Iiterature[18--20], If two N-point, real input sequences are а(п) and Ь(п), they'H have discrete Fourier transforms represented Ьу Ха(т) and Хь(т). If we treat the а(п) sequence as the real part of an РРТ input and the Ь(п) sequence as the imaginary part of the PFТ input, then х(О) = а(О) + jb(O) , х(l) = а(l) + jb(l) , х(2) = а(2) + jb(2) , x(Nl) =a(Nl) + jb(Nl) . (10-38) Applying the х(п) values from Eq, (10-38) to the standard DFТ, Nl Х(т) = Lx(n)ej21tпm/N , п=О (10-39) we'H get an DFТ output Х(т) where т goes from О to Nl, (We're assum- ing, of course, that the DFТ is implemented Ьу way of an PFТ algorithm.) Using the superscript * symbol to represent the complex conjugate, we сап extract the two desired FFТ outputs Ха(т) and Хь(т) from Х(т) Ьу using the following: 
414 Digitol Sigпai Processiпg Trlcks Ха(т) = Х' (N  т) + Х(т) , 2 (1O40) and Хь(т) = ЛХ' (N  т)  Х(т)] 2 (10-41) Let's break Eqs. (10-40) and (1O41) into their real and imaginary parts to get expressions for Ха(т) and Хь(т) that are easier to understand and implement. Using the notation showing X(m)'s real and imaginary parts, where Х(т) = Х,(т) + jXi(m), we can rewrite Eq. (10-40) as Ха(т) = X,(N  т) + Х,(т) +l[x j (m)  Xj(N  т)] (1O42) where m = 1,2,3, ' . ., Nl, What about the first Ха(т), when m = О? Well, this is where we run into а bind if we actually try to implement Eq, (10-40) direct1y. Letting m = О in Eq. (10-40), we quickly realize that the first term in the nuтerator, X*(NO) = X*(N), isn't available because the X(N) sample does not exist in the output of an N-point FFr! We resolve this problem Ьу remembering that Х(т) is periodic with а period N, so X(N) = X(O),t When m = О, Eq, (10-40) becomes = ++ =. 2 (10-43) Next, simplifying Eq. (1O41), Хь(т) = j[X,(N  т)  jXj(N  т)  Х,(т)  jXi(m)] 2 = Xi(N  т) + Xj(m) + j[X,(N  т)  Х,(т)] 2 (10-44) where, again, m = 1,2,3, ' , " Nl. Ву the same argument used for Eq. (10-43), when m = О, Хь(О) in Eq, (1O44) becomes t This fact is illustrated in Section 3.8 during the discussion of spectralleakage in DFТs, 
Efflcieпtly Perforтiпg the FFТ о' Real Sequeпces 415 Хь(О) = Xj(O) + Xj(O) + ЛХт(О)  Хт(О)]  Xj(O) . 2 (1O45) This discussion brings ир а good point for beginners to keep in mind. In the 1iterature Eqs. (1040) and (1O41) are often presented without anу discussion of the т = О problem, 50, whenever you're grinding through an algebraic derivation or have some equations tossed out at you, Ье а lit t1e skeptical, Try the equations out оп an examplee if they're true. (After аll, both authors and book typesetters are human and sometimes make mistakes, We had an old saying in Ohio for this situation: "Trust everybody, but cut the cards.") Following this advice, let's prove that this Two N-Point Real FFTs algorithm really does work Ьу applying the 8point data sequences from Chapter 3's DFТ Examples to Eqs. (10-42) through (1O45), Taking the 8point input data sequence from 5ection 3.1 's DFТ Example 1 and denoting it а(п), а(О) = 0,3535, а(2) = 0,6464, а(4) = 0.3535, а(6) = 1.3535, а(1) = 0.3535, а(3) = 1.0607, а(5) = 1,0607, а(7) = 0.3535 . (10-46) Taking the 8-point input data sequence from 5ection 3,6's DFТ Example 2 and calling it Ь(п), Ь(О) = 1.0607, Ь(2) = 1,0607, Ь(4) = 0.3535, Ь(6) = 0.3535, Ь(1) = 0.3535, Ь(3) = 1.3535, Ь(5) = 0.3535, Ь(7) = 0.6464 . (1O47) Combining the sequences in Eqs, (1O46) and (1O47) into а single complex sequence х(п), а(n) .j. х(п) = 0.3535 + 0.3535 + 0.6464 + 1,0607 + 0.3535  1,0607  1.3535  0.3535 Ь(n) .j. + j 1,0607 + j 0,3535  j 1,0607  j 1.3535  j 0.3535 + j 0.3535 + j 0.3535 + j 0.6464 , (1O48) 
. 416 DigitQI SlgпQI Processiпg Tricks Now, taking the 8point PFТ of the complex sequence in Eq, (1O48) we get Х,(т) J. Х(т) = 0.0000  2.8283 + 2.8282 + 0.0000 + 0.0000 + 0.0000 + 0.0000 + 2,8283 50 from Eq. (1043), Х;(т) J. + j 0.0000  j 1.1717 + j 2.8282 + j 0.0000 + j 0.0000 + j 0.0000 + j 0.0000 + j 6.8282 Ха(О) = Х/О) = о , ....m=Ot.rm ....m=lt.rm .....m=2term .....т.зtеrm .....m-4term .....m=5term .....т=6term .... т = 7 term . (1O49) То get the rest of Ха(т), we have to plug the PFТ output's Х(т) and X(Nm) values into Eq. (1O42).t Doing so, Ха(1) = X r (7) +X r (1) +l[Xi(l) X i (7)1 2.8283 2.8283 + 1,1717 б.8282J 0j7.9999  0j4.0=4L900, 2 Х ( 2 ) = Хr(б) + X r (2) + j[X i (2)  Хi(б)J = 0.0+ 2.8282 + j[2.8282  0.0] а 2 2 2.8282 + j2,8282 = 1.414 + j1.414 = 2L45 o , 2 Х ( 3 ) = Xr(5) + Хr(З) + j[Xi(3) Xi(5)] = 0,0+ 0.0 + ло.о о.о] OLOO, а 2 2 Х ( 4 ) = Xr(4)+Xr(4)+ j[Xi(4)Xi(4)1  0.0+0.0+ j[O.OO,O] OLO O , а 2 2 t Remember, when the FFТ's input is complex, the FFТ outputs тау not Ье conjugate sym- metrie; tha! is, we сan'! assume that F(m) is equa1 !о F*(Nm) when the FFТ input sequence's real and imaginary рartБ are both nonzero, 
Efflcleпt/y Perforтiпg the FFТ of ReQI Sequeпces 417 Х ( 5 ) = Х т (3) + Х т (5) + j[X j (5)  X j (3)]  0,0 + 0.0 + ДО.О  0.0] = OL00 , а 2 2 Х ( 6 ) = Х т (2) + Х,(6) + j[X j (6)  X j (2)] = 2,8282 + 0,0 + ло.о  2.8282] а 2 2  2.8282 j2.8282 1,414 j1,414 = 2L 450 , and 2 Х ( 7 ) = Х,(l) + Х,(7) + j[X j (7) Xj(l)] = 2.8282 + 2,8282 + Д6.8282 + 1,1717] а 2 2 0.0 + j7.9999 = 0+ j4.0 = 4L900 . 2 50 Eq. (1042) real1y does extract Х.(т) from the Х(т) sequence in Eq. (1O49). We сап see that we need not solve Eq. (10-42) when т is greater than 4 (or N /2) because Ха(т) wil1 always Ье conjugate symmetric, Because Х.(7) = Х.(l), Х а (6) = Х а (2), etc., only the first N /2 elements in Ха(т) are independent and need Ье calculated, ок, let's keep going and use Eqs, (10-44) and (1045) to extract Хь(т) from the PFТ output. From Eq. (1045) Хь(О) = Х;(О) = о . Plugging the FFТ's output values into Eq. (10-44) to get the next four Xb(m)s, we have Х ( 1 ) = X j (7) + X j (l) + ЛХ,(7)  X,(l)]  6,8282  1,1717 + Д2,8283 + 2.8283] ь 2 2 5.656 + j5,656  2,828 + j2,828 = 4L450 , 2 Х ( 2 ) = X j (6) + X j (2) + ДХ,(6)  Х,(2)]  0,0 + 2.8282 + до.о  2,8282] ь 2 2 2.8282  j2,8282 = 1,414  j1,414 = 2L  450, and 2 
-418 Dig/to/ SigпQ/ Process/пg Tr/cks Х ь (3) = Хj(5)+Хj(З)+ j[Хr(5)Хr(З)] 2 0,0 + 0,0 + j[O.O  0.0] = OL00 and 2 - ' Х ь (4) = X j (4)+X j (4)+ j[Xr(4)Xr(4)] 2 0.0+0.0+ j[O,OO,O] OLO O . 2 ТЬе question arises "With the additiona1 processing required Ьу Eqs, (1042) and (1044) after the initial FFТ, how much computational saving (or 10ss) is to Ье had Ьу this Two N-Point Real FFТs algorithm?" We Сan estimate the efficiency оЕ this algorithm Ьу considering the number оЕ arithmetic operations required relative to two separate N-point radix2 FFТs. First, we estimate the number of arithmetic operations in two sepa rate Npoint complex FFТs. From 5ection 4.2, we know that а standard radix2 Npoint complex FFТ comprises (N /2) .10g2N butterfly operations. If we use the optimized butterfly structure, each butterfly requires one complex mu1tiplication and two соmр1ех additions. Now, one соmр1ех mu1tiplication requires two real additions and four real multip1ications, and one complex addi tion requires two real additions. t 50 а sing1e FFТ butterfly operation com prises four rea1 mu1tip1ications and six rea1 additions. Тhis means that а single Npoint соmр1ех FFТ requires (4N /2) .10g 2 N rea1 multiplications, and (6N /2) 'log 2 N real additions, Finally, we сап say that two separate N-point complex radix-2 FFТs require two Npoint complex FFrs ..... 4N .10g2N rea1 multip1ications, and (1050) 6N .10g2N real additions. (1050') Next, we need to determine the computational workload of the Two N-Point Rea1 FFТs algorithm. If we add ир the number of rea1 mu1tiplica tions and rea1 additions required Ьу the algorithm's N-point complex FFТ, plus those required Ьу Eq, (1042) to get Ха(т), and those required Ьу Eq. (10-44) to get Хь(т), the Two NPoint Rea1 FFТs algorithm requires two NPoint Real FFrs algorithm..... 2N .10g 2 N + N rea1 multiplications, and (1051) 3N. 10g2N + 2N real additions. (10-51') t Пlе complex addition (a+jb) + (c+jd) = (а+с) + j(b+d) requires two real additions, А complex multiplication (a+jb) . (c+jd) = acbd + j(ad+bc) requires two real additions and four real multi plications, 
Efflcieпtly Perforтiпg the FFТ о' ReQI Sequeпces 419 Equations (1O51) and (1051') assume that we're calculating only the first N /2 independent elements оЕ Ха(m) and Хь(m). Тhe single N term in Eq, (10-51) accounts for the N /2 divide Ьу 2 operations in Eq, (10-42) and the N /2 divide Ьу 2 operations in Eq. (1O44). ОК, now we сап find out how efficient the Two N-Point Real FFIs algo rithm is compared to two separate complex Npoint radix2 FFfs, Тhis comparison, however, depends оп the hardware used for the calculations. If our arithmetic hardware takes mаnу more clock cycles to perform а multip1ication than an addition, then the difference between multip1ica- tions in Eqs, (1O50) and (1O51) is the most important comparison, In this case, the percentage gain in computational saving оЕ the Two N-Point Real FFTs algorithm relative to two separate Npoint complex FFIs is the dif- ference in their necessary multiplications over the nиmber оЕ multiplica tions needed for two separate Npoint complex FFIs, or 4N .log2 N (2N .10g2 N + N) .100%:::: 2 .log2 N  1 .100% 4N .log2 N 4 .log2 N (1 О-52) The computational (multiplications only) saving from Eq, (10-52) is plot ted as the top curve оЕ Figure 10 18. In terrns оЕ multiplications, for N?::32, % Computational saving 01 the Two N-point Aeal FFТs algorithm 50 48 48 44 % 42 . 40 38 36 .. з4 100 1 102 Э 4 5 N 10 10 10 10 Flgure \0- \8 Computotlono\ soving of the Two N-Point Reol FFТs olgorithm over thot of МО seporote N-point complex FFТs, Тhe top сшуе indicates the soving when only multipllcotions ore consldered, Тhe bottom сшуе is the soving when both odditions ond multlplicotlons ore used in the compQrison, 
420 DlgitQI SigпQI Processlпg Tricks the Two N-Point Real FFfs algorithm saves us over 45 percent in compu tational workload compared to two separate Npoint complex FFfs, For hardware using high-speed multiplier integrated circuits, multipli- cation and addition can take rougbly equivalent clock cycles. Тhis makes addition operations just as important and Нmе consuming as multiplica tions, Thus the difference between those combined arithmetic operations in Eqs. (1O50) plus (1050') and Eqs, (10-51) plus (1051') is the appropri ate comparison. In this case, the percentage gain in computational saving of our algorithm over two FFfs is their total arithmetic operational differ- ence over the total arithmetic operations in two separate N-point complex FFfs, or (4N .log 2 N +6N 'log 2 N) (2N .log 2 N + N + 3N 'log 2 N +2N) .100% 4N ,1og 2 N + 6N ,1og 2 N = 5 ,1og 2 N  3 .100% , 10.10g 2 N (1053) The full computational (multiplications and additions) saving from Eq. (10-53) is plotted as the bottom curve of Figure 10-18, ОК, that con- cludes our discussion and illustration of how а single N-point complex FFT сап Ье used to transform two separate N-point real input data sequences. 10.5.2 Performing а 2N-Point Real FFТ Similar to the scheme above where two separate Npoint real data sequences are transformed using а single N-point FFT, а technique exists where а 2Npoint real sequence can Ье transformed with а single complex Npoint FFT. This 2N-Point Real FFT algorithm, whose deriva- tion is also described in the literature, requires that the 2N-sample real input sequence Ье separated into two parts[20,21]. Not broken in two, but l.lnzippedseparating the even and odd sequence samples, The N even-indexed input samples are loaded into the real part of а complex N-point input sequence х(п), Likewise, the input's N odd-indexed sam- ples are loaded into x(п)'s imaginary parts, То Шustrаtе this process, let's say we have а 2N-sample real input data sequence а(п) where О:::; 11 :::; 2N1. We want a(п)'s 2N-point transform Ха(т). Loading a(п)'s odd / even sequence values appropriately into an Npoint complex FFT's input sequence, х(п), 
Efflcleпtly Perforтlпg the FFТ of Rвol Sвquвnces 421 х(О) = а(О) + ja(l) , х(l) = а(2) + jа(З) , х(2) = а(4) + ja(5) , x(Nl) = a(т2) + ja(2Nl) , (10-54) Applying the N сотрlех values in Eq. (10-54) to an N-point сотрlех РП, we'll get an FFf output Х(т) = Xr(m) + jXi(m), where т goes from О to N1. То extract the desired 2NPoint Real FFf algorithm output Х.(т) =X.,real(т) +jX.,imas<m) from Х(т), let's define the following relationships Х:(т) = Xr(m) + r(N  т) , (1O55) X;(m)= Xr(m)r(Nm) , (1O56) Х + ( )  Xi(m) + Xi(N  т) d i т  ,an 2 (1057) X;(m)= Xi(m)i(Nm) , (1 О-58) Тhe values resu1ting from Eqs. (10-55) through (1O58) are, then, used as factors in the fol1owing expressions to obtain the real and imaginary parts of our finаl Х.(т): X.,rea1 (т) = Х:(т) + cos( ТC;:; ), xt(m)  Sin( ТC;:; ), х; (т), (10-59) and X.,imag(m) = Х;(т)  sin( ТC;:; ), xt(m)  cos( тс;:; ). Х;(т) , (10-60) Remember now, the original а(п) input index п goes from О to 2N1, and our Npoint РП output index т goes from О to Nl. We аррlу 2N real input time-domain samples to this algorithm and get back N сотрlех frequency-domain samples representing the first ha1f of the equivalent 2Npoint сотрlех FFf, Х.(О) through X.(Nl). Because this algorithm's 
422 DigitQI SigпQI Processiпg Tricks Unzip Ihe а(п) 2N-poinl (еа' а(п) х(п) sequence and e.tabIi.h the N-poinl complex х(п) sequance, Calculate the Npoinl complex FFТ о! х(п) 10 get Х(m). Ca/culale the !ои, Х(m) Npo/nl .equence. Х;(m), Х;(m), X(m), and Х; (m). Calculale the !ina! N-poinl complex Х.(m) .equence Х.(m) = Х.,,.., (m) + jX .,,,,.g(m), Flgure 10-19 ComputatlonQI flow of the 2N-Point Real FFТ Qlgorlthm, а(п) input is constrained to Ье real, Xa(N) through Xa(2N1) are merely the complex conjugates of their Ха(О) through Xa(Nl) counterparts and need not Ье calculated. То help us keep аН of this straight, Figure 1O19 depicts the computational steps of the 2N-Point Real FFТ algorithm, То demonstrate this process Ьу way of example, let's apply the 8point data sequence from Eq. (1O46) to the 2N-Point Real FFT algorithm. Partitioning those Eq. (10-46) samples as dictated Ьу Eq, (1O54), we have our new FFТ input sequence: х(О) = 0.3535 + j 0.3535, х(l) = 0.6464 + j 1,0607, х(2) = 0,3535  j 1,0607, х(3) =1.3535  j 0.3535, (1O61) With N = 4 in this example, taking the 4point FFT of the complex sequence in Eq. (1O61) we get Х,(т) Xj(m) J, J, Х(т) = 0,0000 + j 0,0000 ..... т = О lenn + 1.4142  j 0.5857 ..... т = 1 lenn + 1.4141  j 1.4141 t-----т =2 term  1.4142 + j 3.4141 .....т=зlеnn, (10-62) Using these values, we now get the intermediate factors from Eqs. (1O55) through (1O58), Calculating our first Х;(О) value, again we're reminded that Х(т) is periodic with а period N, so Х(4) = Х(О), and Х;(О) = [Х, (О) + Х, (0)]/2 = О, Continuing to use Eqs. (1055) through (1(}58), х:(о)=о, х;(о)=о, Х((О) =0, Xi(O)=O, Х:(1) =0, Х;(l) = 1.4142, Xt(l) = 1.4142, Xi(1)=1.9999, Х:(2) = 1.4141, Х;(2)=0, X((2)=1.4144, Xi(2) =0, Х: (3) = О, Х;(3) = 1.4142, Х((3) = 1.4142, Xi(3) = 1.9999. (1O63) 
E{fIc/eпtfy Perform/пg the FFТ of Rвa/ Sвqueпces 423 Using the intermediate values from Eq, (1063) in Eqs. (1O59) and (1O60), ( п.о ) ( п.о ) Xa.reai (О) '" (О) +сов "'"'4 . (О)  Вin "'"'4 . (О) ( п.о ) ( n'О ) Xa,irnag(O) = (О)  Вin "'"'4 . (О)  сов "'"'4 . (О) ( n'1 ) ( n'1 ) X a ,reai(l) = (О) + сов """'4 .(1,4142)Bin"'"4 '(1,4142) ( n'1 ) ( n'1 ) Xa,imag(1)=(l,9999)sin"'"4 '(1,4142)COB""4 .(1,4142) ( n'2 ) ( п'2 ) X a ,reai(2) = (1,4141) + сов "'"'4 .(1.4144)Bin"'"'4 .(0) , ( n'2 ) ( n'2 ) Xa,imag(2)=(0)sm "'"'4 .(1.4144)COB "'"'4 .(0) ( n.з ) ;(1t.з ) X a ,reai(3) = (О)+сов "'"'4 '(1.4142)B\"'"'4 .(1,4142) ( n.з ) ( n.з ) Xa,imag(3)=(l,9999)sin "'"'4 .(1,4142)COB '4 .(1,4142) (10-64) Evaluating the Вinе and СОВinе terms in Eq, (1064), Xa,reai(O) = (О) + (1). (О)  (ОНО) '" О, xa,irnag(O) = (О)  (о). (О)  (1НО) = О, X a ,reai(l) = (О) + (0,7071). (1,4142)  (0,7071)' (1.4142) = О, X a ,imag(l) '" Н.9999)  (0.7071). (1.4142)  (0,7071)' (1,4142) = 3.9999, X a ,reai(2) = (1,4141) + (о). Н.4144)  (1). (О) = 1,4141, X a ,imag(2) = (О)  (1). Н,4144)  (о). (О) = 1.4144, X a ,reai(3) = (О) + (O,7071). (1,4142)  (0,7071)' Н,4142) = О, and X a ,irnag(3) = (1.9999)  (0,7071)' (1,4142)  (0.7071). Н,4142) = О ,(1O65) Combining the results of the terms in Eq, (1O65), we have our final cor- rect answer of Ха(О) = Xa,reai(O) +jXa,imag(O) = О + jO = О LO°, Х а (l) = X a ,reai(l) +jX a ,imag(l) = О  j3,999 = 4 L90°, Ха(2) = X a ,reai(2) +jX a ,imagC2) = 1,4141 + j1.4144 = 2 L45°, and Х а (3) = X a ,reai(3) +jX a ,imag(3) = О + jO = О LO°, (10-66) 
424 Dlgltal Slgnal Processlng Trlcks After going through аН the steps required Ьу Eqs. (1O55) through (1O60), the reader might question the efficiency of this 2NPoint Real FFТ algorithm. Using the same process as the аЬоуе Тwo N-Point Real FFTs algorithm analysis, let's show that the 2NPoint Real FFТ algo rithm does provide some modest computational saving. First, we know that а single 2NPoint radix-2 FFT has (2N /2) .log22N = N, (log2N+1) butterf1ies and requires 2N-point complex FFТ .... 4N. (1og:fl+1) real mu1tiplications (1O67) and 6N. (1og2N+1) real additions. (1(),,67') If we add ир the number of real multiplications and real additions required Ьу the algorithm's Npoint complex FFТ, plus those required Ьу Eqs_ (1O55) through (10-58) and those required Ьу Eqs. (1059) and (1060), the complete 2N-Point Real FFf algorithm requires 2N-Point Real FFТ algOrithm.... 2N .log2N + 8N real multiplications (10-68) and 3N.log 2 N + 8N real additions. (1(),,68') ОК, using the same hardware considerations (mu1tiplications only) we used to arrive at Eq. (10-52), the percentage gain in mu1tiplication saving of the 2N-Point Real FFТ algorithm relative to а 2Npoint complex FFТ is 4N. (10g2 N + 1)  (2N .log2 N + 8N) .100% 4N . (log2 N +1) = 2N .log2 N + 2N  N .log2 N  4N .1000;' 2N .log2 N +2N = log2 N 2 .100%. 2.1og 2 N+2 (1(),,69) The computational (mu1tiplications only) saving from Eq. (10-69) is plot ted as the bottom curve of Figure 1 (),,20. In terms of mu1tiplications, the 2N-Point Real FFТ algorithm provides а saving of >30% when 128 or whenever we transform input data sequences whose lengths are 56. 
CQ/cu/Qtiпg the /пverse FFТ Us/пg the ForwQrd FFТ 425 % 20 to 100 % ComputatJonal savJng 01 the 2N-point Ава' FFТ algorithm 50 105 N 40 за 10 О. . 10' 103 10' 102 Figure 10-20 ComputationQ/ saving of the 2N-Polnt Real FFТ algorithm over that of а slпgle 2N-point сотр/ех FFТ. The top curve is the savlng when both addltions and multiplications are used 'п the comparison, The bottom curve Indlcates the savlng when only mu/tlpllcations are considered, Again, for hardware using high-speed mu1tipliers, we consider both multip1ication and addition operations. The difference between those сот- bined arithmetic operations in Eqs. (107) plus (10-67') and Eqs, (10-68) plus (10-68') is the appropriate comparison. In this case, the percentage gain in computational saving of our algorithm is 4N . (log 2 N + 1)+ 6N . (log 2 N + 1)(2N .log 2 N + 8N + 3N .log 2 N +8N) .100% 4N ,(log 2 N +1)+6N .(log 2 N +1) = 10. (log 2 N + 1)  5 .log 2 N  16 .100% 10. (log 2 N + 1) = 5 .log 2 N 6 .100%. 10. (log 2 N + 1) (10-70) The full computational (multiplications and additions) saving from Eq, (10-70) is plotted as а function of N in the top curve of Figure 10-20, 10.6 Calculating the Inverse FFT Using the Forward FFТ There are many signal processing applications where the capability to perform the inverse FFТ is necessary, тhis can Ье а problem if available 
426 DIg'tQ/ SlgпQ/ Processiпg Trlcks hardware or software routines have the capability to perform only the for ward FFТ. Fortunately, there are two s1ick ways to perform the inverse FFТ using the forward FFТ algorithm, 10.6.1 Flrst Inverse FFT Method Тhe first inverse FFТ calculation scheme is implemented following the processes shown in Figure 1O21, То see how this works, consider the expressions for the forward and inverse DFТs: Forward DFf .... Nl Х(т) = Lx(n)ej21tnт/ N , n=О (1O71 ) and lnverse DFf .... 1 Nl х(п) = N LX(m)ej27tmn/N , т=О (1O72) То reiterate our goal, we want to use the process in Eq, (1O71) to imple ment Eq, (1O72), Тhe first step оЕ our approach is to use complex conjugation, Remember, conjugation (represented Ьу the superscript .. symbol) is the reversal оЕ the sign оЕ а complex number's imaginary exponentif х = e jf2J , then, х" = r jf2J , 50, as а first step, we take the complex conjugate оЕ both sides оЕ Eq, (10-72) to give us [ .. Nl х" (п) =  x(m)ej21tтn/N] (1073) Forward  X( + N Х lmag(п) 1 :::: I 1 Flgure 10-21 Processlng dlagram of first Inverse FFТ cQlculatlon method, 
Ca/cu/at/пg the /пverse FFТ Us/пg the Forward FFТ 427 Onе of the properties of complex numbers, discussed in Appendix А, is that the conjugate of а product is equal to the product of the conjugates; that is, if с = аЬ, then с* = (аЬ)* = а*Ь*, Using this fact, we сап show that the conjugate of the right side of Eq. (1O73) is given Ьу Nl х* (п) =  LX(m)* (ej21tmn/N) т=О Nl =  LX(m)* ej21tmn/N т=О (1O74) Hold оп, we're almost there, Notice the similarity of Eq. (1O74) to our orig- inal forward ОРТ expression Eq, (1O71), If we perform а forward ОРТ оп the conjugate of the Х(т) in Eq, (1O74) and divide the results Ьу N, we get the conjugate of our desired time samples х(п). Taking the conjugate of both sides of Eq. (1(),,74), we get а more straightforward expression for х(п): [ Nl ] * х(п) =  x(m)*ej21tmn/N (1O75) 50, to get the inverse FFf of а sequence Х(т) using the first inverse FFТ algorithm, Step 1: Conjugate the Х(т) input sequence. Step 2: Calculate the forward FFf of the conjugated sequence. Step 3: Conjugate the forward FFf's resиlts, Step 4: Oivide each term of the conjugated results Ьу N to get х(п), 10.6.2 Second Inverse FFT Method The second inverse FPТ calcиlation technique is implemented following the interesting data flow shown in Figure 1O22, In this clever inverse FFf scheme, we don't bother with conjugation. Instead, we merely swap the real and imaginary parts of sequences of complex data[22] , То see why this process works, let's look at the inverse OFТ equation again while sep arating the input Х(т) term into its real and imaginary parts and remem bering that &0 = cos(e) + jsin(e): . 
428 Digital Sigпal Processlпg Tricks Inverse DFr  1 Nl х(п) = N LX(т)ej2I1mпIN т=О 1 Nl , = N L [X real (т) + jXimag(т)] т=О . [cos(21tтn / N) + j sin(21tтn / N)] . (1O76) Multiplying the complex terms in Eq. (10-76) gives us 1 Nl х(п) = N L[Xreal(т)cos(21tтn/ N)  X imag (т)sin(21tтn/ N)] т=О + j[X real (т)sin(2xтn/ N) + Ximag(т) cos(21tтn / N)]. (10-77) Equation (1D--77) is the general expression for the inverse DFf, and we'll now quickly show that the process in Figure 10-22 implements this equa- tion. With Х(т) = Xreal(т) + jXimag(т) and, swapping these tenns, Xswap(т) = Ximag(т) + jXrea1(т) . (1O78) Тhe forward DFf of our Xswaiт) is Nl Forward DFf  L[Ximag(т) + jXreal(т)] п=О . [cos(21tтn / N)  j sin(21tтn / N)] (10-79) Forward FFТ Х reaI (n) Ximag(т) .", ximag(n) Flgure 10-22 Processlng diagram of second Inverse FFТ calculatlon method, 
Fast FFТ Averagiпg 429 Multiplying the complex terms in Eq, (10-79) gives us Nl Forward DFf  L [Ximag(m) cos(21tmn/ N) + X real (m)sin(21tmn / N)] п=О + j[X real (m)cos(21tmn / N)  X imag (m)sin(21tmn/ N)] . (1080) Swapping the rea1 and imaginary parts оЕ the results оЕ this Eorward ОРТ gives us what we're after: Nl Forward DFf.w..  )Xreal(m)cos(21tmn/ N) X imag (m)sin(21tmn/ N)] п=О + j[Ximag(m)cos(21tmn/ N)+ X real (m)sin(21tmn/ N)] (1081) If we divide Eq, (10-81) Ьу N it would Ье equal to the inverse DPТ expres- sion in Eq. (1O77), and that's what we set out to show, То reiterate, we cal culate the inverse FFТ оЕ а sequence Х(т) using this second inverse FPТ algorithm in Figure 10-22: Step 1: Swap the real and imaginary parts of the Х(т) input sequence, Step 2: Calculate the forward РП оЕ the swapped sequence. Step з: Swap the real and imaginary parts оЕ the forward FFf's results. Step 4: Divide each term оЕ the swapped sequence Ьу N to get х(п). 10.7 Fast FFТ Averaglng Section 8.3 discussed the integration gain possible when averaging multiple FFT outputs to enhance signaldetection sensitivity. Well, there's а smart way to do this iE we recall the linearity property оЕ the ОРТ (which of course applies to the FPТ) introduced in Section 3.3. If an input sequence x1(n) has an FFf оЕ X1(m) and another input sequence х 2 (п) has an FFf оЕ Х 2 (т), then the FFТ оЕ the sum оЕ these sequences xsum(n) = х 1 (п) + х 2 (п) is the sum оЕ the individual FFfs, or Xsum(m) = Х 1 (т) + Х 2 (т) . (1O82) 
430 D/gita/ S/gпal Process/пg Tr/cks 50, if we want to average multiple FFТ outputs, we сап save considerable processing effort Ьу averaging the individual PFТ input sample sequences (frames), first, and then take а single FFT, 5ау, for ехаmрlе, that we wanted to average 20 FFТs to improve our PFТ output signaHo-nоisе ratio, Instead of taking 20 FFTs of 20 frames of input signal data, we should average the 20 frames of input data, first, and then take а single РП of that average. Тhis avoids the number crunching necessary for 19 FFrs. Ву the way, for this technique to improve an FFТ's signal-detection sen.sitivity, the original signal sampling must meet the criterion of coher- ent integration as described in 5ection 3.12, That's the good news. Тhe bad news is that this technique only works for periodic signals whose initial samples, xk(O), are collected synchro- nously, Тhat iБ, the beginning of each new block of time-domain data is col1ected at а constant phase relative to the periodic signal. 10.8 Simplified FIR Filter Structure If we need to implement an FIR digital filter using the standard structure in Figure 10-23(а), there's а way to simplify the necessary calculations when the filter has an odd number of taps. Let's 100k at the top of Figure 10-23(а) example where the 5-tap filter coefficients are h(O) through h(4) and the у(п) output is given Ьу у(п) = h(4)x(n4) + h(3)x(n3) + h(2)x(n2) + h(l)x(n 1) + h(O)x(n) , (1O83) If the FIR filter's coefficients are symmetrical, we сап reduce the number of necessary multipliers; that is, if h(4) = h(O), and h(3) = h(l), we сап implement Eq, (1O83) Ьу у(п) = h(4)[x(n4)+x(n)] + h(з)[х(п3)+х(п1)] + h(2)' x(п2) , (1O84) where only three multiplications are necessary, as shown at the bottom of Figure 1O23(а), In our 5tap filter case, we've eliminated two multipliers at the expense of implementing two additional adders, In the general case of symmetricalcoefficient FIR filters with 5 taps, we can trade (51)/2 mu1tipliers for (51)/2 adders when 5 is an odd num ber. 50, in the case of an odd number of taps, we need perform only (51)/2 + 1 multiplications for each filter output sample, For an even number of symmetrical taps as shown in Figure 10-23(Ь), the saving afforded Ьу this technique reduces the necessary number of multiplica- tions to 5/2, For the half-band filters discussed in 5ection 5,7, with their 
Simplified FIR Filter Structure 431 11(0) = 11(4) у(п) 11(0) 11(0) . I (а) Х(п) У(п) 11(0) = 11(5) у(п) ... Х(п) 11(0) 11(2) I1(З) 11(0)) i i 4) 11(5) .' I!, (Ь) х(п) Flgure 10-23 Slmplifled FIR fllter Implementotlons: (о) conventlonol ond slmpllfled, structures of оп FIR fllter with оп odd number of tops; (Ь) conventlono\ ond s\mplified structures of оп FIR filter wlth оп even number of tops, 
432 Dlgftal Slgпal Processlпg Trlcks alternating zerovalued coefficients, the simplified FIR structure in Figure 1O23(b) allows us to get away with only (5+1)/4 + 1 multiplications for each filter output sample when 5 is odd and the first filter coefficient h(O) is not zero. We always benefit whenever we can exchange multipliers for adders. Because multiplication often takes а longer time to perform than addition, this symmetrical FIR filter simplification scheme тау speed filter calcula- tions performed in software, For а hardware FIR filter, this scheme сап either reduce the number of necessary multiplier circuits or increase the effective number of taps for а given number of available hardware multi pliers. Of course, whenever we increase the effective number of filter taps, we improve our filter performance for а given input signal sample rate. 10.9 Accurate A/D Converter Testing Technique The manufacturers of A/D converters have recently begun to take advan- tage of digital signal processing techniques to facilitate the testing of their products. А traditional test method involves applying а sinusoidal analog voltage to an A/D converter and using the FFТ to obtain spectrum of the digitized samples. Converter dynamic range, missing bits, harmonic dis tortion, and other nonlinearities сan Ье characterized Ьу analyzing the spectral content of the converter output. These nonlinearities are easy to recognize because they show ир as spurious spectral components and increased background noise levels in the FFТ spectra, То enhance the accuracy of the spectral measurements, window func- tions were originally used оп the time-domain converter output samples to reduce the spectralleakage inherent in the FFТ. This was fine until the advent of 12- and 14bit A/D converters, These converters have dynamic ranges so large that their small nonlinearities, evident in their spectra, were being swamped Ьу the sidelobe levels of even the best window func- tions. (From Figure 94 we know that а 14-bit A/D converter сan have an SNR ratio of well over 80 dB.) The clever technique that circumvents this problem is to use an analog sinusoidal input voltage whose frequency is an integral fraction of the A/D converter's sample frequency as shown in Figиre 10-24(а), That frequency is mfJN where т is an integer, fs is the sample frequency, and N is the FFТ size. Figure 1O24(a) shows the х(п) timedomain output of an ideal A/D converter under the condition that its analog input is а sinewave having ехасНу eight cycles over 128 output samples. In this case, the input frequency normalized to the sample rate fs is 81./128 Hz. Recall, from Chapter 3, that the expression mfslN defined the analysis frequencies, or bin centers, of the DFТ; and а DFТ input whose frequency is at а bin center results in по leakage even without the 
Accurate А/О Coпverter Testiпg Techпique 433 (а) Б Х(П) 1 ", 7'\ " " (, . " " , .. .. .. .. .. . .. .. O,5. Jl Jl Jl Jl Jl Jl Jl ° I l\ff\ff\f\t\f\ ...(),5 ii ii '; '; ii ii ii \7 " " " , " " ., .,  у у у у у у   (Ь) 1 F(т) in dB о . 20 I : I  100 ,'IJ'."''IJ"I!'''I!!'I!I'''''''''''I!''IJ''I!''I!'''I!!''I!'I!''I!"I!',IJ' О 3 6 9 12 15 18 21 24 27 30 зз 36 39 42 45 48 51 54 57 60 63 т Figure 10-24 Ideal A/D converter output whose input is оп analog 8f,l128 Hz slnusold: (а) time-domain samples; (Ь) frequency-domain spectrum In dB. use оЕ а window fиncHon, Another way to look at this situation is to real- ize that the analog mf/N frequency sinusoid wШ have exactly т complete cycles over the N PFТ input samples, ав indicated Ьу Figure 3-7(Ь) in Chapter 3, The first ha1f оЕ а 128-point FFТ оЕ х(п) is shown in the logarithmic plot in Figure 10-24(Ь) where the input tone liев exact1y at the т = 8 Ьin center, and DFТ leakage has Ьееп avoided altogether. Specifically, if the sample rate were 1 MHz, then the A/D's input analog tone would have to Ье exact1y 8. 106/128 = 62,5 kHz. То implement this scheme, we need to ensure that the analog test generator Ье synchronized, exact1y, with the A/D converter's clock frequency of!. Hz, Achieving this synchronization is why this A/D converter testing procedure is referred to ав coherent sam- pling[25]. The analog signal generator and the A/D clock generator providingf s mиst not drift in frequency relative to еаш otherthey must remain coherent. (We must take care here from а semantic viewpoint because the quadrature sampling schemes described in Sections 7,1 and 7.2 are also вотеНтев called coherent sampling, but they are unrelated to this A/D converter testing procedure,) Ав it turns out, воте values оЕ т are more advantageous than oth- ers. Notice in Figure 10-24(а), when т = 8, only пinе different атрН- tude values are put out Ьу the A/D converter. Those values are 
434 Digital Sigпal Processiпg Trlcks 1 + n) { {., j.1 . (, i; 0,5 . . ,  . . \ . , . ' . i' ..  i · \ . \ . '. I i I \ ,. о V · 1 ; I \ · \ I · i i · \ i . \ .... f i1 \ .. / i n .5 11 lJ i'T,J 1i ,; , iJ 1 " 1 ] " 1   ,. ,:    Flgure 10-25 Seveп-cycle slnusoldol А/О converter output, (а) l Х(П) 1f  ("l  "1 \"1\ ("l   "I , .. .. .. .. .. .. .. ., 0,5 " f 1 i' f 1 l' f 1 f 1 J i о .......................................................................................J........ i \ I \ '  I \ I \ I \ I \ I \ n .............. .. --0,5 l J l J \ J l J l J l J l J l J , , \ I '\ I , I \ I , , \ I \ I 1    у  у  у Dropped blts (Ь) } F(т) in dB О . 10 20 O · :.. .. I.:i IШii i :11: П.. Щ 11: 11 i7 i il! i I i l11i1 50 о 3 6 9 12 15 18 21 24 27 30 33 36 39 42 45 48 51 54 57 60 63 т Figure 10-26 Nonldeol А/О converter output showing several dropped blts: (о) tlme--domoin somples; (Ь) frequency-domoin spectrum In dB, repeated over and over, As shown in Figure 1O25, when т = 7, we exer cise тапу more than nine different A/D output values. Because it's best to test aS тапу A/D output binary words as possible, in practice, users of this A/D testing scheme have found that making т an odd prime number (3, 5, 7, 11, etc.) minimizes the number of redundant A/D output word values, 
Fost F/R F//ter/пg Usiпg the FFТ 435 Figure 1026(a) illиstrates an extreme example of nonlinear A/D con verter operation with several discrete output samples having dropped bits in the time domain х(п) with m = 8. The FFТ of this distorted х(п) is shown in Figиre 1026(b) where we сап see the greatly increased back ground noise level due to the A/D converter's nonlinearities compared to Figиre 1024(b). То fиlly characterize the dynamic performance of ап A/D converter, we' d need to perform this testing technique at тanу different input fre- quencies and amplitudes.+ In addition, applying two analog tones to the A/D converter's input is often done to quantify the intermodulation dis- tortion performance of а converter, which, in tиrn, characterizes the соп- verter's dynamic range. In doing so, both input tones must comply with the mfj N restriction. Тhe key issue here is that, when апу input frequency is mfjN, we сап take fиll advantage of the FFТ's processing sensitivity whi1e completely avoiding spectralleakage. 10.1 О Fast FIR Filtering Using the FFT Whi1e contemplating the convolution relationships in Eq, (531) and Figиre 541, digital signal processing practitioners realized that convolu tion could sometimes Ье performed more efficient1y using FFТ algorithms than it could Ье using the direct convolution method[26,27], This FFT based convolution scheme, called fast convolution, is diagrammed in Figиre 10-27. The standard convolution equation, for ап Mtap FIR filter, given in Eq. (56) is repeated here for reference as Ml у(п) = L h(k)x(n  k) = h(k) * х(п) k=O (10-85) where h(k) is the impulse response sequence (coefficients) of the FIR filter and the "*" symbol indicates convolution. It has Ьееп shown that, when the final у(п) output sequence has а length greater than 30, the process in Figиre 1027 requires fewer multiplications than implementing the convolution expression in Eq. (1O85) directly. Consequently, this fast convolution tech- nique is а very powerfu1 signal processing tool, particи1arly, when used for t The ana!og sinewave applied to аn А/О converter must, of course, Ье as рите as possible, Anу distortion inherent in the analog signa! will show ир in the finа! FFТ output and cou!d Ье mistaken for А/О nonlinearity, 
436 D/g/tol Sigпal Process/пg Tr/cks  FFТ  r? Щт).т) I ;"""  h(k).x(n)  FFТ Н(т)  FFТ Flgure 10-27 Processlng dlagram of fast convolutlon, digital filtering. Very efficient FIR filters can Ье designed using this tech nique because, if their impиlse response h(k) is constant, then we don't have to bother recalcиlating Н(т) each time а new х(п) sequence is filtered. In this case, the Н(т) sequence сап Ье precalcиlated and stored in memory, Тhe necessary forward and inverse FFТ sizes must, of course, Ье equal and are dependent оп the length of the original h(k) and х(п) sequences. Recall from Eq. (529) that, if h(k) is of length Р and х(п) is of length Q, the length of the final у(п) sequence will Ье (P+Q---1), For valid resиlts from this fast convolution technique, the forward and inverse РРТ sizes must Ье equal and greater than (P+Q---1). This means that h(k) and х(п) mиst both Ье padded (or stиffed) with zerovalued samples at the end of their respective sequences, to make their lengths identical and greater than (P+Q---1). This zero padding will not invalidate the fast convolution results. 50, to use fast convolution, we must choose an Npoint FFТ size such that N ;:: (P+Q---1) and zero pad h(k) and х(п), so that they have new lengths equal to N. An interesting aspect of fast convolution, from а hardware standpoint, is that the РРТ indexing bitreversal problem discussed in 5ections 4.5 and 4,6 is not an issue here. If the identical РРТ structиres used in Figure 10-27 result in Х(т) and Н(т) having bitreversed indices, the multiplication сап still Ье performed directly оп the scrambled Н(т) and Х(т) seqиences. Then, an appropriate inverse РРТ structиre сап Ье used that expects bit-reversed input data. That inverse РРТ then provides an output у(п) whose data index is in the сопесt order! 10. 11 Calculation of Sines and Cosines of Consecutive Angles There are times in digital signal processing when we need our software to cakulate lots of sine and cosine values, particularly in implementing cer tain FFT algorithms[28,29], Because trigonometric calculations are time consuming to perform, а clever idea has been used to calculate the sines 
Calcu/atloп of Slпes aпd Coslпes of Coпsecutlve Aпgles 43i and cosines of consecutive angles without having to actually call ироп standard trigonometric functions. t Illustrating this scheme Ьу way оЕ example, let's say we want to ca1culate the sines and cosines of all angles from 0° to 900 in 1 degree increments, Instead of performing those 91 sine and 91 cosine trigonometric operations, we сап use the following identi- ties found in our trusty math reference book, sin(A+B) = sin(A). cos(B) + cos(A). sin(B) (10-86) and cos(A+B) = cos(A). cos(B)  sin(A). sin(B) , (10-87) to reduce our computational burden. То see how, lets make А = а and В = па, where а = 1° and n is an integra1 index O n 89. Equations (10-86) and (10-87) now Ьесоте sin(a +nа) = sin(a [1+n]) = sin(a). cos(na) + cos(a). sin(na), (10-88) and cos(a +nа) = cos(a [1+n]) = cos(a). cos(na)  sin(a. sin(na), (189) ОК, here's how we ca1culate the sines and cosines. First, we know the sine and cosine for the first angle of 0°; i,e., sin(OO) = О, and cosine(OO) = 1. Next we need to use а standard trigonometric function call to ca1culate and store, for later use, the sine and cosine оЕ 1 о; that is, sin(l О) = 0.017452 and cos(l О) =0.999848, Now we're ready to ca1cu1ate the sine and cosine оЕ 2° Ьу substituting n = 1 and а = 1 О into Eqs, (10-88) and (10-89) giving us sin(l °[1 + 1]} = sin(l О) . cos(l . 1°) + cos(l О) . sin(l. 1°), or sin(2°) = (0.017452). (0.999848) + (0.999848). (0.017452) = 0.034899, (10-90) and cos(l °[1+ 1]) = cos(l О) . cos(l. 1 О)  sin(l O),sin(l. 1 О), or cos(2°) = (0.999848). (0.999848) + (0.017452)' (0.017452) = 0.999391, (10-91) t We're assuming here that there's insufficient memory space ауаilаЫе to store аН the required sine and cosine values for later recaH, 
438 Digital Sigпa/ Processiпg Tr/cks Веса use we've already calculated sin(l О) and cos(l О), Eqs, (1O90) and (10-91) each required on1y two multiplies and an add, No trigonometric function needed to Ье called Ьу software. Next we're аЫе to calculate the sine and cosine of 3° Ьу substituting п = 2 and а = 1° in Eqs, (1O88) and (10-89); that is, sin(l °[1 +2]) = sin(l О) . cos(2 .1 О) + cos(l О) . sin(2.1 О), or sin(3°) = (0,017452)' (0.999391) + (0.999848)' (0,034899) = O,052336,(1O92) and cos(l °[1+2]) = cos(l О) . cos(2.1 О)  sin(l о). sin(2.1 О), or cos(3°) = (0.999848). (0.999391) + (0.017452). (0,034899) = 0.998629, (1O93) Again, because we previously calculated sin(2°) and cos(2°), Eqs, (10-92) and (1O93) on1y require us to perform four multiplications and two addi tions. Тhe pattem of our calculations is clear now. For successive angles, we rnerely use the sine and cosine of 1° and the sine and cosine values obtained during the previous angle calcu1ation. In our example, the angle increment was а= 1°, but it's good to know that Eqs. (10-88) and (10-89) apply for anу fixed angle increment, 10. 12 Generating Normally Distributed Random Data Section 0.4 in Appendix О discusses the normal distribution curve as it relates to random data. А problem we mау encounter is how to actually generate random data samples whose distribution follows that normal curve, There's а slick way to solve this problem using any software package that сап generate uniformly distributed random data, as most of them do[30], Figure 10-28 shows our situation pictoriaHy where we require random data that's distributed normally with а mean (average) of J.l' and а standard deviation of а', as in Figure 10-28(а), and аН we have available is а software routine that generates random data that's uniformly distributed between zero and one as in Figure 10-28(Ь). As it turns out, there's а principle in advanced probability theory, known as the Ceпtral Liтit Theorem, that says, when random data from an arbi trary distribution is summed over М samples, the probability distribu 
Geпeratiпg Norma//y Distribиted Raпdom Data 439 Normal probability distribution Uniform probability distribution шшш. 1 3cr' 2a' --о' 1-1' +а' +2а' +Зcr' о (а) (Ь) Flgure 10-28 ProbabIllty dlstributioп fuпctioпs: (а) пormal distributloп with теап = ', and standard deviation о'; (Ь) uпlform dlstribution ЬеМееп zero aпd опе, Probability dis!ribu!ion 01 se! у вит о 1-I=М12 м . Тhis distance is assumod \о ье \о 60. Flgure 10-29 ProbabIlity dlstributioп of the summed set of raпdom data derlved from uпiformly distrlbuted data, tion о! the sиm begins to approach а normal distribиtion, as М increases[31,32], In other words, if we generate а set о! N random sam- ples that are иniformly distribиted between zero and one, we сап begin adding other sets о! N samples to the first set, As we continиe sиmming additional sets, the distribиtion о! the Nelement set о! sиms becomes more and more пorтal. We сап soиnd impressive and state that "the sиm becomes asymptotically normal," Experience has shown that, for practical pиrposes, if we sиm М ;:: 30 times, the sиmmed data distribu- tion is essential1y normal. With this rиle in mind, we're halfway to solv- ing oиr problem. After sиmming М sets of uniformly distribиted samples, the sиmmed set У ошn will have а distribution like that shown in Figure 10-29, Becaиse we've sиmmed М sets, the mеan о! У ошn is 11 = Mj2. То determine Ysum's standard deviation о, we assиme that the six sigma point is eqиal to MI1; that is 60=MI1' (1O94) 
440 Digitol Sigпal Processlпg Tricks That assumption is valid because we know that the probability of an ele- ment in У оит being greater than М is zero, and the probability of having а normal data sample at six sigma is one change in б billion, or essen- НаНу zero. Because Jl = Mj2, then from Eq, (1O94), Ysum's standard devi ation is set to (1= Mf1 = MMj2 =Mj12 б б (1 O95) То convert the У оит data set to our desired data set having а mean of Jl' and а standard deviation оЕ а', · subtract Mj2 from each element of У оит to shift its mean to zero, · next, ensure that ба' is equal to Mj2 Ьу multiplying еаш element in the shifted data set Ьу 12а ' j М, and · finaHy, center the new data set about the desired Jl' Ьу adding Jl' to еаш element of the new data. ТЪе steps in our algorithm are shown in Figure 1030. If we саН our desired normally distributed random data set Ydesired' then the nth element of that set is described m.athematically as 12а' [(  J М ] , Ydesired(n)=M' t(k(n) 2 +Jl (109б) our discussion thus far has had а decidedly software algorithm.ic fla vor, but hardware designers also occasionally need to generate normally distributed (Gaussian) random data at high speeds in their designs. For your hardware designers, reference [33] presents an efficient hardware design technique to generate normally distributed random data using fixedpoint arithmetic integrated circuits. Gener&le М .еtз 01 r&ndom d&I&, wilh e&ch заl contalning N elements. Sum the М .el., elemenl to' elemenl, 10 gel the .ummed заl у aum containing N elements, Subtract м/2 Irom e&ch elemenl 01 У,Wn' Muiliply e&ch elemenl In the .hifled .еl ьу 12о'/М, Add 1" 10 each elemenl 01 Ihe .hifted d&l& заl, Flgure 10-30 Processlng steps requlred to generate normally dlstrlbuted random data from unlformly dlstrlbuted data, 
Refereпces 441 References [1] Freeny, 5, "TDM/FDM Translation as an Application of Digital Signal Processing," IЕЕЕ Coттuпicatioпs Magaziпe, January 1980, [2] Considine, V, "Digital Соmрlех Sampling," Electroпics Letters, 19, 4 August 1983, [3] Harris Semiconductor Corp. "А Digital, 16-Bit, 52 Msps Halfband Filter," Microwave Jourпal, September 1993, [4] Hack, Т, "IQ Sampling Yields Flexible Demodulators," RF Desigп Magaziпe, April1991, [5] Pellon, L, Е, "А Double Nyquist Digital Product detector for Quadrature Sampling," IЕЕЕ Traпs, оп Sigпal Processiпg, Vol, 40, No, 7, July 1992, [6] Waters, W, М" and Jarrett, В, R. "Bandpass Signal Sampling and Coherent Detection," IЕЕЕ Traпs. оп Aerospace aпd Electroпic Systeтs, Vol, АЕ5-18, No, 4, November 1982, (7) Palacherls, А. "DSP-mP Routine Computes Magnitude," EDN, October 26,1989, [8] Mikami, N" Kobayashi, М" and Yokoyama, У, "А New DSPOriented Algorithm for Ca1culation of the Square Root Using а Nonlinear Digital Filter," IЕЕЕ Traпs, оп Sigпal Processiпg, Vol, 40, No, 7, July 1992, [9] Lyons, R. G, "Turbocharge Your Graphics Algorithm," ESD: The Electroпic Systeт Desigп Мagaziпe, October 1988, [10] Adarns, W. т., and Brady, J, "Magnitude Approximations for Мicroprocessor Implementation," IЕЕЕ Micro, Vol, 3, No, 5, October 1983, [11] Eldon, J, "Digita! Correlator Defends Signa! Integrity with Multibit Precision," Electroпic Desigп, Мау 17, 1984. [12] Smith, W, W. "DSP Adds Performance to Pulse Compression Radar," DSP Applicatioпs, October 1993, [13] Нзrris Semiconductor Corp, HSP50110 Digital Qиadrature Tuner Data Sheet, File Number 3651, February 1994, [14] Bingham, с., Godfrey, М" and Tukey, J, "Modern Techniques for Power Spectrum Estimation," IЕЕЕ Traпs, оп Audio aпd Electroacoust" Vol, AU-15, No, 2, June 1967, [15] Harris, F. J, "On the Use of Windows for Harmonic Analysis with the Discrete Fourier Transform," Proceediпgs о/ the IЕЕЕ, Vol, 66, No, 1, January 1978, [16] Nuttall, А. Н, "Some Windows with Very Good Sidelobe Behavior," IЕЕЕ Traпs, оп Acoust, Speech, aпd Sigпal Proc" Vol, ASSP29, No. 1, February 1981, [17] Сох, R, "Complex-Multiply Code Saves Clocks Cycles," EDN, June 25, 1987, [18] Rabiner, L, R" and Gold, В, Theory aпd Applicatioп о/ Digital Sigпal Processiпg, Prentice-Hall, Englewood Cliffs, New Jersey, 1975, рр, 356, 
442 Olgltol SigпQI Processlпg Trlcks [19] Sorenson, Н, V" Jones, О, L" Heideman, М, т., and Burrus, С. 5, "Real-Valued Fast Fourier Transform Algorithms," IЕЕЕ Trans, оп Acoust, Speech, aпd Sigпa/ Proc" Vol, ASSP35, No, 6, June 1987, [20] Сооlеу, J, W., Lewis, Р, А" and We1ch, Р, О, "The Fast Fourier Transform Algorithm: Programming Considerations in the Ca1culation оЕ Sine, Cosine and Laplace Transforms," Jourпa/ Souпd Vib" Vol, 12, July 1970, [21] Бrighаm, Е, О, Тhe Fast Fourier Тransforт and Its Applicatioпs, Prentice-НаН, Englewood Cliffs, New Jersey, 1974, рр, 167, [22] Бurrus, С. 5" et аl. CoтputerBased Exercises for Signa/ Processing, Prentice- НаН, Englewood Cliffs, New Jersey, 1994, рр, 53, [23] Coleman, В" Meehan, Р" Reidy, J" and Weeks, Р, "Coherent Sampling Helps When Specifying OSP А/О Converters," EDN, October 1987, [24] Ushani, R. "Classical Tests Are Inadequate for Modem Нigh-Speed Converters," EDN Magazine, Мау 9,1991, [25] Meehan, Р" and Reidy, J, "FFТ Techniques Give Birth to Digital Spectrum Analyzer," E/ectronic Design, August 11, 1988, рр. 120, [26] Stockham, Т. G, "Нigh-speed Convolution and Сопеlаtiоn," in Digita/ Signa/ Processing, Ed, Ьу L, Rabiner and С. Rader, IEEE Press, New Jersey, 1972, рр, 330, [27] Stockham, Т, G, "Нigh-Speed Convolution and Сопеlаtiоn with Applications to Digital Fi1tering," Chapter 7 in Digita/ Processing о! Signa/s, Ьу В, Gold et al" McGraw-НiН, New York, 1969, рр. 203, [28] DоЬЬе, J, G, G, "Faster FFТs," Dr, Dobb's Jourпa/, February 1995, рр, 125, (Ве carefиl here, Тhe last equation in Ехаmрlе 5 is incorrect оп page 133 оЕ this reference, so Ье sure and use our Eq, (10-86) above.) [291 Crenshaw, J, W. "АН About Foиrier Analysis," Eтbedded Systeтs Prograттing, October 1994, рр, 70. [30] Beadle, Е, "Algorithm Converts Random Variables to Normal," EDN Magazine, Мау 11, 1995, [31] Spiegel, М, R. Theory and Probleтs о! Statistics, Shaum's Outline Series, McGraw-Нill Book Со" New York, 1961, рр, 142. [32] Davenport, W. В" Jr" and Root, W, L. Randoт Signa/s and Noise, McGraw-Нill Book Со" New York, 1958, рр, 81, [33] Salibrici, В, "Fixedpoint DSP СЫр Сап Generate Real-time Random Noise," EDN Magazine, April29, 1993, 
IAPPENDIX А/ The Arithmetic of Complex Numbers То understand digital signal processing, we have to get cornfortable using cornplex numbers, Тhe first step toward this goal is learning to rnаnфи- late cornplex numbers arithrnetically. Fortunately, we сап take advantage of our knowledge of real numbers to rnake this job easier. Although the physical significance оЕ cornplex numbers is discussed in Appendix С, the following discussion provides the arithrnetic rules governing cornplex numbers. А.l Graphical Representation о' Real and Complex Numbers То get started, real numbers are those positive or negative numbers we're used to thinking about in our daily lives, Exarnples of real numbers are 0.3, 2.2, 5.1, etc. Keeping this in rnind, we see how а real nurnber сап Ье represented Ьу а point оп а one--dirnensional axis, called the real axis, as shown in Figure A1. We сап, in fact, consider that аll real numbers correspond to аН of the points оп the real axis line оп а onetoone basis, Thls polnt represents the / real number 2,2 I 8, I I r I I I ...... 7 6 5 4 з 2 1 О 1 2 3 4 5 6 7 Real axis Flgure д-! The representotlon of о reol number os о polnt оп the one- dimensionol reol oxis, 443 
444 Appeпd/x А: Тhe Ar/fhтef/c о' Сотр/ех Nuтbers ........ " This point represents the complex number С = R + j/ о R Real axis Flgure А-2 The phasor representatlon of the complex number С = R + }/ оп the complex plane, А complex number, unlike а real number, has two parts: а real part and an imaginary part. Just as а real number сап Ье considered to Ье а point оп the one-dimensional real axis, а complex number can Ье treated as а point оп а complex plane as shown in Figure А-2. We'll use this geomet rical concept to help us understand the arithmetic of complex numbers. t А.2 Arithmetic Representation 01 Complex Numbers А complex number С is represented in а number of different ways in the literature, such as Rectangular [ОrПI: .... С = R + jI , (A-l) Trigonometric [ОrПI: .... С = M[COS(0) + jsin(0)] , (A-l') Exponential [ОrПI: .... C=Mei e , (A-l") Magnitude and angle [ОrПI: .... C=ML0, (Al"') Equations (Al") and (А-1''') remind us that the complex number С сап also Ье considered the Нр of а phasor оп the complex plane, with magni- tude М, in the direction of 0 degrees relative to the positive real axis as shown in Figиre A2. (We'll avoid calling phasor М а vector because the term vector means different things in different contexts, In linear algebra, vector is the term used to signify а one-dimensional matrix, on the other hand, in mechanical engineering and field theory, vectors are used to sig- nify rnagnitudes and directions, but there are vector operations (scalar or t The complex plane repre5entation of а complex number i5 sometime5 called an Argand dia gramnamed after the French mathematician Jean Robert Argand (1768---1825), 
Ar/ff1тetic RepreseпtQt/oп о( Сomр/вх Nuтbers 44f dot product, and vector or crossproduct) that don't apply to our definition оЕ а phasor,) Тhe relationships between the variables in this figure fol1ow the standard trigonometry оЕ right triangles. Кеер in mind that С is а complex number, and the variables R, 1, М, and 0 are аН real nиmbers, Тhe magnitиde оЕ С, sometimes cal1ed the modulus оЕ С, is M=ICI= R2+12 , (А-2) and, Ьу definition, the phase angle, or argumeпt, оЕ С is the arctangent оЕ I/ R, or 1 ( 1 ) 0=tan R ' (А-3) Тhe variable 0 in Eq. (A3) is а general angle term. It сап have dimensions оЕ degrees or radians. ОЕ course, we сап convert back and forth between degrees and radians using 1t radians = 180., 50, if 0, is in radians and 0d is in degrees, then we can convert 0. to degrees Ьу the expression 1800 . 0d= 1t (A4) Likewise, we сап convert 0d to radians Ьу the expression o = П0 d r 180 (A5) Тhe exponential form оЕ а complex number has an interesting charac teristic that we need to keep in mind, Whereas only а single expression in rectangular Еолn сап describe а single complex nиmber, ап infinite nиm ber оЕ exponential expressions сап describe а single complex nиmber; that is, while, in the exponential Еолn, а complex number С сап Ье represented Ьу С = м!,д, it can also Ье represented Ьу с = Me i " = м!(" + 27tn) , (А-б) where n = ::t1, х2, ::t3, ' . , and 0 is in radians. When 0 is in degrees, Eq. (Аб) is in the form с = Me i " = Md(0+ пЗ60') , (А-7) 
446 Appeпdix А: Тhe Arithтetic о' Coтpiex Nuтbers Equations (А-б) and (А-7) are almost selfexplanatory, They indicate that the point оп the complex plane represented Ьу the tip of the phasor С remains unchanged if we rotate the phasor some integral mu1tigl: of 2х radians or an integral multiple of 3БО . 50, for example, if С == Ме 20 >, then с == Md(200) == мd(ЗВОО) == Md(7400) . (А-В) The variable о, the angle of the phasor in Figure A2, need not Ье constant. We'll often encounter expressions containing а complex sinusoid that takes the form с == Md rot , (A9) Equa tion (А-9) represents а phasor of magnitude М whose angle in Figure A2 is increasing linearly with time at а rate of (j) radians each second. If (j) = 2х, the phasor described Ьу Eq, (A9) is rotating counterclockwise at а rate of 2х radians per secondne revolution per secondand that's why (j) is called the radian frequency. In terms of frequency, Eq, (A9)'s phasor is rotating counterclockwise at (j) == 2х! radians per second, where ! is the cyclic frequency in cycles per second (Нz), If the cyclic frequency is! == 10 Hz, the phasor is rotating 20х radians per second. Likewise, the expression с = Mejrot (A9') represents а phasor of magnitude М that rotates in а clockwise direction about the origin of the complex plane at а negative radian frequency of--ro rаdiалs per second. А.З Arithmetic Operations о' Complex Numbers А.З.1 Addition and Subtraction of Complex Numbers Which of the above forms for С in Eq. (А-l) is the best to use? It depends оп the arithmetic operation we want to perform. For example, if we're adding two complex numbers, the rectangu1ar form in Eq. (А -1) is the eas iest to use. The addition of two complex numbers, С 1 == R 1 + jl 1 and С 2 == R 2 + jI 2 , is merely the sum of the real parts plus j times the sum of the imagmary parts as +==+++==++M+, (А-10) 
Arithmet/c Operat/oпs о( Complex Numbers 447 Imaginary axis И) Imaginary axis И) Real axis Real axis (а) (Ь) Flgure А-З Geometrical representation of the sum of two complex numbers, Figure АЗ is а graphical depiction оЕ the Sum оЕ МО complex numbers using the concept of phasors. Here the sum phasor С 1 + С 2 in Figure А-3(а) is the new phasor from the beginning of phasor С 1 to the end of phasor С 2 in Figure A3(b). Remember, the Rs aпd the 1s сап Ье either positive or neg- ative numbers. Subtracting one complex number from the other is straight forward as long as we find the differences between the МО real parts and the мо imaginary parts separately. Thus С 1  С 2 = (R 1 + Р1)  (R 2 + Р2) = R 1  R 2 + j(1 1  12) , (А-ll) Аn example of complex number addition is discussed in Section 8,3 where we covered the topic of averaging fast Fourier transform outputs, А.3.2 Multiplication of Complex Numbers We сап use the rectangular form to multiply МО complex numbers as С 1 С 2 = (R 1 + j1 1 ) (R 2 + Р2) = (R 1 R 2  1112) + j(Ri2 + R 2 11) . (А-12) However, if we represent the МО complex numbers in exponential form, their product takes the simpler form с с  м e illJ , М d llJ2  М М e i (llJ,+llJ 2 ) 1 2 1 2  1 2 (A13) because multiplication results in the addition of the exponents. 
448 Appeпdix А: The Arifhтef/c of Сотр/ех Nuтbers As а special case of mu1tiplication of two complex numbers, scaling is multiplying а complex number Ьу another complex number whose imag- inary part is zero. We сап use the rectangu1ar or exponential forms with equal ease as fol1ows: kC = k(R + jI) = kR + jkI , (А-14) or in exponential form, kC = k(Md") = kМd" . (А-15) А.3.3 Conjugation of а Complex Number Тhe complex conjugate of а complex number is obtained Ьу merely chang- ing the sign of the number' s imaginary part. 50, if we denote с' as the сот- plex conjugate of the number С = R + jI = Md", then, с' is expressed as с' = R  jI = Mej0 . (А-16) There are two characteristics of conjugates that occasional1y соте in handy. First, the conjugate of а product is equal to the product of the con- jugates. Тhat iБ, if С = С 1 С 2 ' then from Eq, (А-13), С* = (С 1 С 2 )* = (M1M2ej(01+02)* = M1M2ej(01+02)  М j01 M j02  С * с *  1 е 2 е  1 2 . (А-l7) Second, the product of а complex number and its conjugate is the complex number's magnitude squared. It's easy to show this in exponential form as сс' = Mt!0. Mej0 = M 2 tf = м 2 . (А-18) (Тhis property is often used in digital signal processing to determine the relative power of а complex sinusoidal phasor represented Ьу Mt!rot,) А.3.4 Division of Complex Numbers Тhe division of two complex numbers is also convenient using the ехро- nential and magnitude and angle forms, such as 
Arlthmetic Operatloпs of Complex Nиmbers 449 .s;. = M 1 e i01 = М 1 ei(01 02} , С 2 М 2 е/ 02 М 2 (А-19) and С[ M 1 =L(I 2)' С 2 М 2 (А-19') Although not nearly so handy, we can perform complex division in rec- tangиlar notation Ьу mu1tiplying the numerator and the denominator Ьу the complex conjugate of the denominator as C 1 = RI + j1 1 С 2 R 2 + j1 2 = RI + j1[ . R 2  Р2  + j1 2 R 2  Р2  Щ + 1112) + j(R 2 1[  R(1 2 )  R; + 1; (A20) А.3.5 Inverse of а Complex Number А special form of division is the inverse, or reciprocal, of а complex num- ber, If С = Mt!0, its inverse is given Ьу ..!. =  = J..ej0 с Me J0 М (А-21) In rectangular form, the inverse of С = R + j1 is given Ьу 1  1  R  j[ C R+j[  R 2 +[2 (А-22) We get Eq. (А-22) Ьу substituting R 1 = 1, [1 = О, R 2 = R, and [2 = [in Eq, (А-20), 
450 Appeпdix А: The Ar/fhтefic о( Сотр/ех Nuтbers А.3.6 Complex Numbers Raised to а Power Raising а complex number to воте power is еавНу done in the exponen- оа! fопn. If С = Me i0 , then С' = м" (e i0 / = м" e ik0 , (A23) "1250 For example, if С = зeI , then С cubed is (qЗ = ЗЗ(еiН250) = 27еiЗ75° = 27ei15° , (А-24) We conclude this appendix with four finаl complex arithmetic opera- tions that are not very common in digital signal processingbut уои тау need them sometime, А.З.7 Roots 01 а Complex Number Тhe kth root of а complex number С is the number that, multiplied Ьу itsel1 k times, resu1ts in С. Тhe exponentia! fопn of С is the best way to explore this process, When а сотр!ех number is represented Ьу С = Me i0 , remember that it can also Ье represented Ьу с = Mei(0 + nЗ60 0 ) , (А-25) In this case, the variable 13 in Eq. (А-25) is in degrees, Тhere are k dis- tinct roots when we're finding the kth root of С. Ву distinct, we mean roots whose exponents are !ess than 3600. We find those roots Ьу using the fol1owing: vc = v Ме i (0+nЗ600) = VМе i (0+nЗ600)/k (A26) Next, we assign the values О, 1, 2, 3, ' . ., kl to п in Eq. (A26) to get the k roots of С. ОК, we need an example here! Let's вау we're looking for the .(75°) сиЬе (3rd) root of С = 125е l , We proceed ав follows: vc =  125ej(750) =  125e i (75° +nЗШ) = VU5ei(75° +n3600) / з , (A27) Next we assign the values п = О, п = 1, and п = 2 to Eq, (А-27) to get the three roots of С. So the three distinct roots are 
Ar/thтetic Operatioпs of Сотр/ех Nuтbers 451 1s1 rool ....  = 5e j (75° +0'360°) 13 = 5e j (250) ; 2nd rool....  = 5e j (75° +1'360°) 13 = 5e j ( 435°) 13 = 5ej(l450) ; and 3rd rool....  = 5e j (75°+2'3600)/3 = 5e j (795°)/3 = 5e j (265°) А.З.8 Natural Logarithms о, а Complex Number Taking the natura110garithm of а complex number С = Me j " is straightfor- ward using exponential notation; that is lnС = ln(Me j ,,) = 1nМ + ln(e j ")= 1nМ + j0 , (А-28) where О $ 0 < 2х , Ву way of example, if С = 12e j1t/4 , the naturallogarithm of С is lnС = ln(12e]1t/4) = ln(12) + j1t/4 = 2.485 + jO.785 . (А-29) Тhis means that i 2 ,485 + jfJ,785) = ;.485 . O,785 = 12e j1t/4 . А.З.9 Logarlthm to the Base 1 О о, а Complex Number We сап calculate the base 10 logarithm of the complex number С = Me j " using log10C = loglO(Me i ") = logl + loglO(e j ") = logl + j0 . loglO(e) .t (А-30) Of course е is the irrational number, approximately equal to 2.71828, whose log to the base 10 is approximately 0.43429. Keeping this in mind, we сan simplify Eq, (А-30) as log10C '" logl + j(O,43429 . 0) , (А-31) Repeating the above example with С = 11t/4 and using the Eq. (А-31) approximation, the base 10 logarithm of С is t For те second term оЕ те result in Eq, (АЗО) we used loga(x ") = n ./ogax according to те law оЕ logarithms, 
452 Appeпdix А: The Arlthтetlc of Coтplex Nuтbers log10 С::: lOg10(12e i 1!/4) ::: log10(12) + j(0.43429 . те/4) ::: 1,079 + j(0.43429 .0,785) ::: 1,079 + jO.341 , (А-32) The resиlt from Eq, (А-32) means that 10(1.079 + iO.341) ::: 101.079 , 10 jO ,341 ::: 12 . (e 2 ,302)i O ,341 ::: 12ei(2.302 . 0,341) ::: 12eiO.785 ::: 12e i 1!; 4 , (A33) А.З. 1 О Log to the Base 1 О of а Complex Number Using NaturaJ Logarithms Unfortиnately, some software mathematics packages have по base 10 log arithmic function and сап calcиlate only naturaI Iogarithms. In this sitиa Ноп, we jиst иse ln(x) loglO(X):::  l п(10) (A34) to caIcиlate the base 10 logarithm of х, Using this chaпge о/ base formula, we сап find the base 10 logarithm of а complex nиmber С ::: Me i "'; that is, InC Iog 10 С :::  In = (lOg10 e)(In С). 10 (А-35) Веса иse Iog 10 (e) is approximately eqиal to 0.43429, we иse Eq, (А-35) to state that log10C'" 0.43429 . (InC) ::: 0.43429 . (InМ + jfJ) , (А-36) Repeating, again, the example above of С::: 12e i 1!/4, the Eq, (А-36) approx imation aIlows иs to take the base 10 logarithm of С иsing natиraI logs as loglO С::: 0,43429 ' (In(12) + jтe/4) ::: 0.43429 . (2.485 + jO,785) ::: 1,079 + jO,341 , (A37) giving иs the same resиlt as Eq, (А-32), 
Some Proctico//mp//cot/oпs of Us/пg Сотр/вх Numbers 453 А.4 Some Practicallmplications of Using Complex Numbers At the beginning of Section А.3, we said that the choice of using the rec tangular versus the polar form of representing complex numbers depends оп the type of arithmetic operations we intend to perform. It's interesting to note that the rectangular form has а practical advantage over the polar form when we consider how numbers are represented in а computer. For example, let's say we must represent our complex nиm- bers using а fourbit signmagnitude binary nиmber format. This means that we сan have integral nиmbers ranging from 7 to +7, and our range of complex nиmbers covers а square оп the complex plane as shown in Figure A4(a) when we use the rectangular form. Оп the other hand, if we used 4bit numbers to represent the magnitude of а complex nиmber in polar form, those numbers must reside оп or within а circle whose radius is 7 as shown in Figure A4(b), Notice how the four shaded cor ners in Figure A4(b) represent locations of valid complex values using the rectangular form, but are out о! bouпds if we use the polar form, Put another way, а complex number calculation, yielding аn acceptabIe result in rectangular form, could result in an overf1ow error if we used polar notation in our computer. We could accommodate the complex value 7 + j7 in rectangular form but not its polar equivalent because the mag- nitude of that polar nиmber is greater than 7, Imaginary axis и) Imaginary axls (J) . . .. ." .. ..".,.  . ,- ............,."....... ..... .................. . .. . I!I ...... . ." Ii I!I ." , I!I ........,...."........... ............ -.. .......... .  . . . ." ...  ...  ..................."...... ..........t,:............... '........... ".,... .....,. ....,,,...,,,........... . .f.. ." ..................... :..1: :..1...:...::..:.. ........ ......i ReaJaxis ...,....................,.... ...:..+...:.:.Z.:.:..;.::Z ........ ...I!I...;.............+... ........ Аваl axis (8) (Ь) Flgure А-4 Complex Integral numbers represented as polnts оп the complex plane uslng о four-bIt slgn-magnltude data format: (а) using rectangular notatlon; (Ь) uslng polar notatlon, 
454 Appeпdix А: The Arithтetic о' Сотр/ех Nuтbers Although we avoid аnу further discussion here of the practical impli- cations of performing complex arithmetic using standard digital data for- mats, it is аn intricate and interesting subject, То explore this topic fиrther, the inquisitive reader is encouraged to start with the references, References [1] Plaиger, р, J, uComplex Math Fиnctions,u Eтbedded Systeтs Prograттing, Aиgust 1994, [2] Kahan, W, uBranch Cиts for Соmрlех Elementary Functions or Mиch Ado Aboиt Nothing's Sign Bit,U Proceedings о/ the Joint lМA/SIAМ Con/erence оп the State о/ the Art in Nuтerica/ Ana/ysis, Clarendon Press, 1987. [3] Plaиger, Р. J, uComplex Made Simple,u Eтbedded Systeтs Prograттing, July 1994, 
!APPENDIX вl Closed Form of а Geometric Series In the literature of digital signal processing, we often encounter geomet- ric series expressions like Nl Р N L n r r r  lr ' n=р (В-1) or Nl 1 i2mп  i21tnm/N  e -,-,е  1ei21tm/N . n=о (В-2) Unfortunately, тапу authors make а statement like "and we know that," and drop Eqs, (В-1) or (B2) оп the unsuspecting reader who's expected to accept these expressions оп faith, Assuming that уои don't have а Ph,D, in mathematics, уои тау wonder exactly what arithmetic sleight of hand allows us to amve at Eqs. (Б--1) or (B2), То answer this question, let's con sider а general expression for а geometric series such аБ Nl 5= Larn =ar P +ar P + 1 +ar P + 2 +...+arNl , n=р (В-З) where п, N, and р are integers and а and r are апу constants, Multiplying Eq. (В-З) Ьу r, gives иБ Nl Sr = L ar n + 1 = ar P + 1 + ar P + 2 +'" + arNl + ar N n=р (В-4) 455 
456 Appeпdix В: C/osed Forт of Q Geoтetr/c Ser/es 5ubtracting Eq. (В-4) from Eq. (B3) gives the expression 5  5т = 5(1  т) = атР  ar N , or тР  r N 5=a' 1T (В-Б) 50 here's what we're after, Тhe closed forт of the series is Clos..,d {оrш of а general geometric series:  Nl" rPrN Lar =a' 1T "=р (Вб) (Ву closed form, we mean taking an infinite series and converting it to а simpler mathematical form without the surnrnation.) When а = 1, Eq. (В-б) validates Eq, (Bl), We сап quickly verify Eq. (Вб) with an example, Letting N = 5, Р = О, а = 2, and r = 3, for example, we can create the fol lowing list: п ат"=2.3" О 2 . з0 = 2 1 2. 31 =6 2 2 . 32 = 18 3 2'33=54 4 2 . з4 = 162 The 5um of thi5 column 15 4 L2'3" =242 "=0 Plugging our example N, р, а, and r values into Eq, (Вб), Nl т р rN з0 з5 1243  ат" =a.=2.=2.=242, k.,; 1  r 1  3 2 "=р (7) 
Appeпdix В: C/osed Forт of Q Geoтetric Series 457 which equals the sum of the rightmost соlurnn in the list above. As а final step, the terms of our earlier Eq. (B2) are in the form of Eq, (Вб) as р = О, а = 1, and r = ej2"m/N,t 50 plugging those terms from Eq, (B2) into Eq. (В-б) gives us Nl j2"mOIN j21<mNIN L j2"пmIN  1 е e е  . 1ej2"mIN п=О 1  ej27tm 1ej21tmIN ' (В-8 ) confirming Eq, (B2), t From the math identity аХУ = (аХ)У, we сап say e2""тIN = (ej2.тIN)п, so r = eJ2.тIN. 
IAPPENDIX с! Complex Signals and Negative Frequency Complex nurnbers are used in just about every field оЕ science and engi- neering. t For us, complex signal notation is necessary to describe the effects оЕ quadrature and Fourier processing. It mау Ье fair to say that по other topic in digital signal processing causes more initial discomfort for the beginner than coтplex numbers with their real and iтagiпary parts. Why, еуеn the terminology is bizarre. 50 here's where we review the fun damentals оЕ complex nurnbers, get comfortable with how they're used to represent complex signals, and ехаminе the notion оЕ negative frequency as it relates to complex signal notation. То start this discussion, it's important for us to Ье comfortable with the concept оЕ negative frequency because it's essential in understanding the spectral replication effects оЕ periodic sampling, discrete Fourier trans forms, and the various quadrature signal processing techniques discussed in Chapter 7. Тhe convention оЕ negative frequency serves as а consistent and powerfи1 mathematical tool in our analysis оЕ signals. In fact, the use оЕ negative frequency is mandatory when we represent real sigпals, such as а sine or cosine wave, in complex notation. ТЬе difficulty in grasping the idea оЕ negative frequency mау Ье, for some, similar to the consternation fe1t in the parlors оЕ mathematicians in the Middle Ages when they first encountered negative numbers, Until the thirteenth century, negative numbers were consideredfictitious because numbers were normal1y used for counting and measuring. 50 ир to that time, negative numbers just didn't make sense [1,2], In those days, it was valid to ask, "How сап уои ho1d something in your hand that is less than nothing?" Тhe idea оЕ subtracting six from four must have seemed meaningless. Math historians suggest that negative nиm t 1'ha t's because complex sinusoids are solutions to the second-order linear differential equa- tions used to describe so much of nature, 458 
сотр/ех SigпQ/s Qпd NegQtive Frequeпcy 459 bers were first analyzed in Italy. As the story goes, around the year 1200, the НаНаn mathematician Leonardo da Pisa (known as Fibonacci) was working оп а financial problem whose only va1id solution involved а negative number. Undaunted, Leo wrote, "This problem, 1 have shown to Ье insoluble unless it is conceded that the first таn had а debt," Thus negative numbers arrived оп the mathematics scene, never again to Ье disregarded. Modern теn and women сап now appreciate that negative numbers have а direction associated with them, ТЬе direction is backward from zero in the context that positive numbers point forward from zero. For example, negative numbers сап represent temperatures measured in degrees below zero, minutes before the present if the present is consid- ered as zero time, or тоnеу we owe the tax collector when our income is considered positive dollars. 50 the notion of negative quantities is perfect1y valid if we just define it properly, As comfortable as we now are with negative numbers, negative frequency remains а troublesome and controversial concept for таnу engineers [1,2], This author оnсе (а) о 2rr.ft (OJ 1 О 2 3 Time (Ь) О 2rr.ft (OJ 1 О 2 3 Flgure с-] Posltlve Qnd negQtive frequency sinusolds: (а) sine Qnd coslne woves at Q positive radlan frequency (2rr.ft); (Ь) slne Qnd coslne WQves whose Qrguments Qre Q negQtive frequency (2rr.ft), 
460 Appeпdlx с: coтplex Slgпals aпd Negatlve Frequeпcy encountered а paper in а technical joumal which stated: "since negative frequencies cannot exist," Well, like negative numbers, negative fre quency is а perfectly valid concept as long as we define it properly rel ative to what we're used to thinking of as positive frequency, In radians, а negative frequency sinusoid is merely опе whose angu1ar argument is negative, as shown in Figure C-l(b).t С.1 Development 01 Imaginary Numbers Before we go further in our discussion of negative frequency Ьу way of complex notation, we must first take а deep breath and enter the Twilight Zone of the 'т operator and imaginary numbers, You've seen the defini tion j = н before. Stated in words, we say that j represents а number which, when multiplied Ьу itself, results in а negative one, Well, this def- inition causes initial difficulty for the beginner because we know that anу number mu1tiplied Ьу itself always resu1ts in а positive number. (Unfortunately digital signal processing textbooks typically define j and, then, with justified haste, swiftly carry оп with аll the ways that the j operator сan Ье used to analyze sinusoidal signals. Readers soon forget about the question: What does j = н actually mean? Well, Н had Ьееп оп the mathematical scene for some time but wasn't taken seriously until it had to Ье used in the sixteenth century to solve сиЫс equations [3, 4]. Mathematicians reluctantly began to accept the abstract concept of Д without having to visualize it, as long as its mathematical properties were consistent with the arithmetic of пorтal real numbers, It was Euler's introduction of the complex plane, used to solve secondorder differential equations, that further legitimized the notion of Н to Europe's mathe maticians in the eighteenth century,t Euler showed how complex num bers using the Н operator had а clean, consistent relationship to the well-known trigonometric functions of sines and cosines [3]. We сап get more comfortable with the complex plane representation of irninary numbers Ьу examining the mathematical properties of the j = ..J1 operator as shown in Figure C2(a). Multiplying апу number оп t Shortly, we'lI represent negative frequency sinusoids graphically using phasor notation and see that the negative frequency phasors are merely rotating in the direction opposite from an arbitrary positive reference direction, t Leonhard Euler, Ьот in Switzerland in 1707, is considered Ьу many historians as the world's greatest mathematician, Ву the way; in case уои don't speak German, the пате Eиler is pronoиnced as "oiler," 
Deve/opmeпt of /mQgiпQry Numbers 461 Imaginary )8 axis Imaglnary axis и) о 1/ j8 (а) с= 8 + jb ... Ьш шш  } the +8 Ilne ;k" the +jb line о 8 Rв.аl aXls (Ь) Flgure С-2 Numbers оп the complex plone: (о) the 900 rototlons when о number Is multlplied Ьу J; (Ь) о complex number, с = Q+Jb, hoving both reol ond lmoginory parts оп the complex p/one, the real axis Ьу j resu1ts in an imaginary product that 1ies оп the imagi- nary axis. Тhe example in Figure С-2(а) shows that if +8 is represented Ьу the dot lying оп the positive real axis, multiplying +8 Ьу j resu1ts in an imaginary number, +j8, whose position has been rotated 900 counter- clockwise from +8, putting it оп the positive imaginary axis. Similarly, mu1tiplying +j8 Ьу j resu1ts in another 900 rotation yielding the 81ying оп the negative real axis because j2 = 1, Mu1tiplying  Ьу j resu1ts in а further 900 rotation giving the j8 lying оп the negative imaginary axis, Whenever any number represented Ьу а dot is multip1ied Ьу j, the result is а counterclockwise rotation of 900 оп the complex plane. (Conversely, multip1ication Ьу j resu1ts in а clockwise rotation of 900 оп the сот- plex plane.) Тhe complex plane enables us to represent complex num- bers having both real and imaginary parts. For example in Figure С-2(Ь), the complex number с = a+jb is а point lying оп the complex plane оп neither the real nor the imaginary axis. We locate point с Ьу going +а units along the real axis and ир +Ь units along the imaginary axis. Oust to refresh the reader's memory, Appendix А provides а dis- cussion of the arithmetic of complex numbers.) We сап, if we care to, think of аН numbers as being complex. Thus, real numbers are complex numbers with по imaginary part, and imaginary numbers are complex numbers with по real part. Let's pause for а moment here to catch our breath, Don't worry if the ideas of imaginary numbers and the complex plane seem а 1itt1e myste- rious, It's that way for everyone at firstyou'll get comfortable with 
462 Appeпdix с: Сотр/ех s/gпQ/s Qпd NegQt/ve Frequeпcy them the more уои use them. (Remember, the Н operator puzzled Europe's heavyweight mathematicians for hundreds of years,) Not only is the mathematics of complex numbers а bit strange at first, but the ter- minology is unfortunate, Although the term iтagiпary is an unfortunate one to use, the term coтplex is downright weird, When first encountered, the phrase coтplex пuтbers makes one think "complicated numbers." This is regrettable because the concept of complex numbers is not really аН that complicated,t С.2 Representing Real Signals Using Complex Phasors ОК, now we сап tum our attention back to the original discussion of understanding negative frequency when using the mathematics of сот- plex numbers. We start Ьу representing а real sinusoid in the context of the complex plane. То see how this is done, consider the waveform in Figure с-з. тhink of а cosine wave defined Ьу 2cos((Ot) oscillating back and forth оп the real axis as time passes, (Here the (О term is frequency in radians/s, and it corresponds to а frequency of 2тс! cycles/s where j is а single cycle/s or 1 Hz.) Now, consider two complex phasors rotating in opposite directions about the time axis, one rotating counterclockwise with а positive angular change (Ot and the other phasor rotating with а negative angle, t. The angles, of course, change as а function of time making the ej{j)t and ej{j)t phasors rotate, Figure С-4 attempts to show, as time passes, one complete rotation of the ej{j)t phasor, for example. That phasor's tip follows а corkscrew path spiraling along and centered about the time axis. Let's show how the cosine wave is the phasor sum of the two complex phasors. We сan visualize the phasors' (Ot and (Ot angles better if we ori- ent the three-dimensional view in Figure с-з so that we're looking right straight down the time axis in the negative time direction as shown in Figure С-5, The time arrow is coming straight out of the page toward the reader and the two complex phasors, frozen in time, are represented Ьу the bold arrows, Figure C5 looks reasonably simple, but it contains а wealth of information, Let's first consider the ej{j)t phasor. Using the real and imaginary axis, we сап see why the e jrot phasor is defined Ьу t The brilliant American engineer Charles Р, Steinmetz, who pioneered the use of real and imaginary numbers in electrical circuit analysis in the early twentieth century, refrained from using the term сотр/ех пuтber5he cal1ed them "general numbers," 
Represeпtiпg ReQI S/gпQls Usiпg Coтplвx PhQsors 463 Euler's equation:  ejO)t = cos(rot) + jsin(rot) , (Cl) Named in his honor, Eq. (C-l) is now called Euler's equatioп, This expression defines the position of the tip of the ejO)t arrow in the complex plane, The cos(rot) term in Eq, (Cl) is the phasor's component a10ng the rea1 axis, and the sin(rot) term is the phasor's component along the imaginary, or j, axis, It's very important to realize that the phasor's component projected оп the imaginary ахiБ is the real number sin(rot), and пot jsin(rot). The +j in the sec ond term of Eq, (Cl) merely means that the phasor has а component along Imaginary axis (j) Figure с-з Coslne represented Ьу two rotating complex phasors, ! Imaginary axis ( j) I  eal axis 900 Time Flgule С-4 The rotQtion of thв е Jшt phasor Qbout the t/me аХ/5. 
464 Appendix с: сотр/ех SJgпa/s aпd Negat/ve Freqиeпcy , Imaginary I axis (j) t COS(ro7 Тipofthe Sin  (rot) ejrot time arrow  ____(J).t_______ ш _____  rot Аеаl axis sin(ro е  + cos(ro  Flgure С-б Complex phasors representing а coslne wave In the complex plane, the positive j axis whose magnitude is sin{rot). Likewise, the ejro/ phasor has а component along the negative j axis whose magnitude is sin{rot), We describe the ejro/ phasor with the expression Another version of Euler's equation: --+ e--jro/ = cos(rot)  jsin(rot) t (C2) Тhe positive angle rot is (arbitrarily) defined as the counterclockwise angle between the real axis and the phasor, As time t increases, angle ro t increases and the e jro / phasor rotates counterclockwise, Тhe ejro/ phasor rotates in the clockwise direction at the same angular frequency as the e jro / phasor; that is, when rot is zero radians, both phasors are at 3:00 o'clock, along the real axis. As times passes, when the e jro / phasor is at twelve о' clock, the ejro/ phasor is at six о' clock. As the phasors continue rotating, they pass each other, again, exactly at ninе о' clock. Let's look further and see how the sum of the e jro / and ejro/ phasors rep resents а real cosine wave, In Figure С..б(а), the phasor angle is rot = тс/4 (45 degrees), The bold arrow representing the real cosine wave, 2cos(rot), is the phasor sшn of the e jro / and ejrot phasors. Notice how the cosine wave' s arrow t Ot:her versions of Eu\er's equation, which we сan derive from Eqs, (C-l) and (С-2), асе sinto/) = (ei""  e- i "")/2j, and cos((J)/) = (e i "" + e- i "")/2, !I 
Represeпt/пg Rea/ Sigпa/s Usiпg Сотр/ех Phasors 465 + Imaglnary + Imaginary Imaglnary + ах!. и) axl. и) axl. и)   t, /'. ejrot ejrot ",t=1tI4 j"'t= ,,/2 7  ...,t Аеаl Real /...,t:1 axi8 axis в --fwt е --fw t в --fwt I '" i (а) (Ь) (с) Flgure С-6 Complex phosors representing о cosine wove: (о) when oot= тс/4; (Ь) when oot = тс/2; (с) when oot = 3тс/4, tip is along the real зxis. At а later tiше, when ro t = п/2 radians, the ei(J)t pha- sor has rotated counterclockwise, the ei(J)t phasor has rotated clockwise, and the 2cos(rot) wave's arrow tip has moved to the left and sits exactly at the zero point оп the real axis as shown in Figure C-б(Ь), We know this is correct because 2cos(1t/2) = о. As tiше passes and rot = З1t/4 radians, the ei(J)t and ei(J)t phasors and their resulting 2cos(rot) phasor are shown in Figure С.б(с), which is real and negative, As the complex phasors continue rotating, the 2cos(rot) phasor tip merely slides back and forth always remaining оп the real зxis. Figure С-З attempts to illustrate this Ьу showing the 2cos(rot) wave always lying in the plane of the real axis in our three-dimensional depiction. Тhinking about these phasors, it's clear, now, why the cosine wave сап Ье equated to the sum of two complex phasors Ьу ei(J)t + ei(J)t cos(rot) = , 2 (С-З) which is ha1f the sum of Eqs. (С-l) and (С-2), (Тhe example in Figure С-З used а cosine wave with а peak amplitude of 2 merely to avoid cluttering Figures С-З through С-б with а denominator of 2 below each of the ei"'t and ej(J)t terms.) If Eq, (С-З) describes а real cosine wave in the complex plane, how do we represent а real sinewave? Well, we сап combine Eqs. (С-l) and (С-2) and solve for sin(rot) to get the following standard expres- sion for а sinewave in complex notation: ej(J)t  ei(J)t sin(rot) = 2j (С-4) 
466 Appeпdix с: Сотр/ех Sigпo/s ond Negotive Frequeпcy То investigate the meaning of this expression, we сan multiply both sides of Eq. (С-4) Ьу 2 to get the following altemate expression for а sinewave in terms of complex exponentials: ejo>tejo>t . , 2sin«Ot)= , =j(eJo>t eJO)t) ] (С-5) Equation (С-5) looks а little strange, doesn't it? It states that а real sinewave is equal to j times the sum of two complex numbers! Well, we сan decipher Eq. (С-5) Ьу graphically illustrating the complex ехроnеn- tials as phasors just as we did in Figure С-5. А depiction of just the (ejo>t  ejO)t) factor from Eq, (С-5) is the phasors in Figure C7(a). То account for the j term in Eq. (C5), we rotate the phasors in Figure C7(a) Ьу Л/2, or 900, in the clockwise direction. 50 the full j(ejo>t  ejo>t) expres- sion оп the right side of Eq. (C5) is shown in Figure C7(b). Because the joot phasor rotates clockwise and the ejo>t phasor rotates counterclock wise, their phasor sum representing 2sin(O)t) will always lie оп the real axis. We know this is true because the 2sin(O)t) siriewave in Eq. (C5) is reallike а cosine wave, it has по imaginary part, То belabor this point а bit further, consider Figure C8. When the angle о) t == О, both the jejo>t and jejo>t phasors lie оп the imaginary axis, and their phasor sum sits exactly at the zero point of both axes, as shown in Figure C(a). We know this is сопесt because 2sin(O) = О. At а later time when O)t == п/4 radians, the jejo>t phasor has rotated clockwise, the jejo>t phasor Imaginary axis и)  \maginary axis и) / / j ,---ejo>t= jejo>t  Ава\ axis je  Аваl axis jo>t Bjo>t "" (а) (Ь) Flgure С-7 Coтplex phasors: (о) phosor represeпtotion of (e}o>t  e-}o>t); (Ь) phosor representotion of j(e}o>t  e- pt ). or 2sin(w t) = je}o>t + je-}o>t, 
Represeпtiпg Rea/ SigпQ/s USiпg Negatlve Frequeпeies 46j  Imaginary axis и) t je",t= ,соо(О) + sin(O) irot:j1 .axis jejrol =jcos(O) + sin(O) . =j1 (8) + Imaginary . axis и) sin(rol)7- sin(roI), je--jrot + Imaginary axis (j)  Аааl axis  Aaal axis (Ь) (с) Figure С-8 Complex phQsors representing а 2slп(юt) sinewove: (а) when юt = О; (Ь) when юt = 1t/4; (е) when юt = 31t/4, has rotated counterclockwise, and the 2sin(фt) wave's arrow tip has moved to the right to а positive point оп the real axis, as shown in Figure С-8(Ь), As time passes and фt = 31[/4 radians, the jej(J)1 phasor is now in the northeast quadrant, and jej(J)1 phasor is directed southeast. They and their 2sin(фt) phasor sum are shown in Figure C8(c). As the complex phasors continue rotating, the 2sin(фt) phasor oscillates back and forth, always remaining оп the real axis, То keep the reader's mind from spinning like our complex phasors, please realize that the sole purpose of Figures C6 through C8 is to vali date the complex expressions of the cosine and sinewave given in Eqs. (С-3) and (C4), С.3 Representing Real Signals Using Negative Frequencies ОК, let's keep in mind one of the goals of this discussionwhy the concept of negative frequency is valid when rea1 signa1s are represented in complex notation. We сап do this Ьу comparing the relationship between а соs(фi) wave and а sin(Фi) wave, using Eqs. (C3) and (С-4) and combining them graphically оп а threedimensional complex frequency axis as shown in Figше C9. If we say that the angular frequency is ФО radians/second = 21[10 Нz, the time--varying composite angie is Фi radians = 2rifot cycles at Шnе t, Look at Figure C9 very carefullyit's а snapshot of the complex phasors that comprise а rea1 cosine wave (solid arrows) from Eq. (C3) and а real sinewave (shaded arrows) from Eq. (C4) when Шnе equals zero, or Фi = о. 
468 Appeпdix с: Сотр/ех SigпQ/s Qпd Negative Frequeпcy Jmaginary ! R I ' ( ' ) I ;а axJS J V XiS jeO 2 t= О, ао root= О Jro 0 t/ 2 J Freq Figure С-9 Relatlonsh/p of the сотplех representatlons of the cos(root) = (ej())ot + ej())ot)/2 (solid arrows) and the sin(roj) = (eJ())ot  e-jo>ot)/j2 = He)olot + je-)oIоt)/2 (shaded arrows), when roj = О, тhi.5 Нgше shows that, when we use complex notation, e j ())/ and ej())t are the fundamental constituents of а sinusoid, not sin(O)t) or cos(O)t) ЬесаuБe both sin«(i)t) and cos(O)t) are made ир of e j ())/ and ej())t components, on the fre-. quencyaxis, the notion of negative frequency is seen as those phasors located at Шо radians оп the frequency axis, (Н we were to take the discrete Fourier transform of а cosine wave and plot the complex results, we'd get exactly those bold phasors in Figure C9, Likewise, the discrete Fourier transform of а sinewave results in the shaded phasors in Figure С-9,) Figure С-9 also reiterates the fact that а cosine wave is merely а sinewave sblfted in time, If we let the phasors in Figure С-9 rotate 900 (1t/2 radians, or а quarter of а cycle), they're oriented as shown in Figure C10, 50 the sinewave's shaded phasors, in Figure С -10, are oriented exactly as the cosine wave' s phasors in Figure С-9, The relationsblp between Figures C9 and C10 illustrates the мо following trigonometric identities: Sin(0) = COS(0  1t/2) , (С-б) and COS(0) = ---sin(0  1t/2) . (С-7) 
Represeпt/пg ReQ/ S/gпQ/s Us/пg Negative Frequeпcies 46 Imaginary t al axI8(/) V i8 t = п/2ОО 0 = 1/4f o , or 000 t = п/2 еfщ:,t/ 2 е fщ:,t/2 Freq Flgure C-IO Relationship of the complex representations of cos(fiJot) (solid arrows) and sln(fiJot) (shaded arrows) when fiJot = 1t/2, Putting Eqs. (C6) and (C7) into words relative to the two figures above, we can say that the sine phasors in Figure С-I0 are equal to the cosine phasors in Figure С-9, and the cosine phasors in Figure C10 are equal to the negative of the sine phasors in Figure C9. This tel1s us that а sinu- soidal wave сап Ье described as а sinewave or а cosine wave depending оп the time we start looking at it; that is, а delay in the time domain man- ifests itself as а phase shift in the frequency domain. This effect is very important in digital signal processing, so remember it,+ If we use the same axis as before, we can illustrate а sinusoidal wave at an arbitrary phase angle 0, Acos((Oi + 0), as shown Ьу the bold pha- sors in Figure C-l1(a). The magnitude of the two bold phasors is, of course, А/2, so they'll sum to А when they're aligned along the real axis. Figure Cll(a) shows that the phasors are the phasor sum of their real and imaginary parts. Figure Cll(b) shows the real and imaginary сотро- nents a1igned with the real and imaginary axis. Why bother showing the real and imaginary parts as in Figure C-ll(b)? Because this signal repre sentation leads us to the graphical form used so often in the digital signal processing literature of quadrature signal processing. тhink for а moment of а real signal comprising seven sinusoids over а bandwidth В centered about а carrier frequency of (00' We could represent that signal' s spectrum Ьу the bold phasors in the complex frequency domain of Figure С-12(а). If we had another signal with an unlimited number of sinusoids over the bandwidth В, we could forego drawing + For additional examples of this shifting property, check ои! Section 3.6, 
470 Appeпd/x с: Сотр/ех S/gпQ/s Qпd NegQt/ve Frequeпcy Imaginary  iS(j) Аеа' axis F ,maginar y axis (j) Аеа' axis I юо Freq Freq (а) (Ь) Figure с-!! Two depictions of the complex representatlon of Acos(wot + 0) indlcated Ьу the bold phQsors, The thin solid Qrrows ше the real PQrts, and the thin shQded arrows are the imQginary PQrts, individual phasors and merely show the spectrum Ьу joining the tips of the phasors with the bold lines in Figure C12(b), Тhis signal has а con tinuous spectral envelope over the bandwidth В, and that's the typical signal spectrum representation used in the literature of quadrature pro cessing. Figure C12(b) shows the projection of the signal's constant amplitude rectangular spectrum оп both the real and the imaginary axis. In quadrature processing, Ьу convention, the real part of the spec trum is called the iп-phase component, and the imaginary part of the spectrum is called the quadrature-phase component. Тhe signal in Figure C12(b) is real, and, in the time domain, it сап Ье represented digitally Ьу а series of amplitude values that have nonzero real parts and zero- valued imaginary parts, We're not forced to use complex notation to rep reseI1t it in the time domainthe signal is real. (If it was а continuous physical signal, it could Ье transmitted over а single conductor.) Real signals always have positive and negative frequency spectral compo nents, For any real signal, the positive and negative frequency compo nents of its inphase (real) spectrum always have even symmetry about the zero frequency point; that is, the in-phase part's positive and nega tive frequency components are mirror images of each other, Conversely, the positive and negative frequency components of its quadrature (imaginary) spectrum are always complex conjugates of each other [5]. This means that the phase angle of any given positive quadrature fre queIlcy component is the negative of the phase angle of the correspond- 
Сотр/ех SigпQ/s Qпd QUQdroture Mixiпg 471 Imaginary t/ axiS(j) Aeal аюв о (а) (Ь) Original signal Freq In-phase (real) рап Quadra!ura phase (imaginary) par! imaginary l/ iS(j) Аеаl axis о Freq о (с)  Freq Flgure С-12 Quadrature representation of bandpass signals: (а) real signal containlng seven sinusoids over bandwldth В; (Ь) real signal contalnlng an Infinite number of sinusoids over bandwldth В; (с) complex slgnal of bandwidth В, ing quadrature negative frequency component, as shown Ьу the dashed arrows in Figure С-12(Ь). Тhis is the invariant nature of real signals when their spectra are represented using complex notation, С.4 Complex Signals and Quadrature Mixing Complex signals, оп the other hand, are а different story. Figure C12(c) shows the spectrum of an arbitrary complex signal of bandwidth В. In 
472 Appeпdix с: Сотр/ех S/gпa/s aпd Negatlve Freqиeпcy the tllnе domain, it сап only Ье represented Ьу amplitude values that have nonzero real and nonzero imaginary parts, We're forced to use complex notation to represent it in the Нте domainthe signal is coт plex. (As а continuous physical signal, а complex signal could only Ье transmitted иsing two condиctors.) Complex signals aren't forced to have the symmetric real and the conjugate symmetric imaginary spec tral components characteristic of real signalsomplex signals сап have just positive (or just negative) frequency components, as shown in Figure С-12(с). We can summarize аН that we've covered in this chapter Ьу consider- ing an interesting topicthe spectrиm translation effects of quadrature mixing [7]. Figure С-13(а) shows the triangular spectrиm of an arbitrary real signal centered about 000 radians/s, In quadrature mixing, we trans late the original signal's spectrum down to the zero frequency point before digitization, This is typicaHy done Ьу multiplying the original sig- nal Ьу а cosine wave оЕ 000 radians/s, in the time domain, to get the in- phase spectral component of the input signal as shown in Figure С-13(Ь). It's irnportant to see that Figure С-13(Ь) is the product of Figure С-13(а) and the solid cosine phasors in Figure C9, Тhe ejro"t /2 complex cosine phasor from Figure С-9 translates both Figure C-13(a)'s original input sig nal spectral bandwidths toward the negative frequency direction, as shown in Figure C13(b), Likewise, the ej(fJ,t /2 complex cosine phasor from Figure C9 translates both original inpиt signal spectral bandwidths toward the positive frequency direction, also shown in Figure С-13(Ь), Although not obvious in the figure, the magnitude in Figure С-13(Ь) is half the magnitude of that in Figure С-13(а) because of the 1/2 scale fac- tors in the cosine expressions in Eq. (СЗ) and Figure C9, То get the quadrature-phase spectral components of our inpиt signal, we multiply the input signal Ьу а sinewave of 000 radians/s to get the spectrиm shown in Figure С-13(с), Again, Figure С-13(с) is the product of Figure С-13(а) and the dashed sine phasors in Figure C9. Тhe jej(fJ,t /2 dashed complex sine phasor from Figure С-9 translates both Figure C 13(a)'s original input signal spectral bandwidths toward the negative fre- quency direction, but aligned with the imaginary +j axis as shown in Figure С-13(с), Тhe jeiro"t /2 dashed complex sine phasor from Figure С..-9 translates both original input signal spectral bandwidths toward the pos- itive frequency direction aligned with the imaginary j axis, also shown in Figure С-13(с), Figure C-13(d) shows both the in-phase and quadrature spectral bands combined оп the complex frequency plane axis. (Examples of this quadrature mixing scheme are discussed in Sections 7,1 and 7,2,) 
Сотр/ех SigпQ/s Qпd QUQdrQture Mixiпg 473 Jmaginary  iS(j) Ава\ axis (а)  Imaginary  iS(j) Aeal axis , +«\)  в--- Freq (Ь)  (с) о Freq (d) +2<00 "'=,  Freq Freq Flgure С-13 Quadrature mixlng of а real bandpass slgnal with even symmetrie speetral eomponents: (а) original real input signal of bandwidth В; (Ь) in-phase speetral eomponents of the input signal; (е) quadrature- phase speetral eomponents of the input signal; (d) eombined in- phase and quadraturephase eomponents, Providing another example to demonstrate the frequency translation that takes place in complex signal mixing, Figure C14 shows the spectral results of quadrature mixing when the input signal is real and has conju- gate positive and negative frequency components, Section 10,1, with its dis cussion of digital mixing sequences, provides several practical examples of 
474 Сотр/ех S/gпa/s aпd Quadrature M/x/пg Imaginary  iS(j) Аваl axis (а) lmaginary  'S(j) Авal axis 2<% Freq (Ь) (с) (d) Freq 2щ, Freq Flgure С-14 Quadrature mlxlng of а real bandpass signal with eomplex eonjugate symmetrie speetral eomponents: (а) original real input signal of bandwidth 8; (Ь) In-phasв speetra/ eomponents of the input signa/; (е) quadrature-phase speetral eomponents of the Input signal; (d) eombined In-phase and quadrature-phase eomponents, the spectral translation effects of quadrature mixing. Тhat concludes our introduction to complex signals and negative frequency. For further mater- ial оп these topics, the reader is encouraged to review reference [7], а tепifiс series of papers detailing how complex signals and negative frequencies relate to modem-day digital communications signals. 
Refereпces 475 References [1] Lewis, L, J" et al, ипеат Systeтs Aпalysis, McGrawHill Inc., New York, 1969, рр, 193, [2] Schwartz, М. Iп/orтatioп, Traпsтissioп, Modulatioп, aпd Noise, McGraw-НШ Inc., New York, 1970, рр, 35, [3] Struik, D, А Coпcise History о/ Matheтatics, Dover Publications Inc" New York, 1967, рр. 92, [4] Вergarnini, D, Мatheтatics, Ше Science Ubrary, Tune Inc" New York, 1963, рр, 152. [5] Нsи, Н. Fourier Aпalysis, Simon and Schuster, New York, 1970, рр, 75. [6] Chester, D, В., and Phi1lips, G. "Single СЫр Digital Down Converter Simplifies RF DSP Applications," RF Design, November 1992, [7] Воиtin, N" "Соmрlех Signals," RF Design, December 1989, 
I APPENDIX D Mean, Variance, and Standard Deviation In our studies, we're often forced to consider noise functions. Тhese are descriptions of noise signals that we cannot explicitly describe with а timedomain equation. Noise functions сan Ье quantified, however, in а worthwhile way using the statistical measures of mean, variance, and standard deviation. Although we only touch, here, оп the very broad and important field of statistics, we will describe why, how, and when to use these statistical indicators, so that we сап add them to our collection of signal analysis tools, First we'll determine how to calculate these statisti cal values for а series of discrete data samples, cover an example using а continuous analytical function, and conclude this appendix with а dis cussion of the probability density functions of several random variableE that are common in the field of digital signal processing, 50 let's proceec. Ьу sticking our toes in the chilly waters of the mathematics of statistics to obtain а few definitions. D.l Statistical Measures Consider а continuous sinusoid having а frequency of /0 нz with а peak amplitude of Ар expressed Ьу the equation x(t) = A p sin(21tfot) , (Dl) Equation (Dl) completely specifies x(tthat is, we сan determine x(t)'s exact value at anу given instant, For example, when time t = 1/4/0' we know that x(t)'s amplitude will Ье Ар and, at the later time t = 1/210, x(t)'s ampli tude will Ье zero, on the other hand, we have по deftnite way to express 476 
Stat/stica/ Measures 477 the successive values of а random fиnction or of random noise. t Тhere's по equation like Eq. (Dl) available to predict future noiseamplitude values for example. (Тhat's why they сall it random noise.) Statisticians have, how- ever, developed powerful mathematical tools to characterize several prop erties of random fиnctions, Тhe most important of these properties have been given the names теап, variaпce, and staпdard deviatioп, Mathematically, the mеап, or average, of N separate values of а sequence х, denoted x ave ' is defined as [1] N xave =..! 2: х (п) = х(1)+х(2)+х(З)+,..+х(N) N п=l N (D-2) Equation (D2), already familiar to most people, merely states that the average of а sequence of N numbers is the sum of those numbers divided Ьу N. Graphically, the average сап Ье depicted as that value about which а series of sample values cluster, or congregate, as shown in Figure D-1. If the eight values depicted Ьу the dots in Figure D-1 represent some теа- sured quantity and we applied those values to Eq. (D-2), the average of the series is 5.17, as shown Ьу the dotted linе. 6.0 t х(п)ш 5,5t . 50 ! 4.5 4,0 3,5 ХаУе= 5,17 . \ . . . . . . . I I 2 3 I 4 I 5 I 6 I 7 1. 8 п Flgure D-I Average of а sequence of eight values, t We deftne raпdoт пoise to Ье unwanted, unpredictable, disturbances contaminating а sig- nal or а data sequence of interest, 
478 Appeпd/x о: Меоп Vor/oпce, oпd Stoпdord Dev/ot/oп Now that we've defined average, another key deftnition is the variance of а sequence, о' 2, defined as 1 N 0"2 = N ')x(п)XaYe]2 п=l [x(1)XaYe]2 +[x(2)XaYe]2 +[Х(З)Хаvе]2 +",+[x(N)Xave]2 (DЗ) N Sometimes, in the 1iterature, we'll see 0"2 defined with а l/(Nl) factor before the summation instead оЕ the l/N factor in Eq, (DЗ), Тhere are subtle statistical reasons why the l/(Nl) factor sometimes gives more accUIate resu1ts [2], However, when N is greater than, say 20, as it wШ Ье for our purposes, the difference between the twofactors wi1l have по practical significance. Variance is а very important concept because it's the yardstick with which we measure, for example, the effect of quantization епоrs and the usefulness of signal-averaging algorithms, It gives us an idea how the aggregate values in а sequence fluctuate about the sequence's average and provides us with а welldefined quantitative measure of those fluc- tuations, (Бесаusе the positive square root of the variance, the standard deviation, is typically denoted as о' in the 1iterature, we'll use the conven tional notation оЕ 0"2 for the variance.) Equation (D-З) looks а bit perplex- ing if you haven't seen it before. Its meaning becomes clear if we examine it carefully, Тhe x(l)  Хауе value in the bracket, for example, is the differ ence between the х(l) value and the sequence average Хауе' For any sequence value х(п), the х(п)  Хауе difference, which we denote as д(п), сап Ье either positive or negative, as shown in Figure D-2. Specifically, the differences д(l), д(2), Д(З), and д(8) are negative because their corre sponding sequence values are below the sequence average shown Ьу the dotted line, If we replace the х(п)  Хауе difference terms in Eq, (D-З) with д(п) terms, the variance сап Ье expressed as 1 N 0"2 = N )д(п)]2, where д(п) = х(п)  Хауе п=l (D4) The reader might wonder why the squares of the differences are summed, instead of just the differences themselves. If we just add the dif- ferences, some оЕ the negative д(п)s wШ сanсеl some of the positive д(п)s 
Statistica/ Measures 479 6,0 t х(п) 5,5 t 5,01 4,5 A(8) 2 3 Х. уе = 5,17 5 6 7 8 п 4,0 3,5 4 Figure О-2 Dlfference values (п) of the sequence in Figure D-l, resu1ting in а sum that тау Ье too small. For example, if we add the /\(n)s in Figure D-2, the positive /\(6) and А(7) values and the negative /\(3) value will just about cancel each other out and we don't want that, Because we need an unsigned measure of each difference, we use the dif ference-squared terms as indicated Ьу Eq. (D-4). In that way, individual /\(п) difference terms will contribute to the overall variance regardless of whether the difference is positive or negative. Plugging the А(п) values from the example sequence in Figure D-2 into Eq. (D-4), we get а variance value of 0,34. Another useful measure of а signal sequence is the square root of the variance known as the standard deviation. Taking the square root of Eq. (D-3) to get the standard deviation о, N а = Ы =  )x(п)XaYe]2 пl (D5) So far, we have three measurements to use in evaluating а sequence of values: the average ХаУе' the variance 02, and the standard deviation о. Where Хауе indicates about what constant level the individual sequence values vary, 02 is а measure of the magnitude of the noise fluc- tuations about the average Хауе. If the sequence represents а series of random signal samples, we сап say that Хауе specifies the average, or constant, value of the signal. The variance о 2 is the magnitude squared, or power, of the fluctuating component of the signal. The standard devi ation, then, is аn indication of the magnitude of the fluctuating coтpo nent of the signal. 
480 Appendix о: Меаn, Variaпce, aпd Staпdard Deviatfoп D.2 Standard Deviation, or RMS, 01 а Continuous Sinewave For sinewaves, electrical engineers have taken the square root of Eq. (D3), with Хауе = О, and defined а useful parameter, called the rтs value, that's equal to the standard deviation, For discrete samples, that parame ter, x rms ' is defined as Х nn. = 1 N  Lx(п)2 N п=1 (D6) Тhe х пns in Eq. (D6), obtained Ьу setting Хауе = О in Eq. (D5), is the square root of the тean (average) of the squares of the sequence х(п). For а con- tinuous sinusoid x(t) = A p sin(21tft) = Apsin(Q)t) whose average value is zero, x(t)rms is x(t)rms-sinewave defined as 2. x(t)rmssinewave = 2 f [Ар sin(Q)t)]2 d(rot) 2 2. А f 1 ....L  [1  cos( ш)] d( Q)t) 2х 2 А; . [ rot .!(Sin(Q)t)) ] 27t = А; . [ 2Х ] 2х 2 2 2х 2 о  Ар  .J2 (D-7) Тhis .x(t)rms-sinewave = A/.J2 expression is а lot easier to use for ca1culating average power dissipation in circuit elements than taking the integral of more complicated expressions for instantaneous power dissipation. Тhe variance of а sinewave is, of course, the square of Eq, (D-7), or Ai/2, We've provided the equations for the mean (average) and variance of а sequence of discrete values, introduced an expression for the standard 
Тhe Меап aпd Var/aпce of Raпdom Fuпctioпs 481 deviation or rms of а sequence, and given an expression for the rms оЕ а continuous sinewave. The next question is "How сan we characterize ran- dom functions for which there are по equations to predict their values and we have по discrete sample values with which to work?" The answer is that we must use probability density functions, D.З The Mean and Variance о' Random Functions То determine the теan or variance of а random function, we use what's called the probability deпsity fuпctioп. The probabi1ity density function (PDF) is а measure of the likelihood of а particular value occurring in some function. We Сan explain this concept with simple examples of Шр ping а СОin or throwing dice as i11ustrated in Figure D3(a) and (Ь). The result of f1ipping а СОin сan only Ье one оЕ two possibilities: heads or tai1s. Figure D3(a) indicates this PDF and shows that the probabi1ity (like1i- hood) is equal to onehalf for both heads and tails. That is, we have an equal chance that the СОin side facing ир wi1l Ье heads or tai1s. The sum of those two probabi1ity values is one, meaning that there's а 100% prob- abi1ity that either а head or а tai1 wi1l occur. Figure D3(b) shows the probabi1ity of а particular sum оЕ the upper faces when we throw а pair of Фсе. This probabi1ity function is not uni form because, for example, we're six times more likely to have the die faces add to seven than add to two (snake eyes). We сan say that after toss- ing the dice а large number of times, we should expect that 6/36 = 16,7 percent of those tosses would result in sevens, and 1/36 = 2.8 percent of the time we'll get snake eyes. The sum of those eleven probabi1ity values CoJn lace PDF Sum 01 dice PDF Order 01 birth PDF 6IЭ6 ""'/З 2/з8 Gender order Coin Hoada !асе (а) (Ь) (с) Flgure D.3 Slmple probobIllty density functions: (о) the probobIllty of flipping о slngle coin; (Ь) the probobIllty of о portlculor sum of the upper foces of two die; (с) the probobility of the order of bIrth of the glrl ond her slbIlng, 
482 Appeпd/x о: Меаn Var/aпce, aпd staпdard Dev/atloп in Figure D-3(b) is also one, telling us that this PDF accounts for all (100%) of the possible outcomes of throwing the dice. ТЬе fact that PDFs must account for аН possible results is emphasized in ал interesting way in Figure D3(c). If а woman says, "Of ту two chil dren, one is а girl, What's the probability that she has а sister?" Ве careful nowuriously enough, the answer to this controversial question is not а 5050 chance. There are more possibilities to consider than just the girl havi.ng а brother or а sister, We сап think of all the possible combinations of birth order of two children such that one child is а girl, Because we don't know the gender of the firstborn child, there are three gender order possibilities: girl, then Ьоу; Ьоу, then girl; and girl, then girl as shown in Figure D3(c). 50 the possibility of the daughter having а sister is 1/3 instead of 1/2! (Believe Н,) Again, the sum of those three 1/3rd probabil ity values is one. Two important features of PDFs are illustrated Ьу the examples in Figure D3: PDFs are always positive, and the areas under their curves must Ье equal to unity. The very concept of PDFs make them а positive like/ihood that а particular resu1t will оссщ and the fact that some result must occur is equivalent to saying that there's а probabi1ity of one (100% chance) that we'll have а result, For continuous probability density func tions, РИ, we indicate these two characteristics Ьу PDF va1ue are never negative: ..... p(f) ? О , (D8) and Тhe "ит of аН the PDF values is one: .....  J p(j)dJ= 1 , (D8') In 5ection D,l we illustrated how to calculate the average (mean) and variance of discrete samples, We сап also determine these statistical теа- sures for а random function if we know the PDF of the function, Using Jlf to denote the average of а random function ofJ, then, Jlfis defined as  Jlf = J!.p(f)dJ, (D9) and the variance of J is defined as [3] 
Тhe Меап and Var/ance о' Randoт Fиncf/ons 483 J Continous P(f) 1 1 ................  Ь  (a) Ь+а I .... a О Ь f Flgure D.4 Continuous, unlforт probabillty density function,   (11= f(ff)2.p(f)df= ff2.p(f)df7' (D10) In digital signal processing, we'll encounter continuous probability density functions that are uniform in value similar to the examples in Figure D-З. In these cases, it's easy to use Eqs, (D9) and (D-10) to deter minе their average and variance. Figure D4 illustrates а uniform, contin uous PDF indicating а random function whose values have an equal probability of being anywhere in the range from a to Ь. From Eq. (D-8), we know that the area under the curve must Ье unity (i.e., the probability is 100% that the value will Ье somewhere under the сшvе), 50 the аmрli- tude ofp(f) mustbe the area divided Ьу the width, orp(f) = l/(Ь + а). From Eq. (D9), the average of this p(f) is given Ьу   ! = f f. p(f)df= f f'df Ь+а ь [ 2 ] Ь = f fdf=, L Ь+а Ь+а 2 a a ь 2  а 2  2(Ь + а) (b+a)(ba) 2(Ь +а) ba 2 (D 11) which happens to Ье the midpoint in the range from a to Ь. Тhe variance of the PDF in Figure D4 is given Ьу 
484 Appendix о: Меоn, Vorionce, ond Stondord Deviotion 2  f 2 2 b f 2 1 (Ь  а)2 а f = f . p(f)df  11 f = f'  df   _  Ь+а 4 =. [ i ] b  (ba)2 ='(b3 +a3) (ba)2 Ь+а 3 a 4 3(Ь+а) 4 (Ь+а)(ь 2 ab+a2) = 3(Ь+а) ь 2 2ab+a2 4 = ь 2 +2аЬ+а 2  (ba)2 12 12 (D12) We use the results оЕ Eqs. (Dl1) and (D12) in Chapter 9 to analyze the errors induced Ьу quantization from analogto-digital converters and the effects оЕ finНе word lengths оЕ hardware registers. D.4 The Normal Probability Density Function А рrоЬаЬШtу density ЕипсНоп that's so оНеп encountered in nature deserves our attention. This function is so common that it's actually called the пorтa! probability density function,t Тhis function, whose shape is shown in Figure D-S, is important because random data having this dis- tribution is very useful in testing both software algorithms and hardware processors. The normal PDF is defined mathematically Ьу р(х) = e(XX"")' /20' . а .f2it (D-13) The area under the curve equals опе, and the percentages at the bottom оЕ Figure DS tell us that, for random functions having а поrшаl distribution, there's а 68.27 percent chance that anу particular value оЕ х wШ differ from the mеan Ьу $а. Likewise, 99.73 percent of all the х data values wШ Ье within 3а оЕ the mеan Хауе' t The пorтal probabili/y deпsity fипctioп is sometimes called the Gaussian function, А scheme for generating data 10 fit this function is discussed in Section 10,12, 
Refвrences 485 р{х) х -< Ха""  о' Хауо + о'  68.27%  95.45% 99,73% Ха"" + 3cr Ха""  3cr >   Flgure О-5 А normal PDF wlth mean = Xove and standard deviation = 0', References [1] Papoulis, А. ProЬability Random Variables, aпd Stochastic Processes, McGraw-Нill, New York, 1965, рр. 266---68. [2] МШеr, 1" and Freund, J, Probability aпd Statistics for Eпgiпeers, 2nd Ed" Prentice-Ha11, Englewood Cliffs, New Jersey, 1977, рр, 118, [3] Bendat, J" and Piersol, А. Measuremeпt aпd Ana/ysis о/ Raпdom Data, John Wileyand Sons, New York, 1972, рр. 61, 
APPENDIX Е Decibels (dB and dBm) This appendix introduces the 10garithmic function used to improve the magnitude reso1ution of frequency-domain p10ts when we eva1uate signa1 spectrums, digita1 filter magnitude responses, and window function mag- nitude responses, When we use а 10garithmic fиnction to p10t signa11ev- e1s in the frequency domain, the vertica1 axis unit of measure is decibels. Е.l Using Logarithms to Determine Relative Signal Power In discussing decibe1s, it's interesting to see how this unit of measure ev01ved, When comparing continuous (ana1og) signa11eve1s, ear1y spe- cia1ists in e1ectronic communications found it usefи1 to define а measure of the difference in powers of two signa1s, If that difference was treated as the 10garithm of а ratio of powers, it cou1d Ье used as а simp1e additive measure to determine the overall gain or 10ss of cascaded e1ectronic cir cuits, The positive 10garithms associated with system components having gain cou1d Ье added to the negative 10garithms of those components hav ing 10ss to quick1y determine the overall gain or 10ss of the system. With this in mind, the difference between two signa1 power 1eve1s (Р} and Pz), measured in be1s, was defined as the base 10 10garithm of the ratio of those powers, or Power difference = 10g10( ;: J be1s,+ (E-l) t Тhe dimensionless unit of measure bel was named in honor of Alexander Graham ВеН, 486 
Using LogQrithms to Determine Re/Qtive SignQ/ Power 487 Тhe use of Eq, (El) led to another evolutionary step because the иnа of bel was soon found to Ье inconveniently large, For example, it was dis covered that the human ear could detect audio power level differences of onetenth of а bel, Measured power differences srnaller than оnе bel were so comrnon that it led to the use of the decibel (Ьеи10), effectively mak- ing the unit of bel obsolete. Тhe decibel (dB), then, is а unit of rneasure of the relative power difference of two signals defined as Power difference = 10 .10glO(  J dB , (E2) The logarithrnic function 10 'loglO' plotted in Figure Е-1, doesn't seem too beneficial at first glance, but its application turns out to Ье very useful, Notice the large change in the function's value, when the power ratio (Pl/P2) is srnall, and the gradual change when the ratio is large. Тhe effect of this nonlinearity is to provide greater resolution when the ratio P 1 /P 2 is srnall, giving us а good way to recognize very srnall differences in the power levels of signal spectrurns, digital filter responses, and window function frequency responses. Let's dernonstrate the utility of the logarithrnic function's variable res- olution, First, rernernber that the power of аnу frequencydomain sequence representing signal rnagnitude I Х(т) I is proportional to 10'log(P1 IP 2 ), in dB 4 2 О 2 4 --6 --6 10 12 14 16 18 1,3 1,5 1,7 1,9 2,0 Р 1 /Р 2 Figure Е-l Logarithmic decibei function of Eq, (Е-2), 
488 Append/x Е: Dec/be/s (dB ond dBm) 'Х(т) I squared. For convenience, the proportionality constant is assumed to Ье one, so we say the power оЕ / Х{т) , is discrete power spectrum оЕ Х(т) = / Х(т) /2. (ЕЗ) Although equation (E3) mау not actually represent power (in watts) in the classical sense, it's the squaring operation that's important here, because it's analogous to the traditional magnitude squaring operation used to determine the power оЕ continuous signaIs. (ОЕ course, if Х(т) is complex, we сап caIculate the power spectrum sequence using I Х(т) 12 = X reaI (m)2 + X ima s<m)2,) Taking 10 times the log оЕ Eq. (E3) allows us to express а power spectrum sequence XdB(m) in dB as XdB(m) = 10' log10 ( 1 Х{т) 12) dB. (E4) Because log(x 2 ) = log(x) + log(x) = 2Iog(x), we сап eliminate the squaring operation in Eq, (Е-4) Ьу doubIing the factor оЕ 10 and represent the power spectrum sequence Ьу the expression XdB(m) = 20' log10 (1 Х(т) 1) dB , (Е-Б) Without the need for the squaring operation, Eq. (ЕБ) is а more conve nient way, than Eq. (E4), to caIculate the XdB(m) power spectrum sequence from the Х(т) sequence. Equations (Е-4) and (ЕБ), then, are the expressions used to convert а linear magnitude аxiБ to а logarithmic magnitude--squared, or power, axis measured in dB, What we most often see in the literature are normalized log magnitude spectral plots where еаф value оЕ 1 Х(т) 12 is divided Ьу the first I Х(О) 12 power value (for т = О) as , ( 1 Х(т) 12 ) ( ' Х(т) ' ) normallzedX dB (m)=10.log lO 2 =20.log lO  dB. I Х(О) I 1 Х(О) 1 (E6) Тhe division Ьу the 1 Х(О) 12 or 1 Х(О) I уaIие aIways forces the first уaIие in the normalized log magnitude sequence XdВ(т) equaI to О dB.t This makes it easy for us to compare multiple log m.agnitude spectraI plots. То illus trate, let's look at the frequencydomain representations оЕ the Hanning t Тhat's because ]ogI0( J Х(О) J / I Х(О) 1) = logloi1) = О, 
Us/ng Logar/thтs to Deterтine Re/at/ve Signa/ Power 489 and triangular window functions, The magnitudes of those frequency domain functions are plotted оп а linear scale in Figure Е-2(а) where we've arbitrarily assigned their peak values to Ье two. Comparing the two linear scale magnitude sequences, Wиanrring(т) and W triangиJar(т), we сan see some minor differences between their magnitude values, If we're interested in the power associated with the two window functions, we square the two mag- nitude functions and plot them оп а linear scale as in Figure E 2(Ь). The dif ference between the two window function's power sequences is impossible to see above the frequency of, say, т = 8 in Figure E2(b), Here's where the dB scale helps иs out, If we plot the normalized log magnitude versions of the two magnitudesquared sequences оп а logarithmic dB scale using Eq. (E6), the difference between the two functions will Ьесоте obvious, Normalization, in the case of the Hanning window, amounts to calcu lating the log magnitude sequence normalized over 1 WиanniniО) I as ( 1 WИanning(т) 12 J ( 1 WИanning(т) ' ) WH(т) = 10.10g 10 2 =20.10g lO dB. (Е-7) I Wиаnning(О) I 1 Wиаnning(О) 1 The normalized log magnitude sequences are plotted in Figure Е-2(с), We сап now clearly see the difference in the magnitudesquared window functions in Figure E2(c) as compared to the linear plots in Figure E2(b). Notice how normalization forced the peak values for both log magnitude functions in Figure E2(c) to Ье zero dB. (The dots in Figure E2 are соп- nected Ьу lines to emphasize the sidelobe features of the two log таgni- tude sequences.) Although we've shown the utility of dB plots using window function frequency responses as examples, the dB scale is equally useful when we're plotting signalpower spectrums or digital fi1ter frequency responses, We сап further demonstrate the dB scale using а simple digital fi1ter example, Let's say we're designing ап lltap highpass FIR fi1ter whose coefficients are shown in Figure E3(a). If the center coefficient h(5) is O.48, the fi1ter' s frequency magnitude response 1 H,48(т) 1 сап Ье plot ted as the white dots оп the linear scale in Figure E3(b). Should we change h(5) лот O,48 to O.5, the new frequency magnitude response I H.5(т) I woиld Ье the black dots in Figure E3(b), It's difficиlt to see much of а dif- ference between 1 HO,48(т) I and I HO.5(т) 1 оп а linear scale, If we иsed Eq. (E6) to calcиlate two normalized log magnitude sequences, they coиld Ье plotted as shown in Figure E3(c) where the filter sidelobe effects of changing h(5) from O,48 to O,5 are now easy to see. 
490 Appвnd/x Е: Dec/be/s (dB ond dBm) 2,0 1,8 1,6 1,4 1,2 (а) 1,0 0,8 0,6 0,4 0,2 О О 4,0 3,6 3,2 2,8 2.4 (Ь) 2,0 1,6 1,2 0,8 0,4 О О 10 20 O (с) --40 50 --60 70 Window function magnude responses on а linear scale   /1 WHann;ng (т)' I WtrfangUla, (т)' 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 Frequency (т) Window functlon magnltude squared responses on а linear scale 2 IWtrfangula, (т)' 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 Frequency (т) W;ndow functlon тagnltudв squarвd responses О on а normalized logarlthmlc scale (dB) о 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 Frequency (т) Flgure Е-2 Honnlng (whlte squares) ond trlongular (bIack squares) wlndow functlons In the frequency domain: (о) magnitude responses using о linear scale; (Ь) magnitude-squored responses uslng а linear scoie; (с) log magnltude responses uslng о normallzed dB scale, 
Using Logor/thms to Determine Reiotive S/gnoi Power 491 ! АА ..., ""","М., ц. 0,4 . . 0,2 o 2 5 8 Т ,.... (а) I  I I I  ,  2! 1 . 3 4 6 7 . 9 10 k ...(),4 . .... . "'(),48 ",(),б 1,2 FIR filter magnitude responses оп а linear scale 0,8 (Ь) О,б 0,4 0,2 О О 2 4 б 8 10 12 14 1б 18 20 22 24 2б 28 30 Frequency (т) 10 FIR filter magnitude responses О ..."..?....I<>9..r.i!:.:::(>". 1(';; ;;7 ш'r ."ш .............шш..шш ..0 JI '1' ," ... ..', ....., ...., .\шI.\" ...... ii . ,,",' "'"""""" \ . . ......... .... 20 (с) --30 --40 50 О 2 4 б 8 10 12 14 1б 18 20 22 24 26 28 30 Frequency (т) Flgure Е-3 FIR fllter mognltude responses: (о) FIR fllter tlme-domaln coefflcients: (Ь) magnltude responses u51ng а Ilneor scole, I Н..().48(т) I Is shown Ьу the white squores and I H..().s(m) I 15 shown Ьу the bIack squares; (с) log mognltude responses using the dB scale, 
492 Appendix Е: Dec/be/s (d8 ond d8m) Е.2 Some Useful Decibel Numbers If th.e reader finds him or herself using dB scales оп а regular basis, there are а few constants worth committing to memory. А power difference of 3 dB corresponds to а power factor of 2; that is, if the magnitude--squared ratio of two different frequency components is 2, then from Eq. (E2), power difference = 10 .10glO( т) = 10 .10glO(2) = 3.01 '" 3 dB . (E8) Likewise, if the magnitude--squared ratio of two different frequency com ponents is 1/2, then the relative power difference is 3 dB because power difference = 10 'loglO() = 10 .10g10(0.5) = 3.01 '" 3 dB , (E9) ТаЫе E 1lists several magnitude and power ratios vs. dB values worth remembering, Кеер in mind that decibels indicate on1y relative power ТаЫе Е-l Зоmе Useful Logarlthmic Relationships Мagпitиde- Magпitиde Sqиared Power Relative dB Ratio (Р/Р2) Ratio (approxiтate) Нт 1 / 2 НТ 1 10 +-- P l 1s one-tenth Р2 21 Z-2 = 1/4 --6 +-- р 1 iI one.fourth Р 2 21/2 z-1 = 1/2 3 +-- Рl iI one-half Р1 20 20 = 1 О +-- P 1 iI equa1 to Р'/. 21/2 21 =2 3 .... Рl iI twlce Р2 21 22 = 4 6 ....Рllsfоurtiш"Р2 101/2 101 = 10 10 .... Рl iI ten times Р2 101 102 = 100 20 .... р 1 iI one hundred timel Р 2 103/2 1()3 = 1000 30 +-- р 1 iI one thousand tlm" Р 2 
Abso/ute Power Using Decibe/s 493 relationships. For example, if we're told that signal А is 6 dB above signa1 В, we know that the power of signal А is four times that of signal В, and that the magnitude of signal А is twiee the magnitude of signal В. We тау not know the absolute power of signals А and В in watts, but we do know that the power ratio is Р А/ Р в = 4. Е.3 Absolute Power Using Decibels Let's diseuss another use of deeibels that the reader тау eneounter in the literature. It's eonvenient for practitioners in the electronie eommuniea tions field to measure continuous signalpower levels refereneed to а spe еШе absolute power level, In this way, they сап speak of absolute power levels in watts while taking advantage of the eonvenienee of decibels. The most eommon absolute power referenee level used is the milliwatt. For example, if Р 2 in Eq. (E2) is а referenee power level of оnе mil1iwatt, then ( Р 1 ) ( Рl in watts ) absolutepowerofP 1 =10.1og 1o  =10.1og 1o .. dBm,(E10) Р 2 1 milllwatt Тhe dBm unit of measure in Eq. (E10) is read as "dB relative to а milli watt," Тhus, if а eontinuous signal is speeified as having а power of 3 dBm, we know that the signal's absolute power level is 2 times оnе milli- watt, or 2 mil1iwatts. Likewise, а 10 dBm signal has аn absolute power of 0.1 milliwatts,t Тhe reader should take eare and not inadvertently use dB and dBm interchangeably. Тhey mеan very different things. Again, dB is а relative power level relationship, and dBm is an absolute power level in milliwatts. t Other absolute reference power levels сan Ье used, People invo!ved with highpower trans- mitters sometimes ше а sing!e watt as their reference power leve!, Their unit of power using decibels is the dBW, read as "dB re!ative to а watt," In this case, for example, 3 dBW is equa! to а 2 watt power leve!, 
I APPENDIX F I Digital Filter Terminology The first step in becoming familiar with d.igital filters is to learn to speak the language used in the filter business. Fortunately, the vocabulary оЕ digital filters corresponds very well with the mother tongue used for continuous (analog) filterso we don't have to unleam anything that we already know. This appendix is an introduction to the terminology оЕ digital filters. Allpass filter  an IIR filter whose magnitude response is unity over its entire frequency range, but whose phase response is variable. Allpass filters are typically appended in а cascade arrangement following а standard IIR filter, Hj(z), as shown in Figure F-l. х(п) OriginalllR Filter: Allpass IIR Filter: у(п)   H 1 (z) Hap(z) Combined IIR Filter: Hcomblned(Z) Flgure F-l Typlcol use of оп ollposs filter, An allpass fНter, Ha/z), сап Ье designed so that its phase response compensates for, or equalizes, the nonlinear phase response оЕ an orig inal IIR filter [lЗ]. Thus, the phase response of the combined filter, Hcombined (z), is more linear than the original Hj(z), and tbls is particu larly desirable in communications systems. In tbls context, an al1pass filter is sometimes called а phase equalizer. 494 
Allpass filterBandwidth 495 Attenuation  ап amplitude 10ss, usually measured in dB, incurred Ьу а signal after passing through а digital filter, Filter attenuation is the ratio, at а given frequency, of the signal amplitude at the output of the filter divided Ьу the signal amplitude at the input of the filter, defined as attenuation = 20 .10 g lO l ::1 ) dB , (p 1) For а given frequency, if the output amplitude of the filter is smaller than the input amplitude, the ratio in Eq. (P1) is less than опе, and the attenuation is а negative number, Бапd Reject Filter  а filter that rejects (attenuates) one frequency band and passes both а lower and а higher frequency band. Figure Р-2(а) depicts the frequency response of an ideal band reject filter. Тhis filter type is sometimes called а notch fiIter, nJ.1  I Xn J . nJ.1  ! xnJ . Band reject filler ,ввропвв Bandpass flller response ......1 ........1.. ',/2 о (а) ',/2 Frвq ',12 'o о (Ь) '0 ',12 Freq Flgure F.2 Fllter symbols and frequency responses: (а) band reJect filter; (Ь) bandpass filter, Бandраss Filter  а filter, as shown in Figure Р-2(Ь), that passes опе fre- quency band and attenuates frequencies above and below that band. Бandwidth  the frequency width of the passband of а filter. For а 10w pass filter, the bandwidth is equal to the cutoff frequency. For а band- 
496 Appвndix F: Digitoi Fiiter Terтinoiogy pass filter, the bandwidth is typically defined as the frequency differ ence between the upper and lower 3 dB points. Bessel function  а mathematical fиnction used to produce the most lin- ear phase response оЕ аН IIR filters with по consideration оЕ the fre- quency magnitude response. Specifically, filter designs based оп Bessel functions have maximal1y constant group delay. Butterworth function  а mathematical fиnction used to produce maxi- таНу flat filter magnitude responses with по consideration оЕ phase linearity or group delay variations, Filter designs based оп а Butterworth fиnction have по amp1itude ripple in either the passband or the stopband. Unfortunately, for а given filter order, Butterworth designs have the widest transition region of the most popular filter design fиnctions, Cascaded fi1ters  а filtering systeт where multiple individual filters are connected in series; that is, the output of one filter drives the input of the fol1owing filter as il1ustrated in Figures F-l and 6-38(а). Center Frequency </0>  the frequency lying at the midpoint оЕ а band pass filter. Figure F-2(b) shows thelo center frequency of а bandpass fil ter, Chebyshev function  а mathematical function used to produce pass- band or stopband ripples constrained within fixed bounds. There are families of Chebyshev fиnctions based оп the amount of ripple, such as 1 dB, 2 dB, and 3 dB of ripple, Chebyshev filters сan Ье designed to have а frequency response with ripples in the passband and flat pass bands (Chebyshev Туре 1), or flat passbands and ripples in the stop band (Chebyshev Туре П). Chebyshev filters cannot have ripples in both the passband and the stopband, Digital filters based upon Chebyshev fиnctions have steeper transition region rol1-off but more nonlinear-phase response characteristics than, say, Butterworth filters, Cutoff Frequency  the upper passband frequency for low-pass filters, and the lower passband frequency for highpass filters. А cutoff fre- quency is determined Ьу the 3 dB point of а filter magnitude response relative to а peak passband value. Figure F3 il1ustrates the Ic cutoff frequency of а lowpass filter, 
Bessel functlonElliptic funcflon 497 Frequency magnitude response (dB) о  20 Stopba"d (.Fr Freq . i о , I  Passba"d  1fa"sitlo" r , 'eglo" 'с Flgure F-3 А low-pass dlgital ftlter frequency response, The stopband relative amplltude is 20 dB, Decibels (dB)  а uлit of attenuation, or gain, used to express the relative voltage or power between two sign.als, For filters, we иве decibels to indi cate cutoff frequencies (3 dB) and stopband signallevels (20 dB) as illustrated in Figure F3, Appendix Е discusses decibels in тосе detail, Decimation fi1ter  а lowpass digital FIR filter where the output sam ple rate is less than the filter's input sample rate. As discussed in Section 7,3, to avoid aliasing problems, the output sample rate must not violate the Nyquist criterion, Digital fШеr  computational process, or algorithm., transforming а dis- crete sequence of numbers (the input) into another discrete sequence of numbers (the output) having а modified frequencydomain spec- trum. Digital filtering сап Ье in the form of а software routine operat- ing оп data stored in computer memory or сan Ье implemented with dedicated hardware, Elliptic function  а mathematical function used to produce the sharpest rolloff for а given number of fi1ter taps. However, fi1ters designed Ьу using elliptic functions, also called Cauer filters, have the poorest phase linearity of the most common IIR filter design functions, The ripple in the passband and stopband are equal with еШрtiс filters, 
498 Appendix F: Digita/ Filter Terтin%gy Envelope delay  see group delay. Filter coefficients  the set of constants, also called tap weights, used to multiply against delayed signal sample values within а digital filter structure. Digital filter design is аn exercise in determining the filter coefficients that will yield the desired filter frequency response. For аn FIR filter, Ьу definition, the filter coefficients are the impulse response of the filter, Fi1ter order  а number describing the highest exponent in the numera tor or denominator of the zdomain transfer fиnction of а digital filter. For FIR filters, there is по denominator in the transfer fиnction, and the filter order is merely the number of taps used in the filter struc ture. For IIR filters, the filter order is equal to the number of delay ele- ments in the filter structure. Generally, the larger the filter order, the better the frequency magnitude response perfonnance of the filter, Finite impulse response (FIR) fi1ter  а class of digital filters that has only zeros оп the z-plane, Тhe key implications of this are that FIR fil ters are always stable and have linear phase responses (as long as the filter's coefficients are symmetrical), For а given filter order, FIR fil ters have а тиш more gradual transition region rolloff than digital IIR filters, Frequency magnitude response  а frequencydomain description of how а filter interacts with input signals. Тhe frequency magnitude response in Figure P3 is а curve of filter attenuation (in dB) vs. frequency. Associated with а filter's magnitude response is а phase response, Group delay  the derivative of а filter's phase with respect to frequency, G = 110/11f, or the slope of а filter's Н,,(т) phase response curve, Тhe concept of group delay deserves additional explanation beyond а simple definition. For an ideal filter, the phase will Ье 1inear and the group delay would Ье constant, Group delay, whose unit of measure is time in seconds, сап also Ье thought of as the propagation time delay of the envelope of аn amp1itudemodulated signal as it passes through а digital filter. (In this context, group delay is often called eпvelope delay.) Group delay distortion occurs when signals at differ ent frequencies take different amounts of time to pass through а filter. If the group delay is denoted С, then the relationship between group delay, а 110 increment of phase, and а N increment of frequency is 
Enve/ope de/ayGroиp de/ay 49С; G '" -Lldegrees /360 '" Llra(lians /2п seconds, tJ.f tJ.f (Р-2) If we know а linear phase filter's phase shift () in degrees/Hz, or radians/Hz, we сan detennine the group delay in seconds using G. д! = G.l = G = -LldеgrееsIНz = - LlradianslHz seconds, (Р-3) 360 2п То demonstrate Eq, (P3) and illustrate the effect оЕ а nonlinear phase filter, let's assume that we've digitized а continuous wavefonn comprising four frequency components defined Ьу х( t)=sin(21t.1. t)+sin(21t.з. t) /3+sin(21t.5. t) /5+sin(21t. 7. t) /7. (P4) The x(t) input comprises the sum of lHz, 3-Hz, 5Hz, and 7-Hz sinewaves, and its discrete representation is shown in Figure Р-4(а). If we applied the discrete sequence representing хи) to the input of an ideal 4-tap linear-phase low-pass digital FIR filter with а cutoff fre quency оЕ greater than 7 Hz, and whose phase shift is -0.25 radi- ans/Hz, the filter's output sequence would Ье that shown in Figure Р-4(Ь). Because the filter's phase shift is O,25 radians/Hz, Eq, (P3) tells us that the filter's constant group delay G in seconds is G  -д radians/Hz = 0,25 = 0.04 seconds, 2п 2п (Р-5) With а constant group delay оЕ 0,04 seconds, the 1-Hz input sinewave is delayed at the filter output Ьу 0,25 radians, the 3Hz sinewave is delayed Ьу 0.75 radians, the 5Hz sinewave Ьу 1.25 radians, and the 7Hz sinewave Ьу 1.75 radians. Notice how а linear-phase (relative to frequency) filter results in an output that's merely а time shifted ver sion of the input as seen in Figure Р-4(Ь). The amoиnt оЕ time shift is the group delay оЕ 0.04 seconds, Figure P4(c), оп the other hand, shows the distorted output wavefonn if the fi1ter's phase was nonlin- ear, for whatever reason, such that the phase shift was 3.5 radians instead of the ideal1,75 radians at 7 Hz, Notice the distortion оЕ the beginning оЕ the output waveform envelope in Figure Р-4(с) сот- 
500 Appendix F: Digita/ Filter Terтin%gy (а) t Filter input 1 .. .. .1!8 .8,. ..,. .,1'. l ' I ' i ..: : I ;.. i i . '..! : I  : 1 i 1" '!!: 1\': '1 i' i i 1':\ 0,5 ,! l i r ! I : 11 i I i i : ' : I i i : :. О j l i I ! 11 i I i i! [: 1 1 1 1 : I!: I I  ". ., . . ! \ ' : . I : , I , I i I : " I I i : I '1 I  : i: : '! I : 1: 1: 11' i /1 i 1 1 ' Time ) i i 1 < ; ! ,1 . ' I ! j ! : J j i : : i ,! ! -0,5 8 \ 1 i I i I \ ( '! i 1 i 1 [! 11 i ' , ' V I. i I :io.i \, 1..:, III :,!' i.. .... .... .! -1 .. Linear phase filter output 0,5 (Ь) о "'" -0,5 0,04 sec, -1 Nonlinear phase filter output 0,5 (с) О -0,5 -1 Time Time Flgure F-4 Filter tiтe-doтain response exaтples: (а) filter /nput sequenee; (Ь) linear- phase tilter output sequenee that's tiтe shifted Ьу 0,04 seeonds, duplleating the input sequenee; (е) distorted output sequenee due to а tilter wlth а nonlinear phase, аоп is contained in the envelope of а signal that we' re passing through а filter, we'd like that filter's passband phase to Ье as Jjnear as possi Ые with respect to frequency, In other words, we'd prefer the filter's 
.,.\1'&'- Нo!f-8oпd ""'"""""h:: group delay to уату as little as possible in the passband, (А:АiIIJtAJ4'я-J .'Щ aspects of nonlinearphase filters are discussed in Section 5,8!II!"  1!fI\'gI"" Half-Band fi1ter  а type of FIR filter whose transition region is centered at one quarter of the sampling rate, or 1./ 4. Specifically, the end оЕ the passband and the beginning of the stopband are equally spaced about f/4. Due to their frequencydomain synunetry, half-band filters are often used in decimation fi1tering schemes because half of their time- domain coefficients are zero. Тhis reduces the number of necessary filter multiplications, as described in Section 5.7,       Hlghpass filter response 'ш 1 Low-pass fitter response ш1 '. /2 о (а) ',12 Freq './2 о ',12 Freq (Ь) Flgure F-5 FJlter symbols and frequency responses: (а) highpass fIIter; (Ь) lowpass fIIter, Highpass filter  а fi1ter that passes high freqиencies and attenuates low frequencies, as shown in Figиre Р-5(а). We've аН experienced а kind of highpass filtering in our living rooms. Notice what happens when we turn up the treble control (or turn down the bass control) оп our home stereo systems. Тhe audio amplifier's normally flat frequency response changes to а kind оЕ analog highpass fi1ter giving us that sharp and tiппy sound as the high-frequency components of the music are being accentuated, Impulse response  а digital fi1ter's timedomain output sequence when the input is а single иnityvalued sample (impulse) preceded and fol lowed Ьу zerovalued samples, А digita1 filter' s freqиencydomain 
502 Append/x F: Dig/ta/ Filter Terтin%gy response сап Ье calculated Ьу taking the discrete Fourier transform of the fi1ter's timedomain impulse response [4]. Infinite impulse response (IIR) filter  а class of digital filters that тау have both zeros and poles оп the z-plane, As such, IIR filters are not guaranteed to Ье stable and almost always have nonlinear phase responses, For а given filter order (number of IIR feedback taps), IIR filters have а much steeper transition region roll-off than digital FlR filters. Linear-phase filter  а filter that exhibits а constant change in phase angle (degrees) as а function of frequency, Тhe resultant filter phase plot vs. frequency is а straight line. As such, а linear-phase filter's group delay is а constant, То preserve the integrity of their informa tion-carrying signals, linear phase is an important criteria for filters иsed in communication systems. Lowpass filter  а filter that passes low frequencies and attenuates high frequencies as shown in Figure F5(b), Ву way of example, we experi ence low-pass filtering when we turn ир the bass control (or turn down the treble control) оп our home stereo systems giving us that dull, muffled sound as the lowfrequency components of the music are being intensified, Notch filter  see band reject filter, Frequency magnitude response (dB) 1" Stopband attenuation lш::1 Ш. о f ./2 Freq Flgure F-6 low-pass d\g\ta\ fl\ter frequency response show\ng passband ripp\e and stopband attenuation, 
/nfinite iтpu/se response (I/R) fi/terRe/otive ottenuation 503 Passband  the frequency range over which а fi1ter passes signal energy. Usually defined as the frequency range where the filter's frequency response is equal to or greater than з dB, as depicted in Figure F-З, Passband ripple  fluctuations, or variations, in the frequency magni- tude response within the passband of а filter, Passband ripple, теа- sured in dB, is illustrated in Figure F-б. Phase response  the difference in phase, at а particular frequency, between аn input sinewave and the output sinewave at that fre- quency, The phase response, sometimes called phase de/ay, is usu- аllу depicted Ьу а curve showing the filter's phase shift vs, frequency, Section 5.8 discusses digital filter phase response in more detail, Phase wrapping  аn artifact of arctangent software routines, used to calculate phase angles, that causes apparent phase discontinuities, When а true phase angle is in the range of 1800 to ЗБОО, some soft- ware routines automatically convert those angles to their equiva- lent positive angles in the range of 00 to + 1800. Section 5.8 illustrates an example of phase wrapping when the phase of an FIR filter is calculated. Quadrature filter  а dual-path digital filter operating оп complex signals, as shown in Figure F-7. One filter operates оп the in-phase i(n) data, and the other filter processes the quadrature-phase q(n) signal data, Quadrature filtering is normally performed with low-pass filters. Input Х(п) iXn) Cosine sequence q'(n) Sine sequence Flgure F-7 Two low-pass fi/ters used to implement quadrature filtering. 
504 Appeпd/x F: D/g/to/ Fllter Term/n%gy Relative attenuation  attenuation measured relative to the largest mag nitude value. The largest signallevel (minimum attenuation) is typi cally assigned the reference level of zero dB, as depicted in Figures F3 and F6, making all other magnitude points оп а frequencyresponse curve negative dB values. Ripple  refers to fluctuations (measured in dB) in the passband, or stop band, of а filter's frequency-response curve. Elliptic and Chebyshev based filters have equiripple characteristics in that their ripple is constant across their passbands. Вessel and Butterworth derived fil ters have по ripple in their passband responses. Ripples in the stop band response are sometimes called outofbaпd ripple. RoIIoff  а term used to describe the steepness, or sIope, of the fiIter response in the transition region from the passband to the stopband, А particular digital filter тау Ье said to have а roH-оff of 12 dB/octave, meaning that the second-octave frequency would Ье а ttenuated Ьу 24 dB, and the third-octave frequency wouId Ье atten uated Ьу 36 dB, and so оп. Shape factor  а term used to indicate the steepness of а filter's rolloff. Shape factor is normally defined as the ratio of а filter's passband width divided Ьу the passband width plus the transition region width. Тhe smaller the shape factor value, the steeper the filter's rolloff. For an ideal filter with а transition region of zero width, the shape factor is unity. The term shape factor is also used to describe analog filters. Stopband  that band of frequencies attenuated Ьу а digital filter. Figure F3 shows the stopband of а low-pass filter. Although the stopband а ttenuation in Figure F3 is 20 dB, not аН filters have stopband lobes of equal amplitude. Figure F6 shows that stopband attenuation is measured between the peak passband amplitude and the largest stop band lobe amplitude. Structure  refers to the block diagram showing how а digital filter is implemented. А recursive filter structure is one in which feedback takes place and past filter output samples are used, along with past iлрut samples, in calculating the present filter output, ПR filters are almost always implemented with recursive filter structures, А nonre cursive filter structure is one in which onIy past input samples are used in calculating the present filter output, FIR filters are almost 
References 505 always implemented with nonrecursive fi1ter structures. See Chapter 6 for examples of various digital filter structures, Тар weights  see fi1ter coefficients. Tchebyschev function  see Chebyshev. Transfer function  а mathematical expression of the ratio of the output of а digital filter divided Ьу the input of the filter, Given the transfer function, we сап determine the filter's frequency magnitude and phase responses, Transition region  the frequency range over which а filter transitions from the passband to the stopband, Figure F-З illustrates the transi- tion region of а low-pass fi1ter, The transition region is sometimes called the traпsitioп baпd. Transversal filter  in the field of digital filtering, traпsversal filter is another name for FIR fi1ters implemented with the nonrecursive structures described in Chapter 5. References [1] Rabiner, L, R" and Gold, В, The Theory and Application о/ Digita/ Signa/ Processing, Prentice-Hall, Englewood Cliffs, New Jersey, 1975, рр, 206, 273, and 288, [2] Oppenheim, А. V" and Schafer, R. W, Discrete-Tiтe Signa/ Processing, Prentice-Hall, Englewood C1iffs, New Jersey, 1989, рр, 236 and 441, [3] Laakso, Т, 1" et аl, "Splitting the Unit Оеlау," IЕЕЕ Signa/ Processing Magazine, January 1972, рр, 46. [4] Pickerd, J, "Impulse-Response Testing Lets а Single Test 00 the Work оЕ Тhousands," EDN, April27, 1995, 
I'NDEX/ [AJ Absolute value, 9 А/О converters, See Analog-to- digital (А/О) converters Addition process, 10 for соmрlех numbers, 4447 in finite impulse response fi1ters, 158---63 Aliased sinc function, 101 Aliasing, 229 in infinite impulse response fi1 ters, 25,5--.56 АН ones rectangu1ar function, 108---11, 1115 Allpass fi1ter, 494 a.Max+Мin algorithm, 400404 Amplitude, defined, 8---9 Amplitude response, discrete Fourier transform соmрlех input, 11923 real cosine input, 125 Analog, use оЕ term, 2 Analog fi1ters, use оЕ term, 253 Analog signal processing, examples оЕ,2 Analogto-digital (А/О) converters coherent sampling, 297n, 433 crest factor, 364n quantization епоrs, 357---65 testing technique, 43235 Antialiasing filters, 32 Argand diagram, 444n Attenuation defined,495 relative, 503 stopband, 189 Averaging applications, 319 coherent, 32027 exponential, 34148 filtering aspects оЕ time-domain, 34041 in finite impulse response filters, 158---63 incoherent, 32730 multiple fast Foиrier transforms, 133,3304O,42930 [IO Band-lirnited signal, 29 Bandpass design, for finite impulse response fi1ters, 191 93 Bandpass fi1ter, 495 BandpasssaD1pling,3242 spectral inversion in, 446 summary оЕ, 46 Band reject fi1ter, 495 Bandwidth, 49,5--.96 Bartlett windows, 82 Bessel functions, 189,496 Bias, 356 Bilinear transform design, оЕ infinite impulse response fi1ters, 223, 272 Binary data formats defined, 349 fixed-point, 34956 fixed-point effects оп word length, 35775 floating-point, 375....s2 fractional, 35253 hexadecimal,351 octal, 351 offset, 356 рlасе value system for, 350 precision and dynarnic range, 3557 sign-magnitude, 353 two's complement, 356, 3668 Bits defined,34950 effective number оЕ, 365 Bit reversal, fast Fourier transform input/outpиt data index, 14546 507 
508 /ndex Вlackman-Harris windows, 409 Вlackman windows, 184....s7, 409 Вlock diagrams, use оЕ, 10, 161 Вlock f1oating-point, 381....s2 Boxcar windows, 82 Bиtterfly structures, radix-2 FFТ, 154 Bиtterworth function, 496 [g Сапiеr freqиency, 34 Cascade filters, 29092, 496 Caиer filters, 497 СаиБа! systems, 225 Center freqиency, 496 Central Limit Theorem, 438---39 Chebyshev function, 496 Chebyshev windows, 87, 18791 Coefficient quantization, 28б....s7 Coefficients, for finite impulse response filters, 166 constant, 173, 498 Coherent averaging, 32027 Coherent sampling, 297n, 433 Commиtative property, 20 Complex conjиgate, 6 Complex demodulation, 297n Complex down-conversion, 297n Complex freqиency, 225 for Mth-order infinite impulse response filter, 24,5--.46 Complex inpиt, discrete Foиrier transform freqиency response to,119-23 Соmр lex numbers addition and subtraction оЕ, 4447 аррliсаНоns оЕ, 45S4 arithmetic representation оЕ, 444----46 conjиgation оЕ, 427, 448 division оЕ, 448---49 fast mиltiplication оЕ, 4l112 graphical representation оЕ, 44 inverse оЕ, 449 logarithm to the base 10 оЕ, 4Sl52 mu1tiplication оЕ, 41112, 44748 naturallogarithms оЕ, 451 negative freqиency and, 458---74 raised to а power, 450 roots оЕ, 45051 Complex plane, 460---61 Complex signals qиadrature mixing and, 47174 withoиt multiplication, 38,5--.400 Conditional stability, 236 Conjиgate/ conjиgation, 6 оЕ complex nиmbers, 427, 448 Constant-coefficient transversal finite impulse response fi1ters, 173 Constant-geometry algorithm, 154 Continиous signal processing freqиency in, 5---6 иse оЕ term, 2 Convolиtion, 20 discrete, 204----16 eqиation, 165 fast, 43,5--.36 in finite impulse response filters, 1674 theorem, 20916 in time-domain, 209 Cooley, J., 129 Cosines оЕ consecиtive ang1es, calcula- tion оЕ, 436--38 Crest factor, 364n Critical Nyquist, 28 Cиtoff freqиency, 496 [Q] Data formats binary precision/ dynamic range, 3557 defined,349 fixed-point binary, 34956 f1oating-point, 375....s2 dB, See Decibels dBm, See Decibels Deadband effects, 288 ОЕС floating-point, 378 Decibels absolиte power using, 493 defined,486,497 magnitude and power ratios, 49293 signal power determined Ьу loga- rithms, 4891 Decimation сотЬinОО with interpolation, 314----16 filters, 306, 497 
resampling Ьу, 304----9 иБе оЕ term, 304 Decimation-in-frequency algorithm, 148---53, 154 Decimation-in-time, 145, 14953 Demodulation, I/Q or Weaver, 29930l Difference equation, 221, 222 Digital filters, See Finite impulse response filters; Infinite impulse response (IIR) fiIters Digital mixing, quadrature sampling and,3013,3893 Direct Form 1 structure, 244 Direct Form 11 structure, 252 Dirich1et, Peter, 101 Dirichlet kemel, 100103 all ones, 108---11, 114 symmetrical, 105....s Discrete convolution, 204----16 Discrete Fourier transform (OFТ), 21 defined,50 equation, description оЕ, 50---63 ехаmрlе using, 54---63 frequency axis, 67---68 frequency response to соmрlех input, 11923 frequency response to real СОБinе input, 1225 inverse, 7071 leakage, 71....s0 lineari ty, 65 rnagnitudes, 66---67 processing gain, 997 purpose оЕ, 49 rectangu1ar functions, 97119 relationship оЕ fast Fourier trans form to, 13031 scalloping 10ББ, 8в....s9 shifting theorem, 68---70 single-bin frequency response to real СОБinе input, 12,5--.27 symmetry, 63---65 windows, 80....s7 zero stuffing, 8993 Discrete linear systems, 118 Discretetime expression, 4 Discrete-time Fourier transform (OТFТ), defined, 93 Discrete--time signal /ndex 50! connecting dots in, problem with, 3 ехаmрlе оЕ, 23 frequency in, 6 input and output shown, 5 use оЕ term, 2 Discrete-time waveform, methods for describing, 8 Dither sequence, 288 Division оЕ соmрlех numbers, 448---49 Do1ph-Chebyshev windows, 187 Double-memory algorithm, 15354 Down-conversion, соmрlех, 297n Downsampling, resampling Ьу, 304----9 Dynamic range fixed-point binary data format, 3557 f1oating-point, 37981 ш Effective number оЕ bits (ENOB), 365 ЕШрНс function, 497 Envelope delay, 202, 204, 498 Euler, Leonhard, 460 Euler's equation, 50,100,249,267,275, 298,463,464 Even symmetry, 64 Exponential averaging, 34148 ш Fast convolution, 43,5--.36 Fast Fourier transform (FFТ) averaging multiple, 133, 33040, 42930 calculating the inverse оЕ, using the forward, 42,5--.29 constant-geometry algorithm, 154 decimation-infrequency, 148---53, 154 decimation-in-time, 145, 14953 deve10pment оЕ, 129 double-memory algorithm, 1554 fast finite impu1se response filtering using, 43,5--.36 hints for using, 13136 in-рlасе algorithm, 153 input/output data index bit rever- Баl, 14,5--.46 interpreting results, 134----36 
5tO /ndex overf1ow errors, 36970 performing two N-point real, 41220 performing 2N-point real, 42025 radix-2 FFТ algorithm, 1345 radix-2 FFТ butterf1y structures, 1454 relationship to discrete Fourier transform, 13031 software programs, 136 Fibonacci,459 Filtering/ filters See a/so Finite impulse response (FIR) filters; Infinite impulse response (1m) filters allpass, 494 aspects оЕ time--domain averaging, 34041 background оЕ, 157 bandpass, 495 band reject, 495 cascade,29092,496 Cauer, 497 coefficients, 498 decirnation,306,497 description of process, 15758 interpolation, 310, 314 multirate, 314 nonrecursive, 158,253 notch, 495 order, 498 parallel, 29092 polyphase, 313 prototype,254 recursive, 253 strиcture, 161 time-varying, 313 transversal, 162 Finite impulse response (FIR) fi1ters averaging with, 158---63 bandpass design, 19193 coefficients, 166 convolution in, 1674 defu1.ed, 498 fast Fourier transform used for fast, 43,5--.36 5-tap, 162---63 Foиrier series design оЕ, 17,5--.91 frequency response in, 163, 181 half-band, 19798 highpass design, 1994 impulse response, 165---66 infinite impulse response fi1ters compared to, 29293 10w-pass design, 174----91 nonrecursive fi1ters, 158, 253 nonzero input values in, 158 optimal design method, 194 other names for, 158 Parks-МсСlеllan design, 194 phase response in, 199204 Remez Exchange design, 194----97 structuresimplified,43032 window design оЕ, 17,5--.91 Firstorder sampling, 35 5-tap finite impulse response filters, 162---63 Fixed-point binary data formats defined,349 effects оп word length, 35775 fractional, 35253 hexadecimal, 351 octal, 351 offset, 356 рlасе value system for, 350 precision and dynarnic range, 3557 sign-magnitude, 353 two's complement, 356 Floating-point binary data format block, 381....s2 ОЕС, 378 description of, 375....s2 dynamic range, 379....s1 fraction of, 376 hidden bit, 376 IВM,378 ШЕЕ Р754, 378 MIL-SТD 1750А, 378 overf1ow oscillations/1imit cycles and,289 Folding frequency, 28, 30 Fourier series design оЕ finite impulse response fi1ters, 17,5--.91 Fractional binary data format, 35253 Frequency 
center, 496 cutoff, 496 differences between continuous and discrete systems, 5---6 Frequency axiБ, 67---68 in Hz, 112 normalized angle variable and, 113 in radians/seconds, 113 rectangular function and, 11113 Frequency domain defined,6 listing оЕ sequences, 8 windowing in, 4079 Frequency response, 21 discrete Fourier transform, to соm- рlех input, 11923 discrete Fourier transform, to real СОБinе input, 1225 in finite impulse response filters, 163, 181 for Mth-order infinite impulse response fi1ter, 24,5--.46 for Nstage infinite impulse response filter, 251 singlbin, to real cosine input, 12,5--.27 Frequency translation sampling and, 33 without multip1ication, 38,5--.400  Gain, See Processing gain or 10ss Gaussian distribution, 325 General rectangu1ar function, 98---105 Geometric series, 99, 45,5--.57 Gibb's phenomenon, 184 Gradual underf1ow, 379 Group delay, 2012, 204, 498---500 [н] Half-band finite impulse response т- ters, 19798, 501 НаН Nyquist, 28 Hamming windows, 81, 82, 83, 84, 407...g /ndex 51 Hanning/Hann windows, 81, 82, 83, 84....s6,4079 Harmonic sampling, 33 Heaviside, 01iver, 223 Нет, 3 Hexadecimal binary data format, 351 Hidden bit, f1oating-point, 376 НiфраББ design, for finite impulse response fi1ters, 1994 Homogeneity property, 13 ш IВM f1oating-point, 378 !ЕЕЕ Р754, 378 IF sampling, 33 Imaginary numbers, development of, 460---62 Impulse invariance design, for infinite impu1se response filters, 223, 254----55 Design Method 1 ехаmрlе, 262---65 Design Method 1 steps, 2558 Design Method 2 ехаmрlе, 26,5--.72 Design Method 2 steps, 259---62 Impulse response defined, 501 for finite impulse response filters, 165---66 Incoherent averaging, 32730 Infinite impu1se response (IIR) filters, 26 aliasing, 25,5--.56 bilinear transform design, 223, 272 cascade / parallel combinations, 29092 defined, 502 Direct Form 1 structure, 244 Direct Form П structure, 252 finite impulse response fi1ters C0D1paredto,29293 impulse invariance design, 223, 254----72 Laplace transform, 2238 nonzero input values in, 22021 optirnized design, 223, 284....s6 
512 /ndex pitfalls in building, 28б....s9 reasons for using, 21920 recursive filters, 253 stnucture,22123,25154 z-transform, 238--51 In-place algorithm, 153 Input/output data index bit reversal, 14,5--.46 Integration processing gain, 93, 97, 325, 331 coherent, 334----37 incoherent, 33133 Intermodulation distortion, 18 Interpolation combined with decimation, 314----16 filter, 310, 314 resampling Ьу, 30913 Inverse discrete Fourier transform (IDFТ), 7071 Inverse fast Fourier transform, calculat- ing the, 42,5--.29 Inverse оЕ соmрlех numbers, 449 Inverse оЕ general rectangu1ar function, 11,5--.17 Inverse оЕ symmetrical rectangu1ar function, l1719 I/Q demodulation, 299301 Iterative optirnization, 284 QJ j opera tor, 460---62 ею Kaiser windows, 87, 18791 Kelvin, Lord, 50 ш Laplace transform bilateral/twosided, 225 for continuous time-domain, 224----25 description оЕ, 2230 development оЕ, 223 one--sided/causal,225 tables, 224 Laplace transform transfer function, 22930 in bilinear transform design, 27273, 280 in cascade filters, 290 in impulse invariance design Method 1, 262---65 in impulse invariance design Method 2, 265---66 in parallel filters, 290 secondorder, 233 used to determine stability and frequency response in continu ous systems, 23038 Leakage discrete Fourier transform, 71....s0 wraparound, 78--79 Least significant bit (lsb), 350 L'Hospital's ru1e, 101 Limit cycles, 288 Linear, use оЕ term, 13 Linearaveraging, 320 Linearity, discrete Fourier transform, 65 Linear-phase filter, 502 Linear time-invariant (LТI) systems, 12 analyzing, 2021 commutative property, 20 discrete, 118 ехатрlе оЕ а linear system, 14----15 ехаmрlе оЕ а non1inear system, 1,5--.18 homogeneity property, 13 time-invariant systems, 18--19 Loading factor, 361---63 Logarithms, signal power determined Ьу, 4891 Logarithms and соmрlех numbers to base 10, 45152 to base 10 using natural, 452 natural, 451 Loss, See Processing gain or 10ss Low-pass finite impulse response fi1ter design, 174----91,502 Lowpass signals, sampling, 2932 [м] Magnitude(s) approximation (vector), 400406 оЕ С (modulus оЕ С), 445 
defined,8,9 discrete Fourier transform, 66---67 Mantissa, use оЕ term, 375 Mean defined,319,477 оЕ random functions, 481 МIL--SТD 1750А floating-point, 378 Мixing соmрlех signals and quadrature, 47174 соmрlех signals without multiplication, 385...400 convolution and, 3995 cosine mixing sequence, 38991 magnitude and phase and, 395 quadrature-phase mixing sequence, 391 quadrature sampling and digital, 301--3,38993 summary оЕ, 400 Modulus оЕ С, 445 Most significant bit (msb), 350 Mth-order infinite impulse response filter frequency response for, 24,5--.46 time domain expression for, 244 z-domain expression for, 244--45 z-domain transfer expression for, 245 Multiplication оЕ соmрlех numbers, 41112, 44748 frequency translation without, 385---400 process,12 Multirate filter, 314 [ffi Negative frequency, 299, 300 соmрlех numbers and, 458---74 real signals represented Ьу, 46771 Noise, 319 definition оЕ random, 477 Non1inear system, ехаmрlе оЕ, 1,5--.18 Nonrecursive filters, 158, 253 Normal distribution, 325 оЕ random data, 438---40 Normalization, 376 Normalized angle variable, 113 /ndex 51 Normal probability density function, 484----85 Notch filters, 495 N-stage infinite impulse response filter, frequency response for, 251 Nyquist criterion, 30, 301 [Q] Octal binary data format, 351 Odd symmpetry, 64 Offset binary data format, 356 One-sided/ causal system, 225 Optimal design, for finite impulse response filters, 194 Optirnization design, for infinite impulse response filters, 223, 284....s6 Out-of-band ripple, 504 Overflow епоrs, 286, 287....s8 fast Fourier transform, 36970 fixed-point effects оп, 36,5--.70 rounding, 3775 truncation, 37073 two's complement, 356, 366---68 vector-magnitude approximation and, 404---5 Overflow oscillations, 28в....s9 Overlapped windows, 41O11 ш Parallel filters, 29092 Parks-МсСlеllan design, for finite impu1se response fi1ters, 194 Parzen windows, 82 Passband, defined, 502 Passband phase angle resolution, 2023 Passband ripple, 195, 503 Phase angle/argument оЕ С, 445 Рhзsе delay, 503 Phase equalizer, 494 Phase response defined,503 in finite impulse response fi1ters, 199204 Phase wrapping, 201, 503 Phasor outputs оЕ fast Fourier trans- form, 337 38 
514 /ndex Phasors for representing real signals, соmрlех, 462---67 Picket fence effect, 88 Рlасе value system, 350 Polyphase filters, 313 Postdetection averaging, 327 Power, signal absolute power using decibels, 493 defined, 9 10 determined Ьу 10garithms, 91 Power spectrum, 54 Predetection averaging, 320 Prewarp, 283 РroЬаЪility density function (PDF) А(О converter quantization епоrs and, 360---61 mean and variance оЕ random func- Ноns and, 481 normal, 484....s5 roиnding and, 3774 truncation and, 37071 Processing gain or 10ss dis<rete Foиrier transform, 9397 integration, 93, 97, 325, 33137 window, 83, 40911 Prototype filter, 254  Quadratic factorization formula, 234 Quadrature filter, 503 Quadrature heterodyning, 297n Quadrature mixing, соmрlех signals and, 47174 Quadrature sampling description оЕ, 297301 digital mixing and, 30l3, 38993 other names for, 297n Quantization, coefficient/ errors, 28б....s7, 292 fixed-point effects оп А/О converter, 357---65 00 Radian, negative frequency and, 460 Radix2 FFТ algorithm, derivation оЕ, 1345 Radix-2 FFТ bиtterf1y structures, 1454 Raised to а power, соmрlех numbers, 450 Random data, normally distributed, 438---40 Random functions, mean and variance оЕ, 481 Real cosine input, discrete Fourier transform frequency response to, 12325 single---bin, 12,5--.27 Real discrete Fourier transform inpиts, 63 Real numbers, graphical representation оЕ, 4444 Real sampling, 35 Real signals complex phasors for representing, 462---67 negative frequencies for represent- ing, 46771 Rectangular functions allones,108---11,1115 definition оЕ general, 98---105 forms оЕ, 97 inverse оЕ general, 11,5--.17 inverse оЕ symmetrical, 1l719 sYD1rnetrical, 10s....s Нmе and frequency axes and, 111  13 Rectangular windows, 80, 82, 83 Recursive filters, 253 Relative attenuation, 503 Remez Exchange design, for finite impulse response filters, 194----97 Replications, spectral, 2932 Resampling, 3016 applications, 303 decimation, 304----9 decimation combined with interpolation, 314----16 defined,304 interpolation, 30913 Ripples Вlackman window and, 184....s7 defined, 504 finite impulse response fi1ters and, 173 
10w-pass finite impulse response fil- ters and, 17991 out-of-band, 504 passband,195 stopband, 195 rms averaging, 327 of а sinewave, 480....s1 Roll-off, 504 Roots of соmрlех numbers, 45051 Roundoff errors, 286, 288 fixed-point effects оп, 3775 Roundoff noise, 359 ш Sample rate converter, 314 Sampling coherent, 297n, 433 digital resampling, 3016 quadrature, 297303 Sampling, periodic aliasing, 229 bandpass, 3242 10w-pass, 2932 spectral inversion in bandpass, 446 summary of bandpass, 46 translation, 33 under-, 3031, 33 Scalar averaging, 327 Scalloping 10ss, 8889 Shape factor, 504 Shark's tooth pattern, 28 Shifting theorem, discrete Fourier transform, 68---70 Shift-invariant systems, 19 Sidelobes, 74, 103 Вlackman window and, 184....s7 finite impulse response filters and, 173 10w-pass finite impulse response fil- ters and, 17991 Signal processing analog, 2 digital, 2 operational symbols, 1012 use of term, 2 Signal-to-noise ratio (SNR) /ndex 51! coherent averaging, 324----25 incoherent averaging, 32930 word length and А/О converters, 359---64 Sign-magnitude binary data format, 353 Sinc function, 774, 108---10, 123 Sines of consecutive angles, calculation of, 4338 Single-bin frequency response to real cosine input, 12,5--.27 Software programs, fast Fourier trans- form, 136 Spectral inversion in bandpass sam- pling, 446 Spectral replications, 2932 Square roots, obtaining, 400 Stability conditional, 236 Laplace transfer function and, 23038 z-transform and, 24042 Standard deviation, 320, 479 of а sinewave, 480....s1 Starburst pattem, 145 Statisticalmeasures,4779 Step response, 343 Stopband, defined, 504 Stopband attenuation, 189 Stopband ripple, 195 Structure defined, 504 Direct Form 1, 244 Direct Form 11, 252 fi1tering, 161 infinite impulse response filter, 22123, 25154 simplified finite impulse response filter, 43032 Sub-Nyquist sampling, 33 Subtraction process, 10 for соmрlех numbers, 4447 Summation process, 1O12, 32223 Symbols, in signal processing, 1012 Symmetrical rectangular function, 105....s Symmetry discrete Fourier transform, 63---65 
:1'1 О Iпавх even, 64 odd, 64 ш Тар weights, 498 Tchebyschev windows, 187 Tune delay, ztransform and, 24245 lime-domain averaging, filtering, 34041 Time domain expression for Mth-order infinite impulse response filter, 244 lime-domain signals, 5 discrete convolution in, 209 Laplace transform for continuous, 224----25 lime-invariant systems analyzing, 2021 commutative property, 20 ехатрlе of, 1819 Time-varying filters, 313 Transfer function, 2290 in bilinear transform design, 27273, 280 in cascade filters, 290 defined,505 in impulse invariance design Method 1, 26265 in impulse invariance design Method 2, 265---66 in parallel filters, 290 second-order, 233 stability and frequency response in continuous systems using, 23038 Transition region/band, 505 Translation without mиlНрliсаНоn, fre- quency, 385400 Transmultiplexing, 385 Transversal filter, 162, 505 Triangular windows, 80, 82, 83 Truncation errors, 37073 vector-magnitude approximation and, 405---6 Tukey, J" 129 Two N-point real FFТs algorithm, 41220 2Npoint real FFТs algorithm, 42025 Two's complement, 356, 366---68 ШJ Underflow, gradual, 379 Undersampling, 3031, 33 Unit circle, 239 Unit delay, 12 Unit impulse response, 20 [YJ Variance, 3l920 detined,478 of random functions, 481  Vector, use of term, 444----45 Vector averaging, 320 Vector demodulation, 297n Vector-magnitude approximation, 400406 Video averaging, 327 [yt] Warping, frequency, 2777, 278 Weaver demodulation, 299301 Weighting factor, 341, 343 Windows Bartlett, 82 Bessel functions, 189 Вlackman, 184----87, 409 ВlасkmanНапis, 409 boxcar, 82 Chebyshev, 87, 18791 discrete Fourier transform, 8087 Dolph-Chebyshev, 187 dual window functions, 40910 for finite impulse response filters, 17,5--.91 frequency domain and, 4079 Hamming,81,82,83,84,4079 Hanning/Hann, 81, 82, 83, 84----86, 4079 
Kaiser, 87, 18791 overlapped, 41O1l Parzen, 82 processing gain or 10ss, 83, 409 11 purpose of, 86 raised cosine, 82 rectangu1ar, 80, 82, 83 selection of, 86 Tchebyschev, 187 triangu1ar, 80, 82, 83 tricks for using, 40 11 Word length, defined, 350 Word length, fixed-point еНеш оп A/D converter quantization епоrs, 357---65 overflow, 370 rounding, 3775 truncation, 37073 Word length errors, infinite impulse response filters and finite, 286 Wrapping, phase, 201 /ndex 51' [I] z....<fomain expression for Mth-order infinite impulse response filter, 244--45 z....<fomain transfer expression for Mth- order infinite impulse response filter, 245 Zero-frequency IF format, 300 Zero padding, 310 Zero stuffing, discrete Fourier trans- form, 8993 z-transform background of, 238 defined,238 description of, 238---40 infinite impulse response filters and, 24251 polar form, 239 stability and, 24042 time de1ay, 24245