signals and systems primer with matlabwp.kntu.ac.ir/dfard/ebook/sas/alexander d... · signals and...

662
SIGNALS and SYSTEMS PRIMER with MATLAB ®

Upload: others

Post on 23-Mar-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

SIGNALSandSYSTEMSPRIMERwithMATLAB®

Page 2: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

THE ELECTRICAL ENGINEERINGAND APPLIED SIGNAL PROCESSING SERIES

Edited by Alexander Poularikas

The Advanced Signal Processing Handbook: Theory and Implementation for Radar,Sonar, and Medical Imaging Real-Time Systems

Stergios Stergiopoulos

The Transform and Data Compression HandbookK.R. Rao and P.C. Yip

Handbook of Multisensor Data FusionDavid Hall and James Llinas

Handbook of Neural Network Signal ProcessingYu Hen Hu and Jenq-Neng Hwang

Handbook of Antennas in Wireless CommunicationsLal Chand Godara

Noise Reduction in Speech ApplicationsGillian M. Davis

Signal Processing NoiseVyacheslav P. Tuzlukov

Digital Signal Processing with Examples in MATLAB®Samuel Stearns

Applications in Time-Frequency Signal ProcessingAntonia Papandreou-Suppappola

The Digital Color Imaging HandbookGaurav Sharma

Pattern Recognition in Speech and Language ProcessingWu Chou and Biing-Hwang Juang

Propagation Handbook for Wireless Communication System DesignRobert K. Crane

Nonlinear Signal and Image Processing: Theory, Methods, and ApplicationsKenneth E. Barner and Gonzalo R. Arce

Smart AntennasLal Chand Godara

Mobile Internet: Enabling Technologies and ServicesApostolis K. Salkintzis and Alexander Poularikas

Soft Computing with MATLAB®Ali Zilouchian

Wireless Internet: Technologies and ApplicationsApostolis K. Salkintzis and Alexander Poularikas

Signal and Image Processing in Navigational SystemsVyacheslav P. Tuzlukov

Medical Image Analysis MethodsLena Costaridou

MIMO System Technology for Wireless CommunicationsGeorge Tsoulos

Signals and Systems Primer with MATLAB®Alexander Poularikas

Page 3: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

CRC Press is an imprint of theTaylor & Francis Group, an informa business

Boca Raton London New York

SIGNALSandSYSTEMSPRIMERwithMATLAB®

Alexander D. Poularikas

Page 4: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

CRC Press

Taylor & Francis Group

6000 Broken Sound Parkway NW, Suite 300

Boca Raton, FL 33487-2742

© 2007 by Taylor & Francis Group, LLC

CRC Press is an imprint of Taylor & Francis Group, an Informa business

No claim to original U.S. Government works

Version Date: 20130916

International Standard Book Number-13: 978-1-4200-0695-7 (eBook - PDF)

This book contains information obtained from authentic and highly regarded sources. Reasonable efforts

have been made to publish reliable data and information, but the author and publisher cannot assume

responsibility for the validity of all materials or the consequences of their use. The authors and publishers

have attempted to trace the copyright holders of all material reproduced in this publication and apologize to

copyright holders if permission to publish in this form has not been obtained. If any copyright material has

not been acknowledged please write and let us know so we may rectify in any future reprint.

Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced, transmit-

ted, or utilized in any form by any electronic, mechanical, or other means, now known or hereafter invented,

including photocopying, microfilming, and recording, or in any information storage or retrieval system,

without written permission from the publishers.

For permission to photocopy or use material electronically from this work, please access www.copyright.

com (http://www.copyright.com/) or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood

Drive, Danvers, MA 01923, 978-750-8400. CCC is a not-for-profit organization that provides licenses and

registration for a variety of users. For organizations that have been granted a photocopy license by the CCC,

a separate system of payment has been arranged.

Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and are used

only for identification and explanation without intent to infringe.

Visit the Taylor & Francis Web site at

http://www.taylorandfrancis.com

and the CRC Press Web site at

http://www.crcpress.com

Page 5: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

To our grandchildren Colton-Alexander and Thatcher-James who have given us so much pleasure and happiness and have shown

us how difficult it is to teach a time-varying, nonlinear, noncausal, and a multiple-input–multiple-output (MIMO) feedback system.

Page 6: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Preface

Signals and Systems is designed for use as a one-semester analog track, a one-semester digital track, a one-semester analog–digital track, or a two-semesteranalog–digital course.

We have included several carefully chosen examples from many fields toshow the wide applicability of the material and methods presented in thistext. The selection of examples from diverse engineering fields, as well asfrom nonengineering fields, helps to motivate and excite the student to delveinto this course with enthusiasm. It is important that the student studies andlearns the material presented, since this course is one of the most fundamentalin the electrical engineering curriculum. To illustrate this diversity, the exam-ples we include are drawn from chemical engineering, mechanical engineer-ing, biomedical engineering, process control, economics, heat transfer, andother areas. They show that systems in general possess two features: the inputsignals to the system are functions of one or more independent variables, andthe systems produce signals when excited by input signals. It is well knownthat engineers in their long careers will face problems that are not purelyelectrical engineering. They will be involved in heating problems of theirelectronic chips, the use of electromechanical elements driven by small motorsin the development of disc drives, the modeling of parts of the body whenhelping biomedical engineers, the development of edge detectors wheninvolved in pattern recognition of targets, and numerous other applications.

It is the author’s belief that a good background, first of analog signalsand systems, is necessary for the study of discrete signals and systems. It isknown that discrete signals do not exist in nature for the simple fact thattheir detection needs the use of a physical transducer. Therefore, introducingarbitrarily the signal x(n), which is derived from the continuous signal x(t)by taking its values at equal time distances T, it is difficult for the studentto understand why x(n) and x(t) are two different signals. Furthermore,unless the student is well versed and has a good knowledge of the spectrumof analog signals, he or she will have difficulties understanding the spectrumof sampled signals. Some methods to build digital filters are based on analogfilter considerations and use.

In this text we have strived to balance the modeling and presentation ofsystems and their interaction with signals, as well as the study of signals.

Page 7: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

We have tried to balance these two entities and avoid the presentation of acouple of systems, based on electrical circuits alone, for example, and thenproceed to deal only with signals and their interaction with system modelsarbitrarily given without deriving them. It is important that the student beable to create the mathematical representation of a system from the physicallaws that govern it, its physical presentation, and its underline constants.Engineers, if they want to be creative, must be able to model accurately thesystems they investigate and find their responses under many differentexcitations. This type of work is at the heart of the engineering field.

The electrical engineering field, as it was taught for a long time basedon electrical notion, has been changed considerably. For example, micro-electromechanical systems (MEMS) are part of the electrical engineeringstudy today and include mechanical systems, signal processing, mathemat-ics, solid-state physics, vibration analysis (deterministic and random), etc.The above discussion points to the fact that electrical engineering studentsmust possess a wide variety of knowledge in many fields. The engineersmust be able to build and study systems and predict results accurately. Thisbook tries to do that by introducing systems from many diverse disciplines.

In the beginning, we introduce the block diagram presentation of sys-tems, starting from the most elementary systems represented by one element,such as resistors, capacitors, mass, etc. This approach starts the student inthe right direction so that he or she builds the right foundation. During theircareer, engineers will deal with block diagram representations of compli-cated and interrelated systems and will be expected to produce the rightsolution.

In this text, by expounding and covering continuous and discrete sys-tems, we try to emphasize that some operations are done by computersoftware, and therefore we are talking about software systems. It is importantfor the student to realize that circuits, mechanical control systems, and phys-ical media and computers are the everyday compound systems found inmost of the devices in the market.

Because coverage of the different fields starts from the fundamental lawsand devices, there is an additive flexibility, and the book can be used in otherfields of engineering with equal ease. The prerequisites for this course arethe standard mathematics and engineering courses up to the junior year.

In this text, we have also introduced advanced concepts in their elemen-tary form such that students require the fundamentals of those principlesthat will become the basis for their future studies. Concepts such as corre-lation, match filtering, least squares estimation, adaptation, edge detection,etc., are skillfully introduced so that the student builds his or her knowledgeon these important signal processing procedures. Furthermore, althoughnew situations and systems are studied, we require their presentations andsolutions to use methods already introduced, such as spectra, convolution,impulse response, etc. This repetition is one of the most basic pedagogicalmethods of learning available in the field of education.

Page 8: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

The modeling of signals and systems is inherently mathematical andinvolves mathematical forms not ordinarily studied by undergraduate engi-neering majors. Therefore, to improve the student’s skills in different fieldsof needed mathematics, we have included enough mathematical material toserve in understanding the classical solution of differential and differenceequations, convolutions and correlations, Fourier transforms, z-transforms,and other important topics. For the same purpose, we have also included asappendices mathematical formulas, definitions, algebraic summations, etc.

We have introduced MATLAB functions and m-files to produce thedesired results. We have not introduced SIMULINK or any other cannedsoftware program because we feel, at this early learning stage, that thestudent should program the steps needed to find his or her answer. Withthis form of programming, the student must first understand the problem,understand the necessary steps in the digital format, find the requestedresults, and, finally, compare them with the corresponding mathematicalresults whenever they exist. Educators should refrain from canned programs.Very often, even in my graduate classes, when we learn about Fourier trans-forms and ask the students to obtain the transform of a finite signal usingcomputers, they come with plots in the frequency domain from 0 to ½,although we have emphasized in class that every finite signal has infinitespectrum. When asked what 0 to ½ means in the frequency axis, the answeris that MATLAB gave it to them in this form. In my undergraduate classes,I explain to the students the history and importance of the fast Fourier trans-form (FFT), but I require that they find the discrete Fourier transform (DFT)from the definition.

Pedagogical features

1. The book introduces all the needed mathematical background withinthe chapters; some additional material is included in the appendices.

2. There is a balance between signals and systems, and both are em-phasized equally.

3. Examples are derived from many diverse fields to emphasize thatthis course is applicable to any field as long as the systems arecharacterized by the same form of mathematical equations.

4. Key equations are boxed to emphasize their importance.5. There are examples in the text and problems. In addition, appendices

are also added in some chapters to elucidate the mathematics of thechapter.

6. We use paragraphs with the indication “Note” to emphasize the mean-ing of a concept or to improve the understanding of an operation.

7. Analog and digital signal processing and systems are presented inseparate chapters. From experience, we have found that students getconfused easily by jumping back and forth between analog and dig-ital. It may seem appropriate and even novel for an experienced

Page 9: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

person, but for a student that is meeting many of these concepts andmathematical areas for the first time, it is rather confusing.

8. We strive to repeat introduced concepts, such as convolution, correla-tion, spectra, etc., throughout the book. Repetition is the most funda-mental pedagogical learning process, and in this book we try to use it.

9. The author believes that at an early stage of an engineering student’scareer, exposure to random signals and their interaction with lineartime-invariant (LTI) systems is essential. There is nothing determin-istic in the physical world. Most students in their professional life willdeal with and study random phenomena, such as earthquake signals,electroencephalograms, thermal noise in electrical elements, noiseintroduced during the transportation of signals through differentcommunication channels, radar returns, target recognition, acousticsignals in the ocean, etc. For this reason, Chapter 13 was added.

10. It is very important that our undergraduate students come in contactwith and understand filtering processes that are adaptive and learnwhere such devices are used in practice. For this reason, we have addedChapter 14, where Wiener and least mean square (LMS) filtering areintroduced. We provide numerous examples of how these filters areused, and we expect that this will stimulate the student’s interest tocontinuously be involved in the digital signal processing discipline.

11. We introduce the fundamentals of digital sampling and the effect ithas on the spectrum.

12. At the end of each chapter we summarize the new definitions andconcepts that were introduced in the chapter.

13. The material is introduced in a concise format but is elucidated by alarge number of examples.

14. The book has been arranged in such a way that it can be used for aone- or two-semester course. Furthermore, the track can be analog,digital, or analog–digital.

The text consists of 14 chapters. Chapter 1 introduces both analog anddigital signal presentation. It also introduces the presentation of signals bya complete set of orthogonal signals.

Chapter 2 introduces linear and time-invariant continuous-time systems.In addition, the chapter covers convolution and impulse response of suchsystems.

Chapter 3 introduces discrete-type systems and their solution. It alsodiscusses how to simulate analog systems using discrete methods.

Chapter 4 presents the analysis of periodic signals in Fourier series, theamplitude and phase spectra of these signals, as well as the effect that lineartime-invariant systems have on them.

Chapter 5 develops the Fourier transform and its great utility in identify-ing systems, studying the spectra of signals as well as the influence thatsystems have on these spectra, known as filtering of signals. The Gibbs’ phe-nomenon is also introduced, along with its significance in the study of signals.

Page 10: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 6 introduces the sampling theorem and the importance of signalbandwidth in the aliasing problem.

Chapter 7 introduces the discrete-time Fourier transform and the discreteFourier transform. With examples, this chapter gives a clear understandingof the effects of decreasing the sampling time and padding with zeros thesequences on the spectra of discrete signals.

Chapter 8 presents in some detail the Laplace transform and its useful-ness in solving differential equations, identifying analog systems, and pro-ducing transfer functions of systems, as well as its use in feedback controlof systems. The Bode plots are also introduced.

Chapter 9 presents the z-transform and its applications in solving dif-ference equations, developing the transfer functions of discrete systems, andfinding the frequency response of discrete systems.

Chapter 10 brings forth the analog filter design. Specifically, it introducesthe Butterworth and Chebyshev filter, and finally, it introduces the designof analog filters with the use of MATLAB functions.

Chapter 11 introduces the digital filter, known as the finite impulseresponse or the nonrecursive filter.

Chapter 12 introduces the infinite impulse response digital filter and itsuse for filtering discrete signals.

Chapter 13 develops the fundamentals of random variables and theiruse for finding the spectrums of stationary processes’ random sequences.This chapter introduces the Wiener–Kinthcin relation and the nonparametricspectral estimation.

Chapter 14 characterizes different types of filtering and their uses. Par-ticularly, it introduces the use of Wiener filtering and least mean squaresfiltering. It presents several examples with applications to noise elimination,system identification, and channel equalization.

The following are some suggestions in using the text.

One-semester course: Analog and digital signal processingChapter 1: 1.1 1.3Chapter 2: 2.1 2.7Chapter 3: 3.1 3.4Chapter 5: 5.1 5.3Chapter 6: 6.1 6.2Chapter 7: 7.5 7.6Chapter 8: 8.1 8.3Chapter 10: 10.1 10.5Chapter 11: 11.1 11.3

One-semester course: Analog signal processingChapter 1: 1.1 1.3Chapter 2: 2.1 2.7Chapter 4: 4.1 4.4Chapter 5: 5.1 5.2

Page 11: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 6: 6.1 6.2Chapter 8: 8.1 8.7Chapter 10: 10.1 10.6

One-semester course: Discrete signal processingChapter 1: 1.1 1.3Chapter 3: 3.1 3.3Chapter 5: 5.1 5.2Chapter 6Chapter 7: 7.5 7.6Chapter 11: 11.1 11.3Chapter 13

Two-semester courseAll the chapters could be covered, including the starred chapters andsections. Some sections may be skipped at the discretion of theinstructor. The starred sections may be skipped without loss ofcontinuity.

The author acknowledges the valuable and helpful comments of Profes-sor Nicolaos Karayiannis of the University of Houston. The author is indebtedto Dr. Haluk Ogmen, department chair, and Dr. Raymond Flumerfelt, deanof the College of Engineering, who provided an excellent academic andresearch environment at the University of Houston.

MATLAB® is a registered trademark of The MathWorks, Inc. For productinformation, please contact:

The MathWorks, Inc.3 Apple Hill DriveNatick, MA 01760-2098 USATel: 508-647-7000Fax: 508-647-7001E-mail: [email protected]: www.mathworks.com

Page 12: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

The Author

Alexander D. Poularikas received his Ph.D. from the University of Arkansasand became professor at the University of Rhode Island. He became chair-man of the Engineering Department at the University of Denver and thenbecame chairman of the Electrical and Computer Engineering Departmentat the University of Alabama in Huntsville. He has published six books andhas edited two. Dr. Poularikas served as editor-in-chief of the Signal Pro-cessing series (1993–1997) with Artech House and is now editor-in-chief ofthe Electrical Engineering and Applied Signal Processing series, as well asthe Engineering and Science Primers series (1998–present) with Taylor &Francis. He was a Fulbright scholar, is a lifelong senior member of IEEE, andis a member of Tau Beta Pi, Sigma Nu, and Sigma Pi. In 1990 and 1996, hereceived the Outstanding Educator Award of IEEE, Huntsville Section.

Page 13: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Abbreviations

A/D Analog-to-digital conversionAM Amplitude modulationAR AutoregressiveARMA Autoregressive moving averagecdf Cumulative density functiondB DecibelDFT Discrete Fourier transformDSBSC Double-sideband suppressed carrierDTFT Discrete-time Fourier transformFFT Fast Fourier transformFIR Finite impulse responseFM Frequency modulationGHz GigahertzIDTFT Inverse discrete-time Fourier transformIFFT Inverse fast Fourier transformiid Independent and identically distributedIIR Infinite impulse responseILT Inverse Laplace transformKCL Kirchhoff current lawKVL Kirchhoff voltage lawLMS Least mean squaresLT Laplace transformLTI Linear time invariantMMSE Minimum mean square errorMSE Mean square errorNLMS Normalized least mean squaresPAM Pulse amplitude modulationpdf Probability random functionPID Proportional integral differential controllerROC Region of convergencerv Random variableSFG Signal flow graphSSB Single sidebandWGN White GaussianWN White noiseWSS Wide-sense stationary

Page 14: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Contents

Chapter 1 Signals and their functional representation ..............................11.1 Some applications involving signals .........................................................11.2 Fundamental representation of simple time signals ..............................3

Periodic discrete-time signals .....................................................................6Nonperiodic continuous signals ................................................................7

Unit step function .............................................................................7Rectangular pulse function..............................................................8Sinc function ......................................................................................9

Nonperiodic special discrete signals .......................................................10Delta function ..................................................................................10

Comb function.............................................................................................13Arbitrary sampled function ......................................................................13

1.3 Signal conditioning and manipulation ...................................................14Modulation ..................................................................................................14Shifting and flipping ..................................................................................14Time scaling .................................................................................................15Windowing of signals ................................................................................17

*1.4 Representation of signals...........................................................................18Important definitions and concepts...................................................................25Chapter 1 Problems ..............................................................................................26Appendix 1.1: Elementary matrix algebra........................................................33Appendix 1.2: Complex numbers ......................................................................36Appendix 1.1 Problems........................................................................................38Appendix 1.2 Problems........................................................................................39

Chapter 2 Linear continuous-time systems.................................................412.1 Properties of systems .................................................................................412.2 Modeling simple continuous systems.....................................................43

Electrical elements ......................................................................................43Capacitor...........................................................................................43Inductor.............................................................................................45Resistor..............................................................................................47

Mechanical translation elements..............................................................48Ideal mass element..........................................................................48Spring ................................................................................................48Damper .............................................................................................49

Page 15: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Mechanical rotational elements................................................................50Inertial elements ..............................................................................50Spring ................................................................................................51Damper .............................................................................................52

2.3 Solutions of first-order systems................................................................52Zero-input and zero-state solution ..........................................................54Standard solution techniques of differential equations .......................56

2.4 Evaluation of integration constants: initial conditions ........................63Switching of sources...................................................................................64Conservation of charge..............................................................................64Conservation of flux linkages...................................................................64Circuit behavior of L and C......................................................................65General switching.......................................................................................65

2.5 Block diagram representation...................................................................682.6 Convolution and correlation of continuous-time signals ....................71

Matched filters.............................................................................................83Correlation ...................................................................................................84

2.7 Impulse response ........................................................................................86Important definitions and concepts...................................................................96Chapter 2 Problems ..............................................................................................97

Chapter 3 Discrete systems........................................................................... 1113.1 Discrete systems and equations ............................................................. 1113.2 Digital simulation of analog systems.................................................... 118

*3.3 Digital simulation of higher-order differential equations .................1313.4 Convolution of discrete-time signals.....................................................135

Important definitions and concepts.................................................................141Chapter 3 Problems ............................................................................................142Appendix 3.1: Method of variation of parameters .......................................149Appendix 3.2: Euler’s approximation for differential equations................152

Chapter 4 Periodic continuous signals and their spectrums.................1574.1 Complex functions....................................................................................157

Continuous-time signals..........................................................................158Discrete-time signals ................................................................................160

4.2 Fourier series of continuous functions..................................................161Fourier series in complex exponential form ........................................162Fourier series in trigonometric form .....................................................165

4.3 Features of periodic continuous functions ...........................................169Parseval’s formula ....................................................................................169Symmetric functions.................................................................................170

Even function.................................................................................172Odd function..................................................................................172

*Finite signals ............................................................................................172*Convolution..............................................................................................173

Page 16: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

4.4 Linear systems with periodic inputs.....................................................174Important definitions and concepts.................................................................180Chapter 4 Problems ............................................................................................181

Chapter 5 Nonperiodic signals and their Fourier transform ................1895.1 Direct and inverse Fourier transform ...................................................190

Real functions............................................................................................194Real and even functions ..........................................................................195Real and odd functions............................................................................196

5.2 Properties of Fourier transforms............................................................196Linearity .....................................................................................................196Symmetry ...................................................................................................196Time shifting..............................................................................................199Scaling.........................................................................................................200Central ordinate ........................................................................................200Frequency shifting ....................................................................................202Modulation ................................................................................................202Derivatives .................................................................................................208Parseval’s theorem....................................................................................213Time convolution ......................................................................................216Frequency convolution ............................................................................217Summary of continuous-time Fourier properties ...............................218

*5.3 Some special Fourier transform pairs ...................................................220*5.4 Effects of truncation and Gibbs’ phenomenon....................................225*5.5 Linear time-invariant filters ....................................................................226

Distortionless filter ...................................................................................228Ideal low-pass filter..................................................................................229Ideal high-pass filter.................................................................................230

Important definitions and concepts.................................................................231Chapter 5 Problems ............................................................................................231Appendix 5.1 .......................................................................................................237

Chapter 6 Sampling of continuous signals ...............................................2396.1 Fundamentals of sampling......................................................................2396.2 The sampling theorem .............................................................................244

Construction of analog signal from its sampled values ....................252Important definitions and concepts.................................................................253Chapter 6 Problems ............................................................................................254

Chapter 7 Discrete-time transforms............................................................2577.1 Discrete-time Fourier transform (DTFT)...............................................257

Approximating the Fourier transform ..................................................2577.2 Summary of DTFT properties ................................................................2607.3 DTFT of finite time sequences................................................................262

Windowing ................................................................................................266

Page 17: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

7.4 Frequency response of linear time-invariant (LTI) discrete systems........................................................................................................268

7.5 The discrete Fourier transform (DFT) ...................................................2697.6 Summary of the DFT properties ............................................................271

*7.7 Multirate digital signal processing ........................................................284Down sampling (or decimation) ............................................................284Frequency domain of down-sampled signals......................................286Interpolation (up sampling) by a factor U ...........................................291Frequency domain characterization of up-sampled signals..............292

Important definitions and concepts.................................................................295Chapter 7 Problems ............................................................................................295Appendix 7.1: Proofs of the DTFT properties................................................298Appendix 7.2: Proofs of DFT properties.........................................................300Appendix 7.3: Fast Fourier transform (FFT) ..................................................304

Chapter 8 Laplace transform ........................................................................3098.1 One-sided Laplace transform .................................................................3098.2 Summary of the Laplace transform properties ...................................3128.3 Systems analysis: transfer functions of LTI systems ..........................3168.4 Inverse Laplace transform (ILT).............................................................328

MATLAB function residue ..........................................................3298.5 Problem solving with Laplace transform .............................................3368.6 Frequency response of LTI systems.......................................................3528.7 Pole location and the stability of LTI systems.....................................361

Simple-order poles....................................................................................361Multiple-order poles.................................................................................363

*8.8 Feedback for linear systems....................................................................365Cascade stabilization of systems............................................................365Parallel composition.................................................................................366Feedback stabilization..............................................................................367Sensitivity in feedback .............................................................................368Rejection of disturbance using feedback ..............................................369Step response.............................................................................................370Proportional controllers ...........................................................................371Proportional integral differential (PID) controllers.............................375

*8.9 Bode plots ..................................................................................................377Bode plots of constants............................................................................377Bode diagram for differentiator .............................................................378Bode diagram for an integrator .............................................................379Bode diagram for a real pole..................................................................379

Important definitions and concepts.................................................................383Chapter 8 Problems ............................................................................................383Appendix 8.1: Proofs of Laplace transform properties ................................397

Page 18: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 9 The z-transform, difference equations, and discrete systems .........................................................................................................401

9.1 The z-transform.........................................................................................4019.2 Convergence of the z-transform.............................................................4059.3 Properties of the z-transform..................................................................412

Summary of z-transform properties......................................................4139.4 z-Transform pairs......................................................................................4239.5 Inverse z-transform ..................................................................................4239.6 Transfer function.......................................................................................431

*Higher-order transfer functions............................................................4379.7 Frequency response of first-order discrete systems............................438

Phase shift in discrete systems ...............................................................443*9.8 Frequency response of higher-order digital systems..........................4439.9 z-Transform solution of first-order difference equations...................447

*9.10 Higher-order difference equations.........................................................450Method of undetermined coefficients ...................................................454

Important definitions and concepts.................................................................459Chapter 9 Problems ............................................................................................459*Appendix 9.1: Proofs of the z-transform properties ...................................473

Chapter 10 Analog filter design...................................................................47710.1 General aspects of filters .........................................................................47710.2 Butterworth filter ......................................................................................47910.3 Chebyshev low-pass filter .......................................................................48610.4 Phase characteristics.................................................................................49410.5 Frequency transformations .....................................................................494

Low-pass-to-low-pass transformation...................................................494Low-pass-to-high-pass transformation .................................................495Low-pass-to-band-pass transformation ................................................495Low-pass-to-band-stop transformation.................................................498

10.6 Analog filter design using MATLAB functions...................................500Butterworth filter design .........................................................................500

Important definitions and concepts.................................................................501Chapter 10 Problems ..........................................................................................501

Chapter 11 Finite Impulse Response (FIR) filters....................................50511.1 Properties of FIR filters............................................................................505

Causality.....................................................................................................505Frequency normalization.........................................................................505Phase consideration..................................................................................506Scaling the digital transfer function ......................................................507Symmetric FIR low-pass filters ..............................................................508

11.2 FIR filters using the Fourier series approach.......................................509

Page 19: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

11.3 FIR filters using windows .......................................................................513Windows ....................................................................................................513High-pass FIR filters ................................................................................515Band-pass FIR filters ................................................................................516Band-stop FIR filters ................................................................................516

*11.4 Prescribed filter specifications using a Kaiser window .....................51911.5 MATLAB FIR filter design ......................................................................522

Low-pass FIR filter ...................................................................................522High-pass FIR filter ..................................................................................522Band-pass FIR filter ..................................................................................522Band-stop FIR filter ..................................................................................523Window use...............................................................................................523

Important definitions and concepts.................................................................523Chapter 11 Problems ..........................................................................................523

Chapter 12 Infinite Impulse Response (IIR) filters .................................52512.1 The impulse-invariant method approximation in the time domain ..52512.2 Bilinear transformation............................................................................53212.3 Frequency transformation for digital filters.........................................538

Low-pass-to-low-pass transformation...................................................538Low-pass-to-high-pass transformation .................................................539Low-pass-to-band-pass transformation ................................................540Low-pass-to-band-pass transformation ................................................542

12.4 Recursive versus non-recursive design.................................................542Important defintions and concepts........................................................543

Chapter 12 Problems ..........................................................................................543

Chapter 13 Random variables, sequences, and power spectra densities .......................................................................................................545

13.1 Random signals and distributions.........................................................545Stationary and ergodic processes...........................................................548

13.2 Averages .....................................................................................................548Mean value ................................................................................................548Correlation .................................................................................................549Covariance .................................................................................................553Independent and uncorrelated rv’s .......................................................553

13.3 Stationary processes .................................................................................554Autocorrelation matrix ............................................................................554Purely random process (white noise, WN) ..........................................557Random walk (RW)..................................................................................557

13.4 Special random signals and probability density functions ...............557White noise ................................................................................................557Gaussian processes ...................................................................................558

Algorithm to produce normalized Gaussian distribution .....558

Page 20: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Lognormal distribution............................................................................559Algorithm to produce lognormal distribution.........................559

Chi-square distribution............................................................................56013.5 Wiener–Kintchin relations .......................................................................56013.6 Filtering random processes .....................................................................562

Spectral factorization................................................................................565Autoregressive process (AR) ..................................................................565

13.7 Nonparametric spectra estimation.........................................................568Periodogram ..............................................................................................568Correlogram...............................................................................................568Computation of Sp(ej ) and Sc(ej ) using FFT ....................................568General remarks on the periodogram...................................................570Blackman–Tukey (BT) method ...............................................................570Bartlett method .........................................................................................572Welch method............................................................................................573Modified Welch method ..........................................................................575The Blackman–Tukey periodogram with the Bartlett window ........577

Important definitions and concepts.................................................................578Chapter 13 Problems ..........................................................................................579

*Chapter 14 Least square system design, Wiener filter, and the LMS filter .....................................................................................................583

14.1 The least-squares technique ....................................................................583Linear least squares ..................................................................................587

14.2 The mean square error.............................................................................590The Wiener filter .......................................................................................591The Wiener solution .................................................................................594Orthogonality condition ..........................................................................597

14.3 Wiener filtering examples .......................................................................597Minimum mean square error (MMSE) .................................................602Optimum filter (wo) ..................................................................................603

14.4 The least mean square (LMS) algorithm ..............................................608The LMS algorithm ..................................................................................609

14.5 Examples using the LMS algorithm ......................................................614Important definitions and concepts.................................................................623Chapter 14 Problems ..........................................................................................623

Appendix A Mathematical formulas ..........................................................627A.1 Trigonometric identities...........................................................................627A.2 Orthigonality .............................................................................................629A.3 Summation of trigonometric forms .......................................................629A.4 Summation formulas................................................................................630

Finite summation formulas.....................................................................630Infinite summation formulas ..................................................................630

A.5 Series expansions ......................................................................................631

Page 21: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

A.6 Logarithms ................................................................................................631A.7 Some definite integrals............................................................................632

Appendix B Suggestions and explanations for MATLAB use..............633B.1 Creating a directory.................................................................................633B.2 Help............................................................................................................633B.3 Save and load ...........................................................................................634B.4 MATLAB as calculator ............................................................................634B.5 Variable names .........................................................................................634B.6 Complex numbers....................................................................................634B.7 Array indexing .........................................................................................635B.8 Extracting and inserting numbers in arrays........................................635B.9 Vectorization .............................................................................................635B.10 Matrices .....................................................................................................636B.11 Produce a periodic function...................................................................636B.12 Script files ..................................................................................................636

Script file pexp.m ..........................................................................637B.13 Functions ...................................................................................................637B.14 Subplots .....................................................................................................638B.15 Figures........................................................................................................638B.16 Changing the scales of the axes of a figure.........................................639B.17 Writing Greek letters ...............................................................................639B.18 Subscripts and superscripts ...................................................................640B.19 Lines in plots ............................................................................................640

Index .....................................................................................................................641

Page 22: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

1

chapter 1

Signals and their functional representation

In this chapter we will learn about signals, how to represent them in theirmathematical form, how to manipulate them to create new ones, and, finally,why it is necessary to study them.

1.1 Some applications involving signalsElectrical engineers, as well as engineers from other disciplines, are con-cerned with the detection of signals, their analysis, their processing, andtheir manipulation. They are interested in the signal amplitude, time dura-tion, and shape. Electrical engineers are concerned with detecting radarpulses returned from targets that are hidden in noise. Mechanical engineersare interested in signals that engines emit to detect any change that maysuggest engine trouble. Bioengineers are interested in biological signals suchas electrocardiograms (EKGs), brain signals, etc. Economists are interestedin how stock market signals, import–export signals, and the gross nationalproduct (GDP) are changing, as well as many other economic signals, so thatthey can predict how the economy will change in the future.

The most fundamental instrument that is associated with the detectionof signals is the transducer. All of us are aware of our eye–brain combinationtransducer that detects two-dimensional signals (images). Our ear is anothertransducer that detects air pressure variations, and the result is an acousticsignal, such as a song. Since all the transducers found in nature and thosewe build, such as voltage and current transducers, which are made up ofresistors, inductors, and capacitors, cannot respond instantaneously to theabrupt excitation, the signals the transducers produce are continuous. Weare basically living in an analog world.

Since the early 1950s, when the computer appeared, it became obviousthat by describing the signals in their discrete form, it is possible to processthe signals quickly and accurately, without the need to build elaborate andlarge analog systems. To create discrete-time signals, we use an electronic

Page 23: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

2 Signals and systems primer with MATLAB

instrument called analog-to-digital (A/D) converter. Since the discrete sig-nals take all the values within a range, we further process them and assignonly one value if their values fall within a prespecified range; for example,if we split the range between 0 and 2 and assign the value 0 to any discretesignal of values between 0 and 0.5, the value 1 if its value falls between 0.5and 1.5, and the value 2 if the value falls between 1.5 and 2.0. This processwill produce the digital signals, and in this particular case, any discretesignal with values between 0 and 2.0 will be represented by a digital signalhaving three levels only. In the present text, we will primarily study thediscrete-type signals.

Ordinarily, signals cannot be transmitted over long distances directly asproduced. They must be modified or conditioned, usually “riding” onanother signal for their transmission. This type of modification is known asmodulation of signals. For example, if we want to transmit speech, whosemean frequency is 3000 Hz (cycles per second), using an antenna, we knowfrom our course in electromagnetics that c = f , where c is the speed of light,3 × 108 m/s, and f = 3000 Hz in this example. Hence, the wavelength of the3000-Hz sine signal is = 3 × 108/3000 = 105 m, or about 60 miles. Commu-nication engineers tell us that an efficient antenna must have a length in therange of ½ or ¼ of the wavelength. It is the practical considerations thatforce us to modify the signals to be sent. At other times, we may translatea particular signal into a completely different form. The use of smoke signalsby Indian tribes is an example of coding signals for transmission throughspace. Most of us are familiar with the Morse code as a means of transformingletters and numbers into dots and dashes.

Present-day engineers have gone further in studying signals and havebeen able to establish a quantitative description and measure of the infor-mation contained in a signal. To develop their theory, they created a concep-tual model communication system, as shown in Figure 1.1.1. To simplify thediscussion, let us consider a person who is transmitting a message as aninformation source. The output of the information source is called a

Figure 1.1.1 General communication system.

Information

sourceTransmitter Channel Receiver Destination

Noise

and

distortion

Telephone Wires, space Telephone

Message to be

transmitted

Transmitted

signal

Received

signal

Received

message

Page 24: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 1: Signals and their functional representation 3

massage — it is what the person is saying. The transmitter is an apparatusthat transforms the message into a form that allows it to be transmitted. Atelephone handset that converts the acoustic message into a varying electricalcurrent in the telephone line is such a transmitter. The communication chan-nel is the medium over which the message is transmitted. The wires betweentwo telephone receivers and the space between two microwave towers con-stitute two different types of channels.

Because of the properties of the elements making up the communicationsystem, distortion often occurs. Distortion is an operation effect of the systemon the signal, whereas noise involves unpredictable perturbations (varia-tions) of the signal. Clearly, to be useful, the output of the channel, which isthe receiving signal, must resemble to some extent the original signal. Forexample, the received message is what we hear in the telephone receiver.The destination is the final element of a communication system. It can be aperson or an apparatus, depending on the original intent of the system.

1.2 Fundamental representation of simple time signalsThe most fundamental periodic continuous-time signal that we will encoun-ter in our studies is the trigonometric sine function shown in Figure 1.2.1.

Figure 1.2.1 The sine function.

35 30 25 20 15 5 –5 –10 –2

–1.5

–0.5

0.5

1.5

2

0

–1

1

0 10

t (s)

/

2 sin y =

2 s

in (

0.1

t –

0.2

)

= Phase (rad)

f = Frequency = 1/T (Hz)

= 2 f = Angular frequency (rad/s)

Amplitude = 2

(s) Period T = 2 /

Page 25: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

4 Signals and systems primer with MATLAB

For plotting the sine signal we used the specific function s(t) = 2sin(0.1 t –0.2 ). The reason for the importance of this waveform is that any periodicsignal can be approximated by the sum of sine and cosine functions. Theidea of adding sine and cosine functions in describing general periodicfunctions dates back to the time of the Babylonians, who used ideas of thistype in their prediction of astronomical events. In the 18th century, Euler’sobservation that the vibrating strings produce sinusoidal motion was fol-lowed half a century later by the work of Jean Baptiste Joseph Fourier. Fourierclaimed that any periodic signal could be represented by an infinite sum ofsine and cosine functions, each one with different amplitude and each func-tion having a different, although integrally related, frequency. This represen-tation feature is also true for nonperiodic functions, but with the differencethat the frequencies constitute a continuum. The amplitude and phase ofthese sinusoidal waves are known as the amplitude and phase spectra. Thisparticular matter will be studied in detail in later chapters.

Sometimes, eliminating some of the frequencies that make up a com-plicated signal, known as filtering, causes signal distortion and, sometimes,produces undesirable effects. An example familiar to us occurs in our tele-phone conversations. Telephone companies transmit many different voicesover the same telephone line in the interest of making optimum use of thetransmission lines. To optimize this number for the cable wire used, they areforced to limit the maximum frequency, the bandwidth, of each voice channelto 4000 Hz (cycles/s). Because of this bandwidth limitation, there are timeswhen we do not recognize the speaker, although he or she is a familiarperson. Bandwidth is also important when we want to purchase an amplifierfor our hi-fi system. The sales person will defend the price by telling us thatthe particular model under consideration has a flat frequency responseextending from about 100 to 14,000 Hz. What the person is telling us is thatthis amplifier will reproduce any instrument in an orchestra without anyloss in the quality of sound. Essentially, the amplifier will reproduce theamplitude of all the frequencies within the indicated range. However, dis-tortion may occur due to phase changes. Filtering is the most fundamentalprocess that engineers, most importantly electrical engineers, will beinvolved with during their career.

The sine wave is a periodic continuous function. Any function f(t) isperiodic with period T if

(1.1)

Note: The above equation tells us that if we identify any particular time t, wefind the value of the function to be equal to f(t). If we next go to the time valuest + T or t – T, the value of the function is the same as that which we found previously.By repeating this process for all t, we obtain the periodic signal.

Figure 1.2.2 shows two periodic functions. If we had plotted a longerrange of time, we would have observed the periodicity in Figure 1.2.2b.

f t nT f t n( ) ( ) , , ,± = = ± ±0 1 2 �

Page 26: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 1: Signals and their functional representation 5

In general, signals are real functions of time since they denote the resultsof physical phenomena. However, for mathematical convenience, it is veryuseful to present sinusoidal functions as components of complex-valuedfunctions of time called complex signals. An important complex signal isthe exponential function ej t. If we use the Maclaurin series expansionexp(x) = 1 + (x/1!) + (x2/2!) + (x3/3!) + … and substitute j for x, we obtain

(1.2)

Figure 1.2.2 (a) A general periodic signal. (b) f(t) = sin(2 440t) (A note ···); f(t) =sin(2 494t) (B note –·–); f(t) = sin(2 659t) (E note –––); (average sum ——).

T/4 –T/4 3T/4 5T/4 –3T/4 t (s)

1

f(t)

T

–5T/4

(a)

0.8

0.6

0.4

0.2

0

–0.2

–0.4

–0.6

–0.8

–1 0 1 2 3 4 5 6 7 8

1

t (ms)

(b)

e j tj t j t

n

t

j tn

= + + + +

= +

12

12

2

2

( )!

( )!

( )!

(

ttj t

t t)!

( )!

( )!

4 3 5

4 3 5+ +� �

Page 27: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

6 Signals and systems primer with MATLAB

The expansions in (1.2) are cos( t) and sin( t), respectively. Hence, (1.2)becomes

(1.3)

If we set –j for j in the above equation, we find the relation

(1.4)

Combining (1.3) and (1.4), we obtain Euler equations

(1.5)

Observe from (1.3) that we can also write

(1.6)

where Re and Im denote the words real part of and imaginary part of,respectively. Note that the imaginary part is also real. The reader shouldrefer to Appendix 2 of this chapter to learn more on complex numbers.

Periodic discrete-time signals

Our ability to convert continuous signals into equivalent discrete signals isextremely important and will be studied in detail in later chapters. Theconversion is extremely important since we are obligated to use computersto process every signal today. Here, we will examine certain features oftypical discrete signals. To create a discrete sine wave, we keep the valuesof the function at distances nTs, where Ts is the sampling time, 1/Ts is thesampling frequency in Hz, and 2 /Ts = s is the sampling frequency in rad/s.Therefore, if we set t = nTs, where n is a set of integers, we obtain the sampledsine function

(1.7)

If we substitute with + (2 /Ts) in (1.7), we find that

(1.8)

e t j tj t = +cos sin

e t j tj t = cos sin

cos , sinte e

te e

j

j t j t j t j t

= + =2 2

cos Re{ }, sin Im{ }t e t ej t j t= =

f nT T ns s( ) sin=

f nTT

nT T nss

s s( ) sin sin(= + = +22 nn T ns) sin=

Page 28: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 1: Signals and their functional representation 7

Note: The above equation shows that a sampled periodic signal is periodic withperiod 2 /Ts.

The frequency /Ts is called the fold-over frequency. The frequency Ts

has units of radians and is known as the discrete frequency. If this distinctionis not obvious from the context in the development, we will explicitly statethe units of the frequency present. Figure 1.2.3 presents two typical discretesignals.

Nonperiodic continuous signals

This section introduces the reader to a number of special functions for describ-ing particular classes of signals. Many of these functions have features thatmake them particularly useful directly or indirectly in describing other func-tions in the solution of engineering problems. At this point, little more thana catalog of these signals and their mathematical description is presented.

Unit step functionThe unit step function u(t) is an important signal for analytic studies; more-over, it has many practical applications. When we switch on a constantvoltage source (battery) across a circuit, the source is modeled by a unit stepfunction. Likewise, when a constant force is applied to a body at a particulartime, the mathematical modeling of such a force is accomplished by usinga unit step function.

The unit step function is defined by the relation

(1.9)

Note: To plot a unit step function, we introduce values for t, and if the numberin parentheses is 0 or positive, we set the value of the function equal to 1, and if thevalue is negative, we set the value of the function equal to 0.

Figure 1.2.3 Typical discrete periodic signal.

n n

sin

(0

.2πn

)

–1

1

0

0

0.5

–0.5

5 10 15 64

......

20–20

0.5

1

1.5

f(n

)

(a) (b)

u tt

tor u t a

t a

t a( ) ( )=

<=

<

1 0

0 0

1

0

Page 29: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

8 Signals and systems primer with MATLAB

The step function of height a and its shifted forms are shown in Figure1.2.4.

Rectangular pulse functionThe pulse function is the result of an on–off switching operation of a constantvoltage source to an electric circuit. This waveform has considerable practicalutility. For example, its narrow pulses are used to modulate the transmittersin radar equipment, and it is the waveshape of the recurring timing signals(clock pulses) that controls the total operation of any digital computer.

A rectangular pulse function of height b and its shifted form are shownin Figure 1.2.5. Its mathematical form is developed from the appropriatechoice of step functions. Hence, the just-mentioned pulse functions are spec-ified by

(1.10)

Note: The representation of the pulse function by pa(t) is not a mathematicalfunction. In calculations we must use the representation with the appropriate stepfunctions. The definition pa(t) means the following: when t takes a value such thatthe factor inside the parentheses becomes zero, the pulse is centered at that timevalue and the width of the pulse is equal to a in either side of its center.

Figure 1.2.4 The step function and some of its shifted and reflected forms.

Figure 1.2.5 Rectangular pulse function.

a

au(t)

t

au(t – b)

a

tb

t

–a–a

b

–au(t – b)

bt

–au(b – t)

p t u t a u t at a

t a

p t t

a

a

( ) [ ( ) ( )]

( )

= + =>

<

0

1

0 == + =>

<[ ( ) ( )]u t t a u t t a

t t a

t t a0 0

0

0

0

1

–a a t

b

bpa(t)

t0 tt0 + at0 – a

b

bpa(t – t0)

Page 30: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 1: Signals and their functional representation 9

Sinc functionThis function plays an important role in the reconstruction of special signals.We will talk more about this function in the section discussing the samplingof continuous functions and their reconstruction. As a function of , it alsorepresents the frequency content of the pulse function, as we will learn in alater chapter. The sinc function is defined by the expression

(1.11)

This function is shown in Figure 1.2.6 for three different values of a.

Note: If we try to plot the sinc function, we find that at point t = 0 the fractionbecomes 0/0, which is an undefined number. To obtain the limit, we use the L’Hopitalrule, which says: Take the derivative of the numerator with respect to t and set t = 0in the new function. Next, take the derivative of the denominator with respect to tand set t = 0 in the new function.

The following MATLAB program was used to plot Figure 1.2.6:

t=-12:0.05:12;%this creates a vector with values of t from -12 %to 12 in steps of 0.05

s1=sin(0.5*t+eps)./(t+eps);%eps is a small number and is used %to avoid warnings from%MATLAB that a division with zero is present; the period%in the numerator tells MATLAB to divide element by%element the two vectors (numerator and denominator);

s2=sin(t+eps)./(t+eps);

s3=sin(2.5*t+eps)./(t+eps);

s1(241)=0.5;%MATLAB gives always 1 for the form %of any sinc function, hence we %must substitute the 0/0

Figure 1.2.6 Sinc function for three different values of a.

3

2

1

0

–1

sin

(at

)/t

a = 2.5

a = 1a = 0.5

–15 –10 –5 0 5 10 15

t(s)

sin ( )sin

c tat

tta = < <

Page 31: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

10 Signals and systems primer with MATLAB

s3(241)=2.5;%undifined number by its exact values;

subplot(2,1,1);plot(t,s1,'k')%'k' makes the curves black;

hold on;plot(t,s2,'k')

hold on;plot(1,s3,'k')

xlabel('t (s)');ylabel('sin(at)/t');

Nonperiodic special discrete signals

Delta functionThe delta function (t), often called the impulse or Dirac delta function,occupies a central place in signal analysis. Many physical entities, such aspoint sources, point charges, concentrated loads on structures, and voltagesor current sources acting for very short times, can be modeled as deltafunctions. The delta function, not a regular function, has very peculiar prop-erties, and it is defined as follows:

(1.12)

Note: Equation (1.12) indicates that the delta function exists only at one point,in this case at t0. At that point the argument is 0, and hence, the value of t thatmakes the argument 0 is the position of the delta function. If f(t) = 1 for all t, thenthe integral of the delta function is equal to 1. This indicates that the area underthe delta function is 1. Furthermore, (1.12) indicates that the result of integrationof the product of a regular function with a delta function is equal to the value ofthe function at the point the delta function is located. Hence, we do not integratewhen a delta function is involved, but we simply insert in the rest of the functionsof the integrand the value of the independent variable t at which the delta is located.

Several delta functions are shown in Figure 1.2.7a. The height of thespikes shown denotes the area of the delta function. Figure 1.2.7b illustratesgraphically the second equation of (1.12). Note that the delta function is notpresented in a functional form, but is presented by its behavior under theintegral sign. Despite the fact that the delta function is not an analytic one(regular function), a rigorous mathematical formulation was given by Lau-rent Schwartz in his work on the theory of generalized functions.

( )

( ) ( ) ( )

t t t t

f t t t dt f t t tt

t

=

= < <

0 0

0 0 1 0

0

1

2

tt

t t dt f t t t tt

t

2

0 1 0 2

1

2

1 1( ) ( ) ,= = < <

Page 32: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 1: Signals and their functional representation 11

To see how the delta function can be created, consider that a current ofvery short duration and amplitude 1/ is applied to the circuit shown inFigure 1.2.8c. From the well-known expression for the voltage across thecapacitor,

Figure 1.2.7 (a) Representation of several delta functions. (b) Illustration of the effectof multiplying a well-behaved function and a delta function.

Figure 1.2.8 Voltage on a capacitor due to an impulse current source.

–t1

1 0.5 (t + t1)

–1

t2

− (t − t2)

2

t3

2 (t – t3)

t

f(t0)

tt0

f(t)

f(t0) = −

f(t) (t − t0)dt

(a) (b)

1/

2/

4/

/2/4t

i(t)

(a)

1

v(t)

/2/4t

(b)

(c)

C v(t) System

+

i(t) i(t) v(t)

v tC

i dt

( ) ( )= 1

0

Page 33: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

12 Signals and systems primer with MATLAB

we obtain for C = 1 F,

In this example, the area under the function will always be equal to unityfor any 0, and it will be zero everywhere else except at t = 0, where itis undefined. Observe further in this particular example, which involves theintegral of the delta function, that in the limit, as 0, the current functionwill produce a step voltage of 1 V in the circuit. It is a general result that theintegral of the delta function produces a step function. Therefore, the inversemathematical operation to integration, the derivative, will produce a deltafunction at the point the unit step function changes from zero to one.

Despite its special properties, the importance of the delta function willbecome apparent when we study the response of linear systems (those withlinear elements) to an arbitrary input. We will learn that if we know theoutput of a linear and time-invariant system (a system composed of elementsthat do not vary with time and are linear) to a delta function input, we canuse this knowledge to find the output of the system to an input that is anywell-behaved function. A well-behaved function is one that may have a finitenumber of discontinuities of finite amplitude on a finite interval and hasfinite derivatives at both sides of each discontinuity.

Example 1.2.1: Find the velocity of a free body with mass M on a fric-tionless surface when a unit impulse function force is applied at t = 0.

Solution: Using the Newton force law f(t) = Ma(t) = M dv(t)/dt, we find

(1.13)

This result indicates that the velocity is a step function: it is zero at t =0– and assumes the value 1/M for times . We also conclude that thederivative of the unit amplitude step function is equal to the delta function(t). This conclusion is the converse property made above. We also know

that the derivative of a definite integral is equal to the integrand. We maywrite, in general,

(1.14)

v t dt dt dt( )/ /

= = = =1 2 41

0 0

2

0

4

v tM

f t dtM

t dtM

tt t

( ) ( ) ( )= = = >1 1 10

0 0

t +0

du t tdt

t t( )

( )=00

Page 34: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 1: Signals and their functional representation 13

Comb function

The comb function is an array of delta functions that are spaced T units apartand extend in the range – < t < . The function is illustrated in Figure 1.2.9;its mathematical description is

(1.15)

Arbitrary sampled function

The comb function can be used in the presentation of any continuous func-tion in its sampled or discrete form. The property of the delta functionpermits us to write (integrate each side of the expressions)

(1.16)

Therefore,

(1.17)

where fs(t) denotes the sampled version of the function f(t). Figure 1.2.10ashows graphically the function f(t), combT (t), and fs(t). Figure 1.2.10b displaysoperationally the process of combining f(t) and combT(t). We shall show in alater chapter that the sampled function has no relation to the function it wasproduced from by the process of sampling. However, we shall present spe-cific conditions under which we shall be able to recover the original signalfrom its sampled version.

Figure 1.2.9 The comb function.

0 T 2T 3Tt

1

–T–2T

combT(t)

⋅⋅⋅⋅⋅⋅

comb t t nTT

n

( ) ( )==

f t t f t

f t t a f a t a

( ) ( ) ( ) ( )

( ) ( ) ( ) ( )

=

=

0

f t f t comb t f nT t nTs T

n

( ) ( ) ( ) ( ) ( )= ==

Page 35: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

14 Signals and systems primer with MATLAB

1.3 Signal conditioning and manipulationModulation

In communications it is desirable to transmit slow varying signals over longdistances as it is done the amplitude modulation (AM) radio stations. If weassume that the slowest frequency is 1000 Hz, the wavelength of this radiosignal is = 3 × 108/1000 = 300 km. Since an efficient antenna must have alength of about 1/2 of the wavelength of the transmitting signal, it is imprac-tical to build a 150-km antenna. To circumvent this problem, one often resortsto amplitude modulation, which requires the multiplication of the signalwith a high-frequency sinusoidal signal, e.g., cos( ct), known as the carrier.The frequency used for the AM carrier ranges from 80 to 120 kHz. Figure1.3.1 shows the signal to be transmitted and the modulated signal that istransmitted from the antenna.

Shifting and flipping

Figure 1.3.2 shows the exponential function and two shifted positions. Figure1.3.3 shows the same function in its sampled form. Figure 1.3.4 shows a finiteramp function, its shifted, and its flipped positions.

Figure 1.2.10 (a) Representation of the discrete form of an arbitrary function. (b) Rep-resentation of the operational form.

1.5

1

0.5

0

f s(t

)

1.5

1

1

0.8

0.6

0.4

0.2

0

0.5

0–1 0 1 –1 0 1 –1 0 1

f(t)

com

bT

(t)

nT, T = 0.2t nT, T = 0.2

(a)

×f (t)

combT (t)

fs(t)

(b)

Page 36: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 1: Signals and their functional representation 15

Time scaling

The compression or expansion of a signal is known as time scaling. Let usassume that the original signal is

Figure 1.3.1 Illustration of the usefulness of modulation.

Figure 1.3.2 Illustration of the shifting of functions.

×

Multiplier

Power amplifier

Antenna

cos ct

2fc = Carrier frequency =

t (s)

210–1

–0.5

0

0.5

1

3

g(t) = f(t) cos ( ct)

1

0.8

0.6

0.4

0.2

0 0 1 2 3

t (s)

c

f(t) = exp(–t)u(t)

1

0.8

0.6

0.4

0.2

0 0 2 4

t

f(t) = exp(–t)u(t) 1

0.8

0.6

0.4

0.2

0 0 5

t

f(t) = exp(–(t – 2))u(t – 2) 1

0.8

0.6

0.4

0.2

0 –2 0 2

t

f(t) = exp(–(t + 1))u(t + 1)

2

Page 37: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

16 Signals and systems primer with MATLAB

(1.18)

If we are asked to find the function f(2.5t), we first insert the value 2.5tfor each t in the above equation and then rewrite the time range inequalitiesas shown below

(1.19)

(1.20)

Figure 1.3.3 Illustration of the shifting of discrete functions.

Figure 1.3.4 Finite ramp function with its shifted and flipped forms.

1

0.8

0.6

0.4

0.2

0

1

0.8

0.6

0.4

0.2

00 42 0 4 62

f(nT) = exp(–nT), T = 0.2 f(nT) = exp(–(nT – 2))u(nT – 2)

1

0.8

0.6

0.4

0.2

0

f(nT) = exp(–(nT + 1))u(nT + 1)

t t

–2 20

t

2 5

f(t)

t

f(t + 3)

–1 2 t –2 –5 t

f(–t)

f t

t t

t t( )

( )=

+ 1 1 0

12

2 0 2

f t

t t

t t( . )

. .

( . ) .2 5

2 5 1 1 2 5 0

12

2 5 2 0 2 5 2=

+

f tt t

t t

( . ).

.

( . ).

2 52 5 1

12 5

0

12

2 5 2 02

2 5

=+

Page 38: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 1: Signals and their functional representation 17

The functions f(t) and f(2.5t) are shown in Figure 1.3.5. Note that usingthe multiplier 2.5 > 1 the function f(2.5t) is compressed. If, on the other hand,we used a multiplier less than 1, the function would have been expanded.

Windowing of signals

One important signal processing operation is the windowing of signals. Thisoperation is necessary in practical cases when computations are required.For example, when the Fourier transform (the spectrum of the signal) mustbe found using computers (we will discuss this integration in a later chapter),it is not possible to use the infinite length of a signal, for example. Toaccomplish the integration, we must terminate the function at some timelength. This is equivalent to multiplying the original signal with a rectangu-lar function, known as window. It turns out that the rectangular window isnot satisfactory for accurately finding the Fourier transform of a signal.Therefore, many other types of windows were suggested, and the mostimportant ones are given below:

Figure 1.3.5 Illustration of the scaling property.

Windows w(t)First Sidelobe

Level (dB)

1. Rectangular window: –13.3

2. Triangular (Bartlett): –26.5

3. Hanning: –31.5

4. Hamming: –42.7

5. Blackman: –58.1

f(t)

–1 2

1

t

1

f(2.5t)

–0.4 0.8 t

w

Tt

T

rect =1

2 2

0 otherwise

w tt

TT t Ttr ( ) = 1

w tT

tT

hn

tT

( ) . cos= +0 5 12 2

2

w tt

T

Tt

Thm( ) . . cos= +0 54 0 46

2

2 2

w tt

T

t

Tbl( ) . . cos . cos= + +0 42 0 52

0 082 T

tT

2 2

Page 39: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

18 Signals and systems primer with MATLAB

*1.4 Representation of signalsIn the previous sections, it was noted that we presented the signals usingmathematical forms. Another approach, and sometimes very important forsignal manipulation and processing, is to represent the signal by a combi-nation of elementary functions called basis functions. For example, theexponential function and the cosine and sine functions are basisfunctions. The principal reason in employing basis functions is that mathe-matical operations may be performed easier; also, a better understanding ofthe system behavior is possible using such presentation.

Because systems are usually described by mathematical operators, it isevident that the output of the system is the result of the operator operatingon the input signal f(t). However, many mathematical operations, such asintegration, are difficult to perform unless the function f(t) possesses certainspecial properties. One approach is to find a suitable set of basis functions

such that the function f(t) is constructed by using a linear combinationof these functions. Since we are dealing with linear systems, it is relativelyeasy to determine the system output because it is the result of the systemoperator operating on each basis function and adding these effects, an appli-cation of the superposition principle.

In order to understand better the use of basis functions, we shall recallthe use of vectors in vector spaces. Let ai (i = 1, 2, 3), known as the basisset, and denote the three orthogonal unit vectors along the Cartesian coor-dinate axis (see Figure 1.4.1). An arbitrary vector F can be expressed in theform

(1.21)

where Fi’s are projections of the vector F on each coordinate axis. Taking intoconsideration the orthogonality of the basis vector set ai, we have the relation

(1.22)

where i,j is the angle between the two vectors. This mathematical operationis known as the dot product of vectors. Dot multiply (1.21) by ai and takeinto consideration the orthogonality property of the basis vectors to find theith component of the vector F

(1.23)

exp( )j t

{ ( )}i t

F = a + a + a = a1 2 3 iF F F Fi

i

1 2 3

1

3

=

a ai j· cos ,= ==

a ai j

i ji j i j

1

0

Fi = F aa a

i

i i

i

i

Page 40: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 1: Signals and their functional representation 19

where Fi is the projection of the vector F on the ai axis. Since any three-dimensional vector F can be represented as a linear combination of the threebasis orthogonal unit vectors, the system is complete — that is, F is containedin the space spanned by the basis vectors {ai}. On the other hand, athree-dimensional vector F cannot be represented as a linear combination ofonly two orthogonal vectors a1 and a2. Therefore, the two-dimensionalorthogonal set is incomplete to represent three-dimensional vectors, and thebasis set does not span the space containing F.

Our next step is to project the above ideas to functions. We first needfunctions that are orthogonal. However, functions are not vectors, and there-fore, we must find another analogous way. It is known that when we multiplytwo cosine functions, e.g., cos( t) and cos(2 t), and integrate from 0 to 1, weobtain zero value. However, by integrating over the same range the functioncos2( t) we obtain 1/2. Mathematicians tell us that there are several otherfunctions that may become basis functions over some interval t = a to t = b,and thus, we can express an arbitrary function f(t) as a linear sum of thesebasis functions. If we proceed analogously from the three-dimensional vectorspace, we may set the equivalent identities: . Hence,(1.21) assumes the equivalent form

(1.24)

Figure 1.4.1 Three-dimensional vector space with its basis set.

F1

F3

a1

F

a2

a3

F2

i i it c F( ) � �ai and

f t c ti i

i

( ) ( )==1

Page 41: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

20 Signals and systems primer with MATLAB

Multiply (1.24) by if the i’s are complex functions (theasterisk means complex conjugate function — the functions with all complexcomponents replaced by their negative values) and integrate over the rangeof definition [a, b] of f(t). The result is

(1.25)

or

from which it follows that

(1.26)

where

(1.27)

is called the norm of the function i and is a real number. Equations (1.25)to (1.27) are the result of assumed orthogonality property over the intervalt = a to t = b:

(1.28)

If the norm is equal to 1, the basis functions are called orthonormal. One ofthe conditions to analyze functions as a linear combination of basis functionsis that both must be absolutely and square integrable, that is, they mustobey the relations

j jt dt t( ) ( )* or by

f t t dt c t t dta

b

j i i j

a

b

i

( ) ( ) ( ) ( )==1

f t t dt c t dt ci i i i

a

b

a

b

( ) ( ) ( )i = =2 2

c

f t t dt

t dt

f t t dt

i

i

a

b

i

a

b

i

a

b

= =

( ) ( )

( )

( ) ( )

2 i

i2 1 2 3= , , ,�

i i

a

b

t dt= 2

1 2

( )

/

i j

a

bi

t t dti j

i j( ) ( ) =

=2

0

Page 42: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 1: Signals and their functional representation 21

(1.29)

including the case when the interval [a, b] = (– , ).

Example 1.4.1: Show that the set of functions f(t) = [1, cos t, cos 2t, …,cos nt, …} constitutes orthogonal basis functions over the interval [0, ].

Solution: From the relations

we observe that this set constitutes basis functions on the interval 0 t .The basis functions will become orthonormal if each one is multiplied by

. �

The trigonometric function cosn 0t (similarly, sinn 0t) is one of the mostimportant basis functions and one that we will use frequently in our studyof linear systems. The complex representation of these functions is

(1.30)

since Re{exp(jn 0t)} = Re{cosn 0t + j sinn 0t} = cosn 0t; Im{exp(jn 0t)} =sinn 0t. These expressions form the basis for the Fourier series expansionof periodic functions. We will study this matter in more detail in a laterchapter. The main reason for learning about basis functions is that they arethe eigenfunctions of linear time-invariant (LTI) systems.

A linear time-invariant (LTI) system is one that when its input is shifted,its output is also shifted. In addition, superposition applies to LTI systems,which means that the output of a system to multiple inputs is the sum ofthe outputs due to each component of the input. Hence, an eigenfunctioninput to LTI system results in an output that is equal to the input multipliedby a complex constant. If the input is a sinusoidal, the output is a sinusoidalhaving the same frequency, with the only difference that its amplitude maybe changed and an additional phase is added. These ideas and results will bediscussed in more detail in the next chapter.

Orthogonal functions are also important in detection theory. Suppose,for example, that we send four messages corresponding to four orthogonalfunctions 1, 2, 3, and 4, respectively. If we construct a receiver havingthe properties shown in Figure 1.4.2, we observe that each channel willrespond only when the incoming signal is equal to the input signal of the

f t dt f t dta

b

a

b

( ) ( )< <and 2

1 0 000

2cos ; cos cos ; cosnt dt nt mt dt m n nt dt= = ==2

0

2

njn tt e n( ) , , ,= = ± ±0 0 1 2 �

Page 43: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

22 Signals and systems primer with MATLAB

channel. Because of the orthogonality property of the functions, the remain-ing channels will not produce an output.

Example 1.4.2: Given below is some of the complete set of orthonormalfunctions in the range –1 t 1, known as Legendre polynomial functions.

Find the value of the integral

using the two different approximating functions given below. These func-tions try to approximate the parabolic function f(t) = t2 in the range from –1to 1.

a.

b.

Figure 1.4.2 Detection scheme using orthogonal functions.

×

×

×

×

2

0

i = 1

i 1

i (t) i = 1, 2, 3, 4

1(t)

2(t)

3(t)

4(t)

∫ab

i 1dt

∫ab

i 2dt

∫ab

i 3dt

∫ab

i 4dt

1

2

0

i = 2

i 2

2

2

0

i = 3

i 3

3

2

0

i = 4

i 4

4

0 1 221 2 3 2 1 2 5 2 3 1( ) , ( ) / , ( ) ( / ) / ( ),t t t t t= = = 33

31 2 7 2 5 3

( )

( / ) / ( )

t

t t=

I t f t dta= =mean square error 12

2 2

1

1

[ ( )]

f t c t c ta( ) ( ) ( )= +0 0 1 1

f t c t c t c ta( ) ( ) ( ) ( )= + +0 0 1 1 2 2

Page 44: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 1: Signals and their functional representation 23

Solution: To begin with, we must first find the coefficients ci so that thefunction fa(t) approximates f(t) = t2 in the range –1 t 1. Using (1.26), we find

Therefore, the first order approximating function is Using thisfunction, the mean square error I is 0.1080. For the case b, following the sameprocedure we find that c2 = and so fa(t) = (1/3)(3t2 – 1). Forthis case, the mean square error I is 0.0191.

From these results, we observe that the mean square error (MSE), whichis an indicator of how close the approximation function is to the givenfunction, decreases as we add more and more members from the basis set.It can be shown that if we use a complete set of orthogonal functions, theMSE will approach zero as the number of terms approaches infinity. �

Another approach is to approximate the function by polynomials. Theuse of a polynomial for curve fitting can never be mathematically exactunless the function f(t) is a polynomial. However, in suitable circumstances,it can be as accurate as the tabulated values that are available.

Suppose that the function f(t) is approximated by the polynomial

(1.31)

It is assumed that the function is known (collocates) at N + 1 points withvalues f(t0), f(t1), …, f(tN), where t0 < t1 < t2 … < tN. Equation (1.31) leads tothe set of equations

(1.32)

This set of equations can be solved for the unknown coefficients ai. This isconveniently done by writing this set of equations in matrix form:

ct dt

dtc

t t0

2

1

1

2

1

1 1

2

1

1

1 2

1 2

23

3 2=

( )( )

= =,/ ddt

t dt[ ]=

1

123 2

0/

f ta( ) .= 2 3/

2 10 15/ , ( )2 3/ +

f t a ta nn

n

N

( ) ==0

a a t a t a t f t

a a t a t

NN

0 1 0 2 02

0 0

0 1 1 2 12

+ + + + =

+ + + +

( )

aa t f t

a a t a t a t f t

NN

N N N NN

N

1 1

0 1 22

=

+ + + + =

( )

( )

Page 45: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

24 Signals and systems primer with MATLAB

(1.33)

or, more compactly,

(1.34)

where T, A, and F denote matrices in (1.33). Using matrix methods as givenbelow, we find for A the expression

(1.35)

where T–1 is the matrix inverse of T, which involves a procedure discussedin Appendix 1.1.

Example 1.4.3: Find a three-term polynomial approximation for thefunction

over the interval .

Solution: If we arbitrarily select the three points at t0 = –1, t1 = 0, and t2 = 1in a three-term expansion, as given by (1.31), the resulting set of equations is

Solving this set of equations, we obtain the coefficients a0 = 1, a1 = 0, and a2 =–1. The approximating function is fa(t) = 1 – t2, which is a circle. A betterapproximation is possible by using more terms in the polynomial expansion.However, we can also use MATLAB in the form:

1

1

1

0 02

0

1 12

0

2

t t t

t t t

t t t

N

N

N N NN

=

a

a

a

f t

f t

fN

0

1

0

1

� �

( )

( )

(( )tN

TA = F

A = T F-1

f t t( ) cos=2

1 1t

f a a a a a a

f

a

a

( ) ( ) ( ) ( )= + + = + =1 1 1 1 000

11

22

0 1 2

(( ) ( ) ( ) ( )

( )

0 0 0 0 0 0 1

1

00

11

22

0 1 2= + + = + + =a a a a a a

fa == + + = + + =a a a a a a00

11

21

0 1 21 1 1 0( ) ( ) ( )

Page 46: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 1: Signals and their functional representation 25

a=inv(T)*F;%inv(.) is a MATLAB function which finds the inverse %of a matrix;

%a is a vector containing the values 1,0 and -1.

The reader should refer to Appendix 1 of this chapter to read more aboutmatrices and to find out about MATLAB functions to manipulate matrices.

Important definitions and concepts

1. Basic signal characteristics: amplitude, time duration, and shape2. The transducer3. Analog and discrete-time signals4. Modulation of a signal5. The communication channel6. The amplitude and phase spectra of signals7. The bandwidth of a signal8. How to verify that a signal is periodic9. The Euler equations

10. The sampling frequency11. Nonperiodic continuous signals: pulse, unit step function, sinc function12. Nonperiodic special discrete signals: delta function, comb function,

sampled function13. Signal conditioning: modulation, shifting and flipping, time scaling,

windowing of signals14. Windows: rectangular, triangular, Hanning, Hamming, Blackman15. Representation of signals using basis functions16. Basis set functions17. Norm of a function18. Orthonormal functions19. Linear time-invariant systems20. Mean square error21. Even and odd functions (see Problem 1.2.11)22. Energy and power signals (see Problem 1.3.7 and Problem 1.3.8)23. Projection theorem (see Problem 1.4.5)24. Gram–Schmidt orthogonalization process (see Problem 1.4.2)25. Walsh functions (see Problem 1.4.7)

T F= =

1 1 1

1 0 0

1 1 1

1

0

1

;

( )

( )

( )

f

f

f

=

0

1

0

Page 47: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

26 Signals and systems primer with MATLAB

Chapter 1 ProblemsSection 1.2

1. Plot for t = 0 to t = in the complex plane and define the shapeof the curve. Also use MATLAB to verify your conclusion.

2. Using MATLAB, plot sin t for = 0, /8, /4, /2, , 2 , 4 , 8 .Similarly, plot vs. n for = 0, /8, 2 /8,3 /8, 4 /8, 5 /8, 6 /8, 7 /8, 8 /8, 9 /8, 10 /8, 11 /8, 12 /8. Statean important conclusion from the plots.

3. Find the amplitude r and phase of the cosine function f(t) = rcos( t + ) if f(t) is given by the expression .

4. Draw the following functions:

a. f1(t) = u(t) – u(t – 2)b. f2(t) = u(t – 2) – u(t – 4)c. f3(t) = u(–t + 2) – u(–t – 2)d. f4(t) = 2u(t + 1) – 2u(t – 1)e. f5(t) = p(t + 2)f. f6(t) = –p(t – 2)

5. Find the outputs of the systems shown in Figures P1.2.5a and b.

Figure P1.2.5

ej t2

sin sin ( )nT n T= = 1

f t a t b t( ) cos sin= +

a

au(t)

t

Integrator

(a)

y(t)

Differentiator

t 2 1

1

d dt

y(t)

(b)

Page 48: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 1: Signals and their functional representation 27

6. Sketch the functions:

7. If f(t) = u(–t – 1) + exp(–t)u(t), sketch the following functions andstate their changes:

a. f (–t)b. –f (t)c. f (t – 1)d. f (–t – 2)

8. Sketch the functions:

9. Show that the following sequences lead to delta functions as a changes:

Hint: Show that the peak increases and the duration decreases as avaries; also show that the area under each curve is 1.

10. Evaluate the integrals:

a.

b.

f tt

t

f tt

t

1

2

2

12

2 11

( )sin

( )sin ( )

=

=

a.

b.

f tt

tu t

f t t u t

1

2

11

1

2

( )sin( )

( )

( ) cos (

= +

= 11 5

2

2

3

4

. )

( ) cos ( )

( ) cos cos

c.

d.

f t e t u t

f t t t

t=

= +

a.

b.

c

10 0

0

au t u t a a a

ae u t a aat

[ ( ) ( )] ,

( ) , >

..1

20 0

2 4

ae a at a >/ ,

a.

b.

( )[ ( ) ( )]

[ ( )

3 1 2 1

1 2

2

2

2

t t t dt

e tt

+ + +

+ + ( )]

cos [ ( ) ( )]

t dt

e t t t dtt +

1

3 1

2

2

2

2

2

c.

Page 49: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

28 Signals and systems primer with MATLAB

11. If f(t) = f(–t), the function is known as an even function. If f(t) = –f(–t),the function is known as an odd function. The even and odd partsof a general function are given respectively by

For the function shown in Figure P1.2.11, sketch its even and odd parts.

12. Evaluate the integrals:

Because exp(–t2) is a symmetrical function (even function), and inthe light of the value of the integrals, what can we tell about the typefunction

·(t) (the time derivative of (t))?

Hint: In the evaluation, integrate by parts.13. If f(t) = exp(–0.5t)u(t), plot the functions given below and compare

their values with the exact ones for n = 0, 1, 2, 3, …:

14. Use the Euler relations to derive the expressions:

Figure P1.2.11

f tf t f t

f tf t f t

e o( )( ) ( )

, ( )( ) ( )= + =

2 2

–1 1 2

2

f(t)

t

1

a.

b.

e t dt

e t dt

t

t

2

2

2

2

2

2

1

( )

( )

a.b.

f n e u nf n e u

n

n1

0 5

20 5 0 50 5 0 5

( ) ( )( . ) ( .

.

. .

== nn)

a.

b.

cos ( cos )

sin sin cos( )

2 12

1 2

12

12

t t

x y x y

= +

= ccos( )

sin( ) sin cos cos sin

x y

x y x y x y

+

+ = +c.

Page 50: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 1: Signals and their functional representation 29

15. Sketch the following discrete signals for n = 0, 1, 2, 3, …:

16. If f(n) = 2(0.9)nu(n), sketch the signals:

a. f1(n) = f (n – 2)b. f2(n) = f (2 – n)c. f3(n) = –f (–2 – n)

17. Plot the following discrete signals for n = 0, 1, 2, 3, …:

a. f1(n) = (–1)n 2(0.8)n

b. f2(n) = 0.2(1.1)n

c. f3(n) = 0.9n sin( n/8)d. f4(n) = (1.1)n sin( n/8)

18. Plot the following discrete functions, t = 0.2n:

Section 1.3

1. If , plot the functions:

a. f(–t)b. f(–t + 2)c. f(–t –2)

2. If the carrier signal is and the modulating function isf (t) = with , sketch the form of the amplitude-modulated function g(t) = .

3. Determine the frequency spectrum (frequency present) in the mod-ulated signal , where the modulation frequencyis m = 103 rad/s and the carrier frequency is c = 1.2 × 106 rad/s.

4. Determine the spectrum of the modulated signal, g(t) = (1 + 0.1cos mt)cos ct, where the modulating frequency is m = 103 rad/s andthe carrier frequency is c = 1.2 × 106 rad/s. What observation isevident when comparing these results with those of Problem 1.3.3?

a.b.c.

f nf n n nf n

n1

2

3

2 0 92 2 2

( ) ( . )( ) ( ) ( )(

== +

)) ( ) ( )( ) ( )( . ) (

==

=

u n u nf n u nf n

43

0 5 2 04

5

d.e. .. ) .9 0 5n

a.

b.

f n e comb t

f nt

tco

t1 0 2

2

0 2

0 22

( . ) ( )

( . )sin

.=

= mmb t0 2. ( )

f t e u tt( ) ( )( )= 1 1

v t tc c( ) cos=cos mt c m>>

v t f tc( ) ( )

g t t tm c( ) cos cos=

Page 51: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

30 Signals and systems primer with MATLAB

5. If

find and sketch the functions:

a. f1(t) = f(2t – 1)b. f2(t) = f(0.5t + 1)

6. If

find and sketch the functions:

a. f1(t) = f(2t)b. f2(t) = f(0.5t)

7. A signal that satisfies the relation

is known as the energy signal. Indicate whether or not the followingare energy signals:

a. f(t) = exp(–t)u(t)b. f(t) = u(t)

8. A signal that satisfies the relation

is known as the power signal. Indicate whether or not the followingare power signals:

a. f(t) = exp(–t)u(t)b. f(t) = u(t)

f t

t t

t

t( ) ,=

<

<

<

0 2

2 2 3

1 3 4

0 otherwise

f tt t

( ) ,=<1 1 0 1

0 otherwise

E f t dt= <( )2

PT

f t dtT T

T

= <lim ( )/

/1 2

2

2

Page 52: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 1: Signals and their functional representation 31

Section 1.4

1. If the basis functions are complex, show that

2. Given a linear independent system of functions 1, 2, …, n, …defined on the interval [a, b], define a new system 1, 2, …, n, …as follows: 1 = 1,

This procedure is called the Gram–Schmidt orthogonalization pro-cess. Apply this process to the set of functions 1, t, t2, t3, … in theinterval –1 t 1 and generate the Legendre polynomials within aconstant.

3. Are the basis functions orthonormal in the range0 t 2 / 0 ( 0 = 2 /T)? If not, find the appropriate constant thatwill make them orthonormal.

4. Show that the functions

are orthonormal in the interval –1 t 1, in the approximate form.

5. (Projection theorem) One of the most celebrated theorems in signalprocessing is the projection theorem, which states: If f(t) is an elementof a linear (vector) space S spanned by the orthogonal basis { i}, and fa(t) isan element in a lower-dimensional space Sa S, the error (t) = f(t) – fa(t)is a minimum in the mean square sense if, and only if, fa(t) is the orthogonalprojection of f(t) into fa(t). The minimum error and the projection areorthogonal. Figure P1.4.5 illustrates the projection theorem. Observethat for vectors the orthogonality is defined by their dot product,

f t dt f t f t dt ca

b

a

b

n n

n

( ) ( ) * ( )2 2 2

0

= ==

2 2

1 2

12

1 3 3= =( ) ( )

( )( ),

t t dt

t dtta

b

a

b

1 3

12

1

2

( ) ( )

( )( )

( )

t t dt

t dtt

t

a

b

a

b

a

b

33

22

2

( )

( )( ),

t dt

t dtt

a

b�

{ ( )} {exp( )}n t jn t= 0

0 112

32

( ) , ( )t t t= =

f t c t c ta( ) ( ) ( )= +0 0 1 1

Page 53: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

32 Signals and systems primer with MATLAB

whereas in functions it is defined by their integrals. Let f(t) = t3

– 1 t 1 and let , where

is the orthonormal set of Lengendre functions. Use the minimummean square error approach to find c0 and c1. The error then is equalto (t) = f(t) – fa(t). Show that the error is orthogonal to fa(t).

Hint: Find the value of the integral,

6. Determine the MSE if we approximate f(t) = sint over the rangeby the functions:

7. Find an approximation to the function shown in Figure P1.4.7a usingthe first three Walsh functions shown in Figure P1.4.7b. Show alsothat the Walsh functions are orthonormal.

Figure P1.4.5

(a) (b)

F

F1

F2

a1

a2

a3 ε

f(t)

S3

S2fa(t)

ε

ϕ1

ϕ3 ϕ2

f t c t c ta( ) ( ) ( )= +0 0 1 1

012

( ) ,t = 1 223

258

3 1( ) , ( ) ( ),t t t t= = �

f t t dta( ) ( )1

1

0 t

a. /b.c.

f t tf tf t t

a

a

a

( ) ( )( ) .( ) sin ( )

===

10 5

2

Page 54: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 1: Signals and their functional representation 33

Appendix 1.1: Elementary matrix algebraSome basic matrix algebraWe will present the algebraic methods for matrices with constant elementsusing a 2 × 2 and a 2 × 3 matrix as examples. The generalization to largermatrices is done in a similar way.

Addition and subtraction of matricesWe can add and subtract two matrices if they have the same number of rowsand columns. The element aij of the matrix A is the one located at theintersection of the ith row and the jth column. Hence, the ijth element of thematrix is . For example,

(1.1)

Multiplication of matricesThe multiplication of a matrix with any number is a matrix with eachelement been the product of the element of the initial matrix times thenumber.

(1.2)

Figure P1.4.7

0.5 1.0

1.00.8

0.5

(a) (b)

1/2 1.0

1.0

1.0

–1.0

1.0

–1.0

t

w(0, t)

w(1, t)

w(2, t)

1/4 3/4

A B± a bij ij±

A B =± ±a a a

a a a

b b b

b

11 12 13

21 22 23

11 12 13

21 bb b

a b a b a b

a b22 23

11 11 12 12 13 13

21 2

=± ± ±

± 11 22 22 23 23a b a b± ±

c baij ij=

Page 55: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

34 Signals and systems primer with MATLAB

The multiplication of two matrices is given as follows:

(1.3)

The columns of the first matrix must be equal to the rows of the secondmatrix. The number of rows of the new matrix is equal to the number ofrows of the first matrix, and the number of columns of the new matrix isequal to the number of columns of the second matrix. The general elementof the new matrix is given by

(1.4)

where A is any m × p matrix and B is any p × n matrix. The new matrix Cis a m × n matrix.

Determinant of a matrix

The determinant of a 3 × 3 matrix is given as follows:

The inverse of a matrix

A matrix A multiplied with its inverse A–1, if it exists, produces the identitymatrix I (I is a square matrix that has all the off-diagonal elements equal to0 and the element along the main diagonal equal to 1).

The adjoint of a matrix A is defined below using a 3 × 3 matrix A as anexample:

AB =a a a

a a a

b b

b b

b

11 12 13

21 22 23

11 12

21 22

311 32

11 11 12 21 13 31 11 1

b

a b a b a b a b=

+ + 22 12 22 13 32

21 11 22 21 23 31 21 12

+ +

+ + +

a b a b

a b a b a b a b aa b a b22 22 23 32

2 3 3 2 2 2

+

× × ×

c a bij ik kj

k

p

==1

det

a a a

a a a

a a a

11 12 13

21 22 23

31 32 33

= +( ) det1 1 111

22 23

32 33

aa a

a a+ +( ) det1 1 2

12

21 23

31 33

aa a

a a

+ +( ) det1 1 313

21 22

31 3

aa a

a a 22

11 22 33 23 32 12= a a a a a a( ) (( )

( )

a a a a

a a a a a

21 33 23 31

13 21 32 22 31+

(1.5)

Page 56: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 1: Signals and their functional representation 35

(1.6)

The inverse of a matrix A is given by

(1.7)

Example 1.1: Find the inverse of the following 2 × 2 matrix:

Solution:

The reader should verify the product AA–1 = I.

MATLAB operations and functions to manipulate matrices

Writing a matrix

A = [1 2 5; 2 –10 0.2] a 2 × 3 matrix;

B = [0.1 1 –2 0.5 5] a 1 × 5 matrix, a vector.

adj adj

a b c

d e f

g h i

{ }A = = =[ ]

( )

( ) (c

ei fh di fg dh eg

bi ch ai cgij aah bg

bf ce af cd ae bd

ei

T

=

)

( )

fh bi ch bf ce

di fg ai cg af cd

dh eg

( )

( ) ( )

( )ah bg ae bd

AAA

–1 = adj{ )det{ }

A =2 3

1 6

adj

T

{ } ; det{A A= =6 1

3 2

6 3

1 2}} ;= × × =

= =

6 2 1 3 9

19

6 3

1 2

69

39

19

21A

99

Page 57: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

36 Signals and systems primer with MATLAB

Multiplication of two matrices

C=A*B;%matrices are multiplied if they have dimensions of the %form mxn and nxp

Addition and subtraction of two matrices

The dimension of the matrices to be added must be the same.

Inverse of a matrix

Transpose of a matrix

Matrix B is the transpose of A.

Appendix 1.2: Complex numbersAddition and subtraction of complex numbers

If z1 = 2 + j and z2 = 1 – 3j, then z = z1 + z2 = 3 – 2j. The Cartesian representationof these complex numbers and their sum is shown in Figure A1.2.1. Theplane on which the complex numbers are presented is known as the complexplane. Observe that complex numbers add in the complex plane as forcesadd. This is also true for subtraction of complex numbers. Figure A1.2.2presents the following forms of a complex number: z = 2 + j; z* = conjugate ofz = 2 – j; –z = reflected of z; –z* reflected of its conjugate form; z = (22 + 12)1/2

exp(jtan–1(1/2)) = polar form.

Multiplication of complex numbers

Cartesian formatIf z1 = 2 + j and z2 = 1 – 3j, their product is z = z1 × z2 = (2 + j)(1 – 3j) = 2 ×1 + j × 1 – 2 × 3j – 3j2 = 5 – j5.

Polar form

C = A B±

A = A);–1 inv(

B = A';

z z e ej j1 2

2 2 1 2 2 2 3 12 1 1 31 1

= + +tan ( / ) tan ( / )( ) == ×

=

5 10

50

1 11 2 3

0 7854

e

e

j

j

(tan ( / ) tan ( ))

( . ) == 7 0711 4. ej

Page 58: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 1: Signals and their functional representation 37

Division of complex numbers

Cartesian form

Figure A1.2.1

Figure A1.2.2

1

2

3

1

–2

–3

Re(z)

jIm(z)

z-plane

z1

z2

z

z

z∗

–z∗

–z

Re(z)

jIm(z)

tan−1(1/2)

22 + 12r =

2

1

zz

jj

j jj j

j j1

2

21 3

2 1 31 3 1 3

2 6= + = + ++

= + +( )( )( )( ) + +

= +31 3 3 9

110

710j j

j

Page 59: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

38 Signals and systems primer with MATLAB

Polar form

MATLAB functions for complex numbers manipulation

changing Cartesian to polar form

[angle_in_rad, magn]=cart2pol(2,3);%will change the complex %number 2+j3 to 3.6056ej0.9828

To change the radians found above to degrees, we write in the commandwindow: angle_in_rad*(180/pi). For this example, we find that 0.9828 radi-ans corresponds to 56.31 degrees.

Changing polar to Cartesian form

The MATLAB function pol2cart( ,r) converts the complex number rexp(j ) to Cartesian form.

[real,imag]=pol2cart(0.9828,3.6056);%for this case we find the %original values: 2+j3;

Appendix 1.1 Problems

1. Add the following matrices:

2. Add the matrices:

3. Multiply the matrices:

zz

e

e

j

j

1

2

2 2 1 2

2 2 3 1

2 1

1 3

1

1= +

+

tan ( / )

tan ( / )( )==

= =

+510

510

0

1 11 2 3

1 7127

e

e

j

j

(tan ( / ) tan ( ))

. .77071 0 5452ej .

A B= =1 2

3 4

2 1

1 1,

A Bj j

= =+1 2 3

1 2 3

2 1

4 2 1,

A B= =1 2 3

4 5 6

2 3

4 6

1 1

,

Page 60: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 1: Signals and their functional representation 39

4. Multiply the matrices:

5. Find the determinant of the following matrices:

6. Find the inverse of the matrix:

7. Find the inverse of the following matrix:

Appendix 1.2 Problems

1. Add the following complex numbers and plot them: z1 = 2 + j, z2 =–1 – 2j, z3 = 2j.

2. Multiply the following complex numbers and plot them: z1 = 2 + j,z2 = z1*, z3 = 2.

3. Represent the following complex numbers in their Cartesian andpolar form and plot them: z1 = –2 + j, z2 = –z1*, z3 = z1 + 2 – j4, z4 =|z3| + z1.

A B C= = =1 2

3 4

1 2 3

1 1 2

1

2

4

, ,

A B C= = =1 2

2 1

2 1

2 2

1 2 3

4 5 6

7 8 9

, ,

A =1 2

3 4

A =

1 2 0

1 3 1

0 2 3

Page 61: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

41

chapter 2

Linear continuous-time systems

In this chapter we will learn about continuous systems. We will learn howto model the systems and find their outputs if they are excited by differenttypes of inputs. Furthermore, we will learn the mathematical operation ofconvolution and its importance to system operations. We will focus ourattention on how to find the impulse response of a system that is the cor-nerstone of system identification and system responses.

2.1 Properties of systemsEvery physical system is broadly characterized by its ability to accept aninput (voltage, current, pressure, magnetic fields, electric fields, etc.) and toproduce an output response to this input. To study the behavior of a system,the procedure is to model mathematically each element that the systemcomprises and then consider the interconnected array of elements. The anal-ysis of most systems can be reduced to the study of the relationship amongcertain inputs and resulting outputs. The interconnected system is describedmathematically, the form of the description being dictated by the domain ofdescription — time or frequency domain.

Critical to this process are:

1. A mathematical modeling of the elements that the system comprises;these elements might be complicated structures.

2. A mathematical description of their interconnection.3. A solution to the mathematical equations for the specified input and

prescribed initial state of the system.4. Desirably, as a criterion of reasonableness, a careful examination of

the final response equation.

This chapter addresses these aspects of system description and systemanalysis. System description is discussed both mathematically and graphically.

Page 62: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

42 Signals and systems primer with MATLAB

Three different methods for carrying out the solution process for continuous-type systems are studied initially. A somewhat parallel approach is consid-ered for discrete-time systems, although the details differ from those forcontinuous-type systems. Our study will show the applicability of the devel-oped methods to disciplines outside of the engineering domain.

As already noted, every physical system is able to accept an input andto produce an output response to this input. For example, a modernvideo-disc player is an optoelectronic system whose input is the reflection(or transmission) of laser from the grooves of the record and whose outputis a video signal that is viewed on a television system. A telescope is anoptical system that accepts the irradiance of the stars as its input and pro-duces their image on a film or CCD camera as its output. A seismograph isan apparatus that registers the shocks and motions of the earth due toearthquakes. An elementary seismograph consists of a mass and a delicatelymounted spring. Its input is the force caused by the earth’s movement, andits output is the subsequent oscillations, which are registered on a paper asit moves under the stylus.

When the input–output properties of a system’s elements can bedescribed as proportional, time derivative, or integral functions, the resultingdescription is given by an integrodifferential equation. The form is evidentwhen we apply the Kirchhoff voltage law to a series RLC circuit that has avoltage source as input and the circuit current as its output. Such systemscan be shown in a circuit diagram or block diagram form. We will restrictour attention to systems made up of lumped parameters, that is, systemswith a finite number of discrete elements, each of which is able to store ordissipate energy or, if it is a source, deliver energy. Such systems are describedby ordinary differential equations. We can also represent the same systemsin a block diagram form that describes the terminal properties of the net-works, that is, the relationship between its input and its output. Therefore,the output y(t) = O(f(t)}, where f(t) is the input to the system and O is theoperator of the system that operates (differentiates, integrates, multiplies,etc.) on the input to produce the output. Figure 2.1.1 shows the abovedefinition in a block diagram form.

We can also have systems with distributed parameters instead of distinctdiscrete elements, although each infinitesimal part of these systems can bemodeled in lumped parameter form. Their description is accomplished usingpartial differential equations. One such system is the telephone line. Thesesystems are not dealt with in this text.

Figure 2.1.1 Block diagram representation of a system.

O{f(t)}

System

f(t) y(t)

Page 63: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 2: Linear continuous-time systems 43

Systems with random parameters or randomly varying parameters arecalled stochastic systems, and those with parameters that are not varyingrandomly are called deterministic systems. Both system categories may usetime in a continuous form and may be described by differential equations;in such cases, both are continuous-time systems. If excitations are introducedto systems at distinct instants of time and the systems are described bydifference equations, these systems are termed discrete-time systems.

Systems can be linear or nonlinear. A linear system is one for which alinear relation exists between cause and effect, or between excitation andresponse. If the relation between cause and effect is nonlinear, the system istermed nonlinear. We will find that systems analysis can often be carriedout in closed mathematical form for systems composed of linear elements.This analysis is rarely possible for nonlinear systems. This book is confinedto linear systems only.

Systems for which an output at any time t0 is a function only of thoseinputs that have occurred for t t0 — that is, the system response neverprecedes the system excitation — are nonanticipatory, or causal, systems.Ordinary physical systems are causal systems. Signals that do not start atminus infinity are called causal. Although noncausal systems exist, in thistext we will study only causal systems.

Systems whose parameters vary with time are called time-varying sys-tems, and they are not considered in this book. The focus here is on systemswith constants, called linear time-invariant (LTI) systems. It is important tonote that within these limitations, the number of specific systems is almostlimitless. Thus, while the book emphasizes the study of some relativelysimple electrical and mechanical systems, the procedures and methods canbe applied to many other types of systems, such as economic, chemical,biological, etc.

2.2 Modeling simple continuous systemsAs already noted, an essential requirement in continuous-time, or analog,systems analysis is a mathematical input–output description of the elementsthat make up the interconnected system. The requirement exists because wewish to perform mathematical studies on systems comprising hardware com-ponents or carry out designs mathematically that will ultimately be realizedby hardware. It must be stressed that the analysis or design can be no betterthan the quality of the models used. The essential ideas in the modelingprocess are reviewed here.

Electrical elements

CapacitorThe linear capacitor is an idealized circuit element in which energy is storedin electric form. In its most elementary form, the capacitor consists of twoclosely spaced metallic plates that are separated by a single or multiple layers

Page 64: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

44 Signals and systems primer with MATLAB

of nonconducting (insulating) dielectric material, such as air, glass, or paper.A schematic representation of the capacitor is shown in Figure 2.2.1a. Theterminal properties of a linear time-invariant capacitor are described graph-ically by a charge–voltage relationship of the form shown in Figure 2.2.1b.The capacitors used in most electronic circuits are essentially time invariant,although the capacitor microphone used in radio studios is an example of alinear time-varying capacitor.

By definition, the capacitance C is

(2.1)

Since the current is given by

(2.2)

we obtain the relations

(2.3)

As descriptive of their inherent properties, the current i(t) is termed athrough variable and the voltage v(t) is called across variable.

Example 2.2.1: Find the voltage across a 1-μF capacitor at t = 2 s if thecurrent through it has the waveshape shown in Figure 2.2.2.

Figure 2.2.1 (a) Capacitor element and its circuit representation. (b) Charge–voltagecharacteristics of a linear capacitor element.

v(t)

+

i(t)

i(t) q

v

Slope = C

C

(a) (b)

Cqv

= =coulombvolt

farad (F)

idqdt

= =coulombsecond

ampere (A)

v tC

i x dx

i t Cdv t

dt

t

( ) ( )

( )( )

=

=

1a)

b)

Page 65: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 2: Linear continuous-time systems 45

Solution: Apply (2.3) part a) to obtain

The negative sign indicates that the voltage polarity at t = 2 s is opposite ofthe polarity initially assumed as the reference condition shown in Figure2.2.1a.

InductorAnother important electrical element that stores energy in the form of mag-netic field is the inductor, sometimes called coil or solenoid. The terminalproperties of linear inductors are described graphically by the flux linkage–current relationship , I shown in Figure 2.2.3b. Figure 2.2.3a shows the

Figure 2.2.2 Current delivered to 1 μF capacitor.

Figure 2.2.3 (a) Inductor element and its circuit representation. (b) Linear flux–current relationship.

–2 –1

1

–1

3 5

2

t (s)

i(t) (mA)

v i x dx dx( ) ( ) (21

1 1010 10 10

6

26 3

2

13=

×= + xx dx dx

V

+ +

= ×

1 10

0 5 10

1

03

0

2

3

) ( )

.

i(t)

L

+

Slope = L

i(t)

i

(a) (b)

v(t)

Page 66: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

46 Signals and systems primer with MATLAB

circuit representation of the inductor. The simple telephone receiver is anexample of a time-varying inductor.

By definition, the inductance of an inductor is written

(2.4)

Combine this with Faraday’s law,

(2.5)

to obtain the relation (L is assumed to be time invariant; see Figure 2.2.3b)

(2.6)

Example 2.2.2: Find the voltage across a 3-H inductor at t = 2 s if thecurrent through it is as shown in Figure 2.2.4.

Solution: From (2.6) part b) we obtain

Figure 2.2.4 Current delivered to a 3-H inductor.

Li

= =weberampere

henry (H)

v tddt

( ) = volt (V)

i tL

v x dx

v t Ldi tdt

t

( ) ( )

( )( )

=

=

1a)

b)

vdi tdt

d e u tdt

et

t

t

( )( ) [ ( )]( )

2 3 31

32

1

2

= = == =

1

i(t)

1

e (t 1)u(t – 1)

2 0 1 2

t (s)

Page 67: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 2: Linear continuous-time systems 47

ResistorUnlike the capacitor and inductor, each of which stores energy, the resistorshown in Figure 2.2.5a dissipates energy. The v, i characteristic for a linearresistor, as shown in Figure 2.2.5b, is a straight line with proportionality factor

(2.7)

where R = resistance (ohm) and G = 1/R = conductance (mho). Ordinaryresistors are usually assumed to be time invariant, but carbon microphonein the ordinary telephone set is a time-varying resistor.

The above three simple systems can also be represented in their blockdiagram form (Figure 2.2.6). The input is manipulated (mathematically) bythe system operator to form the output. It is desired that the reader becomesfamiliar with this type of presentation since it helps engineers and scientiststo study systems and their behavior. Observe in Figure 2.2.6 that the systemoperator is different for each system, although the input and output for allthe systems are the same. From this we can conclude that operator form

Figure 2.2.5 Resistor. (a) Network representation of the resistor. (b) Linear voltage–current relationship.

Figure 2.2.6 O = operator. (a) Capacitor block diagram–operator representation.(b) Inductor block diagram–operator representation. (c) Resistor block diagram–operator representation.

i(t)

i(t) v(t)

i(t) R

(a) (b)

v(t)

Slope = R

+

Rv ti t

Gi tv t

= =

=

( )( )

( )( )

voltampere

ohm

mho

( ) a)

( ) b)�

i(t) i(t) i(t)

(a) (b) (c)

v(t) v(t) v(t) O = RO = L d

dt

1

C O = t dx

Page 68: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

48 Signals and systems primer with MATLAB

depends on the type of system and the input and output variables in whichwe are interested.

Mechanical translation elements

Ideal mass elementBulk matter as a single unit is defined as a mass element. The dynamics ofa mass element are described by Newton’s second law of motion:

(2.8)

which relates the force f(t) to the acceleration dv/dt = d2x/dt2. The motionvariable v enters in a relative form: it is the velocity of the mass relative tothe velocity of the ground, which is zero; hence, v is an across variable. Theforce f(t) is transmitted through an element; hence, it is a through variable.The integral form of (2.8) is given by

(2.9)

Note: It is interesting to compare (2.9) and (2.3) part a). This comparisonshows that an analogy exists between the mass in a mechanical system and thecapacitor in an electrical system. A schematic representation of the mass element isshown in Figure 2.2.7.

SpringA spring element is one that stores energy due to the elastic deformation thatresults from the application of a force. Over its linear region, the spring satisfiesHook’s law that relates the force to the displacement by the expression

(2.10)

where K is the spring constant, with units newton/m.

Figure 2.2.7 Schematic representation of the mass element.

f t Mdv t

dtM

d x tdt

( )( ) ( )= =

2

2 newton kg m s (N= –2i i ))

v tM

f dt

( ) ( )= 1

f t Kx t( ) ( )= newton (N)

M

M

v(t)

f(t)

f(t)

+

v(t)

Referencevelocity (ground){vg = 0 =

Page 69: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 2: Linear continuous-time systems 49

By differentiating (2.10) with respect to time, we obtain the relation

(2.11)

Refer to the schematic representation of the spring in Figure 2.2.8 and use(2.10) and (2.11) to find

(2.12)

If x1 > x2, there is compressive force and f > 0. If x1 < x2, there is a negative,or extensive, force.

Note: Observe the analogy between the spring and the inductor.

DamperConsideration of this element is limited here to viscous friction, which, fora linear dependence between force and velocity, is given by

(2.13)

from which

(2.14)

where D is the damping constant (newton-second/m). A mechanical damperand its schematic representation are shown in Figure 2.2.9.

Note: Observe the analogy between the damper and the resistor.

Figure 2.2.8 Schematic representation of the spring.

v1 v2

x2

f(t)

+v = v1 − v2

x1

v tK

df tdt

( )( )= 1

f t K x t x t K v x v x dx K vt

( ) [ ( ) ( )] [ ( ) ( )]= = =1 2 1 2 (( )x dxt

f t Dv t( ) ( )=

v tD

f t( ) ( )= 1

Page 70: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

50 Signals and systems primer with MATLAB

By maintaining the parallelism between through and across variables,which also leads to a parallelism in the resulting network topology, we foundthat mass and capacitor, spring and inductor, and damper and resistor areanalogous quantities. From a purely mathematical point of view, a parallel-ism between velocity and current and force and voltage could be chosen, inwhich case, we could obtain analogy between mass and inductor, spring andcapacitor, and damper and resistor. In this case, the topology would be duallyrelated — that is, parallel connection of mechanical elements would lead toan analogous series connection of electrical elements. Some of the olderwritings, particularly in acoustics, employed this dual relationship; this textis confined only to the through and across variable parallelisms, thereby alsomaintaining the parallel topological structure.

Mechanical rotational elements

Inertial elementsA set of rotational mechanical elements and rotational variables exists andbears a one-to-one correspondence to the translational mechanical elementsand the translational variables that have been discussed above. In the rota-tional system, torque (T ) is the through variable and angular velocity ( =d /dt) is the motional or across variable. The corresponding fundamentalquantities are

In this rotational set, J is a rotational parameter and the proportionality factorbetween torque and angular acceleration. When the motion is considered onone axis only,

Figure 2.2.9 Physical and diagrammatic representation of a dash pot (damper).

Oil

Oil

v1 v2

Physical system v1 v2

D f(t)

v = v1 v2

+

J = polar moment of inertia corrresponds to in translation

rotational

M

K = sspring constant corresponds to KK

D

in translation

rotational damping const= aant corresponds to in translationD

T == torque corresponds to in translationf

= dd dt/ , angular velocity corrresponds to / in translationv dx dt=

Page 71: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 2: Linear continuous-time systems 51

(2.15)

and for systems with constant J,

(2.16)

J, the moment of inertia of a rotational body, depends on the mass and thesquare of a characteristic distance of the body, called the radius of gyration,k. This is given by

(2.17)

For a simple point mass rotating about an axis at a distance r from the centerof mass, k = r and

(2.18)

For a simple disc of radius r rotating about its center, with

(2.19)

Figure 2.2.10 shows the linear rotational inertial elements.

SpringA rotational spring is one that will twist under the action of torque. A linearspring element is described by the pair of equations

Figure 2.2.10 Schematic representation of rotational inertial systems.

J J

+T

T

T = d Jdt( )

T = =Jd t

dtJ

ddt

( ) 2

2 newton-meter

J Mk= 2 2kg mi

J Mr= 2

k r= / 2 ,

J Mr= ( / )1 2 2

Page 72: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

52 Signals and systems primer with MATLAB

(2.20)

A schematic representation of the rotational spring is shown in Figure 2.2.11.

DamperA rotational damper differs from the translational damper principally in thecharacter of the motion. A schematic representation is given in Figure 2.2.12,and the equations that describe a rotational damper are

(2.21)

2.3 Solutions of first-order systemsFirst, we wish to study the characteristic behavior of systems of intercon-nected elements through their mathematical formulations. Second, we willstudy other than electrical and mechanical systems. It will be evident fromour studies that, knowing the fundamental approach and the basic principlesfor engineering systems, we will be able to solve any other system that is

Figure 2.2.11 Schematic representation of rotational spring: (a) physical system and(b) circuit representation.

Figure 2.2.12 Schematic representation of a rotational damper.

(b) (a)

+

= 1 2

+

1, 1 = 1 2

2, 2

T T

Viscous fluid

+ +

1 2

T T

T

T

( ) ( ) ( )

( )( )

t K t K d

tK

d tdt

t

= =

= 1

T

T

( ) ( )

( ) ( )

t D t

tD

t

=

= 1

Page 73: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 2: Linear continuous-time systems 53

described by the same differential equations. We develop the mathematicaldescription by the use of Kirchhoff’s current and voltage laws for electricalsystems and by the use of D’Alembert’s principle for mechanical systems.The resulting system equations that are given as one or more differentialequations require, as the next step, the solution of the mathematical problemin a form that will yield the trajectory (output value) that satisfies the initialcondition that applies to the system at some specified time, known as theinitial time.

First, we shall examine first-order systems, that is, those systemsdescribed by first-order differential equations. It is very important to under-stand the principles and fundamental properties of the first-order differentialequations because the basic principles can be extrapolated to any order ofdifferential equations such as initial conditions, input, output, homogeneoussolution, etc.

Consider the simple electric system shown in Figure 2.3.1a. An applica-tion of Kirchhoff’s voltage law (the algebraic sum of the voltages around aclosed loop is equal to zero) yields

or

(2.22)

where we set vo(t) = Ri(t). Observe that (2.22) is a first-order, ordinary differ-ential equation since it involves only the first derivative of the dependentvariable, vo(t). In the present system we have only one energy-storing ele-ment (the inductor in the form of magnetic field) and only one forcingfunction (source), v(t).

Figure 2.3.1 (a) Simple electrical system. (b) Zero-input response.

Ldi tdt

Ri t v t( )

( ) ( )+ =

LR

dv tdt

v t v too

( )( ) ( )+ =

i(t)

L

R

+

+

v(t) νo(t)νo(t)

νo(0)

ν(t)

OutputInput

(a) (b)

t

System

νozi(t)

τ =R

Lτ2

τ1

τ1 > τ2

Page 74: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

54 Signals and systems primer with MATLAB

Note: Every system described by an ordinary differential equation is charac-terized by its input function (in this case by v(t)) and its output function (in thiscase, vo(t)). A system is also characterized by its operator, which operates on itsinput to produce the output. Although in simple systems finding the operator maybe easy, in most cases, it is very difficult, if not impossible.

Finding the unknown function vo(t) requires that we find the solution to(2.22). A fundamental requirement in the solution of differential equationsis that the complete solution must contain as many arbitrary constants asthe order of the differential equation being solved. Therefore, we must haveadditional information if we are to obtain a solution that meets all theconditions of the problem. This added information is specified by the knowl-edge of the state; the condition of the system at a particular time is knownas the initial condition. Without loss of generality we use the particular timet = 0.

There are several approaches in solving ordinary differential equations.In this chapter we will present the method of undetermined coefficients andconvolution. The transform methods for both continuous and discrete sys-tems will be presented in later chapters.

Zero-input and zero-state solution

To apply the method of undetermined coefficients, we use a two-step pro-cess. First, we write the differential equation in its homogeneous form, whichis equivalent to writing the equation without its forcing function, or equiv-alently the input to the system. Hence, we write

(2.23)

The solution of this homogeneous equation is known as the zero-inputresponse.

Note: The zero-input response is due entirely to the energy stored in the system.If there is no energy stored in the system, the zero-input response of the system iszero.

Energy is stored in the form of magnetic field in inductors, in the formof electric field in capacitors, as kinetic energy in masses, and as potentialenergy in the deformation of springs.

To solve (2.23), we try a solution of the form

(2.24)

LR

dv tdt

v too

( )( )+ = 0

v t Aeost( ) =

Page 75: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 2: Linear continuous-time systems 55

where A is an unknown constant and s is a constant having the units offrequency s–1. The basis for the suggested form of the solution is found in(2.23), which requires that the sum of its derivative and its solution must beequal to zero (hence the exponential function). Substituting this trial solutionin (2.23), we obtain

(2.25)

If we were to set A = 0, we would obtain the trivial solution. Therefore, weimpose the requirement that (s + R/L) = 0 or s = –(R/L). Hence, the homo-geneous solution takes the form

(2.26)

If we choose vo(t)�t=0 = vo(0), then, for this initial state, vo(0) = A exp( 0R/L) =A, and hence the zero-input solution (response) is

(2.27)

Note: Observe that it was necessary to evaluate only a single arbitrary constantfor this first-order differential equation.

The zero-input solution is shown in Figure 2.3.1b for two values of the ratioR/L, known as the time constant of the system.

Our next step is to solve (2.22) with the forcing function present (input).Thus, we are to find a solution to the nonhomogeneous differential equation

(2.28)

To proceed, we multiply both sides of this equation by exp(tR/L), the formsuggested by (2.27). We recognize that we can write the result as follows:

(2.29)

Integrate both sides of the above equation from 0 to t to obtain

LR

s Ae sRL

Aest st+ = + =1 0 0or

v t Aeot R L( ) ( / )=

v t v eozi oR L t( ) ( ) ( / )= 0

dv tdt

RL

v tRL

v too

( )( ) ( )+ =

ddt

e v tRL

e v tt R Lo

t R L[ ( )] ( )( / ) ( / )=

e v tRL

e v x dx e vt R Lo

tx R L

tt R L( / ) ( / ) ( / )( ) ( )

0 0= or oo o

x R Lt

t vRL

e v x dx( ) ( ) ( )( / )=00

Page 76: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

56 Signals and systems primer with MATLAB

This result is written in the form

(2.30)

where the integral indicates a convolution of the two functions v(t) andexp(–(R/L)t). More will be said about convluition in Section 2.6.

Let us assume that at t = 0, the initial voltage V and the ratioR/L = 1. Under these conditions, the output voltage for an assumed unitstep input voltage v(t) = u(t) is

(2.31)

Here vot identifies the transient component of the solution and voss identifiesthe steady-state component of the solution.

Standard solution techniques of differential equations

In this subsection we carry out the solution of (2.22) using the standardapproach that provides directly the transient and steady-state componentsof the solution. The steps are as follows:

Step 1: First solve the homogeneous equation

(2.32)

Following the procedure discussed above, we found (see (2.26)) thatthe homogeneous solution is (L/R = 1)

(2.33)

Step 2: Next, we solve the nonhomogeneous equation, with inputvoltage u(t) = 1 (t > 0), which is

(2.34)

Since the input voltage is constant, the solution, known as the par-ticular solution, is also a constant. Let vop(t) = B = constant, where B

v t v eo ot R L( ) ( ) ( / )

(

= 0zero-inputresponse vozi tt

t R L x R LtR

Le e v x dx

)

( / ) ( / ) ( )� � +0

zero-statte response vozr ( )

( /( )

t

ot Rv e

� �

= 0 LL R L t xrR

Lv x e dx) ( / )( )( )+

0

vo( )0 2=

v t e e e dx e eot t x

tt

v

t

voziozs

( ) ( )= + = +2 2 10� ��� � �= +e t

v vot oss

1

LR

dv tdt

v too

( )( )+ = 0

v t Aeoht( ) =

dv tdt

v too

( )( )+ = 1

Page 77: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 2: Linear continuous-time systems 57

is unknown. We next substitute the trial solution into this equationand force both sides to be equal. Hence, we find that B = 1. Therefore,the total solution is

(2.35)

Step 3: Finally, we apply the initial conditions in the total solution.Hence, we find

Therefore, the solution is

which is identical to (2.31), as it should be.

Example 2.3.1: Computer system. Find the zero-input, zero-state, tran-sient, and steady-state responses of the magnetic head of the computer discdrive modeled in Figure 2.3.2a. We consider only the mass of the headstructure and the friction due to the air and arm of the assembly. The massis equal to 10–4 kg, and the air friction constant D = 10–4 N s/m.

Solution: First, we present the system in its physical representation, asshown in Figure 2.3.2b. Next, we create a diagram that indicates the two

Figure 2.3.2 Computer disc drive: (a) physical representation, (b) velocity diagram,and (c) velocity response.

v t v t v t Ae to oh opt( ) ( ) ( )= + = + >1 0

v A e Ao( )0 2 1 10= = + + =or

v t e tot( ) = + >1 0

M

fM

M

M

Arm

Force

Magnetic

head Friction

D

(a)

(c) (d)

(b)

f

v

D

v

f

fDv

vg = 0

vg = 0

Page 78: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

58 Signals and systems primer with MATLAB

velocities: the ground velocity equal to zero and the velocity of the mass, asshown in Figure 2.3.2c. From the ground node to velocity, we connect theforce source, the mass, and the damping effect, as shown in Figure 2.3.2d.This figure is the equivalent circuit representation of the system.

At the node, D’Alembert’s principle requires that the algebraic sum ofthe forces must be equal to zero. Hence, we write

(2.36)

or

(2.37)

It has been assumed that the frictional force is proportional to velocity v,with a frictional coefficient D.

We assume that the force f is an exponential function, f(t) = 10–4e–2tu(t).The differential equation under consideration is

(2.38)

We first employ the method of variation of parameters. The solution to thehomogeneous equation is easily found to be

Figure 2.3.2 (continued).

1

0.8

0.6

0.4

0.2

0 v(t)

–0.2

–0.4

–0.6

–0.8

–1

exp(–t) exp(–t)–exp(–2t)

-exp(–2t)

0 0.5 1 1.5 2 2.5 3 3.5 4

t (s)

(e)

f f fM D+ =

Mdv t

dtDv t f t

( )( ) ( )+ =

dv tdt

v t e tt( )( )+ = >2 0

Page 79: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 2: Linear continuous-time systems 59

(2.39)

where v(0) is the initial velocity (state) of the system. To find the solution ofthe nonhomogeneous equation, multiply both sides of (2.38) by exp(t) andrearrange the result to the form

Integrate both sides of this equation from 0 to t, combine the result withvzi (t), and rearrange the resulting equation to

(2.40)

To proceed, we employ the standard methods of differential equationsas it was discussed above. The particular solution of (2.38) is obtained if weassume a trial solution of the form vp(t) = Be–2t. Again, the trial solution wasselected to be proportional to the input to the system. Combine this solutionwith (2.38) to find the relation

The complete general solution is given by

(2.41)

where A, the unknown constant of the homogeneous solution, is deducedby the specified initial condition. At t = 0, the initial velocity is v(0), so that

Combine this value of A with (2.41) to find

(2.42)

which is the same result given by (2.40). If we further assume that the initialvelocity v(0) is zero, the velocity of the head becomes

(2.43)

v t v ezit( ) ( )= 0

ddt

e v t e f tt t[ ( )] ( )=

v t v e e e e dxt

v

t x xt

vzi

zs

( ) ( )= +0 2

0�� � � = +v e e et t t( ) ( )0 2

B e Be e Bt t t( ) + = =2 12 2 2 or

v t Ae et t( ) = 2

v A A v( ) ( )0 1 0 1= = +or

v t v e e et t t( ) ( ) ( )= +0 2

v t e et t( ) ( )= 2

Page 80: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

60 Signals and systems primer with MATLAB

This response is a pulse-type function and does not show the discontinuityat t = 0 of the exponential input function. Figure 2.3.2e graphically shows,(2.43). �

Example 2.3.2: Electro-optics. In many applications, such as readingproduct codes in supermarkets, printing, and so forth, an optical scanner, asshown in Figure 2.3.3a, is used. If the applied torque is given by T (t) =0.1cos o(t)u(t), find the zero-input and zero-state responses of the angularvelocity of the mirror. As the mirror rotates, a friction force is developed thatis proportional to its angular speed. The friction constant D is equal to 0.05 Nm s/rad, and the polar moment of inertial J is equal to 0.1 kg-m2. Alsodetermine the transient and steady terms using the standard differentialequation techniques.

Solution: The physical system is modeled as shown in Figure 2.3.3b; thecircuit diagram is developed in Figures 2.3.3c and d. Apply D’Alembert’sprinciple for rotational systems, which requires that the algebraic sum of thetorques be zero. We thus have

Figure 2.3.3 Electro-optic scanner: (a) physical representation, (b) velocity diagram,and (c) circuit representation.

T T T( ) ( ) ( )t t tJ D= + inertial torque friction + aal torque

System

Laser Motor

Mirror Bar code

Lens

Detector

Microcomputer

TorqueTorque Angular

velocity

(a)

J J D

TJ TD

D g = 0

g = 0(b) (c)

(d)

T T

Page 81: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 2: Linear continuous-time systems 61

Using the known form for each term, we write

or equivalently,

(2.44)

The zero-input solution is readily found from the homogeneous equation,and the result is

(2.45)

Also, following the same procedure as in the previous example, we obtain

(2.46)

Now, let us use standard techniques of differential equations to find thetransient and steady-state solutions, assuming (0) = 1. The homogeneoussolution is

(2.47)

Since the input to the system is a cosine function, the particular solution isfound by assuming a combination of a sine and a cosine function:

Note that even though the input is a cosine function, we must use both thesine and cosine terms in the trial solution. Combine the particular solutionwith (2.44) to find

0 1 0 05 0 1 0.( )

. ( ) . cos ( )d t

dtt t u t+ =

ddt

t u t+ =0 5 0. cos ( )

zitt e t( ) ( ) .= >0 00 5

( ) ( ) c. . .t e e et t x= +0 0 5 0 5 0 5

zero input� � oos

( ) .

00

0 50

xdx

e

t

t=

zero state� �

++ ++

0 5 0 50 25

00 5

0 0

02

. cos . sin.

.t e tt

htt Ae( ) .= 0 5

p t B t C t( ) cos sin= +0 0

( . ) cos ( . ) sin cosC B t C B t t0 0 0 0 00 5 0 5+ + =

Page 82: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

62 Signals and systems primer with MATLAB

Equating the coefficients of like terms, we find the system

Solving the system, we obtain the values of B and C to be

The complete solution is

For the initial condition (0) = 1, the above equation becomes

Introducing A in the above equation, we find that the angular velocity isidentical to that given by (2.46) with (0) = 1. �

It is important for the reader to recognize the applicability of the methodswe have presented up to here; they can also be applied to any other disciplineas long as they are characterized by the same form of differential equations.Let us consider an example from engineering economics.

Example 2.3.3: Economics. Suppose that the rate of change in the pricep(t) of a commodity, e.g., electronic chips, is proportional to the differencebetween the demand d(t) and the supply s(t) in the market at time t. Deter-mine and study the equation that describes the economic system for the casewhere d(t) and s(t) are linear and proportional to the price, respectively: d(t) =a + bp(t) and s(t) = cp(t), with a, b, and c constants.

Solution: The controlling equation, as expressed by the problem, is

(2.48)

where h is an adjustment constant. The solution of this differential equationis found (following the procedures developed above) to be

0 5 1

0 5 0

0

0

.

.

B C

B C

+ =

+ =

B C=+

=+

0 50 25 0 250

20

02

..

,.

( ).

.cos

.si.t Ae tt= +

++

+0 5

02 0

0

02

0 50 25 0 25

nn 0t

10 5

0 251

0 50 250

202

= ++

=+

A A.

..

.or

dp tdt

h d t s tdp t

dth c b p t ah

( )[ ( ) ( )]

( )( ) ( )= + =or

Page 83: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 2: Linear continuous-time systems 63

(2.49)

The reader is easily able to see that c cannot be equal to b and that c > b mustbe the case, since the price will continuously be increasing. In economics,the price of a commodity when supply is equal to demand is known as theequilibrium price, pe. Then,

d(t) = s(t) or a + pe = cpe

Hence,

and (2.49) becomes

(2.50)

From this we observe that as the time increases to infinity, the final priceapproaches the equilibrium price. It is also obvious that the speed of con-vergence depends on the constants in the exponential as well as on thedifference between the initial price and the equilibrium price. �

2.4 Evaluation of integration constants: initial conditions

Once the complementary solution and the particular solution have beendeduced for a given differential equation, the next step is to determine theconstants of integration that arise in the complementary solution, if thegeneral solution is to be converted to a solution that satisfies all conditionsof a particular problem. The data necessary for this determination are pro-vided by initial conditions that exist in the system. For electrical systems,these conditions are the known charges on all capacitors (usually given asinitial voltages across the capacitors) and known currents through all induc-tors at some specified initial time, usually taken as t = 0. In the more generalcase, the initial conditions would be specified by initial through and acrossvariables pertinent to the system elements. If these initial voltages and cur-rents are zero, the system is said to be initially relaxed. In all cases, thespecified initial conditions must be applied to the complete solution to deter-mine the constants of integration. In this way, the character of the systemdisturbance is taken into account. If the system excitation involves more thanthe switching of input sources — for example, the switching of systemelements — such changes must be taken into consideration.

p t pa

c be

ac b

h c b t( ) ( ) ( )= +0

pa

c be =

p t p p e peh c b t

e( ) [ ( ) ] ( )= +0

Page 84: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

64 Signals and systems primer with MATLAB

Switching of sources

The most common switching operation is that of introducing an excitationsource into the circuit. The most common input waveforms are the stepfunction, sinusoids, pulses, and decaying exponentials. As shown in Table2.3.1, the excitation function establishes the form of the particular solution.

Conservation of charge

If the initial voltages across capacitors are not zero and if, during the switch-ing operation, the total system capacitance remains unchanged, then thevoltage across each capacitor will be the same before and after the switchinginstant. This result assumes the absence of switching impulse to one or moreof the capacitors. It follows from the fact that the terminal relation for thecapacitor is i(t) = Cdv(t)/dt, and in the switching operation during the inter-val from t = 0– to t = 0+, when C is constant,

(2.51)

The value of the integral on the right side is zero unless i is an impulsefunction (delta function). Hence, for a constant C, (2.51) becomes

(2.52)

Equation (2.52) is a statement of conservation of charge (conservation ofmomentum in mechanics). If no current impulse is applied during theswitching operation, the voltage across the capacitor remains constant.

Conservation of flux linkages

If initial currents exist in inductors and if, during the switching operation,the total inductance of the system remains unchanged, then the current

Table 2.3.1 Particular Solutions

Excitation Function (Input) Trial Solution

1. Polynomial Polynomial

(Some ai’s may be zero) (No ci’s are set to zero)2. Exponential function

3. Sine or cosine function

(A or B may be zero) (Both C and D are different from zero)4. Combination of above cases Split excitation into its separate parts, solve

the individual equations, then add the results

f t a a t a t a tnn( ) = + + + +0 1 2

2 � f t c c t c t c tnn( ) = + + + +0 1 2

2 �

f t Aeat( ) = f t Beat( ) =

f t A t B t( ) cos sin= + f t C t D t( ) cos sin= +

Cdv i div

v

( )

( )

0

0

0

0+ +

=

Cv Cv( ) ( )0 0 0+ =

Page 85: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 2: Linear continuous-time systems 65

through each inductor will remain unchanged over the switching instant.This result follows directly from the fact that the terminal relation for theinductor is v(t) = Ldi(t)/dt and, with L constant over the switching interval,

(2.53)

The right-hand side will be zero in the absence of voltage impulses. If sucha situation exists, then

(2.54)

and the current through the inductor remains constant during the switchinginterval. This is a statement of conservation of flux linkages. This conditionis the dual complement of that of the voltage across the capacitor.

Circuit behavior of L and C

In the light of the foregoing discussion, for circuits with constant excitation:

1. Capacitors behave as open circuits in the steady state.2. Inductors behave as short circuits in the steady state.

General switching

In those cases where L or C or both are changed instantaneously during aswitching operation, and in the absence of switching impulses, (2.52) and(2.54) must be modified to the following forms:

For capacitors: conservation of charge:

(2.55)

For inductors: conservation of flux linkages:

(2.56)

As a practical matter, circuits with switched L or C are easily accomplishedby placing switches across all or part of the L or C of a circuit.

Ldi vdti

i

=++

0

0

0

0

( )

( )

Li Li( ) ( )0 0 0+ =

q q

C v C v

( ) ( )

( ) ( ) ( ) ( )

0 0

0 0 0 0

+ =

+ + =

( ) ( )

( ) ( ) ( ) ( )

0 0

0 0 0 0

+ =

+ + =L i L i

Page 86: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

66 Signals and systems primer with MATLAB

Example 2.4.1: Consider the circuit in Figure 2.4.1a, which shows theswitching of the circuit resistance. Observe that the total circuit resistance isR1 before opening the switch and R1 + R2 after the switch operation at t = 0.Find i(t) for t > 0.

Solution: The initial current prior to the switching instant is constantsince the source is assumed to be on for a long time and all the transientshave died out. The initial current has the value

(2.57)

After opening the switch at time t(0+), the controlling differential equa-tion is

(2.58)

The differential equation has the homogeneous solution ih(t) =and a particular solution ip(t) = V/(R1 + R2). The total solution is

(2.59)

To evaluate the constant A, we impose the initial condition, which isi(0–) = i(0+), since no energy-storing elements were altered. Then by (2.54),no instantaneous change in current will occur, and i(0–) = i(0+). Thus, from(2.57) and (2.59), with t = 0, we find

Figure 2.4.1 Resistor switching. (a) Switching of R in a circuit with an initial current.(b) Transient response following switching.

R1 R2

L S V

V R1

V R1 R2 +

DC +

i(t)

(a) (b) t

i iVR0

1

0= =( )

Ldi tdt

R R i t V( )

( ) ( )+ + =1 2

Ae R R t L+( ) /1 2

i t i iV

R RAeh p

R R t L( ) ( ) /= + =+

+ +

1 2

1 2

VR

VR R

A AVR

R R R1 1 2

2

1 1 2

=+

+ =+

or( )

Page 87: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 2: Linear continuous-time systems 67

Therefore, the final solution is

(2.60)

This is sketched in Figure 2.4.1b. �

Example 2.4.2: Refer to Figure 2.4.2a, which shows the switching of L ina circuit with an initial current. Prior to switching, the inductance is L1, andafter the switching, the total circuit inductance is L1 + L2. Switching occursat t = 0. Find the current in the circuit after switching.

Solution: The current in the circuit prior to switching for assumedsteady-state conditions is

(2.61)

To find the current after switching, we employ the law of conservation offlux linkages given by (2.56). Thus, over the switching period

(2.62)

from which

(2.63)

Figure 2.4.2 Illustration of Example 2.4.2.

i tV

R RRR

e R R t L( ) ( ) /=+

+ +

1 2

2

1

1 1 2

iVR

( )01

=

L i L L i1 1 20 0( ) ( ) ( )= + +

iL

L Li

LL L

VR

( ) ( )0 01

1 2

1

1 2 1

+ =+

=+

R2

R1

L2

L1

V DC S

(b)

V

R1 + R2

i(t)

Case L1R2 > L2R1

Case L1R2 < L2R1

i(t)

(a)

+_

t

Page 88: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

68 Signals and systems primer with MATLAB

The differential equation for t > 0 is now of the form

(2.64)

Following the above discussion, the total solution of this equation is

(2.65)

At the switching instant t = 0+,

Therefore, the final solution is given by the expression

(2.66)

The form of this function is illustrated in Figure 2.4.2b. Observe that thecurrent may rise or fall at the switching instant, depending on the relativevalues L1R2 and L2R1. �

2.5 Block diagram representationThe description of system interconnections to this point has been a mathe-matical one that employed the fundamental laws of Kirchhoff, D’Alembert,and others to specify the interconnection of the components of a system bydifferential equations. A second procedure is one that graphically displaysthe interconnected models and then employs techniques of graphical reduc-tions to write the circuit equations. Two important graphical methods exist:the block diagram and signal flow graph (SFG). These techniques are closelyrelated, and consideration will only be given to the block diagrams.

Block diagram portrayals possess the important feature that the signalpaths from input to output are placed in sharp focus without displaying thehardware of the system. Furthermore, they provide tools of analysis thatoften possess advantages over other methods. We will usually proceed inblock diagram developments through a series of mathematical equationsthat are given graphical portrayal.

Refer to Figure 2.5.1. Figure 2.5.1a shows a pick-off point that transmitsthe variable to different branches. Note that the variable is not divided but

( )( )

( ) ( )L Ldi tdt

R R i t V1 2 1 2+ + + =

i t AeV

R RR R t L L( ) ( ) /( )= +

++ +1 2 1 2

1 2

i AV

R RL

L LVR

AL R L R V

R( )

( )0

1 2

1

1 2 1

1 2 2 1

1

+ = ++

=+

=or(( )( )R R L L1 2 1 2+ +

i tV

R RL R L RR L L

e R R t( )( )

( ) /(=+

++

+

1 2

1 2 2 1

1 1 2

1 1 2 LL L1 2+ )

Page 89: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 2: Linear continuous-time systems 69

transmitted to all branches at its original strength. Figure 2.5.1b shows asummation point and the resulting output, Figure 2.5.1c shows a systemthat is characterized by an operator O, for example, an integrator, a differ-entiator, a multiplier, or the like.

To understand the block diagram representation of systems, it is conve-nient to think of the block as a multiplier, where the operator operates onthe input. Hence, if O = a in Figure 2.5.1c, the output is g = af. Figure 2.5.1dshows two blocks in cascade. Clearly, the output is just the successive oper-ation of the operators on the input. If O1 = a and O2 = b, the output is abf.If each of the operators is a derivative, then the output is d2f(t)/dt2. Figure2.5.1e shows the equivalent configuration of Figure 2.5.1d. Figure 2.5.1.fshows the details of a more complicated block diagram.

Figure 2.5.2 shows the most celebrated block diagram in systems andelectronics and, of course, in many other fields, known as the feedbacksystem. The terminology is extensively used in control systems engineering.It is one of the most fundamental configurations of physical and man-madesystems. Without this feedback mechanism, no living creature would havesurvived.

To understand and learn how to build block diagrams for differentsystems, let us consider the RL circuit shown in Figure 2.3.1. The differentialequation that represents the system is

(2.67)

Figure 2.5.1 Elementary rules of block diagram operations.

f

f

f

f

Pickoff point

++ + f1 + f2 ± f3

±

f1

f2

f3

(b)

f

f O1{f } f g

(a)

(c)

Og = O{ f }

O1 O2

g = O2O1{f }

O2 O1

(d) (e)

(f )

+ f

f

f O2 {f }

O1{f }

+O1

O3O2O3 O2{f }

g = O1{f } − O3 O2 {f }

LR

dvdt

v v too+ = ( )

Page 90: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

70 Signals and systems primer with MATLAB

To produce a summation point, we write the equation in the form

(2.68)

This expression shows that the output is equal to the input minus (L/R)times the derivative of the output. To build the block diagram, we start withtwo arrows at opposite sides of the page. The left-side one represents theinput and the right-side one represents the output. Taking into considerationthe properties as given in Figure 2.5.1, we complete the block diagram. Therepresentation of the above equation is shown in Figure 2.5.3a.

Suppose that we write (2.67) in the form

(2.69)

This expression shows that the output of the summation point (L/R)dvo(t)/dtis the difference between the input v(t) and the output vo(t). The blockdiagram representation is shown in Figure 2.5.3b.

A block diagram representation of a given system can often be reducedby block diagram reduction techniques to achieve a block diagram withfewer blocks than the original diagram. A number of block reduction rulesare contained in Figure 2.5.4.

Example 2.5.1: Use Figure 2.5.4 to deduce the complex systems shownin Figure 2.5.5a and b to a single-block diagram. The operators are constantmultipliers.

Figure 2.5.2 Block diagram of a system with feedback. All operators are assumedconstant multipliers.

+ G1 G2

H

R +

±

E

G1E G = G1G2

G2G1E

C

Pickoff point Summing

point

C HC = B

Forward

path

Feedback path

R = Input signal

G = C/E = Forward transfer function H = B/C = Feedback transfer function

C = G2G1E = GE = Output signal GH = B/E = Loop transfer function

T = C/R = System transfer function

E = R ± CH = R ± B = Error signal

or open-loop transfer function

or closed-loop transfer function

v t v tLR

dv tdtoo( ) ( )( )=

LR

dv tdt

v t v too

( )( ) ( )=

Page 91: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 2: Linear continuous-time systems 71

Solution: We observe from Figure 2.5.5a that the output of the summeris H1 f – H2 f. The summer output is the input to the next block, the outputof which is g = H3(H1 f – H2 f) = H3H1 f – H3H2 f. This result is shown in Figure2.5.5c.

Refer next to the Figure 2.5.5b. By entry 4 of Figure 2.5.4 the equivalentrepresentation of the first feedback loop operator is equal to 1/(1 – H1). Byentry 6 of Figure 2.5.4 the equivalent representation of the second feedbackloop operator is H2/(1 + H2H3). These two blocks are in cascade and the finaloperator is the product of these operators, thus forming the final block. Thefinal reduction is sown in Figure 2.5.5d. �

2.6 Convolution and correlation of continuous-time signals

The convolution operation on functions is one of the most useful operationsencountered in the study of signals and systems. The importance of theconvolution integral in systems studies stems from the fact that a knowledgeof the output of the system to an impulse (delta) function excitation allowsus to find its output to any input function (subject to some mild restrictions).

To help us develop the convolution integral, let us begin with the prop-erties of the delta function (see Chapter 1). Based on the delta properties,we write

(2.70)

Figure 2.5.3 Block diagram representation of the system shown in Figure 2.3.1.

+

L

R

d

dt

+

Summer

Scalar multiplier Differentiator

Pickoff point

dvo(t)

dt

dvo(t)

dt

(a)

1

+

−+

L

R

dvo(t)

dt

L

R

R

L

Integrator

v(t)

vo(t)

(b)

vo(t) vo(t)

v(t) vo(t) vo(t)

vo(t)vo(t)

f t f t d( ) ( ) ( )=

Page 92: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

72 Signals and systems primer with MATLAB

Figure 2.5.4 Properties of block diagrams.

a b x y

ab x y Two blocks in

cascade

(a)

Summation point +

+

±x

v

y = x ± v

(b)

x

x

x

x

Pickoff point

(c)

1

1 � ax y + 1

a

x +

±y

Feedback loop

(d)

1 –+ aa x y Special case of unit

Feedback loop

+ a x + y

±

(e)

Page 93: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 2: Linear continuous-time systems 73

Figure 2.5.4 (continued).

+ a x +

1 –+ ab

a x y y

Complete feedback

loop b

±

(f)

a x y

x

a

1/a

x y

x

Moving a pickoff

point ahead

(g)

Moving a pickoff

point behind

a x y

y a

x y

y

a

(h)

+x +

±a

y

v

a +

a

+

±x y

v

Moving a summing

point ahead

(i)

Moving a summing

point behind

a x y

v

+

±+ +

1/a

y

v

+

±

x a

(j)

Page 94: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

74 Signals and systems primer with MATLAB

Observe that, as far as the integral is concerned, time t is a parameter(constant for the integral, although it can take any value) and the integrationis with respect to . Our next step is to represent the integral with its equiv-alent approximate form, the summation form, by dividing the axis intointervals of T; then the above integral is represented approximately by thesum

(2.71)

As T goes to zero and n increases to infinity, the product n T takes thevalue of , T becomes d , and the summation becomes integral, thus recap-turing (2.70).

Note: The function f(t) has been approximated with an infinite sum of shifteddelta functions equal to n T, and their area (see Chapter 1) is equal to f(n T) T.

We define the response of a causal (system that reacts after being excited)and LTI system to a delta function excitation by h(t), known as the impulseresponse of the system. If the input to the system is (t), the output is h(t),and when the input is (t – t0), then the output is h(t – t0). Further, we definethe output of a system by g(t) if its input is f(t). Based on the definitionsdiscussed so far, it is obvious that if the input to the system is fa(t), the output

Figure 2.5.5 Block diagram reduction.

H1

H2

H3

f+

_

g

(a)

+

++

+f

H1

++

H3

H2_

(b)

g

H3H1 – H3H2f g f g1

1 − H1 1 + H2H3

H2

(c) (d)

f t f n T t n T TaT

n

( ) lim ( ) ( )==

0

Page 95: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 2: Linear continuous-time systems 75

is a sum of impulse functions shifted identically to the shifts of the inputdelta functions of the summation, and therefore, the output is equal to

In the limit as T approaches zero, the summation becomes an integral ofthe form

(2.72)

This expression is the convolution integral for any two functions f(t) andh(t) (see also (2.30)).

Let us represent an LTI system by its operator O. Clearly, the operatorO denotes a linear process in the variable t that operates on the input functionto yield the system response. In actual systems, the operator O{.} can be adifferentiator d/dt, an integrator dt, a multiplier, or a combination of all. Wewrite this operation as

(2.73)

Further, we make use of (2.70), which specifies f(t) as an infinite sum ofweighted impulses. Thus,

which is the convolution integral given by (2.72). This expression employedthe definition O{ (t)} = h(t), the system response to a delta function (impulsefunction). Because the system is time invariant, O{ (t – )} = h(t – ) for ashifted delta input, and the response to is . By super-position, the response for all t is that given by (2.72).

Convolution is a general mathematical operation, and for any tworeal-valued functions, their convolution, indicated mathematically by theasterisk between the functions, is given by

(2.74)

g t f n T h t n T TT

n

( ) lim ( ) ( )==

0

g t f h t d( ) ( ) ( )=

g t f t( ) { ( )}= O

g t f t d f t( ) ( ) ( ) ( ) { (= =O O )} ( ) ( )d f h t d=

f t( ) ( ) f h t( ) ( )

g t f t h t f h t d f t h d( ) ( ) ( ) ( ) ( ) ( ) ( )� = =

Page 96: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

76 Signals and systems primer with MATLAB

Observe from the definition that f(t) h(t) = h(t) f(t), which indicates thatconvolution obeys the commutation property.

Note: Equation (2.74) tells us the following: given two functions in the timedomain t, we find their convolution g(t) by doing the following steps:

1. Rewrite one of the functions in the domain by substituting the variable wherever there is t; the shape of the function is identical to that in the tdomain.

2. To the second function we substitute t – wherever we see t; this producesa function in the domain that is flipped (the minus sign in front of the )and shifted by t (positive values of t shift the function to the right andnegative values shift the function to the left).

3. Multiply these two functions and find another function of , since t is aparameter and constant as far as the integration is concerned.

4. Next find the area under the product function whose value is equal to theoutput of the convolution at t (in our case, g(t)). By introducing the infinitevalues of t’s, from minus infinity to infinity, we obtain the output functiong(t).

Example 2.6.1: Deduce the convolution of the following two functions:f(t) = exp(–t)u(t) and h(t) = exp(–0.5t)u(t).

Solution: First, we observe from (2.74) that one of the functions isunchanged when it is mapped from the t domain to the domain. The secondfunction is reversed or folded over (mirrored with respect to the verticalaxis) in the domain, and it is shifted by an amount t, which is just aparameter in the integrand. Figures 2.6.1a and b shows two functions in thet and domains, respectively. We now write

Figure 2.6.1c shows the result of the convolution. �

Note: Observe that the resulting function from the convolution is smootherthan either of them. This smoothing effect is a fundamental property of the convo-lution process.

Example 2.6.2: Discuss the convolution of the pulse functions pa(t) andp2a(t).

Solution: Refer to Figure 2.6.2a, which shows the overlapping of the twopulse functions for different values of t. Figure 2.6.2b shows the resultingfunction g(t). The points on the curve represent the values of the integrals

g t f t h t e u e u t dt( ) ( ) ( ) ( ) ( ). ( )= = 0 5 =

= =

e e d

e e d e

tt

tt

0 5

0

0 5 0 5

02

. ( )

. . ( 0 5. )t te

Page 97: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 2: Linear continuous-time systems 77

at the values of t shown in Figure 2.6.2a. Since the two rectangular pulseshave unit amplitudes, the value of the function is smoother than either ofthe convolving functions, a feature already noted. Figure 2.6.2b shows theresult of the convolution. �

Example 2.6.3: Determine the convolution g(t) = pa(t) (t – 2a).

Solution: This convolution, in integral form, is

By the use of the properties of the delta function, we proceed as follows: Sett – – 2a = 0, from which = t – 2a. Next, introduce this value into the pa( )

Figure 2.6.1 Illustration of Example 2.6.1.

t

f (t) = e−t u(t)1

t

f (t) = e−0.5t u(t)1

(a)

1

1

t

x

a

= a

t

(b)

f ( ) = e u( )

h(t – ) = e–0.5 (t– ) u(t – )

f ( )h(t – t) = e– e–0.5(t– )u( )u(t – )

Area = g(t) =

= t0e e0.5(t )d

e e 0.5(t )u( )u(t )d

g t p t a da( ) ( ) ( )= 2

Page 98: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

78 Signals and systems primer with MATLAB

function. The resulting function is given by g(t) = pa(t – 2a). This shows thatwe have recaptured the function pa(t), although it is shifted to the point wherethe delta function was located. �

Note: Any time we convolve a function with the delta function, there is noneed to do the integration. Simply, we shift the function by the same amount thedelta function has been shifted.

Figure 2.6.1 (continued).

Figure 2.6.2 Graphical representation of the convolution of two-unit pulse functions.

2

–2

(c)

t

g1(t) = 2e–0.5t u(t)

g(t) = g1(t) + g2(t)

g2(t) = –2e–t u(t)

(a)

–2a 2a–4a

1

pa(t − τ) p2a(t)

t = –3a

1

2a–2a

t = –2a

pa(t − τ)p2a(t)

–2a

1

2a

pa(t − τ)

t = –a

p2a(t)

2a–2a

1

t = 2a

p2a(t) pa(t − τ)

–2a 2a

1

t = 3a

p2a(t) pa(t − τ)

τ τ τ

ττ

Page 99: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 2: Linear continuous-time systems 79

Example 2.6.4: Determine the convolution of the functions f(t) = p1/2[t –(1/2)] and h(t) = 2p1/2[t – (1/4)].

Solution: Figure 2.6.3 includes the details of the solution. �

Figure 2.6.2 (continued).

Figure 2.6.3 Illustration of Example 2.6.4.

a

–a a t•

–3a 3a

(b)

2a

g(t) = pa(t) ∗ p2a(t)

1

1

2

t

t 1 t – 0.5

2

t

t – 0.5

1

2

t0 f ( )h(t – )d = t

01•2•d = 2t 0 t 0.5

tt–0.5 f ( )h(t – )d = t

t–0.51•2•d = 1 0.5 t 1

1t–0.5 f ( )h(t – )d = 1

t–0.51•2•d = 2(1.5 – t) 1 t 1.5

1

1

t

f(t) = p1/2(t – 0.5)

1

1

f( ) = p1/2( – 0.5)

–0.5

2

h( ) = 2p1/4(– – 0.25)

0.5

2

t

h(t) = 2p1/4(t – 0.25)

Page 100: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

80 Signals and systems primer with MATLAB

When a signal is applied to a causal system, its output (response) cannever precede the input. We can split the convolution integral (see (2.74))into two parts:

(2.75)

The function gzi(t) is the zero-input response of the system, and gzs(t) is thezero-state response of the system, where t0 is arbitrarily taken as the initialtime. The symbol t0– indicates that functions with finite discontinuities areincluded in the definition of the zero-state response.

The second convolution integral represents the zero-state response ofthe system. This integral specifies that at time t = t0, the system is relaxed;that is, there were not charges on capacitors and currents through the induc-tors, no deformation of springs, no velocities of masses, etc. However, if theinitial state of the system is not zero, we must add a zero-input responseproduced by the initial state at t = t0.The integral gzi(t) specifies that the stateat t = t0 depends on the inputs prior to that time. The solution after t0 dependson the state of the system at that time (initial conditions), and it is immaterialhow the initial conditions were attained.

Example 2.6.5: Associative property of convolution. Shaw, by applyingthe convolution integral, that [f1(t) f2(t)] f3(t) = f1(t) [f2(t) f3(t)] = g(t) for thefunctions shown in Figure 2.6.4a. The above relationship is the associativeproperty of the convolution integral.

Solution: We have found in Example 2.6.1 that

Figure 2.6.4 Illustration of Example 2.6.5.

g t f t h t f h t dt

g tzi

( ) ( ) ( ) ( ) ( )

( )

�� �

=0

� � + =

+

f h t d gt

g t

zi

zs

( ) ( )

( )

0

(( ) ( )t g tzs+

f t f t f t e e u tt t( ) ( ) ( ) ( ) ( ).= =1 20 52

(a)

t

1

f1(t) = e–t u(t)

t

1

f2(t) = e–0.5t u(t)

(b)

t

1

f(t) = u(t)

2

10 t

g(t)

Page 101: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 2: Linear continuous-time systems 81

Therefore, g(t) = f(t) f3(t) is given by

However, u(t – ) = 0 for t < and u( ) = 0 for < 0, so that the integral becomes

Next, we consider the alternate form. We begin with the convolution

Then,

The two relationships for these particular functions are identical. It canbe proved that this associative property is always true for all functions thatcan be used in the convolution integral. �

An important input function in system studies is (see also Sec-tion 1.2). For any specific value of omega, f(t) is a complex function havinga real part cos t and imaginary part sin t. In polar form representation, thefunction has magnitude 1 and phase t. If t = 0, the point in the complexplane is at the real axis and at a distance 1. As t increases, the values of thefunction describe a unit circle. After the value 2 / of t, the circle is repeated.Because f(t) is the input to an LTI system, its output is given by

(2.76)

g t f f t d e e u u t( ) ( ) ( ) ( ) ( ) (.= =30 52 )d

g t e e d e e u tt

t t( ) ( ) ( ) (. .= = +2 2 2 40 5

0

0 5 ))

f t f t e u u t d e d2 30 5 0 5( ) ( ) ( ) ( ). .= =

00

0 52 2t

te u t= ( ) ( ).

g t e u e u t d et t( ) ( ) ( ) ( ). ( )= =2 2 0 5 (( )

( ) ( )

.

.

2 2

2 4 2

0 5

0

0 5

e e d

e e u t

t

t t= +

f t ej t( ) =

g t h f t d h e d

e

j t

j

( ) ( ) ( ) ( ) ( )= =

= t j j th e d e H( ) ( )=

Page 102: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

82 Signals and systems primer with MATLAB

where

(2.77)

is the system function or transfer function of the system at frequency .The transfer function H( ) is called the Fourier transform (more will be saidabout the Fourier transform of signals in a later chapter) of the system’simpulse function h(t). Also in this context, ej t is the eigenfuction of thesystem and H( ) is its eigenvalue. As we know from our circuit analysisdefinition, the transfer function is equal to the ratio of the output to the inputof a relaxed system when the excitation is the sinusoidal signal.

The transfer function is complex and can be separated into its real andimaginary parts, Cartesian form. It can also be represented in its polar form.To see how to find the transfer function using the circuit analysis approach,let us find the transfer function for the system shown in Figure 2.3.1a.

The differential equation describing the system is given by

(2.78)

If the input to this relaxed system (zero initial conditions) is the complexexponential function exp(j t), the output is Aexp(j t), where A is an arbitraryconstant. Introducing this function in the above equation, we obtain

(2.79)

The Cartesian form of the above transfer function is

(2.80)

where Hr(.) and Hi(.) are real functions of omega. The corresponding polarform of this transfer function for any value of omega is

(2.81)

H h e dj( ) ( )=

Ldi tdt

Ri t v tdv t

dtRL

v tRL

v too

( )( ) ( )

( )( ) (+ = + =or )) ( ) ( )v t Ri to =

d Aedt

RL

AeRL

e j AeRL

Aej t

j t j t j t j t( ) + = + =orRRL

e

Aee

RL

jRL

Hvolt

j t

j t

j t

or

or+ = =( )aage out

voltage inVV

RR j

o= =+

( )( )

HR R j

R j R jR

Rj

RHr( )

( )( )( )

=+

=+ +

2

2 2 2 2� (( ) ( ( ))+ j Hi

H H H e H er ij j( ) [ ( ) ( )] ( ) ;

(

/ ( ) ( )= + =2 2 1 2

) tan [ ( ) ( )]= 1 H Hi r/

Page 103: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 2: Linear continuous-time systems 83

In case the input function was cos t = Re{ej t}, the output would have been

The above equation indicates that the system for every sinusoidal signalinput will create a sinusoidal with the same frequency, but phase shifted andamplitude modified. This shows the importance of transfer function. Inpurchasing an audio amplifier, we are interested in knowing if the amplitudeof the transfer function H( ) vs. frequency is flat for all audio frequencies.This observation indicates that all frequencies of speech or melodies willpass undisturbed. The phase also plays a role in passing undisturbed inputs.

Note: For any linear operation, such as integration, we can find the real(imaginary) part of the resulting quantity by taking first the real (imaginary) partof the integrand and then integrate, or integrate first and then taking the real(imaginary) part of the integration results.

Note: LTI systems that have real-valued impulse responses, the eigenvaluesH( ), are Hermitian. A transfer function is Hermitian if its real part is even andits imaginary part is odd. Equivalently, the amplitude is an even function and thephase is an odd function of frequency.

A reasonable question is whether, given the output g(t) and the inputf(t), it is possible to deduce h(t). The process, known as deconvolution, isoften encountered in communications while trying to measure the responseof the communication channel (space, wires, fibers). However, deconvolutionhas no direct mathematical definition in the time domain and merely con-notes the inverse of the convolution operation. Owing to errors and noiseassociated with practical measurements, exact knowledge of the decon-volved time signals is not possible, and approximations must be made. Thedeconvolution process lends itself to better interpretation in the frequencydomain, where it becomes an approximation and a filtering problem.

Matched filters

One important procedure for signal detection is the matched filtering oper-ation. If we receive a signal s(t) and want to maximize at t0 in some sense,we pass the signal through a system whose impulse response is the shiftedand flipped form of the received signal, h(t) = s(t0 – t). Let the signal be thatshown in Figure 2.6.5a. Let the impulse response be that shown in Figure2.6.5b, h(t) = s(–t), where it is assumed that t0 = 0. Therefore, the output ofthe system is the convolution of these two signals, and the result is shownin Figure 2.6.5c. Observe that the maximum point of the output is at t = 0.Next, we set t0 = 1. Then, the two corresponding functions are shown inFigures 2.6.5d and e. The output of the system is the convolution of these

g t e H H e Hj t j t( ) Re{ ( )} Re{ ( ) } ( ) c( ( ))= = =+ oos( ( ))t +

Page 104: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

84 Signals and systems primer with MATLAB

two signals, and the result is shown in Figure 2.6.5f. Since in this case t0 = 1,the maximum point is located at t = 1.

Correlation

Correlation is an important concept in the study of random signals andserves to relate the average intensity (or power), an observable quantity, withspecified time-average values of members of a family of functions definedon a probability space. Correlation techniques are used in many fields,including medicine when acoustic (ultrasonic) waves are used as probes todetect anomalies inside the human body. This technique also finds importantapplications in many areas of physics and technology. It is routinely used inradar signal detection when correlation is performed between the emittedsignal and the signal returned from a target. A large peak indicates a resem-blance between the returned signal and the emitted signal, from which it isinferred that a target is present.

Mathematically, correlation is a process somewhat similar to convolu-tion. The mathematical procedures are identical to those used in a convolutionoperation, with the only difference that the shifted signal is not flipped, andthe commutative property of cross-correlation (correlation between two dif-ferent signals) is not obeyed. The cross-correlation of two different functionsis defined by the relation

(2.82)

When f(t) = h(t), the correlation operation is called autocorrelation. Itcan be shown, using Schwartz inequality, that the following relation is true:

Figure 2.6.5 Illustration of matched filtering operation.

s(t)

1 t

1

(a)

h(t) = s(–t)

t1

1

(b)

s(t) ∗ h(t)

1

–1 1 t

(c)

s(t)

(d)

1

1 t

h(t) = s(1 – t)

(e)

1

1 t

s(t) ∗ h(t)

(f )

1 t

1

R t f t h t f h t d f t h dfh( ) ( ) ( ) ( ) ( ) ( ) ( )� � = = +

Page 105: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 2: Linear continuous-time systems 85

(2.83)

This equation indicates that there is a time t = 0 at which the absolute valueof the autocorrelation function is equal to or greater than at any other time.This fact is of great importance in signal detection.

Example 2.6.6: Find the correlation between a pulse transmitted by radarequipment, as shown in Figure 2.6.6a, and each of the two possible receivedpulses shown in Figures 2.6.6b and c.

Solution: The correlation between the transmitted signal and the iden-tical received one can be easily accomplished by using the graphicalapproach. At zero shifting, t = 0, the two pulses do not overlap, and theoutput is zero. This result is the same until t = 1. Then the two pulses startoverlapping, and since the overlap is linear, the resulting output is thatshown in Figure 2.6.6d. Observe that the correlation signal is displaced byone unit of time. This indicates the time it took the signal to reach the targetand return to radar. This is how air traffic controllers know exactly how farairplanes are from the airport. For the case of s2(t), we proceed to performthe calculations for each pulse independently and then add the two results.Figure 2.6.6e is the final correlation output. We observe that if the returnedpulse is highly distorted, we may not be able to detect for sure the existence

Figure 2.6.6 Illustration of the correlation principle.

R t f t f t Rff ff( ) ( ) ( ) ( )� � 0

1

1

s(t)

t

(a)

s1(t)

1

t

(b)

s2(t)

2

2.25 –1

1 2.5

3 t

(c)

1

1 3 t

0.5

s(t) s1(t)

(d)

0.5

–0.25 1

1.5

2.25 3 t

s(t) s2(t)

(e)

2 3

Page 106: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

86 Signals and systems primer with MATLAB

of a target. If, for example, we had set a threshold level at 0.5, to avoid smallvariations of the returned signal, then the second returned signal would nothave indicated a target. �

Now that we have learned about convolution, let us return to (2.30) andassume the initial condition vo(0) = 0. Hence, the equation takes the form

(2.84)

The above equation indicates that the output of the system is the convolutionof the input v(t) and the function h(t) = (R/L)e–(R/L)t, which is the impulseresponse of the system. This fact will be shown in the next section.

Note: The output of an LTI system is equal to the convolution of its impulseresponse (the output of a relaxed system when its input is a delta function) and itsinput.

2.7 Impulse responseAs discussed above, we require a knowledge of the impulse response h(t) ifwe are to apply convolution techniques to the solution of system problemswith general excitation functions. The following sequence arises from thesystem description:

(2.85)

where O denotes the system operator, with O–1{g(t)} denoting the controllingdifferential equation of the system. By definition, h(t) is the response functionwhen f(t) = (t) and the system is relaxed (zero initial conditions), that is

(2.86)

However, the delta function exists only at t = 0; then, we split the probleminto two parts:

(2.87)

Note that (2.87) a) provides information about features of h(t) only at t = 0,and so provides initial conditions on h(t) that can be used in the solution ofthe resulting homogeneous differential equation in h(t) specified by (2.87) b).

v tRL

e e v x dxRL

eot R L x R L

tR L( ) ( )( / ) ( / ) ( / )(= =

0

tt xt

v x dx) ( )0

g t f t( ) { ( )}= O

h t t( ) { ( )}= O

h t t a h t bt t

( ) { ( )} ); ( ) { } )= >

= =0 0

0O O

Page 107: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 2: Linear continuous-time systems 87

A second approach is to use the fact that the impulse response h(t) of asystem is the time derivative of the response of the system, yu(t), to a unitstep function, u(t). This response function is given the name indicialresponse. Symbolically,

(2.88)

(2.89)

In the chapter dealing with the Laplace transform we will show how tofind the impulse response of a system. Here, however, we will use theapproach provided by (2.87) and (2.89).

Example 2.7.1: Find the zero-input and zero-state response of the systemdescribed in Example 2.3.1 if the initial condition for the velocity is v(0) = 2,the input force is f(t) = e–2tu(t), M = 1 kg, and D = 0.1 N s/m.

Solution: The differential equation that describes the system is given by

(2.90)

If f(t) is the delta function, then the above equation becomes

(2.91)

We have changed the v to h to indicate that the input to the system is thedelta function. However, the impulse response h(t) has the same units asvelocity, that is, m/s. Next, we multiply the above equation by dt andintegrate from 0– to 0+. Hence,

(2.92)

from which we obtain

(2.93)

y t u tu( ) { ( )}= O

h tdy t

dtu( )( )=

dv tdt

v t f t( )

. ( ) ( )+ =0 1

dh tdt

h t t( )

. ( ) ( )+ =0 1

dh tdt

dt h t dt t dt( )

. ( ) ( )+ =++ +

0 10

0

0

0

0

0

h h h t dt t dt( ) ( ) . ( ) ( )0 0 0 1 10

0

0

0

+ + = =+ +

Page 108: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

88 Signals and systems primer with MATLAB

where the property of the delta function was used on the right side of theequation. The second integral vanishes since h(t) does not have an infinitediscontinuity at t = 0, and it is assumed to be a well-behaved function. Thisindicates that the area under the h(t) curve of zero distance is zero. Further-more, the system is relaxed at t = 0, and therefore h(0–) = 0. Thus, we have that

For t > 0, (2.91) becomes a homogeneous differential equation:

This equation has the solution

Using the known value for h(0+), it follows that A = 1. Therefore, the impulseresponse of the system is

(2.94)

The zero-state response is equal to the convolution of the input and theimpulse response of the system. Hence, we obtain

(2.95)

From the homogeneous equation of (2.90) we find its solution to be

Applying next the initial condition v(0) = 2, we find the value of B to beequal to 2. Hence, the total solution is

(2.96)

h( )0 1+ =

dh tdt

h t( )

. ( )+ =0 1 0

h t Ae tt( ) .= >0 1 0

h t e t m st( ) ( ).= >0 1 0 /

v t h t f t e e dx ezsx t x

t

( ) ( ) ( ).

(. ( )= = =0 1 2

0

11 9

>0 1 2 0. )t te t

v t Beht( ) .= 0 1

v t e et

zero inputsolution

t( ).

(. .= +21

1 90 1 0 1� e t

zero statesolution

2 )� �

Page 109: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 2: Linear continuous-time systems 89

Example 2.7.2: Determine the output of the system shown in Figure2.7.1a if the input is a unit pulse function.

Solution: To determine the impulse response function of the system, wefirst write the controlling differential equation that describes the system:

Therefore, the solution of the above equation gives the voltage output. Fora delta function input we obtain

Figure 2.7.1 Illustration of Example 2.7.2.

di tdt

i t v t v t i t i to( )

( ) ( ) ( ) ( ) ( )+ = = × =1

dh tdt

h t t( )

( ) ( )+ =

DC vo(t)R = 1

L = 1

(a)

+–

v(t) = p1/2 (t – 0.5)h(t)

vo (t) = v(t) ∗ h(t)

(b)

e − 1

e

1 t

g(t)

x1t

e–(t – x)u(t – x)1

p1/2(x – 0.5)

1

1 xt

e–(t – x)u(t – x)p1/2(x – 0.5)

∫t0 1• e–(t – x)dx = 1 – e–t 0 ≤ t < 1

∫10 1• e–(t – x)dx = e–t (e – 1) 1 ≤ t < ∞

g(t) = p1/2 (t – 0.5) ∗ (e–tu)(t)

Page 110: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

90 Signals and systems primer with MATLAB

Following the procedure developed in the previous example, the impulseresponse is

Let us also find the impulse response using the second method, whichis the solution to the relaxed system when the input is a step function. Wefirst find the homogeneous solution, which is ih(t) = Ae–t. Next we find theparticular solution by introducing the constant B as the solution. Hence, weobtain

or B = 1. The total solution is i(t) = Ae–t + 1, and after introducing the initialcondition i(0) = 0, we find A to be –1. Hence, the solution is i(t) = 1 – e–t.Therefore, the impulse response is (see (2.89))

which is identical to the expression found previously. By convolution, thesystem response is

The essential details of the convolution evaluation are contained in Fig-ure 2.7.1b. �

Example 2.7.3: Low-pass filter: The node equation describing the systemshown in Figure 2.7.2a is

(2.97)

Determine the general form of the solution and also the solution to thedelayed input current function i(t – t0).

Solution: We first consider the step function response to this circuit,which is the solution to

(2.98)

h t e tt( ) = > 0

0 1+ =B

h tdi tdt

e e tt t( )( )

( )= = = >0 0

v te t

e e to

t

t( )

( )=

<

<

1 0 1

1 1

dv tdt

v tRC C

i t( ) ( )

( )+ = 1

dv tdt

v tRC C

u t( ) ( )

( )+ = 1

Page 111: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 2: Linear continuous-time systems 91

The solution to the homogeneous equation is found to be

(2.99)

where A is an unknown constant to be determined from the initial condition.Now, we consider the particular solution to a step function excitation

u(t). This requires the solution of

(2.100)

We observe that the right-hand side is a constant. Hence, we assume thatthe particular solution is equal to some constant B, that is, vp(t) = B. Intro-ducing this value into (2.100), we obtain B/(RC) = 1/C. From this, theparticular solution is vp(t) = R. Attention is called to the fact that R is mul-tiplied by a unit current; hence, this result is dimensionally correct. Therefore,the total solution is

(2.101)

The value of A is deduced by applying the initial condition v(0) = 0 for therelaxed system. As a consequence, we have

Figure 2.7.2 Low-pass filter.

h(t)v(t)

v(t)

(a)

i(t)

i(t)

R C

+

i(t) v(t) v(t)

v(t)

1

C

1

RC

++

(b)

v t Aeht RC( ) /=

dv tdt

v tRC C

t( ) ( )+ = >1

0

v t v t v t Ae Rh pt RC( ) ( ) ( ) /= + = +

v Ae R A RRC( ) /0 0 0= = + =or

Page 112: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

92 Signals and systems primer with MATLAB

The complete solution is

(2.102)

Now, making use of the fact that the impulse response is the time derivativeof the unit step function response, we have

(2.103)

With the knowledge of the impulse response of the system, we candetermine the response to an arbitrary input i(t – t0) using the convolutiontheorem. For the output, we find

The limits in the second integral were defined from the definition of the unitstep function and the condition imposed on the current. The step functionu(t – x) is zero for x > t and i(x – t0) is zero for x < t0. To carry out theintegration, set x – t0 = y, then dx = dy. In addition, at x = t0, y = 0, and atx = t, y = t – t0, and the step function is unity within these limits. We thusobtain

This equation indicates that this system is time invariant, that is, the quantityt – t0 substitutes for t in (2.97). In other words, a shifted input of t0 producesa shifted output of t0. Figure 2.7.2b is a block diagram representation of (2.97).The block diagram was obtained after we multiplied the equation with dtand integrated both sides. This procedure produced the following expression:

*Example 2.7.4: Determine the impulse response of an initially relaxedRLC series circuit with L = 1 H, R = 5 , and C = 0.25 F.

Solution: The integrodifferential equation describing the system is

(2.104)

v t R e tt RC( ) ( )/= >1 0

h tdv t

dt Ce tt RC( )

( ) /= = >10

1 10 0

0Ce u t x i x t u x t dx

Ct x RC

t=( )/ ( ) ( ) ( )

ttt x RCe u t x i x t dx( )/ ( ) ( )0

10

0

00C

e i y dy v t tt t y RCt t

[( ) ]/ ( ) ( )�

v tRC

v t dtC

i t dt( ) ( ) ( )= +1 1

Ldi tdt

Ri tC

i t dt v t( )

( ) ( ) ( )+ + =1

Page 113: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 2: Linear continuous-time systems 93

We write this equation in differential equation form by writing i(t) =dq(t)/dt, with the result

(2.105)

For a delta function input, this equation becomes

(2.106)

First, we establish the initial conditions that permit a solution to theabove equation. The system is initially relaxed so that

(2.107)

Now, let us integrate (2.106) between the limits t = 0– and t = 0+. We thuswrite

(2.108)

The third integral is zero because the area under a continuous function from0– to 0+ is zero. Also, the area under the delta function is unity. The result is

(2.109)

which becomes, by (2.107),

(2.110)

Now, we integrate (2.106) twice, which yields

Assuming h(t) to be a well-behaved function, the second term is zero becausethe area under h(t) within the limits from 0– to 0+ is zero. The first integration

d q tdt

dq tdt

q t v t2

25 4

( ) ( )( ) ( )+ + =

d h tdt

dh tdt

h t t2

25 4

( ) ( )( ) ( )+ + =

dhdt

h( )

( )0

0 0= =

d h tdt

dtdh t

dtdt h t dt

2

20

0

0

0

0

0

5 4( ) ( )

( )+ ++ + ++ +

= ( )t dt0

0

dhdt

dhdt

h h( ) ( )

[ ( ) ( )]0 0

5 0 0 1+ + + =

dhdt

h( )

( )0

5 0 1+ + + =

dh tdt

dt h t dt h t dtdt( )

( ) ( )0

0

0

0

0

0

05 4

+ + +

+ ++ ++

=0

0

0

0

0

( )t dtdt

Page 114: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

94 Signals and systems primer with MATLAB

of the third term will produce a well-behaved function, and hence the secondintegration will give a value of zero. The first integration of the fourth termwill produce the value of 1, a well-behaved function, and thus the secondintegration will produce zero. Hence, the above equation becomes

(2.111)

Combining (2.111) with (2.110) yields

(2.112)

This result indicates that the impulse source forces the current dq(t)/dtdh(t)/dt to jump instantaneously, in this case from 0 to 1, while the chargeremains at zero.

We next proceed with the solution (2.106), noting as before that (t) = 0for t > 0. Thus, the equation under consideration is

(2.113)

For an assumed solution of the form h(t) = Aexp(st), the characteristic equa-tion becomes

The solution of the above homogeneous equation is

Introducing the initial conditions in the above equation and solving thesystem for the two unknown constants B and C, we obtain

or B = –1/3 and C = 1/3. Therefore, the solution is

(2.114)

h h h( ) ( ) ( )0 0 0 0 0+ = + =or

dhdt( )0

1+ =

d h tdt

dh tdt

h t t2

2 5 4 0 0( ) ( )

( )+ + = >

Initial condittions: hdh

dt( )

( )0 0

01+ = + =

s s s s21 25 4 0 4 1+ + = = = with roots ,

h t Be Cet t( ) = +4

h B Cdh

dtB C( ) ,

( )0 0

01 4+ = = + + = =

h t q t e e tt t( ) ( )� = + >13

13

04

Page 115: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 2: Linear continuous-time systems 95

The current through the circuit is found by taking the derivative of the aboveequation. �

*Example 2.7.5: Repeat Example 2.7.4, but now proceeding from (2.104).

Solution: We proceed now by writing the equation

(2.115)

We consider this equation at two specific instants of time, t = 0– and t = 0+,and subtract the two. The result is

We recall that the delta function is zero at any value of t besides t = 0;thus, . Further, the area under the h(t) curve within thoselimits is zero. In addition, h(0–) = dh(0–)/dt = 0, and thus the above equationbecomes

(2.116)

Now we consider the integral of (2.115) over the limits t = 0– and t =0+. This gives

Remembering that the area under the delta function is unity and that h(t) isa smooth function, we then have that

(2.117)

Combine this result with (2.116) to get

(2.118)

[ ( ) ( )]h t i t�

dh tdt

h t h t dt t( )

( ) ( ) ( )+ + =5 4

dhdt

dhdt

h h h( ) ( )

[ ( ) ( )] (0 0

5 0 5 0 4+ + + + tt dt t) ( )

0

0

0

0+ +=

( ) ( )0 0 0= + =

dhdt

h( )

( )0

5 0 0+ + + =

dh tdt

dt h t dt h t dt( )

( ) ( )0

0

0

0

0

0

5 4+ +

+ +++ +

=dt t dt( )0

0

h h h( ) ( ) ( )0 0 1 0 1+ = + =or

dhdt( )0

5+ =

Page 116: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

96 Signals and systems primer with MATLAB

To find the solution for h(t) and for t > 0, differentiate (2.115), whichyields the differential equation

Since (t) = 0 for t > 0, the derivative of (t) is also equal to zero for t > 0. Theresulting differential equation is precisely that given by (2.113), and henceits final solution is

Next, apply the initial conditions given by (2.117) and (2.118) to obtain thefinal solution:

(2.119)

Observe that the derivative of (2.114) yields (2.119), as it should, sincedq(t)/dt = i(t). �

Important definitions and concepts

1. Mathematical modeling of analog electrical systems2. Causality3. Mathematical modeling of linear and rotating mechanical systems4. Zero-input and zero-state solutions5. Transient and steady-state solution6. Initial conditions7. Block diagram representation of systems8. Block diagram transformations9. The feedback concept

10. Convolution of signals11. Correlation of signals12. Impulse response of systems13. Matched filtering14. Edge detection (see Problem 2.6.8)15. Monte Carlo calculations (see Problem 2.2.7)16. Energy associated with electrical circuits17. Environmental engineering (see Problem 2.3.14)18. Heat transfer (see Problem 2.3.8)

d h tdt

dh tdt

h td t

dtt

2

5 4 0 0( ) ( )

( )( )+ + = = >

h t i t Be Ce tt t( ) ( )� = + >4 0

h t i t e e tt t( ) ( )� = >43

13

04

Page 117: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 2: Linear continuous-time systems 97

Chapter 2 ProblemsSection 2.2

1. Develop the block diagram representation of the system shown inFigure P2.2.1 and explicitly identify the operator of the system, O.

2. a. Find the current through an inductor of 1 H at t = 0 s and at t =2 s if the voltage waveform across the inductor is that shown inFigure P2.2.2a.

Figure P2.2.1

Figure P2.2.2

i(t) i(t)

(a) (b)

L C

+ +

vo(t) vo(t)

(c)

Mf(t)

v(t)

f(t) = force (N)

M = mass (kg)

v(t) = velocity (m/s)

v(t)

2

–2

–3 –1

4

t

(a)

–4

4

–3 –1

2

t

i(t)

(b)

Page 118: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

98 Signals and systems primer with MATLAB

b. Find the voltage across an inductor of 1 H at t = 0 s and at t =2 s, if the current waveform through the inductor is that shownin Figure P2.2.2b.

3. Find the energy dissipated by a resistor of 5 for currents throughit that have the waveforms shown in Figure P2.2.3.

4. Forces of the form shown in Figure P2.2.4 are applied to a springwith a spring constant K = 2. Determine the functional form of thevelocity corresponding to these two forces.

5. A time-varying torque is applied to a rotating body that has a polarmoment of inertia of 2 kg-m2. Plot the angular velocity of the rotatingbody if the torque is that shown in Figure P2.2.5.

6. A current source having the fundamental form i(t) = e–�t�u(t + 2) isapplied through a capacitor of 0.5 F. Find the voltage and chargeacross the capacitor if the current source remains applied for aninfinite time.

7. Monte Carlo method. (Monte Carlo method is one of the most im-portant practical methods for solving differential equations, findingvalues of multidimensional integrals, performing simulations, filter-ing signals using particle filters, etc.) A force having the functionalform i(t) = e–tp1/2(t – 0.5) is applied to a mass of a 1 kg. Determinethe velocity of the mass. Compare your results with the results ob-tained by using the following numerical procedure, known as the

Figure P2.2.3

Figure P2.2.4

–1

1

i(t) (A)

t3

(a)

3 t–1

1e−t u(t)

(b)

i(t) (A)

1 3 t

1

3

f(t)

(a)

1.5

2 3

1

–1

f(t)

(b)

t

Page 119: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 2: Linear continuous-time systems 99

Monte Carlo method. Here, because the curve lies within a unitsquare, use a random number generator supplied by MATLAB, forexample, to produce randomly values from 0 to 1. For any pair ofgenerated numbers (ti1, ti2) corresponds a point inside the square. Ifthe total number of trials is N (use N = 100, 1000, 10,000) and n denotesthe number of times that f(ti1) > ti2 is satisfied, then the value of theintegral is approximately equal to n/N.

Book MATLAB function

function[v]=ssvelocitymc(N)

n1=0;

for n=1:N

t1=rand;

t2=rand;

if exp(-t1)>=t2;

n1=n1+1;

end;

end;

v=n1/N

(It is recommended that the reader develops his or her own MATLABfunction and compare results.)

8. The energy delivered to each electrical element — resistor, inductor,and capacitor — between t1 t t2 is given by t1

t1v(t)i(t)dt, where v(t)

is the voltage across the element and i(t) is through it. Deduce ex-pressions for the energies ER, EL, and EC.

9. The switch to the relaxed circuit (zero initial conditions) shown inFigure P2.2.9 is closed at t = 0. The voltage across the RC parallelcombination is v(t) = 0.5(1 – e–10t). Determine (a) the energy delivered

Figure P2.2.5

t

–1

2

–2 1 3

T(t)

Page 120: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

100 Signals and systems primer with MATLAB

by the source at time t, (b) the energy dissipated in the resistor, and(c) the energy stored in the capacitor. From your answer, draw afundamental conclusion that is the property of any type of RLCcircuits.

Section 2.3

1. Represent the following differential equations in block form:

a. 0.5(dy/dt) = 4y + exp(–t)u(t)b. (dy/dt) – y – 2tu(t) = sin t u(t)

2. Find the equilibrium equations for each network shown in FigureP2.3.2. Specify the initial conditions, assuming that the situationshown existed for a time before the switching operation was initiated.The solutions are not required. What conclusions can be drawn fromthese results?

3. Find the transient and steady-state solutions for the relaxed systemgiven in Figure P2.3.3.

Hint: Assume a trial solution of the form v(t) = a0 + a1t + a2t2 indetermining the particular solution.

4. Find the zero-input, zero-state, transient, and the steady-state solu-tions for the system shown in Figure 2.3.1. The input voltage is v(t) =exp(–0.5t)u(t). The initial current is i(0) = 1.5 A.

Figure P2.2.9

Figure P2.3.2

i(t)

i(t)

iR(t) ic(t)

R = 100 Ω C = 1 mF

I S

C V

+

+

R1

R2 R1

R2S

L

iR1(t)

vc(t)

ic(t)iL(t)

Page 121: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 2: Linear continuous-time systems 101

5. Find the zero-input, zero-state, transient, and steady-state solutionsof the system shown in Figure 2.3.3a. The input force is f(t) = 10–4

exp(–t)u(t) + u(t). The initial velocity is v(0) = 2 m/s.6. A current is applied to the circuit shown in the block diagram in

Figure P2.3.3. Determine the zero-input and zero-state responses. Setv(0) = 1.

7. Repeat Problem 2.3.3 for the transient and steady-state responses, butnow by determining the zero-input and zero-state responses of theinitially relaxed system. Compare these results with those obtainedin Problem 2.3.3.

8. Heat transfer. The temperature outside a digital chip is constant andequal to T0 = 22˚C. Because of currents in the chip, heat is generateduniformly at the rate Q. The temperature inside the chip isconsidered to be uniform throughout the chip at temperature T˚C.The total rate of change of heat within the chip is equal to mcp(dT/dt),where m is the mass of the chip and cp is its heat capacity. This heatis equal to the rate at which heat is supplied by the source Q plusthe rate at which the heat is transferred to the chip from the sur-rounding air. Thus, we write mcp(dT/dt) = –Ko(T – To) + Q, whereKo(T – To) is the rate of heat transfer into the chip from the surroundingair (or heat sink). Given that m = 50 g, cp = 0.15 cal/g-C˚, Ko = 3 cal/C˚,and Q = e–t + cost cal for t > 0, determine the transient and steady-statesolutions for the chip temperature.

Hint: Find the particular solution separately for exp(–t) and cost andadd the results. This superposition is valid because differentiation isa linear process.

9. The current in the circuit shown in Figure P2.3.9 is i(t) = 2(1 –exp(–2t))u(t). Determine the input voltage.

10. Determine the zero-input, zero-state, transient, and steady-state so-lutions for the current in the circuit shown in Figure P2.3.9. The inputvoltage is v(t) = 4 + exp(–4t) for t > 0. The circuit is initially relaxed.

Figure P2.3.3

v(t)i(t)

(b)

(a)

2 Ω0.5 F

+

Systemvo(t)

i(t) = (1 + t2)u(t)

Page 122: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

102 Signals and systems primer with MATLAB

11. Vibration isolator. A force f(t) = 2exp(–t) for t > 0 is applied to thesystem shown in Figure P2.3.11. This type of system is often used asa vibration isolator. Determine the distance x traveled by the top levelof the initially relaxed system.

12. The voltage applied to the circuit of Figure P2.3.12 is v(t) = cos t fort > 0. The initial charge on the capacitor is zero.

a. Find an expression for the current iC(t).b. Is there some value of vC(0–) for which the transient term is zero?

13. Biomedical engineering (biology). Assume that a colony of bacteriaincreases at a rate proportional to the numbers present. If the numberof bacteria doubles in 5 h, how long will it take for the number ofbacteria to triple? Draw a block diagram that represents the system.

14. Environmental engineering. A tank contains 400 l of water. By acci-dent, 120 kg of chlorine is poured into the tank instead of 60 kg. To

Figure P2.3.9

Figure P2.3.11

R = 2 Ωi(t)

i(t)

+

L = 1 H

D = 2

vg = 0

x

K = 1

f (t) = 2e–t u(t)

Page 123: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 2: Linear continuous-time systems 103

correct the mixture, a stopper is removed from the bottom of the tankallowing 3 l of the mixture to flow out each minute. At the same time,3 l/min of pure water is poured into the tank. If the mixture is keptuniform by stirring, how long will it take for the mixture to attainthe desired amount of clorine?

15. Finance. The sum of $6000.00 is invested at the rate of 6% per year,compounded continuously. What will be the amount after 50 years?

Section 2.4

1. The circuit shown in Figure P2.4.1 is initially in its quiescent statewhen the switch is opened.a. Deduce an expression for the inductor currents for t > 0.b. Determine the conditions for the current to be zero.

2. A pulse of height V and duration T = RC is applied to the series RCcircuit shown in Figure P2.4.2. The circuit is initially relaxed. Sketchthe output voltage vo(t) as a function of time. Label all features of thecurve.

Figure P2.3.12

Figure P2.4.1

+

C

R

i(t)

v(t) = cos ωt u(t)

V

S

+

i1 i2

R2R1

L1 L2

Page 124: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

104 Signals and systems primer with MATLAB

3. A two-pulse wave-train is applied to the initially relaxed RC circuitshown in Figure P2.4.3. From knowledge of the step function re-sponse of the RC circuit, deduce the voltage waveform vo(t).

Hint: Use a step-by-step procedure beginning at t = 0, and thendetermine the values of vo(t) at the successive switching times.

4. In the circuit of Figure P2.4.4, vC(0–) = 0. The switch is closed at timet = 1 s. Determine vC(t) and iC(t) and sketch their time variations.

Section 2.5

1. Prove the block diagram transformations shown in Figure 2.5.4 andspecify (d) and (j).

2. Draw block diagrams for the systems shown in Figure P2.5.2.

Figure P2.4.2

Figure P2.4.3

Figure P2.4.4

T

V

R

C

+

t0

v(t)

vo(t)

0 1 2 3 t

V

v(t) 1 F

1 Ω

+

vo(t)

u(t)

+

2 Ω

1 Ω

1 F

S

vc(t)

Page 125: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 2: Linear continuous-time systems 105

3. Draw block diagrams for the following sets of differential equations,where p = d/dt, p2 = d2/dt2, and p3 = d3/dt3.

4. Deduce the input–output (transmittance H(p)) of the systems repre-sented by the block diagrams shown in Figure P2.5.4.

Section 2.6

1. Determine the convolution of the following pairs of functions:

a. p1(t), p1(t – 2)b. p1(t), (t)c. exp(–(t – 2))u(t – 2), (t)d. u(t), exp(–t)u(t)

2. Determine the convolution of the following pairs of functions:

a. p1(t) – p1(t – 2), (t)b. 2p1(t – 2), exp(–t)u(t)

3. Using the functions f(t) = p1(t – 1) and h(t) = exp(–t)u(t), verify thecommutatitive property of the convolution f(t)*h(t) = h(t)*f(t).

Figure P2.5.2

Figure P2.5.4

R L

++

+

C

(a)

vi(t)

i1(t)

vi(t)vo(t) i1(t)i2(t)

R1 R2

CL

(b)

vo(t)

+

a.b.

( )( )p p y tp y t

3

23 2 75 3

+ + = ++ =

R(t) +

_

C(t)

(a)

a

b

c

d

R +

_ _ +C

(b)

+ O1

O2

Page 126: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

106 Signals and systems primer with MATLAB

4. Determine the convolution of the following pairs of functions:

a. tu(t), t2u(t)b. t2u(t), t3u(t)

5. Show that if h(t) is a real function and we define [f1(t) + jf2(t)]*h(t) =g1(t) + jg2(t), then f1(t)*h(t) = g1(t) and f2(t)*h(t) = g2(t).

6. If g(t) = f1(t)*f2(t), show that dg(t)/dt = [df1(t)/dt]*f2(t) = f1(t)*[df2(t)/dt].7. Find the convolution of the functions shown in Figure P2.6.7.

8. Edge detection. One of the most important operations in signal pro-cessing, especially in image processing for recognizing patterns (tar-gets in military terms) embedded in an image, is the exaggeration ofa signal transition. An operator (signal) that will exaggerate a transition(from white to gray to black) is known as the edge detector. For veri-fying the above assertion, find the convolution of the signals shownin Figure P2.6.8 for a = 1 and a = 1/2 and state your observations.

9. Deduce the correlation between the functions given below:

a. p1(t), exp(–t)u(t)b. p1(t), (t – 1) + p1(t – 3)c. exp(–t)u(t), exp(–t)u(t)d. tp1(t – 1), exp(–t)u(t)

10. Verify that , where the circle with the dot meanscorrelation.

Figure P2.6.7

Figure P2.6.8

t

1

1

f (t) = e–t[u(t) – u(t – 1)]

t

1

2

h(t) = e–2t[u(t) – u(t – 2)]

f(t)

1

a

–1

–a t ∗

h(t)

1

1 t

f t h t f t h t( ) ( ) ( ) ( )� =

Page 127: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 2: Linear continuous-time systems 107

Section 2.7

1. Deduce the zero-input and zero-state responses of the system shownin Figure P2.7.1. The initial condition for the charge is q(0) = 1 C andthe input voltage is v(t) = tu(t). Use the convolution approach.

2. Determine the output of the initially relaxed systems shown in FigureP2.7.2 if the input is v(t) = exp(–t)u(t). Use the convolution approach.

3. Determine the output of the initially relaxed systems shown in FigureP2.7.3 if the inputs are, respectively, f(t) = p1(t – 1) and T = exp(–t)u(t).Use the convolution method.

Figure P2.7.1

Figure P2.7.2

v(t)

+R = 1 Ω

C = 0.5 F

+

Systemq(t)v(t)

vo(t)

v(t)R = 5 Ω

L = 1 Η

+

+

vo(t)v(t)

Systemvo(t)

v(t)

+R = 5 Ω

L = 1 Η

+

vo(t)v(t)

Systemvo(t)

(b)

(a)

Page 128: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

108 Signals and systems primer with MATLAB

4. Find the impulse response of the initially relaxed systems shown inFigure P2.7.4. The charge is q(t) for initial charge q(0+) = 0.

5. Find the output of the system described in Example 2.7.2 if the inputis v(t)= u(t – 1) + (t – 3).

6. The input to the system discussed in Example 2.7.3 is i(t) = p(t – 4).Determine the output using convolution methods. Choose C = 1 Fand R = 2 ohms.

7. The input to the system discussed in Example 2.7.3 is p(t – 1) – p(t – 5).Use the convolution approach to determine the output. Choose C =1 F and R = 2 ohms.

8. Determine the output of the initially relaxed system shown in FigureP2.7.8 for the following inputs:a. i1(t) = u(t – 2)b. i2(t) = exp(–(t – 4))u(t – 4)

Figure P2.7.3

Figure P2.7.4

M = 2 f(t)

v(t)

D = 1

System f(t) v(t)

J = 1

D = 2

T(t)

(a)

(b)

System T(t) (t)

v(t)

+

R = 2

J = 1

C = 0.25

D = 0.5

(a)

(b)

System T(t) = (t) h(t) = (t)

System v(t) = (t) h(t) = q(t)

(t)

T(t)

Page 129: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 2: Linear continuous-time systems 109

9. Determine the output to the system shown in Figure P2.7.9 if theinput is f(t) = cost u(t). Use convolution methods.

10. Determine the output of the system discussed in Example 2.7.5 if theinput is the unit step function v(t) = u(t).

Figure P2.7.8

Figure P2.7.9

i(t)

R1 = 2 Ω

R2 = 4 Ω

L = 1 H

+

vo(t)

vo(t)i(t)System

K = 4

D = 5

M = 1f(t)

v(t)

v(t)f(t)System

Page 130: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

111

chapter 3

Discrete systems

In this chapter we will learn how to describe and model discrete systems. Thesystems that we will study will be primarily derived from continuous sys-tems appropriately digitized. As we learn the mathematical operations ofconvolution, we shall proceed in this chapter to learn similar operations fordiscrete systems. Furthermore, we shall develop approaches such that thediscrete systems approximate the continuous ones to a degree that is accept-able for practical applications.

3.1 Discrete systems and equationsNote: The reader should have in mind that, in this chapter, we will arbitrarily definediscrete signals and will also introduce discrete signals created from analog ones,without presenting their similarities and differences. This will be done when westudy the sampling theorem in a later chapter. The effect of sampling will be broughtto the attention of the reader when applicable.

When we dealt with continuous systems, our interest was in the rela-tionship between an input signal v(t) and output signal g(t). Hence, we wereinterested in finding the appropriate operator O that, when operated on theinput, would yield the relation between the input and output. Similarly, adiscrete, or digital, system establishes a relationship between two discretesignals: an input v(n) and output g(n). The values of n are integers. However,we will also deal with discrete signals whose values will not be separatedby a unit time, but by a fraction of time, e.g., nT, where T is equal to a valuein the range, 0 < T < 1. An actual discrete system is a combination of manydifferent electronic components, such as amplifiers, shift registers, and gates.However, it is represented here in simple block diagram form.

In discrete-time systems, a discrete source produces discrete-time sig-nals that are pulses of assumed zero width and finite height. A discrete signalsequence may arise by pulse sampling a continuous-time excitation function,usually at uniform time intervals. It might represent a sequence of narrowpulses generated in a pulse-generating source. As we mentioned above, the

Page 131: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

112 Signals and systems primer with MATLAB

generation of discrete signals having zero width and finite height is notpossible using any physical system. Therefore, there is no physical sourcethat is able to produce discrete signals.

Another element of a discrete system is the scalar multiplier, a compo-nent that produces pulses at the output that are proportional to input pulses.There is also a delay element that produces an output identical to its input,but delayed by a predetermined number of time units or a multiple fractionof a time unit. The symbol z–1 will be used to denote a delay of a unit timeor a fraction of unit time (T); two delay units will be denoted by z–2 and kdelay units by z–k. These delay elements are shown in Figure 3.1.1.

A group of such connected discrete elements and adders (summingpoints or summers) with appropriate pick-off points constitute a digitalsystem. Discrete sources are its inputs, and the resulting signals in its variousparts are the outputs, or responses, of the system. The analysis of the behav-ior of such systems will parallel, to some extent, the systems analysis pro-cedures in continuous-time systems.

Example 3.1.1: A discrete system and its input is shown in Figure 3.1.2.Find its output.

Solution: By inspection, it is seen that the output from the summer is asignal consisting of two pulses: a pulse of height 1 at n = 0 and a pulse ofheight 2 at n = 2. These pulses are each delayed by two time units, givingthe output shown. �

Example 3.1.2: Find the output of the system shown in Figure 3.1.3.

Solution: Clearly, the output signal is the sum of the input signal plusa replica of this signal, but delayed by two time units. The result is shownin the same figure. �

Figure 3.1.1 Digital system entities: (a) multiplier, (b) delay element, and (c) digitalsystem.

a

v(n)

(v(nT))

g(n) = av(n – k)

(g(nT) = av(nT – kT)) z–k

v(n)

(v(nT))

g(n) = av(n)

(g(nT) = av(nT))

Input Output Input Output

Multiplier Delay element

v(n)

(v(nT)) O

g(n) = O{v(n)}

(g(nT ) = O{v(nT)})

Input Output

Digital system

(a) (b)

(c)

Page 132: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 3: Discrete systems 113

A system consisting of discrete-time elements with a discrete-time inputsignal sequence is described by a difference equation. This description is tobe contrasted with the description of linear, lumped, time-invariant systemsthat are described by ordinary differential equations. Depending on thenumber and character of the elements in the discrete system, the system isdescribed by difference equation of different order. The following exampleswill help us understand how difference equations are developed. The struc-ture layout of the discrete elements will produce specific type of differenceequations, which will be identified with specific names. Furthermore, theiterative method of solution will be adopted at present and other methodswill be considered in later chapters.

Example 3.1.3: Consider the system shown in Figure 3.1.4a. Find thedifference equation that describes the system and deduce g(n) if the input is

Figure 3.1.2 Simple discrete system with delay element.

Figure 3.1.3 Single-time discrete repeater.

+

n

δ(n)

z−2g(n)

2 n

22δ(n−2)

1

2

n2 4

g(n)

+

z−1 z−1

g(n)

v(n)

n

2

1

1 1 2 3 n

g(n)

2

1

Page 133: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

114 Signals and systems primer with MATLAB

v(n) = u(n), the unit step function. The system is relaxed at n = 0, whichimplies that g(–1) = 0.

Solution: From the figure we observe that

(3.1)

The above equation may be put in the general form

(3.2)

Since the difference between the independent variables of the output of thesystem is (n – (n – 1)) = 1, the difference equation is of the first order.Furthermore, since the output is given in its unshifted and shifted formats,but the input is only given by its zero shift position, the system is of theinfinite impulse response (IIR) system. Observe that this type of discretesystem produces a feedback-type block diagram form.

Note: The infinite impulse response (IIR) discrete system consists of the outputplus additional delayed outputs multiplied by constants. This type of system hasonly one input and not delayed ones. The block diagram structure is a feedback type.

To find a numerical solution, we proceed by successively introducingvalues of n into the difference equation, starting with n = 0 since the inputfunction starts at time n = 0. We proceed iteratively thereafter. Hence,

Figure 3.1.4 A first-order IIR discrete system.

+

2

_

v(n) g(n)

g(n)

v(n) –2g(n – 1)

g(n – 1)

z−1

2g(n – 1)

(a)

g(n)

1

3

–1

–5

1

2

3

n

(b)

g n v n g n g n g n v n( ) ( ) ( ) ( ) ( ) ( )= + =2 1 2 1or

y n a y n b x n( ) ( ) ( )+ =1 01

g v g

g v g

( ) ( ) ( )

( ) ( ) ( )

0 0 2 1 1 2 0 1

1 1 2 0 1 2

= = × =

= = ×× =

= = × =

1 1

2 2 2 1 1 2 1 3g v g( ) ( ) ( ) ( )

Page 134: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 3: Discrete systems 115

The output has been plotted in Figure 3.1.4b. The following MATLAB func-tion can solve any first-order IIR discrete system. �

Book MATLAB function for an IIR system

function[y]=ssfirstorderiir(a1,b0,N,x)

y(1)=0;%if the initial condition is different than 0

%the new value must be introduced here;

for n=0:N

y(n+2)=-a1*y(n+1)+b0*x(n+1);

end;

%since matlab starts from 1, everything must be shifted by

%two; the answer will also contain the value of the initial

%condition at n=1; to have the exact plot we must set: k=-1:N;

%stem(k,y);

Example 3.1.4: Find the difference equation that describes the systemshown in Figure 3.1.5a. Determine its output g(n) if its input is v(n) = u(n).The system is relaxed at n = 0, which implies that g(–1) = 0.

Solution: From the figure we deduce that

(3.3)

The above equation may be put in the general form

(3.4)

Note that the output of the system is expressed only in terms of the inputfunction. Such a system is called a nonrecursive, transversal, or finite

Figure 3.1.5 A three-term FIR system.

g n v n v n v n( ) ( ) ( ) ( )= + 2 1 4 2

y n b x n b x n b x n( ) ( ) ( ) ( )= + +0 1 21 2

+

2

–4

v(n) v(n)

v(n)

g(n)

z−1

z−2

2v(n – 1)

–4v(n – 2)

(a)

n

g(n)

1

3

–11

2 3 4

(b)

‘’’

Page 135: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

116 Signals and systems primer with MATLAB

duration impulse response (FIR). To find the solution, we solve the equationrecursively. Hence,

The MATLAB function that will solve a FIR system is given below. �

Book MATLAB function for four-term FIR system

function[y]=ssfir4term(N,x,b)

for n=0:N

y(n+1)=[x(n+4) x(n+3) x(n+2) x(n+1)]*b';

end;

%the input vector x must have its first three

%elements zero for a relaxed system; to plot

%the output must write:k=0:N;stem(k,y);

Note: The finite impulse response system has only one output, an input, andadditional delayed inputs multiplied by constants. The output of the system is thesum of both the input and the delayed inputs. The block diagram form is of theforward format.

Example 3.1.5: Find the difference equation that describes the systemshown in Figure 3.1.6a. Determine the output g(n) for an input v(n) = u(n).The system is relaxed at n = 0, which implies that g(–1) = g(–2) = 0.

Solution: From the figure we see that

(3.5)

The general second-order mixed (IIR and FIR) discrete system is given by

(3.6)

Because the difference between n and n – 2 belonging to the dependentvariables g(n) and g(n – 2) is equal to 2, the difference equation is of thesecond order. We note that the output is the sum of the inputs and thedelayed outputs with their proportionality factors. The solution of (3.5) is

g v v v

g v

( ) ( ) ( ) ( )

( ) (

0 0 2 1 4 2 1 2 0 4 0 1

1 1

= + = + × × =

= )) ( ) ( )

( ) ( ) ( )

+ = + × × =

= +

2 0 4 1 1 2 1 4 0 3

2 2 2 1

v v

g v v 44 0 1 2 1 4 1 1v( ) = + × × =

g n v n v n g n( ) ( ) ( ) ( )= 1 2 2 2 2

y n a y n a y n b x n b x n b x( ) ( ) ( ) ( ) ( ) (+ + = + +1 2 0 1 21 2 1 nn 2)

Page 136: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 3: Discrete systems 117

The output is plotted in Figure 3.1.6b. �

Example 3.1.6: Engineering economics (banking). The interest rate ofa savings account is r% per year compounded k times per year (k = 4 wouldcorrespond to quarterly compounding). Determine what the total bankaccount balance, y(n), would be at the end of the nth compounded periodif the total deposits during the nth compounding period are x(n). Assumethat deposits at any period do not earn interest until the next compoundingperiod.

Solution: The interest is compounded at the rate r/k% for each com-pounding period. Therefore, at the end of any compounding period, the totalbank account balance is equal to the sum of the following: the bank account

Figure 3.1.6 Mixed IIR and FIR discrete systems.

–2

+

–2

z−1

z−1 z−1

v(n) v(n – 1)

–2v(n – 2) –2g(n – 2)

g(n) g(n)

(a)

… 1

–1

–3

1

2 3

4 n

g(n)

(b)

g v v g

g v

( ) ( ) ( ) ( )

( ) (

0 1 2 2 2 2 0 2 0 2 0 0

1

= = × × =

= 00 2 1 2 1 1 2 0 2 0 1

2 1 2 0

) ( ) ( )

( ) ( ) (

= × × =

=

v g

g v v )) ( )

( ) ( ) ( ) ( )

= × × =

= =

2 0 1 2 1 2 0 1

3 2 2 1 2 1

g

g v v g 11 2 1 2 1 3× × =

Page 137: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

118 Signals and systems primer with MATLAB

balance at the start of the compounding period, the interest accrued on thisbalance, and the deposits made during the period. We, thus write

3.2 Digital simulation of analog systemsIf we wish to carry out continuous-time systems analysis using digital com-puters, a procedure we will be using very often in practice, it is requiredthat we determine a digital system whose output is equivalent to that of thecontinuous-time or analog system. We refer to the digital equivalent as adigital simulator and require, of course, that the digital output closelyapproximate the output of the corresponding analog system. The objectiveof digital simulation is to determine a simulator of an anlog system and todetermine the class of signals that can be processed.

Because the analog systems that we are studying in this book aredescribed by ordinary differential equations, the digital simulators will cor-respond to a recursive equation that can be represented by delay elementsand scalar multipliers. To accomplish these objectives, we must study howto create the digital simulators from their analog counterparts.

To understand the process, let us study the analog system shown inFigure 3.2.1a. We first replace the differential relationship di(t)/dt by anapproximately equivalent difference relationship. This transformation isaccomplished by replacing the derivative by the approximate form

(3.7)

or

(3.8)

The approximation (3.7) is shown graphically in Figure 3.2.1b. Observe thatas T approaches zero and n increases, so that nT remains the same, theinclination of the line AB approaches the inclination of the exact tangent atnT.

For our case and for T = 1, the approximation to the analog expression(the output voltage) is

(3.9)

y n y nrk

y n x nrk

y n( ) ( ) ( ) ( ) ( )= + + = + +1 1 1 1 xx n( )

di tdt

i nT i nT TT

i nT i n TT

( ) ( ) ( ) ( ) [( ) ]= 1

di tdt

i n i n T( )

( ) ( ), =1 1

v n L i n i n( ) [ ( ) ( )]= 1

Page 138: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 3: Discrete systems 119

Assume an initially relaxed system v(–1) = 0; for the discrete or sampledversion of the analog input i(t) shown in Figure 3.2.1a, we obtain i(n) = n.The solution is found based on the same procedure as that done in theprevious example, as follows:

Figure 3.2.1 Analog-to-digital simulation of electrical circuits. (a) Simple analog cir-cuit, input and output. (b) Approximation to derivative.

1

1

i(t)

t

v(t)

t

L

(a)

i(t)

+

L v(t) Systemi(t)

di(t)v(t) = L

dt

Input Output

nTnT – T t

Tangent at t = nT

i(t)

i(nT – T)

i(nT)

T

i(nT) – i(nT – T)

A

B

(b)

i(t)

v L i i L

v L i i

( ) [ ( ) ( )] [ ]

( ) [ ( ) ( )

0 0 1 0 0 0

1 1 0

= = =

= ]] [ ]

( ) [ ( ) ( )] [ ]

( )

= =

= = =

=

L L

v L i i L L

v L

1 0

2 2 1 2 1

3 [[ ( ) ( )] [ ]i i L L3 2 3 2= =

Page 139: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

120 Signals and systems primer with MATLAB

These data are shown in Figure 3.2.1c. The numerical process described by(3.9) is shown in Figure 3.2.1d. Observe that the instantaneous on–off switch(ideal) accomplishes the production of discrete signals from the analog withinfinite accuracy.

We now investigate the system shown in Figure 3.2.2a with a unit stepinput. In this example, we approximate an integral with its simulated discreteform. Hence, we write

(3.10)

which becomes

(3.11)

However, the integral represents the area under the curve of f(t) in theinterval nT – T t nT, and this area is approximately equal to Tf(nT). Hence,(3.11) becomes

(3.12)

Figure 3.2.1 (continued). (c) Sampled input and output from digital equivalent sys-tem. (d) Block diagram of digital simulation.

(c)

1 2 3 n

i(n)

v(n)

n1 2 3

L

L

L

+_

i(t)

On-off switch

i(n)

i(n)

Li(n)

Li(n – 1)

z−1

v(n)

(d)

v nTM

f t dtM

f t dtM

f t dtnT nT T

n( ) ( ) ( ) ( )= = +1 1 1

0 0 TT T

nT

v nT v nT TM

f t dtnT T

nT

( ) ( ) ( )= + 1

v nT v nT TM

Tf nT n( ) ( ) ( ) , , ,+ =10 1 2 �

Page 140: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 3: Discrete systems 121

In general, the integral

(3.13)

is approximated as follows

(3.14)

Figure 3.2.2 Analog-to-digital simulation of mechanical system. (a) Mechanical sys-tem, step force input and output velocity. (b) Simulation of integration.

M

v(t)

f(t)System

f(t)

Input Output

1M

∫0t f (x)dx

t

1

f(t) v(t)

t

1

1

(a)

nT

nT – T

T

x(nT)

t

x(t)

c

d

b

a

x(t)

(b)

Error

y t x t dtt nT

( ) ( )==

0

y t nT y nT T x t dt y nT T Tx nTnT T

nT

( ) ( ) ( ) ( ) (= = + + ))

Page 141: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

122 Signals and systems primer with MATLAB

Observe that the quantity y(nT – T) is equal to the area enclosed by the linesabc(nT – T), as shown in Figure 3.2.2b. The integral gives the area (nT – T)cd(nT). This area can be approximated by the rectangle shown in the figure.The error committed by this approximation is equal to the area enclosedbetween the curve x(t) and the top side of the rectangle. Observe that as Tdiminishes, the error does the same.

For an initially relaxed mechanical system with unit step function andT = 1, we find

These values are shown in Figure 3.2.2c. The numerical process describedby (3.12) is shown in Figure 3.2.2d, which is the digital simulator.

Example 3.2.1: Find the output in analog and discrete form of the systemshown in Figure 3.2.3a for a unit step function v(t) = u(t). The system isinitially relaxed at t = 0.

Figure 3.2.2 (continued). (c) Sampled input and output from digital equivalent sys-tem. (d) Simulator block diagram.

(c)

1 3 n

f(n)

1 2 n

v(n)

1/M

2/M

3/M

1

2

+f(t) f(nT)

T/Mv(nT)v(nT)

z−1

v(nT – T)

(d)

v v M f M M

v v

( ) ( ) ( ) ( ) ( )

( ) ( ) (

0 1 1 0 0 1 1

1 0

= + = + =

= +

/ / /

11 1 1 1 2

2 1 1 2

/ / / /

/

M f M M M

v v M f

) ( ) ( ) ( )

( ) ( ) ( ) (

= + =

= + )) ( ) ( )= + =2 1 3/ / /M M M

Page 142: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 3: Discrete systems 123

Solution: The differential equation that describes the system is

Figure 3.2.3 Illustration of Example 3.2.1.

(a)

u(t)

++

vo(t)vo(t)

u(t)

R = 0.5 Ω

L = 1 H

InputSystem

Output

1

0.9

0.8

0.7

0.6

0.5

0.4

0.3

0.2

0.1

0 2 4 6 8 10 0

v o(t

), v

o(n

)

t (s)

1

0.9

0.8

0.7

0.6

0.5

0.4

0.3

0.2

0.1

0 2 4 6 8 10 0

v o(t

), v

o(0

.2n

)

t (s)

(b)

1/2.5

1/1.25 z–1

+

T = 0.5

u(t)

u(0.5n)

vo(0.5n)

(c)

di tdt

i t u t v t i to( )

. ( ) ( ) ( ) . ( )+ = =0 5 0 5and

Page 143: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

124 Signals and systems primer with MATLAB

or

(3.15)

By an application of the methods previously discussed for solvingfirst-order differential equations, we obtain the following solution:

(3.16)

Next, we deduce the equivalent digital format of (3.15) using (3.7). Equation(3.15) is approximated by

or

(3.17)

To have zero value at n = 0, we introduce n = 0 in the above equation to findthe relation

(3.18)

Next, we solve (3.17) by iteration to obtain the general form of solution,which is

Observe that if n = N, then the last set of parentheses will have the form. This expression is a finite term geometric series,

and thus, the output voltage is given for any n by

(3.19)

dv tdt

v t u too

( ). ( ) . ( )+ =0 5 0 5

v t e u tot( ) ( ) ( ).= 1 0 5

v nT v nT TT

v nT u nTo oo

( ) ( ). ( ) . ( )+ =0 5 0 5

v nT a v nT T a T u nT aTo( ) ( ) . ( )

.= =

+1 1 10 51

1 0 5

v T a v T a v T a T v To o o o( ) ( ) ( ) . ( )0 0 0 51 1 1= = =or TT0 5.

n v T a v T a T a T a T

n

o o= = + = + =0 0 0 5 0 5 0 5 01 1 1 1( ) ( ) . . .

== = + = + =

=

1 1 0 0 5 0 0 5

2

1 1 1 1v T a v T a T a T a T

n v

o o

o

( ) ( ) . .

(( ) ( ) . . .

(

2 1 0 5 0 5 0 5

3 3

1 1 12

1T a v T a T a T a T

n v

o

o

= + = +

= TT a v T a T a T a T a T

n

o) ( ) . . . .= + = + +1 1 13

12

12 0 5 0 5 0 5 0 5

== = + = + +4 4 3 0 5 0 5 0 51 1 14

13v T a v T a T a T a T ao o( ) ( ) . . . 11

21

1 1 12

13

0 5 0 5

0 5 1

T a T

a T a a a

. .

. ( )

+

= + + +

( )1 1 12

13

11+ + + + +a a a aN�

v nT a Taa

aTo

n

( ) ..

= =+1

1

110 5

11

11 0 5

Page 144: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 3: Discrete systems 125

Book MATLAB m-file for example 3.2.1: ex3_2_1

%the name of this file is: Ex3_2_1;this is an m-file

%that produces outputs for the Ex. 3.2.1;the reader

%can change value of T and get different desired results;

T=1; %T=sampling time;

t1=10; %t1=time on the time axis we would like to plot

%the functions;

N=t1/T;

a1=1/(1+0.5*T);

n=0:N;

v=a1*T*0.5*(1-a1.^n)/(1-a1);

Figure 3.2.3b gives plots of the analog system output and the outputfrom its digital simulator. We observe that the smaller the sampling timeintroduced, the better approximation we obtain. Figure 3.2.3c shows theblock diagram representation of the simulated continuous system for T = 1and T = 0.2 sampling times. �

Example 3.2.2: Find the output of the analog and equivalent discreteform of the system shown in Figure 3.2.4a. The input to the system is theexponential function vi (t) = exp(–t)u(t).

Solution: The integrodifferential equation describing the system is

(3.20)

We make use of the fact that the current through the capacitor is C dvc/dt.This current is the same through the circuit. Substituting this expression inthe above equation and taking into consideration the properties of the inte-gration of a derivative, we obtain the equation

(3.21)

For an exponential decaying input function and relaxed initial condi-tions, the solution is easily found to be

(3.22)

Further, the output voltage is

(3.23)

4 2i t dt i t v ti( ) ( ) ( )+ =

v tdvdt

v tcc

i( ) . ( )+ =0 5

v t e e tct t( ) ( )= >2 02

v t e e tot t( ) = >2 02

Page 145: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

126 Signals and systems primer with MATLAB

A sketch of the function is given in Figure 3.2.4b by the solid line. Forcomparison, digital simulations with sampling times of T = 0.5 s and T =0.2 s are also shown. As we have seen in the previous example, the smallerthe sampling time, the better approximation we produce.

Next, we approximate (3.21) in its discrete form. The resulting equation is

Figure 3.2.4 Illustration of Example 3.2.2.

(a)

++

+ vo(t)vo(t)vi(t) = e–tu(t)

vi(t)

vc

R = 2 Ω

C = 0.25 F

SystemOutputInput

1.2

1

0.8

0.6

0.4

0.2

–0.2

0

0 2 4 6

t s

v o(t

); v

o(n

T)

T = 0.5 s

1.2

1

0.8

0.6

0.4

0.2

–0.2

0

0 2 4 6

t s

v o(t

); v

o(n

T)

T = 0.2 s

(b)

+vi(t) vo(nT ) vi(nT )

1 – a12T

−a1

z−1 z−1

a1

a1 = 1/(1 + 2T)

(c)

Page 146: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 3: Discrete systems 127

(3.24)

Also, by inspection of Figure 3.2.4a, we write Kirchhoff’s voltage law,

(3.25)

Combine these two equations by eliminating vc(nT) and vc(nT – T), the latterby appropriately changing the time variable nT to nT – T in (3.25). The resultis readily found to be

(3.26)

For the particular case of T = 0.5 s, the solution is calculated as follows:

Figure 3.2.4b has been plotted using the Book MATLAB m-file givenbelow.

Book MATLAB m-file for example 3.2.2: ex_3_2_2

%ex_3_2_2= name of book m-file to solve Ex. 3.2.2

T=0.2; %T and N can be changed to fit the desired accuracy;

N=26;

a1=1/(1+2*T);

v(1)=0;

n=2:N;

vi1=exp(-(n-2)*T);

vi=[0 vi1];

for m=2:N

v(m)=a1*v(m-1)+(1-a1*2*T)*vi(m)-a1*vi(m-1);

end;

vo=v(1,2:N);

v nT a v nT T a Tv nT a Tc c i( ) ( ) ( ) ( )= = +1 1 12 1 1 2/

v nT v nT v nTi c o( ) ( ) ( ) = 0

v nT a v nT T a T v nT a v nT To o i i( ) ( ) ( ) ( ) ( )= +1 1 11 2 aa T1 1 1 2= +/( )

n v v v vo o i i= = +0 0 0 5 0 5 1 0 5 0 0 5 0( ) . ( . ) ( . ) ( ) . ( .55

0 5 0 0 5 1 0 5 0 0 5

1 0 5 0 5 0

)

. . . .

( . ) . (

=

× + × × =

= =n v vo o )) ( . ) ( . ) . ( )

. . .

+ =

+ ×

1 0 5 0 5 0 5 0

0 25 0 5 0 6065

v vi i

00 5 1 0 0533

2 1 0 5 0 5 1 0 5

. .

( ) . ( . ) ( . ) (

× =

= = +n v v vo o i 11 0 5 0 5

0 5 0 0533 0 5 0 3679 0 5 0

) . ( . )

. . . . . .

=

× + × ×

vi

66065 0 927= .

Page 147: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

128 Signals and systems primer with MATLAB

The reader will easily find that as T approaches zero, the accuracy willbecome better and better. Figure 3.2.4c gives the block diagram representa-tion of the simulated continuous system. �

It is instructive to deduce the equivalent discrete form equation directlyfrom (3.20). We proceed by writing (3.20) in the form

or

But 2i(.) is equal to the voltage output vo(.), and the accumulated charge onthe capacitor divided by the capacitance is equal to the voltage across thecapacitor, vc(t). Hence, the above equation becomes

or

But from Kirchhoff’s voltage law we have that

and therefore by shifting the above equation we obtain

The combination of the last two discrete equations yields (3.26).

Example 3.2.3: Chemical engineering. A large tank contains 81 gal ofbrine that contains 20 lb of dissolved salt. Additional brine containing 3 lbof dissolved salt per gallon runs into the tank at the rate of 5 gal/min. Themixture, which is stirred to ensure homogeneity, runs out of the tank at therate of 2 gal/min. How much salt is in the tank at the end of 37 min? Compareresults using a continuous-time and discrete-time analysis.

4 4 20

i t dt i t dt i t v tnT T

nT T

nT

i( ) ( ) ( ) ( )+ + =

4 4 2q nT T Ti nT i nT v nTi( ) ( ) ( ) ( )+ + =

4 0 250 25

1 2 2× + + =.( )

.( )[ ( )] ( )

q nT TT i nT v nTi

v nT T T v nT v nTc o i( ) ( ) ( ) ( )+ + =1 2

v t v t v tc i o( ) ( ) ( )=

v nT T v nT T v nT Tc i o( ) ( ) ( )=

Page 148: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 3: Discrete systems 129

Solution: The rate of change of salt is given by

The rate in is given as

To find the rate out, we must first find the concentration of salt at time t,that is, the amount of salt per gallon of the brine in the tank. Since

hence,

Therefore, the differential equation that describes the mixture is

with the initial condition y(0) = 20.To solve this differential equation, we employ the method of variation

of parameters (see also Appendix 3.1). Based on the solution of the homo-geneous equation, we use the multiplying factor (exponent with the positivesign)

Next, by multiplying the differential equation with the multiplying factor(27 + t)2/3, we obtain

dy tdt( ) = rate in-rate out

rate in 3 (lb/gal) 5 (gal/min) 15 lb/min= × =

concentrationpounds of salt in tank at tim

=ee t

gallons of brine in tank at time t= y t( )

881 5 2+ ( )t

rate outy(t)

tlbs/gal gal/min=

81+ 32=2( )

yy(t)t

lbs/min81+ 3

dy tdt( ) = 15

281+ 3

y(t)t

exp exp [ln( )] (23

127

23

27+

= + =t

dt t 227 2 3+ t) /

dy tdt

t y t t t( )

( ) ( )( ) ( )/ /2723

27 15 272 3 1 3 2+ + + = + //3

Page 149: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

130 Signals and systems primer with MATLAB

This equation can be written in the form

Integrate both sides with respect to t to obtain

where C is the constant of integration. This expression is written

Applying the initial condition, we find that C = –2007. The final solution is

For the special time t = 37, we find y(37) = 450.56 lb.When this problem is converted into equivalent discrete form by writing

the discrete equivalent equation becomes

For n = 0, y(0T) = 20, and hence, the above equation gives the followingexpression

for the value of y(–T). The Book MATLAB m-file to solve the discrete simu-lation is given below.

Book MATLAB m-file for example 3.2.3: ex3_2_3

%ex3_2_3 is the name of the m-file to produce

%simulations for the Ex 3.2.3;to find desired results

%the reader can change sampling time T and appropriately

ddt

y t t t[ ( )( ) ] ( )/ /27 15 272 3 2 3+ = +

y t tt

C( )( )( )/

/

2715 27

5 32 3

5 3

+ = + +/

y t t C t( ) ( ) ( ) /= + + +9 27 27 2 3

y t t t( ) ( ) ( ) /= + +9 27 2007 27 2 3

dy t dt y nT y nT T T( )/ [ ( ) ( )] ,= /

y nTnT

T nTT

nTT nT

y n( ) (= ++ +

+ ++ +

81 381 2 3

1581 3

81 2 3TT T)

y TT

T( )( )= +20 81 2

8115

Page 150: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 3: Discrete systems 131

%N;

T=0.05;

N=500;

y(1)=(20*(81+2*T)/81)-15*T;

for n=0:N

y(n+2)=((81+3*(n+2)*T)*15*T)/(81+2*T+3*(n+2)*T)...

+((81+3*(n+2)*T)/(81+2*T+3*(n+2)*T))*y(n+1);

end;

For example, the exact value at t = 10 min is 152.2495 lb, and the corre-sponding values for T = 1, 0.2, and 0.05 are 139.8727, 147.3289, and 151.0224,respectively. �

*3.3 Digital simulation of higher-order differential equations

Because more complicated linear systems can be described by higher-orderlinear differential equations, it is desired to develop the equivalent digitalrepresentations of different-order derivatives. This development yields

(3.27)

(3.28)

The values of initial conditions are determined from those values spec-ified for the continuous system. For example, given the values of y(t) anddy(t)/dt at t = 0, the required values of y(–T) can be obtained approximatelyfrom the relationship

or

(3.29)

Following such a procedure, the value of y(–nT) can be obtained fromdny(0)/dtn by proceeding from the lower- to higher-order derivatives usingthose values already found for y(0T), y(–T), …, y(–nT + T).

dy tdt

y nT y nT TT

( ) ( ) ( )

d y tdt

ddt

dy tdt

y nT y nT T y nT2

2

2 2 2( ) ( ) ( ) ( ) (= + TTT

)2

dy tdt

dydt

y T y T TT

t

( ) ( ) ( ) ( )

=

=0

0 0 0

y T y Tdy

dt( ) ( )

( )= 00

Page 151: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

132 Signals and systems primer with MATLAB

Example 3.3.1: Bioengineering (linearization of systems). The systemshown in Figure 3.3.1a represents an idealized model of a stiff human limbas a step in assessing the passive control process of locomotive action. It isrequired to find the movement of the system if the input torque is given byT (t) = e–tu(t). We also assume that friction during the movement is specifiedby the friction constant D. The initial conditions of the system are zero, thatis, (0) = d (0)/dt = 0. Compare the analog solution with the correspondingdigital simulation.

Figure 3.3.1 Model of human limb. (a) Modeling of the movement of a stiff humanlimb. (b) Continuous- and discrete-time simulation responses for T = 0.5 and T = 0.1.

(a)

System

Mg sin (t)

T(t) (t)

(t)

(t)

T(t)

Mg

l

Input Output

6 5 4 3 2 1 0 0

0.05

0.1

0.15

0.2

0.25

Continuous case

Discrete case T = 0.1

Discrete case T = 0.5

(t);

(n

T)

t (s)

(b)

Page 152: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 3: Discrete systems 133

Solution: By an application of D’Alembert’s principle, which requiresthat the algebraic sum of torques must be zero at a node, we write

(3.30)

where

The equation that describes the system is

(3.31)

This equation is nonlinear owing to the presence of the term in theexpression of the gravity torque. To produce a linear equation, we mustassume that the deflection is small enough ( < 30°) such that we can sub-stitute the sine function with its approximate value equal to its angle. Hence,under these conditions (3.31) becomes

(3.32)

For the specific constants J = 1, D = 2, and Mgl = 2, the above equationbecomes

(3.33)

This is a second-order differential equation; hence, its solution must containtwo arbitrary constants, the values of which will be determined from spec-ified initial conditions.

We first find the homogeneous solution from the homogeneous equation.If we assume a solution of the form , the solution requirement is

T T T T( ) ( ) ( ) ( )t t t tg D J= + +

T

T

( )

( ) si

t

t Mglg

=

= =

input torque

gravity torque nn ( )

( ) ( )( )

t

t D t Dd t

dDT = = =frictional torquett

t Jd t

dtJ

d tdtJT ( )

( ) ( )= = =inertial torque2

2

Jd t

dtD

d tdt

Mgl t t2

2

( ) ( )sin ( ) ( )+ + = T

sin ( )t

Jd t

dtD

d tdt

Mgl t t2

2

( ) ( )( ) ( )+ + = T

d tdt

d tdt

t e u tt2

22 2

( ) ( )( ) ( )+ + =

hstt Ce( ) =

s s2 2 2 0+ + =

Page 153: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

134 Signals and systems primer with MATLAB

from which we find the roots s1 = –1 + j and s2 = –1 – j. The homogeneoussolution is therefore

where C1 and C2 are arbitrary constants to be found from the initial conditions.To find the particular solution, we assume a trial solution of the form

p(t) = Ae–t for t 0. By inserting this value in (3.33), we obtain

The total solution is

We now apply the assumed zero initial conditions that require

Solving the system for the unknown constants, we obtain

Introducing the above constants in the total solution, we find the final solution:

(3.34)

The digital simulation of (3.33) is deduced by employing (3.27) and (3.28)in this expression. We obtain

(3.35)

hs t s tt C e C e( ) = +1 21 2

Ae Ae Ae e At t t t+ = =2 2 1or

( ) ( ) ( )t t t C e C e e th ps t s t t= + = + +1 21 2 0for

( )

( )

0 1 0

01 0

1 2

1 1 2 2

= + + =

= + =

C C

ddt

C s C s

Cs

s sC

ss s1

2

1 22

1

1 2

1 1= + = +;

( ) ( cos )t e e e e e t e tt jt t jt t t= + =12

12

1 0

( ) ( ) ( ) ( ) ( )nT nT T nT TT

nT nT TT

+ +

+

2 22

2

2

( ) , , ,...nT e nnT= = 0 1 2

Page 154: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 3: Discrete systems 135

After rearrangement, this equation becomes

(3.36)

Using (3.29), we find that (–T) = 0. Next, introducing this value and theinitial condition (0T) = 0 in (3.36), we obtain (–2T) = T 2. Hence, these initialconditions are used for the simulation of the discrete case. The following twoBook MATLAB m-files solve the continuous and discrete cases, respectively.

Book MATLAB m-file for the continuous case: ex_3_3_1c

%ex_3_3_1c is the name of the m-file to produce

%and plot the continuous case presented in Ex 3.3.1

t=0:0.1:5.5;

th=(1-cos(t)).*exp(-t);

plot(t,th,'k');xlabel('t s');

Book MATLAB m-file for the discrete case: ex_3_3_1d

%ex_3_3_1d is the name of the m-file for

%the discrete case of the Ex 3.3.1

T=0.1;

N=5.5/T;

a=1/(1+2*T+2*T*T);

thd(2)=0;

thd(1)=T*T;

for n=0:N

thd(n+3)=a*(2+2*T)*thd(n+2)-a*thd(n+1)+T*T*a*exp(-n*T);

end;

Figure 3.3.1b shows both the continuous case and two discrete simula-tions with T = 0.5 and T = 0.1. �

3.4 Convolution of discrete-time signalsThe convolution of continuous signals is defined as follows (see also Chapter 2):

(3.37)

( ) ( ) ( ) ( )nT a T nT T a nT T aT e

a

nT= + +

=+

2 2 2

11

2

22 20 1 22T T

n+

= …, , , ,

g t f x h t x dx( ) ( ) ( )=

Page 155: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

136 Signals and systems primer with MATLAB

The above equation is approximated as follows:

(3.38)or

and for T = 1 the above convolution equation becomes

(3.39)

Note: To perform convolution of two sequences, we change n to m in one ofthe functions and in the other we substitute n – m in place of n. These substitutionsmean that the first sequence is identical to the one in the n domain, and the secondsubstitution performs a flipping of the sequence and a shifting by n in the m domain.For each n, we multiply first the corresponding elements of the two sequences, andthen add the products. The result is equal to the output function at n.

The impulse response of a discrete system is defined in the same wayas for a continuous-time system. It specifies the output of a digital systemh(n) to a delta function excitation:

(3.40)

This process is represented by the input–output relationship of a discretesystem in the form shown in Figure 3.4.1. Note that if h(n) is the responseof a system to (n), then h(n – m) is the response of the system to a shifteddelta function (n – m). Clearly, if the input is of the general form

the output will be of the form

g t f x h t x dx f x h t x dxT mT

( ) ( ) ( ) lim ( ) ( )= =0 TT

mT

m m

Tf mT h t mT= =

( ) ( )

g nT T f mT h nT mT n mm

( ) ( ) ( ) , , , ,= = ± ± … = ±=

0 1 2 0 1,, ,± …2

g n f m h n m n mm

( ) ( ) ( ) , , , , , ,= = ± ± … = ± ± …=

0 1 2 0 1 2

( ) ( )nTn

nnT mT

n m

n m=

==

=1 0

0 0

1

0

( ),n mn=

h n mn

( ).=

Page 156: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 3: Discrete systems 137

For linear time-invariant (LTI) discrete systems, causality, linearity, andstability are defined in a manner analogous to their definition in continuoussystems. Therefore, we expect that we will not observe a response ahead ofa discrete input, that the resulting output due to many inputs will be equalto the sum of the outputs to each input alone, and that the infinite sum ofimpulse functions is produced by a physical source. As in continuous sys-tems, the convolution of discrete sequences obeys the commutative andassociative properties.

Suppose that the input function to a system is

and the system impulse response is h(n) = (n). The output of this system is

The output is

We observe that the output is identical with the input, an anticipated resultsince the impulse response was a delta function.

Example 3.4.1: Determine the output of the system shown in Figure3.4.2a. The input to the system is the unit step function u(n). Use discreteconvolution.

Solution: The application of Kirchhoff’s voltage law leads to the differ-ential equation

(3.41)

Figure 3.4.1 Diagrammatic representation of the input–output relationship of a dis-crete system.

System h(n)δ(n) h(n) f(n) g(n) = f(n) ∗ h(n)

f n e u nn( ) ( ).= 0 5

g n n m e u m n m em

m m

( ) ( ) ( ) ( ). .= == =

0 5

0

0 55

0 5 0 0 5 1 0 50 1 2

m

n e n e n e= + +× ×( ) ( ) ( ). . . ×× +2 �

g

g e e

g

( )

( )

( )

. .

0 1 0 0 1

1 0 0 0

2

0 5 0 5

= + + + =

= + + + + =

=

00 0 01 1+ + + + =e e�

di tdt

i t v t( )

. ( ) ( )+ =0 5

Page 157: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

138 Signals and systems primer with MATLAB

Since we have assumed from the beginning T = 1, the corresponding differ-ence equation is

(3.42)

The equivalent discrete form of the system is shown in Figure 3.4.2b. Toapply the convolution, we must first find the impulse response of the system.To do this, we write (3.42) in the form (remember that h(n) has the units ofcurrent)

We obtain (since the system is causal, that is, the system reacts after it isexcited, h(–1) = 0)

Figure 3.4.2 Response of a discrete system to a step function.

(a)

v(t)

i(t)

++

vo(t)vo(t)

v(t)R = 0.5 Ω

L = 1 H

System

(b)

+ 1/1.5

h(n)

v(t) = u(t) u(n) i(n)

z−1

u(n) vo(t)

i(n – 1)

1

1 2 3 n

vo(n)

0.5/1.5

1.25/2.25

2.375/3.375

4.063/5.063

(c)

i n i n i n u n i n i n u( ) ( ) . ( ) ( ) . ( ) ( ) (+ = =1 0 5 1 5 1or nn)

h n n h n( ).

( ).

( )= +11 5

11 5

1

Page 158: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 3: Discrete systems 139

or

The output of the system is given by

From this expression, we deduce the successive values by iteration. Hence,

The general expression is of the form

The result is due to the fact that the expression in parentheses is a finitegeometric series. �

h h h h( ).

, ( ).

( ).

, ( )01

1 51 0

11 5

1 11

1 52 0

112= = + = = +..

( ).

,5

2 11

1 53h = �

h n n( ).

= +1

1 5 1

v n i n u n h n u n m h mo

m

( ) . ( ) . ( ) ( ) . ( ) ( )= = ==

0 5 0 5 0 5 +=

= 0 51

1 5 10

. ( ).

u n mm

m

n

v u m uo mm

( ) . ( ).

. ( ).

.0 0 5 0

11 5

0 5 01

1 50 5

10

0

= = =+=

11 5

1 0 5 11

1 50 5 1

11 5

0

1

1

.

( ) . ( ).

. ( ).

v u m uo

mm= =

=+ 11 20

11 5

0 51

1 51

11 5

1 25

+

= + =

u( ).

.. .

.22 25

2 0 5 21

1 50 5 2

111

0

2

.

( ) . ( ).

. ( ).

v u m uo mm

= =+=

551

11 5

01

1 5

0 51 5

11

1 5

1 2 3+ +

= + +

u u( ).

( ).

.

. .11

1 5

2 3753 375

2.

.

.=

v no n( ) .

. . . ..= + + + + =0 5

11 5

11

1 51

1 51

1 50 5

2�

111 5

11

1 5

11

1 5

1

..

.

+n

Page 159: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

140 Signals and systems primer with MATLAB

Example 3.4.2: Repeat Example 3.4.1 with the difference that the sam-pling time T is included so that the solution can be found for any value of T.

Solution: The corresponding difference equation of (3.41) is

(3.43)

To apply the convolution, we must first find the impulse response functionh(nT) of the system. Hence, we write

(3.44)

In the above equation we have introduced the delta function property:

.

Since the system is causal, h(–T) = 0. Following the procedure of the previousexample, the impulse response is

(3.45)

If we compare the present impulse response with that found above, we seethe correspondence between 1/1.5 and a. Hence, the output voltage is

(3.46)

To compare the output at t = 1.5 for T = 0.5 and T = 0.01, we introduce thesevalues in the above equation. Hence, the values are 0.5904 and 0.5291, respec-tively. The exact value at t = 1.5 is 0.5276. �

Example 3.4.3: Determine the convolution of the two discrete functionsshown in Figure 3.4.3a.

Solution: The two functions in Figure 3.4.3b are shown in the m domainfor three different values of n. Now, apply the steps required in the convo-lution formula:

i nT ai nT T aTv nT aT

( ) ( ) ( ),.

= =+

11 0 5

h nT ah nT T aT nT aT

( ) ( ) ( ).

= + =+

11 0 5

( ) ( )ata

t= 1

h nT Ta aT

nn( ).

, , ,= =+

=+1 11 0 5

0 1 2 �

v nT aTa

ao

n

( ) .=+

0 51

1

1

g n u m u m e u n mn m

m

n

( ) [ ( ) ( )] ( )( )==

40

Page 160: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 3: Discrete systems 141

This can be accomplished by graphical construction. The resulting g(n) isshown in Figure 3.4.3b. �

Important definitions and concepts

1. Discrete system2. Block diagram representation of discrete systems3. Difference equations

Figure 3.4.3 Illustration of Example 3.4.3.

(a)

n n

1 1

f(n) = u(n) – u(n – 4) h(n) = exp(–n)u(n)

3 3

1/e3

1/e2

1/e

m

f(m)

3 –3 m

h(–m)

for n = 0

Multiply

and sum =1 1 1

g(0)

n

1

f(m)

m 1–2

h(1 – m)

m

for n = 1

Multiply

and sum =

n

1 + 1/e

1

g(1)

+

3

f(m)

m

1

2 m

1

1

h(2 – m)for n = 2

Multiply

and sum

3

–1

=

g(2)

n2

1 + 1/e + 1/e2

+

+

=g(n)

1 2 3 4 5 6 n

…1

g(0) = 1; g(1) = 1 + 1/e; g(2) = 1 + 1/e + 1/e2

g(3) = 1 + 1/e + 1/e2 + 1/e3; g(4) = 1/e + 1/e2 + 1/e3 + 1/e4

g(5) = 1/e2 + 1/e3 + 1/e4 + 1/e5

(b)

Page 161: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

142 Signals and systems primer with MATLAB

4. Finite duration impulse response system (FIR), or nonrecursive ortransversal

5. Infinite duration impulse response (IIR)6. Digital simulation of analog systems7. Linearization of nonlinear systems8. Convolution of sequences9. Smoothing systems

10. Correlation of sequences11. Method of variation of parameters (see Appendix 3.1)12. The approximate Euler’s method for solving differential equations

(see Appendix 3.2)

Chapter 3 ProblemsSection 3.1

1. A signal generator produces a signal specified by

With signal source as a basis unit, draw the block diagram of thesystem that will produce the signal shown in Figure P3.1.1.

Figure P3.1.1

v n

n

n n

n

( ) =

<

+

>

0 0

1 2 0 2

0 2

1

3

5

2 3 4 n

g(n) g(n)

n–1

–3

–5

2 3 4

g(n)

5

n

1

3

5

–1

–3

–5

(a) (b) (c)

Page 162: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 3: Discrete systems 143

2. A discrete system is shown in Figure P3.1.2a. If the input function isthat shown in Figure P3.1.2b, determine the output.

3. A discrete system is shown in Figure P 3.1.3a. If the input is thatshown in Figure P3.1.3b, find the output.

4. Refer to Figure P3.1.4. Deduce the difference equation and find itssolution when the input voltage v(n) is that shown in the same figure.Identify the system.

Figure P3.1.2

Figure P3.1.3

Figure P3.1.4

+ 1

z–1

y(n)2δ(n)

2

n

δ(n)

(a) (b)

1

n

δ(n)

z–1

z–1

4

6

+

+δ(n) y(n)

(a) (b)

z–1

z–1

–1

+

1

n

g(n)v(n)–1

–1

g(n)

2

Page 163: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

144 Signals and systems primer with MATLAB

5. Smoothing system. Deduce the difference equation and its solutionfor the system shown in Figure P3.1.5. What is the effect of this systemto the input?

6. A unit step sequence is applied to the input of the system shown inFigure P3.1.6. Deduce the difference equation and its solution. Iden-tify the nature of the output.

7. Banking. If a family invests $1000 per quarter at 12% interest for20 years, how much money will the family have accumulated?Assume no initial money was in the account. Interest is compoundedquarterly. Draw the block diagram of the system and identify it.

Section 3.2

1. The input to each system shown in Figure P3.2.1 is a ramp functionf(t) = 2r(t). Determine the outputs in analog form and in digital formfor T = 0.2 s. Contrast results. Draw analog and digital block diagramrepresentations.

Figure P3.1.5

Figure P3.1.6

+

2

–4

v(n) v(n)

v(n)

g(n)

z−1

z−2

2v(n – 1)

–4v(n – 2)

(a)

n

g(n)

1

3

–1 1

2 3 4

(b)

z–1z–1

z–1

z–1

v(n)

_ __+

g(n)

1

v(n)

3 n

Page 164: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 3: Discrete systems 145

Figure P3.2.1

(a)

v(t)

v(t) = 2r(t)

i(t)

+v(t) i(t)

Input Output

L = 2 H

System

t

(b)

v(t)

v(t) = 2r(t)

i(t)

+v(t) i(t)

Input Output

C = 0.2 F

System

t

(c)

f(t)

v(t) = 2r(t)

v(t)

f(t) v(t)

Input Output

K = 2 N/m

System

t

J = 2

kg m2 System

T(t)

(t)

(t)

T(t) = 2r(t)

T(t)

t

Input Output

(d)

Page 165: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

146 Signals and systems primer with MATLAB

2. The initially relaxed system shown in Figure P3.2.2 is excited by acurrent source i(t) = exp(–2t)u(t). Determine the output voltage inboth analog and digital forms for T = 0.2 s. Give the block diagramrepresentation for each case.

3. If g(–1) = 0 and g(n) – 2g(n – 1) – 4 = 0 for n 0, find a closed-formsolution for g(n).Hint: Use a recursive solution to identify the closed form.

4. If g(–1) = 2 and g(n) – 2g(n – 1) = (n) for n 0, find the closed-formsolution for g(n).

Section 3.3

1. Illustrated in Figure P3.3.1 is a ballistic pendulum that is initially atrest. A bullet of mass m traveling with a speed v is fired into thependulum mass at t = 0 and remains lodged therein. Determine theinitial value (0+). Write the controlling equation for angle (t). Drawa network equivalent of the system. Simulate the system with itsequivalent discrete form.

Figure P3.2.2

Figure P3.3.1

R = 2

C = 0.5 F

+

vo(t) vo(t)

System i(t)

Input Output i(t) = exp(–2t)u(t)

M

m

Page 166: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 3: Discrete systems 147

2. Determine the particular solution of the following differential equa-tions:

a. (d2y/dt2) + y = 2t for t > 0

Hint: Assume a solution of the form y = A + Bt.

b. (d2y/dt2) – 4y = exp(2t) for t > 0

Hint: Since Aexp(2t) is a solution of the homogeneous equation,try y = Atexp(2t).

c. (d2y/dt2) – y = sint for t > 0

Hint: Assume the solution of the form y = Acost + Bsint.

3. The capacitor of the RLC circuit shown in Figure P3.3.3 carries aninitial charge of Qo = 2 C. Determine the current in the circuit. Sim-ulate the system with its discrete equivalent.

Hint: Use the fact that i = dq/dt to solve an equation for q, withdq(0)/dt = 0. Use this solution to deduce the equation for i = dq/dt.An alternative approach is to differentiate the KVL integrodifferentialequation to obtain L(d2i/dt2) + R(di/dt) + (1/C)i = dvi/dt. Initial con-ditions are q(0) = Qo = constant, then i(0) = dq(0)/dt = 0; from theintegrodifferential equation, (di(0)/dt) = (1/L)[vi(0) – (1/C)q(0)].

4. Solve the equations given in Problem 3.3.2 for zero initial conditions:y(0) = 0 and dy(0)/dt = 0. Then, simulate the equations in digital formand solve for T = 0.1. Compare the results.

Figure P3.3.3

vi = 5V

R = 5 Ω L = 1 H

C = (4/9)F

S

Qo = 2C

Page 167: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

148 Signals and systems primer with MATLAB

Section 3.4

1. Determine the convolution of the discrete signals shown in FigureP3.4.1.

2. Deduce the output of the system shown in Figure P3.4.2 in discreteform using the convolution method. Assume a step function inputi(t) = u(t), a sampling time T = 0.5 s, R = 0.5 ohms, and C = 1 F.

3. Deduce the convolution of the following pairs of functions:

a. f(n) = 3nu(n), h(n) = 4nu(n)b. f(n) = 0.8nu(n), h(n) = u(n)c. f(n) = u(n), h(n) = u(n)

4. Determine the convolutions:

a. g(n) = [2nu(n)]*[2nu(n)]b. g(n) = [2nu(n)]*[2nu(n)] [2nu(n)]

5. Determine the convolution of the functions shown in Figure P3.4.5.

Figure P3.4.1

Figure P3.4.2

Figure P3.4.5

1

3 n

1

n

(a) (b)

3

1

2 n n

1

1

1

n 3 n

1

(c)

3

+

v(t)v(t)i(t)

i(t)

R = 0.5 Ω

C = 1 F

System

(a) (b)

–1

1 1

–3

8

n n

f(n) h(n)

1

4 –2n n

f(n) h(n)

Page 168: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 3: Discrete systems 149

6. a. Show that

where m is a constant integer.b. Determine the convolution of the functions shown in Figure

P3.4.6.

3. Correlation of sequences. The correlation of discrete signals is givenby the relation

Discretize and deduce the correlation between the functions given.

a. f(t) = p1(t), h(t) = exp(–t)u(t)b. f(t) = p1(t), h(t) = (t – 1) + p1(t – 3)

Appendix 3.1: Method of variation of parametersThe method of variation of parameters

For convenience and clarity, we shall restrict our development on the first-and second-order differential equations with constant coefficients. Therefore,a second-order differential equation is of the form

(1.1)

Figure P3.4.6

[ ( ) ( )] [ ( )] ( ),f n u n u n m f nn

n m

==0

5 n

1

–1

6 n

f(n) h(n)

1

g nT f nT h nT f mT h mT nT

g n f

m

( ) ( ) ( ) ( ) ( )

( )

= =

=

=

(( ) ( ) ( ) ( )n h n f m h m nm

� ==

a y a y a y Q t a2 1 0 2 0+ + = ( ),

Page 169: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

150 Signals and systems primer with MATLAB

In the method of undetermined coefficients, introduced in Chapter 2, thefunction Q(t) was assumed to have a finite number of linear independentderivatives. However, in this method we will assume that Q(t) is a contin-uous function on an interval I and it is different than zero on I.

The homogeneous equation of (1.1) is

(1.2)

Let its two independent solutions be y1 and y2. With the help of these solu-tions we form the equation

(1.3)

where u1 and u2 are unknown functions of t that are to be determined.The successive derivatives of (1.3) are

(1.4)

(1.5)

Substituting the above values of in (1.1), we see that yp will bea solution of (1.1) if, after some simple algebraic manipulation, the relationbelow is satisfied.

(1.6)

Since y1 and y2 are assumed to be solutions to homogeneous equation (1.2),the quantities in the first two parentheses in (1.6) are equal to zero. Theremaining three terms will be equal to Q(t) if we choose u1 and u2 such that

(1.7)

The above equations can be solved for in terms of the other func-tions by the ordinary algebraic methods. Or, using the determinant approach,the solutions of (1.7) are

a y a y a y2 1 0 0+ + =

y t u t y t u t y tp( ) ( ) ( ) ( ) ( )= +1 1 2 2

= + + + = + +y u y u y u y u y u y u yp 1 1 1 1 2 2 2 2 1 1 2 2( ) ( +u y u y1 1 2 2)

= + + + +y u y u y u y u y u yp ( ) ( ) (1 1 2 2 1 1 2 2 1 1 ++ u y2 2)

y y yp p p, , and

u a y a y a y u a y a y a y1 2 1 1 1 0 1 2 2 2 1 2 0 2( ) ( )+ + + + + ++ +

+ + +

a u y u y

a u y u y a u

2 1 1 2 2

2 1 1 2 2 1 1

( )

( ) ( yy u y Q t1 2 2+ =) ( )

+ =

+ =

u y u y

u y u yQ ta

1 1 2 2

1 1 2 22

0

( )

u u1 2and

Page 170: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 3: Discrete systems 151

(1.8)

Equation (1.8) will always give solutions to provided the denom-inator is different than zero.

Example A3.1.1: Find the general solution of

(1.9)

Solution: We observe that this equation cannot be solved by the methodof undetermined coefficients. We also see that Q(t) = sin(e–t) has an infinitenumber of linearly independent derivatives. The roots of the characteristicequation are m = 1, m = 2. Hence, the complementary function (or homoge-neous solution) of (1.9) is

(1.10)

The two independent solutions of the related homogeneous equation of (1.9)are

(1.11)

Substituting the above values and their derivatives in (1.7), we obtain, witha2 = 1 (a2 is the coefficient of y ),

(1.12)

Solving (1.12) for we find

(1.13)

Therefore, the values of u1 and u2 are

= =u

y

Q ta

y

y y

y y

yQ ta

y y1

2

22

1 2

1 2

22

1 2

0

( ) ( )

= =y y

u

y

yQ ta

y y

y y

Q ta

y

1 222

1

12

1 2

1 2

2

0

,

( ) ( )

'11

1 2 1 2y y y y

u u1 2and ,

+ =y y y e t3 2 sin( )

y c e c ect t= +1 2

2

y e y et t1 2

2= =and

+ =

+ =

u e u e

u e u e e

t t

t t t

1 22

1 22

0

2( ) sin( )

u u1 2and ,

= =u e e u e et t t t1 2

2sin( ), sin( )

Page 171: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

152 Signals and systems primer with MATLAB

(1.14)

where we set u = e–t and du = –e–tdt. Substituting (1.14) and (1.11) in (1.3),we obtain

(1.15)

Therefore, the total solution is

(1.16)

The unknown constants will be determined from the initial conditions.�

Appendix 3.2: Euler’s approximation for differential equationsIntroduction

There are numerous numerical methods for solving differential equations.In this chapter we have introduced one of these methods. Since our treatmentis introductory, we shall omit details on accuracy of results and how mucherror is involved in the approximation. In our case, we just decrease thesampling time and decide on it based on how much the values change fromone T to the other.

In our present development, we assume that the differential equation inquestion is of the form We note that all differential equations canbe written in this form since higher-order ones can be decomposed as a setof first-order differential equations. Therefore, to avoid cumbersome treat-ment of integration constants, we develop the initial value problems (IVPs).Thus, we investigate the following IVPs:

(2.1)

(2.2)

Let assume that the solution to the IVP is the curve shown in Figure A3.2.1.Suppose that we want to know the coordinates of the point (t1, y1). In case

u e e dt e

u e e

t t t

t

1

2

= =

=

sin( )( ) cos( ),

sin( = +t t t t te dt e e e)( ) sin( ) cos( )

y e ept t= 2 sin( )

y y y c e c e e ec pt t t t= + = +1 2

2 2 sin( )

=y f t y( , ).

dy tdt

f t y y f t y( )

( , ) ( , )= =or

y t y( )0 0=

Page 172: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 3: Discrete systems 153

we know explicitly the equation of y as a function of t, it is a simple matterof knowing t1. The following question arises: Is it possible in the absence ofan explicit form of y(t) to determine y1 knowing t1? The answer to thisquestion is the goal of any numerical method. We will say that we have anumerical solution of our differential equation in the interval [t0, tb] whenwe have obtained a set of values [(t0, y0), (t1, y1), …, (tn, yn)], where tn = b andyi is an approximation to the solution at each point of t.

Euler method

Referring to Figure A3.2.2, we can consider that in transferring from theinitial point (t0, y0) to nearby point (t1, y1) the following changes occur: t =t1 – t0, y = y1 – y0. The Euler method is to approximate y by its differentialdy. Hence, we write

To obtain an accurate approximation, it is reasonable to make t as smallas possible. Given the IVPs (2.1) and (2.2) and the specific value t1, y1 can befound using the Euler method:

Thus, one can calculate y1 directly from the information given. Next, we findy2 using the relationship

Figure A3.2.1

y

t

(t0, y0)

(t1, y1)

dydydt

dt f t y dt f t y t= = ( , ) ( , )

y y f t y t y f t y t t1 0 0 0 0 0 1 1 0= + = +( , ) ( , )( )

y y f t y t y f t y t t t t2 1 1 1 1 1 1 2 1 2 1= + = + >( , ) ( , )( )

Page 173: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

154 Signals and systems primer with MATLAB

This process can then be repeated to obtain additional pairs of points. Usu-ally, this process is carried out in a specified interval with prescribed spacingbetween the t coordinates. The spacing is usually taken to be uniform andequal to T. If it is desired to obtain n points in addition to the initial point,then T is given by the formula

where b is the value of the end of the desired range of t. When the sequence{yi} is plotted vs. {ti}, hopefully it is very close to the solution curve.

The Euler method can be summarized as follows:

(2.3)

(2.4)

Example A3.2.1: Use the Euler method to solve numerically the IVPproblem

(2.5)

Solution: If we desire n = 5, then the sampling time T = (1 – 0)/5 = 0.2.Hence, t2 = 0 + 0.2 = 0.2. Thus, y1 = y0 + y2 = y1 + =0.008, y3 = 0.040013, and y4 = 0.112333. �

Figure A3.2.2

Δy

dy

Δt

t

y

(t0, y0)

(t1, y1)

Tb t

n= 0

t t T i ni i= + =1 1 2 3, , , ,�

y y f t y T i ni i i i= + =1 1 1 1 2 3( , ) , , , ,�

= + =y x y y t2 2 0 0 0 1, ( ) ,

( ) . ,t y02

02 0 2 0+ = ( ) .t y1

212 0 2+

Page 174: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 3: Discrete systems 155

Book m-File for the Euler Method: exA_3_2_1

%exA_3_2_1 is the name of the m file to solve

%ExA3.2.1

T=(1-0)/5;

y(1)=0;

t=0:T:1;

for i=1:5

y(i+1)=y(i)+(t(i)^2+y(i)^2)*T;

end;

Page 175: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

157

chapter 4

Periodic continuous signals and their spectrums

The study of periodic functions has had a long history. Bernoulli, around themiddle of the 18th century, suggested that the physical motion of a clampedstring, such as those in stringed instruments, could be represented by linearcombinations of normal modes (sinusoids). At about the same time, Lagrangestrongly criticized the use of trigonometric series, arguing that it was notpossible to represent functions that contain edges with such series. It was ahalf century later that Jean Batiste Joseph Fourier, in conducting his studieson heat diffusion and propagation, developed the series now carrying hisname that mathematically addressed such problems. His revolutionary dis-coveries have had a major impact on the development of mathematics. Fou-rier series are used extensively today in the fields of science and engineering.

As we will see in this chapter, many types of nonsinusoidal periodicfunctions can be represented as the sum of periodic complex exponentialfunctions, or sinusoids, a property noted in the next section. This importantconcept plays a significant role in our general studies. In particular, we willfind that the output of a linear time-invariant (LTI) system to a periodic inputsignal composed of sinusoids is the sum of these same sinusoids, each ofwhich is scaled and time shifted.

The representation of periodic functions in sampled form, a requirementwhen using a computer and digital signal processing, will also be examined.Further, the conditions necessary for an acceptable approximation that leadsto the discrete Fourier transform (DFT) series will be established.

4.1 Complex functionsFirst, we shall consider the complex form of sinusoidal signals, which areuseful as building blocks or basis functions from which we can constructother signals. We shall consider both continuous- and discrete-time functions.

Page 176: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

158 Signals and systems primer with MATLAB

Continuous-time signals

A general complex signal is of the form

(4.1)

where a and b are complex numbers in general. If a and b are real numbers,we have the well-known exponential functions. If a is a constant and b is acomplex number, b = c + jd, we have the complex exponential of the form

(4.2)

A very important signal in our subsequent work is obtained by settingin (4.1) a = 1 and b = j 0. This signal is

(4.3)

where use is made of the Euler relation (see Chapter 1). The signal y(t) canalso be written in the form

(4.4)

The frequency is 0 = 2 f0 = 2 /T, where T is the period.A feature of the exponential signal is made evident by writing t = t + T

in (4.3). Hence,

(4.5)

This shows that y(t) is periodic with period T. Since T is the smallest time tthat makes exp(j 0t) equal to 1, it is called the fundamental period. Further,if we plot exp(j 0t) on the complex plane as t varies, we observe a unit vectorthat rotates counterclockwise at the rate 0/2 rev/s. Figure 4.1.1 shows thefunction exp(j 0t) in the complex plane for the particular value 0 = 4 rad/sand for different values of t. Similarly, the function exp(–j 0t) is also periodic,but it rotates in the clockwise direction as the time t increases.

A signal that is closed related to the complex one is the sinusoid of theform

(4.6)

y t aebt( ) =

y t ae ae ec jd t ct jdt( ) ( )= =+

y t e t j tj t( ) cos sin= = +00 0

y t t t ej t t( ) cos sin tan (sin /cos )= +20

20

10 0

y t T e e e e e

e

j t T j t j T j t j

j t

( ) ( )+ = = =

=

+0 0 0 0

0

2

((cos sin ) ( )2 2 0+ = =j e y tj t

y t A t( ) cos( )= +0

Page 177: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 4: Periodic continuous signals and their spectrums 159

This can also be written in the form

(4.7)

where Re{} denotes the real part of the complex expression in the braces.As already suggested, we can construct periodic nonsinusoidal signals

using sinusoids at frequencies that are multiples of the fundamental fre-quency 0 (angular frequency). These sinusoids are of the form

(4.8)

We observe that for n = 0, y(0) = 1, a constant. Further, for any n, the signal exp(jn 0t) has a frequency �n� 0/2 Hz and fundamental period 2 /(�n� 0) = T/n.

An important feature of the complex functions exp(jn 0t) for integralvalues of n (– < n < ) is that these functions constitute an orthogonal setover a full period (see Chapter 1). This means that

(4.9)

Also, sin n 0t and cos n 0t constitute orthogonal sets, with

(4.10)

Figure 4.1.1 Complex function ej4 t at different values of t.

t � 0

t � 1/16

t � 1/8

t � 5/16 t � 7/16

t � 15/32

Im(e j4π t)

Re(e j4π t)

y tAe Ae

A ej t j t

j t( ) Re( ) ( )

( )= + = { }+ +

+0 0

0

2

y t e nnjn t( ) , , ,= = ± ±0 0 1 2 �

e e dt e dtT n m

n

jn t jm tT

j n m tT

0 0 0

0 0 0( ) * ( )= =

=

m

cos cosn t m tdt

Tn m

n m

T

0 00

2

0

==

Page 178: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

160 Signals and systems primer with MATLAB

(4.11)

These properties are of importance in the development of the Fourier series.

Discrete-time signals

The equivalent exponential function in the discrete domain is

(4.12)

In this form, stands for discrete frequency and has the units of radians perunit. If we consider the new frequency + 2 , we obtain

(4.13)

This result indicates that the exponential function has the same value atand at + 2 . In fact, the functions are the same at + 2 , + 4 , andso forth. We thus conclude for discrete exponential signals that we needconsider only the interval of length 2 , This conclu-sion is different from that of the continuous case, in which we have a differentfunction for any distinct frequency. Figure 4.1.2 plots the function cosas increases. Observe that the function starts repeating itself as increasesbeyond the value 2 . Observe that the fourth and sixth plots are identicalsince /2 corresponds to 5 /2 = 2 + ( /2) – 2 .

Note: As the frequency of an analog sinusoid increases to infinity, the undu-lations also increase to infinity. On the contrary, the digitized sinusoids repeatthemselves every period. For T = 1, the period is 2 , and for any T, the period is 2 /T.

For the discrete function exp(j n) with period N > 0, we must have

(4.14)

which, for periodicity, requires that

(4.15)

This requires that

(4.16)

This expression indicates that the ratio must be a rational number forthe exponential function exp(j n) to be periodic.

sin sinn t m tdt

Tn m

n m

T

0 00

2

0

==

y n ejn( ) =

e e e ej n j n jn jn( ) + = =2 2

,

0 2 < or .

( )n

e e ej n N j n j N ( )+ =

ej N = 1

N nnN

n= = =22

or integer

/2

Page 179: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 4: Periodic continuous signals and their spectrums 161

When we wish to represent a continuous sinusoidal function by its discreteform representation, we must investigate whether the new function is periodic.For example, the continuous function exp(j t) can be digitized to the form

(4.17)

which selects values of f(t) at time intervals t = nT.

Note: The frequency has the units of rad/s. However, the the frequency Thas the units rad/unit and is known as the discrete frequency. If the value of T is1, then the frequency is automatically a discrete frequency.

Comparing (4.17) and (4.15), we must conclude that the digitized func-tion is periodic if

(4.18)

This expression shows that although exp(j t) is periodic, exp(j nT) may not be.

4.2 Fourier series of continuous functionsOne of the most frequent features of natural phenomena is periodicity. Awide range of periodic phenomena exist, such as the audible note of amosquito, the beautiful patterns of crystal structures, the periodic vibrations

Figure 4.1.2 Discrete sinusoidal function for different frequencies.

–10–20

–1

10 200

0

1

cos(

n0

)

n

–10–20–1

10 200

0

1

cos(

nπ/

8)

n

–10–20–1

10 200

0

1

cos(

nπ/

4)

n

–10–20–1

10 200

0

1

cos(

nπ)

n

–10–20–1

10 200

0

1

cos(

nπ/

2)

n

–10–20–1

10 200

0

1

cos(

n5

π/2

)

n

f nT e ej nT j T n( ) ( )= =

T2

= rational number

Page 180: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

162 Signals and systems primer with MATLAB

of musical instruments, and acoustic and electromagnetic waves of mosttypes. In all these phenomena, there is a pattern of displacement that repeatsitself over and over again in time or in space. In some instances, for example,in wave patterns, the pattern itself moves in time. A periodic pattern mightbe simple or rather complicated.

A function f(t) (a physical pattern or phenomenon) is periodic withperiod T if its value satisfies the condition

(4.19)

for any t and n.An important feature of a general periodic function is that it can be

represented in terms of an infinite sum of sine and cosine functions, whichthemselves are periodic. This is possible due to the fact that the sine andcosine functions are orthogonal under integration within their period. Thisseries of sine and cosine terms is known as a Fourier series. For a periodicfunction to be Fourier series transformable, it must possess properties knownas the Dirichlet conditions, which ensure mathematical sufficiency but notnecessity. The Dirichlet conditions require that within a period:

1. Only a finite number of maximums and minimums can be present.2. The number of discontinuities must be finite.3. The discontinuities must be bounded. That is, the function must be

absolutely integrable, which requires that

.

Fourier series in complex exponential formAny periodic signal f(t) having period T and satisfying the Dirichlet condi-tions can be expressed in a series form given below:

(4.20)

f t T f t f t nT f t n( ) ( ) ( ) ( ) , , ,+ = + = = ± ± ±or 1 2 3 �

f t dtT

( ) <0

f t a e a enjn t

n

nj n t

n

n( ) ( )= ==

+

=

0 0

( )

a)

coaT

f t e dtnjn t

t

t T

= =+1

0

0

0

mmplex constant

= = +a e a j anj

n n n nn cos sin b)

fundamental frequency0

0

2= =

=

T

t aarbitrary value of

period

t

T =

Page 181: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 4: Periodic continuous signals and their spectrums 163

Observe that the amplitudes an of the component terms in the Fourierseries expansion of f(t) are determined from the given f(t) using a range oft equal to the period T. Correspondingly, f(t) is determined from the knowl-edge of the complex constants an. Often, these two related equations arereferred to as a Fourier series transform pair; that is, knowing one equation,the second can be found, and vice versa. In addition, any periodic functionthat satisfies the Dirichlet conditions and is written in a Fourier series expan-sion converges at any point t to f(t) provided that the function is continuousat t. If f(t) is discontinuous at t = t0, the function f(t0) will converge to f(t0) =[f(t0+) + f(t0–)]/2, the mean value at the point of discontinuity (the arithmeticmean of the left-hand and right-hand limits). If f(t) is real, then

(4.21)

This result, when combined with (4.20a), yields

(4.22)

Example 4.2.1: Find the coefficients an for the periodic function shownin Figure 4.2.1a and plot f(t) using different number of factors of the sum.

Solution: Apply (4.20b) to obtain

Note: The j in the integration is treated as another constant.

For the values a–n, the complex conjugate values of an, it is necessary tochange the sign in front of each j in the equation for an. The result is

aT

f t e dtT

f t enjn t

t

t Tjn t

t

t+

= =1 10

0

00

0

0

( ) ( )++

=T

ndt a

f t a a a n t j a a tn n n n

n

( ) [( )cos ( )sin ]= + + +=

0 0 0

11

a f t e dt enjn t jn t= =1

3 51

3 510 0

0 5

3 5

0.( )

..

.

..

. ( )

5

1

1

3

0

0

13 5

0+

=

dt e dt

jne

jn t

jn 0 0 0

0 5

1

0

0 513 5

t jn j n

j ne e=

.

.

.( )

f tj n

e ej n

jn j n( ).

( ).

.= + +37

13 5

13 50

0 5

0

0 0 (( ) cos.e e n t

j

jn j n

n

0 00 50

1

1+

=

jj ne e

j ne ejn j n jn

3 51

3 50

0 5

0

0 0 0

.( )

.(. jj n n t0 5

00. ) sin

Page 182: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

164 Signals and systems primer with MATLAB

(4.23)

The plot in Figure 4.2.1b shows the results of (4.23) for n = 3, n = 15, and 3 n 15.

Book MATLAB m-file: four_ser

%four-ser=this is the name of an m-file to

%compute the fourier series;

%the reader must change a0,T,n,an,and bn for

%each case;

a0=3/7;

T=3.5;

om=2*pi/T;

n=5:15;

t=0:0.01:1.5*T;

an=(4./(3.5*n*om)).*(sin(0.75*n*om).*cos(0.25*n*om));

bn=(4./(3.5*n*om)).*(sin(0.75*n*om).*sin(0.25*n*om));

f=a0+cos(t'*n*om)*an'+sin(t'*n*om)*bn';

%f is the desired function and to plot

%it we just input plot(t,f);

%note that cos (t'*n*om) is a matrix;

We observe from Figure 4.2.1b that an overshoot occurs at each point ofthe discontinuity. It was shown by Gibbs that the overshoot remains at about10% at each edge, regardless of the number of terms included in the expan-sion, although the rest of the undulations decrease with increasing n. Thisproperty is known as the Gibbs’ phenomenon. Observe that as we add moreand more terms (higher frequencies), we recapture better the abrupt changesof the signal. This tells us that the high frequencies in the expansion con-tribute to building the discontinuities of the function. Thus, if a periodic

= + +37

23 5

0 52

3 500 0 0.

(sin sin . )cos.n

n n n tn 001

0 00 5

=n

n n(cos cos . ))sin

.[(sin . cos .

n t

nn n

0

00

37

43 5

0 75 0 25= + 00 0

1

0 75

)cos

(sin .

n tn

+

=

nn n n t

A n tn

n

0 0 0

1

0

0 25

37

sin . )sin ]

cos= +=

++ B n tn sin 0

Page 183: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 4: Periodic continuous signals and their spectrums 165

nonsinusoidal signal is applied to a system and if the higher frequencies inthe expansion are attenuated more than the lower frequencies, the outputsignal will be smoother than the original. This is obvious from the plot forn = 3 and n = 15. This feature of frequency-selective attenuation is veryimportant in our studies of signals and systems. This procedure is knownas filtering. �

Fourier series in trigonometric form

The Fourier series expansion given by (4.22) can be written

(4.24)

Figure 4.2.1 A square periodic function and its Fourier representation.

… …

–4 –2.5 –0.5 1 3 4.5 t

f(t)

1

(a)

T

T – 3.5

0 1 2 3 4 5 6 –0.2

0

0.2

0.4

0.6

0.8

1

1.2

f(t)

t

Gibbs’ phenomenon

n – 3

n – 15

n – 5–15

(b)

f t A A n t B n tn n

n

( ) ( cos sin )= + +=

0 0 0

1

Page 184: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

166 Signals and systems primer with MATLAB

where

(4.25)

These expressions for the coefficients can be obtained directly from(4.24). Thus, to find A0, multiply all terms in (4.24) by dt and integrate overa period. The result is

The trigonometric terms integrate to zero, leaving only

which is (4.25a). To find An, multiply all terms in (4.24) by cos(m 0t) dt andintegrate over a full period. This yields

By the orthogonality relationships, every integral on the right-hand sidebecomes zero except the single expression for n = m in the form

Similarly, by multiplying all terms in (4.24) by sin(m 0t)dt and integratingover a full period, (4.25c) results.

A aT

f t dt

A a aT

f t

t

t T

n n n

0 01

2

0

0

= =

= + =

+

( )

( ) ( )co*

a)

ss

( ) ( )sin*

n t dt

B j a aT

f t n t

t

t T

n n n

0

0

0

0

2

+

= =

b)

ddtt

t T

0

0 +

c)

f t dt A dt A n t dt BT T

n

T

n

n( ) cos sin0

00

00

1

= + +=

nn t dtT

n

00

1=

f t dt A dt A TT T

( )0

00

0= =

f t m tdt A m t dt A n tT T

( )cos cos cos co00

0 00

0 0= + ss

sin cos

m t dt

B n t m t dt

T

n

n

T

n

00

1

0 00

=

=

+00

f t n t dt A n t dt ATT

n

T

n( )cos cos00

20

0 2= =

Page 185: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 4: Periodic continuous signals and their spectrums 167

We can write (4.24) in a slightly different form:

(4.26)

where

(4.27)

The foregoing results are summarized in Table 4.2.1.

Example 4.2.2: Develop the trigonometric forms of the Fourier series forthe periodic function given in Example 4.2.1.

Solution: By (4.25), we find

Using the above values, we can easily verify (4.23). Next, using (4.27)we obtain

f t A A n tBA

n t

A

nn

nn

( ) cos sin= + +

=

=0 0 0

1

0 ++

= +

=

A n t n t

AA

n n

n

n

nn

(cos tan sin )

cos

0 0

1

0

==

=

+

= + +

1

0

0 0

1

cos( )

cos( )

n t

A C n t

n

n n

n

n n n n n nB A C A B= = +tan ( ) ( ) /1 2 2 1 2/

A f t n t dt n t dtn = =23 5

23 50

0 5

3

00.

( )cos.

cos. .55

1

00 0

00

23 5

0 5

23 5

1

= +

=

.(sin sin . )

. .

nn n

A dt55

1

00 5

1

0

33 5

23 5

23 5

=

= =

.

.sin

.(cos

.B n t dt

nn 00 5 0 0. cos )n n

Cn

n nn = + +23 5

0 52

3 500 0

2

.(sin sin . )

.(coss . cos )

/

0 5 0 0

21 2

n n

Page 186: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

168 Signals and systems primer with MATLAB

The above equations are ploted in the upper and lower parts of Figure 4.2.2,respectively. The coefficients Cn are known as the amplitude spectrum, andthe phase n is the phase spectrum. Specifying amplitude and phase spec-trums is a very important concept.

Note: The amplitude spectrum contains information about the energy contentof a signal and the distribution of energy among the different frequencies. The phasespectrum indicates the phase shift for each frequency.

The spectrum is important in many practical applications. For example,knowledge of the spectrum of an electrocardiogram of the heart or a signalfrom an engine may reveal abnormal operation and possible imminent failure.

Table 4.2.1 Forms of Fourier Series for Real Functions

Complex Form Trigonometric Forms

Formulas for the Coefficients

f t a e

a e

n

n

jn t

n

j n t

n

n

( )

( )

=

=

=

+

=

1

0

0

f t A A n t B n t

f t A C

n

n

n( ) ( cos sin )

( )

= + +

= +

=

0 0

1

0

0 nn

n

nn t=

+1

0cos( )

0

0

2

10

0

0

=

=

=+

T

a a e

aT

f t e dt

t

n n

j

n

jn t

t

t T

n

( )

tt t T

AT

f t m t dt

n

B

nt

t T

n

+

=

=

+

0

0

2

1 2 3

0

0

( ) cos

, , ,�

==

=

+2

1 2 3

0

0

0

Tf t n t dt

n

t

t T

( ) sin

, , ,�

A a

A a a a

B j a a a

n n n n

n n n n

0 0

2

2

=

= + =

= =

*

*

Re{ }

( ) Im{ }

CC A B

B A

A C

B

n n n

n n n

n n n

n

= +

=

=

[ ]

tan [ ]

cos

2 2

1

1 2

/

== Cn nsin

nn n

n n=

+tan

cos . cossin sin .

1 0 0

0 0

0 50 5

Page 187: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 4: Periodic continuous signals and their spectrums 169

Note: The spectrum of periodic functions is made up of discrete harmonics; eachone is a multiple of the fundamental harmonic, which is equal to 2 /T. Therefore, thesmallest frequency existing in a periodic function is equal to its fundamental harmonic.

4.3 Features of periodic continuous functionsParseval’s formulaOne important property of continuous periodic functions is the energy rela-tion known as the Parseval formula. Consider a periodic function f(t) thatis represented in Fourier series expansion

(4.28)

The mean value of f 2(t) (this represents instantaneous power if weassume that f(t) is voltage and is multiplied by f(t)/(1-ohm resistor), whichis current) over a period is given by

(4.29)

Figure 4.2.2 Amplitude and phase spectrums for the signals shown in Figure 4.2.1a.

20181614121086420–4

–2

0

2

n or nω0 rad/s

φ n r

ad

201816141210864200

0.4

0.2

0.6

0.8

n or nω0 rad/s

Cn

f t A C n tn

n

n( ) cos( )= + +=

0

1

0

1 120 0

0

0

0

0

Tf t dt

TA C n t

t

t T

t

t T

n n( ) cos( )+ +

= + +nn

m m

n

A C m t

=

=

× + +

1

0 0

1

cos( ) dt

Page 188: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

170 Signals and systems primer with MATLAB

We can see that the terms in the integrand will be of the form CnCmcos(n 0t +n)cos(m 0t + m). These terms are periodic with period T, and the value of

the integral for n m will vanish. The remaining integrands for m = n willbe of the form , and these integrals have the valueHence, (4.29) becomes

(4.30)

This result is the energy relation, and it can be considered the energydissipated during one period by a 1-ohm resistor when a voltage source f(t)is applied to it. If f(t) denotes a current, this result specifies that the rootmean square (rms) value of the current is the sum of the direct current (dc)component and the rms values of the alternating current (ac) components.In other words, the total power is the power of the dc component plus thepower of all the ac components.

Example 4.3.1: Find the energy associated with the terms n = 3 to n = in the Fourier series expansion of the periodic function of Example 4.2.2.

Solution: Use (4.30) and the results of Example 4.2.2 to write

This result shows that most of the energy is contained in the dc componentand a few of the low-frequency harmonics. �

Symmetric functions

There are two very important symmetries of real periodic functions: zero-axis(even) and zero-point (odd) symmetry. An even function has symmetry

C n tn n2 2

0cos ( )+ Cn2 2/ .

12

202

2

10

0

Tf t dt A

Ct

t Tn

n

( )+

=

= + Parseval formulla

13 5

37 2 2 20 5

1 2

12

22 2

3. .

dtC C Cn

n=

= orr

Cn

n

2

32

1 53 5

949

12

23 5 2 3 5

23

=

= .. . ( / . )

sin..

sin.

.

. ( / .

50 5 2

3 5

12

23 5 2 3 5

2

+ ×

))cos

..

cos.

.

0 5 23 5

23 5

12

23 5

××+ × ×

2 2 3 543 5

0 5 2 23 5( / . )

sin.

sin.

.

×× ×

2

12

23 5 2 2 3 5

0 5 2 23 5

43. ( / . )

cos.

.cos

...

50 0445

2

=

Page 189: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 4: Periodic continuous signals and their spectrums 171

about the axis t = 0, and an odd function has symmetry about the origin.These two features are illustrated in Figures 4.3.1a and b. Figure 4.3.1c showsa nonsymmetric periodic function having a mean value of zero.

Figure 4.3.1 Types of symmetry: (a) even symmetry, (b) odd symmetry, and(c) zero-average value.

–1 1 3 5 t

f(t)

2

……

–5

(a)

2

1.5

0.5

–0.5

–1

–1.5

–2–5 –4 –3 –2 –1 0 1 2 3 4 5

0

1

f(t)

(b)

t

3

–1–3

–1.5

16

10 t

f(t)

(c)

Page 190: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

172 Signals and systems primer with MATLAB

Even functionAn even periodic function is defined by f(–t) = f(t) = fe(t). It follows from thedefinition of Bn that all these coefficients are zero since the integrand is(even × odd = odd) odd. The Fourier series expansion becomes

(4.31)

Odd functionAn odd periodic function is one for which f(–t) = –f(–t) = fo(t). Using thefunction in the Fourier series equation we find that all An coefficients arezero and the Fourier expansion becomes

(4.32)

It is important to realize that any periodic function can be resolved intoeven and odd parts. This follows because we can write any function f(t) inequivalent form:

(4.33)

Figure 4.3.2 shows the reconstruction of a function f(t) from its even andodd parts.

*Finite signals

It can be shown that any continuous function f (t) within an intervalcan be approximated by a trigonometric polynomial of the form

given in (4.24) to any degree of accuracy specified in advance. To approximate

Figure 4.3.2 Construction of a signal from its even and odd parts: (a) given function,and (b) even part, and (c) odd part.

–1–11

2

1

t

f(t)

–1 1

1

t

1

1–1

–1

t

2

f (t) + f (−t)fe (t) – 2

f (t) − f (−t)fo(t) –

(a) (b) (c)

f t A A n t AT

f t n te n

n

n et

t

( ) cos ( )cos= + ==

0 0

1

02

0

00 +T

dt

f t B n t BT

f t n to n

n

n ot

t T

( ) sin ( )sin= ==

+

0

1

02

0

0

dt

f tf t f t f t f t

even odd

( )( ) ( ) ( ) ( )= + +

2 2� � � �

t t t T0 0 +

Page 191: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 4: Periodic continuous signals and their spectrums 173

the function f(t) shown in Figure 4.3.3a, the periodic function fp(t) shown inFigure 4.3.3b is created. The expansion then proceeds as before for the peri-odic function, but the range of applicability is limited to the range of theoriginal function. The solution is then specified as

(4.34)

*Convolution

As a continuation of the discussion in Section 2.6, let us consider the specialcase when f(t) and h(t) are periodic functions with the same period. We willfind that the convolution integral assumes special properties. Periodic, orcyclic, convolution is defined by the integral

(4.35)

where the integral is taken over a period. In this case, g(t) is also periodic.To show that g(t) is periodic, consider the integral

and choose c = nT + a with 0 a T. The above equation then becomes

Figure 4.3.3 Nonperiodic function expanded in Fourier series.

a b t

f(t)

T

a b t

……

fp(t)

(a) (b)

f ta e a t b

t a t b

an

jn t

n n( ) =

< >

==

0

0

110

0

0

Tf t e dtp

jn t

t

t T

( )+

g tT

f x h t x dxT

( ) ( ) ( )= 10

g tT

f x h t x dxpc

c T

( ) ( ) ( )=+1

g tT

f x h t x dxT

f x nT apnT a

nT a T

( ) ( ) ( ) (= = + ++

+ +1 1)) [ ( )]

( ) ( ) (

h t x nT a dx

Tf x h t x dx g

T

+ +

= =

0

1tt

T

)0

Page 192: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

174 Signals and systems primer with MATLAB

where we set Since f(t) and h(t) are periodic, it turnsout that g(t) is periodic as shown above. Now, since g(t) is periodic, we canexpress it in a Fourier series expansion with coefficients

Write t – x = x in the second integral, and so

However, for periodic functions, the integration of the second integral isindependent of the shift x. Then,

(4.36)

where the Fourier coefficients bn and cn belong to the functions f(t) and h(t),respectively. Therefore, we have that

(4.37)

Another important property of (4.35) is that cyclic convolution is com-mutative, so that

(4.38)

To show this property, substitute t – x = x in (4.35). We write

4.4 Linear systems with periodic inputsThere are many practical periodic signals that are required to pass throughlinear time-invariant (LTI) systems. The timing signal of a computer is a pulseperiodic signal that passes through many computer circuits. The transducer

= + =x x nT a dx dx( ), .

aT

g t e dtT

f x h t x enT

Tjn t j= =1 1

2

2

20( ) ( ) ( )

/

/nn t

T

T

T

Tjn x

dtdx

Tf x e dx

0

0

2

2

2

21 1=

/

/

/

/

( )TT

h t x e dtT

Tjn t x( )

/

/( )

2

20

aT

f x e dxT

h xnT

Tjn x

T x

T

=+

1 12

2

2

0( ) ( )/

/

( / )

( // )20

+xjn xe dx

a b cn n n=

g t a e b c eT

f xn

n

jn tn n

n

jn t( ) ( )= = == =

0 01

hh t x dxT

T

( )/

/

2

2

f t h t h t f t( ) ( ) ( ) ( )=

g t f t x h x dx f t x h x dxt

t T

( ) ( ) ( ) ( ) ( )= =TT

T

f t x h x dx0

0= ( ) ( )

Page 193: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 4: Periodic continuous signals and their spectrums 175

that detects heartbeats is a linear time-invariant system whose input is theperiodic heart signal and the output is a signal observed on an oscilloscopethat is supposed to resemble the original signal (this may not be true).Therefore, it is important to find out what quantities we should know fromboth the periodic signals and the LTI systems, such that we can predict withextreme accuracy the output of LTI systems to periodic inputs.

Refer to the system shown in Figure 4.4.1a. It is assumed that the drivingsystem produces a force , where f0 is the peak amplitude. Todevelop the equivalent circuit representation of the mechanical system, wedraw two levels that correspond to velocity v of the mass and damper andto reference velocity vg, or ground velocity. Now, we connect the mass ele-ment between these two levels. Finally, we connect the forces between vg

and v. The circuit representation is shown in Figure 4.4.1d. Figure 4.4.1b showsthe force equilibrium diagram, and Figure 4.4.1c shows the input–outputrelationships of the system.

An application of D’Alembert’s principle at node v yields

(4.39)

The resulting equation that describes the system behavior is (M = D = 1)

(4.40)

Figure 4.4.1 Linear time-invariant system excited by a sinusoidal time function.

(a) (b)

M f(t)

dν M dt

– fM

D – fD

M – 1 D – 2

v

f (t) – f0 sin 0t

0

System f (t) – f0 sin 0t

Input – utput

v(t) M D

v

vg

f(t)

fM fD

(c) (d)

f t f t( ) sin= 0 0

+ + = + =f t f f f f f tM D M D( ) ( )0 or

Mdv t

dtDv t f t

dv tdt

v t f t( )

( ) ( )( )

( ) sin+ = + =or 2 0 0

Page 194: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

176 Signals and systems primer with MATLAB

To find the particular solution (steady state) of this differential equation,we assume a solution of the form . Introduce thissolution into (4.40), from which we obtain the identity

Equating coefficients of like functions on both sides of this equation, weobtain

Thus, the velocity of the system is given by

(4.41)

If we set tan 0 = 2/ 0 in (4.41), we obtain the equation

(4.42)

For the particular case for rad/s, the phase shift is 5.8195 rad and theamplitude factor is 0.4472f0.

We observe from this LTI system that when the input is a sine function,the output is the same sine function, but with a phase shift of 0 + (3 /2)and with an amplitude change of A similar result wouldbe found if a cosine function was the input. This, of course, applies to allLTI systems.

Note: When the input to an LTI system is a sinusoidal function, the output isalso sinusoidal, but with different amplitude and phase. The phase and amplitudechanges are functions of the input frequency. We can thus conclude that if the signalis made up of many sinusoidal functions of different frequencies, each componentwill experience different phase shifts and amplitude changes.

Now refer to the system shown in Figure 4.4.2. The equation thatdescribes this system is found by using the Kirchhoff node equation, and it is

v t A t B t( ) cos sin= +0 0

( ) cos ( )sin sin2 20 0 0 0 0 0A B t B A t f t+ + =

2 0 24

240 0 0

0 0

02

0

02A B A B f A

fB

f+ = + = =+

=+

or

v t f t t( ) cos sin=+0

0

02 0

00

42

v tf

t t( )cos

(cos cos sin sin=+

0

02

0

00 0 04 00

0

02

0

00 0

0

02

0

4 4

)

coscos( )

co=

++ + =

+f

tfss

sin0

0 032

t + +

0 1=

0 02

04/[( )cos ].+

Cdv t

dtv tR

i t( ) ( )

( )+ =

Page 195: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 4: Periodic continuous signals and their spectrums 177

For the parameters given in the figure, the above equation becomes

(4.43)

If we assume that the input is an exponential of the form theoutput will be of the same form (remember that the exponential function isthe sum of two sinusoidal functions): Here, is assumed to bea real constant (without loss of generality), and so v0 (a complex constant)specifies the output amplitude. In particular, if we include both forms in(4.43), we have

Note: The system function H(j ) (also called transfer function) is defined asthe ratio of the output to input of an LTI system when the excitation is sinusoidal.

Therefore, the system function is

(4.44)

and the output is given by

(4.45)

If we assume that the input is , the output would be

(4.46)

Figure 4.4.2 RC parallel circuit.

R – 0.5

C – 1

+

v(t) System

H(– )

i(t)

Input – utput

v(t) i(t)

dv tdt

v t i t( )

( ) ( )+ =2

i t i ej t( ) ,= 00

v t v ej t( ) .= 00 i0

v j e v e i ej t j t j t0 0 0 0

0 0 02+ =

H jv ei e j e

j t

j t j( )

tan (00

0 0 02

0

0 1

12

1

4� =

+=

+ 0

10

0

202

0 5

0

1

4/ )

tan ( . )

( )( )

=+

=

e

H j e

j

j

v ti

ej t( ) ( tan ( . ))=+0

02

0 5

40

10

i t i ej t0 0 0

0sin Im{ }=

v t v ti

t( ) Im{ ( )} sin( tan ( . ))= =+0

02 0

10

40 5

Page 196: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

178 Signals and systems primer with MATLAB

Note: The amplitude and phase of the output are dictated by the amplitude andphase characteristics of the system function H(j ).

Example 4.4.1: Deduce the steady-state output (the current) for the sys-tem shown in Figure 4.4.3 for an input .

Solution: Apply the Kirchhoff voltage law to write the controlling systemequation

(4.47)

The input is written , and the output is assumed to be of thesame form, where i0 is an unknown complex number to bedetermined. By introducing the complex form of these quantities in (4.47)we find

from which the system function H(j 0) is (an admittance function)

Thus,

Figure 4.4.3 RLC series circuit.

v t t( ) cos= 3 0

2di tdt

i t i t dt v t( )

( ) ( ) ( )+ + =

v t ej t( ) Re{ }= 3 0

i t i ej t( ) Re{ },= 00

21

30 0 00

00 0 0 0j i e i e

ji e ej t j t j t j t+ + =

H jiv j

j

jj

( )00

00

0

0

02

0

1

1 21 1 2

= =+ +

=+

i H j vj

jej

0 0= =+

=( )( )

/

00

02

0

02

02

31 2

3

1 2 2202 1

0 02

0

02

1 2

31 2

+

=

exp[ tan [ ( )]]

[( )

j /

++ 02 1 2

2 1 210 0

2

] /[ / tan [ /( )]]ej

(4.48)

+

Input – utput

v(t)

i(t)

i(t)

H(–ω)

SystemR – 1 Ω L – 2 H C – 1 F

v(t)

Page 197: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 4: Periodic continuous signals and their spectrums 179

The output current is then

(4.49)

As in the previous discussion, we observe that the amplitude and phase ofthe output signal are dictated by the amplitude and phase of the transferfunction (system function), a somewhat complicated function. �

We observe from our analysis that when the input is a sinusoidal signalexp(j 0t), the transfer function is H(j 0) and the output is H(j 0)exp(j 0t). Ofcourse, if the input frequency is n 0 so that the complex input is exp(jn 0),the transfer function is H(jn 0) and the output is H(jn 0)exp(jn 0t). Clearly,when the input is the sum of sinusoids, the output will consist of eachcomponent sinusoid multiplied by the appropriately chosen transfer func-tion. Thus, for an input

the output will be

(4.50)

Note: If the input to an LTI system is a periodic nonsinusoidal function, theoutput is a periodic function with Fourier series coefficients defined by the expressionanH(jn 0).

In all these cases we imply that the input periodic function has beenapplied for a long time so that the transient effect has disappeared.

If we expand in sine and cosine form the input periodic function to anLTI system

the output function will have the form

i t i t i ej t( ) Re{ ( )} Re{ }

[( )

= =

=+

0

0

02 2

02

0

31 2 ]]

cos tan/1 2 01 0

022 1 2

t +

f t a ei njn t

n

( ) ==

0

f t a H jn eo njn t

n

( ) ( )==

00

f t A A n t B n ti n n

n

( ) ( cos sin )= + +=

0 0 0

1

Page 198: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

180 Signals and systems primer with MATLAB

(4.51)

Example 4.4.2: The periodic signal fi (t) = 2sin( t/100) + 0.1sin(5 t/100)is applied to a system with transfer function H(j ) = 1/(1 + j2 ). Determinethe output of the system.

Solution: The amplitude and phase functions of the transfer function are

By (4.51) and with A0 = An = 0, we obtain

Important definitions and concepts1. Complex exponentials2. Fundamental period of a periodic function3. Fundamental frequency of a periodic function4. Fundamental difference between continuous sinusoidal signals and

discrete ones5. Periodicity6. Dirichlet conditions for periodic functions7. Complex and sinusoidal forms of the Fourier series of periodic func-

tions8. Gibbs’ phenomenon9. Amplitude and phase spectrums of periodic signals

10. Parseval’s formula11. Energy relation of periodic signals12. Fourier series of the convolution of periodic signals having the same

period

f t A H j H jn

A n t n

o

n

n n

( ) ( ) ( )

( cos[ (

= +

× +

=0 0

1

0

0

0 0 0)] sin[ ( )])+ +B n t nn n

f to( )

H j( ) ( ) tan ( )=+

=1

1 42

2

1

f t to( ) sin tan=

+

21

1 4100

1002

1002

1

+

+

0 11

1 45100

5100

25

2

1. sin tant1100

Page 199: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 4: Periodic continuous signals and their spectrums 181

13. Transfer (system) function and its influence on the output of an LTIsystem when the input is a periodic function

14. Half- and full-wave signals15. Ripple factor of a half-wave (or full-wave) signal16. Filtering

Chapter 4 ProblemsSection 4.1

1. Draw the following functions given that c and a are real numbers:y1(t) = c eat and y2(t) = c e–at.

2. Plot the real and imaginary parts of the signal for c = 2 + jand a = 2 – 2j.

3. Using Euler’s relations a) and b), show the relations c) and d):

4. Any complex number z can be represented by a point in the complexplane with z = a + jb = exp(jtan–1(b/a) r cos + jrsin , as shown in Figure P4.1.4.

5. Corresponding to the complex number, is thecomplex conjugate Ifand , determine the following relationships:

Figure P4.1.4

y t c e at( ) =

a. /

b.

cos ( )

sin ( )/

t e e

t e e

j t j t

j t j t

= +=

2

2212

1 22

1 2

j

t t

t t

c.

d.

cos ( cos )

sin sin [cos

= +

= (( ) cos( ) ]1 2 212+t t /

a2 b2+ � r jexp( ) =

b

a

r

–Im(z)

Re(z)

θ

z a jb r j= + = exp( )z a jb r j= = exp( ). z a jb z a jb1 1 1 2 2 2= + = +, ,

z a jb3 3 3= +

Page 200: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

182 Signals and systems primer with MATLAB

6. Express each relation by a complex number in its polar form (rej ):

7. The quantities z1 and z2 are complex numbers. Prove the followingrelationships:

8. Prove the following orthogonality relations:

9. The continuous function is sampled at t = nT. Specify thecondition that enables to be periodic. Do the same for asine signal.

Section 4.2

The reader should verify, wherever applicable, the analytical results usingMATLAB.

1. Show the following relations:

a. b. /

c. d.

e.

z z z z z

z z z z

z

1 1 2 2 2

3 3 1 2

1

* *

*

( )

( ) *

(

+

+ +

++ +z z z z z1 2 2 1 23* *) ( ) ( ) */ f.

a. / b. /

c. /

( ) ( ) [ ( )]

[ (

/

/

2 4 1 2 1

2 1

6

6

+ + +

+

j j e j

e

j

j jj e j

j j e e

j

j j

)]* ( ) *

( ) *

/

/ /

d.

e. f.

3 2 6

3 4

6

6 2

++

++

e

j j j

j j

j

g. / h.

i.

[( ) ( )]* ( )

( ) * (

2 6 2 6 1

2 2

5

)) * /ej 4

a.

b.

c.

z r

z z z z

z z z z z z

1 1

1 2 1 2

1 2

2

1 2

2

1

2

2

2

=

=

( ) + +(( )

a. /

b.

cos sin

cos cos

n t m tdt T

n t m

T

0 00

0

0

0 2= =

00

0 02

tdt nT n m

T

==/

cos 0tcos n T0

a.

b.

c.

A a

A a

B an n

n n

0 0

2

2

==

=Re{ }

Im{ }

Page 201: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 4: Periodic continuous signals and their spectrums 183

2. Show that .3. Deduce the Fourier series in trigonometric form for the periodic

function shown in Figure P4.2.3. Find and plot the amplitude andphase spectrums of the series. This function is known as thehalf-wave rectified signal. It is assumed that the figure extends fromminus infinity to infinity.

4. Find the Fourier series in trigonometric form of the full-wave rectifiedsignal shown in Figure P4.2.4. Find and plot the amplitude and phasespectrums.

5. The ripple factor of a half-wave (or full-wave) rectified signal isdefined by

where frms is the rms value of the ac components of the signal withina period and fdc is the average value of the periodic signal. Show thatthe r values for the half- and full-wave signals are 1.21 and 0.48,respectively.

Figure P4.2.3

Figure P4.2.4

C A Bn n n= +2 2

1

0.8

0.6

0.4

0.2

00

cos

πt/2

5 10 15

t

1

0.8

0.6

0.4

0.2

00

cos

πt/2

5 10 15

t

r f frms dc= ( ) ,/ 1

Page 202: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

184 Signals and systems primer with MATLAB

6. Find the Fourier series expansion in trigonometric form for the pe-riodic signals shown in Figure P4.2.6. The signals extend from minusinfinity to infinity.

To plot the half- and full-wave rectifier, the following book MATLABprogram was used:

for t=1:300

if cos(pi*0.05*t/2)>=0

s(t)=cos(pi*0.05*t/2);

else

s(t)=abs(cos(pi*0.05*t/2));%for half-wave s(t)=0

end;

end;

m=0:0.05:15-0.05;

plot(m,s)

7. Compute the Fourier series of the following functions:

Figure P4.2.6

A

f(t)

t

–A

T

(a)

t

A

f(t)

T

(b)

T t

A

f(t)

(c)

A

f(t)

T t

(d)

a.b.

f t t t Tf t t t T( ) ,( )

= == =

2 21 1 2

Page 203: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 4: Periodic continuous signals and their spectrums 185

8. Compute the Fourier series of the following functions:

Section 4.3

1. If the Fourier series expansion of a periodic function f(t) is writtenin its exponential form

show that

This is another form of Parseval energy relation.2. Show that the Parseval energy relation can be written in the form

3. Deduce the Fourier series expansions for the signals shown in FigureP4.3.3. Compare the amplitude and phase spectrums of the two func-tions in Figures P4.3.3b and c and state your observation.

Figure P4.3.3

a.b.

f t t t t t f t t f tf t et

( ) ( ) ( )( )

= + == +

0 0 021 1 tt T =1 4

f t a enjn t

n

( ) ,==

0

( ) ( ) * ( ) ( ) ( )1 10

0

0

0 2/ /T f t f t dt T f t dt

t

t T

t

t T+ +

= ===

an

n

2

( ) ( )12 2

2

02

2 2

10

0

/T f t dt AA B

t

t Tn n

n

= + ++

=

TT/3

1

f(t)

t

(a)

0.5–1

2

h(t)

T

8 t

2

g(t)

t1.5

T

9

(b) (c)

Page 204: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

186 Signals and systems primer with MATLAB

4. Find the Fourier series for the functions shown in Figure P4.3.4.Hint: Create a periodic function with any period.

5. Determine the Fourier series of the periodic functions shown in Fig-ure P4.2.6 if they are shifted a half period, T/2, to the right andcompare their spectra.

Section 4.4

1. Determine the output for the systems shown in Figure P4.4.1 if theinput is . State your observation about the output as 0 variesfrom zero to infinity.

Figure P4.3.4

Figure P4.4.1

–0.5 0.5

1

f(t)

t 1 t

h(t)

1

sin 0t

(a)

(d)

(b) (c)

i(t) v(t)

C – 2 F

+

i(t) v(t)

R – 2 Ω+

i(t) v(t)

L – 2 H

+

(e)

vi(t) vo(t)

R – 2 Ω

R – 1 ΩL – 3 H

++

i(t) v(t)

C – 2 F

L – 2 H

+

Page 205: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 4: Periodic continuous signals and their spectrums 187

2. Determine the output for the systems shown in Figure P4.4.2 if theinput is .

Hint: Remember that the systems are linear; thus, define the systemfunction appropriately for each frequency.

Figure P4.4.2

sin cos1 2t t+

M – 2f(t)

v

M – 2

v

D – 1

f(t)

Systemf(t) v(t) f(t)

System

v(t)

Systemv(t)f(t)

(a) (b) (c)

M – 2f(t)

v

– – 1

Page 206: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

189

chapter 5

Nonperiodic signals and their Fourier transform

Unlike the Fourier series, which is essentially oriented toward periodic func-tions, the Fourier integral permits a description of nonperiodic functions.The Fourier integral bears a close relationship to the Fourier series. The factthat a Fourier transform pair exists is of importance to our work. The trans-form pair permits a frequency domain function F( ) to be deduced from aknowledge of the time domain function f(t), and vice versa.

Note: Every well-behaved function f(t) has a unique characteristic spectrumin the frequency domain.

This chapter considers the properties of the Fourier transform, withexamples of the calculations of some elementary but fundamental transformpairs. Among the important applications of the Fourier transform are ana-lytically representing nonperiodic functions, solving differential equations,aiding in the analysis of linear time-invariant (LTI) systems, and analyzingand processing signals in engineering, medical, optical, metallographic, andseismic problems, just to mention a few.

For the case where signals are experimentally derived, analytic formsare usually not available for the integration involved. The approach now isto replace the continuous Fourier transform by an equivalent discrete Fouriertransform (DFT), and then evaluate the DFT using discrete data. While theprocess is straightforward in principle, the number of calculations involvedcan become extremely large, even in relatively small problems. It is the useof the fast Fourier transform (FFT), a computational algorithm that greatlyreduces the number of calculations in the use of the DFT, that makes theDFT a viable and indispensable procedure. The DFT will be discussed indetail in a later chapter.

Page 207: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

190 Signals and systems primer with MATLAB

5.1 Direct and inverse Fourier transformThe Fourier transform of a function f(t), written and theinverse transform, written F –1{F( )} f(t), are defined by the integral rela-tions

(5.1)

F( ) is known as the spectrum function. If is a complex function of theform are real functions of ), we would ordi-narily plot the absolute value

and argument vs. frequency , or the real andimaginary parts vs. frequency.

Not all functions are Fourier transformable. Sufficiency conditions for afunction f(t) to be Fourier transformable are called Dirichlet conditions,which are:

1. .

2. f(t) has finite maximums and minimums within any finite interval.3. f(t) has a finite number of discontinuities within any finite interval.

If these conditions are met, f(t) can be transformed uniquely. Some functionsexist that do not possess Fourier transforms in the strict sense since theyviolate one or another of the Dirichlet conditions. Yet, in many cases, it isstill possible to deduce the Fourier transform if the function under consid-eration belongs to a set known as generalized functions. One such functionis the delta function (t), which is considered below.

Example 5.1.1: Determine the Fourier transform of the function f(t) =e–atu(t) a > 0 and, from this result, plot the following vs. frequency: (1) theabsolute value and phase spectrum and (2) the real and imaginary parts ofits spectrum.

F { ( )} ( ),f t F��

F { ( )} ( ) ( )f t F f t e dtj t� = a)

direct, or forward, Fourieer transform

F =1 12

{ ( )} ( ) ( )F f t F e dj t� b)

inverse FFourier transform

F( )F F jF F Fr i r i( ) ( ) ( ) ( ( ), ( )= +

F F Fr i( ) ( ) ( )= +2 2

Arg F F Fi r{ ( )} tan [ ( ) ( )]= 1 /

f t dt( ) <

Page 208: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 5: Nonperiodic signals and their Fourier transform 191

Solution: By an application of (5.1a),

The real and imaginary parts of the spectrum are

The function can also be written in the form

Thus, the absolute value and phase spectrums are

Book m-File for example 5.1.1: ex5_1_1

%ex5_1_1, this is the m-file name for the Ex5.1.1;

t=0:.05:5;

f1=exp(-0.5*t);

f2=exp(-4*t);

w=-20:.05:20;

fr1=0.5./(0.25+w.^2);

fr2=4./(16+w.^2);

fi1=-w./(0.25+w.^2);

fi2=-w./(16+w.^2);

fabs1=1./sqrt(0.25+w.^2);

fabs2=1./sqrt(16+w.^2);

arg1=-atan(2*w);

arg2=-atan(w/4);

subplot(2,1,1);plot(t,f1,'k');hold on;plot(t,f2,'k');

F e u t e dt e dta

at j t a j t( ) ( ) ( )= = =+

+

0

1jj

a > 0

Fa j

a ja

aa

r ( ) Re Re=+

=+

=+

12 2 2 22

2 2

1F

a ja j

a ai( ) Im Im=

+=

+=

22 2+

F( )

Fa

ea

ej F F ji r( ) tan [ / ] tan ( /=+

=+

1 12 2 2 2

1 1 aa)

Fa

ArgF a( ) ( ) tan ( / )=+

=12 2

1

Page 209: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

192 Signals and systems primer with MATLAB

xlabel('t');ylabel('exp(-at)');

subplot(2,1,2);plot(w,fabs1,'k');hold on;plot(w,fabs2,'k');

xlabel('\omega');ylabel('abs(F(\omega))');

%the last four lines can be changed appropriately

%to plot the rest of the figure;

Plots of several functions are shown in Figure 5.1.1. �

Example 5.1.2: Determine the spectrum of the following functions:(a) f(t) = (t) and (b) g(t) = (t – a) for a > 0.

Solution: Employ the properties of the delta function to obtain

The functions and their spectrums are shown in Figure 5.1.2. �

Figure 5.1.1 Time and frequency functions. (a) Time functions. (b) The absolute valueof the spectrum.

1

0.8

0.6

0.4

0.2

0 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5

a � 4

a � 0.5

exp

(–at

)u(t

)

t

(a)

2

1.5

1

0.5

0 –20 –15 –10 –5 0 5 10 15 20

a � 4

a � 0.5

abs(

F(

))

(b)

F t e dt ej t j( ) ( )= = =0 1

G t a e dt e aj t j a( ) ( )= = > 0

Page 210: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 5: Nonperiodic signals and their Fourier transform 193

Based on our observations of the Figure 5.1.2 spectrums we conclude:

Note: A signal and its shifted version have the same absolute value of theirspectrums but they differ on their phase spectrums.

Figure 5.1.1 (continued). Time and frequency functions. (c) Corresponding real partsof their spectrums. (d) Corresponding imaginary parts of their spectrums. (e) Argu-ments of the spectrums.

2

1.5

1

0.5

0–20 –15 –10 –5 0 5 10 15 20

a � 4

a � 0.5

Fr(

ω)

ω(c)

1

0.5

0

–0.5

–1–20 –15 –10 –5 0 5 10 15 20

a � 4

a � 0.5

Fi(

ω)

ω(d)

Arg

F(ω

)

0

1

2

–1

–2–20 –15 –10 –5 0 5 10 15 20

(e)

ω

a � 4

a � 0.5

Page 211: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

194 Signals and systems primer with MATLAB

Real functions

Suppose that f(t) is real. We obtain the relationship

(5.2)

The above result is due to the fact that an integral can be substituted (forwell-behaved functions) by an infinite sum. But since the conjugate of thesum is equal to the sum of each term, (5.2) is correct. The above resultindicates that the reflected form of F( ) is equal to the conjugate of F( ). Wecan start from the right side of (5.2) to find

This result, when applied to Example 5.1.1, shows that

as it should be in accordance with the previous results.

Note: A conjugation is performed on an expression by simply changing thesigns of all j’s that are present in the expression.

Figure 5.1.2 Delta function and its presentations. (a) Delta function at the origin andits Fourier spectrum. (b) Shifted delta function and its Fourier spectrum.

(b)

f(t)

t

1

(a)

1

g(t)

a t

1

G(ω)

ω

F(ω)

1

ω

Arg F (ω)

ω

Arg G (ω)

Slope:– a

ω

F f t e dt f t e dtj t j t( ) ( ) ( )*

= = == F*( )

f t tdt j f t tdt

f t

( )cos ( )sin

(= ))cos ( )sin [ ( ) ]t j f t tdt f t e dtj t+ = = =f t e dt Fj t( ) ( )( )

Fa j a j

F( ) ( )= =+

=1 1

Page 212: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 5: Nonperiodic signals and their Fourier transform 195

Real and even functions

For f(t) even and real, we obtain

(5.3)

Here, the integrand is an odd function and the integral in the rangefrom minus infinity to infinity is zero. By equating the real and imaginaryparts at both sides of (5.3) we obtain

(5.4)

Example 5.1.3: Deduce and plot the Fourier spectrum of the even func-tion f (t) = exp(–2|t|) illustrated in Figure 5.1.3a. Show that this spectrumverifies (5.4).

Solution: The Fourier transform of the given function is

Figure 5.1.3 Illustration of Example 5.1.3.

F F jF f t e dt f t tr ij t( ) ( ) ( ) ( ) ( )cos= + = = ddt

j f t t dt f t t dt=( ) sin ( )cos

f t t( ) sin

F f t t dt f t t dt Fr i( ) ( )cos ( )cos ; ( )= = 20

== 0

F e e dt e e dt e et j t t j t t j( ) = = +2 20

2 t

j t j t

dt

e dt e dtj

0

20

2

0

12

+= + =( ) ( ) ++

=+

12

44 2j

1

0.8

0.6

0.4

0.2

0 –5 0 5

t

(a) (b)

f(t)

1

0.8

0.6

0.4

0.2

0

F(

)

–10 –5 5 0 10

Page 213: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

196 Signals and systems primer with MATLAB

This final expression shows that Fi( ) = 0, and the even function is shownin Figure 5.1.3b. Now, we examine

which agrees with the above. �

Real and odd functions

For f(t) odd and real, we obtain

(5.5)

Thus,

(5.6)

5.2 Properties of Fourier transformsFourier transforms possess a number of very important properties. Theseproperties are developed next.

Linearity

Consider the Fourier integral of the function (af(t) + bh(t))

(5.7)

where a and b are constants. This property is a direct result of the linearoperation of integration.

Symmetry

If F{f(t)} = F( ), then

(5.8)

F e t dt e e e dtrt t j t j t( ) cos ( )= = +2 2 2

00

== ++

=+

12

12

44j j j

F f t e dt f t t dt j f tj t( ) ( ) ( )cos ( )s= = iin

( )sin

t dt

j f t t dt=

F F j f t t dtr i( ) ; ( ) ( ) sin= =0

F F F{ ( ) ( )} { ( )} { ( )} ( ) (af t bg t a f t b g t aF bG+ = + = + ))

2 f F t e dtj t( ) ( )=

Page 214: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 5: Nonperiodic signals and their Fourier transform 197

Proof: Begin with the inverse Fourier integral

where we interchanged the symbols and t in the first equation. By intro-ducing the change from to – , the result is (5.8). This symmetry propertyhelps in extending the tables of Fourier transforms.

Example 5.2.1: Examine the symmetry property of the pulse functionpa(t) and the impulse function (delta function) (t).

Solution: The Fourier transform of the pulse function is

(5.9)

From the symmetry property, we write

(5.10)

The graphical representation of these formulas is given in Figure 5.2.1a.Remember also that the pulse function is symmetric and pa(– ) = pa( ). Toprove this result requires the use of integral tables, which give the followingexpression

For the delta function, we have

(5.11)

By the symmetry property and because the delta function is even,

(5.12)

At this point we may ask: Can we physically produce an infinite numberof sinusoids with each having an amplitude of 1, as (5.11) indicates? Theanswer is no. This is true since we will need an infinite amount of energy

2 2f t F e d or f F t e dtj t j t( ) ( ) , ( ) ( )= =

F { ( )} ( )sin

p t p t e dt e dta aj t j t

a

a

= = = 2aa

ca= 2sin

2 2pat

ta( )sin= F

2 2 20

sincos

att

t dt a a=

F { ( )} ( ) ( )t t e dt ej t j= = =0 1 �

2 2 1( ) ( ) { ( )} { }= = =F Ft

Page 215: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

198 Signals and systems primer with MATLAB

to produce the signals. Of course, no contradiction exists since the deltafunction is a mathematical expression and no physical mechanism exists thatcan produce it. The relationships of (5.11) and (5.12) are shown in Figure5.2.1b. �

Figure 5.2.1 Symmetry properties. (a) Illustration of the symmetry property of thepulse function. (b) Illustration of the symmetry property of the delta function.

(a)

p2(t

)

0.5

0–2 –1 0 1 2

t

1

1.5

ω0 5–5

–1

0

1

2

3

4

2 s

in a

ω/ω

; a �

2

2a a � 2

π/a−π/a

2π/a

ω

2πp

a(ω

); a

� 2 2π

0.5

0–2 –1 0 1 2

1

1.5

2 s

in a

t/t;

a �

2

2a a � 2

π/a

4

3

2

1

0

–1–5 0 5

t

1

δ(t)

t

Δ(ω)

ω

1

Δ(t)

t

1

2πδ(ω)

(b)

ω

Page 216: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 5: Nonperiodic signals and their Fourier transform 199

Time shifting

For any real-time t0

(5.13)

Example 5.2.2: Find the Fourier transform of the function f (t – t0) =e–(t – t0) u(t – t0).

Solution: Use (5.13) to write (see also Example 5.1.1)

The effect of shifting is shown in Figure 5.2.2 for t0 = 0 and t0 = 4. Observethat only the phase spectrum is modified. �

Note: When a signal is shifted, only its phase spectrum changes.

Figure 5.2.2 The effect of shifting in the time domain the function exp(–t)u(t).

F F{ ( )} { ( )} ( )f t t e f t e Fj t j t± = =± ±0

0 0

F F F{ ( )} { ( )} { ( )}f t t e f t e e u t ej t j t t= = =00 0

+j t

j0

11

1

0.8

0.6

0.4

0.2

00 5 10

t

f(t)

� e

xp

(–t)

u(t

)ex

p(t

– 4

)u(t

– 4

)

absF

(ω)

0.5

1.5

1

00 1 2

ω

ang

leF

(ω)

–1

–1.5

–0.5

0

210

ω

1

0.8

0.6

0.4

0.2

00 5 10

t

absF

(ω)

0.5

1.5

1

00 1 2

ω ω

ang

leF

(ω)

210

–1

0

1

2

3

4

–2

Page 217: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

200 Signals and systems primer with MATLAB

Scaling

If then

(5.14)

and from this, by setting a = –1, we see that

(5.15)

This equation indicates that if a time function is reflected, its Fourier spec-trum is also reflected.

Example 5.2.3: Discuss the Fourier transform of the pulse functionwhere b > a.

Solution: By Example 5.2.1, the Fourier transform of fa(t) = pa(t) is. By (5.14), the Fourier transform of fb(t) = pa(bt) is

The respective functions are shown in Figure 5.2.3. Note that as the pulsenarrows in time, the spectrum broadens. �

Note: From Example 5.2.3 we conclude that signals with low variations intime are rich in low frequencies and signals with sharp variations are rich in highfrequencies.

Central ordinate

By setting = 0 and t = 0 in the two equations of (5.1), respectively, therelating expressions are

(5.16)

The first of these equations shows that the area under the f(t) curve is equalto the central ordinate of the Fourier transform. The second of these equations

F { ( )} ( ),f t F=

F { ( )}f ata

Fa

= 1

F { ( )} ( )f t F=

f t p btb a( ) ( ),=

2 2(sin / ) sin ( )a ca�

F F F{ ( )} { ( )} { ( )} ( ) /f t p btb

f tb

Fb a a a b= = = ==1 1 11

2

b

ab

b

sin

F f t dt f F d( ) ( ) ( ) ( )0 01

2= =

Page 218: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 5: Nonperiodic signals and their Fourier transform 201

shows that the area under the F( ) curve is 2 times the value of the functionat t = 0.

Example 5.2.4: Find F(0) and f(0) for the function f(t) = 2pa(t) using (5.16).

Solution: From Example 5.2.1, the Fourier integral of f(t) is F( ) =4sin(a )/ . For = 0, by application of L’Hospital’s rule, F(0) = 4a. Fromthe above equation we have

For f(0), we use the inverse Fourier integral

where use has been made of mathematical tables for the value of the lastintegral. �

Figure 5.2.3 The effect on the spectrum due to time scaling.

−1.5 −1 −0.5 0 0.5 1 1.50

0.5

1

1.5

t

pa/

b(b

t)

1

a − 2

b − 2

a/b

−10 −5 0 5 10−0.5

0

0.5

1

1.5

2

ω

2si

n(a

ω/b

)/(a

bs(

b)ω

/b)

πb/a

a − 2

b − 22a/abs(b)

−2 −1 0 1 20

0.5

1

1.5

t

pa(

t)

1a − 2

a

b − 1

−10 −5 0 5 10−1

0

1

2

3

4

ω

2si

n(a

ω)/

ω

2a

a − 2

π/a

b − 1

F p t dt dt aaa

a

( ) ( )0 2 2 4= = =

fn

dn

ad a( )

sin sin( )0

12

42 2= = = ssin x

xdx = × =2

2

Page 219: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

202 Signals and systems primer with MATLAB

Frequency shifting

If then

(5.17)

Modulation

If then

(5.18)

Equation (5.18a) is shown graphically in Figure 5.2.4. Equation (5.18) indi-cates that the spectrum of a modulated signal f(t) is halved and shifted to

Figure 5.2.4 Modulation. Illustration of the spectrum shift of a modulated signal f(t) =p1(t).

F { ( )} ( ),f t F=

F { ( )} ( )e f t Fj t± =00∓

F { ( )} ( ),f t F=

F

F

{ ( )cos } [ ( ) ( )]

{ ( )si

f t t F F

f t

0 0 012

= + + a)

nn } [ ( ) ( )]0 0 012

tj

F F= + b)

1.5

1

0.5

0-1.5 -1 -0.5 0 0.5 1 1.5

t x

f(t)−p1(t)

p1(t

)

2

2

1

0

-1-20 -10 0 10 20

*

2si

n(

)/

0.8

0.6

0.4

0.2

0-20 -10 0 10 20

=

0

0

1

0.5

-0.5

-1-1-2 0 1 2

… …

t −

0

1

-1

-1.5 0 -1.510.5-0.5-1

t

cos(

16

t)p

1(t

)co

s(1

6t)

-20 40200-40

16−0

-16

1

-0.5

0

0.5F( −

0)/2

F( −0)/2

Page 220: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 5: Nonperiodic signals and their Fourier transform 203

the carrier frequency 0. These formulas are easily derived by expandingthe cosine and sine terms into their equivalent exponential forms (see Chap-ter 1) and then using (5.17).

The results of (5.18) constitute the fundamental properties of modulationand are basic to the field of communications. In Figure 5.2.5 we have alsoindicated that the resulting spectrum is equal to the convolution of thespectrums of the product functions, as we will see in the property below onfrequency convolution.

Example 5.2.5: Modulation. Find the spectrum of the modulated signalfm(t) = f(t)cos ct shown in Figure 5.2.5.

Solution: Initially, we find the Fourier spectrums of cos ct and f(t). Theseare

The spectrums are shown in Figure 5.2.5. The spectrum of the modulatedfunction fm(t) is deduced as follows:

F F{cos } (c

j t j tjt

e ee

c c

= + =2

12

c ct j t

c

dt e dt) ( )

( ) (

++

= +

12

+

= = +

c

t t j t t j te e e dt e e dt e

)

{ }F0

=+

t j te dt0

2

21

F e te e e e

mt

c

t j t t j tc c

( ) { cos }� F F= +2 2

= + + +12

12

10

e dt ej j t j jc c( ) ( 11

0

101

212

)

( ) (

t

j j t j j

dt

e dt ec++ + c tdt+1

0

)

= ++ +

++

12

11

12

11

12

11

j j

j

c c

c

( ) ( )

( )112

11

11

112 2

j c

c c

( )

( ) ( )

+

=+

++ +

Page 221: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

204 Signals and systems primer with MATLAB

The spectrum of Fm( ) is also shown in Figure 5.2.5. Observe from Figure5.2.4 and Figure 5.2.5 that when a signal is modulated by a sinusoidalfunction of frequency c, the carrier frequency, the spectrum of the signalis shifted in the frequency domain by c. This process, known as amplitudemodulation (AM), is used in communications. Many of us listen to AM radiostations, which use this type of modulation for their broadcasting. �

The need for modulation systems arises from practical considerations.For transmission through space, the question of the antenna length is animportant consideration. Without some form of modulation, the antennaproblem is impracticable. A second consideration arises if we want to use agiven channel to transmit a number of messages simultaneously withoutinterference. We are familiar with the many broadcasting stations within theallowable broadcast band that use free space as the channel for transmission.In fact, this same free-space channel is used for frequency modulation (FM),TV, and many other forms of communication.

In the amplitude-modulated (AM) system, the carrier signal is easilyproduced by a stable oscillator with power amplifiers to establish the desiredpower level. The carrier signal is of the form , where is

Figure 5.2.5 Illustration of Example 5.2.5.

f(t)

− e

xp

(-ab

s(t)

)

–10 –5 0 5 10 0

0.5

1

1.5

2

ω

F(ω

)

g(t

) −

co

s15

t

–20 –10 0 10 20 0

1

2

3

4

ω

G(ω

)

–5 0 5 –1

–0.5

0

0.5

1

t

f m(t

) −

f(t

)co

s15

t

–20 –10 0 10 20 0

0.5

1

ω

Fm

(ω)

ωc − 15

ωc−ωc

–5 0 5 0

0.5

1

t

×

–6 –4 –2 0 2 4 6 –1

–0.5

0

0.5

1

t

... ...

π

v t V tc c c( ) cos= c

Page 222: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 5: Nonperiodic signals and their Fourier transform 205

the carrier frequency. The modulating signal in its simplest form (tone mod-ulation) is and may denote one component of a complexsignal pattern, where is the modulating frequency and . Thegeneral form of the modulation process is specified by the equation

(5.19)

where m is the modulation index and is defined as m = Vm/Vc. The maximumvalue of mvm(t) must be less than unity if distortion of the envelope is to beavoided. For the case of simple sinusoidal modulation, the equation can beexpanded to

or

(5.20)

The amplitude spectrums of the three waveforms of (5.20) are given in Figure5.2.6a. Figure 5.2.6b shows the system of an AM generator in schematic form.Observe from Figure 5.2.6 that the amplitude-modulated signal has twicethe bandwidth of the original signal and, in addition, that the carrier is alsopresent. From the symmetry property we have shown that the Fourier trans-form of 1 is 2 ( ). Therefore, when we want to find the Fourier transformof cos ct = (ej ct + e–j ct)/2, we end up finding the Fourier transforms of 1,but with frequencies ( + c) and ( – c), respectively. Hence, the resultwill be that shown in Figure 5.2.6a. Observe that in the figure we presentedonly the positive side of the spectrum.

Figure 5.2.6 Amplitude modulation. (a) Frequency spectrum of an AM signal mod-ulated by Vm cos mt. (b) A schematic representation of an ideal generator of an AMsignal.

v t V tm m m( ) cos=m m c�

v t V mv t tc m c( ) [ ( )]cos= +1

v t V T V m t tc c c c m( ) cos cos cos= +

v t V tm

t tc c c m c m( ) cos [cos( ) cos( ) ]= + + +2

2

Vm( ) Vc( ) V( )

m

W − Bandwidth Vm

Vc Vc

Vm

Lower

sideband

Carrier

Upper

sideband

2W

×

~

(a) (b)

1 + mvm(t)

Vc cos c t

v(t)

c c

c + mc m

Page 223: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

206 Signals and systems primer with MATLAB

Suppose that we had used a modulated signal of the form

In such a system, the carrier frequency is not present. This type of modulationis known as double-sideband suppressed carrier (DSBSC) modulation.While such modulation does save energy of the carrier in the transmittedsignal and the carrier component carries no information, subsequent extrac-tion of the information component is rather difficult. Moreover, the informa-tion is contained redundantly in each sideband; hence, it is desirable toremove one or the other sideband to yield single-sideband (SSB) modulation.

The ability to shift the frequency spectrum of the information-carryingsignal by means of amplitude modulation allows us to transmit many dif-ferent signals simultaneously through a given channel, such as a transmissionline, telephone line, microwave link, radio broadcast, and the like. Thisscheme is known as frequency division multiplexing (FDM). Of course, theability to extract a given signal from the channel is equally essential, and avariety of demodulation or detection schemes exist. The sum of the fre-quency bands of the transmitted signals plus frequency guard bands sepa-rating the signals must be less than or equal to the bandwidth of the channelfor undistorted transmission.

For purposes of classification, the frequency spectrum is roughly dividedas follows: 3 to 300 kHz for telephony, navigation, industrial communication,and long-range navigation; 0.3 to 30 MHz for AM broadcasting, militarycommunication, and amateur and citizen-band radio; 30 to 300 MHz for FMbroadcasting, TV broadcasting, and land transportation; and 0.3 to 3 GHz forUHF TV, radar, and military applications. The frequencies above 30 GHz areused mostly for research purposes and radio astronomy.

The process of separating a modulating signal from a modulated signalis called demodulation or detection.

Example 5.2.6: Demodulation. Show that the spectrum of the modu-lated signal can be conveniently retranslated back to the original positionby multiplying the modulated signal by at the receiving end. Weassume that the modulating signal is band limited.

Solution: Figure 5.2.7a shows the schematic representation of the demod-ulation process. Let the modulated signal be expressed as

(5.21)

Then, as shown in Figure 5.2.7a, at the receiver we multiply the receivedsignal f(t), assuming that no noise was added, with the carrier toobtain, by the use of trigonometric identity,

v t mv t t m t tm

m c m c c( ) ( ) cos cos cos [cos(= = = +2 mm c mt t) cos( ) ]+

cos ct

f t m t tc( ) ( ) cos=

cos ct

Page 224: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 5: Nonperiodic signals and their Fourier transform 207

(5.22)

Now if

where M is the highest frequency of the modulating signal m(t), then weobtain

(5.23)

The bottom part of Figure 5.2.7b indicates that we can recover the originalsignal m(t) using a low-pass filter that passes the spectrum up to the highestfrequency of m(t). The low-pass filter is shown by the dotted lines. �

Figure 5.2.7 The demodulation process

(a)

cos ωct

Receivingantenna

f (t) − m(t) cos ωct m(t) cos2 ωctm(t)

× Low pass filter

M0

M0

M( ) F( )

M M

1 2

− c

−2 c 2 c

c

c + M

c M

1 2

M0

F(f (t) cos ct)

1 4 M0

(b)

Low pass filter

M

f t t m t t m t tc c c( )cos ( )cos ( ) ( cos )= = +

=

2 12

1 2

12

mm t m t tc( ) ( )cos+ 12

2

F { ( )} ( ) ( )m t M M M= = >and for0

F F F{ ( )cos } { ( )cos } ( )f t t m t t m tc c= = +2 12

FF12

2

12

14

214

m t t

M M M

c

c

( )cos

( ) ( )= + + (( )+ 2 c

Page 225: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

208 Signals and systems primer with MATLAB

Derivatives

If F{f(t)} = F( ), then

(5.24)

Example 5.2.7: Find the transformed input–output relationship of thesystem shown in Figure 5.2.8a, with the block diagram representation shownin Figure 5.2.8b.

Solution: It is first necessary to write the differential equation of thesystem in the time domain. This equation is the result of applying Kirchhoff’snode equation. The resulting equation is

Because of the linearity property, the Fourier transform of both sides of thisequation becomes

from which,

Figure 5.2.8 An electric system and its schematic representation.

F Fdf t

dtj F

d f tdt

n

n

( )( );

( )= = (( ) ( )j Fn

v tR

Cdv t

dti t

( ) ( )( )+ =

1R

j C V I+ =( ) ( )

VR j C

outputsystem function

( )( / )�� �

=+

11

IIY

I Z I Hinput system

fu

( )( )

( ) ( ) ( ) ( )� = = =1

nnctioninput

I��( )

RC

+

i(t) v(t)

System

h(t)

H(ω)

i(t)

I(ω)

v(t)

V(ω)

(a) (b)

Page 226: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 5: Nonperiodic signals and their Fourier transform 209

This expression shows that the input–output relationship for any LTI systemis given by

(5.25)

Note: When we find the system function (or equivalently, transfer function),all initial conditions are set to zero.

If the input to the system is an impulse function (delta function), theimpulse response h(t) of the system is deduced from the differential equation

(5.26)

Note: Observe that the units of h(t) are volts, as they are in the node equationabove.

Our first step is to find h(t) at t = 0, following the procedure discussedin Section 2.7. Thus, we integrate from t = 0– to t = 0+, which yields

since h(t) is assumed to be continuous at t = 0. This condition is true becauseh(t) is the response of a physical system and h(t) is not expected to be animpulse. Further, for a causal system, h(0–) = 0; hence, h(0+) = 1/C. Next,the solution to the homogeneous equation

is easily found to be (see Chapter 2)

where A is an unknown constant. However, we have already found thath(0+) = 1/C; therefore, from the last equation, A = 1/C. Hence,

G H F oroutput system

functioninput

( ) ( ) ( )� ��= HH system functionoutputinput

GF

( )( )( )

= = =

h tR

Cdh t

dtt

( ) ( )( )+ =

1 10

0

0

0

0

0

Rh t dt

dh tdt

dt t dt( )( )

( )+ + +

+ = orRR

C h h× + + =0 0 0 1[ ( ) ( )]

dh tdt RC

h t( )

( )+ =10

h t Ae tt RC( ) /= > 0

h tC

e tt RC( ) /= >10

Page 227: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

210 Signals and systems primer with MATLAB

The Fourier transform of this function is given by

which is identical with the transfer function above, but which was found bya different approach.

We conclude from this example that the impulse response of a systemcan be deduced by the following steps:

1. Fourier-transform the differential equation that describes the systemassuming a delta function input and zero initial conditions:

2. Solve for the output function:

3. Take the inverse Fourier transform:

This result is obtained from the table in Appendix 5.1. �

Example 5.2.8: Deduce the impulse response of the system shown inFigure 5.2.9a from a knowledge of the system response to the voltage v(t) =exp(j t). Indicate the response to a general voltage v(t).

Solution: By an application of Kirchhoff’s voltage law, we write

If the input is , the current (output) is the same sinusoidal (expo-nential form), but modified by change of its amplitude and phase; thus, wehave

HC

e e dtC

jRC

et RC j t j R( ) / ( /= =+

+1 1 110

1 CC t

Rj C

)

0

11

=+

F Fh tR

Cdh t

dtt

Rj C

( ) ( ){ ( )}+ = +or

1HH( ) = 1

HRj RC C

RCj

( ) =+

=+1

1 11

F =+

=1 12

11

1{ ( )} ( ) /H h t

CRC

je d

Cej t t� RRC

di tdt

RL

i tL

v t( )

( ) ( )+ = 1

v t ej t( ) =

Page 228: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 5: Nonperiodic signals and their Fourier transform 211

where Hr and Hi are real functions of omega. Observe that i(t) is a complexfunction. Introducing this value of i(t) in the first equation we obtain

This value of the transfer function is the value that would be obtained byusing the Fourier transform on the controlling differential equation. Theimpulse response is obtained by taking the inverse Fourier transform of thetransfer function:

The function is shown in Figure 5.2.9b. Thus, the solution for any inputvoltage v(t) is given by

The result of these examples indicates that the transform of a differentialequation that describes the physical system will be of the form

(5.27)

Figure 5.2.9 Simple linear time-invariant system.

(a) (b)

v(t) i(t)

+LR

h(t)

1

L1

Le–t/(L/R)

t

i t H e H ej t j t H Hi r( ) ( ) ( ) [ tan ( ( )/ ( ))]= = + 1

j H eRL

H eL

e HL R

Lj

j t j t j t( ) ( ) ( )+ = =+

1 1 1or

h t HL R L j

e dL

ej t( ) { ( )}( )

� F =+

=1 12

1 1 1/

>t L R t/( / ) 0

i t h t v tL

e v x e dxt L R x L Rt

( ) ( ) ( ) ( )/( / ) /( / )= = 1

ad g t

dtb

d f tdt

n

n

nn

N

m

m

mm

M( ) ( )

= =

=0 0

Page 229: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

212 Signals and systems primer with MATLAB

Taking the Fourier transform of both sides of the above equation, we find

(5.28)

which is an algebraic equation. We will use similar procedures in laterchapters when dealing with Laplace and z-transforms. Solving for the outputwe find

(5.29)

The output in the time domain then follows from the inverse transform,although many times it is not an easy task to find a closed solution. Hence,

(5.30)

Example 5.2.9: Deduce the transfer (system) function for the systemshown in Figure 5.2.10.

Solution: By an application of Kirchhoff’s equation to the two loops,

The Fourier transform of these equations yields

Solve this system of equations to find I2( ). The result is

Since the output , then

a j G b j Fnn

n

N

mm

m

M

( ) ( ) ( ) ( )== =0 0

G

b j

a jouput

mm

m

M

nn

n

N

system fu

( )

( )

( )� = =

=

0

0

nnction

input

F H F

� �

�( ) ( ) ( )=

g t H F e dj t( ) ( ) ( )= 12

Ldi t

dtR i t L

di tdt

v t Ldi t

dt1

1 12 1( )

( )( )

( );( )+ = (( ) ( )

( )R R i t L

di tdt2 3 22 0+ =

( ) ( ) ( ) ( ); ( ) (j L R I j LI V j LI R R+ = +1 1 2 1 2 3 ++ =j L I) ( )2 0

Ij L

R j L R R j L LV2

1 2 32 2

( )( )( )

( )=+ + + +

V R Io( ) ( )= 3 2

VV

Hj LR

R R R j L R R Ro( )( )

( )( ) ( )

� =+ + + +

3

1 2 3 1 2 3

Page 230: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 5: Nonperiodic signals and their Fourier transform 213

As an interesting exercise, we now solve this problem when it is cast inthe form given in (5.27). We subtract the first two equations deduced by anapplication of Kirchhoff’s laws. This yields

Differentiate this equation and then substitute the results into the second ofKirchhoff’s equations. Then, we have

which has the form (5.27). The Fourier transform of this equation is

Multiplying the above equation by R3 and setting I2R3 = Vo, we obtain atransfer function identical to the one already found. �

Parseval’s theorem

Parseval’s relation is given by

(5.31)

Proof: Proceed as follows:

Figure 5.2.10 Illustration of Example 5.2.9.

v(t)

+

+R1 R2

R3

i1(t)i2(t)

vo(t)v(t) vo(t)

V(ω) Vo(ω)L

Systemh(t)

H(ω)

i tR R

Ri t

v tR1

2 3

12

1

( ) ( )( )= + +

L R R Rdi t

dtR R R i t L

dv tdt

( )( )

( ) ( )( )

2 3 12

1 2 3 2+ + + + =

[ ( ) ( )] ( ) ( )j L R R R R R R I j LV1 2 3 1 2 3 2+ + + + =

E f t dt F dt= =( ) ( )2 21

2

f t dt f t f t dt F e dj t( ) ( ) * ( ) ( )= =2

12

f t dt* ( )

Page 231: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

214 Signals and systems primer with MATLAB

This shows that the energy of the time domain signal is equal to the energyof the frequency domain. This is a statement of the conservation of energy.

If the power density spectrum of a signal is defined by

(5.32)

then the energy in an infinitesimal band of frequencies is , andthe energy contained within a band of frequencies is

(5.33)

The fraction of the total energy that is contained with a band is

(5.34)

The interpretation of energy and power of signals in this manner ispossible because f(t) may be thought of as a voltage, so that f(t)/(1 – ohmresistor) is current, and thus f 2(t) is proportional to power.

Example 5.2.10: Determine the total energy associated with the function.

Solution: From (5.31), the total energy is

By using the results of Example 5.1.1, we can also proceed from a frequencypoint of view:

=

=

12

12

F f t e dt d

F

j t( ) ( )

(

*

)) * ( ) ( )F d F d= 12

2

W F( ) ( )= =12

2spectrum power density

d W d( )

E F d= 12

2

1 21

2

( )

EE

F d= =energy in band

total energy

12

2

1

( )2

1

2

12

2

2

2=

F d

F d

F d( )

( )

( )

f t e u tt( ) ( )=

E e u t dt e dtt t= = =( ) ( )2 2

0

12

Ej j

d d=+

=+

=12

11

11

12

11 2

11 11

12

122

0 += =d

Page 232: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 5: Nonperiodic signals and their Fourier transform 215

where we used the symmetry property of the integrand. Using mathematicaltables, the last integral is equal to tan–1( ) evaluated from zero to infinity.�

Another important form follows using the spectrum between input andoutput specified by the definition of the transfer function. Hence,

so that

(5.35)

In general, the transfer function is a complex function and can be written inthe polar form as follows:

(5.36)

where Hr, Hi, and H0 are real functions of frequency. Therefore,

(5.37)

Note: The power density spectrum of the response of an LTI system is theproduct of the power density spectrum of the input function and the square amplitudefunction of the system. The phase characteristics of the system do not affect theenergy density of the output.

Example 5.2.11: Find the frequency response of an LTI system given thatthe input is and the output is . Determine theimpulse response of the system.

Solution: From (5.25), we write the relation

The impulse response is the inverse Fourier transform of the above equation,and hence

G F H( ) ( ) ( )=

G F H F H F H F H( ) ( ) ( ) ( ) ( ) * ( ) * ( ) ( ) (2 2 2

= = = ))2

H H H e Hr ij H Hi r( ) ( ) ( ) (tan [ ( )/ ( )]= + =2 2

01

)) ( )ej

G H F( ) ( ) ( )2

02 2

=

f t e u tt( ) ( )= g t e u tt( ) ( )= 2 2

Hj

( )( )= = +output spectrum

input spectrum/2 2

11 12

12

22

2/( )+= +

+=

+jjj j

h t t e tt( ) ( )= 2 2 02

Page 233: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

216 Signals and systems primer with MATLAB

Time convolution

If and denote the Fourier transforms of f(t) and h(t), respectively,then

(5.38)

Proof: The Fourier transform

where we have written t – x = s. This result agrees with (5.25). Furthermore,if we assume that f(t) is the input to an LTI system, h(t) is its impulseresponse, and g(t) its output, then (5.38) is written in the form

(5.39)

This expression shows that the output of an LTI system in the time domainis equal to the inverse Fourier transform of the product of the transferfunction and the Fourier transform of its input.

Example 5.2.12: Determine the Fourier transform of the function.

Solution: We observe that f(t) is the convolution of f1(t) = e–t u(t) and f2(t) =e–t u(t). However, the Fourier transform of e–t u(t) is 1/(1 + j ), so that F( ) =1/(1 + j )2. �

Example 5.2.13: Determine the frequency spectrum of the output for thesystem shown in Figure 5.2.11.

Solution: By an application of Kirchhoff’s current law at a node, thecontrolling differential equation is

F( ) H( )

F F{ ( ) * ( )} ( ) ( ) ( )f t h t f x h t x dx F= = HH( )

F { ( ) * ( )} [ ( ) * ( )] ( )f t h t f t h t e dt f x dxj t= =

=

h t x e dt

f x e dx h s e

j t

j x

( )

( ) ( ) jj sds F H= ( ) ( )

g t f x h t x dx F H F( ) ( ) ( ) { ( ) ( )} ( )= = =F 1 12

HH e dj t( )

f t te u tt( ) ( )=

dv tdt

v t p too

( )( ) ( )+ =5 5

Page 234: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 5: Nonperiodic signals and their Fourier transform 217

The impulse response of the system is obtained from the equation

The Fourier transform of this equation is

The inverse Fourier transform of the above equation is

However, the output is the convolution of the system input and its impulseresponse, and the frequency spectrum of its output is given by the product

We would also proceed by Fourier-transforming the first equation. This yields

which is identical to our previous result. �

Frequency convolution

If f(t) and h(t) are transformable functions, then

(5.40)

Figure 5.2.11 Illustration of Example 5.2.13.

+

h(t)i(t)

i(t) − p(t)vo(t)

vo(t)

R − 1Ω

C − 0.2F

dh tdt

h t t( )

( ) ( )+ =5

j H H H j( ) ( ) ( ) ( )+ = = +5 1 1 5or /

h t e u tt( ) ( )= 5

V p t e u tjo

t( ) { ( )} { ( )}sin= =

+F F5 10

15

5

j V V Vjo o o( ) ( )

sin( )

sin+ = =+

5 10 101

5or

F { ( ) ( )} ( ) ( ) ( ) * (f t h t F x H x dx F H= =12

12

))

Page 235: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

218 Signals and systems primer with MATLAB

Proof: We proceed by writing

where we have written – x = s, that is = x + s and d = ds.

Example 5.2.14: Verify the results of Example 5.2.5 by using the convo-lution property of the Fourier transform.

Solution: The Fourier transform of the function is given by

Further, we know that Next, use (5.40) and apply thedelta function properties (the value of the integral is found by substitutingthe value of the position in which the delta function is located to the rest ofthe functions in the integrand). Thus,

Summary of continuous-time Fourier properties

Linearity

Time shifting

F F F=1 1 12

{ { ( ) ( )}} ( ) ( ) ( ) * ( )f t h t f t h t F H�

=

=

12

12

12

F x H x e dxd

F x

j t( ) ( )

( )ee dx H s e dsjtx jts12

( )

cos ct

F F{cos } (c

j t j tjt

e ee

c c

= + =2

12

c ct j t

c

dt e dt) ( )

( ) (

++

= +

12

+ c)

F { } ( ).||e t = +2 1 2/

F {cos } [ ( ) ( )]||c

tc ct e x x= + +1

22

1 ++

=+

+ +

( )

( )( )

( )

xdx

xx

dx xc c

2

2

11

11 ++

=+

++ +

( )

( ) ( )

xdx

c c

2

2 2

11

11

af t bh t aF bH( ) ( ) ( ) ( )+ +F

f t t e Fj t( ) ( )± ±0

0F

Page 236: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 5: Nonperiodic signals and their Fourier transform 219

Symmetry

Time scaling

Time reversal (real time functions)

Frequency shifting

Modulation

Time differentiation

Frequency differentiation

Time convolution

Frequency convolution

Autocorrelation

Central ordinate

Parseval’s theorem

F t f( ) ( )

( ) ( )

F

F =

2

1 2 2

f ata

Fa

( ) F 1

f t F( ) ( )F

e f t Fj t± 00( ) ( )F ∓

f t t F F

f t t

( )cos [ ( ) ( )]

( )sin

0 0 0

0

12

F + +

FF +12 0 0j

F F[ ( ) ( )]

d f tdt

j Fn

nn( )

( ) ( )F

( ) ( )( )

( ) ( )( )

jt f tdF

d

jt f td F

dn

n

n

F

F

f t h t f x h t x dx F H( ) * ( ) ( ) ( ) ( ) ( )= F

f t h t F H F x H x dx( ) ( ) ( ) * ( ) ( ) ( )F =12

12

f t f t f x f x t dx F F

F

( ) ( ) ( ) * ( ) ( ) * (

(

� =

=

F

)2

f F d F f t dt( ) ( ) ( ) ( )01

20= =

E f t dt E F d= =( ) ( )2 21

2

Page 237: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

220 Signals and systems primer with MATLAB

*5.3 Some special Fourier transform pairsTo find the Fourier transform of the delta function, although it does notsatisfy the Dirichlet conditions, we use a limiting process. We consider somespecial functions below.

Example 5.3.1: Find the Fourier transform of the delta function illus-trated in Figure 5.3.1 and defined here by the limiting formula for differentpositive real values of .

Solution: The Fourier transform of this equation is

(5.41)

where the limit is found using L’Hospital’s rule on limits. �

Example 5.3.2: Find the Fourier transform of the function sgn(t) shownin Figure 5.3.2a.

Solution: We proceed to write the signum function as lim 0 exp[– �t�]sgn(t), as shown in Figure 5.3.2b. The procedure is now direct and yields

(5.42)

Figure 5.3.1 A delta function sequence.

4

2

1

–1 1

ε � 2

ε � 1

ε � 0.25

–0.5 0.5 t

1 pε/2(t)ε

( ) lim ( )/t p t=0

21

F F F{ ( )} lim ( ) lim/ /t p t p= =0

20

1 122

0

22

1( ) limsin( )

( )t = =/

/

F F{sgn( )} lim sgn( ) lim sgnt e t et t= { } =0 0

(( )

lim ( ) (

t e dt

e dt e

j t

j t j+= +0 0

)tdt0

Page 238: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 5: Nonperiodic signals and their Fourier transform 221

The Fourier amplitude and phase spectrums of sgn(t) are shown inFigures 5.3.2c and d. In this proof, we changed the order of limit and inte-gration. Such an interchange is not always appropriate and requires math-ematical justification, which is beyond the scope of this text. �

Example 5.3.3: Find the Fourier transform of the unit step function u(t).

Solution: Begin by writing u(t) in its equivalent representation involvingthe sgn(t) function:

(5.43)

Therefore, the Fourier transform is

(5.44)

The real and imaginary parts of its spectrum are shown in Figure 5.3.3. �

Figure 5.3.2 The sgn function and its Fourier representation.

t

–1

1

1

sgn(t) 0

t � 0

t � 0

t � 0

⎧⎪⎨⎪

−1⎩

t

1

1

–1

ε1

ε2

ε1 − ε2

sgn(t)te −ε

(a) (b)

SGN (ω)

ω(c) (d)

Arg SGN (ω)

−π /2

ω

= ++

= =lim (/

0

21 1 2 2j j j

e SGNj � )

u t t( ) sgn( )= +12

12

U u tj j

( ) { ( )} ( ) ( )� F = + = +22

22

1

Page 239: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

222 Signals and systems primer with MATLAB

Example 5.3.4: Find the Fourier transform of the functionshown in Figure 5.3.4a.

Solution: Carrying out this problem requires that the functionfirst be represented in its Fourier series expression, which is

(5.45)

where

The Fourier transform is then

(5.46)

Figure 5.3.3 Fourier transform representation of the unit step function u(t).

Figure 5.3.4 Fourier transform of the function.

Re(U(ω)) Im(U(ω))

π

ω ω

comb tT ( )

comb tT ( )

comb t t nT a eT

eT

n

njn t

n

jn( ) ( )= == =

� 01

0t

n=

aT

t e dtT Tn

jn t

T

T

= = =1 1 20

2

2

0( )/

/

F F{ ( )} { } ( )comb tT

eT

nT

n

jn t

n

= ==

1 120

0

==

=

= 2 2 20T

nT T

COMBn

� ( )

……

T 2T

1

–T t

combT(t)

(a)

COMB2π/T(ω)

2πT

2πT

2πT

2πT

4π ωT

(b)

comb tT ( )

Page 240: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 5: Nonperiodic signals and their Fourier transform 223

The foregoing shows that any periodic function of the form

(5.47)

has a Fourier transform of the form

(5.48)

Example 5.3.5: Pulse amplitude modulation (PAM). Find the spectrumof the pulse amplitude modulation (PAM) case, if m(t) (see Figures 5.3.5aand b) is a band-limited modulating signal and g(t) is a train of periodicrectangular pulses of width 2a seconds and repeating every T seconds (seeFigures 5.3.5c and d).

Figure 5.3.5 Pulse amplitude modulation.

f t a enjn t

n

( ) ==

0

F { ( )} ( ) ( )f t F a nn

n

� ==

2 0

t

f(t) − m(t)g(t)

t

m(t)

×

(a)

(c) (d)

(e)

… …

t

1

T

2a

g(t)

……

G( )

2 a 0 2 sin a 0

sin 2 a 0

(b)

M ( )

M- M

(f )

M- M

F( )

a 0/

… …

Page 241: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

224 Signals and systems primer with MATLAB

Solution: Let

(5.49)

According to the frequency convolution theorem (5.40), the Fouriertransform of f(t) = m(t)g(t) is

(5.50)

The signal g(t) can be constructed by the convolution of the and theone-period signal (centered at the origin) extracted from g(t), which we cancall g1(t). Hence,

(5.51)

The Fourier transform of the comb function is given by (5.46), and the Fourierof the centered pulse of width 2a is given by (5.9). Hence,

(5.52)

and it is plotted in Figure 5.3.5d. Therefore, introducing (5.52) into (5.50), weobtain

(5.53)

We observe from the figure and the analysis above that the outputspectrum is the convolution of the spectrum of the periodic function and thespectrum of the modulating function. From Figure 5.3.5f we observe that wecan recover exactly the signal m(t) if we carefully select the sampling time Tand let f(t) pass through an ideal low-pass filter with bandwidth from – M

to M. �

F { ( )} ( ) ( )m t M M M= = >0 for

F f t m t g t M G G( ) { ( )} { ( ) ( )} ( ) * ( ), ( )� F F= = =12

FF { ( )}g t

comb tT ( )

G comb T g t comb t g tT T( ) { ( ) * ( )} { ( )} { ( )}= =F F F1 1

Ga

Tn

Tan

nn

( )sin

( )sin= =

=

2 2 40

0

0

( )

sin( ),= =

=

=

n

ann

n

n

n

0

00 02

22T

Fann

x n M x dxn

( )sin

( ) ( )==

12

2 00

===

1 00

n

ann

M nsin

( )

Page 242: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 5: Nonperiodic signals and their Fourier transform 225

*5.4 Effects of truncation and Gibbs’ phenomenonFrom the symmetry property we have found out that the spectrum of a pulseis a sinc function. Then, if we create a time function from this sinc function,its Fourier transform is a pulse. If a pulse is symmetric about the origin andhas a width of 2 and height of 1, then its Fourier transform is Wethen change this function to a time function and divide it by 2 to obtain

The inverse Fourier transform is the pulse. Next, instead of taking thewhole length for its inversion, we first take a portion from –5 to 5. Whatthis, in theory, does is multiply the sinc function with a pulse of width 10and make it symmetric about the origin. Hence, when we take the Fouriertransform of the truncated sinc function, it is equivalent to taking the trans-form of the product functions, which are the sinc function and the pulse.But from the product property of the Fourier transform we know that thespectrum is the convolution of these two spectrums. Hence, we do not expectan exact reproduction of the pulse, but an approximation to it. Figure 5.4.1shows the results when the truncation is from –5 to 5 and –30 to 30. Observethat as we increase the time bandwidth, the resemblance to the pulse formimproves. However, even if we increase further the time bandwidth, theundulations in the middle will be diminished, but at the edge the undulationwill remain about 9%. This is known as Gibbs’ phenomenon.

The same happens if we truncate the spectrum and try to find its timefunction by using the inverse Fourier transform. We have found that theFourier transform of f(t) = is and the range is from minusinfinity to infinity. Next we use the following two frequency ranges, –0.5

0.5 and –6 6, respectively, and proceed to find the inverse transforms.

Figure 5.4.1 The effect of truncation in the time domain.

2sin ./

f tt

tt( )

sin= < <

exp( )t 2 1 2/( )+

Sp

ectr

um

0.5

00 2 4 6 8

1

1.5

ω

Sp

ectr

um

0.5

00 1 32

1

1.5

ω

Page 243: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

226 Signals and systems primer with MATLAB

The results are shown in Figure 5.4.2. Observe that if the range is not infinity,an approximate time function is found (we plotted here the positive timeonly). Since we truncated the spectrum, in effect, we multiplied the exactspectrum with a rectangular window spectrum. From the time convolutionproperty of the Fourier transform, we know that the approximate time func-tion is equal to the convolution of the original time function with the inverseFourier transform of the pulse in the frequency domain. The inverse trans-form of the pulse is a sinc function in the time domain. Hence, the result isan approximation to the exact function since any convolution creates a signalthat is not exactly either of the two that were involved in the convolutionprocess.

*5.5 Linear time-invariant filtersThe Fourier transform discussed in the previous sections has important usesin the study of the input–output relationships of linear time-invariant (LTI)systems. It is also important in determining the frequency spectra of LTIsystems. We have already found that the output of an LTI system is relatedto the input through a convolution integral. Moreover, we have shown thatthis relationship becomes a simple algebraic one in the frequency domain:the frequency spectrum of the output is equal to the product of the spectrumof the input and the spectrum of the impulse response (inverse Fouriertransform of the transfer function) of the system.

Note: The output spectrum in the most general terms is a filtered version ofthe input.

Filters, which for our purposes are systems that influence a signal in aprescribed way, have many useful applications and are used in diversefields — for example, filtering of mechanical vibrations, fluctuations of eco-nomic data, electrical signals, biological signals, and two-dimensional signals(images), just to name a few. Their construction is such that when filters areincluded in a given system, the detected output will have some desiredcharacteristics. For example, when we purchase an audio amplifier (a hi-fi

Figure 5.4.2 Truncation in the frequency domain.

65432100

0.2

0.4

0.6

0.8

1f(

t)u

(t)

Approximate

t

Page 244: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 5: Nonperiodic signals and their Fourier transform 227

system), we expect that is equipped with both bass and treble controls sothat we can modify to our liking the low- and high-frequency responses ofthe program to which we are listening. What is actually provided in theamplifier is essentially two variable filters. In the case of AM communica-tions, we may wish to transmit the upper sideband only, since it containsall the information of the transmitted signal. This might require inserting ahigh-pass filter in the system so that only those frequencies above the carrierfrequency are passed. Filtering is used extensively to eliminate undesiredlow- and high-frequency noise. In later chapters we will discuss how to buildanalog and digital filters to accomplish the appropriate filtering of signalsat hand.

As already discussed, the output spectrum of g(t) is equal to the productof the spectrums of the input f(t) and the impulse response h(t) of the system(filter) and is given by the relation

(5.54)

In general, the system function is a complex function and can be set in theform

(5.55)

where is the amplitude transfer function and is the phasetransfer function. Similarly, we can write the input signal spectrum functionin the form

(5.56)

where is the amplitude spectrum of the input signal and is itsphase spectrum. Hr, Hi , Fr, and Fi are all real functions of the frequency.Combining the last three equations, we obtain the relation

(5.57)

Note: The amplitude of the output spectrum is the product of the amplitudespectrum of the input and the amplitude spectrum of the filter (system function ortransfer function). The phase spectrum of the output is equal to the sum of the phasespectrum of the input and the phase spectrum of the filter.

G F H( ) ( ) ( )=

H H e H H ejr i

j H Hh i r( ) ( ) ( ) tan ( / )� = +2 2 1

H( ) h( )

F F e F F ejr i

j F Ff i r( ) ( ) ( ) tan ( / )� = +2 2 1

F( ) f ( )

G G e H F e

G

j jg h f( ) ( ) ( ) )

( )

( ) [ ( ) ( )]� = +

==

= +

H F

g h f

( ) )

( ) ( ) ( )

Page 245: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

228 Signals and systems primer with MATLAB

Distortionless filter

A filter is distortionless when the form of the output is identical to that ofthe input, except perhaps for a change in the amplitude and a possible timelag. Under these conditions, the output is specified as

(5.58)

where f(t) is the input signal and Ho is the constant amplitude response ofthe filter, which may be less or equal to unity. Taking the Fourier transformof this equation, we obtain

(5.59)

Hence, the system function of a distortionless filter (see 5.54) is

(5.60)

A graphical representation of this function is shown in Figure 5.5.1.

Example 5.5.1: Find the conditions under which the filter shown inFigure 5.5.2 is of the distortionless type.

Figure 5.5.1 The transfer function of a nondistortion filter.

Figure 5.5.2 Illustration of Example 5.5.1.

Distortionless

filterf(t)

H(ω) − H0e− jω t0

H0 f (t − t0) H0

H(ω)θh(ω)

−t0

1

ω

ω

g t H f t to( ) ( )= 0

G H e Foj t( ) ( )= 0

H H eoj t( ) = 0 � Transfer function of distortiionless filter

+

+

vi(t) vo(t)R

R

C

Page 246: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 5: Nonperiodic signals and their Fourier transform 229

Solution: From the voltage division rule, or applying the node Kirchhoff’sequation and then taking the Fourier transform, we obtain

Since

for (RC /2) << 1, the arctangent is approximated by RC /2, and hence thetransfer function becomes

Ideal low-pass filter

An ideal low-pass filter is one that has a transfer function of the form

(5.61)

The characteristics of this filter are shown in Figure 5.5.3a. Clearly, the ideallow-pass filter is one that permits ideal transmission over a specified bandof frequencies and completely excludes all other frequencies. Such idealfilters are not physically realizable, as discussed below, but the concept doeshelp in an understanding of different types of physical filters whose responsemay be approximated by those of the ideal filters.

The impulse response of the ideal low-pass filter specified by (5.61) isfound by taking the inverse Fourier transform of H( ). This is

or

(5.62)

HVV

R jRCR R jRC j

o

i

( )( )( )

( )( )

= = ++ +

=+

//1

11

2 RRC RCe j RC=

+

1

4 2

21

( )tan ( / )

tan ( ) ( )( )

!( )

!= +1

3 5

2 22

32

5RC RC

RC RC/ /

/ /��

H eRC

j RC( ) ( / )12

22 �

H H p e j t( ) ( )= 0 00 � Ideal low-pass filter

h t H p e e d H ej t j t j t( ) ( ) (= =12

120 00

0 t d0

0

0)

h tH t t

t tH

c t t( )sin[ ( )]

sin ( )= =0 0 0

0

000

� Immpulse response of ideal low-pass filter

Page 247: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

230 Signals and systems primer with MATLAB

The form dictated by this expression is shown in Figure 5.5.3b. Thisfigure shows that the impulse response is not identically zero for time equalto or less than zero. This would suggest that when a delta source is appliedat t = 0, the system anticipates the input and a signal occurs at the outputof the system even before the source has been applied. Of course, this is nottrue for physical systems. This is proof that ideal filters are not physicallyrealizable; that is, it is not possible to build an ideal filter with any combi-nation of resistors, capacitors, and inductors.

Ideal high-pass filter

The frequency characteristic of an ideal high-pass filter is given by

(5.63)

The corresponding impulse response function, which is obtained by takingthe inverse Fourier transform of this equation, is

(5.64)

Figure 5.5.3 The impulse response characteristics of an ideal low-pass filter.

(a)

1 H0

H( ) − H0 p0( ) h( ) − – t0

0- 0

–t0

43210–1–2–3–4–2

0

2

4

6

8

(b)

t

t0

h(t

) π/ω0H0ω0/π

H H H p e j t( ) [ ( )]= 0 0 00

h t H t tH t t

t t( ) ( )

sin[ ( )]= 0 00 0 0

0

Page 248: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 5: Nonperiodic signals and their Fourier transform 231

Important definitions and concepts

1. Uniqueness of spectrum for each signal2. The Fourier transform and its inverse constitute a pair3. The shifting of a function affects only the phase spectrum of the signal4. The Fourier transform of delta function (t) is 1, and the Fourier

transform of a constant A is 2 A ( )5. The faster a signal varies, per unit time, the richer it is in high

frequencies6. Modulation succeeds to shift the spectrum of the modulating func-

tion to the carrier frequency7. A channel is any medium through which an information signal is

transmitted.8. The opposite of a modulation process is called demodulation or

detection9. The ratio of the output spectrum of an LTI system to the input,

assuming sinusoidal excitation, is known as the transfer or systemfunction

10. Parseval’s identity indicates that the total energy of the signal can befound from its time domain or frequency domain

Note: Parseval’s identity tells us about the total energy of the signal, butit does not tell us how the energy of a signal contained at a specified range inthe time domain is distributed in the frequency domain. The same is trueif we consider the transformation from the frequency domain to the timedomain. This is one major drawback of the Fourier transform operation.

11. Power spectrums densities12. Pulse amplitude modulation13. Effects of truncation in time and frequency domains and Gibbs’ phe-

nomenon14. Ideal filters

Chapter 5 ProblemsSection 5.1

1. Deduce the spectrum functions of the time functions shown in FigureP5.1.1a. Deduce the spectrum function of Figure P5.1.1b by (a) usingthe Fourier integral and (b) combining the results found in FigureP5.1.1a. (Note that the pulse function must be multiplied by A.)

2. Refer to Figure P5.1.2. (a) Deduce the even and odd functions Fr( )and Fi( ) for this function. (b) Decompose the given function in thetime domain into two functions with even and odd parts and againfind Fr( ) and Fi( ). Compare the results with the results in part (a).

Page 249: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

232 Signals and systems primer with MATLAB

3. Deduce the Fourier transform of the odd function

and verify the odd and real function properties of the Fourier trans-form.

4. Determine the Fourier transform of the following functions and givethe value of the as .

Section 5.2

1. Prove (5.13), (5.14), (5.17), and (5.18).2. Find the Fourier transform of the following functions and sketch their

amplitude and phase spectrums:

Figure P5.1.1

Figure P5.1.2

A

T t

)2TpT/2(t –

t

A

T–T

pT (t)

A

–A

tT

–T

) )2 2T TpT/2(t – – pT/2(t +

(a) (b)

t2–2

2

f(t)

f te u t

e u t

t

t( )

( )

( )=

F( )

a.

b.

f t p t t

f t e u t tt

( ) ( ) ( )

( ) ( ) ( )

.= + +

= +

0 5 1

2

Page 250: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 5: Nonperiodic signals and their Fourier transform 233

3. Find the Fourier transform of the following functions:

4. A signal f (t) = e–t u(t) is applied to a system that has an impulseresponse h(t) = e–3t u(t). Specify the system output and find its spectrum.

5. Systems are given in block diagram form in Figure P5.2.5. Find thetransfer function of these systems and the Fourier outputs.

Figure P5.2.5

a.

b.

c.

f t p t

f t p t p t

f t

( ) ( )

( ) ( ) ( )

( )

=

= + +

=

3

2 2

2

2 2

ee t

f t e p t

f t e p t

t

j t

j t

=

=

cos

( ) ( )

( ) ( )

0

31

22 3

d.

e.

a. /

b. /

c.

f t a jt

f t t

f t at

( ) ( )

( ) ( )

( ) sin(

= +

= +

=

1

1 1 2

))

( )

/

d.

t

f t t= 2

+ +∫ ∫

2

5

g(t)

−−

δ(t)

(c)

+

2

g(t)∫e−tu(t)

(a) (b)

+ ∫

2 2

+

g(t)e−2tu(t)

Page 251: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

234 Signals and systems primer with MATLAB

6. Deduce the transfer function for the systems shown in Figure P5.2.6by (a) a direct application of Fourier transform and (b) first findingh(t) and then using the Fourier transform to find the transfer function.Compare the results. The systems are relaxed at t = 0.

7. The impulse response of a network is given as .Deduce the transfer function and, from the spectrum, indicate theeffect on the spectrums of the input signals.

8. Prove the following identities, where a, b, and 0 are constants:

9. Find the Fourier transforms of the functions given and sketch theiramplitude and phase spectrums.

10. A 1 μs (10–6 s) pulse modulates a carrier wave with frequency c =109 rad/s. Locate the frequencies at which the resulting output spec-trum becomes zero.

11. Deduce the spectrum of the output for the systems shown in FigureP5.2.11 for a delta function input.

Figure P5.2.6

(a) (b)

v(t)

+

R

i(t) L f(t)M

D

v

h t p t p t( ) ( ) . ( )= 2 40 5

a.

b.

F

F

{ ( ) * ( ) * ( )} ( ) ( ) ( )

{ ( ) *

f t h t g t F H G

F

=

1 HH f t h t

f t t a f a e ja

( )} ( ) ( )

{ ( ) ( )} ( )

=

=

2

c.

d

F

.. F { ( ) * [( / ) ]} ( )f t t a b a F e jab=

a.

b.

c

f t p t p t

f t p t p t

( ) ( ) * ( )

( ) ( ) * ( )

=

= +

1 3

2 1

3

2 2

.. /

d.

f t c t c t c t t t( ) sin ( )sin ( ) (sin ( ) sin );= =3 3 3

ff t e tt( ) cos=

Page 252: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 5: Nonperiodic signals and their Fourier transform 235

12. Compare the amplitude and phase spectrums of the following setsof functions:

a. p(t), p(t-2), p(t+2)b. p(t), p(2t–2)

13. The impulse response of a system is . Find the spec-trum of the output if the input is p(t).

14. Square-law modulator. Assume that a nonlinear resistive device hasthe voltage–current characteristics given by v = a1i + a2i2. Supposethat the input is i = Imcos 0t + Bm(t), where m(t) has a band-limitedspectrum. Find the spectrum of v(t).

Figure P5.2.11

(a)

D

T TSystem

+

+R1

R2 vo(t)

vi(t) vi(t)

vo(t) L System

(b)

(c)

M1 M2

System

v1v2

D1 D2

f(t) v2

f(t)

h t e u tj t( ) ( )( )= 2 2

Page 253: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

236 Signals and systems primer with MATLAB

15. Using the convolution property, find the frequency spectrum of thefunction . Verify your result by evaluating

16. Determine the Fourier transform of the function .

Section 5.3

1. Find the Fourier transform of the following functions:

2. Find the Fourier transform of the periodic functions shown in FigureP5.3.2.

3. We may often want to find the spectrum of a function taken from anoscilloscope trace. Also, there are certain closed-form functions forwhich the Fourier transform cannot be found. One approach is toapproximate the function by piecewise polynomial approximationsor straight-line segments. Compare the Fourier spectrums of the func-tion p(t) with those of (1 – t2) and (1 – t4) for –1 t 1. Discuss yourresults.

Figure P5.3.2

p t p t a ta a a( ) * ( ) ( )= 2 2

21

22 2

0

2 2a t t

t

aa t a

a aF { ( )}; ( ) =

otheerwise

.

f t p t t( ) ( ) cos= 2

a.

b.

f t t t t t

f t e t

( ) sin ( ) cos ( )

( ) si

= +

=

0 0 0 03

nn ( )

( ) cos cos

( ) ( cos

0

1 2

1

t u t

f t t t

f t m

c.

d.

=

= + tt tc)cos

1 3–1

3

–3

t

f(t)

t

h(t)

2

–2

2 4 6–2

(a) (b)

Page 254: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 5: Nonperiodic signals and their Fourier transform 237

4. Prove the frequency differentiation property of the Fourier transform

5. Determine the Fourier transform of the signals shown in Figure P5.3.5by employing Fourier transform properties in conjunction with f0(t) =exp(–t)u(t). All the curves shown in the figure decay as exp(–t).

Appendix 5.1

Figure P5.3.5

Table A.5.1 Table of Fourier Transform Pairs

1.

2.

3.

F F{( ) ( )}( )

{( ) ( )}( )= =jt f t

dFd

jt f td F

dn

n

n

1

t

f(t)

(a)

1

–2

g(t)

t

(b)

h(t)

t

1

–1

(c) (d)

t

texp(–t)u(t)

y(t)

f t F e d F f t e dtj t j t( ) ( ) ( ) ( )= =1

2

f tt a

Fa

( ) ( )sin

= =1

02

otherwise

f t Ae u t FA

a jat( ) ( ) ( )= =

+

f t Ae FaA

aa t( ) ( )= =

+2

2 2

Page 255: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

238 Signals and systems primer with MATLAB

Table A.5.1 (continued) Table of Fourier Transform Pairs

4.

5.

6.

7.

8.

9.

10.

11.

12.

13.

14.

15.

16.

f tA

t

at a

F Aa( ) ( )= =1

0 otherwise

ssin( )

( )

a

a

/

/

2

2

2

f t Ae F Aa

ea t a( ) ( ) ( / )= =2 2 22

f tA t e t

tF A

a j

a j

at

( )cos

( )(

=<

=+

+

0 0

0 0 ))202+

f tA t e t

tF

A

a j

at

( )sin

( )( )

=<

=+

0 02

0

0 0 ++ 02

f tA t t a

F Aa

( )cos

( )sin (

= =0

0 otherwise

0

0

0

0

)

sin ( )+

++

Aa

f t A t F A( ) ( ) ( )= =

f tA t

F A j( ) ( ) ( )=>

=0

0

1

otherwise

f t

A t

t

A t

F j A( ) ( )

>

=

<

=

0

0 0

0

21

f t A F A( ) ( ) ( )= = 2

f t A t F A( ) cos ( ) [ ( ) ( )]= = + +0 0 0

f t A t nT FA

Tn

Tn n

( ) ( ) ( )= == =

2 2

f tat

tF pa( )

sin( ) ( )= =

f tat

tF a

a( )

sin ( / )( )= =

2 2 1

0

2

2

otherwise

Page 256: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

239

chapter 6

Sampling of continuous signals

The sampling of continuous signals at periodic intervals has become a veryimportant and practical mathematical operation. One of the main concernswhen signals are sampled is the accuracy with which the sampled signal isrepresented by its sampled values. Also, what type must the signal be andwhat must the sampling interval be in order that an optimum recovery ofthe original signal can be accomplished from the sampled values?

A very important fact in the sampling operation is that all physicalengineering systems have frequency response limitations; that is, they respondonly to some upper frequency limit, which we call the Nyquist frequency.As a result, the output signal of these systems is band limited. We havealready seen that the ordinary house telephone signal has an upper frequencylimit of about 4 kHz and the television signals have an upper frequency limitof 4 MHz. A very important consequence of a finite bandwidth signal is thatit can be accurately represented by a narrow time duration samplingsequence, with samples taken at discrete and periodic instants. As alreadynoted, the time space between the samples of one signal can be used toaccommodate (time multiplex) without interference the samples of a differ-ent signal when transmitted through some transmitting channel. Often thesamples are digitized, and this digitization is readily accomplished with ananalog-to-digital (A/D) converter, the output being amplitude informationin digital form. It is in this form that sampled and digitized signals enter acomputer for further processing.

6.1 Fundamentals of samplingThe values of the function at the sampling points are called sampled values.These values are the exact values (infinite precision) of the signal at thosecorresponding sampling times. The time that separates the sampling pointsis called the sampling interval (Ts), and the reciprocal of the sampling

Page 257: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

240 Signals and systems primer with MATLAB

interval is the sampling frequency (Fs = 1/Ts) or sampling rate. The valueof any continuous function f(t) at the point nTs is specified by

(6.1)

This relationship is easily proved by integrating both sides of the equa-tion. The sampling interval is chosen to be a real positive number andconstant, and n = 0, ±1, ±2, ±3, …. The choice of Ts is critical in recapturingthe original signal, a matter to be discussed in detail below. The sampledsignal (see also Figure 1.2.10) is

(6.2)

where the equality (6.1) was used. The Fourier transform of the above equa-tion is

(6.3)

where the delta function properties for the Fourier integral were used. Notethat the Fourier transform operates on functions having continuous time tas their independent variable.

Now, consider the Fourier transform of the term ,which appears in (6.2) and which is the equivalent of the quantity involvingthe shifted delta function. By (5.40) (frequency convolution Fourier property)and (5.46) (the Fourier transform of the comb function), we obtain

(6.4)

f t t nT f nT t nTs s s( ) ( ) ( ) ( )=

f t f t t nT f t comb t f nTs s

n

Ts( ) ( ) ( ) ( ) ( ) (� = =

=ss s

n

t nT) ( )=

F f t f nT t nT f nTs s s

n

s( ) { ( )} ( ) { ( )} (� F F= ==

ssj nT

n

e s)=

f t f t comb ts Ts( ) ( ) ( )=

F f t comb t F comb ts T Ts s( ) { ( ) ( )} ( ) { ( )}= =F F

12

==

=

=

12

2

1

FT

n

TF x

ss

n

s

( ) ( )

( )) ( )

( )=

=

n

s

ss

n

x n dx

TF n

1

Page 258: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 6: Sampling of continuous signals 241

By (6.3) and (6.4),

(6.5)

where s is the sampling frequency in rad/s and Fs is the sampling frequencyin s–1.

This discussion shows that if we know the Fourier transform of f(t), theFourier transform of its sampled version is uniquely determined. Further-more, if we set in (6.5), we obtain

(6.6)

where we set n + m = k. Observe that for any m, as n increases to plus minusinfinity, the values of k also increase to plus minus infinity.

Note: The spectrum of the sampled signal fs(t) is an infinite sum of shiftedspectrums of the original signal f(t). The spectrum of the sampled signal is periodicwith period s (see Figure 6.1.1).

When the function f(t) is causal (positive time), f(t) = 0 for t < 0, then

(6.7)

which can be shown to yield

(6.8)

Example 6.1.1: Find the Fourier transform of the sampled functions

F f nT eT

F ns sj nT

n ss

n

s( ) ( ) ( )= == =

1s

ssT

F= =22

= m s

F mT

F m nT

Fs ss n

s ss n

( ) [ ] [= == =

1 1 +

= ==

( ) ]

[ ] ( )

m n

TF k F

s

s k

s s1

f t f nT t nTs s

n

s( ) ( ) ( )==0

F f nT ef

F ns sj nT

n

s

n

s( ) ( )( )

( )= = + += =0

02

a.

b.

f t e comb t

f t e u t comb t

st

T

st

T

s

s

( ) ( )

( ) ( ) (

=

= ))

Page 259: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

242 Signals and systems primer with MATLAB

Solution: By (6.5) and (6.8) and Appendix 5.1, we obtain, respectively,

(6.9)

(6.10)

Example 6.1.2: Consider three functions, f(t), h(t), and g(t), with respec-tive frequency characteristics F( ), H( ), and G( ), as shown in Figure 6.1.2b.Find the maximum sampling interval Ts in order that the function y(t) = f (t) +

Figure 6.1.1 Fourier spectrum of a sampled signal with only three elements. The F( )is present for n s shifts with – < n < .

(a)

×f (t)

combTs(t)

F{ fs(t)}fs(t) Fs( )

151050–5–100

0.2

0.4

0.6

0.8

1

1.2

1.4

–15

F(ω + ωs)

F(ω − ωs)

F(ω)

Fs(ω)

−ωsωs

(b)

ω

F { ( )} ( )( )

e comb t FT n

tT s

s sns

=

=+ +

�1 2

1 2 sssT

= 2

F { ( ) ( )} ( )( )

e u t comb t FT j n

tT s

s ss

= ++ +

�12

1 11

nn=

Page 260: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 6: Sampling of continuous signals 243

h(t)g(t) shown in Figure 6.1.2a is recovered from its sampled version ys(t)using a low-pass filter.

Solution: The Fourier transform of the sampled function is given by

From the frequency convolution property of the Fourier transform, we find

Figure 6.1.2 Illustration of Example 6.1.2.

(a)

× + ×

h(t)

g(t)

f(t) combTs(t)

ys(t) y(t)

1

F(ω ) H(ω ) G(ω )

ω–2π104 2π104 ω2π104–2π104 ω2π104–2π104

1 1

(b)

1

2

H(ω)*G(ω)

Ys(ω)

ω s

F(ω)

2π104 4π104 8π104 ω

(c)

Y f t comb t h t g t comb ts T Ts s( ) { ( ) ( ) ( ) ( ) ( )}= +F

Y FT

COMB h t g tss

s( ) ( ) ( ) { ( ) ( )}= +1

22 1

2F

22

1 12

2

TCOMB

TF COMB

s

s

s

s

( )

( ) ( )= + HH GT

COMBs

s( ) ( ) ( )

2

Page 261: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

244 Signals and systems primer with MATLAB

The convolution of gives us a periodic repetitionof the spectrum F( ). The convolution gives usa periodic repetition of the spectrum . However, the spectrumwidth of is equal to the sum of the spectral widths of H( ) andG( ); hence, in the present case, .The spectrum Ys( ) is shown in Figure 6.1.2c. We observe that the minimumsampling frequency s, in order that the spectrum of does notoverlap, is 8 104 or, equivalently, the maximum Ts = 2 /8 104 = 0.25 × 10–4.Because the spectral width of is greater than the spectral widthof F( ), the value of the sampling time is determined by the spectral widthof . However, if the spectral width of F( ) were greater than thespectral width of , the value of the sampling time would bedetermined from the spectral width of F( ). The spectrums in Figure 6.1.2chave been normalized to unity. �

6.2 The sampling theoremWe next show that it is possible for a band-limited signal f(t) to be exactlyspecified by its sampled values provided that the time distance betweensampled values does not exceed a critical sampling interval. The samplingtheorem is stated as follows:

Theorem 6.2.1: A finite energy function f(t) having a band-limited Fou-rier spectrum, that is, , can be completely reconstructedfrom its sampled values f(nTs) (see Figure 6.2.1) with

(6.11)

provided that the sampling time is selected to satisfy

(6.12)

where N, known as the Nyquist frequency, is the highest frequency of thesignal.

This theorem states that no loss of information is incurred through thesampling process if the signal is sampled at a sampling frequency that is atleast twice as fast as the highest frequency contained in the signal. Equiva-lently, the sampling time must be less than or equal to one half of the Nyquisttime TN. For band-limiting signals, the sampling process introduces no error,since, in theory, we can recover the original continuous time signal from itssampled version. The sinc function in (6.11) is known as the interpolationfunction to indicate that it allows an interpolation between the sampledvalues to find f(t) for all t.

F COMBs

( ) ( )andH G COMB

s( ) ( ) ( )with

H G( ) ( )H G( ) ( )

N NH NG= + = + =2 10 2 10 4 102 2 2

H G( ) ( )

H G( ) ( )

H G( ) ( )H G( ) ( )

F N( ) = 0 for

f t T f nTt nT

t nTs

n

ss s

s

( ) ( )sin[ ( ) ]

( )=

=

/2s

sT= 2

22

12 2

2s

sN N N

NNT

f fT

� �= = = = also s

Page 262: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 6: Sampling of continuous signals 245

Proof: Employ (6.5) and Figure 6.2.1b to write (n = 0)

(6.13)

By (6.3), this equation becomes

(6.14)

from which we have that

(6.15)

Note that the inverse Fourier transform operates only on the function withthe independent variable . By the application of the frequency-shift prop-erty of Fourier transform, it is seen that this equation proves the theorem.

Figure 6.2.1 Sampling theorem.

F

(a)

f(t)

f(3Ts)

–Ts Ts 3Ts t

F(0)

F( )

– N N

(b)

(c)

fs(t)

t

F(0)

s s s + N

s /2

Ps /2

( )

N N

Fs( )

Low pass filter

F

Ts 3Ts –Ts

f(3Ts) f(0)

F( )

F P T Fs s s( ) ( ) ( )/= 2

F P T f nT es

ss s

j nT

n

( ) ( ) ( )/==

2

f t F P T f nT es

ss s

j nT

n

( ) { ( )} ( ) ( )/= ==

F F1 12

= T f nT P es sj nT

ss( ) { ( )/F 1

2

nn=

}

Page 263: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

246 Signals and systems primer with MATLAB

For the case when s = 2 N, (6.11) becomes

(6.16)

and the spectrum of the sampled function is a periodic one with the succes-sive replicas of the spectrum of f(t) just touching.

The sampling time

(6.17)

is called the Nyquist interval. It is the longest time interval that can be usedfor sampling a band-limited signal while still permitting us to recover thesignal without distortion. Figure 6.2.2 shows how a band-limited signal canbe reconstructed from its samples using (6.11). Observe that the sinc functionstend to cancel between the sampling times and reinforce at the samplingpoints. Although we used a Gaussian function that has an infinite spectrum,a unit sampling time, and only three sinc functions, we observe that theapproximation is very good. Of course, for a band-limited function and aninfinite number of shifted sinc functions the recovery is complete and notapproximate.

If we select the sampling time to be larger than half the Nyquist timeor, equivalently, the sampling frequency to be less than twice the largest

Figure 6.2.2 Reconstruction of a signal from its samples.

f t f nTt nT

t nTsN s

N sn

( ) ( )sin[ ( )]

( )=

=

TT

fsN

N

= =2

12

0.8

1

0.6

0.4

0.2

0

–0.2

–0.4–5 –4 –3 –2 –1 0 1 2 3 4 5

t

f(t)

f(0)

f(–1)f(1)

f(t) � exp(–t2)

Approximate

Page 264: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 6: Sampling of continuous signals 247

frequency (Nyquist frequency), an overlapping of the spectrums occurs. Thisoverlapping is known as aliasing.

The Fourier transform of a sampled function is

If the sampling frequency is not appropriate (is less than twice the Nyquistfrequency), then aliasing will take place and the spectrum will look like theone shown in Figure 6.2.3a. If the sampling time diminishes at least to thevalue TN/2, then the spectrum of the sampled function will look like the oneshown in Figure 6.2.3b. It is clear from Figure 6.2.3a that there is no filteravailable that is capable of extracting the frequency spectrum of the signalwithout including additional frequencies produced by the shifted spectrums.

The effect of aliasing can be used to our advantage in some cases. Sup-pose that we want to stop optically a repetitive action, for example, the wingundulation of a bee or the turning of a wheel. To accomplish this opticaleffect, we flash the object with a strobe light. If we adjust the repetition ofthe strobe flash to equal the wing repetition rate or the wheel turning rate,these events will appear to be stationary. If the strobe frequency is muchhigher than twice that of the periodic phenomenon, the speed of the phe-nomenon does not appear to change. However, if the strobe flashes are lessthan twice the frequency of the phenomenon under observation, the repeti-tion slows down; thus, we observe a slow-flying bee or a slow-rotating wheel.This phenomenon is commonly observed in movies when we observe amoving stagecoach, with wheels appearing stationary or turning slowly

Figure 6.2.3 Aliasing and nonaliasing situation.

F f t comb t F comb ts T Ts s( ) { ( ) ( )} ( ) { ( )}= =F F

12

frequency convolution

=1

22

FT

ns

s( ) ( )) ( ) ( )n s

s

nT

F n= =

= 1

= 1T

F COMBs

s( ) ( ) (6.18)

1Fs(ω) �

–ωN ωN

ωs � 2ωN

F(ω) ∗ COMBωs(ω)

Ts

(a)

–ωN ωN 2ωN

ωs � 2ωN

1Fs(ω) � F(ω) ∗ COMBωs

(ω)Ts

(b)

Page 265: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

248 Signals and systems primer with MATLAB

(sometimes backwards). In the movies, the sampling rate is 1/20 s becausethe frame rate of the film is about 20 frames per second.

Sampling the function at twice the largest frequency available in thesignal (Nyquist frequency), the signal spectrums just touch each other andextend from minus infinity to infinity. This situation is shown to the left ofFigure 6.2.4a. To isolate the spectrum of the signal, we must multiply thesampled spectrum with a ideal low-pass filter, which is shown in the centerof Figure 6.2.4a. The resulting spectrum of this multiplication is the spectrumof the signal F( ). Hence, to recapture the signal intact, we write

Figure 6.2.4 Delta sampling, representation, and recovery of signals.

F−1 F−1F−1

–Ts Ts 2Ts

tTs

fs(t)

f(t)

t t

1

Ts sin ( st/2)/( t)

(a)

(b)

× −

2 −

Ts/2

s

2 s

Ps /2

( )

– N N

F( )

… …

1 Fs( ) −

– N Ns − 2 N

F( ) COMBs( )

Ts

F F=1 1 1{ ( )} ( ) ( ) ( )F f t

TF COMB

T

s

ss

�22

1

2

1

P

TF COMB

s

ss

/ ( )

( ) ( )= F

=

TP

f t comb tT

s

Ts

s

s

2

2

12F { ( )}

( ) ( ) *

/

22 2sin( )

( ) ( )

s

ss s

n

tt

Tf nT t nT

/

==

sin( )stt

/2

Page 266: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 6: Sampling of continuous signals 249

Example 6.2.1: Show the aliasing phenomenon by decreasing s or,equivalently, by increasing the sampling time Ts, associated with a purecosine function . Use a low-pass filter of bandwidth s in theoutput.

Solution: The Fourier transform of f(t) is .Thus, the Fourier transform of the sampled function fs(t) is (see also (6.18))

Figure 6.2.5a shows the spectrum of the sampled function whenor, equivalently, when Figure 6.2.5b is the result of the con-volution of and . Figure 6.2.5d is the convolutionof and By adding the spectrums of Figure 6.2.5b andd, we obtain the total spectrum of Fs( ) as specified by the above equation.The spectrum of the sampled function is shown in Figure 6.2.5e. If weincorporate a filter having a frequency bandwidth of s/2, we regain oursignal since

We follow the same procedure as shown in Figure 6.2.5, with the differ-ence that in this case the sampling frequency was taken to be less than twicethe Nyquist frequency, which in this case is 0. We observe, in Figure 6.2.6,that the low-pass filter will produce a cosine function, but with a differentfrequency, equal to s – 0, which is the alias of 0. �

==

Tf nT t x nT

xx

dxss s

n

s( ) ( )sin( )/2

===

T f nTt nT

t nTs

n

ss s

s

( )sin( ( ) )

( )/2

f t t( ) cos= 0

F( ) ( ) ( )= + +0 0

FT

F COMB

TCOMB

ss

s

s

s

( ) ( ) * ( )

[ ( ) * (

=

=

1

0 ) ( ) * ( )]+ + 0 COMBs

s � 0

T Ts � 0 02= / .( )0 COMB

s( )

( )+ 0 COMBs( ).

12

12 0T P e d T

T Tsj t

ss s

s( ) ( ) (= + + 0) e dj t

[ ] cos= + =12

0 00e e tj t j t

Page 267: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

250 Signals and systems primer with MATLAB

Example 6.2.2: Consider the analog signal .

a. Find and plot the magnitude of its spectrum.b. Using MATLAB, plot the magnitude spectrum of the sampled version

of f(t) for Ts = 0.6 and Ts = 0.4.

Solution: The Fourier transform of f(t) is easily found using the Fourierintegral (see also Appendix 5.1) and it is equal to . From(6.3) we find that the Fourier transform of its sampled version is

where the formula for the infinite geometric series was used: 1/(1 – x) = 1 +x + x2 + x3 + …. The value of x must be less than 1 for the series to converge.

Figure 6.2.5 Nonaliasing problem using a pure sinusoid function.

/Ts

F( )

00

COMBs( )

ss

1 …

(a)

(b)

+

/Ts

F( )

00

COMBs( )

ss

… … 1

(c)

(d)

F( ) COMBs( )

/Ts

s 0 s0s

s 0

s + 0 s + 0s 00 0

s/2

s/2

Ts Fs( ) Low pass filter

(e)

F( ) COMBs( )

/Ts

s0

− s + 0s s + 0

f t e u tt( ) ( ).= 0 5

F j( ) /( . )= +1 0 5

F e e esnT j nT

n

T j T n

n

s s s s( ) . ( . )= ==

+0 5

0

0 5

==

+ += + + +

=

0

0 5 0 5 21

11

e eT j T T j Ts s s s( . ) ( . ) �

=+e e eT j T T j Ts s s s( . ) .0 5 0 5

11

Page 268: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 6: Sampling of continuous signals 251

Figure 6.2.7a shows the magnitude of the spectrum F( ) and Figures 6.2.7band c shows the spectrum of the sampled function for Ts = 0.6 and 0.4,respectively.

Figure 6.2.6 Aliasing problem using pure sinusoidal function.

Figure 6.2.7 Illustration of Example 6.2.2.

/Ts

F( )

00

COMBs( )

ss

1 …

(a)

(b)

+

/Ts

F( )

00

COMBs( )

ss

… 1

(c)

(d)

F( ) COMBs( )

/Ts

ss 0

s 0

s 0

… …

F( ) COMBs( )

/Ts

s0

− s + 0s s + 0

(e)

s

s + 0 s 0

s + 00

s0

s/2

Ts Fs( )Low pass filter

s 0

s/2

20 0 0

1

2

3

4

5

6

–20

Ts − 0.4

Mag

nit

ud

e

20 0 0

1

2

3

4

–20

Ts − 0.6

Mag

nit

ud

e

20 0 0

0.5

1

1.5

2

–20

Mag

nit

ud

e

(a) (b) (c)

Page 269: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

252 Signals and systems primer with MATLAB

Book MATLAB m-file: ex6_2_2

%ex6_2_2 is the m-file for illustrating Ex 6.2.2

w=-10:.01:10;

fw=abs(1./(0.5+j*w));

fs1w=abs(1./(1-exp(-0.5*0.6)*exp(-j*w*0.6)));

fs2w=abs(1./(1-exp(-0.5*0.1)*exp(-j*w*0.1)));

subplot(2,3,1);plot(w,fw,'k');xlabel('\omega');ylabel...('magnitude');

subplot(2,3,2);plot(w,fs1w,'k');xlabel('\omega');ylabel...('magnitude');

subplot(2,3,3);plot(w,fs2w,'k');xlabel('\omega');ylabel...('magnitude'); �

Construction of analog signal from its sampled values

If a continuous signal is band limited, we can reconstruct it by using thesampling theorem. This requires an infinite number of samples — not apractical way to accomplish its reconstruction. Furthermore, this approachdoes not lead to real-time processing, which is needed in communicationsand many other areas of signal processing.

The simplest way to construct f(t), for nTs < t (n + 1)Ts, from f(nTs) isto hold the value of f(nTs) until the arrival of the next sample value f((n + 1)Ts).This process is known as the zero-order hold. If we had connected the valuesof the samples by a straight line, then we would talk about a first-order hold.The MATLAB function plot performs this process. Figure 6.2.8a shows thesample values of continuous signal. Figure 6.2.8b shows the zero-order hold,and Figure 6.2.8c shows the construction of the continuous signal usinglinear interpolation (straight line can be described by a polynomial of t ofdegree 1).

Book MATLAB m-file: zero_order_hold

%zero_order_hold is a m-file that creates zero-hold and

%linear interpolation;

t=0:1:10;

f=exp(-0.2*t)-exp(-0.8*t);

subplot(1,3,1);stem(t,f,'k');xlabel('nT_s');ylabel('f(nT_s)');

subplot(1,3,2);stairs(t,f,'k');xlabel('t');ylabel...('zero-order hold');

subplot(1,3,3);plot(t,f,'k');xlabel('t');ylabel('linear... interpolation')

It is apparent that when we use the zero-order hold to reconstruct f(t), we createerrors. These errors will become smaller the shorter the sampling time used.In addition, cost and performance specifications should also be considered.

Page 270: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 6: Sampling of continuous signals 253

Important definitions and concepts

1. Importance of sampling2. Sampled values3. Sampling interval and sampling frequency4. Sampling rate5. Ideal sampling with the comb function6. The spectrum of the sampled signal7. The sampling theorem8. The Nyquist frequency of a signal9. The interpolation function

10. Aliasing11. Sampling of pure sinusoids12. Construction of continuous signals from their sampled values13. Zero-order hold and linear interpolation

Figure 6.2.8 First-order hold and linear interpolation.

0.5

0.45

0.35

0.4

0.25

0.15

0.05

00 5 10

t

0.1

0.2

0.3

Lin

ear

inte

rpo

lati

on

(c)

0 5 10

t

(b)

0.5

0.45

0.35

0.4

0.25

0.15

0.05

0

0.1

0.2

0.3Z

ero

-ord

er h

old

0 5 10

nTs

(a)

0.5

0.45

0.35

0.4

0.25

0.15

0.05

0

0.1

0.2

0.3

f(n

Ts)

Page 271: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

254 Signals and systems primer with MATLAB

Chapter 6 ProblemsSection 6.1

1. Prove the identity:

Hint: Expand in Fourier series.2. Sketch the amplitude Fourier spectrum of fs(t) for the systems shown

in Figure P6.1.2. Assume that the sampling frequency is sufficientlylarge that no overlap of repeated spectrums occurs.

3. Verify (6.1) and (6.3).4. Determine the Fourier transform of the product f1(t)f2(t)f3(t). Based

on this answer, deduce the Fourier transform of the productf1(t)f2(t)…fn(t).

5. Find the Fourier transform of the function

for Ts = 0.5 and Ts = 0.05. Use (6.3) and the following Book MATLABfunction:

Figure P6.1.2

( ) ( )= == =

n e Ts s

n

j nT

n

s ss1 2/ /

× ×

f(t)

h(t)

fs(t)

combTs(t)

(a)

combTs(t)

Delay

t0

+ ×

f(t)

fs(t)

(b)

(c)

combTs(t)

+ ×

f(t)

h(t)

fs(t)

H( )

1

22

F( )

1

11

2 − 2 1

f te tt

( ).

=0 5 0 3

0 otherwise

Page 272: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 6: Sampling of continuous signals 255

%p6_1_5 m-file solves the request of Prob6.1.5

Ts=0.25;

n=0:3/Ts;

w=0:.05:200;

f=exp(-0.5*Ts*n)*exp(-j*0.5*Ts*n'*w);

%f is an nxw matrix, first we add the rows

%using the MATLAB command sum(f,1) and then plot the results;

sf=sum(f,1);

plot(abs(sf)*Ts)

Section 6.2

1. Suppose that we choose a sampling plan that will contain 99% of theenergy of F( ) of the time function f(t) = exp(–t)u(t). To find theNyquist frequency, and hence to find the sampling frequency, use therelationship

2. Verify the sampling theorem using (6.15).3. Expand the band-limited F( ), with � � N, in a Fourier series and

prove the sampling theorem.4. A signal f(t) is sampled with pulses. The sampled signal is represent-

ed by , where

.

Use the Fourier transformation of s(t) to find the Fourier spectrumof fs(t). Sketch the Fourier spectrum of fs(t) if f(t) is a band-limitedsignal.

5. Find the Nyquist frequency for each of the following signals:a.b.c.d.

6. Find the value of the RC combination such that the low-pass filtershown in Figure P6.2.6 is used as an anti-aliasing filter. The magni-tude square of the transfer function must be equal to (0.01)2 at 20,000rad/s. Plot also the transfer function in a linear-log scale to observethe roll-off with frequency. In practice, sharper filters are used.

F d F d dN N

( ) . ( ) .2

0

2

02

00 99

11

0 9=+

=or 991

1 20 +

d

f t f t s ts( ) ( ) ( )=

s t p t nTa s

n

( ) ( )/==

2

f t t( ) cos( )= 10 100f t p t( ) ( )= 2

f t t t( ) sin( )= 2 2 /f t t t( ) [sin( ) ]cos( )= 100 30000/

Page 273: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

256 Signals and systems primer with MATLAB

Figure P6.2.6

+

+R

Cvo(t)vi(t)

Page 274: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

257

chapter 7

Discrete-time transforms

In the previous chapters we have included discussion of the use of Fouriertransform techniques in continuous-time signal processing and signal sam-pling studies. However, in many problems, the signal may be experimentallyderived and analytic functions are not available for the integrations involved.There are two general approaches that might be adopted in such cases. Onemethod calls for approximating the functions and carrying out the integra-tions by numerical means. A second method, and one that is used exten-sively, calls for replacing the continuous Fourier transform by an equivalentdiscrete Fourier transform (DFT) and then evaluating the DFT using thediscrete data. Now, instead of integrations, the direct solution of DFT requires,for each sample, N complex multiplications, N complex additions, and theaccess of N complex exponentials that appear in the DFT. Hence, with 104

samples (a small number in many cases), more than 108 mathematical oper-ations are required in the solution. It was the development of the fast Fouriertransform (FFT), a computational technique that reduces the number ofmathematical operations of the DFT to , that made DFT anextremely useful transform in many fields of science and engineering.

7.1 Discrete-time Fourier transform (DTFT)Approximating the Fourier transform

The Fourier transform of a continuous-time function is given by

(7.1)

where we have used the capital omega to represent the continuous frequencyindependent variable in rad/s. We can approximate the above integral byintroducing a short time interval Ts such that essentially all the radian fre-quency content of lies in the interval – /Ts /Ts. With this approx-imation, we express the Fourier transform integral (7.1) in the form

N Nlog2

F f t e dtj t( ) ( )=

F( )

Page 275: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

258 Signals and systems primer with MATLAB

(7.2)

If we set

(7.3)

in the above equation, we obtain

(7.4)

which is known as the DTFT.

Note: The discrete frequency is equal to Ts and has the units of radiansper unit length, where has units of radians per second. If Ts is unity time, thenthe discrete frequency and the continuous frequency have the same values butdifferent units. Both frequencies and are continuous independent variables.

Therefore, the following steps can be taken to approximate the continuous-time Fourier transform:

1. Select the time sampling Ts such that2. Sample f(t) at times to obtain .3. Compute the DTFT using the sequence4. The resulting approximation is then

If we introduce the value of in (7.4), we obtain

(7.5)

since exp(j2 ) = 1. Therefore, the function is periodic with a period of2 . This property contrasts with the Fourier transforms of continuous func-tions whose range is infinite. Thus, due to periodicity, the frequency rangeof any discrete-time signal is limited to the range for Ts = 1;any frequency outside these intervals is equivalent to a frequency withinthese intervals. If we had included the sampling time, (7.5) would have takenthe form

(7.6)

F f t e dt T f nT ej t

nT

nT T

n

s ss

s s

( ) ( ) ( )=+

=

jj nT

n

ss T

=

0

f n T f nT

T

s s

s

( ) ( )

rad/unit

FDTj j n

n

f n F F e f n e{ ( )} ( ) ( ) ( )� � ==

F Ts( ) .>0 for all /nTs f nTs( )

{ ( )}.T f nTs s

F F T Ts s( ) ( ) .for / /

+ 2

F F e F e Fj j( ) ( ) ( ) ( )( )+ = =+2 2�

F( )

( , ] ( , ]or 0 2

F e F ej

TT

j Tss

s( )

( )+

= ( )2

Page 276: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 7: Discrete-time transforms 259

which indicates that the spectrum is periodic every 2 /Ts.Because is periodic, it can be expanded in a Fourier series. To

accomplish this, multiply both sides of (7.4) by and integrate theexpression within the period. This yields

(7.7)

But taking into consideration that the integral of any sinusoidal signal iszero when it is integrated within a period (or multiple period), we obtain

(7.8)

Then (7.7) becomes (only one element from the sum remains)

(7.9)

Thus, the DT Fourier transform pair of discrete-time signals is

(7.10)

Example 7.1.1: Determine the DTFT of the signal f(t) = exp(–t)u(t), forTs = 1 and Ts = 0.1.

Solution:

a. From (7.10), we write

since the summation is an infinite geometric series.b. Taking into consideration the sampling time in (7.10), we obtain

F( )e dj m

F e e d f n ej j m jn

n

( ) ( )=

= e djm

f n e df n m n

m nn

j m n( )( )

( )

=

==2

0

f n F e e dj j n( ) ( )= 12

F e F e e f n e

f n

j j j j n

n

( ) ( ) ( )

( )

( )= =

=

=

12

FF e e dj j n( )

F e e e ee

j n j n

n

j n

n

( ) ( )(

= = ==

+

=0

1

01

11 ++j )

Page 277: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

260 Signals and systems primer with MATLAB

Since {f(n)} and f(nTs) are absolutely summable,

the series converge (we used the complex identity �z1z2� = �z1��z2�).The magnitude and phase of the second case, for example, are given by

If we set in the equation above, we observe that the magnitude ofthe spectrum is an even function and the phase is an odd function.

Note: For real functions, the amplitude spectrum is an even function and thephase spectrum is an odd function. Thus, the representation of the frequency spec-trum within the range 0 will suffice.

The reader should plot the magnitude of the spectrums given above toobserve the differences. Furthermore, if we set Ts = 0.01, the spectrum willclosely approximate the exact one to 100 , and its magnitude at zero frequencyis 0.01/(1 – exp(–0.01)) = 1.0050, which is very close to 1, as it should be.

7.2 Summary of DTFT properties

Linearity

Time shifting

F e T f nT e e ej Ts s

j T n

n

nT j Ts s s( ) ( ) .= ==0

0 1 ssn

n

j n

n

ee e

=

+

=

= =

0

0 1 0 1

00 1

0 10 1

1.

.( . . ). j0 1.

e e ee

j n

n

n

n

n

n

+

= = =

= = = <( )

.

1

0 0 01

11

0 11 0 10 1

10 1 0 1

0

0 1

0

e ee

j n

n

n

n

+

= =

= =( . . ) ... <

0 1.

F ee j e

j( ).

( cos . ) ( sin ..

. .0 1

0 1 0 1

0 11 0 1 0 1

=+ )

.

( cos . ) ( sin . ). .=

+

0 1

1 0 1 0 10 1 2 0 1 2e ee

j ttansin .

cos .

.

.1

0 1

0 10 1

1 0 1

e

e

=

af n bh n aF e bH eDT j j( ) ( ) ( ) ( )+ +F

f n m e F eDT j m j( ) ( )F

Page 278: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 7: Discrete-time transforms 261

Time reversal

Convolution

Frequency shifting

Modulation

Correlation

Parseval’s formula

The proofs of these properties are given in Appendix 7.1.

Example 7.2.1: Find the DTFT of the function .

Solution: We observe that the function 0.9nu(n) is a modulating functionand thus

We must always have in mind that the spectrum of discrete signals is infi-nitely periodic. Therefore, the magnitude of is a double periodic struc-ture, one shifted to the left by 0.1 and the other shifted to the right by 0.1 .Since in this case Ts = 1, the spectrum can be plotted from – /1 to /1.

Book MATLAB m-file: ex7_2_1

%ex7_2_1 is an m file for illustrating Ex 7.2.1

w=-pi:0.01:pi;

fw1=abs(0.5*(1./(1-0.9*exp(-j*(w-0.1*pi)))));

fw2=abs(0.5*(1./(1-0.9*exp(-j*(w+0.1*pi)))));

plot(w,fw1,w,fw2); �

f n F eDT j( ) ( )F

f n h n F e H eDT j j( ) ( ) ( ) ( )F

e f n F ej n jDT0 0( ) ( )( )F

f n n F e F eDT j j( )cos ( ) (( ) ( )0

12

12

0 0F ++ ))

f n h n F e H eDT j j( ) ( ) ( ) ( )� F

f n F e dn

j( ) ( )2 21

2=

=

g n u n nn( ) . ( ) cos .= 0 9 0 1

F F{ . ( )cos . }. ( ) ..

0 9 0 10 9

20 90 1

nn j n n

u n nu n e u= + (( )

( .

.

( . )

n e

e

j n

j=

0 1

0 1

2

12

0 9 )) ( . ).

( . )n

n

j n

n

ee

=

+

=

+ =0

0 1

0

12

0 912

11 0 9

++ =

j

jj

eG e

( . )

( . )(

.(

0 1

0 1

12

11 0 9

12

00 1 0 112

. ) ( . )) ( )+ +G ej

G ej( )

Page 279: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

262 Signals and systems primer with MATLAB

Note: In contrast with the Fourier transform, where we had continuous func-tions in both the time and frequency domains, in the case of DTFT we have discretefunctions in time domain and continuous functions in the frequency domain.

Example 7.2.2: Verify Parseval’s formula using the function

Solution: The time sequence corresponding to the given is

But the relations

and

prove the theorem. �

7.3 DTFT of finite time sequencesPractical considerations usually dictate that we deal with truncated series.Therefore, the spectrum of a truncated series requires special attention. Whenwe observe a finite number of data points, , how dowe account for the unobserved time series elements that lie outside themeasured interval 0 n N – 1? We must consider the effect of the missingdata since a one-sided Fourier transform, for example, requires the entire setof time series elements f(n) for the interval 0 n < .

The one-sided truncated DTFT is defined by

(7.11)

F ej( ) =< <1

0 otherwise

F ej( )

f n e dn

nj n( )

sin= =12

sin sinnn

nn

n n

= == =

2

20 0

21 1

22 0 0 1( )+ + + =�

12

d = 1

f f f f N( ), ( ), ( ), , ( )0 1 2 1�

F e f n eNj j n

n

N

( ) ( )==0

1

Page 280: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 7: Discrete-time transforms 263

We introduce the DTFT of f(n) in the above expression so that

(7.12)

where

(7.13)

and the finite geometric series formula was used. The transform functionis the DTFT of the rectangular window, since it is the transform of

the time function for even N. We observethat with a finite sequence a convolution appears in the frequency domain.From (7.12) we observe that to find the exact spectrum we require aFourier-transformed window equal to a delta function ( ) in theinterval – . However, the magnitude of �W(ej )� = sin( N/2)/sin( /2)has the properties of a delta function and approaches it as N . Therefore,the longer the time–data sequence we observe, the less distortion that willoccur in the spectrum of the signal, .

We observe that

(7.14)

and hence the DTFT of

(7.15)

is

(7.16)

The convolution of (7.16) with (7.13) gives the following expression:

F e F e e dNj j j n

n

N

( ) ( )'==

12

0

1

ee

F e e d

j n

j

n

Nj n

=

= =12

12

0

1

( ) ( )

=

F e W e d

F e W e

j j

j j

( ) ( )

( ) (

( )

12

))

W e eee

ej j n

n

N j N

jj N( )

( ) (= = ==0

11

111 2 2

2)/ sin( )

sin( )N//

W ej( )w n u n u n N p n NN( ) ( ) ( ) ( )/= = 2 2/

F ej( )W ej( )

F ej( )

cos { ( ) ( )}01

0 0n DT= + +F

f n n n( ) cos( ) cos[( ) ]= + +0 0 0

F ej( ) [ ( ) ( ) ( ) (= + + + +0 0 0 0 0 ++ 0 )]

Page 281: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

264 Signals and systems primer with MATLAB

(7.17)

We observe that the DTFT of two finite sinusoids is made up of four sincfunctions, two on the right side and two on the left side. We will plot themagnitude of (7.17) for different values of 0. This will show us how thevalue of N affects the resolution capabilities of the DTFT for two sinusoidswhose frequencies are very close to each other. We shall plot only half of thesprectum for convenience. Figure 7.3.1a shows the magnitude of the spectrum

Figure 7.3.1 The effect of time truncation on the separation of closely spaced sinusoids.

F e eN

Nj j N( )

sin

sin

( )( )/= 12

2

2

0 1 2

0

0++

+

+

+

+12

2

2

12

0 1 2

0

0e

N

e

j N( )( )/sin

sin

jj NN

( )( )/sin

sin

0 0 1 2

0 0

0 0

2

22

12

20 0 1 2

0 0sin

sin

( )( )/+

+ ++ +e

Nj N

++ +0 0

2

(a)

0.2π0.3π

F(e jω)

π

ω

3.532.521.510.500

5

10

15

20

25

30

ω

N � 50

ω0 � 0.2πΔω0 � 0.1π

Mag

nit

ud

e o

f F

N(e

jω)

(b)

Page 282: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 7: Discrete-time transforms 265

for two sinusoids with 0 = 0.2 , and an infinite number of terms.Figure 7.3.1b shows the magnitude spectrum for the case

.

Figure 7.3.1c shows the magnitude spectrum for the case

,

and finally, Figure 7.3.1d shows the magnitude spectrum for the case

.

Since the limit value is 2 /N, then as N , the value of 2 /N approacheszero. This indicates that we can separate two sinusoids with infinitesimaldifference if we take enough signal values.

Figure 7.3.1 (continued)

3.532.521.510.500

5

10

30

ω

N � 25

ω0 � 0.2πΔω0 � 0.1π

Mag

nit

ud

e o

f F

N(e

jω)

(c)

3.532.521.510.500

8

10

ω

N � 10

Δω0 � 0.1πω0 � 0.2π

Mag

nit

ud

e o

f F

N(e

jω)

(d)

6

4

2

0 0 1= .

0 0 12 2

50= =. �

N

0 0 12 2

25= > =.

N

0 0 12 2

10= < =.

N

Page 283: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

266 Signals and systems primer with MATLAB

Windowing

It turns out that the Fourier transform spectrum will depend on the type ofwindow used. It is appropriate that the window functions used are such thatthe smoothed version of the spectrum resembles the exact spectrum asclosely as possible. Typically it is found that for a given value N, the smooth-ing effect is directly proportional to the width of the main lobe of the window,and the effects of ripple decrease as the relative amplitude of the main lobeand the largest side lobe diverge. A few important discrete windows are:

1. von Hann or Hanning:

(7.18)

2. Bartlett:

(7.19)

3. Hamming:

(7.20)

4. Blackman:

(7.21)

Example 7.3.1: Find the DTFT of the discrete functionusing N = 21 and compare that spectrum with the spectrum using theHamming window instead of the rectangular one.

Solution: Figure 7.3.2a shows the spectrum for the rectangular window,and Figure 7.3.2b shows the spectrum using the Hamming window. For bothcases we used N = 21. Figure 7.3.2c is the exact spectrum.

w nn

Nn N( ) cos= <1

21

21

0

w n

nN

nN

nN

Nn N

( ) =

<

21

01

2

22

11

2

w nn

Nn N( ) . . cos= <0 54 0 46

21

0

w nn

Nn

N( ) . . cos . cos= +0 4 0 5

21

0 084

1<0 n N

f n u nn( ) . ( )= 0 95

Page 284: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 7: Discrete-time transforms 267

Book MATLAB m-file: ex7_3_1

%ex7_3_1 is an m file that illustrates Ex 7.3.1

N=21;

n=0:N-1;

w=0:.01:pi;

wh=0.54-0.46*cos(2*pi*n'/(N-1));%Nx1 vector;

f1=abs((0.95.^n')'*exp(-j*n'*w));

f1s=sum(f1,1);%sums the columns of the Nxlength(w) matrix f1;

f2h=abs((0.95.^n'.*wh)'*exp(-j*n'*w));

f2hs=sum(f2h,1);

subplot(1,3,1);plot(w,f1s,'k');xlabel('\omega');ylabel...('magnitude')

subplot(1,3,2);plot(w,f2hs,'k');xlabel('\omega');ylabel...('magnitude')

fwe=abs(1./(1-0.95*exp(-j*w)));

subplot(1,3,3);plot(w,fwe,'k');xlabel('\omega');ylabel...('magnitude')

Figure 7.3.2 The effect of windowing on the DTFT spectrum.

20

18

16

14

12

10

8

6

4

2

00 2 4

ω

Mag

nit

ud

e

Mag

nit

ud

e

(c)

7

6

5

00 2 4

ω(b)

4

3

2

1

Mag

nit

ud

e

14

12

10

00 2 4

ω(a)

8

6

4

2

Page 285: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

268 Signals and systems primer with MATLAB

7.4 Frequency response of linear time-invariant (LTI) discrete systems

In Chapter 3 we studied the discrete systems, which are described by dif-ference equations. The general difference equation for the first-order systemis given by

(7.22)

We assume that the DTFT of y(n), x(n) and the system impulse response h(n)all exist. Taking the DTFT of both sides of the above equation, we obtain

(7.23)

from which we write the system function

(7.24)

If we set in the above equation, we find that , whichindicates that the transfer function is periodic with period 2 (Ts = 1).

Example 7.4.1: Determine the system function of the system specified by

(7.25)

Solution: Comparing (7.25) to (7.22), we observe that the constantsare Hence, (7.24) gives the following transferfunction:

(7.26)

We know that the DTFT of is

Therefore, the impulse response of the system is

(7.27)�

y n b x n b x n a y n( ) ( ) ( ) ( )= +0 1 11 1

Y e b X e b e X e a e Y ej j j j j j( ) ( ) ( ) ( )= +0 1 1

H eY eX e

b b ea e

be

jj

j

j

j

j

( )( )( )

= = ++

=0 1

10

1

++

+ =

bb

e ab

z zz pj

z ej

1

0

10

1

1

+ 2 H e H ej j( ) ( )( )+ =2

y n y n x n( ) . ( ) ( )=0 5 1

a b b1 0 10 5 1 0= = =. , ., and

H ee

ee

jj

j

j( )

. .= =1

1 0 5 0 5

0 5. ( )n u n

0 51

1 0 50

..

( )n j n

nj

jee

H e=

= =

h n u nn( ) . ( )= 0 5

Page 286: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 7: Discrete-time transforms 269

7.5 The discrete Fourier transform (DFT)We have shown in Chapter 6 that if a time function is sampled uniformlyin time, its Fourier spectrum is a periodic function. Therefore, correspondingto any sampled function in the frequency domain, a periodic function existsin the time domain. As a result, the sampled signal values can be related inboth domains.

As a practical matter, we are only able to manipulate a certain length ofsignal. That is, suppose that the data sequence is available only within afinite time window from n = 0 to n = N – 1. The transform is discretized forN values by taking samples at the frequencies 2 /NTs, where Ts is the timeinterval between sample points in the time domain. Hence, we define thediscrete Fourier transform (DFT) of a sequence of N samples {f(nTs)} by therelation

(7.28)

where

The inverse DFT (IDFT) is related to DFT in much the same way thatthe Fourier transform is related to its inverse Fourier transform. The IDFTis given by

(7.29)

F k F e f nT T f nT ebjk

D s s s

n

N

b( ) ( ) { ( )} ( )� = ==

F0

1

=

j T kn

bs

b s

NTn N

20 1;

N

Ts

=

=

number of samples (even number)

samplingg time interval

signal length in ti( 1)N Ts = mme domain

the frequency samplibs

sN NT= = =2

nng interval (frequency bin)

Nth prie j Tb s = nncipal root of unity

f nT F kNT

F k es D bs

bj T nk

k

N

b s( ) { ( )} ( )� F=

=1

0

111

20 1=b

sNTk N;

Page 287: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

270 Signals and systems primer with MATLAB

Proof: We write

However, using the finite number geometric series formula, we obtain (seeProblem 7.5.1)

and hence the right side of the above equation becomes equal to f(nTs), as itshould. Therefore, (7.29) and (7.28) constitute a pair of the DFT.

Note: The sequences in time domain and in frequency domain are periodic withperiod N (see Problem 7.5.2). This indicates that when we take N terms from a timesequence and use the DFT, we automatically create a periotic time function and thecorresponding periodic frequency function.

Note: In DFT both the time domain and the frequency domain are discretesequences.

In general, is complex function and can be written in the form

(7.30)

where are discrete frequency functions. The plots of thesefunctions vs. are referred to as the amplitude and phase spectrums,respectively, of the signal f(nTs).

Example 7.5.1: Find the DFT of the function for N = 4.

Solution: Since the sampling time is unity, (7.28) becomes

1 1

0

1

NTF k e

NTT f mT e

sb

j T nk

k

N

ss s

jb s b( ) ( )=

= TT mk

m

N

k

Nj T nk

s

s b se

Nf mT

==

=

0

1

0

1

1( )) ( )

m

Nj T m n k

k

N

e b s

= =0

1

0

1

eN m n

m n

j T m n k

k

N

b s

=

==

( )

0

1

0

F ejk b( )

F e F e ejk jk j kb b b( ) ( ) ( )=

F e kjkb

b( ) ) and (k b

f n u nn( ) . ( )= 0 9

F en j n

n

024

0 9 1 0 924

0

0

4 1

= = +=

. . ++ + =0 9 0 9 3 43902 3. . .

Page 288: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 7: Discrete-time transforms 271

Note: The magnitude of the spectrum for k = 3 and k = 1 are the same. Thefrequency /Ts = /1 is known as the fold-over frequency.

The amplitude spectrum is 3.4390, 0.2556, 0.1810, 0.2556 for k = 0, 1, 2,and 3, respectively. The phase spectrum is 0.0000, –0.7328, 0, and 0.7328 fork = 0, 1, 2, and 3, respectively. The phase spectrum is given in radians. Sincethe frequency bin is b = 2 /NTs = 2 /4 × 1 = /2, the amplitude and frequencyspectrums are located at 0, /2, (fold-over frequency), and 3 /2 rad/unitlength. �

7.6 Summary of the DFT propertiesBelow we give a summary of the DFT properties. Their proof is given inAppendix 7.2. It is convenient to abbreviate the notation of (7.28) and (7.29)by writing

(7.31)

Using this notation, the DFT pair takes the form

(7.32)

F en j n

n

124

0 9 1 0 924

1

0

4 1

= = +=

. . ee e ej j j× × ×

+ +

=

24

1 1 224

1 2 324

1 30 9 0 9

0 19

. .

. 000 0 1710

224

0 924

2=

=

.

.

j

F en j n

n 00

4 1 24

2 1 224

2 2 31 0 9 0 9 0 9× ×

= + + +. . .e e ej j j

224

2 3

0 1810 0 0000

324

0 9

×

=

=

. .

.

j

F nn j n

n

j je e e

=

×= + +

24

3

0

4 1 24

3 1 2241 0 9 0 9. .

33 2 324

3 30 9

0 1900 0 1710

× ×+

= +

.

. .

e

j

j

F k F k f nT f n e Wbj N( ) ( ); ( ) ( ); /= = =2

F k f n W f n e knk

n

Nj nk N

n

N

( ) ( ) ( ) /= = == =0

12

0

1

0,, , , ,

( ) ( ) ( )

1 2 1

1 1

0

12

� N

f nN

F k WN

F k enk

k

Nj= =

=

nk N

k

N

n N/ , , , ,=

=0

1

0 1 2 1�

Page 289: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

272 Signals and systems primer with MATLAB

Linearity

Symmetry

Time shifting

Frequency shifting

Time convolution

Frequency convolution

Parseval’s theorem

Time reversal

Delta function

Central ordinate

Example 7.6.1: Shifting property. Deduce the DFT of the two sequencesshown in Figure 7.6.1. Observe that h(n) is a shifted function of f(n).

Solution: From (7.28) we obtain, respectively,

Figure 7.6.1 Illustration of Example 7.6.1.

af n bh n aF k bH kDF( ) ( ) ( ) ( )+ +F

1N

F n f kDF( ) ( )F

f n i F k e F k WDF j ki N ki( ) ( ) ( )/ =F 2

f n e F k ijni DF( ) ( )F

y n f n h n F k H kDF( ) ( ) ( ) ( ) ( )� F

f n h nN

F x H n xDF

x

N

( ) ( ) ( ) ( )F

=

1

0

1

f nN

F kn

N

k

N

( ) ( )2

0

12

0

11=

= =

f n F kDF( ) ( )F

( )n DFF 1

fN

F k F f nk

N

n

N

( ) ( ); ( ) ( )01

00

1

0

1

= == =

F k f n e H kj kn

n

24

24

2 4

0

4 1

==

( ) ;/ ==

f n e j kn

n

( ) /2 4

3

6

1

3

4

2

3 n 3 6 n

f(n) h(n)

4

Page 290: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 7: Discrete-time transforms 273

The specific expansions are

We can proceed the same way to find the rest of the values. However,we can use the following Book MATLAB m-file to find the values easily.

Book MATLAB m-files: ex7_6_1, ex7_6_1b

%ex7_6_1 is an m-file to find the values of the summations

N=4;

n=0:N-1;

fn=[1 2 3 4];

k=0:N-1;

F=exp(-j*k'*n*2*pi/N)*fn';

subplot(2,1,1);stem(k,abs(F));subplot(2,1,2);stem(k,angle(F));

%after you call the m-file, type F and return and you will

%be presented with the values of the DFT

The values of F are:

10.000–2.0000 + 2.0000i–2.0000 – 0.0000i–2.0000 – 2.0000i

If we call the m-file ex7_6_1b, we obtain the DFT of the shifted functionh(n). The values are:

F 02

12

0 0 22

0 1= × + × +cos cos 332

0 2 42

0 3

12

0

cos cos

sin

× + ×

j ×× + × + × +0 22

0 1 32

0 2 4sin sin ssin

cos

20 3

10 0

12

1

×

=

=

j

F22

1 0 22

1 1 32

1 2× + × + ×cos cos ++ ×

× +

42

1 3

12

1 0 22

cos

sin sinj 11 1 32

1 2 42

1 3× + × + ×sin sin

= +2 2j

Page 291: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

274 Signals and systems primer with MATLAB

10.0000–2.0000 – 2.0000i2.0000 + 0.0000i

–2.0000 + 2.0000i

Observe that the magnitude of the spectrum stays the same, but thephases have changed. This is the practical verification of the shifting property.

Example 7.6.2: Time convolution. Consider the two periodic sequences. Verify the time convolution property by

showing that for Ts = 1,

Solution: We first find the summation

Next, we obtain the DFT of the sequences f(n) and h(n), which are

Similarly, we obtain

f n h n( ) { , , } ( ) { , , }= =1 1 4 0 1 3and

y f x h x F k H kN

Fx

N

DF( ) ( ) ( ) { ( ) ( )} (2 21

0

11= = =

=

F kk H k ej k N

k

N

) ( ) /2 2

0

1

=

f x h x f h f h f hx

( ) ( ) ( ) ( ) ( ) ( ) ( ) ( )2 0 2 1 1 2 00

2

= + + ==

11 3 1 1 4 0 2× + + × =( )

F f n e f f fj n

n

( ) ( ) ( ) ( ) ( )/0 0 1 2 1 12 0 3

0

2

= = + + = +=

44 4

1 1 42 1 3

0

22 1 1 3

=

= = +=

×F f n e e ej n

n

j( ) ( ) / / ×

=

×= =

j

j n

n

jF f n e e

2 1 2 3

2 2 3

0

22 22 1

/

/( ) ( ) 11 3 2 2 2 34/ /+ ×e j

H h n e h h hj n

n

( ) ( ) ( ) ( ) ( )/0 0 1 2 0 12 0 3

0

2

= = + + = + +=

33 4

1 0 32 1 3

0

22 1 1 3

=

= = + +=

×H h n e e ej n

n

j( ) ( ) / / ×

=

×= = +

j

j n

n

jH h n e e

2 1 2 3

2 2 3

0

22 22 0

/

/( ) ( ) 11 3 2 2 2 33/ /+ ×e j

Page 292: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 7: Discrete-time transforms 275

The second summation given above becomes

For convenience, the reader can use MATLAB directly. �

Note: To obtain the circular convolution of two sequences f(n) and h(n) wefollow the following steps:

1. Calculate the DFT of these sequences to obtain F(k) and H(k).2. Multiply element by element these DFTs to obtain G(k) = F(k)H(k).3. Calculate the IDFT of G(k).

The result is the circular convolution, and for the two given in the example above,g(n) = {1 13 2}.

Note: To obtain the linear convolution of f(n) with N elements and h(n) withM elements, we add zeros at the end of each sequence such that its total length isQ = N + M – 1.

Example 7.6.3: Frequency convolution. Use the values of F(k) and H(k)of Example 7.6.1 to verify the frequency convolution property.

Solution: Figure 7.6.2 shows the circular convolution of F(k) and H(k),with the values obtained from Example 7.6.2. From the frequency convolu-tion property we obtain the periodic sequence

or

Thus, from the results of Figure 7.6.2, we obtain

13

13

0 0 1 10

22 2 3F k H k e F H F H

k

jk( ) ( ) [ ( ) ( ) ( ) (/

=

= + )) ( ) ( ) ]

. .

/ /e F H e

j

j j4 3 8 32 2

2 0000 0 0000

+

=

y n Y kN

F i H k iDF DF

i

N

( ) { ( )} ( ) ( )= ==

F F1 1

0

11

{ ( )} { ( ) ( )} { , , }y n f n h n= = 0 1 12

y Y k Y k eDFjk

k

N

( ) { ( )} ( ) ( / )013

13

1 2 3 0

0

1

= =

=

=

F

111112

112

133

213

32

0+ =j j

Page 293: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

276 Signals and systems primer with MATLAB

From Figure 7.6.2 we obtain

The results obtained verify the frequency convolution property. �

Figure 7.6.2 Circular convolution in the frequency domain.

1 5 32 3

2 2F(1) − − + j

1 5 32 2

F(2) − − − j

3H(2) − −2 − j

2 33

H(1) − −2 + j

H(0) − 4 F(0) − 4

(a)

y Y k jDF( ) { ( )} cos113

11112

133

221= = + +F33

23

112

133

243

+

+

j

j

sin

cos ++ =

= =

j

y Y kDF

sin

( ) { ( )}

43

1

213

111F ++ + +

+

112

133

243

43

j jcos sin

+ =112

133

283

83

1j jcos sin 22

YF H F H F H

Y

( )[ ( ) ( ) ( ) ( ) ( ) ( )]

,

( )

00 0 1 2 2 1

311

1

= + + =

= [[ ( ) ( ) ( ) ( ) ( ) ( )]

(

F H F H F Hj

Y

0 1 1 0 2 23

112

133

2+ + = +

220 2 1 1 2 0

3112

133

)[ ( ) ( ) ( ) ( ) ( ) ( )]= + + =F H F H F H

j22

Page 294: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 7: Discrete-time transforms 277

Example 7.6.4: Parseval’s theorem. Verify Parseval’s theorem using thesequence f(n) = {1, –1, 4}.

Solution: We have directly that

.

Figure 7.6.2 (continued).

1 5 32 2

F(1) − − + j

1 5 32 2

F(2) − − − j

2 33

H(1) − −2 + j

2 33

H(2) − −2 − j

H(0) − 4

F(0) − 4

(b)

1 5 32 2

F(1) − − + j

1 5 32 2

F(2) − − − j

2 33

H(1) − −2 + j

2 33

H(2) − −2 − j

H(0) − 4

F(0) − 4

(c)

f nn

2

0

3 1

1 1 16 18( ) = + + ==

Page 295: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

278 Signals and systems primer with MATLAB

The values of F(k) for this sequence are given in Example 7.6.2, so that

The above examples elucidate some of the DFT properties. The followingtwo examples will clarify the similarities and differences between the DFTof continuous functions and their Fourier transform.

Example 7.6.5: Deduce the DFT of the function shown in Figure 7.6.3adiscretized with Ts = 1 and Ts = 0.5.

Figure 7.6.3 Illustration of Example 7.6.5.

13

13

16 0 5 5 0 8660 0 5 52

0

22

F k j jk

( ) [ . . .=

= + + × + × 00 8660

13

16 19 19 18

2.

[ ]= + + =

2 4 t

2

f(t)

(a)

Mag

nit

ud

e

4

3.5

3

2.5

2

1.5

1

0.5

0 0 2 4 6 8 10 12 14

rad/s

Ts − 0.5

Ts − 1

Continuous case

(b)

Page 296: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 7: Discrete-time transforms 279

Solution: This signal is a shifted triangle by 2 s. The centered signal isequal to the convolution of two pulses of total width 2 s each: f (t) = p(t) p(t). From the time convolution property, the FT of f(t) is equal to F( ) =P( )P( ). But the FT of a pulse is equal to

.

Hence, the FT of the symmetric signal is

.

Taking into consideration the time-shifting property, the FT of the shiftedsignal is given by

.

For the case of Ts = 1 we have the following discrete signal: f (nTs) ={0 1 2 1 0} for times t = {0 1 2 3 4} s, respectively. Let us further defineNTs = 16. Since we set Ts = 1 and NTs = 16, we find that N = 16. This valuespecifies the bins in the frequency domain that are located at every b =2 /NTs = 2 /16 = /8 rad/s. For the case of Ts = 0.5 s and NTs = 16 we obtainN = 32. However, because NTs = 16, the bins at the frequency domain arelocated every /8. But since in this case N = 32, the fold-over frequency (theuseful frequency extent) is at ( /8)32 = 4 rad/s. This can be compared withthe first case, whose fold-over frequency is ( /8)16 = 2 . Comparing the tworesults, we observe that by decreasing the sampling time by 2 we expandthe fold-over frequency (the useful frequency) by 2. The spectrums can befound following Example 7.5.1. Here we use MATLAB for convenience.

Book MATLAB m-file: ex7_6_5

%ex7_6_5 is an m-file for the Ex 7.6.5

N1=16;

T1=1;

T2=0.5;

f1=[0 1 2 1 0 zeros(1,27)];

f2=[0 0.5 1 1.5 2 1.5 1 0.5 0 zeros(1,23)];

fd1=fft(f1);

wb1=0:2*pi/(N1*T1):4*pi-2*pi/(N1*T1);

fd2=T2*fft(f2);%the fft must be multiplied by sampling time;

P( )sin= 2

F( )sin= 4 2

2

F e j( )sin= 2

2

2

4

Page 297: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

280 Signals and systems primer with MATLAB

ftf=4*(sin(wb1).^2./(wb1+eps).^2);

plot(wb1,abs(fd1),'ko');hold on; plot(wb1,abs(fd2),'ko');...

hold on;plot(wb1,abs(ftf),'ko');

The reader can change the plotting function by incorporating ‘kx’, for exam-ple, instead of ‘ko’.

Note: We observe that by decreasing the time sampling we succeed in extend-ing the useful frequency range (the fold-over frequency), and within that range theapproximation becomes better. �

Example 7.6.6: Deduce the DFT transform of the function

for the following three cases

a.b.c.

Solution: We readily find the magnitude of the FT of the continuous-timefunction to be

Cases a and b: Setting Ts = 1 and NTs = 16 we find that N = 16. Thefrequency bins are apart by

rad/s.

The fold-over frequency is at

rad/s.

Figure 7.6.4a shows the absolute value of the difference (error) of theirmagnitude between the continuous and DFT case at the same points of thefrequency axis. For this case, the distance is /8. The discrete-time function

f tt

( ) =2 0 6

0 otherwise

T NTs s= =1 0 16. ,T NTs s= =1 0 32. ,T NTs s= =0 2 16. ,

F( )sin= 4 3

bsNT

= = =2 216 8

8 2 88× = =N

Page 298: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 7: Discrete-time transforms 281

is f(n) = [2 2 2 2 2 2 zeros(1, 10)]. Below are nine magnitude values of theDFT spectrum for case a:

12.0000 9.4713 3.6955 1.3776 2.8284 0.9205 1.5307 1.8840 0

In case b we set Ts = 1 and NTs = 32 to obtain N = 32 and the frequency bin

rad/s.

The fold-over frequency is

,

Figure 7.6.4 Illustration of Example 7.6.6.

5

00 1 2 3 4 5 6

0 1 2 3 54 6 7

10

ω rad/s

ω rad/s

−rr

or

−rr

or

15

10

5

0

(a)

(b)

0 2 4 6 8 1210 14 16

ω rad/s

−rr

or

0.2

0.15

0.1

0

0.05

(c)

bsNT

= = =2 232 16

16 2 1616× = =N

Page 299: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

282 Signals and systems primer with MATLAB

which is identical to that of case a above. The discrete-time function for thiscase is f(n) = [2 2 2 2 2 2 zeros(1, 26)]. Note that in case a we added 10zeros and for case b we added 26 zeros so that the numbers N in the twocases have the correct value. Although the fold-over frequency is the same,the number of frequency bins is twice as many as in case a. Comparing thenine above frequency values with the nine numbers below for case b

12.0000 11.3362 9.4713 6.7574 3.6955 0.8277 1.3776 2.6213 2.8284

we observe that new values appeared in the second case between every /8distance. We note that at /8 frequency bins the values of the spectrum forboth cases are the same.

Note: By adding zeros to a discrete sequence, the accuracy of the spectrum doesnot increase. However, within any range, the number of points increases and givesus a better overall view of the spectrum.

Figure 7.6.4b depicts the error between the discrete case b and the exactspectrum.

Case c: For this case we set Ts = 0.2 and NTs = 16. Hence, the number ofelements of the sequence is N = 16/0.2 = 80. The frequency bin is

.

The fold-over frequency is

rad/s,

which is five times the fold-over frequency of cases a and b.

Note: By decreasing the sampling frequency, we extend the useful frequency(fold-over) to a larger range.

The discrete-time function created from the continuous signal is f(n0.2) =[2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 zeros(1,50)]. The first nine elements of DFT magnitude are

12.0000 9.4130 3.6050 1.3023 2.5570 0.7846 1.2116 1.3614 0.0000

The exact first nine frequency values for the continuous case are

12.0000 9.4106 3.6013 1.2993 2.5465 0.7796 1.2004 1.3444 0.0000

b = =216 8

bN2 8

40 5= =

Page 300: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 7: Discrete-time transforms 283

If we compare case c with case a, we observe that case c results are moreaccurate (they are closer to the continuous case). If we compare case c withcase a for the frequency 3( /8) rad/s, we obtain 0.0030 for case c and 0.0783for case a. Figure 7.6.4c shows the error between the DFT for case c and theexact values.

Note: By decreasing the sampling time, the discrete signal spectrum approxi-mates better the exact spectrum of the continuous signal up to the folding frequency.The approximation increases as the time sampling decreases further. �

Because the DFT uses a finite number of samples, we must be concernedabout the effect that truncation has on the Fourier spectrum. Specifically, ifthe signal f(t) extends beyond the total sampling (N – 1)Ts time, the resultingfrequency spectrum is an approximation of the exact one. If, for example,we take the DFT of a truncated sinusoidal signal, we find that an error ispresent in the Fourier spectrum. If N is small and the sampling covers neithera large number of periods nor an integral number of cycles of the signal, alarge error may occur, known as the leakage problem. Since the truncatedsignal is equal to , its Fourier spectrum is the convolution of the exactspectrum with the spectrum of the window. Since the truncation preassumesa rectangular window, its spectrum consists of a main lobe and side lobes.The side lobes affect the spectra and sometimes completely hide weak spec-tra lines. Since the magnitudes of the side lobes do not decrease with N, itis recommended to use other type of windows that may remedy the problem.However, the main lobe for other windows is wider, and we must justifyany effect that it may introduce.

Example 7.6.7: Find the DFT of the exponential function thatis truncated at times t = 0.8 s and t = 1.6 s. Assume the sampling time Ts =0.02 for both cases.

Solution: The results are shown in Figure 7.6.5. The discrete spectrumwas plotted in the continuous format to produce a better visual picture ofthe differences. The following Book m-file produces the results shown in thefigure.

Book MATLAB m-file: ex7_6_7

%ex7_6_7 is an m file for the Ex7.6.7

t=0:0.02:0.8-.02;

f=[exp(-t) zeros(1,40)];

t1=0:0.02:1.6-0.02;

f1=exp(-t1);

df=0.02*fft(f);

df1=0.02*fft(f1);

f t p ta( ) ( )

f t e u tt( ) ( )=

Page 301: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

284 Signals and systems primer with MATLAB

w=0:2*pi/(80*0.02):100*pi-(2*pi/(80*0.02));

fcw=1./(1+w);

plot(w(1,1:20),fcw(1,1:20),'k');

hold on;plot(w(1,1:20),abs(df1(1,1:20)),'k');

hold on;plot(w(1,1:20),abs(df(1,1:20)),'k'); �

*7.7 Multirate digital signal processingThere are many applications where the signal of a given sampling rate mustbe converted into an equivalent signal with a different sampling rate. Inother words, we sample digital signals. The sampling can be achieved byusing the down sampler (decimation), a device (or process) that createsanother discrete signal from the original by skipping a specific number ofelements, and by using the up sampler (interpolation), a device (or process)that pads with a specific number of zeros in all the spaces between theoriginal discrete-time signal.

Down sampling (or decimation)

The down-sampling operation by an integer on a discrete-time signalx(n) consists of keeping every Dth sample of x(n) and removing D – 1in-between samples. Hence, the output of such an operation is (see alsoFigure 7.7.1)

Figure 7.6.5 The time truncation effect.

−xact

T − 1.6

T − 0.8

Mag

nit

ud

e

1

0.9

0.8

0.7

0.6

0.5

0.4

0.3

0.2

0.1

00 10 20 30 40 50 60 70 80

ω rad/s

D > 1

Page 302: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 7: Discrete-time transforms 285

(7.33)

Since the initial sampling time of x(t) was assumed to be Ts = 1 producingx(n), the sampling time of x(nD) is TsD = D. This indicates that the initialsampling rate for x(n) changes towhich is (1/D)th of that of x(n). By decreasing the sampling frequency, weproduce a periodic frequency spectrum whose period is . Downsampling produces aliasing. Figure 7.7.2 illustrates the effect of down sam-pling in the time domain, and Figure 7.7.1 represents the down-samplingoperation in block diagram form.

Book MATLAB function for down sampling

function[y,n1]=ssdownsampling(x,D)

%x=input sequence to be downsampled assuming

%that Ts=1;

%D=down-sampling factor;

Figure 7.7.1 Block diagram representation of down sampling.

Figure 7.7.2 Illustration of down-sampling process.

Dx(n) y(n) − x(nD)

y(n) − x(nDTs)

ωs − 2π ωsd − 2π /D

ωsd − 2π /DTs

fs − 1 fsd − 1/D − fs /D

fsd − 1/DTs − fs /D

ωs − 2π /Ts

fs − 1/Ts

Dx(nTs)

201816141210864200

0.5

1

Time index n

x(n

)− y

(n)

− x

(nD

), D

− 3

D − 3y(n)

x(n)

y n x nD( ) ( )=

s sT= =2 2/ sd sDT D= =2 2/ / ,

sd s<

Page 303: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

286 Signals and systems primer with MATLAB

n1=0:floor(length(x)/D)-1;

%floor(x) rounds the elements of x to the

%nearest integers towards minus infinity;

%if desired, n1 can be used as the x-axis

%to plot y from the origin;

y=x(1,1:D:D*floor(length(x)/D));

Example 7.7.1: Consider the system shown in Figure 7.7.3. Thesequences that appear in the system are given below.

The sampling rate conversion can also be understood from the point ofview of digital resampling of the same analog signal. If the analog signalx(t) is sampled at the rate 1/Ts to generate x(n), the analog signal must besampled at the rate 1/(DTs) to generate y(n).

Frequency domain of down-sampled signals

It is instructive to develop the spectrums of the input and output sequencesof a down sampler. The spectrum of the output signal can be found afterbeing transformed in the DTFT domain. Hence, we write

(7.34)

Figure 7.7.3 A multirate system.

n: 0 1 2 3 4 5 6

x(n) x(0) x(1) x(2) x(3) x(4) x(5) x(6)y1(n) x(–1) x(0) x(1) x(2) x(3) x(4) x(5)y3(n) x(1) x(2) x(3) x(4) x(5) x(6) x(7)y2(n) x(–1) x(1) x(3) x(5) x(7) x(9) x(11)y4(n) x(1) x(4) x(7) x(10) x(13) x(16) x(19)y(n) x(–1) – x(1) x(1) – x(4) x(3) – x(7) x(5) – x(10) x(7) – x(13) x(9) – x(16) x(11) – x(19)

z–1

z1

D − 2

D − 3

+x(n)

y1(n) y2(n)

y3(n) y4(n) −

y(n)

y e y n e x nD e nj j n

n

j n

n

( ) ( ) ( )= = <= =

<<

Page 304: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 7: Discrete-time transforms 287

If we set nD = k, then n = k/D and (7.34) becomes (n is an integer)

(7.35)

The above equation suggests that we must take the DTFT of the values ofx(n) at every D numbers apart so that k/D is an integer. Since only every Dvalues of x(n) are used (7.35) is not in the form of the definition of DTFT.Therefore, we must write (7.35) in the form

(7.36)

(7.37)

And thus the DTFT applies. The function x(n) is a discrete periodic function,a comb function with impulses every D apart and zero otherwise; it can berepresented by the relation (see Problem 7.7.1)

(7.38)

which is known as the discrete sampling function. Note that (7.38) is the IDFtransform. Introducing (7.38) in (7.36) we obtain

(7.39)

which indicates that the spectrum of the down-sampled signal is the sum ofthe D uniformly shifted and stretched version of the spectrum andscaled down by D. Graphically (see Figure 7.7.4) the above formula is inter-preted as follows: (a) stretch by D to obtain , (b) create D – 1copies of this stretched version by shifting it uniformly in successive amountsof 2 , and (c) add all these shifted versions to and divide by D.

Y e x k e k D Dj j k D

k

( ) ( ) , , ,/= = ± ±=

0 2 �

Y e c n x n e nj j n D

n

( ) ( ) ( ) , , ,/= = ± ±=

0 1 2 �

c nn D D

( ), , ,

== ± ±1 0 2

0

otherwise

c nD

eD

W W ej kn D

k

Dkn

k

Dj( ) /= = =

= =

1 12

0

1

0

12 //D

Y eD

W x n eD

W ej kn j n D

nk

Dk( ) ( ) /= =

==

1 1

0

1jj D

n

nk

D

k j D

k

D

x n

DX W e

/

/

( )( )

= ( )==

=

0

1

0

1

=

=1 2

0

11D

X ej

kD

k

D

X ej( )

X ej( ) X ej D( )/

X ej D( )/

Page 305: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

288 Signals and systems primer with MATLAB

Let the spectrum of the sequence {x(n)} be that shown at the top of Figure7.7.4. Let us further set D = 2. Then (7.39) becomes

(7.40)

Because there is a multiplication by 1/D = 0.5 < 1 of , the implication isthat the function is stretched by a factor of 2. Figure 7.7.4 shows thespectrum of a digital signal and the nonaliased spectrum at the output of adecimator with D = 2. By judiciously assuming the Nyquist frequency of{x(n)} to be and D = 2, we avoided the aliasing phenomenon. If,however, the Nyquist frequency was in the range a decimatorwith D = 2 would produce aliasing at its output, as shown in Figure 7.7.5.In general, aliasing is avoided if the Nyquist frequency of {x(n)} is less than

/D.

Example 7.7.2: Figure 7.7.6a shows the frequency response of a discretesignal. Figure 7.7.6b shows the frequency response when the correspondingtime signal is down sampled by a factor of 2. Figure 7.7.6c shows the fre-quency response when the time signal is down sampled by a factor of 4, andfinally, Figure 7.7.6d shows the spectrum when the time signal is down

Figure 7.7.4 Frequency spectra of a down-sampled signal without aliasing.

… …

2−

22π 3π 4π

2π 3π 4π 5π

0

X(e jω)

2π 3π

0

… …X(e jω/2)

2Y(e jω)

X(e j(ω – 2π )/2)

0

… …

ω

ω

ω

ω

π

−π π

−π π

4π 5π2π 3π0−π π

π π

Y e X e X e e X ej j j j j( ) [ ( ) ( )] [ (/ / /= + =12

12

2 2 2 )) ( )]( )/+ X ej 2 2

X ej( )

N = /2/2 < < ,

Page 306: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 7: Discrete-time transforms 289

sampled by a factor of 6. Observe the distortion of the spectrum in d due toaliasing. Observe, also, that the magnitudes in b and c are 1/2 and 1/4 ofthe original spectrum, which verifies (7.39). The following program producesFigure 7.7.6.

Book MATLAB m-file: ex7_7_2

%ex7_7_2 is an m file for the EX 7.7.2

f=[0 1/8 1/4 1/2 3/4 1];%normalized frequency bins;

m=[1 1 0 0 0 0];%magnitude spectrum corresponding

%to the above frequency bins;

h=fir2(200,f,m);%based on the frequency magnitude m it returns

%the time function (filter coefficients);

[Hz,w]=freqz(h,1,512);%evaluation of the spectrum;

subplot(2,2,1);plot(w/pi,abs(Hz));grid on;

xlabel('Normalized frequency');ylabel('Magnitude');

title('Input spectrum');

D=2;y=h(1,1:D:length(h));

[Yz,w]=freqz(y,1,512);subplot(2,2,2);plot(w/pi,abs(Yz));grid on;

Figure 7.7.5 Frequency spectra of a down-sampled signal with aliasing, D = 2.

… …

2− 2π 3π 4π

2π − πD 4π − π 2D

X(e jω)

–2π π 4π–3π

… …

… …

X(e jω/2)

2Y(e jω)

X(e j(ω – 2π )/2)

… …

ω

ω

ω

ω

ππ

−π

4π2π−π π

Page 307: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

290 Signals and systems primer with MATLAB

xlabel('Normalized frequency');ylabel('Magnitude');

title('Output spectrum with D=2');

D1=4;y1=h(1,1:D1:length(h));

[Y1z,w]=freqz(y1,1,512);subplot(2,2,3);plot(w/pi,abs(Y1z));grid on;

xlabel('Normalized frequency');ylabel('Magnitude');

title('Output spectrum with D=4');

D2=6;y2=h(1,1:D2:length(h));

[Y2z,w]=freqz(y2,1,512);subplot(2,2,4);plot(w/pi,abs(Y2z));grid on;

xlabel('Normalized frequency');ylabel('Magnitude');

title('Output spectrum with D=6'); �

Note: To avoid aliasing, we must first reduce the bandwidth of the signal by/D and then down sample it by a factor D.

Figure 7.7.7 shows graphically the relationship among the sampled formof x(t) (Ts = 1), the function c(n), and the output function y(n) of the decimation

Figure 7.7.6 Input to and outputs from a down sampler.

Input spectrumM

agn

itu

de

1.5

0.5

00 0.5 1

1

Normalized frequency

− utput spectrum with D − 4

− utput spectrum with D − 2

Mag

nit

ud

e

0.8

0.2

0.4

00 0.5 1

0.6

Mag

nit

ud

e

0.4

0.1

0.2

00 0.5 1

0.3

Normalized frequency

Normalized frequency

− utput spectrum with D − 6

Mag

nit

ud

e0.18

0.12

0.14

0.10 0.5 1

0.16

Normalized frequency

(a) (b)

(c) (d)

Page 308: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 7: Discrete-time transforms 291

process with factor D = 2. Note how the different functions shown areregistered in the time domain.

Let us assume that we have a signal x(t) with ± 200 rad/s bandwidth.If we sample the signal at Ts = 0.001 seconds, the sampled function willoccupy the frequency range ± 200 × 0.001 = ± 0.2 rad. This indicates thatwe can down sample up to D = 5 without aliasing. We can also see that halfof the sampling frequency is rad/s, and hence the signal bandwidthcan be widened up to five times.

Interpolation (up sampling) by a factor U

Interpolation or up sampling is the process of increasing the sampling rateof a signal by an integer factor U > 1, which results in adding U – 1 zerosamples between two consecutive samples of the input sequence {x(n)}.Figure 7.7.8 shows the block diagram representation of an up-samplingoperation (interpolation). Figure 7.7.9 shows the form of a discrete signalbefore and after the up sampler (interpolator) with U = 3. The followingBook MATLAB will produce the output of an up sampler:

Book MATLAB function

function[y]=ssupsampling(x,U)

%y=output of the up-sampler;U=up-sampling factor

%x=input to the up-sampler;

Figure 7.7.7 The decimation operation with a factor D = 2.

32100

5

10

4 5 6 7 8 9

x(n

) fu

nct

ion

32100

0.5

1

4 5 6 7 8 9

c(n

) fu

nct

ion

1.510.500

5

10

2 2.5 3 3.5 4Dec

imat

or

ou

tpu

t

Time index n

1000

Page 309: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

292 Signals and systems primer with MATLAB

y1=zeros(1,U*length(x));

y1(1,1:U:length(y1))=x;

y=y1(1,1:length(y1)-U+1);

Frequency domain characterization of up-sampled signals

The input and output relationship of the signals of an interpolator is

(7.41)

Figure 7.7.8 Block diagram representation of an up sampler.

Figure 7.7.9 The up-sampling (interpolation) operation.

Ux(n) y(n) � x(n/U)

y(n) � x(nTs/U)

fs � 1

fs � 1/Ts

fsu � U � fsU

f su � U/Ts � fsU

ωs � 2π

ωs � 2π /Ts

ω su � 2π U

ω su � 2π U/Ts

Ux(nTs)

Inp

ut

to i

nte

rpo

lato

r 6

4

2

00 1 2 3 4 5 6

�u

tpu

t to

in

terp

ola

tor 6

4

2

00 2 4 6 8 10 12 14 16 18

Time index n

y nx n U n U U

n U( )

( ) , , ,=

= ± ±/

multiple of

0 2

0

Page 310: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 7: Discrete-time transforms 293

Note: The sampling rate of y(n) is U times larger than that of the originalsequence {x(n)}.

The DTFT of (7.41) is given by

(7.42)

The above equation states that we take the DTFT of the input sequence tothe interpolator and then we substitute every with

Let the spectrum of {x(n)}, given by , be the one shown in Figure7.7.10a. The spectrum of the output of the interpolator is given by .If we set in , we find that the output is periodic fork = ± U, ± 2U, …. Furthermore, U > 1 implies that the -axis is compressedby a factor of U. By adding U – 1 zeros between the values of the inputsequence {x(n)}, we increase the sampling frequency, which results in a signalwhose spectrum is a U-fold periodic repetition of the input signalspectrum . This effect on the input spectrum is shown in Figure 7.7.10b.

Since only frequency components of this {x(n)} in the rangeare unique for the reproduction of the sequence {x(n)}, the images above =

/U should be eliminated using a low-pass filter with ideal characteristics

Figure 7.7.10 Spectra of x(n) and y(n) of an up sampler.

Y e y n e x n U e xj j n

n

j n

n

( ) ( ) ( ) (= = == =

/ mm e

x m e X e

j mU

m

j U m

n

j U

)

( )( ) ( )

=

=

= =

ej ej U .X ej( )

X ej U( )= + ( )2 k U/ Y ej( )

Y ej( )X ej( )

0 /U

……

X(e jω)

Y(e jω) … X(e jωU)

(a)

π

ππ

2π 3π

3π 5π

ω

ω

−π

……

U U U U−

(b)

Page 311: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

294 Signals and systems primer with MATLAB

(7.43)

where A is a scale factor to be used for the normalization of the outputsequence {y(n)}, which is U.

Example 7.7.3: Let the input spectrum to an interpolator with up-sampling factor U = 4 be that shown in Figure 7.7.11a. The Book MATLABm-file given below produces the spectrum shown in Figure 7.7.11b.

Book MATLAB m-file: ex7_7_3

%ex7_7_3 an m file for the EX7.7.3

freq=[0 0.2 0.3 0.4 1];%frequency range must run from 0 to 1;

mag=[1 1 0.5 0 0];

x=fir2(59,freq,mag);%given the magnitude vector of a spectrum

%and its corresponding frequency vector,

%fir2(N,freq,mag) produces N+1 filter

%coefficients (time function);

[xw,w]=freqz(x,1,512);%input frequency spectrum;

[y]=ssupsampling(x,6);

Figure 7.7.11 Input and output spectra of an interpolatior (up sampler) with factorU = 6.

Input spectrum to upsampler

Mag

nit

ud

e

1.5

0.5

00 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

1

…utput spectrum to the upsampler

Mag

nit

ud

e

1.5

0.5

00 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

1

Normalized frequency

H eA U

j( ) =0

0

/

otherwise

Page 312: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 7: Discrete-time transforms 295

[yw,w]=freqz(y,1,512);

subplot(2,1,1);plot(w/pi,abs(xw),'k');ylabel('Magnitude');

title('Input spectrum to upsampler');

subplot(2,1,2);plot(w/pi,abs(yw),'k');xlabel('Normalized... frequency');

ylabel('Magnitude');title('Output spectrum of the upsampler');�

Important definitions and concepts

1. Discrete-time Fourier transform (DTFT)2. Discrete frequency3. Sampling time4. Sampling frequency5. Amplitude and phase spectra of DTFT6. Properties of DTFT7. The DTFT is a continuous periodic function8. Effect on spectrum by truncating a sequence9. Windowing of sequences

10. Frequency response of LTI discrete systems11. The discrete Fourier transform (DFT)12. The DFT presupposes a periodic time sequence and its corresponding

discrete frequency sequence13. The /Ts ratio is known as the fold-over frequency, and it is the largest

frequency that is useful to compare the spectrum of the analog signalwith the spectrum of its sampled form

14. DFT properties15. Down sampling of discrete sequences16. Up sampling of discrete sequences17. Spectrums of the down-sampled and up-sampled discrete sequences

Chapter 7 ProblemsSection 7.1

1. Given the two sequences

sketch the corresponding for these sequences.

f nn

n

h n

n n

( ) ( )=

<

=13

0

0 0

13

nn

n <

0

0 0

F( )

Page 313: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

296 Signals and systems primer with MATLAB

2. Deduce the DTFT of the following functions for n 0:

a. e–n sinnb. e–2n cos3n

3. The frequency response of a system is shown in Figure P7.1.3. De-termine the impulse response of the system.

4. Deduce the transfer function and plot its magnitude if the followingdifference equation characterizes the system:

5. Prove the time multiplication property of DTFT, which is

Section 7.2

1. Write several terms to verify the relationship

2. The function is sampled at Ts = 1/4 s intervals. Writethe DFT of N = 16 and N = 32. Compare and discuss the results.

3. Show that and are periodic and determine their periods.4. Deduce the DFT of the function . Compare the

results with the Fourier transform of when 0 =m2 /NTs.

Figure P7.1.3

1

2π−π −

2π π ω

F(ω)

y n y n y n x n x n x n( ) ( ) . ( ) ( ) . ( ) . (+ = +1 0 5 2 0 8 1 0 1 2)

FDTj

j

jnf n edF ed e

{ ( )}( )

( )=

eN m k

m k

j m k n N

n

N

=

==

[ ( ) ]/2

0

1

0

f t t u t( ) cos ( )=

F k b( ) f nTs( )f nT n Ts s( ) cos( )= 0

f t t( ) cos( )= 0

Page 314: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 7: Discrete-time transforms 297

5. Deduce the DFT of the signals shown in Figure P7.2.5.

6. Deduce the DFT of the signals shown in Figure P7.2.6.

7. Using FFT, plot the DFT of for N =8, 16, 32, and 64, and explain your results.

8. If , find the DFT of f(n – 3) and compare yourresult with the DFT shifting property.

9. Find the IDFT of the spectrum F(k – 2), which is found in Problem7.2.8. Compare it with the DFT definition of signals.

10. Given two sequences, f(n) = {1 0 1 1} and h(n) = {1 1 0 1}, verifythe time convolution property by considering each side of the equation

11. Show that Parseval’s theorem holds for the discretized functionshown in Figure P7.2.11. Show also that the central ordinate propertyis true.

Figure P7.2.5

Figure P7.2.6

3

1

f(n)

0 n 41 n

h(n)

50

3

1

2

f(n)

n 0 6 n

h(n)

3

2

1

f n n n N( ) sin( . )= 0 1 0 1for

f n nn( ) .= 0 9 0 3

y n f m h n mN

F k H k em

j nk N

k

( ) ( ) ( ) ( ) ( ) ( )/= == =0

321

00

3

Page 315: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

298 Signals and systems primer with MATLAB

Appendix 7.1: Proofs of the DTFT propertiesLinearity

Proof:

Time shifting

Proof:

where we set n – m = k. Observe that k is a dummy variable.

Time reversal

Proof:

Time convolution

Proof:

Figure P7.2.11

1

10.50 t

f(t)

[ ( ) ( )] ( )af n bh n e a f n e bj n

n

j n

n

+ = += =

hh n e aF e bH ej n

n

j j( ) ( ) ( )=

= +

F e f n m e e f k eshj j n

n

j m j k

k

( ) ( ) ( )= == =

= e F ej m j( )

f n e f m e F ej n

n

j m

m

j( ) ( ) ( )( )= == =

f m h n m e f mm

j n

n n

( ) ( ) ( )=== ==

h n m e j n

m

( )

Page 316: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 7: Discrete-time transforms 299

where we set n – m = k. Observe that both m and k are dummy variablesand can take any other name, e.g., n.

Frequency shifting

Proof:

Time multiplication

Example 1: Find the DTFT of

Solution: The DTFT of for n = 0, 1, 2, … is equal to

and hence

Modulation

Proof:

( ) ( ) (= == =

f m e h k e F em

j m

k

j k j )) ( )H ej

e f n e f n ej n j n

n

j n

n

±

= =

= =0 0( ) ( ) ( )∓ FF ej( )( )∓ 0

nf n e e f nd ed e

j n

n

jj n

jn

( ) ( )( )( )

= =

==

=

=

ed

d ef n e

ed

d eF

jj

j n

n

jj

( )( )

( )(( )ej

y n na a nn( ) , .= < <and1 0

f n an( ) =

F e a e a eae

j n j n

n

j n

nj

( ) ( )= = = == =0 0

11

eee a

j

j

=ed

d ee

e aa

ee a

jj

j

j

j

j( ) ( )2

f n nef n e f n ej n

n

j n j n

( )cos( ) ( )

0

0 0

2=

= +22

12

0=

=n

j n

j n

n

e

f n e( ) ( )

==

+

=

+ =12

12

0 0f n e F ej n

n

j( ) ( )( ) ( ) ++ +12

0F ej( )( )

Page 317: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

300 Signals and systems primer with MATLAB

Correlation

Proof:

where in the last step we used the time reversal and shifting properties.

Parseval’s formula

Proof: We start from the right-hand side of the identity. Hence,

Appendix 7.2: Proofs of DFT propertiesNote: For simplicity, we have deleted the constant 2 /N in the exponent.

Linearity

Proof: See the linearity proof in Appendix 7.1.

Symmetry

Proof: Set n = –n in the IDFT. Hence,

Next, interchange the parameters n and k to find

f m h m n e f m hm

j n

n

( ) ( ) ( ) [===

(( )]

( )

n m e

f m

m

j n

n

=

==

nnm

j n j m

m

h n m e f m e H== =

=[ ( )] ( ) (( ) ( ) ( )e F e H ej j j=

12

f n e F e d f nj n

n

j( ) ( ) (=

= )) ( )

( )

*12

12

n

j j nF e e d

f n

=

= FF e e d f n f nj j n

n n

*( ) ( ) * ( )= =

==

= f nn

( )2

f nN

F k ejk n

n

N

( ) ( ) ( )==

1

0

1

f kN

F n e DFTN

F njkn

n

N

( ) ( ) ( )= ==

1 1

0

1

Page 318: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 7: Discrete-time transforms 301

Time shifting

Proof: Substitute m = n – i into IDFT so that the equation

becomes

Frequency shifting

Proof: We write the DFT in the form

Next, we set m = k – i in the expression to find

Time convolution

Proof: Start with the function

This is rearranged to

But, using the finite geometric series formula, we can prove that

f mN

F k ejkm

k

N

( ) ( )==

1

0

1

f n iN

F k eN

F k e ej n i k

k

Njik( ) ( ) [ ( ) ]( )= =

=

1 1

0

1jjnk

k

NjikIDFT F k e

=

=0

1

{ ( ) }

F m f n e jmn

n

N

( ) ( )==0

1

F k i f n e f n e ej k i n

k

Njin jnk( ) ( ) [ ( ) ]( )= =

=0

1

kk

NjinDFT f n e

=

=0

1

{ ( ) }

f i h n iN

F k eN

H m ejik

k

Nj n i m( ) ( ) ( ) ( ) ( )= ×

=

1 1

0

1

mm

N

i

N

i

N

=== 0

1

0

1

0

1

=== =

1 1

0

1

0

1

0N

F k H m eN

e ejmn

m

N

k

Njik jim

i

( ) ( )NN 1

1

00

1

Ne e

n n m

n m

jik jim

i

N

=

==

Page 319: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

302 Signals and systems primer with MATLAB

Hence, for n = m in the second sum, we finally find

Since we have shown that the DFT automatically supposes periodicsequences in the time and frequency domain, the periodic convolution forthe two specific signals, f(n) = {1 2 3} and h(n) = {1 1 0}, are shown in FigureA7.2.1.

Another approach to the evaluation of cyclic convolution is to cast theconvolution form in matrix form. For the case of the periodic sequences f(n)and h(n), each of three elements, as in Figure A7.2.1, we write

This set can be written in matrix form:

For this specific example,

Figure A7.2.1

y(1) = 1 × 1 + 2 × 1 + 3 × 0 = 31

f (0) = 1

f (1) = 2

f (2) = 3

h(2) = 0

h(2) = 0h(1) = 1

h(0) = 1

y(0) = 1 × 1 + 2 × 0 + 1 × 3 = 4

f (0) = 1

f (1) = 2

f (2) = 3

h(2) = 0

h(1) = 1h(0) = 1

y(2) = 1 × 0 + 2 × 1 + 3 × 1 = 5

f (0) = 1

f (1) = 2

f (2) = 3

h(2) = 0

h(1) = 1

h(0) = 1

y n f i h n iN

F k H k ei

Njnk

k

N

( ) ( ) ( ) ( ) ( )= == =0

1

0

11

� IDFT F k H k{ ( ) ( )}

y f h f h f h

y f h

( ) ( ) ( ) ( ) ( ) ( ) ( )

( ) ( ) (

0 0 0 1 2 2 1

1 0 1

= + +

= )) ( ) ( ) ( ) ( )

( ) ( ) ( ) ( ) ( )

+ +

= + +

f h f h

y f h f h

1 0 2 2

2 0 2 1 1 ff h( ) ( )2 0

[ ] [ ( ) ( ) ( )]

( ) ( ) ( )

( ) ( ) ( )y f f f

h h h

h h hT = 0 1 2

0 1 2

2 0 1

hh h h( ) ( ) ( )1 2 0

[ ( ) ( ) ( )] [ ] [y y y0 1 2 1 2 3

1 1 0

0 1 1

1 0 1

= = 44 3 5]

Page 320: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 7: Discrete-time transforms 303

To produce a linear convolution for this case, each sequence must haveN = 3 + 3 – 1 = 5 elements. But since each sequence has only three elements,we pad them with zeros. Hence, for f(n) = {1 2 3 0 0} and h(n) = {1 1 1 0 0},the result is f h = {0 1 2 1 12 0 0 0 0}.

Frequency convolution

Proof: Substitute known forms into

The bracketed term is the orthogonality relationship and is equal to N ifm = k and zero if m is different than k. Therefore,

from which the property is verified if we take the inverse DFT of both sidesof the above equation. Because F(k) and H(k) are periodic, their convolutionis a circular convolution in the frequency domain.

Parseval’s theorem

Using the equation that characterizes the frequency convolution property,we obtain

If we set k = 0 in this expression, we find

From this result we may define a discrete energy spectral density or peri-odogram spectral estimate:

F i H k i f m ei

Njmi

m

N

i

( ) ( ) ( )== =0

1

0

1

== =

=

0

1

0

1Njn k i

n

N

h n e

f m

( )

( )

( )

hh n e e ejkn

n

N

m

Njmi jni

i

N

( )== =0

1

0

1

0

1

F i H k i N f n h n e N Di

Njkn

n

N

( ) ( ) ( ) ( )= ×= =0

1

0

1

� FFT f n h n{ ( ) ( )}

f n f n eN

F i F k ijkn

n

N

i

N

( ) ( ) ( ) ( )= =

=0

1

0

11

f nN

F i F iN

F in

N

i

N

i

N2

0

1

0

12

0

1 1( ) ( ) ( ) ( )

= = =

= =1

S k F k k N( ) ( )=2

0 1

Page 321: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

304 Signals and systems primer with MATLAB

Time reversal

Setting n = –n in the IDFT, we find that

Next, set k = –m on the right side. Then

Because of the periodic nature of F(–m) and exp(jmn), the sum over –(N – 1)to 0 and (N – 1) to 0 is the same. Thus,

which verifies the time reversal property.

Appendix 7.3: Fast Fourier transform (FFT)Decimation in time procedure

The DFT of a sequence {x(n)} is given by

(3.1)

Let us assume that N = 2r for r integer. This indicates that N is always aneven number. Because of N being even, we can decompose the summationof the above equation into two terms, one with even indices and one withodd indices. Hence,

(3.2)

We can write the even indices as n = 2m and the odd indices as n = 2m + 1,with m = 0, 1, …, (N/2) – 1. Therefore, (3.2) becomes

f nN

F k e jnk

k

N

( ) ( )==

1

0

1

f nN

F m ejnm

m

N

( ) ( )( )

==

1

0

1

f nN

F m e IDFT F mjnm

m

N

( ) ( ) { ( )}==

1

0

1

F k f n W W e k NN Nkn

n

N

Nj N( ) ( ) , , , , ,/= = =

=0

12 0 1 � 11

F k f n W f n WN Nkn

even

Nkn

odd

( ) ( ) ( )= +

Page 322: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 7: Discrete-time transforms 305

(3.3)

In the second summation we used the identity

Observe that

1.

2.

3.

Furthermore, the two summations in (3.3) are DFTs themselves: the DFT ofthe even samples f(0), f(2), …, f(N – 2) and the DFT of the odd samples f(1),f(3), …, f(N – 1). Therefore, we write

(3.4)

where

(3.5)

(3.6)

We observe that the DFT of the N-point sequence has been decomposed intotwo DFTs of N/2 samples each.

For example, when we need to compute F4(0), F4(1), F4(2),F4(3), on the basis of and . Hence, for k = 0,1 wewrite

(3.7)

For the two indices, k = 2, 3, we use the fact that the DFT of a 2-pointsequence is periodic with period 2. Hence, for k = 0, 1, we find

F k f m W W f m WN Nmk

m

N

Nk

Nmk

m

( ) ( ) ( )( / )

= += =

2 22

0

2 12

00

2 1( / )N

W W WNm k

Nk

Nmk( )2 1 2+ =

W e WNj N

N2 2 2

2= =/( / )/

W eNN j= =2 1

W eNN j/2 1= =

F k F k W F k k NN Ne

N No( ) ( ) ( ) , , ,/

( )/

( )= + =2 2 0 1 1�

F k DFT f f f N f m WNe

N/( )

/( ) { ( ), ( ), , ( )} ( )2 0 2 2 2= =� 22

0

2 1km

m

N

=

( / )

F k DFT f f f N f m WNo/

( ) ( ) { ( ), ( ), , ( )} ( )2 1 3 1 2 1= = +� NNkm

m

N

/

( / )

2

0

2 1

=

N = =4 22

F Fe e2 20 1( ) ( )( ), ( ) F Fo o

2 20 1( ) ( )( ), ( )

F k F k W F k ke k o4 2 4 2 0 1( ) ( ) ( ) ,( ) ( )= + =

Page 323: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

306 Signals and systems primer with MATLAB

(3.8)

because . Because , (3.7) and (3.8)become

(3.9)

The above equation can be generalized for any sequence of even-number Nsamples in the form

(3.10)

The above equation is known as a butterfly. Figure A7.3.1 depicts (3.10).Figure A7.3.2 shows the FFT for N = 8.

Figure A7.3.1

Figure A7.3.2

F k F k W F k ke k o4 2 4

222 0 1( ) ( ) ( ) ,( ) ( )+ = + =+

F k F k2 2 2( ) ( )= + W e ej j42 2 4 2 1= = =( )/

F k F k W F k k

F k F

eNk o

e

4 2 2

4 2

0 1

2

( ) ( ) ( ) ,

( )

( ) ( )

(

= + =

+ = )) ( )( ) ( ) ,k W F k kNk o =2 0 1

F k F k W F k k NN Ne

Nk

No( ) ( ) ( ) , , , ( )/

( )/

( )= + =2 2 0 1 2� /

+ = =

1

2 0 12 2F k F k W F k kN Ne

Nk

No( ) ( ) ( ) , , ,/

( )/

( ) � (( )N/2 1

+

+_

F N(e)

/2(k) FN(k)

FN(k + N/2)FN(o)

/2

WNk

a

b

a + b

a – b

F(0)

F(1)

F(2)

F(3)

F(4)

F(5)

F(6)

F(7)

f(0)

f(4)

f(2)

f(6)

f(1)

f(5)

f(3)

f(7)

W 40

W 40

W 41

W41

W 80

W 81

W 82

W 83

Page 324: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 7: Discrete-time transforms 307

Next, the question is how efficient the FFT is. Let us look at the casewhen N = 8. In Figure A7.3.1 we see that the first stage is two 4-order DFTs.Each one of these DFTs can be split in two 2-order FFTs. As we can easilysee, a 2-order DFT is just a butterfly, since

when k = 0, 1. For N = 8 we find that we obtain 3 = log2(8) layers of butterflieswith 8/2 butterflies to be computed in each layer. Since each butterflyinvolves one multiplication and two additions, we require about (8/2)log2(8)complex multiplications and 8 log2(8) complex additions. Hence, the com-plexity of DFT is O(8log2(8)). If we substitute N for 8, we find that the FFTcomplexity is of the order Nlog2(N). This must be compared with N 2 oper-ations that must be performed by the DFT. For N = 1024 = 210, the DFT needs(1024)2 = 1,048,576 operations, whereas the FFT needs only 1024 × 10 = 10,240operations.

Observe that to obtain the unscrambled output from the FFT operation,we must scramble the input as shown in Figure A7.3.2. To accomplish this,we first write the numbers, in this case 0 to 7, in their 3-bit representation.Next, we reverse the bits and find the scrambled input. This process is shownbelow:

000 = 0, 001 = 1, 010 = 2, 011 = 3, 100 = 4, 101 = 5, 110 = 6, 111 = 7

000 = 0, 100 = 4, 010 = 2, 110 = 6, 001 = 1, 101 = 5, 011 = 3, 111 = 7

W e Wj k k2

2 221 1 1= = = = ±/ ( )and

Page 325: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

309

chapter 8

Laplace transform

The use of Fourier transform (FT) in systems analysis involves the decom-position of the excitation function f(t) into a function F( ) over an infinite bandof frequencies. The excitation function F( ), together with the appropriatesystem function H( ), leads, through the inverse Fourier transform, to theresponse of the system to the prescribed excitation or excitations. Despite itsgeneral importance in systems functions, the Fourier integral is not generallyuseful in determining the transient response of networks (systems).

The discussion of the FT showed that we could represent a function f(t)by a continuous sum of weighted exponential functions of the form .The values of the exponential are restricted along the imaginary axis of thecomplex plane as omega varies from minus infinity to infinity. This restrictionproves to be undesirable in many cases. We can remove this restriction byrepresenting f(t) by a continuous sum of weighted damped exponentialfunctions of the form , where with some real constant . Thechoice of s moves the values of the exponential function from the j -axis toa parallel line off the j -axis in the complex plane. The Laplace transform iswell adapted to linear time domain systems analysis. Another feature of theLaplace transform is that it automatically provides for initial conditions inthe systems.

8.1 One-sided Laplace transformIn systems problems, it is usually possible to restrict considerations to pos-itive time functions. The reason is that the response of physical systems canbe determined for all t 0 from a knowledge of the input for and theinitial conditions. The one-sided Laplace transform is defined by

(8.1)

provided that the function is defined in the range of integration and that theintegral exists for all values of s greater than a specific value s0.

f t ej t( )

f t e st( ) s j= +

t 0

F s f t e dt f tst( ) ( ) { ( )}=0

�L

Page 326: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

310 Signals and systems primer with MATLAB

In our studies we will consider piecewise continuous functions (a func-tion is piecewise continuous on an interval if the interval can be subdividedinto a finite number of subintervals, in each of which the function is contin-uous and has finite left- and right-hand limits) and those functions for which

(8.2)

Functions of this type are known as functions of exponential order c. Also,from the expression

we observe that if f(t) is of exponential order, the integral converges forRe{s} = > c (c is the abscissa of convergence) since the integrand goes tozero as t . The abscissa of convergence may be positive, negative, orzero depending on the function. The importance of this result is that a finitenumber of infinite discontinuities are permissible so long as they have finiteareas under them. In addition, the convergence is also uniform, which per-mits us to alter the order of integration in multiple integrals without affectingthe results. The restriction in this equation, namely, Re{s} = > c, indicatesthat when we wish to find the inverse Laplace transform, we must choosean appropriate path of integration in the complex plane. By doing so, it isguaranteed that the time function so obtained is unique. The left-hand infi-nite space with its boundary the abscissa of convergence is known as theregion of convergence (ROC).

Example 8.1.1: Find the Laplace transform of the unit step function f(t) =u(t) and establish the region of convergence.

Solution: By (8.1), we find

(8.3)

The region of convergence is found from the expression �e– t e–j t� = �e– t� < ,which is true only if > 0. �

Example 8.1.2: Find the Laplace transform of and establishthe ROC.

lim ( )t

ctf t e c= =0 real constant

f t e dt f t e e dt f t est t j t( ) ( ) ( )= =0 0 0

tt j t t

ct c t

e dt f t e dt

f t e e

=

=

( )

( ) ( )

0

0ddt

U s u t e dt e dtes s

st stst

( ) ( )= = = =0 0

0

1

f t e u tt( ) ( )= 2

Page 327: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 311

Solution: The Laplace transform is

(8.4)

and the ROC is found from

which results in > –2. Figure 8.1.1a shows the ROC for the function f (t) =u(t), and Figure 8.1.1b for the function . These are found inExamples 8.1.1 and 8.1.2, respectively. �

Example 8.1.3: Find the Laplace transform of the delta function and theROC.

Solution: The Laplace transform is

(8.5)

and the ROC is found from

which indicates that the result is independent of , and hence the ROC isthe entire s-plane. �

Figure 8.1.1 (a) ROC for the signal f(t) = u(t). (b) ROC for the signal f (t) = e–2t u(t).

Re(s)

Im(s)

ROC

(a)

ROC

Re(s)

Im(s)

(b)

σ > 0

σ > –2

F s e e dt e dts

et st s t( )( )

( ) (= = =+

+2

0

2

0

12

ss t

s+ =

+2

0

12

)

e e e ej t t j t t+ + + += =( ) ( ) ( )2 2 2

f t e u tt( ) ( )= 2

( ) ( ) ( )s t e dt e t dtst s= = =+

0

0

0

0

1

( ) ( ) ( )t e dt t e dt t dtst s= = = <0 0

0

01

Page 328: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

312 Signals and systems primer with MATLAB

Example 8.1.4: Find the Laplace transform of the function f (t) = 2u(t) +e–t u(t).

Solution: From (8.1) we find

The ROC is > 0. Observe that the ROC, which is accepted, is the region ofthe s-plane where the two ROC overlap. �

8.2 Summary of the Laplace transform properties

1. Linearity

2. Time derivative

3. Integral zero initial conditions

nonzero initial conditions

4. Multiplication by exponentiala = positive constant

5. Multiplication by t

6. Time shifting

7. Complex frequency shift

8. Scaling

9. Time convolution

F s u t e e dt e dt et st st s t( ) [ ( ) ] ( )= + = + +

00

1 ddts s0

1 11

= ++

af t bh t aF s bF s( ) ( ) ( ) ( )+ +L

df tdt

sF s f( )

( ) ( )L 0

d f tdt

s F s s f s fn

nn n n( )

( ) ( ) ( )( )L 1 2 10 0

� ff fd f t

dtn m

m

mt

( ) ( )( ), ( )( )

=

1

0

0 0 �

f x dxF s

s

t

( )( )

0

L

f x dxF s

s

f t dt

s

t

( )( ) ( )

+L

0

e f t F s aat +( ) ( )L

tf tdF s

ds( )

( )L

f t a u t a e F s aas( ) ( ) ( ) >L 0

e f t F s ss t00( ) ( )L

f ata

Fsa

a( ) L >10

f t h t F s H s( ) ( ) ( ) ( )L

Page 329: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 313

10. Initial value provided that no delta function

exists at t = 0

11. Final value provided that sF(s) is analytic on the

j -axis and in the right half of the s-plane

Example 8.2.1: Time derivative. Find the Laplace transform of the dif-ferential equation characterizing an RL series circuit with a voltage v(t) asinput.

Solution: From Kirchhoff voltage law (KVL) we obtain the differentialequation

.

Using the linearity property we obtain

or

Example 8.2.2: Integral. Find the Laplace transform of the integrodif-ferential equation of a series RC circuit with a voltage input. There is aninitial voltage vC(0) across the capacitor.

Solution: From the KVL we obtain the equation

.

Applying the linearity property, we can write the Laplace transform of theabove equation as

From the integration

lim ( ) lim ( )f t sF st s

=0

lim ( ) lim ( )f t sF st s=

=0

Ldi tdt

Ri t v t( )

( ) ( )+ =

L L LLdi tdt

Ri t v t Ldi tdt

( )( ) { ( )}

( )+ = or + =R i t v tL L{ ( )} { ( )}

LsI s Li RI s V s( ) ( ) ( ) ( )+ =0

Ri tC

i x dx v tt

( ) ( ) ( )+ =1

R i tC

i x dx v t RIt

L L L{ ( )} ( ) { ( )} (+ =1or ss

CI ss C

i x dx

sV s)

( ) ( )( )+ + =1 1

0

i x dx q( ) ( )= 00

Page 330: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

314 Signals and systems primer with MATLAB

we obtain the charge accumulated at the initial time t = 0. But q(0)/C is theinitial voltage across the capacitor, and hence the transformed equationbecomes

Example 8.2.3: Multiplication by an exponential. Find the Laplacetransform (LT) of the function .

Solution: To find the transformation, we need to find the LT of the cosinefunction. Therefore, we write

Thus, the answer is

Example 8.2.4: Multiplication by t. Find the LT of the function g(t) =From the property, we need only to find the LT of the sine signal.

Hence, following the procedure of the previous example we find

Thus,

Example 8.2.5: Time shifting. Find the LT of the function fs(t) =(t – a)u(t – a) a > 0.

RCs

I sv

sV sC+ = +1 0

( )( )

( )

g t e t u tat( ) cos ( )= 0

L{cos ( )}00

0 0

2t u t

e ee dt

j t j tst= + = 11

212

12

1

0 0

0 0e dt e dtj s t j s t+ ++

=

( ) ( )

(jj se

j sej s t j s t

0 0 0

0 012

1+

++

+ +

) ( )( ) ( )

00

0 02

02

12

1 12

1=+

++

=+( ) ( )j s j ss

s

G ss a

s a( )

( )= +

+ +202

t t u tsin ( ).0

F se e

je dt

s

j t j tst( ) = =

+

0 0

20

202

0

G sdds s

ss

( )( )

=+

=+

02

02

02

02 2

2

Page 331: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 315

Solution: We first must find the LT of the unshifted function, which is

Hence, applying the time-shifting property we obtain

Example 8.2.6: Frequency shift. Find the LT of the function g(t) =

Solution: Above, we have already found the LT of the cosine function.Hence, the solution is

Example 8.2.7: Scaling. Verify the LT of the functionby using the scaling properties and the LT of the function .

Solution: The LT of the signal f(t) is equal to

Applying the scaling property we find

.

Example 8.2.8: Time convolution. Find the LT of the convolution of thefollowing two functions:

Solution:

F s te dts

tde

dtdt

std est

stst( ) (= = =

0 0

1 1))

0 0 02

1 1= =s

te e dts

st st

F s e F s es

ssa sa( ) ( )= = 1

2

e f t e t u tas as=( ) cos ( ).0

G ss a

s a( )

( )= +

+ +202

f t t u t( ) cos ( )0 0=f t t( ) cos=

ss2 1+

1 110 0 0

0

02 2

0

Fs s

ss

s=

+=

+/

/( )

f t tu t h t t u t( ) ( ), ( ) cos ( )= =

L{ ( ) ( )} ( ) ( )f t h t F s H ss

ss s s

= =+

=+

11

1 112 2 2

Page 332: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

316 Signals and systems primer with MATLAB

Example 8.2.9: Initial value. Apply the initial value property to thefollowing functions:

Solution:

a.

b. If we expand the division of H(s), we obtain

This shows the presence of an impulse at t = 0 and, therefore, we cannotfind the initial value of the time function. �

Example 8.2.10: Final value. Apply the final value property to the fol-lowing two functions:

a.

b.

Solution:

a.

b. In this case, the property is not applicable because the function hassingularities on the imaginary axis at s = ±jb. �

8.3 Systems analysis: transfer functions of LTI systemsThe transfer function or system function, H(s), of a linear time-invariant (LTI)system, an almost essential entity in system analysis, is defined as the ratioof the LT of the output to the LT of the input. Thus, if the input is f(t) andthe output is y(t), then

(8.6)

F ss

sH s

s ss

( ) , ( )=+

= + ++2

2

233

3

lim ( ) lim lim( )s s s

sF ss

s s=

+=

+=

2

2 231

1 31

/

H ss

s( ) = +

+1

32

F ss a

s a b( )

( )= +

+ +2 2

H ss

s b( ) =

+2

lim ( ) lim( )

( )s ssF s

s s as a b

= ++ +

=0 0 2 2

0

H sY sF s

( )( )( )

= = transfer function or system fuunction

Page 333: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 317

The output may be a voltage or a current anywhere in the system, and H(s)is then appropriate to the selected output for a specified input. That is, H(s)may be an impedance, an admittance, or a transfer entity in the givenproblem. The transfer function H(s) describes the properties of the systemalone. That is, the system is assumed to be in its quiescent state (zero state);hence, the initial conditions are assumed zero. The output time function isgiven by

(8.7)

If the input is a delta function, , the output in the s-domain is H(s)since the LT of the delta function is 1. The impulse response of the systemis found by taking the Inverse Laplace transform (ILT) of H(s). Hence, we find

(8.8)

The above relation shows that the impulse response of a system is the ILTof the transfer function H(s), and the transfer function is equal to the LT ofthe system’s impulse response.

An important feature of the LT method is that it is not necessary to isolateand identify the system transfer function since H(s) appears automaticallythrough the transform of the differential equation and is included in the math-ematical operations. The situation changes considerably in those cases whenthe system consists of a number of subsystems that are interconnected to formthe completed system. Next, one must take due account of whether the sub-systems are interconnected in cascade, parallel, or feedback configuration.

The following examples illustrate how we can find the transfer functionof a system from its time domain representation. Often, it is convenient todraw a block diagram representation of the system and then use the prop-erties of block diagram reduction, as is given in Section 2.5.

Example 8.3.1: Determine the transfer function of the system shown inFigure 8.3.1a.

Solution: The differential equation describing the system is

which we write

y t H s F s( ) { ( ) ( )}= L 1

f t t( ) ( )=

h t H s( ) { ( )}= L 1

Ldi tdt

Ri t v ti( )

( ) ( )+ =

LR

dv tdt

v t v t v t Ri too i o

( )( ) ( ); ( ) ( )+ = =

Page 334: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

318 Signals and systems primer with MATLAB

The LT of both sides of the differential equation, invoking the linearityand differentiation properties of LT plus zero initial conditions (remember,the transfer function is defined only with zero initial conditions), is

To obtain the block diagram representation of the system, the aboveequation is written in the following forms:

a.

b.

The first equation is represented in block diagram form in Figure 8.3.1b, andthe second equation is represented in block diagram form in Figure 8.3.1c.

Example 8.3.2: Find the transfer function for the system shown in Figure8.3.2a.

Figure 8.3.1 Electrical system and its block diagram representation: (a) circuit dia-gram, (b) block diagram, and (c) transfer function in block diagram representation.

+L

R

+

i(t)

(a)

vi(t) vo(t)

+_

Vi(s) Vo(s) Vo(s)

L

R s

(b)

(c)

Vi(s) 1

L

R s 1 +

= H(s) Vo(s)

LR

sV s V s V s H sV sV s

R Lso o i

o

i

( ) ( ) ( ); ( )( )( ) (

+ = = =+

/RR L/ )

V s V sLR

sV so i o( ) ( ) ( );=

V sLR

sV so i( ) ( )=

+

1

1

Page 335: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 319

Solution: The differential equation describing the system is

The above equation, by multiplying by R and dividing by R, becomes

The transfer function is shown in block form in Figure 8.3.2c. Further, toobtain the block diagram format, we write the transformed equation in theform

The block diagram representation of the above equation is shown in Figure8.3.2b. �

Figure 8.3.2 Electrical system and its block diagram representation: (a) circuit dia-gram, (b) block diagram, and (c) input–output block diagram.

(a)

+C

R

+

i(t)

vi(t) vo(t)

+

1

RCs

(b)

_

Vi(s) Vo(s) Vo(s)

(c)

s

s + 1

RC

Vi(s) Vo(s)

v t Ri tC

i x dxi

t

( ) ( ) ( )= + 10

(zero initial conditiions)

V s V sV sRCs

H sV sV s

s

sR

i oo o

i

( ) ( )( )

( )( )( )

= + = =+

or1CC

V s V sRCs

V so i o( ) ( ) ( )= 1

Page 336: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

320 Signals and systems primer with MATLAB

Example 8.3.3: Determine the transfer function, H(s) = V(s)/F(s), of thesystem shown in Figure 8.3.3a.

Solution: To find the differential equation describing the system, we addalgebraically the inertia force, the two frictional forces, and the input force.Since the forces are collinear, we obtain

The LT of the above equation and its transfer function, assuming zero initialconditions, are

Figure 8.3.3 Mechanical system and its block diagram representation: (a) mechanicalsystem, (b) block diagram, and (c) input–output block diagram.

Mdv t

dtD v t D v t f t

( )( ) ( ) ( )+ + =1 2

MsV s D D V s F s H sM

sDM

D D D( ) ( ) ( ) ( ), ( )+ + = =+

= +1 2 1 21 1

M

D1

D2

f(t)

v

(a)

1/D +

Ms/D

F(s)

_

V(s)

D = D1 + D2

(b)

V(s)

F(s) V(s)1

M1

s + (D/M)H(s) =

(c)

Page 337: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 321

To obtain the block diagram representation, we write the transformed equa-tion in the form

The block diagram for the above equation is shown in Figure 8.3.3b, and thetransfer function is shown in Figure 8.3.3c �

*Example 8.3.4: Mechanical system. Find the transfer function H(s) =V1(s)/F(s) of the system shown in Figure 8.3.4.

Solution: We first develop the network equivalent diagram. It is shownin Figure 8.3.4b, where the velocities v1 and v2 are specified relative to groundas a fixed frame of reference. Observe that the force moves with velocity v1;hence, this source is connected between ground and level v1 as shown inFigure 8.3.4c. Observe also that the mass M1 moves with velocity v1 and istherefore connected between v1 and vg. The damper D1 moves with relativevelocity specified by v1 and v2; hence, it is connected between these twovelocities. Lastly, since both M2 and D2 move with velocity v2, they areconnected in parallel between v2 and vg. A rearrangement of the resultinggeometry yields Figure 8.3.4d, a familiar circuit configuration for themechanical system.

Figure 8.3.4 Mechanical system: (a) physical model, (b to d) steps in developing thenetwork diagram, (e) block diagram, and (f) block diagram showing input–outputrelation.

V sD

F sMsD

V s( ) ( ) ( )= 1

M1 M2

f(t)D1

(a)

v1 v2

D2

vg = 0

(b)

v1

v2

M1

M2 f(t)

v1

D1

D1

(c)

v2

vg=0

Page 338: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

322 Signals and systems primer with MATLAB

Since the sum of the forces at each node must be zero, we obtain

(8.9)

In writing these equations, we assumed that nonsource terms were pointingaway from the nodes and were assumed positive. This selection is arbitraryand must be kept consistent for all nodes. The LT of these equations is

(8.10)

Figure 8.3.4 (continued).

M1 f(t)

fM1

fD1

fD2

fM2

1 2

(d)

fD2

M2

v2 v1 D1

D2

vg = 0

+

(e)

F(s) 1

M1s + D1

V1(s) V1(s)

V1(s)V2(s)D1

M1s + D1

D1

M1s + D1 + D2

(f )

F(s) V1(s)M2s + D1 + D2

(M1s + D1)(M2s + D1 + D2) – D21

Mdv t

dtD v t v t f t

Mdv t

11

1 1 2

22

0( )

[ ( ) ( )] ( )

( )

+ = a)

ddtD v t v t D v t+ + =1 2 1 2 2 0[ ( ) ( )] ( ) b)

( ) ( ) ( ) ( )

( ) (

M s D V s D V s F s

D V s M s D

1 1 1 1 2

1 1 2

+ =

+ +

a)

11 2 2 0+ =D V s) ( ) b)

Page 339: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 323

To draw the block diagram of the system, we rearrange these equations to

These equations are readily seen in Figure 8.3.4e. Substituting V2(s) from thesecond equation in the first we obtain

or

The final configuration is shown in Figure 8.3.4f. �

*Example 8.3.5: Electromechanical system. Find the transfer functionH(s) = (s)/E(s) of the rotational electromechanical transducer shown inFigure 8.3.5a. Mechanical and air friction damping are taken into consider-ation by the damping constant D. The movement of the cylinder–pointercombination is restrained by a spring with spring constant Ks. The momentof inertia of the coil assembly is J. There are N turns in the coil (in thisexample, e’s define voltages and v’s define velocities).

Solution: Because there are N turns on the coil, there are 2N conductorsof length l perpendicular to the magnetic field at a distance a from the centerof rotation. Therefore, the electrical torque is

(8.11)

where Ke is a constant depending on the physical and geometrical propertiesof the apparatus. The spring develops an equal and opposite torque, whichis written as follows

(8.12)

Owing to the movement of the coil in the magnetic field, a voltage is gen-erated in the coil. The voltage is given by

V sD

M s DV s

M s DF s V s

DM s1

1

1 12

1 12

1

2

1( ) ( ) ( ), ( )=

++

+=

++ +D DV s

1 21( )

V sD

M s DD

M s D DV s

M s DF s1

1

1 1

1

2 1 21

1 1

1( ) ( ) ( )=

+ + ++

+

V sF s

M s DD

M s D M s D DM

1 1 1

12

1 1 2 1 21

1

11

1( )( )

(= +

+ + +

=ss D

DM s D D

M s D DM s D M s D

++ +

= + ++ +

112

2 1 2

2 1 2

1 1 2

)

( )( 11 2+ D )

T e t ef a NBli a NBla i K i= = = =( ) ( )2 2

T s s sK K= = (newton-meter)/degree

Page 340: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

324 Signals and systems primer with MATLAB

(8.13)

From (8.11) and (8.13) we observe that Ke and Km are equal. From the equiv-alent circuit representation of the system shown in Figure 8.3.5b, we obtainthe equations

Figure 8.3.5 Rotational electromechanical transducer: (a) physical model, (b) circuit model, and (c) block diagram representation.

e +

R

i

N

S

a

J

L

ft

0

+10

–10

ft

(a)

e

+

R L

+

D J

Kei

Ks

(b)

Te

TJ TK TD

Km d

dt

+

(c)

_

1

Ls + R

Ea(s) Ke

Km

(s)

Js + D + Ks s

1

e NBlv NBladdt

Kddt

Km m m= = = = =2 2( ) angular vellocity

Page 341: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 325

(8.14)

The LT of these equations yields

(8.15)

Substituting the value of I(s) from the second of these equations into the firstand solving for the ratio (s)/E(s) we obtain

(8.16)

A block diagram representation of this system is shown in Figure 8.3.5c. Toobtain the block diagram, we first observe that (8.15a) gives the error signal(the signal just after the summer) equal to

From (8.15b) we find the relationship

which indicates that the error signal must be multiplied by the three frontfactors shown in the above equation to obtain the output. These are shownas a combination of three systems in series. �

*Example 8.3.6: Bioengineering. Determine the transfer function H(s)(s)/T (s) for the mechanical system (pendulum) shown in Figure 8.3.6a.

Draw a block diagram of the system and use block diagram reductions (seeChapter 2) to deduce the transfer function.

Solution: By an application of D’Alembert’s principle, which requiresthat the algebraic sum of torques be zero at a node, we write

(8.17)

Ldidt

Ri K e

Jddt

m+ + =

+

Kirchhoff voltage law a)

DD K dt K is e+ = D’Alembert’s principle b)

( ) ( ) ( ) ( )

( ) ( ) (

Ls R I s K s E s

Js DKs

s K I

m

se

+ + =

+ +

a)

ss) = 0 b)

H ss

E sK

Ls R Js DKs

K K

e

se m

( )( )( )

( )� =

+ + + +

E s K s Ls R I sm( ) ( ) ( ) ( )= +

( ) [( ) ( )]s KLs R Js D

Ks

Ls R I ses

=+ + +

+1 1

T T T T= + +g D J

Page 342: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

326 Signals and systems primer with MATLAB

where

We have characterized the problem as a bioengineering one because wecan think of the physical presentation shown in Figure 8.3.6a as an idealizedstiff human limb, with the idea to assess as an initial step the passive controlof the locomotive action. Therefore, the equation that describes the systemis (see Figure 8.3.6a)

Figure 8.3.6 Mechanical system with steps in reducing the transfer function H(s) =H(s) = (s)/T (s).

_ _ +

(b)

(s)(s)

(s)

D

Js

Mgl

Js2

T(s)

Js2

Mg

l

(a)

Mgl sin

+ +

D

Js

_ _ +

(c)

(d)

(s) (s)

Mgl

Js2

T(s)

Js2

T(s)

Js2 (s)

D

Js

1

Mgl

Js2 1 +

(e)

(s)T(s) Js2

Js2 + Ds + Mgl

T

T

T

=

=

=

input torque

gravity torque sin

f

g

D

Mgl=

rrictional torque

inertial torqu

= D Dddt

J

=

=T ee = Dddt

Jddt

=2

2

Page 343: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 327

(8.18)

This equation is nonlinear owing to the presence of the in the differ-ential equation. However, if we assume small deflections, less than 20˚ to 30˚,we can approximate the sine function with (t). Under these conditions theabove equation becomes

(8.19)

The LT of this equation is

(8.20)

To obtain the block diagram representation we write the above equation inthe form

This result is shown in Figure 8.3.6b. Rearrange the block diagram as inFigure 8.3.6c and then reduce the innermost feedback loop. This inner loophas the value 1/(1 + Mgl/Js2). The block diagram simplifies to that shownin Figure 8.3.6d. Now, reduce this feedback loop to finally obtain

The transfer function is shown in Figure 8.3.6e. �

*Example 8.3.7: Determine the transfer function of thesystem shown in Figure 8.3.7.

Solution: We have seen in the LT operation that the operator d/dt in adifferential equation is replaced by s and the operator dt is replaced by 1/sin problems with zero initial conditions (see previous examples). Therefore,we can write Kirchhoff’ voltage law in Laplace form by direct reference toFigure 8.3.7b. The equations are

Jd t

dtD

d tdt

Mgl t t2

2

( ) ( )sin ( ) ( )+ + = T

sin ( )t

Jd t

dtD

d tdt

Mgl t t2

2

( ) ( )( ) ( )+ + = T

Js s Ds s Mgl s s2 ( ) ( ) ( ) ( )+ + = T

( ) ( ) ( ) ( )sDJs

sMglJs

sJs

s= +2 2

1T

( )( )

( )

( )

ss

Js

Mgl JsDJs Mgl Js

T2

2

2

1 1

11

1

= +

++

/ /

/

orr( )( )

( )ss

H sJs Ds MglT

� =+ +

12

H s V s V so i( ) ( ) ( )� /

Page 344: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

328 Signals and systems primer with MATLAB

(8.21)

These equations are shown in Figures 8.3.7c, d, and e, respectively. Whenthe parts are combined, the resulting block diagram is that shown in Figure8.3.7f. Using the rules of block reduction (see Chapter 2), the transfer functionis easily determined. �

8.4 Inverse Laplace transform (ILT)As already discussed, the LT is the integral that converts F(s) into the equiv-alent f(t). To perform the inverse transformation requires that the integrationbe performed in the complex plane along a path that ensures that f(t) is

Figure 8.3.7 Illustration of Example 8.3.7.

vo(t)

(a)

R1

L1 L2

R2

i1(t)i2(t)

vi(t)

+

+R1

sL1

I1(s)I2(s)

Vo(s)sL2

R2

Vi(s)

+

(b)

+

+

(c)

Vi(s) I1(s)

L1s I2(s)

(R1 + L1s)I1(s)

1

R1 + L1s

(d)

(e)

I1(s)L1s

(R2 + L1s + L2s)I2(s)

I2(s)

I2(s)

I2(s) Vo(s)

1

R2 + L1s + L2s

L2s

+

(f )

Vi(s) 1

R1 + L1s

I1(s)L1s

L1s

1

R2 + L1s + L2s

I2(s)L2s

Vo(s)

( ) ( ) ( ) ( )

( ) (

R L s I s L sI s V s

L sI s R

i1 1 1 1 2

1 1 2

+ =

+

a)

++ + =

=

L s L s I s

L sI s V so

1 2 2

2 2

0) ( )

( ) ( )

b)

c)

Page 345: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 329

unique. Since this type of integration is beyond the level of this text, we willconcentrate on the one-to-one correspondence between the direct and inversetransforms, as expressed by the pair

(8.22)

Consequently, for this level of mathematical knowledge we must referto Table 8.3.1 to write f(t) appropriate to a given The followingexamples illustrate some of the usual methods used in finding inverseLaplace transforms.

Example 8.4.1: Separate roots. Find the inverse LT of the function

(8.23)

Solution: Observe that the denominator can be factored in the form(s + 2)(s + 3). Thus, F(s) is written in partial fraction form:

(8.24)

where A and B are constants to be determined. To evaluate A, multiply bothsides of (8.24) by (s + 2) and set s = –2. The result is

We proceed in the same manner to reduce the constant B. By multiplyingboth sides by (s + 3) and setting s = –3, we obtain B = 6. Hence, the inverseLT is given by

where Table 8.3.1, entry 4, was used.

MATLAB function residueWe can find the partial fraction expansion of the rational functions by invok-ing the residue command of MATLAB: [r,p,k]=residue(A,B), where Band A are row vectors specifying the coefficients of the numerator anddenominator polynomials in descending powers of s. The residues arereturned in the column vector r, the poles in column vector p, and the direct

F s f t f t F s( ) { ( )} ( ) { ( )}= =L L 1

L 1{ ( )}.F s

F ss

s s( ) =

+ +3

5 62

F ss

s sA

sB

s( )

( )( )=

+ +=

++

+3

2 3 2 3

ss s

s As Bs

As s

+ ++ = + +

+=

= =

32 3

223

2 2( )( )

( )( )

or 55

L L L=+

++

=1 1 151

26

13

5{ ( )}F ss s

ee e tt t+2 36 0

Page 346: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

330 Signals and systems primer with MATLAB

Table 8.3.1 Table of Elementary Laplace Transform Pairs

Entry No. f(t)

1 (t) 1

2 u(t)

3 tn n = 1, 2, 3, …

4 e–at

5 tn e–at

6 sin t

7 cos t

8 e–at sin t

9 e–at cos t

10 sinh t

11 cosh t

12 t sin t

13 t cos t

14

15

F s f t e dtst( ) ( )=0

1

s

n

sn

!+1

1

s a+

n

s a n

!

( )+ +1

s2 2+

s

s2 2+

( )s a+ +2 2

s a

s a

++ +( )2 2

s2 2

s

s2 2

22 2 2

s

s( )+

s

s

2 2

2 2 2+( )

at e

a

at+ 12

12s a s( )+

bat b a e a b

a

at+ +( ) ( )2

b s

s a s

++( )2

Page 347: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 331

terms in row vector k. If, for example, k = [1 –5], we add in the expressionthe function s – 5. For the case above, we write at the command window

[r,p,k]=residue([0 1 -3],[1 5 6]);

where r = residues in column form, p = poles in column form, and k = somefunction of s or constant.The results of our example above are:

r p k

6 –3 []

–5 –2

With these results, we write

.

This result is identical to the one found above. �

Table 8.3.1 (continued) Table of Elementary Laplace Transform Pairs

Entry No. f(t)

16

17

18

19

F s f t e dtst( ) ( )=0

( ) sin( )

tan

/b t

b

2 2 1 2

1

+ +

=

s b

s

++2 2

b b t

b

+ +

=

( ) cos( )

tan

/2 2 1 2

2

1

s b

s s

++( )2 2

( ) sin( )

tan

/a b c ac e bt

b

b

c a

at2 2 2 1 2

1

2+ + +

=

s c

s a b

++ +( )2 2

b a b e bt

b a b

b

a

at+ ++

=

( ) sin( )

( )

tan

/2 2 1 2

2 2

1

12 2s s a b[( ) )]+ +

F ss s

( )( ) ( )

= + +63

52

0

Page 348: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

332 Signals and systems primer with MATLAB

Example 8.4.2: Find the inverse LT of the function

Solution: This function is written in the form

The value of A is evaluated by multiplying both sides of the equation bys + 3 and then setting s = –3. The result is

To evaluate B and C, combine the two equations

from which it follows that

Combine like-powered terms of s to write

Equating the coefficients of equal power of s, we then have –1 + B = 0; –4 +C + 3B = 1; and –5 + 3C = 1. From these equations, we obtain B = 1 andC = 2. Hence, the function is written in the equivalent form

Now, using Table 8.3.1, the result is

F ss

s s( )

[( ) ]( )= +

+ + +1

2 1 32

F sA

sBs C

ss

s( )

[( ) ] [( ) ]=

++ +

+ += +

+ +3 2 11

2 12 2

A s F s= + = ++ +

=( ) ( )( )

33 1

3 2 11

2

+ + + + ++ + +

= +1 2 1 32 1 3

12

2

[( ) ] ( )( )[( ) ]( )

s s Bs Cs s

s[[( ) ]( )s s+ + +2 1 32

+ + + + + + = +( ) ( )s s Bs C B s C s2 24 5 3 3 1

( ) ( ) ( )+ + + + + + = +1 4 3 5 3 12B s C B s C s

F ss

ss

( )( )

=+

+ ++ +

13

22 12

f t e e t tt t( ) cos= +3 2 0

Page 349: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 333

Using the residue MATLAB function, [r,p,k]=residue([0 0 1 1],[1 7 17 15]); we obtain

r p k

–1.0000 –3.0000

0.5000–0.0000i –2.0000 + 1.0000i

0.5000+0.0000i –2.0000 – 1.0000i []

Therefore, the function becomes

or

which is identical to the value found above. �

In many cases, F(s) is the quotient of two polynomials with real coeffi-cients. If the numerator polynomial is of the same or higher degree than thedenominator polynomial, we must first divide the numerator polynomialby the denominator polynomial, the division carried forward until thenumerator polynomial is of a degree one less than the denominator polyno-mial. This procedure results in a polynomial of s plus a proper function.The proper function can be expanded into a partial fraction expansion. Theresult of such an expansion is an expression in the form

(8.25)

This expression has been written in a form to show three types of terms:

1. Polynomial2. Simple partial fraction, including all terms with distinct roots3. Partial fraction appropriate to multiple roots

To find the constants A1, A2, A3, …, the polynomial terms are removed,leaving the proper fraction

(8.26)

F ss s j s j

( )( )

.( )

.( )

= ++

+ +13

0 52

0 52

0

f t e e e e et t jt t jt t( ) . . .= + + = ++3 2 2 30 5 0 5 0 5 + = +2 3 2t jt jt t te e e e t( ) cos

= + + + + + + + +F s B B s B sA

s sA

s sA

s s( ) 0 1 2

2 1

1

2

2

3

3

� �AA

s s

A

s s

A

s s

A

s s

p

p

p

p

p

p

pr

pr

1

22

33+ + + +

( ) ( ) ( )�

F s F s B B s B s( ) ( ) ( )= + + +0 1 32 �

Page 350: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

334 Signals and systems primer with MATLAB

where F(s) is the partial fraction expansion containing all the A’s. To find theconstants Ak, which in complex variable terminology are the residues of thefunction F(s) at the simple poles sk, it is only necessary to note that as s sk,the term will become large compared with all other terms. In thelimit,

(8.27)

Therefore, for each simple pole, upon taking the inverse transform, the resultwill be a simple exponential of the form

(8.28)

Note also that since F(s) contains only real coefficients, if sk is a complex polewith Ak, there exists also a conjugate pole with residue For such com-plex poles,

These terms can be combined in the following way:

(8.29)

When the proper fraction contains a multiple pole of order r, the coeffi-cients in the partial fraction expansion, which are involved in the terms

must be evaluated. A simple application of (8.27) is not adequate. Now theprocedure is to multiply both sides of (8.26) by (s – sp)r, which gives

A s sk k/( )

A s s F sks s

kk

= lim[( ) ( )]

L =1 As s

A ek

kk

s tk

sk Ak .

L + = +1 As s

As s

A e A ek

k

k

kk

s tk

sk ktt

response = + ++( ) ( )( ) (a jb e a jb ek kj t

k kjk k k kk

k

t

tk k k k k ke a jb t j t a jb

)

[( )(cos sin ) ( )= + + + ((cos sin )]

( cos sin )

k k

tk k k k

t j t

e a t b tk= 2 == +

= + =

2

2 2 1

A e t

A a bba

kt

k k

k k kk

k

k cos( )

, tan

A

s s

A

s s

A

s s

A

s sp

p

p

p

p

p

pr

p

1 22

33( ) ( ) ( ) ( )

+ + + +�rr

Page 351: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 335

(8.30)

In the limit s = sp, all terms on the right vanish with the exception of Apr.Suppose now that this equation is differentiated once with respect to s. Theconstant Apr will vanish in the differentiation, but Ap(r –1) will be determinedby setting s = sp. This procedure is continued to find each of the coefficientsApk. Specifically, this procedure is quantified by

(8.31)

Example 8.4.3: Find the inverse transform of the following function:

Solution: This fraction is not a proper one. The numerator polynomialis divided by the denominator polynomial by simple long division. Theresult is

The proper fraction is expanded into partial fraction form:

The value of A2 is deduced by using (8.27):

To find A11 and A12, we proceed as specified by (8.31):

( ) ( ) ( )s s F s s sA

s sA

s sA

s spr

pr k

k

= + + +1

1

2

2

� +

+ + +

A s s

A s s A s

p pr

p pr

p r

11

22

1

( )

( ) (( )� +s Ap pr)

Ar k

dds

F s s s kpk

r k

r k pr

s sp= ==

11 2

( )![ ( )( ) ] , ,��, !r 0 1=

= + + ++

F ss s s

s s( )

( )

3 2

2

2 3 11

= + + ++

F ss ss s

( )( )

13 1

1

2

2

F ss ss s

As

As

As

( )( )

= + ++

= + ++

2

211 12

223 1

1 1

A s F ss ss s

s

s

2 1

2

21

13 1

11= + = + +

+==

=

[( ) ( )]( )

A s F ss s

s

Ad

ss

122

0

2

0

11

2

3 11

1

12 1

= = + ++

=

=

==

( )

( )!

11

2 12

0

2 3 11ds

s F sdds

s ss

s s=

= + ++

( )== =

= + ++

=0

2

20

2 21

2s s

ss

( )

Page 352: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

336 Signals and systems primer with MATLAB

Therefore,

where Table 8.3.1 was used. �

We can use MATLAB function [r,p,k]=residue(b,a) for multipleroots. For example, to invert the function

we proceed as follows: At the command sign >> we write [r,p,k]=res-idue([0 0 0 0 0 1],[1 4 6 4 1 0]);. At the enter command wefind the following values:

r p k

–1.0000 –1.0000 []

–1.0000 –1.0000

–1.0000 –1.0000

–1.0000 –1.0000

1.0000 0

Based on these values we write

Its inverse LT, consulting Table 8.3.1, is

8.5 Problem solving with Laplace transformIt is instructive to present several examples and their solutions using the LTmethod.

Example 8.5.1: Study the changes in time of the current in an RL seriescircuit with initial condition i(0) = constant and input voltage source v(t).

=+

+ + = + +F ss s s

f t t e tt( ) ( ) ( )11

12

1 122 or for tt 0

F ss s s s s s s

( )( )

=+

=+ + + +

11

14 6 44 5 4 3 2

F ss s s s

( )( ) [ ( )] [ ( )] [

= + + +11

11

11

12 3 (( )] ( )

+1

104 s

f t ete t e t e

u ttt t t

( )! ! !

( )= +1 2 3

2 3

Page 353: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 337

Solution: The differential equation describing the system (KVL) is

(8.32)

With the help of the LT properties (see Section 8.2), we find the LT of theabove equation and the unknown I(s) to be

(8.33)

or

where

(8.34)

and

(8.35)

Therefore, the total solution in the transform and time domains is

(8.36)

Impulse response

To find the impulse response of the system, we set the initial condition equalto zero and a delta function as the input voltage. This implies that thezero-input solution is zero. Therefore, the system function for this problem,which is the zero-state solution in the transform domain, and the impulseresponse are

Ldi tdt

Ri t v t( )

( ) ( )+ =

LsI s Li RI s V s( ) ( ) ( ) ( )+ =0

I sL

Ls Ri

Ls RV s I s I szi zs( ) ( ) ( ) ( ) ( )=

++

++0

1�

I sL

Ls Rizi( ) ( )=

+=0 zero-input solution ( depenndent on initial

conditions and independent of inputts)

I sLs R

V szs( ) ( )=+1

= zero-state solution (dependdent on inputsand independent of initial conditioons)

I s I s I s i t i t i tzi zs zi zs( ) ( ) ( ) ( ) ( ) ( )= + = +or

H sL s R L

h tL s R L L

( )( / )

; ( )( / )

=+

=+

=1 1 1 1 11L ee R L t( / )

Page 354: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

338 Signals and systems primer with MATLAB

Superposition

Let us assume that v(t) = v1(t) + v2(t). Then the zero-state solution will be

(8.37)

Note: The input voltages affect only the zero-state part of the solution.

Time invariance

Suppose that the source v(t) is shifted by t0. Then the zero-state solution is

This indicates that the current due to a shifted source is of the same formbut shifted by t0 due to exp(–st0). Hence,

(8.38)

Note: A delay of the input results in an equal delay of the zero-state solution.

Step response

If v(t) = u(t) is a unit step signal applied at t = 0 to a system with zero initialconditions, then the resulting zero-state response is called step response.This step response will be denoted by usr(t). Since the LT of u(t) is 1/s, then(8.35) yields

Hence,

(8.39)

Let, for example, the values of the circuit elements be R = 2 and L = 1. Weassume a voltage input of the form shown in Figure 8.5.1a and zero initialcondition. The input voltage is

I sLs R

V s V sLs R

V sLs R

Vzs( ) [ ( ) ( )] ( )=+

+ =+

++

1 1 11 2 1 22

1 2

( )

( ) ( )

s

I s I szs zs= +

I sLs R

v t t u t tLs R

V s ezss

0 0 01 1

( ) { ( ) ( )} ( )=+

=+

L ttzs

stI s e0 0= ( )

i t i t t u t tzs zs0 0 0( ) ( ) ( )=

I sLs R s R s R s R Lzs( )

( )=

+=

+1 1 1 1 1 1

/

i t u tR

e u tzs srR L t( ) ( ) ( )( / )� = ( )1

1

v t u t u t u t( ) ( ) ( ) ( )= +2 1 2 2

Page 355: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 339

Therefore (superposition),

But

and hence the total current is

Figure 8.5.1 Zero-state response of an RL series circuit to multistep input.

t

v(t)

1

2

3

1 2

(a)

(b)

i zs(

t)

1.5

0.5

00 0.5 1 1.5 2 2.5

t (s)

3 3.5 4 4.5 5

1

i t u t u t u tzs sr sr sr( ) ( ) ( ) ( )= +2 1 2 2

u tR

e u t e u tsrR L t t( ) ( ) ( ) ( )( / )= ( ) =1

112

1 2

i t

e t

e t

e

zs

t

t( )

( )

( )

(

( )= <

1 0

12

1 1

1

2

2 1

22 2 2( ) )t t <

Page 356: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

340 Signals and systems primer with MATLAB

This current is plotted in Figure 8.5.1b. However, if we had also assumedinitial condition i(0), then the general LT format would have been as follows:

Using Table 8.3.1, the inverse transform of the above equation is

Example 8.5.2: Find the current in an initially relaxed RL series circuitwhen the input is a pulse shown in Figure 8.5.2a.

Solution: The differential equation describing the system is

The input signal is decomposed into two unit step functions, as shown inFigure 8.5.2:

Because the system is LTI, we can use the superposition property and thetime-invariant properties discussed above. Hence, we write

But usr(t) is given by (8.39), and thus the current is given by

For L = 1 and R = 2 the current is shown in Figure 8.5.2c. �

Example 8.5.3: A force is applied to a relaxed mechanical system ofnegligible mass, as shown in Figure 8.5.3a. Find the velocity of the system.

I sR s s R L

( )( )

=+

+1 1 1/

zero-state responsee zero-input response

/� � �

10

s R Li

+ ( )( )

��

i tR

e R L t( ) ( )( / )= 11

zero-state response� � � � + =i e iR L t( ) (( / )0

zero-input response

001

) ( / )

Re R L t

transient response� � �

+ 10

Rt

steady-stateresponse

Ldi tdt

Ri t v t( )

( ) ( )+ =

v t u t u t( ) ( ) ( )= 1

i t u t u tzs sr sr( ) ( ) ( )= 1

i tR

e u tR

ezsR L t R L t( ) ( )( / ) ( / )( )= ( ) (1

11

1 1 )) u t( )1

Page 357: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 341

Solution: From Figure 8.5.3b, we write

Now, define a new variable

Figure 8.5.2 Illustration of Example 8.5.2, the principle of superposition and timeinvariance.

Figure 8.5.3 Simple mechanical system: (a) physical model and (b) circuit equivalentform.

1

1 t

(a)

v(t) = p0.5(1 – 0.5)

1

1

–1

t

(b)

v(t)

u(t)

–u(t – 1)

0.5

0.4

0.3

0.2

0.1

0 0 0.5 1 1.5 2 2.5

t (s)

3 3.5 4 4.5 5

i zs(

t)

(c)

(1/R)(1 – e–(R/L))

f(t)

v(t)

K

D

(a) vg = 0

K D

fK

(b)

v(t)

f(t)

fD

Dv K v x dx au tt

+ =( ) ( )0

y t v x dxt

( ) ( ) ;=0

Page 358: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

342 Signals and systems primer with MATLAB

this equation takes the form

Observe that the solution is equal to ausr(t), where usr(t) is the step responsesolution. Therefore, the LT of the above equation and its inverse are (seeExample 8.5.1)

Hence, the velocity is given by

Next, we approach this problem from a different point of view, namely,the use of convolution. This approach requires that we find the impulseresponse of the system in the time and LT domains, which are (h(t) has thesame units as the velocity)

from which the transfer function and its impulse response are

For a step function input au(t), the output is

This result is precisely what we found above using a different approach.This makes sense if we remember that the derivative of a step function is adelta function.

Ddy t

dtKy au t

( )( )+ =

Y saD s K D s

y taK

e tK D t( )[ ( )]

; ( ) ( )( / )=+

=11 0

/

v tdy t

dtaD

e tK D t( )( ) ( / )� = 0

Dh t K h x dx t DH sKs

H st

( ) ( ) ( ); ( ) ( )+ = + =0

1

H sD

KD s K D

h tD

tKD

e K D t( )( )

; ( ) ( ) ( / )=+

=1 1 12 2/

tt 0

v t au t h taD

x u t x dxKaD

e K( ) ( ) ( ) ( ) ( ) (= =2

// )

( / )

( ) ( )

( )

D x

K D x

u x u t x dx

aD

u tKaD

e dx=2

001

tK D t K D ta

Du t

aD

e u taD

e u= + =( ) ( ) ( ) (( / ) ( / ) tt)

Page 359: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 343

We could have also taken the LT of the defining equation, which yields

Solving for the unknown V(s) and taking the inverse LT, we obtain, as before,the desired solution

Example 8.5.4: Refer to Figure 8.5.4a, which shows the switching of aninductor into a circuit with an initial current. Prior to switching, the circuitinductance is L1; after switching, the total circuit inductance is L1 + L2. Theswitching occurs at t = 0. Determine the current in the circuit for t 0.

Solution: The current just before switching is

To find the current after switching at t = 0+, we employ the law of conser-vation of flux linkages (see (2.54)). We can write over the switching period,

Figure 8.5.4 Switching L in a circuit with initial current: (a) circuit configuration and(b) response of the RL circuit after L is switched.

DV s KV s

sa

s( )

( )+ = 1

V saD s K D

v taD

e tK D T( )( )

; ( ) ( / )=+

=10

/

iVR

( )0 =

L i L L i iL

L Li1 1 2

1

1 2

0 0 0 0( ) ( ) ( ) ( )( )

( )= + + + =+

=orLL

L LVR

1

1 2( )+

V +

i(t)

L1 R

L2

S

(a)

i(t)

V/R

(b)

t VL1/[R(L1 + L2)]

Page 360: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

344 Signals and systems primer with MATLAB

The differential equation that governs the circuit response, after the switchS is closed, is

The LT of this equation yields

Include the value of i(0+) in this expression and then take the inverse LT.The result is

The form of the current variation is shown in Figure 8.5.4b. �

*Example 8.5.5: Second-order systems: The series RLC circuit. Let usanalyze a series RLC circuit driven by a voltage source vi(t), as shown inFigure 8.5.5a. Specifically, we will be interested in the step response of thesystem. The output is the voltage across the capacitor. In our study thefollowing important parameters are needed

which are used to determine the current i(t) and the voltage across thecapacitor v(t).

Let us assume that there exists an initial current i(0) and an initial voltageacross the capacitor v(0). The following equation (KVL) characterizes thesystem

(8.40)

( )( )

( ) ( )L Ldi tdt

Ri t Vu t1 2+ + =

I sVR s s R L L s R L L

i( )( ) ( )

(=+ +

++ +

1 1 1

1 2 1 2/ /00+)

i tVR

LL L

e tRt L L( ) /( )=+

+1 02

1 2

1 2

Critical resistance: Damping: =RLCc = 2

RRL

LC

2

1Resonant frequency: Natural fre r = qquency:

Q-factor: Damping

= r2

=

2

2Q r rratio: = =

r c

RR

Ri t Ldi tdt C

i x dx v v tt

i( )( )

( ) ( ) ( )+ + + =10

0

Page 361: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 345

Taking the transform of both sides, we obtain

Therefore,

(8.41)

Figure 8.5.5 The zero-state current and zero-state voltage response across a capacitorof an RLC series circuit to a unit step function input.

+ RL

C

+

v(t)

(a)

t

E

vi(t)

vi(t)

ζ = 0.6ζ = 0.6

ζ = 1

ζ = 2.5

ζ = 1

i zs(

t) A

i zs(

t) A

v zs(

t) V

v zs(

t) V

v zs(

t) V

ts

ts

ts ts

ts

ts

(b)

–0.5

0

0.5

0

0.1

0.2

ζ = 0.06

v zs(

t) V

ts0

0

1

2

2 4 6 8 10

00

0.5

1

1.5

0

0.5

1

1.5

–0.5

0

0.5

1

2 4 6 8 10

0 2 4 6 8 10

0 2 4 6 8 10

ζ = 2.5

i zs(

t) A

0

0.05

0.1

0 2 4 6 8 10

0 2 4 6 8 10

0 2 4 6 8 10

ζ = 0.06

i zs(

t) A

ts

–0.5

0

0.5

0 2 4 6 8 10

RI s LsI s LiI sCs

vs

V si( ) ( ) ( )( ) ( )

( )+ + + =00

I sV s

R Ls Csi( )( )( )

=+ + 1/

zero-state response� �

++ +

Li v sR Ls Cs

( ) ( ( ) )( )

0 01

//

zero-input reesponse� �

� I s I szs zi( ) ( )+

Page 362: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

346 Signals and systems primer with MATLAB

The voltage v(t) can be expressed in terms of the current i(t). Since i(t) =C(dv(t)/dt), we conclude that .

The zero-state response Vzs(s) of the voltage V(s) is therefore given by

(8.42)

Step response

If vi(t) = Eu(t), then Vi(s) = E/s; hence,

(8.43)

To obtain the inverse LT of these quantities, we must investigate their poles,which are

(8.44)

Based on the above equation, the following three cases may be considered:

1. If R > Rc, then the roots are real and the time functions are

(8.45)

2. If R = Rc, then and

(8.46)

3. If R < Rc, then the roots are complex, , and the timefunctions are

(8.47)

We note that if , and (8.47) yields

I s C sV s v( ) [ ( ) ( )]= 0

V s I sCs

V sLCs RCs

zs zs( ) ( )( )= =

+ +1

12

I sE s

R Ls CsE L

s sV szs

rzs( )

( ); ( )=

+ +=

+ +=/

//

1 22 2

EEs s s

r

r

2

2 22( )+ +

pRL

RL LC

RRr

c1 2

2 2

2 21

1, = ± = ±

i tE

L p pe e v t E

Epzs

p t p tzs

r( )( )

( ); ( )(

= = +1 2

21 2

11 2 1 2

1 11 2

p pe

pep t p t

)

p p r1 2= = =

i tEL

te v t E E t ezst

zs rt( ) ; ( ) ( )= = +1

p j1 2, = ±

i tEL

e t v t E Ee tzst

zst( ) sin ; ( ) cos s= = + iin t

R Rc r� �, then

Page 363: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 347

(8.48)

It is instructive to find out how the current and voltage behave when thedamping ratio varies. Let us assume the following circuit element values:vi(t) = u(t), L = 1, C = 0.25. The four cases, which we investigate, are shownin Figure 8.5.5b from top to bottom. The parameters for these four cases are:

There exists the MATLAB function step(num,den) where num is a vectorcontaining the coefficients of the numerator and den is a vector containingthe coefficients of the denominator. The variable, which we want to find,must be given in a Laplace-transformed rational fraction form. To plot theoutput we write: >>sr=step(num,den); plot(sr);. �

*Example 8.5.6: Find the velocity of the system shown in Figure 8.5.6awhen the applied force is . Use the LT method and assumezero initial conditions. Solve the same problem by means of the convolutiontechnique. The input is the force and the output is the velocity.

Solution: From Figure 8.5.6b, we write the controlling equation

Laplace-transform these equations and then solve for V(s). This yields

Write the expression in the form

i t ECL

e t v t E Ee tzst

r zst

r( ) sin ; ( ) cos

a. roots:R r= = = =10 2 5 2 5 9 5826 0 4174, . , , , . , .

bb. roots:R r= = = =4 1 0 2 2 2 0000 2 0000, . , , , . , .

cc. roots:R r j= = = = +2 4 0 6 2 1 2 1 2000 1. , . , , . , . .66000 1 2000 1 6000

0 24 0 06 2

, . .

. , . , ,= = =

j

R rd. == +0 12 0 1200 1 9964 0 1200 1 996. , . . , . .roots: j j 44

f t t u t( ) exp( ) ( )=

Mdv t

dtDv t K v x dx f t

dv tdt

vt( )

( ) ( ) ( )( )

(+ + = +0

5or tt v x dx e u tt

t) ( ) ( )+ =40

H ss

Ms Ds KV s

ss s s

ss

( ) ; ( )( )( ) ( )

=+ +

=+ + +

=+2 2 21 5 4 1 (( )s + 4

V sA

sB

sC

s( )

( )=

++

++

+4 1 1 2

Page 364: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

348 Signals and systems primer with MATLAB

where

The inverse transform of V(s) is given by

To find the zero-state solution, v(t), by the use of the convolution integral,we must first find the impulse response of the system, h(t). The quantity isspecified by

Because we want to find the impulse response, the system is assumed tohave zero initial conditions. The LT of the equation yields and its inverse are

Figure 8.5.6 Illustration of Example 8.5.6: (a) mechanical system and (b) networkrepresentation.

M = 1f(t)

D = 5

K = 4

Systemf(t) v(t)

M

dvdt

M

Dv

K ∫vdt

(a)

M = 1

fD = 5 K = 4

+

v

(b)

vg = 0

As

sB

dds

ss

s s

=+

= =+

== =

( );

!149

11 4

492

4 1

;; Cs

ss

=+

==4

13

1

v t e e te tt t t( ) = +49

49

13

04

dh tdt

h t h x dx tt( )

( ) ( ) ( )+ + =5 40

H ss

s s s sh t e et( ) ; ( )=

+ +=

+ +=

24

5 443

14

13

11

43

13

t t 0

Page 365: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 349

Therefore, the output of the system to the input exp(–t)u(t) is written

This result is identical with that found using the LT technique, as it should be.�

*Example 8.5.7: Environmental engineering. Let us assume that at tomet = 0 there are a certain number of some species, say n(0), all of the same age.For convenience, let us classify this age as the zero age. At future time t,there are n1(t) of these members still in the population. Therefore, n1(t) andn(0) are connected through a survival function, f(t), as follows

Let us assume that at time t1 we placed m of zero age. At any future timet > t1 the number of these individuals will be

Consider that there is a replacement rate r(t) of the zero-age individuals. Inthe time interval from to + , r( 1) individuals are placed in thepopulation. 1 must be in the range 1 + . The survival law dictatesthat r( 1) f(t – 1) individuals will still be present in the population at timet. We can therefore think that we split the interval [0, t] into subintervals oflength and add up the number of survivors for each interval. At the limit,as approaches zero, the summation becomes an integral. Hence, thenumber of species at time t is

(8.49)

Let us assume that in 2005 the population of deer was 55,000 and theirsurvival function was the exponential function exp(–t). Suppose that we

v t h x f t x dx e u t x et x( ) ( ) ( ) ( )( )= = 43

44

3

0 0

13

43

13

x x

t xt t

e u x dx

e e dx dx=

( )

=

=

e e tt x

t43

13

13

3

0

449

49

13

04e e te tt t t+

n t n f t1 0( ) ( ) ( )=

m t m t f t t t t( ) ( ) ( )= >1 1 1

n t n f t r f t dt

( ) ( ) ( ) ( ) ( )= +00

Page 366: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

350 Signals and systems primer with MATLAB

must determine a rate function r(t) so that the population is a linear functionof time, that is,

where a is a constant.

Solution: Here n(0) = 55,000 and r(t) must satisfy the equation

(8.50)

Taking the LT of both sides of the above equation, we find

Therefore, the rate function is �

Note: Observe that the Laplace transform was used in (8.49), even if it wasnot a differential equation.

*Example 8.5.8: Systems of differential equations. Find the voltage v2(t)for a delta function (impulse response, h(t)) and step function (step response)inputs to the system shown in Figure 8.5.7. Assume zero initial conditions,which indicates we find the zero-state response for the step function.

Solution: Using the node equation law, we write

(8.51)

Taking transforms of both sides and setting G = 1/R, we obtain

(8.52)

The desired output is

(8.53)

n t n at( ) ( )= +0

n at n e r x e dx tt t xt

( ) ( ) ( ) ( )0 0 00

+ = +

ns

as

ns

R ss

R sn( ) ( )

( ) ( )( (0 0

11

10

2+ =+

++

=or)) ) ( )+ + = + +a s a

sn a

sas2 2

0

r t n a at( ) ( )= + +0

v tR

Cdv t

dti t i t

v tR

Cdv t

di1 1 2 2( ) ( )

( ) ( );( ) ( )+ + = +

tti t

v t v t Ldi tdt

=

=

( ) ;

( ) ( )( )

0

1 2

GV s CsV s I s I s

GV s CsV s I s

i1 1

2 2

( ) ( ) ( ) ( )

( ) ( ) (

+ + =

+ ))

( ) ( ) ( )

=

=

0

01 2V s V s LsI s

V sI s

LC s LCGs LG C s Gi

2 2 3 2 22 2 2( )

( )( )

=+ + + +

Page 367: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 351

Let us assume the following values: L = 1, R = 4, and C = 1. Then (8.53)becomes

For the impulse response, Ii(s) = 1, and for step response, Ii(s) = 1/s. To obtainthe time domain of these two responses we used the following MATLABprograms:

>>t=0:0.05:40;

>>h=impulse([0 0 0 1],[1 0.5 2.0625 0.5],t]);

>>subplot(2,2,1);plot(t,h);xlabel('t s');ylabel('h(t)');

For the step response we used the commands:

>>t=0:0.05:40;

>>sr=step([0 0 0 1],[1 0.5 2.0625 0.5],t]);

The outputs are shown in Figure 8.5.7b. �

Figure 8.5.7 Illustration of Example 8.5.8.

ii(t)

i(t)v1(t)

R C C R

L

(a)

v2(t)

0 –0.2

0

0.2

0.4

0.6

0.8

10 20 30 40

h(t

)

t (s)

0 0

0.5

1

1.5

2

2.5

10 20 30 40

t (s)

(b)

usr

(t)

V s I ss s s

i2 3 2

10 5 2 0625 0 5

( ) ( ). . .

=+ + +

Page 368: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

352 Signals and systems primer with MATLAB

8.6 Frequency response of LTI systemsThe frequency response of systems is defined when the initial conditions arezero; hence, we address only the zero-state response. We know that theoutput of an analog system is given by the convolution of the input and theimpulse response of the system:

(8.54)

The LT of both sides of (8.54) gives (see Section 8.2)

(8.55)

The time and transformed representation of a system are shown diagram-matically in Figure 8.6.1. Because h(t) is the inverse LT of H(s),

(8.56)

When two systems are connected in cascade, as shown in Figure 8.6.2,we obtain the following equations:

Figure 8.6.1 Diagrammatic representation of an analog system.

Figure 8.6.2 Representation of two systems in cascade.

g t f t h t( ) ( ) ( )output input impulse

response

� �= ��

G s F s H s( ) ( ) ( )=

h t H sG sF s

( ) { ( )}( )( )

= =L L1 1

g t f t h t G s F s H s g t g t1 1 1 1 1( ) ( ) ( ) ( ) ( ) ( ); ( ) ( )= = = hh t G s G s H s2 1 2( ) ( ) ( ) ( )=

f(t)

F(s)

h(t)

H(s) G(s) = F(s)Η(s)

g(t) = f(t) ∗ h(t)

f(t)

F(s)

h1(t)

H1(s)

h2(t)

H2(s)

g1(t)

G1(s)

g(t)

G(s)

H(s) = H1(s)H2(s)

Page 369: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 353

Eliminating G1(s) from the transformed equations above, we find

which shows that the combined transfer function is

(8.57)

Therefore, if n systems are connected in series, their total transfer function is

(8.58)

If two systems are connected in parallel, as shown in Figure 8.6.3, wehave

from which

(8.59)

This equation shows that the transfer function of two systems connected inparallel is given by

(8.60)

Figure 8.6.3 Representation of two systems in parallel.

G s H s H s F s( ) ( ) ( ) ( )= 1 2

H s H s H s( ) ( ) ( )= 1 2

H s H s H s H s H sn( ) ( ) ( ) ( ) ( )= 1 2 3 �

g t g t g t f t h t f t h t( ) ( ) ( ) ( ) ( ) ( ) ( )= + = +1 2 1 2

G s F s H s F s H s F s H s H s( ) ( ) ( ) ( ) ( ) ( )[ ( ) ( )]= + = +1 2 1 2

H s H s H s( ) ( ) ( )= +1 2

+g(t)

G(s)

f(t)

f(t)

f(t)

H1(s)

h1(t)

H2(s)

h2(t)

g1(t) = f(t) ∗ h1(t)

g2(t) = f(t) ∗ h2(t)

G1(s) = F(s)H1(s)

G2(s) = F(s)H2(s)

H(s) = H1(s) + H2(s)

Page 370: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

354 Signals and systems primer with MATLAB

For systems with feedback connection, as shown in Figure 8.6.4, we write

The LT of the second equation above gives

from which

(8.61)

and

(8.62)

These results are consistent with those discussed for block diagram config-urations (see Figure 2.5.4).

Example 8.6.1: Determine the transfer function, I2(s)/V(s), for the systemshown in Figure 8.6.5a. Also, find the magnitude and phase response functions.

Solution: The differential equations describing the system are

from which

Figure 8.6.4 Representation of systems in feedback form.

+

±

f(t) g(t)

1 −+ H1(s)H2(s)

H1(s)

g1(t)

G1(s)

h1(t)

H1(s)

h2(t)

H2(s)

g(t)

g(t)

H(s) =

g t f t g t h t g t g t h t1 2 1 1( ) ( ) ( ) ( ) ( ) ( ) ( )= ± = =and ff t h t g t h t h t( ) ( ) ( ) ( ) ( )±1 2 1

G s F s H s G s H s H s( ) ( ) ( ) ( ) ( ) ( )= ±1 1 2

G s F sH s

H s H s( ) ( )

( )( ) ( )

= 1

1 21 ∓

H sG sF s

H sH s H s

( )( )( )

( )( ) ( )

= = 1

1 21 ∓

Ri t Ri t v t Ldi t

dtRi t Ri t1 2

22 1 0( ) ( ) ( )

( )( ) ( )= + =

I sR

V s I s I s I sR

Ls R1 2 2 11

( ) ( ) ( ) ( ) ( )= + =+

Page 371: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 355

These two equations are shown in block diagram representation in Figure8.6.5b. By block diagram simplification (see Figure 2.5.4) or by eliminatingI1(s) from these equations we obtain

As a consequence,

Example 8.6.2: Deduce an expression for the current (voltage input–current output) in the circuit shown in Figure 8.6.6 if a cosine is applied with

= 5.

Solution: Taking the LT of the KVL equation that describes the system,we find the transfer function to be equal to

The output of the system, if the input is a complex exponential function, is

Figure 8.6.5 Illustration of Example 8.6.1.

v(t)

+i1

R L

(a)

i2System

i2(t)v(t)

1/R +

(b)

V2(s) I1(s) I2(s)R/(Ls + R)

H sI sV s Ls

H jj L

( )( )( )

( )= = =2 1 1or

H jL

( ) ( )= = =12

constant

H ss

( ) =+1

2

i t e h t h x e dxj t j t x( ) Re{ ( )} Re{ ( ) } R( )= = = ee{ ( ) }

Re{ ( )}

e h x e dx

e H j

j t j x

j t=

Page 372: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

356 Signals and systems primer with MATLAB

Note: We can exchange linear operations (integrations, differentiations, etc.)with the Re{} or Im{} operations.

Based on our results above, we write the output as follows:

When there is a sum of exponential function inputs

(8.63)

the output function becomes

(8.64)�

Example 8.6.3: Repeat Example 8.6.2 for an input voltage v(t) = 2 + 5 cos3t + 6 sin 6t.

Solution: For the given circuit,

and, thus, we write

Figure 8.6.6 Illustration of Example 8.6.2.

+

R = 2i(t)

v(t) L = 1 Systemv(t) i(t)

i tj

ee

j t

j( ) Re Re

tan ( / )=

+=

+

15 2

1

5 25

2 2 5 21ee tj t5 11

295 5 2= cos[ tan ( / )]

f t a e a e e aj t j t j tn

n( ) = + + +1 21 2 �

g t a H j e a H j e a H jj t j tn n( ) ( ) ( ) ( )= + + +1 1 2 2

1 2 � eej tn

H jj

( ) =+1

2

i tj

ej

ej t j t( ) Re Re=+

++

+21

0 25

13 2

0 3 IIm

cos tan

61

6 2

15

133

32

6

1

je

t

j t

+

= + + 6

406

62

1cos tant

Page 373: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 357

A basic and very important property of any system is its filtering prop-erties, which define how different frequencies are attenuated and phaseshifted as they pass through the system. Further, the energy of a signal isassociated with the amplitude of each harmonic. Thus, the filtering proper-ties of a system will dictate the amount of energy that is to be transferredby the system and the percentage for each particular frequency component.Therefore, we generally prefer to plot the magnitude and the phase

vs. frequency , where Hi( ) and Hr( ) are theimaginary and real components of H(j ) and are real functions of . �

Example 8.6.4: Deduce and plot the frequency characteristics (filtering)of the circuit shown in Figure 8.6.7a.

Solution: Applying the KCL and taking the LT of the differential equa-tion, we obtain

The magnitude and phase spectrums are obtained by setting s = j . These are

The magnitude and phase characteristics are graphed in Figure 8.6.7b. �

Example 8.6.5: Deduce and plot the frequency characteristics of thesystem shown in Figure 8.6.8.

Figure 8.6.7 Illustration of Example 8.6.4.

H j( )( ) tan [ ( ) ( )]= 1 H Hi r/

Cdv t

dtv tR

i t H sV sI s C s RC

( ) ( )( ) ( )

( )( ) (

+ = = =+

1 11/ ))

H jC RC

RC( )( )

( ) tan ( )=+

=1 1

12 2

1

/

RC

v(t)

+

i(t) Systemi(t) v(t)

(a)

Page 374: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

358 Signals and systems primer with MATLAB

Solution: From an inspection of the circuit, we write the two KCLequations:

The LTs of these equations are

Eliminate VC(s) from these last equations and solve for H(s) Vo(s)/I(s). Theresult is

Figure 8.6.7 (continued).

R C = 1

rad/s

Mag

nit

ud

e

0 0 2 4 6 8

rad/s

0 2 4 6 8

rad/s

0 2 4 6 8

rad/s

0 2 4 6 8

0.5

1

1.5

2

–2

–1.5

–1

–0.5

0

–2

–1.5

–1

–0.5

0

Mag

nit

ud

e

0

0.5

1

1.5

2

R/2 C = 0.25

sqrt(3)/RC

/4

1/RC

Ph

ase

Ph

ase

(b)

Cdv t

dt Lv t v t dt i t

Lv t v

cc o

o

( )[ ( ) ( )] ( )

[ ( )

+ =1

1cc

ot dtv t

R( )]

( )+ = 0

CsV sLs

V s V s I sLs

V s Vc c o o c( ) [ ( ) ( )] ( ); [ ( ) (+ =1 1ss

V sRo)]( )+ = 0

H sV sI s

R LCs R L s LC

o( )( )

( ) ( )� =

+ +/

/ /2 1

Page 375: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 359

Therefore,

The above characteristics are plotted in Figure 8.6.8b for L = R = 1 and C =0.2. These plots can be done by the following two approaches.

Figure 8.6.8 Illustration of Example 8.6.5.

i(t)

vc

L

C R

+

vo(t)

(a)

Systemi(t) vo(t)

R = L = 1, C = 0.2

ω rad/s

Mag

nit

ud

eP

has

e

0 1 2 3 4 5 6

ω rad/s

00

0.5

1

1.5

2

2.5

–2

–1

0

1

2

1 2 3 4 5 6

(b)

H jLC

LCRL

( )

( )

/=

+ +

1

12 22

2

1

/

/

221

21; ( ) tan

( )= R LLC

//

Page 376: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

360 Signals and systems primer with MATLAB

Book MATLAB calculations

>>w=0:0.02:6;

>>r=1;l=1;c=0.2;

>>H=(r/(l*c))./sqrt((-w.^2+1/(l*c))^2+(r/l)^2*w.^2);

>>phw=-atan((r/l)*w./(1/(l*c)-w.^2));

>>subplot(2,1,1);plot(w,H);subplot(2,1,2);plot(w,phw);

MATLAB functions

>>w=0:0.02:6;

>>r=1;l=1;c=0.2;

>>num=[0 0 r/(l*c)]; den[1 r/l 1/(l*c)];%numerator and denom-%inator coefficients;

>>H=freqs(num,den,w);%the function freqs() is used for Laplace %transform rational functions;

>>phw=angle(H);

>>subplot(2,1,1);plot(w,abs(H)); subplot(2,1,2);plot(w,phw);%note that we used the function abs();

Example 8.6.6: A signal 2 + 3sin5t is the input to the system of Example8.6.5. Find the output vo(t).

Solution: The output is given by

Therefore, we obtain

v t H j e H j e

H j

oj t j t( ) Re{ ( ) } Im{ ( ) }

Re{ (

= +

=

2 0 3 5

2

0 5

00 3 50 0 5 5) } Im{ ( ) }( ) ( )e e H j e ej j t j j t+

v tR LC

LC R L

R LC

o( )/

[( ) ( ) ]

/[(

/=+

++

21 0

325

2 2 1 2/ /

11 255

51 252 1 2

1

/ //

/LC R Lt

R LLC) ( ) ]

sin tan/+

Page 377: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 361

8.7 Pole location and the stability of LTI systemsThe physical idea of stability is closely related to a bounded system responseto a sudden disturbance or input. If the system is displaced slightly from itsequilibrium state, several different behaviors are possible. If the systemremains near the equilibrium state, the system is said to be stable. If thesystem tends to return to the equilibrium state or tends to a bounded orlimited state, it is said to be asymptotically stable. Here, it should be notedthat the stability can be examined by studying a system either through itimpulse response h(t) or through its Lapalace-transformed system H(s).

Let us assume that we can expand the transfer function in terms of itsroots as follows:

(8.65)

The time response for an applied impulse due to the kth pole will be of theform . Thus, the nature of the response will depend on the location ofthe roots sk in the complex s-plane. Because the controlling differential equa-tion that describes the system has real coefficients, the roots either are realor, if complex, will occur in complex conjugate pairs. Three general casesexist that depend intimately on the order and location of the poles sk in thes-plane. These are:

1. The point representing sk lies to the left of the imaginary axis in thes-plane.

2. The point representing sk lies on the j -axis.3. The point representing sk lies to the right of the imaginary axis in the

s-plane.

We examine each of these alternatives for both simple-order and higher-order poles.

Simple-order poles

Case IThe root is a real number sk = k, and it is located on the negative real axisof the s-plane. The response due to this root will be of the form

(8.66)

This expression indicates that after a lapse time, the response will be van-ishingly small.

H sA

s sA

s sA

s sA

s sk

k

n

n

( ) = + + + + +1

1

2

2

� �

A eks tk

response = <A ekt

kk 0

Page 378: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

362 Signals and systems primer with MATLAB

For the case when a pair of complex conjugate roots exists, the responseis given by

(8.67)

The response terms can be combined, noting that Ak = a + jb and sk = k + j k

or

(8.68)

This response is a damped sinusoid, and it ultimately decays to zero.

Case IIThe point representing lies in the imaginary axis. This condition is a specialcase of Case I, but now k = 0. The response for complex conjugate poles(see (8.68)) is

(8.69)

Observe that there is no damping, and the response is thus a sustainedoscillatory function. Such a system has a bounded response to a boundedinput, and the system is defined as stable even though it is oscillatory.

Case IIIThe point representing lies in the right half of the s-plane. The responsefunction will be of the form

(8.70)

for real roots and

(8.71)

for complex conjugate roots. Because both functions increase with time with-out limit, even for bounded inputs, the system for these functions is said tobe unstable.

response = +A e A eks t

ks tk k* *

response = k k( ) ( )( ) ( )a jb e a jb ej t j tk k+ ++

response = 2 2 2 1a b e t b aktk k k+ + =cos( ), tan ( / )), k < 0

sk

response /= 2 2 2 1a b t b ak k k k+ + =cos( ), tan ( ), == 0

sk

response = >A ekt

kk 0

response /= 2 2 2 1a b e t b aktk k k+ + =cos( ), tan ( )), k > 0

Page 379: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 363

Multiple-order poles

We now examine the situation when multiple-order poles exist. The follow-ing cases are examined.

Case IMultiple real poles exist in the left half of the s-plane. As previously dis-cussed (see Table 8.3.1), a second-order real pole (two repeated roots) givesrise to the response function

(8.72)

Because k is negative and because the exponential decreases faster than thelinearly increasing time, the response eventually becomes zero. The systemwith such poles is stable.

Case IIMultiple poles exist on the imaginary axis. The response function is madeup of the responses due to each pair of poles, and it is

(8.73)

Following the procedure discussed above for the simple complex poles, thisresult can be written

(8.74)

Because the second term is oscillatory and increases linearly with time, thesystem is unstable.

Case IIIMultiple roots exist in the right hand of the s-plane. For a double real root,for example, the solution in this case will be

(8.75)

For complex roots, the solution will be

(8.76)

response = + <( )A A t ek kt

kk

1 2 0

response = + + +( ) ( )A A t e A A t ek kj t

k kj tk k

1 2 1 2

response = + + + + +2 22 2 2 2a b t c d t tk k kcos( ) cos( kk

k kb a d c

)

tan ( ) tan ( )= =1 1/ /

response = + >( )A A t ek kt

kk

1 2 0

response = + + + +e a b t c d tktk k[ cos( ) cos(2 22 2 2 2

k kt + )]

Page 380: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

364 Signals and systems primer with MATLAB

In both cases, owning to the exponential factor, the response increases withtime and the system is unstable.

Note:

1. A system with simple poles is unstable if one or more poles of its transferfunction appear in the right half of the s-plane.

2. A system whose transfer function has simple poles is stable when all of thepoles are in the left half of the s-plane and on its boundary (imaginary axis).

3. A system with multiple poles is unstable if one or more of its poles appearon the imaginary axis or in the right half of the s-plane.

4. When all of the multiple poles of the system are confined to the left-hands-plane, the system is stable.

The impulse response of a system and the location of its poles are shownin Figure 8.7.1.

Figure 8.7.1 Location of poles and corresponding impulse response of the system.

s-plane

j

j

j

j

j

j

j

Time domain s-plane

jTime domain

× ×

×

×

×

×

×

×

×

×

×

Double

Double

0 0

1

2

0

2

4

0

0.1

0.2

–50

0

50

100

0

20

40

60

–1

0

1

–1

0

1

0

0.5

1

2 t s

4

0 2 t s

4

0 2 t s

4

0 2 t s

4 0 2 t s

4

0 2 t s

4

0 2 t s

4

0 2 t s

4

h(t

)

h(t

)

Page 381: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 365

*8.8 Feedback for linear systemsThe feedback concept is one of the most important engineering discoveriesof the last century. In general, the introduction of feedback is to adjust theoutput so that it coincides with the desired one. The following are some ofthe features that can be achieved by using feedback.

1. Stabilization of the system is possible.2. The system output sensitivity may be reduced due to the system

parameter variations.3. Reduction of input disturbance to the system is possible.4. Feedback improves the system transient response.5. Feedback improves the steady-state output.

Cascade stabilization of systems

For cascaded systems, it is possible, by selecting the appropriate transferfunctions, to cancel zeros or poles, thus producing stabilization. It was foundin Chapter 2 (see Figure 2.5.4) that the combined transfer function of twosystems in cascade is given by H(s) = H1(s)H2(s). If the first system transferfunction is of the form H1(s) = s/(s – 1.2), we observe that the pole is on theright side of the s-plane, which indicates a nonstable system. Hence, if weadd in series a second system with a transfer function of the form H2(s) =(s – 1.2)/s, the combined transfer function will be H(s) = 1. Thus, we suc-ceeded in creating a stable system because the ROC is the whole s-plane. Inpractice, however, most of the times we cannot create a system with a polehaving the exact value that is needed for stabilization. If the first system, forexample, is of the form H1(s) = s/(s – 1.2001), then the total transfer function is

and indicates an unstable combined system.In communications, for example, a signal leaves a transmitter (antenna),

propagates through space, and reaches the receiver (cell phone). Duringtransmissions, the information-carrying signal is distorted by the transferfunction of the space it traveled, known as channel. One remedy would beto create a system in front of the receiver that would be the reciprocal of thespace transfer function. This system is known as an equalizer and acts as acompensator that reduces the distortion or completely eliminates it. Forexample, let the channel transfer function be of the form

H s H s H ss

ss

ss

s( ) ( ) ( )

.. .

.= = =1 2 1 2001

1 2 1 21 20001

H ss

s1 0 5( )

.=

+

Page 382: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

366 Signals and systems primer with MATLAB

The equalizer must have a transfer function of the form

The impulse response of the above filter is . This filter isstable and can serve as an equalizer.

Most of the time, the functional form of the communication channel is notknown. One way to circumvent this difficulty, especially in slow-changingchannels, is to transmit a known signal and then design the appropriateinverse filter that eliminates the channel disturbance. The sequence of theknown signals is called the training sequence.

Parallel composition

The transfer function of two systems in parallel is given by (see also Figure2.5.4)

The transfer function of the system shown in Figure 8.8.1 is

where D(s) is the transformed desired signal and V(s) is the transformednoise that must be eliminated. If we can create a filter such that H2(s) = –H1(s),then the desired signal is detected. This type of process is known as noisecancellation. One of the important tasks of engineers is to build noise can-cellers that suppress or remove unwanted signals (noise). One common caseis when a person speaks in a microphone, as a person in a convention centeror a pilot in the cockpit, and noise is also introduced (the noise of theattendees or the engine noise). Figure 8.8.2a shows a physical setup of

Figure 8.8.1 A noise-canceling system.

H s H ss

s s2 11 0 5

1 0 51

( ) { ( )}.

.= = + = +

h t t u t2 0 5( ) ( ) . ( )= +

H s H s H s( ) ( ) ( )= +1 2

Y s D s H s H s V s( ) ( ) [ ( ) ( )] ( )= + +1 2

+

+

H1(s)

D(s)

Y(s)

H2(s)

V(s)

Page 383: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 367

the situation discussed, and Figure 8.8.2b shows the diagrammatic represen-tation of the system. From the figure we obtain

or we can write

From the above results we observe that if we introduce in the second parallelbranch a system (H3(s)) with the transfer function –H1(s)/H2(s), we are ableto eliminate the noise and receive the desired signal. A common use of sucha scheme is in telephone systems. At the receiving and sending ends, thetwo-wire transmission changes into a four-wire transmission by a deviceknown as the hybrid. The imperfection of the hybrid devices creates echoes(we hear our own voice) that we sometimes encounter during conversation.

Feedback stabilization

Figure 8.8.3 shows a simple negative feedback system with unity return (seealso Figure 2.5.2 and Figure 2.5.4). Let the open-loop transfer function beof the form

This system is unstable due to the pole at +0.6. This pole creates in the timedomain an exponential function of the form e0.6t, which becomes unboundedas t . If the open system is modified to a negative feedback system, as

Figure 8.8.2 Noise cancellation: (a) physical setup and (b) diagrammatic representation.

H1(s)

H2(s) H3(s)

+

+

(a) (b)

Voice

D(s)

+

Noise

source

V(s)

H1(s)

H2(s) H3(s)

Voice barrier

Y(s)

V(s) Y(s)

D(s)

V s H s D s V s H s H s Y s( ) ( ) ( ) ( )[ ( ) ( )] ( )1 2 3+ + =

Y s V s H s D s V s H sH sH s

( ) ( ) ( ) ( ) ( ) ( )( )( )

= + +1 21

2

= D s( )

G s G s G ss s

( ) ( ) ( )( . )( . )

= =+1 2

10 6 1 2

Page 384: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

368 Signals and systems primer with MATLAB

shown in Figure 8.8.3, the total transfer function (closed-loop transfer func-tion) is

The poles of this new system are –0.3000 + j0.4359, –0.3000 – j0.4359. Becausethe real part of both poles is negative, this indicates a sinusoidal decayingfunction in the time domain. Observe also that the closed-loop poles aredifferent than those of the open loop.

Note: An unstable system may become stable by introducing a negative feedbackpath.

Sensitivity in feedback

The input–output relation for a unit feedback system (see Figure 8.8.3) is

If we assume that there is an incremental change of the open-loop transferfunction by G(s), there will be an incremental change of the output. There-fore, we will have the following relation:

Proceeding to rearrange the above equation, we find

Figure 8.8.3 Unity feedback system.

G1

G2

_

R+

C

G = G2G

1

TCR s s

= =+ +

10 6 0 282 . .

C sG s

G sR s( )

( )( )

( )=+1

C s C sG s G s

G s G sR s( ) ( )

( ) ( )( ) ( )

( )+ = ++ +1

C sG s G s

G s G sR s C s

G s( )

( ) ( )( ) ( )

( ) ( )( )= +

+ += +

1G s

G s G sR s

G sG s

R s

G s

( )( ) ( )

( )( )

( )( )

( )

1 1+ + +

=[[ ( ) ( )][ ( )]

( )1 1+ + +G s G s G s

R s

Page 385: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 369

Since, in general, , the last expression can be approximated asfollows

We can now write the above equation in the form

(8.77)

where S(s) is called the system output sensitivity function. Since �S(s)� =�1/[1 + G(s)]� < 1, the variation of the open-loop transfer function due to theperturbation of its parameter will reduce the perturbation of the output bythe factor of �S(s)� < 1.

Rejection of disturbance using feedback

Figure 8.8.4 shows a feedback configuration that completely eliminates thedisturbance V(s). Based on the design shown and referring to Figure 2.5.2,we obtain

The above equation can be written in the form

(8.78)

It is apparent that for in the frequency range of V(s), the feed-back configuration is able to diminish and eliminate the disturbance.

Figure 8.8.4 Feedback system with an external disturbance.

G s G s( ) ( )�

C sG s

G s G sR s

G s G sG

( )( )

[ ( )][ ( )]( )

( ) ( )(+ +

=1 1 ss G s G s

R s

G sG s

)[ ( )][ ( )]( )

( )( )

1 1

1

+ +

=11 + G s

C s( )

( )

C sC s G s

G sG s

S sG s

G s( )

( ) ( )( )

( )( )

( )( )

=+

=11

C s V s G s R s C s( ) ( ) ( )[ ( ) ( )]= +

C sG s

G sR s

G sV s

G sG s

R( )( )

( )( )

( )( )

( )( )

=+

++

=+1

11 1

(( ) ( ) ( )s S s V s+

S s V s( ) ( ) 0

G(s) +_

+R(s)

V(s)

C(s)

Page 386: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

370 Signals and systems primer with MATLAB

Step response

The voltage across the capacitor of an RLC series circuit to a step input isgiven by (8.43) and is also given below with the following substitutions:

The second factor of the above equation is produced by the feedback systemshown in Figure 8.8.5a. The voltage responses for K = 5, 15, and 60 are shownin Figure 8.8.5b. We observe that we can shorten the rise time with thedrawback in creating overshoots. In this case, the percent overshoot is about25%. The rise time is defined as the time required for the response to rise

Figure 8.8.5 (a) Block diagram of a second-order system. (b) The unit step function.

E Kr= = =1 2 62, ,

Vs

Ks s K

zs =+ +

162

+ K_

Vi(s)1/[s(s + 6)]

Vzs(s)

(a)

K = 60

(b)

1.4

1.2

1

0.8

0.6

0.4

0.2

0 0 0.5

Vzx

1 1.5 2 2.5 3 3.5 4

t (s)

K = 15

K = 5

Page 387: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 371

from 10 to 90% of the steady-state value. From Figure 8.8.5b we can categorizethe step responses in three main categories. For this case, we have (a) K < 5is said to be an overdamped case, (b) K = 15 is said to be critically damped,and c) K > 15 is said to be underdamped.

Book MATLAB m-file: step8_8_1

%step8_8_1 is an m file to produce one of the

%curves of Figure 8.8.5b;n=numerator coefficient vector;

%d=denominator coefficient vector;H(s)=15/(s^2+6s+15);

n=15;d=[1 6 15];

sys=tf(n,d);

[y,t]=step(sys,4);%4 is the desired end of time axis;

plot(t,y);

text(3,1.2,'a)');%this sets the text 'a)' at point (3,1.2);

Proportional controllers

Let a voltage source be attached to an inductor. The relationship is wellknown to be equal to

where i(t) is the current in the circuit at time t, v(t) is the voltage source, andL is the inductance. Based on the above relationships, we can create a unityfeedback system made of the plant and controller. The feedback configurationis shown in Figure 8.8.6, where G2 is called the plant and G1 is called thecontroller. This particular feedback controller is known as the proportionalcontroller. Since the feedback loop transfers the output I to the summation

Figure 8.8.6 Feedback proportional controller with gain K.

Ldi tdt

v tdi tdt L

v t I sLs

V( )

( )( )

( ) ( ) (= = =or1 1

also ss H sI sV s Ls

) ( )( )( )

or 21= =

+ G1 = K G2 = 1/Ls_

V(s) I(s)E

PlantController

K/L

s + (K/L)IT

V= =

Page 388: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

372 Signals and systems primer with MATLAB

point, it is apparent that the error signal E will be zero if the input is equalto the output. The total transfer function for the feedback system is

(8.79)

with a pole at –K/L. To obtain the range of values of the gain K must taketo create a bounded feedback system, we can vary K and plot the values ofthe root in the s-plane. For the present case, as K varies from – to + thepole ranges from + to – . The trace of the values of the roots is known asthe root locus. Figure 8.8.7 shows the root locus for this case. If the systemhad additional roots, each root would have produced its own root locus(branch).

If the input is a step function, the output in LT form and in the timedomain is

We observe that at time infinity the current is equal to its input. The firstterm is known as the steady-state response iss(t). Hence, the error signal(tracking error), i(t) – u(t) = e(t) = –exp[–(K/L)t], decreases faster the largerthe gain K values are.

Example 8.8.1: The position of the mass shown in Figure 8.8.8a is foundby solving the equation

where M is the mass D is the damping factor and A is a constant. The transferfunction of this system is

Figure 8.8.7 Root locus of a proportional controller.

s-plane

0 ≤ K/L < + ∞ 0 ≤ K/L < – ∞

T sKG s

KG sK L

s K L( )

( )( ) ( )

=+

=+

2

21/

/

I sK L

s K L s s K L si t u t e( )

( ) ( )( ) ( )=

+=

++ =/

/ /or

1 1 1 ( / ) ( )K L tu t

Mdv t

dtDv t M

d x tdt

Ddx t

dtAf t

( )( )

( ) ( )( )+ = + =

2

2

G sX sF s

AMs Ds

A Ms s D M2 2( )

( )( ) [ ( )]

� =+

=+

//

Page 389: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 373

The step response of this system is unstable due to the double root ats = 0. If we use a proportional controller with unit feedback loop, as shownin Figure 8.8.6, the total transfer function is

Figure 8.8.8 (a) A mechanical system. (b) Roots for different values of gain K.

MAf(t)

D

x, v

(a)

2.5

2

1.5

1

0.5

0

–0.5

–1

–1.5

–2

–2.5–3 –2.5 –2 –1.5 –1 –0.5 0 0.5 1 1.5 2

K = –10 K = –2K = –2

K = –10K = 0

K = 0

K = 10

(b)

× × × × × × × × × ×

×

××××

×

××××

K = 10

K = 2

K = 2

T sX sF s

KG sKG s

KAMs Ds KA

s

( )( )( )

( )( )

,

� =+

=+ +

2

22

1

1

22

2

22 4= ±D

MDM

KAM

roots of the characteristtic equation Ms Ds KA2 + +

Page 390: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

374 Signals and systems primer with MATLAB

If K is positive, both roots have negative real parts and the system isstable. If K < [D2/(4MA)], both poles are real. However, if K > [D2/(4MA)],the two roots are complex conjugate, which is

If we set A/M = 0.5, D/M = 1, the transfer function becomes

Figure 8.8.8b shows the roots for different values of the gain K and Figure8.8.8c the unit step response of the feedback system.

Book MATLAB m-file: ex8_8_1

%m-file for plotting the roots of the total

%transfer function of the Ex 8.8.1; name:ex8_8_1;

for k=1:5

z(:,k)=roots([1 1 0.5*2*k]);

end;

plot(real(z(1,:)),imag(z(1,:)),'xk')%'xk'=plot black x's;

Figure 8.8.8 (continued). (c) The unit step response for two values of K.

Un

it s

tep

res

po

nse

1.5

1

0.5

00 2 4 6 8 10 12

K = 8

K = 1

t s

(c)

sDM

jKAM

DM

1 2

2

22 4, = ±

T sK

s s K( )

.. .

=+ +

0 50 2 0 52

Page 391: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 375

hold on;

plot(real(z(2,:)),imag(z(2,:)),'xk');

for m=1:5

z1(:,k)=roots([1 1 -0.5*2*k]);

end;

plot(real(z1(1,:)),imag(z1(1,:)),'xk');

hold on;

plot(real(z1(2,:)),imag(z1(2,:)),'xk');�

We must mention that the proportional controller does not always pro-duce a closed-loop stability.

Proportional integral differential (PID) controllers

Before we proceed with an example, we must mention that a proportionalcontroller is just a constant, as it was developed above. If the controller hasin integrator, its transform domain representation is proportional to 1/s. Andsimilarly, the differentiator is proportional to s. This type of controller isbasically a generalization of a proportional controller.

Example 8.8.2: The KVL of a series RLC relaxed circuit and the equivalentdifferential equation with respect to charge are

(8.80)

The LT of the second equation and the transfer function are

(8.81)

From the results of Problem 8.8.7 we observe that the transient disappearsto about 10 units of time, which may be very slow for some applications. Inaddition, the overshoot may be also objectionable.

To alleviate these objections, we can use a PID controller, which is ofthe form

(8.82)

Ldi tdt

Ri tC

i t dt v t Ld q t

dtR

( )( ) ( ) ( )

( )+ + = +1 2

2orddq t

dt Cq t v t

( )( ) ( )+ =1

Ls Q s RsQ s C Q s V s G sQ sV s

221( ) ( ) ( ) ( ) ( ); ( )

( )(

+ + =/ �)) ( )

=+ +

112Ls Rs C/

G s KKs

K sK s K s K

s1 12

33

21 2( ) = + + = + +

Page 392: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

376 Signals and systems primer with MATLAB

The feedback controller is shown in Figure 8.8.9. The configuration indi-cates that by selecting the values of Ki’s, we can create the following individualcontrollers: (a) proportional controller, K3 = K2 = 0, (b) integral controller,K3 = K1 = 0, and (c) derivative controller, K1 = K2 = 0. �

Example 8.8.3: To evaluate the PID controller, we set L = R = 1 and 1/C =1.30. The total transfer function (closed-loop transfer function) is

(8.83)

Setting K1 = 8 and K2 = K3 = 0, the step response of the P controller isgiven by

(8.84)

Setting K1 = K3 = 8 and K2 = 0, the step response of the PD controller isgiven by

(8.85)

Finally, with K1 = K3 = 8 and K2 = 4, the step response of the PID controlleris given by

(8.86)

Figure 8.8.10 shows the step responses for the above three cases and theopen-loop response with L = R = 1 and (1/C) = 1.3. �

Figure 8.8.9 The RLC series circuit with a PID controller in a unit feedback form.

+_

V(s)

PlantPID controller

G1(s) =K3s2 + K1s + K2

s

Q(s)1

Ls2 + Rs + (1/C)G2(s) =

= Q(s)

V(s)

G1(s)G2(s)

1 + G1(s)G2(s)T(s) =

T sG s G s

G s G sK s K s K

s( )

( ) ( )( ) ( ) (

=+

= + ++

1 2

1 2

32

1 231 11 1 33

21 2+ + + +K s K s K) ( . )

Q ss s s

P ( ).

=+ +

1 89 32

Q ss

ss s

PD( ).

= ++ +

1 8 89 9 32

Q ss

s ss s s

PID( ).

= + ++ + +

1 8 8 49 9 3 4

2

3 2

Page 393: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 377

*8.9 Bode plotsBode plots represent the magnitude and phase vs. frequency based on 10 baselog-log scales. The data are plotted as follows:

(8.87)

(8.88)

Bode plots are extensively used in feedback control studies since they areone several techniques used to specify whether a system is stable.

Bode plots of constants

Based on (8.87), and due to the fact that weobtain

(8.89)

Figure 8.8.10 Step responses illustrating Example 8.8.3.

1.4

1.2

1

0.8

0.6

0.4

0.2

00 5

t

10 15

Ste

p r

esp

on

ses

qP

qPID qPD

Open loop TF

decibels vs. (dB) = 20log ( ) log , log(.)H j � llog (.)10

( ) vs. log( )

C Ce C Ce Cej j j= = =0 and ,

dBpositive number

negative= =20log C

C > 1

nnumber C

C

C

<

=>

= <

1

0 1

1

Page 394: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

378 Signals and systems primer with MATLAB

For example, the number –0.5 gives –6.0206 and = or – .This means that the plot will show a straight line at height –6.0206.

Bode diagram for differentiator

The frequency transfer function, amplitude, and phase of a differentiator are

(8.90)

Since s = j , the transfer function of a differentiator is H(s) = s/1. Based onthe Book MATLAB m-file given below, Figure 8.9.1 was found.

Book MATLAB m-file: bode_differentiator

%m-file: bode_differentiator

num=[1 0];den=[0 1];

sys=tf(num,den);

w=logspace(-2,3,100);%(-2,3,100)=create 100 points

%along x-axis from 10^{-2}=0.01 to 10^{3}=1000

%in a log scale;

Figure 8.9.1 Magnitude and phase Bode plots for a differentiator.

60

40

20

0

20

4010 2 10 1

10 110 2

100

100

101 102 103

101 102 103

rad/s

rad/s

91

90.5

90

89.5

89

Ph

ase

(deg

) M

agn

itu

de

(dB

)

(b)

(a)

20 0 5log( . ) =

H j j e H j j jj

dB( ) ; ( ) log ( )( ) lo= = = =2 10 20 gg ; ( ) =

2

Page 395: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 379

[ma,ph]=bode(sys,w);

mag=reshape(ma,[100,1]);%since ma=1x1x100 it reshapes

%to 100 by 1 vector;

phg=reshape(ph,[100,1]);

subplot(2,1,1);semilogx(w,20*log10(mag),'k');

xlabel('\omega rad/s');ylabel('Magnitude (dB)');

subplot(2,1,2);semilogx(w,phg,'k');

xlabel('\omega rad/s');ylabel('Phase (deg)');

Bode diagram for an integrator

The frequency transfer function, amplitude. and phase of an integrator are(log(1) = 0):

(8.91)

If we plot the Bode diagram of an integrator, the magnitude line has theopposite inclination to that of the differentiator.

Bode diagram for a real pole

Let the transfer function of a system be given by

(8.92)

The magnitude and phase of the above transfer function for a Bode plot are

H jj

H jdB

( ) , ( ) log log , ( )= = = =120

120

2

H sp

p sH j

pp j j

p p

e( ) ( )=+

=+

=+

=

+

or1

1

1

12

jp

tan

( ) ( )= H j ej

H j

p

p( ) log log( ) log=

+

= +201

1

20 1 20 12

= +

=

2 2

1

20 1log

( ) tan

p

p(8.93)

Page 396: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

380 Signals and systems primer with MATLAB

For << p, the magnitude is about equal to –20log(~1) = 0, a constant. Forthe same case, the angle is equal to On the other hand, if

>> p, the magnitude is about equal to –20 log( /p) = –20 log( ) + 20 log(p),which is a straight line with a negative slope of –20 dB/decade. The Bodeplots are shown in Figure 8.9.2 as curves, and the approximations are shownas straight lines for the particular case when p = 1.

For the case of a transfer function having a real zero (see Problem 8.9.1),we expect the curves to be reflected with respect to the frequency axis sincethe zero is the reciprocal of the pole.

Example 8.9.1: Find the transfer function for the system shown in Figure8.9.3. Plot the s-plane of zeros and poles, the locus, and the Bode plots.

Figure 8.9.2 Magnitude and phase Bode plots for

Figure 8.9.3 The integrating circuit.

0

5

10

15

20

2510 1 100 101

rad/s

rad/s

Mag

nit

ud

e (d

B)

0

20

40

60

80

10010–1 100 101

Ph

ase

(deg

)

(b)

(a)

H j j( ) ( ).= +1 1/

=tan ( ) .1 0 0∼ ∼

R C

+ +

v1 v2

Page 397: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 381

Solution: The voltage ratio system function is

There are three critical ranges to be examined:

1. For low frequencies, H(j ) 1, with phase angle approximately zero.2. For high frequencies, H(j ) 1/(j RC), with angle approximately

–90o.3. For frequency

The appropriate figures are given in Figures 8.9.4a to c. The followingBook MATLAB m-files can be used to produce Figure 8.9.4c.

Book MATLAB m-file: ex8_9_1

%m-file for Ex8.9.1:ex8_9_1

num=[0 1];den=[1 1];

sys=tf(num,den);

bode(sys,'k',{0.1 100});

Book MATLAB m-file: ex8_9_1a

%another way to find the Body plots;

%m file: ex8_9_1a

num=[0 1]; den=[1 1];

w=0.1:0.01:100;

[mag,pha,w]=bode(num,den,w);

subplot(2,1,1);semilogx(w,20*log10(mag),'k');

xlabel('\omega rad/s');ylabel('Magnitude (dB)');

subplot(2,1,2);semilogx(w,pha,'k');

xlabel('\omega rad/s');ylabel('Phase (deg)');�

V sV s

H s Cs

RCs

RCsRC

sRC

H2

1

1

11

1

1

1( )( )

( ) , (� =+

=+

=+

jj RC

jRC

) =+

1

1

= = + = °1 1 1 1 0 707 45/ /RC H j j, ( ) ( ) . .

Page 398: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

382 Signals and systems primer with MATLAB

Figure 8.9.4 Illustration of Example 8.9.1.

s-plane

×−1/RC

(a)

j Im{H( jω)}

(b)

ω = 1/RC

Re{H( jω)}

ω = ∞ ω = 0

–45°

0

5

10

15

20

30

35

40

4550

10 1

25

45

90

0

100 101 102

Bode Diagram

3 dB 20 dB/decade

Frequency (rad/sec)

Mag

nit

ud

e (d

B)

Ph

ase

(deg

)

(c)

Page 399: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 383

Important definitions and concepts

1. One-sided Laplace transform2. Laplace transform properties3. Transfer function of systems4. Inverse Laplace transform5. Impulse response of systems using Laplace transform6. Zero-state and zero-input solutions of differential equations7. Frequency response of linear time-invariant systems8. Filtering of signals by systems9. Stability and location and order of poles

10. Cascade stabilization11. Equalizer12. Channel13. Compensators14. Parallel stabilization15. Feedback stabilization16. Sensitivity in feedback systems17. Negative and positive feedback systems18. Output sensitivity function in feedback systems19. Step response20. Percent overshoot21. Rise time of a response22. Overdamped response23. Critically damped response24. Proportional controller25. Error signal in feedback control26. Steady-state response27. Proportional integral differential controllers28. Bode plots

Chapter 8 ProblemsSection 8.1

1. Deduce the LT of the following functions:

a. Entries 5, 6, 9, and 14 in Table 8.3.1.b.

2. Find the LT and the region of convergence of the following functionsfor t 0:

t t t t t t2 2 1 1 4 2 0+ + +, ( cos ) , sin ./ for

2 3 4 2 10 1 2+ +t e t t et t, , sinh , sin ,.

Page 400: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

384 Signals and systems primer with MATLAB

3. Find the LT of the following functions for t 0:

4. Find the LT of the following functions for t 0:

Section 8.2

1. a. Find the LT of the following functions for t 0:

b. Verify your results in a by using the LT properties.2. Find the LT of the functions shown in Figure P8.2.2.

3. Apply the initial value and final value properties to the followingfunctions:

4. Find the LT of the following functions for t 0:

Figure P8.2.2

2 8

2

3t

t t

e t

e t

t

t

cos

cos

cosh

1 12+ e u t u tt , ( ) ( )

cos sin2 3t e tt

dedt

e u t et

t t3

2 2, ( ), ( / )

(a)

T

T/2A

−A

t

f(t)

t

f(t)

A

T 2T

(b)

ss

s ss

ss b

s as a b2

2

2 2 2 2 233

3++ +

++

+ +( )

e u tdg t

dtg t e dxt x

t

+ +( )( )

( )20

Page 401: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 385

5. If f(t) is an even function, find the relationship between F(s) and F(–s).Repeat for the case when f(t) is an odd function.

6. Determine the LT of the functions shown in Figure P8.2.6.

7. Find the LT of the functions shown in Figure P8.2.7 and then deducethe LT of the related h(t) using the appropriate Laplace property foreach case.

8. Find the LT of the following functions for t 0:

Figure P8.2.6

Figure P8.2.7

45°

t

−A

t1 t2

t 1 2

1

2

f(t)

t

f(t)

t0

f(t)

(b)(a) (c)

45°t

f(t)

1

t

h(t)

tt

f(t) = t2

2

1

h(t)

t

1

f(t)

t

h(t)

1

1

(c)

(b)

(a)

e bt te t btat atcos , , cos

Page 402: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

386 Signals and systems primer with MATLAB

Section 8.3

1. Draw the equivalent block diagram representation of the systemsshown in Figure P8.3.1 and find the transfer function, as indicated,for each.

2. Microphone. Draw the equivalent block diagram representation ofthe system (a microphone) shown in Figure P8.3.2 and find the trans-fer function H(s) = Eo(s)/Fa(s). In this example, the voltage is desig-nated e and the velocity v.

Figure P8.3.1

Figure P8.3.2

+

+

vo(t)

R

C

Integrating circuit

H(s) = Vo(s)/Vi(s)

i(t)

Vi(t)

(a)

(b)

M

D1

D2H(s) = V(s)/F(s)

f(t)

v(t)

(b)(a)

N 2r

S

S

R

+ L

MK

D

fa eoeo

+L

R i M

fM fD

faD

+

v

2πrNBv 2πrNBi

Page 403: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 387

3. Find the equivalent block diagram of the systems shown in FigureP8.3.3 and determine the transfer function, as indicated, in each case.

4. Determine the transfer function H(s) = C(s)/R(s) for the systemsshown in Figure P8.3.4.

Figure P8.3.3

Figure P8.3.4

R1

C R2

+ +

vo(t)

Differentiating circuit

H(s) = Vo(s)/Vi(s) Low-pass filter

H(s) = Vo(s)/Vi(s)

vi(t) vo(t)R1

C

L

R2 vi(t)

(a) (b)

+ +

+ +

H2(s)

H3(s)

_R(s) C(s)H1(s)

(a)

R(s) + H1(s) + H2(s)

H3(s)

Η4(S)

H5(s)

_ _ _+ C(s)

(b)

Page 404: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

388 Signals and systems primer with MATLAB

5. Determine the block diagram representation of the system shown inFigure P8.3.5 in the time domain and also find the transfer functionI(s)/V(s).

6. Linear and rotational mechanical systems. Determine the block dia-gram representation of the systems shown in Figure P8.3.6 in thetime domain and find their transfer functions.

Figure P8.3.4 (continued).

Figure P8.3.5

Figure P8.3.6

+ H1(s) + H2(s) + H3(s) H5(s)

H4(s)

H6(s)

H7(s)

H8(s)

_

_

__R(s) C(s)

(c)

R C

i(t)

+v(t) System

v(t)

V(s)

i(t)

I(s)

(a)

J

D

TSystem

T

Page 405: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 389

7. Find the transfer function for the systems shown in Figure P8.3.7.

8. Linear mechanical system. Find the transfer function for the systemshown in Figure P8.3.8.

Figure P8.3.6 (continued).

Figure P8.3.7

Figure P8.3.8

(b)

M1 M2

K

v2

D1

v1

f f System

v2

i(t)

RC

+

vo(t)

Systemi(t)

R1

i1 L

R2i2

R3

+v(t)

+

vo(t)

vo(t)

I(s) Vo(s)System

v(t)

V(s)

vo(t)

Vo(s)

(a) (b)

M

v

f

D

K

Systemf (t) x(t) = displacement

Page 406: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

390 Signals and systems primer with MATLAB

Section 8.4

1. Find the inverse LT of the following functions by means of partialfraction expansions. Check you result using MATLAB.

2. Find the inverse LT of the following functions:

3. Find the inverse LT of the following functions:

Section 8.5

Note: We must have in mind that y(0) means y(0+) to avoid any inconsis-tencies when input functions are discontinuous at t = 0, such as the stepfunction.

1. Solve the following differential equations by LT methods for t 0:

a. b. c.

d.

1 1 2 14 7

12

12

22 4s s

es

s s s

ss

s ++ + +

++

( )

( )(( ) ( )ss ss s

s ss s

e

++ +

++ ++ +3

2 11

2 13 52

2

2

2

2e. f.

g.22

2 21 3

s

s s( ) ( )+ +

a. b. c.

d.

as b s s s

ss

2 2 2 2 2

2

25 4

21

2 31 25

+ + +

+ +

( )

( )ee. f.

41 12 2 2( )( )s s

ss a+

a. b.

c.

63

2 53 5

5 134

2

2

2

s ss s

s s

ss s s

( ) ( )( )

(

++ +

+ +

++ ++ + +13 9 22) ( )( )

d.s

s s

a.d y t

dtdy t

dty t y

dydt

2

2 3 2 0 0 50( ) ( )

( ) ( ) ,( )+ + = = = 00

b. initially red y t

dtdy t

dty t t

2

2 3 2( ) ( )

( ) ( )+ + = llaxed

Page 407: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 391

2. Determine the driving point current in the circuits of Figure P8.5.2for t > 0. Assume that these circuits are initially relaxed.

3. Determine the currents i1(t) and i2(t) for t > 0 in the network shownin Figure P8.5.3.

4. Find the velocity v for the system shown in Figure P8.5.4 for t > 0 iff(0) = V0 and f (t) = sin( t + ).

Figure P8.5.2

Figure P8.5.3

Figure P8.5.4

c. initially relaxd y t

dty t t e t

2

235 2

( )( ) sin+ = + eed

d.d y t

dtdy t

dty t t t y

dy2

223 2 3 0 2

0( ) ( )( ) ( ) ,

(+ + = + = ))dt

= 8

+

5 sin t

R = 1

R = 1

L = 1

C = 1 C1 = 1 C2 = 0.5

R = 2

L = 1

+

e−t cos t

(a) (b)

10e−t

+

S1

L = 1

C = 1

R2 = 2 S2i1(t)i2(t)

R1 = 1

Mf(t)

D

v

Page 408: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

392 Signals and systems primer with MATLAB

5. Determine the LT of the output vo(t) for t > 0 of the system shownin Figure P8.5.5 when the input is . Use the convolutionproperty.

6. Refer to Figure P8.5.6a. Prove that the portion external to the rectan-gle can be replaced by the circuit of Figure P8.5.6b for an initiallyrelaxed system.

Hint: Consider the similarity of this result with the Thevenin theoremfor the steady state.

7. Determine the impulse response of a series RLC circuit for the fol-lowing circuit constants:

a. R = 4, C = 1, L = 1b. R = 1, C = 4, L = 1c. R = 2, C = 0.1, L = 1

Figure P8.5.5

Figure P8.5.6

v t te t( ) = 2

+

vo(t)

+v(t)

L = 1

R = 2

Passive

network +

V

S

L

R

(a)

+

L

R

V(1 e (R/L)t)

(b)

Page 409: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 393

8. Determine the impulse response of the systems shown in FigureP8.5.8.

9. Determine the impulse response of the system shown in FigureP8.5.9. The input is f(t) and the output is v2(t).

10. Use LT techniques to find the output voltage of the relaxed circuitshown in Figure P8.5.10 for an input voltage . Verifyyour results using the convolution integral method.

Figure P8.5.8

Figure P8.5.9

Figure P8.5.10

+

vi(t)

+

vo(t)

L = 1

C = 0.5

R = 2

L = 1

L = 2

R = 2 +

vi(t) vo(t)

System vi(t) vo(t) (b) (a)

+

M = 1f(t)

v1 v2

K = 1 D = 1

v t e tit( ) = > 0

C = 1 R1 = 2

R2 = 1 R3 = 4

+

vo(t)vi(t)

+

Page 410: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

394 Signals and systems primer with MATLAB

11. Ecology; environmental engineering. Consider two species that co-exist in a given region and that interact in a specific way. Denote thenumber of each species at time t by N1(t) and N2(t), respectively.Assume that the rate of change of their numbers is proportional tothe number present. Find the change in their numbers if the propor-tionality constants are a = –1, b = 0, c = 2, and d = –1. Based on thesesuggestions, the governing equations are:

b = 0 means that the second species does not compete with the firstspecies; c = 2 implies that the first species competes with the second.Next, assume that initial numbers were N1(0) = 2000 and N2(0) = 1000.Using the LT method, find the number of each species vs. time.

Section 8.6

1. Find the transfer function for the systems shown in Figure P8.6.1.

2. Deduce the transfer function for the system shown in Figure P8.6.2.

Figure P8.6.1

Figure P8.6.2

dN tdt

aN t bN tdN t

dtcN t dN t1

1 22

1 2( )

( ) ( )( )

( ) (= + = + ))

h1(t)

h2(t)

+

h3(t)

f (t) g(t)

(a)

h1(t) +

h2(t)

±

f (t) g(t)

(b)

h1(t) + h2(t)f (t)

+

h3(t)

g(t)

Page 411: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 395

3. Determine the transfer functions of the systems shown in FigureP8.6.3.

4. Determine the output of the circuits shown in Figure P8.6.4.

5. Determine and plot the magnitude filtering characteristics of thesystem shown in Figure P8.6.5.

Figure P8.6.3

Figure P8.6.4

Figure P8.6.5

d/dt

b1

+

b0

f (t)

g(t)

d/dt d/dt

b1

+b0

b2

+

f (t)

g(t)

(a) (b)

R = 2 C = 1 i(t) vo(t)

+

v(t) i(t)

R = 2 C = 0.2

+

i(t) = 2 + cos 3t System

vo(t) v(t) = 2 + cos 3t + sin 2tSystem

i(t)

(a) (b)

R = 2L = 1

C = 0.2

+vi(t) vo(t)

+

Page 412: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

396 Signals and systems primer with MATLAB

Section 8.8

1. If the transfer function of a communication channel is H1(s) =can the inverse function be considered an

equilazer?2. Let the open-loop transfer function be .

Find whether the negative closed-loop feedback system is stable orunstable.

3. Find the condition for eliminating the disturbance for the feedbacksystem shown in Figure P8.8.3.

4. Let the plant shown in Figure 8.8.6 have some imperfection given by1/[L(s – )] for some small > 0. Find the values of K of the feedbacksystem with a proportional controller that is stable. Also plot the rootlocus.

5. Find the steady state and transient response of the system describedby (8.79) if the input is the function . Equation(8.79) is the total transfer function of a simple inductor with a pro-portional feedback controller.

6. Find the velocity of the mass given in Example 8.8.1 if A/M = 0.5,D/M = 1, and K takes values 0.8 and 0.6. Compare your results tothose given in the example. Use the method of partial fractionexpansion.

7. Set L = 1, R = 1, and (1/C) = 1.3 in (8.81) and find the unit stepfunction response.

Section 8.9

1. Plot the Bode diagram of the transfer function H(s) = 1 + s.2. Plot the Bode diagrams for the transfer function

Use and

Figure P8.8.3

s s a s a2/[( )( )], H s11( )

G s s s( ) /[( . )( . )]= +1 1 1 1 9

G(s) +

H(s)

_

R(s)+

C(s)

V(s)

v t A t u t( ) cos ( )= 0

H ss ss j

r

r r s j

( )=

=

=+ +

2

2 22

r = 1 = 0 1 0 5 1 5. , . . .and

Page 413: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 397

3. Draw the Bode diagrams for the transfer function and its asymptotes.The transfer function is

Appendix 8.1: Proofs of Laplace transform propertiesLinearity

This property is the result of the linear operation of an integral.

Time derivative

Integral

Note that the term

is the LT of a step function of amplitude

.

H ss

ss j( )

== 2

Ldf t

dtdf t

dte dt f t est st( ) ( )

( )= =0 0

ff tde

dtf s f t e dt

sF s

stst( ) ( ) ( )

( )

= +

=

0 00

ff f t ets( ); lim ( )0 only for functions that tt = 0

L f x dx f x dx et t

st( ) ( )=0

ddt f x dxddt

es

e

t st

=

=

( )0

+st t st

sf x dx

es

ddt

f x dx( ) ( )0

0

tt s

s

dte

sf x dx

es

f x dx

=

+

( )

( )0

+ = +0

0

01 1s

f t e dtF s

s sf t dt f tst( )

( )( ) ; ( ))dt =

0

initial

value of the integral of ff t t f x dx( ) ( )at = 0; the value of must b ee finite

( / ) ( )10

s f t dt

f t dt( )0

Page 414: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

398 Signals and systems primer with MATLAB

This factor is a very important result in network problems since it showsthat initial conditions associated with integral functions are automaticallystep functions in the LT development.

Multiplication by exponential

provided that has zero value.

Multiplication by t

Time shifting

By setting x = t – a, we obtain for t = 0, x = –a; for t = , x = ; dx = dt andt = x + a. Therefore, the above equation becomes

where a is a positive constant.

Complex frequency shift

Scaling

L{ ( )}( )

( ) ( )e f t e dts a

eat s a t s a t+ += =+0 0

1 =+1

s a

e s a+( )

L{ ( )} ( ) ( )tf t tf t e dt f tdeds

dtstst

= = =0 0

ddds

f t e dtdds

F sst( ) ( )=0

L{ ( ) ( )} ( ) ( )f t a u t a f t a u t a e dtst=0

L{ ( ) ( )} ( ) ( ) ( )( )f x u x f x u x e dx e f xs x a

a

sa= =+ ee dx e F ssx sa=0

( )

L{ ( )} ( ) ( )( )e f t e f t dt e f t dts t s s t s t0 0

0 0= = = =F s F s s( ) ( )0

L f at f at e dt f x e d x ast s a x( ) ( ) ( ) ( )( / ){ } = = =0

/11

00 a

Fsa

a >

Page 415: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 8: Laplace transform 399

Time convolution

where we set t – x = y, and for t = 0, y = –x (but h(y) = 0 for y < 0 and thesecond integral starts from 0); for t = , y = . We also find that dt = dy.

Initial value

Taking the limit of the above equation, we find

where the exchange of integral and limit operations was performed due tothe linearity of the two operators. The initial value theorem does not applyfor functions that have an impulse (delta function) at t = 0.

Final value

provided that f(t) exists as the value of t approaches infinity.

L L{ ( ) ( )} ( ) ( ) ( )f t h t f x h t x dx f x h= =0

(( )

( ) ( )

t x dx e dt

f x dx h t x e

st

st=

00

ddt f x dx h y e dy

f x e

s y x

00 00

+=

=

( ) ( )

( )

( )

ssx sydx h y e dy F s H s( ) ( ) ( )=00

Ldf t

dtdf t

dte dt sF s fst( ) ( )

( ) ( )= =0

0 orr sF sdf t

dte dt fst( )

( )( )= + 0

0

lim ( ) ( ) lim (s s

stsF s f t e dt f= +� �0

0)) ( )= f 0

df tdt

e dt sF s xdf t

dtst

s

( )( ) ( ) lim

( )=0 0

0 or � ee dtdf t

dte dt

df t

st

s

st=

=

0 00

( )lim( )

(

))( ) ( ) lim[ ( ) ( )] lim

dtdt f f sF s x

s0 0

0 0= = =�ss

t s

sF s x

f t sF s=

0

0

0�

� �

( ) ( )

lim ( ) lim ( )

or

Page 416: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

401

chapter 9

The z-transform, difference equations, and discrete systems

The z-transform method provides a powerful tool for solving differenceequations of any order, and hence plays a very important role in digitalsystems analysis. This chapter includes a study of the z-transform, its prop-erties, and its applications.

The z-transform method provides a technique for transforming a differ-ence equation into an algebraic equation. Specifically, the z-transform convertsa sequence of numbers {

y

(

n

)} into a function of complex variable

Y

(

z

), therebyallowing algebraic process and well-defined mathematical procedures to beapplied in the solution process. In this sense, the z-transform plays the samegeneral role in the solution of difference equations that the Laplace transformplays in the solution of differential equations, and in a roughly parallel way.Inversion procedures that parallel one another also exist.

9.1 The z-transform

To understand the essential features of the z-transform, consider a

one-sidedsequence

of numbers taken at uniform time intervals. This sequencemight be the values of a continuous function that has been sampled atuniform time intervals; it could, of course, be a number sequence, e.g., thevalue of the amount that is present in a bank account at the beginning ofeach month, including the interest. This number sequence is written

(9.1)

We now create the series

(9.2)

{ ( )}y n

{ ( )} { ( ), ( ), ( ), , ( ), }y n y y y y n= … …0 1 2

Y zyz

yz

yz

y y z y( )( ) ( ) ( )

( ) ( ) (= + + + = + +−0 1 20 1 2

0 21� ))z− +2 �

7267_book.fm Page 401 Thursday, November 2, 2006 3:28 PM

Page 417: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

402 Signals and systems primer with MATLAB

In this expression, z denotes the general complex variable and

Y

(

z

) denotesthe z-transform of the sequence {

y

(

n

)}. In this more general form, theone-sided z-transform of a sequence {

y

(

n

)} is written

(9.3)

This expression can be taken as the definition of the one-sided z-transform.Since the exponent of the

z

’s is equal to the distance from the sequenceelement

y

(0), we identify the negative exponents as the amount of delay.This interpretation is not explicit in the mathematical form of (9.3), but it isimplied when the shifting properties of functions are considered. This sameconcept will occur when we apply the z-transform to the solution of differenceequations. Initially, however, we study the mathematics of the z-transform.

When the sequence of numbers is obtained by sampling a function

y

(

t

)every

T

seconds — for example, by using an analog-to-digital (A/D) con-verter — the numbers represent sample values

y

(

nT

) for

n

= 0, 1, 2, …. Thissuggests that there is a relationship between the Laplace transform of acontinuous function and the z-transform of a sequence of samples of thefunction at the time constants … –

nT

, –(

n

– 1)

T

, … –

T

, 0,

T

, 2

T

, …,

nT

,(

n

+ 1)

T

, …. To show that there is such a relationship, let

y

(

t

) be a functionsampled at time constants

T

seconds apart. The sampled function is (see (6.2))

(9.4)

The Laplace transform of this equation is

(9.5)

noting that the Laplace operator operates on time

t

. If we make the substi-tution

z

=

e

sT

, then

(9.6)

Hence,

Y

(

z

) is the z-transform of the sequence of samples of

y

(

t

), namely,

y

(

nT

), with

n

= 0, 1, 2, …. From this discussion, we observe that the

Y z y n y n z n

n

( ) { ( )} ( )� Z = −

=

∑0

y t y t comb t y nT t nTs T

n

( ) ( ) ( ) ( ) ( )= = −=−∞

∑ δ

Y s y t y nT t nTs s

n

( ) { ( )} ( ) ( )� L L= −

=−∞

∑ δ

= −

=

=−∞

=−∞

y nT t nT

y nT e

n

nTs

n

( ) { ( )}

( )

L δ

Y s y nT z Y zs z e

n

n

sT( ) ( ) ( )=

=−∞

= =∑

7267_book.fm Page 402 Thursday, November 2, 2006 3:28 PM

Page 418: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 9: The z-transform, difference equations, and discrete systems 403

z-transform may be viewed as the Laplace transform of the sampled timefunction

y

s

(

t

), with an appropriate change of variables. This interpretationis in addition to that given in (9.3), which, as already noted, specifies that

Y

(

z

) is the z-transform of the number sequence {

y

(

nT

)} for

n

= … –2, –1, 0,1, 2, … The above equation is the two-sided z-transform.

Example 9.1.1:

Deduce the z-transform of the discrete function

Solution

:

From the defining equation (9.3), we write

Observe that this function possesses a second-order pole at the origin anda zero at –2. Observe that

y

(

n

) could be written as

y

(

n

) =

δ

(

n

– 1) + 2

δ

(

n

– 2).The definition of the discrete delta function is

(9.7)

Example 9.1.2:

Deduce the z-transform of the function

which is sampled every

T

seconds, that is, at times

t

=

nT

.

Solution

:

The sampled values are

The z-transform of this sequence is written

y n

n

n

n

n

( ) =

=

=

0 0

1 1

2 2

0 3

Y zz z

z zz

z( ) = + = + = +− −1 2 2

21 2

2

δ( )nn

n=

=

1 0

0 0

f t Ae tat( ) = ≥− 0

{ ( )} , , ,f nT A Ae AeaT aT= …− −2

F z Ae

ze

ze

z

aT aT aT

( ) = + +

+

+

− − −

12 3

7267_book.fm Page 403 Thursday, November 2, 2006 3:28 PM

Page 419: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

404 Signals and systems primer with MATLAB

The series can be written in closed form, recalling that

Thus, we have that

(9.8)

The convergence is satisfied if

Example 9.1.3:

Deduce the z-transform of the function

which is sampled at time intervals

T

= 0.1 s.

Solution

:

We use the results of Example 9.1.2 to write

Example 9.1.4:

Find the z-transform of the given functions when sam-pled every

T

seconds:

a.b.c.d.

Solution

:

a. (9.9)

11

1 11 2 3

−= + + + + <

xx x x x�

Z{ ( )} ( )e u nT F zAe

z

Ae z

Azz

anTaT aT

−− − −=

−=

−=

−�

11 1 ee aT−

e z e z z eaT aT aT− − − − −= < >1 1 1 or

f t e e tt t( ) = + ≥− −2 02

F zz

z ez

z ez

zz

z( )

. .. .=

−+

−=

−+

−− −0 1 0 2

20 9048

20 81877

3 2 62831 7235 0 7408

2

2= −

− +z

z z.

. .

f t u t( ) ( )=f t tu t( ) ( )=f t e u t bbt( ) ( )= >− 0f t t u t( ) sin ( )= ω

Z Z{ ( )} { ( )} ( ) (f nT u nT u nT z z zn

n

= = = + +−

=

∞− −∑

0

1 21 ++

=−

=−

>−

�)

11 1

11zz

zz

7267_book.fm Page 404 Thursday, November 2, 2006 3:28 PM

Page 420: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 9: The z-transform, difference equations, and discrete systems 405

b.

c. (9.11)

d. (9.12)

The inequalities that appear in the solutions are found from the fact thatthe summations to converge the factor of the geometric series must have anabsolute value of less than 1 (see Section 9.2). �

9.2 Convergence of the z-transformThe function F(z) for a specified value of z may be either finite or infinite.The region of convergence (ROC) is the set of values of z in the complexz-plane for which the magnitude of F(z) is finite, whereas the set of valuesof z for which the magnitude of F(z) is infinite is the region of divergence.The region of convergence is determined by considering the defining expres-sion (9.3) and examining the complex values of z for which

Z Z{ ( )} { ( )} ( )f nT nTu nT nTu nT z Tzn

n= = = +=

∞− −∑

0

1 2TTz Tz

Tzddz

z z z Tzddz

− −

− − −

+ +

= − + + + = −

2 3

1 2 3

3 �

�( ) [zz z z z

Tzddz

zz

z

− − − −

+ + + +

= −−

=

1 1 2 3

1

1

1

( )]�

TTzz

z( )−

>1

12

(9.10)

Z Z Z{ ( )} { ( )} { ( ) }; ;f nT e u nT u nT c c ebnT n bT= = =

=

− −

uu nT c z c z c zc z

n n

n

( ) − −

=

∞− − − −

−∑ = + + + =−

0

1 1 2 211

11

� −−

−−=

−=

−=

−>

1

1 1cz

czze

zez

z ez e

bT

bT bTbT

Z Z Z{ ( )} { ( )sin } ( )f nT u nT nT u nTe ej nT j nT

= = − −

ωω ω

2jj

u nTj

c zu nT

jn

n n

n

= −=

∞− −

=∑ ( ) ( )

2 20

1

0

∞∞− − −∑ = =

=−

c z c e c e

jc z

c zc

n n j nT j nT2 1 2

1

1

12 1

; ,ω ω

22

221 2 1

1z

c zz T

z z Tz

=

− +>sin

cosω

ω

f nT z n

n

( ) −

=

∑0

7267_book.fm Page 405 Thursday, November 2, 2006 3:28 PM

Page 421: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

406 Signals and systems primer with MATLAB

has finite values. If we write z in polar form, , then

(9.13)

since For this sum to be finite, we find num-bers M and R such that Thus,

(9.14)

For this sum to be finite, it is required that R/r < 1 or r > R. That is, F(z)is absolutely convergent for all z in the region where A separatetest is required to establish whether the boundary belongs in the ROC.

Example 9.2.1: Find the z-transform of the signal specified and discussits properties.

(9.15)

The real constant c takes the values (a) 0 < c <1 and (b) c > 1.

Solution: The time sequences for the two cases are shown in Figures 9.2.1aand b. The z-transform is given by

(9.16)

Initially, we consider the sum of the first n terms (up to the term) ofthis geometric series, which is given by

(9.17)

Next, we set c–1z = c–1|z| ejθ, where θ is the argument of the complex numberc–1z. Hence, we write (c –1z)–n = (cz–1)n = (cr–1e–jθ)n = (c|z|–1)n e–jθn.

z rej= θ

f nT z f nT re f nT rn

n

j n

n

n

n

( ) ( )( ) ( )−

=

∞−

=

∞−

=∑ ∑= =

0 0

θ

00 0

∞− −

=

∑ ∑=e f nT rj n n

n

θ ( )

| | [cos sin ] ./e n nj n− = + =θ θ θ2 2 1 2 1| ( )| .f nT MR nn≤ ≥for 0

f nT z M R r MRr

n

n

n n

n

n

n

( ) −

=

∞−

=

=

∑ ∑ ∑≤ =

0 0 0

|| .z r R= >

f nc n

n

n

( ), , ,

, ,=

=

= − −

0 1 2

0 1 2

F z c z c z c z c zn n

n

n

n

( ) ( ) ( )= = = + +−

=

∞− −

=

∞− −∑ ∑

0

1

0

1 11 22 1+ + +−� �( )c z n

( )c z n− −1 1

Fc z

c zc zc z

n

n n

= −−

= −−

− − +

11

11

1 1 1

1

1

1

( ) ( )( )

7267_book.fm Page 406 Thursday, November 2, 2006 3:28 PM

Page 422: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 9: The z-transform, difference equations, and discrete systems 407

Case 1

For values of z for which |cz–1| < 1 for real c), themagnitude of the complex number approaches zero as n → ∞. As aconsequence,

(9.18)

Case 2

For the general case where c is a complex number, the inequalityleads to |c| < |z|, which implies that the series converges when |z| > |c| anddiverges when |z| < |c|. Thus, we see that the ROC and divergence in thecomplex z-plane for F(z) are those shown in Figure 9.2.1c.

To establish whether the boundary of the circle in Figure 9.2.1c belongsto the ROC, we apply L’Hospital’s rule to (9.17). Thus,

Figure 9.2.1 Discrete signal cn.

… …

1.5

0.5

00 5 10

n

(a) (b)

n

15 00

2

4

f(n

), c

> 1

f(n

), c

< 1

6

8

5 10 15

1

x x

jy

Region of

convergence

c

(c)

Region of

divergence

(| | ||| | | |cz c z c z− − −= =1 1 1

( )cz n−1

F z F zcz

zz c

cz z cn

n( ) lim ( )= =−

=−

< >→∞ −

−11

111 or

| |cz− <1 1

7267_book.fm Page 407 Thursday, November 2, 2006 3:28 PM

Page 423: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

408 Signals and systems primer with MATLAB

and hence . Clearly, the boundary belongs to the region ofdivergence. �

Example 9.2.2: Deduce the z-transform and discuss the properties of theimpulse functions

(9.19)

(9.20)

Solution: From the basic definition of the z-transform we write that

Since Y(z) is independent of z, the entire plane is the ROC. By an applicationof the basic definition, (9.20) becomes

Since only for z = 0, the entire z-plane is the ROC except for aninfinitesimal part of the region. �

Example 9.2.3: Deduce the z-transform of the function

(9.21)

Indicate the ROC, the region of divergence, and the poles and zeros in thez-plane.

Solution: The given functions are shown in Figures 9.2.2a and b for twodifferent values of a. Clearly, for a = 1, the function is a sinusoidal discretesignal. The z-transform is given by

lim ( ) lim ( )( )

(

z cn

z c

n

F z

dd cz

cz

dd cz

→ →

−−

=−( )1

11

111

1 1

11

)( )

lim( )

−( )= −

−=

− →

− −

cz

n czn

z c

n

lim ( )z c

nF z→

→ ∞

y n nn

n( ) ( )= =

=

δ

1 0

0 0

y n n Nn N

n N( ) ( )= − =

=

δ

1

0

Y z z z( ) ( ) ( )= + + = + + + =− −δ δ0 1 1 0 0 10 1 � �

Y z n N z z z z zn

n

N N( ) ( ) (= − = + + + +−

=

∞− − − − +∑δ

0

0 10 0 1 0� 11) + = −� z N

Y z( ) → ∞

y na n n a

n

n

( )sin

=≥ >

<

ω 0 0

0 0

7267_book.fm Page 408 Thursday, November 2, 2006 3:28 PM

Page 424: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 9: The z-transform, difference equations, and discrete systems 409

Next, multiply the numerator and denominator of this expression by z2 tofind

Figure 9.2.2 Discrete signal an sin nω, its poles, zeros, and ROC.

1

0.8

0.6 0 < a < 1

a > 1

0.4

0.2y(n

)

y(n

)

–0.2

–0.4

0

0 10 20n

(a)

30 40

20

10

–10

–20

–30

0

0 10 20n

(b)

30 40

x

x

jy

x1–1

–ω

Region of

convergence

(c)

Y z a n z ae e

jzn n

n

njn jn

n

n

( ) sin= = −−

=

∞ −−

=

∑ ∑ωω ω

0 02

== − =−

=

∞− −

=

∑ ∑12

12

12

1

0

1

0j

ae zj

ae zj n

n

j n

n

( ) ( )ω ω

jj ae z ae z

z aa

j j

11

11

1 2

1 1

1

−−

=−

− − −

ω ω

ωsinzz a z

z a− −+>

1 2 2cos ω

(9.22)

Y zza

z a z aza

z a j( )

sin(cos )

sin[ cos

=− +

=− −

ωω

ωω2 22 aa z a ja

zaz ae z aej

sin ][ cos sin ]

sin( )(

ω ω ω

ωω

− +

=− − −−jω )

(9.23)

7267_book.fm Page 409 Thursday, November 2, 2006 3:28 PM

Page 425: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

410 Signals and systems primer with MATLAB

The zeros and poles are shown in Figure 9.2.2c for the case a < 1.To examine the ROC, consider the summations in (9.22). It is seen that

each summation converges if Thisregion is shown in Figure 9.2.2c.

Book MATLAB m-file: ex_9_2_3

%m-file:ex9_2_3

n=0:35;

y1=0.9.^n.*sin(0.1*pi*n);

y2=1.1.^n.*sin(0.1*pi*n);

subplot(2,2,1);stem(n,y1,'k.');

xlabel('n');ylabel('y(n)');

hold on;text(25,0.6,'0<a<1');

hold on;text(35,0.8,'a)');

subplot(2,2,2);stem(n,y2,'k.');

xlabel('n');ylabel('y(n)');

hold on;text(10,-20,'a>1')

hold on;text(35,10,'b)'); �

When the sequence {y(k)} has values for both positive and negative k,the region of convergence of Y(z) becomes an annular ring around the originor Y(z) does not have a region of convergence. Let us consider the sequence

This is a bilateral function, and the definition of the bilateral z-transform isgiven by

(9.24)

For our specific function,

The first summation converges as provided that Ifwe set R+ = 3 for positive n’s, we see that the region of convergence for

| | | || | | | || .ae z az e az z aj jω ω− − −= = < >1 1 1 1 or

y nn

n

n

n( ) =

<

3 0

4 0

Z{ ( )} ( )y n y n z n

n

= −

=−∞

Y z z z zn n

n

n n

n

n n

n

n( ) = + = +−

=

∞−

=−∞

−−

=

∞−∑ ∑ ∑3 4 3 4

0

1

0

zz z zn

n

n n

n

n n

n=∞

=

∞−

=

∑ ∑ ∑= +1

0 1

3 4

n → ∞ | | || .3 1 31z z− < >or

7267_book.fm Page 410 Thursday, November 2, 2006 3:28 PM

Page 426: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 9: The z-transform, difference equations, and discrete systems 411

positive n’s is Similarly, the second summation will converge ifand the region of convergence for negative n’s is |z| < R

with R– = 4. The sequence y(n) and the region of convergence depicted bythe double-line region are shown in Figures 9.2.3a and b, respectively.

The reader can easily show, following parallel steps to the above, thatthe sequence

has no region of convergence.From the foregoing discussion, we conclude that:

1. The region of convergence of a two-sided sequence is a ring in thez-plane centered at the origin.

2. The region of convergence of a sequence of finite duration is theentire z-plane, except possibly the points or z = ∞.

Figure 9.2.3 ROC for a two-sided sequence.

10

8

6

4

2

0–3 –2 –1 0

n(a)

1 2 3

9.0

3.0

1.0

1/41/16

y(n

)

……

R+

R–

x

jy

4 3

ROC

(b)

|| .z R> +

| | ||4 1 41− < <z zor

y nn

n

n

n( ) =

<

4 0

3 0

z = 0

7267_book.fm Page 411 Thursday, November 2, 2006 3:28 PM

Page 427: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

412 Signals and systems primer with MATLAB

3. If the sequence is right-handed, that is, n ≥ 0, then the region ofconvergence is beyond a circle of finite radius.

4. If the sequence is left-handed, that is, n < 0, then the region ofconvergence is within a circle of finite radius.

The following example shows why it is important to specify the regionof convergence.

Example 9.2.4: Specify the regions of convergence for the two sequences

(9.25)

Solution: The z-transform of the first sequence is

(9.26)

For convergence, we must have which implies that the region ofconvergence is |z| > a.

The z-transform of the other sequence is

(9.27)

The region of convergence for this function is found as follows: |a–1 z| < 1 or|z| < a. We observe that although the two sequences are completely differentin the time domain (one increases positively with positive time and the otherdecreases absolutely with negative time), they have the same function intheir z presentation. However, each one has its own ROC, and this distin-guishes one sequence from the other. The inverse z-transform is an integralwhere the integration path is inside the ROC. Therefore, to find the righttime function, the integration must be conducted inside the correspondingROC. �

9.3 Properties of the z-transformThe most important properties of the z-transform for one-sided sequencesare given next. The properties are summarized and accompanied by exam-ples to elucidate their use. At the end of this chapter, in Appendix 9.1, weprovide the proofs. The one-sided sequences are of great importance because

x n a a n

y n a a n

n

n

( ) , , , ,

( ) , , ,

= > =

= − > = − − −

1 0 1 2

1 1 2

� a)

33, � b)

X z azaz

zz a

n

n

( ) ( )= =−

=−

=

−∑ 1

01

11

| | ,az− <1 1

Y z a z a z a zn n

n

n n

n

n n

n

( ) = − = − = − +−

=−

−∞−

=

∞−

=

∑ ∑ ∑1 1 0

111

11

1= −

−+ =

−−a zz

z a

7267_book.fm Page 412 Thursday, November 2, 2006 3:28 PM

Page 428: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 9: The z-transform, difference equations, and discrete systems 413

all detected signals are of finite extent and their starting points can alwaysbe referenced at t = 0 (n = 0).

Summary of z-transform properties

1. Linearity2. Right-shifting property

a. zero intial conditions

b. initial conditions present

3. Left-shifting property

4. Time scaling

5. Periodic sequence

N = number of time units in a periody(1)(n) = first period

6. Multiplication by n

7. Initial value

8. Final value provided (∞) exists

9. Convolution

10. Bilateral convolution

Example 9.3.1: Shifting property. Find the z-transform of the functionsshown in Figures 9.3.1a and b using the right-shifting property.

Solution: First, consider the z-transform of the unit step function u(n)shown in Figure 9.3.1b, which is given by

Z Z Z{ ( ) ( )} { ( )} { ( )}ax n by n a x n b y n+ = +

Z Z{ ( )} { ( )} ( )y n m z y n z Y zm m− = =− −

Z{ ( )} ( ) ( )y n m z Y z y i m zm i

i

m

− = + −− −

=

∑0

1

Z{ ( )} ( ) ( )y n m z Y z y i zm m i

i

m

+ = − −

=

∑0

1

Z{ ( )} ( ) ( )a y n Y a z a zn

n

n= =− −

=

∞−∑1 1

0

Z Z{ ( )} { ( )},( )y nz

zy n

N

N=− 1 1

Z{ ( )}( )

ny n zdY z

dz= −

y n z Y z y n n nn

z( ) ( ) ( )0 0

0 0= = <→∞

for

lim ( ) lim( ) ( )n n

y n z Y z→∞ →

−= −1

11

Z Z Z{ ( )} { ( ) ( )} ( ) ( )y n h n x n h n m x mm

= ∗ = −

=

∑0

= H z X z( ) ( )

Z Z Z{ ( )} { ( ) ( )} ( ) ( )y n h n x n h n m x mm

= ∗ = −

=−∞

= H z X z( ) ( )

U z u n z z z zz

zz

n

n

( ) ( )= = + + + + =−

=−

=

∞− − −

−∑0

1 2 31

11

1�

−− 1

7267_book.fm Page 413 Thursday, November 2, 2006 3:28 PM

Page 429: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

414 Signals and systems primer with MATLAB

The discrete-time function in Figure 9.3.1a is y(n) = u(n – 2). The z-transformof this equation is

The pole-zero configurations are shown in Figure 9.3.1c. We observe fromthis figure that U(z) does not have poles at zero, whereas the combinationof its shifted version y(n) does possess poles (single) at the origin for thisparticular shifting. �

Example 9.3.2: Shifting property. Find the z-transform of an RL seriescircuit, with a voltage input and the current as the output. The initial con-dition is i(0) = 2. Discretize the analog system.

Solution: The Kirchhoff voltage law (KVL) is

Figure 9.3.1 Shifted discrete signal.

1.5

0.5

y(n

)

1

0

1.5

0.5

u(n

)

1

00 2 4 6

n

(a)

8 10 0 2 4 6n

(b)

8 10

… …

x x1–1 Re(z)

jIm (z)

U(z)

jIm (z)

Re(z)1

(c)

–1

Y(z)

x

Z Z Z{ ( )} { ( )} { ( )}(

y n u n z u nz

zz z z

= − = =−

=−

−21

11

12

2 ))

Ldi tdt

Ri t v t( )

( ) ( )+ =

7267_book.fm Page 414 Thursday, November 2, 2006 3:28 PM

Page 430: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 9: The z-transform, difference equations, and discrete systems 415

The discretized form of the above equation is given by

or

Taking into consideration the linearity and shifting property, we obtain

Finally, we obtain the algebraic relation

Example 9.3.3: Time scaling property. The z-transform offor n = 0, 1, 2, … is equal to (see (9.12) with T = 1).By application of the scaling property, we can write the z-transform of thefunction by inserting a–1z for z. This substitution leads to

The result is the same as (9.23), which was deduced by a different approach.�

Example 9.3.4: Left-shifting property. Find the z-transform of the out-put of the system shown in Figure 9.3.2.

Solution: From the diagram, the difference equation that describes thesystem is

Li nT i nT T

TRi nT v nT

( ) ( )( ) ( )

− − + =

i nTT

RL

i nT TTL T

RL

v nT( ) ( ) ( )−+

− =+

1

1

1

1

I z a z I z i zTL

aV z aT

RL

( ) [ ( ) ( ) ] ( )− + − = =+

− −1 00 01

1

I zaaz

TL

aaz

V z( ) ( )=−

+−− −

21 11 1

y n n( ) sin= ωz z zsin ( cos )ω ω/ 2 2 1− +

a y n a nn n( ) sin= ω

Z{ sin }sin

cosa n

a za z a z

n ω ωω

=− +

− −

1

2 2 12 1

δ δ( ) ( ) ( ) ( ) ( ) ( )n y n y n y n y n n+ − = + + + = +1 3 1 1 3 1or

7267_book.fm Page 415 Thursday, November 2, 2006 3:28 PM

Page 431: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

416 Signals and systems primer with MATLAB

Take the z-transform of both sides of the equation, recalling the linearity andthe left-shifting property, with the result

which, by applying the left-shifting property, yields

Example 9.3.5: Periodic sequence property. Find the z-transform of thesequence shown in Figure 9.3.3.

Solution: Use periodic sequence property No 5 with N = 4 to find

Figure 9.3.2 First-order discrete system.

Figure 9.3.3 Periodic discrete function.

+

z–1

3

y(n + 1)

y(n)

_

δ(n + 1)

Z Z Z{ ( )} { ( )} { ( )}y n y n n+ + = +1 3 1δ

zY z zy Y z z Y zz y

z( ) ( ) ( ) ( )

[ ( )]− + = = ++

0 31 0

3or

Y zz

zy n

zz

z zz

( ) { ( )} ( )(

( )=−

=−

+ + =− −4

4 1

4

41 2

2

1 11Z

zz zz

2

4

11

+ +−

)

1.5

0.5

y(n

)

00 1 2 3 4 5

n6 7 8 9 10

1

7267_book.fm Page 416 Thursday, November 2, 2006 3:28 PM

Page 432: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 9: The z-transform, difference equations, and discrete systems 417

Example 9.3.6: Multiplication by n property. Deduce the z-transformof the functions .

Solution: Since then multiplication by n property No 6,we have

We can continue this procedure to find

Because n(n + 1) = n2 + n, we use the linearity property and, adding theresults above, find Z{n(n + 1)u(n)} = Z{n2 u(n)} + Z{nu(n)} = 2z2/(z – 1)3.Similarly, for the last case we find Z{n(n – 1)u(n)} = Z{n2 u(n)} – Z{nu(n)} =2z/(z – 1)3.

Example 9.3.7: Initial value property. To find the initial value of thefunction given by (9.23), we proceed as follows:

which agrees with the value deduced from (9.21). �

Example 9.3.8: Final value property. We know that the z-transform ofthe function is and therefore the final valueproperty is given by

as it should be. �

Example 9.3.9: Convolution property. The input signal sequence x(n)and the impulse response h(n) of a system are shown in Figures 9.3.4a and b.Deduce the output of the system w(n).

Solution: Figures 9.3.4a and b show the input function x(n) and theimpulse response function h(n) of the system. Figure 9.3.4c shows the reflected

nu n n u n n n u n n n u n( ), ( ), ( ) ( ), ( ) ( )2 1 1+ −

Z{ ( )} ( ),u n z z= −/ 1

Z{ ( )}( )

nu n zddz

zz

zz

= −−

=−1 1 2

Z Z{ ( )} { [ ( )]}( )

(n u n n nu n z

ddz

zz

z221

= = −−

= zzz

+−

11 3

)( )

y z Y zz a

az a zzz

( ) ( )sin

cos0

1 20

1

1 2 2= =

− +→∞

− −→∞

ωω

== 0

y n u nn( ) . ( )= 0 9 Y z z z( ) ( . ),= −/ 0 9

lim( ).

lim. .z z

zz

zz

z→

→−

−= −

−= −

−1

1

11

0 91

0 91 1

1 0 9== 0

7267_book.fm Page 417 Thursday, November 2, 2006 3:28 PM

Page 433: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

418 Signals and systems primer with MATLAB

function x(0 – m) in the m-domain with zero shift. In the same figure we haveplotted the impulse function in the m-domain. From the figure we see thatthere is an overlap at 0, and their multiplication gives us a zero result. Hence,the first value of the output at n = 0 is w(0) = 0. The output is plotted on theright-hand side of the same figure as a function of n. The left part of Figure9.3.4d shows the input function x(m) shifted by one to the right (a positivenumber, +1, was introduced) and was plotted in the m-domain. The impulse

Figure 9.3.4 Convolution of two discrete functions.

1.5

1

0.5

x(n

)

00 1 2

n

(a)

3 4 5

1.5

1

0.5

h(n

)

00 1 2

n

(b)

3 4 5

(c)

1.5

0.5

–4 –2 0 2 4

m

0 1 2 3 4

n

x(0 – m)

x(0

– m

), h

(m)

h(m)

0

1

1.5

0.5

x(0 – 0) h(0) = 1 × 0 = 0 = w(0)w

(n)

0

1

(d)

1.5

0.5

x(1

– m

), h

(m)

1

0

1.5

0.5

w(n

)

1

0–2 0

m

2 4 0 1 2 3

n

x(1 – 0) h(0) + x(1 – 1) h(1) =

1 × 0 + 1 × 0.5 = 0.5 = w(1)

4 5

7267_book.fm Page 418 Thursday, November 2, 2006 3:28 PM

Page 434: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 9: The z-transform, difference equations, and discrete systems 419

response was also plotted in the m-domain. Next, we multiplied point bypoint the two functions and added the result. The value found is shown asthe number 0.5 at n = 1 in the right-hand figure. However, we have plottedthe output function w(n) for both shifts n = 0 and n = 1. Similarly, the resultfor shift 2 gives the output to be equal to 1.5. The right-hand figure of Figure9.3.4d gives the output w(n) for shifts 0, 1, and 2. Proceed th same way toobtain the final output function, which is given in Figure 9.3.4e.

The reader can use the following MATALAB algorithm to obtain theoutput function w(n):

x=[1 1 1 1]; h=[0 0.5 1 1.5];w=conv(x,h);n=0:6;stem(n,w,'k'); %conv is a MATLAB function; �

Example 9.3.10: Convolution property. Find the z-transform of the con-volution of the following three functions:

Figure 9.3.4 (continued).

1.5 3

2.5

1.5

0.5

2

1

00 1

x( 2 – 0) h(0) + x(2 – 1) h(1)

+x(2 – 2) h(2) = 1 × 0 + 1 × 1.5

+1 × 1 = 1.5 = w(2)

2 3 4 5

0.5

w(n

)

x(2

– m

), h

(m)

0–2 0

m n

(e)

2 4

1

5

4

3

2

w(n

)

1

00 1 2 3 4

n

(f )

5 6 7 8

x n a n a n

y n b n b n

q n

( ) ( ) ( )

( ) ( ) ( )

(

= + −

= + −

0 1

0 1

1

1

δ δ

δ δ

)) ( ) ( )= + −c n c n0 1 1δ δ

7267_book.fm Page 419 Thursday, November 2, 2006 3:28 PM

Page 435: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

420 Signals and systems primer with MATLAB

Solution: The z-transforms of these three functions are

We observe that

from which it follows that

This result shows that convolution is associative. Thus, we write

We next apply the definition of the z-transform to see that this result implies

We have left as an exercise showing that the convolution is also commutative.�

X z a a z Y z b b z Q z c c z( ) ( ) ( )= + = + = +− − −0 1

10 1

10 1

1

[ ( ) ( )] ( ) ( )[ ( ) ( )]X z Y z Q z X z Y z Q z=

[ ( ) ( )] ( ) ( ) [ ( ) ( )]x n y n q n x n y n q n∗ ∗ = ∗ ∗

Z{ ( ) ( ) ( )} ( ) ( ) ( ) [ (x n y n q n X z Y z Q z a b a b∗ ∗ = = + +0 0 1 0 aa b z a b z

c c z a b c a b c

0 11

1 12

0 11

0 0 0 1 0 0

) ]

( ) (

− −

+

+ = + ++ +

+ + +

−a b c a b c z

a b c a b c a b c z

0 1 0 1 0 11

1 0 1 0 1 1 1 1 0

)

( ) −− −+21 1 1

3a b c z

x n y n q n

a n m a n m am

n

( ) ( ) ( )

[ ( ) ( )][

∗ ∗ =

− + − −=

∑ 0 1

0

1δ δ 00 1

0 1

1δ δ

δ δ

( ) ( )]

[ ( ) (

n m a n m

c n c n

− + − −

∗ + − 11 10 0 1 0

0

)] [ ( ) ( ) ( ) ( )= − + − −

=∑ a b n m m a b n m mm

n

δ δ δ δ

+ − − + − − −

a b n m m a b n m m0 1 1 11 1 1δ δ δ δ( ) ( ) ( ) ( )] ∗ + −

= + − +

[ ( ) ( )]

[ ( ) ( )

c n c n

a b n a b n a

0 1

0 0 1 0

1

1

δ δ

δ δ 00 1 1 1 0 1

0

1 2 1b n a b n c n c n

a

δ δ δ δ( ) ( )] [ ( ) ( )]− + − ∗ + −

= bb c n a b c a b c a b c n

a b

0 0 1 0 0 0 1 0 0 0 1

1

1δ δ( ) ( ) ( )

(

+ + + −

+ 00 1 0 1 1 1 1 0 1 1 12 3c a b c a b c n a b c n+ + − + −) ( ) ( )δ δ

7267_book.fm Page 420 Thursday, November 2, 2006 3:28 PM

Page 436: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 9: The z-transform, difference equations, and discrete systems 421

Example 9.3.11: Convolution property. Find the output of the relaxedsystem shown in Figure 9.3.5a if the input is that shown in 9.3.5b. Expressthe system in its discrete form.

Solution: A direct application of the KVL yields the equation

The second equation follows from the first since with R = 1ohm. If we assume the sampling time T = 1, then from Section 3.2 we find

Figure 9.3.5 Impulse response of an RL circuit in discrete form with a discrete pulseas input.

(a)

v(t)

++

vo(t)vo(t)

v(t)R = 1

L = 1

System

1.5

1

0.5

00 2 4 6 8

n

v (n)

(b)

0.8

0.4

0

v 0 (

n)

0.2

0.6

1

0 2 4 6 8h

(c)

di tdt

i t v tdv t

dtv t v to

o( )

( ) ( ),( )

( ) ( )+ = + =

v t Ri to( ) ( )=

7267_book.fm Page 421 Thursday, November 2, 2006 3:28 PM

Page 437: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

422 Signals and systems primer with MATLAB

that and thus the above equation takes the follow-ing discretized form:

Next, we proceed to determine the impulse response of the system. Weuse the fact that the z-transform of the output of the system is equal to thesystem function H(z) for a delta function input (the exact sameapproach as was used in Laplace transform (LT) studies). Also, the inversetransform of H(z) is the impulse response h(n). Therefore, H(z) is given by

It follows from (9.2) that

Since the output of the system is equal to the convolution of the input andits impulse response, this result can be used in the expression

The outputs at successive time steps are

dv t dt v n v no o o( ) ( ) ( ),/ ≅ − − 1

v n v n v no o( ) ( ) ( )= + −12

12

1

v n n( ) ( )= δ

Z Z Z{ ( )} { ( )} { ( )} ( )( )

v z n v n H zV z

o o= + − =12

12

1 0δ orVV z z

z z

( )=

= +

+

12

1

112

12

112

12

1

12

−− +

=2 1� , ( )V z

h n nn

( ) =

≥12

12

0

v n h n m v mo

m

n

( ) ( ) ( )= −=

∑0

v h v

v h v h v

o

o

( ) ( ) ( )

( ) ( ) ( ) ( ) (

0 0 012

112

1 1 0 0

= = × =

= + 1114

112

134

2 2 0 1 1 0

)

( ) ( ) ( ) ( ) ( ) (

= × + × =

= + +v h v h v ho )) ( )v 218

114

112

178

= × + × + × =

7267_book.fm Page 422 Thursday, November 2, 2006 3:28 PM

Page 438: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 9: The z-transform, difference equations, and discrete systems 423

The output is shown in Figure 9.3.5c. Observe that the resulting shape of theoutput is the same as that for the corresponding continuous system. It isexpected that if we had selected the sampling time interval to be shorter, theoutput voltage would be closer to its corresponding analog case, and theshorter the sampling time, the closer to the analog case the output voltagewould have resulted. �

9.4 z-Transform pairsJust as with other transforms, the z-transform of a discrete function and itsinverse are given as

(9.28)

where Z–1 denotes the inverse z-transformation. Since the inverse z-trans-form includes integration in the complex z-plane, we will not study it. It isbeyond the scope of this course. However, we would like to point out thatthe integration path must be inside the ROC for the integral to give us theright answer. In our studies in this text we will rely on tables to obtain theinverse z-transforms. Table 9.4.1 provides some common z-transform pairs.

9.5 Inverse z-transformAs already discussed in our studies, we assume that an F(z) corresponds toa sequence {f(n)} that is bounded as n → ∞. To find the inverse z-transform,we cast the transform function into a form that is amenable to simple tabularlookup using Table 9.4.2. The approach parallels that followed in performingsimilar operations using the Laplace transform. The functions that we willbe concerned with are rational functions of z, that is, they are the ratios oftwo polynomials. Ordinarily, these are proper fractions since the degree ofthe numerator polynomial is less than the degree of the denominator poly-nomial. If the functions are not proper functions, we perform long divisionuntil the degree of the numerator is less than that of the denominator. Thisresults is a power series and a proper fraction.

Example 9.5.1: Determine the inverse z-transform of the function

(9.29)

Z{ ( )} ( ) ( ) ( ) ( )f n F z f n z F z f nT zn

n

n

n

� = =−

=

∞−

=∑

0 0

or∞∞

− −

∫=Z 1 112

{ ( )} { ( )} ( )F z f nj

F z z dzn

C

� �π

F zz

( ).

=− −

11 0 1 1

7267_book.fm Page 423 Thursday, November 2, 2006 3:28 PM

Page 439: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

424 Signals and systems primer with MATLAB

Solution: The function possesses a simple pole at z = 0.1 and a zero atz = 0. The ROC is a circle in the complex z-plane with radius |z| > 0.1. Wecan proceed by dividing the numerator by the denominator, which resultsin the following infinite series in powers of z–1:

Thus, we have that

Table 9.4.1 Properties of the z-Transform (n ≥ 0)

1.

2.

3.

4.

5. ; y(1) is the first period of a periodic

sequence y(n) = y(n + N)

6.

7.

8.

9. ; n0 is the initial value of the sequence

and

10.

Z{ ( ) ( )}ax n by n+ aX z bY z( ) ( )+

Z{ ( )}y n m− z Y z y i zm m i

i

m

− − −

=

+ −∑( ) ( ) ( )

1

Z{ ( )}y n m+ z Y z y n zm m n

n

m

( ) ( )− −

=

∑0

1

Z{ ( )}a y nn Yz

a

Z{ ( )}y nz

zY z

N

N − 11( )

Z{ ( ) ( )}y n h n∗ Y z H z( ) ( )

Z{ ( )}ny n −zd

dzY z( )

Z{ ( )}n y nm −

zd

dzY z

m

( )

y n( )0 z Y zn

z0 ( )

→∞

Y z y n n z n

n

( ) ( )= + −

=

∑ 0

0

lim ( )z

y n→∞

lim( ) ( )z

z Y z→

−−1

11

F z z z z( ) . ( . ) ( . )= + + + +− − −1 0 1 0 1 0 11 2 2 3 3 �

F z z z z( ) . ( . ) ( . )= + + + +− − −1 0 1 0 1 0 11 2 2 3 3 �

7267_book.fm Page 424 Thursday, November 2, 2006 3:28 PM

Page 440: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 9: The z-transform, difference equations, and discrete systems 425

Table 9.4.2 Common z-Transform Pairs

Entry Number f(n), f(nT) for n ≥ 0

Radius of Convergence

|z| > R

1. δ(n) 1 02. δ(n – m) z–m 0

3. 1 1

4. n 1

5. n2 1

6. n3 1

7. an |a|

8. nan |a|

9. n2 an |a|

10. e a/z 0

11. (n + 1)an |a|

12. |a|

13. |a|

14. sin nωT 1

15. cos nωT 1

16. an sin nωT |a|–1

F z f n z n

n

( ) ( )= −

=

∑0

z

z − 1

z

z( )− 1 2

z z

z

( )

( )

+−

1

1 3

z z z

z

( )

( )

2

4

4 1

1

+ +−

z

z a−

az

z a( )− 2

az z a

z a

( )

( )

+− 3

a

n

n

!

z

z a

2

2( )−

( )( )

!

n n an+ +1 2

2

z

z a

3

3( )−

( )( ) ( )

!

n n n m a

m

n+ + +1 2 � z

z a

m

m

+

+−

1

1( )

z T

z z T

sin

cos

ωω2 2 1− +

z z T

z z T

( cos )

cos

−− +

ωω2 2 1

az T

z az T a

sin

cos

ωω2 22− +

7267_book.fm Page 425 Thursday, November 2, 2006 3:28 PM

Page 441: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

426 Signals and systems primer with MATLAB

It follows from (9.2) that the corresponding sequence is

(9.30)

which is the sequence

(9.31)

17. anT sin nωT |a|–T

18. an cos nωT |a|–1

19. e–anT sin nωT |z|>|e–aT|

20. e–anT cos nωT |z|>|e–aT|

21. 1

22. 1

23. 1

24. e–anT |e–aT|

25. ne–anT |e–aT|

Table 9.4.2 (continued) Common z-Transform Pairs

Entry Number f(n), f(nT) for n ≥ 0

Radius of Convergence

|z| > RF z f n z n

n

( ) ( )= −

=

∑0

a z T

z a z T a

T

T T

sin

cos

ωω2 22− +

z z a T

z az T a

( cos )

cos

−− +

ωω2 22

ze T

z e z T e

aT

aT aT

− −− +sin

cos

ωω2 22

z z e T

z e z T e

aT

aT aT

( cos )

cos

−− +

− −

ωω2 22

n n( )

!

− 1

2

z

z( )− 1 3

n n n( )( )

!

− −1 2

3

z

z( )− 1 4

n n n n m

man m( )( ) ( )

!

− − − + −1 2 1� z

z a m( )− +1

z

z e aT− −

ze

z e

aT

aT

−−( )2

f nn

n( )

, . , ( . ) ,( . ) ,=

… ≥

<

1 0 1 0 1 0 1 0

0 0

2 3

f n nn( ) ( . )= ≥0 1 0

7267_book.fm Page 426 Thursday, November 2, 2006 3:28 PM

Page 442: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 9: The z-transform, difference equations, and discrete systems 427

Example 9.5.2: Find the inverse z-transform of the function

(9.32)

Solution: One approach is to proceed as in the foregoing example. Bylong division, the following polynomial results in

with region of convergence |z| > 0.2. This series corresponds to the sequence

(9.33)

A different approach calls for separating the function F(z) into partial fractionform. Now, two factors must be considered: (1) the resulting function mustbe proper function, and (2) many entries in Table 9.4.2 involve z in thenumerator of the resulting expression for F(z). This need is achieved byconsidering F(z)/z. Thus, we modify F(z) to F(z)/z:

where

From appropriate entries of Table 9.4.2, the inverse transform is

(9.34)

The reader can easily verify that (9.33) and (9.34) yield identical results. �

F zz z z

( )( . )( . ) .

=− +

=−− − −

11 0 2 1 0 2

11 0 041 1 2

F z z z zn n( ) . ( . ) ( . ) ( )= + + + =− − −1 0 04 0 04 0 22 2 4 2 1 2�

f m

m n n

m n n

n

m

( )

( . )

=

= ≥

= + >

<

0 2 2 0

0 2 1 0

0 0

F zz

zz z

Az

Bz

( )( . )( . ) . .

=− +

=−

++0 2 0 2 0 2 0 2

Az

zB

zz

z z

=+

= =−

= −−

== =−0 2

0 50 2

0 20 4

00 2 0 2

.. ,

...

. .

..

( ). .

5

12 0 2 0 2

F zz

zz

z=

−+

+

f nn

n

n n

( )[( . ) ( . ) ]

=+ ≥

<

−12

0 2 0 2 0

0 0

7267_book.fm Page 427 Thursday, November 2, 2006 3:28 PM

Page 443: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

428 Signals and systems primer with MATLAB

Example 9.5.3: Find the inverse z-transform of the function

(9.35)

Solution: By long division, we obtain

From Table 9.4.2, the inverse transform is

where the last term is applicable for n ≥ 0. Therefore, this equation is equiv-alent to

(9.36)

It is recalled that (9.35) could be expanded into the form

The inverse transform of the bracketed term is 0.2n, and the factor z2 indicatesa shift to the left of two sample periods. Thus, (9.36) is realized.

From the above, we note that to find the inverse z-transform, we must:

• Initially ignore any factor of the form zn, where n is an integer• Expand the remaining part into partial fraction form• Use z-transform tables or properties to obtain the inverse z-transform

of each term in the expansion• Combine the results and perform the necessary shifting required by

zn omitted in the first step �

Example 9.5.4: Find the inverse z-transform of the function

F zz z

zz

( )( . ) .

=−

=−− −

11 0 2 0 21 2

3

F z z zz

z( ) . ( . )

.= + +

−2 20 2 0 2

0 2

f n n n n( ) ( ) . ( ) ( . ) ( . )= + + + +δ δ2 0 2 1 0 2 0 22

f nn

n

n

( ).

=≥ −

< −

+0 2 2

0 2

2

F z z z z z z( ) . ( . ) ( . ) ( . )= + + + + +− −2 2 0 3 1 4 20 2 0 2 0 2 0 2 �

== + + +

z

z z2

2

21

0 2 0 2. .�

F zz z

z z z( )

( )( )( )= − +

− + +

2 3 82 2 3

7267_book.fm Page 428 Thursday, November 2, 2006 3:28 PM

Page 444: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 9: The z-transform, difference equations, and discrete systems 429

Solution: Expand F(z)/z in partial fraction form for reasons alreadydiscussed:

where

Therefore,

This leads to the following values for {f(n)} using Table 9.4.2:

If we set n = 0, then f(0) = 0 and MATLAB below ignores this point. However,if we divide the numerator by the denominator, we obtain the sequence

, which indicates a shifted sequence to theright and MATLAB ignores the shifting.

Book MATLAB m-file: ex_9_5_4

%m-file: ex_9_5_4

num=[0 1 -3 8];den=[conv(conv([1 -2],[1 2]),[1 3])];

[r,p,k]=residue(num,den);

r =[5.2000 -4.5000 0.3000]; p=[-3.0000 -2.0000 2.0000]; k=[]

F zz

z zz z z z

Az

Bz

Cz

( )( )( )( )

= − +− + +

= +−

++

+2 3 82 2 3 2 2

DDz + 3

A zF z

zz

= = −=

( )

0

23

B zF z

zz z

z z zz z

= − = − ++ +

== =

( )( )

( )( )2

3 82 3

320

2

2

2

C zF z

zz z

z z zz z

= + = − +− +

==− =−

( )( )

( )( )2

3 82 3

94

2

2

2

D zF z

zz z

z z zz z

= + = − +− +

= −=− =−

( )( )

( )( )3

3 82 2

26

3

2

3115

F zz

zz

zz

z( ) = − +

−+

+−

+23

320 2

94 2

2615 3

f n n n n n( ) ( ) ( ) ( )= − + + − − −23

320

294

22615

z z z z− − − −− + − +1 1 2 31 6 30 102( )�

7267_book.fm Page 429 Thursday, November 2, 2006 3:28 PM

Page 445: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

430 Signals and systems primer with MATLAB

Based on the MATLAB results we write

Note the corresponding numbers between r and p vectors. The inversez-transform of the above equation is

Although the two results look different the sequence {f(n)}, the two casesare numerically identical. �

Example 9.5.5: Find the inverse z-transform of the function

Observe that the function has a single- and a second-order pole.

Solution: The function F(z)/z is expanded in partial fraction form asfollows:

(9.37)

We can find three of the unknown constants using the relations

These constants are introduced in (9.37), leaving a relation involving the oneremaining constant C1. One procedure for finding the constant is to select

F zz

zz

zz

z( ) . . .=

+−

++

−5 2

34 5

20 3

2

f n n n n( ) . ( ) . ( ) . ( )= − − − +5 2 3 4 5 2 0 3 2

F zz

z z( )

( )( )= −

− −

2

2

91 2

F zz

zz z z

Az

Bz

Cz

C( )( )( ) ( ) ( )

= −− −

= +−

+−

+2

21 29

1 2 1 2 (( )z − 2 2

Az

z zz

= −− −

= −−

==

2

20

91 2

91 4

94( )( ) ( )( )

Bz

z zz

= −−

= −× −

= −=

2

21

2

92

1 91 1

8( ) ( )

Cz

z zz

2

2

2

91

4 92 1

52

= −−

= − = −=

( ) ( )

7267_book.fm Page 430 Thursday, November 2, 2006 3:28 PM

Page 446: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 9: The z-transform, difference equations, and discrete systems 431

any two appropriate values for z, avoiding the roots of the rational polyno-mial, thereby creating an equation with the unknown. In particular, if wechoose z = 3, we obtain the following expression:

First we introduce the values of all the constants found in (9.37), next wemultiply both sides by z, and finally we take the inverse z-transform usingTable 9.4.2. The result is

For n = 0, 1, 2, 3, and 4, the value of the sequence is {f(n)} = {0 1 5 8 4}.

Book MATLAB m-file: ex_9_5_5

%m-file: ex_9_5_5

num=[0 1 0 -9];

den=[1 -5 8 -4];

f=dimpulse(num,den,5);%the number 5 indicates the number

%of values desired of f(n);

The values found using the above MATLAB m-file are identical to thosefound above. �

9.6 Transfer functionThe z-transform provides a very important technique in the solution of thedifference equation. As part of this process, the transfer function plays animportant role.

Example 9.6.1: Deduce an expression for the impulse response of thecircuit shown in Figure 9.6.1a using the z-transform technique.

Solution: The controlling equation of the circuit is

The appropriate discrete form of this equation for sampling time Ts = 1 is(see (3.7) and (3.8))

3 93 3 1 3 2

94

13

81

3 11

3 252

13 2

2

2 1−

− −= −

−+

−−

−( )( ) ( )C 22 1

234

or C =

f n n u n nn n( ) ( ) ( )= − + − −94

8234

252

2 1δ

Ldi tdt

Ri t v t( )

( ) ( )+ =

7267_book.fm Page 431 Thursday, November 2, 2006 3:28 PM

Page 447: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

432 Signals and systems primer with MATLAB

from which we obtain

Taking the z-transform of both sides of the above equation and using theappropriate properties in Section 9.3, the above equation becomes

(9.38)

This equation relates the input–output relation explicitly in the transformeddomain of a discrete system. The quantity H(z) = I(z)/V(z), or equivalentlythe ratio of the system output to its input, is the system transfer functionfor the discrete system. Further, the inverse transform of H(z) is the impulseresponse h(n) of the system. Thus, for our circuit with a delta functionexcitation, (Z{δ(n)} = 1), we have

(9.39)

Figure 9.6.1 Series RL circuit.

v(t)

+ RL

i(t) Systemv(t) i(t)

(a)

+

a1z–1

V(z)b0

I(z)

(b)

b0 +

z–1a1

(c)

v(n) i(n)

L i n i n Ri n v n[ ( ) ( )] ( ) ( )− − + =1

i nL R

v nL

L Ri n b v n a i n( ) ( ) ( ) ( ) ( )=

++

+− + −1

1 10 1�

I z b V z a z I z I zba z

V z H( ) ( ) ( ) ( ) ( )= + =−

=−−0 1

1 0

111

or (( ) ( )z V z

I z H zba z

( ) ( )� =− −

0

111

7267_book.fm Page 432 Thursday, November 2, 2006 3:28 PM

Page 448: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 9: The z-transform, difference equations, and discrete systems 433

The inverse transform is easily found to be

(9.40)

Figures 9.6.1b and c shows the feedback configuration of the discretesystem in the transformed and time domains. �

Example 9.6.2: Determine the response of the first-order system specifiedby (9.38) to a unit step response by z-transform and convolution methods.

Solution: The unit step sequence, which is written

has the z-transformed value

The response, by writing y for i, is given by (see (9.38))

where

Thus,

The inverse transform is

h n b a nn( ) ( )= ≥0 1 0

u nn

n( )

, , ,=

=

<

1 0 1 2

0 0

U zz

z z( ) =

−=

− −11

1 1

Y z bz

z az

zb

Azz a

Bzz

( ) =− −

=−

+−

0

10

11 1

Az

za

aB

zz a a

z a z

=−

=−

=−

=−= =1 11

11

1

1 1 1 1

,

Y zb

aaa z z

( ) =−

−−

+−

−0

1

1

11 11 1

11

y nb

aa a

ba

a nn n n( ) [ ( ) ( ) ] ( )=−

− + =−

− +0

11 1

0

11

1

11

11 ≥≥ 0

7267_book.fm Page 433 Thursday, November 2, 2006 3:28 PM

Page 449: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

434 Signals and systems primer with MATLAB

It is recalled that the derivative of the step function response of a system isits impulse response. To show that the result is consistent with the result ofExample 9.6.1, we consider the derivative of y(n) in its discrete form repre-sentation. Ignoring at first the constant factor b0/(1 – a1), we obtain

Therefore, the impulse response is given by

We can proceed to find the output in the forgoing example by using theconvolution equation. Here we write, using the results of Example 9.6.1,

The output at successive time steps is

where the formula for the finite geometric series was used in the last summa-tion. This result is identical with that above using the z-transform method. �

When discrete systems are interconnected, the rules that apply to con-tinuous systems are also applied for discrete systems. For example, if theimpulse responses of two systems connected in cascade are known, theimpulse response of the total system is

(9.41)

and in the z-domain

(9.42)

y n y na a a an n n( ) ( )

( )− − = − − + = −+1

11 1 11

11 1

h nb

aa a b a nn n( ) ( )=

−− = ≥0

11 1 0 11

1 0

y n h n m u n b a u mn m

m

n

m

n

( ) ( ) ( ) ( )= − = −

==∑∑ 0 1

00

y b a b

y b a

y b a a

( ) ( )

( ) ( )

( ) (

0

1 1

2

0 10

0

0 1

0 12

1

= =

= +

= + + 11

1110 1 1

10

11

1

)

( ) ( )

�y n b a a baa

n nn

= + + + = −−

+

h n h n h n( ) ( ) ( )= ∗1 2

H z H z H z h n h n( ) ( ) ( ) { ( ) ( )}= = ∗1 2 1 2Z

7267_book.fm Page 434 Thursday, November 2, 2006 3:28 PM

Page 450: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 9: The z-transform, difference equations, and discrete systems 435

Example 9.6.3: Deduce the transfer function for the system shown inFigure 9.6.3a.

Solution: Consider initially the portion of the system (subsystem) shownbetween x(n) and y1(n) described by the difference equation

The z-transform of this expression is

The portion of the system between y1(n) and y(n) (a cascaded subsystemwith the first subsystem) is described by a similar expression whosez-transform is

Substitute the known expression for Y1(z) into this final expression to obtain

Figure 9.6.3 Two first-order discrete systems in cascades.

b +

z–1

a1

b +

z–1

a1

x(n)

y1(n – 1)

y1(n) y1(n)

y(n – 1)

y(n) y(n)

(a)

× × ×

jIm z

H1(z)

a1

jIm z

H2(z)

a1Re z Re z

jIm z

Re z

Double

a1

(b)

H(z)

y n bx n a y n1 1 1 1( ) ( ) ( )= + −

Y z bX z a z Y z Y zba z

X z1 11

1 11

11( ) ( ) ( ) ( ) ( )= + =

−=−

−or HH z X z1( ) ( )

Y zba z

Y z H z Y z( ) ( ) ( ) ( )=−

=−1 11 1 2 1

Y zba z

ba z

X z H z( ) ( ) ( )=−

=− −1 11

11

1 1 HH z X z H z X z2( ) ( ) ( ) ( )=

7267_book.fm Page 435 Thursday, November 2, 2006 3:28 PM

Page 451: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

436 Signals and systems primer with MATLAB

where

The pole-zero configurations for each subsystem and for the combined sys-tems are shown in Figure 9.6.3b. �

Example 9.6.4: Find the transfer function for the first-order system,shown in Figure 9.6.4a, and sketch the pole-zero configuration.

Solution: The difference equation describing the system is

The z-transform of this equation and the transfer function of the systemare

The pole-zero configuration is shown in Figure 9.6.4b. �

Note: In Example 9.6.1, b0 as well as a0 (1 in this case) and a1 are different thanzero. This type of system is known as the first-order infinite impulse response (IIR)system. Observe that an analog first-order RL series circuit results in an IIR digitalsystem. In Example 9.6.4, a0 (= 1), b0, and b1 are different than zero. This type offirst-order digital system is known as the finite impulse response (FIR) system.

Figure 9.6.5 shows a combined FIR and IIR system. The difference equa-tion describing the total system is found by the following two equations,which are obtained by inspection of Figure 9.6.5. These are

Figure 9.6.4 First-order discrete system.

H z H z H zba z

( ) ( ) ( )= =−

−1 21

1

2

1

y n b x n b x n( ) ( ) ( )= + −0 1 1

Y z b X z b z X z H zY zX z

b b z( ) ( ) ( ) ( )( )( )

= + = +−0 1

10 1or � −− =

+1

0

1

0bz

bb

z

x n a y n y n x n b x n b x n1 1 1 0 11 1( ) ( ) ( ), ( ) ( ) ( )− − = = + −

x(n)b

0

z-1

b1

+

x(n-1)

(a)

y(n)

×-b

1/b

0

jIm z

jRe z

(b)

7267_book.fm Page 436 Thursday, November 2, 2006 3:28 PM

Page 452: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 9: The z-transform, difference equations, and discrete systems 437

Therefore, the difference equation describing the system is

(9.43)

The a’s and b’s can take either positive or negative values. Taking thez-transform of both sides of (9.43), we obtain the transfer function of thesystem, which is

(9.44)

*Higher-order transfer functions

The general case of a system is described by the following difference equation:

Taking the z-transform and solving for the ratio Y(z)/X(z), we obtain thetransfer function

(9.46)

This equation indicates that if we know the transfer function H(z), then theoutput Y(z) to any input X(z) (or equivalently, x(n)) can be determined.

Figure 9.6.5 A first-order combined FIR and IIR digital system.

z–1

b0

b1

+ +

–a1

z–1

x(n) x1(n)

x(n – 1)

y(n)

y(n – 1)

y n a y n b x n b x n( ) ( ) ( ) ( )+ − = + −1 0 11 1

H zY zX z

b b za z

( )( )( )

� = ++

−0 1

1

111

y n a y n a y n a y n p b x n bp( ) ( ) ( ) ( ) ( )+ − + − + + − = +1 2 0 11 2 � xx n b x n

b x n qq

( ) ( )

( )

− + −

+ + −

1 22

� (9.45)

H zY zX z

b b z b z

a z a zq

q

p

( )( )( )

��

�=

+ + ++ + +

− −

−0 1

1

111 −−

=

=

=

+

∑p

nn

n

q

nn

n

p

b z

a z

0

1

1

7267_book.fm Page 437 Thursday, November 2, 2006 3:28 PM

Page 453: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

438 Signals and systems primer with MATLAB

If we set equal to zero, (9.45) becomes

(9.47)

This expression defines a qth-order FIR filter, and such filters are examinedin a later chapter. The block diagram of a FIR filter is shown in Figure 9.6.6.

For the case when b0 = 1 and the rest of the bi’s are zero, the differenceequation (9.45) becomes

(9.48)

This equation defines a pth-order IIR filter. A block diagram representationof this equation is shown in Figure 9.6.7.

Finally, if none of the constants is zero in (9.45), the block diagram rep-resentation of the combined FIR and IIR system is that shown in Figure 9.6.8.

9.7 Frequency response of first-order discrete systemsSuppose that the input to the system is the function zn. Then, using theconvolution property of system response, the output is given by

(9.49)

If we set in this expression, we have

(9.50)

Figure 9.6.6 A qth-order FIR digital system.

z–1

b0 +

b1 +

bq–1 +

z–1

bq

x(n)

x(n – 1)

x(n – q + 1)

x(n – q)

y(n)

H(z) = b0 + b1z−1 + ... + bq z−q•••

•••

a a ap1 2, , ,�

y n b x n b x n b x n b x n qq( ) ( ) ( ) ( ) ( )= + − + − + + −0 1 21 2 �

y n a y n a y n a y n p x np( ) ( ) ( ) ( ) ( )+ − + − + + − =1 21 2 �

y n z h n h m z z h m z zn

m

n m n

m

m( ) ( ) ( ) ( )= ∗ = = ==

∞−

=

∞−∑ ∑

0 0

nnH z( )

z ej= ω

y n e H ej n j( ) ( )= ω ω

7267_book.fm Page 438 Thursday, November 2, 2006 3:28 PM

Page 454: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 9: The z-transform, difference equations, and discrete systems 439

Therefore, the transfer function for the first-order systems is

(9.51)

This is the frequency response function.If we set in H(.) we find that ,

which indicates that the frequency response function is periodic with period2π. If, on the other hand, we had introduced (T = sampling time),then the frequency response function would be of the form

Figure 9.6.7 A pth-order IIR digital system.

Figure 9.6.8 A combined FIR and IIR digital system.

+

–a1+

–a2+

–ap

x(n) y(n)

z–1

z–1

z–1

1

1 + a1z−1 + a2z−2 + ... + apz−pH(z) =•••

•••

+b0

b1 +

bq

+

–a1+

–ap

z–1

z–1

z–1

z–1

1 + a1z−1 + ... + apz−pb0 + b1z−1 + ... + bqz−q

H(z) =••• •••

•••

•••

x(n – 1)

x(n – q)

y(n)x(n)

y(n – 1)

y(n – p)

H eb b e

a ej

j

j( )ω

ω

ω= ++

−0 1

11

ω ω π= + 2 H e H e e H ej j j j( ) ( ) ( )( )ω π ω π ω+ = =2 2

z ej T= ω

7267_book.fm Page 439 Thursday, November 2, 2006 3:28 PM

Page 455: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

440 Signals and systems primer with MATLAB

(9.52)

If we set

in H(.), we find that

which indicates that the frequency response function is periodic with period2π/T.

Note: Discrete systems with unit sampling time (T = 1) have periodic frequencyresponse functions with period 2π, and those with time sampling equal to T haveperiodic frequency response functions with period 2π/Τ.

Example 9.7.1: Find the frequency response of a first-order FIR systemand plot its amplitude and phase spectra for b0 = 1 and b1 = 0.5. Plot bothcases using T = 1 and T = 2.

Solution: The frequency response function of a first-order FIR system isfound from (9.51) by setting a1 = 0. Hence, we have

From the above equation, the amplitude and phase spectra are

The plots are shown in Figure 9.7.1. Note that for T = 1, the periodicityof the spectra is 2π/1 = 2π, and for T = 2, the periodicity is 2π/2 = π. �

H eb b e

a ej T

j T

j T( )ω

ω

ω= ++

−0 1

11

ω ω π= + 2T

H e H e e H ej

TT j T j j T( )

( ) ( ),ω π

ω π ω+

= =

22

H eb b e

b b e b b T jj Tj T

j T( ) cosωω

ω ω= + = + = + −−

−0 10 1 0 11

bb T1 sin ω

H e H e b b e b b e bj T j T j T j T( ) * ( ) ( )( )ω ω ω ω= + + =−0 1 0 1 0

2 ++ +2 0 1 12b b T bcos ω

ph H eb T

b b Tj T{ ( )} tan

sincos

ω ωω

= −+

−1 1

0 1

7267_book.fm Page 440 Thursday, November 2, 2006 3:28 PM

Page 456: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 9: The z-transform, difference equations, and discrete systems 441

Example 9.7.2: Find the frequency characteristics of the system shownin Figure 9.7.2, which is made up of two FIR systems in cascade.

Solution: The difference equation describing the system is

Figure 9.7.1 Spectra of a first-order FIR system for T = 1 and T = 2.

Figure 9.7.2 Two first-order FIR systems (identical) in cascade.

1.5 1

0.5

–0.5

–10 2 4 6 8

01

T = 1 T = 1

0.5

Am

pli

tud

e

Ph

ase

0 2 4

ω ω

1

0.5

–0.5

–10 2 4 6 8

0

T = 2P

has

e

ω

6 8

1.5

1

T = 2

0.5

Am

pli

tud

e

0 2 4

ω6 8

y n x n x n x n( ) ( ) ( ) ( )= + − + −4 4 1 2

2x(n)+x(n-1)

+ +z-1 z-1

2 2

x(n) y(n)

×

j Im z

Re z

Double

-1/2

Double

7267_book.fm Page 441 Thursday, November 2, 2006 3:28 PM

Page 457: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

442 Signals and systems primer with MATLAB

The system function for this system is

The frequency responses are obtained from the relationships

Figure 9.7.3 shows the frequency characteristics of the combined systemusing the MATLAB functions abs(H) and angle(H). Note that the periodicityin this case is equal to 2π/0.5 = 4π.

Note: The amplitude functions are even functions of the frequency and thephase functions are odd functions of the frequency. �

Figure 9.7.3 Frequency characteristics of two FIR systems in cascade.

10

T = 0.5

T = 0.5

Mag

nit

ud

eP

has

e

8

6

4

2

0

1.5

–1.50 5 10 15

0.5

–0.5

1

–1

0

0 5 10

ω

ω

15

H zY zX z

e ej T j T( )( )( )

� = + +− −4 4 2ω ω

H z H z H z H zz e z e

j T j T( ) * ( ) ( ) ( )

/

=

=−

=ω ω

1 21

= + + +

1 2

1 233 40 8 2

/

/( cos cos )ω ωT T

7267_book.fm Page 442 Thursday, November 2, 2006 3:28 PM

Page 458: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 9: The z-transform, difference equations, and discrete systems 443

Phase shift in discrete systems

Let us assume that a discrete system is described by the difference equation

The system function for this is

and the frequency response function is then given by

and the phase is

Since we have shown above that when the input is the complex functionthe output is when the input is cos ωnT,

the output is the real part of the output, which is

If we set T = 0.5 and ω = 0.4π in the above equations, then the input andoutput are shown in Figure 9.7.4. Observe the phase shift to the left and thedecrease of the amplitude of the output signal. The general input–outputrelations of a discrete system to sinusoidal inputs are shown in Figure 9.7.5.

*9.8 Frequency response of higher-order digital systemsIf we set in (9.46) we obtain the general frequency response function

(9.53)

of a combined system of qth-order FIR and a pth-order IIR. If, for example,we want to study a third-order system, then the transfer function is

y n x nT x nT T( ) ( ) . ( )= + −0 6

H zY zX z

z( )( )( )

.� = + −1 0 6 1

H z H z Tz ej T

( ) ( ) ( . . cos )/

/−

=

= +1

1 211 36 1 2

ωω 22

θ ω ωω

ω( ) arg ( ) tan. sin

. cos= = −

+−H e

TT

j T 1 0 61 0 6

ej Tω H e e H e e ej T j nT j T j j T( ) | ( )| ,( )ω ω ω θ ω ω=

y nT H e nTj T( ) ( ) cos[ ( )]= +ω ω θ ω

z ej T= ω

H eb b e b e b e

a aj T

j T j Tq

jq T

( )ωω ω ω

=+ + + ++

− − −0 1 2

2

0 1

ee a e a eH z

j T j Tp

jp T z ej T− − − =+ + +=ω ω ω ω

22 �

( )

7267_book.fm Page 443 Thursday, November 2, 2006 3:28 PM

Page 459: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

444 Signals and systems primer with MATLAB

(9.54)

The amplitude squared is given by

(9.55)

Figure 9.7.4 The input–output results of a discrete system.

Figure 9.7.5 Input–output relationship for discrete sinusoidal signals.

-10

1

-1

-0.5

0

0.5

-8 -2-4-6 0 862 4 10

Inp

ut

n

-10

1

-1

-0.5

0

0.5

-8 -2-4-6 0 862 4 10n

Ou

tpu

t

H(z)ejωT y(nT) = H(ejωT)e jωT H (ejωT) ej[ωT + θ(ω)]=

x(nT) = cos ωnT cos[ωnT + θ(ω)]y(nT) = H(ejωT)

x(nT) = sin ωnT sin[ωnT + θ(ω)]y(nT ) = H(ejωT)

H zb b e b ea a e a e

j T j T

j T j T( ) = + +

+ +

− −

− −0 1 2

2

0 1 22

ω ω

ω ω

H z H z H zd z d z d d

z e z ej T j T( ) ( ) ( )

2 1 22

1 0 1

=

== = + + +

ω ω

zz d zc z c z c c z c z

d

z ej T

− −

− −=

++ + + +

=+

12

2

22

1 0 11

22

0

ω

22

2

1

2

0

1

2

d n T

c c n T

n

n

n

n

cos

cos

ω

ω

=

=

∑+

7267_book.fm Page 444 Thursday, November 2, 2006 3:28 PM

Page 460: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 9: The z-transform, difference equations, and discrete systems 445

where

(9.56)

For example,

Example 9.8.1: Find and plot the frequency characteristics of a generalthird-order discrete system with the following constants: b0 = 1, b1 = 0.8, b2 =0.1,

Solution: The frequency characteristics are plotted in Figure 9.8.1 usingthe MATLAB functions abs(H) and angle(H). The transfer function with thegiven data is

Example 9.8.2: Find the frequency response function of the systemshown in Figure 9.8.2.

Solution: We can solve this problem in two different ways. From thefigure, the difference equations describing the first and second subsystemsare respectively

Substituting x1(n) from the second equation into the first, we obtain

c a a d b bn k n k

k

k n

n k n k

k

k n

= =+=

+=

∑ ∑0 0

c a a a a a a a a

c a a

k k

k

k k

k

0 0

0

2 0

0 0 1 1 2 2

1 1

0

= = + +

=

+=

+=

∑22 1

0 1 1 2

2 2

0

2 2

0 2

+=

= +

= =

a a a a

c a a a ak k

k

a a a T0 1 21 0 6 0 8 2= = − = =, . , . , .

H ee ee e

jj j

j( )

. .

. .2

2 4

2

1 0 8 0 11 0 6 0 8

ωω ω

ω= + +− +

− −

− −jj4ω

x n x n y n

y n y n x n x

1 1

1

1 2

1 2

( ) ( ) ( )

[ ( ) ( )] ( ) (

− + =

− − + + = nn)

5 4 1 2 2 1y n y n y n x n x n( ) ( ) ( ) ( ) ( )+ − + − = + −

7267_book.fm Page 445 Thursday, November 2, 2006 3:28 PM

Page 461: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

446 Signals and systems primer with MATLAB

By taking the z-transform of the above equation and solving for the ratioof output over input, we obtain the transfer function

Since the transfer function for each subsystem is the same, Hs(z) = 2 +z–1, the transfer function of the total system is found using the feedbacktransfer function given in Figure 2.5.4. �

Figure 9.8.1 Second-order combined FIR and IIR discrete systems.

Figure 9.8.2 A discrete interconnected system.

8

6

4

Mag

nit

ud

eP

has

e

2

0

2

1

0

0 1 2 3 4 5 6 7 8

–1

–2

0 1 2 3 4 5

ω

ω

6 7 8

+ z–1 +

2

z–1+

2

x(n) x1(n)

_

y(n)

H zz

z z( ) = +

+ +

− −

25 4

1

1 2

7267_book.fm Page 446 Thursday, November 2, 2006 3:28 PM

Page 462: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 9: The z-transform, difference equations, and discrete systems 447

9.9 z-Transform solution of first-order difference equations

We now study the use of z-transform methods in the solution of lineardifference equations with constant coefficients. The following examples willexplain how to use the z-transform method for the solution of differenceequations.

Example 9.9.1: Solve the discrete-time problem defined by the equation

(9.57)

with y(–1) = 0 and u(n) is the discrete unit step function.

Solution: Begin by taking the z-transform of both sides of (9.57). This is

By Section 9.3 and Table 9.4.1, we write

The inverse z-transform of this equation is

If you want to use the MATLAB function residue(.), you must solve forthe Y(z)/z function and then multiply both sides by z.

Example 9.9.2: Repeat Example 9.9.1, but now with the initial conditiony(–1) = 4.

Solution: We again begin by taking the z-transform of both sides anduse the right-shift property (see Section 9.3):

y n y n u n( ) ( ) . ( )+ − =2 1 3 5

Z Z Z{ ( )} { ( )} . { ( )}y n y n u n+ − =2 1 3 5

Y z z Y zz

zY z

zz

zz

z( ) ( ) . ( ) .+ =

−=

− +=−2 3 5

13 5

1 267

1 orzz

zz−

++1

73 2

y n u n nn( ) ( ) ( ) , , ,= + − =76

73

2 0 1 2 �

Z Z Z{ ( )} { ( )} . { ( )} ( ) (y n y n u n Y z z Y z+ − = + −2 1 3 5 2 1or )) ( ) . ( )+ − =2 1 3 5y U z

7267_book.fm Page 447 Thursday, November 2, 2006 3:28 PM

Page 463: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

448 Signals and systems primer with MATLAB

Upon solving for Y(z), we obtain

The inverse transform of the zero-input response is the solution of thehomogeneous difference equation , a result that can bereadily verified by setting consecutively n = 0, 1, 2, … in the equation.Specifically, the results are

The complete solution is the sum of these two responses. Hence, we write

and

Example 9.9.3: Determine the output of the discrete approximation ofthe system shown in Figure 9.9.1a for a sampling time T. The outputs forT = 0.2 and T = 1 are to be plotted, and the results compared with the outputof the continuous system. The input is a unit step current source i(t) = u(t),and an initial condition vo(0) = 2 V.

Solution: The differential equation describing the system is

Y zz

U z

zero stateresponse

( ).

( )

-

=+ −3 5

1 2 1� ��� ���

−− −+ −

2 11 2 1

yz

zero inputresponse

( )

-��� ��

y n y n( ) ( )+ − =2 1 0

zero input responsey

z- = − −

+

−−Z 1

1

2 11 2

( ) == − − −

= −

2 1 2

3 51

y u n

zero state response

n( )( ) ( )

.- Z

11 21

13 52 11 1

12

+ −

=+ +

− −

z zz

z zZ

.( )( )

=+

−+

−Z 1 72

3 51

zz

zz

.

y n n

zero inputresponse

n( ) ( ) ( )= − + −+4 2 7 21

-��� �� −− =3 5 0 1 2. ( ) , , ,u n n

zero stateresponse

-� ��� ��� �

y n u nn

transient steadystate

( ) ( ) . ( )= − − −2 3 5��� ���� �� �n = 0 1 2, , ,

dv tdt

v ti to o( ) ( )

.( )+ =

0 5

7267_book.fm Page 448 Thursday, November 2, 2006 3:28 PM

Page 464: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 9: The z-transform, difference equations, and discrete systems 449

The analogous discrete form of this equation is

From this,

The z-transform of this equation gives (see Section 9.3)

Since the continuous case vo(0) = 2, we must refer back to the differenceequation and set the appropriate values to find the value of vo(–T). Hence,we find

Figure 9.9.1 Illustration of Example 9.9.3.

(a)

+

vo(t)i(t)

R=0.5

C=1

Systemi(t) v

o(t)

1.5

1

00 1 2

t, n

3 4

(b)

0.5

v o(t

), v

o(1

n)

v o(t

), v

o(0

.2n

)

2 2

1.5

0.5

00 1 2

t, n

3 4

1

v nT v nT TT

v nT i nTo oo

( ) ( )( ) ( )

− − + =2

v nTT

Ti nT

Tv nT T b i nT a vo o( ) ( ) ( ) ( )=

++

+− = +

1 21

1 2 0 1 oo nT T( )−

V zba z

I zo

zero stateresponse

( ) ( )=− −

0

111

-� ��� ���� � ��� ���

+−

−−aa z

v To

zero inputresponse

1

111

( )

-

7267_book.fm Page 449 Thursday, November 2, 2006 3:28 PM

Page 465: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

450 Signals and systems primer with MATLAB

Thus, we obtain

The solution is the sum of the zero-input and zero-state solutions. The solutionof the continuous case is easily found to be equal to

The results for the continuous and discrete cases T = 1 and T = 0.2 areshown in Figure 9.9.1b. �

*9.10 Higher-order difference equationsThe class of linear discrete systems under discussion is described by thegeneral difference equation

(9.58)

The constant in front of y(n) does not appear since we can always divideboth sides of the equation by that number. We have seen that such anequation can arise when a differential equation is transformed into an equiv-alent difference equation using approximations of the derivatives. Hence,

(9.59)

v b i a v T n v T b ao o( ) ( ) ( ) , ( ) ( )0 0 0 20 1 0 0 1= + − = − = −or /

zero-input response =− −

−Z 1

0

2

11b

zz z a( )( )

=

− −+

− −

=

−Z 1 0

1

0 1

1 11 1 1b

az

zb aa

zz a

b00

1

0 1

111 1−

+−a

u nb aa

a u nn( ) ( )

zero-state responsse = −−

= −−Z 1 0

10 1

22

( )( )

( ) ( )b z

z ab a u nn

v t e tot( ) . .= + ≥−0 5 1 5 02

y n a y n a y n a y n p b x np( ) ( ) ( ) ( ) ( )+ − + − + + − =1 2 01 2 �

dy tdt

y nT y nT TT

d y tdt

y nT y

( ) ( ) ( )

( ) ( ) (

≅ − −

≅ −

a)

2

2

2 nnT T y nT TT

d y tdt

y nT y nT T

− + −

≅ − −

) ( )

( ) ( ) ( )

2

3

2

3

3

b)

++ − − −3 2 33

Y nT T y nT TT

( ) ( )c)

7267_book.fm Page 450 Thursday, November 2, 2006 3:28 PM

Page 466: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 9: The z-transform, difference equations, and discrete systems 451

We would like to mention again that when the coefficients ai are independentof n, the system is time invariant; otherwise, it is time varying.

For T = 1, the second-order difference equation can always be writtenin the form

(9.60)

We can assert that a complete and unique solution to the above equationcan be found if the initial conditions are known, say,

(9.61)

where A and B are constants. In this connection, we state certain theoremswithout proof (see Finizio and Ladas*).

Definition 9.10.1: If {a(n)} and {b(n)} denote two sequences, the determinant

(9.62)

is known as the Casoratian or Wroskian determinant. �

Theorem 9.10.1: Two solutions, y1(n) and y2(n), of the linear homoge-neous difference equation (the input b0x(n) is set equal to zero) are linearlyindependent if and only if their Casoratian

(9.63)

is different from zero for all values of n = 0, 1, 2, … �

Theorem 9.10.2: If y1(n) and y2(n) are two linear independent solutionsof the homogeneous equation and yp(n) is the particular solution to thenonhomogeneous equation (9.60), then the general solution is

(9.64)

where C1 and C2 are arbitrary constants and can be determined from theinitial conditions. �

* N. Finizio and G. Ladas, An Introduction to Differential Equations, Belmont, CA: WadsworthPublishing Co., 1982.

y n a y n a y n b x n( ) ( ) ( ) ( )+ − + − =1 2 01 2

y A y B( ) ( )− = =1 0

C a n b na n b n

a n b n[ ( ), ( )]

( ) ( )

( ) ( )=

− −1 1

C y n y ny n y n

y n y n[ ( ), ( )]

( ) ( )

( ) ( )1 2

1 2

1 21 1=

− −

y n y n y n C y n C y n y nh p p( ) ( ) ( ) ( ) ( ) ( )= + = + +1 1 2 2

7267_book.fm Page 451 Thursday, November 2, 2006 3:28 PM

Page 467: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

452 Signals and systems primer with MATLAB

Theorem 9.10.3: The homogeneous difference equation

(9.65)

with constant and real coefficients and with the roots of the characteristicequation

(9.66)

denoted λ1 and λ2, has the possible solutions shown in Table 9.10.1.

Solution: Assume that is a solution of (9.65). Then

which is (9.66). �

Example 9.10.1: Solve the difference equation

The constants are to be selected so that the second-order system is (a) criti-cally damped, (b) underdamped, or (c) overdamped. The starting conditionsare zero: y(–1) = 0, y(–2) = 0.

Solution: Taking the z-transform of both sides of the difference equationand solving for Y(z), we obtain

(9.67)

The denominator of the first factor, which is the characteristic equation ofthe difference equation, has two roots that are specified by

Table 9.10.1 Solutions to Homogeneous Difference Equations

Difference Equation Characteristic Equation

Note: All the ci’s and Ci’s are constants.

y n a y n a y n( ) ( ) ( )+ − + − =1 21 2 0 λ λ21 2 0+ + =a a

λ λ1 2≠ y n c cn n( ) = +1 1 2 2λ λ

λ λ λ1 2= = y n c c n n( ) = +1 2λ λ

λ λ1 2= + = −a jb a jb; y n C e bn C e bnan an( ) cos sin= +1 2

y n a y n a y n( ) ( ) ( )+ − + − =1 21 2 0

λ λ21 2 0+ + =a a

y n c n( ) = λ

c a c a c or a an n nλ λ λ λ λ+ + = + + =− −1

12

2 21 20 0

y n by n ay n u n a b( ) ( ) ( ) ( ) ,− − + − = >1 2 0

Y zz

z bz az

z( ) =

− + −

2

2 1

7267_book.fm Page 452 Thursday, November 2, 2006 3:28 PM

Page 468: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 9: The z-transform, difference equations, and discrete systems 453

(9.68)

Critically damped case (b2 = 4a)

We set b = 0.8, and hence a = 0.8. The two roots are 0.4 and 0.4. Thus, (9.67)becomes

By straightforward methods we find A = 25/9, B = –1.1111, and C = –2/3.The inverse transform of this equation is

The response to a step function can also be found using the MATLABfunction [y,t]=stepz(num,den). For this particular case and for n = 0,1, 2, … 30 we write

[y,t]=stepz([1 0 0],[1 -0.8 0.16],30);

Overdamped case (4a < b2)

If we select b = 0.9 and a = 0.1, the inequality holds. The two roots are 0.1298and 0.7702. The z-transform of the output is given by

and its inverse is

Underdamped case (b2 < 4a)

In this case, two conjugate roots exist, and these roots are poles of Y(z). Toproceed, we write the denominator of Y(z) in the form

(9.69)

By expanding the right-hand side and equating like powers of z, we find that

zb b a

1 2

2 42, = ± −

Y zz

zz

zAz

zBz

zCz

z( )

( . ) . ( .=

− −=

−+

−+

2

2

2

0 4 1 1 0 4 0 4))2

y n nn n( ) . ( . ) ( )( . )= − − +259

1 1111 0 423

1 0 4

Y zz

zz

zz

z( ) .

..

.=

−+

−−

−5

10 0303

0 12984 0303

0 7702

y n nn n( ) . ( . ) . ( . ) ,= + − =5 0 0303 0 1298 4 0303 0 7702 0 1,, ,2 �

z bz a z c e z c ej j2 − + = − − −( )( )θ θ

a c b c= =2 2and cosθ

7267_book.fm Page 453 Thursday, November 2, 2006 3:28 PM

Page 469: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

454 Signals and systems primer with MATLAB

Thus, if a and b are known, then c and θ are readily obtained. By combining(9.69) with (9.67), we write

This fraction is now expanded into fractional form, which is

The inverse z-transform of this equation is

This expression can be written in a more convenient form by writing; then, . Figure 9.10.1 shows the underdamped

cases for c = 0.85 and θ = π/4 and for c = 0.7 and θ = π/4. �

Method of undetermined coefficients

The particular solution of a nonhomogeneous equation is the method ofundetermined coefficients. The method is particularly efficient for inputfunctions that are linear combinations of the following functions:

Figure 9.10.1 Step response of a second-order system.

3.5

2.5

y(n

)

1.5

2

10 5 10

Underdamp case: c = 0.85, θ = π/4

Underdamp case: c = 0.7, θ = π/4

15 20 25

n

30 35 40 45 50

3

Y zz

z ce z cez

zj j( )

( )( )=

− − −−

2

1θ θ

Y zc c

zz

cej ce

zz

j

j( )

cos sin ( )=

− + −−

−1

1 2 1 2 12

2

θ θ

θ

θ −−

+− −

− −

ce

cej ce

zz ce

j

j

j j

θ

θ

θ θθ

2

2 1sin ( )

y nc c

u nce

j cec

j

jn( )

cos( )

sin ( )=

− +−

−1

1 2 2 12

2

θ θ

θ

θ eece

j cec ejn

j

jn jnθ

θ

θθ

θ+

−−

2

2 1sin ( )

1 − = −ce rej jθ φ 1 − =−ce rej jθ φ

7267_book.fm Page 454 Thursday, November 2, 2006 3:28 PM

Page 470: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 9: The z-transform, difference equations, and discrete systems 455

1. nk, where n is a positive integer or zero2. an, where a is a nonzero constant3. cos an, where a is a nonzero constant4. sin an, where a is a nonzero constant5. A product (finite) of two or more functions of type 1 to 4

This method works because any derivative of the input function x(n) isalso possible as a linear combination of functions of the five types above.For example, the function or any derivative of is a linear combina-tion of the sequences n2, n and 1, all of which are of type 1. Hence, what isrequired in any case is the appropriate sequences for which any derivativeof the input function x(n) can be constructed by a linear combination of thesesequences. Clearly, if x(n) = cos 3n, the appropriate sequences are cos 3n andsin 3n. The following examples clarify these assertions.

Example 9.10.2: Consider the system shown in Figure 9.10.2. Find thegeneral solution if the input is and initial conditions are y(–1) =0 and y(–2) = 1.

Solution: From Figure 9.10.2, and taking into consideration the time shiftof the output function, the controlling difference equation of this system is

(9.70)

The characteristic equation obtained from the corresponding homoge-neous equation is

with roots λ1 = 2 and λ2 = 3. The two solutions are

(9.71)

Figure 9.10.2 A discrete-time system.

2 2n 2 2n

x n u nn( ) ( )= 3

y n y n y n nn( ) ( ) ( ) , , ,− − + − = =5 1 6 2 3 0 1 2 �

λ λ2 5 6 0− + =

y n y nn n1 22 3( ) ( )= =

+

5

6

x(n)

_

y(n)

z–1

z–1

y(n – 1)

7267_book.fm Page 455 Thursday, November 2, 2006 3:28 PM

Page 471: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

456 Signals and systems primer with MATLAB

Since one of the homogeneous solutions is proportional to the inputfunction, the particular solution is of the form , where B is aconstant. Introducing the particular solution in (9.70), we obtain

Solving for the unknown, we find that B = 3. Hence, the total solution is

(9.72)

Subjecting this solution to the given initial conditions yields

From this system we find C1 = 16 and C2 = –21. The complete solution is

(9.73)

We now solve this problem by the z-transform method. The z-transformof (9.70) is

which can be written as follows:

The terms to the right are expanded (two terms and three terms, respectively)as follows:

By Table 9.4.2, the inverse z-transform is

which is (9.73) as anticipated. �

y n Bnpn( ) = 3

Bn b n B nn n n n3 5 1 3 6 2 3 31 2− − + − =− −( ) ( )

y n C y n C y n y n C C npn n n( ) ( ) ( ) ( ) ( )= + + = + +1 1 2 2 1 22 3 3 3

12

13

1

14

19

53

1 2

1 2

C C

C C

+ =

+ =

y n nn n n( ) ( ) ( ) ( )= − +16 2 21 3 3 3

Y z z Y z y z Y z y z y( ) [ ( ) ( )] [ ( ) ( ) (− + − + + − +− − −5 1 6 11 2 1 −− =−

−23

0) ]zz

z

Y zz

z zz

z z( )

( )( ) ( )( )= −

− −+

− −62 3 2 3

2 3

2

Y zz

zz

zz

zz

zz

z( )

( )=

−−

−+

−−

−+

−12

218

34

26

33

3

2

2

y n nn n n n n( ) ( ) ( ) ( ) ( ) ( ) (= − + − + + =12 2 18 3 4 2 6 3 3 1 3 16 22 21 3 3 3n n nn) ( ) ( )− +

7267_book.fm Page 456 Thursday, November 2, 2006 3:28 PM

Page 472: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 9: The z-transform, difference equations, and discrete systems 457

Example 9.10.3: Find the solution for the system shown in Figure 9.10.3.The initial conditions are y(–1) = 1, y(–2) = 0.

Solution: The difference equation describing the system of Figure 9.10.3is

(9.74)

As found in the example above, the roots are the same, and hence the generalsolution of the homogeneous equation is

(9.75)

We observe that the input 2n is also a solution to the homogeneous equation.This suggests that we try the following particular solution:

(9.76)

where the constants A and B are undetermined coefficients. These constantscan be found by substituting (9.76) into (9.74). When this is done, we obtain

Rearranging terms, we have

Figure 9.10.3 Second-order discrete system.

+

5

z–1

z–1

6

x(n) = 2.5 × 5n

y(n)

y(n – 1)

2n

y n y n y n n n( ) ( ) ( ) .− − + − = × +5 1 6 2 2 5 5 2

y n C Chn n( ) = +1 22 3

y n A Bnpn n( ) = +5 2

A Bn A B n

A B n

n n n n

n

5 2 5 5 1 2

6 5 2

1 1

2

+ − + −

+ + −

− −

[ ( ) ]

[ ( )22 2 5 5 22n n n− = × +] .

A A A BnB Bn Bn Bn− +

+ + − + −

515

61

255

5 52

6 124

= × +2 2 5 5 2n n n.

7267_book.fm Page 457 Thursday, November 2, 2006 3:28 PM

Page 473: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

458 Signals and systems primer with MATLAB

By equating coefficients of similar terms, we find that

and therefore, the total solution is

Applying the initial conditions, the constants are C1 = –8.667 and C2 = 6.750.�

Example 9.10.4: Find the particular solution of the nonhomogeneousequation

(9.77)

Solution: The roots of the characteristic equation are readily found to beλ1 = 1 and λ2 = –1. Since the characteristic equation is λ2 – 1 = 0, we can usethe MATLAB function roots([1 0 –1]) to find the roots. Thus, the solutionto the homogeneous equation is

We observe that the function 5n2 and its derivatives can be found by thelinear combination of sequences n2, n and 1. However, 1 is a solution of thehomogeneous equation, so we choose as a trial particular solution n timesthe sequence n2, n and 1:

(9.78)

Substitute this trial solution in (9.77) and equate coefficients of equal powerterms. The coefficients are found to be A = 5/6, B = 5/2, and C = 5/3. �

Table 9.10.2 gives the suggested forms for the particular solutions for aspecified x(n).

Table 9.10.2 Method of Undetermined Coefficients

x(n) yp(n)

nm A1nm + A2nm–1 + … + Amn + Am+1

an Aan

cos θn or sin θn A1 cos θn + A2 sin θnnm an an (A1nm + A2nm–1 + … + Amn + Am+1)an cos θn or an sin θn an (A1 cos θn + A2 sin θn)

A B= = −62 56

2.

y n y n y n C C nh pn n n n( ) ( ) ( )

.= + = + + −1 22 362 5

65 2 2

y n y n n( ) ( )− − =2 5 2

y n C C nhn n( ) ( ) ( ) , , ,= + − =1 21 1 0 1 2 �

y n An Bn Cnp( ) = + +3 2

7267_book.fm Page 458 Thursday, November 2, 2006 3:28 PM

Page 474: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 9: The z-transform, difference equations, and discrete systems 459

Important definitions and concepts1. One-sided z-transform2. Convergence of z-transform3. Region of convergence4. Two-sided z-transform and its region of convergence5. The z-transform properties: linearity, right-shifting property, left-

shifting property, time scaling, periodic sequence, multiplication by n,initial value, final value, convolution, and bilateral convolution

6. Inverse z-transform7. System transfer function8. Infinite impulse response (IIR) system9. Finite impulse system (FIR)

10. Higher-order transfer functions11. Frequency response of discrete systems12. z-transform solution of difference equations13. Zero-state and zero-input solution of discrete systems14. Casoratian or Wroskian determinant15. Critically damped, underdamped, and overdamped systems16. Method of undetermined coefficients

Chapter 9 ProblemsSection 9.1

1. Find the z-transform for the sequences shown in Figure P9.1.1.

2. Determine the z-transform of the following sequences:

a.

Figure P9.1.1

1.5

1

0.5

x(n

)

00 2 4

1.5

0.5

0

1

–0.5

–1

x(n

)

–1.50 2

n nn

4

3.5

2.5

1.5

2

3

1

0.5

x(n

)

00 5 10

f nn

n

n

( )( / ) , , ,

==

<

1 2 0 1 2

0 0

7267_book.fm Page 459 Thursday, November 2, 2006 3:28 PM

Page 475: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

460 Signals and systems primer with MATLAB

b.

3. Find the z-transform of the following functions:

a.

b.

c.

4. Determine the z-transform of of the following functions:

a.

b.

Section 9.2

1. Find the z-transforms and their regions of convergence and plot thepole-zero configurations of the sequences given for n ≥ 0.

a.

b.

c.

d.

2. Determine the z-transform of the function given below and the regionof convergence and divergence, and show the zeros and poles on thez-plane.

3. Determine the z-transforms and their regions of convergence andplot the pole configuration of the following sequences:

a.

b.

f n

n

n

a nn

( )

, ,

=

− =

=

0 0

1 1

2 3 �

f n n( ) ( )= δ

f n n m( ) ( )= −δ

f n n n( ) ( ) . ( )= − −2 2 5 2δ δ

f n n n n( ) ( ) ( ) ( )= + − + −2 3 1 4 2δ δ δ

f n a a a a a( ) { , , , , , , }= − − −1 2 3 4 5 �

y n n( ) = +1

y n n( ) = 2

y n a a an n( ) = + >− 1

y n ejn( ) = θ

y na nb n a

n

n

( )cos ,

=≥ >

<

0 0

0 0

y nn

nn( )

, , , ,

, ,=

=

=

2 0 1 2 3 4

3 5 6 �

y n nn n( ) ( / ) ( / ) , , ,= + =1 3 1 4 0 1 2 �

7267_book.fm Page 460 Thursday, November 2, 2006 3:28 PM

Page 476: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 9: The z-transform, difference equations, and discrete systems 461

4. Determine the z-transform and the region of convergence and plotthe pole-zero configuration of the following sequence:

5. Show that the region of convergence of the sequence forn = 0, 1, 2, … depends only on b.

6. Determine the z-transform of the following functions when sampledevery T seconds:

a.

b.

c.

d.

e.

f.

7. Determine the z-transform and the region of convergence of thefollowing functions that are sampled every T seconds:

a. , a is a real number

b.

Section 9.3

1. Generalize the z-transform property and showthat

2. Two sequences are given. Determine their z-transforms, their regionsof convergence, and their pole-zero configurations. Compare the tworesults and state your observations.

a.

b.

y nnn

( ) =≤ ≤

2 0 5

0 otherwise

y n a b n( ) ( )=

y n t u t( ) cos ( )= ω

y n a t u tt( ) sin ( )= ω

y n a t u tt( ) cos ( )= ω

y n e t u tat( ) sin ( )= − ω

y n e t u tat( ) cos ( )= − ω

y n a u tt( ) ( )=

y n e u tat( ) ( )= −

y n u t u t T( ) ( ) ( )= − − 4

Z{ ( )} ( )ny n zddz

Y z= −

Z{ ( )} ( )n y n zddz

Y zmm

= −

y n e nn( ) , , ,= =−2 0 1 2 �

y n e u n nn( ) ( ) , , ,( )= − =− −2 2 0 1 22 �

7267_book.fm Page 461 Thursday, November 2, 2006 3:28 PM

Page 477: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

462 Signals and systems primer with MATLAB

3. Determine the z-transforms and the regions of convergence of thefollowing sequences:

a.

b.

4. Deduce the z-transform of the sequence shown in Figure P9.3.4 andcompare the pole-zero configurations between

5. Given the relationship use the multiplication byn property to obtain the inverse transform of

6. Prove that the convolution is commutative; hence, we have thefollowing:

7. Deduce the z-transform of the output y(n) of the system shown inFigure P9.3.7 if the input is a unit step function u(n) and h3(n) =0.5n u(n).

8. Use the convolution theorem to find the voltage output of the systemshown in Figure P9.3.8 for an input current n = 0, 1, 2, ….Compare these results to those found in the corresponding continuous-time case.

9. Show that the z-transform of the shifted function sampledevery T seconds and shifted to the right by seconds is .

10. Deduce the z-transform of the shifted function (nT – 2T)[u(nT – 2T) –u(nT – 5T)].

11. Show that the z-transform of the function sampled every Tseconds and shifted to the left by mT seconds is equal to

.

Figure P9.3.4

y n e x n nj n( ) ( ) , , ,= =± ω0 0 1 2 �

y n z x n nn( ) ( ) , , ,= =0 0 1 2 �

y n y n( ) ( ).( )and 1

2.5

2

1.5

1

0.5

00 1 2 3 4 5 6 7 8 9 10

y(n

)

n

...

Z{ ( )} ( ),u n z= − −1 1 1/Y z z z( ) ( ) .= −− −1 1 21/

y n h n m x m h m x n mm

n

m

n

( ) ( ) ( ) ( ) ( )= − = −= =

∑ ∑0 0

i n e n( ) .= −0 2

y t u t( ) ( )mT z Y zm− ( )

y t u t( ) ( )

z Y z y nT zm n

n

m[ ( ) ( ) ]− −

=

−∑ 0

1

7267_book.fm Page 462 Thursday, November 2, 2006 3:28 PM

Page 478: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 9: The z-transform, difference equations, and discrete systems 463

12. Determine the z-transform of the output of the system shown inFigure P9.3.12.

13. Deduce the z-transform of the following functions using the time-scaling property:

a.

b.

Figure P9.3.7

Figure P9.3.8

Figure P9.3.12

+

0.8

+

z–1

z–1

0.8

+ h3(n)

u(n) y(n)

R = 0.5

C = 2

+

v(n)i(n)

+

z−12

y(nT + 2T)δ(nT + 2T)

y n a e u nn bn( ) ( )= −

y n a n u nn( ) cos ( )= ω

7267_book.fm Page 463 Thursday, November 2, 2006 3:28 PM

Page 479: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

464 Signals and systems primer with MATLAB

c.

d.

14. Show that the z-transform of the function f (t) = aty(t)u(t) sampledevery T seconds (time-scaling property of sampled signals) is F(z) =Y(a–T z).

15. Determine the z-transform of the sequences shown in Figure P9.3.15.

16. Show that the z-transform of the function sampledevery T seconds is

17. Use the results of Problem 9.3.16 to deduce the z-transforms of thefollowing functions:

a.

b.

c.

d.

18. Show that the z-transform of the convolution of two sampled func-tions is given by

19. Determine the response of the system shown in Figure P9.3.19 indiscrete form. Assume T = 0.5. Use the convolution theorem of theinput–output relationship of LTI systems.

Section 9.5

1. Deduce the function specified by the following one-sidedz-transforms. Employ fraction expansion.

Figure P9.3.15

y n na u nn( ) ( )=

y n a e n u nn bn( ) sin ( )= − ω

2.5

2

1.5

y(n

)

1

0.5

00 2 4

n

6 8 0 2 4

n

6 8

2.5

2

1.5y(

n)

1

0.5

0

... ...

f t ty t u t( ) ( ) ( )=F z Tz dY z dz( ) [ ( ) ].= − /

y nT nTu nT( ) ( )=

y nT nT u nT( ) ( ) ( )= 2

y nT nT nT T u nT( ) ( ) ( )= +

y nT nT nT T u nT( ) ( ) ( )= −

Z{ ( ) ( )} ( ) ( ).h nT x nT H z X z∗ =

f n( )

7267_book.fm Page 464 Thursday, November 2, 2006 3:28 PM

Page 480: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 9: The z-transform, difference equations, and discrete systems 465

a.

b.

c.

2. Determine the inverse functions for the following z-transforms:

a.

b.

c.

d. Repeat part (c) for the entire region |z| > 1.

3. Find the inverse z-transform of the function F(z) = z2 – 3z + 8)/[(z – 2)(z + 2)(z + 3)] for 3 < |z| < 2 and 2 < |z| < 3.

4. Determine the inverse z-transform of the function F(z) = (zsin a)/[z2 – (2cos a)z + 1] for|z|> 1.

5. Determine the inverse z-transforms of the following functions:

a.

b.

6. Derive the z-transforms of the functions shown in Figure P9.5.6 andthen deduce the inverse transforms.

7. Deduce the inverse z-transform of the following functions:

a.

b.

Figure P9.3.19

R = 1 C = 1

+

v(t)i(t) = u(t)

–u(t – 5) Systemi(t) v(t)

F z z z( ) [( )( )]= − −− −1 1 1 21 1/

F z z z( ) [( ) ]= −− −1 1 22/

F z z z z z( ) [ ( )] ( )= + + +2 22 4 3/

z z z z/[( )( )]− − < <1 2 1 2

z z z z2 21 2 1 2/[( ) ( )]− − < <

z z z z3 21 2 1 2/[( )( ) ]− − < <

( ) [ ( )]z z z+ −2 12/

( ) ( )z z z z z z3 2 3 22 1 5 3+ + + + − +/

( ) [( )( )]18 12 3 12z z z z− − −/

z z z2 22 1/[( )( ) ]− −

7267_book.fm Page 465 Thursday, November 2, 2006 3:28 PM

Page 481: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

466 Signals and systems primer with MATLAB

Section 9.6

1. A discrete-time system function is

The input is the signal specified by x(0) = 0, x(1) = 1, x(2) = 2, x(3) =0. Determine y(n).

2. A discrete-time system function is

The input is the unit step function u(n). Determine the system response(output).

3. A system is described by its system function

Figure P9.5.6

1.5

1

0.5

f(n

)

00 1 2

n

3 4 5

1.5

1

0.5

f(n

)

0–3 –2 –1

n

0 21 3

1.5

1

0.5

f(n

)

00 2

n

4 6

1.5

1

0.5

f(n

)

00 2 4 6

n

8

2

3

1

f(n

)

0–4 –2 2

n

0 4

1

2

3

f(n

)

00 2 4 6

n

... ...

H zz

z z( )

( )= −− +

− −

2 31 2

1

1 2

H zz

z z( ) = +

+ +

− −

21 3

1

1 2

H zaz

z bcz

z d( ) =

−+

7267_book.fm Page 466 Thursday, November 2, 2006 3:28 PM

Page 482: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 9: The z-transform, difference equations, and discrete systems 467

b and d are real and have magnitudes less than unity. Show differentblock diagram configurations that have this H(z).

4. Find the transfer function of the systems shown in Figure P9.6.4.

Section 9.7

1. Find the frequency response of the first-order IIR system and plot itsamplitude and phase spectra for .

2. Find the frequency response of the system shown in Figure P9.7.2.Observe that the system is made up of two first-order IIR systems incascade.

Figure P9.6.4

Figure P9.7.2

+ +

z−1 z−1

b a

x(n)

y(n)

(a)

z−1

z−1

1/4

2/3

+x(n) y(n)

(b)

b a0 10 5 0 8= = −. , .

+2 +

–3

z–1z–1

4

x(n) y(n)

7267_book.fm Page 467 Thursday, November 2, 2006 3:28 PM

Page 483: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

468 Signals and systems primer with MATLAB

3. Sketch the general shape of the magnitude of as a function ofthe frequency omega. The system function is

4. Find the frequency response of the systems shown in Figure P9.7.4.

5. A system is defined by the difference equation y(n) = ay(n – 1) +(1 – a)x(n). Determine the response of the system to the input signal

Section 9.9

1. Discretize the systems shown in Figure P9.9.1 and find their solutionsusing a direct solution of the difference equations. Next, verify yourresult using the z-transform method.

Figure P9.7.4

H ej( )ω

H zz z

z( )

( )( ).

= + −+

2 2

4

1 10 8

+

–0.9

+

–0.8 z–1z–1

z–1z–1

x(n) y(n)

+

–0.1

+

–0.2

x(n) y(n)

(a)

(b)

x nnT n

n( )

sin , , ,=

=

<

ω 0 1 2

0 0

7267_book.fm Page 468 Thursday, November 2, 2006 3:28 PM

Page 484: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 9: The z-transform, difference equations, and discrete systems 469

2. Refer to the system shown in Figure P9.9.2. Deduce the zero-stateresponse and the zero-input response. Also, find its transfer function.Use the appropriate substitutions to create the analogous discretesystem. With the sampling time T = 0.2, an input function f (t) =e –t u(t), and initial condition v(0) = 1, determine the output v(0.2n).Determine the impulse response function h(n).

Figure P9.9.1

Figure P9.9.2

+

v(t) = e–t u(t)

v(t) = e–t + u(t)

i(t) R = 2

L = 1

+

v(t) = u(t)

L = 1

R = 2

+

+

(a)

(b)

+ R = 1

C = 0.5 vc(t)

vo(t)

(c)

M = 2 System

v(t)

f(t)D = 1

f(t) v(t)

7267_book.fm Page 469 Thursday, November 2, 2006 3:28 PM

Page 485: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

470 Signals and systems primer with MATLAB

3. Let us approximate the first-order differential in a forward-type for-mat as as follows:

Using the above formula, find the solution to the differential equation

4. Use the z-transform technique to determine the solution to the fol-lowing difference equations:

a.

b.

Observe that one equation can be derived from the other by one unittime shift.

5. Radioactive decay. A radioactive substance decays at a rate propor-tional to the amount of the substance that is present. Therefore, thedifferential equation describing the decay is

.

The number of atoms present at time t is N(t), and k is a positiveproportionality constant. If the initial number of atoms present areN0, and knowing that the half-time is T½, the proportionality constantcan be found from the solution and is equal to ln2/T½. If the radio-active isotope I125 is injected in a cancerous prostate gland, with theinitial amount of atoms 1020, how many radioactive atoms remainafter 4 years if the half-life of I125 is 60 days? Use the equivalentdiscrete case.

6. Bioengineering. Assumptions: D0 = milligrams (mg) of dye injectedinto a patient’s heart at t = 0; the mixture of blood and dye in theheart is uniform; the mixture flows out at a constant rate r l/min;the heart is a container with constant volume V liters. Since dD(t)/dtis the rate change of the dye in the heart at time t, we obtain dD(t)/dt =rate dye in-rate dye out. Here, rate is zero and

dy tdt

y nT T y nTT

( ) ( ) ( )≅ + −

dy tdt

y t u t y( )

( ) ( ) ( )+ = =2 0 1

3 2 1 5 1 1 0y n y n u n y( ) ( ) ( ) ( )+ − = − − =

3 1 2 5 0 0y n y n u n y( ) ( ) ( ) ( )+ + = =

dN tdt

kN t( )

( )= −

rate out =D tV

r( )

,

7267_book.fm Page 470 Thursday, November 2, 2006 3:28 PM

Page 486: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 9: The z-transform, difference equations, and discrete systems 471

where D(t)/V is the concentration of the dye in the heart. Hence, thedifferential equation is

Discretize the above equation and find the quantity D(t)/V, a usefulmeasure of cardiac output, if r = 5 l/min, V = 0.1 l, and D0 = 100 mg.

7. Use the z-transform techniques to find the solution to the followingdifference equations (n > 0) with zero initial conditions:

a.

b.

Section 9.10

1. Solve the homogeneous equations:

a.

b.

2. Solve the homogeneous equations:

a.

b.

3. Solve the homogeneous equations:

a.

b.

4. Solve the equations given in Problem 9.10.1 using the z-transformmethods.

5. Fibonacci numbers. The sequence 1, 1, 2, 3, 5, 8, 13, … is called theFibonacci sequence. Observe that after the second element, eachterm is the sum of the two preceding terms. Therefore, if y(n) denotesthe nth term in the sequence, the unique solution is the initial valueproblem y(n + 2) = y(n + 1) + y(n), where n = 1, 2, 3, 4, …, y(0) = 1,and y(1) = 1. Show that the solution is

dD tdt

rV

D t( )

( )= −

y n y n( ) ( )+ + = −1 2

y n y n n( ) ( ) sin( )+ + =1 2 4π/

y n y n y n y y( ) ( ) ( ) ( ) , ( )− − + − = − = − =3 1 2 2 0 2 2 1 4

y n y n y n y y( ) ( ) ( ) ( ) , ( )− − + = − = − =8 1 15 0 2 0 1 1

y n y n y n y y( ) ( ) ( ) ( ) , ( )+ − + + = = =2 3 1 2 0 0 2 1 4

y n y n y n y y( ) ( ) ( ) ( ) , ( )+ − + + = = =2 8 1 15 0 0 0 1 1

y n y n y n y y( ) ( ) ( ) ( ) , ( )− − + − = − = − =7 1 10 2 0 2 0 1 1

y n y n y n y y( ) ( ) ( ) ( ) , ( )+ − + − = − = − =6 1 18 2 0 2 0 1 1

y n

n n

( ) = +

− −

1

5

1 52

1 52

7267_book.fm Page 471 Thursday, November 2, 2006 3:28 PM

Page 487: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

472 Signals and systems primer with MATLAB

6. Determine the distance traveled by the system shown in FigureP9.10.6 if x(–1) = 0 and x(–2) = 1 with the sampling time T = 1. Usethe z-transform method.

7. Population model. A pair of adult rabbits is assumed to produce apair of rabbits every month. Every new pair of rabbits is assumed tofollow the same sequence. How many pairs will there be after nmonths if we begin (initial condition) with a pair of newborn rabbits?(This is the Fibonacci rabbit problem.)

8. Use the z-transform methods to solve the following difference equa-tions:

a.

b.

c.

9. National income (engineering economics). A national income modelis given by the equation v(n) = c(n) + i(n) + g(n), where c(n) = consumerexpenditure, i(n) = induced private investment, and g(n) = govern-ment expenditures. It is specified* that c(n) = av(n – 1) and i(n) =c[c(n) – c(n – 1)] = ab[v(n – 1) – v(n – 2)], where a and b are constants(a is referred to as the marginal propensity to consume). Thus, at anycounting period — for example, say any four months — the nationalincome is given by

Determine the national income if a = 1, b = 1, g(n) = u(n), and v(–1) =v(–2) = 0. Use the z-transform methods.

1. The national income is the sum of consumer expenditure, inducedprivate investment, and government expenditures.

2. Consumer expenditure in each period is directly proportional tothe national income in that period.

Figure P9.10.6

* A.P. Samuelson, Interactions between the multiplier analysis and the principle of acceleration,Rev. Econ. Stat., 21, 75, 1939.

M = 2

v

x D = 5

y n y n yn( ) ( ) ( )+ − = =1 2 0 1

y n y n y( ) ( ) ( )+ − = =1 3 2 0 0

y n y n y n y yn( ) ( ) ( ) ( ) ( )+ − + + = × = =2 8 1 15 5 2 0 1 0

v n a b v n abv n g n( ) ( ) ( ) ( ) ( )= + − − − +1 1 2

7267_book.fm Page 472 Thursday, November 2, 2006 3:28 PM

Page 488: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 9: The z-transform, difference equations, and discrete systems 473

3. Induced private investment in any period is directly proportionalto the increase in the national income for that period above thenational income for the preceding period.

4. The government expenditure stays constant from one period tothe next.

10. Loan repayments (engineering economics). Compound interest isequal to ap, where a is the fraction of a year and p% is the interestper year. It is supposed that compound interest at 8% per year ischarged on the outstanding debt, with conversion period a = 1/12of the year as the period between payments. Find the debt 20 yearslater if the beginning debt was 200,000.00 and the payments were2000.00 per month.

*Appendix 9.1: Proofs of the z-transform propertiesLinearity

This property is due to the fact that the summation is a linear operation.Furthermore, if we have the sum of m sequences and take their z-transform,we have m regions of convergence (ROCs) or, equivalently, m radius. TheROC of the sum is equal to the greatest radius found.

Right shifting

Proof: Begin with the definition of the z-transform:

Multiply by z–m and then substitute –q for –m – n. The result is

where, since m is a dummy variable, it has been changed to the letter n. Thethird term in the expression is obtained by invoking the one-sided characterof y(n) with y(negative argument) = 0. For the case when we find that y(–m)(initial condition) has values other than zero, we must add the quantity

to the left-hand member of the aboveequation. The multiplication by z–m (m > 0) creates a pole at z = 0 and deletesa pole at infinity. Therefore, the ROC is the same as the ROC of y(n), withpossible exclusion of the origin.

Y z y n z n

n

( ) ( )= −

=

∑0

z Y z z y q m z y q m z ym m q

q m

q

q

− − −

=

∞−

=

= − = − =∑ ∑( ) ( ) ( ) (0

nn m z n

n

− −

=

∑ )0

y m y m z y z m( ) ( ) ( ) ( )− + − + + −− − −1 11 1�

7267_book.fm Page 473 Thursday, November 2, 2006 3:28 PM

Page 489: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

474 Signals and systems primer with MATLAB

Left-shift property

Proof: From the basic definition,

Now, set n + 1 = m to find

By a similar procedure, we can show that

Time scaling

Proof: From the definition of the z-transform,

which indicates that in the z-transform of y(n), wherever we see z we sub-stitute it with a–1z.

Periodic sequences

Proof: The z-transform of the first period is

Because the period is repeated every N discrete time units, we can use theright-shift property to write

Z{ ( )} ( )y n y n z n

n

+ = + −

=

∑1 10

Z{ ( )} ( ) ( ) ( )y m y m z z y m z z y m zm

m

m

m

= = =− +

=

∞−

=

∑ ∑1

1 1

−−

=

∑ − = −m

m

zy zY z zy0

0 0( ) ( ) ( )

Z{ ( )} ( ) ( ) ( ) ( )y n m z Y z z y z y zy mm m m+ = − − − − −

=

−0 1 11 �

zz Y z y n zm m n

n

m

( ) ( )− −

=

∑0

1

Z{ ( )} ( ) ( )( )a y n a y n z y n a zn n n

n

n

n

= = =−

=

∞− −

=

∑ ∑0

1

0

YY a z( )−1

Z{ ( )} ( ) ( )( ) ( ) ( )y n y n z Y zn

n

N

1 1

0

1

1= =−

=

Z Z Z Z{ ( )} { ( )} { ( )} { (( ) ( ) ( )y n y n y n N y n N= + − + −1 1 1 2 ))}

( ) ( ) ( )( ) ( ) ( ) ( )

+

= + + + =− −

�Y z z Y z z Y z YN N1 1

21 1 (( )( )

( )( ) ( )

z z z

zY z

zz

Y

N N

N

N

N

1

11 1

2

1 1

+ + +

=−

=−

− −

(( )z

7267_book.fm Page 474 Thursday, November 2, 2006 3:28 PM

Page 490: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 9: The z-transform, difference equations, and discrete systems 475

where the geometric series formula was used.

Multiplication by n

Proof: From the basic definition,

Initial value

Proof: Let the sequence be zero for n < m. Then,

Multiply both sides by zm to obtain

As z → ∞, all terms to the left of the above expression go to zero besides thefirst.

Final value

Proof: Begin with and consider

by the right-shifting property. This is written

Take the limit as z → 1, or

Z{ ( )} ( ) ( )( )ny n y n nz z y n nz zn

n

n

n

= = =−

=

∞− −

=

∑ ∑0

1

0

yy nddz

z

zddz

y n z

n

n

n

n

( )

( )

=

∞−

=

∞−

= − = −

0

0

zzdY z

dz( )

Y z y n z y m z y m zn

n m

m m( ) ( ) ( ) ( )= = + + +−

=

∞− − −∑ 1 1 �

y m y m z y m z z Y zm( ) ( ) ( ) ( )+ + + + + =− −1 21 2 �

y n y n( ) ( )− − 1

Z{ ( ) ( )} ( ) ( ) [ ( ) ( )]y n y n Y z z Y z y n y nn

− − = − = − −−

=

1 11

00

∞−∑ z n

( ) ( ) lim [ ( ) ( )]1 11

0

− = − −−

→∞=

−∑z Y z y n y n zN

n

Nn

lim( ) ( ) lim lim [ ( ) ( )]z z N

z Y z y n y n→

→ →∞− = − −

1

1

11 1

nn

Nnz

=

−∑0

7267_book.fm Page 475 Thursday, November 2, 2006 3:28 PM

Page 491: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

476 Signals and systems primer with MATLAB

Interchange the summation on the right:

since y(–1) = 0. The limit z → 1 will give meaningful results only when thepoint z = 1 is located within the ROC of Y(z).

Convolution

Proof: The z-transform of the convolution summation is

We substituted n = ∞ in the second summation since h (negative argument)is zero. Next, write n – m = q and invert the order of summation:

since h(q) = 0 for q < 0.

= − − =→∞ →

=

→∞∑lim lim [ ( ) ( )] lim [N z

n

Nn

Ny n y n z y

10

1 (( ) ( )]

lim [ ( ) ( ) ( ) (

n y n

y y y y

n

N

N

− −

= − − + −

=

→∞

∑ 1

0 1 1

0

00 2 1) ( ) ( ) ] lim ( )+ − + =→∞

y y y NN

Z{ ( )} ( ) ( ) ( )y n Y z z h n m x m zn

n m

nn

n

� = − =−

=

=

=∑ ∑

0 0 0

∞∞

=

∑ ∑ −h n m x mm

( ) ( )0

Y z x m h n m z x m z hm

n

n

n

m

m( ) ( ) ( ) ( ) (= − ==

∞−

= =

∞−∑ ∑ ∑

0 0 0

qq z

x m z h q z X z H

q

q m

m

m q

q

)

( ) ( ) ( )

=−

=

∞− −

=

∑ ∑= =0 0

(( )z

7267_book.fm Page 476 Thursday, November 2, 2006 3:28 PM

Page 492: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

477

chapter 10

Analog filter design

The term filter, as used in this text, is a frequency-selective network designto operate on an input signal to produce a desired output signal. That is, afilter passes signals of certain frequencies and blocks signals of other fre-quencies. The signals may be continuous-time entities that may be stated intime or frequency terms. The signals may also be discrete-time entities, andthese signals may also be stated in time or frequency terms.

Filters are usually categorized according to their behavior in the frequencydomain and are specified in terms of their magnitude and phase character-istics. Based on their magnitude or transfer response, filters are classified aslow-pass, high-pass, band-pass, and band-stop. Based on phase characteris-tics, filters are often linear phase devises.

Modern filter design techniques, which date from the 1930s, employ atwo-step procedure. The first step is to find an analytic approximation to thespecified filter characteristic as a transfer function. The second step is aphysical realization of this transfer function by passive or active networks.In this text we will discuss the first step because we will need the analogform of filters to develop the corresponding digital ones. The second step isbeyond our studies in this text. Our intent is not to provide an in-depthpresentation of analog filters in electrical engineering, but to give the fun-damentals of two types of filters that will be used to develop digital ones.

10.1 General aspects of filtersIdeal low-pass, high-pass, band-pass, and band-stop analog filters are shownin Figure 10.1.1. Well-developed procedures exist for approximating theseresponse characteristics and involve such functions as Butterworth, Cheby-shev, elliptic, and others. The use of these functions has the advantage thatthe formulas for them are well established and design tables are available.

As a step in meeting our interests in digital filter design, we first studythe approximation problem in the analog domain and then the means ofconverting from the s-plane, in which the H(s) approximation exists, to thez-plane and the corresponding H(z). The developed system function H(z)

Page 493: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

478 Signals and systems primer with MATLAB

can then be realized by discrete systems, either by transformation to differ-ence equation form, which can be adapted to computer calculations, or bydirect hardware implementation. The resulting difference equation can beconsidered to denote a digital filter approximation to the analog filter.

From a practical point of view, the implementation of the filter on adigital computer places accuracy constraints on the realization of the transferfunction. This problem arises because the registers can contain only a finitenumber of bits at any one instance. Therefore, when we are dealing withdevices having registers that can contain a limited number of bits, we mustbe aware that the filters to implement may differ considerably from thedesired ones. These sources of error within a digital filter are referred to asround-off noise, and methods have been developed to reduce their effect.

It is important to understand that when we talk about filters, we actuallymean systems. Filters (systems) can be of a diverse nature. For example, apainting is a two-dimensional optical signal (input) to our eyes. The filter(system) that processes and interprets the optical signal is our eye–braincombination, and the output is the painting that we actually see. ObserveFigure 10.1.2 at close range and at arm’s length. At the first position theblack-and-white changes are sharp and well defined. At the second positionthe sharpness has disappeared and the picture looks smoother. Because thehigh frequencies (in this case, the number of black-and-white variations ofparallel black lines per 1˚ angle from the center of our retina; it must not beconfused with the frequencies that make up the light) in the optical signaldo not pass through the eye–brain filter (actually a band-pass filter with its

Figure 10.1.1 Ideal frequency response characteristics of analog filters.

Pass

band

Stop

band

Low-pass

ωc ω

H(ω)

Pass

band

Stop

band

Stop

band

Band-pass

ω1 ω2 ω

H(ω)

Pass

band

Stop

band

High-pass

ωc ω

H(ω)

Pass

band

Pass

band

Stop

band

Band-stop

ω1 ω2 ω

H(ω)

(b) (a)

(c) (d)

Page 494: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 10: Analog filter design 479

lower end at 0.5 cycles/degree and its high end at 35 cycles/degree; the eyesees best at about 26 cycles/degree), smoothing of the picture occurs. The samephenomenon was discussed in Chapter 4 when we tried to reproduce adiscontinuous periodic signal by retaining only the low-frequency components.

Other examples of nonelectrical systems that possess filtering character-istics include the economy of the country (input = goods and services,output = gross national product), the structure of a building (input = earth-quake vibrations, output = building oscillations), the heartbeat (input =message for a girl or boy, output = number of heartbeats per minute), theairplane (input = direction and speed of wind, output = direction of flaps),etc. From this brief discussion, it can be seen that the study of filters —electrical, biological, chemical, and so on — can be far ranging and is mostimportant.

10.2 Butterworth filterWe now examine the use of the Butterworth function to approximate theideal low-pass filter shown in Figure 10.1.1a. The amplitude response of thenth-order Butterworth filter is given by

(10.1)

where c is the cutoff frequency and is the frequency in rad/s. If we hadset the cutoff frequency equal to 1, the above formula would represent thenormalized amplitude response.

At equal to 0 the magnitude has the maximum value of 1. At the cutofffrequency, the so-called cutoff point, the magnitude is equal to

Figure 10.1.2 Observe the effect of filtering of the visual system by studying the figurewhen held several feet away. (Harmon, L. et al., Masking in visual recognition: Effectsof two-dimensional filtered noise, Science, vol. 180, June 15, 1973, p. 1194. © AAAS.)

H jn

cn

( )( )

=+

1

1 2/

H j H j H jc( ) ( ) . ( )max max

= =1

20 707

Page 495: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

480 Signals and systems primer with MATLAB

Because the function of all orders approaches the value 1 smoothly withoutovershoots, the function is called maximally flat. It is observed that that theapproximation to the ideal filter improves as n increases.

To obtain the transfer function form of the Butterworth filter, we makeuse of the fact that the normalized formula can be written in the form Hn(j ) =Hn(s)|s= j and rewrite (10.1) in squared form:

(10.2)

We write the denominator polynomial in the form

(10.3)

The roots of the function are deduced from

from which it follows that

(10.4)

so that

The kth root is

(10.5)

In expanded form, this expression is

(10.6)

It can be seen from (10.5) that the roots of sk are on a unit circle andspaced /2n radians apart. Moreover, no sk can occur on the j -axis since2k – 1 cannot be an even integer. We thus see that there are n left-half planeroots and n right-half plane roots. The left-half plane roots are associatedwith H(s) since k is negative for these roots, and the right-half plane roots

H s H sj j sn n n n( ) ( )

[( ) ] ( )=

+=

+1

11

12 2 2/

D s D s s n( ) ( ) ( )= +1 2

1 02+ =( )s n

( ) , , , ,( )= = =1 1 1 2 3 22 2 1n n j ks e k n�

s e en j k jn2 2 1= ( )

s j e jek k kj k n n j k n= + = =+( ) / ( ) /2 1 2 2 1 2

s kn

j knk = +sin ( ) cos ( )2 1

22 1

21 k n2

Page 496: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 10: Analog filter design 481

are associated with H(–s). These results are shown in Figure 10.2.1 for thecase n = 4:

The poles due to H(–s) located on the right side of the s-plane are not shown.They are symmetrically located with respect to the imaginary axis. Thepolynomial constructed from these poles is

We can use the following MATLAB function to plot the roots:zplane([], roots([1 2.6131 3.4142 2.6131 1]). If there are alsozeros, we substitute [] with roots([b]), where b is a vector containing thepolynomial coefficients.

Note: The expression for D(s) is for the normalized condition c = 1. For c 1,we must substitute s/ c for s in the expression.

The normalized D(s) of the Butterworth function of order n is the poly-nomial

(10.7)

Figure 10.2.1 The left-hand-side poles of the fourth-order Butterworth filter.

1

0.8

0.6

0.4

0.2

0

–0.2

–0.4

–0.6

–0.8

–1

–1 –0.5 0.5 10

Real part

Imag

inar

y p

art

s2 = –0.9239 + j0.3827

s1 = –0.3827 + j0.9239

s3 = –0.9239 − j0.3827

s4 = –0.3827 − j0.9239

×

×

×

×

s e s e s e s ej j j j1

5 82

7 83

9 84

11 8= = = =/ / / /

D s s s s s s s s s s( ) ( )( )( )( ) . .= = + +1 2 3 4 1 2 6131 3 41142 2 61312 3 4s s s+ +.

D s a s a s a s snn n( ) = + + + + +1 1 2

21

1�

Page 497: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

482 Signals and systems primer with MATLAB

with the coefficients computed in the manner shown above. Note that a0 andan are always unity because the poles are all on the unit circle. Table 10.2.1gives the values of the coefficients for these functions for n = 2 to n = 8, andTable 10.2.2 gives the Butterworth polynomials (10.7) in factored form.

The steps to find the transfer function of a Butterworth filter are sum-marized as follows:

1. Use the normalized form of (10.1), c = 1, to obtain the value of n orattenuation for frequencies

above = k c = k × 1, where k is some given positive number.2. If the deduced value of n is nonintegral, select the next higher integer

as the order of the filter. For example, if in a specific case n = 3.325,we select a fourth-order filter.

3. Use Table 10.2.2 to obtain the the normalized transfer function

Table 10.2.1 Coefficients of Butterworth Polynomial

n a1 a2 a3 a4 a5 a6 a7

2345678

1.41422.00002.61313.23613.86374.49405.1528

2.00003.41425.23617.4641

10.097813.1371

2.61315.23619.1416

14.591821.8462

3.23.617.4641

14.591825.6884

3.863710.097821.8462

4.494013.1371 5.1258

Table 10.2.2 Factors of Butterworth Polynomials

n

1

2

3

4

5

6

7

8

9

= +10 10 1102

102log | ( )| log ( )H j n dB

H sD s

( )( )

= 1

s + 1

s s2 1 4142 1+ +.

( )( )s s s+ + +1 12

( . )( . )s s s s2 20 7654 1 1 8478 1+ + + +

( )( . )( . )s s s s s+ + + + +1 0 6180 1 1 6180 12 2

( . )( . )( . )s s s s s s2 2 20 5176 1 1 4142 1 1 9319 1+ + + + + +

( )( . )( . )( .s s s s s s+ + + + + +1 0 4450 1 1 2470 1 1 80192 2 2 ss + 1)

( . )( . )( . )(s s s s s s2 2 20 3902 1 1 1111 1 1 6639 1+ + + + + + ss s2 1 9616 1+ +. )

( )( . )( )( . )(s s s s s s s s+ + + + + + +1 0 3473 1 1 1 5321 12 2 2 22 1 8794 1+ +. )s

Page 498: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 10: Analog filter design 483

4. Substitute s/ c for in step 3 for the nonnormalized form.5. If we wish to normalize |H(s/ c)| with amplitude starting at unity,

multiply |H(s/ c)| by the value of the constant of the polynomialD(s/ c).

Example 10.2.1: Deduce the transfer function of a Butterworth filter thathas an attenuation of at least 10 dB at twice the cutoff frequency, where c =2.5 × 103 rad/s.

Solution: We initially find the normalized Butterworth filter. At = 2 ×c = 2 × 1 ( c=1, normalized),

(10.8)

The dB attenuation is given by

Therefore,

The order of the filter must then be n = (log2 9)/2 = 1.5850. Instead oflogarithm transformation, the reader can use the MATLAB functionlog2(9)/2 to obtain the above value. Hence, a second-order Butterworthsatisfies this requirement. The corresponding transfer function of the nor-malized filter is (see Table 10.2.2)

(10.9)

For a cutoff frequency c = 2.5 × 103 rad/s, the transfer function is

(10.10)

Figure 10.2.2 shows the amplitude and phase characteristics of the normal-ized second-order filter. If we multiply the axis of the normalized filter by

c = 2.5 × 103 rad/s, we obtain the unnormalized filter characteristics for thiscase.

H jn n( )2

11 2

2

2=

+

( ) = +10 2 10 1 2 1010

2

102

1log ( ) log ( ) logH jnn or 00

210

11 2 10( ) log ( )+ =n

1 2 10 92+ =n or 22n

H ss s

2 2

11 4142 1

( ).

=+ +

H ss sc2 7 2 4

11 6 10 5 6568 10 1

( ). .

/ =× + × +

Page 499: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

484 Signals and systems primer with MATLAB

The denominator polynomial has conjugate roots with negative realparts. We split the function D(s) of (10.10) into two polynomials, separatingthe even and odd powers of s:

(10.11)

The roots of each component are purely imaginary (zero included), andadditionally, the roots alternate; thus, . Polynomialsthat possess these properties are known as Hurwitz polynomials.

Observe also that (10.10) is of the general form

(10.12)

It can be shown that a transfer function of this form can be realized withpassive elements if and only if D(s) is a Hurwitz polynomial.

Suppose that we wish to find a two-port network of the terminated formshown in Figure 10.2.3a appropriate to (10.10). Since D(s) is of the secondorder, the lossless two-port network shown in Figure 10.2.3b appears to bean appropriate form. The transfer function is

(10.13)

This form differs from (10.10) by 2 in the denominator. If we multiplythe numerator and denominator of (10.10) by 2, we obtain an equivalenttransfer function:

Figure 10.2.2 Phase and amplitude characteristics of the second-order normalizedButterworth filter.

0–2

–1.5

–1

–0.5

0

1 2 3 4 5ω/ωc

Ph

ase

of

H2(s

)

00

0.8

0.6

0.4

0.2

0

1 2 3 4 5ω/ωc

Mag

nit

ud

e o

f H

2(s

)

D s e s o s se

( ) ( ) ( ) . .= + = × + + ×1 6 10 1 5 65697 2� � 110 4 s

o� �

× < < ×2 5 10 2 5 103 3. .s

H sa a s a s a s a s

kD sn

nn

n( )

( )=

+ + + + +=1

0 1 22

11�

V sV s

H sLCs L C s

o

i

( )( )

( )( )

= =+ + +

122

Page 500: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 10: Analog filter design 485

(10.14)

By comparing these two equations, we obtain

These expressions can be solved to yield C = 5.6164 × 10–4 F and L = 5.6976 ×10–4 H. �

Example 10.2.2: A low-pass normalized Butterworth filter must satisfythe following: (a) |Hn(j0.5)|2 > 0.9 in pass-band, 0 1, and (b) |Hn(j0.5)|2 <0.05 in the stop-band, 1 . Find its order and plot its amplitude response.

Solution: From (a) we have 1/[1 + (0.5)2n] > 0.9 or n > 1.5850, and from(b), 1/[1 + (1.5)2n] < 0.05 or n > 3.6309, which implies that n = 4 will sufficeand satisfies both inequalities.

Book MATLAB m-file: ex_10_2_2

%m-file: ex_10_2_2

w=0:0.01:4;%frequency range from 0 to 4 rad/s;

b=[0 0 0 1];

Figure 10.2.3 Second-order Butterworth filter.

Rs = 1+

RL = 1 Vo

L

CVi

+

+ Rs = 1

RL = 1

Lossless network

VoVi

+

(a)

(b)

H ss s

( ). .2

13 2 10 1 1314 10 27 2 3

=× + × +

CL C L= × + = ×3 2 10 1 1314 107 3. .

Page 501: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

486 Signals and systems primer with MATLAB

a=[1 2.613 3.414 2.613 1];

H=freqs(b,a,w);

plot(w,abs(H),'k');xlabel('\omega rad/s');

ylabel('Magn. 4th-order Butt. filter'); �

10.3 Chebyshev low-pass filterAn examination of Figure 10.2.2 shows that the Butterworth low-pass ampli-tude response approaches the ideal in the region of low frequencies and alsoin the region of high-value frequencies. However, it does not produce verygood approximation in the neighborhood of the cutoff frequency ( = 1).The Chebyshev low-pass filter possesses a sharper cutoff response than theButterworth filter, but it also possesses amplitude variations within thepass-band. A number of general properties are:

1. The oscillations in the pass-band have equal amplitudes for a givenvalue of .

2. The curves for n even always start from the trough of the ripple,whereas the curves for n odd always start from the peak.

3. At the normalized cutoff frequency of 1, all curves pass through thesame point.

The amplitude response of the Chebyshev low-pass filter is specified by

(10.15)

where is a constant and Cn( ) is the Chebyshev polynomials given by theequations

(10.16)

The analytic form of Chebyshev polynomials for order 0 to 10 is tabulatedin Table 10.3.1.

By (10.16) and the recurrence relationship

(10.17)

the nth-order Chebyshev polynomial possesses the properties shown inTable 10.3.1.

H jC C s j

nn

n n

( )( ) ( )

, , ,==+

=+

=1

1

1

11 2 3

2 2 2 2 /�

C n

n

n( ) cos( cos )

cosh( cosh )

=

= >

1

1

1

1

a)

b)

C C C n

C C

n n n+ = =

=

1 1

1 0

2 1 2 3( ) ( ) ( ) , , ,

( )

� a)

(( ) b)

Page 502: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 10: Analog filter design 487

1. For any n,

2. Cn( ) is monotonically increasing for > 1 for all n.3. Cn( ) is an odd polynomial if n is odd. Cn( ) is an even polynomial

if n is even.4. Cn(0) = 0 for n odd.5. |Cn(0)| = 1 for n even.

The function |H(j )| attains its maximum value 1 at the zeros of Cn( )and its minimum value 1/ at the points where Cn( ) attains its max-imum value of 1. Thus, the ripples in the pass-band 0 1 have a peak-to-peak value of

(10.18)

The ripple in decibels is given by

(10.19)

Outside of the pass-band > 1,|H(j )|decreases monotonically.

Table 10.3.1 Chebyshev Polynomials

n Cn( )

0 112 2 2 – 13 4 3 – 34 8 4 – 8 2 + 15 16 5 – 20 3 + 56 32 6 – 48 4 + 18 2 – 17 64 7 – 112 5 + 56 3 – 78 128 8 – 256 6 + 160 4 – 32 2 + 19 256 9 – 476 7 + 432 5 – 120 3 + 9

10 512 10 – 1280 8 + 1120 6 – 400 4 + 50 2 – 1

0 1 0 1

1 1> >

C

C

n

n

( )

( )

1 2+

r = +1 1 1 2/

rdB =+

= +201

110 110

210

2log log ( )

Page 503: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

488 Signals and systems primer with MATLAB

In the unnormalized case, when c 1, the Chebyshev low-pass filter isdefined by

(10.20)

To find the pole location of Hn(s), where s = j , we study the denominatorof the normalized function ( c = 1)

(10.21)

More specifically, the poles of the function occur when orwhen (see (10.16))

(10.22)

To proceed we define

(10.23)

Combine this with (10.22), from which

(10.24)

because cos jx = cosh x and sin jx = jsinh x. Equate real and imaginary termson each side of the equation:

(10.25)

It follows from (10.25a), since , that

(10.26)

Because (10.25b) together with (10.26) yields for :

H jC C s j

nn c n c

( )( ) ( )

, ,=+

=+

=1

1

1

11 2 3

2 2 2 2/ /,,�

H s H sC s jn n

n

( ) ( )( )

=+

11 2 2 /

C s jn( )/ /= ± 1 2

cos[ cos ( )]n s j j= ±1 / /

cos ( ) =1 s j j/

cos cosh (sin sinh )n n j n nj+ = ±

cos cosh

sin sinh

n n

n n

=

= ±

0

1

a)

b)

cos n 0

= =( ) , , , ,2 12

1 2 3 2kn

k n�

sin ,n = ± 1

Page 504: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 10: Analog filter design 489

(10.27)

Equation (10.23) can be used to specify the poles:

(10.28)

These points are located on an ellipse in the s-plane. The reader can writeone of the following simple MATLAB programs (in this case for thesixth-order Chebyshev filter) and see that indeed the roots are located on anellipse.

Book MATLAB program

y=roots([1 1.1592 2.1718 1.5898 1.1719 0.4324 0.0948]);

>> plot(real(y),imag(y),'xk');

>> axis equal;

Book MATLAB program

zplane([],[1 1.1592 2.1718 1.5898 1.1719 0.4324 0.0948]);

To prove that the locus is an ellipse, let

(10.29)

(10.30)

It follows from (10.29) and (10.30) that

(10.31)

= ± 1 11

nsinh

s j j j knk k k= + = =cos( ) sin ( ) sin2 1

2hh sinh

cos ( )

1 1

2 12

1

n

j kn

cosh sinh1 11

n

k kn n

= sin ( ) sinh sinh2 12

1 11

k kn n

= cos ( ) cosh sinh2 12

1 11

k k

n

2

1

2

2

1 1sinh sinh cos

+

hh sinh1 1

11

2

n

=

Page 505: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

490 Signals and systems primer with MATLAB

This equation is of an ellipse with the minor axis (x-axis) equal to the squareroot of the denominator of k and the major axis (y-axis) equal to the squareroot of the denominator of k.

The desired response, using only the roots with negative real parts, isgiven by the following transfer function:

(10.32)

The steps to find the Chebyshev filter are summarized as follows:

1. For a specified dB ripple, is deduced from (10.19).2. The attenuation in dB at a specified frequency that is a multiple of

the critical frequency must satisfy the equation (see (10.20))

3. From step 2, n is determined. Next, use (10.28) to obtain the roots.4. The constant K of (10.32) is selected to meet the direct current (dc)

gain level dictated by the problem at hand.5. The normalized transfer function is then given by

(10.33)

6. For the case that the cutoff frequency is different than unity, thetransfer function is

(10.34)

Table 10.3.2 gives the coefficients in the denominator of (10.32).

Example 10.3.1: Design a Chebyshev filter with a 1-dB ripple in thepass-band and an attenuation of at least 20 dB at twice the cutoff frequency,specified as 3 kHz.

H sK

a a s a s a s snn n

( ) =+ + + + +0 1 2

21

1�

= +10 10 110

2

102 2log ( ) logH j Cn

c

dB

H sK s

sn

kk

n

( )

( )

=

=

1

1 11

H sK s

sn c

kk

n

( )

( )( )

=

=

1

1 11

/

Page 506: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 10: Analog filter design 491

Solution: Follow the steps outlined above to obtain:

1. Since Cn(1) = 1 n = 0, 1, 2, …, then 1 = 10 log10(1 + 2) from which100.1 = 1 + 2. Thus, .

2. 10 log10[1 + 0.50882 Cn2(2)] 20 dB from which 1 + 0.50882 Cn

2(2) 102.Thus, we find that Cn

2(2) 99/(0.50882) = 382.42. From Table 10.3.1we find that C3

2(2) = (4 × 23 – 3 × 2)2 = 676 and all others less n = 3have values of less than 382.42. Hence, we choose n = 3.

3. From (10.28), we obtain

In a similar manner, we find

4. Assume K = 1.

Table 10.3.2 Coefficients of the Polynomial in (10.32)

n a0 a1 a2 a3 a4 a5 a6 a7

r = 0.5 dB = 0.34931 2.86282 1.5162 1.42563 0.7157 1.5349 1.25294 0.3791 1.0255 1.7169 1.19745 0.1789 0.7525 1.3096 1.9374 1.17256 0.0948 0.4324 1.1719 1.5898 2.1718 1.15927 0.0447 0.2821 0.7557 1.6479 1.8694 2.4127 1.15128 0.0237 0.1525 0.5736 1.1486 2.1840 2.1492 2.6567 1.1461

r = 1.0 dB = 0.50881 1.96522 1.1025 1.09773 0.4913 1.2384 0.98834 0.2756 0.7426 1.4539 0.95285 0.1228 0.5805 0.9744 1.6888 0.93686 0.0689 0.3071 0.9393 1.2021 1.9308 0.92837 0.0307 0.2137 0.5486 1.3575 1.4288 2.1761 0.92318 0.0172 0.1073 0.4478 0.8468 1.8369 1.6552 2.4230 0.9198

= =1 2589 1 0 5088. .

s j1 1 11

613

10 5088

= + = sin sinh sinh.

+

×

j cos

cosh sinh.

6

13

10 508

1

880 2471 0 9660= +. .j

s j s j j2 2 2 3 3 30 4942 0 2471 0 9660= + = = + =. . .

Page 507: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

492 Signals and systems primer with MATLAB

5. The normalized transfer function is

6. In this example, and the final function is

Figure 10.3.1a shows the pole location on the s-plane, and Figure 10.3.1bshows the frequency response of the filter.

Book MATLAB m-file: ex_10_3_1a

%m-file for Ex 10.3.1: ex_10_3_1a

r=roots([1/(6*pi*10^3)^3 0.9883*(1/((6*pi*10^3)^2))...

1.2384*(1/(6*pi*10^3)) 0.4913]);

cr=-r;%conjugate roots to the right of the s-plane;

p=[r' cr'];

plot(real(p),imag(p),'x');

axis equal;

grid on;

Book MATLAB m-file: ex_10_3_1b

%m-file for Ex_10.3.1:ex_10_3_1b

w=0:500:80000;

h=0.4913./((j*w/(6*pi*10^3)).^3+0.9883*(j*w/...

(6*pi*10^3)).^2+1.2384*(j*w/(6*pi*10^3))+0.4913);

plot(w,abs(h)); �

H ss s s

s s s s s s3

1 2 33

1 2 31

0 4913

( )( ) ( )( )( )

.

=

=(( ) [ ( ) ( )+ + + + +1 3 3

1 2 32

1 2 1 3 2 3 1s s s s s s s s s s s s s ss s

s s s

2 3

3 2

0 49130 9883 1 2384 0 4913

]

.. . .

=+ + +

c = × × = ×2 3 10 6 103 3

Hs

s

3 3

3

3

6 10

0 4913

6 100

×=

×+

.

.998836 10

1 23846 10

0 43

2

3

s s×

+. . 9913

Page 508: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 10: Analog filter design 493

Figure 10.3.1 Illustration of Example 10.3.1.

Imag

(s)

1.5

0.5

0

–0.5

–1

–1.5

–2 –1.5 –1 –0.5 0

1

Real(s)

0.5 1 1.5 2

× 104

× 104

× ×

(a)

Mag

nit

ud

e o

f fi

lter

res

po

nse

1

0.9

0.8

0.7

0.6

0.5

0.4

0.3

0.2

0.1

00 1 2 3 4 5 6 7 8

× 104ω rad/s

(b)

Page 509: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

494 Signals and systems primer with MATLAB

10.4 Phase characteristicsThe prior discussion focused on the amplitude response of low-pass filters.However, phase characteristics have been ignored in these discussions, andthese characteristics generally become progressively worse (less linear) asthe amplitude response is improved. The phase characteristic is often animportant factor since a linear phase response with frequency is necessaryif we wish to transmit a pulse through a network without distortion, eventhough a time delay may ensue. As we will see, a digital FIR filter does havea linear phase characteristic.

10.5 Frequency transformationsOur initial studies have been confined to low-pass filters. However, we areable to make the following frequency transformations: low-pass to low-pass,low-pass to high-pass, low-pass to band-pass, and low-pass to band-stop.All these transformations give the same order of filter as the low-pass one.

Low-pass-to-low-pass transformation

To achieve a low-pass-to-low-pass transformation, we must introduce a func-tion of such that

A function that accomplishes this transformation is given by

(10.35)

Example 10.5.1: Transform a low-pass filter with a cutoff of 1 to anotherlow-pass filter with a cutoff frequency of 1.8.

Solution: The denominator of the second-order low-pass filter, after thesubstitution, is

= =

= ± = ±

=

0 0

1

transforms

transforms

w

w

transforms w wc=

swwc

=

D ww w

( ) .. .

= + +1 1 41421 8 1 8

2

Page 510: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 10: Analog filter design 495

And hence the transformed filter is

The reader can easily verify the transformation. �

We can also use the MATLAB function lp2lp(). To solve Example 10.5.1,we write [nt,dt]=lp2lp([0 0 1],[1 1.4142 1]); (note that thevectors nt and dt start from the highest order and go to the zero order ofthese polynomials).

Low-pass-to-high-pass transformation

To effect this transformation we set

(10.36)

Example 10.5.2: Design a second-order Chebyshev high-pass filter witha cutoff frequency of 300 rad/s. The ripple factor is defined at 1 dB. Use theMATLAB m-file.

Solution: The following m-file produces the desired output.

Book MATLAB m-file: ex_10_5_2

%m-file for the Ex 10.5.2:ex_10_5_2

w=0:10:1000;

n=[0 0 1];d=[1 1.0977 1.5162];

[nt,dt]=lp2hp(n,d,300);

h=freqs(nt,dt,w);

plot(w,abs(h)) �

Low-pass-to-band-pass transformation

The required function must effect the following correspondence:

H ww w

2 2

2

2

1

1 1 41421 8 1 8

1 81 8 1

( )

.. .

.. .

=

+ +

=+ 44142 1 8 2× +. w w

sww

c=

= = ±0 0 transforms to the center frequew w , nncy

transforms to and> >

<

0

0

0 w < w

0w w ,

ttransforms to w w w0 0> >

Page 511: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

496 Signals and systems primer with MATLAB

Figure 10.5.1 shows these relationships in graphical form.The transformation that accomplishes the required correspondence

between the low-pass and the band-pass case is given by

(10.37)

where and =bandwidth. From the factor wcw–c, it isevident that only a geometric symmetry exists. Hence, to obtain theband-pass H(s) from the low-pass H(s), substitute for the vari-able s.

Example 10.5.3: Design a band-pass filter that meets the followingspecifications:

1. The 3-dB attenuation occurs at 8000 and 12,000 rad/s.2. The attenuation must be at least 20 dB for frequencies lower than

4000 rad/s and higher than 20,000 rad/s.

Solution: The requisite transformation is given by (wc = 12 × 103 rad/sw–c = 8 × 103 rad/s)

Figure 10.5.1 Transformation from a low-pass to a band-pass filter.

H( j )

d1d2 cc

wd1 wd1 wwd2wd2wc w c w c wcw0 w0

H( jw)

ss w

s w ws w w

s Wn

n c c

n c c

n

= + = +202 2

( )

w w wc c02 = W w wc c=

( )s w s Wn n2

02+ /

sssn

n

= + ×× ×

2 7

3

9 6 104 10.

Page 512: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 10: Analog filter design 497

or

or

(10.38)

Now, substitute rad/s in this equation, from which

Substitute in the equation to find

Since 3.8 is smaller than 5, we must design a normalized filter with c =1 and d1 = 3.8. However, from Figure 10.5.2a, we find that the Butterworthfilter at meets line n = 2 just below 20 dB, which satisfies the speci-fications, with its normalized function (see Table 10.2.2)

(10.39)

Combine (10.38) and (10.39) to find the desired band-pass filter transferfunction:

(10.40)

Introduce into this equation to obtain a function of w rad/s. Aplot of 20 log10|H(jw)|vs. w rad/s is shown in Figure 10.5.2b. Observe thatthe –3 dB points are at and rad/s, as originally specified. Inaddition, the attenuation at and rad/s exceeds –20 dB, asrequired. �

jw

jw= + × × ×

× ×

2 3 3

3

8 10 12 104 10

= ×× ×

ww

2 7

3

9 6 104 10.

wd234 10= ×

d2

7 7

3 3

1 6 10 9 6 104 10 4 10

5= × ×× × ×

=. .

wd142 10= ×

d1

8 7

4 3

1 6 10 9 6 102 10 4 10

3 8= × ×× × ×

=. ..

= 3 8.

H ss s

2 2

11 4142 1

( ).

=+ +

H sss

sn

n

n

22 7

3

22

1

9 6 104 10

1 4142

( ).

.

=+ ×

× ×+ ++ ×

× ×+9 6 10

4 101

7

3

.sn

s jwn =

8 103× 12 103×4 103× 20 103×

Page 513: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

498 Signals and systems primer with MATLAB

We can also use the MATLAB function as follows:

[nt,dt]=lp2bp(num,den,w0,bw);%w0=center frequency of the %band-pass filter;

%bw=bandwidth of the band-pass %filter;

Therefore, for our example above, we write the following.

Book MATLAB program

[nt,dt]=lp2bp([0 0 1],[1 1.4142 1],10^4,4*10^3);

x=100:10:1000;y=1050:50:10000;z=10500:500:100000; w=[x y z];

H=freqs(nt,dt,w);

semilogx(w,-abs(20*log10(H)));

Low-pass-to-band-stop transformation

This transformation is roughly the inverse of that for the low-pass toband-pass filter. It is (see Figure 10.5.1)

Figure 10.5.2 Illustrating Example 10.5.3.

Mag

nit

ud

e o

f H

n(j

ω/ω

c)

0

−20

−40

−60

−80

−100100 101 102

ω/ωc

n = 3

n = 2

n = 1

(a)

Mag

nit

ud

e o

f H

(jw

)

0

−20

−40

−60

−80

−100102 103 104 105

w

(b)

Page 514: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 10: Analog filter design 499

(10.41)

Example 10.5 4: Design a band-stop filter to meet the following specifi-cations:

1. The attenuation between 1500 and 2200 rad/s must be at least 30 dB.2. The attenuation for less than 500 rad/s and larger than 2800 rad/s

must be less than –3 dB.

Solution: For the data given, (10.41) yields

(10.42)

The values of f(w) for f(2800) and f(500) are

Since we require that the attenuation be less than –3 dB for –0.4317 d1

and 0.4317 d1, the pass-band cutoff frequency of the original low-passfilter is chosen to be c = 0.4317 d1. Begin with the normalized c = 1, then

d1 = 1/0.4317 = 2.32 rad/s. Thus, the low-pass filter that we must first designhas a 3-dB pass-band cutoff frequency at 1 rad/s and an attenuation of atleast 30 dB at frequencies larger than 2.32 rad/s. From Figure 10.5.2a, wesee that we require a third-order Butterworth filter. The transform functionis Hence, we find

(10.43)

This transfer function can be found by setting and then plotting the20 log10|H(jw)| vs. w.

We can plot the filter response by writing the following.

ss w w

s w wjw w w

wn d d d

n d d

d d d=+

=( ) ( )1 2 12

1 2

1 2 122

1 2+ w wd d

f s ss

sfn

n d

n

( )( )

( )= =+ ×

2200 15002200 1500

12 or == =

+ ×w

sd

n

7003 3 10

12 6.

f d( )( ) .

.28002800 700

2800 3 3 100 43171

2 6= ×

+ ×= d

df

1

12 6

500500 700

500 3 3 100 1147( )

( ) ..= ×

+ ×= d1

H s s s s( ) [( )( )].= + + +1 1 12/

H sss

sn

n

n

n

( ).

.

+ ×+ ×

1

700 2 323 3 10

1700 2

2 6

...

..

323 3 10

700 2 323 3 102 6

2

2sssn

n

n+ ×+ ×

+ × 66 1+

s jwn =

Page 515: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

500 Signals and systems primer with MATLAB

Book MATLAB program

w=200:10:4000;

x=((j*w*700*2.32)./(-w.^2+3.3*10^6)+1);

y=x.^2+x+1;

H=1./(x.*y);

plot(w,20*log10(abs(H))) �

We can also use the following MATLAB function:

[nt,dt]=lp2bs(num,den,w0,bw);%w0=center frequency of the %band-stop filter;

%bw=bandwidth of the band-stop %filter;

For Example 10.5.4 we write the following:

Book MATLAB program

[nt,dt]=lp2bs([0 0 0 1],[1 2 2 1],(1500+2200)/2,(2800-500));

w=200:10:4000;

H=freqs(nt,dt,w);

plot(w,20*log10(abs((H)));

10.6 Analog filter design using MATLAB functionsButterworth filter design

The m-file function [z,p,k]=buttap(n) provides the zeros and the polesin the vectors z and p, and the gain factor k for an nth-order filter with a3-dB cutoff frequency.

To find the numerator and denominator coefficients, we use the m-filefunction [num,den]=zp2tf(z,p,k). Having this information, we find thetransfer function using the m-file function [H,w]=freqs(num,den), wherew is the frequency range vector, a set of 200 frequencies. If we provide thevector w, we use the following form of the m-file: [H]=freqs(num,den,w).

The order of low-pass filter and the 3-dB cutoff frequency is producedby the m-file function [n,wn]=buttord(wp,ws,rp,rs,'s'), where n =order, wn = 3-dB cutoff frequency, wp = pass-band edge frequency, ws =stop-band edge frequency, rp = maximum pass-band attenuation in dB, andrs = minimum stop-band attenuation in dB. The edge frequencies are asfollows for different types of filters:

Low-pass: wp = 0.1, ws = 0.2High-pass: wp = 0.2, ws = 0.1Band-pass: wp = [0.2 0.7], ws = [0.1 0.8]Band-stop: wp = [0.1 0.8], ws = [0.2 0.7]

Page 516: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 10: Analog filter design 501

Different types of filters can be found using the following m-file function:

[num,den]=butter(n,wn,'filter type','s');%filter type=high

%for high pass); filter type=

%stop (for band stop); filter type=pass (for pass band);

The m-files for the Chebyshev filter are:

[z,p,k]=cheb1ap(n,rp)

[num,den]=cheby1(n,rp,wn,'s')

[num,den]=cheby1(n,rp,wn,'filter type','s')

[n,wn]=cheb1ord(wp,ws,rp,'s')

Important definitions and concepts1. Butterworth filter2. Maximally flat filter3. Hurwitz polynomials4. Normalized filters5. Chebyshev filter6. Chebyshev polynomials7. Ripple constant of a Chebyshev filter8. Phase characteristics of filters9. Frequency transformations

10. MATLAB functions for frequency transformations of analog filters

Chapter 10 ProblemsSection 10.2

1. A Butterworth filter must have an attenuation of at least 20 dB at6 kHz, twice the cutoff frequency. Deduce the transfer function of theappropriate low-pass filter.

2. Show that the square of (10.1), with = 1, is equal to (10.2).3. First deduce D(s) for the third-order Butterworth filter and then

demonstrate that .4. Deduce a low-pass Butterworth filter that has an attenuation of at

least 20 dB at three times the frequency rad/s.5. Deduce the transfer function of a Butterworth filter that has an at-

tenuation of at least 10 dB at twice the cutoff frequency c = 105 rad/s.Find the values of L and C for the filter shown in Figure 10.2.3.

6. Determine the impulse response functions of the first-order andthird-order Butterworth filters.

7. A low-pass normalized filter ( c = 1) filter must satisfy the following:a. |Hn(j0.5)|2 < 0.9 in the pass-band.b. |Hn(j1.5)|2 < 0.05 in the stop-band.Find its order.

c

D s D s( ) ( ) = +1 6

c = ×2 104

Page 517: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

502 Signals and systems primer with MATLAB

8. Show that the high-frequency roll-off of an nth-order Butterworthfilter is 2n dB/decade. Also, show that the first five (2n – 1) deriva-tives of a third-order Butterworth filter are zero at = 0.

Section 10.3

1. Use (10.16) to find Cn( ) for n = 0, 1, 2, 3 and for both | | 1 and > 1.2. The ripple of a Chebyshev filter in decibels is given by (a) rdB = 0.05,

(b) rdB = 0.1, and (c) rdB = 1.5. Find the corresponding ’s.3. Write the Chebyshev functions|H2(j )|and|H3(j )| if c = 4 rad/s

and = 1.4. For n = 3 and = 0.8, determine the poles of a low-pass Chebyshev

filter. Plot the poles on the complex plane. Find the major and minoraxes of the ellipse that they define.

5. Plot the Chebyshev functions of several orders. The following BookMATLAB Function will plot the first four polynomials:

function[w,w1,w2,tn1,tn2,Tn]=sschebfunct(wmax,dw)

%introduce small values of wmax e.g 1.5;

w=0:dw:wmax;%wmax=maximum frequency in rad/s;

n=[1 2 3 4];%this function will produce the first

%four polynomials;

w1=0:dw:1;

w2=1+dw:dw:wmax;

tn1=cos(n'*acos(w1));

tn2=cosh(n'*acosh(w2));

Tn=[tn1 tn2];%an nx(wmax/dw) matrix;

plot(w,Tn(1,:),w,Tn(2,:),'g',w,Tn(3,:),'r',w,Tn(4,:),'k');

%will plot the third order polynimial since

%Tn(3,:)=vector of the third row and all the

%columns of Tn;

6. Design a low-pass Chebyshev filter with a 1.2-dB ripple in theband-pass and an attenuation of at least 30 dB at three times thecutoff frequency of 8 rad/s.

7. Determine the transfer function of a second-order Chebyshevlow-pass filter with a cutoff frequency of 100/2 Hz, a 0.5-dB ripplein the pass-band, and a unit magnitude at = 0.

8. Design a Chebyshev low-pass filter to meet the following specifications:

a. Bandwidth, 103 rad/sb. Ripple, 0.1 dBc. Attenuation at least 30 dB for rad/s

Find the transfer function of this filter.

×6 103

Page 518: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 10: Analog filter design 503

Section 10.5

1. The design of Problem 10.3.6 is to provide the basis for a high-passfilter with cutoff at 3 rad/s. Specify the transfer function.

2. Design a pass-band filter to meet the following specifications:

a. The 3-dB attenuations are at and rad/s.b. The attenuation should be at least 30 dB for frequencies lower

than rad/s and higher than rad/s.

3. Design a band-stop filter with an attenuation of at least 30 dB between104 and Hz. The attenuation for less than Hz andmore than Hz must be less than –3 dB.

1500 2× 2500 2×

700 2× 5000 2×

1 3 104. × 4 103×16 103×

Page 519: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

505

chapter 11

Finite Impulse Response (FIR) filters

FIR filters (nonrecursive) are filters whose present output is terminated fromthe present and past inputs, but is independent of its previous outputs.Because no feedback is present, FIR filters are stable. Furthermore, suchfilters are associated with zero phase or linear phase characteristics, and sono phase distortion occurs in the output.

Linear phase FIR digital filters have many advantages, such as guaran-teed stability, freedom from phase distortion, and low coefficient sensitivity.Such filters are used where frequency dispersion is harmful. The design ofsuch filters is well established. However, the design problem has the short-coming of complexity, particularly in sharp filters. Several methods havebeen proposed in the literature for reducing the complexity of sharp filters.In this text we shall present the two fundamental approaches, the use ofdiscrete Fourier series and discrete Fourier transform.

11.1 Properties of FIR filtersCausality

An ideal filter has an infinite number of terms of its impulse response. Toalleviate this problem, we select 2N terms symmetrically with respect to h(0)and shift the resulting sequence N steps to the right, producing a sequence{h(n)} for 0 n 2N. The result of the truncation produces the Gibbs’phenomenon.

Frequency normalization

Since the desired frequencies are given in Hz, we must transform them tothe normalized digital ones. Therefore, we write

Page 520: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

506 Signals and systems primer with MATLAB

(11.1)

The lowercase ’s indicate digital frequencies (rad/unit time) and the capital’s indicate analog frequencies (rad/s). T is the sampling time, Fs is the

sampling frequency in Hz, p is the pass-band frequency, and a is thestop-band frequency (attenuation frequency). For example, if the pass-bandis 5 kHz and the sampling frequency is 15 kHz, then we find that

Phase consideration

The transfer function H(z) of a causal FIR filter of length N is given by

(11.2)

The corresponding frequency response is given by the discrete-time Fouriertransform

(11.3)

To ensure the filter with linear phase, we must impose the conditions

(11.4)

The first filter is called symmetric and the second antisymmetric.The phase and group delays of a filter are defined respectively by

(11.5)

If we substitute, for example, N = 3 in (11.3) we obtain the relations

p p pp

s

p

ss

a a a

T F TF

FT

T F T

= = = = =

= =

22 1

2

a)

== = =a

s

a

ssF

FT

2 1b)

p = × × × =2 5 10 1 15 10 2 33 3[ ( )]/ /

H z h n z n

n

N

( ) ( )==0

1

H e h n e H z H e ej j n

n

N

z e

j jj( ) ( ) ( ) ( )= = =

==

0

1(( )

h n h N n

h n h N n

( ) ( )

( ) ( )

=

=

1

1

a)

b)

p gpd

d= =( ) ( )

Page 521: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 11: Finite Impulse Response (FIR) filters 507

The above equality holds if

(11.6)

Therefore, by expanding the summation, we find

The above equation is satisfied if p = (3 – 1)/2 and h(0) = h(3 – 1 – 0), andhence, for N = odd, the general solution for the symmetric case is

(11.7)

We therefore observe that FIR filters can have constant phase and groupdelays over the entire baseband. For this to happen, the impulse responsemust be symmetrical about the midpoint, that is, between (N – 2)/2 andN/2 for even N and about samples (N – 1)/2 for odd N.

For the antisymmetrical case we have the relations

(11.8)

(11.9)

Scaling the digital transfer function

To scale the magnitude of the filter, we multiply the transfer function by ascaling constant K such that the scaled transfer function has a maximumgain of zero dB. In the case of a low-pass filter, we usually set K = 1/H(1),a direct current (dc) gain of 0 dB, and for a high-pass filter, we set K =1/H(–1), yielding a gain of 0 dB at = . For the band-pass transfer function

( ) tan

( )sin

( )cos

= = =

=

pn

n

h n n

h n n

1 0

3 1

00

3 10

3 1

0

=

=

=or tan

( )sin

( )cosp

n

n

h n n

h n n33 1 =

sincos

p

p

h n n h n np

n

p

n

( )sin cos ( )cos sin= =0

3 1

0

3 11

0

3 1

0

=

==

( )sin( )h n np

n

h h hp p p( ) sin ( )sin( ) ( ) sin( )0 1 2 2 0+ + =

pN

h n h N n n N= = =12

1 0 1 2 1( ) ( ) , , , ,�

( ) ( )= = ± =0 1 2p p p N /

h n h N n n N( ) ( ) , , , ,= =1 0 1 2 1�

Page 522: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

508 Signals and systems primer with MATLAB

we set K = 1/|H(ej c)|, where c is the center frequency. For the band-stoptransfer function K is reciprocal to the maximum of the two values H(–1)and H(1).

Symmetric FIR low-pass filters

A FIR filter of length N is characterized by the difference equation

(11.10)

If we set and recalling the convolution property of the z-transform,we obtain

(11.11)

If we set N = 5 in (11.11) and consider a symmetric sequence (see (11.7)),we find

(11.12)

By using (11.7) (h(n) = h(N – 1 – n)) and then letting 5 – 1 – n = m, the lastsummation of (11.12) becomes

(11.13)

where h(5 – 1 – m) = h(m) and m was renamed n. Combining next (11.13)and (11.12) we obtain the expression

y n b x n b x n b x n N

b x

N

m

( ) ( ) ( ) ( )= + + + + =0 1 11 1�

(( ) ( )n m b x nm

N

n==0

1

h n bn( ) =

H zY zX z

h n z n

n

N

( )( )( )

( )= ==0

1

H e h h e h e h e hj j j j( ) ( ) ( ) ( ) ( ) (= + + + +0 1 2 32 3 44

5 12

4

0

5 3 2

)

( )( )/

e

h n e h e

j

j n

n=

= + jj j n

n

h n e( )/

( )/

( )5 1 2

5 1 2

5 1

= +

+

h n e h m ej n

n

j m

m

( ) ( )( )/

( )

= +

=5 1 2

5 15 15 1

== =

=0

5 3 25 1

0

5 3 2( )/( )

( )/

( )h n e j n

n

H e e h h nj j( ) ( )cos( )/= +5 1 2 5 12

5 12

nnn=0

5 3 2( )/

Page 523: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 11: Finite Impulse Response (FIR) filters 509

If we then set

,

where N is an odd integer in place of 5 and rename k = n, we end up withthe general equation

(11.14)

In a similar approach the antisymmetric case can be developed.

Book MATLAB function m-file: ssfir1(h)

function[H,w]=ssfir1(h)

%this function finds the frequency response of

%a FIR filter with an odd N(=length of filter)

%and symmetric form starting from n=1 to N+1, the

%middle point is (N+1)/2;w is the frequency range

%from 0 to pi; H is real and it is the FIR response;

N=length(h);

n=2:(N+1)/2;

w=0:pi/512:pi-(pi/512);

H1=cos(w'*(n-1));

H2=H1*(2*h(((N+1)/2)-n+1))';

H=h((N+1)/2)+H2;

Figure 11.1.1 shows the response of a FIR low-pass filter with N = 61 indB scale form.

11.2 FIR filters using the Fourier series approachSince H(ej ) is periodic with period 2 , [H(ej( +2 )) = H(ej ) ], it can be expandedin discrete-time Fourier transform (DTFT) in the form

(11.15)

Nn k=1

2

H e e a n n

a

j j N

n

N

( ) ( ) cos

( )

( )/( )/

=

=

=

1 2

0

1 2

0 hhN

a n hN

n=12

21

2( )

H e h n ej j n

n

( ) ( )==

Page 524: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

510 Signals and systems primer with MATLAB

The inverse DTFT is (see also Chapter 7)

(11.16)

If we set in (11.15), we obtain

(11.17)

The above transfer function is noncausal and infinite order. Therefore, wemust truncate it and shift it to the right such that h(n) has values for positiven’s only. Next we set

(11.18)

Figure 11.1.1 FIR low-pass filter with N = 61 and symmetric.

0.25

0.2

0.15

0.1

0.05

–0.05

–0.1 –30 –20 –10 0 10 20 30

0

h(n

)

h(n) � sin(nπ/4)/(nπ)

n

20

0

–20

–40

–60

–80

–100 0 0.5 1 1.5 2.5 3 3.52

20

log

10

(|H

|)

ω rad/unit

N � 61

h n H e e dj jn( ) ( )= 12

z ej=

H z h n z n

n

( ) ( )==

h n nN

N( ) = > =01

2odd integer

Page 525: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 11: Finite Impulse Response (FIR) filters 511

to obtain

(11.19)

The shifted equivalent of (11.19) is the causal filter

(11.20)

which is the desired transfer function.

Example 11.2.1: Design a low-pass FIR filter with rad/s and sam-pling frequency rad/s. Use N = 21 and N = 91.

Solution: From the given sampling frequency we obtain

The normalized pass-band edge discrete frequency is

The desired low-pass filter has a magnitude of 1 in the range of 0 /3and zero otherwise. Hence, from (11.16) we obtain the impulse response

For a causal transfer function with odd N and symmetrical h(n), itsfrequency response is

where hd(n) was found first in the range –(N – 1)/2 n (N – 1)/2 and thenshifted to the right by (N – 1)/2 to recreate h(n). The amplitude responsesfor N = 21 and N = 91 are shown in Figure 11.2.1.

H z h h n z h n zn n

n

N

( ) ( ) [ ( ) ( ) ]( )/

= + +=

01

1 2

H z z H zcsN( ) ( )( )/= 1 2

p = 2s = 12

s s sF F= = = =2 12 12 2 6, / /

p p p sT F= = = =/ / / /2 6 3( )

h n e d

n

ndjn( )

sin

/

/

= =12

3

3

3

H e e hN

hN

ncsj j N

d d( ) ( )/= +1 2 12

21

2=

cos( )/

nn

N

1

1 2

Page 526: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

512 Signals and systems primer with MATLAB

Book MATLAB function m-file: ex_11_2_1

function[ampH,w]=ex_11_2_1(hd)

%this function solves the Ex 11.2.1 for low-pass FIR filter;

N=length(hd);

M=(N-1)/2;

a=[hd(M+1) 2*hd(M:-1:1)];%middle point of hd is at M+1;

n=[0:M];

w=[0:511]'*pi/511;

ampH=cos(w*n)*a';

%w*n is a (512x1)x(1x(M+1))=512x(M+1) matrix and the value

%of each element e.g. (k,m) is equal to cos(w(k)*n(m));

%ampH is a 512x1 vector where each element is the sum

%over n for each row at each w (omega);

To execute the above m-function we write:

N=10; %this plots the left-hand side of the figure;

n=[-N:N];

hd=sin((n*pi/3)+eps)./(n*pi+eps);

hd(N+1)=1/3;%observe the correction, MATLAB gives zero;

[ampH,w]=ex_11_2_1;

subplot(1,2,1);plot(w,20*log10(ampH),'k'); �

Figure 11.2.1 FIR filter using Fourier series approach.

10

0

–10

–20

–30

–40

–50

–60

–70

10

–10

0

–20

–30

–40

–50

–60

–70

–80

–900 1 2 3 40 1 2 3 4

Mag

nit

ud

e o

f H

, dB

Mag

nit

ud

e o

f H

, dB

ω rad/unitω rad/unit

Page 527: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 11: Finite Impulse Response (FIR) filters 513

11.3 FIR filters using windowsWindows

To reduce Gibbs’ phenomenon (oscillations), we must multiply the impulseresponse, h(n), with special finite length function w(n), known as windowfunction. Therefore, the widowed impulse response is

(11.21)

The two basic characteristics of a window are the width of the main lobeand the ripple ratio. The ripple ratio is defined by the relation

(11.22)

For example, the rectangular window has a ripple ratio of 21.70 and a relativeside-lobe level of –13.27 dB, and the Blackman window has a ripple factorof 0.12 and a relative side-lobe level of –58.42. Table 11.3.1 gives the mostuseful windows.

Table 11.3.1 Window Functions for FIR Filter Design

Name of Window w(n), –N n N

1. Bartlett (triangular)

2. Blackman

3. Hamming

4. Hann

5. Kaiser

Note: In practice, 20 to 25 terms of I0(x) are sufficient for accurate results.

h n w n h nw ( ) ( ) ( )=

r = 100(maximum side-lobe amplitude)main-lob

ee amplitude

%

1| |n

N

0 42 0 52

2 10 08

4

2 1. . cos . cos+

++

+n

N

n

N

0 54 0 462

2 1. . cos+

+n

N

1

21

2

2 1+

+cos

n

N

In

NI0

2

01 / ( )

= adjustable parameterzero-order modiI0 (x) = ffied Bessel function

I xk

xk

k

0

2

1

11

2( )

!= +

=

Page 528: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

514 Signals and systems primer with MATLAB

Example 11.3.1: Design a low-pass FIR filter using the Fourier seriesapproach and the windowing approach. The constants are pass-band fre-quency 20 rad/s and sampling frequency 60 rad/s.

Solution: From (11.1) we find the normalized pass-band frequency to beFrom (11.16) we obtain

The following Book MATLAB program gives the requested results:

Book MATLAB m-file: ex_11_3_1

%m-file for the Ex 11.3.1: ex_11_3_1

n=-50:50;hn=sin(2*pi*n/3)./(n*pi+eps);hn(51)=2/3;

[ah,w]=ex_11_2_1(hn);

hw=hn.*hamming(101)';%hamming(M) is a MATLAB function

%that gives a column vector of length M;

[ahw,w]=ex_11_2_1(hw);

plot(w,20*log10(ah),'k');hold on;

plot(w,20*log10(ahw),'k');

xlabel('\omega rad/unit');ylabel('Magnitude, dB');

Figure 11.3.1 shows a Fourier series FIR low-pass filter and a windowedone using the Hamming window and the same impulse response function.

Figure 11.3.1 Fourier series and windowed FIR filter.

p p s= = =2 2 20 60 2 3/ / / .

h n e dn

njn( )

sin

/

/

= × =12

1

23

2 3

2 3

20

0

–20

–40

–60

–80

–100

–120

Mag

nit

ud

e, d

B

Fourier series FIR

Hamming windowed FIR

0 0.5 1 1.5 2 2.5 3 3.5

rad/unit

Page 529: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 11: Finite Impulse Response (FIR) filters 515

Note: The sampling time is T = 2 /60 = /30, and hence the frequency rangeis from 0 to /( /30) = 30 rad/s. �

If the pass-band frequency and attenuation-band frequency are given,then we generally use the cutoff frequency

(11.23)

High-pass FIR filters

The only new information needed is (see Figure 11.3.2b)

(11.24)

Hence, the impulse response is found as follows (see (11.16))

(11.25)

The procedure is identical to that given above for low-pass filters (see Figure11.3.2a).

Figure 11.3.2 Ideal frequency response for low-pass and high-pass filters.

cp a=

+2

H ej

c

c cp a

( ),

=

<

=+

0

12

h n e d e dj n j n

c

c

c

( ) = × + ×

=

12

11

21

1 n

nn

nc

=

>

0

0sin( )

(a) (b)

Linear dB

1 + δp

1 − δp

δa

ωp ωc ωa π

−Aa

−Ap

Ap

Linear dB

1 + δp

1 − δp

δa

ωpωcωa π

−Aa

−Ap

Ap1

Page 530: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

516 Signals and systems primer with MATLAB

Band-pass FIR filters

For this case, the impulse response is (see Figure 11.3.3a)

(11.26)

Band-stop FIR filters

The impulse response for this case is (see Figure 11.3.3b)

(11.27)

Example 11.3.2: Design a pass-band FIR filter and a windowed one withthe Hamming window. The following are given: a1 = 0.2 , p1 = 0.4 , a2 =0.8 , p1 = 0.6 .

Solution: Figure 11.3.4 shows the requested results. The following BookMATLAB m-file produces the results.

Book MATLAB m-file: ex_11_3_2

%Book MATLAB m-file:ex_11_3_2;

n=-30:30;wc1=0.3*pi;wc2=0.7*pi;

hn=(sin(wc2*n)-sin(wc1*n))./(n*pi+eps);

Figure 11.3.3 Band-pass and band-stop FIR filter specifications.

(a) (b)

Linear dB

1 + δp

1 − δp

δa

ωa1 ωa2

ωc2ωc1

ωp1 ωp2

−Aa

−Ap

Ap1

ωa1 ωa2

ωc2ωc1

ωp1 ωp2

Linear dB

1 + δp

1 − δp

δa −Aa

−Ap

Ap

1

h nn n

nnc c

c a p

( )sin( ) sin( )

( )

=

= +

2 1

1 1 1

0

/22 22 2 2c a p= +( )/

h nn

n nn

n

c c

c c

( )sin( ) sin( )

==

>

1 0

0

2 1

1 2

= + = +c a p c a p1 1 1 2 2 22 2( ) ( )//

Page 531: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 11: Finite Impulse Response (FIR) filters 517

hn(31)=0.4;

[ah,w]=ex_11_2_1(hn);

hnw=hn.*hamming(61)';%MATLAB gives the window in column form;

[ahw,w]=ex_11_2_1(hnw);

plot(w,20*log10(ah),'k');hold on;plot(w,20*log10(ahw),'k');

xlabel('\omega rad/unit');ylabel('Magnitude, dB'); �

Example 11.3.3: Find a low-pass FIR such that it eliminates the upperfrequency of the signal

which is contaminated with noise (a signal that is nonpredictable from onetime to the next). To produce such a signal, we will use the MATLAB functionrandn(1,M). More will be said about random signals in Chapter 13.

Solution: The Book MATLAB m-file given below produces the desiredresults. From Figure 11.3.5 we observe the following: The first figure showsthe signal equal to the sum of two sine waves and the second the same signalbut added noise. The third figure shows the DFT of the noisy signal. Weobserve that the spectrum is made up of two approximately delta functions,which indicates that two sinusoidal signals are present. However, we alsosee frequencies present in the whole spectral range. These frequencies camefrom the added noise. The fourth figure shows a 101-term impulse responseof a low-pass FIR filter. The fifth figure shows the output of the filter that

Figure 11.3.4 Band-pass FIR and windowed FIR filter.

20

0

–20

–40

–60

–80

–100

–120

Mag

nit

ud

e, d

B

Windowed FIR filter

FIR filter

0 0.5 1 1.5 2 2.5 3 3.5

ω rad/unit

s t t t( ) sin sin= +20 40

Page 532: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

518 Signals and systems primer with MATLAB

was produced by taking the convolution between the input and the impulseresponse of the filter. Observe that the signal is not pure sinusoid. This ismore evident from the sixth figure, where the delta function is not alone butis accompanied with noise. This is true because the low-pass filter passes allthe frequencies from 0 to 0.15 , including the noise. However, we are ableto eliminate the second sine signal completely.

Book MATLAB m-file: ex_11_3_3

%Book m-file for Ex 11.3.3; ex_11_3_3

ws=400;%ws=sampling frequency rad/s;

m=0:300;

T=2*pi/ws;%T=time sampling;

s1=sin(20*m*T)+sin(40*m*T);

s=sin(20*m*T)+sin(40*m*T)+randn(1,301);%signal plus noise;

w=0:2*pi/512:2*pi-(2*pi/512);

fs=fft(s,512)/301;

n=-50:50;%102 impulse response of the filter;

hn=sin(0.15*pi*n)./(n*pi+eps);%hn=impulse response;

hn(51)=0.15;%corrects the MATLAB value that gives 0;

Figure 11.3.5 Low-pass filtering.

2

1

0

–1

–2

Tw

o s

ine

sig

nal

s

0 100 200 300

5

0

0 100 200 300 –5 T

wo

sin

es w

ith

no

ise

0.8

0.6

0.4

0.2

0 0 2 4 6 8

FT

of

sig

nal

an

d n

ois

e

0.15

0.1

0.05

0

–0.05 –50 0 50

Imp

uls

e re

spo

nse

h

2

0

–2

–4 0 200 100 300 400 500

Fil

ter

ou

tpu

t

0.4

0.3

0.2

0.1

0 0 2 4 8 6

FT

of

ou

tpu

t

rad/unit

rad/unit

n n

n

n

Page 533: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 11: Finite Impulse Response (FIR) filters 519

y=conv(s,hn);%y=the output of the system (filter);

%conv(.,.) is a MATLAB function giving the convolution

%of two sequences;

fy=fft(y,512)/402;

subplot(3,2,1);plot(m,s1,'k');ylabel('Two sine signals');

subplot(3,2,2);plot(m,s,'k');ylabel('Two sines with noise');

subplot(3,2,3);plot(w,abs(fs),'k');ylabel('FT of signal and... noise');

subplot(3,2,4);stem(n,hn,'k');ylabel('Impulse response h');

subplot(3,2,5);plot(y,'k');ylabel('Filter output');

subplot(3,2,6);plot(w,abs(fy),'k');ylabel('FT of output'); �

*11.4 Prescribed filter specifications using a Kaiser window

Consider the low-pass filter specifications shown in Figure 11.3.2a. Thepass-band ripple and minimum stop band attenuation in decibels are givenby

(11.28)

The transition bandwidth is given by

(11.29)

The procedure to find a FIR filter obeying specific restrictions is:

1. Perform transformation from the frequency domain (rad/s) to thedigital frequency domain (rad/unit) using (11.1).

2. Determine h(n) by assuming the ideal low-pass filter

(11.30)

from which we find (see (11.16))

(11.31)

However, for a high-pass, band-pass, or stop-band filter we can use(11.25), (11.26), or (11.27), respectively.

A Ap a= + =2011

20log loga) b)

Bt a p=

H ejc

c

ca p( ) =

<=

+1

0 2

h n e d

c

c

j n( ) = 12

1

Page 534: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

520 Signals and systems primer with MATLAB

3. Choose in (11.28), whichever of the two equalities gives the smallerone. That is,

(11.32)

4. Calculate using (11.28b).5. Choose parameter as follows:

(11.33)

6. Choose parameter D as follows:

(11.34)

Then select the lowest odd value of N satisfying the inequality

7. Use the desired window.8. From

(11.35)

Note: The parameter is used in the Kaiser window formula (see Table 11.3.1).

Example 11.4.1: Design a FIR filter satisfying the following specifications:

= = =min( , ), ,..

.1 2 10 05

2

0 05

010

10 1

10A

Aa

p

005 1Ap +

Aa

= + <

0 21

0 5842 21 0 07886 21 210 4

A

A A A

a

a a. ( ) . ( ).aa

a aA A >

50

0 1102 8 7 50. ( . )

D

A

AA

a

aa

=>

0 9222 21

7 9514 36

21

.

( . ).

ND

Bt

+21

= =H z z H z H z w n h nwN

w w( ) ( ), ( ) [ ( ) ( )]( )/1 2 Z

a p p a1 1 2 220 30 50 60= = = =rad/s rad/s rad/s r, , , aad/s

Minimum attenuation /s: 40 dB

Maximu

0 20 rad

mm pass-band ripple rad/s: 0.2 dB

Max

30 < < 50

iimum attenuation rad/s: 40 dB

Sampli

60 80< <

nng frequency rad/s 160

Page 535: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 11: Finite Impulse Response (FIR) filters 521

Solution: From (11.1) we obtain

and similarly

From step 2 and (11.26) we find

From step 3 we obtain

and hence from step 4,

From step 5 we obtain

From step 6 we find

The following Book MATLAB m-file gives the appropriate results.

Book MATLAB m-file function

function[ahnw,w]=ssbandpass_kaiser_fir(N,wc1,wc2,beta);

%Book MATLAB function

n=-N:N;

hn=(sin(wc2*n)-sin(wc1*n))./(n*pi+eps);

a aaT1 11 2160

20 2160

0 25= = × = × = .

p p a c c1 2 2 1 23 8 5 8 3 4 5 16 11= = = = =/ , , , ,/ / / /16

h nn n

nnc c( )

sin( ) sin( ) sin( ) sin= =2 1 11 16/ (( )5 16nn

/

10 05 40

2

0 05 0 2

0 05 010 0 01

10 110

= = =××

×.

. .

. .. ,

22 1+= 0.0115

A Ap a= + = =201 0 011 0 01

0 1737 20 010 10log..

. , log ( .. )01 40=

= + =0 5842 40 21 0 07886 40 21 3 39530 4. ( ) . ( ) ..

D N= = >40 7 9514 36

2 23192 2 2319

11 16 5.

.. ,

.( ) (/ /16

11 9035 13)

. ,= =N

Page 536: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

522 Signals and systems primer with MATLAB

hn(N+1)=(wc2-wc1)/pi;

hnw=hn.*kaiser(2*N+1,beta)';

[ahnw,w]=ex_11_2_1(hnw);

To plot the response we write at the command window: plot(w,20*log10(ahnw)). The above function can be easily modified to intro-duce a different window. �

11.5 MATLAB FIR filter designThe MATLAB function fir1 can be used to design low-pass, high-pass,band-pass, and band-stop linear phase FIR filters.

Low-pass FIR filter

b=fir1(N,wc); %N=order of the filter(odd); wc=normalized cutoff %frequency (0<wc<1);

%b=vector of the impulse response coefficients %arranged in ascending

%powers of z-1; the sampling frequency is assumed %2 Hz.

[h,w]=freqz(b,a,n); %a=1, n=frequency response is calculated %at n points equally spaced

%around the upper half of the unit circle %(usually n=512); w=contains n

%points between 0 and ; b is the vector %containing the coefficients%of the denominator polynomial;

plot(w,20*log10(abs(h)));

High-pass FIR filter

b=fir1(N,wc,'high'); %N=order of the filter (even only); %wc=filter stop band;

[h,w]=freqz(b,a,n);%a=1,n=usually 512;

plot(w,20*log10(abs(h)));

Band-pass FIR filter

b=fir1(N,[wc1wc2]);%band-pass=wc2-wc1;

[h,w]=freqz(b,1,512);

plot(w,20*log10(abs(h)));

In the command window use help fir1 to obtain functions to producemultiple band-pass and band-stop designs.

Page 537: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 11: Finite Impulse Response (FIR) filters 523

Band-stop FIR filter

b=fir1(N, [wc1wc2],'stop');%wc1 and wc2 must be put in vector %form;

[h,w]=freqz(b,1,512);

plot(w,20*log10(abs(h)));

Window use

If we want, for example, to create a band-stop filter with a Hamming win-dow, we write:

b=fir1(N,[wc1 wc2],'stop',hamming(N+1));%N must be even;

Other windows are: blackman (N+1), hanning (N+1), chebwin (N+1),and kaiser (N+1,beta).

Important definitions and concepts

1. Causality of filter systems2. Frequency normalization3. Symmetric and antisymmetrical filters4. Scaling of transfer functions5. FIR design using the Fourier series6. FIR design using windows7. Main lobe of filter response8. Ripple ratio9. High-pass, band-pass, and band-stop FIR filters

10. Prescribed filter specifications11. Transition bandwidth12. MATLAB filter design

Chapter 11 ProblemsSection 11.1

1. The band-pass frequency for a low-pass FIR filter is 120 rad/s andthe attenuation frequency is 130 rad/s. Show the frequency axis inrad/s and in rad/unit.

2. For third-order filter prove (11.9).3. Consider the filter as a

low-pass or high-pass filter. Find the attenuation factors K for thesetwo cases.

4. Draw, by taking a small subset (10 to 15) of FIR impulse responses,the following causal cases: odd and antisymmetric, even and sym-metric, even and antisymmetric.

H z b b z b z a z a z( ) [ ]/[ ]= + + + +0 11

22

11

221

Page 538: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

524 Signals and systems primer with MATLAB

Section 11.2

1. Design a low-pass filter with p = 0.4 and N = 5.2. Design a low-pass filter with p = 2 rad/s and sampling frequency

s = 12 rad/s. Use N = 11 and N = 101.3. Plot the frequency responses of the rectangular, Hamming, and Black-

man windows and estimate from your graphs the height of the firstside lobe.

Section 11.3

1. Plot the low-pass FIR filter response if the band-pass frequency is1000 rad/s and the sampling frequency is 2000 rad/s.

2. Repeat Problem 11.3.1, but using the Hamming window.3. Repeat Problem 11.3.1, but using the Blackman window.4. Find the response of a band-pass FIR given the following:

a. Attenuation range from 0 to 30 rad/sb. Band-pass range from 40 to 80 rad/sc. Attenuation range from 90 to200 rad/sd. Sampling frequency of 400 rad/s

5. Repeat Problem 11.3.4 but using Hamming and Blackman windows.6. Find the response of a band-stop FIR filter given the following:

a. Band-pass range from 0 to 100 rad/sb. Band-stop range from 120 to 150 rad/sc. Band-pass range from 170 to 300 rad/sd. Sampling frequency of 600 rad/s

7. Repeat Problem 11.3.6 but using Hamming and Blackman windows.

Section 11.4

1. Design a high-pass FIR filter given the following:

a. Minimum attenuation band from 0 to 30 rad/s: 45 dBb. Maximum band-pass ripple from 40 to 100 rad/s: 0.1 dBc. Sampling frequency: 200 rad/s

2. Design a band-pass FIR filter given the following:

a. Minimum attenuation from 0 to 50 rad/s: 50 dBb. Maximum band-pass ripple from 70 to 120 rad/s: 0.2 dBc. Minimum attenuation from 140 to 400 rad/s: 50 dBd. Sampling frequency: 800 rad/s

3. Repeat Problem 11.4.1 but using a Hamming window.4. Repeat Problem 11.4.2 but using a Kaiser window.

Page 539: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

525

*chapter 12

Infinite Impulse Response (IIR) filters

Infinite impulse response (IIR) filters, also known as recursive filters, takeadvantage of the continuous-time filters made up of networks with discreteelements. Both have impulse responses of infinite length and are describedby rational fractional transfer functions in the frequency domain. We canstart by designing the continuous-time filters and transforming them intodigital format. The transformations, however, do not produce identicalresults since the output of the continuous case is due to the convolution ofinput and filter through integration, whereas the digital case is a convolutionperformed by summation. It can be said that the continuous-time and dis-crete-time systems converge more and more as the sampling time decreases.

12.1 The impulse-invariant method approximation in the time domain

In the impulse-invariant design method, the impulse response of the con-tinuous method is sampled at equal instances of time. Hence, h(t) becomesh(nT). Suppose that the system function of a low-pass filter is

(12.1)

Assume that all poles are distinct; hence, the impulse response function is

(12.2)

If is the corresponding sampled version of h(t), then we write

H sA

s sp

pp

P

( ) =+

=1

h t H s A eps t

p

Pp( ) { ( )}= =

=

L 1

1

Th nT( )

Page 540: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

526 Signals and systems primer with MATLAB

(12.3)

which, using the well-known formula of geometric series, is

(12.4)

A comparison of (12.1) and (12.4) shows that a continuous low-pass filterspecified by the system function H(s) transforms into a digital filter specifiedby H(z) via impulse-invariant techniques by setting

(12.5)

Observe, therefore, that H(z) can be obtained from H(s) without evaluatingh(t) or h(nT). As already noted, some degree of approximation exists in thistransformation because the digital filter is necessarily band limited andperiodic, whereas H(s), a rational function of s, is not band limited. Becausethe frequency response of the digital filter comprises fewer frequency com-ponents than the analog filter, an added or folded difference due to thedifferent number of terms of the series exists. This phenomenon is equivalentto that discussed in connection with the sampling theorem in Chapter 6. Noerror due to sampling occurs if |H(j )| = 0 for | | > s. In this section, weintroduce capital omega for the continuous case to facilitate our discussion.

The design of an IIR digital filter employs the following steps:

1. Begin with a given filter specification.2. Create an analog transfer function H(s) that meets the specifications

of step 1.3. Determine the impulse response of the analog filter by means of the

Laplace inversion technique,4. Sample h(t) at T-second intervals, thereby creating a sequence {h(nT)}.5. Deduce H(z) of the resulting digital filter by taking the z-transform

of the discrete function h(nT),

As an alternative procedure, proceed with steps 1 and 2 and then applytransformation (12.5).

Example 12.1.1: Determine the digital equivalent of the first-order Butter-worth filter. The cutoff frequency c is 20 rad/s.

H z T h nT z T z A en

n

np

s nT

p

P

n

p( ) ( )= = == ==0 10

TT A z epn s nT

np

Pp

== 01

H z TA

e zp

s Tp

P

p( ) =

= 1 11

s s e zps Tp+ = 1 1

h t H s( ) { ( )}.= L 1

H z T h nT z n

n

( ) ( ) .==0

Page 541: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 12: Infinite Impulse Response (IIR) filters 527

Solution: The normalized analog transfer function is found from Table10.2.2 to be

The system transfer function is given by

The impulse response of this filter is given by

The z-transform of the discrete function Th(nT) is

Note that we could have found H(z) simply by setting s + 20 = 1 – e–20T z–1

in H(s/ c), as shown in (12.4) and multiply by T. To proceed for the specifiedsampling frequency s = 80 rad/s, we first deduce the absolute value of theanalog transfer function:

Next, we normalize the frequency using (11.1). Hence, we find

The equivalent expression becomes

H ss

( ) =+1

1

Hs

Hs

s sc

= =+

=+20

120 1

2020( )/

h t Hs

s( ) = =

+L L1 1

2020

20= 20 020e tt

H z T e z T e znT

n

Tn

n

( ) = = ( ) == =

20 2020 1

0

20 1

0

2201 20 1

Te zT

Hj

j20120 1

1

1 20 2=

+=

+( / ) ( / )

c c cs

T= = = =220

280

0 5.

H z H eT

e eT

e ej

T j T T j( ) ( )= = =20

120

120 20

Page 542: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 12: Infinite Impulse Response (IIR) filters 527

Solution: The normalized analog transfer function is found from Table10.2.2 to be

The system transfer function is given by

The impulse response of this filter is given by

The z-transform of the discrete function Th(nT) is

Note that we could have found H(z) simply by setting s + 20 = 1 – e–20T z–1

in H(s/ c), as shown in (12.4) and multiply by T. To proceed for the specifiedsampling frequency s = 80 rad/s, we first deduce the absolute value of theanalog transfer function:

Next, we normalize the frequency using (11.1). Hence, we find

The equivalent expression becomes

H ss

( ) =+1

1

Hs

Hs

s sc

= =+

=+20

120 1

2020( )/

h t Hs

s( ) = =

+L L1 1

2020

20= 20 020e tt

H z T e z T e znT

n

Tn

n

( ) = = ( ) == =

20 2020 1

0

20 1

0

2201 20 1

Te zT

Hj

j20120 1

1

1 20 2=

+=

+( / ) ( / )

c c cs

T= = = =220

280

0 5.

H z H eT

e eT

e ej

T j T T j( ) ( )= = =20

120

120 20

Page 543: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 12: Infinite Impulse Response (IIR) filters 529

Example 12.1.2: Determine the digital equivalent of a Butterworththird-order low-pass filter and find T if the sampling frequency is 15 timesthe normalized cutoff frequency. Repeat the procedure if the sampling fre-quency is 100 times the normalized cutoff frequency.

Solution: The normalized system function of this filter is deduced fromTable 10.2.2:

The constant Ai’s are easily found (see Chapter 8) to be

The impulse response of this system is given by

Further, we note that s = 2 /T = 15 c = 15, from which the sampling timeT = 0.4189. The sampled impulse response function is

The z-transform of this function is

Using the following Book MATLAB program, we obtain the digital filterresponse shown in Figure 12.1.2.

Book MATLAB m-file: ex_12_1_2

%Book MATLAB m-file:ex_12_1_2

w=0:0.01:5;

a2=2/(-3+j*sqrt(3));a3=2/(-3-j*sqrt(3));

H ss s s s s s

s s

( )( )( )

( )

=+ + +

=+ + +

=

+ +

12 2 1

11 1

1

112

3 2 2

+ +

=+

++

+

j s j

As p

As p

As

32

12

32

1

1

2

2

3

++ p3

A Aj

Aj

1 2 312

3 3

2

3 3= =

+=

h t A e A e A et p t p t( ) = + +1 2 32 3

h n A e A en p n( . ) . . .0 4189 0 4189 10 4189

20 4189 2= + + AA e p n

30 4189 3.

H z zz e

Az

z eA

zzp

( ). . .0 4189 0 4189 2 0 4189 3

2= + +

e p0 4189 3.

Page 544: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

530 Signals and systems primer with MATLAB

p2=.5-j*sqrt(3)*.5;p3=.5+j*sqrt(3)*.5;

T=.4189;

H=(exp(j*w*T)./(exp(j*w*T)-exp(-0.4189)))...

+(a2*exp(j*w*T)./(exp(j*w*T)-exp(-.4189*p2)))...

+(a3*exp(j*w*T)./(exp(j*w*T)-exp(-.4189*p3)));

subplot(2,1,1);plot(w,abs(H)*.4189);

Hs=freqs([0 0 0 1],[1 2 2 1],w);

subplot(2,1,2);plot(w,abs(Hs));

In general, a digital filter designed using the impulse-invariant methodresults in a transfer function in the form of the ratio of two polynomials. Thedifference equation written from this system function is a recursive expres-sion, and the filter so realized is an infinite impulse response (IIR) filter.Clearly, the impulse-invariant response method is equivalent to analogfiltering of an impulse-sampled input signal. The fact has already beendiscussed that for a sampled signal to approximate the analog signal, thesampling rate (Nyquist rate) must be at least twice the highest frequencycomponent contained in the signal. However, a practical analog filter H(s)is never strictly band limited. Therefore, an aliasing error occurs when thisdesign method is used. As a practical matter, if the sampling frequency isfive or more times the cutoff frequency of the low-pass analog filter, thealiasing effect on the frequency response is extremely small. �

Example 12.1.3: The normalized transfer function of the third-order Che-byshev filter with a 1-dB ripple is

(12.6)

Figure 12.1.2 Impulse response h(t) and h(nT) for T = 1.

0.4

0.3

0.2

0.1

0

–0.1

h(t

)

0 5 10 15

t

0.4

0.3

0.2

0.1

0

–0.1

h(n

T),

T =

1

0 5 10 15

n

H ss s s

( ).

. . .=

+ + +0 4913

0 9883 1 2384 0 49133 2

Page 545: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 12: Infinite Impulse Response (IIR) filters 531

Determine the following:

1. The corresponding impulse-invariant digital filter2. The amplitude characteristics of the digital filter3. The impulse response h(t) of H(s)4. The sampled response h(nT) of the digital filter for T = 1.

Solution:

1. Begin with the Chebyshev function in factored form (the roots canbe found using the MATLAB function roots([1 0.9883 1.23840.4913]) ):

This expression is written in partial fraction form, which is foundusing the MATLAM function [r,p,k]=residue([0 0 00.4913],[1 0.9883 1.2384 0.4913]). This expression iswritten in partial fraction form:

(12.7)

Now, we set in (12.7), which specifies the impulse-invariant digital filter representation

(12.8)

2. The corresponding frequency response is obtained by substituting, setting T = 0.08, and next, using the following m-file to

produce the two responses.

Book MATLAB m-file: ex_12_1_3

%Book m-file: ex_12_1_3

w=0:0.05:8;T=0.08;

a1=-0.2471-j*0.0632;a2=conj(a1);ex=(-0.2471+j*0.966)*T;

hz=(a1./(1-exp(ex)*exp(-j*w*T)))+(a2./(1-exp(conj(ex))*...exp(-j*w*T)))...

+0.4942./(1-exp(-0.4942*T)*exp(-j*w*T));

H ss j s j

( ).

( . . )( . .=

+ + +0 4913

0 2471 0 9660 0 2471 0 96660 0 4942)( . )s +

H sj j

s j( )

. .. .

.=+

+0 2471 0 06320 2471 0 9660

0 24771 0 06320 2471 0 9660

0 49420 4942

++ +

++

js j s

.. .

..

s p e zip Ti+ = 1 1

H zT

j je zT j T

( ) . .. .

= +

0 2471 0 06321 0 2471 0 9660

+ + +1 0 2471 0 9660 1

0 2471 0 06321

. .. .

je zT j T

00 49421 0 4942 1

..e zT

z e ej j T= =

Page 546: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

532 Signals and systems primer with MATLAB

hs=0.4913./(-j*w.^3-0.9883*w.^2+1.2384*j*w+0.4913);

subplot(2,1,1);plot(w,abs(hs));

subplot(2,1,2);plot(w,abs(hz)/max(abs(hz)));

3. Next, we apply the inverse Laplace transform to (12.7) and find h(t)to be

(12.9)

4. The continuous and discrete forms of the impulse response are shownin Figure 12.1.2. �

12.2 Bilinear transformationWe start with a first-order differential equation and an identity relation:

(12.10)

If we introduce t = nT and t0 = nT – T in (12.10b) as T 0, we obtain theapproximate expression where the integral is approximated by a rectanglewhose height is the average value of the integrandHence, we obtain

(12.11)

From (12.10a) we also find that

(12.12)

Introducing (12.12) in (12.11) and simplifying, we find

(12.13)

h t A e A et j t t j( ) ( ) *. . .= ++1

0 2471 0 96601

0 2471 0.. .

. .

.

[

9660 0 4942

0 24711

0 966

0 4942t t

t j

e

e A e

+

= 001

0 9660 0 4942

0 24

0 4942t j t tA e e

e

+ +

=

+( )*] .. .

. 771 0 490 5102 0 9660 2 8912 0 4942t t e× +. cos( . . ) . . 442t

dy tdt

ay t bx t y t y d y tt

t( )

( ) ( ) ( ) ( ) ( )+ = = +a)

0

0 bb)

[ ( ) ( )] .+y nT y nT T /2

y nTT

y nT y nT T y nT T( ) [ ( ) ( )] ( )= + +2

= +y nT ay nT bx nT( ) ( ) ( )

12

12 2

+ =aTy nT

aTy nT T

bTx n( ) ( ) [ ( TT x nT T) ( )]+

Page 547: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 12: Infinite Impulse Response (IIR) filters 533

The z-transform of the above equation produces the transfer function, whichis

(12.14)

The transfer function of (12.10a) using the Laplace transform is

(12.15)

Comparing the equations (12.15) and (12.14) we conclude that

(12.16)

In terms of the z-plane, this algebraic transformation uniquely maps theleft-hand side of the s-plane, as shown in Figure 12.2.1a, into the interior ofthe unit circle in the z-plane, as shown in Figure 12.2.1b. Because no foldingoccurs, no folding error will arise. However, a shortcoming of the transfor-mation is that the frequency response is nonlinear — that is, warped — inthe digital domain.

The inverse transformation for T = 2 is given by

(12.17)

Figure 12.2.1 The bilinear transformation mapping.

Y zX z

H zbT zaT aT

( )( )

( )( )( )= = +

+

/2 1

12

12

1

=

++z

b

Tzz

a11

1

2 11

H sb

s a( ) =

+

sT

zz

zTsTs

=+

= +2 11

1 21 2

a)//

b)

zss

= +11

z-plane

Re(z)

Im(z)

s-plane

σ

(a) (b)

Page 548: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

534 Signals and systems primer with MATLAB

In the general case, for

(12.18)

Therefore,

(12.19)

Thus, a point on the j -axis in the s-plane ( = 0) is mapped onto a pointon the unit circle in the z-plane. A point on the left half of the s-plane with

< 0 is mapped onto a point inside the unit circle in the z-plane. Any pointon the right half of the s-plane, > 0, is mapped outside the unit circle ofthe z-plane. Any point in the s-plane is mapped onto a unique point in thez-plane and vice versa. Figure 12.2.1 shows this transformation.

If we insert into (12.16a), we obtain a relationship between fre-quency of the analog filter and the digital frequency. We find that

(12.20)

From this equation, by equating real and imaginary parts separately, we obtain

(12.21)

Observe that the relationship between the two frequencies is nonlinear.The effect is known as warping. Figure 12.2.2 shows the mapping between

Figure 12.2.2 Mapping of to via the bilinear transformation.

s j= +

zjj

= + +( )( )11

z2 2 2

2 2

11

= + +( )( )

z ej=

s je

T ee e ej

j

j j j

= + =+

=2 11

2 2 2 2( )( )

(/ / / ))( )

tan/ / /Te e e

jTj j j2 2 2

22+

=

=

=

0

22T

tan

4

2

0

–2

–4 –15 –10 –5 0 5 10 15 20–20

Page 549: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 12: Infinite Impulse Response (IIR) filters 535

the two frequencies through (12.21). Figure 12.2.3 shows graphically thewarping effect. Observe that the shapes of the filters are similar, but at highfrequencies are disproportionately reduced.

Example 12.2.1: Use the bilinear transformation to determine the char-acteristic of a digital filter if the corresponding analog filter has the transferfunction

(12.22)

Solution: By the use of (12.16), we obtain

(12.23)

To illustrate the variations graphically, we choose (a) H0 = 0.8, p = 0.8,and T = 1 and (b) H0 = 0.8, p = 0.8, and T = 0.2. Figure 12.2.4 shows the threefilter responses. The following Book MATLAB m-file produces the desiredresults. Note that when the sampling time is different than 1, the digitaltransfer function is of the form H(ej T). This indicates that in (12.23) we mustset z = ej T (see the Book m-file below).

Figure 12.2.3 The frequency warping effect.

H(e jω)

Ω = a tan(ω/2)Ω

H( jΩ) ω

ω

H sH

s p( ) =

+0

H z H sH

Tzz

pH T

zs z T z

( ) ( )( )/ ( )

= =

++

= += +2 1 1

002 1

1

112 1 1( ) ( )z Tp z+ +

Page 550: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

536 Signals and systems primer with MATLAB

Book MATLAB m-file: ex_12_2_1

%Book m-file:ex_12_2_1

w=0:0.05:6;

T=1;p=0.8;h0=0.8;

hs=h0./(j*w+p);

hz=h0*T*(exp(j*w)+1)./(2*(exp(j*w)-1)+p*T*(exp(j*w)+1));

T=0.2;

w1=0:0.05:30;

hs1=h0./(j*w1+p);

hz1=h0*T*(exp(j*w1*T)+1)./(2*(exp(j*w1*T)-1)+p*T*(exp(j*w1...*T)+1));

subplot(2,1,1);plot(w,abs(hs),'k',w,abs(hz)/max(abs(hz)),'k');

xlabel('Frequency rad/s');ylabel('Magnitude');

subplot(2,1,2);plot(w1,abs(hs1),'k',w1,abs(hz1)/max(abs...(hz1)),'k');

xlabel('Frequency rad/s');ylabel('Magnitude'); �

Figure 12.2.4 Illustration of Example 12.2.1.˙

Analog

Analog

Digital

Digital

T = 1

T = 0.2

/1

/0.2

Frequency rad/s

Frequency rad/s

Mag

nit

ud

e M

agn

itu

de

0 1 2 3 4 5 6

0 0

0.2

0.4

0.6

0.8

1

0

0.2

0.4

0.6

0.8

1

5 10 15 20 25 30

(b)

(a)

Page 551: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 12: Infinite Impulse Response (IIR) filters 537

Example 12.2.2: Design a digital Butterworth filter that meets the fol-lowing specifications:

1. The 3-dB cutoff frequency is to occur at rad/unit.2. T = 50 μs.3. At 2 c, the attenuation is 15 dB.

Solution: First, we find the analog-equivalent criteria for the requireddigital filter. Using (12.21), we have

By (10.1) we find

from which

or

Hence, the minimum order of the Butterworth filter to meet the specificationsis n = 2. The form of the filter is, from Table 10.2.2,

c 0 4.

cc

T= =

×= ×2

22

50 100 4

229 062 106

3tan tan.

. rad/ss

15 6

2 22

250 10

0 82

123 107dB

c

T= =

×= ×tan tan

.. 1103 rad/s

×

=+

10 123 107 10

101

1 123 1

103

2

10

log ( . )

log[( .

H j

007 10 29 062 1015

3 3 2× ×) /( . )] n

1123 107 1029 062 10

10 31 623

3

2

1 5+ ××

=..

..

n

228

×

12

30 6228

123 107 1029 062 10

10

10

3

log ( . )

log.. 33

1 1851= .

H ss s

( ).

=+ +

11 4142 12

Page 552: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

538 Signals and systems primer with MATLAB

The analog normalized filter satisfying the specifications is

Introduce (12.16) in this equation to write

which is the digital Butterworth design. �

12.3 Frequency transformation for digital filtersFrequency transformations are available, and these transforms permit alow-pass filter design to be adapted to another low-pass filter, a high-passfilter, a band-pass filter, or a band-stop filter. These transformations areconsidered below.

Low-pass-to-low-pass transformation

The transformation is specified by

(12.24)

Example 12.3.1: Deduce a low-pass digital filter with = 30 rad/s usingthe low-pass digital filter of Example 12.1.1 for the case T = 0.05 s.

Solution: The given digital filter has the system function

(12.25)

H s Hs

Hs

s

un unc

( ).

= =×

=

29 062 10

1

29

3

...

.

( )

062 101 4142

29 062 1013

2

3×+

×+

=

s

H sun(( . )

. ( . )29 062 10

41 0995 10 29 062 10

3 2

2 3 3 2

×+ × + ×s s

H z H sz

T z

un un( ) ( )( . )

( )( )

= = ×

+

29 062 10

2 11

3 2

+ ×+

+ ×2

341 0995 102 1

129 062.

( )( )

( .z

T z1103 2)

zz c

czc c c

c c

c

= =+

=

122

sin[( ) ]sin[( ) ]

,//

ccutoff frequency of the desired filter

c == cutoff frequency of the given filter

c

H ze z

zz

( )..

= =×

201

200 367920 0 05 1

Page 553: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 12: Infinite Impulse Response (IIR) filters 539

The original low-pass filter has a cutoff frequency of 20 rad/s. Workingwith normalization formats, we observe that if the cutoff frequency of theoriginal is at 1, then the cutoff frequency of the desired one is at 30/20 = 1.5.Hence, the transformation gives the following expression:

(12.26)

Figure 12.3.1 shows the plots of the two filters by substituting in(12.25) and (12.26). Observe that the values of the filters at = 1 (20 rad/s)and = 1.5 (30 rad/s) are the same (–2.6636), a result that was expectedin light of the requirement imposed on the problem. Since T = 0.05, we have1/0.05 = 20 rad/s and 1.5/0.05 = 30 rad/s. �

Low-pass-to-high-pass transformation

The required transformation is given by

(12.27)

Example 12.3.2: Using the digital filter of Example 12.1.1, determine thehigh-pass digital filter with = 30 rad/s and T = 0.05 s.

Figure 12.3.1 Low-pass-to-low-pass transformation of digital filter.

1.5

T = 0.05 s

ω rad/unit

Man

git

ud

e, d

B

0–7

–6

–5

–4

–3

–2

0

–1

1 2 3 4 5 6

H z

z ccz

z ccz

( ).

= =20

1

10 3679

20(( )( . ) .

,

sin[( . )/

z cc z c

c

+

=

1 0 3679 0 3679

1 1 5 2]]sin[( . )/ ]1 1 5 2+

z ej== c

= c

zz c

czc c c

c c

= ++

= +1

22

cos[( ) ]cos[( ) ]

,//

cc = cutoff frequency of the desired filter

c = cutoff frequency of the given filter

c

Page 554: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

540 Signals and systems primer with MATLAB

Solution: We begin with the given filter H(z) = 20z/(z – 0.3679). Nowapply the transformation by (12.27):

As in the previous example, we observe that the two filters have anidentical value, –2.66, at normalized frequencies 1 for the low-pass filter and1.5 for the high-pass filter. �

Low-pass-to-band-pass transformation

The transformation is given by

Example 12.3.3: Determine a band-pass digital filter with an upper cutofffrequency of 0.8 rad/unit and a lower cutoff frequency of 0.4 rad/unit.Use the first-order digital filter of Example 2.1.1 with T = 0.05.

Figure 12.3.2 Low-pass-to-high-pass transformation of digital filter.

T = 0.05 s

–0.266

Mag

nit

ud

e, d

B

0–7

–6

–5

–4

–3

–2

–1

0

1 1.5 2 3 4 5 6

ω rad/unit

H z

z ccz

z ccz

z c( )

.

( )( .

=

++

++

= ++

201

10 3679

201 0 33679 0 3679c z) .+

zz

abb

zbb

bb

zab

bz

z= ++

+

+ ++

=2

2

22

111

11

21

1

aa z bb z a z

aab

bb

bb

a

1 1

12

11 11

21

11

++

=+

=+

= cos[( uu l

u l

u lb+ =)/ ]

cos[( )/ ]cot tan

22 2

c

u

l

2

=

=

desired upper cutoff frequency

desiired lower cutoff frequency

low-pass filc = tter cutoff frequency

(12.28)

Page 555: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 12: Infinite Impulse Response (IIR) filters 541

Solution: The transformation is given by

The normalized plot is given in Figure 12.3.3. Observe that the attenu-ation of –2.66 is at the normalized frequencies of 1, 0.4 , and 0.8 , as it shouldbe. Since we have accepted a sampling time of 0.05, the correspondingunnormalized frequencies are 20, 8 , and 16 rad/s, respectively.

Figure 12.3.3 Low-pass-to-band-pass transformation of digital filter.

H z

z a z bb z a z

z a z bb z

( )( )

=

++

+

201

21 1

12

12

1 1

12 +

= ++

a z

z a z bb z

1

21 1

12

10 3679

201 0 3679

.

( )( . ) (( . ) .a a z b1 1 10 3679 0 3679+ + +

aab

bb

bb

a

1 12

111

0 8 0 4 2

=+

=+

= +cos[( . . )/ ]cos[(00 8 0 4 2

0 8 0 42

1 2. . )/ ]

cot. .

tan( )=b /

T = 0.05 s

–2.66

Mag

nit

ud

e, d

B

ω rad/unit

0–7

–6

–5

–4

–3

–2

–1

0

0.5 1 1.5 2 2.5 3 3.5 4

0.8π0.4π

Page 556: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

542 Signals and systems primer with MATLAB

Book MATLAB m-file: ex_12_3_3

%Book m-file: ex_12_3_3

w=0:0.05:4;

a=cos(0.5*(0.8*pi+0.4*pi))/cos(0.5*(0.8*pi-0.4*pi));

b=cot(0.5*(0.8*pi-0.4*pi))*tan(1/2);

a1=2*a*b/(b+1);b1=(b-1)/(b+1);

num=20*(exp(j*2*w)-a1*exp(j*w)+b1);

den=(1+0.3679*b1)*exp(j*2*w)-(a1+0.3679*a1)*exp(j*w)+b1+0.3679;

hz=num./(den);

hzt=1./(1-exp(-1)*exp(-j*w));

plot(w,20*log10(abs(hzt)/max(abs(hzt))),'k',w,20*log10...(abs(hz)/max(abs(hz))),'k');

grid on;

xlabel('\omega rad/unit');ylabel('Magnitude, dB') �

Low-pass-to-band-pass transformation

The transformation is given by

12.4 Recursive versus non-recursive designA comparison of the important features of different filter designs is helpful.In recursive IIR filters, the poles of the transfer function can be placedanywhere within the unit circle in the frequency plane. As a result, IIR filterscan usually match physical systems well. Also, high selectivity can beachieved using low-order transfer functions. With non-recursive FIR filters,on the other hand, the poles are fixed at the origin, and high selectivity canbe achieved only by using a relatively high-order transfer function with itsresulting computations. For the same filter specifications, the order of the

zz

ab

zbb

bb

zab

z

z a z= ++

+

+ ++

= +2

2

21

21

11

11

21

1

bbb z a z

aab

bbb

a u l

1

12

11 11

21

11+

=+

=+

= +cos[( )///

22 2 2

]cos[( ) ]

tan tanu l

u l c

u

b =

==

=

desired upper cutoff frequency

desiredl llower cutoff frequency

low-pass filter cc = uutoff frequency

(12.29)

Page 557: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 12: Infinite Impulse Response (IIR) filters 543

non-recursive filter might be of the order of 5 to 10 times that of the recursivestructure, with the consequent need for more electronic parts. Often, how-ever, a recursive structure might not meet the specifications and, in suchcases, the non-recursive filter can be used. An advantage in the design ofthe non-recursive filter is that FFT techniques can be used in the calculations.

Hardware implementation of filters requires that storage of input outputdata and also arithmetic operations be implemented, which requires usingfinite word length registers — for example, 8, 12, 16 bits. As a result, certainerrors will occur. These errors are categorized as follows:

1. Optimization errors due to arithmetic operations, such as roundingoff and truncation.

2. Quantization errors due to representing the input signal by a set ofdiscrete values.

3. Quantization errors when the filter coefficients are represented by afinite number of bits.

It is left to the filter designer to decide on the various trade-offs betweencost and precision in trying to reach a specified goal.

Important defintions and concepts

a. Impulse invariant methodb. Bilinear transformationc. Warping effect from analog to digital transformationd. Frequency transformations for digital filters

Chapter 12 ProblemsSection 12.1

1. Fill in the steps of Example 12.1.2.2. Determine the impulse-invariant digital filter corresponding to the

second-order Butterworth filter.3. Find H(z) using the impulse-invariant method for a first-order nor-

malized Chebyshev filter having a 0.5-dB ripple factor.

Section 12.2

1. Set in (12.26) and z = rej ; next, solve for and to obtainthem as two functions of r and . Based on these equations, showthat the left-hand s-plane is mapped into the unit circle of the z-plane.

2. Create a strip in the s-plane with a width from –j s/2 to j s/2. Usingthe bilinear transformation and plotting several points, infer whereall the points of this trip, which extends to ±j , are mapped in thez-plane.

s j= +

Page 558: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

544 Signals and systems primer with MATLAB

3. Repeat Example 12.2.2 with the following difference: 3) At 2 c, theattenuation is to be 30 dB. Plot your result and compare with theresults of Example 12.2.2.

4. Repeat Problem 12.2.3 but for a Chebyshev filter.

Section 12.3

1. Determine the digital equivalent of the first-order Butterworth filterusing the bilinear transformation. The cutoff frequency is 25 rad/s.Next, deduce a low-pass digital filter using digital transformationwith cutoff frequency of 40 rad/s. The sampling frequency is T =

/40 s.2. Repeat Problem 12.3.1 but for a high-pass digital filter transformation.3. Determine the digital equivalent of the second-order Butterworth

filter using the bilinear transformation. The cutoff frequency is20 rad/s. Next, deduce a band-pass digital filter using digital trans-formation. The lower frequency is 40 rad/s and the upper frequencyis 60 rad/s. The sampling frequency is /200 s.

4. Repeat Example 12.3.2 but for a band-stop digital filter with the samelower and upper frequencies.

5. Repeat Example 12.3.3 but for a band-stop digital filter with the samelower and upper frequencies.

6. Repeat Problem 12.3.3 but for a Chebyshev filter.

Page 559: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

545

chapter 13

Random variables, sequences, and power spectra densities

13.1 Random signals and distributionsMost signals in practice are not deterministic but random. However, theycan be described by precise mathematical analysis whose tools are containedin the theory statistical analysis. In this text we will be dealing only withdiscrete random signals. This can always be accomplished since we cansample the continuous signals at sampling rates at least at twice their highestfrequency, thus avoiding aliasing. Remember that the signals we receive areband limited because all signals must be detected by a physical (not ideal)transducer, such as a voltmeter, one that measures the electrocardiogram,another that measures the earthquake, etc. All of these physical transducerscannot respond to a delta function excitation, and hence they pass onlyfrequencies up to a specific value.

A discrete random signal {X(n)} is a sequence of indexed random vari-ables (rv’s) assuming the values

(13.1)

The random sequence with values {x(n)} is discrete with respect to samplingindex n. In our case, we will assume that the random variable at any timen takes continuous values, and hence it is a continuous random variable atany time n. What we really say is that we can associate at each n an infiniteset of values (continuous) of the random variable X(n) within a specifiedrange. This type of sequence is also known as time series. In case we studya continuous random signal, we will assume that we sample it at a highenough so that we construct a time series that is free of aliasing.

A particular rv X(n) is characterized by its probability density function(pdf) f(x(n)):

{ ( ) ( ) ( ) }x x x0 1 2 �

Page 560: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

546 Signals and systems primer with MATLAB

(13.2)

and its cumulative density function (cdf) F(x(n)) or distribution function:

(13.3)

The expression is interpreted as the probability that the rvX(n) will take values less than or equal to x(n) at time n. As the value at timen approaches infinity, F(x(n)) approaches unity.

Similarly, the multivariate distributions are given by

(13.4)

Note that we have used a capital letter to indicate rv. In general, we shallnot keep this notation since it will be obvious from the context.

If, for example, we want to check the accuracy of reading a dial by aperson, we will have two readings, one due to the person and another dueto the instruments. A simultaneous plot of these two readings, each oneassociated with a different orthogonal axis, will produce a scattering diagrambut with a linear dependence. The closer the points fall on a straight line,the more reliable the person’s readings are. This example presents a case ofa bivariate distribution.

To obtain a formal definition of a discrete-time stochastic process, weconsider an experiment with a finite or infinite number of unpredictableoutcomes from a sample space, S(z1,z2, …), each one occurring with a prob-ability p(zi). Next, by some rule we assign a deterministic sequence x(n, zi),– < n < , to each element zi of the sample space. The sample space, theprobabilities of each outcome, and the sequences constitute a discrete-timestochastic process or random sequence. From this definition we obtain thefollowing four interpretations:

• x(n, z) is an rv if n is fixed and z is variable• x(n, z) is a sample sequence called realization if z is fixed and n is

variable• x(n, z) is a number if both n and z are fixed• x(n, z) is a stochastic process if both n and z are variables

f x nF x n

x n( ( ))

( ( ))( )

=

F x n p X n x n f y n dy nx n

( ( )) ( ( ) ( )) ( ( )) ( )( )

= =

p X n x n( ( ) ( ))

F x n x n p X n x n X n x nk k k( ( ), , ( )) ( ( ) ( ), , ( ) (1 1 1� �= )))

( ( ), , ( ))( ( ), , ( ))(

f x n x nF x n x nx nk

kk

11

1

��=

)) ( )� x nk

Page 561: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 13: Random variables, sequences, and power spectra densities 547

Each time we run an experiment under identical conditions, we createa sequence of rv’s {X(n)} that is known as a realization and constitutes anevent. A realization is one member of a set called the ensemble of all possibleresults from the repetition of an experiment. Figure 13.1.1 shows a typicalensemble of realizations.

Book MATLAB m-file

(To create a script file, we first create the file, as shown below, as a newMATLAB file. Then we save the file named “realizations.m,” for example,in the directory c:\ap\samatlab. Be sure to add the .m at the end of thefile name. When we are in the MATLAB command window we attach theabove directory to the MATLAB path using the following command:>>path(path,‘c:\ap\samatlab’) or >>cd ‘c:\ap\smatlab’. Thenthe only thing we have to do is to write realizations and automaticallythe MATLAB will produce the figure with four subplots.)

Figure 13.1.1 Ensemble of realizations.

0 5 10 15 20 25 30 35 40 45 50–0.5

0

0.5 Four realizations

0 5 10 15 20 25 30 35 40 45 50–0.5

0

0.5

0 5 10 15 20 25 30 35 40 45 50–0.5

0

0.5

0 5 10 15 20 25 30 35 40 45 50–0.5

0

0.5

n

x(n

)

Page 562: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

548 Signals and systems primer with MATLAB

Book MATLAB m-file: realizations

%Book MATLAB m-file: realizations

for n=1:4

x(n,:)=rand(1,50)-0.5;%x=4x50 matrix with each row having

%zero mean;

end;

m=0:49;

for i=1:4

subplot(4,1,i);stem(m,x(i,:),'k');%plots four rows of matrix x

end;

xlabel('n');ylabel('x(n)')

Figure 13.1.1 shows four realizations of a stochastic process with zeromean value. With only slight modifications of the above script file we canproduce any number of realizations.

Stationary and ergodic processes

It is seldom in practice that we will be able to create an ensemble of a randomprocess with numerous realizations so that we can find some of its statisticalcharacteristics, e.g., mean value, variance, etc. To find these statistical quan-tities, we need the pdf of the process, which most of the time is not possibleto produce. Therefore, we will restrict our studies to processes that are easyto study and easy to handle mathematically.

The process that produces an ensemble of realizations and whose sta-tistical characteristics do not change with time is called stationary. For exam-ple, the pdfs of the rv’s x(n) and x(n + k) of the process {x(n)} are the sameindependently of the values of n and k.

Since we will be unable to produce ensemble averages in practice, weare left with only one realization of the stochastic process. To overcome thisdifficulty, we assume that the process is ergodic. This characterization per-mits us to find the desired statistical characteristics of the process from onlyone realization at hand. We refer to those statistical values as sample mean,sample variance, etc. We must have in mind that these values are the approx-imate to the ensemble values. One of the main objectives of the statisticiansis to find ways to give these sample values some confidence limits withinwhich, with a high degree of probability, the ensemble value exists.

13.2 AveragesMean value

The mean value or expectation value mn at time n of a random variable x(n)having pdf f(x(n)) is defined by

Page 563: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 13: Random variables, sequences, and power spectra densities 549

(13.5)

where E{·} stands for expectation operator. We can also use the ensemble ofrealizations to obtain the mean value using the frequency interpretationformula

(13.6)

where xi(n) is the ith outcome at sample index n (or time n) of the ithrealization. Depending on the type of the rv, the mean value may or maynot vary with time.

For an ergodic process, we find the sample mean (estimator of the mean)using the time-average formula

(13.7)

It turns out that the ensample of sample mean is equal to the populationmean m, and therefore, we call the sample mean an unbiased estimator, inthis case of the mean value.

Example 13.2.1: Show that the ensample mean of the sample mean is anunbiased estimator.

Solution:

Note that we were able to exchange the summation with the ensemble (anintegral) because the integrant is not a function of k, as far as the integrationis concerned, but a function of the values of x (see (13.5)). �

Correlation

The cross-correlation between two random variables is defined by

(13.8)

m E x n x n f x n dx nn = ={ ( )} ( ) ( ( )) ( )

mN

x n NnN

i

i

N

= ==

lim ( )1

1

number of rrealizations

ˆ ( )mN

x nn

N

==

1

0

1

m

E m EN

x kN

E x kN

mk

N

k

N

k

N

{ ˆ } { ( )} { ( )}= = == = =

1 1 1

1 1 1

= =NmN

m

r m n E x m y n x m y n f x m y n dxy ( , ) { ( ), ( )} ( ) ( ) ( ( ), ( ))= = xx m dy n( ) ( )

Page 564: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

550 Signals and systems primer with MATLAB

where the integrals are from minus infinity to infinity. If x(n) = y(n), thecorrelation is known as the autocorrelation. Having an ensemble of realiza-tions, the frequency interpretation of the autocorrelation function is foundusing the formula

(13.9)

Example 13.2.2: Using Figure 13.1.1, find the mean for n = 10 and theautocorrelation function for a time difference of 5: n = 20 and n = 25.

Solution: The desired values are

Because the number of realizations is very small, both values found aboveare not expected to be accurate. �

Figure 13.2.1 shows the mean value at 20 individual times and theautocorrelation function for 20 differences (from 0 to 49), known as lags.These results were found using the MALAB function given below. Note thatas the number of realizations increases, the mean tends to zero and theautocorrelation tends to a delta function, as it should be. In this case, therandom variables are independent, identically distributed (iid), and theirpdf is Gaussian (white noise). If the rv’s are independent, the autocorrelationis a delta function.

Book MATLAB function for mean and autocorrelation using the frequency interpretation approach

function[mx,rx]=ssmeanautocorensemble(M,N)

%function[mx,rx]=sameanautocorensemble(M,N);

%N=number of time instances;easily modified for

%other pdf's;

r m nN

x m x nxxN

i i

i

N

( , ) lim ( ) ( )==

1

1

μ10

1

414

1014

0 3 0 1 0 4 0 45 0 06= = + ==

xi

i

( ) ( . . . . ) .

rr

x x

x

i i

( , )

( ) ( ) [( . )( .

20 25

14

25 3014

0 1 0= = 335 0 15 0 4 0 35 0 25 0 2 0 1) ( . )( . ) ( . )( . ) ( . )( . )+ + + ]]

.

i=

=

1

4

0 032

Page 565: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 13: Random variables, sequences, and power spectra densities 551

x=randn(M,N); %randn=MATLAB function producing zero mean

%Gaussian distributed white noise; x=MxN matrix;

%sum(x,1)=MATLAB function that sums all the rows;

%sum(x,2)=MATLAB function that sums all the columns;

mx=sum(x,1)/M;

for i=1:N

rx(i)=sum(x(:,1).*x(:,i))/M;

end;

Having the values of mx and rx, we can plot them as in Figure 13.2.1.To find the unbiased sample autocorrelation function from one realiza-

tion (ergotic process), we use the formula

(13.10)

Figure 13.2.1 Means and autocorrelations based on frequency interpretations.

–1

–0.5

0

0.5

1

Mea

n v

alu

e

–0.1

–0.05

0

0.05

0.1

Mea

n v

alu

e

–1.5

–1

–0.5

0

0.5

1

1.5

2

Au

toco

r. v

alu

e

–0.2

0

0.2

0.4

0.6

0.8

1

1.2A

uto

cor.

val

ue

0 5 10 15 20

Mean of 10 realizations

0 5 10 15 20

Mean of 400 realizations

0 5 10 15 20

Lags of autocor. function, 400 realiz.

0 5 10 15 20

Lags of autocor. function

ˆ( ) ( ) , , ,r mN m

x n x n m m Nn

N m

= +( ) ==

10 1 1

0

1

Page 566: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

552 Signals and systems primer with MATLAB

The absolute value of m ensures the symmetry of the sample autocorre-lation sequency at n = 0. Although the formula gives an unbiased autocor-relation sequence, it sometimes produces autocorrelation matrices (discussedbelow) that do not have inverses. Therefore, it is customary in practice touse any one of the biased formulas

(13.11)

Book MATLAB function to find the biased autocorrelation function

function[r]=sssamplebiasedautoc(x,lg)

%this function finds the biased autocorrelation function

%with lag from 0 to lg;it is recommended that lg is 20-30 percent

%of N;

N=length(x);%x=data;lg=lag;

for m=1:lg

for n=1:N+1-m

xs(m,n)=x(n-1+m);

end;

end;

r1=xs*x';

r=r1'./N;

We can also use MATLAB functions to obtain the biased or unbiasedsample autocorrelation and cross-correlation sequences. The functions are

r=xcorr(x,y,'biased');

r=xcorr(x,y),'unbiased');

%x,y are N length vectors; r is a 2N-1 symmetric cross-

%correlation vector; in case the vectors are unequal

%the shorter one is padded with zeros;

Note: If none of the options (i.e., biased or unbiased) is used, the default valueis the biased, but the resulting vector is not divided by N.

The reader is encouraged to find several interesting options in using thexcorr command by writing help xcorr or doc xcorr on the MATLAB com-mand window.

ˆ( ) ( )

ˆ( )

r mN

x n x n m m N

r mN

x

n

N m

= +( )

=

=

10 1

1

0

1

(( ) ( )n x n m m Nn

N

=0

1

0 1

Page 567: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 13: Random variables, sequences, and power spectra densities 553

Covariance

The covariance (autocovariance) of a random iid sequence is defined by

(13.12)

The variance is found by setting m = n in (13.12). Thus,

(13.13)

If the mean value is zero, then the variance and correlation function areidentical:

(13.14)

The estimator for the biased variance is given by

(13.15)

and for the unbiased case we substitute N with N – 1. The variance abovecan be found from the Book MATLAB function sssamplebiasedautoc(data_vector,lags) at 0 lag. The reader can also use the MATLABfunctions std(data_vector)=standard deviation= andvar(data_vector)=variance.

Independent and uncorrelated rv’s

If the joint pdf of two rv’s can be separated into two pdfs, fx,y(m,n) = fx(m)fy(n),then the rv’s are statistically independent. Hence,

(13.16)

The above equation is a necessary and sufficient condition for the two ran-dom variables x(m), x(n) to be uncorrelated. Note that independent randomvariables are always uncorrelated. However, the converse is not necessarilytrue. If the mean value of any two uncorrelated rv’s is zero, then the randomvariables are called orthogonal. In general, two rv’s are called orthogonal iftheir correlation is zero.

c m n E x m m x n m E x m x n mx m n( , ) {( ( ) )( ( ) )} { ( ) ( )}= = mm n

x m n

m

r m n m m= ( , )

c n n E x n m E x n mx n n n( , ) {( ( ) ) } { ( )}= = =2 2 2 2

c n n E x n r n nx n x( , ) { ( )} ( , )= = =2 2

ˆ ( ( ) ˆ )2 2

1

1==

Nx n m

n

N

variance

E x m x n E x m E x n m mm n{ ( ) ( )} { ( )} { ( )}= =

Page 568: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

554 Signals and systems primer with MATLAB

13.3 Stationary processesFor a wide-sense (or weakly) stationary process (WSS), the cdf satisfies therelationship

(13.17)

for any m, n, and k. This also applies for all statistical characteristics, suchas mean value, variance, correlation, etc. If the above relationship is true forany number of rv’s of the time series, then the process is known as strictlystationary process.

The basic properties of a wide-sense stationary process are (see Problem13.3.1)

(13.18)

Autocorrelation matrix

If x = [x(0) x(1) … x(p)]T is a vector representing a finite WSS randomsequence, then the autocorrelation matrix is defined by

(13.19)

since rx(k) = rx(–k).

F x m x n F x m k x n k( ( ), ( )) ( ( ), ( ))= + +

a) c)

b)

m n m r k r k

r m n r

n x x

x

( ) ( ) ( )

( , )

= = =

=

constant

xx x xm n r r k( ) ( ) ( )d) 0

R xxxT= =E

E x x E x x E x x p

{ }

{ ( ) ( )} { ( ) ( )} { ( ) ( )0 0 0 1 0� }}

( ( ) ( )} { ( ) ( )} { ( ) ( )}

{ (

E x x E x x E x x p

E x

1 0 1 1 1�

� � �

pp x E x p x E x p x p) ( )} { ( ) ( )} { ( ) ( )}0 1 �

=+

r r r p

r r r p

x x x

x x x

( ) ( ) ( )

( ) ( ) ( )

0 1

1 0 1

��

�r p r p r

r r

x x x

x

( ) ( ) ( )

( )

=

1 0

0 xx x

x x x

x x

r p

r r r p

r p r p

( ) ( )

( ) ( ) ( )

( ) ( )

1

1 0 1

1

+

rrx( )0

Page 569: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 13: Random variables, sequences, and power spectra densities 555

Example 13.3.1: (a) Find the biased autocorrelation function with a lagtime of up to 20 of a sequence of 40 terms, which is a realization of rv’shaving a Gaussian distribution with zero mean value. (b) Create a 4 × 4autocorrelation matrix.

Solution: The Book MATLAB m-function ex13_3_1 produces Figure13.3.1 and is given below. To find the correlation matrix from the autocorre-lation function, we use the following MATLAB function: Rx=toeplitz(rx(1,1:4)). In this example, a 4 × 4 matrix produced from the first fourcolumns of correlation row vector rx is

Figure 13.3.1 Illustration of Example 13.3.1.

Rx =

2 0817 0 3909 0 1342 0 0994

0 3909 2 0817 0 3

. . . .

. . . 9909 0 1342

0 1342 0 3909 2 0817 0 3909

0 0994 0

.

. . . .

. .11342 0 3909 2 0817. .

–0.5

0

0.5

1

–1

s(n

)

–2

0

2

4

–4

v(n

)

0 10 20 30 40n

0 10 20 30 40n

5

10

15

20

0

FT

of

s

2

4

6

8

0

FT

of

rx

0 10 20 30 40Freq. bins

0 10 20 30 40Freq. bins

–2

0

2

4

–4

x =

s +

v

0

1

2

–1

rx

0 5 10 15 20k

0 10 20 30 40n

Page 570: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

556 Signals and systems primer with MATLAB

Book MATLAB m file: ex13_3_1

%ex13_3_1 Book m-file;

n=0:39;

s=sin(.2*pi*n);

v=randn(1,40); %randn=MATLAB function producing white Gaussian

%distributed rv's;

x=s+v;

rx=sssamplebiasedautoc(x,20);%Book MATLAB function creating the

%autocorrelation of x;

fts=fft(s,40); %fft=MATLAB function executing the fast Fourier %transform;

ftrx=fft(rx,40);

subplot(3,2,1);stem(s,'k');xlabel('n');ylabel('s(n)');

subplot(3,2,2);stem(v,'k');xlabel('n');ylabel('v(n)');

subplot(3,2,3);stem(x,'k');xlabel('n');ylabel('x=s+v');

subplot(3,2,4);stem(rx,'k');xlabel('k');ylabel('rx');

subplot(3,2,5);stem(abs(fts),'k');xlabel('Freq. bins');ylabel('FT of s');

subplot(3,2,6);stem(abs(ftrx),'k');xlabel('Freq. bins');ylabel('FT rx');

Note: If we have a row vector x and need to create a vector y with elements ofx from k to m only, we write y = x(1,k:m);. If x is a column vector, we writey = x(k:m,1);. �

Example 13.3.2: Let {v(n)} be a zero mean, uncorrelated Gaussian randomsequence with variance = constant. (a) Characterize the randomsequence {v(n)}, and (b) determine the mean and autocorrelation of thesequence {x(n)} if x(n) = v(n) + av(n – 1), in the range – < n < . a is a constant.

Solution:

a. The variance of {v(n)} is constant, and hence is independent of thetime, n. Since {v(n)} is an uncorrelated sequence, it is also independentdue to the fact it is a Gaussian sequence. From (13.12) we obtain

or 2 = rv(n,n) = constant. Hence,rv(l,n) = 2(l – n), which implies that {v(n)} is a WSS process.

b. E{x(n)} = 0 since E{v(n)} = E{v(n – 1)} = 0. Hence,

v n2 2( ) =

c l n r l n m m r l nv v l n v( , ) ( , ) ( , )= =

r l n E v l av l v n av n E vx( , ) {[ ( ) ( )][ ( ) ( )]} {= + + =1 1 (( ) ( )}

{ ( ) ( )} { (

l v n

aE v l v n aE v+ +1 ll v n a E v l v n r l nv) ( )} { ( ) ( )} ( , )+ =1 1 12

( , ) ( , ) ( , )+ + +ar l n ar l n a r l nv v v1 1 1 12 == + +

+

2 2

2 2

1( ) ( )

(

l n a l n

a l = + + + + =n a r a r a r l n r) ( ) ( ) ( ) ( ),1 1 12 2 2 2

Page 571: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 13: Random variables, sequences, and power spectra densities 557

Since the mean of {x(n)} is zero, a constant, and its autocorrelation is afunction of the lag factor r = l – n, it is a WSS process. �

Purely random process (white noise, WN)

A discrete process is purely random if the random variables {x(n)} of asequence are mutually independent and identically distributed variables.Since the mean and cov(x(m), x(m + k)) do not depend on time, the processis WSS. This process is also known as white noise and is given by

(13.20)

Random walk (RW)

Let {x(n)} be a purely random process with mean mx and variance . Aprocess {y(n)} is a random walk if

(13.21)

Solving the above equation iteratively, we find that

(13.22)

The mean is found to be E{y(n)} = nmx, and the covariance is

It interesting to note that the difference x(n) = y(n) – y(n – 1) is purelyrandom, and hence stationary.

13.4 Special random signals and probability density functions

White noise

A WSS discrete random sequence that satisfies the relation

(13.23)

c kE x m m x m k m k

kx

x x( )

{( ( ) )( ( ) )}

, ,=

+ =

= ± ±

0

0 1 2 �

x2

y n y n x n y( ) ( ) ( ) ( )= + =1 0 0

y n x ii

n

( ) ( )==1

cov( ( ), ( )) {[ ( ) ][ ( ) ]} [ {y n y n E y n m y n m n E xy y= = 2 }} ] =m nx x2 2

f x x f x f x f x( ( ), ( ), ) ( ( )) ( ( )) ( ( ))0 1 0 1 2� �=

Page 572: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

558 Signals and systems primer with MATLAB

is a pure random sequence whose elements x(n) are statistically independentand identically distributed (iid). Therefore, the zero mean iid sequence hasthe following correlation function:

(13.24)

where is the variance of the signal and (m – n) is the discrete-time deltafunction. For m n, (m – n) = 0, and hence (13.24) becomes

(13.25)

For example, a random process consisting of a sequence of uncorrelatedGaussian rv’s is a white noise process referred to as white Gaussian noise(WGN). MATLAB has a special function that will produce WGN. For exam-ple, writing x=randn(1,500)will produce a sequence (vector x) whoseelements are normally distributed and variance is 1. We can use the MATLABfunction hist(x,20) to produce the pdf of the time series {x(n)}. The func-tion divides the range between the maximum and minimum values of thesequence in 20 sections. Then it plots the number of x’s, whose values fallwithin each section, vs. the range of values of x’s.

Gaussian processes

The pdf of a Gaussian rv x(n) at time n is given by

(13.26)

Algorithm to produce normalized Gaussian distribution

1. Generate two independent rv’s u1 and u2 from uniform distribution(0, 1).

2.3. Keep x1 or x2.

Book MATLAB function

function[x]=ssnormalpdf(m,s,N)

%function[x]=ssnormalpdf(m,s,N);

%s=standard deviation;m=mean value;

for i=1:N

r1=rand;

r m n E x m x n m nx x( ) { ( ) ( )} ( )= = 2

x2

r kk k

kx

x( )

( )=

=2 0

0 0

f x n N m en n

n

x n mn

n( ( )) ( , )( ( ) )

� = 1

2 2

2

2

2

x u u x u1 11 2

2 1 112 2 2= =( ln( )) cos( ) [ ( ln( ))/ /or 22

22sin( )].u

Page 573: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 13: Random variables, sequences, and power spectra densities 559

r2=rand;

z(i)=sqrt(-2*log(r1))*cos(2*pi*r2);

end;

x=s*z+m;

Example 3.4.1: Find the joint pdf of a sequence of WGN with n elements,each one having a zero mean value and the same variance.

Solution: The joint pdf is

(13.27)

A discrete-time random process {x(n)} is said to be Gaussian if everyfinite collection of samples of x(n) is jointly Gaussian. A Gaussian randomprocess has the following properties: (a) it is completely defined by its meanvector and covariance matrix; (b) any linear operation on the time variablesproduces another Gaussian random process; (c) all higher moments can beexpressed by the first and second moments of the distribution (mean, cova-riance); and d) white noise is necessarily generated by iid samples (indepen-dence implies uncorrelated rv’s and vice versa).

Lognormal distribution

Let the rv x be N(m, 2). Then y = exp(x) has the lognormal distribution withpdf

(13.28)

The values of sigma and mu must be small to form a lognormal-type distri-bution.

Algorithm to produce lognormal distribution

1. Generate z from N(0, 1).2. x = μ + z (x is N(m, 2)).3. y = exp(x).4. Keep y.

f x x x n f x f x f x nn( ( ), ( ), , ( )) ( ( )) ( ( )) ( (1 2 1 21 2� �= )))

( )exp ( )

/=

=

12

122 2

2

1n

xn

x k

n

x k

f y y

y my

( )exp

(ln )

=<1

2 20

0

2

otherwisse

Page 574: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

560 Signals and systems primer with MATLAB

Book MATLAB function: [y]=sslognormalpdf(m,s,N)

function[y]=sslognormalpdf(m,s,N)

%function[y]=sslognormalpdf(m,s,N);

%m=mean value;s=standard deviation;N=number of samples;

%m and s is associated with the normal distribution and

%to find the mean and standard deviation of the

%lognormal distribution you must

%use the MATLAB functions mean(y) and std(y)

for i=1:N

r1=rand;

r2=rand;

z(i)=sqrt(-2*log(r1))*cos(2*pi*r2);

end;

x=m+s*z;

y=exp(x);

Chi-square distribution

If are N(0, 1), then

(13.29)

has the chi-square distribution with n degrees of freedom and it is denotedby 2(n).

13.5 Wiener–Kintchin relationsFor a WSS process, the correlation function asymptotically goes to zero, andtherefore, we can find its spectrum using the discrete Fourier transform(DFT). Hence, the power spectrum is given by

(13.30)

This function is periodic with period 2 (exp(–jk( + 2 )) = exp(–jk )). Giventhe power spectral density, the autocorrelation sequence is given by therelation

z z zn1 2, ,,�

y zi

i

n

==

2

1

S e r k exj j k

k

( ) ( )==

Page 575: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 13: Random variables, sequences, and power spectra densities 561

(13.31)

For real processes, rx(k) = rx(–k) (symmetric function), and as a conse-quence, the power spectrum is an even function. Furthermore, the powerspectrum of the WSS process is also nonnegative. These two assertions aregiven below in the form of mathematical relations:

(13.32)

Example 13.5.1: Find the power spectral density of the sequencewith n = 0, 1, 2, …, 63.

Solution: The following Book MATLAB m-file produces Figure 13.5.1.

Figure 13.5.1 Illustration of Example 13.5.1.

r k S e e dx xj j k( ) ( )= 1

2

S e S e S e

S e

xj

xj

xj

xj

( ) ( ) ( )

( )

= =

0

x n n randn( ) sin( . ) ( , )= × +0 2 2 1 64

10

20

30

0

2

4

6

8

0

Sx(e

jω)

Ss(

ejω

)

0 2 4 6 8ω rad/unitω rad/unit

0 2 4 6 8

–2

0

2

4

–4

x(n

)

0.5

0

1

1.5

–0.5

r(k

)

0 50 100 150

k, time lags

0 20 40 60 80n

–2

0

2

4

v(n

)

0 20 40 60 80n

0 20 40 60 80n

–0.5

0

0.5

1

–1

s(n

)

Page 576: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

562 Signals and systems primer with MATLAB

Book MATLAB m-file: ex_13_5_1

%Book m-file:ex_13_5_1

n=0:63;

s=sin(0.1*2*pi*n);

v=randn(1,64);%Gaussian white noise;

x=s+v;

r=xcorr(x,'biased');%the biased autocorrelation is divided by N,%here by 64;

fs=fft(s);

fr=fft(r,64);

w=0:2*pi/64:2*pi-(2*pi/64);

subplot(3,2,1);stem(n,s,'k');xlabel('n');ylabel('s(n)');

subplot(3,2,2);stem(n,v,'k');xlabel('n');ylabel('v(n)');

subplot(3,2,3);stem(n,x,'k');xlabel('n');ylabel('x(n)');

subplot(3,2,4);stem(n,r(1,32:63),'k');xlabel('k, time lags');

ylabel('r(k)');

subplot(3,2,5);stem(w,abs(fs),'k');xlabel('\omega rad/unit');

ylabel('S_s(e^{j\omega}');

subplot(3,2,6);stem(w,abs(fr),'k');xlabel('\omega rad/unit');

ylabel('S_x(e^{j\omega}');�

13.6 Filtering random processesLinear time-invariant filters are used in many signal processing applications.Sine the input signals of these filters are usually random processes, we needto determine how the statistics of these signals are modified as a result offiltering.

Let x(n), y(n), and h(n) be the filter input, filter output, and filter impulseresponse, respectively. It can be shown that if x(n) is a WSS process, then thefilter output autocorrelation is related to the filter input autocorrelation

as follows:

(13.33)

The right-hand side of the expression (13.33) shows convolution of three func-tions. We can take the convolution of two of the functions, and the resultingfunction is then convolved with the third function. Based on the convolutionproperty discussed in the previous chapters, the results are independent ofthe order we operate on the functions.

r ky ( )r kx( )

r k h l r m l k h m r hy x

ml

x k( ) ( ) ( ) ( ) ( )= + ===

(( ) ( )k h k

Page 577: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 13: Random variables, sequences, and power spectra densities 563

From the z-transform table, we know that the z-transform of the convo-lution of two functions is equal to the product of their z-transform. Remem-bering the definition of the z-transform, we find the relationship (the orderof summation does not change the results)

(13.34)

since the summation is the same regardless of the direction in which we sumthe series.

Therefore, the z-transform of (13.33) becomes

(13.35)

If we set z = ej in the definition of the z-transform of a function, we findthe spectrum of the function. Having in mind the Wiener–Kintchin theorem,(13.35) becomes

(13.36)

Note: The above equation indicates that the power spectrum of the outputrandom sequence is equal to the power spectrum of the input sequence modified bythe square of the absolute value of the spectrum of the filter transfer function.

Example 13.6.1: A FIR filter is defined in the time domain by the differ-ence equation y(n) = x(n) + 0.5x(n – 1). If the input signal is a white Gaussiannoise with zero mean value, find the power spectrum of the output of thefilter.

Solution: The z-transform of the difference equation is Y(z) = (1 +0.5z–1)X(z). Since the ratio of the output to input is the transfer function ofthe filter, the transformed equation gives H(z) = Y(z)/X(z) = 1 + 0.5z–1. Theabsolute square value of the spectrum of the transfer function is given by

(13.37)

where the Euler identity was used. Figure 13.6.1 showsthe required results. Remember, the spectrum is valid in the range 0

. We remind the reader that if the sequence were coming from a continuousfunction sampled at times T, the spectrum range would have been 0

(rad/s) /T. The following Book MATLAB m-file produces Figure 13.6.1.

Z{ ( )} ( ) ( )( )h k h k z h m z Hk

k

m

m

= = == =

1 (( )z 1

R z r k h k h k R z H z H zy x x( ) { ( ) ( )} { ( )} ( ) ( ) ( )= =Z Z 1

S e S e H eyj

xj j( ) ( ) ( )=

2

H e e e e ej j j j j( ) ( . )( . ) . (2

1 0 5 1 0 5 1 0 5= + + = + + ) . . cos+ = +0 25 1 25

e jj± = ±cos sin

Page 578: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

564 Signals and systems primer with MATLAB

Book MATLAB m-file: ex_13_6_1

%Book m-file:ex_13_6_1

x=randn(1,128);

rx=xcorr(x,'biased');

sx=fft(rx,128);

w=0:2*pi/128:2*pi-(2*pi)/128;

sy=abs(sx).*(1.25+cos(w));

subplot(2,2,1);plot(x,'k');xlabel('n');ylabel('x(n)');

subplot(2,2,2);plot(rx,'k');xlabel('n');ylabel('x(n)');

subplot(2,2,3);plot(w,abs(sx),'k');xlabel('\omega rad/unit');

ylabel('S_x^{j\omega}');

subplot(2,2,4);plot(w,abs(sy),'k');xlabel('\omega rad/unit');

ylabel('S_y^{j\omega}');

Observe that the filter is low-pass since it has attenuated the high fre-quencies (frequencies close to ). We have also plotted the sequences in acontinuous format to show better the effects of filtering. �

Figure 13.6.1 Illustration of Example 13.6.1.

–3

–2

–1

0

1

2

3

x(n

)

r x(k

)

0 50 100 150

n

–0.2

0

0.2

0.6

0.4

0.8

1

1.2

0 100 200 300

k

0 0 2 4

rad/unit

6 8

1

2

3

4

Sx(e

jω)

0 2 4

rad/unit

6 8 0

2

4

8

6

10 S

y(ejω

)

Page 579: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 13: Random variables, sequences, and power spectra densities 565

Spectral factorization

The power spectral density of a WSS process {x(n)} is a real-valued,positive, and periodic function of . It can be shown that this function canbe factored in the form

(13.38)

where:

1. Any WSS process {x(n)} may be realized as the output of a causaland stable filter h(n) that is driven by white noise v(n) having variance

. This is known as the innovations representation of the process.2. If x(n) is filtered by the filter 1/H(z) (whitening filter), the output is

a white noise v(n) having variance . This process is known as theinnovations process and is given by

(13.39)

where the first bracket is the input Sx(z), the second represents thefilter power spectrum, and the output is the variance of the noise.

3. Since v(n) and x(n) are related by inverse transformations, one processcan be derived from the other. Therefore, both contain the sameinformation.

Autoregressive process (AR)

A special and important type of the combined FIR and IIR filter, known alsoas the autoregressive moving average (ARMA) filter (system), is the autore-gressive filter (AR). If we set q = 0 (see Figure 9.6.8), we obtain the relation

(13.40)

Using (13.38), we find the power spectrum of an observed signal producedat the output of an AR filter to be equal to

(13.41)

S exj( )

S e Q z Q zxj

v( ) ( ) ( )= 2 1

v2

v2

[ ( ) ( )]( ) ( )v vH z H z

H z H z2 1

121 =

H zb

a k z

bA z

k

k

p( )

( )

( )

( )( )

=

+

=

=

0

1

0

1

S eb

A ex

jv

j( )

( )

( )= 2

2

2

0

Page 580: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

566 Signals and systems primer with MATLAB

It can be shown that the following correlation relationship exists for theAR process:

(13.42)

The above equation is also written in a matrix form as follows:

(13.43)

For real sequences, the autocorrelation is symmetric, rx(k) = rx(–k).

Example 13.6.2: Find the AR coefficients a(1) to a(5) if the autocorrelationof the observed signal {x(n)} is given. Assume the noise variance to be equalto 1. Find the power spectrum of the process.

Solution: First we must produce a WSS process {x(n)}. This can beachieved by passing white noise through a linear time-invariant filter. In thisexample we use an AR filter with two coefficients, x(n) – 0.9x(n – 1) +0.5x(n – 2) = v(n). The variance of the white noise input to the filter v(n) is1, and its mean value is 0. The results are shown in Figure 13.6.2. The BookMATLAB m-file is also given below.

Book MATLAB m-file: ex_13_6_2

%Book m-file: ex_13_6_2

x(2)=0;x(1)=0; %initial conditions to solve the difference %equation;

for n=3:512

x(n)=0.9*x(n-1)-0.5*x(n-2)+3.5*(rand-0.5);%input is WSS %white noise;

end; %this iteration produces the WSS process x(n);

x1=x(1,10:265); %we skipped the first and last values to avoid %edge effects;

rx1=sssamplebiasedautoc(x1,15); %we call the m-function here %to obtain the autocorrelation

%function, the m-function must be located in a %folder which

%is in the working path of MATLAB;

r k a m r k m b k kx

m

p

x v( ) ( ) ( ) ( ) ( )+ ==1

2 20 0

r r r p

r r r p

r

x x x

x x x

x

( ) ( ) ( )

( ) ( ) ( )

(

0 1

1 0 1+

� � �

pp r p r

a

a px x) ( ) ( )

( )

( )1 0

1

1

�= vb2 20

1

0

0

( )�

Page 581: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 13: Random variables, sequences, and power spectra densities 567

R=toeplitz(rx1(1,1:6)); %we create the 6x6 autocorrelation %matrix;

R1=R(2:6,2:6); %R1 is a sub-matrix of R by picking the 2nd to %6th row and the 2nd to 6th column;

a=-inv(R1)*R(2:6,1); %R(2:6,1)=the first column and rows 2 to %6, a= a 5x1 column;

b2=R(1,:)*([1 a']'); %R(1,:)=a row vector of the 1st row of %R and all 6 columns of the row; b2=b(0)2

H=abs(b2./(fft([1 a'],512))); %with the appropriate commands we%plotted x(n), r(k) and %Sx(exp(j )_;

ftx=fft(x,512);

m=0:49;w=0:2*pi/512:2*pi-(2*pi/512);

subplot(2,2,1);stem(m,x(1,1:50),'k','filled');xlabel('n');

ylabel('x(n)');

subplot(2,2,2);plot(w,abs(ftx),'k');xlabel('n');ylabel...

('X(e^{j\omega})');

p=0:14;subplot(2,2,3);stem(p,rx1(1,1:15),'k','filled');

xlabel('Lags');ylabel('r_x(k)');

subplot(2,2,4);plot(w,H,'k');xlabel('\omega rad/unit');

ylabel('S_x(e^{j\omega})'); �

Figure 13.6.2 Illustration of Example 13.6.2.

4

2

0

–2

–4

x(n

)

0 20 40 60

n

0 2 4 6 8

120

100

80

60

40

20

0

X(e

jω)

n

r x(k

)

0 5 10 15

Lags

2.5

2

1.5

1

0.5

0

–0.50 2 4 6 8

ω rad/unit

Sx(e

jω)

2.5

2

1.5

1

0.5

0

Page 582: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

568 Signals and systems primer with MATLAB

13.7 Nonparametric spectra estimationThe spectra estimation problem in practice is based on the finite length record{x(1), …, x(N)} of a second-order stationary random process. However, har-monic processes have line spectra and appear in applications either aloneor combined with noise.

Periodogram

The periodogram spectral estimator is based on the following formula:

(13.44)

where is periodic with period is the DFT ofx(n). The periodicity is simply shown by introducing + 2 in place of in(13.44) and remembering that exp(j2 ) = 1.

Correlogram

The correlogram spectral estimator is based on the formula

(13.45)

where is the estimate of the biased autocorrelation (assumed meanvalue of {x(n)} zero} given by (13.11). It can be shown that the correlogramspectral estimator, evaluated using the standard biased autocorrelation esti-mates, coincides with the periodogram spectral estimator. As in (13.44), thecorrelogram is a periodic function of with period 2 .

Computation of Sp(ej ) and Sc(ej ) using FFT

Since both functions are continuous functions of , we can sample the fre-quency as follows:

(13.46)

This situation reduces (13.44) and (13.45) to finding the DFT at those fre-quencies:

ˆ ( ) ( ) ( )S eN

x n eN

X epj j n

n

Nj= =

=

1 1

0

12

2

ˆ ( )S epj 2 , , ( )and X ej

ˆ ( ) ˆ( )( )

S e r m ecj

m N

Nj m=

= 1

1

ˆ( )r m

k Nk k N= =2

0 1 2 1, , , ,�

Page 583: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 13: Random variables, sequences, and power spectra densities 569

(13.47)

and thus,

(13.48)

The most efficient way to find the DFT using fast Fourier transform (FFT)is to set N = 2r for some integer r. The following two Book MATLAB functionsgive the windowed periodogram and correlogram, respectively.

Book MATLAB function for windowed periodogram: [s,as,phs]=ssperiodogram(x,w,L)

%Book function:[s,as,phs]=ssperiodogram(x,w,L)

function[s,as,phs]=ssperiodogram(x,w,L)

%w=window(@name,length(x)),(name=hamming,kaiser,hann,rectwin,

%bartlett,tukeywin,blackman,gausswin,nattallwin,triang,black

%manharris);

%L=desired number of points (bins) of the spectrum;

%x=data in row form;s=complex form of the DFT;

xw=x.*w';

for m=1:L

n=1:length(x);

s(m)=sum(xw.*exp(-j*(m-1)*(2*pi/L)*n));

end;

as=((abs(s)).^2/length(x))/norm(w);

phs=(atan(imag(s)./real(s))/length(x))/norm(w);

wb=0:2*pi/L:2*pi-(2*pi/L);subplot(2,1,1);stem(wb,as,'k');

xlabel('Frequency bins, 2\pi/L');ylabel('Magnitude');

Book MATLAB function for windowed correlogram: [s,as,phs]=sscorrelogram(x,w,lg,L)

%Book MATLAB function:function[s,asc,psc]=sscorrelogram

%(x,w,lg,L);

function[s,as,ps]=sscorrelogram(x,w,lg,L)

%function[s]=aacorrelogram(x,w,lg,L);

X e x n e x n W Wj

n

Nj

Nnk nk

n

N

k( ) ( ) ( )= == =0

1 2

0

1

== e k Nj N2 0 1/

ˆ ( ) ( ) ; ˆ ( ) ˆ( )

S eN

X e S e rpj j

cj

m N

N

k k k= ==

1 2

1

11 2

( )m ej

Nkm

Page 584: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

570 Signals and systems primer with MATLAB

%x=data with mean zero;w=window(@name,length(2*lg)), see

%ssperiodogram

%function and below this function);L=desired number of spectral

%points;

%lg=lag number<<N;rc=symmetric autocorrelation function;

r=sssamplebiasedautoc(x,lg);

rc=[fliplr(r(1,2:lg)) r 0];

rcw=rc.*w';

for m=1:L

n=-lg+1:lg;

s(m)=sum(rcw.*exp(-j*(m-1)*(2*pi/L)*n));

end;

as=(abs(s).^2)/norm(w);%amplitude spectrum;

ps=(atan(imag(s))/real(s))/norm(w);%phase spectrum;

To plot, for example, as or ps, we can use the command plot(0:2*pi/L:2*pi-(2*pi/L),as).

General remarks on the periodogram

1. The variance of the periodogram does not tend to zero as N .This indicates that the periodogram is an inconsistent estimator; thatis, its distribution does not tend to cluster more closely around thetrue spectrum as N increases.

2. To reduce the variance, and thus produce a smoother spectral esti-mator, we must (a) average contiguous values of the periodogram or(b) average periodograms obtained from multiple data segments.

3. The effect of the side lobes of the windows on the estimated spectrumconsists of transferring power from strong bands to less strong bandsor bands with no power. This process is known as the leakage problem.

Blackman–Tukey (BT) method

Because the correlation function at its extreme lag values is not reliable dueto the small overlapping of the correlation process, it is recommended to uselag values of about 30 to 40% of the total length of the data. The Blackman–Tukey estimator is a windowed correlogram and is given by

(13.49)

where w(m) is the window with zero values for |m| > L – 1 and Theabove equation can also be written in the form

ˆ ( ) ( )ˆ( )( )

S e w m r m eBTj

m L

Lj m=

= 1

1

L N<< .

Page 585: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 13: Random variables, sequences, and power spectra densities 571

(13.50)

where we applied the discrete-time Fourier transform (DTFT) frequencyconvolution property (the DTFT of the multiplication of two functions isequal to the convolution of their Fourier transforms). Since windows havea dominant and relatively strong main lobe, the BT estimator correspondsto a “local” weighting average of the periodogram. Although the convolutionsmoothes the periodogram, it reduces resolution at the same time. It isexpected that the smaller the L, the larger the reduction in variance and thelower the resolution. It turns out that the resolution of this spectral estimatoris on the order of 1/L, whereas its variance is on the order of L/N.

For convenience, we again give some of the most common windowsbelow. For the Kaiser window, the parameter trades the main lobe widthfor the side lobe leakage; = 0 corresponds to a rectangular window and

> 0 produces a lower side lobe at the expense of a broader main lobe.

• Rectangle window

w(n) = 1 n = 0, 1, 2, …, L – 1

• Bartlett (triangle) window

• Hann window

• Hamming window

ˆ ( ) ( )ˆ( )

ˆ ( ) (

S e w m r m e

S e W e

BTj j m

m

cj

=

=

=

jjc

j jS e W e d) ˆ ( ) ( )( )= 12

w n

nL

n L

L nL

nL

L

( )

, , ,

, ,

== …

= + …

//

/

20 1 2

2 21 1

w nn

Ln L( ) . cos , , ,= = …0 5 1

20 1 1

w nL

n n L( ) . . cos , , ,= = …0 54 0 462

0 1 1

Page 586: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

572 Signals and systems primer with MATLAB

• Blackman window

• Kaiser window

Note: To use the window derived from MATLAB, we must write

w=window(@name,L);

name=the name of any of the following windows: bartlett, barthannwin, blackman, blackmanharris, bohmanwin, chebwin, gausswin, hanning, hann, kaiser, natullwin, hamming,rectwin, tukeywin, triang.

L=number window values

Bartlett method

Bartlett’s method reduces the fluctuation of the periodogram by splitting upthe available data of N observations into K = N/L subsections of L observationseach, and then averaging the spectral densities of all K periodograms (see Figure13.7.1). The MATLAB function below provides the Bartlett periodogram.

Book MATLAB function for Bartlett’s method: function[s,as,ps]=ssbartlettpsd(x,k,w,L)

%Book MATLAB function for Bartlett spectra estimation

function[s,as,ps]=ssbartlettpsd(x,k,w,L)

%x=data;k=number of sections; w=window(@name,floor(length

%(x)/k));

w nL

nL

( ) . . cos . cos= + +0 42 0 52

20 08

222

21 2 1

Ln

Ln L= …, , ,

w n

In

L

IL( )

.

( )( )=

0

2

0

1 02

1/

nn L

I x

x

k

k

k

==

1

20

0

2

( )!

== zero-order modified Bessel function

w k( ) = 0 for L, k w k w k=( ) ( ) and equations are vallid for 0 1k L

Page 587: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 13: Random variables, sequences, and power spectra densities 573

%L=number of points desired in the FT domain;

%K=number of points in each section;

K=floor(length(x)/k);

s=0;

ns=1;

for m=1:k

s=s+ssperiodogram(x(ns:ns+K-1),w,L);

ns=ns+K;

end;

as=abs(s)/k;

ps=atan(imag(s)./real(s))/k;

Welch method

Welch proposed the following modifications to the Bartlett method: datasegments are allowed to overlap, and each segment is windowed prior tocomputing the periodogram. Since, in most practical applications, only asingle realization is available, we create smaller sections as follows:

(13.51)

where w(n) is the window of length M, D is an offset distance, and K is thenumber of sections that the sequence {x(n)} is divided into. Pictorially, theWelch method is shown in Figure 13.7.2.

Figure 13.7.1 Bartlett method of spectra estimation.

….

Periodogram 1

Periodogram 2

Periodogram K

0 L – 1 2L – 1 N – 1

+

+...

=

Total/K Averaging

PSD Estimate

x n x iD n w n n M i Ki( ) ( ) ( ) ,= + 0 1 0 1

Page 588: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

574 Signals and systems primer with MATLAB

The ith periodogram is given by

(13.52)

and the average periodogram is given by

(13.53)

If D = L, then the segments do not overlap and the result is equivalent tothe Bartlett method, with the exception of the data being windowed.

Book MATLAB function for the Welch method: function[s,as,ps,K]=sswelch(x,w,D,L)

function[s,as,ps,K]=sswelch(x,w,D,L)

%function[as,ps,s,K]=sswelch(x,w,D,L);

%M=length(w)=section length;

%L=number of samples desired in the frequency domain;

%w=window(@name,length of each segment=length(w));x=data;

Figure 13.7.2 Welch method of spectra estimation.

DataSegment 1

Segment 2

Segment K

Periodogram 1

Periodogram 2

Periodogram K

Total/K

0 N – 1

+

+..

=

PSD Estimate

Averaging

L – 1

D

S eL

x eij

ij n

n

L

( ) ( )==

1

0

12

S eK

S eji

j

i

K

( ) ( )==

1

0

1

Page 589: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 13: Random variables, sequences, and power spectra densities 575

%D=offset distance=fraction of length(w), mostly 50% of M;

%M<<N=length(x);

N=length(x);

M=length(w);

K=floor((N-M+D)/D);%K=number of processings;

s=0;

for i=1:K

s=s+ssperiodogram(x(1,(i-1)*D+1:(i-1)*D+M),w,L);

end;

as=abs(s)/(M*K);%as=amplitude spectral density;

ps=atan(imag(s)./real(s))/(M*K);%ps=phase spectral density;

The MATLAB function is given as follows:P=spectrum(x,m)%x=data; m=number of points of each section

%and must be a power of 2;the sections are %windowed by

%a hanning window;P is a (m/2)x2 matrix whose %first column is the

%power spectral density and the second is the %95% confidence interval;

Modified Welch method

It is evident from Figure 13.7.2 that if the lengths of the sections are not longenough, frequencies close together cannot be differentiated. Therefore, wepropose a procedure, defined as symmetric method, and its implementationis shown in Figure 13.7.3. Windowing of the segments can also be incorpo-rated. This approach and the rest of the proposed schemes have the advan-tage of progressively incorporating longer and longer segments of the data,thus introducing better and better resolution. In addition, due to the aver-aging process, the variance decreases and smoother periodograms areobtained. Figure 3.7.4 shows another proposed method, which is defined asthe asymmetric method. Figure 3.7.5 shows a suggested approach for betterresolution and reduced variance. The procedure is based on the method ofprediction and averaging and is defined as the symmetric predictionmethod. This procedure can be used in all the other forms, e.g., nonsym-metric. The above methods can also be used for spectral estimation if wesubstitute the word periodogram with the word correlogram.

Figure 13.7.6 shows data given by the equation

(13.54)

and 128 time units. Figure 13.7.6b shows the Welch method using theMATLAB function (P=spectrum(x,64)). Figure 13.7.6c shows the proposed

x n n n randn( ) sin( . ) sin( . ) ( , )= + +0 4 0 422 1 128

Page 590: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

576 Signals and systems primer with MATLAB

modified Welch method. We observe that we are able to differentiate a 0.022radian difference in the spectrum. However, as expected, the variance wassomewhat larger.

Figure 13.7.3 Modified symmetric Welch method.

Figure 13.7.4 Modified asymmetric Welch method.

DataSegment 1Segment 2

.

.

.Segment K

Periodogram 1

+Periodogram 2

+..

Periodogram K

=

Total/K

0 N – 1

Averaging

PSD Estimate

Data

Segment 1

Segment 2

.

.

.

Segment K

Periodogram 1

+

Periodogram 2

+..

Periodogram K

=

Total/K

0 N – 1

Averaging

PSD Estimate

Page 591: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 13: Random variables, sequences, and power spectra densities 577

The Blackman–Tukey periodogram with the Bartlett window

The PSD based on the Blackman–Tukey method is given by

(13.55)

Book MATLAB function for the Blackman–Tukey periodogramwith triangle window

functon[s]=ssblackmantukeypsd(x,lg,L)

%function[s]=ssblackmantukeypsd(x,lg,L);

%the window used is the triangle (Bartlett) window;

%x=data;lg=lag number about 20-40% of length(x)=N;

%L=desired number of spectral points (bins);

[r]=sssamplebiasedautoc(x,lg);

n=-(lg-1):1:(lg-1);

w=1-(abs(n)/lg);

Figure 13.7.5 Modified with prediction Welch method.

Data

Segment 1

Segment 2

.

.

.

Segment K

Periodogram 1+

Periodogram 2

+..

Periodogram K

=

Total/K

PSD Estimate

Averaging

0 N – 1

Predicted Predicted

Predicted Predicted

ˆ ( ) ( )ˆ( )

( ),

S e w m r m e

w m

m

Lm

BTj j m

m L

L

=

== ±

=

1 0 11 2

0

, , ,± � L

otherwise

Page 592: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

578 Signals and systems primer with MATLAB

rc=[fliplr(r(1,2:lg)) r];

rcw=rc.*w;

s=fft(rcw,L);

Another approach to spectra estimation is the parametric method, whichwill not be developed in this text.

Important definitions and concepts

1. Discrete random signals2. Probability density function3. Cumulative density function4. Multivariate distribution5. Realization of random variables6. Event7. Stationary process

Figure 13.7.6 Comparison between the Welch method (b) and the proposed modifiedWelch method. (a) is the original random signal.

5

0

–5

x(n

)

0 20 40 60 80 100 120 140n

(a)

30

20

10

00 0.5 1 1.5 2 2.5 3 3.5

PS

D

rad/unit

(b)

PS

D

0 1 2 3 4 5 6 7rad/unit

0.8

0.6

0.4

0.2

0

(c)

Page 593: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 13: Random variables, sequences, and power spectra densities 579

8. Ergotic process9. Sample mean value

10. Sample variance11. Mean value or expectation12. Frequency interpretation of statistical characteristics13. The time-average formula14. Unbiased estimator15. Correlation and cross-correlation16. Autocorrelation17. Variance and covariance18. Independent rv’s19. Stationary, wide-sense stationary, and strict-sense stationary processes20. Independent and orthogonal rv’s21. Autocorrelation matrix22. Toeplitz matrix23. White noise24. Random walk25. White Gaussian noise26. Lognormal distribution27. Chi-square distribution28. Wiener–Kintchin relations29. Power spectrum30. Filtering of random processes31. Spectral factorization32. Nonparametric spectral estimation33. Periodogram34. Correlogram35. Blackman–Tukey method36. Bartlett method37. Welch method38. Modified Welch method

Chapter 13 ProblemsSection 13.2

1. To add the rows of a matrix A we write sum(A,1). Produce fourrealizations using the script m-file (realizations) and produce the y1 =sum(x, 1)/4. Next, produce 1000 realizations (the script file mustbe modified) and then obtain the sum y2 = sum(x, 1)/1000.Explain any difference you observe between the y1 and y2 time series.

2. Find the sample mean of the first and third realizations shown inFigure 13.1.1. State your observation.

3. Modify the ssmeanautocorensemble m-file by substituting the linex=rand(M,N); with the line x=rand(M,N)-0.5; rand is a

Page 594: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

580 Signals and systems primer with MATLAB

MATLAB file producing uniform iid random samples. State yourobservation by changing the number of realizations.

4. Verify (13.12).

Section 13.3

1. Prove the basic properties of a wide-sense stationary (WSS) process(see (13.18)).

2. Modify the noise vector v in the m-file ex_13_2_1 as follows:v=0.1*randn(1,40). State your observation between Figure 13.3.1and your result of the FT of rx. Also, using vector rx, create a corre-lation matrix Rx having dimensions 2 × 2, 5 × 5, and 19 × 10.

3. If the sequence {x(n)} is characterized by iid random variables, findthe mean and variance of the signal y(n) = ax(n) + b, where a and bare constants.

4. The covariance function of WN (white noise) is given by (13.20).Using the MATLAB function rand, create a sample random sequencex=0.2*rand(1,20)+0.2 and find its sample covariance cx(k).

5. Create a random walk of 200 steps and plot y(n).6. Find the mean, E{y(n)}, and the cov(y(n) – my,y(n) – my) of the random

walk process y(n) (see (13.21)).

Section 13.4

1. Create the following vectors: x1 = randn(1, 50), x2 = randn(1,500), and x3 = randn(1, 10,000). Next, plot different histogramsfor each sequence and observe their shapes. State your observations.

2. Using (13.26), fit the analytical Gaussian rv x to those produced inProblem 13.4.1.

3. Create a pdf f(x(1), x(2)) = f(x(1))f(x(2)), each one having zero meanand the same variance. Next, create a histogram and superimposethe analytical function given by (13.27).

4. Produce a simulated lognormal sequence and superimpose on itshistogram its analytic representation given by (13.28).

Section 13.5

1. Repeat Example 13.5.1, but increase the noise by 1.5. That is, substi-tute v=randn(1,64) with v=1.5*rand(1,64). State your obser-vation and conclusions.

2. Repeat Problem 13.5.1, but this time increase the length of the signalto 512. That is, substitute any number 64 in m-file Ex_15_3_1 with512. State your observations and conclusions.

Page 595: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 13: Random variables, sequences, and power spectra densities 581

Section 13.6

1. Repeat Example 13.6.1 with a third-order FIR filter.2. Repeat Example 13.6.1 with a third-order high-pass FIR filter.3. Create a 3 × 3 similar to matrix (13.43). Solve the lower 2 × 2 matrix

to find the ai’s. Next, substitute them in the first row to find .Finally, find the AR spectrum density .

Section 13.7

1. Use the Book MATLAB functions for the periodogram and correlo-gram and study the following:a. x(n) = cos(0.2 × 2 n) + v(n) 0 n 31, v(n) is noise.b. x(n) = cos(0.2 × 2 n) + v(n) 0 n 255, v(n) is same noise as in a.c. x(n) = cos(0.2 × 2 n) + cos(0.25 × 2 n) + v(n) 0 n 31, v(n) is

noise.d. x(n) = cos(0.2 × 2 n) + cos(0.25 × 2 n) + v(n) 0 n 255, v(n)

same noise as in c).e. Repeat a) to d) above with increased (double) variance of the

noise.2. Compare the Blackman–Tukey method with that of Bartlett by re-

peating Problem 13.7.1.3. Using the signal x(n) = sin(0.4 × 2 n) + sin(0.405 × 2 n) + randn(1,N),

do the following:a. Increase the length to N = 64, N = 128, and N = 512, and in each

case compare the Welch method with the modified Welch method.b. Do the same, but now use 0.1*randn(1,N).

vb2 20( )S ej( )

Page 596: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

583

*chapter 14

Least square system design, Wiener filter, and the LMS filter

In this chapter we shall develop three basic and important principles usedextensively in signal processing, communications, system identification,denoising signals, etc. The least squares principle, proposed first by Gausswhen he was 18 years old, is widely applicable to the design of digital signalprocessing systems. We will first describe the use of the least square approachto modeling, interference canceling, as well as the cases involving prediction.Next, we will study the celebrated Wiener filter, which was developed duringthe Second World War, and finally, we will study another widely used filterknown as the least mean squares (LMS) filter.

14.1 The least-squares techniqueThe principle of least squares will be used in this text for signals of onevariable, although the concept applies equally well for signals with morethan one variable. Furthermore, we shall study discrete signals, which canalways be derived from continuous signals if the sampling frequency issufficiently high enough so that aliasing does not take place.

Let us, for example, have a discrete signal that is represented in its vectorform as follows: . We would next like to approximatethe function with a polynomial of the form

(14.1)

Since the approximating polynomial is a linear function of the unknown ci’s,we are dealing with linear least squares approximation. The differencebetween the exact and approximate function is the error. We can define acost function J, which is equal to the sum of the difference of errors squared,the total square error. Hence, we write

x x x x N= [ ( ) ( ) ( )]1 2 �

ˆ( ) ( ) ( ) ( )x nT c c nT c nT c nT TMM= + + + + =1 2 3

2 1� sampliing time

Page 597: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

584 Signals and systems primer with MATLAB

(14.2)

Our next step is to minimize this error. To see how the above equationworks, let us have the discrete function plotted in Figure 14.1.1 as black dots.It is required to find a straight line that minimizes the mean square error,the cost function. To do so, we assume an approximate function of the formx = a + b(nT) T = 1, where a and b are unknown and must be determinedbased on the given data. Hence, we must minimize the cost function

Next, we take the partial derivatives of J with respect to a and b and equatethese derivatives equal to zero. Using the fundamental property of differen-tiation, the derivative of J with respect to the unknown a is

Figure 14.1.1 Least squares approximation of sampled data T = 1.

0

25

20

15

10

5

0

–52

x(n

) =

5 +

0.5

n +

ran

dn

(1, 2

0),

bla

ck d

ots

4 6 8 10

ax = 5.4716 + 0.4877n

n

12 14 16 18 20

J x n x nn

N

==

[ ( ) ˆ( )]2

1

J x n a bnn

==

( ( ) )2

1

20

= = += = =

Ja

x n a bn a b nn n n

2 0 11

20

1

20

1

2

( ( ) ) or00

1

20

2020 20 1

2211

=

+ + =

=

x n

a b

n

( )

( ).or 88391 20 210 211 8391or a b+ = .

Page 598: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 14: Least square system design, Wiener filter, and the LMS filter 585

Similarly, the derivative of J with respect to the unknown b is

or

or

With the help of MATLAB we found the following expressions:

However, we could also use MATLAB for the other two summations, butinstead, we used Appendix A at the end of the book. The final value is foundwith the help of MATLAB. However, we could have done this manuallysince the inverse of a 2 × 2 matrix is easy to perform. The final value is thenfound as follows:

Introducing the values a and b found above in the equation of a straightline, we obtained the approximation to the exact line whose constant valuesare a = 5 and b = 0.5. The straight line indicated by x’s, which is very closeto the exact one, is the mean squares approximation to the data. The straightline found above gives the smallest sum of the squared errors from any otherline that we may try to create. The error is the distance from the line to ascattered point along the same time. For example, at n = 4 the error isapproximately equal to 8.

Example 14.1.1: Find the least squares approximation to the data shownin Figure 14.1.2 as black dots and superimpose on them the least squareserror line.

= = += = =

Jb

x n a bn n a n b nn n n

2 01

20

1

202( ( ) ) or

11

20

1

20

==

nx nn

( )

a b nn

20 20 12

20 20 1 40 16

1

20( ) ( )( )+ + + + =

=

xx n( )

210 2870 2548 6a b+ = .

x n sum xn

( ) ( )==1

20

nx n sum x nn=

=1

20

( ) ( * )

a

b=

20 210

210 2870

211 8391

25

1.

448 6

5 4716

0 4877.

.

.=

Page 599: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

586 Signals and systems primer with MATLAB

Solution: In Figure 14.1.1, it was obvious that the points have a lineartrend, and as a consequence, we used a straight line. Here, however, weobserve some nonlinear trend, and therefore, we will use a higher-orderpolynomial. We again assume sampling time T = 1. As previously, the costfunction is

The partial derivatives with respect to ci’s are:

Figure 14.1.2 Least squares approximation for nonlinear data.

0

4

3

2

1

0

–2

–1

2

x(n) 2 sin(0.05π n)

+ randn(1, 20)

2 sin(0.05π n) ax = c1 + c2n + c3n2

4 6 8 10

n

12 14 16 18 20

J x n x n x n c c n cn n

= == =

[ ( ) ˆ( )] ( ( )1

202

1 2

1

20

3nn2 2)

= ==

Jc

x n c c n c nn1

1 2 32

1

20

2 0( ( ) )

or x n c c n c nn n n n

( )= = = =

1

1

20

1

20

2

1

20

32

1

2

100

21 2 3

2

1

20

0

2 0

=

= ==

Jc

x n c c n c n nn

( ( ) )

or x n n c n c n cn n n

( )= = =

1

1

20

1

20

22

1

20

333

1

20

0nn=

=

Page 600: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 14: Least square system design, Wiener filter, and the LMS filter 587

Using the MATLAB help, we obtain the following system:

The values of the unknown ci’s are found by using the expression

Therefore, the estimate curve is given by: x(n) = –0.6580 + 0.5970n –0.0285n2. Observe that although we used a sine function to create the scatteredpoints, the estimate curve that gives the least squares error is different. �

Linear least squares

We proceed to generalize the linear least squares technique by a set of knownfunctions h(n) and write

(14.3)

where the underline indicates a vector for small letters and matrices forcapital letters. The exponent T means the transpose of a vector or matrix (seeAppendix 1.1 of Chapter 1). We shall assume in this text that N > M andfull-rank M for H so that solutions exist.

= ==

Jc

x n c c n c n nn3

1 2 32 2

1

20

2 0( ( ) )

or x n n c n c n c nn n n

( ) 21

1

202

1

20

23

1

20

3

= = =

44

1

20

0n=

=

20 210 2870 30 4297

210 2870 44100

1 2 3

1 2

c c c

c c

+ + =

+ +

.

cc

c c c

3

1 2 3

318 5917

2870 44100 687190 3847 1

=

+ + =

.

.

c

c

c

1

2

3

20 210 2870

210 2870 44100

287

=

00 44100 722666

30 4297

318 5917

3

1.

.

8847 1

0 6580

0 5970

0 0285.

.

.

.

=

J c x n x n x n c h nn

NT

n

N

( ) [ ( ) ˆ( )] [ ( ) ( )= == =0

12

0

112

1 1

0

12= + =

=

]

[ ( ) ( ( ) , ( ))] (x n c h n c h n xM M

n

N

� Hc x HcT) ( )

Page 601: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

588 Signals and systems primer with MATLAB

Let us verify (14.3) by accepting a two-term expansion. Hence, we write

The last expression of (14.3) for the above conditions is

The last two expressions are identical. The reader should observe that thefollowing matrix relationship was used:

(14.4)

where the exponent T stands for transpose of a matrix.To find the unknown ci’s, we differentiate the cost function of (14.3) with

respect to each ci and then set the developed equations equal to zero. There-fore, we have a system with ci’s, of which the unknowns are determined bysolving the system. The following example will elucidate the procedure.

Example 14.1.2: Let a signal be a constant, s(n) = A, and let the receivedsignal be given by . Find A.

Solution: According to the least squares approach, we can estimate 5 byminimizing the cost function. Taking the derivative of J with respect to Aand setting the result equal to zero, we obtain

J x n c h n c h n

x c h

n

=

=

=

( ( ) ( ) ( ))

( ( ) (

1 1 2 22

0

1

1 10 0)) ( )) ( ( ) ( ) ( ))+c h x c h c h2 22

1 1 2 220 1 1 1

Jx

x

h h

h h=

( )

( )

( ) ( )

( ) ( )

0

1

0 0

1 1

1 2

1 2

c

c

x

x

T

1

2

0

1

( )

( )

hh h

h h

c

c

1 2

1 2

1

2

0 0

1 1

( ) ( )

( ) ( )

= x x c ch h

h( ) ( )

( ) ( )

(0 1

0 1

01 2

1 1

2 )) ( )

( ) ( ) ( )

h

x h c h c

2

1 1 2 2

1

0 0 0

xx h c h c

x c h

( ) ( ) ( )

[ ( ) ( )

1 1 1

0 0

1 1 2 2

1 1= c h x c h c hx h c

2 2 1 1 2 2

1 10 1 1 1

0 0( ) ( ) ( ) ( )]

( ) ( ) hh c

x h c h c

2 2

1 1 2 2

0

1 1 1

( )

( ) ( ) ( )

( ) ( )x H c x c HT T T T=

x n randn( ) ( , )= +5 1 10

J A A x nJ A

AA x n

n

N

n

( ) [ ( )] ;( )

[ ( )]= == =0

12

0

2 2NN

n

N

n

N

n

A x n AN

x n= = =

=

= =

1

0

1

0

1

0

0

11

or

or( ) ( )NN 1

Page 602: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 14: Least square system design, Wiener filter, and the LMS filter 589

Using MATLAB help we obtain = sum(x)/10 = 5.1022. The J(A) mini-mum is given by

and for the present case

= 5.6484

Example 14.1.3: Find the amplitude constants of the signal

if the received signal is and their exact values areA = 0.2 and B = 5.2.

Solution: For this case, and for n = 0, 1, 2, and 3 and N = 4, we obtain

If we differentiate first J(A, B) with respect to A, and next with respectto B, and then equate the results to zero, we obtain

(14.5)

With MATLAB help, the approximate values areThe exact values are . Further, using the above two sets ofvalues we obtain and s = [0 4.8171 3.0565–2.0771], respectively. The moment we define the vector n, we find the vectorsx, h1, and h2. The values of A and B are found from the column vector ab,which is given by the MATLAB expression

ab=inv([sum(h1.^2) sum(h1.*h2);sum(h1.*h2) sum(h2.^2)])*...[sum(x.*h1);sum(x.*h2)] �

A

J x n An

N

min ( ( ) ˆ )==

2

0

1

J x nn

min ( ( ) . )==

5 1022 2

1

10

s n A n B n n N( ) sin . sin . , , ,= + =0 1 0 4 0 1 1�

x n s n randn N( ) ( ) ( , )= + 1

J A B x n h n A h n B

h

n

( , ) ( ( ) ( ) ( ) )==

1 22

0

3

11 20 1 0 4( ) sin( . ) ( ) sin( . )n n h n n= =

A

B

h n h n h n

h n h

n n=

= =12

0

3

1 2

0

3

1

( ) ( ) ( )

( ) 22

0

3

22

0

3

1

( ) ( )

( )

n h n

x n

n n= =

hh n

x n h n

n

n

1

0

3

2

0

3

( )

( ) ( )

=

=

ˆ . ˆ . .A B= =0 4934 5 0037A B= =0 2 5 2. .

ˆ [ . . . ]s = 0 4 9113 3 2311 2 5419

Page 603: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

590 Signals and systems primer with MATLAB

14.2 The mean square errorIn this chapter we develop a class of linear optimum discrete-time filtersknown as the Wiener filters. These filters are optimum in the sense ofminimizing an appropriate function of the error, known as the cost function.The cost function that is commonly used in filter design optimization is themean square error (MSE). Minimizing MSE involves only second-orderstatistics (correlations) and leads to a theory of linear filtering that is usefulin many practical applications. This approach is common to all optimumfilter designs. Figure 14.2.1 shows the block diagram presentation of theoptimum filter problem.

The basic idea is to recover a desired signal d(n) given a noisy observationx(n) = d(n) + v(n), where both d(n) and v(n) are assumed to be wide-sensestationary (WSS) processes. Therefore, the problem can be stated as follows:

Design a filter that produces an estimate d(n) using a linear combina-tion of the data x(n) such that the mean square error (MSE) function(cost function J)

(14.6)

is minimized.

Depending on how the data x(n) and the desired signal d(n) are related,there are four basic problems that need solved: filtering, smoothing, predic-tion, and deconvolution.

Observe that in (14.6) the least squares formula appears again, but withthe difference that we take the expectation (ensemble average) value of thesquare value of the error. To proceed with our development and create usefulformulas, we will initially assume that we are able to repeat the experiments,produce the probability density function (pdf), and then find the meansquare error using the formula (see also Chapter 13)

However, when we find the final formulas, we will proceed to define thesignals as ergotic and then find their means and variances using the approx-imate formulas developed in Chapter 13 (see (13.7) and (13.11)).

Figure 14.2.1 Block diagram representation of the optimum filtering problem.

J E d n d n E e n= ={[ ( ) ˆ( )] } { ( )}2 2

E e n e n f e n de n{ ( )} ( ) ( ( )) ( )2 2=

w(n), W(z) +x(n)

d(n)

ˆ ˆd(n)

–+d(n)

v(n)

e(n) = d(n) − d(n)

Page 604: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 14: Least square system design, Wiener filter, and the LMS filter 591

The Wiener filter

Let the sample response (filter coefficients) of the desired filter be denotedby w. In this chapter we will use wi’s for filter coefficients since it is customaryto use this symbol in books involving adaptive and optimum filtering ofrandom signals. This filter will process the real-valued stationary process{x(n)} to produce an estimate of the desired real-valued signal d(n).Without loss of generality, we will assume, unless otherwise stated, that theprocesses {x(n)}, {d(n)}, etc., have zero mean values. Furthermore, assumingthat the filter coefficients do not change with time, the output of the filter isequal to the convolution of the input and the filter coefficients. Hence, weobtain

(14.7)

where M is the number of filter coefficients and

(14.8)

In this chapter we will develop filtering problems using only finiteimpulse response (FIR) filters. This is due to the main property that FIRfilters are stable.

The mean square error (see (14.6)) of the filtering problem is

(14.9)

where

(14.10)

ˆ( )d n

ˆ( ) ( ) ( ) ( )d n w x n w x n m nn m

m

MT= = =

=0

1

w x

w x= = +[ ] , ( ) [ ( ) ( ) ( )]w w w n x n x n x n MMT T

0 2 1 1 1� �

J E e n E d n n

E

T( ) { ( )} {[ ( ) ( )] }

{

w w x= = =

=

constant 2 2

[[ ( ) ( )][ ( ) ( )] }

{[ ( ) (

d n n d n n

E d n n

T T T

T=

w x w x

w x ))][ ( ) ( ) ]}

{ ( ) ( ) ( ) ( )

d n n

E d n n d n d n

T

T T=

x w

w x x2 (( ) ( ) ( ) }

{ ( )} { ( ) ( )}

n n n

E d n E d n n

T T

T

w w x x w

w x

+

= 2 2 ++

= +

w x x w

w p w R w

T T

dT

dxT

x

E n n{ ( ) ( )}

2 2

w x x w =T T

d

n n( ) ( )=

=

number

variance of the des2 iired signal, d n

p p p Mdx dx dx dx

( )

[ ( ) ( ) (p = 0 1 1� ))]

( ) ( ),

T

dx dxp r

= cross-correlation vector

0 0� pp r p M r Mdx dx dx dx( ) ( ), , ( ) ( )1 1 1 1� � �

Page 605: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

592 Signals and systems primer with MATLAB

The above matrix is the correlation matrix of the input data to the filter,and it is symmetric because the random process is assumed to be stationary,and hence we have the equality rx(k) = rx(–k). Since in practical cases we haveonly one realization, we will assume that the signal is ergodic. Therefore,we will use the sample biased autocorrelation coefficients given in (13.11).

Example 14.2.1: Let us assume that we have found the sample autocor-relation coefficients (rx(0) = 1.0, rx(1) = 0) from given data x(n), which, inaddition to noise, contain the desired signal. Furthermore, let the varianceof the desired signal d

2 = 24.40 and the cross-correlation vector be pdx =[2 4.5]T. It is desired to find the surface defined by the mean square functionJ(w).

Solution: Introducing the values given above in (14.9), we obtain

(14.12)

Note that the equation is quadratic with respect to filter coefficients, andit is true for any number of filter coefficients. This is because we used themean square error approach for the minimization of the error. Figure 14.2.2

R x E

x n

x n

x n M

x=

+

{

( )

( )

( )

[ (1

1

�nn x n x n M

E x n x n E x n x n

) ( ) ( )]}

{ ( ) ( )} { ( ) (

+

=

1 1

1

))} { ( ) ( )}

{ ( ) ( )} { ( ) (

� E x n x n M

E x n x n E x n x n

+ 1

1 1 +

+

1 1 1

1

)} { ( ) ( )}

{ ( ) ( )} {

� �

E x n x n M

E x n M x n E x(( ) ( )} ( ( ) ( )}n M x n E x n M x n M+ + +1 1 1 1�

=

r r r M

r r r

x x x

x x x

( ) ( ) ( )

( ) ( ) (

0 1 1

1 0

� MM

r M r M rx x x+ +

2

1 2 0

)

( ) ( ) ( )

� �

(14.11)

J w w w w( ) . [ ].

[ ]w = +24 40 22

4 5

1 0

0 10 1 0 1

= + +

w

w

w w w w

0

1

0 1 02

1224 40 4 9.

Page 606: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 14: Least square system design, Wiener filter, and the LMS filter 593

shows the schematic representation of the Wiener filter. The data x(n) arethe sum of the desired signal and noise. From the data we find the correlationmatrix and the cross-correlation between the desired signal and the data.

Note: To find the optimum Wiener filter coefficients, the desired signal is needed.

Figure 14.2.3 shows the mean square error surface. This surface is foundby inserting different values of w0 and w1 in the function J(w) and plottingits magnitude. The values of the coefficients that correspond to the bottomof the surface are the optimum Wiener coefficients. The vertical distancefrom the w0 – w1 plane to the bottom of the surface is known as the minimumerror, Jmin, and corresponds to the optimum Wiener coefficients. We observethat the minimum height of the surface corresponds to about w0 = 2 andw1 = 4.5, which are the optimum coefficients (we will learn how to find themin the next section). Figure 14.2.4 shows an adaptive FIR filter. The followingBook MALAB m-file produces Figure 14.2.3.

Figure 14.2.2 Block diagram representation of the Wiener filter.

Figure 14.2.3 The mean square error surface.

Filter, w

d(n)

v(n)

x(n) y(n)

d(n)

e(n) + +

100

80

60

40

J(w

)

w1

w0

20

0 10

10 8

8 6 6 4

4 2 2 0

0 –2 –2

Page 607: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

594 Signals and systems primer with MATLAB

Book MATLAB m-file: ex_14_2_1

%Book m-file:ex_14_2_1

x=-2:0.4:10;y=-2:0.4:10;

[w0,w1]=meshgrid(x,y);%MATLAB function;

J=24.40-4*w0-9*w1+w0.^2+w1.^2;

meshc(w0,w1,J);grid on;xlabel('w_0'),ylabel('w_1'),zlabel('J');

title('Mean-square error surface');

colormap([0 0 0]);%changes the color grading to black color;�

The Wiener solution

From the mean square error surface, Figure 14.2.3, we observe that thereexists a plane touching the parabolic surface at its minimum point andparallel to the w-plane. Furthermore, we observe that the surface is concaveupwards, and therefore the first derivative of the MSE with respect to w0

and w1 must be zero at the minimum point and the second derivative mustbe positive. Hence, we write

(14.13)

For a two-coefficient filter, (14.9) becomes

(14.14)

Figure 14.2.4 Schematic representation of an adaptive FIR filter.

+ +

+ …

+

+

+

+ +

Adjusting

weights

algorithm

x(n)

_

x(n – 1) x(n – M + 2) x(n – M + 1)

d(n)

e(n)

z −1 z −1 z −1

d(n)ˆ

w0 w1wM − 2 wM − 1

M

= =J w ww

J w ww

w ww

( , ) ( )

( , )

,0 1

0

0 1

1

20 1

20

0 0 a)

>> >0 02

0 12

1

J w ww

( , )( )

b)

J w w w r w w r w r w rx x x d( , ) ( ) ( ) ( )0 1 02

0 1 12

00 2 1 0 2= + + xx dx dw r( ) ( )0 2 112+

Page 608: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 14: Least square system design, Wiener filter, and the LMS filter 595

Introducing (14.14) in part a of (14.13) produces the following set ofequations:

(14.15)

The above system can be written in the following matrix form, called theWiener–Hopf equation:

(14.16)

where the superscript o indicates the optimum Wiener solution for the filter.Note that to find the correlation matrix Rx, we must know the second-orderstatistics (autocorrelation of the data x(n)). If, in addition, the matrix isinvertible, the optimum filter is given by

(14.17)

For an M-order filter, Rx is an M × M matrix, wo is an M × 1 vector, and p isan M × 1 vector.

If we differentiate J(w) with respect to twice, we find that itis equal to 2rx(0). But rx(0) = E{x(m) x(m)} = > 0, and hence the surface isconcave upwards. Therefore, the extreme is the minimum point of the sur-face. If we next introduce (14.17) in (14.9), we obtain the minimum meansquare error (MMSE):

(14.18)

which indicates that the minimum point of the error surface is at a distanceJmin above the w-plane. The above equation shows that if no correlation existsbetween the desired signal and the data, the error is equal to the varianceof the desired signal.

The problem we face is how to choose the length of the filter M. In theabsence of a priori information, we compute the optimum coefficients, start-ing from a small reasonable number. As we increase the number, we checkthe MMSE, and if its value is small enough, e.g., MMSE < 0.01, we acceptthe corresponding number of the coefficients.

Example 14.2.2: We would like to find the optimum filter coefficients w0

and w1 of the Wiener filter, which approximates (models) the unknownsystem with coefficients b0 = 1 and b1 = 0.38 (see Figure 14.2.5).

2 0 2 1 2 0 0

2 0 2

0 1

1

w r w r r

w r w

ox

ox dx

ox

( ) ( ) ( )

( )

+ =

+

a)

00 1 2 1 0ox dxr r( ) ( ) = b)

R w = pxo

dx

w = R p-ox dx1

w wo o0 1and

x2

J d xdT o

d dxT

x xdmin = 2 2 1p w = p R p

Page 609: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

596 Signals and systems primer with MATLAB

Solution: The Book MATLAB program given below was used for theidentification of the unknown system.

Book MATLAB m-file: ex_14_2_2

%Book m-file:ex_14_2_2

%example14_2_2 m-file;

v=0.5*(rand(1,20)-0.5);%v=noise vector(20 uniformly distributed %rv’s with mean zero);

x=randn(1,20);%x=data vector entering the system and the %Wiener filter (20 normal

%distributed rv’s with mean zero;

sysout=filter([1.00 0.38],1,x);%sysout=system output with x %as input; filter(b,a,x) is a

%MATLAB function, where b is the vector of the %coefficients of the ARMA numerator,

%a is the vector of the coefficients of the ARMA %denominator;

dn=sysout+v;

rx=sssamplebiasedautoc(x,2);%book MATLAB function with lag=2;

Rx=toeplitz(rx);%toeplitz() is a MATLAB function that gives %the symmetric

%autocorrelation matrix;

pdx=xcorr(x,dn,'biased');%xcorr() is a MATLAB function that %gives a symmetric

%biased crosscorrelation;

p=pdx(1,19:20);

w=inv(Rx)*p';

dnc=sssamplebiasedautoc(dn,1);%gives the variance of dn;

jmin=dnc-p*w;

Figure 14.2.5 Illustration of Example 14.2.2.

1 + 0.38z–1

w0 + w1z–1

+ +

x(n)

v(n)

d(n) e(n)

Adjusting

weights

algorithm

Page 610: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 14: Least square system design, Wiener filter, and the LMS filter 597

Some typical values found are Rx = [0.9979 0.1503;0.1503 0.9979], p = [0.51961.0674], w = [1.0142 0.3680], and Jmin = 0.0179. �

Orthogonality condition

In order for the set of filter coefficients to minimize the cost function J(w),it is necessary and sufficient that the derivatives of J(w) with respect to wk

be equal to zero for k = 0, 1, 2, …, M – 1,

(14.19)

But

(14.20)

And hence it follows that

(14.21)

Therefore, (14.19) becomes

(14.22)

where the superscript o denotes that the corresponding wk’s used to find theestimation error eo(n) are optimal. Figure 14.2.6 illustrates the orthogonalityprinciple where the error eo(n) is orthogonal (perpendicular) to the data set{x(n)} when the estimator employs the optimum set of filter coefficients.

14.3 Wiener filtering examplesThis section illustrates the use of Wiener filtering in different engineeringapplications.

Example 14.3.1: Filtering: Filtering of noisy signals (noise reduction) isextremely important, and the method has been used in many applications,such as speech in a noisy environment, reception of data across a noisychannel, enhancement of images, etc.

= = =Jw w

E e n e n E e ne nwk k k

{ ( ) ( )} ( )( )

2 00

e n d n w x n mm

m

M

( ) ( ) ( )==0

1

=e nw

x n kk

( )( )

E e n x n k k Mo{ ( ) ( )} , , , ,= = …0 0 1 2 1

Page 611: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

598 Signals and systems primer with MATLAB

Let the received signal be x(n) = d(n) + v(n), where v(n) is a noise signalwith zero mean, variance , and it is uncorrelated with the desired signal,d(n). We also assume that the signals are stationary (see Chapter 13). Hence,

(14.23)

Similarly, we obtain

(14.24)

where we used the assumption that d(n) and v(n) are uncorrelated and v(n)has a zero mean value. Therefore, the Wiener–Hopf equation (14.16) becomes

(14.25)

The following Book MATLAB m-file is used to produce the results shownin Figure 14.3.1.

Book MATLAB m-file: ex_14_3_1

%Book MATLAB m-File:ex_14_3_1

n=0:511;

d=sin(.1*pi*n);%desired signal

v=0.5*randn(1,512);%white Gaussian noise;

x=d+v;%input signal to Wiener filter;

Figure 14.2.6 Pictorial illustration of the orthogonality principle.

d(n)

eo(n) = d(n) –do (n)

do (n)

wo0 x(n)

wo1 x(n – 1)

x(n – 1)

x(n)

ˆ

ˆ

v2

p m E d n x n m E d n d n m E d n Edx( ) { ( ) ( )} { ( ) ( )} { ( )}= = + {{ ( )}

{ ( )} ( )

v n m

E d m r md= =2

r m E x n x n m r m r mx d v( ) { ( ) ( )} ( ) ( )= = +

( )R R w = pd vo

dx+

Page 612: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 14: Least square system design, Wiener filter, and the LMS filter 599

rd=sssamplebiasedautoc(d,20);%rdx=rd=biased autoc. function of %the desired signal(see 14.3.1);

rv=sssamplebiasedautoc(v,20);%rv=biased autoc. function of the %noise;

R=toeplitz(rd(1,1:12))+toeplitz(rv(1,1:12));%see(14.3.3);

pdx=rd(1,1:12);

w=inv(R)*pdx';

y=filter(w',1,x);%output of the filter;

But

(14.26)

and hence, from the MATLAB function var(), we obtain vard = var(x) –var(v) = 0.4968 and . We can also use the BookMATLAB function [w,jmin]=sswienerfirfilter(x,d,M) to obtainthe filter coefficients and the MMSE. �

Example 14.3.2: Filtering. It is desired to find a two-coefficient Wienerfilter for the communication channel shown in Figure 14.3.2. Let v1(n) andv2(n) be white noises with zero mean, uncorrelated with each other and withd(n), and have the following variances: . The desired sig-nal produced by the first filter shown in Figure 14.3.2 is

(14.27)

Figure 14.3.1 Illustration of Example 14.3.1.

2

1.5

1

0

0 10 20 30

n

x(n

), y

(n)

x(n)

y(n)

40 50 60

–0.5

0.5

–1.5

–1

x d v x x d d v vr r r2 2 2 2 2 20 0 0= + = = =; ( ( ), ( ), ( ))

J dxo

min . .= =0 4968 0 0320p w

12

220 31 0 12= =. , .

d n d n v n( ) . ( ) ( )= +0 796 1 1

Page 613: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

600 Signals and systems primer with MATLAB

Therefore, the autocorrelation function of the desired signal becomes

(14.28)

or

(14.29)

We must always have in mind that all the signals are assumed to be station-ary. This means that the signal statistics (mean, variance, pdf, etc.) are inde-pendent of the time n.

From the second filter we obtain

(14.30)

Introducing (14.30) in (14.27) we obtain

(14.31)

But , and hence the vector form of the set becomes x(n) =u(n) + v2(n). Therefore, the autocorrelation matrix Rx becomes

(14.32)

Figure 14.3.2 Illustration of Example 14.3.2.

v1(n)+

–0.796

+

z–1z–1

z–1

0.931

+

w1w0

+

+

Algorithm

adjusting

wi’s

Wiener filterCommunication channel

Signal

producing

filter

_

d(n) u(n)

v2(n)

x(n)

e(n)

d(n)ˆ

E d n d n E d n E d n{ ( ) ( )} . { ( )} . { (= ×0 796 1 2 0 796 12 2 ))} { ( )}

{ ( )}

E v n

E v n

1

12+

d d2 2 2

12 20 796 0 31 1 0 796 0 84= + = =. . ( . ) .or d

2 / 661

d n u n u n( ) ( ) . ( )= 0 931 1

u n u n u n v n( ) . ( ) . ( ) ( )=0 135 1 0 7411 2 1

x n u n v n( ) ( ) ( )= + 2

E n n E n n n n{ ( ) ( )} {[ ( ) ( )][ ( ) ( )x x R u v u vTx 2

T2T� = + + ]]} = +R Ru v2

Page 614: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 14: Least square system design, Wiener filter, and the LMS filter 601

where we used the assumption that u(n) and v2(n) are uncorrelated zeromean random sequences (vectors), which implies that E{v2(n)uT(n)} = E{v2(n)}E{uT(n)} = 0.

We must remember that the expectation values of a vector and matrixare defined as follows:

Next, we multiply (14.31) by u(n – m) and then take the ensemble averageof both sides, which results in the following expression:

(14.34)

Setting m = 1 and next m = 2 in the above equation, we find the Yule–Walkerequations:

(14.35)

since v1(n) and u(n – m) are uncorrelated. If we set m = 0 in (14.34), it becomes

(14.36)

If we next substitute the value of u(n) from (14.31) in (14.36), and taking intoconsideration that v and u are independent rv’s, we obtain the relation

(14.37)

where we used the symmetry property of the correlation function. From thefirst equation of (14.35) we obtain the relation

(14.38)

E E

x

x

x

E x

E x{ }

( )

( )

( )

{ ( )}

{ (x = =

0

1

2

0

11

2

0 1)}

{ ( )}

; { } {[ ( ) ( )

E x

E E x x= x xx

E x E x E x E Ex

( )]}

[ { ( )} { ( )} { ( )}]; { }( )

2

0 1 20

=

= =Rxx

x x

E x E x

E x

( )

( ) ( )

{ ( )} { ( )}

{ ( )}

1

3 4

0 1

3=

EE x{ ( )}4

(14.33)

r m r m r m r m Eu u u v u( ) . ( ) . ( ) ( ) {= =0 135 1 0 7411 21

vv n u n m1( ) ( )}

r r

r r

u u

u u

( ) ( )

( ) ( )

.

.

0 1

1 0

0 1350

0 7411= =

r

r

u

u

( )

( )

1

2Yule-Walker eequations

r r r E v n u nu u u( ) . ( ) . ( ) { ( ) ( )}0 0 135 1 0 7411 2 1=

12 0 0 135 1 0 7411 2= r r ru u u( ) . ( ) . ( )

r ru u u( )..

( )..

10 135

1 0 74110

0 1350 2589

2= =

Page 615: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

602 Signals and systems primer with MATLAB

Substituting, next, the above equation in the second equation of the set(14.35), we find

(14.39)

Hence, the last three equations give the variance of u:

(14.40)

Using (14.40), (14.38), and the value , we obtain the correlationmatrix

(14.41)

From Figure 14.3.2, and specifically from the communication channel,we find the relation

(14.42)

Multiplying (14.42) by u(n) and then by u(n – 1), and taking the ensembleaverages of the results, we obtain the correlation vector

(14.43)

Minimum mean square error (MMSE)

Introducing the above results in (14.9), we obtain the mean square surface(cost function) as a function of the filter coefficients. Hence,

The mean square surface and its contour plots are shown in Figure 14.3.3.

ru u u( ) ...

.2 0 1350 1350 2589

0 74112 2= +

u2 1

2

0 32820 31

0 32820 9445= = =

..

..

22 0 12= .

R R Rx u v= + = +2

0 9445 0 4925

0 4925 0 9445

. .

. .

00 12 0

0 0 12

1 0645 0 4925

0 4925 1 064

.

.

. .

. .=

55

u n u n d n( ) . ( ) ( )=0 931 1

pdxT= [ . . ]0 4860 0 3868

J w w w( ) . [ ].

.[w = +0 8461 2

0 4860

0 38680 1 00 1

1 0645 0 4925

0 4925 1 0645

0 846

w ]. .

. .

.= 11 0 972 0 7736 1 0645 1 0645 0 90 1 02

12+ + + +. . . . .w w w w 885 0 1w w

(14.44)

Page 616: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 14: Least square system design, Wiener filter, and the LMS filter 603

Optimum filter (wo)

The optimum filter coefficients are defined by (14.17), and in this case, thevector of optimum coefficients takes the following form:

The MMSE is found using (14.18), which in this case gives the value

Observe that the center of the ellipse, minimum point, has the coordi-nates of the optimum vector coefficients 0.7948 and –0.7311. �

Figure 14.3.3 The MSE surface and its corresponding contour plots of Example 14.3.2.

12

14

2

1.5

0.5

–0.5

–1

–1.5

–2 –2 –1 0 1 2

0

1

J(w

)

w1

w1

w0

w0

0

2

4

6

8

10

1

2

0

–2

–1 –1

0

1

2

–2

w R pox dx= =1

1 1953 0 5531

0 5531 1 1953

. .

. .=

0 4860

0 3868

0 7948

0 7311

.

.

.

.=

w

w

0

1

J dmin . [ . . ]= =2 0 8461 0 4860 0 3868p R pdxT

x-1

dx

11 1953 0 5531

0 5531 1 1953

0 4860

0

. .

. .

.

..

.

3868

0 1770=

Page 617: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

604 Signals and systems primer with MATLAB

Example 14.3.3: System identification. It is desired, using a Wienerfilter, to estimate the unknown impulse response coefficients hi of a FIRsystem (see Figure 14.3.4). The input {x(n)} is a zero mean iid rv with variance

. Let the impulse response h of the filter be h = [0.9 0.6 0.2]T. Since theinput {x(n)} is a zero mean iid rv, the correlation matrix Rx is diagonal withelements having values . The desired signal d(n) is the output of theunknown filter and is given by d(n) = 0.9x(n) + 0.6x(n – 1) + 0.2x(n – 2).Therefore, the cross-correlation output is given by (remember the signals arestationary):

Hence, we obtain (rx(m) = 0 for m 0 because the input data are independentto each other (white noise)): .The optimum filter is

and the MMSE is (assuming = 1)

But,

and hence we find Jmin = 1.21 – (0.92 + 0.62) = 0.04.

Figure 14.3.4 System identification setup.

h

w

+x(n)

x(n)

x(n)

e(n)

d(n)

d(n) ˆ

x2

x2

p i E d n x n i E x n x ndx( ) { ( ) ( )} {[ . ( ) . ( )= = + +0 9 0 6 1 0.. ( )] ( )}

. { ( ) ( )} . { (

2 2

0 9 0 6

x n x n i

E x n x n i E x n= + +

= +

1 0 2 2

0 9 0 6

) ( )} . { ( ) ( )}

. ( ) .

x n i E x n x n i

r ix rr i r xx x( ) . ( )+1 0 2 2

p pdx x dx x( ) . , ( ) .0 0 9 1 0 62 2= =

w R pox dx x= =1 2 1

1 0

0 1

0 9

0 6( )

.

.= ( )

.

.x2 1

0 9

0 6

x2

J dmin [ . . ].

.= 2 0 9 0 6

1 0

0 1

0 9

0 6..

d E d n d n E x n x n x n2 0 9 0 6 1 0 2= = + +{ ( ) ( )} {[ . ( ) . ( ) . (

= + + =

2

0 81 0 36 0 04 1 21

2)] }

. . . .

Page 618: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 14: Least square system design, Wiener filter, and the LMS filter 605

Book MATLAB function for system identification

function[w,jm]=sswienerfirfilter(x,d,M)

%function[w,jm]=aawienerfirfilter(x,d,M);

%x=data entering both the unknown filter(system) and the Wiener

%filter;

%d=the desired signal=output of the unknown system; length(d)=

%length(x);

%M=number of coefficients of the Wiener filter;

%w=Wiener filter coefficients;jm=minimum mean square error;

pdx=xcorr(d,x,'biased');

p=pdx(1,(length(pdx)+1)/2:((length(pdx)+1)/2)+M-1);

rx=sssamplebiasedautoc(x,M);

R=toeplitz(rx);

w=inv(R)*p';

jm=var(d)-p*w;%var() is a MATLAB function;

By setting, for example, the following MATLAB procedure, x=rand(1,256);d=filter([1 0.8 0.24],1,x); [w,jm]=sswienerfir-filter(x,d,6); we obtain: Jmin = 0.0216 and w = [1.0002 0.7778 0.23990.0110 0.0074 0.0014]. Observe that the values after the third coefficient areclose to zero. This indicates that the unknown system has only three coeffi-cients. Observe that the derived coefficients are very close to the exact ones. �

Example 14.3.4: Noise canceling. In many practical applications thereexists a need to cancel the noise added to a signal. For example, we aretalking on a cell phone inside a car and the noise of the car, radio, etc., isadded to the message we are trying to transmit. A similar circumstanceappears when pilots in planes and helicopters try to communicate or tankdrivers try to do the same. Figure 14.3.5 shows pictorially the noise contam-ination situations. Observe that the noise added to the signal and the other

Figure 14.3.5 Noise canceling scheme.

Noise source

(cockpit noise)

+

w

+Signal source

(pilot) –

d(n) x(n) = d(n) + v1(n) = d(n) + v1(n) v1(n)

e(n) = x(n) v1(n)

v1(n)

v2 (n) v1(n)

ˆ

ˆ

ˆ

Page 619: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

606 Signals and systems primer with MATLAB

components entering the Wiener filter emanate from the same source butfollow different paths in the same environment. This indicates that there issome degree of correlation between these two noises. It is assumed that thenoises have zero mean values. The output of the Wiener filter will approx-imate the noise added to the desired signal, and thus the error will be closeto the desired signal. The Wiener filter in this case is

(14.45)

because the desired signal in this case is v1.The individual components of the vector are

(14.46)

Because d(n) and v2(n) are uncorrelated,

Therefore, (14.45) becomes

(14.47)

To demonstrate the effect of the Wiener filter, let d(n) = 0.99n sin(0.1n +0.2 ) be a decaying sine function, v1(n) = 0.8v1(n – 1) + v(n) and v2(n) =–0.95v2(n – 1) + v(n), where v(n) is white noise with zero mean value andunit variance. The correlation matrix and cross-correlation vector arefound using the sample biased correlation equations

(14.48)

Figure 14.3.6 shows simulation results for different-order filters usingthe Book MATLAB function given below (remember that you must have theBook MATLAB function in the MATLAB path).

R w pvo

v v2 1 2=

pv v1 2

p m E v n v n m E x n d n v nv v1 2 1 2 2( ) { ( ) ( )} {( ( ) ( )) (= = mm

E x n v n m E d n v n m p mxv

)}

{ ( ) ( )} { ( ) ( )} ( )= =2 2 2

E d n v n m E d n E v n m{ ( ) ( )} { ( )} { ( )}2 2 0= =

R w pvo

xv2 2=

Rv2pxv2

ˆ ( ) ( ) ( ) , , , ,r kN

v n v n k k Kv v

n

N

2 2

10 1 12 2

0

1

= ==

� KK N

p kN

x n v n k k K K Nxv

<<

= = <<ˆ ( ) ( ) ( ) , , , ,2

10 1 12 �

nn

N

=0

1

Page 620: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 14: Least square system design, Wiener filter, and the LMS filter 607

Book MATLAB function for noise canceling: [d,w,xn]=sswienernoisecancelor(dn,a1,a2,v,M,N)

function[d,w,xn]=sswienernoisecancelor(dn,a1,a2,v,M,N)

%[d,w,xn]=sswienernoisecancelor(dn,a1,a2,v,M,N);dn=desired

%signal;

%a1=first order IIR coefficient,a2=first order IIR coefficient;

%v=noise;M=number of Wiener filter coefficients;N=number of

%sequence

%elements of dn(desired signal) and v(noise);d=output desired

%signal;

%w=Wiener filter coefficients;xn=corrupted signal;en=xn-v1=d;

v1(1)=0;v2(1)=0;

for n=2:N

v1(n)=a1*v1(n-1)+v(n-1);

v2(n)=a2*v2(n-1)+v(n-1);

end;

v2autoc=sssamplebiasedautoc(v2,M);

Figure 14.3.6 Noise canceling.

4

2

0

0 100 200

n n

n n

300 0 100 200 300

0 100

M = 8 M = 16

M = 4

200 300 0 100 200 300

x(n

)

–2

–4

–6

3

2

1

e(n

)

0

–1

–2

–3

1.5

1

1

0.50.5

–1.5

e(n

)

0 0

–0.5–0.5

–1

–1

e(n

)

Page 621: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

608 Signals and systems primer with MATLAB

xn=dn+v1;

Rv2=toeplitz(v2autoc);

p1=xcorr(xn,v2,'biased');

if M>N

disp(['error:M must be less than N']);

end;

R=Rv2(1:M,1:M);

p=p1(1,(length(p1)+1)/2:(length(p1)+1)/2+M-1);

w=inv(R)*p';

yw=filter(w,1,v2);

d=xn-yw(:,1:N); �

We can also arrange the standard single Wiener filter in a series form,as shown in Figure 14.3.7. This configuration permits us to process the signalusing filters with fewer coefficients, thus saving in computation. Because ofthe form, we can name it the self-correcting Wiener filter (SCWF).

14.4 The least mean square (LMS) algorithmIn this chapter, we also present the celebrated least mean square (LMS)algorithm, developed by Widrow and Hoff in 1960. This algorithm is amember of stochastic gradient algorithms, and because of its robustness andlow computational complexity, it has been used in a wide spectrum ofapplications.

Figure 14.3.7 Self-correcting Wiener filter (SCWF).

+ w1 +

w2 +

w3 +

d(n)

v(n)

_

_

x(n) x1(n)

x1(n)

x2(n)

x2(n)

x3(n)

x3(n)

e1(n)

e2(n)

e3(n)

d(n)

d(n)

d(n)

d(n)

Page 622: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 14: Least square system design, Wiener filter, and the LMS filter 609

The LMS algorithm has the following most important properties:

1. It can be used to solve the Wiener–Hopf equation without finding thematrix inversion. Furthermore, it does not require the availability ofthe autocorrelation matrix of the filter input and the cross-correlationbetween the filter input and its desired signal.

2. Its form and implementation are simple, yet it is capable of deliveringhigh performance during the adaptation process.

3. Its iterative procedure involves (a) computing the output of a FIRfilter produced by a set of tap inputs (filter coefficients), (b) generationof an estimated error by computing the output of the filter to a desiredresponse, and (c) adjusting the tap weights (filter coefficients) basedon the estimation error.

4. The correlation term needed to find the values of the coefficients atthe n + 1 iteration contains the stochastic product x(n)e(n) without theexpectation operation that is present in the steepest descent method.

5. Since the expectation operation is not present, each coefficient goesthrough sharp variations (noise) during the iteration process. There-fore, instead of terminating at the Wiener solution, the LMS algorithmsuffers random variation around the minimum point (optimumvalue) of the error-performance surface.

6. It includes a step-size parameter, μ, that must be selected properlyto control stability and the convergence speed of the algorithm.

7. It is stable and robust for a variety of signal conditions.

The LMS algorithm

In many signal processing applications data are received one at a time, andbecause of this, the following question arises: Should we wait for all the datato be received first and then process (batch processing) them, or proceed toprocess as they arrive (sequential processing)? It turns out that sequentialprocessing is desirable for two main reasons: we need less memory spaceand the results are given instantaneously.

Let, for example, that we have received N values of the signal {x(0), x(1),x(2), …, x(N – 1)}. The estimate mean value is given by (see also Chapter 13)

(14.49)

where the argument of denotes the index of the most recent data pointreceived. If we now observe the new data sample x(N), then the mean valueis given by

ˆ ( ) ( )m NN

x nn

N

==

11

0

1

m

Page 623: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

610 Signals and systems primer with MATLAB

(14.50)

In computing this new estimate, we do not have to recompute the sum ofthe observations since the above equation can be cast in the form

(14.51)

Note: The new mean value is found by using the previous mean value plus thenew sample.

The sequential approach also lends itself to an interesting interpretation.Rearranging (14.51) we obtain

(14.52)

Note: The new estimate is equal to the old estimate plus a correction term.The correction term decreases with N. The term [x(N) – m(N – 1)] can be thoughtof as the error in predicting x(N) by the previous samples.

The LMS algorithm is similar to the above format, but with the differencethat instead of numbers, vectors are involved. Hence, the sequential LMSalgorithm is

(14.53)

where

(14.54)

(14.55)

(14.56)

ˆ ( ) ( )m NN

x nn

N

=+

=

11

0

ˆ ( ) ( ) ( ) ˆ (m NN

x n x NN

Nm N

n

N

=+

+ =+

=

11 1

0

1

++

11

1) ( )

Nx N

ˆ ( ) ˆ ( ) [ ( ) ˆ ( )]m N m NN

x N m N= ++

11

11

w = w + x x w

= w + x

T( ) ( ) ( )[ ( ) ( ) ( )]

( )

n n n d n n n

n

+ 1 2

2

μ

μ (( )[ ( ) ( ) ( )]

( ) ( ) ( )

n d n n n

n e n n

w x

w + x

T

= 2μ

y n n n( ) ( ) ( )= w xT filter output

e n d n y n( ) ( ) ( )= error

w( ) [ ( ) ( ) ( )]n w n w n w nMT= 0 1 1� filter taps (coeffficients) at time ,

an 1 vector

n

M ×

Page 624: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 14: Least square system design, Wiener filter, and the LMS filter 611

(14.57)

The algorithm defined by (14.53), (14.54), and (14.55) constitutes the LMSalgorithm. The algorithm requires that at each time step x(n), d(n), and w(n)are known. The block diagram representation of the algorithm is given inFigure 14.4.1. The essential elements in adaptive signal processing are shownin Figure 14.4.2. As shown, the filter weights are adjusted at regular intervals,in accordance with an adaptive algorithm. The adaptive algorithm, as givenabove, usually uses, either explicitly or implicitly, the signals shown in Figure14.4.2. These signals are the input signal, x(n), the desired signal, d(n), andthe error signal, e(n), which is the difference between d(n) and y(n), thefiltered version of the input signal x(n). The adaptive filtering algorithmcontinually varies the filter coefficients to reduce the mean square errortoward its minimum value. Thus, the adaptive filter continually seeks toreduce the difference between the desired response, d(n), and its ownresponse, y(n). It is this approach that the filter adjusts to its prescribed signalenvironment.

Figure 14.4.1 Block diagram representation of the LMS algorithm.

Figure 14.4.2 Schematic of adaptive signal processing.

x( ) [ ( ) ( ) ( ) ( )]n x n x n x n x n M T= +1 2 1� input data,

an vector

1 M ×

×

+

+ ×2μ

z−1I

d(n)

xT(n)

w(n)

w(n)

x(n)

w(n)

w(n)

w(n + 1)

w(n + 1)

Filter with

varying

coefficients wi’s+

x(n) y(n)–

d(n)

e(n)

Page 625: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

612 Signals and systems primer with MATLAB

Below is a step-by-step development of how the LMS algorithm works.The results were found using MATLAB help:

>>n=0:9; x=[-0.4326 -1.3566 0.7131 1.0967 -0.1954 2.1909...

>>2.1402 0.7714 0.9151 0.4837]; mu=0.1; dn=[0 0.3090...

>>0.5878 0.8090 0.9511 1.0000...

>>0.9511 0.8090 0.5878 0.3090];w0=[0 0]';

>>w1=w0+2*mu*x(1,1:2)'*(dn(1)-w0'*x(1,1:2)';%w1=[0 0]'

>>w2=w1+2*mu*x(1,2:3)'*(dn(2)-w1'*x(1,2:3)';%w2=[-0.0838

%0.0441];

>>w3=w2+2*mu*x(1,3:4)'*(dn(3)-w2'*x(1,3:4)';%w3=[0.0016

%0.1755]

etc

Book MATLAB function for LMS algorithm: [w,y,e,J]=sslms(x,dn,mu,M)

function[w,y,e,J]=sslms(x,dn,mu,M)

%function[w,y,e,J]=aalms(x,dn,mu,M);

%all quantities are real-valued;

%x=input data to the filter; dn=desired signal;

%M=order of the filter;

%mu=step-size factor; x and dn must be of the same length;

N=length(x);

y=zeros(1,N); %initialized output of the filter;

w=zeros(1,M); %initialized filter coefficient vector;

for n=M:N

x1=x(n:-1:n-M+1); %for each n the vector x1 is

%of length M with elements from x in reverse order;

y(n)=w*x1';

e(n)=dn(n)-y(n);

w=w+2*mu*e(n)*x1;

end;

J=e.^2; %J is the learning curve of the adaptation;

Example 14.4.1: Find the 30-coefficient FIR filter using the Book MATLABfunction for the LMS algorithm. Use the following: n=0:255;dn=sin(0.1*pi*n); x=dn+rand(1,256); mu=0.04; M=30;.

Solution: The results are shown in Figure 14.4.3. Observe that as theerror, J, becomes smaller, the output of the filter approaches the desiredsignal. �

Page 626: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 14: Least square system design, Wiener filter, and the LMS filter 613

The following Book MATLAB function provides the history of valuesfor each filter coefficient.

Book MATLAB function providing the filter coefficient history: [w,y,e,J,w1]=sslms1(x,dn,mu,M)

function[w,y,e,J,w1]=sslms1(x,dn,mu,M)

%function[w,y,e,J,w1]=sslms1(x,dn,mu,M);

%this function provides also the changes of the filter coef-

%ficients

%versus iterations;

%all quantities are real-valued;

%x=input data to the filter; dn=desired signal;

%M=order of the filter;

%mu=step size; x and dn must be of the same length;

%each column of the matrix w1 contains the history of each

%filter coefficient;

N=length(x);

y=zeros(1,N);

w=zeros(1,M); %initialized filter coefficient vector;

for n=M:N

xl=x(n:-1:n-M+1); %for each n the vector xl of length M is %produced

%with elements from x in reverse order;

Figure 14.4.3 Illustration of Example 14.4.1.

2

1.5

1

0.5

dn

(n),

x(n

), y

(n)

0

0.2

0.15

0.1

0

0.05

0 10

0 50 100 150 200 250 300

20 30 40 50 60 70 80 90 100

–0.5

–1

–1.5

y(n)

n

n

J(n

)x(n)

dn(n)

Page 627: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

614 Signals and systems primer with MATLAB

Table 14.4.1 provides a comprehensive format of the LMS algorithm.

y(n)=w*xl';

e(n)=dn(n)-y(n);

w=w+2*mu*e(n)*xl;

w1(n-M+1,:)=w(1,:);

end;

J=e.^2;%J is the learning curve of the adaptive process; each %column of the matrix w1

%depicts the history of each filter coefficient;

14.5 Examples using the LMS algorithmThe following examples will elucidate the use of the LMS algorithm todifferent areas of engineering applications and will create an appreciationfor the versatility of this important algorithm.

Example 14.5.1: Linear prediction. We can use an adaptive LMS filteras a predictor, as shown in Figure 14.5.1. The data {x(n)} were created bypassing a zero mean white noise {v(n)} through an autoregressive (AR) processdescribed by the difference equation x(n) = 0.6010x(n – 1) – 0.7225x(n – 2) +v(n). The LMS filter is used to predict the values of the AR filter parameters0.6010 and –0.7225. A two-coefficient LMS filter predicts x(n) by

(14.58)

Figure 14.5.2 gives w0 and w1 vs. the number of iterations for two differentvalues of step size (μ = 0.02 and μ = 0.005). The adaptive filter is a two-coefficient filter. The noise is white and Gaussian distributed. The figureshows fluctuations in the values of coefficients as they converge to a neigh-borhood of their optimum value, 0.6010 and –0.7225, respectively. As thestep-size μ becomes smaller, the fluctuations are not as large, but the con-vergence speed to the optimal values is slower.

Table 14.4.1 LMS Algorithm for an Mth-Order FIR Adaptive Filter

Inputs: M = filter lengthμ = step-size factorx(n) = input data vector to the adaptive filterw(0) = initialization filter vector = 0

Outputs: y(n) = adaptive filter output =e(n) = d(n) – y(n) = errorw(n + 1) = w(n) + 2μe(n)x(n)

w xT( ) ( ) ˆ( )n n d n

ˆ( ) ( ) ( ) ( )x n w n x n i y ni

i

==

10

1

Page 628: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 14: Least square system design, Wiener filter, and the LMS filter 615

Book one-step LMS predictor MATLAB function: [w,y,e,J,w1]=sslmsonesteppredictor(x,mu,M)

function[w,y,e,J,w1]=sslmsonesteppredictor(x,mu,M)

%function[w,J,w1]=sslmsonesteppredictor(x,mu,M);

%x=data=signal plus noise;mu=step size factor;M=number of filter

%coefficients;w1 is a matrix and each column is the history

%of each

%filter coefficient versus time n;

N=length(x);

Figure 14.5.1 (a) Linear predictor LMS filter. (b) Two-coefficient adaptive with itsadaptive weight-control mechanism.

Figure 14.5.2 Convergence of two-element LMS adaptive filter used as a linearpredictor.

H(z) +

LMS

v(n) x(n)

x(n 1) y(n)

e(n)

z 1

z 1

w

(a)

+ +

x(n 1) x(n 2)

x(n)

e(n)

(b)

w0(n) w1(n)

x(n) = y(n) �ˆ

0

1

0.5

0

–0.5

–1200 400 600 800 1000

n

w0, μ = 0.02

w0, μ = 0.005

w1, μ = 0.005w1, μ = 0.02

1200 1400 1600 1800 2000

Page 629: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

616 Signals and systems primer with MATLAB

y=zeros(1,N);

w=zeros(1,M);

for n=M:N-1

x1=x(n:-1:n-M+1);

y(n)=w*x1';

e(n)=x(n+1)-y(n);

w=w+2*mu*e(n)*x1;

w1(n-M+1,:)=w(1,:);

end;

J=e.^2;

%J is the learning curve of the adaptive process; �

Example 14.5.2: Modeling or identification of systems. Adaptive filter-ing can also be used to find the coefficients of an unknown filter, as shownin Figure 14.5.3. The data x(n) were created similar to those in Example 14.5.1.The desired signal is given by d(n) = x(n) – 2x(n – 1) + 4x(n – 2). If the outputy(n) is approximately equal to d(n), it implies that the coefficients of the LMSfilter are approximately equal to those of the unknown system. Figure 14.5.4shows the ability of the LMS filter to identify the unknown system. After500 iterations, the system is practically identified. For this example, we usedμ = 0.01 and M = 4. It is observed that the fourth coefficient is zero, as it

Figure 14.5.3 System identification setup.

Figure 14.5.4 LMS adaptive filtering for system identification.

H1(z)

1 – 2z–1 + 4z–2

w0 + w1z–1

+ w2z–2 + w3z–3

+v(n)

y(n)

d(n)

x(n) e(n)

4

w2

w1

w0 w3

3

2

1

0

0 100 200 300 400 500

n

600 700 800 900 1000

–1

–2

Page 630: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 14: Least square system design, Wiener filter, and the LMS filter 617

should be, since the system to be identified has only three coefficients andthe rest are zero.

Note: One important difference of adaptive filtering with Wiener filtering isthat adaptive filtering does not need the desired signal to be known. �

Example 14.5.3: Noise cancellation. A noise cancellation scheme isshown in Figure 14.5.5. We introduce in this example the following values:H1(z) = 1 (or h(n) = (n)), v1(n) = white noise = v(n), L = 1, s(n) = sin(0.2 n).Therefore, the input signal to the adaptive filter is x(n) = s(n – 1) + v(n – 1)and the desired signal is d(n) = s(n) + v(n).The Book LMS MATLAB algorithmsslms was used. Figure 14.5.6 shows the signal, the signal plus noise, andthe outputs of the filter for three different sets of coefficients: M = 4, M = 12,and M = 62.

Book MATLAB m-file: ex_14_5_3

%Book m-file:ex_14_5_3

n=0:2000;mu=0.005;v=rand(1,2001)-0.5;

s=0.8*sin(0.1*pi*n);dn=s+v;

for m=1:1999

x(m+1)=dn(m);

end;

subplot(2,2,1);plot(s(1,1:120),'k');xlabel('n');ylabel('s(n)');

subplot(2,2,2);plot(dn(1,1:120),'k');xlabel('n');ylabel...('dn(n)');

[w,y,e,J,w1]=sslms1(x,dn,mu,4);

subplot(2,2,3);plot(y(1,4:124),'k');xlabel('n');ylabel...('y(n), M=4');

[w,y,e,J,w1]=sslms1(x,dn,mu,32);

subplot(2,2,4);plot(y(1,32:152),'k');xlabel('n');ylabel...('y(n), M=32'); �

Figure 14.5.5 Adaptive LMS noise cancellation scheme.

H1(z) +

z–L

w +

v1(n) v(n)

s(n)

x(n) = d(n – L)

y(n)–

e(n)

d(n) = s(n) + v(n)

Page 631: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

618 Signals and systems primer with MATLAB

The transmission of signals through space, for example, change, to alarge extent, due to noise introduced by the change of the index of refractionand scattering elements of the atmosphere. This phenomenon impedes, andsometimes completely destroys, the information to be transmitted. It is there-fore desirable to find a transfer function that is equal to that of the atmo-sphere. Using the inverse of this transmission function, we will be able toneutralize to some extent the influence of the transmission channel, and thusreceive the original signal undistorted or slightly so. In this example, weassume that the atmospheric channel changes slowly, and hence we canintroduce the inverse filter periodically after we have specified the atmo-spheric channel by the adaptive filtering procedure.

Example 14.5.4: Channel equalization. Figure 14.5.7a shows a basebanddata transmission system equipped with an adaptive channel equalizer anda training system. The signal {s(n)} transmitted through the communicationchannel is amplitude- or phase-modulated pulses. The communication chan-nel distorts the signal — the most important one is the pulse spreading —and results in overlapping of pulses, thus creating the intersymbol interfer-ence phenomenon. The noise v(n) further deteriorates the fidelity of thesignal. It is ideally required that the output of the equalizer is the signal s(n).Therefore, an initialization period is used during which the transmitter sendsa sequence of training symbols that are known to the receiver (trainingmode). This approach is satisfactory if the channel does not change its

Figure 14.5.6 Noise cancellation using LMS filtering.

1

0.5

0.6

0.4

0.2

0

–0.2

–0.4

15010050

n n

0

s(n

)y(

n),

M =

4

y(n

), M

= 3

2d

n(n

)

150100500

15010050

n n

0 150100500

0

–0.5

–1

1

0.5

0

–0.5

–1

1

0.5

1.5

0

–0.5

–1.5

–1

Page 632: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 14: Least square system design, Wiener filter, and the LMS filter 619

characteristics rapidly in time. However, for slow changes, the output fromthe channel can be treated as the desired signal for further adaptation of theequalizer, so that its variations can be followed (decision-directed mode).

If the equalization filter is the inverse of the channel filter, W(z) = 1/H(z),the output will be that of the input to the channel, assuming, of course, thatnoise is small. To avoid singularities from the zero of the channel transferfunction inside the unit circle, we select an equalizer such that W(z)H(z) z–L. This indicates that the output of the filter W(z) is that of the input to thechannel shifted by L units of time. Sometimes, more general filters of the formY(z)/H(z) are used, where Y(z) z–L. These systems are known as the par-tial-response signaling systems. In these cases, Y(z) is selected such that theamplitude spectra are about equal over the range of frequencies of interest.The result of this choice is that W(z) has a magnitude response of about 1,thereby minimizing the noise enhancement.

Figure 14.5.7b shows a channel equalization problem at the trainingstage. The channel noise v(n) is assumed to be white Gaussian with variance

. The equalizer is an M-tap (M-coefficient) FIR filter, and the desired outputis assumed to be a delayed replica of the signal s(n), s(n – L). The signal s(n)

Figure 14.5.7 (a) Baseband data transmission system equipped with an adaptivechannel equalizer and (b) a training system.

s(n) x(n)

e(n)

y(n)

d(n)

(a)

s(n)

v(n)

+

+–

Channel

H(z)

Equalizer

W(z)

Training

sequence

generator

ˆ

Random independent

binary (+ or –1)

generator

Channel

H(z)+

Adaptive

LMS filter

W(z)

+s(n)

s(n – L) = d(n)s(n)z−L

y(n) e(n)

v(n)

(b)

v2

Page 633: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

620 Signals and systems primer with MATLAB

is white, has variance , has zero mean value, and is uncorrelated withv(n). The channel transfer function was assumed to take the following FIRforms:

(14.59)

The solution of the two systems above was selected based on the eigen-value spread of their output correlation matrix. Figure 14.5.8a shows thelearning curve with a channel system of the form H(z) = 0.34 + z–1 – 0.34z–2

and two different step-size parameters and c = 0.5. The variance of the noisewas = 0.043. Figure 14.5.8b shows the learning curve with a channelsystem of the form H(z) = 0.34 + 0.8z–1 + 0.1z–2 and with the same step-sizeparameter and noise variance as in case a above. In both cases, the curveswere reproduced 20 times and averaged. The delay L was assumed to be 3,and the number of filter coefficients were 12. The curves were producedusing the following Book MATLAB function.

Figure 14.5.8 Learning curves of the channel system.

s2 1=

H z H z z z

H z H z

( ) ( ) . .

( ) ( ) .

= = +

= = +

11 2

2

0 34 0 34

0 34 00 8 0 11 2. .z z+

v2

0 50 100 150 200 250 300 350 400 450 5000

0.5

1

1.5

n

(a)

(b)

0 50 100 150 200 250 300 350 400 450 500n

J av

erag

ed 2

0 t

imes

0

0.2

0.4

0.6

0.8

1

J av

erag

ed 2

0 t

imes

μ = 0.001

μ = 0.01

μ = 0.001μ = 0.01

Page 634: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 14: Least square system design, Wiener filter, and the LMS filter 621

Book MATLAB function for channel equalization

function[Jav,wav,dn,e,x]=ssequalizer(av,M,L,h,N,mu,c)

%function[Jav,wav,dn,e,x]=aaequalizer(av,M,L,h,N,mu,c)

%this function solves the example depicted

%in Fig 14.5.7;av=number of times to average e(error or

%learning curve)and w(filter coefficient);N=length

%of signal s;L=shift of the signal s to become dn;h=assumed

%impulse response of the channel system;mu=step factor;

%M=number of adaptive filter coefficients;c=constant multiplier;

w1=[zeros(1,M)];

J=[zeros(1,N)];

for i=1:av

for n=1:N

v(n)=c*randn;

s(n)=rand-.5;

if s(n)<=0

s(n)=-1;

else

s(n)=1;

end;

end;

dn=[zeros(1,L) s(:,1:N-L)];

ych=filter(h,1,s);

x=ych(1,1:N)+v;

[w,y,e]=sslms(x,dn,mu,M);

w1=w1+w;

J=J+e.^2;

end;

Jav=J/av;

wav=w1/av;�

During the past 40 years, many more types of LMS filters were proposed.The main purpose of these proposed algorithms is to create a more robustand fast adaptive algorithm. One of the proposed algorithms that has oftenbeen used in practice is the normalized LMS (NLMS) algorithm:

(14.60)

where –μ and are constants.

w wx x

x( ) ( )( ) ( )

( ) ( )n nn n

e n nT+ = ++

Page 635: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

622 Signals and systems primer with MATLAB

Book MATLAB normalized LMS filter algorithm

(Note: This algorithm can also be used with complex-valued signals.)

function[w,y,e,J,w1]=sscomplexnlms(x,dn,mubar,M,ep)

%function[w,y,e,J,w1]=sscomplexnlms(x,dn,mubar,M,c)

%x=input data to the filter;dn=desired signal;

%M=filter order;c=constant;mubar=step-size equivalent parameter;

%x and dn must be of the same length;J=learning curve;

N=length(x);

y=zeros(1,N);

w=zeros(1,M);%initialized filter coefficient vector;

for n=M:N

x1=x(n:-1:n-M+1);%for each n vector x1 is of length

%M with elements from x in reverse order;

y(n)=conj(w)*x1';

e(n)=dn(n)-y(n);

w=w+(mubar/(ep+conj(x1)*x1'))*conj(e(n))*x1;

w1(n-M+1,:)=w(1,:);

end;

J=e.^2;

%the columns of the matrix w1 depict the history of the

%filter coefficients;

Table 14.5.1 presents the NLMS algorithm.

Table 14.5.1 NLMS Algorithm

Real-Valued Functions Complex-Valued Functions

Input:Initialization vector: w(n) = 0Input vector: x(n)Desired output: d(n)Step-size parameter: μ–

Constant:Filter length: M

Output:Filter output: y(n)Coefficient vector: w(n + 1)

Procedure:

1. y(n) = wT(n)x = w(n)xT(n) 1. y(n) = wH (n)x(n)

2. e(n) = d(n) – y(n) 2. e(n) = d(n) – wH(n)x(n)

3. 3. w(n + 1) = w(n)

+

Note: The superscript H stands for Hermitian or, equivalently, conjugate transpose.

w wx x

xT

( ) ( )( ) ( )

( ) ( )n nn n

e n n+ = ++

μ+ x x

xH( ) ( )

( ) * ( )n n

n e n

Page 636: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 14: Least square system design, Wiener filter, and the LMS filter 623

Important definitions and concepts

1. Least squares technique2. Linear least squares approximation3. Mean square error4. Wiener filter5. Cost function6. Correlation matrix7. Variance of a signal8. Mean square error surface9. Optimum Wiener filter coefficients

10. Minimum error11. Wiener solution12. Orthogonality principle13. Wiener filtering14. Yule–Walker equations15. System identification (modeling) using Wiener filtering16. Noise canceling using Wiener filtering17. Self-correcting Wiener filter18. The least mean square (LMS) filter19. Sequential adaptation20. Batch processing21. Applications using LMS filter: linear prediction, modeling, noise can-

cellation, channel equalization22. Normalized LMS algorithm

Chapter 14 ProblemsSection 14.1

1. Use the following equation to create 20 random points:

Accept Find a, b, and c and then superimpose theline on the random points.

2. Use the following equation to create 20 random points:

Accept Find a, b, and c and then superimpose theline on the random points.

3. Repeat Example 14.1.1, but now use and com-pare with the results of the example.

x n rand= + +5 0 5 5 1 20. * * ( , )

ˆ( ) .x n a bn cn= + + 2

ˆ( )x n

x rand= +1 2 1 20. ( , )

ˆ( ) .x n a bn cn= + + 2

ˆ( )x nˆ( )x n a bn cn d n= + + +2 3

Page 637: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

624 Signals and systems primer with MATLAB

4. The cost function is

.

Find the estimate value and then find Jmin.5. Verify (14.5).6. Repeat Example 14.1.3 for N = 30.

Section 14.2

1. Repeat Example 14.2.1 with the following data:

pdx = [1.5 5]T

2. Introduce (14.15) in (14.13b) and show that the inequalities are true.3. Use the values given and found in Example 14.2.1 to find Jmin.4. Prove (14.18).

Section 14.3

1. Verify (14.24).2. Repeat Example 14.3.1 and substitute the fourth line of ex_14_3_1

with .3. Repeat Example 14.3.1 by introducing the following change to t0 in

the m-file:

ex_14_3_1: v=1.5*randn(1,512); rd=sssamplebiasedautoc ...(d,80);

rv=sssamplebiasedautoc(v,80); R=toeplitz(rd(1,1:60))+...toeplitz(rv(1,1:60));

pdx=rd(1,1:60);

State your observations and conclusions and compare to the resultsof Example 14.3.1.

4. Verify (14.31).5. Verify (14.41).6. Repeat Example 14.3.2 with the help of MATLAB to produce the

different needed signals and the results, for example, J(w), wo, andJmin.

J c x n ch nn

N

( ) ( ( ) ( ))==

2

0

1

c

r rx x d( ) . , ( ) . ,0 0 8 1 0 5 152= = =

v randn= 0 1 1 512. * ( , )

Page 638: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Chapter 14: Least square system design, Wiener filter, and the LMS filter 625

7. Repeat Example 14.3.3 using the inputs (a) x=2*randn(1,256), (b)n=0:255; x=sin(0.1*pi*n), and (c) n=0:255; x=sin(0.1*pi*n)+randn(1,256);. In all cases, use the following FIR filter:h = [0.95 0.423 0.110].

8. Repeat Example 14.3.4 with the difference by making the followingsubstitution: v2 = a2*v2(n – 1) + v(n – 1) + c*dn(n) for (a) c = 0.05,(b) c = 0.1, and (c) c = 0.5. State your observations and conclusions.

9. Find the outputs from a SCWF at the first and fourth states.

Section 14.4

1. Follow the development in the book and find the two-coefficient filterfor four steps.

2. Repeat Example 14.4.1 for (a) μ = 0.005, (b) μ = 0.01, (c) μ = 0.5. Stateyour observations and conclusions.

Section 14.5

1. Repeat Example 14.5.1 with (a) x(n) = rand – 0.5 and (b)x(n) = 0.85x(n – 1) + rand and different values of μ.

2. Repeat Example 14.5.1 with μ = 0.008 and compare the signals x(n)and y(n).

3. Repeat Example 14.5.2 using the following unknown systems:

a.b.c.

4. Repeat Example 14.5.2 by (a) using v = 1.5*rand(1,2001) –0.5, (b) repeating (a) with mu = 0.01, and (c) repeating Example 14.5.2,but using a delay L = 2.

5. Use the NLMS algorithm in Examples 14.5.4, 14.5.3, 14.5.2, and 14.5.1.

1 0 85 0 61 2. .z z0 1 0 9 0 231 2. . .+ +z z1 0 85 0 552 4+. .z z

Page 639: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

627

appendix A

Mathematical formulas

A.1 Trigonometric identities

cos( ) cos=a a

sin( ) sin=a a

cos sina a± =2

sin cosa a± = ±2

cos( ) cosa a± =

sin( ) sina a± =

cos sin2 2 1a a+ =

cos sin cos2 2 2a a a=

cos( ) cos cos sin sina b a b a b± = ∓

sin( ) sin cos cos sina b a b a b± = ±

cos cos [cos( ) cos( )]a b a b a b= + +12

Page 640: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

628 Signals and systems primer with MATLAB

sin sin [cos( ) cos( )]a b a b a b= +12

sin cos [sin( ) sin( )]a b a b a b= + +12

c a d a a b a d ccos sin cos[ tan ( )]+ = 2 2 1 /

cos ( cos )2 12

1 2a a= +

cos ( cos cos )3 14

3 3a a a= +

cos ( cos cos )4 18

3 4 2 4a a a= + +

sin ( cos )2 12

1 2a a=

sin ( sin sin )3 14

3 3a a a=

sin ( cos cos )4 18

3 4 2 4a a a= +

e a j aja± = ±cos sin

cosh cosa ja=

cos ( )a e eja ja= +12

sin ( )aj

e eja ja=2

Page 641: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Appendix A: Mathematical formulas 629

A.2 Orthigonality

The above formulas are correct if all k, l, and n are replaced by k mod N andl mod N.

A.3 Summation of trigonometric forms

(k, l and n are integers)

sinh sina j ja=

tanh tana j ja=

cos cos , ,2 2

0 1 10

1k

Nn

lN

n k l N k ln

N

=

=

sin sin , ,2 2

0 1 10

1k

Nn

lN

n k l N k ln

N

=

=

sin cos , ,2 2

0 1 10

1k

Nn

lN

n k l N k ln

N

=

=

cos, ,

,2 2 2 1 1 2

0 2

kN

nN k l N k N

N k Nn

===

/ /

/00

1N

sin, ,

,2 2 2 1 1 2

0 0 2

kN

nN k l N k N

k Nn

===

/ /

/00

1N

cos,

2 0 1 1

00

1k

Nn

k N

N k Nn

N

==

sin,

2 0 1 1

00

1k

Nn

k N

N k Nn

N

==

Page 642: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

630 Signals and systems primer with MATLAB

A.4 Summation formulasFinite summation formulas

Infinite summation formulas

aa

aak

n

k

n

=+

=

11

11

0

,

kaa n a na

aak

n n

k

n

= + + +

=

( ( ) )( )

1 11

11

21

k aa a n a n n a n ak

n n n2

2 2 1 21 1 2 2 12

= + + + + + +[( ) ( ) ( ) ]]( )1

13

1= aa

k

n

kn n

k

n

= +

=

( )12

1

kn n n

k

n2

1

1 2 16

= + +

=

( )( )

kn n

k

n3

2 2

1

14

= +

=

( )

( )2 1 2

0

2 1

k nk

n

+ ==

aa

ak

k

= <=

11

10

kaaa

ak

k

= <= ( )1

12

0

Page 643: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Appendix A: Mathematical formulas 631

A.5 Series expansions

A.6 Logarithms

k aa a

aak

k

22

30

11= + <

= ( )

e aa aa = + + + +12 3

2 3

! !�

ln( )12 3 4

12 3 4

+ = + + <a aa a a

a�

sin! ! !

a aa a a= + +

3 5 7

3 5 7�

cos! ! !

aa a a= + +12 4 6

2 4 6

tan a aa a a

a= + + + + <3 5 7

3215

17315 2

sinh! ! !

a aa a a= + + + +

3 5 7

3 5 7�

cosh! ! !

aa a a= + + + +12 4 6

2 4 6

tanh a aa a a

a= + + <3 5 7

3215

17315 2

( )( )

!( )( )

!1 1

12

1 23

12 3+ = + + + + <a nan n

an n n

a an �

log log logloglogb a b

a

a

N N aNb

= =

Page 644: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

632 Signals and systems primer with MATLAB

A.7 Some definite integrals

x e dxa

ax2

0

3

2=

x e dxn

aan ax

n+= >0

10

!

e dxa

aa x = >2 2

02

0

xe dxa

aa x = >2 2

0

2

12

0

ex

mx dxma

aax

= >sin tan0

1 0

sin mxx

dx =2

0

Page 645: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

633

appendix B

Suggestions and explanations for MATLAB use

Before using the text, it is suggested that readers who do not have a lot ofexperience with MATLAB review this appendix and try to execute the pre-sented material in MATLAB.

B.1 Creating a directoryIt was found by the author that it is less confusing if for a particular projectwe create our own directory where our developed MATLAB m-files arestored. However, any time we need any of these files, we must include thedirectory in the MATLAB path. Let us assume that we have the followingdirectory path: c:\ap\sig-syt\ssmatlab. We can use the following twoapproaches:

>>cd ‘c:\ap\sig-syst\ssmatlab’

or

>>path(path,’c:\ap\sig-syst\ssmatlab’)%remember to introduce %the path any time you start new

%MATLAB operations; the symbol % is necessary

%for the MATLAB to ignore the explanations;

The MATLAB files are included in the ‘ssmatlab’ directory.

B.2 HelpIf we know the name of a MATLAB function and would like to know howto use it, we write the following command in the command window:

>>help sin

or

Page 646: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

634 Signals and systems primer with MATLAB

>>help exp

etc.If we want to look for a keyword, we write:

>>lookfor filter

B.3 Save and loadWhen we are in the command window and have created many variablesand, for example, would like to save two of them in a particular directoryand in a particular file, we proceed as follows:

>>cd ‘c:\ap\matlabdata’

>>save data1 x dt %it saves in the matlabdata directory the %file data1 having

%the two variables x and dt;

Let us assume now that we want to bring these two variables in theworking space to use them. First, we change directory, as we did above, andthen we write in the command window:

>>load data1

Then, the two variables will appear in the working space ready to be used.

B.4 MATLAB as calculator>>pi^pi-10;

>>cos(pi/4);

>>ans*ans; %the result will be ( /2) × ( /2) = 1/2 because

%the first output

%is eliminated, only the last output is kept in the form of ans;

B.5 Variable names>>x=[1 2 3 4 5];

>>dt=0.1;

>>cos(pi*dt);%since no assignment takes place there is no %variable;

B.6 Complex numbers>>z=3+j*4;%note the multiplication sign;

>>zs=z*z;%or z^2 will give you the same results;

>>rz=real(z);iz=imag(z):%will give rz=3, and iz=4;

>>az=angle(z); abz=abs(z);%will give az=0.9273 rad, and abz=5;

>>x=exp(-z)+4;%x=3.9675+j0.0377;

2 2

Page 647: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Appendix B: Suggestions and explanations for MATLAB use 635

B.7 Array indexing>>x=2:1:6; %x is an array of the numbers {2, 3, 4, 5, 6};

>>y=2:-1:-2: %y is an array of the numbers {2, 1, 0, -1, -2};

>>z=[1 3 y];%z is an array of the numbers {1, 3, 2, 1, 0, -1, -2};

%note the required space between array numbers;

>>xt2=2*x; %xt2 is an array of numbers of x each one multiplied %by 2;

>>xty=x.*y; %xty is an array of numbers which are the result of

%multiplication of corresponding elements, that is

%{4, 3, 0, -5, -12};

B.8 Extracting and inserting numbers in arrays>>x=2:1:6;

>>y=[x zeros(1,3)];%y is an array of the numbers {2, 3, 4, 5, %6, 0, 0, 0};

>>z=y(1,3:7); %1 stands for row 1 which y is and 3:7 instructs %to keep columns

%3 through 7 the result is the array {4, 5, 6, %0, 0};

lx=length(x);%lx is the number equal to the number of columns %of the row

%vector x, that is lx=5;

x(1,2:4)=4.5*(1:3);%this assignment substitutes the elements %of x at column

%positions 2,3 and 4 with the numbers 4.5*%[1 2 3]=4.5, 9,

%and 13.5, note the columns of 2:4 and %1:3 are the same;

x(1,2:2:length(x))=pi;%substitutes the columns 2 and 4 of x with

%the value of pi, hence the array is %{2, 3.1416, 4, 3.1416, 6};

B.9 Vectorization>>n=0:0.2:1;

>>s=sin(0.2*pi*n);%the result of these two commands gives the %signal s

%(sine function) at times (values of n) %0, 0.2, 0.4, 0.6, 0.4, 1;

Page 648: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

636 Signals and systems primer with MATLAB

This approach is preferable since MATLAB executes faster with thevectorization approach rather than the loop approach, which is

>>s=[];%initializes all values of vector s to zero;

>>for n=0:5%note that the index must be integer;

>>s(n+1)=sin(0.2*pi*n*0.2);%since we want values of s every %0.2 seconds

%we must multiply n by 0.2; note also that

%for n=0 the variable becomes s(1) and this

%because the array in MATLAB always starts

%counting columns from 1;

>>end

The results are identical with those of the previous approach.

B.10 MatricesIf a and b are matrices such that a is 2 × 3 and b is 3 × 3, then c = a*b is a2 × 3 matrix.

>>a=[1 2; 4 6]; %a is a 2x2 matrix ;

>>b=a’;%b is a transposed 2x2 matrix of a and is ;

>>da=det(a);%da is a number equal to the determinant of a, da=-2;

>>c=a(:);%c is a vector which is made up of the columns of a, %c=[1 4 2 6];

>>ia=inv(a); ia is a matrix which is the inverse of a;

>>sa1=sum(a,1);%sa1 is a row vector made up of the sum of the %rows, sa1=[5 8];

>>sa2=sum(a,2);%sa2 is a column vector made up by the sum of %the columns, sa2=[3 10]’;

B.11 Produce a periodic function>>x=[1 2 3 4];

>>xm=x’*ones(1,5);%xm is 4 × 5 matrix and each of its column is x’;>>xp=xm(:)’;%xp is a row vector, xp=[x x x x x];

B.12 Script filesScript files are m-files that when we introduce their names in the commandwindow we receive the results. However, we must have the directory that

1 2

4 6

1 4

2 6

Page 649: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Appendix B: Suggestions and explanations for MATLAB use 637

includes the file in the MATLAB search directories. You can modify the fileany desired way and get new results. Suppose that any time we ask for thefile pexp.m the magnitude and angle of the exponential function areplotted. To accomplish this, we first go to the command window and opena new m-file. At the window we type the file as shown below. As soon aswe finish typing, we click on Save as and save the file in, say, :c:\ap\ssmatlab.If we want to see the results, at the command window we just write pexpand hit the enter key.

Script file pexp.m

>>w=0:pi/500:pi-pi/500;%they are 500 at pi/500 apart;

>>x=exp(j*w);ax=abs(x);anx=angle(x);

>>subplot(2,1,1);plot(w,ax,’k’)%’k’ means plot line in black;

>>xlabel(‘\omega rad/s’);ylabel(‘Magnitude’);

>>subplot(2,1,2);plot(w,anx,’k’);

>>xlabel(‘\omega rad/s’);ylabel(‘Angle’);

If we have the function

and want to plot the results as above, we substitute in the script file thefunction x with the function

x=2*exp(j*w)./(exp(j*w)-0.5);

In the above MATLAB expression note the dot before the slash. This instructsMATLAB to operate at each value of w separately, and thus give results ateach frequency point.

B.13 FunctionsWe will present here an example of how to write functions. The reader shouldalso study the functions that are presented throughout the book. In Fourierseries, for example, we have to plot functions of the form

and we want to plot this sum of cosines with each one having a differentamplitude and frequency. Let A = [1 0.6 0.4 0.1], , and . Weapproach this solution by vectorizing the summation. The MATLAB functionis of the form

ej

20 5

ee

j

j .

s t A n tn

n

N

( ) cos==

0

0

0 2= 0 4t

Page 650: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

638 Signals and systems primer with MATLAB

function[s]=sumofcos(A,N,w0,rangeoft)

n=0:N-1;

s=A*cos(w0*n’*rangeoft)

%when we want to use this function at the command window to

%find s we write for example:

>>A=[1 0.6 0.4 0.1];N=4;w0=2;rangeoft=0:0.05:6;

>>[s]=sumofcos(A,N,w0,rangeoft); %at the enter key click the %vector s is one of the variables in the command window %and it can be plotted at the wishes of the reader; we %must secure that the directory in which sumofcos function %exists is in the MATLAB path; after you type the function %in the editing window you save as.. in the directory, %for example, c:\ap\ssmatlab and filename: sumofcos.m

It is recommended that the reader set small numbers for N (N = 4) andthe range of t (0:0.2:1) and produce first the matrix cos(w0*n'*t) and then seethe result A*cos(w0*n'*t).

B.14 SubplotsIf, for example, we would like to plot four separate plots in a page, we write:

>>subplot(2,2,1);plot(x,y)%plots on the first half row a plot %of x versus y;

>>subplot(2,2,2);plot(x1,y1); %plots on the second half of the %first row;

>>subplot(2,2,3);plot(x2,y2); %plots the first half of the %second row;

>>subplot(2,2,4);plot(x3,y3); %plots the second half of the %second row;

%if we are working, say, in %subplot(2,2,4) and we want

%to add labels in subplot(2,2,2) we write;

>>subplot(2,2,2);

>>xlabel(‘Frequency’);ylabel(‘Magnitude in dB’);

B.15 FiguresIf we have plotted something in figure(1) and we want to see another plot,without erasing the first plot, we write:

>>figure(2);

>>plot(x,y);%it will leave the plot in figure(1) but will now %plot in figure(2) and both

Page 651: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Appendix B: Suggestions and explanations for MATLAB use 639

%will be available; if we want, next, to add %something to figure(1), we

%write:

>>figure(1);

>> %and continue on figure(1);

B.16 Changing the scales of the axes of a figureTo change scale we write:

>>axis([minimum x maximum x minimum y maximum y]);%for example,

%we write: axis([1 166 -60 0]);

B.17 Writing Greek lettersSay, for example, we have a figure in which we want to place the followingwords: in rad/s, in rad per unit. In the command window we write:

>>gtext(‘\omega in rad/s, \Omega in rad per unit’);

%at the return, a cross hair will appear in the %figure and we can set the cross

%point anywhere we want; at the click of the mouse %the above sentence

%will appear; observe the slash direction and the %greek letter designation

%starting with small letter and a capital letter; %the same approach we use for

%labeling, for example, xlabel(‘\lambda and \Pi’) %will create the following

%label along the x axis: and ;

The following table gives some additional information:

For the Greek letters we have delta, gamma, lambda, omega, phi, pi, psi,sigma, theta, upsilon, xi, eta, iota, kappa, mu, nu, omega, rho, tau, and zeta.All these need the slash before them, and if we want capital letters, the firstletter must be capital.

÷\ . \ \ \ \

\

approx bullet o circ div downarrow

epsiilon equiv exists forall geq

ty

\ \ \ \

\ inf \ innt \ \ \

\ \ \±

leftarrow leq neq

partial pm subseet

Page 652: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

640 Signals and systems primer with MATLAB

B.18 Subscripts and superscriptsIf we want to write the following expression in a figure, , in the commandwindow we write:

>>gtext(‘t_{i,j}^{2\pix}’);

B.19 Lines in plots>>plot(x,y,’.’); %will plot blue dots at the {x,y} points;

>>plot(x,y,’.r’) %will plot red points; if we substitute the r %with k, we get black dots; g

%letter will give green.

>>plot(x,y,’g’);%will plot green lines;

>>plot(x,y,’xr’);%will plot red lines with x’s;

>>plot(x,y,’-r’,x,y,’xk’);%plots green continuous line and at %the {x,y} points puts black x’s;

The following information is valuable:

Color: ‘y’, ‘r’, ‘g’, ‘b’, ‘k’Line style: ‘-’ for solid, ‘- -’ for dashed, ‘:’ for dotted, ‘–·’ for dash-dotMarkers: ‘+’, ‘o’, ‘*’, ‘x’, ‘s’ for square, ‘d’ for diamond

ti jx

,2

Page 653: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

641

Index

Aabs, 442, 445Aliasing, 247, 251Amplitude, 1

modulation, 14, 204, 205pulse, 223

response, 479sinusoidal wave, 4transfer function, 227

Analog filter(s). See also Filter(s)design, 477–501

using MATLAB functions, 500–501ideal frequency response characteristics,

478Analog signal, 250

construction from sampled values, 252–253Analog systems

digital simulation, 118–131problems, 144–146

Analog-to-digital converter, 2Angle, 442, 445Angular velocity, 50Asymmetric method, 575Autocorrelation, 219, 550

matrix, 554–557unbiased sample, 551

Autoregressive filter, 565Autoregressive process, 565–567Averages, 548–553

mean value, 548–549problems, 579–580

BBandwidth, 4, 205, 224, 496

finite, 239limitation, 4

low-pass filter, 249time, 225transition, 519widening, 291

Banking, 144Bartlett method, 572–573Bartlett window, 17, 266, 513, 571

Blackman-Tukey periodogram and, 577–578

Basis functions, 18orthonormal, 20

Basis set, 18, 19, 23Batch processing, 623Bilinear transformation, 532–538, 543–544

problems, 543–544Bioengineering, 325–327Biomedical engineering, 102Blackman-Tukey method, 570–572Blackman-Tukey periodogram, Bartlett

window and, 577–578Blackman window, 266, 572Block diagram(s), 42, 68

elementary rules, 69operator, 69pick-off point, 68, 69representation, 68–71, 72–74

problems, 103–104summation point, 69

Bode plot(s), 377–382of constants, 377–378differentiator, 378–379problems, 396–399for real pole, 379–382

Butterfly, 306Butterworth filter(s), 479–486

design, 500left-hand-side poles of fourth-order, 481phase and amplitude characteristics of

second-order, 484

Page 654: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

642 Signals and Systems Primer with MATLAB

polynomials, 482problems, 501–502

CCarrier frequency, 204Cascade stabilization, 365–366Casoratian determinant, 451Causality, 43, 137, 505Central ordinate, 219Channel, defined, 231Channel equalization, 618–621Chebyshev filter, 489–492

files, 501low-pass, 486–493, 502problems, 502

Chebyshev polynomials, 486, 487Chemical engineering, 128–131Chi-square distribution, 560Comb function, 13Communication channel, 3Communication system, 2

distortion, 3message, 3receiving signal, 3

Complex conjugate, 181Complex functions, 157–161

problems, 181–182Complex signals, 6Compressed, 293Compression, 293Computer system, 57–60Conductance, 47Continuous functions

features of periodic, 169–174Fourier series, 161–169

Continuous signal, sampling, 239–256. See also Sampling

Continuous-time signal(s)convolution, 71, 74–83correlation, 84–86problems, 105–106

Controller, 371Convolution, 56, 173–174, 261

associative property, 80–83of continuous-time signals, 71, 74–83

problems, 105–106of discrete-time signals, 135–142

problems, 148–149frequency, 217–218, 275–277property, 417–423

Correlation, 84–86, 261, 300, 549–552of sequences, 149

Correlation matrix, 592, 593, 595, 602, 604, 606output, 620

Correlogram spectral estimator, 568Cost function, 583, 590Covariance, 553Critically damped response, 371Critically damped second-order system, 452Cross-correlation, 549Cumulative density function, 546

DD’Alembert’s principle, 325Damper element, 49–50, 52Decimation, 284–291

in time procedure, 304–307Deconvolution, 83Delay element, 112Delta functions, 10, 190Delta sampling, 248Demodulation, 206Dependent variable, 53Detection schemes, 206Determinant, 34Deterministic systems, 43DFT. See Discrete Fourier transform (DFT)Difference equation(s), 113

first order, 114higher order, 450–458

problems, 471–473Differential equation(s)

Euler’s approximation, 152–155higher order, 450–458homogeneous, 54nonhomogeneous, 55standard solution techniques, 56–63

for computer system, 57–60for economics, 62–63for electro-optics, 60–62

systems, 350–351Digital signal(s), 2Digital signal processing

multirate, 284–295Digital simulation

analog systems, 118–131problems, 144–146

of higher-order differential equations, 131–135

problems, 146–147Digital systems, higher-order, frequency

response in, 443–450Dirac delta function, 10Dirichlet conditions, 162, 190Discrete energy spectral density, 303

Page 655: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Index 643

Discrete Fourier transform (DFT), 269–271inverse, 269properties, 271–284

frequency, 275–277Parseval’s theorem, 277–278proofs, 300–304shifting property, 272–274time convolution, 274–275

Discrete frequency, 7Discrete random signal, 545, 548Discrete source, 111Discrete system(s)

block diagram representation (See Block diagram(s))

equations and, 111–118problems, 142–144

first-order, frequency response of, 438–443

linear time-invariant, 268phase shift in, 443

Discrete-time Fourier transform (DTFT), 257–267

approximating, 257–260of finite time sequences, 262–267properties, 260–262

problems, 296–298proofs of, 298–300

windowing, 266–267Discrete-time stochastic process, 546Discrete-time systems, 43

signals, 135–142, 148–149Discrete-time transforms, 257–307Distortion, 3Distortionless filter, 228–229Distributed parameters, 42Dot product, 18Double-sided suppressed carrier

modulation, 206Down sampler, 284Down sampling, 284–286, 285

block diagram representation, 285frequency domain of signals, 286–291MATLAB function for, 285–286signals, frequency domain of, 286–291

DTFT. See Discrete-time Fourier transform (DTFT)

EEconomics, differential equation for, 62–63Edge detection, 106Edge detector, 106Electro-optics, 60–62Electromechanical system, 323–325

Energy relation, 170Energy-storing element, 53Engineering economics, 117–118Ensemble of realization, 547Environmental engineering, 102–103, 349Equilibrium price, 63Ergodic process, 548, 549Ergotic process, 551, 579Error signal, 70, 325, 372, 611Euler equations, 6Euler method, 153–155Event, 547Expectation, 548–549Exponential order, 310

FFast Fourier transform (FFT), 189, 257,

304–307, 568–569Feedback stabilization, 367–368Feedback system, 69, 365–377

error signal, 372output sensitivity function, 369rejection of disturbance using, 369sensitivity in, 368–369

FFT. See Fast Fourier transform (FFT)Filter(s). See also Finite impulse response

(FIR) filtersautoregressive, 565Butterworth, 479–486Chebyshev, 489–492

files, 501low-pass, 486–493, 502problems, 502

defined, 477design using MATLAB functions, 500–501digital, frequency transformations for,

538–542, 544distortionless, 228–229frequency transformations, 494–500general aspects of, 477–479ideal high-pass, 230ideal low-pass, 229–230linear time-invariant, 226–230matched, 83–84maximally flat, 480normalized, 483optimum, 603–608phase characteristics, 494prescribed specifications using Kaiser

window, 519–522problems, 524

problems, 501–505types, 501

Page 656: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

644 Signals and Systems Primer with MATLAB

whitening, 565Wiener, 590, 591–594

examples, 597–608problems, 624–625self-correcting, 608

Filtering, 4matched, 83–84properties, 357random processes, 562–567

problems, 581Final value property, 417Finite duration impulse response, 115–116Finite impulse response (FIR) filters, 436, 437,

505–524antisymmetric, 506band-pass, 522band-stop, 523causal, 506design, 522–523high-pass, 522linear phase, 506low-pass, 522

symmetric, 508–509MATLAB design, 522–523properties, 505–509

causality, 505frequency, 505–506phase consideration, 506–507problems, 523scaling transfer function, 508

stability, 505symmetric, 506, 508–509using Fourier series approach, 509–512

problems, 523using windows, 513–519, 523

main lobe, 513problems, 524ripple ratio, 513

Finite impulse response (FIR) system, 115–116Finite signals, 172–173FIR filters. See Finite impulse response (FIR)

filtersFirst order discrete system, 438–443

problems, 467–468First-order hold, 252First order system(s), 52–63

problems, 100–103Fold-over frequency, 7Fourier series, 162–169

in complex exponential form, 162–165transform pair, 163in trigonometric form, 165–169

Fourier series of continuous functions, 161–169

problems, 182–185

Fourier transform(s)direct and inverse, 190–196

problems, 231–232pairs, 220–224, 237–238properties, 196–220

central ordinate, 200–201continuous-time, 218–219derivatives, 208–213frequency convolution, 217–218frequency shifting, 202linearity, 196modulation, 202–207problems, 232–236scaling, 200symmetry, 196–198time convolution, 216time shifting, 199

real functions, 194–196Frequency convolution, 217–218, 275–277Frequency differentiation, 219Frequency division multiplexing, 206Frequency interpretation, 549, 550Frequency response

discrete system, 438–443first order discrete system, 438–443,

467–468function, 439higher-order digital systems, 443–450LTI systems, 352–360

Frequency shifting, 219, 261, 299, 301Frequency transformations

for digital filters, 538–542problems, 544

low-pass-to-band-pass, 495–498low-pass-to-band-stop, 498–500low-pass-to-high-pass, 495low-pass-to-low-pass, 494–495MATLAB functions for, 500–501problems, 503

Full-wave rectified signal, 183

GGaussian processes, 558–559Generalized functions, 190Gibbs’ phenomenon, 164, 225–226Gram–Schmidt orthogonalization process, 31

HHalf-wave rectified signal, 183Hamming window, 17, 266, 513, 523, 571Hanning window, 17, 266, 523, 572Heat transfer, 101

Page 657: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Index 645

Higher-order digital systems, 443–446Hurwitz polynomials, 484

IIdeal high-pass filter, 230Ideal low-pass filter, 229–230Impulse function, 10Impulse-invariant design method, 525–532

problems, 543Impulse response, 74, 86–96, 337

problems, 107–108symmetrical, 507

Independent and identical distribution, 550, 553, 559, 580

Independent random variables, 553, 558Indexed random variables, 545, 548Inductor, 45–47Infinite impulse response (IIR) filters, 525–544

design, 525–543bilinear transformation, 532–538,

543–544frequency transformation for digital

filters, 538–542, 544impulse-invariant method, 525–532recursive vs. non-recursive, 542–543

Infinite impulse response (IIR) system, 114, 436, 437

Infinite order, 510Information source, 2Initial condition, 53, 54Initial state, 55Initial time, 53Initial value problems, 152Initial value property, 417Innovations process, 565Innovations representation, 565Input, 41Integer, 285Integral, 313–314Integration constant(s), 152

evaluation of, 63–68circuit behavior L and C, 65conservation of charge, 64conservation of flux linages, 64–65general switching, 65–68problems, 103–104switching of sources, 64

Interpolation, 284, 291–295block diagram of, 292by factor U, 291–292signals, 292–295

Interpolation function, 244Intersymbol interference, 618

KKaiser window, 513, 519–522

LLags, 550Laplace transform, 309–399

inverse, 328–336problems, 390

one-sided, 309–312problems, 383–384

problem solving with, 336–351impulse response, 337problems relating to, 390–394step response, 338superposition, 338time invariance, 338

properties, 312–316complex frequency shift, 398final value, 316, 399frequency shift, 315initial value, 316, 399integral, 313–314, 397–398linearity, 397multiplication by exponential, 314, 398multiplication by t, 314, 398problems, 384–385proofs, 397–399scaling, 315, 398time convolution, 315, 399time derivative, 313, 397time shifting, 314–315, 398

Leakage, 283, 570Least mean square

algorithm, 609examples using, 614–622problems, 625

applications, 614–622normalized, 621

Least squares technique, 583–589problems, 623–624

Left-shifting property, 415–416Legendre function, 22, 31Linear and rotational mechanical systems,

388Linear continuous-time systems, 41–109

problems, 97–109Linear interpolation, 252Linear least square(s), 587–589Linear least square approximation, 583Linear mechanical system, 389Linear prediction, 614–616

modeling, 616–617

Page 658: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

646 Signals and Systems Primer with MATLAB

Linear system(s), 43continuous-time, 41–109

problems, 97–109feedback, 365–377

cascade stabilization of systems, 365–366

parallel composition, 366–367problems, 396proportional integral differential

controllers, 375–376rejection of disturbance using, 369sensitivity in, 368–369stabilization, 367–368step response, 370–375

with periodic inputs, 174–180problems, 186–187

Linear time-invariant filters, 226–230Linear time-variant (LTI) discrete system(s),

268Linear time-variant (LTI) system(s), 21, 43

frequency response, 352–360problems, 394–395

pole location and stability of, 361–364transfer functions, 316–328

problems, 386–389Linearity, 137, 218, 260, 298Lognormal distribution, 559–560LTI systems. See Linear time-variant (LTI)

system(s)Lumped parameters, 42

MMain lobe, 513Mass element, 48Matched filters, 83–84Mathematical modeling, 7, 41MATLAB, manipulation of matrices in, 35–36MATLAB function residue, 329–332Matrix(ices)

addition and substractions of, 36adjoint, 34correlation, 592, 593, 595, 602, 604, 606, 620determinant, 34in elementary algebra, 33–35manipulations in MATLAB, 35–36multiplication, 34Toeplitz, 555, 567transposition of, 36

Maximally flat filter, 480Mean square error, 23, 590–597

minimum, 595surface, 593

Mean value, 548–549

Mechanical system, 321–323Message, 3Method of undetermined coefficients, 54, 150,

454–458Method of variation of parameters, 149–152Microphone, 386Minimum error, 593Minimum mean square error, 595, 602Modulation, 2, 14, 202, 219, 261, 299

amplitude, 14, 204, 205pulse, 223

double-sided suppressed carrier, 206frequency, 29, 204index, 205need for, 204properties, 203single-sideband, 206sinusoidal, 205tone, 205

Monte Carlo method, 98Multiplication

matrices, 34Multiplication by n property, 416Multirate digital signal processing, 284–295Multivariate distributions, 546

NNoise cancellation, 605, 617–618Nonanticipatory systems, 43Noncausal transfer function, 510Nonlinear systems, 43

linearization of, 132Nonparametric spectral estimation, 568

Bartlett method, 572–573Blackman–Tukey method, 570–572Blackman–Tukey periodogram with

Bartlett, 577–578correlogram, 568modified Welch method, 575–577periodogram, 568, 570problems, 581Welch method, 573–575

Nonrecursive system, 115Normalized filter, 483Nyquist frequency, 239, 244, 247, 248Nyquist interval, 246

OOperator, 47Optimum filter, 603–608Optimum Wiener coefficients, 593Orthogonal variable, 553Orthogonality condition, 597

Page 659: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Index 647

Orthonormal function, 20Output response, 41Overdamped response, 371Overdamped second-order system, 452

PParallel composition, 366–367Parseval formula, 169–170, 261Parseval's theorem, 213, 219, 261, 277, 300, 303Particular solution, 57Percent overshoot, 370Periodic continuous functions, 4

features, 169–174problems, 18–186

Periodic sequence property, 416Periodogram(s), 570, 574, 575

nonparametric spectra estimation, 568Periodogram spectral estimate, 303Periodogram spectral estimator, 569Phase characteristics, 494Phase transfer function, 227Physical system, 41Plant, 371Power spectrum, 560–561, 563, 565, 566Probability density function, 545Projection theorem, 31Proper fractions, 423Proper function, 333Proportional controllers, 371–377Proportional integral differential controllers,

375–377pth order IIR filter, 438Pulse amplitude modulation, 223Pure sinusoid function, 250

Qqth order FIR filter, 438Quantitative description, 2

RRadius of gyration, 51Random processes, 562–567Random sequels, 557–560Random sequence, 546Random signals, 545–548

special, 557–560problems, 580

Random variables, 545, 548, 553, 558realization of, 555

Realization, 547, 592

defined, 546, 547ith, 549of random variables, 555of stochastic process, 548

Receiving signal, 3Rectangle window, 17, 226, 263, 266, 283, 513,

571Rectangular pulse function, 8Recursive filters, Infinite impulse response

(IIR) filtersReplacement rate, 349Resistance, 47Resistor, 47–48Ripple factor, 181, 183, 184, 495, 543Ripple ratio, 513Rise time, 370Root locus, 372

SSample mean value, 548, 549Sample variance, 548Sampled function, 13–14, 243, 246, 251, 259,

269, 402Sampling, 239–256

delta, 248down, 284–286, 285

block diagram representation, 285frequency domain of signals, 286–291MATLAB function for, 285–286signals, frequency domain of, 286–291

frequency, 6, 240, 506, 571, 583fundamentals, 239–244interval, 239problems, 254–256rate, 240theorem, 244–253time, 6, 125

changing, 130up, 291–295

frequency domain characterization of signals, 292–295

values, 239Scalar multiplier, 112Scaling, 200, 315, 398

digital transfer function, 507–508time, 15–16, 219, 415

Second-order systems, 344Separate roots, 329Sequence(s)

correlation of, 149down-sampled, 286–291DTFT of finite time, 262–267up-sampled, 291–295

Page 660: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

648 Signals and Systems Primer with MATLAB

Sequential processing, 623Shape, 1Shifting property, 272–274, 413–415Signal(s)

amplitude, 1applications involving, 1bandwidth, 4, 205, 224, 496 (See also

Bandwidth)coding, 2complex, 5conditioning and manipulation, 14–17

modulation, 14shifting and flipping, 14time scaling, 15–17windowing of scaling, 17

continuous-time, 71, 74–86, 105–106convolution (See Convolution)digital, 2discrete, 1

nonperiodic special, 10–13arbitrary sampled function, 13comb function, 13delta function, 10–12

modulation, 2nonperiodic continuous, 7–10

rectangular pulse function, 8sinc function, 9–10unit step, 7–8

nonperiodic special discrete, 10–13arbitrary sampled function, 13comb function, 13delta function, 10–12

periodic discrete time, 6–7quantitative description, 2receiving, 3, 5representation, 18–25shape, 1simple time, 3–13time duration, 1transducer, 1variance, 548, 591, 592, 595windowing, 17, 266–267 (See also

Windowing)Simple continuous system(s)

electrical elements of, 43–48capacitor, 43–45inductor, 45resistor, 46–48

mechanical rotational elements of, 50–52

damper, 52inertial element, 50–51spring, 51–52

mechanical translation elements of, 48–50

damper, 49–50ideal mass element, 48spring, 48–49

modeling of, 43–52problems, 97–100

Sinc function, 9–10, 225, 226, 244Sine, 3, 6Single-sideband modulation, 206Sinusoidal wave(s)

amplitude, 4phase spectra, 4

Smoothing system, 144Spectral factorization, 565Spectrum function, 190Spring element, 48–49Stability, 137State, 54Stationary process(es), 548, 554–557

problems, 580purely random process, 557random walk, 557wide-sense, 554, 580

Steady-state response, 372Steady-state solution, 56. 176Step response, 370–375Stochastic process, discrete-time, 546Stochastic systems, 43Survival function, 349Symmetric functions, 170–172

even, 172odd, 172

Symmetric method, 575Symmetric prediction method, 575Symmetry, 219System(s)

across variable, 44, 48causal, 43, 80, 138, 140, 209

response, 74deterministic, 43discrete-time, 43first order

solutions, 52–63problems, 100–103

identification, 616–617impulse response, 74, 86–96, 337

problems, 107–108symmetrical, 507

linear, 43linear time invariant, 43nonanticipatory, 43nonlinear, 43physical, 41properties, 41–43

Page 661: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

Index 649

simple continuouselectrical elements of, 43–48

capacitor, 43–45inductor, 45resistor, 46–48

mechanical rotational elements of, 50–52

damper, 52inertial element, 50–51spring, 51–52

mechanical translation elements of, 48–50

damper, 49–50ideal mass element, 48spring, 48–49

modeling of, 43–52problems, 97–100

stochastic, 43time-varying, 43

System identification, 604–605System transfer function, 432

TTerminal properties, 42Three-dimensional vector space, 19Through variable, 44, 48Time-average formula, 549Time constant, 55Time convolution, 216–217, 219, 274–275,

298–299, 301–303Time derivative, 313Time differentiation, 219Time duration, 1Time invariance, 338Time multiplex, 239Time multiplication, 299Time reversal, 219, 260, 298, 304Time scaling, 15–16, 219

property, 415Time series, 545Time shifting, 218, 260, 298Time-varying systems, 43Toeplitz matrix, 555, 567Torque, 50Tracking error, 372Training mode, 618Training sequence, 366Transducer, 1, 174, 545

rotational electromechanical, 323, 324Transfer function, 82, 177, 179, 209, 215, 228,

431–438

amplitude, 227causal, 511of distortionless filter, 228feedback, 70forward, 70Fourier transform and, 216higher-order, 437–438inverse Fourier transform of, 226loop, 70of LTI systems, 316–328noncausal, 510open-loop, 70phase, 227problems, 466–467scaling the digital, 507–508system, 432value, 211z-transform, 431–438

Transient solution, 56, 100Transition bandwith, 519Transversal response, 115–116Transversal system, 115Triangle window, 17, 513, 571

UUnbiased estimator, 549Unbiased sample autocorrelation, 551Uncorrelated random variables, 553Underdamped response, 371Underdamped second-order system, 452Undetermined coefficients, 54, 150, 454–458Up-sampled signals, 292–295Up sampler, 284

block diagram representation, 292Up sampling, 291–295

frequency domain characterization of signals, 292–295

VVariable(s)

dependent, 53independent random, 553, 558indexed random, 545, 548orthogonal, 553random, 545, 548through, 44, 48uncorrelated random, 553

Variance, 548, 591, 592, 595Variation of parameters, 129Vibration isolator, 102

Page 662: SIGNALS and SYSTEMS PRIMER with MATLABwp.kntu.ac.ir/dfard/ebook/sas/Alexander D... · Signals and Systems is designed for use as a one-semester analog track, a one-semester digital

650 Signals and Systems Primer with MATLAB

WWalsh functions, 32Warping, 534Weakly stationary process, 554Welch method, 573–575

modified, 575–577White Gaussian noise, 558, 563White noise, 550, 557–558Whitening filter, 565Wide-sense stationary process, 554, 580Wiener coefficients, 593Wiener filter(s), 590, 591–594

examples, 597–608problems, 624–625self-correcting, 608

Wiener–Hopf equation, 595Wiener–Kintchin relations, 560–562

even function, 561power spectrum, 560problems, 580

Wiener solution, 594–597Windowing, 17, 266–267

Bartlett, 17, 266, 513, 571, 577–578Blackman, 266, 572Hamming, 17, 266, 513, 523, 571Hanning, 17, 266, 523, 572Kaiser, 513, 519–522rectangle, 17, 226, 263, 266, 283, 513, 571triangle, 17, 513, 571

Wroskian determinant, 451

YYule-Walker equation, 601

ZZ-transform

convergence, 405–412problems, 460–461

essential features, 401–405inverse, 423–431

problems, 464–466Laplace transform and, 402pairs, 459–460problems, 459–460properties, 412–423

convolution, 417–423final value, 417initial value, 417inverse, 423–431left shifting, 415–416linearity, 413multiplication by n, 417pairs, 423periodic sequence, 416problems, 461–464proofs, 473–476shifting property, 413–415time scaling, 415transfer function, 431–438

higher-order transfer, 437region of convergence, 405region of divergence, 405solution of first-order difference

equations, 447–450problems, 468–471

Zero-input response, 54, 55, 80Zero-input solution, 337, 450Zero mean sequence, 558, 604Zero-order hold, 252Zero-state response, 80Zero-state solution, 337, 450Zplane, 481