Tải bản đầy đủ (.pdf) (708 trang)

practical matlab applications for engineers

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (7.23 MB, 708 trang )

PRACTICAL MATLAB
®
APPLICATIONS FOR
ENGINEERS
CRC_47760_fm.indd iCRC_47760_fm.indd i 7/28/2008 12:32:49 PM7/28/2008 12:32:49 PM
Handbook of Practical MATLAB
®
for Engineers
Practical MATLAB
®
Basics for Engineers
Practical MATLAB
®
Applications for Engineers
CRC_47760_fm.indd iiCRC_47760_fm.indd ii 7/28/2008 12:32:49 PM7/28/2008 12:32:49 PM
PRACTICAL MATLAB
®
FOR ENGINEERS
PRACTICAL MATLAB
®
APPLICATIONS FOR
ENGINEERS
Misza Kalechman
Professor of Electrical and Telecommunication Engineering Technology
New York City College of Technology
City University of New York (CUNY)
CRC_47760_fm.indd iiiCRC_47760_fm.indd iii 7/28/2008 12:32:49 PM7/28/2008 12:32:49 PM
MATLAB® is a trademark of The MathWorks, Inc. and is used with permission. The MathWorks does not warrant the
accuracy of the text or exercises in this book. This book’s use or discussion of MATLAB® software or related products
does not constitute endorsement or sponsorship by The MathWorks of a particular pedagogical approach or particular


use of the MATLAB® software.
This book was previously published by Pearson Education, Inc.
CRC Press
Taylor & Francis Group
6000 Broken Sound Parkway NW, Suite 300
Boca Raton, FL 33487-2742
© 2009 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
Printed in the United States of America on acid-free paper
10 9 8 7 6 5 4 3 2 1
International Standard Book Number-13: 978-1-4200-4776-9 (Softcover)
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 valid-
ity 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, transmitted, or uti-
lized in any form by any electronic, mechanical, or other means, now known or hereafter invented, including photocopy-
ing, 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 orga-
nizations 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.
Library of Congress Cataloging-in-Publication Data
Kalechman, Misza.

Practical MATLAB applications for engineers / Misza Kalechman.
p. cm.
Includes bibliographical references and index.
ISBN 978-1-4200-4776-9 (alk. paper)
1. Engineering mathematics Data processing. 2. MATLAB. I. Title.
TK153.K179 2007
620.001’51 dc22 2008000269
Visit the Taylor & Francis Web site at

and the CRC Press Web site at

CRC_47760_fm.indd ivCRC_47760_fm.indd iv 7/28/2008 12:32:50 PM7/28/2008 12:32:50 PM
v
Contents
Preface vii
Author ix
1 Time Domain Representation of Continuous and Discrete Signals 1
1.1 Introduction 1
1.2 Objectives 4
1.3 Background 4
1.4 Examples 58
1.5 Application Problems 93
2 Direct Current and Transient Analysis 101
2.1 Introduction 101
2.2 Objectives 103
2.3 Background 104
2.4 Examples 138
2.5 Application Problems 208
3 Alternating Current Analysis 223
3.1 Introduction 223

3.2 Objectives 224
3.3 Background 226
3.4 Examples 267
3.5 Application Problems 310
4 Fourier and Laplace 319
4.1 Introduction 319
4.2 Objectives 321
4.3 Background 322
4.4 Examples 376
4.5 Application Problems 447
5 DTFT, DFT, ZT, and FFT 457
5.1 Introduction 457
5.2 Objectives 458
5.3 Background 459
5.4 Examples 505
5.5 Application Problems 556
6 Analog and Digital Filters 561
6.1 Introduction 561
6.2 Objectives 562
6.3 Background 563
6.4 Examples 599
6.5 Application Problems 660
Bibliog raphy 667
Index 671
CRC_47760_fm.indd vCRC_47760_fm.indd v 7/28/2008 12:32:50 PM7/28/2008 12:32:50 PM
CRC_47760_fm.indd viCRC_47760_fm.indd vi 7/28/2008 12:32:50 PM7/28/2008 12:32:50 PM
vii
Preface
Practical MATLAB
®

Applications for Engineers introduces the reader to the concepts of
MATLAB
®
tools used in the solution of advanced engineering course work followed by
engineering and technology students. Every chapter of this book discusses the course
material used to illustrate the direct connection between the theory and real-world appli-
cations encountered in the typical engineering and technology programs at most colleges.
Every chapter has a section, titled Background, in which the basic concepts are introduced
and a section in which those concepts are tested, with the objective of exploring a number
of worked-out examples that demonstrate and illustrate various classes of real-world prob-
lems and its solutions.
The topics include
Continuous and discrete signals
Sampling
Communication signals
DC (direct current) analysis
Transient analysis
AC (alternating current) analysis
Fourier series
Fourier transform
Spectra analysis
Frequency response
Discrete Fourier transform
Z-transform
Standard  lters
IRR (in nite impulse response) and FIR ( nite impulse response)  lters
For product information, please contact
The MathWorks, Inc.
3 Apple Hill Drive
Natick, MA 01760-2098 USA

Tel: 508 647 7000
Fax: 508-647-7001
E-mail:
Web: www.mathworks.com














CRC_47760_fm.indd viiCRC_47760_fm.indd vii 7/28/2008 12:32:50 PM7/28/2008 12:32:50 PM
CRC_47760_fm.indd viiiCRC_47760_fm.indd viii 7/28/2008 12:32:50 PM7/28/2008 12:32:50 PM
ix
Author
Misza Kalechman is a professor of electrical and telecommunication engineering technol-
ogy at New York City College of Technology, part of the City University of New York.
Mr. Kalechman graduated from the Academy of Aeronautics (New York), Polytechnic
University (BSEE), Columbia University (MSEE), and Universidad Central de Venezuela
(UCV; electrical engineering).
Mr. Kalechman was associated with a number of South American universities where he
taught undergraduate and graduate courses in electrical, industrial, telecommunication, and
computer engineering; and was involved with applied research projects, design of labo-

ratories for diverse systems, and installations of equipment.
He is one of the founders of the Polytechnic of Caracas (Ministry of Higher Education,
Venezuela), where he taught and served as its  rst chair of the Department of System
Engineering. He also taught at New York Institute of Technology (NYIT); Escofa (of cers
telecommunication school of the Venezuelan armed forces); and at the following South
American universities: Universidad Central de Venezuela, Universidad Metropolitana,
Universidad Catolica Andres Bello, Universidad the Los Andes, and Colegio Universitario
de Cabimas.
He has also worked as a full-time senior project engineer (telecom/computers) at the
research oil laboratories at Petroleos de Venezuela (PDVSA) Intevep and various re neries
for many years, where he was involved in major projects. He also served as a consultant
and project engineer for a number of private industries and government agencies.
Mr. Kalechman is a licensed professional engineer of the State of New York and has
written Practical MATLAB for Beginners (Pearson), Laboratorio de Ingenieria Electrica (Alpi-
Rad-Tronics), and a number of other publications.
CRC_47760_fm.indd ixCRC_47760_fm.indd ix 7/28/2008 12:32:50 PM7/28/2008 12:32:50 PM
CRC_47760_fm.indd xCRC_47760_fm.indd x 7/28/2008 12:32:50 PM7/28/2008 12:32:50 PM
1
1
Time Domain Representation of Continuous
and Discrete Signals
This time, like all time, is a very good one, if we know what to do with it. Time is the
most valuable and the most perishable of all possessions.
Ralph Waldo Emerson
1.1 Introduction
Signals are physical variables that carry information about a particular process or event
of interest. Signals are de ned mathematically over a range and domain of interest, and
constitute different things to different people.
To an electrical engineer, it may be
• A current

• A voltage
• Power
• Energy
To a mechanical engineer, it may be
• A force
• A torque
• A velocity
• A displacement
To an economist, it may be
• Growth (GNP)
• Employment rate
• Prime interest rate
• In ation rate
• The stock market variations
To a meteorologist, it may be
• Atmospheric temperature
• Atmospheric humidity
• Atmospheric pressures or depressions
• Wind speed
To a geophysicist, it may be
• Seismic waves
• Tsunamis
• Volcanic activity
CRC_47760_CH001.indd 1CRC_47760_CH001.indd 1 7/25/2008 4:16:08 PM7/25/2008 4:16:08 PM
2 Practical MATLAB
®
Applications for Engineers
To a physician, it may be
• An electrocardiogram (EKG)
• An electroencephalogram (EEG)

• A sonogram
For a telecommunication engineer, it
may be
• Audio sound wave (human voice or music)
• Video (TV, HDTV, teleconference, etc.)
• Computer data
• Modulated-waves (amplitude modulation [AM],
frequency modulation [FM], phase modula-
tion [PM], quadrature amplitude modulation
[QAM], etc.)
• Multiplexed waves (time division multiplex-
ing [TDM], statistical time division multiplex-
ing [STDM], frequency division multiplexing
[FDM], etc.)
From a block box diagram point of view, signals constitute inputs to a system, and their
responses referred to as outputs. Since many of the measuring, recording, tracking, and
processing instruments of signal activities are electrical or electronic devices, scientists
and engineers usually convert any type of physical variations into an electrical signal.
Electrical signals can be classi ed using a variety of criteria. Some of the signal’s clas-
si cation criteria are
a. Signals may be functions of one or more than one independent variable generated
by a single source or multiple sources.
b. Signals may be single or multidimensional.
c. Signals may be orthogonal or nonorthogonal, periodic or nonperiodic, even, odd,
or present a particular symmetry.
d. Signals may be deterministic or nondeterministic (probabilistic).
e. Signals may be analog or discrete.
f. Signals may be narrow or wide band.
g. Signals may be power or energy signals.
In any case, signals are produced as a result of a process de ned by a mathematical relation

usually in the form of an equation, an algorithm, a model, a table, a plot, or a given rule.
A one-dimensional (1-D) signal is given by a mathematical expression consisting of one
independent variable, for example, audio. A 2-D signal is a function of two independent
variables, for example, a black and white picture. A full motion black and white video can
be viewed as a 3-D signal, consisting of pictures (2-D) that are transmitted or processed at
a particular rate. The dimension of a video signal can be increased by adding color (red,
green, and blue), luminance, etc.
Deterministic and probabilistic signals is another broad way to classify signals. Deter-
ministic signals are those signals where each value is unique, while nondeterministic
signals are those whose values are not speci ed. They may be random or de ned by statis-
tical values such as noise. In this book, the majority of the signals are restricted to 1-D and
2-D, limited to one independent variable usually either time (t) or frequency (f or w), and
CRC_47760_CH001.indd 2CRC_47760_CH001.indd 2 7/25/2008 4:16:09 PM7/25/2008 4:16:09 PM
Time Domain Representation of Continuous and Discrete Signals 3
deterministic such as current, voltage, power, or energy represented as vectors or matrices
by MATLAB
®
.
In this book, following the widely accepted industrial standards, signals are classi ed
in two broad categories
Analog
Discrete
Analog signals are signals capable of changing at any time. This type of signals is also
referred as continuous time signals, meaning that continuous amplitude imply that the
amplitude of the signal can take any value.
Discrete time signals, however, are signals de ned at some instances of time, over a time
interval t ∈ [t
0
, t
1

]. Therefore discrete signals are given as a sequence of points, also called
samples over time such as t = nT, for n = 0, ±1, ±2, …, ±N, whereas all other points are
unde ned.
An analog or continuous signal is denoted by f(t), whereas a discrete signal is represented
by f(nT) or in short without any loss of generality by f(n), as indicated in Figure 1.1 by dots.
An analog signal f(t) can be converted into a discrete signal f(nT) by sampling f(t) with a
constant sampling rate T (a time also referred as T
s
), where n is an integer over the range
−∞ < n < +∞ large but  nite. Therefore a large, but  nite number of samples also referred
to as a sequence can be generated. Since the sampling rate is constant (T), a discrete signal
can simply be represented by f(nT) or f(n), without any loss of information (just a scaling
factor of T).
Continuous time systems or signals usually model physical systems and are best
described by a set of differential equations. The analogous model for discrete models is
described by a set of difference equations.
Signals that occur in nature are usually analog, but if a signal is processed by a computer
or any digital device the continuous signal must be converted to a discrete sequence (using
an analog to digital converter, denoted by A/D), or mathematically by a  nite sequence of
numbers that represent its amplitude at the sampling instances.
Discrete signals take the value of the continuous signals at equally spaced time intervals
(nT). Those values can be considered an ordered sequence, meaning that the discrete sig-
nal represents mathematically the sequence: f(0), f(1), f(2), f(3), …, f(n).
The spacing T between consecutive samples of f(t) is called the sampling interval or the
sampling period (also referred to as T
s
).


0

5
10
Analog signal
t
f(t)
0 1 2 3 4 5 6 7 8 9 10
0
5
10
Discrete signal
n
f(n)
FIGURE 1.1
Analog and discrete signal representation.
CRC_47760_CH001.indd 3CRC_47760_CH001.indd 3 7/25/2008 4:16:09 PM7/25/2008 4:16:09 PM
4 Practical MATLAB
®
Applications for Engineers
1.2 Objectives
After completing this chapter the reader should be able to
Mathematically de ne the most important analog and discrete signals used in
practical systems
Understand the sampling process
Understand the concept of orthogonal signal
De ne the most widely used orthogonal signal families
Understand the concepts of symmetric and asymmetric signals
Understand the concept of time and amplitude scaling
Understand the concepts of time shifting, reversal, compression, and expansion
Understand the reconstruction process involved in transforming a discrete signal
into an analog signal

Compute the average value, power, and energy associated with a given signal
Understand the concepts of down-, up-, and resampling
De ne the concept of modulation, a process used extensively in communications
De ne the multiplexing process, a process used extensively in communications
Relate mathematically the input and output of a system (analog or digital)
De ne the concept and purpose of a window
De ne when and where a window function should be used
De ne the most important window functions used in system analysis
Use the window concept to limit or truncate a signal
Model and generate different continuous as well as discrete time signals, using the
power of MATLAB
1.3 Background
R.1.1 The sampling or Nyquist–Shannon theorem states that if a continuous signal f(t)
is band-limited* to f
m
Hertz, then by sampling the signal f(t) with a constant period
T ≤ [1/(2.f
m
)], or at least with a sampling rate of twice the highest frequency of f(t), the
original signal f(t) can be recovered from the equally spaced samples f(0), f(T), f(2T),
f(3T), …, f(nT), and a perfect reconstruction is then possible (with no distortion).
The spacing T (or T
s
) between two consecutive samples is called the sampling period
or the sampling interval, and the sampling frequency F
s
is de ned then as F
s
= 1/T.
R.1.2 By passing the sampling sequence f(nT) through a low-pass  lter* with cutoff fre-

quency f
m
, the original continuous time function f(t) can be reconstructed (see
Chapter 6 for a discussion about  lters).
*

The concepts of band-limit and  ltering are discussed in Chapters 4 and 6. At this point, it is suf cient for the
reader to know that by sampling an analog function using the Nyquist rate, a discrete function is created from
the analog function, and in theory the analog signal can be reconstructed, error free, from its samples.


















CRC_47760_CH001.indd 4CRC_47760_CH001.indd 4 7/25/2008 4:16:10 PM7/25/2008 4:16:10 PM
Time Domain Representation of Continuous and Discrete Signals 5
R.1.3 Analytically, the sampling process is accomplished by multiplying f(t) by a se-

quence of impulses. The concept of the unit impulse δ(t), also known as the Dirac
function, is introduced and discussed next.
R.1.4 The unit impulse, denoted by δ(t), also known as the Dirac or the Delta function, is
de ned by the following relation:

()tdtϭ
ϩ
1
Ϫ∞



meaning that the area under [δ(t)] = 1,
where
(t) = 0, for t ≠ 0
(t) = 1, for t = 0
δ(t) is an even function, that is, δ(t) = δ(−t).
The impulse function δ(t) is not a true function in the traditional mathematical
sense. However, it can be de ned by the following limiting process:
by taking the limit of a rectangular function with an amplitude 1/τ and width τ,
when τ approaches zero, as illustrated in Figure 1.2.
The impulse function δ(t), as de ned, has been accepted and widely used by engi-
neers and scientists, and rigorously justi ed by an extensive literature referred as
the generalized functions, which was  rst proposed by Kirchhoff as far back as
1882. A more modern approach is found in the work of K.O. Friedrichs published
in 1939. The present form, widely accepted by engineers and used in this chapter is
attributed to the works of S.L. Sobolov and L. Swartz who labeled those functions
with the generic name of distribution functions.
Teams of scientists developed the general theory of generalized (or distribu-
tion) functions apparently independent from each other in the 1940s and 1950s,

respectively.
R.1.5 Observe that the impulse function δ(t) as de ned in R.1.4 has zero duration, unde-
 ned amplitude at t = 0, and a constant area of one. Obviously, this type of func-
tion presents some interesting properties when analyzed at one point in time, that
is, at t = 0.
1
lim
{
{
t
0
+
0
0
t
FIGURE 1.2
The impulse function δ(t).
CRC_47760_CH001.indd 5CRC_47760_CH001.indd 5 7/25/2008 4:16:10 PM7/25/2008 4:16:10 PM
6 Practical MATLAB
®
Applications for Engineers
R.1.6 Since δ(t) is not a conventional signal, it is not possible to generate a function that
has exactly the same properties as δ(t). However, the Dirak function as well as its
derivatives (dδ(t)/dt) can be approximated by different mathematical models.
Some of the approximations are listed as follows (Lathi, 1998):






( ) lim
sin( / )
/
(sin)
()
t
a
ta
ta
c
t
a
ϭ
ϭ
it













0
1

using ’s
llim ( )
( ) lim
/
it
it
a
jt a
a
t
e
jt
t
e









0
0


using exponentials
ϭ
222

4/
()
a
a 







using Gaussian

R.1.7 Multiplying a unit impulse δ(t) by a constant A changes the area of the impulse to
A, or the amplitude of the impulse becomes A.
R.1.8 The impulse function δ(t) when multiplied by an arbitrary function f(t) results in an
impulse with the magnitude of the function evaluated at t = 0, indicated by
(t) f(t) = f(0) (t)
Observe that f(0) δ(t) can be de ned as

ft
t
ft
()()
()
0
00
00
 ϭ
ϭ

for
for





R.1.9 A shifted impulse δ(t − t
1
) is illustrated in Figure 1.3. When the shifted impulse
δ(t − t
1
) is multiplied by an arbitrary function f(t), the result is given by
(t − t
1
) ⋅ f(t) = f(t
1
) ⋅ (t − t
1
)
R.1.10 The derivative of the unit Dirak δ(t) is called the unit doublet, denoted by
d[δ(t)]

______

dt
= δ′(t),
is illustrated in Figure 1.4.
0t
1

t
Amplitude
FIGURE 1.3
Plot of δ(t − t
1
).
FIGURE 1.4
Plot of δ(t)′ as a approaches zero.
a
1
t
(t)′
CRC_47760_CH001.indd 6CRC_47760_CH001.indd 6 7/25/2008 4:16:10 PM7/25/2008 4:16:10 PM
Time Domain Representation of Continuous and Discrete Signals 7
R.1.11 Figure 1.4 indicates that the unit doublet cannot be represented as a conventional
function since there is no single value,  nite or in nite, that can be assigned to δ(t)’
at t = 0.
R.1.12 Additional useful properties of the impulse function δ(t) that can be easily proven
are stated as follows:
a. ft t t dt ft
oo
() ( ) ( ) Ϫ
Ϫ∞


ϩ
ϭ
b. ft t tdt f t
oo
()()()ϪϪ

Ϫ
 ϭ
ϩ



c. ft t t t dt ft t
o
()() ( )ϪϪ Ϫ
Ϫ

110



ϩ
ϭ
R.1.13 The unit impulse δ(t), the unit doublet δ(t)’, and the higher derivatives of δ(t) are
often referred as the impulse family. These functions vanish at t = 0, and they
all have the origin as the sole support. At t = 0, all the impulse functions suffer
discontinuities of increasing complexity, consisting of a series of sharp pulses going
positive and negative depending on the order of the derivative.
As was stated δ(t) is an even function of t, and so are all its even derivatives, but
all the odd derivatives of δ(t) return odd functions of t.
The preceding statement is summarized as follows:

  () (), ’() ()ttt tϭϪ ϭϪϪ

or in general



()
() ( ) ( )
22nn
ttϭϪeven case



21 21nn
tt
ϪϪ
ϭϪ Ϫ() ( ) ( )odd case

R.1.14 A train of impulses denoted by the function Imp[(t)
T
] de nes a sequence consisting of
an in nite number of impulses occurring at the following instants of time nT, …, −T,
T, 2T, 3T, …, nT, as n approaches ∞. This sequence can be expressed analytically by

Imp[( ) ] ( )ttnT
T
n
ϭϪ
ϭ

Ϫ∞



illustrated in Figure 1.5.

FIGURE 1.5
Plot of Imp[(t)
T
].
Imp[(t)
T
]
1
t
4T
−2T
T
−T
2T 3T0
CRC_47760_CH001.indd 7CRC_47760_CH001.indd 7 7/25/2008 4:16:10 PM7/25/2008 4:16:10 PM
8 Practical MATLAB
®
Applications for Engineers
The expansion of the function Imp[(t)
T
] results in

Imp[( ) ] ( )
()()()()
ttnT
tnT tT t tT
T
n
ϭ
ϭϩ ϩϩ ϩ ϩϩ

ϭ

 
Ϫ
Ϫ
Ϫϱ
ϱ


……
(()tnTϪ

R.1.15 The sampling process is modeled mathematically by multiplying an arbitrary ana-
log signal f(t) by the train of impulses de ned by Imp[(t)
T
]. This process is illustrated
graphically in Figure 1.6.
Analytically,

ft t nT ft t nT
nn
() ( ) ()( )⋅
∑∑
Ϫϭ
ϭϭ
Ϫ
Ϫϱ
ϱ
Ϫϱ
ϱ


and the expanded discrete version of f(t) is given by

fn fk t k f t f t f t
f
k
() ()( ) ( )( ) ( )( ) ()()ϭϭϪϪ
Ϫϱ
ϱ
Ϫϩ ϩϩ ϩϩ
ϩ
ϭ

 22 110
(()( ) ()( ) ( )( )1122 tft fntnϪϪ Ϫϩϩϩ

assuming that T = 1, without any loss of generality.
0
5
10
f(t)
−4T −3T −2T −T 0 T 2T 3T 4T 5T 6
T
0
0.5
1
ImpT(t)
−4T −3T −2T −T 0 T 2T 3T 4T 5T 6
T
0

5
10
t
f(t)
*
ImpT(t)
FIGURE 1.6
Plots illustrating the sampling process.
CRC_47760_CH001.indd 8CRC_47760_CH001.indd 8 7/25/2008 4:16:11 PM7/25/2008 4:16:11 PM
Time Domain Representation of Continuous and Discrete Signals 9
In general, the set of samples given by f(−n), f(−n + 1), …, f(0), f(1), …, f(n − 1), f(n),
can be real or complex. f(n) is called a real sequence if all its samples are real and a
complex sequence if at least one sample is complex.
Observe that any (discrete) sequence f(n) can be expressed by the equation

fn fk n k
k
() ()( )ϭ
ϭ
 Ϫ
Ϫϱ
ϱ


Examples of analog signals are often encountered in nature such as sound, tem-
peratures, pressure, growth, and precipitations waves.
Discrete time signals or events are usually man-made functions such as weekly
pay, monthly payment of a loan or mortgage, or the (U.S.) presidential election
every 4 years.
Discrete signals are often confused with digital signals and binary signals. A

digital signal f(nT) or in short f(n) is a discrete time signal whose values are one of
a prede ned  nite set of values.
A binary signal is a discrete signal whose values consist of either zeros or ones.
An analog or continuous time function or signal can be transformed into a digital
signal using an A/D. Conversely, a digital signal can be converted into an analog
signal by means of a digital to analog converter (D/A).
Digital signals are frequently encoded using binary codes such as ASCII* into
strings of ones and zeros because in this format they can be stored and processed
by digital devices such as computers, and are in general more immune to noise and
interference.
R.1.16 The discrete impulse sequence δ(n) also called the Kronecker delta sequence (named
after the German mathematician Leopold Kronecker [1823–1891]) is de ned ana-
lytically as follows and illustrated in Figure 1.7.

()n
n
n
ϭ
ϭ10
00
for
for 




Note that the discrete impulse is similar to the analog version δ(t).
R.1.17 A discrete shifted impulse δ(n − m) is illustrated in Figure 1.8.
*


The ASCII code is de ned in Chapter 3 of Practical MATLAB
®
Basics for Engineers.
1
−2 −1
1230
n
FIGURE 1.7
Plot of the discrete impulse δ(n).
FIGURE 1.8
Plot of δ(n − m).
1
n
m − 1 m m + 1
(n − m)
CRC_47760_CH001.indd 9CRC_47760_CH001.indd 9 7/25/2008 4:16:11 PM7/25/2008 4:16:11 PM
10 Practical MATLAB
®
Applications for Engineers
The discrete shifted impulse function δ(n − m)m − 1

m

m + 1n is de ned as

()nm
nm
nm
Ϫ


ϭ
ϭ1
0
for
for




R.1.18 Let us go back to the analog world. The analog unit step function denoted by u(t) is
illustrated in Figure 1.9.
Analytically, the analog unit step is de ned by

ut
t
t
()ϭ
Ն10
00
for
for Ͻ




The step is related to the impulse by the following relations:

du t
dt
t

()
()ϭ 

or in general

d
dt
ut t t t
oo
[( )] ( )ϪϪϭ 


() ()tdt utϭ
Ϫϱ
ϱ


or in general

ut t t d
t
t
t
t
o
t
o
() ()ϪϪ
Ͼ
Ͻ

Ϫϱ
ϭϭ 




1
0
0
0
for
for

The derivative of the unit step constitutes a break with the traditional differen-
tial and integral calculus. This new approach to the class of functions called sin-
gular functions is referred to as generalized or distributional calculus (mentioned
in R.1.4).
R.1.19 The analog unit step u(t) can be implemented by a switch connected to a voltage
source of 1 V that closes instantaneously at t = 0, illustrated in Figure 1.10.
u(t)
1
t
0
FIGURE 1.9
Plot of the step function u(t).
CRC_47760_CH001.indd 10CRC_47760_CH001.indd 10 7/25/2008 4:16:11 PM7/25/2008 4:16:11 PM
Time Domain Representation of Continuous and Discrete Signals 11
R.1.20 A right-shifted unit step, by t
0
units, denoted by u(t − t

0
) is illustrated in Figure 1.11.
The shifted step function u(t − t
0
) is de ned analytically by

ut t
tt
tt
()Ϫ
Ն
Ͻ
0
0
0
1
0
ϭ
for
for




R.1.21 A unit step sequence or the discrete unit step u(n) is illustrated in Figure 1.12.
The unit discrete step u(n) is de ned analytically by

un
n
n

()ϭ
10
00
for
for
Ն
Ͻ




R.1.22 A unit discrete step sequence u(n) can be constructed by a sequence of impulses
indicated as follows:

un n k
k
() ( )ϭ
ϭ
 Ϫ
ϱ
0


Observe that δ(n) = u(n) − u(n − 1).
R.1.23 A shifted and amplitude-scaled step sequence, A u(n − m) is illustrated in Figure 1.13.
The sequence A u(n − m) is de ned analytically by

Au n m
Anm
nm

()Ϫ
Ն
Ͻ
ϭ
for
for0




sw closes at t = 0
1 V
v(t) = u(t)
FIGURE 1.10
Circuit implementation of u(t).
FIGURE 1.11
Plot of u(t − t
0
).
u(t − t
0
)
0
t
0
t
1
u(n)
−2 −11
2

3
0
n
FIGURE 1.12
Plot of u(n).
CRC_47760_CH001.indd 11CRC_47760_CH001.indd 11 7/25/2008 4:16:12 PM7/25/2008 4:16:12 PM
12 Practical MATLAB
®
Applications for Engineers
R.1.24 The analog pulse function pul(t/τ) is illustrated graphically in Figure 1.14.
The function pul(t/τ) is de ned analytically by

pul t
t
tt
(/)
//
//



ϭ
ՅՅ1for
for and
Ϫ
ϪϾ Ͼ
22
02 2





R.1.25 The analog pulse pul(t/τ) is related to the analog step function u(t) by the following
relation:
pul(t/) = u(t + /2) − u(t − /2)
R.1.26 The discrete pulse sequence denoted by pul(n/N) is given by

pul n N
Nn
Nn n
(/ )
//
//
ϭ
ՅՅ1for
for and
Ϫ
ϪϾ Ͼ
22
02 2
N
N




For example, for N = 11 (odd), the discrete sequence is given by

pul n
n

nn
(/ )11
15 5
05 5
ϭ
Ϫ
Ϫ
for
for
ՅՅ
ϾϾand




The preceding function pul(n/11) is illustrated in Figure 1.15.
Observe that the pulse function pul(n/11) can be represented by the superposition
of two discrete step sequences as
pul(n/11) = u(n + 5) − u(n − 6)
R.1.27 The analog unit ramp function denoted by r(t) = t u(t) is illustrated in Figure 1.16.
The unit ramp is de ned analytically by

rt
tt
t
()ϭ
for
for
Ն
Ͻ

0
00




A
u(n − m)
m − 1 mm + 1 m + 2 m + 3
n
FIGURE 1.13
Plot of u(n − m).
pul(t/)
t
−/2
0
/2
1
FIGURE 1.14
Plot of pul(t/τ).
CRC_47760_CH001.indd 12CRC_47760_CH001.indd 12 7/25/2008 4:16:12 PM7/25/2008 4:16:12 PM
Time Domain Representation of Continuous and Discrete Signals 13
R.1.28 The more general analog ramp function r(t) = t u(t) (with time and amplitude scaled)
is de ned by

Ar t t
At t t
tt
()Ϫ
Ն

Ͻ
0
0
0
0
ϭ
for
for




where A represents the ramp’s slope and t
0
is the time shift with respect to the
origin.
R.1.29 The discrete ramp sequence denoted by r(n − m) u(n − m) is de ned analytically
by

rn mun m
nnm
nm
()()ϪϪ
Ն
Ͻ
ϭ
for
for0





−6 −5 −4 −3 −2 −1 0 1 2 3 4 5 6
0
0.5
1
1.5
2
n
Amplitude
pul(n/11)
FIGURE 1.15
Plot of the function pul(n/11).
r(t)
t
1
1
0
FIGURE 1.16
Plot of the analog unit ramp function r(t) = t u(t).
CRC_47760_CH001.indd 13CRC_47760_CH001.indd 13 7/25/2008 4:16:12 PM7/25/2008 4:16:12 PM
14 Practical MATLAB
®
Applications for Engineers
R.1.30 The analog unit parabolic function p
K
(t) u(t) is de ned by

ptut
K

tt K
t
K
K
() ()
!
,,
ϭ
ϭ
1
023
00
for
for
Ն
Ͻ
and …






R.1.31 The discrete unit parabolic function p
K
(n) u(n) is de ned by

pnun
K
nn K

n
K
K
()()
!
,,
ϭ
ϭ
1
023
00
for
for
Յ
Ͻ
and …






R.1.32 Observe that
a. The unit ramp presents a sharp 45°

corner at t = 0.
b. The unit parabolic function presents a smooth behavior at t = 0.
c. The unit step presents a discontinuity at t = 0.
R.1.33 The step, ramp, and parabolic functions are related by derivatives as follows:
a. (d/dt)[r(t)] = u(t)

b.
d

__

dt
[ p
2
(t)] = r(t)u(t)
c. (d/dt)[p
a
(t)] = p
a−1
(t)
Observe that the  rst relation makes sense for all t ≠ 0, since at t = 0 a discontinu-
ity occurs, whereas the second and third relations hold for all t.
R.1.34 Note that, in general, the product f(t) times u(t) [f(t)u(t)] de nes the composite func-
tion given by

ftut
ft t
t
() ()
()
ϭ
Ͻ
for Ն 0
00for





R.1.35 A wide class of engineering systems employ sinusoidal and exponential* signals as
inputs. A real exponential analog signal is in general given by
f(t) = Ae
bt
where e = 2.7183 (Neperian constant) and A and b are in most cases real constants.
Observe that for f(t) = Ae
bt
,
a. f(t) is a decaying exponential function for b < 0.
b. f(t) is a growing exponential function for b > 0.
The coef cient b as exponent is referred to as the damping coef cient or constant.
In electric circuit theory, the damping constant is frequently given by b = 1/τ, where
τ is referred as the time constant of the network (see Chapter 2).
Note that the exponential function f(t) = Ae
bt
repeats itself when differentiated
or integrated with respect to time, and constitutes the homogeneous solution of
*

Recall that sinusoids are complex exponentials (Euler), see Chapter 4 of Practical MATLAB
®
Basics for
Engineers.
CRC_47760_CH001.indd 14CRC_47760_CH001.indd 14 7/25/2008 4:16:13 PM7/25/2008 4:16:13 PM

×