PREFACE XV Chapter 7 develops the standard filter realizations of canonical,direct,and cascade forms,and their implementation with linear and circular buffers.Quantization effects are briefly discussed. Chapter 8 presents three DSP application areas.The first is on digital waveform generation,with particular emphasis on wavetable generators.The second is on digital audio effects,such as flanging,chorusing,reverberation,multitap delays,and dynamics processors,such as compressors,limiters,expanders,and gates.These areas were cho- sen for their appeal to undergraduates and because they provide concrete illustrations of the use of delays,circular buffers,and filtering concepts in the context of audio signal processing. The third area is on noise reduction/signal enhancement,which is one of the most important applications of DSP and is of interest to practicing engineers and scientists who remove noise from data on a routine basis.Here,we develop the basic principles for designing noise reduction and signal enhancement filters both in the frequency and time domains.We discuss the design and circular buffer implementation of notch and comb filters for removing periodic interference,enhancing periodic signals,signal averaging, and separating the luminance and chrominance components in digital color TV systems We also discuss Savitzky-Golay filters for data smoothing and differentiation. Chapter 9 covers DFT/FFT algorithms.The first part emphasizes the issues of spec- tral analysis,frequency resolution,windowing,and leakage.The second part discusses the computational aspects of the DFT and some of its pitfalls,the difference between physical and computational frequency resolution,the FFT,and fast convolution Chapter 10 covers FIR filter design using the window method,with particular em- phasis on the Kaiser window.We also discuss the use of the Kaiser window in spectral analysis. Chapter 11 discusses IR filter design using the bilinear transformation based on Butterworth and Chebyshev filters.By way of introducing the bilinear transformation, we show how to design practical second-order digital audio parametric equalizer filters having prescribed widths,center frequencies,and gains.We also discuss the design of periodic notch and comb filters with prescribed widths. In the two filter design chapters,we have chosen to present only a few design meth- ods that are simple enough for our intended level of presentation and effective enough to be of practical use. Chapter 12 discusses interpolation,decimation,oversampling DSP systems,sample rate converters,and delta-sigma quantizers.We discuss the use of oversampling for alleviating the need for high quality analog prefilters and postfilters.We present several practical design examples of interpolation filters,including polyphase and multistage designs.We consider the design of sample rate converters and study the operation of oversampled delta-sigma quantizers by simulation.This material is too advanced for juniors but not seniors.All undergraduates,however,have a strong interest in it because of its use in digital audio systems such as CD and DAT players. The Appendix has four parts:(a)a review section on random signals;(b)a discus- sion of random number generators,including uniform,Gaussian,low frequency,and 1/f noise generators;(c)C functions for performing the complex arithmetic in the DFT routines;(d)listings of MATLAB functions
PREFACE xv Chapter 7 develops the standard filter realizations of canonical, direct, and cascade forms, and their implementation with linear and circular buffers. Quantization effects are briefly discussed. Chapter 8 presents three DSP application areas. The first is on digital waveform generation, with particular emphasis on wavetable generators. The second is on digital audio effects, such as flanging, chorusing, reverberation, multitap delays, and dynamics processors, such as compressors, limiters, expanders, and gates. These areas were chosen for their appeal to undergraduates and because they provide concrete illustrations of the use of delays, circular buffers, and filtering concepts in the context of audio signal processing. The third area is on noise reduction/signal enhancement, which is one of the most important applications of DSP and is of interest to practicing engineers and scientists who remove noise from data on a routine basis. Here, we develop the basic principles for designing noise reduction and signal enhancement filters both in the frequency and time domains. We discuss the design and circular buffer implementation of notch and comb filters for removing periodic interference, enhancing periodic signals, signal averaging, and separating the luminance and chrominance components in digital color TV systems. We also discuss Savitzky-Golay filters for data smoothing and differentiation. Chapter 9 covers DFT/FFT algorithms. The first part emphasizes the issues of spectral analysis, frequency resolution, windowing, and leakage. The second part discusses the computational aspects of the DFT and some of its pitfalls, the difference between physical and computational frequency resolution, the FFT, and fast convolution. Chapter 10 covers FIR filter design using the window method, with particular emphasis on the Kaiser window. We also discuss the use of the Kaiser window in spectral analysis. Chapter 11 discusses IIR filter design using the bilinear transformation based on Butterworth and Chebyshev filters. By way of introducing the bilinear transformation, we show how to design practical second-order digital audio parametric equalizer filters having prescribed widths, center frequencies, and gains. We also discuss the design of periodic notch and comb filters with prescribed widths. In the two filter design chapters, we have chosen to present only a few design methods that are simple enough for our intended level of presentation and effective enough to be of practical use. Chapter 12 discusses interpolation, decimation, oversampling DSP systems, sample rate converters, and delta-sigma quantizers. We discuss the use of oversampling for alleviating the need for high quality analog prefilters and postfilters. We present several practical design examples of interpolation filters, including polyphase and multistage designs. We consider the design of sample rate converters and study the operation of oversampled delta-sigma quantizers by simulation. This material is too advanced for juniors but not seniors. All undergraduates, however, have a strong interest in it because of its use in digital audio systems such as CD and DAT players. The Appendix has four parts: (a) a review section on random signals; (b) a discussion of random number generators, including uniform, Gaussian, low frequency, and 1/f noise generators; (c) C functions for performing the complex arithmetic in the DFT routines; (d) listings of MATLAB functions
xvi PREFACE Paths Several course paths are possible through the text depending on the desired level of presentation.For example,in the 14-week junior course at Rutgers we cover Sections 1.1-1.4,2.1-2.4,Chapters 3-7,Sections 8.1-8.2,Chapter 9,and Sections 10.1-10.2 and 11.1-11.4.One may omit certain of these sections and/or add others depending on the available time and student interest and background.In a second DSP course at the senior year,one may add Sections 1.5-1.7,2.5,8.3,11.5-11.6,and Chapter 12.In a graduate course,the entire text can be covered comfortably in one semester. Acknowledgments I am indebted to the many generations of students who tried earlier versions of the book and helped me refine it.In particular,I would like to thank Mr.Cem Saraydar for his thorough proofreading of the manuscript.I would like to thank my colleagues Drs.Zoran Gajic,Mark Kahrs,James Kaiser,Dino Lelic,Tom Marshall,Peter Meer,and Nader Moayeri for their feedback and encouragement.I am especially indebted to Dr.James Kaiser for enriching my classes over the past eight years with his inspiring yearly lectures on the Kaiser window.I would like to thank the book's reviewers Drs.A.V.Oppenheim,J.A. Fleming,Y-C.Jeng,W.B.Mikhael,S.J.Reeves,A.Sekey,and J.Weitzen,whose comments helped improve the book.And I would like to thank Rutgers for providing me with a sabbatical leave to finish up the project.I welcome any feedback from readers-it may be sent to orfanididece.rutgers.edu. Finally,I would like to thank my wife Monica and son John for their love,patience, encouragement,and support. Sophocles J.Orfanidis
xvi PREFACE Paths Several course paths are possible through the text depending on the desired level of presentation. For example, in the 14-week junior course at Rutgers we cover Sections 1.1–1.4, 2.1–2.4, Chapters 3–7, Sections 8.1–8.2, Chapter 9, and Sections 10.1–10.2 and 11.1–11.4. One may omit certain of these sections and/or add others depending on the available time and student interest and background. In a second DSP course at the senior year, one may add Sections 1.5–1.7, 2.5, 8.3, 11.5–11.6, and Chapter 12. In a graduate course, the entire text can be covered comfortably in one semester. Acknowledgments I am indebted to the many generations of students who tried earlier versions of the book and helped me refine it. In particular, I would like to thank Mr. Cem Saraydar for his thorough proofreading of the manuscript. I would like to thank my colleagues Drs. Zoran Gajic, Mark Kahrs, James Kaiser, Dino Lelic, Tom Marshall, Peter Meer, and Nader Moayeri for their feedback and encouragement. I am especially indebted to Dr. James Kaiser for enriching my classes over the past eight years with his inspiring yearly lectures on the Kaiser window. I would like to thank the book’s reviewers Drs. A. V. Oppenheim, J. A. Fleming, Y-C. Jenq, W. B. Mikhael, S. J. Reeves, A. Sekey, and J. Weitzen, whose comments helped improve the book. And I would like to thank Rutgers for providing me with a sabbatical leave to finish up the project. I welcome any feedback from readers—it may be sent to orfanidi@ece.rutgers.edu. Finally, I would like to thank my wife Monica and son John for their love, patience, encouragement, and support. Sophocles J. Orfanidis
1 Sampling and Reconstruction 1.1 Introduction Digital processing of analog signals proceeds in three stages: 1.The analog signal is digitized,that is,it is sampled and each sample quantized to a finite number of bits.This process is called A/D conversion. 2.The digitized samples are processed by a digital signal processor. 3.The resulting output samples may be converted back into analog form by an ana- log reconstructor (D/A conversion). A typical digital signal processing system is shown below. M 100111011 110010100 sampler 0110·* digital 1101· v and signal analog reconstructor analog quantizer digital processor digital analog input input output output The digital signal processor can be programmed to perform a variety of signal pro- cessing operations,such as filtering,spectrum estimation,and other DSP algorithms. Depending on the speed and computational requirements of the application,the digital signal processor may be realized by a general purpose computer,minicomputer,special purpose DSP chip,or other digital hardware dedicated to performing a particular signal processing task. The design and implementation of DSP algorithms will be considered in the rest of this text.In the first two chapters we discuss the two key concepts of sampling and quantization,which are prerequisites to every DSP operation. 1.2 Review of Analog Signals We begin by reviewing some pertinent topics from analog system theory.An analog signal is described by a function of time,say,x(t).The Fourier transform X(Q)of x(t) is the frequency spectrum of the signal:
1 Sampling and Reconstruction 1.1 Introduction Digital processing of analog signals proceeds in three stages: 1. The analog signal is digitized, that is, it is sampled and each sample quantized to a finite number of bits. This process is called A/D conversion. 2. The digitized samples are processed by a digital signal processor. 3. The resulting output samples may be converted back into analog form by an analog reconstructor (D/A conversion). A typical digital signal processing system is shown below. sampler and analog quantizer input 100111011 0110 ... 110010100 1101 ... analog output digital input digital output digital signal processor analog reconstructor The digital signal processor can be programmed to perform a variety of signal processing operations, such as filtering, spectrum estimation, and other DSP algorithms. Depending on the speed and computational requirements of the application, the digital signal processor may be realized by a general purpose computer, minicomputer, special purpose DSP chip, or other digital hardware dedicated to performing a particular signal processing task. The design and implementation of DSP algorithms will be considered in the rest of this text. In the first two chapters we discuss the two key concepts of sampling and quantization, which are prerequisites to every DSP operation. 1.2 Review of Analog Signals We begin by reviewing some pertinent topics from analog system theory. An analog signal is described by a function of time, say, x(t). The Fourier transform X(Ω) of x(t) is the frequency spectrum of the signal: 1
2 1.SAMPLING AND RECONSTRUCTION X(2)= x(t)e-jo dt (1.2.1) =00 where is the radian frequencyt in [radians/second].The ordinary frequency f in [Hertz]or [cycles/sec]is related to by 2=2πf (1.2.2) The physical meaning of X()is brought out by the inverse Fourier transform,which expresses the arbitrary signal x(t)as a linear superposition of sinusoids of different frequencies: x(t)= X(2)elot do (1.2.3) 2π The relative importance of each sinusoidal component is given by the quantity X(). The Laplace transform is defined by X(s)= x(t)e-st dt It reduces to the Fourier transform,Eq.(1.2.1),under the substitution s =j.The s-plane pole/zero properties of transforms provide additional insight into the nature of signals.For example,a typical exponentially decaying sinusoid of the form x(t)=e-aeu(t)=esitu(t) where s1 =-+j1,has Laplace transform Ims↑ s-plane 1 2 X(s)= s-S1 0 Res with a pole at s=s1,which lies in the left-hand s-plane.Next,consider the response of a linear system to an input signal x(t): x(t) linear M(t) system input h() output twe use the notation to denote the physical frequency in units of [radians/secl,and reserve the notation wo to denote digital frequency in [radians/samplel
2 1. SAMPLING AND RECONSTRUCTION X(Ω)= ∞ −∞ x(t)e−jΩt dt (1.2.1) where Ω is the radian frequency† in [radians/second]. The ordinary frequency f in [Hertz] or [cycles/sec] is related to Ω by Ω = 2πf (1.2.2) The physical meaning of X(Ω) is brought out by the inverse Fourier transform, which expresses the arbitrary signal x(t) as a linear superposition of sinusoids of different frequencies: x(t)= ∞ −∞ X(Ω)ejΩt dΩ 2π (1.2.3) The relative importance of each sinusoidal component is given by the quantity X(Ω). The Laplace transform is defined by X(s)= ∞ −∞ x(t)e−st dt It reduces to the Fourier transform, Eq. (1.2.1), under the substitution s = jΩ. The s-plane pole/zero properties of transforms provide additional insight into the nature of signals. For example, a typical exponentially decaying sinusoid of the form x(t)= e−α1t ejΩ1t u(t)= es1t u(t) t where s1 = −α1 + jΩ1, has Laplace transform X(s)= 1 s − s1 Im s Re s s1 jΩ1 -α1 0 s- plane with a pole at s = s1, which lies in the left-hand s-plane. Next, consider the response of a linear system to an input signal x(t): input output linear system h(t) x(t) y(t) †We use the notation Ω to denote the physical frequency in units of [radians/sec], and reserve the notation ω to denote digital frequency in [radians/sample].
1.2.REVIEW OF ANALOG SIGNALS 3 The system is characterized completely by the impulse response function h(t).The output y(t)is obtained in the time domain by convolution: y(t)= h(t-t')x(t')dt' or,in the frequency domain by multiplication: Y(2)=H(2)X(2) (1.2.4) where H()is the frequency response of the system,defined as the Fourier transform of the impulse response h(t): H(2)= h(t)e-jodt (1.2.5) The steady-state sinusoidal response of the filter,defined as its response to sinu- soidal inputs,is summarized below: 0=em or linear )=H(2)e system sinusoid in H(2) sinusoid out This figure illustrates the filtering action of linear filters,that is,a given frequency component is attenuated (or,magnified)by an amount H()by the filter.More precisely,an input sinusoid of frequency will reappear at the output modified in magnitude by a factor |H(Q)I and shifted in phase by an amount arg H(): x(t)=ejor y(t)=H(Q)eiat =H(Q)lejot+jargH() By linear superposition,if the input consists of the sum of two sinusoids of frequen- cies 1 and 2 and relative amplitudes Ai and A2. x(t)=Alelnt+A2elQzt then,after filtering,the steady-state output will be y(t)=AH(Q1)et +A2H(Q2)elozt Notice how the filter changes the relative amplitudes of the sinusoids,but not their frequencies.The filtering effect may also be seen in the frequency domain using Eq.(1.2.4), as shown below: X(2)◆ 2)◆ A2 AH21) H(2) D A3H2) 形且 21 91 92
1.2. REVIEW OF ANALOG SIGNALS 3 The system is characterized completely by the impulse response function h(t). The output y(t) is obtained in the time domain by convolution: y(t)= ∞ −∞ h(t − t )x(t ) dt or, in the frequency domain by multiplication: Y(Ω)= H(Ω)X(Ω) (1.2.4) where H(Ω) is the frequency response of the system, defined as the Fourier transform of the impulse response h(t): H(Ω)= ∞ −∞ h(t)e−jΩt dt (1.2.5) The steady-state sinusoidal response of the filter, defined as its response to sinusoidal inputs, is summarized below: sinusoid in sinusoid out linear system H(Ω) x(t) = e jΩt y(t) = H(Ω) e jΩt This figure illustrates the filtering action of linear filters, that is, a given frequency component Ω is attenuated (or, magnified) by an amount H(Ω) by the filter. More precisely, an input sinusoid of frequency Ω will reappear at the output modified in magnitude by a factor |H(Ω)| and shifted in phase by an amount arg H(Ω): x(t)= ejΩt ⇒ y(t)= H(Ω)ejΩt = |H(Ω)|ejΩt + jarg H(Ω) By linear superposition, if the input consists of the sum of two sinusoids of frequencies Ω1 and Ω2 and relative amplitudes A1 and A2, x(t)= A1ejΩ1t + A2ejΩ2t then, after filtering, the steady-state output will be y(t)= A1H(Ω1)ejΩ1t + A2H(Ω2)ejΩ2t Notice how the filter changes the relative amplitudes of the sinusoids, but not their frequencies. The filtering effect may also be seen in the frequency domain using Eq. (1.2.4), as shown below: Ω Ω Ω1 Ω2 Ω1 Ω2 A1 A2 H(Ω) X(Ω) Y(Ω) A1H(Ω1) A2H(Ω2)