Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean,...

182
1

Transcript of Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean,...

Page 1: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

1

Page 2: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Contents

0.1 General textbooks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50.2 Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50.3 Fourier analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60.4 Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60.5 Other . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

1 Fourier Series in Complex Form 71.1 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

1.1.1 Periodic functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.1.2 Even functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.1.3 Odd functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.1.4 Sine and cosine of period T0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

1.2 The Σ-notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81.3 Specifying periodic functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91.4 Complex Fourier series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91.5 An application to filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

2 Fourier transforms 162.1 The Fourier Transform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162.2 Fourier transform pairs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172.3 Discrete and continuous spectra . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182.4 A special case — f(t) is real and even . . . . . . . . . . . . . . . . . . . . . . . . . . 192.5 The Dirac δ function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

3 Fourier transform properties 243.1 Linearity (also known as superposition) . . . . . . . . . . . . . . . . . . . . . . . . . 243.2 Time scaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253.3 Time shifting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263.4 Differentiation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273.5 Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283.6 Frequency shifting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293.7 Convolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

3.7.1 Definition of convolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293.7.2 Fourier transform of the convolution of two functions . . . . . . . . . . . . . . 29

4 Fourier transforms without integration 334.1 Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334.2 Recipe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

1

Page 3: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

5 Cross correlation and autocorrelation 385.1 Reminder: complex conjugate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385.2 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385.3 Correlation properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

5.3.1 The autocorrelation function is always even . . . . . . . . . . . . . . . . . . . 405.3.2 Calculating cross correlation either way round . . . . . . . . . . . . . . . . . . 415.3.3 The maximum of the autocorrelation function . . . . . . . . . . . . . . . . . . 415.3.4 Autocorrelation of a periodic function . . . . . . . . . . . . . . . . . . . . . . 41

5.4 Worked examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425.5 Power and energy signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455.6 Correlation demonstrations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

5.6.1 Cross correlation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465.6.2 Autocorrelation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475.6.3 Practical applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

6 Introductory probability 516.1 Definition of probability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516.2 Addition of probabilities — mutually exclusive case . . . . . . . . . . . . . . . . . . . 536.3 Addition of probabilities — general case . . . . . . . . . . . . . . . . . . . . . . . . . 546.4 Multiplication of probabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

7 Discrete variables: the p.d.f., mean and variance 587.1 Random variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 587.2 Definitions: a set of N discrete values . . . . . . . . . . . . . . . . . . . . . . . . . . 59

7.2.1 Mean of x, x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 597.2.2 Standard deviation of x, σx . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

7.3 The probability density function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 607.3.1 Normalisation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617.3.2 Other names for p.d.f. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

7.4 What does the p.d.f. mean? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 637.5 The cumulative distribution function . . . . . . . . . . . . . . . . . . . . . . . . . . . 667.6 Mean & standard deviation: when the p.d.f. is known . . . . . . . . . . . . . . . . . 66

7.6.1 Mean, x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 677.6.2 Standard deviation, σx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

8 Continuous distributions 698.1 Continuous random variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 698.2 Those definitions again . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

8.2.1 Mean of x, x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 708.2.2 Standard deviation of x, σx . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

8.3 Application to signal power . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 718.4 The p.d.f. for continuous variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . 728.5 The c.d.f., F (x) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 738.6 Definitions: when the p.d.f. is known . . . . . . . . . . . . . . . . . . . . . . . . . . . 75

8.6.1 Mean of x, x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 758.6.2 Standard deviation of x, σx . . . . . . . . . . . . . . . . . . . . . . . . . . . . 758.6.3 The mean of any function of x . . . . . . . . . . . . . . . . . . . . . . . . . . 75

2

Page 4: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

9 Theoretical distributions 789.1 The Gaussian distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 789.2 The Gaussian probability distribution . . . . . . . . . . . . . . . . . . . . . . . . . . 809.3 The Poisson distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 829.4 The binomial distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85

10 The method of least squares 8810.1 Gauss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8810.2 A data fitting problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8810.3 The method of least squares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8910.4 Calculating m and c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9010.5 Fitting to a parabola . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93

11 Complex frequency 9611.1 Complex frequency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96

11.1.1 σ < 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9711.1.2 σ = 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9711.1.3 σ > 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98

11.2 Linear homogeneous differential equations . . . . . . . . . . . . . . . . . . . . . . . . 9811.2.1 a2 > 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10011.2.2 a2 = 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10111.2.3 a2 < 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101

12 The Laplace Transform 10312.1 The Laplace transform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10312.2 The Laplace transform of a derivative . . . . . . . . . . . . . . . . . . . . . . . . . . 105

13 Differential Equations and the Laplace Transform 10813.1 Inhomogeneous differential equations . . . . . . . . . . . . . . . . . . . . . . . . . . . 10813.2 Solving a d.e. by Laplace transform — overview . . . . . . . . . . . . . . . . . . . . 10913.3 The Laplace transform of a differential equation . . . . . . . . . . . . . . . . . . . . . 11013.4 Inverse Laplace transform using tables . . . . . . . . . . . . . . . . . . . . . . . . . . 11213.5 Inverse Laplace transform by partial fractions . . . . . . . . . . . . . . . . . . . . . . 114

14 The Z transform: definition, examples 11614.1 Introduction and Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116

14.1.1 Sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11614.1.2 The connection with Laplace transforms . . . . . . . . . . . . . . . . . . . . . 11714.1.3 The two ways of writing down z-transforms . . . . . . . . . . . . . . . . . . . 119

14.2 z-transform examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12014.2.1 f(n) = an . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12214.2.2 f(n) = δ(n), the unit impulse . . . . . . . . . . . . . . . . . . . . . . . . . . . 12214.2.3 f(n) = u(n), the unit step function . . . . . . . . . . . . . . . . . . . . . . . . 12314.2.4 f(n) = an . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12314.2.5 f(n) = cos an . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123

15 The Z transform: properties, inversion 12515.1 z-transform properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125

15.1.1 Linearity/superposition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12515.1.2 Time delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126

3

Page 5: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

15.1.3 Time advance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12615.1.4 Multiplication by an exponential sequence . . . . . . . . . . . . . . . . . . . . 12715.1.5 Differentiation property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12715.1.6 Initial Value Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12815.1.7 Final Value Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129

15.2 Inversion of the z-transform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130

16 The Z transform: applications 13716.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13716.2 Difference equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13716.3 Solving difference equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13816.4 A FIR filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142

17 Matrices I 14717.1 The basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14717.2 Matrix equality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14817.3 Matrix addition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14817.4 Matrix multiplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148

17.4.1 Scalar × matrix = matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14817.4.2 Matrix × vector = vector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14917.4.3 Matrix × matrix = matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149

17.5 Determinants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14917.6 Solving two linear equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150

17.6.1 Properties of the unit matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . 15217.7 Application — Z and Y parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . 152

18 Matrices II 15518.1 Matrix inversion: Pi to T conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . 15518.2 Solving n linear equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15718.3 Inverting an n× n matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15718.4 The equation matrix × vector = 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15918.5 Application of matrix × vector = 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16018.6 Eigenvalues and eigenvectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16118.7 Applications of eigenvalues/eigenvectors . . . . . . . . . . . . . . . . . . . . . . . . . 163

19 The wave equation 16619.1 Partial differential equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16619.2 Derivation of the wave equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16719.3 The d’Alembert solution of the wave equation . . . . . . . . . . . . . . . . . . . . . . 17019.4 Boundary conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17119.5 What does it all mean? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174

4

Page 6: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Recommended books (for reference)

0.1 General textbooks

• Mary L. Boas, Mathematical Methods in the Physical Sciences

(2nd ed) ISBN 0-471-09960-0 Wiley

(The library has a couple of copies.)

Contains most of what you need (a little thin on Fourier trans-

forms; useful reference for differential equations, matrix algebra

etc.)

• Erwin Kreyszig Advanced Engineering Maths

(Getting very fat and middle-aged. 1271 pages. I pity students

who have to cycle to the university carrying this one.)

• Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-

neers and Scientists.

(Newly arrived on the scene. It’s thin, light, reasonably priced

and seems to cover a lot of good stuff. No Fourier transforms.)

• K.A. Stroud, Further Engineering Mathematics

(Concentrates on ‘programmed learning’ and if you like this ap-

proach, this book may be the one for you.)

0.2 Statistics

There are many possible additional books for statistics. I suggest

you borrow from the library G.M. Clarke and D. Cooke ‘A Basic

Course in Statistics’ if you want some readable background informa-

tion. Kreyszig is also strong on statistics, Weltner et al is not bad;

Boas less so.

5

Page 7: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

0.3 Fourier analysis

G. Stephenson’s ‘Mathematical methods for Science Students’ is good

for Fourier series, and worth having a look at. (The library has many

copies.) It doesn’t even mention Fourier transforms; for these, I can

recommend wholeheartedly S. Haykin’s ‘Communication Systems’,

chapter 2. The library has about a dozen copies.

0.4 Matrices

These are well covered by all the general textbooks, and also by

Stephenson.

0.5 Other

C.R. Wylie, Differential Equations has a very good section on the

wave equation.

Note on the problems

Problems whose numbers have an asterisk are a bit harder than

those without. Look on them as a challenge.

Web page

Materials that support the course available on the WWW and the

address for this is

http://personal.maths.surrey.ac.uk/st/J.Deane/Teach/em2

6

Page 8: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Chapter 1

Fourier Series in Complex Form

1.1 Functions

1.1.1 Periodic functions

A function f (t) is said to be periodic with period T0 if T0 is the

smallest positive number for which

f (t + T0) = f (t)

holds for all t. Examples include:

(1) f (t) = sin t, which has period 2π because sin(t + 2π) = sin t

(2) f (t) = cos 4t, which has period π/2, since cos 4(t+π/2) = cos 4t.

Note: although sin(t + 4π) = sin t, the period is not 4π, because

there is a smaller positive number that has this property (i.e. 2π).

1.1.2 Even functions

A function f (t) is said to be even if

f (t) = f (−t)

for all t. Such functions are symmetrical about t = 0.

Examples: 1 + cos t, t2 − 3t4, |t|.

1.1.3 Odd functions

A function f (t) is said to be odd if

7

Page 9: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

f (t) = −f (−t)

for all t. Such functions are anti-symmetric about t = 0.

Examples: sin t, t + 3/t3, t(1 + cos 3t).

1.1.4 Sine and cosine of period T0

In the rest of this chapter, you will see many references to

sin2nπt

T0and cos

2nπt

T0

where n is an integer (a whole number). Using the fact that the

periods of sin t and cos t are both 2π, you should be able to see that

the period of sin(2πt/T0) is T0, and so the period of sin(2nπt/T0) is

T0/n — and that the same is true for cos(2nπt/T0).

1.2 The Σ-notation

As a reminder, it is useful at this point to give some examples of the

Σ-notation, which is a neat shorthand way of representing the sum

of a set of numbers. Some examples are:

t1 + t2 + . . . + tN =

N∑i=1

ti

a0 + a1x + a2x2 + . . . =

∞∑m=0

amxm

sin t− 1

3sin 3t +

1

5sin 5t− 1

7sin 7t + . . . =

∞∑k=0

(−1)k sin(2k + 1)t

2k + 1

Study the examples and make sure you understand why the right-

hand side represents the left-hand side.

8

Page 10: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

1.3 Specifying periodic functions

You will often meet a specification of a periodic function like

f (t) =

0 −π < t ≤ 0

−1 0 < t ≤ π/2

1 π/2 < t ≤ π

with

f (t + 2π) = f (t).

It is important that you know how to turn this into a picture of the

function. Check that you can do this by sketching the function on

the axes below, being careful to label the relevant t and f (t) values.

-

6f (t)

t

1.4 Complex Fourier series

There is a neat form in which to write the Fourier coefficients, which

involves complex numbers. We derive this in two steps.

Step 1 — rewrite the Fourier series in terms of complex numbers.

Start with the definition of a Fourier series in trigonometric form:

9

Page 11: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

f (t) =1

2a0 +

∞∑n=1

an cos2nπt

T0+

∞∑n=1

bn sin2nπt

T0

where

an =2

T0

∫ T02

−T02

f (t) cos2nπt

T0dt, bn =

2

T0

∫ T02

−T02

f (t) sin2nπt

T0dt.

(1.1)

Now write sin and cos in terms of complex exponentials, so that

f (t) =

a0

2+

∞∑n=1

e2jnπt/T0 + e−2jnπt/T0

2an −

∞∑n=1

e2jnπt/T0 − e−2jnπt/T0

2jbn

which can be rewritten as

f (t) =1

2a0 +

∞∑n=1

an − jbn2

e2jnπt/T0 +

∞∑n=1

an + jbn2

e−2jnπt/T0.

Define the complex numbers

α0 = a0 αn =an − jbn

2α−n =

an + jbn2

.

Step 2 — rewrite the definitions of an and bnExpanding cos 2nπt/T0 and sin 2nπt/T0, we can rewrite the defini-

tions of an and bn (equations 1.1) as

an =2

T0

∫ T02

−T02

f (t)e2jnπt/T0 + e−2jnπt/T0

2dt

jbn =2

T0

∫ T02

−T02

f (t)e2jnπt/T0 − e−2jnπt/T0

2dt

10

Page 12: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Now, adding these two equations gives

an + jbn =2

T0

∫ T02

−T02

f (t)e2jnπt/T0 dt

and subtracting them gives

an − jbn =2

T0

∫ T02

−T02

f (t)e−2jnπt/T0 dt.

Using our definition of αn, we have, finally,

f (t) =

∞∑n=−∞

αne2jnπt/T0 with αn =

1

T0

∫ T02

−T02

f (t)e−2jnπt/T0 dt

where the definition of αn is true for all n.

Example 1.1 Find the Fourier series in the complex form for the squarewave

s(t) =

−1 −1 ≤ t < −1/2

1 −1/2 ≤ t < 1/2−1 1/2 ≤ t < 1

with s(t+ 2) = s(t).We are being asked to calculate αn for all n. Hence, we need to find

αn =1

T0

∫ T02

−T02

f(t)e−2jnπt/T0 dt,

where T0 = 2. In this case

1

2

[−∫ −1/2

−1e−jnπt dt+

∫ 1/2

−1/2e−jnπt dt−

∫ 1

1/2e−jnπt dt

]

=−1

2jnπ

[−e−jnπt

∣∣∣−1/2

−1+e−jnπt

∣∣∣1/2−1/2−e−jnπt

∣∣∣11/2

]

=−1

2jnπ

[−ejnπ/2 + ejnπ + e−jnπ/2 − ejnπ/2 − e−jnπ + e−jnπ/2

]

11

Page 13: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

=−1

2jnπ

[ejnπ − e−jnπ + 2e−jnπ/2 − 2ejnπ/2

]

=−1

nπ[sinnπ − 2 sinnπ/2] =

2 sinnπ/2

nπ.

This expression is valid for all n except n = 0. We have α0 = the areaunder s(t) over one period, divided by the period, and this equals (−1/2 +1−1/2)/2 = 0. Hence, α0 = 0.

1.5 An application to filters

From problem 6 you will see that the Fourier series in the complex

form for a square wave voltage v(t), period T0, defined by

v(t) =

1 −T0/2 < t < 0

0 0 < t < T0/2with v(t + T0) = v(t)

is

v(t) =1

2+j

π

∞∑n=−∞

1

2n + 1ej(2n+1)2πt/T0.

Example 1.2 What is the output vo(t) if this square wave voltage is appliedto the low pass filter in figure 1.1?

C

R

v(t)

ov (t)

Figure 1.1: An RC filter fed by a square wave.

From circuit theory, we know that the output of this filter when the input isvine

jωt is

vout =1

1 + jωτvine

jωt

12

Page 14: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

with τ = RC. This is true for any frequency ω. Since the filter is a linearsystem, its output, when the input is a square wave, is the sum of the in-dividual sine waves in the input × the transfer function, (1 + jωτ)−1: wededuce this from a property known as superposition. The frequencies in theinput are (2n+ 1)2π/T0, so

vo(t) =1

2+j

π

∞∑n=−∞

1

1 + j(2n + 1)2πτ/T0

ej(2n+1)2πt/T0

2n + 1. (1.2)

Figure 1.2 shows the input and output waveforms for T0 = 1 and τ = 0.2.

0.0 0.5 1.0 1.5 2.0

t

-0.2

0.0

0.2

0.4

0.6

0.8

1.0

vo

ut

-0.2

0.0

0.2

0.4

0.6

0.8

1.0

vin

Figure 1.2: The input and output waveforms for the RC-filter example.

13

Page 15: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Problems, chapter 1

1. (a) Sketch the even and odd example functions in sections 1.1.2 and 1.1.3.

(b) Let E1(t), E2(t) be two even functions of t and O1(t), O2(t) be twoodd functions of t. Are the following functions even or odd?

(i) E1(t)×E2(t) (ii) E1(t)×O1(t) (iii) O1(t)×O2(t) (iv) E1(t) +E2(t)(v) O1(t) +O2(t) (vi) O1(t) +O1(−t)

[Even: (i), (iii), (iv) and (vi). The rest are odd.]

2. Here are some useful formulae for simplifying Fourier series results. Inall cases, n is an integer. Prove them.

(i) ejnπ = cosnπ = (−1)n.

(ii)

ejnπ/2 =

(−1)n/2 n even

j(−1)(n−1)/2 n odd

(iii) For any set of numbers a0, a1, a2, . . .,

∞∑n=0

[1 + (−1)n] an = 2

∞∑n=0

a2n

∞∑n=0

[1− (−1)n] an = 2

∞∑n=0

a2n+1

(iv) Show that

∫ π−πejnt dt =

0 n 6= 0

2π n = 0

3. (i) Sketch the following function over at least two periods:

f(t) =

0 −π < t < 0sin t 0 < t < π

f(t+ 2π) = f(t)

(ii) Find its Fourier series in the complex form.

[(ii) α±1 = ±1/(4j), αn = [(−1)n+1 − 1]/[2π(n2 − 1)]]

14

Page 16: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

4. Find the Fourier series in the complex form for the function

f(t) = 1 + t − 1 < t ≤ 1 with f(t+ 2) = f(t).

[αn = j(−1)n/(nπ) if n 6= 0; α0 = 1.]

5. Find the complex Fourier series for the following waveform:

v(t) = ekt, −T0/2 < t ≤ T0/2 where v(t+ T0) = v(t).

[αn = (−1)n(ekT0/2 − e−kT0/2)/(kT0 − 2jnπ)]

6. Find the complex Fourier series for

v(t) =

1 −T0/2 < t < 00 0 < t < T0/2

with v(t+ T0) = v(t).

[Answer on page 12]

7. From the answer to problem 3(ii) above, deduce (i.e. do not re-do theintegrals to find the coefficients) the complex Fourier coefficients for thefull-wave rectified sine wave

g(t) =

− sin t −π < t ≤ 0sin t 0 < t ≤ π

Simplify your answer as far as possible.

Hint: if f(t) is a half-wave rectified sine wave, then first show thatg(t) = f(t) + f(−t).

[g(t) = 2π −

(cos 2t22−1 + cos 4t

42−1 + cos 6t62−1 + . . .

)]

15

Page 17: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Chapter 2

Fourier transforms

2.1 The Fourier Transform

In the previous chapter, we discussed periodic functions which satis-

fied some conditions, known as the Dirichlet conditions,1 which allow

them to be expanded in a Fourier series. In this chapter, we deal with

non-periodic functions that satisfy the Dirichlet conditions. For such

functions, the Fourier transform can be calculated, which enables us

to express a function of time f (t) as a function of frequency, F (ω),

instead.

Recall from the last chapter that

f (t) =

∞∑−∞

αne2jnπt/T0 and αn =

1

T0

∫ T02

−T02

f (t)e−2jnπt/T0 dt

where f (t) is a function of time t with period T0, i.e. f (t+T0) = f (t).

The definition of αn in words is

αn is the mean value, over the range −T02 ≤ t ≤ T0

2 (one

period), of [f (t)× e−2jnπt/T0]

If the function is not periodic, then the period T0 →∞, which leads

us to consider the integral1Specifically, if the periodic function is f(t) and has period T0, then the conditions are (i)

∫ T0/2

−T0/2f(t)dt is finite;

(ii) f(t) must have a finite number of turning points and finite discontinuities in a period; and (iii) f(t) itself mustbe finite for all t.

16

Page 18: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

F (ω) =

∫ ∞−∞

f (t)e−jωt dt (2.1)

and this is the definition of the Fourier transform of f (t). Given

F (ω) we can recover the original f (t). By analogy with the Fourier

series expression for f (t), when the sum is replaced by an integral,

f (t) =1

∫ ∞−∞

F (ω)ejωt dω. (2.2)

The two boxed equations show us how to calculate the Fourier trans-

form (2.1)/inverse Fourier transform (2.2) for a given function. All

the material in this chapter is based on just these two equations.

(See problem 1)

We occasionally need to use the following notation for the Fourier

transform of a function f (t):

F (ω) = F [f (t)] and f (t) = F−1[F (ω)].

2.2 Fourier transform pairs

We will always stick to the convention that a lower case letter stands

for the function of time t and the corresponding upper case letter for

the function of angular frequency, ω.

The two functions f (t) and F (ω) constitute a Fourier transform

pair, which we write as

f (t) F (ω).

This means that

F (ω) =

∫ ∞−∞

f (t)e−jωt dt and f (t) =1

∫ ∞−∞

F (ω)ejωt dω

or, in words,

17

Page 19: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

F (ω) is the Fourier transform of f (t) and f (t) is the inverse

Fourier transform of F (ω).

2.3 Discrete and continuous spectra

We have used Fourier series to express periodic functions, which

have a discrete spectrum, i.e. one in which only certain frequen-

cies are present. These frequencies were generally of the form ωn =

n(2π/T0), with n = 0, 1, 2 . . .. Similarly, in order to describe non-

periodic functions, it is necessary to use a continuous spectrum, i.e.

one in which all frequencies are present. Equation 2.1 tells us how

to calculate this spectrum.

Example 2.1 Let us first define the function rect(t), the rectangular pulse,as

rect(t) =

1 −12 < t < 1

2

0 otherwise.

We can now find the Fourier transform of f(t) = rect(t/2T ), which is

rect

(t

2T

)=

0 t < −T1 −T < t < T

0 t > T

(see sketch below).

-

6

1

f(t)

t−T 0 T

18

Page 20: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Answer By definition, the Fourier transform F (ω) is given by

F (ω) =

∫ ∞

−∞f(t)e−jωt dt =

∫ T

−T1× e−jωt dt =

1

−jω[e−jωt

]T−T

=e−jωT − ejωT

−jω=

2

ω

ejωT − e−jωT2j

=2

ωsinωT.

Without doing the integral, we know straight away that the inverse Fouriertransform of (2/ω) sinωT will give us the original rectangular pulse, that is

rect

(t

2T

)

2

ωsinωT

are a Fourier transform pair.(See problem 2)

Τ

0

−Τ0 π/Τ 2π/Τ−π/Τ

ω

F(ω)

Figure 2.1: The Fourier transform of a rectangular pulse of width 2T .

2.4 A special case — f(t) is real and even

In most cases that you will come across, f (t) will be a real function

of time. It can be shown that this implies that

Re F (ω) is an even, and ImF (ω) an odd function of ω

19

Page 21: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

that is, the real part of F (ω) is an even function of ω and the imag-

inary part of F (ω) is an odd function of ω.

If f (t) is also an even function of t, that is

f (t) = f (−t)

then the Fourier transform of f (t) is

F (ω) =

∫ ∞0

e−jωtf (t) dt +

∫ 0

−∞e−jωtf (t) dt.

Substituting −t for t in the right-hand half gives

F (ω) =

∫ ∞0

e−jωtf (t) dt +

∫ ∞0

ejωtf (−t) dt.

Using the fact that f (t) is even, this becomes

F (ω) =

∫ ∞0

2 cosωtf (t) dt

which is real. Hence

The Fourier transform of an even, real function of time is a

real, even function of ω.

(See problem 3)

2.5 The Dirac δ function

The function δ(t) is an infinitely narrow spike, with unit area, located

at t = 0. Since the area under it is 1, its height must be infinite since

its width is zero. The fact that the area under it is one tells us that∫ ∞−∞

δ(t) dt = 1.

It is helpful to visualise δ(t) as the limit of a rectangular pulse as its

width tends to zero, with a height such that its area = 1.

20

Page 22: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

What is the Fourier transform of δ(t)? In the light of the above, it

is given by

F [δ(t)] = limT→0F

1

2Trect

t

2T

.The factor 1/2T multiplying rect(t/2T ) makes the area equal to

unity. We already know the Fourier transform of rect(t/2T ): it is2ω sinωT . Hence (by l’Hospital’s rule)

F [δ(t)] = limT→0

2

2ωTsinωT = 1.

Hence

δ(t) 1.

(See problem 6)

Note that δ(t− t0) is an infinitely narrow, infinitely high spike with

unit area, occurring at t = t0. From this we can deduce that for any

function of time f (t)∫ ∞−∞

f (t)δ(t− t0) dt = f (t0). (2.3)

In other words, the delta function can be used to sample a function

of time, f (t), at a particular time t0.

Incidentally, the sampling property allows us to derive the Fourier

transform of δ(t) in one line: by putting f (t) = ejωt and t0 = 0 in

equation (2.3). Since e0 = 1, the Fourier transform of δ(t) must also

be 1.

21

Page 23: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Problems, chapter 2

1. Write the following in terms of the Fourier transforms of the given func-tions:

(i) ∫ ∞

−∞10e−jωth(t) dt

(ii) ∫ ∞

−∞βe−jΩxf(x) dx−

∫ ∞

−∞βe−jΩxg(x) dx

(β is a constant.)

(iii) ∫ −∞

∞e−jkya(y) dy +

∫ ∞

−∞e−jkza(z) dz

(iv) ∫ ∞

−∞

(∫ ∞

−∞C(α)ejαv dα

)e−jωv dv

[(i) 10H(ω), (ii) β[F (Ω)−G(Ω)] (iii) 0 (iv) 2πC(ω) ]

2. Sketch the following functions and find their Fourier transforms:

(i)

rect

(t

4T

)

(ii)

f(t) =

at 0 < t < T0 otherwise

(a is a constant)

(iii)

f(t) =

cosπt −1 < t < 10 otherwise

(iv)

rect

(1 +

t

T

)

[(i) (2/ω) sin 2ωT (ii) a[e−jωT (1 + jωT ) − 1]/ω2 (iii) 2ω sinω/(π2 − ω2)(iv) jejωT/2[1− ejωT ]/ω ]

22

Page 24: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

3. Prove that the Fourier transform of an odd, real function f(t) is imagi-nary.

4. Prove that, for any real f(t), Re F (ω) is an even function of ω, andIm(F (ω) is an odd function of ω.

5. Using the sampling property of the Dirac delta function, equation 2.3,find

(i)∫∞−∞ δ(t− π/2) sin t dt

(ii) The constant t0 such that∫∞−∞ δ(t− t0)ekt dt = e2

(iii)∫∞−∞ [δ(t+ a) + δ(t− a)] ejωt dt.

[(i) 1, (ii) 2/k, (iii) 2 cosωa]

6.∗The Fourier transform of the delta function can be expressed as theFourier transform of the limit of any function of t whose width tends tozero and whose height tends to infinity at t = 0, in such a way that thearea is unity.

Using the result of question 2(ii), show that this is true for the triangularpulse defined there. (Hint: You will need to define the constant a suchthat the area under the triangular pulse is 1 regardless of the value ofT . To take the limit as T tends to zero, you will need to use the Taylorseries for e−jωT up to and including the term in ω2T 2.)

[Well done if you get this right.]

23

Page 25: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Chapter 3

Fourier transform properties

Introduction

Many of the useful applications of the Fourier transform come about

because it has the properties which are discussed in this chapter. In

reading this chapter, you must remember the meaning of the symbol, which was defined in the previous chapter in section 2.2.

3.1 Linearity (also known as superposition)

Let

f1(t) F1(ω) and f2(t) F2(ω)

be two Fourier transform pairs. Then, for constants c1 and c2,∫ ∞−∞

[c1f1(t) + c2f2(t)] e−jωt dt

= c1

∫ ∞−∞

f1(t)e−jωt dt+ c2

∫ ∞−∞

f2(t)e−jωt dt = c1F1(ω) + c2F2(ω),

so

c1f1(t) + c2f2(t) c1F1(ω) + c2F2(ω).

This property allows us to find the Fourier transform of two functions

added together, if we know the Fourier transform of each of the

functions individually.

24

Page 26: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

3.2 Time scaling

Let f (t) F (ω). Then

f (at) 1

|a|F

(ωa

)

where a is a constant.

We prove this, assuming a > 0, by writing the Fourier transform of

f (at) as

F [f (at)] =

∫ ∞−∞

f (at)e−jωt dt,

and substituting u = at, with a > 0. Then t = u/a, and as

t → +∞, u → +∞, since a > 0, so the limits on the integral stay

the same. Hence,

F.T. =

∫ ∞−∞

f (u)e−jωu/a du/a =1

a

∫ ∞−∞

f (u)e−juωa du

=1

aF

(ωa

).

(For the case a < 0 see problem 1.)

Example 3.1 The two properties of superposition and time scaling can beused to calculate the Fourier transform of f(t) shown in the figure below:

-

6f(t)

t−T T

1

2

−2T 2T

25

Page 27: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

The key to this problem is to realise that f(t) is the sum of two rectangularpulses, rect(t/2T ), of width 2T , and rect(t/4T ), of width 4T . In other words,

f(t) = rect(t/2T ) + rect(t/4T ).

Now, we know from example 2.1 that the transform of rect(t/2T ) is (2/ω) sinωT .But, rect(t/2T ) and rect(t/4T ) are related by

rect(t/4T ) = rect(at/2T ) with a =1

2

so, using the time scaling property, we can immediately say that

F (ω) = (2/ω) sinωT+(1/2)−1(2/2ω) sin 2ωT = (2/ω) sinωT+(2/ω) sin 2ωT.

3.3 Time shifting

If f (t) F (ω) then

f (t− t0) e−jωt0F (ω).

The Fourier transform of f (t− t0) is∫ ∞−∞

f (t− t0)e−jωt dt.

Substituting u = t− t0, we have t = u + t0 and dt = du, so∫ ∞−∞

f (u)e−jω(u+t0) du = e−jωt0∫ ∞−∞

f (u)ejωu du

from which the time shifting property follows.

Example 3.2 Find the Fourier transform of f(t) defined in the figure below.

26

Page 28: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

-

6f(t)

t−T T−3T 3T

1

Answer The function f(t) is the sum of two time-shifted rectangular pulses.We know that the Fourier transform of rect(t/2T ) is (2/ω) sinωT . The left-and right-hand pulses are given by

rect

(t+ 2T

2T

)and rect

(t− 2T

2T

)

respectively — be sure you understand why. Hence, the Fourier transform ofthe left-hand pulse is

e2jωT × (2/ω) sinωT.

Similarly, the Fourier transform of the right-hand pulse is e−2jωT×(2/ω) sinωTand so, using superposition, the Fourier transform for the pair of pulses is

(2/ω)(e2jωT + e−2jωT ) sinωT = (4/ω) cos 2ωT sinωT.

3.4 Differentiation

If f (t) F (ω) then

df (t)

dt jωF (ω).

We prove this by writing down the inverse Fourier transform of F (ω),

which is, by definition,

27

Page 29: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

f (t) =1

∫ ∞−∞

F (ω)ejωtdω.

Differentiating with respect to t

df (t)

dt=

1

∫ ∞−∞

[jωF (ω)] ejωtdω

where the right hand side is the inverse Fourier transform of jωF (ω).

Finding the Fourier transform of both sides now proves the result.

3.5 Integration

If f (t) F (ω) then

∫ t

−∞f (u)du

1

jωF (ω)

provided that F (0) = 0, which implies that∫∞−∞ f (t) dt = 0.

The Fourier transform of the integral of f (t) is∫ ∞−∞

e−jωt(∫ t

−∞f (u)du

)dt.

Integrating by parts gives

1

−jωe−jωt

(∫ t

−∞f (u)du

)∣∣∣∣∞−∞−∫ ∞−∞

1

−jωf (t)e−jωt dt =

1

jωF (ω)

provided that the first term on the right hand side is zero. This will

be so if∫∞−∞ f (t) dt = 0 — why? In the case

∫∞−∞ f (t) dt 6= 0, see

Haykin, Chapter 2.

In the next chapter we use this property a great deal, along with the

differentiation and time shifting properties.

28

Page 30: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

3.6 Frequency shifting

If f (t) F (ω) then

ejω0tf (t) F (ω − ω0).

This is proved in a similar way to the time shifting property.

Example 3.3 Given that f(t) F (ω), what is the Fourier transform off(t) cosω0t?Answer We know that

cosω0t =ejω0t + e−jω0t

2

and using the frequency shifting property above, we have

f(t) cosω0t 1

2[F (ω − ω0) + F (ω + ω0)].

This example relates to amplitude modulation.

3.7 Convolution

3.7.1 Definition of convolution

Given two functions of time, f1(t) and f2(t), their convolution, writ-

ten f1 ? f2(τ ), is defined as

f1 ? f2(τ ) =

∫ ∞−∞

f1(t)f2(τ − t) dt.

Notice that this is a function of τ only. The importance of convolution

becomes clear when we find the Fourier transform of f1 ? f2(τ ).

3.7.2 Fourier transform of the convolution of two functions

Let us find the Fourier transform of the convolution of two functions

of t. This is given by

29

Page 31: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

∫ ∞−∞

e−jωτf1 ? f2(τ ) dτ =

∫ ∞−∞

e−jωτ(∫ ∞−∞

f1(t)f2(τ − t) dt)dτ.

Call this expression FTC (Fourier Transform of the Convolution).

Swap the order of integration (first w.r.t. τ , then w.r.t. t):

FTC =

∫ ∞−∞

∫ ∞−∞

f1(t)e−jωτf2(τ − t) dτ dt.

Since f1(t) depends only on t, we can write this as

FTC =

∫ ∞−∞

f1(t)

[∫ ∞−∞

e−jωτf2(τ − t) dτ]dt.

Now, applying the time shift property to the τ integral, we have

FTC =

∫ ∞−∞

f1(t)e−jωtF2(ω) dt = F2(ω)

∫ ∞−∞

f1(t)e−jωt dt,

and so

F1(ω)F2(ω) = FTC.

Hence,

F [f1 ? f2(τ )] = F1(ω)F2(ω)

or, in words,

The Fourier transform of the convolution of two functions

f1(t) and f2(t) is the product of the Fourier transforms of

the individual functions.

This pretty amazing result is known as the Convolution Theorem.

30

Page 32: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Problems, chapter 3

1. Show that the time scaling property is also true for a < 0

2. Prove the result of example 3.1 by transforming the function directly.

3. Prove the frequency shifting property.

4. If f(t) F (ω), show that F (0) = 0 implies that∫ ∞−∞ f(t) dt = 0.

5. Find the Fourier transform of

f(t) =

(T + t)/T −T < t < 0(T − t)/T 0 < t < T

0 otherwise.

(a) by direct calculation, and

(b) by finding the Fourier transform of the derivative of f(t) and thenusing the integration property to find the Fourier transform of f(t).

[Both give 2(1− cosωT )/ω2T ]

6. Find the Fourier transform of

f(t) =

1 −T0/2 < t < T0/20 otherwise.

Hence, using the frequency shift property (and doing no integration),show that the Fourier transform of

g(t) =

sinω0t −T0/2 < t < T0/20 otherwise

is

G(ω) =sin[(ω − ω0)T0/2]

j(ω − ω0)− sin[(ω + ω0)T0/2]

j(ω + ω0).

[F (ω) = (2/ω) sin(ωT0/2)]

7. (i) Use the time scaling property to show that if f(t) F (ω), thenf(−t) F (−ω). (ii) Hence, using the fact the the Fourier transformof f(t) = at, 0 ≤ t ≤ T , is a[e−jωT (1 + jωT ) − 1]/ω2, find the Fouriertransform of

g(t) =

−at −T ≤ t < 0at 0 ≤ t < T

[G(ω) = 2a(cosωT + ωT sinωT − 1)/ω2]

31

Page 33: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

8. Find f ? g(τ) if

(i)

f(t) =

1 −T < t < T0 otherwise

and g(t) = sinω0t.

(ii)

f(t) =

1− t 0 < t < 10 otherwise

and g(t) = cosω0t.

[(i) [cosω0(τ − T )− cosω0(τ + T )]/ω0, (ii)[ω0 sinω0τ − cosω0(τ − 1) + cosω0τ ]/ω2

0]

9.∗A demonstration of the Convolution Theorem.

(a) Show graphically that the convolution of two rectangular pulses ofunit height, stretching between t = −T and t = +T , is given by

Convolution =

τ + 2T −2T < τ < 0−τ + 2T 0 < τ < 2T0 otherwise.

(b) Find the Fourier transform of the convolution in (a).

(c) Hence demonstrate that the convolution theorem is true in this case,i.e., that

The Fourier transform of the convolution of the two rectangular pulses= the product of the Fourier transforms of the two rectangular pulses.

[(b) 2(1− cos 2ωT )/ω2 (c) (2 sinωT/ω)2, which is the same, since1− cos 2x = 2 sin2 x. Congratulations if you got there.]

32

Page 34: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Chapter 4

Fourier transforms withoutintegration

Aims

This chapter concentrates on a technique for calculating Fourier

transforms of piecewise polynomial functions which tend to zero

as t → ±∞, without using integration. There are distinct advan-

tages to doing it this way, once you have mastered the technique.

I give an outline of the technique here, and some problems for you

to practise on. A detailed explanation and some further worked

examples will be given in lectures.

4.1 Definition

A piecewise polynomial function f (t) is one which can be

expressed as a set of polynomials in t, each applying over a different

range of t. Examples include

f (t) =

1 −τ < t < τ

0 otherwise(rectangular pulse)

f (t) =

T+tT −T < t < 0

0 otherwise(half a triangular pulse)

33

Page 35: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

f (t) =

at2 + bt + c −t1 < t ≤ 0

−c 0 < t ≤ t2t− t2 t2 < t < 5t20 otherwise

(a nasty mess).

The important thing about functions of this type is that by differ-

entiating with respect to t sufficiently many times, nothing remains

except a set of δ-functions and their derivatives, at various times.

Loosely speaking, such functions can be ‘differentiated away’ into

nothing but a set of (derivatives of) δ-functions.

Why do this? The answer is that it is very easy to find the Fourier

transform of a set of δ-functions, and from this the Fourier trans-

form of the original function can be deduced by using the integration

property derived in the previous chapter.

Believe me, this method can often be a lot less trouble than the

alternative — for example, integrating by parts.

4.2 Recipe

Taking as an example the half triangular pulse defined above, the

following steps allow us to find its Fourier transform without inte-

grating anything. In order to follow the argument it will help you

greatly if you sketch f (t) and its derivatives.

1. Differentiate f (t) w.r.t. t, which gives

df (t)

dt= −δ(t) +

1T −T < t < 0

0 otherwise.

The δ-function arises because f (t) goes instantaneously from 1 to

0 at t = 0. Note that the area under df/dt is −1+T ×1/T = 0.

34

Page 36: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

We haven’t differentiated enough yet — the result is not zero

everywhere — so. . .

2. . . . differentiate again to get

d2f (t)

dt2=

1

Tδ(t + T )− dδ(t)

dt− 1

Tδ(t).

Note that the area under d2f(t)dt2

is 1/T − 0 + 1/T = 0. How

do we know that the area under dδ(t)dt = 0? Look back at the

differentiation property in the previous chapter: F [δ(t)] = 1

implies that F[dδ(t)

dt

]= jω, so the Fourier transform of dδ(t)

dt is 0

when ω = 0. Now look at the integration property: F (0) = 0

implies that∫∞−∞ f (u)du = 0. Hence, the area under dδ(t)

dt = 0.

3. Now we only have δ-functions and their derivatives, so we are

ready to find the Fourier transform of d2f(t)dt2

. Using the differ-

entiation property, the Fourier transform of dδ(t)dt = jω. (See

problem 1.) Using the time shifting property, the Fourier trans-

form of δ(t + T ) is ejωT . Hence,

Fd2f (t)

dt2

=1

TejωT − jω − 1

T=ejωT − jωT − 1

T.

(Check that the dimensions are consistent.)

4. Finally, to find the Fourier transform of f (t), check that we can

use the integration property twice: we can, because the area

under both the first and the second derivatives of f (t) is zero.

Hence, we integrate twice by dividing by (jω)2, which gives

F (ω) = F [f (t)] =1 + jωT − ejωT

ω2T.

35

Page 37: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Problems, chapter 4

1.∗ Show that the Fourier transform of the derivative of the δ-function is jω

(i) by using the differentiation property (easy), and

(ii) by finding the Fourier transform of the derivative of f(t), where

f(t) =

1T −T

2 < t < T2

0 otherwise

and then finding the limit of this as T → 0 (harder). Note that f(t) asdefined here has unit area, and therefore, as T → 0, tends to δ(t).

2. Using the method outlined in this chapter, find the Fourier transform of

f(t) =

h −T < t < T

0 otherwise

[F (ω) = (2h/ω) sinωT ]

3. Find the Fourier transform of the function

f(t) =

T+tT −T < t < 0

1 0 < t < T

0 otherwise

[F (ω) = (1 + jωTe−jωT − ejωT )/ω2T ]

4. Find the Fourier transform of

f(t) =

1−(tT

)2 −T < t < T

0 otherwise

[F (ω) = 4(sinωT − ωT cosωT )/ω3T 2]

5.∗Find the Fourier transform of the function

f(t) =

(tT

)30 ≤ t ≤ T

0 otherwise

[F (ω) = [6− e−jωT (6 + 6jωT − 3ω2T 2 − jω3T 3)]/(ω4T 3)]

36

Page 38: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

6.∗Have fun finding the Fourier transform of f(t) as drawn below

6

-AAAAAAAAAAAA

A

AAAAA A

AAAAAAAAAAA

0t

a

2a

f(t)

8T2T 4T 5T 7T 9T 10T 11T 13T

[F (ω) = (−a/ω2T )1− 2X2 +X4 +X5 −X7

−X8 + 2X9 −X10 −X11 +X13

where X = e−jωT ]

37

Page 39: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Chapter 5

Cross correlation and autocorrelation

Cross correlation and autocorrelation are related to convolution, and

in this chapter, we define what they are, explain some of their prop-

erties, and give some practical examples of their applications.

5.1 Reminder: complex conjugate

Before we define and discuss correlation, it will be useful to remember

the definition of the complex conjugate of a complex number, z. If

z = x + jy, then the complex conjugate of z, written z∗, is defined

as z∗ = x − jy. If z happens to be written in polar form, that is,

z = rejθ, then z∗ = re−jθ. You might notice that the same rule

works in both (in fact, in all) cases: to find the complex conjugate,

change the sign of j.

You also need to remember that zz∗ = |z|2 = (x + jy)(x − jy) =

x2 + y2 is the squared modulus of the complex number z; zz∗ ≥ 0

and is always real.

5.2 Definitions

Given two real functions of time, f (t) and g(t), say, their cross cor-

relation function, written Corr(f, g)(τ ), is defined as

Corr(f, g)(τ ) =

∫ ∞−∞

f (t)g(t + τ ) dt. (5.1)

38

Page 40: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

This is very similar to the convolution of f and g, but it is not quite

the same — the argument of the second function is t + τ and not

τ − t.The autocorrelation function is simply the cross correlation of a real

function with itself, in other words

Autocorrelation of f = Corr(f, f )(τ ) =

∫ ∞−∞

f (t)f (t + τ ) dt.

You might expect, because of the similarity of correlation to convo-

lution, that there should be a correlation theorem which is like the

Convolution Theorem (see page 30), and indeed this is the case. Here

it is.

Let us try to find FC, the Fourier transform of the cross correlation

of two functions, f (t) and g(t). By definition, this is

FC =

∫ ∞−∞

e−jωτ(∫ ∞−∞

f (t)g(t + τ ) dt

)dτ.

Changing the order of integration, we have

FC =

∫ ∞−∞

∫ ∞−∞

e−jωτf (t)g(t + τ ) dτ dt.

Substituting u = t + τ , so dτ = du, we find

FC =

∫ ∞−∞

∫ ∞−∞

e−jω(u−t)f (t)g(u) du dt

=

∫ ∞−∞

e−jωug(u) du ×∫ ∞−∞

ejωtf (t) dt.

The first part is clearly the Fourier transform of g(t), G(ω). The

second is not quite F (ω) because f (t) is multiplied by e+jωt and not

e−jωt. So what is it? Provided f (t) is real, and bearing in mind the

“change the sign of j rule”, you should be able to see that it is the

complex conjugate of F (ω), i.e. F ∗(ω). Hence

39

Page 41: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Corr(f, g)(τ ) F ∗(ω)G(ω)

are a Fourier transform pair: this is the Correlation Theorem.

Setting f (t) = g(t), we have

Corr(f, f )(τ ) F ∗(ω)F (ω) = |F (ω)|2,

where the function |F (ω)|2 is always real, greater than or equal to

zero, and is known as the power spectral density. It is a measure of

how the power in a signal is distributed over different frequencies.

5.3 Correlation properties

We give four properties here, and prove three of them.

5.3.1 The autocorrelation function is always even

It is easy to show that the autocorrelation function is always an even

function of τ . By definition,

Corr(f, f )(τ ) =

∫ ∞−∞

f (t)f (t + τ ) dt

and so

Corr(f, f )(−τ ) =

∫ ∞−∞

f (t)f (t− τ ) dt.

Substituting u = t− τ in the above gives

Corr(f, f )(−τ ) =

∫ ∞−∞

f (u + τ )f (u)dt = Corr(f, f )(τ ).

Hence, we have Corr(f, f )(−τ ) = Corr(f, f )(τ ) and so Corr(f, f )(τ )

is an even function of τ .

40

Page 42: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

5.3.2 Calculating cross correlation either way round

We show that

Corr(f, g)(τ ) = Corr(g, f )(−τ ),

which is a useful property to bear in mind since sometimes it is easier

to calculate the correlation one way round than the other.

Starting from the definition, we have

Corr(f, g)(τ ) =

∫ ∞−∞

f (t)g(t + τ )dt

and substituting u = t + τ , we have

Corr(f, g)(τ ) =

∫ ∞−∞

f (u− τ )g(u)du.

By the definition of correlation, this is just Corr(g, f )(−τ ): the −τterm comes from the fact that the argument of f is u − τ and not

u + τ .

It is now easy to see (again) that the autocorrelation function is an

even function of τ — substituting g = f in the above, we have

Corr(f, f )(τ ) = Corr(f, f )(−τ ).

5.3.3 The maximum of the autocorrelation function

We do not prove this property, but state it thus: for any τ ,

Corr(f, f )(0) ≥ Corr(f, f )(τ ),

i.e. the autocorrelation function has a maximum at τ = 0. There

may be other maxima for τ > 0, but they will never be greater than

the one at τ = 0.

5.3.4 Autocorrelation of a periodic function

Let f (t) be a periodic function with period T0, so f (t + T0) = f (t).

Then the autocorrelation function of f (t) is also periodic, with the

same period.

41

Page 43: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

This is easily proved as follows. From the definition

Corr(f, f )(τ ) =

∫ ∞−∞

f (t)f (t + τ ) dt

we have

Corr(f, f )(τ + T0) =

∫ ∞−∞

f (t)f (t + τ + T0) dt

which, since f (t) has period T0, is equal to∫ ∞−∞

f (t)f (t + τ ) dt = Corr(f, f )(τ ).

5.4 Worked examples

Example 5.1 Define

r(t) =

1 0 ≤ t ≤ T0 otherwise

and let f(t) = sinωt. Then

Corr(r, f)(τ) =

∫ ∞

−∞r(t)f(t+ τ) dt =

∫ T

0

1× sinω(t+ τ) dt

= − 1

ωcosω(t+ τ)

∣∣∣∣T0=

cosωτ − cosω(T + τ)

ω.

Example 5.2 Now for a slightly harder example. Find Corr(f, f)(τ) where

f(t) =

e−kt t ≥ 00 otherwise

Plots of f(t), f(t+τ), τ < 0 and f(t+τ), τ > 0 are shown in the figure below.Note carefully that, when τ < 0, f(t) is shifted to the right, and when τ > 0,it is shifted to the left.Case 1: τ < 0.We first work out Corr(f, f)(τ) when τ < 0. Notice from figure 5.1 (top)that f(t) = 0 for t < 0, and so f(t + τ) = 0 for t < −τ . Why −τ? Becauseτ is negative: but from the figure, you can see that f(t + τ) = 0 for t less

42

Page 44: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

0

1

0

1

0

1

f(t)

f(t+τ), τ < 0

f(t+τ), τ > 0

Figure 5.1: The function f(t) used in example 5.2.

than some positive number. It would be easy to get this wrong, and sketchinga figure helps to avoid falling into a trap.Hence, for τ < 0, we have

Corr(f, f)(τ) =

∫ ∞

−∞f(t)f(t+τ) dt =

∫ ∞

−τe−kte−k(t+τ) dt =

∫ ∞

−τe−2kte−kτ dt

= −e−kτ

2ke−2kt

∣∣∣∣∣∣∞

−τ=ekτ

2k.

Case 2: τ > 0.We now work out Corr(f, f)(τ) when τ > 0. It is still true that f(t) = 0 fort < 0, but now we have f(t + τ) = 0 for t < −τ , the logic being the same asbefore — see the bottom panel of figure 5.1.Hence, for τ > 0, we have

Corr(f, f)(τ) =

∫ ∞

−∞f(t)f(t+τ) dt =

∫ ∞

0

e−kte−k(t+τ) dt =

∫ ∞

0

e−2kte−kτ dt

43

Page 45: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

= −e−kτ

2ke−2kt

∣∣∣∣∣∣∞

0

=e−kτ

2k.

Note that the lower limit on the integral was 0 in this case.Summarising,

Corr(f, f)(τ) =

ekτ

2kτ ≤ 0

e−kτ

2kτ > 0.

-2 -1 0 1 2τ

0.0

0.5

Co

rr(f

,f)(

t)

Figure 5.2: The autocorrelation function Corr(f, f)(τ), k = 1, from example 5.2. Note thatCorr(f, f)(τ) is an even function of τ .

Notice, too, from figure 5.2, that Corr(f, f )(τ ) is an even function of

τ , and its maximum is at τ = 0, as discussed in section 5.3.

Example 5.3 Show that the Autocorrelation Theorem is true for the functionf(t) defined in example 5.2.We’ve done the hard work, which was to compute the autocorrelation func-tion. The Autocorrelation Theorem tells us that the Fourier transform ofCorr(f, f)(τ) is the same as the modulus of the Fourier transform of f(t),squared.To check this, first find the Fourier transform of Corr(f, f)(τ), which is∫ ∞

−∞e−jωτ Corr(f, f)(τ)dτ =

1

2k

∫ 0

−∞e−jωτekτdτ +

1

2k

∫ ∞

0

e−jωτe−kτdτ

44

Page 46: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

=1

2k

∫ 0

−∞e(k−jω)τdτ+

1

2k

∫ ∞

0

e−(k+jω)τdτ =e(k−jω)τ

2k(k − jω)

∣∣∣∣0−∞

− e−(k+jω)τ

2k(k + jω)

∣∣∣∣∞0

=1

2k(k − jω)+

1

2k(k + jω)=

1

2k

2k

k2 + ω2=

1

k2 + ω2.

Let us now find the Fourier transform of f(t), which is

F (ω) =

∫ ∞

−∞e−jωtf(t) dt =

∫ ∞

0

e−jωte−kt dt = − e−kt

k + jω

∣∣∣∣∞0

=1

k + jω.

Now,

|F (ω)|2 = F (ω)F ∗(ω) =1

k + jω× 1

k − jω=

1

k2 + ω2

which is indeed equal to the Fourier transform of Corr(f, f)(τ).

5.5 Power and energy signals

Let v(t) be measured in volts. If v(t) is an energy signal, then it

contains a finite amount of energy, E. Mathematically, this means

that E = g∫∞−∞ |v(t)|2dt, where g has dimensions of Ω−1, is finite.

Hence, all signals that last a finite time, e.g. rectangular or triangular

pulses, are energy signals; but so, too, are signals like f (t) in exam-

ple 5.2, which has infinite duration, but decreases rapidly enough as

t→ ±∞ that the integral for E, defined above, is finite.

By contrast, a power signal, v(t), ‘goes on for ever’ and thus contains

an infinite amount of energy, although the power is finite. Examples

include sin t, cos t or any periodic function that has a Fourier series.

It makes sense here to define power by

P = limT→∞

g

2T

∫ T

−T|v(t)|2dt.

The definition for cross correlation given earlier in equation (5.1) is

correct for energy signals but not for power signals. For power

45

Page 47: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

signals f (t) and g(t), say, we instead calculate the correlation by

Corr(f, g)(τ ) = limT→∞

1

2T

∫ T

−Tf (t)g(t + τ ) dt. (5.2)

5.6 Correlation demonstrations

We now look at two demonstrations of correlation, their purpose

being to give a feel for how correlation is useful in practical situations.

5.6.1 Cross correlation

We compute the cross correlation of two signals g(t) and h(t), each of

which consists of a sum of four sine waves. Three of the frequencies

are different in each case, but g(t) and h(t) also contain one common

frequency. Cross correlation picks out the period of this common

signal.

0 500 1000 1500 2000-3

-2

-1

0

1

2

3

g(t

)

0 500 1000 1500 2000-3

-2

-1

0

1

2

3

h(t

)

84 204 324 444-0.02

-0.01

0

0.01

0.02

Corr

(g, h)(

τ)

Figure 5.3: Cross correlation being used to pick out an underlying common periodic signal in thepresence of other periodic signals.

Specifically, in figure 5.3,

46

Page 48: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

g(t) = 0.1 sin 2πt120 + 0.5 sin 2πt

17 + 0.7 sin 2πt59 + 1.0 sin 2πt

173

and

h(t) = 0.05 sin 2πt120 + 0.4 sin 2πt

31 + 0.8 sin 2πt131 + 1.2 sin 2πt

203

although these exact details are not important — just that fact that

the signals contain one common frequency and the other three are

unrelated. The common frequency, 2π/120, corresponds to a period

of 120, and this component also happens to have a rather smaller

amplitude than the other terms. It would be difficult to pick out

what this period actually is by eye — see figure 5.3, top (g(t)) and

middle (h(t)) panels.

The bottom of figure 5.3 shows the cross correlation Corr(g, h)(τ ),

calculated using equation (5.2), since these are power signals. As can

easily be read from the figure, the common period of the two signals,

120, is also the period of Corr(g, h)(τ ).

5.6.2 Autocorrelation

Autocorrelation can be used to pick out the period (and hence the

frequency) of a periodic signal buried in noise, and figure 5.4 illus-

trates this. The signal f (t) = 1.4 r(t) + 0.05 sin 2πt/120, where r(t)

consists of normally distributed random numbers with standard de-

viation (s.d.) approximately 0.3 – see the Theoretical Distributions

chapter for what this means. The signal is plotted in the upper half

of figure 5.4. You are unlikely to be able to pick out the sine wave

by eye, in the presence of this much noise (the s.d. of the noise being

about 12 times bigger than that of the signal). However, the auto-

correlation function, shown in the lower half, reveals that there is an

underlying periodicity, and furthermore, that the period is about 120

units.

47

Page 49: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

0 500 1000 1500 2000-2.0

-1.0

0.0

1.0

2.0

0 120 240 360 480

0

0.005

0.01

f(t)

Corr(f, f)(τ)

Figure 5.4: The autocorrelation function being used to pick out an underlying periodic signal inthe presence of noise.

5.6.3 Practical applications

More details will be given in a lecture, but some examples of practical

applications of autocorrelation and cross correlation are:

• Loudspeaker evaluation. White noise is fed into a loudspeaker

and a microphone is placed to pick up the sound from the speaker.

The autocorrelation function of the output of the microphone

shows the resonant frequencies of the speaker and its housing.

• Leak location. Two sound sensors are attached to a buried water

pipe, one on either side of the leak. Assume that the velocity of

sound along the pipe is known. The cross correlation of the two

signals is calculated, the peak of which then gives the value of

x− y, where x and y are the distances between the sensors and

the leak. The distance x+y can be measured directly — it is the

distance between the sensors. Hence, we have two simultaneous

48

Page 50: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

equations in x and y, from which x and y can be found and the

leak located.

• Also used in cross correlation flow meter, GPS, Multipath inter-

ference measurements.

Problems, chapter 5

1. Given two functions of time, f(t) and g(t), write down the definition oftheir convolution, f ? g(τ) and their correlation, Corr(f, g)(τ). Directlyfrom these definitions, show that, if g(t) is an even function of time,then

f ? g(τ) = Corr(f, g)(−τ).

2. Define the following functions:

r(t) =

1 0 ≤ t ≤ T

0 otherwise

q(t) =

t 0 ≤ t ≤ T0 otherwise

c(t) = cosωt, s(t) = sinωt

where T and ω are positive constants. Calculate

(i) Corr(r, c)(τ)

(ii) Corr(q, s)(τ)

(iii) Corr(q, q)(τ) (Hint: follow example 5.2.)

[(i) [sinω(T+τ)−sinωτ ]/ω (ii) [sinω(T+τ)−sinωτ−ωT cosω(T+τ)]/ω2

(iii) (2T 3 + 3τT 2 − τ 3)/6 for −T ≤ τ < 0; (2T 3 − 3τT 2 + τ 3)/6 for0 ≤ τ < T ; 0 otherwise]

3.∗ (i) For r(t) as defined in the previous question, show that

Corr(r, r)(τ) =

T + τ −T ≤ τ ≤ 0T − τ 0 < τ ≤ T0 otherwise

(ii) Check that the Autocorrelation Theorem is true in this case by find-ing the Fourier transform of Corr(r, r)(τ), and also of r(t), squaring thelatter, and comparing.

49

Page 51: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

[R(ω) = (1− e−jωT )/(jω); |R(ω)|2 = 2(1− cosωT )/ω2, which is also thef.t. of Corr(r, r)(τ)]

4. For power signals, for instance, sin t and cos t, the autocorrelation isdefined as

Corr(f, f)(τ) = limT→∞

1

2T

∫ T

−Tf(t)f(t+ τ) dt.

(If we did not divide by 2T , the answer would usually be infinite forpower signals.)

Use this definition to calculate Corr(f, f)(τ) when f(t) = cos t.

Hint: cosx cos y = 12 cos(x+ y) + 1

2 cos(x− y)

[(1/2) cos τ ]

50

Page 52: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Chapter 6

Introductory probability

6.1 Definition of probability

In everyday English, we have many different ways of saying how likely

an event is, e.g.

will certainly

will probably

It may/might rain today.

is unlikely to

will not

These are five ways of saying roughly how likely it is to rain. They are

not quantitative though — no numbers are put on the likelihood of

rain. The part of mathematics that deals with how likely something

is, is called probability.

Example 6.1 In tossing a fair coin, there are two possible outcomes: headsor tails. The probability of a head is

P (head) =No. of outcomes that result in a head

total number of possible outcomes=

1

2.

Example 6.2 Walkers Crisps claim to have put a cheque for £10,000 in‘selected packets’. Suppose there are 10 cheques in 8,000,000 packets. Theprobability of buying a winning packet is

P (win) =No. of outcomes that result in a win

total number of possible outcomes=

1

800, 000

51

Page 53: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

. . . so you can be fairly certain you won’t be lucky.

Both these probabilities are obtained ‘in the limit’ as the coin is

tossed more and more times, or more and more crisps are bought. For

instance, if you were to toss the coin 1,000,000 times, you would be

fairly unlikely to get exactly 500,000 heads (about one time in 1,253

— we shall see how to calculate this from the Binomial distribution)

— but you would expect to obtain around 500,000 almost all the

time. To estimate experimentally the probability of a head, you

would need to find

P (head) = limN→∞

No. of heads

Number of times coin has been tossed, N.

In calculating probabilities, you need to be careful to evaluate all

possibilities, as illustrated below.

Example 6.3 A coin is tossed three times. What is the probability that(a) heads are obtained twice and tails, once? (b) the result is heads, heads,tails, in that order? (c) If at least two are heads, what is the probability thatall are heads?Answer. First write down all possible outcomes, which are hhh, hht, hth,htt, thh, tht, tth, ttt (8 in all). (a) The outcomes that consist of two headsand one tail are hht, hth, thh so

P (2 heads, 1 tail) =3

8

(b) There is only one possibility in this case: hht. Hence,

P (hht in that order) =1

8

(c) Outcomes in which there are at least two heads are hhh, hht, hth, thh (4in all). Of these, only 1 is all heads, so

P (hhh given at least two heads) =1

4

We can summarise the above examples in the following definition:

52

Page 54: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

If all outcomes of an experiment are (a) equally likely and (b)

mutually exclusive, the probability of an event E is

P (E) =number of outcomes favourable to E

total number of outcomes. (6.1)

In these examples, we have calculated the probability of an event E,

which we shall write P (E). By convention

• P (E) = 1 means E is certain to happen

• P (E) = 0 means it is certain not to happen.

Hence, all probabilities must lie between 0 and 1. Furthermore, let

us write the probability of an event E not happening as P (not E).

Then

P (E) + P (not E) = 1.

This equation is saying that the probability of an event happening,

plus the probability of it not happening, is one. It is certain that it

either happens or it doesn’t.

Example 6.4 A fair die is thrown. The probability of throwing a 4, P (4),=1/6. The probability of not throwing a 4, P (not 4) = P (1) + P (2) + P (3) +P (5) + P (6) = 5/6. So

P (4) + P (not 4) = 1/6 + 5/6 = 1.

6.2 Addition of probabilities — mutually exclusive case

We can take this further. To do so, we need to know that, if A and

B are mutually exclusive events — ones that cannot both happen

— then the probability of A or B happening, written P (A or B),

= P (A) +P (B). Examples of mutually exclusive events are: tossing

a coin — the outcome can only be heads or tails; rolling a die — the

53

Page 55: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

outcome can be precisely one of the integers 1 . . . 6, so an outcome

of, say, 4 precludes any other outcome.

For general n, rather than just 2 events, the addition formula becomes

P (E1 or E2 . . . or En) = P (E1)+P (E2)+ . . .+P (En) (6.2)

or, in words,

The probability of event E1 or E2 or . . .En happening, where

E1 . . . En are mutually exclusive events, is the sum of the

individual probabilities P (E1), P (E2). . .P (En).

Example 6.5 Two dice are rolled. What is the probability that they bothshow the same number?Answer. Let E1 be the event that both dice show 1; E2, that they bothshow 2, etc. Then P (E1) = 1/36 (one outcome favourable to E1 out of62 = 36 possible outcomes. Similarly, P (E2) = . . . = P (E6) = 1/36. NowE1 . . . E6 are mutually exclusive events — both dice showing 3, say, excludesany other outcome — so the probability of obtaining the same number is1/36 + 1/36 + 1/36 + 1/36 + 1/36 + 1/36 = 6/36 = 1/6.

6.3 Addition of probabilities — general case

IfE1 andE2 are now any two (i.e. not necessarily mutually exclusive)

events then

P (E1 or E2) = P (E1) + P (E2)− P (E1 and E2). (6.3)

The proof of this is easily seen by using a Venn diagram — figure 6.1.

The diagram is drawn inside a rectangle whose area is 1. Then P (E1)

is the area of the circle labelled E1 and P (E2) is the area of the circle

labelled E2. You should be able to see that the union of P (E1) and

54

Page 56: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

E 1 E and E E1 22

Figure 6.1: The proof of formula (6.3).

P (E2) includes the area common to E1 and E2 — the intersection

in Figure 6.1 — twice. Therefore the total area enclosed by E1 and

E2 is given by P (E1) + P (E2)− P (E1 and E2).

Example 6.6 A card is drawn at random from a standard pack of cards.What is the probability that the card drawn will be a diamond or an ace?Answer: P (diamond) = 13/52 = 1/4, P (ace) = 4/52 = 1/13 andP (diamond and ace) = P (ace of diamonds) = 1/52.Hence P (diamond or ace) = 1/4 + 1/13− 1/52 = 4/13.

6.4 Multiplication of probabilities

If two events A and B are independent, then one event has no effect

on the other. We now calculate the probability that two independent

events both happen.

Example 6.7 Suppose we toss a coin and roll a die. What is the probabilityof the coin showing heads and the die showing 3?Answer We assume that for the coin, P (heads) = 1/2 and for the die,P (3) = 1/6. We also know that there are 6 × 2 = 12 possible outcomes,only one of which is the desired one of heads and 3. Hence, we would expectP (heads and 3) = 1/12. But this result is also given by P (heads and 3) =P (heads)× P (3) = 1/12.

55

Page 57: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

This is a general rule for ‘independent AND events’:

For two independent events A and B, with probabilities P (A)

and P (B) respectively, the probability

P (A and B) = P (A)P (B). (6.4)

Problems, chapter 6

1. One card is taken randomly from a shuffled pack of 52. What is theprobability that it is (a) an ace? (b) a spade? (c) a red queen?

[(a) 1/13 (b) 1/4 (c) 1/26]

2. A cow has two calves. If male and female calves are equally likely, what isthe probability that (a) both calves are female? (b) there is at least onemale? (c) Given that there is at least one male, what is the probabilitythat both are male? [(a) 1/4 (b) 3/4 (c) 1/3]

3. Two dice are rolled. What is the probability of obtaining (a) two sixes?(b) two even numbers? (c) both numbers greater than or equal to 5?

[(a) 1/36 (b) 1/4 (c) 1/9]

4. In a large batch of resistors, it is found that 1 in 50 is out of tolerance;for capacitors, it is found that 1 in 21 is out of tolerance. If I build anRC filter using one resistor and one capacitor, what are the probabilitiesthat (a) the resistor, (b) the capacitor and (c) both components I selectwill be in tolerance?

[(a) 49/50 (b) 20/21 (c) 14/15]

5. By drawing the analogous diagram to figure 6.1, show that for THREE(not necessarily mutually exclusive) events,

P (E1 or E2 or E3) = P (E1) + P (E2) + P (E3)− P (E1 and E2)

−P (E1 and E3)− P (E2 and E3) + P (E1 and E2 and E3).

6. In the Italian Superenalotto, in order to win the jackpot, you have tomatch 6 different numbers drawn from the range 1–90 inclusive. Whatare the odds of winning the jackpot?

[Rather low at 1/622,614,630]

56

Page 58: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

7. A die is rolled three times. What is the probability that the sum of thenumbers obtained is (i) 3? (ii) 4? (iii) 5?

[(i) 1/216, (ii) 3/216 = 1/72, (iii) 6/216 = 1/36]

8. From a standard pack of cards, two are drawn at random without re-placement. What is the probability that both cards are face cards (jack,queen or king of any of the four suits)? [11/221]

9. A biscuit tin contains 100×2p coins, 50×5p coins and 30×10p coins.Two coins are drawn from the tin at random and not replaced. What isthe probability that their combined value is greater than 10p?

[329/1074]

10. Two cards are taken successively, without replacement, from a standardpack of 52. What is the probability that (a) both cards are greater than3 and less than 9? (b) The first card is an ace and the second is a facecard? (c) The cards drawn are an ace and a face card (in either order)?

[(a) 95/663, (b) 4/221, (c) 8/221]

57

Page 59: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Chapter 7

Discrete variables: the p.d.f., meanand variance

Aims

By the end of this chapter, you should understand the terms

• random variable

• normalisation

• probability density function (p.d.f.) f (x)

• cumulative distribution function (c.d.f.) F (x)

• mean and standard deviation

and be able to calculate the last three.

7.1 Random variables

We have already come across the idea of a random variable in the

previous chapter. For instance, the number shown when a die is

rolled is a random variable, because we have no way of predicting it

in advance.

The actual number a fair die will show (let us call it x) is unknown

in advance, but this does not mean to say we cannot say something

about it: for instance,

58

Page 60: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

• x lies between 1 and 6 (1 ≤ x ≤ 6)

• x is equally likely to be 1, 2, 3, 4, 5 or 6

• if we roll the die 1,000 times and calculate the average of the

numbers obtained, it is likely to be around 3.5

These items are what we could call statistical properties of the ran-

dom variable x, the number shown by a die. We could do experiments

to verify that x actually has these statistical properties. (What sort

of experiments might we do?)

7.2 Definitions: a set of N discrete values

We define below the terms mean, standard deviation and variance

as applied to a set of N discrete values, x1, x2, . . . xN .

7.2.1 Mean of x, x

To calculate the mean of a set of N discrete values, add them up and

divide by N :

x =1

N

N∑i=1

xi. (7.1)

7.2.2 Standard deviation of x, σx

To calculate the standard deviation of a set of N discrete values of

x, first find the mean, x. Then the standard deviation is given by

σx =

√√√√√ 1

N − 1

N∑i=1

(xi − x)2. (7.2)

59

Page 61: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

The reason we divide by N − 1 and not N is subtle and has to

do with the fact that the formula, as given, generally gives a better

approximation to the standard deviation of the whole population,

even though you’re only looking at a sample of size N : this will be

further explained in a lecture.

If all the numbers xi were very close to the mean, then the standard

deviation would be small, so σx can be seen as a measure of how

widely scattered around the mean the values are. It is in fact the

root mean square (r.m.s.) deviation from the mean.

People sometimes also talk about the variance; this is defined as σ2x.

Example 7.1 Two dice were rolled 12 times and the sums of the two numberswere: 12, 8, 5, 10, 8, 8, 9, 9, 5, 3, 4, 10. What are the mean and standarddeviation of these results?Answers The mean is the sum of the numbers divided by 12, which is 91/12(= 7.58). The standard deviation is the square root of

1

11

(12− 91/12)2 + (8− 91/12)2 + . . .+ (10− 91/12)2

which is 2.75.

7.3 The probability density function

The random variable obtained by rolling a fair die is rather special, in

that it is equally likely to be any of the integers (whole numbers) 1 –

6. What about random variables that do not have this ‘equally likely’

property? For example, suppose the random variable x is obtained

by rolling a die twice and adding up the two numbers shown. What

can we say about this random variable?

We can easily see that the random variable obtained by adding the

numbers in this experiment does not have the ‘equally likely’ prop-

erty. For instance, there is only one way that x = 2: when the first

throw gives 1 and the second throw also gives one. There are, how-

ever three ways that the result x = 10 can be obtained: 4,6 5,5 and

60

Page 62: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

6,4. We would therefore expect to observe x = 10 more often than

x = 2 in a large number of trials. It is an important general principle

in probability that the more ways there are of obtaining a result, the

more likely that result is.

The information about how likely different results are is best dis-

played as a bar chart1. Along the x-axis we plot the independent

variable, x, the sum of the two numbers in this example, and along

the y-axis we plot f (x), the probability of result x. So, for instance,

there are 3 ways to obtain x = 10. There are 6 × 6 = 36 different

possible outcomes from rolling a die twice, so f (10) = 3/36.

The function f (x) as we have defined it, is known as the probability

density function, abbreviated to p.d.f. Figure 7.1 explains how to

plot a bar chart of the p.d.f. for the two dice experiment. The steps

are

1. List all possible outcomes.

2. Calculate x for each one.

3. Calculate the relative frequency of each outcome — that is,

count how many times each different outcome is obtained and

divide by the number of possible outcomes (36 in this case).

4. Plot this number against x.

7.3.1 Normalisation

You will notice in figure 7.1 that the relative frequency is plotted

on the vertical axis, i.e. the frequency divided by the number of

possible outcomes. Suppose we add up all the values of f (x), that

is, we calculate f (2) + f (3) + . . . + f (12): what do we obtain?1A bar chart is a graph in which the variable plotted along the x-axis is discrete and so the y variable is plotted

as a series of vertical bars of the appropriate height.

61

Page 63: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

1,2

1,3

1,4

1,5

1,6

2,1

2,2

2,3

2,4

2,5

2,6

3,1

3,2

3,3

3,4

3,5

3,6

4,1

4,2

4,3

4,4

4,5

4,6

5,1

5,2

5,3

5,4

5,5

5,6

6,1

6,2

6,3

6,4

6,5

6,6

1,1

7 8 9 10 11 12

6 7 8 9 10 11

5 6 7 8 9 10

4 5 6 7 8 9

3 4 5 6 7 8

2 3 4 5 6 7

Add

Plotfrequency

2 3 4 5 7 8 9 10 11 121 6

1/36

2/36

3/36

4/36

5/36

6/36

f(x)

0

List possible outcomes:

0/36

sum, x

Figure 7.1: How to calculate the probability density function for the sum of numbers shown byrolling a die twice.

1 + 2 + 3 + 4 + 5 + 6 + 5 + 4 + 3 + 2 + 1

36= 1

Is it a coincidence that these numbers add up to one? No! — to

see that it isn’t, recall the addition of probabilities formula for the

mutually exclusive case (6.2) in the previous chapter. That formula

applies here, since in the ‘roll a die twice’ experiment, the events ‘sum

of the numbers = x’ and ‘sum of the numbers = y’ are mutually

exclusive if x 6= y. Now, the outcome of the experiment must be

precisely one of the numbers 2 . . . 12, and so the sum of the individual

probabilities of these numbers must be one.

A p.d.f. will always be normalised if we plot it in the way described

above, so the general rule is that all the probabilities added together

equal one, i.e. ∑i

f (xi) = 1

62

Page 64: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

where∑i

means ‘sum over all relevant values of i’.

Example 7.2 On the axes below, plot the p.d.f. for x = [the number of headsobtained when a coin is tossed four times]. Check that the probabilities addup to one.

-

6f(x)

x

7.3.2 Other names for p.d.f.

There are various different names for the p.d.f., including frequency

function, probability density and probability function, so be aware

of this when reading textbooks.

7.4 What does the p.d.f. mean?

We have looked at the p.d.f. for two examples, both of which are

discrete. That is, the variable we have called x only takes on integer

values. (You can never roll two dice and add the numbers up to get

3.4, neither can you obtain 1.5 heads in a coin tossing experiment.)

We will look at the p.d.f. in continuous cases in the next chapter.

Look back at figure 7.1. We have calculated the p.d.f. for the sum of

63

Page 65: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

the numbers shown by two dice. Two questions we might ask are:

1. What does the bar chart mean?

2. How would we plot the bar chart experimentally for the two dice?

The answer to the first question is that f (x) is the relative frequency

of the value x — i.e. the number of times x occurs, divided by the

total number of observations. So for instance, looking at figure 7.1, we

see that a sum of 5 is twice as likely as a sum of 3, since f (5) = 4/36

and f (3) = 2/36. The p.d.f. cannot tell you what the next outcome

will be (because it is random) but it can tell you the probability of a

particular outcome. The p.d.f. also enables us to calculate numbers

like the mean and standard deviation, as we shall see in section 7.6.

Strictly speaking, the answer to the second question is to take two

dice and roll them N times, adding up the numbers shown and

recording them. We would then plot a bar chart of the number of

times we had obtained the result 2, 3, . . . 12, normalised by dividing

by N . The question remains though, how large does N have to be to

obtain an accurate result? I am not going to do this experiment in

the lecture — unless N only needs to be some small number like 20

say, you would get bored and so would I — but I can do a computer

simulation that amounts to the same thing. Using the C random

number generator, drand48(), I can simulate a die being thrown and

so produce the data for N = 200, 000 in about 90 milliseconds (on

my computer).

The table below shows the results. The p.d.f. has been normalised, by

dividing by N in each case, and then the result has been multiplied

by 36 so that the numbers agree with those in figure 7.1.

64

Page 66: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

x = sum p.d.f. for N =

of numbers 20 200 200,000

2 0.0/36 0.54/36 1.0237/36

3 1.8/36 2.16/36 1.9973/36

4 3.6/36 3.42/36 2.9916/36

5 5.4/36 2.52/36 4.0104/36

6 5.4/36 4.14/36 5.0197/36

7 9.0/36 5.58/36 5.9967/36

8 3.6/36 7.02/36 4.9948/36

9 1.8/36 3.60/36 3.9470/36

10 3.6/36 4.14/36 2.9921/36

11 3.6/36 2.16/36 2.0284/36

12 0.0/36 0.90/36 0.9985/36

2 4 6 8 10 120

2

4

6

8

10

P.D

.F. , f

(x),

(3

6th

s)

20 throws

2 4 6 8 10 12x = Sum of numbers

0

2

4

6

8

10200 throws

2 4 6 8 10 120

2

4

6

8

10

200,000 throws

Figure 7.2: Finding the p.d.f. for the two dice problem by computer simulation.

65

Page 67: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

7.5 The cumulative distribution function

As discussed in the previous section, the p.d.f., f (xi) gives us the

probability that x = xi exactly. In many instances we want to know

something different, but related: what is the probability that x is less

than or equal to a given value? For instance, tubes of Smarties might

nominally contain 40, but in fact can contain anything between 37

and 44. We might want to know the probability that a tube contains

fewer than 39. As another example, we know the probability of

rolling a die and obtaining a given number — it is 1/6 (if the die is

fair) — but what about the probability that the result is less than,

say, 4?

Both these questions can be answered if we know the cumulative

distribution function, c.d.f., F (x), and F (x) can be easily worked

out if we know the p.d.f. As an example, let us calculate F (x) = the

probability that the number shown by a fair die is less than or equal

to x. We know the p.d.f. for this problem: it is f (x) = 1/6 for 1 ≤x ≤ 6 and f (x) = 0 otherwise. Hence, F (1), the probability that

x ≤ 1 is 1/6; F (2), the probability that x ≤ 2 is 1/6 + 1/6 = 1/3;

F (3) = 1/6 + 1/6 + 1/6 = 1/2 and so on.

From this, you should be able to see that in general, given f (x), we

can calculate F (x) by

F (xi) = probability that outcome x ≤ xi =∑xj≤xi

f (xj).

7.6 Mean & standard deviation: when the p.d.f. is known

Suppose now, instead of giving you a list of numbers, I give you a plot

or a table of the p.d.f., f (x). It is possible to calculate directly from

66

Page 68: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

this what the mean and standard deviation for a very large number

of observations would be.

7.6.1 Mean, x

Example 7.3 Let x be the number of heads obtained when three coins aretossed. What is the mean value of x?Answer First work out the p.d.f., f(x). You should be able to show thatf(0) = 1/8, f(1) = f(2) = 3/8 and f(3) = 1/8. (For other values of x,f(x) = 0.) These figures could also be calculated using the binomial distribu-tion — see the Theoretical Distributions chapter.How many times, on average, will we obtain 2 heads? We know that f(2) =3/8, so if we toss the three coins 8, 000 times, say, we would expect about3/8× 8, 000 = 3, 000 of these to result in 2 heads. Similarly, we would expectto get 3 or 0 heads about 1,000 times each, and 1 head about 3,000 times.The average number of heads per toss will therefore be

0× 1, 000 + 1× 3, 000 + 2× 3, 000 + 3× 1, 000

8, 000=

3

2heads per toss

From the above example, we deduce that the general formula for the

mean when the p.d.f. is known is

x =∑i

xif (xi) (7.3)

7.6.2 Standard deviation, σx

The calculation of the standard deviation is done in a similar way:

σx =√∑i

(xi − x)2f (xi) (7.4)

67

Page 69: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Problems, chapter 7

1. Ten resistors, nominally 1kΩ, are measured and their values are found tobe 996, 1001, 1023, 997, 1004, 1010, 1008, 996, 990, 1007 Ω. Calculatethe mean and standard deviation of these values.

[R = 1003.2Ω, σR = 9.4Ω]

2. In the two dice experiment, calculate the mean and standard deviationof x, where x is the sum of the two numbers. (Hint: figure 7.1 shows thep.d.f.) [x = 7, σx = 2.42]

3. Sketch the p.d.f. for

x = the number of heads − the number of tails

when four coins are tossed.

[f(4) = f(−4) = 1/16, f(2) = f(−2) = 4/16, f(0) = 6/16]

4. My research on Smarties indicates that the p.d.f., f(x) = the probabilitythat a tube contains x Smarties is as follows:

x 36 37 38 39 40 41 42 43

f(x) 1/12 1/12 2/12 2/12 3/12 1/12 1/12 1/12

For other values of x, f(x) = 0. Plot a bar chart of the c.d.f. for thisproblem. What is the probability that a tube contains (a) 39 or fewer(b) 41 or more Smarties? [(a) 1/2, (b) 1/4]

5. A money box contains 80×10p and 120×20p coins. Two coins are takenout at random without replacement. Calculate the p.d.f. f(x), where xis the total monetary value of the coins taken out. Sketch this p.d.f. inthe form of a bar chart. If this experiment is repeated many times, whatis the mean value of the money withdrawn per experiment?

[f(20) = 0.1588, f(30) = 0.4824, f(40) = 0.3588; x = 32p]

68

Page 70: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Chapter 8

Continuous distributions

Aims

By the end of this chapter, you should know about

• the p.d.f., f (x), and cumulative distribution function, c.d.f., F (x),

for continuous variables

• how to calculate the mean and standard deviation for continuous

variables

• applications to noise.

8.1 Continuous random variables

In the previous chapters we have looked at random variables x which

take on a discrete set of values, such as the number obtained by rolling

dice and so on. In this chapter we turn our attention to continuous

variables, i.e. ones which can take a continuous set of values — all

values in a range. Examples include

• the values of resistors whose nominal value is, say, 1MΩ — the

actual value might lie anywhere between about 0.9 and 1.1MΩ

(assuming 10% tolerance).

• the voltage produced by a noise source, sampled at discrete time

intervals.

69

Page 71: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

8.2 Those definitions again

Before we discuss the p.d.f., we will define the mean and standard

deviation for continuous variables.

8.2.1 Mean of x, x

Suppose x(t) is a variable (e.g. voltage or current) that depends on

time. Then, by analogy with equation 7.1, the mean of x(t) in the

range 0 ≤ t ≤ T is

x =1

T

∫ T

0

x(t)dt. (8.1)

In practice, T will often be set by the response time of the measuring

instrument.

To see why this definition is reasonable, remember that the integral

of a function between limits 0 and T is the area between a graph of

the function and the horizontal axis, with areas below the axis being

negative, and with t ranging from 0 to T . Suppose we were to squash

the graph of the function into a rectangular shape, but with the same

area and width (T ) as before. Then the height of this rectangle is

just x — which is an intuitively reasonable way to define the mean.

8.2.2 Standard deviation of x, σx

Similarly, by analogy with equation 7.2, we have

σ2x =

1

T

∫ T

0

(x(t)− x)2dt. (8.2)

Note that if x = 0 then

70

Page 72: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

σ2x =

1

T

∫ T

0

x(t)2dt = mean value of[x(t)2

].

8.3 Application to signal power

You are probably familiar with the fact that the power delivered by

a voltage of the form V1 sinωt to a load R is V 21 /2R. This is because

in general,

Signal power, P =mean square voltage, v2

load resistance, R.

In the case of a sine wave, therefore, equation 8.1 can be used to

find the mean square voltage v2. In this periodic case, it is sensible

to integrate over one complete cycle, although the integral over any

number of complete cycles, or taking the limit as T → ∞, would

give the same answer (why?). The integral, when divided by R, gives

the power:

v2 =1

T

∫ T

0

V 21 sin2 2πt/Tdt =

V 21

2

1

T

∫ T

0

(1− cos 4πt/T )dt

=V 2

1

2

1

T[T ] =

V 21

2, so signal power =

V 21

2R.

Now, notice that if the mean of a signal v = 0 then the variance,

σ2v , is the same as the mean square (see equation 8.2). Hence, the

total signal power delivered to a load R by a signal with zero mean

and variance σ2v is given by σ2

v/R. This is sometimes useful for noise

power calculations.

71

Page 73: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

8.4 The p.d.f. for continuous variables

Look back at figure 7.1. The bar chart of f (x) gives the probability

of obtaining the sum x when two dice are rolled, so that, for instance,

the probability that x = 1 is f (1) = 0, and the probability that x = 4

is f (4) = 3/36. In fact, the probability of obtaining x is equal to the

height of the strip, provided that the bar chart has been normalised.

The p.d.f. in the continuous case is the limit of the bar chart as the

width of the strips tends to zero and the number of measurements

tends to infinity. Unless we are prepared to do an infinite number

of measurements, therefore, we can only ever find (discrete) approxi-

mations to the p.d.f. by means of an experiment, and we discuss the

experimental techniques involved in the next chapter.

Example 8.1 What is the p.d.f. for the random numbers generated by the Crandom number generator drand48()?Answer The C random number generator generates pseudo-random numbers,x, in the range 0–1. We would expect them to be uniformly distributed overthat range, so that there would be, in the long run, roughly the same numberlying in the range 0 – 0.1 as in the range 0.47 – 0.57 say. In other words,we might expect the p.d.f., f(x), to be something like

f(x) =

1 0 ≤ x < 10 otherwise.

Note that

• this is a continuous distribution (x can have any value in the range ±∞);

• it is normalised, that is ∫ ∞

−∞f(x)dx = 1.

You can easily write a program to produce data for a bar chart, with a givennumber of strips, by generating a given number of random numbers.Some sample results are shown in figure 8.1.

72

Page 74: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

−0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1

x

0.0

0.5

1.0

1.5

−0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.10.0

0.5

1.0

1.5

f(x)

−0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.10.0

0.5

1.0

1.5

10 strips, 2,000 numbers

50 strips, 100,000 numbers

Infinite limit

Figure 8.1: Visualising the p.d.f. for the C random number generator, using different numbers ofstrips and random numbers.

8.5 The c.d.f., F (x)

We defined the c.d.f., F (x), in the previous chapter. The definition

there was given as a sum for a discrete distribution, so you should

not be surprised that it is an integral for continuous distributions:

F (x0) = probability that x ≤ x0 =

∫ x0

−∞f (x)dx. (8.3)

Look at figure 8.2. This illustrates how we would calculate the prob-

ability that a measurement of the random variable x lies between x0

and x1:

P (x0 ≤ x ≤ x1) =

∫ x1

x0

f (x)dx

provided that f (x) has been normalised. So, from the definition of

73

Page 75: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

F (x), we have

P (x0 ≤ x ≤ x1) = F (x1)− F (x0)

— see figure 8.2.

x

f(x)

xx0 1

Figure 8.2: The probability that x lies between x0 and x1 is the area under the p.d.f. between x0

and x1.

Example 8.2 Find the probability that none of the three light bulbs in aspotlight array will have to be replaced during the first 1,200 hours of use ifthe lifetime of a light bulb can be modelled as a random variable with p.d.f.given by

f(x) =

6(−x2 + 3x− 2) for 1 ≤ x ≤ 20 otherwise,

where x is measured in units of 1,000 hours.Answer We are dealing with independent ‘and’ events here (one light bulbdoes not affect another), so we need to find 1− F (1.2), the probability that abulb is still working after 1.2 thousand hours. (It’s 1−F (1.2) because F (1.2)is the probability that a bulb has stopped working by 1,200 hours.)The probability that all three are still working is then (1− F (1.2))3.We know the p.d.f., so bearing in mind equation 8.3,

F (1.2) =

∫ 1.2

−∞f(x)dx =

∫ 1.2

1

6(−x2 + 3x− 2)dx = 13/125

which gives a probability of (1 − F (1.2))3 = 0.72, or 72% that all three arestill working after 1,200 hours.

74

Page 76: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

8.6 Definitions: when the p.d.f. is known

If you look back at section 7.4, you will remember that we said that

the p.d.f. in the discrete case tells us a lot about the outcome of an

experiment. This is equally true in the continuous case, so that the

mean and standard deviation can easily be calculated, just as in the

discrete case.

8.6.1 Mean of x, x

x =

∫ ∞−∞

xf (x)dx (8.4)

8.6.2 Standard deviation of x, σx

σ2x =

∫ ∞−∞

(x− x)2f (x)dx (8.5)

8.6.3 The mean of any function of x

From the previous two subsections, it should come as no surprise to

you that you can calculate the mean of any function, G(x) say, from

G(x) =

∫ ∞−∞

G(x)f (x)dx. (8.6)

For instance, if you wanted to know the mean value of x3, this can

be computed from

x3 =

∫ ∞−∞

x3f (x)dx.

75

Page 77: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Example 8.3 What are the mean and standard deviation of the numbersproduced by the C random number generator?Answer Assume that the p.d.f. is

f(x) =

1 0 ≤ x ≤ 10 otherwise

Then

x =

∫ ∞

−∞xf(x)dx =

∫ 1

0

x× 1dx =x2

2

∣∣∣∣10

=1

2

and

σ2x =

∫ ∞

−∞(x− x)2f(x)dx =

∫ 1

0

(x− 1

2)2dx =

x3

3− x2

2+x

4

∣∣∣∣10

=1

12

so the standard deviation, σx, is√

1/12 = 1/(2√

3).

Problems, chapter 8

1. A voltage v(t) is given by

v(t) = V0 + V1 sinωt

(a) What is the mean, v?

(b) What is the standard deviation, σv?

(c) What is the mean power delivered by this signal to a load of resistanceR?

[(a) V0, (b) V1/√

2, (c) (V 20 + V 2

1 /2)/R]

2. In example 8.2 show that the p.d.f. given for light bulb failures is nor-malised.

3. A particular noise voltage v(t) has p.d.f.

f(v) =

1

v ln 2 for 1 ≤ v ≤ 20 otherwise

Calculate (a) the mean, (b) the standard deviation and (c) the averagepower delivered to a 50Ω load.

[(a) 1.44V, (b) 0.29V, (c) 43mW]

76

Page 78: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

4. The shelf-life, x, in months, of a batteries can be modelled as a randomvariable with p.d.f.

f(x) =

a

(x+ 5)3for x ≥ 0

0 otherwise

(a) Find the value of a.

(b) Find the probability that a single battery will have a shelf-life of (i)at least 20 months and (ii) anywhere between 10 and 40 months.

[(a) 50, (b)(i) 1/25 or 4%, (ii) 8/81 or 9.9%]

5. The waiting time in a Post Office queue, in minutes, x, is modelled as acontinuous random variable with cumulative distribution function

F (x) =

1− e−x/4 for x ≥ 00 otherwise

(a) Calculate the probability of waiting (i) less than 12 minutes, (ii) morethan 5 minutes, and (iii) between 2 and 4 minutes.

(b) Derive the p.d.f., f(x), and hence calculate the mean waiting time,x.

[(a)(i) 0.95, (ii) 0.29, (iii) 0.24, (b) x = 4 minutes]

6.∗The lifetime of a light bulb is a random variable with p.d.f. given by

f(x) =

x− 1 for 1 ≤ x ≤ 23− x for 2 ≤ x ≤ 30 otherwise

(x is measured in 1000 hours.)

(a) Sketch the p.d.f.

(b) Sketch the probability that a bulb has stopped working after a timet, with t in the range 0–4000 hours.

(c) Calculate the probability that a bulb has stopped working after 2200hours.

(d) A circuit consists of two such bulbs in (i) series and (ii) in parallel.What is the probability that these arrangements are open circuit after2,200 hours of operation?

[(c) 68% (d) (i) 90% (ii) 46%]

77

Page 79: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Chapter 9

Theoretical distributions

Aims

By the end of this chapter, you should know about

• the Gaussian (also known as normal) distribution and its prop-

erties

• the Poisson distribution and its properties

• the Binomial distribution and its properties.

9.1 The Gaussian distribution

Suppose that we were to measure the actual resistance of a large

number of resistors, say 1,000 of them, whose value is supposed to

be 1kΩ. We should not expect to obtain 1,000 values of exactly 1kΩ,

because the manufacturing process for resistors isn’t perfect. In other

words, we would expect to obtain some resistances greater than 1kΩ,

some less.

I have actually done these measurements, for 75 rather than 1,000

resistors, and a bar chart of the results is shown in figure 9.1. The

shape is more-or-less what you might have expected: a large number

around the middle and fewer further away. The mode (most popu-

lar value) however, is not 1kΩ, perhaps unexpectedly: it is 987.6Ω,

which provides evidence that the bridge I used needs re-calibrating.

78

Page 80: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

R Count

980.6 1 *

982.0 1 *

983.4 3 ***

984.8 4 ****

986.2 8 ********

987.6 17 *****************

989.0 15 ***************

990.4 16 ****************

991.8 3 ***

993.2 1 *

994.6 4 ****

996.0 0

997.4 1 *

Mean = 988.6, Std. dev. = 2.93

Figure 9.1: Non-normalised bar chart for the resistance of 74 nominally 1kΩ resistors, measured onan RLC bridge.

I actually measured 76 resistors, one of which was 99.6Ω (I imagine

that it had escaped from the 100Ω drawer) and I also discounted a

single 1009Ω resistor from the calculations, on the grounds that it

has an exceptionally high value — it is an ‘outlier’.

The bar chart in figure 9.1 is an approximation to the p.d.f. f (R) for

the various values of resistance R, except that as shown it has not

been normalised: to normalise we would need to divide each column

height by 74, the number of resistors, ×1.4Ω, the width of each class.

That would ensure that the area under the bar chart is one.

It is an experimental fact that the p.d.f. of a wide range of mea-

surements of a variable subject to random errors is found to be well

approximated by a particular curve. The p.d.f. in question has a

particular mathematical form (see below) and data that follows this

description is said to be Gaussian or normally distributed.

The continuous distribution with p.d.f.

f (x) =1

σ√

2πe− (x−x)2

2σ2 (9.1)

79

Page 81: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

is known as the Gaussian or normal distribution. It crops up all over

the place. Some points to note are:

• The mean of the random variable x is just x

• The standard deviation is σ

• The distribution is normalised, that is,∫ ∞−∞

f (x)dx = 1

• The curve is symmetrical about x = x and bell-shaped

It is useful to know how different values of the parameters x and

σ affect the shape of the Gaussian curve, and this is illustrated in

figure 9.2. Notice that the smaller σ is, the narrower and higher the

curve is; if it is narrower, it must also be higher because the total

area has to be 1 (normalisation). Note also that the peak of the curve

occurs at x = x — that is, the most likely value (the mode) is also

the mean: not all distributions have this property.

9.2 The Gaussian probability distribution

Look back at equation 8.3. That tells us that if a random variable x

is normally distributed, the probability that its value is less than a

number x1, P (x ≤ x1), is given by

F (x1) = P (x ≤ x1) =1

σ√

∫ x1

−∞e− (x−x)2

2σ2 dx (9.2)

This defines the cumulative distribution function, F (x), for a Gaus-

sian p.d.f. We can calculate the probability that x lies between x1

and x2 — it is given by F (x2)− F (x1).

80

Page 82: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

–2.0 –1.0 0.0 1.0 2.0

x

0.0

0.5

1.0

1.5

2.0

f(x)

σ =

σ =

1

0.25

0.5

σ =

Figure 9.2: The Gaussian p.d.f. for x = 0 and different values of σ.

Unfortunately, the integral in (9.2) can’t be expressed in terms of

known functions like sine, exp, log etc. and so we generally have to

find its value from tables. If you look at the integral in 9.2 you will see

that its value depends on three parameters: x, σ and x1. Obviously

it would be impractical to compile tables for all possible values of

these parameters, and this is not necessary. Instead we can use a

single table, which is on page 177 and which gives the area under the

Gaussian curve between 0 and z, where

z =|x− x|σ

is the normalised variable. From this you can calculate F (z) in all

cases, as set out below.

Example 9.1 The amplitude of a noise voltage v is normally distributed withmean 0.8V and variance 0.25V2. What is the probability that the voltagesampled at a particular instant (a) lies between 1 and 2V? (b) is less than1.5V?

81

Page 83: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Answer (a) The probability required is P (1 ≤ v ≤ 2). We need to translatethese values of v into the normalised variable z. First, the standard deviationσ =√

0.25 = 0.5V. Given the mean and standard deviation, we can see thatv = 1V corresponds to z = 0.4 and v = 2V corresponds to z = 2.4. Fromthe table on page 177, F (0.4) = 0.5 + 0.1554, F (2.4) = 0.5 + 0.4918. Hence,P (1 ≤ v ≤ 2) = 0.9918− 0.6554 = 0.3364, which is the required answer. Thetwo numbers are subtracted because the two voltages, 1 and 2V, are on thesame side of the mean.(b) Here we need to find P (−∞ ≤ v ≤ 1.5). The value v = 1.5 correspondsto z = 1.4. We first need to find the area under the Gaussian curve betweenv = −∞ and v = v = 0.8 V. Since F (v) is symmetrical about v = v,and F (∞) = 1 (normalisation), we know that F (v) = 0.5. Now, the areabetween z = 0 and z = 1.4, from the table, is F (1.4) = 0.4192. Hence,P (−∞ ≤ v ≤ 1.5) = 0.5 + 0.4192 = 0.9192. The two numbers are addedbecause the two voltages −∞ and 1.5V are on opposite sides of the mean.

9.3 The Poisson distribution

This is a discrete distribution and has many applications, e.g. in

computer networks and queueing theory.

The distribution arises in situations where a series of independent

random events occurs, and the probability of a single such event

occurring within a small time interval is proportional to the length

of that interval. In fact, it applies not just to events that happen

in time, but events distributed within any region. For example, the

Poisson distribution allows us to answer questions such as

• If an office receives on average 100 telephone calls per hour, what

is the probability of exactly 210 calls being received in a given

two hour period? [2.2%]

• If a cyclist gets a flat tyre once every 5,000 miles on average,

what is the probability of having no flat tyres in 10,000 miles?

[13.5%]

82

Page 84: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

• A typist makes an average of one mistake per page; what is

the likelihood of picking a page at random that contains three

mistakes? [6.1%]

We now derive the Poisson p.d.f.

Suppose that at the book issue desk of a library, the probability that

one person arrives during a small time interval from 0 to δt is λδt,

with λ a constant equal to the average number of arrivals per unit

time. We want to calculate Pn(t), which is the probability of exactly

n arrivals during a time interval t.

We can calculate this probability by considering Pn(t+δt), the prob-

ability of exactly n arrivals during the interval t+ δt. For n > 0 this

is the sum of the probabilities of two mutually exclusive events, i.e.

[n arrivals in t and none in δt] and [n− 1 arrivals in t and 1 in δt].

That is

Pn(t + δt) = Pn(t)× P0(δt) + Pn−1(t)× P1(δt)

where we have assumed that δt is so small that P2(δt) ≈ 0.

Now, the probability of one arrival in δt is P1(δt) = λδt by definition,

so the probability of no arrivals in δt, P0(δt) = 1− λδt. Using these

values in the above equation gives

Pn(t + δt) = Pn(t)(1− λδt) + Pn−1(t)λδt

Hence

Pn(t + δt)− Pn(t)

δt=

dPn(t)

dt= λ[Pn−1(t)− Pn(t)] (9.3)

where we have taken the limit as δt→ 0. This is actually a differential-

difference equation for Pn(t), which we can solve.

First let us consider n = 0. In 9.3, P−1(t) = 0 — we cannot have

−1 arrivals during any time interval, so 9.3 becomes

83

Page 85: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

dP0(t)

dt= −λP0(t)

which has the solution P0(t) = P0(0)e−λt. Since P0(0), the probabil-

ity of no arrivals in zero time, is unity, this simplifies to

P0(t) = e−λt.

Knowing P0(t), we can use this in 9.3 with n = 1 to find P1(t), which

turns out to be

P1(t) = λte−λt

(see problems in the chapter entitled ‘Differential Equations and the

Laplace Transform’). Solving 9.3 for successive values of n gives

Pn(t) =(λt)n

n!e−λt (9.4)

which is the probability of exactly n arrivals in a time t when the

mean arrival rate is λ. This is the Poisson distribution.

Example 9.2 During the 8 hour period that a library is open, a total of 960people join the queue at the book issues desk. (a) What is the average rateat which people arrive in the queue, in people/minute? (b) What are theprobabilities of exactly 0, 1, 2, and 3 people arriving in the queue during anygiven minute?Answer (a) 8 hours = 480 minutes; hence λ = 960/480 = 2 people/minuteis the average arrival rate.(b) ‘Per unit time’ in the context of this problem means ‘per minute’. ThePoisson distribution tells us thatP0 = (λ×1)0

0! e−λ×1 = 1× e−2 = 13.5%

P1 = (λ×1)1

1! e−λ×1 = 2× e−2 = 27.1%

P2 = (λ×1)2

2! e−λ×1 = 2× e−2 = 27.1%

P3 = (λ×1)3

3! e−λ×1 = 1.33× e−2 = 18.0%

The Poisson distribution has mean λt, standard deviation√λt (see

problems) and is of course normalised so that

84

Page 86: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

∞∑n=0

Pn(t) = 1.

9.4 The binomial distribution

The binomial distribution is another discrete distribution. It applies

to situations with a discrete number of possible outcomes. It is de-

fined as follows:

If the probability of an event occurring is p, and of

it not occurring is q (so that q = 1 − p), then the

probability that the event will happen k times out

of n is given by the (k + 1)-th term in the binomial

expansion of (q + p)n.

Recall that

(q + p)n =

qn + nqn−1p+n(n− 1)

2!qn−2p2 + . . .+

n!

(n− k)!k!qn−kpk + . . .+ pn.

(9.5)

Example 9.3 A die is rolled 4 times. What is the probability of obtaining(a) 2 (b) 4 sixes?Answer This is a classic example of the sort of problem to which the binomialdistribution applies. In this case, let p be the probability of obtaining a six withone throw of the die, so p = 1/6, and so q, the probability of not obtaining asix, is 5/6. Using the binomial expansion, we obtain

(5

6+

1

6

)4

=

(5

6

)4

+ 4

(5

6

)3 (1

6

)+ 6

(5

6

)2 (1

6

)2

+ 4

(5

6

) (1

6

)3

+

(1

6

)4

so the probability of 2 sixes is 6× (5/6)2× (1/6)2 ≈11.6%. The probability of4 sixes is (1/6)4 (as you’d expect) ≈ 0.08%.

85

Page 87: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Problems, chapter 9For areas under the Gaussian curve, see the table on page 177.

1. Resistor values are found to be normally distributed with mean R andstandard deviation σ. In a large batch of resistors of the same nominalvalue, what percentage would be expected to lie within (a) ±σ, (b) ±2σof R? (c) Exactly half of all resistors lie within ± how many σ of R?

[(a) 68%, (b) 95%, (c) 0.67σ]

2. Nominally 1µF capacitors are found to have values that are normallydistributed. They are marked as being of ±5% tolerance, but 20% arefound to be outside this range. What is the standard deviation of theproduction spread? [0.039µF]

3. A d.c. signal of 100mV has added noise whose amplitude p.d.f. is Gaus-sian with zero mean and variance 10−6V2. This signal is fed into a D.V.M.with resolution 1mV, which rounds to the nearest 0.5mV. Calculate theprobability of the meter reading 101mV.

[0.2417]

4. In a binary signal, levels of 0 and 100mV correspond to logic 0 and 1respectively. Suppose this signal has Gaussian noise with zero mean andstandard deviation of 50mV added to it. (a) What is the probabilityof a bit error being produced, assuming that the threshold for decidingbetween 0 and 1 is 50mV? (b) What is the probability of a 4 bit wordbeing correct?

[(a) 15.9%, (b) 50.1%]

5. Show that the Poisson distribution really does obey equation (9.3).

6. Show that the Poisson distribution is normalised.

7.∗ Show that the Poisson distribution has mean λt.

8. Crashes of the student file server are Poisson distributed, occurring at amean rate of 2 per day when there’s a deadline to be met. What is theprobability of (a) 0, (b) 2, (c) 4 crashes in one day?

[(a) 13.5%, (b) 27%, (c) 9%]

9. The average number of faults on a new car is 5. What is the probabilityof (a) buying a new car with 0 faults and (b) buying two new cars with

86

Page 88: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

a total of 4 faults between them? (c) What is the most likely number offaults in one car?

[(a) 0.67%, (b) 1.9%, (c) 4 and 5 equally likely]

10. Calculate the probabilities for the three examples of the Poisson distri-bution on page 82. N.B. 210! ≈ 1.06× 10398.

11. The premium bond problem. For every pound you invest in premiumbonds, you used to have a 1/15,000 chance of winning a prize each month.Suppose you have invested £20,000. What is the probability of winning,in a given month, (a) exactly one prize? (b) exactly two prizes? (c) atleast one prize?

(Hints. The binomial distribution applies. For part (c) probability of atleast one prize = 1− probability of no prizes.)

[(a) 0.3515 (b) 0.2343 (c) 0.7364]

12. A hundred samples of 5 resistors were taken from a large batch. 59samples had no defective resistors, 33 had 1, 7 had 2, 1 had 3 and nosamples had 4 or 5 defective resistors. Show that the distribution isapproximately binomial and estimate the overall percentage of defectivecomponents.

[about 10%]

13. Show that, for all n ≥ 0, the Poisson distribution, equation (9.4), isindeed the solution to equation (9.3).

87

Page 89: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Chapter 10

The method of least squares

Aims

By the end of this chapter, you should understand

• how the method of least squares works

• how to fit a straight line to given data

• how to fit simple curves to given data.

You will need to recall some facts about partial differentiation from

first year maths.

10.1 Gauss

Carl Friedrich Gauss was an important mathematician in his time. In

the Theoretical Distributions chapter we learnt about a probability

density function that was named after him; in this chapter, we discuss

the method of least squares, which was discovered by him.

10.2 A data fitting problem

Suppose we measure the current in through a resistor R, for N dif-

ferent values of the voltage vn across it (so n = 1, 2, 3, . . . , N). If

Ohm’s law holds, the graph of in against vn should be a straight

line with slope 1/R. Experiments being what they are, there will

88

Page 90: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

be some errors in the measurements and the resulting graph will not

be exactly a straight line. How do we then calculate the slope and

intercept of the ‘best’ straight line through the data, and what do

we mean by ‘best’ anyway?

The general ‘straight line fit’ problem is illustrated in figure 10.1.

di

yi

xi ,( )

*

*

*

*

*

*

**

*

*

m

*

*

y

x

c

*

Figure 10.1: A problem to be solved by the method of least squares: fit a straight line of the formy = mx+ c to the given data set. The vertical distance from the i-th point (xi, yi) to the line is di.

10.3 The method of least squares

Almost any straight line1 can be represented in the form y = mx+c,

where m is the gradient and c is the y-intercept. We want to find the

two numbers m and c that best represent a given set of data, with

the assumption that

The errors in x are much smaller than the errors in y.

Under this assumption, a way to do this is to1The exception is any vertical straight line.

89

Page 91: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Calculate m and c so as to minimise the sum of the

squared vertical distances of each of the points from

the straight line.

This is known as the method of least squares, since we are trying to

minimise a sum of squares. We minimise the sum of squared vertical

distances because the errors in x are assumed to be much less than

the errors in y. We have also found one plausible answer to the

question “What do we mean by ‘best’ straight line?” — one that

minimises the sum of the squared vertical distances. Why squared

distances? There are two points to note here:

1. If just the distance were to be used, some cancelling out could

happen, since some of the distances could be positive and some

negative. In fact we could make the sum of distances equal to 0,

with a straight line that was a very poor fit to the data.

2. The calculation of c and m is straightforward for squared dis-

tances, as we shall see.

There are other ways this fit could be done, e.g. by minimising the

sum of the absolute values, or the fourth power of the distances,

neither of which can be carried out as easily.

If the errors in y are much smaller than the errors in x, then you

should swap the x and y values in what follows. The theory then

remains the same.

10.4 Calculating m and c

Let us write the i-th data point, with i going from 1 to N , as (xi, yi).

We then need to define S, the sum of the vertical squared distances

of all the points from the straight line y = mx+ c. This is given by

90

Page 92: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

S =

N∑i=1

(yi −mxi − c)2.

It is surprisingly easy to find the values of c and m that minimise

S. We partially differentiate S with respect to c and to m, and set

the derivatives equal to zero. This assumes that S as a function of c

and m has exactly one turning point, which is a minimum. This is

indeed true, and can be proved by calculating second derivatives —

see problems. The values of c and m that satisfy the resulting pair

of equations are the values that minimise S. Hence

∂S

∂c=

N∑i=1

−2(yi −mxi − c) = 0

and

∂S

∂m=

N∑i=1

−2xi(yi −mxi − c) = 0

Using the fact that∑N

i=1 c = Nc, the first equation gives

N∑i=1

yi −mN∑i=1

xi −Nc = 0 (10.1)

and the second

N∑i=1

xiyi −mN∑i=1

x2i − c

N∑i=1

xi = 0. (10.2)

We now have two simultaneous linear equations and two unknowns,

c and m, so we can solve for c and m.

91

Page 93: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Example 10.1 Use the method of least squares to fit a straight line to thefive points

(−1, 3.2), (0, 1.4), (1,−0.8), (2,−2.9), (3,−3.8)assuming that the x-values are accurate.Answer We will use equations 10.1 and 10.2, so we first calculate

N∑i=1

xi = 5,

N∑i=1

yi = −2.9,

N∑i=1

x2i = 15,

N∑i=1

xiyi = −21.2

Equations 10.1 and 10.2 now become

−2.9− 5m− 5c = 0 and − 21.2− 15m− 5c = 0

which we can solve to obtain

m = −1.83 and c = 1.25.

The data and the least squares straight line fit to the data are shown in fig-ure 10.2.

-1.0 0.0 1.0 2.0 3.0-4.0

-2.0

0.0

2.0

4.0

Figure 10.2: Five data points and a straight line fit to them, as calculated by the method of leastsquares.

92

Page 94: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

10.5 Fitting to a parabola

In a similar way, we can calculate a least squares fit to a parabola of

the form y = a+ bx+ cx2. In this case there are three unknowns, a,

b and c. We still define S as the sum of the squared vertical distances

from the parabola to the points, and hence

S =

N∑i=1

(yi − a− bxi − cx2i )

2

The three equations now are

∂S

∂a=

N∑i=1

−2(yi − a− bxi − cx2i ) = 0

∂S

∂b=

N∑i=1

−2xi(yi − a− bxi − cx2i ) = 0

and

∂S

∂c=

N∑i=1

−2x2i (yi − a− bxi − cx2

i ) = 0

As before, these equations can be solved for a, b and c.

Similar calculations can be used to fit any functions to a data set,

provided that the functions are linear in the unknown parameters.

For example,

y = a sinx y = ax + bex y = ax3 + b lnx + c

are all linear in the parameters a, b and c, and the method of least

squares can be used to find the parameters for a given set of data.

By contrast, the following

y = e(x−b)2/c2 y = cos(a/x + bx + c) y = ln(a + bx)

are not linear in a, b and c, and least squares cannot be used — at

least not directly.

93

Page 95: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Problems, chapter 10

1. By considering second derivatives, show that the values of c and m ob-tained by solving equations 10.1 and 10.2 are such that

S =

N∑i=1

(yi −mxi − c)2

is a minimum (as opposed to a maximum).

2. Fit a straight line of the form y = ax + b to the following set of points,by using the method of least squares:

(0, 12.3), (5, 14.5), (8, 15.0), (11, 17.6)

Assume that the x values are correct.

[a = 0.4500, b = 12.15]

3. A battery of nominal voltage V0 and internal resistance r is connected toa variable resistance. Various values of the current i through and voltagev across this load are given below

i 0 2 4 6 8 Amps

v 6.1 4.9 3.0 1.6 0.2 Volts

Assuming that the errors in the current readings are much smaller thanthose in voltage, calculate V0 and r.

[V0 = 6.18V, r = 0.755Ω]

4. (i) Show that the value of a that gives the least squares fit of the functiony = ax2 to a data set (x1, y1), . . . (xN , yN), is given by

a =

∑Ni=1 x

2iyi∑N

i=1 x4i

(ii) Some power, P , versus voltage, V , measurements for a resistor R aregiven below.

V 1 1.5 2 2.5 3 Volts, ±0.3%

P 0.2 0.6 0.9 1.6 2.4 Watts, ±2%

94

Page 96: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Calculate the least squares value of R.

[R = 3.87Ω]

5.∗ (i) Show, by taking logs, that least squares fitting a function of the form

y = aebx

can be reduced to fitting a straight line.

(ii) A capacitor C is initially charged to 10V and then connected acrossa resistor R. The current through R measured at 1 millisecond intervalsis

t 0 1 2 3 4 ms, ±0.5%

i 4.5 2.8 1.5 1.0 0.6 mA, ±2.5%

Using the method of least squares, find R and C.

[R = 2.2kΩ, C = 0.89µF]

6.∗The average mass, y, of nails of length x obeys the law y = axb where aand b are constants.

(i) Show that the problem of finding a and b from N data points canbe reduced to a least squares straight line fitting problem in which theequations to be solved are∑

i

ln yi − b∑i

lnxi −N ln a = 0

and ∑i

lnxi ln yi − b∑i

(lnxi)2 − ln a

∑i

lnxi = 0

(ii) Given the following data:

x 1 2 4 6 inch

y 5 12 30 60 g

and assuming that the nail lengths are more accurately known than themasses, estimate a and b.

[a = 4.81, b = 1.37]

95

Page 97: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Chapter 11

Complex frequency

11.1 Complex frequency

You should be familiar now with the idea of a transform since we have

looked at the Fourier transform in some detail. The purpose of the

Fourier transform is to represent a function of time, f (t), instead as a

function of angular frequency, F (ω). Both f (t) and F (ω) represent

the same function, but in terms of a different variable.

Similar to, but not the same as the Fourier transform is the Laplace

transform, which transforms a function of time, f (t), into a function

of the variable s, known as complex frequency. We define the Laplace

transform in the next chapter, but in this chapter we look at what s

means.

In general, s has both a real and imaginary part, and it is written

conventionally as

s = σ + jω

so that

est = e(σ+jω)t = eσtejωt.

We always assume that σ and ω are real.

We already know that ejωt = cosωt+ j sinωt is periodic with period

2π/ω. What is the meaning of σ, the real part of s?

There are three cases to consider: (1) σ < 0, (2) σ = 0 and (3)

σ > 0. We consider these in turn.

96

Page 98: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

11.1.1 σ < 0

Here, eσt is an exponentially decreasing function of time. If this

is then multiplied by ejωt, the real part of the result is a damped

oscillation:

t

t

t

Re e

st

σ < 0

σ < 0

11.1.2 σ = 0

Here, eσt = 1 is a constant function of time. If this is then multiplied

by ejωt, the real part of the result oscillates with constant amplitude:

t

t

t

Re e

st

σ = 0

σ = 0

1

97

Page 99: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

11.1.3 σ > 0

Here, eσt is an exponentially increasing function of time. If this is

then multiplied by ejωt, the real part of the result is an exponentially

growing oscillation:

t

t

t

Re e

st

σ > 0

σ > 0

11.2 Linear homogeneous differential equations

Recall that a linear second order differential equation is an equation

of the form

d2v

dt2+ 2aω0

dv

dt+ ω2

0v = f (t)

This equation is

• linear (only first powers of the unknown function, v, and its

derivatives appear)

• second order (the highest derivative that appears is the second)

It is assumed that the real constants a and ω0 are known, and also

the function (the ‘drive’) f (t) on the right hand side is given. The

98

Page 100: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

problem then is to find the unknown function v(t) that satisfies the

differential equation for all times t and all initial conditions.

If f (t) = 0 then the equation becomes

d2v

dt2+ 2aω0

dv

dt+ ω2

0v = 0 (11.1)

and is described as a homogeneous linear differential equation.1 We

consider this case now. In order to solve 11.1 we assume that the

solution will be of the form

v(t) = V0est where V0 is a constant.

We then need to find the possible values of the complex frequency s.

Substituting our assumed solution into 11.1 and using the fact that

dv

dt= V0se

st andd2v

dt2= V0s

2est

gives [s2 + 2aω0s + ω2

0

]V0est = 0.

This has to be 0 for all times, t. Hence either V0 = 0 (trivial

solution, since this leads to v(t) = 0 for all t) or

s2 + 2aω0s + ω20 = 0.

By assuming the general form of the solution, we have managed to

transform the original differential equation into a quadratic in s —

which of course we know how to solve:

s± = −ω0a± ω0

√a2 − 1.

This is just a shorthand way of writing the two values of s

s+ = −ω0(a+√a2 − 1) and s− = −ω0(a−

√a2 − 1).

1If f(t) 6= 0, then it is an inhomogeneous differential equation.

99

Page 101: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

The most general solution to 11.1 will therefore be

v(t) = e−ω0at[Ae(ω0

√a2−1)t + Be−(ω0

√a2−1)t

]

where A and B are arbitrary constants whose values can be found

from initial conditions.

We can now use the results of section 11.1 to describe the behaviour

of v(t) as defined by the differential equation (11.1). We can always

assume that ω0 > 0 (why?). The behaviour of v(t) then depends on

the value of a. There are three cases:

1. a2 > 1

2. a2 = 1

3. a2 < 1

We consider these in turn.

11.2.1 a2 > 1

In this case, a2 − 1 > 0 and so√a2 − 1 is real. Furthermore, if

a > 0, a−√a2 − 1 > 0. Hence, the two numbers

s± = −ω0(a±√a2 − 1)

are both negative if a > 0 so the general solution is the sum of two

damped exponentials.

Similarly, if a < 0, a−√a2 − 1 < 0. Thus, the two numbers

s± = −ω0(a±√a2 − 1)

are both positive if a < 0 and in this case, the general solution

consists of the sum of two growing exponentials.

100

Page 102: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

11.2.2 a2 = 1

When a2 = 1,

s± = −ω0a

so the solution is exponentially decaying if a > 0 and exponentially

growing if a < 0. (In fact, the situation is a bit more complicated

than this, and the Laplace transform enables us to sort out the dif-

ficult cases easily.)

11.2.3 a2 < 1

In this case, a2 − 1 < 0 and so√a2 − 1 is imaginary. Hence

s± = −ω0(a± j√

1− a2)

are both complex. Therefore, if the real part of s±, −ω0a, is negative

— that is, a > 0 — the solution is damped oscillatory.

On the other hand, if a < 0, the solution is exponentially growing

and oscillatory.

All the above are summarised in the following diagram.

a−1 0 1

Growing Damped

oscillatoryoscillatory

Growing exponential Damped exponential

Steady state oscillation

Figure 11.1: All possible types of behaviour of solutions of equation (11.1).

101

Page 103: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Problems, chapter 11

L R

CS

1. In the figure, L = 4H, C = 1F. Capacitor C is initially charged. SwitchS is then closed. For what value/range of values of R is the subsequentbehaviour

(i) damped oscillatory

(ii) damped exponential

(iii) oscillatory with constant amplitude

(iv) growing oscillatory?

What is the frequency in the case of an oscillatory solution with constantamplitude?

Which of these would be physically realisable with passive components?

[(i) 0 < R < 4Ω (ii) R ≥ 4Ω (iii) R = 0 (iv) −4 < R < 0; 1/4π Hz; (i)and (ii) are realisable]

102

Page 104: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Chapter 12

The Laplace Transform

12.1 The Laplace transform

You should already be familiar with the idea of a transform, as we

have discussed the Fourier transform in previous lectures. Just as

the Fourier transform allows us to express a function of time instead

as a function of angular frequency ω, the Laplace transform allows

us to express a function of time in terms of complex frequency, s.

(Some books use p.) If the function of time is f (t), then its Laplace

transform is written F (s), or occasionally L[f (t)], and is defined by

F (s) = L[f (t)] =

∫ ∞0

e−stf (t) dt. (12.1)

Two important differences between the Laplace transform and the

Fourier transform are

1. In the Laplace transform, the function f (t) is assumed to start

from t = 0, whereas in the Fourier transform, it is assumed to

start from t = −∞.

2. In the Laplace transform, the new variable s has both real and

imaginary parts, whereas in the Fourier transform, jω is purely

imaginary.

Let us start by calculating some Laplace transforms.

103

Page 105: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Example 12.1 If f(t) = e−kt, then

F (s) = L[e−kt]

=

∫ ∞

0

e−ste−kt dt =

∫ ∞

0

e−(k+s)t dt

= −e−(k+s)t

k + s

∣∣∣∣∣∣∞

0

=1

k + s.

So

L[e−kt

]=

1

k + s. (12.2)

Example 12.2 If f(t) = sinωt then, using the fact that

sinωt =e jωt − e−jωt

2j

we see that

L[sinωt] =

∫ ∞

0

e−st(e jωt − e−jωt)

2jdt.

Using the previous result, that L[ekt

]= 1/(k + s), we get

L[sinωt] =1

2j

[1

−jω + s− 1

jω + s

].

Hence, simplifying,

L[sinωt] =ω

ω2 + s2.

Example 12.3 What is the Laplace transform of cosωt = e jωt+e−jωt

2 ? Asbefore,

L[cosωt] =1

2

[1

−jω + s+

1

jω + s

]

=s

ω2 + s2.

104

Page 106: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

12.2 The Laplace transform of a derivative

The importance of the Laplace transform in solving differential equa-

tions becomes clear when we try to find the transform of the deriva-

tive of a function f (t) w.r.t. time:

L[

df

dt

]=

∫ ∞0

e−stdf

dtdt

Integrating by parts gives

L[

df

dt

]= e−stf (t)

∣∣∣∣∞0

−∫ ∞

0

−se−stf (t) dt

= −f (0) + sL[f ] = −f (0) + sF (s).

We have assumed that f (t) is such that limt→∞ e−stf (t) = 0. (If f (t)

didn’t have this property, it would not have a Laplace transform.)

What about second derivatives? Using the fact that

d2f

dt2=

d

dt

df

dt

we can use the result for the first derivative:

Ld2f

dt2

= −df (0)

dt+ sL

df

dt

Replacing L

[dfdt

]with [−f (0) + sF (s)] gives

Ld2f

dt2

= −sf (0)− df (0)

dt+ s2F (s)

The two important results we have deduced are

Ldf

dt

= −f (0)+sF (s), Ld2f

dt2

= −sf (0)−df (0)

dt+s2F (s).

(12.3)

105

Page 107: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Note that f (0) is the value of f (t) at t = 0 and df(0)dt is the value of

the derivative of f at t = 0.

Example 12.4 Is this consistent with our previous examples? We’ve alreadyfound L[sinωt] and L[cosωt]. They are given by

L[sinωt] =ω

ω2 + s2and L[cosωt] =

s

ω2 + s2

But,

sinωt = − 1

ω

d

dtcosωt

so the Laplace transform of sinωt should equal

L[−1

ω

d

dtcosωt

]= − 1

ω(− cos 0 + sL[cosωt]) = − 1

ω(−1 +

s2

ω2 + s2) =

ω

ω2 + s2

which is indeed the Laplace transform of sinωt.

106

Page 108: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Problems, chapter 12

1. Show that the Laplace transform has the superposition property, i.e. if

L[f(t)] = F (s) and L[g(t)] = G(s), then

L[af(t) + bg(t)] = aF (s) + bG(s)

where a and b are constants.

2. Find the Laplace transform of

(i) f(t) = a, a is a constant.

(ii) f(t) = t

(iii) f(t) = a+ bt, a and b constants. (Use superposition).

[(i) a/s, (ii) 1/s2, (iii) (as+ b)/s2]

3. Expand sin(ωt+ φ) and hence show that

L[sin(ωt+ φ)] =ω cosφ+ s sinφ

s2 + ω2

What is L[cos(ωt+ φ)]?

[(s cosφ− ω sinφ)/(s2 + ω2)]

4. Find the Laplace transform of e−kt cos(ωt+φ) and e−kt sin(ωt+φ) withoutintegration, by

(i) deducing the Laplace transform of e−kte j(ωt+φ) (use equation 12.2)

then

(ii) finding the real and imaginary parts of this expression.

[ (s+k) cosφ−ω sinφ(s+k)2+ω2 , (s+k) sinφ+ω cosφ

(s+k)2+ω2 ]

107

Page 109: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Chapter 13

Differential Equations and theLaplace Transform

13.1 Inhomogeneous differential equations

In the last but one chapter, we saw how to solve the following differ-

ential equation

d2v

dt2+ 2aω0

dv

dt+ ω2

0v = f (t) (13.1)

with f (t) = 0. We could (a) describe the solutions qualitatively (e.g.

damped oscillatory, growing exponential etc.) and (b) write down a

general, exact solution.

In this chapter, we discuss how to do (b) but now when f (t) 6= 0, or,

in technical terms, when the differential equation is inhomogeneous.

Where does such an equation arise in practice?

L R

CS

Figure 13.1: A circuit described by a homogeneous differential equation

108

Page 110: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

L R

Cf(t)

Figure 13.2: A circuit described by an inhomogeneous differential equation

In figure 13.1 the capacitor is initially charged and switch S is open.

At t = 0, S is closed. The behaviour of the circuit is described by

the homogeneous differential equation

LCd2v

dt2+ RC

dv

dt+ v = 0

where v = v(t) is the voltage across C.

In figure 13.2 the circuit is driven by an applied voltage f (t) — this

might, for instance, be a sine wave from a signal generator. The

circuit is now described by the inhomogeneous differential equation

LCd2v

dt2+ RC

dv

dt+ v = f (t). (13.2)

We are going to solve differential equations like this one by using the

Laplace transform technique.

13.2 Solving a d.e. by Laplace transform — overview

Recall that

to solve a differential equation in a function of time, v(t),

means

to find a function, v(t), that satisfies the differential equation for

all time, t.

109

Page 111: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

You should also remember that the general solution of a second order

differential equation will have two arbitrary constants whose values

are determined from initial conditions.

A good way to solve equation 13.1 when f (t) 6= 0 uses the Laplace

transform. This method requires us to

1. Find the Laplace transform of the differential equation;

2. solve the resulting (algebraic) equation for V (s), the Laplace

transform of v(t); then

3. find the inverse Laplace transform of V (s), which gives us v(t).

We look at each of these items in turn.

13.3 The Laplace transform of a differential equation

Using the rules for finding the Laplace transform of first and sec-

ond derivatives, and writing dv(0)dt = v′(0), we can immediately find

the Laplace transform of the differential equation for a driven RLC

circuit, equation 13.2. It is

LC[−sv(0)− v′(0) + s2V (s)] +RC[−v(0) + sV (s)] + V (s) = F (s)

This looks rather a mess! It is, however, just a linear equation for

V (s), the Laplace transform of the (as yet unknown) function v(t).

Solving for V (s) gives

V (s)[LCs2 + RCs + 1

]= F (s) + LCsv(0) + LCv′(0) + RCv(0)

so

V (s) =F (s) + LCsv(0) + LCv′(0) + RCv(0)

LCs2 + RCs + 1(13.3)

We haven’t found v(t) yet, but we’ve found something closely related

to it: the Laplace transform of v(t), V (s). And, what is more, this

is a completely general expression for V (s), valid for any

110

Page 112: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

• drive function, f (t) (provided its Laplace transform exists)

• initial conditions v(0) and v′(0)

• values of R, L and C.

Notice that the initial conditions (v(t) and its derivative at t = 0)

are automatically built into the expression for V (s).

Example 13.1 Let R = 3/2Ω, C = 2F and L = 1H. Let f(t) = H(t) be theHeaviside function, also knowns as the unit step function, which is defined by

H(t) =

0 t < 01 t > 0

(H(t) is undefined at t = 0.)If the initial capacitor voltage v(0) = 0V with initial rate of change v′(0) =0V/s, find the Laplace transform of v(t), V (s).Answer We have been asked to calculate the response of a circuit to an inputconsisting of a unit step function.According to equation 13.3, in order to find V (s), we need to find the Laplacetransform of the drive function f(t). This is H(t), whose Laplace transformis given by

L[H(t)] =

∫ ∞

0

e−st × 1 dt = −1

se−st∣∣∣t=∞t=0

=1

s

Substituting the given values in 13.3, we get

V (s) =1

s(s+ 1)(2s+ 1)

In words,

the Laplace transform of the unit step response of the circuit is1/[s(s+ 1)(2s+ 1)].

We are now left with the problem of finding v(t) from V (s), i.e. the

problem of inverting the Laplace transform.

111

Page 113: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

13.4 Inverse Laplace transform using tables

There is an analytical way of inverting the Laplace transform, called

the Bromwich integral, which involves contour integration. It is dealt

with in, for instance, Boas (chapter 15). However, we are going to

adopt the simpler and more usual approach of using tables of Laplace

transforms. In what follows, I shall always refer to the tables on

pages 8–11 in the E.E. Department’s ‘Tables of constants, formulae

and transforms’. These tables are also included at the end of this

book, starting on page 178; we refer to them as the L.T. Tables.

Sometimes it is easy to find the Laplace transform that we need in

the L.T. Tables, as the following example shows:

Example 13.2 Let us finish off the previous example by finding the inverseLaplace transform of V (s). In the L.T. Tables you will find that the Laplacetransform of

1

ab

[1− b

b− ae−at +

a

b− ae−bt

](13.4)

is1

s(s+ a)(s+ b).

But V (s) is of this form. If we divide the numerator and denominator ofV (s) by 2, we get

V (s) =1/2

s(s+ 1)(s+ 1/2)

so, to make this look like the result in the L.T. Tables, put

a = 1, b =1

2.

Using these in 13.4 gives

v(t) = 1 + e−t − 2e−t/2.

You should check that this (a) satisfies the differential equation 13.2, and (b)has the properties v(0) = 0 and v′(0) = 0.In this case, therefore, we have solved the differential equation 13.2.

112

Page 114: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Sometimes there is a little more effort involved, as in the following

example:

Example 13.3 Suppose that we have instead

V (s) =s+ 2

2s2 + s+ 1.

This looks quite like two entries in the L.T. Tables, at the top of the thirdpage:

L[e−at cosωt

]=

s+ a

s2 + 2as+ bwith ω =

√b− a2 (13.5)

and

L[

1

ωe−at sinωt

]=

1

s2 + 2as+ b. (13.6)

Notice that both the denominators are of the form s2 + 2as+ b, so let’s bringout a factor of 1/2 from V (s):

V (s) =1

2

s+ 2

s2 + 12s+ 1

2

.

Now we can find the values of a and b such that

s2 +1

2s+

1

2= s2 + 2as+ b.

Obviously,

a =1

4and b =

1

2, from which ω =

√b− a2 =

√7

4.

That’s the denominator sorted out. What about the numerator? The numer-ator in equation (13.5) is s+ a = s+ 1/4, but we have a numerator of s+ 2.How do we get this? The answer is that we rewrite V (s) as

V (s) =1

2

s+ 14

s2 + 12s+ 1

2

+74

s2 + 12s+ 1

2

.Now we can use 13.5 and 13.6 to obtain

v(t) =1

2e−t/4 cos

√7t

4+

√7

2e−t/4 sin

√7t

4.

113

Page 115: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

13.5 Inverse Laplace transform by partial fractions

In some cases the function we want to invert isn’t in the L.T. Ta-

bles, in which case it may be necessary to use the method of partial

fractions. An example of this type is now given.

Example 13.4 Suppose that

V (s) =1

s2(s+ 1);

what is v(t)?The idea of using partial fractions is to re-write V (s) in the form

1

s2(s+ 1)=As+B

s2+

C

s+ 1

with A, B and C constants that we have to find. If we can write V (s) inthis form, we can invert each of the fractions individually. The general rulefor partial fractions is that the degree of the numerator must be one less thanthat of the denominator, hence the As+B term in the numerator of the firstfraction above.We now need to find A, B and C. We do this by adding up the partialfractions:

1

s2(s+ 1)=

(As+B)(s+ 1) + Cs2

s2(s+ 1)

The denominators are equal, so comparing the numerators,

1 ≡ (As+B)(s+ 1) + Cs2 = (A+ C)s2 + (A+B)s+B

which has to be true for all s; hence, comparing coefficients of powers of s,

B = 1, A+B = 0, A+ C = 0

so A = −1, B = 1 and C = 1. Therefore,

V (s) =−s+ 1

s2+

1

s+ 1= −1

s+

1

s2+

1

s+ 1.

We can invert each part of this using the L.T. Tables. The answer is

v(t) = −H(t) + t+ e−t

where H(t) is the unit step function.

114

Page 116: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Problems, chapter 13

1. Solve the following differential equation by the Laplace transform method:

dy

dt− y = 2e−t with y(0) = 3

[y(t) = 4et − e−t = 3 cosh t+ 5 sinh t = 3et + 2 sinh t]

2. Solve

d2x

dt2− 4

dx

dt+ 4x = 4 with x(0) = 0,

dx(0)

dt= −2

[x(t) = 1− e2t]

3. Solve

d2v

dt2+ 16v = 8 cos 4t with v(0) = 0,

dv(0)

dt= 8

[v(t) = (2 + t) sin 4t]

4. In the circuit of figure 13.2, L = 1H, C = 1/5F, R = 2Ω and f(t) =2 sin t. Write down the differential equation that describes v(t), the volt-age across the capacitor, and solve it with the initial conditions v(0) = 0and dv(0)

dt = 3.

[v(t) = − cos t+ 2 sin t+ e−t(cos 2t+ sin 2t)]

5. Show that the solution to equation 9.3 in chapter 9, with n = 1, P0(t) =e−λt and P1(0) = 0, is as given.

6. An inductor, L, and resistor, R, are connected in series with a voltagesource v(t) = v0 + (v1R/L) t. Show that the differential equation for thecurrent in this circuit can be written as

di

dt+i

τ= a0 + a1t

where τ = L/R, a0 = v0/L and a1 = v1R/L2. Given that the current

is equal to i0 at t = 0, solve this differential equation using the Laplacetransform.

[i(t) = e−t/τ(i0 − a0τ + a1τ

2)

+ a0τ − a1τ2H(t) + a1τt ]

115

Page 117: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Chapter 14

The Z transform: definition, examples

14.1 Introduction and Definitions

14.1.1 Sampling

The z-transform is to sampled signals as the Laplace transform is

to continuous time signals. It is widely used in control theory and

digital signal processing. Throughout this and the next two chapters,

the sampling interval will be a fixed, positive time T .

We first show how the Laplace and z-transforms are connected.

t

f(t)

0T 1T 2T 3T 4T 5T 6T 7Tt

Σ δ

(t -

nT

)

Figure 14.1: Left: a continuous function of time, f(t). Right: a ‘comb’ of equally-spaced Diracdelta functions, C(t) =

∑∞n=0 δ(t− nT ).

Figure 14.1, left, shows a continuous function of time, f (t). Fig-

ure 14.1, right, shows the function C(t) =∑∞

n=0 δ(t− nT ), a set of

equally-spaced Dirac delta functions, occurring at t = 0, T, 2T, . . ..

Figure 14.2 tries to show the product, f (t) × C(t), which we will

call fs(t). This picture should be interpreted as follows: since each

116

Page 118: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

0T 1T 2T 3T 4T 5T 6T 7Tt

f s(t)

= f

(t)

xC

(t)

f(T)

f(2T)

f(0T)

f(t)

Figure 14.2: The sampled version of the function f(t), which is f(t) × C(t). The heights of thearrows are proportional to their areas — hence, the labels f(0), f(T ) and so on refer to the areasunder the Dirac delta functions at t = 0, T, . . . respectively.

Dirac δ(t − nT ) has unit area, but is infinite at t = nT and zero

everywhere else, fs(t) is also infinite at t = nT and zero everywhere

else. Figure 14.2 is therefore showing, by the height of the arrows, the

area under the Dirac delta functions at t = 0, T, 2T, . . ., these areas

being f (0), f (T ), f (2T ), . . . respectively. Hence, multiplying f (t)

by C(t) can be seen as a way of sampling f (t) at the equally-spaced

intervals t = 0, T, 2T, . . ., and so

fs(t) =

∞∑n=0

f (nT )δ(t− nT ) =

∞∑n=0

f (t)δ(t− nT ).

14.1.2 The connection with Laplace transforms

You now need to remember the important sampling property of the

Dirac delta function, equation (2.3), which is repeated here:

117

Page 119: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

∫ ∞−∞

f (t)δ(t− t0) dt = f (t0), (14.1)

true for any continuous function f (t). Using this result, you should

immediately be able to see that the Laplace transform of fs(t) is

L[fs(t)] =

∫ ∞0

e−st

( ∞∑n=0

f (nT )δ(t− nT )

)dt

=

∞∑n=0

∫ ∞0

[e−stf (nT )

]δ(t− nT )dt =

∞∑n=0

f (nT )e−nsT .

Defining z = esT , we have the so-called z-transform of f (t), which is

Z [f (nT )] = F (z) =

∞∑n=0

f (nT )z−n. (14.2)

In practice, you will often see the sampled version of f (t) written

as f (n), with the sampling interval T “built in” to f (n). See the

following section for a further explanation. Using this convention,

the z-transform is defined as follows:

Z [f (n)] = F (z) =

∞∑n=0

f (n)z−n. (14.3)

In words:

The z-transform of a function of time, f (t), is the Laplace

transform of the periodically-sampled version of f (t), written

fs(t). The function fs(t) is obtained from f (t) by multiplying

it by the sum of Dirac delta functions∑∞

n=0 δ(t− nT ).

118

Page 120: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Points to note about the z-transform

• We will always assume that f (t) = 0 for t < 0, so f (n) = 0 for

n < 0.

• The z-transform transforms a function of n, n = 0, 1, 2, . . . into

a function of z, where z = esT and s is the complex frequency.

14.1.3 The two ways of writing down z-transforms

There are two slightly different ways of writing down z-transforms:

• CE, the way that is preferred by control engineers, is shown in

equation (14.2);

• DSP, the boxed definition, (14.3), which is generally used by

Digital Signal Processing people.

They are equivalent to each other, and, although we concentrate on

the DSP way in these notes, you should be familiar with both. Note

also that the Departmental Tables, the relevant section of which is

quoted on page 131, use both ways.

Time and again, in dealing with z-transforms you will find you need

to use properties of power functions, which you have certainly seen

before, but which are repeated here — you need to be able to apply

these almost without thinking about it. In the expressions, x is a

positive real number and a, b are any real numbers. We have

xa xb = xa+b 1/xb = x−b xa/xb = xa−b (xa)b = xa×b.

Of course, since e is a positive real number, all these also apply

to the exponential function; so, for instance, eaeb = ea+b. Here

is a good moment to note also that (−1)n = 1,−1, 1,−1, . . . for

n = 0, 1, 2, 3 . . .; and so (−1)n+1 = (−1)n−1 = −1, 1,−1, 1, . . .,

again for n = 0, 1, 2, 3 . . ..

119

Page 121: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Let us now look at four examples of z-transforms, taken from the

Departmental Tables on page 131. In all cases, the sampling interval

is T and n = 0, 1, 2, . . .. Each example shows that CE and DSP

are equivalent, provided that we make the right choice of parameters

(see the last column).

CE way DSP way

f (t) f (nT ) f (n) with. . .

sinωt sinωnT sin an a = ωT

t nT an a = T

e−at e−anT bn b = e−aT

e−at cosωt e−anT cosωnT bn cos cn b = e−aT , c = ωT

For instance, take the first row in the table above. This is saying

that if f (t) = sinωt, then f (nT ) = sinωnT and we can then write

f (n) = sin an, by choosing the right definition for a, which in this

case is a = ωT .

14.2 z-transform examples

Before we compute the z-transforms of some well-known functions,

we will derive the formula for the sum of a geometric series — you

will have seen this before. You will see these formulae many times

when discussing z-transforms and it is well worth your while to learn

them, particularly the boxed ones.

Let Sk =∑k

n=0 xn = 1 + x + x2 + . . . + xk. Then xSk = x + x2 +

x3 + . . . + xk+1. Hence Sk − xSk = Sk(1− x) =

1 + x + x2 + . . . + xk − (x + x2 + x3 + . . . + xk+1) = 1− xk+1.

Therefore

120

Page 122: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Sk = 1 + x + x2 + . . . + xk =

k∑n=0

xn =1− xk+1

1− x. (14.4)

Now let k tend to infinity. Provided that |x| < 1, the numerator

tends to one, so we have

1 + x + x2 + . . . =

∞∑n=0

xn =1

1− xprovided that |x| < 1.

(14.5)

Replace x with −x in the above to get

1−x+x2−x3+. . . =

∞∑n=0

(−1)nxn =1

1 + xprovided |x| < 1.

(14.6)

By differentiating the above expression, we obtain

d

dx

1

1− x=

1

(1− x)2=

d

dx

(1 + x + x2 + x3 + . . .

)

= 1 + 2x + 3x2 + . . . =

∞∑n=0

nxn−1

and multiplying both sides by x, we havex

(1− x)2= x + 2x2 + 3x3 + . . .

and hence

x + 2x2 + 3x3 . . . =

∞∑n=1

nxn =

∞∑n=0

nxn =x

(1− x)2(14.7)

121

Page 123: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

where it does not matter whether or not we include the n = 0 term

— it is zero anyway.

Replacing x with −x in the above gives

x−2x2+3x3−4x4+. . . =

∞∑n=1

(−1)n+1nxn =x

(1 + x)2.(14.8)

We now compute the z-transforms of some well-known functions. In

all the following, a, b are constants and n is an integer.

14.2.1 f(n) = an

This corresponds to a sampled version of a linear ramp, f (t) = bt —

then f (nT ) = (bT )n = an with a = bT . From the definition,

Z [an] =

∞∑n=0

an z−n = a

∞∑n=1

nz−n,

where the second sum starts from 1 rather than 0 because the n = 0

term is zero. Now we can use equation (14.7) to obtain

Z [an] = a1/z

(1− 1/z)2=

az

(z − 1)2.

14.2.2 f(n) = δ(n), the unit impulse

We need to be careful with definitions here: in the discrete case, the

function δ(n), which we call the unit impulse to avoid confusion

with the Dirac delta function, is defined as

δ(n) =

1 n = 0

0 otherwise.

122

Page 124: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Note that this is different from the Dirac delta function. With this

definition in mind, it is easy to see that

Z [δ(n)] =

∞∑n=0

δ(n) z−n = 1 · z0 = 1.

14.2.3 f(n) = u(n), the unit step function

The unit step function is defined as

u(n) =

1 n ≥ 0

0 otherwiseWe then have

Z [u(n)] =

∞∑n=0

u(n) z−n =

∞∑n=0

z−n =1

1− 1/z=

z

z − 1.

Note that, since all our functions start at n = 0, a constant c is

written as c u(n) and so the z-transform of c is cz/(z − 1).

14.2.4 f(n) = an

This corresponds to a sampled version of f (t) = e−bt: then f (nT ) =

e−bnT =(e−bT

)n, and putting a = e−bT , we have f (n) = an. Directly

from the definition, equation (14.3), we have

Z [an] =

∞∑n=0

anz−n =

∞∑n=0

(a/z)n =1

1− a/z=

z

z − a

where we have used equation (14.5) to calculate the infinite sum.

14.2.5 f(n) = cos an

Remember that cos x =(ejx + e−jx

)/2. Hence, the z-transform of

cos an, by definition, is

Z [cos an] =

∞∑n=0

cos an z−n =1

2

∞∑n=0

(ejan + e−jan

)z−n.

123

Page 125: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

We can therefore use the previous result:

2Z [cos an] =z

z − eja+

z

z − e−ja=

2z2 − ze−ja − zeja

z2 − ze−ja − zeja + 1.

Hence,

Z [cos an] =z(z − cos a)

z2 − 2z cos a + 1.

The z-transform of sin an can be found in an analogous way.

Problems, chapter 14

1. Find the z-transform of the sequences (i) a = [1,−1, 3, 0, 2] (read this asa(0) = 1, a(1) = −1 etc. ); and (ii) b = [0, 0, 1, 0, 2].

[(i) A(z) = 1− z−1 + 3z−2 + 2z−4, (ii) B(z) = z−2 + 2z−4]

2. Find the z-transform of sin an. [z sin a/(z2 − 2z cos a+ 1)]

3. Find the z-transform of bn cos an.

Hint: easiest is to look at the real part of∑∞n=0(be

ja/z)n.

[z(z − b cos a)/(z2 − 2bz cos a+ b2)]

4. Sketch the functions u(n), u(n− 2) and u(n)− u(n− 2). Hence deduceZ [u(n)− u(n− 2)]. [1 + z−1]

(You’ll see another way to solve this problem in the next chapter.)

5. Define the finite sequence f(0) = 1, f(1) = 2, f(2) = 3, f(i) = 0, i > 2.Write this sequence (i) as a sum of delta functions (unit impulses) and(ii) as a sum of unit step functions. A sketch may help.

Using the answer to part (i) and the definitions of the z-transform andthe unit impulse, find the z-transform of the sequence f(n).

[(i) δ(n) + 2δ(n− 1) + 3δ(n− 2), (ii)u(n) + u(n− 1) + u(n− 2)− 3u(n− 3). F (z) = 1 + 2z−1 + 3z−2]

6. Find the z-transform of the infinite sequence f(n) = 1/n!, n ≥ 0. (Hint:ex = 1/0! + x/1! + x2/2! + . . .)

[F (z) = e(1/z)]

7. Find the z-transform of the infinite sequence f(n) = 1/(n+ 1), n ≥ 0.

(Hint: ln(1 + x) = x− x2/2 + x3/3 . . .]

[F (z) = −z ln(1− 1/z)]

124

Page 126: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Chapter 15

The Z transform: properties,inversion

15.1 z-transform properties

Like the Fourier and Laplace transforms, the z-transform has many

useful properties, some of which we derive in this chapter.

15.1.1 Linearity/superposition

If c1 and c2 are constants and f1(n) and f2(n) are given functions,

then the linearity property states that

Z [c1f1(n) + c2f2(n)] = c1F1(z) + c2F2(z) (15.1)

where F1(z) = Z [f1(n)] and F2(z) = Z [f2(n)]. This is proved

directly from the definition of the z-transform.

Example 15.1 If g(t) = 1− e−at, find G(z).

First of all, note that g(nT ) = 1− e−anT so letting b = e−aT we have g(n) =1− bn. Remembering that our functions start at t = 0, we have that g(n) isthe sum of the two functions u(n) and −(bn). The z-transforms of these arez/(z − 1) and −z/(z − b) respectively, so, using superposition,

G(z) =z

z − 1− z

z − b=

z(1− b)(z − 1)(z − b)

=z(1− e−aT

)(z − 1) (z − e−aT )

.

125

Page 127: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

15.1.2 Time delay

This property is analogous to the Fourier transform time shift prop-

erty. It is stated as follows:

If Z [f (n)] = F (z) then Z [f (n−m)] = z−m F (z)

where m ≥ 0 is an integer. It can be proved as follows. By definition,

Z [f (n−m)] =

∞∑n=0

f (n−m)z−n

= z0f (−m) + z−1f (1−m) + . . . + z−mf (0) + z−m−1f (1) + . . .

and, since f (n) = 0 for n < 0, we have

Z [f (n−m)] = z0 × 0 + z−1 × 0 + . . . + z−m∞∑n=0

f (n)z−n

= z−mF (z).

15.1.3 Time advance

This property is also analogous to the Fourier time shift property.

In what follows, we only need time advances of 1× T and 2× T , in

which case the time advance property is: If Z [f (n)] = F (z), then

Z [f (n + 1)] = zF (z)− zf (0)

and

Z [f (n + 2)] = z2F (z)− z2f (0)− zf (1).

The proof follows directly from the definition. We haveZ [f (n + 1)] =∞∑n=0

f (n + 1) z−n = f (1) + f (2)z−1 + f (3)z−2 + . . .

126

Page 128: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

= zF (z)− zf (0), using equation (14.3). The proof for Z [f (n + 2)]

works in the same way.

15.1.4 Multiplication by an exponential sequence

This property is analogous to the Fourier time scaling property, and

is stated as follows:

If Z [f (n)] = F (z) then Z [an f (n)] = F (z/a)

Again, the proof follows directly from the definition. We have that

Z [anf (n)] =

∞∑n=0

anf (n) z−n =

∞∑n=0

f (n) (z/a)−n = F (z/a).

Example 15.2 Given that Z [cos an] = (z2 − z cos a)/(z2 − 2z cos a+ 1), wecan deduce that

Z [bn cos an] =(z/b)2 − (z/b) cos a

(z/b)2 − 2(z/b) cos a+ 1=

z2 − zb cos a

z2 − 2zb cos a+ b2.

15.1.5 Differentiation property

Like Fourier and Laplace transforms, the z-transform has a differen-

tiation property, which is stated as follows:

If Z [f (n)] = F (z) then Z [n f (n)] = −zdF (z)

dz.

The proof goes as follows. By definition,

F (z) =

∞∑n=0

f (n) z−n sodF

dz= −

∞∑n=0

n f (n) z−n−1.

127

Page 129: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Multiplying by −z gives

−zdF (z)

dz=

∞∑n=0

nf (n) z−n,

which, by definition, is the z-transform of nf (n).

Example 15.3 Using Z [an] = z/(z − a), find Z [nan] and Z[n2an

].

We have that Z [nan] = −z d/dz z/(z − a). Using the derivative of a quo-tient rule, this gives

Z [nan] =za

(z − a)2.

Differentiating again and multiplying the result by −z, we find

Z[n2an

]=za(z + a)

(z − a)3.

15.1.6 Initial Value Theorem

If you know the z-transform of a function f (t), you can compute the

value of the function at t = 0, using the Initial Value Theorem. This

is

If Z [f (n)] = F (z) then f (0) = limz→∞F (z). (15.2)

The proof of this is straightforward. From the definition,

F (z) = f (0) + z−1f (1) + z−2f (2) + . . .

and if z →∞, we are left with f (0).

Example 15.4 If f(t) = cos at so f(n) = cos an, then f(0) = cos 0 = 1.The Initial Value Theorem gives the same result:

F (z) =z(z − cos a)

z2 − 2z cos a+ 1=

1− (1/z) cos a

1− (2/z) cos a+ 1/z2

and solimz→∞F (z) = 1

as expected.

128

Page 130: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

15.1.7 Final Value Theorem

The Final Value Theorem is a similar type of result to the Initial

Value Theorem, but is harder to prove. The theorem is

If Z [f (n)] = F (z) then limn→∞ f (n) = lim

z→1(z − 1)F (z). (15.3)

The proof requires the Time Advance Theorem, which we have al-

ready seen.

Let f (t) be a function of time whose z-transform exists, so that the

series∑∞

n=0 f (n) z−n converges. Now consider

Z [f (k + 1)− f (k)] = limn→∞

n∑i=0

z−if (i + 1)− z−if (i)

= lim

n→∞

−f (0) + f (1)− z−1f (1) + z−1f (2)− z−2f (2)

+z−2f (3)/z2 − z−3f (3) + . . . + z−nf (n + 1)

= limn→∞

−f (0) + z−nf (n + 1) + (1− 1/z)f (1)

+z−1(1− 1/z)f (2) + z−2(1− 1/z)f (3) + . . .

Therefore,

limz→1Z [f (k + 1)− f (k)] = lim

n→∞ −f (0) + f (n + 1) , (15.4)

since, if z → 1, then (1− 1/z)→ 0 and zi → 1 for any i.

Also, from the time advance property, we have the additional fact

that

limz→1Z [f (k + 1)− f (k)] = lim

z→1zF (z)− zf (0)− F (z)

= −f (0) + limz→1

(z − 1)F (z),

129

Page 131: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

and this is the same thing as equation (15.4). As f (0) is a constant,

we have

limn→∞ −f (0) + f (n + 1) = −f (0) + lim

n→∞ f (n + 1)

= −f (0) + limz→1

(z − 1)F (z)

and, noting that limn→∞ f (n+ 1) is the same thing as limn→∞ f (n),

the Final Value Theorem follows.

Example 15.5 We have seen in example 15.1 that

Z [1− an] =z(1− a)

(z − 1)(z − a).

Now, limn→∞ 1− an = 1 if |a| < 1. The Final Value Theorem confirms this:

limz→1

(z − 1)× z(1− a)

(z − 1)(z − a)= lim

z→1

z(1− a)

(z − a)= 1.

15.2 Inversion of the z-transform

Much like the approach we used for inverting Laplace transforms, we

can often use tables for inverting the z-transform. We can also use

the properties described above, as well as partial fractions and power

series — sometimes a combination of all of these is necessary. Finding

inverse transforms can be anything from easy to quite complicated.

Easy examples include the case where the transformed function is a

polynomial in z−1. Examples of all kinds are given in what follows.

A small table of z-transforms, taken from the “Tables of Constants,

formulae and transforms” used in exams, is included below.

130

Page 132: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Laplace Transform Z Transformf(t) F (s) F (z)

δ(t) 1 1

Unit impulse

H(t) 1s

zz − 1

Heaviside function or unit step

t 1s2

Tz(z − 1)2

t2 2s3

T 2z(z + 1)(z − 1)3

tn n!sn+1 lim

a→0(−1)n ∂n

∂an

(z

z − e−aT

)e−at 1

s+ az

z − e−aT

te−at 1(s+ a)2

Tz e−aT

(z − e−aT )2

sinωt ωs2 + ω2

z sinωTz2 − 2z cosωT + 1

cosωt ss2 + ω2

z(z − cosωT )z2 − 2z cosωT + 1

e−at sinωt ω(s+ a)2 + ω2

z e−aT sinωTz2 − 2z e−aT cosωT + e−2aT

e−at cosωt(s+ a)

(s+ a)2 + ω2z2 − z e−aT cosωT

z2 − 2z e−aT cosωT + e−2aT

1− e−at as(s+ a)

z(1− e−aT )

(z − 1)(z − e−aT )

You should note carefully how the information is presented in this

version of the table: in particular, f (t) is given in the left-hand

column, not f (n). Look back at section 14.2 to see why, for instance,

f (t) = e−bt, corresponds exactly to f (n) = an, provided that we

choose a = e−bT .

131

Page 133: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Z Transformf(n) F (z)

δ(n) [Unit impulse] 1

H(n) [Unit step] zz − 1

n z(z − 1)2

n2z(z + 1)(z − 1)3

nk lima→0(−1)k ∂k

∂ak

(z

z − ea)

bn zz − b

nbn zb(z − b)2

sin an z sin az2 − 2z cos a+ 1

cos anz(z − cos a)

z2 − 2z cos a+ 1

bn sin an zb sin az2 − 2zb cos a+ b2

bn cos an z2 − zb cos az2 − 2zb cos a+ b2

1− bn z(1− b)(z − 1)(z − b)

By contrast, in this table, f (n) is given and not f (t) — the DSP

way, as opposed to the CE way.

There now follow some inversion examples.

Example 15.6 Find the inverse z-transform (i.z.t.) of F (z) = 1 + 2z−1 −7z−3.

• This is a finite degree polynomial in z−1. By the definition of the z-transform, it should be clear that

f(n) =

1 n = 02 n = 10 n = 2−7 n = 30 otherwise.

132

Page 134: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

We now look at some examples in which the function to be inverted,

F (z), is close to a form that is in the tables. Always bear in mind also

the z-transform properties derived in the first part of this chapter.

Example 15.7 Find the i.z.t. of F (z) = z/(z + b).

• Note that Z [an] = z/(z − a).

• Now substitute b = −a to obtain Z [(−b)n] = z/(z + b).

Hence, the i.z.t. of F (z) = z/(z + b) is f(n) = (−b)n.

Example 15.8 Find the i.z.t. of F (z) = z/(z − b)2.

• Use the fact that Z [nbn] = zb/(z − b)2 (see Example 15.3).

• Thus, using the linearity property, we can divide both sides by b to getZ [n(bn)/b] = z/(z − b)2.

Hence, the i.z.t. of F (z) = z/(z − b)2 is f(n) = n bn−1.

Example 15.9 Find the i.z.t. of F (z) = z/(z2 + b2).

• Use the fact that Z [bn sin an] = zb sin a/(z2−2zb cos a+b2) (from tables).

• To get rid of the 2zb cos a term in the denominator, set a = π/2, sincecos π/2 = 0.

• Hence, Z [bn sin(nπ/2)] = zb/(z2 + b2), since sin π/2 = 1.

• Divide both sides by b to get the final result.

Hence, the i.z.t. of F (z) = z/(z2 + b2) is f(n) = bn−1 sin(nπ/2).

Here is an example where we first use partial fractions, then use the

tables.

Example 15.10 Find the i.z.t. of F (z) = 2z/((z − 1)(z − 3)).

• First convert this to partial fractions. Note that you want, if possible, aform that is in the tables, so look for partial fractions in the form1

2z

(z − 1)(z − 3)=

Az

z − 1+

Bz

z − 3.

1F (z) is also equal to 1/(z − 1) + 3/(z − 3), but the form 1/(z − b) isn’t in the tables.

133

Page 135: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

• This gives A = −1, B = 1 (check this), so

F (z) =−zz − 1

+z

z − 3.

• Each of these parts is in the tables: −z/(z − 1) corresponds to −u(n)and z/(z − 3), to 3n.

Hence, the i.z.t. of F (z) = 2z/((z−1)(z−3)) is f(n) = 3n−u(n). (If n ≥ 0,this is the same as 3n − 1.)

Here are a couple of examples where we use power series. This is

a good method to use, not too difficult, and often easier than the

alternatives. Always bear in mind equations (14.5) and (14.7) for

finding power series.

Example 15.11 Find the i.z.t. of F (z) = 1/(z + b)2.

• From equation (14.8) we have that

(1 + x)−2 = x−1

∞∑n=1

(−1)n+1nxn =

∞∑n=1

(−1)n+1nxn−1.

• Hence (z + b)−2 = z−2(1 + b/z)−2 =

z−2

∞∑n=1

(−1)n+1n(b/z)n−1 = z−2 − 2bz−3 + 3b2z−4 − 4b3z−5 . . .

• Remember the definition of the z-transform. The previous equation isclearly the transform of a function of n which has the values f(0) =f(1) = 0 and

f(2) = 1, f(3) = −2b, f(4) = 3b2 . . . , f(n) = (n− 1)(−b)n−2,

provided that n ≥ 1 (remember that b0 = 1.)

• Therefore, we are nearly right if we say that f(n) = (n−1)(−b)n−2, butthis gives the wrong value for n = 0. We want f(0) = 0, but substitutingn = 0 in (n− 1)(−b)n−2 gives −b−2.

Hence the i.z.t. of F (z) = 1/(z + b)2 is f(n) = (n− 1)(−b)n−2 + b−2δ(n).Make sure you clearly understand how adding the term b−2δ(n) makes thingswork out right.

134

Page 136: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Example 15.12 Find the i.z.t. of F (z) = 1/(z3 − 1).

• By substituting x = z−3 in equation (14.5), we have

(z3 − 1)−1 = z−3(1− z−3)−1 = z−3

∞∑n=0

z−3n = z−3 + z−6 + z−9 + . . .

• Hence f(n) = 1 when n = 3, 6, 9, . . . and is zero otherwise.

The answer in the form given above is perfectly adequate. However, if youwant to be fancy, you could also write this as f(n) = (1 + 2 cos(2nπ/3))/3−δ(n) — check that this gives you the right sequence — but this is not necessary.

Example 15.13 Find the i.z.t. of F (z) = z/(z− b)2. (We have already donethis using tables — see Example 15.8.)

• By substituting x = bz−1 in equation (14.7), we have

z(z − b)−2 = z−1(1− bz−1)−2 = z−1(1 + 2bz−1 + 3b2z−2 + 4b3z−3 . . .

),

= 0 + z−1 + 2bz−2 + 3b2z−3 + 4b3z−4 . . .

• Therefore, f(n) = 0, 1, 2b, 3b2, 4b3 . . . for n = 0, 1, 2, 3, 4 . . ..

Hence the i.z.t. of F (z) = z/(z − b)2 is f(n) = nbn−1, as before.

Enough examples: time for you to have a go.

Problems, chapter 15

1. Find the z-transform of f(n) = nu(n) in two ways: (i) directly from thedefinition; and (ii) by using the differentiation property.

[Both give F (z) = z/(z − 1)2.]

2. Find the inverse z-transform of F (z) = z−1 − z−2 + 2z−4.

[f(n) = 0, 1,−1, 0, 2 for n = 0, 1, 2, 3, 4 and f(n) = 0 for n > 4.]

3. By using the “multiplication by an exponential sequence” property, de-duce the z-transform of f(n) = bn sin an directly from the z-transformof sin an.

[F (z) = bz sin a/(z2 − 2bz cos a+ b2)]

135

Page 137: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

4. By using the linearity property, deduce the z-transform of f(n) = sin(an+φ), φ constant, directly from the z-transforms of sin an, cos an.

[F (z) = z(z sinφ+ sin(a− φ))/(z2 − 2z cos a+ 1)]

5. By using the linearity property, deduce the z-transform of f(n) = cosh andirectly from the z-transforms of ean, e−an.

[F (z) = z(z − cosh a)/(z2 − 2z cosh a+ 1)]

6. Find the inverse z-transform of F (z) = z2/(z+b)2. Use the time advanceproperty and the z-transform of nbn from the tables.

[f(n) = (n+ 1)(−b)n]

7. Use partial fractions, then tables, to find the inverse z-transform ofF (z) = 3z2/((z − 1)(z + 2)).

[Hint: try partial fractions in the form F (z) = Az/(z− 1) +Bz/(z+ 2).][f(n) = u(n) + 2(−2)n]

8. Use partial fractions, followed by tables, to find the inverse z-transformof F (z) = z2/(z2 − 4).

[f(n) = (2n + (−2)n)/2]

9. Find the inverse z-transform of F (z) = (1− z−1)(1− 2z−2).

[f(n) = 1,−1,−2, 2 for n = 0, 1, 2, 3 and is zero otherwise]

10. Use power series to find the inverse z-transform of F (z) = 1/[z(z − 1)].

[f(0) = f(1) = 0, f(n) = 1, n ≥ 2 or, equivalently, f(n) = u(n− 2)]

11. Use power series to find the inverse z-transform of F (z) = 2z/(2z − 1).

[f(n) = 2−n]

12. Use power series to find the inverse z-transform of F (z) = 1/(z + b).

[f(n) = (−b)n−1 + δ(n)/b]

13. Using power series, or otherwise, find the inverse z-transform of F (z) =(z + 2)/(z + 1).

[f(n) = 1, 1,−1, 1,−1, . . ., or, equivalently, f(n) = 2δ(n) + (−1)n+1]

14. Use power series to find the inverse z-transform of F (z) = 1/(z2 − 1).

[f(n) = 0, 0, 1, 0, 1, 0 . . . or f(n) = (1 + (−1)n)/2− δ(n)]

136

Page 138: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Chapter 16

The Z transform: applications

16.1 Introduction

Having introduced a lot of new material about z-transforms in the

previous two chapters, it is now time to see why they are important,

by looking at what they can enable us to do. In Electronic Engineer-

ing, you are most likely to encounter z-transforms in Control Theory

and Digital Signal Processing applications. We will therefore look at

some very basic filtering problems in this chapter, but before that, we

will discuss the use of the z-transform to solve difference equations.

16.2 Difference equations

Before we see how to solve them, here a a few examples of difference

equations.

1. The present value of an annuity after n periods, x(n), obeys the

difference equation x(n + 1) = (x(n) + P )/(1 + r), where r is

the interest rate and P is the amount of each payment.

2. The repeated drug dose model, in which the amount of the drug

still in the body at the n-th period, x(n), obeys the difference

equation x(n + 1) = ax(n) + b. Here, a is the fraction of the

drug which is degraded by the body during one period, and b is

the dose given per period.

137

Page 139: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

3. The cumulative average of a sampled signal. Let the sampled sig-

nal be x(n), with n = 0, 1, 2, . . ., so that the cumulative average,

y(n), is defined as

y(n) =1

n + 1

n∑i=0

x(n).

We divide by n + 1 because there are n + 1 values on the right

hand side. Suppose we want to compute y(n) for all n: this

formula seems to be telling us that we need to store all n + 1

values x(0) . . . x(n) in order to do this. Eventually we will run

out of memory. We can get around this problem by being clever

and noting that (n + 1)y(n) =∑n

i=0 x(n), and so

(n+ 2)y(n+ 1) = x(n+ 1) +

n∑i=0

x(n) = (n+ 1)y(n) +x(n+ 1).

Hence,

y(n + 1) =(n + 1) y(n) + x(n + 2)

n + 2.

This is a more complicated difference equation than the previous

two, and its solution depends on the entire sequence x(n).

16.3 Solving difference equations

Difference equations are in several ways like differential equations, the

main difference being that, in a differential equation, the unknown

function, x(t), say, is a function of a continuous variable, t. The

continuous variable t can take on any real value. By contrast, in a

difference equation, the unknown function, x(n), say, is a function of

a discrete variable n, which it is assumed will only take on the values

0, 1, 2, . . ., the non-negative integers (although the solution may in

fact be meaningful for all integers).

138

Page 140: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Solving a difference equation poses a similar sort of problem to solving

a differential equation. For example, suppose that the difference

equation is x(n+ 1) = 2x(n). A solution, if we can find one, will be

a function x(n) that satisfies this for all integers n ≥ 0. It should be

clear that, for a given value of x(0), we have

x(1) = 2x(0), x(2) = 2x(1) = 22x(0), x(3) = 2x(2) = 23x(0), . . .

and from this you should be able to spot the general pattern, which

is that x(n) = 2nx(0). Note that

• This is a first order difference equation: x(n+ 1) is a function of

x(n) only.

• Once we have specified a value of x(0), the solution is determined

for all integers n ≥ 0 — this is just like a first order differential

equation, where we need one initial condition to specify a partic-

ular solution.

Thus, suppose that we have an initial condition, x(0) = 5 say. Then

the difference equation x(n + 1) = 2x(n) with x(0) = 5 has the

solution1 x(n) = 5× 2n.

You might think that was a rather easy problem with an obvious

solution, so consider instead the first order difference equation

Example 16.1x(n+ 1) = 2x(n) + 3n.

This is harder, because we have an additional function of n on the right handside. We use the z-transform in a way that should remind you of the useof Laplace transforms to solve differential equations, by going through thefollowing steps:

1. Find the z transform of the difference equation. In this case, we have

zX(z)− zx(0) = 2X(z) + z/(z − 3).1The general solution is x(n) = x(0)2n; the particular solution, when x(0) = 5, is x(n) = 5 × 2n. Even the

terminology is the same as for differential equations.

139

Page 141: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Note that we have used the Time Advance Property (see page 126) to findthe z-transform of x(n+ 1).

2. Solve this equation for X(z):

X(z) =z

z − 2x(0) +

z

(z − 3)(z − 2).

3. If necessary, manipulate this expression so that the inverse z-transformcan easily be found. In this case, it is best is to use partial fractions forthe second term; we then have

z

(z − 3)(z − 2)=

z

z − 3− z

z − 2

(check this) and so

F (z) =z

z − 2x(0) +

z

z − 3− z

z − 2.

4. Now find the inverse z-transform, which will give us x(n). In this case,

x(n) = 2nx(0)− 2n + 3n = 2n(x(0)− 1) + 3n.

(Look back at example 15.7 in the previous chapter if you need to remindyourself of the i.z.t. of z/(z − a).)

You can easily check this: if it’s true, then, for any x(0),

x(n+ 1)− 2x(n) = 2n+1(x(0)− 1) + 3n+1 − 2n+1(x(0)− 1)− 2× 3n

= 3× 3n − 2× 3n = 3n

which is what it should be, according to the difference equation.

As a second example, let’s look at the repeated drug dose model.

Example 16.2 Find the general solution to the difference equation x(n+1) =ax(n) + b. Under what conditions does x(n) tend to a finite limit as n→∞,and what is this limit?

Bear in mind that the constant b on the right hand side, as far as the z-transform is concerned, is u(n)b. Then the z-transform of this equation is

zX(z)− zx(0) = aX(z) +bz

z − 1

140

Page 142: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

(again, using the time advance property) so

X(z) =z

z − ax(0) +

bz

(z − a)(z − 1)=

z

z − ax(0) +

b

1− a

(z

z − 1− z

z − a

)

where we have used partial fractions to expand the last term. Hence,

x(n) = anx(0) +b (u(n)− an)

1− a.

It is clear from this expression that x(n) tends to a finite limit as n → ∞only if |a| < 1 (so an → 0), and then the limit is b/(1− a) — remember thatu(n) = 1 for n ≥ 0.You could also obtain this last result by applying the Final Value Theorem toX(z): try it and see.

As a third example, let’s try a second order difference equation.

You’ll need to remember the Time Advance Property with an ad-

vance of 2 steps as well as 1 step.

Example 16.3 Find the general solution to the difference equation x(n+2) =2x(n + 1) + 3x(n), with general initial conditions (that is, x(0), x(1) can beanything). Under what conditions does this solution not blow up as n→∞?

Follow through the steps in the usual way. The z-transform of the equationis

z2X(z)− z2x(0)− zx(1) = 2zX(z)− 2zx(0) + 3X(z).

Hence,(z2 − 2z − 3

)X(z) = (z + 1)(z − 3)X(z) = z(z − 2)x(0) + zx(1)

and so

X(z) = x(0)z(z − 2)

(z + 1)(z − 3)+ x(1)

z

(z + 1)(z − 3).

As usual, we now need partial fractions. Again, we seek fractions of the formz/(z±a), because we know that this form is in the tables — it has an inverse(∓a)n. The partial fraction form is

X(z) =x(0)

4

(z

z − 3+

3z

z + 1

)+x(1)

4

(z

z − 3− z

z + 1

)

from which it is easy to see that

x(n) = (−1)n3x(0)− x(1)

4+ 3n

x(0) + x(1)

4.

141

Page 143: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

This will blow up (i.e. x(n) will tend to ∞ as n increases), because of the3n term, unless x(1) = −x(0). In that case only, x(n) = (−1)nx(0), whichremains finite for all n.

Finally, another second order difference equation.

Example 16.4 Find the general solution to the difference equation

x(n+ 2)− 2x(n+ 1) cos a+ x(n) = 0,

with general initial conditions. Here, a is a constant.

Start in the usual way. The z-transform of the difference equation this timeis

z2X(z)− z2x(0)− zx(1)− 2zX(z) cos a− 2zx(0) cos a+X(z) = 0

so

X(z) =x(0)z2 + z x(1)− 2z x(0) cos a

z2 − 2z cos a+ 1.

Looking in the tables, you will recognise the denominator from the z-transformsof both sin an and cos an. Let us guess that the inverse z-transform of X(z)is of the form x(n) = c1 sin an + c2 cos an, where c1, c2 are constants to bedetermined. Now, from the tables, Z [c1 sin an+ c2 cos an] =

c1z sin a+ c2z(z − cos a)

z2 − 2z cos a+ 1=c2z

2 + c1z sin a− c2z cos a

z2 − 2z cos a+ 1,

and matching the coefficients of z in the numerator, to those in the expressionfor X(z) (since the denominators are the same), we have

c2 = x(0) and c1 sin a− c2 cos a = x(1)− 2x(0) cos a

which we can solve for c1, c2. This gives, finally,

x(n) =x(1)− x(0) cos a

sin asin an+ x(0) cos an.

16.4 A FIR filter

We now look very briefly at a simple digital signal processing (DSP)

application of the z-transform: a Finite Impulse Response (FIR)

142

Page 144: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

filter. The purpose of this section is to give you just a taste of why

the z-transform is important in DSP applications — you will learn

much more about this if you choose the relevant Year 3/MSc options.

The filter we will discuss is a band-stop filter, which is one that at-

tenuates all frequencies within a range, while letting all other fre-

quencies through. We have in fact already seen, in the last ex-

ample of the previous section, the basis on which a band-stop fil-

ter works. The basis is this: imagine that a signal of the form

x(n) = c1 sin an + c2 cos an, for a given a, is the input to a sys-

tem which computes y(n) = x(n)−2x(n−1) cos a+x(n−2). Then

we know from example 16.4 that the output sequence y(n) will be

zero. In other words, this system filters out the particular signal x(n)

defined above (and signals which are close by).

0 50 100 150 200 250 300-1.5

-1.0

-0.5

0.0

0.5

1.0

1.5

Input

0 50 100 150 200 250 300n

-0.5

0.0

0.5

1.0

1.5

Outp

ut

0.24

0.26

0.28

Figure 16.1: The filtering example. Top: input signal x(n) = x1(n)+x2(n) = 0.5 sin 0.5n+cos 0.05n.Bottom: the output signal y(n) = y1(n) + y2(n) = x(n) −

√3x(n − 1) + x(n − 2), showing that

x1(n) has been almost filtered out.

To see how this works, let us set a = π/6, so that 2 cos a =√

3.

143

Page 145: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Then the output y(n), for n ≥ 2, will be given by

y(n) = x(n)−√

3x(n− 1) + x(n− 2).

We know, from example 16.4, that if the input is x(n) = c1 sinnπ/6+

c2 cosnπ/6, for any constants c1 and c2, then the output will be zero.

This is easily checked. Let’s set c1 = 1, c2 = 0 to simplify things.

Then y(n) = sinnπ/6 −√

3 sin(n − 1)π/6 + sin(n − 2)π/6, and

expanding the terms, we have

y(n) = sinnπ/6−√

3 sinnπ/6 cos π/6−√

3 cosnπ/6 sin π/6+

sinnπ/6 cos π/3− cosnπ/6 sin π/3

=[1−√

3√

3/2 + 1/2]sinnπ/6 +

[−√

3/2 +√

3/2]cosnπ/6 = 0

as it should. This would work for any values of c1, c2.

What happens if the input consists of two signals, one close to

sinnπ/6 and one far away? Let’s take, as an example, x(n) =

x1(n) + x2(n), where x1(n) = 0.5 sin 0.5n and x2(n) = cos 0.05n

— see figure 16.1, top. Then x1(n) is close to sinnπ/6 (because 0.5

is close to π/6 ≈ 0.524). On the other hand, the x2(n) is far away

from cosnπ/6.

In this case, the output y(n) consists of a phase- and amplitude-

modified version of x2(n), with almost no trace of x1(n): x1(n) has

effectively been filtered out — see figure 16.1, bottom. We can cal-

culate the amplitudes of both components as follows. Since this is

a linear system, superposition applies and we can write the output

y(n) = y1(n)+y2(n), where y1(n) is the response to x1(n) and y2(n),

to x2(n). Then y1(n) = x1(n)−√

3x1(n− 1) + x1(n− 2)

= 0.5 sin 0.5n− 0.5√

3 sin 0.5(n− 1) + 0.5 sin 0.5(n− 2)

= 0.5(1−√

3 cos 0.5 + cos 1) sin 0.5n +

0.5(√

3 sin 0.5− sin 1) cos 0.5n

= 0.0102 sin 0.5n− 0.0056 cos 0.5n.

144

Page 146: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

The amplitude of y1(n) is therefore√

0.01022 + 0.00562 = 0.0116.

You should also be able to estimate this amplitude from the magnified

portion in figure 16.1.

Carrying out the same calculation for x2(n) shows that the amplitude

of y2(n) is 0.26, about 20 times bigger than the amplitude of y1(n),

which again agrees with figure 16.1.

Problems, chapter 16

1. Use z-transforms to solve the following difference equations:

(i) x(n+ 1) = 3x(n) with x(0) = 5

(ii) x(n+ 1) = −2x(n) + 3u(n) with x(0) = 0

(iii) x(n+ 2) = 5x(n+ 1)− 6x(n) with x(0) = 1, x(1) = −1.

[(i) x(n) = 5 · 3n, (ii) x(n) = 1− (−2)n, (iii) x(n) = 4 · 2n − 3 · 3n]

2. Solve x(n + 2) = 3x(n + 1) − 2x(n) by the z-transform method, withgeneral initial conditions. What relation must there be among the initialconditions in order for the solution to be constant for n ≥ 0?

[x(n) = (2x(0)− x(1))u(n) + (x(1)− x(0))2n; constant if x(1) = x(0).]

3. Use the z-transform to solve the present value of an annuity differenceequation x(n), which is x(n+ 1) = (x(n) + P )/(1 + r).

[x(n) = (1 + r)−n(x(0)− P/r) + Pu(n)/r]

4. Find the difference equation whose solution is x(n) = 5n−3n, given thatit is of the form x(n + 2) + Bx(n + 1) + Cx(n) = 0. Find the initialconditions that give rise to this solution.

[x(n+ 2)− 8x(n+ 1) + 15x(n) = 0, x(0) = 0, x(1) = 2]

5. Solve the difference equation x(n+ 1) + 3x(n) = (−1)n.

[x(n) = 12(−1)n + (−3)n(x(0)− 1

2)]

6. A digital filter computes its output, y(n), from its input, x(n), accordingto the formula y(n) = x(n)− x(n− 1) · 2 cos a+ x(n− 2).

(i) Find a such that this system filters out a signal of the form x(n) =c1 sinnπ/3.

145

Page 147: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

(ii) Let the input signal be x1(n) + x2(n) = sinn + 8 sin(n/12). Theoutput is of the form y(n) = y1(n) + y2(n) where y1(n) = A1 sin(n+ φ1)and y2(n) = A2 sin(n/12 + φ2). Find the constants A1, A2, φ1 and φ2.Sketch the input and output waveforms.

[(i) a = π/3, (ii) A1 = 0.0806, φ1 = −1.00, A2 = 7.94, φ2 = −0.0833]

146

Page 148: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Chapter 17

Matrices I

17.1 The basics

A matrix is an

n×m array of numbers; n rows, m columns.

Examples:

1. 1 0

0 1

. . . 2× 2 unit matrix

2. v1

v2

v3

. . . 3× 1 column vector

3. 1.4 2 4

5 1− 3j 2

. . . 2× 3 matrix

4. a11 a12

a21 a22

. . . general 2× 2 matrix

147

Page 149: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

We use the convention: upper case A, B, C etc. for matrices, un-

derlined letters a, b, c etc. for vectors and ordinary letters, a, b, c

etc. for scalars.

We now go through some of the rules of matrix algebra.

17.2 Matrix equality

Two matrices A and B with the same number of rows and columns

are said to be equal to each other if and only if all their corresponding

elements are equal. For instance, if A and B are 2×2 matrices, then

they are equal only if

a11 = b11, a12 = b12, a21 = b21, and a22 = b22.

17.3 Matrix addition

If two matrices A and B have the same number of rows and columns,

they can be added by adding together corresponding elements. For

example, if

A =

a11 a12

a21 a22

and B =

b11 b12

b21 b22

then

A + B =

a11 + b11 a12 + b12

a21 + b21 a22 + b22

.

17.4 Matrix multiplication

17.4.1 Scalar × matrix = matrix

Given

A =

a11 a12

a21 a22

and c = a scalar

148

Page 150: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

then

cA =

ca11 ca12

ca21 ca22

i.e. the result is another matrix, with each element multiplied by c.

17.4.2 Matrix × vector = vector

Given

A =

a11 a12

a21 a22

and v =

v1

v2

then

Av =

a11v1 + a12v2

a21v1 + a22v2

i.e. the result is a column vector.

N.B. Number of columns in A must equal number of rows in v.

17.4.3 Matrix × matrix = matrix

Given

A =

a11 a12

a21 a22

and B =

b11 b12

b21 b22

then

AB =

a11b11 + a12b21 a11b12 + a12b22

a21b11 + a22b21 a21b12 + a22b22

i.e. the result is a 2× 2 matrix.

N.B. Number of columns in A must equal number of rows in B.

Note also that AB does not equal BA in general — ‘matrices do not

commute’. (See problem 1)

17.5 Determinants

You may have met these before. To recap, the determinant of a 2×2

matrix A, written as detA or |A|, is

detA = a11a22 − a12a21

149

Page 151: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

i.e. the determinant of a matrix is a number.

What about a 3 × 3 matrix? This can be calculated as three 2 × 2

determinants as follows. Given

A =

a11 a12 a13

a21 a22 a23

a31 a32 a33

then

detA = a11 det

a22 a23

a32 a33

−a12 det

a21 a23

a31 a33

+a13 det

a21 a22

a31 a32

This is known as the Laplace development of a determinant.

Remember it as

1. Pick a row or column (used the first row in the above).

2. Taking each element in this row or column in turn, delete the

row and column in which it occurs, and find the determinant of

the remaining 2× 2 matrix.

3. Multiply this determinant by the element in (2), with signs

+ − + . . .

− + − . . .

+ − + . . .... ... ...

and add up the three resulting numbers to obtain the determi-

nant.

This works for n× n matrices, but involves a lot of work for n > 3.

(See problems 2 and 3)

17.6 Solving two linear equations

Matrix algebra provides a systematic way of solving a set of simul-

taneous linear equations. For example, given two linear equations

a11x1 + a12x2 = w1 (17.1)

150

Page 152: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

and

a21x1 + a22x2 = w2 (17.2)

put these into matrix notation by defining

A =

a11 a12

a21 a22

x =

x1

x2

w =

w1

w2

so that equations 17.1 and 17.2 together become a11 a12

a21 a22

x1

x2

=

w1

w2

(17.3)

or, in matrix notation

Ax = w.

(See problem 4)

Now, suppose that a11 . . . a22 and w1, w2 are given, with w1, w2 not

both 0. To solve for x2,

1. Multiply 17.1 by a21 and 17.2 by a11 to get

a11a21x1 + a12a21x2 = a21w1

a11a21x1 + a11a22x2 = a11w2.

2. Subtract these to get

x2(a11a22 − a12a21) = a11w2 − a21w1.

3. Note that a11a22 − a12a21 = detA so

x2 =a11w2 − a21w1

detA. (17.4)

A similarl calculation for x1gives :

x1 =a22w1 − a12w2

detA. (17.5)

151

Page 153: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Look at 17.4 and 17.5: they are same form as 17.1 and 17.2. We can

write 17.4 and 17.5 together in matrix notation:

1

detA

a22 −a12

−a21 a11

w1

w2

=

x1

x2

.This equation looks just like 17.3, but with x and w swapped and

matrix A replaced by

1

detA

a22 −a12

−a21 a11

.This new matrix is known as the inverse of A, written A−1 or inv

A. It has the property that

A−1A = AA−1 = I, the unit matrix,

1 0

0 1

.

17.6.1 Properties of the unit matrix

1. The n× n unit matrix has 1s down the leading diagonal and 0s

everywhere else.

2. If A is any n × n matrix and I is the n × n unit matrix, then

AI = IA = A (just like multiplying numbers by 1).

3. For any column vector v with n rows, Iv = v.

(See problem 5)

17.7 Application — Z and Y parameters

The 2-port Z parameters, z11 . . . z22, are defined with reference to

the figure below.

The Z parameters are quantities with the dimensions of impedance,

z11 . . . z22, such that

v1 = z11i1 + z12i2

152

Page 154: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

i i1 2

Two port networkv1 v2

and

v2 = z21i1 + z22i2

or, in matrix/vector notation

v = Zi (17.6)

where

v =

v1

v2

, i =

i1i2

, Z =

z11 z12

z21 z22

.The Y parameters, y11 . . . y22, have dimensions of admittance (recip-

rocal impedance) and are defined by:

i = Y v. (17.7)

Now, pre-multiplying 17.6 by Z−1 gives

Z−1v = Z−1Zi = Ii = i

and, comparing with 17.7

Y = Z−1 and, inverting, Z = Y −1.

Hence,

the Y (admittance) matrix is the inverse of the Z (impedance)

matrix (and vice versa).

(See problem 6)

We shall have more to say about Z and Y parameters in the next

chapter.

153

Page 155: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Problems, chapter 17

1. If

A =

(a11 a12

a21 a22

)and B =

(b11 b12

b21 b22

)

show that AB does not equal BA in general.

2. Evaluate the determinant of the following matrices:

(a)

(2 43 5

)(b)

(jωL R1/R −jωC

)(c)

1 2 32 3 13 1 2

(d)

a 4a 2bc d e

2a 8a 4b

(e)

4.3 −2.2 1.22.1 1.4 5.97.3 4.9 −4.1

[(a) −2, (b) ω2LC − 1, (c) −18 (d) 0 (e) −262.607]

3. Evaluate the determinant of5 3 41 −3 07 2 −8

by expanding (a) along the second row, (b) down the first column.

[(a) and (b) 236]

4. If

A =

(a11 a12

a21 a22

)

calculate A−1 and show that AA−1 = A−1A = I, the 2× 2 unit matrix.

5. Put the following three linear equations into matrix form Ax = w

2x1 − x2 + 5 = 3x3

−x3 + 8 = x1 + x2

x2 + 3x3 = 2− x1

6. The admittance matrix for a 2-port network is

Y =

(−3j 0.52 −0.5j

)

What is its impedance matrix?

[z11 = 0.2j, z12 = 0.2, z21 = 0.8, z22 = 1.2j]

154

Page 156: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Chapter 18

Matrices II

18.1 Matrix inversion: Pi to T conversion

Given Ya, Yb and Yc in the following Pi configuration

Yb

Ya Ycv v

i i

1

1 2

2

the problem is to find Za, Zb and Zc such that the following T circuit

is equivalent to the above Pi circuit.

aZ Zc

Zb

Matrix manipulation provides a systematic solution to this problem,

which known as the Pi–T or Delta–star transformation.

The first thing to remember is that it is easy to write down

Y -parameters for a Pi circuit,

Z-parameters for a T circuit.

155

Page 157: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

So, what are the Y -parameters for the Pi circuit? The definition we

need is i = Y v, or, in full,

i1 = y11v1 + y12v2

i2 = y21v1 + y22v2.

So, for instance

y11 =i1v1

when v2 = 0

i.e.

y11 = Ya + Yb.

Similarly,

y12 =i1v2

when v1 = 0

i.e.

y12 = −Yb.Repeating for y21 and y22 gives

Y =

Ya + Yb −Yb−Yb Yb + Yc

.Next, what are the Z-parameters for T circuit? By the same method,

we find that

Z =

Za + Zb ZbZb Zb + Zc

.Now, we know that Z = Y −1 so

Z =

Za + Zb ZbZb Zb + Zc

=1

detY

Yb + Yc YbYb Ya + Yb

where detY = (Ya + Yb)(Yb + Yc)− Y 2

b = YaYb + YbYc + YcYa.

Two matrices are equal only when all their elements are equal, so in

order for the Pi and T circuits to be equivalent, Y −1 for the Pi must

156

Page 158: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

be equal to Z for the T, and so, considering each element in turn,

the following must hold

Zb = Yb/ detY

Za + Zb = (Yb + Yc)/ detY, giving Za = Yc/ detY

Zb + Zc = (Ya + Yb)/ detY, giving Zc = Ya/ detY.

which is the required answer.

18.2 Solving n linear equations

Under certain conditions, for known matrix A and known vector w,

the set of n linear equations

Ax = w (18.1)

can be solved for unknown vector x:

x = A−1w.

The condition is that the inverse of A exists. Looking back at the last

section of the previous chapter, we see that calculating the inverse of

A requires us to divide by detA. The condition for the inverse of A

to exist is therefore that

detA is not equal to 0.

Provided that this condition is met, we can find the inverse of A (in

principle) and hence solve the n equations 18.1, as long as w 6= 0.

Note that this is true regardless of how many equations there are.

18.3 Inverting an n× n matrix

We have seen how to invert a 2× 2 matrix. How is this generalised

to larger matrices?

There are several ways of doing this, one of which is known as the

adjoint method, which is best shown by example.

157

Page 159: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Example 18.1 Use the adjoint method to invert a 3× 3 matrix

A =

a11 a12 a13

a21 a22 a23

a31 a32 a33

.The inverse of A is given by

A−1 =AdjointA

detAwhere the adjoint of A is calculated in two steps:

1. Replace each element of A with its cofactor. To do this, for each elementof A, cross out the row and column in which it appears, and find the de-terminant of the remaining matrix. Multiply this by +1 or −1, accordingto its position.

e.g. The cofactor of a11 is a22a33 − a23a32.

e.g. The cofactor of a23 is −(a11a32 − a12a31).

The signs we need to multiply by are

+ − +− + −+ − +

for a 3× 3 matrix.

The matrix of cofactors of A is thereforea22a33 − a23a32 −(a21a33 − a23a31) a21a32 − a22a31

−(a12a33 − a13a32) a11a33 − a13a31 −(a11a32 − a12a31)a12a23 − a13a22 −(a11a23 − a13a21) a11a22 − a12a21

2. Transpose the matrix of cofactors — that is, reflect it about the leading

diagonal, to give

AdjA =

a22a33 − a23a32 −(a12a33 − a13a32) a12a23 − a13a22

−(a21a33 − a23a31) a11a33 − a13a31 −(a11a23 − a13a21)a21a32 − a22a31 −(a11a32 − a12a31) a11a22 − a12a21

Dividing this by detA gives the inverse of A, provided that detA 6= 0.

This method extends to n × n matrices, but involves a lot of work

for n > 3.

158

Page 160: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

18.4 The equation matrix × vector = 0

We have solved Ax = w when w is not the zero vector, 0. What

about the equation Ax = 0? (N.B. By ‘0’ I mean the column vector

with zeros everywhere.) That is, for a 2× 2 matrix,

A =

a11 a12

a21 a22

, x =

x1

x2

and 0 =

0

0

so Ax = 0 becomes the pair of equations

a11x1 + a12x2 = 0 (18.2)

and

a21x1 + a22x2 = 0. (18.3)

There are two possibilities. The first is

(a) x1 = x2 = 0 (obviously).

However, another solution may also exist: first find x1 from 18.2:

x1 = −a12x2

a11(18.4)

Substitute this in 18.3

−a21a12x2

a11+ a22x2 =

−a21a12

a11+ a22

x2 = 0

so we can see that x2 is forced to be 0 unless

−a21a12

a11+ a22 = 0

or, in other words, if

a11a22 − a12a21 = 0.

Recognise this? It’s detA, so the second possibility is that

(b) detA = 0, in which case x1 and x2 are not forced to be 0.

This is a general condition and applies to n linear equations, not just

two.

159

Page 161: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

In case (b), detA = 0, only the ratio x1/x2 is defined by 18.2

and 18.3. From 18.2 this ratio isx1

x2= −a12

a11.

18.5 Application of matrix × vector = 0

L L

C CCi i1 2

Figure 18.1: An application of Ax = 0.

From Kirchhoff’s voltage law, we know that the sum of the voltages

around closed loops is zero, so for the circuit in figure 18.1

Loop 1: i1

1

jωC+ jωL

+i1 − i2jωC

= 0 (18.5)

and

Loop 2: i2

1

jωC+ jωL

+i2 − i1jωC

= 0. (18.6)

In matrix form,

Zi = 0

so1

jωC

2− ω2LC −1

−1 2− ω2LC

i1i2

=

0

0

. (18.7)

The solution is either

(a) i1 = i2 = 0 (true, but trivial)

or

(b) detZ = 0, which gives

(2− ω2LC)2 − 1 = 0

160

Page 162: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

i.e.

2− ω2LC = ±1

so

ω2 =3

LC,

1

LC.

This condition gives the two resonant frequencies of the circuit. As

stated above, i1 and i2 aren’t fixed, but their ratio is: from either 18.5

or 18.6,i2i1

= 2− ω2LC = ±1.

The interpretation of this is that current i1 can have any magnitude;

then i2 is of the same magnitude, but with the same or opposite sign

(i.e. circulates in the same or the opposite direction).

18.6 Eigenvalues and eigenvectors

The equation

Ax = λx or, equivalently, (A− λI)x = 0 (18.8)

where A is an n × n matrix, I is the n × n unit matrix, λ is a

number and x is a vector, arises in problems in circuit theory and

other branches of electronic engineering.

Note the following about the nontrivial solutions λ and x to this

equation:

• There are n values of λ, which are known as the eigenvalues of

A.

• The eigenvalues can be real or complex, depending on A.

• To each eigenvalue there corresponds a vector x, known as an

eigenvector of A.

161

Page 163: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

• If x1 is an eigenvector, then ax1, where a is any constant, is also

an eigenvector.

Example 18.2 Find the eigenvalues and corresponding eigenvectors of thematrix

A =

(2 1−2 5

).

Answer As we saw in the previous section, the equation Ax = 0 only has non-trivial solutions if detA = 0. Hence, nontrivial solutions to equation (18.8)can only be found if

det

[(2 1−2 5

)− λ

(1 00 1

)]= 0.

We can solve this for λ, the eigenvalues:

det

[(2 1−2 5

)− λ

(1 00 1

)]= det

(2− λ 1−2 5− λ

)

= (2− λ)(5− λ) + 2 = λ2 − 7λ+ 12 = 0

which has solutionsλ = 3, 4.

To each of these values of λ there corresponds an eigenvector x, which isdefined such that

(A− λI)x = 0.

Taking the eigenvalue λ = 3 gives

[A− 3I]x =

[(2 1−2 5

)−(

3 00 3

)] (x1

x2

)=

(−1 1−2 2

) (x1

x2

)= 0.

Multiplying this out gives

−x1 + x2 = 0 and − 2x1 + 2x2 = 0

both of which tell us that x1 = x2. Hence, the eigenvector corresponding to

λ = 3 is x = a

(11

)for an arbitrary constant a.

The eigenvector corresponding to λ = 4 is calculated in the same way. It is

b

(12

)with b another arbitrary constant.

162

Page 164: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

18.7 Applications of eigenvalues/eigenvectors

The resonance problem considered in section 18.5 can also be treated

as an eigenvalue problem. Multiplying equation 18.7 by jωC gives

2− ω2LC −1

−1 2− ω2LC

i1i2

=

0

0

so

2 −1

−1 2

− ω2LC

1 0

0 1

i1i2

=

0

0

↑ ↑ ↑ ↑ ↑

[ A − λ I ] x = 0.

You should recognise this as the eigenvalue equation again. The

eigenvalues of the matrix A are LC× (the resonant frequencies of

the circuit)2. The eigenvectors of A are the currents i1 and i2. As

pointed out before, only the ratio i1/i2 is fixed, not their actual values

— which is also true for eigenvectors.

For another application, see problems.

163

Page 165: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Problems, chapter 18

1.∗The T-Pi transformation. Use matrix algebra to find the values of Ya, Yband Yc, in terms of Za, Zb and Zc, that make the following two circuitsequivalent:

Z Z

Z Ya Y

Yb

c

a

b

c

[Ya = Zc/D, Yb = Zb/D, Yc = Za/D, where D = ZaZb + ZbZc + ZcZa]

2. (a) Put the following equations into the form Az = b:

2z1 − 3z2 = 4

9z2 − 6z1 = −12

Find det A. Can you solve the equations? Why?

(b) Put b = 0. Now what can you say about z1 and z2?

[(a) det A = 0. No. The 2nd eqn. is just −3× the first, so it gives us nonew information; det A = 0 is telling us this. (b) z1/z2 = 3/2.]

3. Consider the following circuit:

2C C

L L2Li 1 i 2

Find the resonant frequencies and the corresponding values of i1/i2.

[ω2 = (4±√

6)/(10LC), i1/i2 = (2∓ 2√

6)/(4±√

6) = −0.449, 4.449]

4. Find the eigenvalues and corresponding eigenvectors for the followingmatrices:

(a) (4 32 5

)

164

Page 166: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

(b) (2 3−1 2

)

(c) 4 0 10 4 7−5 1 3

[(a) 2, (−3/2, 1) and 7, (1, 1), (b) 2± j

√3, (1,±j/

√3)

(c) 4, (1, 5, 0); 2, (1, 7,−2) and 5, (1, 7, 1)]

5.∗ (a) The two port network below has transmission parameter matrix T ,which is defined so that

(v2

i2

)=

(t11 t12

t21 t22

) (v1

i1

).

i1 2

Two port networkv1 v2 Z0

i

An external impedance Z0 is connected to port 2. If Z0 is chosen so thatthe input impedance (v1/i1) is also Z0, show that the eigenvalues of Tare the ratios of i2/i1.

What do the eigenvectors of T correspond to?

(b) The network above has parameters

T =

(8 31 8

).

Find the values of Z0 such that input impedance is Z0 and the corre-sponding current ratios, i2/i1.

[Z0 = ±√

3, i2/i1 = 8±√

3]

165

Page 167: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Chapter 19

The wave equation

Aims

By the end of this chapter, you should understand

• what a partial differential equation is

• how to derive the wave equation for a transmission line

• how to find a general solution to the wave equation

• why signals propagate along lines.

19.1 Partial differential equations

You have met differential equations in the first year and they appear

again in this course, in the Laplace transform chapters. In this chap-

ter, we derive and discuss a partial differential equation, known as

the wave equation, that crops up frequently. The one-dimensional

wave equation is

∂2v

∂t2= c2∂

2v

∂x2. (19.1)

Points to note about it are:

• The unknown function, v = v(x, t), is a function of more than

one variable. In this case v(x, t) is a function of distance, x, and

time, t.

166

Page 168: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

• In ordinary differential equations, the unknown function depends

on only one variable; in partial differential equations, the un-

known function depends on two or more variables.

• The constant c2 has dimensions of velocity squared.

Other examples of partial differential equations include

• Laplace’s equation

∇2v(x, y, z) =∂2v

∂x2+∂2v

∂y2+∂2v

∂z2= 0

• The three-dimensional wave equation

∂2v

∂t2= c2∇2v(x, y, z, t)

both of which arise in electromagnetic problems.

In this chapter, we concentrate on the one-dimensional wave equa-

tion, 19.1.

19.2 Derivation of the wave equation

Inner conductor

Earthed shield

Figure 19.1: A piece of coaxial cable.

167

Page 169: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

In this section we derive equation 19.1 for a coaxial cable which has

an inner conducting core and an earthed outer shield, as shown in

figure 19.1. We assume that there is no leakage between the inner

conductor and the shield, and that the conductor has zero resistance.

Suppose that the inner conductor has inductance L per unit length

and capacitance C between it and the shield, also per unit length.

Then a section of cable of length δx has inductance Lδx and capac-

itance Cδx.

Consider first the inductive behaviour of a length δx of cable, illus-

trated below.

-

-δx

v v + δv

x x + δx

i

The voltage of the inner conductor is v at a distance x along the line,

and v + δv at a distance x + δx. If the current is i, then, from the

definition of inductance, we get

v − (v + δv) = (Lδx)∂i

∂t.

(N.B. signs). Rearranging and letting δx→ 0 gives

−∂v∂x

= L∂i

∂t. (19.2)

168

Page 170: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Now consider the capacitive behaviour of the same piece of line.

-

- -

δx

x x + δx

i + δii

v

The current in the core is i at a distance x along the line, and i+ δi

at a distance x + δx. If the voltage is v, then, from the capacitance

equation we get δQ = (Cδx) v, and using the fact that i = dQ/dt

gives

i− (i + δi) = (Cδx)∂v

∂t.

Rearranging and letting δx→ 0 gives

− ∂i∂x

= C∂v

∂t. (19.3)

We can now derive the wave equation from 19.2 and 19.3. Differen-

tiating 19.2 with respect to x gives

−∂2v

∂x2= L

∂2i

∂x∂tand differentiating 19.3 with respect to t gives

− ∂2i

∂t∂x= C

∂2v

∂t2.

169

Page 171: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Combining these and using the fact that ∂2i∂t∂x = ∂2i

∂x∂t gives

∂2v

∂t2=

1

LC

∂2v

∂x2. (19.4)

This is the wave equation. Remembering that L and C are the in-

ductance/capacitance per unit length, you should show that 1/(LC)

has the dimensions of velocity squared. In fact it can be shown (see

electromagnetism course notes) that

LC = ε0εrµ0µr.

In an air-filled cable the relative permittivity/permeability, εr = µr =

1, so the velocity is

c =1

√ε0µ0

≈ 3.0× 108 m/s

which is the velocity of light.

19.3 The d’Alembert solution of the wave equation

Look again at the wave equation in the form 19.1 in which it was first

given. Suppose f is a function, which is arbitrary except that it can

be differentiated twice. Now consider f (x− c t). Differentiating:1

∂f (x− c t)∂x

= f ′(x− c t) and∂2f (x− c t)

∂x2= f ′′(x− c t)

∂f (x− c t)∂t

= −cf ′(x−c t) and∂2f (x− c t)

∂t2= c2f ′′(x−c t)

1I have used f ′(x − c t) to mean “the derivative of f with respect to its argument, evaluated at x − ct”. Forinstance, if f(x− ct) = (x− ct)3, then f ′(x− ct) = 3(x− ct)2 and f ′′(x− ct) = 6(x− ct).

170

Page 172: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Looking at the second derivatives, we can see that f (x − c t) is a

solution to the wave equation. That is,

∂2f (x− c t)∂t2

= c2∂2f (x− c t)∂x2

.

The same is true of another arbitrary, twice-differentiable function,

g(x+ c t) (see problems). In fact, the most general possible solution

to 19.1 is the sum of the two:

v(x, t) = f (x− c t) + g(x + c t). (19.5)

This is known as the d’Alembert solution of the wave equation.

Points to note:

• f (x − c t) represents a wave travelling to the right — in the

direction of increasing x — with velocity c.

• g(x + c t) represents a wave travelling to the left — decreasing

x — with velocity c.

• Both f and g are arbitrary functions — hence, there is a very

wide range of possible solutions to the wave equation.

• Boundary conditions are needed to find f and g for a given sit-

uation — see below.

• All of this theory applies equally to plane electromagnetic waves

in free space, waves on stretched strings etc. as well as waves on

coaxial cables.

19.4 Boundary conditions

As is the case with ordinary differential equations, some initial infor-

mation is needed to solve the wave equation in a particular case. This

171

Page 173: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

information is contained in the boundary conditions. Two boundary

conditions are needed:

1. the voltage on the line at t = 0 for all x, which we shall call

V0(x); and

2. the derivative of the voltage with respect to time, also at t = 0

and again for all x, which we shall call W0(x).

Given V0(x) and W0(x) we can find the solution, v(x, t) for all x and

t by finding the functions f and g appearing in 19.5. To put this in

the form of an equation

Given the general solution (f and g arbitrary)

apply boundary conditions, V0(x) and W0(x)

→ Particular solution, v(x, t).

So, how do we find the functions f and g given the functions V0(x)

and W0(x)? Let us write down the two things we know:

V0(x) = f (x− c t) + g(x + c t)|t=0 = f (x) + g(x) (19.6)

for the voltage at t = 0, and

W0(x) =∂f (x− c t)

∂t+∂g(x + c t)

∂t

∣∣∣∣∣∣∣t=0

= −cf ′(x)+cg′(x) (19.7)

for the derivative of voltage w.r.t. t at t = 0. We have two equations

here, which we hope to solve for the two unknown functions f and

g. To do this, first integrate (19.7) and divide by c to get

−f (x) + g(x) =1

c

∫ x

x0

W0(s)ds (19.8)

172

Page 174: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

where x0 is an arbitrary constant which disappears later on. Now,

subtracting (19.6) and (19.8) gives

f (x) =1

2V0(x)− 1

2c

∫ x

x0

W0(s)ds

and adding the same pair of equations gives

g(x) =1

2V0(x) +

1

2c

∫ x

x0

W0(s)ds.

Remembering that the solution, v(x, t), is f (x − c t) + g(x + c t),

we obtain

v(x, t) =1

2[V0(x− c t) + V0(x + c t)]

− 1

2c

∫ x−ct

x0

W0(s)ds +1

2c

∫ x+ct

x0

W0(s)ds.

However

−∫ x−ct

x0

W0(s)ds = +

∫ x0

x−ctW0(s)ds

(swapping the limits changes the sign), so combining the two integrals

gives, finally,

v(x, t) =1

2[V0(x− c t) + V0(x + c t)] +

1

2c

∫ x+ct

x−ctW0(s)ds.

(19.9)

To illustrate further, let us consider an example.

Example 19.1 A coaxial cable stretching to ±∞ has on it the initial voltage

V0(x) =1

1 + x2

173

Page 175: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

and initial time derivative of voltage

W0(x) = 0

at t = 0. Find the function v(x, t), which describes the voltage as a functionof x and t, if the wave velocity for the cable is c.Answer We are being asked to solve the wave equation with the boundarycondition that, at t = 0,

V0(x) = v(x, 0) =1

1 + x2

and W0(x) = 0. The required solution to the wave equation is

v(x, t) =1

2V0(x− c t) +

1

2V0(x+ c t) +

1

2c

∫ x+ct

x−ct0ds

from 19.9. Hence,

v(x, t) =1

2(1 + (x− ct)2)+

1

2(1 + (x+ ct)2)

where c is the wave velocity for the cable. You can check that at t = 0,v(x, 0) = V0(x), as it should do. You can also check that the time derivativeis zero at t = 0, as required.

19.5 What does it all mean?

The above example shows why a signal (a time-varying voltage) fed

into one end of a coaxial cable of length l, comes out at the other

end a time l/c later.

The condition that f and g must be twice differentiable is automat-

ically satisfied for all real voltage waveforms on transmission lines,

even supposedly rectangular pulses. This is because it is not possible

to create a perfectly sharp voltage edge, as this would imply a volt-

age with infinite first derivative. The reason this cannot happen is

that there is always some stray capacitance Cs around any conduc-

tor, and i = Csdv/dt would be infinite for an infinitely sharp edge.

174

Page 176: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

No source can generate an infinite current, which would require an

infinite number of electrons to flow past a point (there aren’t enough

electrons in the Universe) or a finite number of electrons to flow with

infinite velocity (which violates relativity). By a similar argument,

v′′ cannot be infinite because that would imply an infinite di/dt for

Cs. Such a current flowing through any stray inductance would give

rise to an infinite voltage across the inductance.

You can get a good idea what the solution to the example actu-

ally looks like by using a simple demonstration I have set up. This

uses the animation function in the algebraic manipulation program

xmaple. It animates the solution to example 19.1.

I recommend you look at this. You can also modify the program

yourself to see how the pictures change.

To see the demonstration

1. Copy

/vol/examples/teaching/engmaths2/wave eqn

to your home directory. Call it wave eqn.

2. Type xmaple.

3. When the xmaple window comes up, type read wave eqn;.

4. After a short while a plot of single-humped function will be pro-

duced. Click on the plot; a box appears around it and a second

row of buttons appears. Click on the play button to see the

two waves move off in opposite directions.

You can also use xmaple to differentiate v(x, t) with respect to t,

substitute t = 0 in the result: simplify(subs(t = 0, diff(v,

t))), and show that this is 0 as it should be.

175

Page 177: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Problems, chapter 19

1. Show that

v(x, t) = A sin(kx− ωt) +B cos(kx+ ωt)

with A and B arbitrary constants, is a solution to the wave equation.What is the wave velocity in this case?

[Velocity = ±ω/k]

2. Show that g(x+c t), where g is an arbitrary, twice differentiable functiong, is a solution of the wave equation.

3. A string is given an initial displacement

V0(x) =sinx

x

The initial velocity of the string is everywhere zero. Find v(x, t), thefunction that describes the motion of the string after it is released att = 0. Describe in words and a sketch what the motion looks like. Showthat v(x, t) has the properties (a) v(x, 0) = V0(x) and (b) ∂v(x,t)

∂t = 0 att = 0.

To see what this solution looks like, use xmaple to animate v(x, t) foryou.

[v(x, t) = 1/2[sin(x− ct)/(x− ct) + sin(x+ ct)/(x+ ct)]]

4.∗The solution to the wave equation with initial displacement V0(x) andinitial time derivative W0(x) is

v(x, t) =V0(x− c t) + V0(x+ c t)

2+

1

2c

∫ x+ct

x−ctW0(s)ds

If the initial voltage on an infinite coaxial cable is e−x2

, what must theinitial rate of change of voltage, W0(s), be in order that v(x, t) consistsof only a single pulse of height 1, with shape e−x

2

, moving to the right?

You are encouraged to use xmaple to animate this solution too.

[W0(s) = 2cse−s2

]

176

Page 178: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Area under the Gaussian error curve

The table below gives the area under the Gaussian error curve between 0 and z, wherez = |x−x|

σ.

Example: For z = 1.72, area = 0.4573.

z 0 .01 .02 .03 .04 .05 .06 .07 .08 .090.0 .0000 .0040 .0080 .0120 .0160 .0199 .0239 .0279 .0319 .03590.1 .0398 .0438 .0478 .0517 .0557 .0596 .0636 .0675 .0714 .07530.2 .0793 .0832 .0871 .0910 .0948 .0987 .1026 .1064 .1103 .11410.3 .1179 .1217 .1255 .1293 .1331 .1368 .1406 .1443 .1480 .15170.4 .1554 .1591 .1628 .1664 .1700 .1736 .1772 .1808 .1844 .18790.5 .1915 .1950 .1985 .2019 .2054 .2088 .2123 .2157 .2190 .22240.6 .2257 .2291 .2324 .2357 .2389 .2422 .2454 .2486 .2517 .25490.7 .2580 .2611 .2642 .2673 .2704 .2734 .2764 .2794 .2823 .28520.8 .2881 .2910 .2939 .2967 .2995 .3023 .3051 .3078 .3106 .31330.9 .3159 .3186 .3212 .3238 .3264 .3289 .3315 .3340 .3365 .33891.0 .3413 .3438 .3461 .3485 .3508 .3531 .3554 .3577 .3599 .36211.1 .3643 .3665 .3686 .3708 .3729 .3749 .3770 .3790 .3810 .38301.2 .3849 .3869 .3888 .3907 .3925 .3944 .3962 .3980 .3997 .40151.3 .4032 .4049 .4066 .4082 .4099 .4115 .4131 .4147 .4162 .41771.4 .4192 .4207 .4222 .4236 .4251 .4265 .4279 .4292 .4306 .43191.5 .4332 .4345 .4357 .4370 .4382 .4394 .4406 .4418 .4429 .44411.6 .4452 .4463 .4474 .4484 .4495 .4505 .4515 .4525 .4535 .45451.7 .4554 .4564 .4573 .4582 .4591 .4599 .4608 .4616 .4625 .46331.8 .4641 .4649 .4656 .4664 .4671 .4678 .4686 .4693 .4699 .47061.9 .4713 .4719 .4726 .4732 .4738 .4744 .4750 .4756 .4761 .47672.0 .4772 .4778 .4783 .4788 .4793 .4798 .4803 .4808 .4812 .48172.1 .4821 .4826 .4830 .4834 .4838 .4842 .4846 .4850 .4854 .48572.2 .4861 .4864 .4868 .4871 .4875 .4878 .4881 .4884 .4887 .48902.3 .4893 .4896 .4898 .4901 .4904 .4906 .4909 .4911 .4913 .49162.4 .4918 .4920 .4922 .4925 .4927 .4929 .4931 .4932 .4934 .49362.5 .4938 .4940 .4941 .4943 .4945 .4946 .4948 .4949 .4951 .49522.6 .4953 .4955 .4956 .4957 .4959 .4960 .4961 .4962 .4963 .49642.7 .4965 .4966 .4967 .4968 .4969 .4970 .4971 .4972 .4973 .49742.8 .4974 .4975 .4976 .4977 .4977 .4978 .4979 .4979 .4980 .49812.9 .4981 .4982 .4982 .4983 .4984 .4984 .4985 .4985 .4986 .49863.0 .4987 .4987 .4987 .4988 .4988 .4989 .4989 .4989 .4990 .49903.1 .4990 .4991 .4991 .4991 .4992 .4992 .4992 .4992 .4993 .49933.2 .4993 .4993 .4994 .4994 .4994 .4994 .4994 .4995 .4995 .49953.3 .4995 .4995 .4995 .4996 .4996 .4996 .4996 .4996 .4996 .49973.4 .4997 .4997 .4997 .4997 .4997 .4997 .4997 .4997 .4997 .49983.5 .4998 .4998 .4998 .4998 .4998 .4998 .4998 .4998 .4998 .49983.6 .4998 .4998 .4999 .4999 .4999 .4999 .4999 .4999 .4999 .49993.7 .4999 .4999 .4999 .4999 .4999 .4999 .4999 .4999 .4999 .49993.8 .4999 .4999 .4999 .4999 .4999 .4999 .4999 .5000 .5000 .5000

177

Page 179: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

LAPLACE TRANSFORMS

F (s) =

∞∫0

f(t)e−st dt

f(t) F (s)af1(t) + bf2(t) aF1(s) + bF2(s)

ddtf(t) sF (s)− f(0)

d2

dt2f(t) s2F (s)− sf(0)− f ′(0)

dn

dtnf(t) snF (s)− sn−1f(0)− sn−2f ′(0)− . . .− fn−1(0)∫ t0 f(u) du

F (s)s∫ t

0

∫ u0 f(v) dv du

F (s)s2

tf(t) − ddsF (s)

tn f(t) n > 0 (−1)n dn

dsnF (s)

1t f(t)

∫∞0 F (u) du∫ t

0 f(t− u)g(u) du = f(t) ∗ g(t) F (s) G(s)eatf(t) F (s− a)f(t− a) with f(t) = 0 for t < 0 e−asF (s) a > 01af( ta) a > 0 F (as)Re f(t) Re F (s)Imf(t) ImF (s)

f(t), where f(t+ a) = f(t) 11− e−as

∫ a

0f(t)e−st dt

f(t), where f(t+ a) = −f(t) 11 + e−as

∫ a

0f(t)e−st dt

178

Page 180: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Laplace Transforms of Simple Functions

f(t) F (s)

H(t) (Heaviside function or unit step) 1s

δ(t) (Dirac δ-function) 1tn−1

(n− 1)!1sn (n = 2, 3, 4 . . .)

e−at 1(s+ a)

te−at 1(s+ a)2

tn−1e−at

(n− 1)!1

(s+ a)n

e−at − e−bt

b− a1

(s+ a)(s+ b)1a sin at 1

s2 + a2

cos at ss2 + a2

1a sinh at 1

s2 − a2

cosh at ss2 − a2

(πt)−1/2 s−1/2

2( tπ )1/2 s−3/2

1a2 (1− cos at) 1

s(s2 + a2)1a3 (at− sin at) 1

s2(s2 + a2)1

2a3 (sin at− at cos at) 1(s2 + a2)2

t2a sin at s

(s2 + a2)2

12a(sin at+ at cos at) s2

(s2 + a2)2

t cos at s2 − a2

(s2 + a2)2

179

Page 181: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Laplace Transforms of Simple Functions (continued)

f(t) F (s)

e−at cosωt where ω =√b− a2 s+ a

s2 + 2as+ b1ω e−at sinωt where ω =

√b− a2 1

s2 + 2as+ bH(t− a) Heaviside function starting at t = a 1

se−as

H(t)−H(t− a) rectangular pulse, equal to 1 from 0 to a 1s(1− e−as)

1a(1− e−at) 1

s(s+ a)1ab

(1− b

b− ae−at + ab− ae−bt

)1

s(s+ a)(s+ b)1ab

(α− b(α− a)

b− a e−at +a(α− b)b− a e−bt

)s+ α

s(s+ a)(s+ b)1

a− b(ae−at − be−bt) s(s+ a)(s+ b)

1b− a

((α− a)e−at − (α− b)e−bt

)s+ α

(s+ a)(s+ b)

e−at

(b− a)(c− a)+ e−bt

(c− b)(a− b) + e−ct

(a− c)(b− c)1

(s+ a)(s+ b)(s+ c)

(α− a)e−at

(b− a)(c− a)+

(α− b)e−bt(c− b)(a− b) +

(α− c)e−ct(a− c)(b− c)

s+ α(s+ a)(s+ b)(s+ c)

cosωt+ αω sinωt s+ α

s2 + ω2

sin(ωt+ φ) s sinφ+ ω cosφs2 + ω2

aω2 −

√a2 + ω2

ω2 cos(ωt+ φ) s+ as(s2 + ω2)

where φ = arctan ωae−at

a2 + ω2 + 1ω√a2 + ω2

sin(ωt− φ) 1(s+ a)(s2 + ω2)

where a > 0, φ = arctan ωae−at cosωt s+ a

(s+ a)2 + ω2

1ω e−at (ω cosωt+ (b− a) sinωt) s+ b

(s+ a)2 + ω2

180

Page 182: Contentspersonal.maths.surrey.ac.uk/st/J.Deane/Teach/eee2035/book.pdf · Weltner, Grosjean, Schuster and Weber, Mathematics for Engi-neers and Scientists. (Newly arrived on the scene.

Laplace Transforms of Simple Functions (continued)

f(t) F (s)1

a2 + b2 − 1b√a2 + b2

e−at sin(bt+ φ) 1s((s+ a)2 + b2

)where a > 0, φ = arctan ba

1ω2 − 1

ω2√

1− ζ2e−ζωt sin(ωt

√1− ζ2 + φ) 1

s(s2 + 2ζωs+ ω2)

where φ = arccos ζ

αa2 + b2 + e−at

b(a2 + b2)[(a2 − αa+ b2) sin bt− αb cos bt] s+ α

s((s+ a)2 + b2

)be−ct + [(c− a) sin bt− b cos bt] e−at

b[(c− a)2 + b2

] 1(s+ c)

((s+ a)2 + b2

)1

c(a2 + b2)− e−ct

c((c− a)2 + b2

) +e−at sin(bt+ φ)

b√a2 + b2

√(c− a)2 + b2

1s(s+ c)

((s+ a)2 + b2

)where a > c > 0, φ = arctan ba + arctan b

a− c

αc(a2 + b2)

+(c− α)e−ct

c((c− a)2 + b2

)+

√(α− a)2 + b2

b√a2 + b2

√(c− a)2 + b2

e−at sin(bt+ φ) s+ αs(s+ c)

((s+ a)2 + b2

)where α > a > c > 0, φ = arctan b

α− a + arctan ba + arctan ba− c

1a2 (at− 1 + e−at) 1

s2(s+ a)1a2 (1− e−at − ate−at) 1

s(s+ a)2

1a2 (α− αe−at + a(a− α)te−at) s+ α

s(s+ a)2

181