You are on page 1of 205

Digital Signal Processing in a Nutshell (Volume I)

Jan Allebach, Krithika Chandrasekar

ID: 12395631
www.lulu.com

5 800077 300189

Digital Signal Processing in a


Nutshell (Volume I)
Jan P Allebach

Krithika Chandrasekar

Contents
1 Signals
1.1 Chapter Outline . . . . . . . . . .
1.2 Signal Types . . . . . . . . . . . .
1.3 Signal Characteristics . . . . . . .
1.4 Signal Transformations . . . . . . .
1.5 Special Signals . . . . . . . . . . .
1.6 Complex Variables . . . . . . . . .
1.7 Singularity functions . . . . . . . .
1.8 Comb and Replication Operations

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

5
5
6
7
10
14
17
23
27

2 Systems
2.1 Chapter Outline . .
2.2 Systems . . . . . . .
2.3 System Properties .
2.4 Convolution . . . . .
2.5 Frequency Response

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

29
29
29
32
36
44

3 Fourier Analysis
3.1 Chapter Outline . . . . . . . . . . . . .
3.2 Continuous-Time Fourier Series (CTFS)
3.3 Continuous-Time Fourier Transform . .
3.4 Discrete-Time Fourier Transform . . . .

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

51
51
51
57
70

4 Sampling
4.1 Chapter Outline . . . . . . . . . . .
4.2 Analysis of Sampling . . . . . . . . .
4.3 Relation between CTFT and DTFT
4.4 Sampling Rate Conversion . . . . . .

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

79
79
79
87
90

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.

.
.
.
.

CONTENTS

5 Z Transform (ZT)
5.1 Chapter Outline . . . . . . . . . . . . . . . . . . . .
5.2 Derivation of the Z Transform . . . . . . . . . . . . .
5.3 Convergence of the ZT . . . . . . . . . . . . . . . . .
5.4 ZT Properties and Pairs . . . . . . . . . . . . . . . .
5.5 ZT,Linear Constant Coefficient Difference Equations
5.6 Inverse Z Transform . . . . . . . . . . . . . . . . . .
5.7 General Form of Response of LTI Systems . . . . . .

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

99
99
99
103
107
108
114
124

6 Discrete Fourier Transform (DFT)


6.1 Chapter Outline . . . . . . . . . . . . . .
6.2 Derivation of the DFT . . . . . . . . . . .
6.3 DFT Properties and Pairs . . . . . . . . .
6.4 Spectral Analysis Via the DFT . . . . . .
6.5 Fast Fourier Transform (FFT) Algorithm
6.6 Periodic Convolution . . . . . . . . . . . .

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

129
129
129
132
134
137
142

7 Digital Filter Design


7.1 Chapter Outline . . . . . . . . . . . . .
7.2 Overview . . . . . . . . . . . . . . . . .
7.3 Finite Impulse Response Filter Design .
7.4 Infinite Impulse Response Filter Design

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

147
147
147
154
165

8 Random Signals
8.1 Chapter Outline . . . . . . . .
8.2 Single Random Variable . . . .
8.3 Two Random Variables . . . .
8.4 Sequences of Random Variables
8.5 Estimating Distributions . . . .
8.6 Filtering of Random Sequences
8.7 Estimating Correlation . . . . .

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

177
177
177
181
184
191
195
203

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

Chapter 1

Signals
1.1

Chapter Outline
In this chapter, we will discuss:

1. Signal Types
2. Signal Characteristics
3. Signal Transformations
4. Special Signals
5. Complex Variables
6. Singularity Functions
7. Comb and Replication Operators

CHAPTER 1. SIGNALS

1.2

Signal Types

There are three different types of signals:


1. Continuous-time (CT)
2. Discrete-time (DT)
3. Digital (discrete-time and discrete-amplitude)
The different types of signals are shown in Figure 1.2(a) below.

Figure 1.2(a) Different types of signals.

Comments
The CT signal need not be continuous in amplitude
The DT signal is undefined between sampling instances
Levels need not be uniformly spaced in a digital signal
We make no distinction between discrete-time and digital signals in
theory
The independent variable need not be time

1.3. SIGNAL CHARACTERISTICS

x(n) may or may not be sampled from an analog waveform, i.e.


xd (n) = xa (nT ) T- sampling interval
Throughout this book, we will use the subscripts d and a only
when necessary for clarity.

Equivalent Representations for DT signals

Figure 1.2(b) Equivalent representations for DT signals.

1.3

Signal Characteristics

Signals can be:


1. Deterministic or random
2. Periodic or aperiodic
For periodic signals, x(t) = x(t + nT ), for some fixed T and for all
integers n and times t.
3. Right-sided, left-sided, or two-sided
For right-sided signals, x(t) 6= 0 only when t t0 .
If t0 0, the signal is causal.
For left-sided signals, x(t) 6= 0 only when t t0 .
If t0 0, the signal is anticausal.
For 2-sided or mixed causal signals, x(t) 6= 0 for some t < 0, and
x(t) 6= 0 for some t > 0.
4. Finite or infinite duration
For finite duration signals, x(t) 6= 0 only for < t1 t t2 < .

CHAPTER 1. SIGNALS

Metrics
Metrics
Energy

CT signal
R
Ex = |x(t)|2 dt

Power

1
Px = lim
T 2T

DT signal
X
|x(n)|2
Ex =
n

|x(t)|2 dt

Magnitude
Area

Mx = maxt |x(t)|
R
Ax = |x(t)|dt

Average value

1
xavg = lim
T 2T

N
X
1
|x(n)|2
N 2N + 1

Px = lim

n=N

Mx = maxn |x(n)|
X
Ax =
|x(n)|
n

x(t)dt
T

N
X
1
x(n)
N 2N + 1

xavg = lim

n=N

Comments
If signal is periodic, we need only average over one period, e.g. if
x(n)=x(n+N) for all n
Px =

1
N

n0 +N
X1

|x(n)|2 , for any n0

n=n0

root-mean-square (rms) value


p
xrms = Px

Examples
Example 1

Figure 1.3(a) Signal for Example 1.


 (t+1)/2
e
, t > 1
x(t) =
0,
t < 1

1.3. SIGNAL CHARACTERISTICS

The signal is:


1. deterministic
2. aperiodic
3. right-sided
4. mixed causal

Metrics
1. Ex =

Ex =

1
0

|e(t+1)/2 |2 dt,
es ds =

let s = t + 1

es |0

=1

2. Px = 0
3. Mx = 1
4. Ax = 2
5. xavg = 0
Example 2

Figure 1.3(b) Signal for Example 2.


x(n) = A cos(n/4)
The signal is:
1. deterministic
2. periodic (N = 8)

10

CHAPTER 1. SIGNALS
3. 2-sided
4. mixed causal

Metrics
1. Ex =
2. Px =

7
1X
|A cos(n/4)|2
8 n=0

7
A2 X
[1 + cos(n/2)]
16 n=0
A2
Px =
2

Px =

A
3. xrms =
2
4. Mx = A
5. Ax is undefined
6. xavg = 0

1.4

Signal Transformations

Continous-Time Case
Consider

1. Reflection
y(t) = x(t)

1.4. SIGNAL TRANSFORMATIONS

2. Shifting
y(t) = x(t t0 )

3. Scaling
y(t) = x( at )

4. Scaling and Shifting


Example 1
y(t) = x( at t0 )
What does this signal look like?
center of pulse:

t
a

t0 = 0 t = at0

11

12

CHAPTER 1. SIGNALS
left edge of pulse:

t
a

right edge of pulse:

1
2
t0 = 21

t0 =

t = a(t0 12 )

t
a

t = a(t0 + 21 )

Example 2
y(t) = x

tt0
a

What does this signal look like?


center: (t t0 )/a = 0 t = t0
left edge of pulse: (t t0 )/a = 1/2 t = t0 a/2
right edge of pulse: (t t0 )/a = 1/2 t = t0 + a/2

Discrete-Time Case
Consider

1.4. SIGNAL TRANSFORMATIONS


1. Reflection
y(n) = x(n)

2. Shifting
y(n) = x(n n0 )

Note that n0 must be an integer. Non-integer delays can only be


defined in the context of a CT signal, and are implemented by
interpolation.
3. Scaling
a. downsampler
y(n) = x(Dn), D Z

b. upsampler

x(n/D), n/D Z, D Z
y(n) =
0,
else

13

14

1.5

CHAPTER 1. SIGNALS

Special Signals

Unit step
a. CT case

1,
u(t) =
0,

t>0
t<0

b. DT case

1, n 0
u(n) =
0, else

Rectangle

1, |t| < 1/2
rect(t) =
0, |t| > 1/2

1.5. SPECIAL SIGNALS

Triangle

1 |t|, |t| 1
(t) =
0,
else

Sinusoids
a. CT

xa (t) = A sin(a t + )
where A is the amplitude
a is the frequency
is the phase
Analog frequency




radians
cycles
a
= 2fa
sec
sec

15

16

CHAPTER 1. SIGNALS

Period


sec
1
T
=
cycle
fa
b. DT
xd (n) = A sin(d n + )

digital
 frequency



radians
cycles
d
= 2
sample
sample
Comments
1. Depending on , xd (n) may not look like a sinusoid

2. Digital frequencies 1 = 0 and 2 = 0 + 2k are equivalent


x2 (n) = A sin(2 n + )
= A sin[(0 + 2k)n + ]
= x1 (n), for all n
3. xd (n) will be periodic if and only if d = 2(p/q) where p and q are
integers. In this case, the period is q.

1.6. COMPLEX VARIABLES


Sinc
sinc(t) =

1.6

sin(t)
(t)

Complex Variables

Definition
Cartesian coordinates
z = (x, y)
Polar coordinates
z = R
p
R = x2 + y 2
x = R cos ()

17

18

CHAPTER 1. SIGNALS

= arctan

y
x

y = R sin ()

Alternate representation
define j = (0, 1) = 1 (/2)
then z = x + jy
Additional notation
Re {z} = x
Im {z} = y
|z| = R

Algebraic Operations
Addition (Cartesian Coordinates)

z1 = x1 + jy1
z2 = x2 + jy2
z1 + z2 = (x1 + x2 ) + j(y1 + y2 )

1.6. COMPLEX VARIABLES


Multiplication (Polar Coordinates)

z1 = R1 1
z2 = R2 2
z1 z2 = R1 R2 (1 + 2 )

Special Examples
1. 1 = (1, 0) = 10

2. 1 = (1, 0) = 1180

3. j 2 = (190)2 = 1180 = 1

19

20

CHAPTER 1. SIGNALS

Complex Conjugate
z = x jy = R ()

Some useful identities


1
Re {z} = [z + z ]
2
1
Im {z} = [z z ]
j2

|z| = zz

Complex Exponential
Taylor series for exponential function of real variable x
ex =

k=0
X

xk
k!

Replace x by j
j2
j3
j4
j5
+
+
+
2!
3!
4!
5!
2
4
3
5
= (1
+
...) + j(
+
...)
2!
4!
3!
5!
= cos + j sin

ej = 1 + j +

1.6. COMPLEX VARIABLES

ej

cos2 + sin2 = 1
sin
= arctan
=
cos

|ej | =

Alternate form for polar coordinate representation of complex number


z = R = Rej

Multiplication of two complex numbers can be done using rules for


multiplication of exponentials:
z1 z2 = (R1 ej1 )(R2 ej2 ) = R1 R2 ej(1 +2 )

Complex exponential signal


CT x(t) = Aej(t)
(t) = a t + instantaneous
phase

rad
d(t)
= a
instantaneous phasor velocity
dt
sec

21

22

CHAPTER 1. SIGNALS

DT x(n) = Aej(d n+)


d is the phasor velocity in


radians .
sample

Example
d = /3 = /6

Aliasing
1. It refers to the ability of one frequency to mimic another
2. For CT case, ej1 t = ej2 t for all t 1 = 2
3. In DT, ej1 n = ej2 n if 2 = 1 + 2k

1.7. SINGULARITY FUNCTIONS


Consider
7
5
1 =
2 =
6
6
x1 (n) = ej1 n x2 (n) = ej2 n

In general, if 1 = + and 2 = ( ), then


x1 (n) = ej1 n
= ej(+)n
= ej[(+)n2n]
= ej[(+)n]
= ej()n
= x2 (n)

1.7

Singularity functions

CT Impulse Function
1
t
Let (t) = rect( )

Z
Note that
(t)dt = 1.

What happens as 0?
1 > 2 > 3

23

24

CHAPTER 1. SIGNALS

In the limit, we obtain


(t) = lim (t)
0

0, t 6= 0
(t) =
, t = 0
and
Z
(t)dt = 1

We will use impulses in three ways:


1. to sample signals
2. as a way to decompose signals into elementary components
3. as a way to characterize the response of a class of systems to an
arbitrary input signal

Sifting property
Consider a signal x(t) multiplied by (t t0 )for some fixed t0 :

1.7. SINGULARITY FUNCTIONS


From the mean value theorem of calculus,
Z

x(t) (t t0 )dt = x()

for some which satisfies


t0

t0 +

As 0, t0 and x() x(t0 )


So we have
Z
x(t)(t t0 )dt = x(t0 )

provided x(t) is continuous at t0 .

Equivalence
Based on sifting property,
x(t)(t t0 ) x(t0 )(t t0 )

Indefinite integral of (t)


Z

( )d

Let u (t) =

25

26

CHAPTER 1. SIGNALS

Let 0,
Z t
u(t) =
( )d

When we define the unit step function, we did not specify its value at
t=0. In this case, u(0) = 0.5

More general form of sifting property


Z


x( )( t0 )d =

x(t0 ), a < t0 < b


0,
t0 < a or b < t0

DT Impulse Function (unit sample function)


(n) =

1, n = 0
0, else

1.8. COMB AND REPLICATION OPERATIONS

27

Sifting Property
n2
X


x(n)(n n0 ) =

n=n1

x(n0 ), n1 n0 n2
0,
else

Equivalence
x(n)(n n0 ) = x(n0 )(n n0 )
Indefinite sum of (n)
u(n) =

n
X

(m)

m=

1.8

Comb and Replication Operations

Sifting property yields a single sample at t0 . Consider multiplying x(t) by


an entire train of impulses:

Define
xs (t) = combT [x(t)]
X
= x(t)
(t nT )
n

x(t)(t nT )

X
n

x(nT )(t nT )

28

CHAPTER 1. SIGNALS

Area of each impulse = value of sample there.


The replication operator similarly provides a compact way to express
periodic signals:

xp (t) = repT [x0 (t)] =

x0 (t nT )

Note that x0 (t) = xp (t)rect

 
t
T

Chapter 2

Systems
2.1

Chapter Outline

In this chapter, we will discuss:


1. System Properties
2. Convolution
3. Frequency Response

2.2

Systems

A system is a mapping which assigns to each signal x(t) in the input


domain a unique signal y(t) in the output range.

29

30

CHAPTER 2. SYSTEMS

Examples
Z

t+1/2

1. CT y(t) =

x( )d
t1/2

let x(t) = sin(2f t)


Z t+1/2
y(t) =
sin(2f t)dt
t1/2

1
t+1/2
cos(2f t)|t1/2
=
2f
1
=
{cos[2f (t + 1/2)] cos[2f (t 1/2)]}
2f
use cos( ) = cos cos sin sin
1
{[cos(2f t) cos(f ) sin(2f t) sin(f )]
2f
[cos(2f t) cos(f ) + sin(2f t)sin(f )]}

y(t) =

sin(f )
sin(2f t)
f
= sinc(f )sin(2f t)

y(t) =

Look at particular values of f


f = 0 : x(t) 0

y(t) 0

f = 1 : x(t) = sin(2t)
sinc(1) = 0
y(t) 0

2.2. SYSTEMS

2. DT y(n) =

31

1
[x(n) + x(n 1) + x(n 2)]
3

Effect of filter on output:


1. widened,smoothed, or smeared each pulse
2. delayed pulse train by one sample time

32

CHAPTER 2. SYSTEMS

2.3

System Properties

Notation:
y(t) = S[x(t)]

A. Linearity
def. A system S is linear (L) if for any two inputs x1 (t) and x2 (t) and any
two constants a1 and a2 , it satisfies:
S[a1 x1 (t) + a2 x2 (t)] = a1 S[x1 (t)] + a2 S[x2 (t)]

Special cases:
1. homogeneity (let a2 = 0)
S[a1 x1 (t)] = a1 S[x1 (t)]
2. superposition (let a1 = a2 = 1)
S[x1 (t) + x2 (t)] = S[x1 (t)] + S[x2 (t)]

Examples
Z

t+1/2

y(t) =

x( )d
t1/2

let x3 (t) = a1 x1 (t) + a2 x2 (t)


Z

t+1/2

y3 (t) =

x3 ( )d
t1/2

t+1/2

[a1 x1 ( ) + a2 x2 ( )]d
t1/2

t+1/2

= a1

t+1/2

x1 ( )d + a2
t1/2

x2 ( )d
t1/2

= a1 y1 (t) + a2 y2 (t)
system is linear
We can similarly show that
y(n) = 13 [x(n) + x(n 1) + x(n 2)] is linear.

2.3. SYSTEM PROPERTIES

33

Consider two additional examples:


3. y(n) = nx(n)
let x3 (n) = a1 x1 (n) + a2 x2 (n)
y3 (n) = nx3 (n)
= (a1 nx1 (n) + a2 nx2 (n))
= a1 y1 (n) + a2 y2 (n)
system is linear

1, x(t) < 1
x(t), 1 x(t) 1
y(t) =

1,
1 < x(t)

Suspect that system is nonlinear - find a counterexample.


x1 (t) 1 y1 (t) 1
x2 (t)

1
2

y2 (t)

1
2

x3 (t) = x1 (t) + x2 (t) =

3
2

y3 (t) 1 6=

3
2

system is not linear


Because it is memoryless, this system is completely described by a curve
relating input to output at each time t:

34

CHAPTER 2. SYSTEMS

Importance of linearity: We can represent response to a complex input in


terms of responses to very simple inputs.

B. Time Invariance
def. A system is time-invariant if delaying the input results in only an
identical delay in the output, i.e.
if y1 (t) = S[x1 (t)]
and y2 (t) = S[x1 (t t0 )]
then y2 (t) = y1 (t t0 )
Examples
1. y(n) =

1
[x(n) + x(n 1) + x(n 2)]
3

assume
1
[x1 (n) + x1 (n 1) + x1 (n 2)]
3
let x2 (n) = x1 (n n0 )

y1 (n) =

1
[x2 (n) + x2 (n 1) + x3 (n 2)]
3
1
= [x1 (n n0 ) + x1 (n 1 n0 ) + x1 (n 2 n0 )]
3
1
= [x1 (n n0 ) + x1 (n n0 1) + x1 (n n0 2)]
3
= y1 (n n0 )

y2 (n) =

system is TI.
We can similarly show that

2.3. SYSTEM PROPERTIES


Z

35

t+1/2

2. y(t) =

x( )d is TI
t1/2

3. y(n) = nx(n)
assume y1 (n) = nx1 (n)
let x2 (n) = x1 (n n0 )
y2 (n) = nx2 (n)
= nx1 (n n0 )
6= (n n0 )x1 (n n0 )
system is not TI.

C. Causality
def. A system S is causal if the output at time t depends only on x( ) for
t
Casuality is equivalent to the following property:
If x1 (t) = x2 (t), t t0 then y1 (t) = y2 (t), t t0

D. Stability
def. A system is said to be bounded-input bounded-output (BIBO) stable
if every bounded input produces a bounded output,i.e.
Mx < My < .
Example
1
[x(n) + x(n 1) + x(n 2)]
3
Assume |x(n)| Mx for all n
1. y(n) =

1
|x(n) + x(n 1) + x(n 2)|
3
1
[|x(n)| + |x(n 1)| + |x(n 2)|]
3
Mx

|y(n)| =

36

2.4

CHAPTER 2. SYSTEMS

Convolution

Characterization of behavior of an LTI system


1. Decompose input into sum of simple basis functions xi (n)

x(n) =

N
1
X

ci xi (n)

i=0

y(n) = S[x(n)]
=

N
1
X

ci S[xi (n)]

i=0

2. Choose basis functions which are all shifted versions of a single basis
function x0 (n)
i.e. xi (n) = x0 (n ni )
Let yi (n) = S[xi (n)], i=0,...,N-1
then yi (n) = y0 (n ni )
and y(n) =

N
1
X

ci y0 (n ni )

i=0

3. Choose impulse as basis function


Denote impulse response by h(n).

Now consider an arbitrary input x(n).

2.4. CONVOLUTION

Sum over both the set of inputs and the set of outputs.

x(n) = x(0)(n) + x(1)(n 1) + x(2)(n 2) + x(3)(n 3)


y(n) = x(0)h(n) + x(1)h(n 1) + x(2)h(n 2) + x(3)h(n 3)

37

38

CHAPTER 2. SYSTEMS

Convolution sum
x(n) =

x(k)(n k)

k=

y(n) =

x(k)h(n k)

k=

let ` = n k k = n `

X
X
y(n) =
x(n `)h(`) =
x(n `)h(`)
`=

`=

Notation and identity


For any signals x1 (n) and x2 (n), we use an asterisk to denote their
convolution; and we have the following identity.
x1 (n) x2 (n) =
=

X
k=

x1 (n k)x2 (k)
x1 (k)x2 (n k)

k=

Characterization of CT LTI systems


Approximate x(t) by a superposition of rectangular pulses:

2.4. CONVOLUTION

x (t) =

x(k) (t k)

k=

Find response to a single pulse:

Determine response to x (t):

X
y (t) =
x(k)h (t k)
k=

Let 0 (d ) k
(t) (t) x (t) x(t)
h (t) h(t) y (t) y(t)

Convolution Integral
Z

x( )(t )d

x(t) =
Z

x( )h(t )d

y(t) =

39

40

CHAPTER 2. SYSTEMS

Notation and Identity


For any signals x1 (t) and x2 (t), we use an asterisk to denote their
convolution; and we have the following identity.
Z
x1 (n) x2 (n) =
x1 ( )x2 (t )d

Z
=
x1 (t )x2 ( )d

Example
DT system y(n) =

W 1
1 X
x(n k) W - integer
W
k=0

Find response to x(n) = en/D u(n).


W - width of averaging window
D - duration of input
To find impulse response, let x(n) = (n) h(n) = y(n).

W 1
1 X
1/W, 0 n W 1
h(n) =
(n k) =
0,
else
W
k=0

Now use convolution to find response to x(n) = en/D u(n).

X
y(n) =
x(n k)h(k)
k=

Case 1: n < 0

y(n) = 0

2.4. CONVOLUTION

41

Case 2: 0 n W 1

y(n) =

n
X

x(n k)h(k)

k=0

n
1 X (nk)/D
e
W
k=0

1 n/D X k/D
e
e
W
k=0

Geometrical Series
N
1
X

zk =

k=0

1 zN
, for any complex number z
1z

1
, |z| < 1
1z
k=0


1 n/D 1 e(n+1)/D
y(n) =
e
W
1 e1/D
zk =

Case 3: W n

42

CHAPTER 2. SYSTEMS

y(n) =

W
1
X

x(n k)h(k)

k=0

W 1
1 X (nk)/D
e
W
k=0

W 1
1 n/D X k/D
=
e
e
W
k=0



1 n/D 1 eW/D
e
W
1 e1/D


1 1 e(W/D [n(W 1)]/D
=
e
W 1 e1/D

y(n) =

Puttingeverything together
0,
n<0




1 1 e(n+1)/D
,
0nW 1
y(n) =
W  1 e1/D

(W/D

1 1e

e[n(W 1)]/D , W n
W 1 e1/D

Causality for LTI systems


y(n) =

n
X
k=

x(k)h(n k) +

x(k)h(n k)

k=n+1

System will be causal second sum is zero for any input x(k).
This will be true h(n k) = 0, k = n + 1, ...,

2.4. CONVOLUTION

43

h(k) = 0, k < 0
An LTI system is causal h(k) = 0, k < 0, i.e. the impulse response is
a causal signal.

Stability of LTI systems


Suppose the input is bounded, i.e Mx <

X
x(k)h(n k)
y(n) =
k=

|y(n)| = |

x(k)h(n k)|

k=

|x(k)||h(n k)|

k=

Mx

|h(k)|

k=

Therefore, it is sufficient for BIBO stability that the impulse response be


absolutely summable.
X
Suppose
|h(k)| <
6 .
k

Consider y(0) =

x(k)h(k).


Assuming h(k) to be real-valued, let x(k) =
then y(0) =

1,
1,

h(k) > 0
h(k) < 0

|h(k)| <
6

For an LTI system to be BIBO stable,X


it is necessary that the impulse
response is absolutely summable, i.e.
|h(k)| < .
k

Examples
y(n) = x(n) + y(n 1)
Find the impulse response.
Let x(n) = (n), then h(n) = y(n).
Need to find solution to

44

CHAPTER 2. SYSTEMS

y(n) = (n) = 2y(n 1)


This example differs from earlier ones because the system is recursive, i.e
the current output depends on previous output values as well as the
current and previous inputs.
1. must specify initial conditions for the system (assume y(-1)=0)
2. cannot directly write a closed form expression for y(n)
Find output sequence term by term.
y(0) = (0) + 2y(1) = 1 + 2(0) = 1
y(1) = (1) + 2y(0) = 0 + 2(1) = 2
y(2) = (2) + 2y(1) = 0 + 2(2) = 4
Recognize general form.
h(n) = y(n) = 2n u(n)
1. Assuming system is initially at rest, it is causal
X
2.
|h(n)| <
6 system is not BIBO stable
n

2.5

Frequency Response

We have seen that the impulse signal provides a simple way to


characterize the response of an LTI system to any input. Sinusoids play a
similar role
Consider x(n) = ejn , is fixed
Denote response by y (n)

Now consider

2.5. FREQUENCY RESPONSE

45

Since ejm ejn = ej(n+m)


y (n + m) = y (n)ejm
Let n = 0,
y (m) = y (0)ejm for all m

For a system which is homogeneous and time-invariant, the response to


a complex exponential input x(n) = ejn is y(n) = y (0)x(n), a
frequency-dependent constant times the input x(n). Thus, complex
exponential signals are eigenfunctions of homogeneous, time-invariant
systems.

Comments
We refer to the constant of proportionality as the frequency
response of the system and denote it by
H(ej ) = y (0)
We write it as a function of ej rather than for two reasons:
1. digital frequencies are only unique modulo 2
2. there is a relation between frequency response and the Z
transform that this representation captures
Note that we did not use superposition. We will need it later when
we express the response to arbitrary signals in terms of the
frequency response.

46

CHAPTER 2. SYSTEMS

Magnitude and Phase of Frequency Response


In general, H(ej ) is complex-valued,
i.e. H(ej ) = A()ej()
Thus for x(n) = ejn
y(n) = A()ej[n+()]
Suppose response to any real-valued input x(n) is real-valued.
1
Let x(n) = cos(n) = [ejn + ejn ].
2
Assuming superposition holds,
y(n) =


1
H(ej )ejn + H(ej )ejn
2

[y(n)] =


1
[H(ej )] ejn + [H(ej )] ejn
2

y(n) = [y(n)] H(ej ) = [H(ej ]


Expressed in polar coordinates
A()ej() = A()ej()
A() = A() even
() = () odd
Examples
1
[x(n) + x(n 1)]
2
Let x(n) = ejn
1
y(n) = [ejn + ej(n1) ]
2
1
= [1 + ej ]ejn
2
1
H(ej ) = [1 + ej ]
2
Factoring out the half-angle:
1. y(n) =

1 j/2 j/2
e
[e
+ ej/2 ]
2
= ej/2 cos(/2)

H(ej ) =

2.5. FREQUENCY RESPONSE


|H(ej )| = |ej/2 || cos(/2)|
= | cos(/2)|
H(ej ) = ej/2 + cos(/2)

/2,
cos(/2) 0
H(ej ) =
/2 , cos(/2) < 0

Note:
even symmetry of |H(ej )|
odd symmetry of H(ej )|
periodicity of H(ej ) with period 2
low pass characteristic
1
[x(n) x(n 2)]
2
Let x(n) = ejn
2. y(n) =

1 jn
[e
ej(n2) ]
2
1
= [1 ej2 ]ejn
2

y(n) =

1
[1 ej2 ]
2
1
= jej [ (ej ej )]
j2

H(ej ) =

47

48

CHAPTER 2. SYSTEMS

H(ej ) = jej sin()

|H(ej )| = |j||ej || sin()|


= | sin()|

H(ej ) = j + ej + sin()

/2 ,
sin() 0
H(ej ) =
/2 , sin() < 0

The filter has a bandpass characteristic.


3. y(n) = x(n) x(n 1) y(n 1)
Let x(n) = ejn , how do we find y(n)?
Assume desired form of output,
i.e. y(n) = H(ej )ejn
H(ej )ejn = ejn ej(n1) H(ej )ej(n1)

2.5. FREQUENCY RESPONSE


H(ej )[1 + ej ]ejn = [1 ej ]ejn


1 ej
j
H(e ) =
1 + ej
=

1
jej/2 [ j2
(ej/2 ej/2 )]

ej/2 [ 21 (ej/2 + ej/2 )]


sin(/2)
=j
cos(/2)
= j tan(/2)
|H(ej )| = | tan(/2)|

/2,
tan(/2) 0
H(ej ) =
/2 , tan(/2) < 0

Comments
What happens at = /2?
Factoring out the half-angle is possible only for a relatively
restricted class of filters

49

50

CHAPTER 2. SYSTEMS

Chapter 3

Fourier Analysis
3.1

Chapter Outline

In this chapter, we will discuss:


1. Continuous-Time Fourier Series (CTFS)
2. Continuous-Time Fourier Transform (CTFT)
3. Discrete-Time Fourier Transorm (DTFT)

3.2

Continuous-Time Fourier Series (CTFS)

Spectral representation for periodic CT signals


Assume x(t) = x(t + nT )
We seek a representation for x(t) of the form
x(t) =

N 1
1 X
Ak xk (t) (1a)
T
k=0

xk (t) = cos(2fk t + k ) (1b)


Since x(t) is periodic with period T, we only use the frequency
components that are periodic with this period:
51

52

CHAPTER 3. FOURIER ANALYSIS

How do we choose amplitude Ak and the phase k of each component?


k 6= 0:
Ak xk (t) = Ak cos(2kt/T + k )
Ak jk j2kt/T Ak jk j2kt/T
=
e e
+
e
e
2
2
= Xk ej2kt/T + Xk ej2kt/T
k = 0:
A0 x0 (t) = A0 cos(0 )
= X0

3.2. CONTINUOUS-TIME FOURIER SERIES (CTFS)

53

Given a fixed signal x(t), we dont know at the outset whether an exact
representation of the form given by Eq.(1) even exists.
However, we can always approximate x(t) by an expression of this form.
So we consider
N
1
X
1
Xk ej2kt/T
x
b(t) =
T
k=(N 1)

We want to choose the coefficients Xk so that x


b(t) is a good
approximation to x(t).
Define e(t) = x
b(t) x(t).
Recall
1
Pe =
T

1
=
T

T /2

|e(t)|2 dt

T /2
T /2

|e
x(t) x(t)|2 dt

T /2

2



N
1
X

1
j2kt/T

Xk e
x(t) dt
T
T /2

k=(N 1)

Z
N
1
X
1 T /2 1
=
Xk ej2/pikt/T x(t)
T T /2 T
k=(N 1)

N
1
X
1

X` ej2`t/T x (t) dt
T
1
=
T

T /2

`=(N 1)

("
#
Z
N 1
1 T /2
1 X
j2kt/T
Pe =
Xk e
T T /2
T
k=N +1
"
#
N 1
1 X
j2`t/T

X` e
T
`=N +1
"
#
N 1
1 X
j2/pikt/T

Xk e
x (t)
T
k=N +1
"
#
)
1 X
j2`t/T

x(t)
X` e
+ x(t)x (t) dt
T
`=N +1

54

CHAPTER 3. FOURIER ANALYSIS

1
Pe = 3
T
1
2
T

N
1
X

N
1
X

Xk X`

T /2

ej2(kl)t/T dt

T /2

k=N +1 `=N +1
N
1
X

T /2

Xk

x (t)ej2kt/T dt

T /2

k=N +1

Z T /2
N
1
X
1

2
X`
x(t)ej2lt/T dt
T
T
/2
`=N +1
Z T /2
1
+
|x(t)|2 dt
T T /2

T /2

j2(kl)t/T

T /2

T /2

T
j2(kl)t/T
e
dt =

j2(k l)
T /2
h
i
T
=
e[j(k`)] e[j(k`)]
j2(k `)
= T sinc(k `)

T, k = l
=
0, k 6= l

T /2

x(t)ej2lt/T dt.

el =
Let X
T /2

Pe =

1
T2

N
1
X

n
o
e X X
e k + Px
|x(k)|2 Xk X
k
k

N +1

Xk -unknown coefficients in the Fourier Series approximation


ek -fixed numbers that depend on x(t)
X
We want to choose values for the coefficients Xk ,k = N + 1, ..., N 1
which will minimize Pe .
Fix l between N + 1 and N 1.
Let Xl = Al + jBl .
and consider

Pe
Al

and

Pe
Bl

3.2. CONTINUOUS-TIME FOURIER SERIES (CTFS)

Pe =

1
T2

N
1
X

55

n
o
ek Xk X
e k + Px
|X(k)|2 Xk X

k=N +1

o
1 Pe n
Pe
el (Al jBl )X
el
= 2
(Al + jBl )(Al jBl ) (Al + jBl )X
Al
T Al
o
1 n
el X
el
= 2 Xl + Xl X
T
n
o
2
el
= 2 Re X l X
T
n o
Pe
el
= 0 Re {Xl } = Re X
Al
Similarly
Pe
1
el + j X
el
= 2 jXl jXl j X
Bl
T
n
o
2
el Xl
= j 2 Im X
T
and
n o
Pe
el
= 0 Im {Xl } = Im X
Bl
To summarize
N 1
1 X
For x
b(t) =
Xk ej2kt/T
T
k=N +1

to be a minimum mean-squared error approximation to the signal x(t)


over the interval T /2 t T /2, the coefficients Xk must satisfy
Z T /2
Xk =
x(t)ej2kt/T dt
T /2

Example

56

CHAPTER 3. FOURIER ANALYSIS

T /2

x(t)ej2kt/T dt

Xk =
T /2

/2

=A

ej2kt/T dt

/2

A
ej2kt/T
j2kt/T
A
=
[ejk /T ejk /T ]
j2k/T
sin(k /T )
= A
k /T
=

Line spectrum
Xk = A sinc(k /T )

|Xk | = |A sinc(k /T )| Xk =

0,
sinc(k /T ) > 0
, sinc(k /T ) < 0

3.3. CONTINUOUS-TIME FOURIER TRANSFORM


Comments
Z

57

T /2

x(t)ej2kt/T dt

Recall Xk =
T /2

T /2

1. X0 =

x(t)dt = T xavg
T /2

2. Xk = 0, k 6= 0
3. lim |Xk | = 0
T

What happens as N increases?


N 1
1 X
Let x
bN (t) =
Xk ej2kt/T
T
k=N +1

T /2

|x(t)|2 dt < ,

1. If
T /2

T /2

|b
xN (t) x(t)|2 dt 0

T /2

T /2

|x(t)|dt < and other Dirichilet conditions are met,

2. If
T /2

x
bN (t) x(t) for all t where x(t) is continuous
3. In the neighborhood of discontinuities, x
bN (t) exhibits an overshoot
or undershoot with maximum amplitude equal to 9 percent of the
step size no matter how large N is (Gibbs phenomena)

3.3

Continuous-Time Fourier Transform

Spectral representation for aperiodic CT signals


Consider a fixed signal x(t) and let xp (t) = repT [x(t)].

58

CHAPTER 3. FOURIER ANALYSIS

What happens to the Fourier series as T increases?


= T /2

= T /4

Fourier coefficients
Z

T /2

Xk =
T /2

Let T .

x(t)ej2kt/T dt

3.3. CONTINUOUS-TIME FOURIER TRANSFORM


k/T f
Xk X(f )
Z
X(f ) =
x(t)ej2f t dt

Fourier series expansion


xp (t) =

1X
Xk ej2kt/T
T

Let T .
xp (t) x(t)
k/T f Xk X(f )
Z

1 X

df
T

k=
Z
x(t) =
X(f )ej2f t df

Fourier Transform pairs


Forward transform
Z
X(f ) =
x(t)ej2f t dt

Inverse Transform
Z
x(t) =
X(f )ej2f t df

Sufficient conditions for Existence of CTFT


1. x(t)
Z has finite energy
|x(t)|2 dt <

2. x(t)
Z is absolutely integrable
|x(t)|dt <

and it satisfies Dirichlet conditions

59

60

CHAPTER 3. FOURIER ANALYSIS

Transform relations
Linearity
CT F T

a1 x1 (t) + a2 x2 (t) a1 X1 (f ) + a2 X2 (f )
Scaling and shifting


t t0 CT F T
x
|a|X(af )ej2f t0
a
Modulation
x(t)ej2f0 t

CT F T

X(f f0 )

Reciprocity
CT F T

X(t) x(f )
Parsevals relation
Z
Z
|x(t)|2 dt =
|X(f )|2 df

Initial value
Z
x(t)dt = X(0)

Comments
1. Reflection is a special case of scaling and shifting with a = 1 and
t0 = 0, i.e.
CT F T
x(t) X(f )
2. The scaling relation exhibits reciprocal spreading
3. Uniqueness of the CTFT follows from Parsevals relation

CTFT for real signals


If x(t) is real, X(f ) = [X(f )] .
|X(f )| = |X(f )| and Xf = X(f )
In this case, the inverse transform may be written as:
Z
|X(f )| cos[2f t + X(f )]df
x(t) = 2
0

3.3. CONTINUOUS-TIME FOURIER TRANSFORM


Additional symmetry relations:
x(t) is real and even X(f ) is real and even.
x(t) is real and odd X(f ) is real and odd.

Important transform pairs:


CT F T

rect(t) sinc(f )

CT F T

(t) 1

Proof

(by sifting property)

F {(t)} =

(t)ej2f t dt = 1

CT F T

1 (f ) (by reciprocity)

ej2f0 t

CT F T

(f f0 ) (by modulation property)

61

62

CHAPTER 3. FOURIER ANALYSIS

CT F T

cos(2f0 t)

1
[(f f0 ) + (f + f0 )]
2

Generalized Fourier transform


Note that (t) is absolutely integrable but not square integrable.
 
t
1
Consider (t) = rect
.
T

Z
| (t)|dt = 1

| (t)|2 dt =

| (t)|2 dt =

lim

The function x(t) 1 is neither absolutely nor square integrable; and the
integral
Z
1ej2f t dt is undefined.

Even when neither condition for existence of the CTFT is satisfied, we


may still be able to define a Fourier transform through a limiting process.
Let xn (t), n = 0, 1, 2, ... denote a sequence of functions each of which has
a valid CTFT Xn (f ).
Suppose lim xn (t) = x(t), that function does not have a valid transform.
n

If X(f ) = lim Xn (f ) exists, we call it the generalized Fourier transform


n

3.3. CONTINUOUS-TIME FOURIER TRANSFORM


of x(t) i.e.
CT F T

x0 (t) X0 (f )
CT F T

x1 (t) X1 (f )
CT F T

x2 (t) X2 (f )
x(t)

GCT F T

X(f )

Example
Let xn (t) = rect(t/n).
Xn (f ) = nsinc(nf ) (by scaling)
lim xn (t) = 1

What is lim Xn (f )?
n

Xn (f ) 0, f 6= 0
Xn (0)
Z
What is
Xn (f )df ?

By the initial value relation


Z
Xn (f )df = xn (0) = 1

lim Xn (f ) = (f )
n

and we have
1

GCT F T

(f )

63

64

CHAPTER 3. FOURIER ANALYSIS

Efficient calculation of Fourier transforms


Suppose we wish to determine the CTFT of the following signal.

Brute force approach:


1. EvaluateZtransform integral directly
Z 2
0
j2f t
X(f ) =
(1)e
dt +
(1)ej2f t dt
2

2. Collect terms and simplify

Faster approach
1. Write x(t) in terms of functions whose transforms are known


x(t) = rect

t+1
2


+ rect

t1
2

2. Use transform relations to determine Xf


X(f ) = 2 sinc(2f )[ej2f ej2f ]
X(f ) = j4 sinc(2f )sin(2f )

3.3. CONTINUOUS-TIME FOURIER TRANSFORM

65

Comments
1. Ax = 0 and X(0) = 0
2. x(t) is real and odd and X(f ) is imaginary and odd

CTFT and CT LTI systems


The key factor that made it possible to express the response y(t) of an
LTI system to an arbitrary input x(t) in terms of the impulse response
h(t) was the fact that we could write x(t) as the superposition of
impulses (t).
We can similarly express x(t) as a superposition of complex exponential
signals:
Z
x(t) =
X(f )ej2f t df

e ) denote the frequency response of the system, i.e. for a fixed


Let H(f
frequency f.

66

CHAPTER 3. FOURIER ANALYSIS

then by homogeneity

and by superposition

Thus, the response to x(t) is


Z
e )X(f )ej2f t dt
H(f
y(t) =

But also
Z

y(t) =

Y (f )ej2f t dt

e )X(f ) (1)
Y (f ) = H(f
We alsoZ know that

y(t) =
h(t )x( )d

e )?
What is the relation between h(t) and H(f
Let x(t) = (t) y(t) = h(t)
then X(f ) = 1 and Y (f ) = H(f ).
e ) = H(f )
From Eq(1), we conclude that H(f
Since the frequency response is the CTFT of the impulse response, we
will drop the tilde.
Summarizing, we have two equivalent characterizations for CT LTI

3.3. CONTINUOUS-TIME FOURIER TRANSFORM


systems.
Z
y(t) =

h(t )x( )d

Y (f ) = X(f )H(f )

Convolution Theorem
Since x(t) and h(t) are arbitrary signals, we also have the following
Fourier transform relation
Z
CT F T
x1 ( )x2 (t )d X1 (f )X2 (f )
CT F T

x1 (t) x2 (t) X1 (f )X2 (f )

Product Theorem
By reciprocity, we also have the following result:
CT F T

x1 (t)x2 (t) X1 (f ) X2 (f )
This can be very (
useful for calculating transforms of certain functions.
1
[1 + cos(2t)], |t| 1/2
Example x(t) =
2
0,
|t| > 1/2
Find X(f )

1
[1 + cos(2t)]rect(t)
2


1
1
X(f ) =
(f ) + [(f 1) + (f + 1)] sinc(f )
2
2
Since convolution obeys linearity, we can write this as
x(t) =

67

68

CHAPTER 3. FOURIER ANALYSIS

1
X(f ) =
2


1
(f ) sinc(f ) + [(f 1) sinc(f ) + (f + 1) sinc(f )]
2

All three convolutions here are of the same general form.

Identity
For any signal w(t),
w(t) (t t0 ) = w(t t0 )
Proof:
w(t) (t t0 ) =

w( )(t t0 )d = w(t t0 ) (by sifting property)

Using the identity,




1
1
X(f ) =
(f ) sinc(f ) + [(f 1) sinc(f ) + (f + 1) sinc(f )]
2
2


1
1
=
sinc(f ) + [sinc(f 1) + sinc(f + 1)]
2
2

Fourier transform of Periodic Signals


We previously developed the Fourier series as a spectral
representation for periodic CT signals
Such signals are neither square integrable nor absolutely integrable,
and hence do not satisfy the conditions for existence of the CTFT
By applying the concept of the generalized Fourier transform, we
can obtain a Fourier transform for periodic signals

3.3. CONTINUOUS-TIME FOURIER TRANSFORM

69

This allows us to treat the spectral analysis of all CT signals within


a single framework
We can also obtain the same result directly from the Fourier series
Let x0 (t) denote one period of a signal that is periodic with period T, i.e.
x0 (t) = 0, |t| > T /2.
Define x(t) = repT [x0 (t)].
The fourier series representation for x(t) is
1X
x(t) =
Xk ej2kt/T
T
k

Taking the CTFT directly, we obtain


(
)
1X
j2kt/T
X(f ) = F
Xk e
T
k
n
o
1X
=
Xk F ej2kt/T (by linearity)
T
k
1X
Xk (f k/T )
=
T
k

Also
Z

T /2

x(t)ej2kt/T dt

Xk =
T /2
Z

x0 (t)ej2kt/T dt

= X0 (k/T )
Thus
X(f ) =

1X
X0 (k/T )(f k/T )
T
k

1
= comb T1 [X0 (f )]
T
Dropping the subscript 0, we may state this result in the form of a
transform relation:
CT F T

repT [x(t)]

1
comb T1 [X(f )]
T

70

CHAPTER 3. FOURIER ANALYSIS

For our derivation, we required that x(t) = 0, |t| > t/2. However, when
the generalized transform is used to derive the result, this restriction is
not needed.

Example

3.4

Discrete-Time Fourier Transform

Spectral representation for aperiodic DT signals


As in the CT case, we may derive the DTFT by starting with a
spectral representation (the discrete-time Fourier series) for
periodic DT signals and letting the period become infinitely long
Instead, we will take a shorter but less direct approach
Recall the continuous-time fourier series:

1 X
x(t) =
Xk ej2kt/T (1)
T
k=

3.4. DISCRETE-TIME FOURIER TRANSFORM


Z

71

T /2

x(t)ej2kt/T dt (2)

Xk =
T /2

Before, we interpreted (1) as a spectral representation for the CT


periodic signal x(t).
Now lets consider (2) to be a spectral representation for the sequence
Xk , < k < .
We are effectively interchanging the time and frequency domains.
We want to express an arbitrary signal x(n) in terms of complex
exponential signals of the form ejn .
Recall that is only unique modulo 2.
To obtain this, we make the following substitutions in (2).
Z T /2
Xk =
x(t)ej2kt/T dt
T /2

kn
T x(t) X(ej )
2t/T
Xk x(n)
T
d
dt 2

x(n) =

1
2

X(ej )ejn d

This is the inverse transform.


To obtain the forward transform, we make the same substitution in (1).
x(t) =

1 X
Xk ej2kt/T
T
k=

T x(t) X(ej )
kn
Xk x(n)
2t/T
X(ej ) =

X
n=

x(n)ejn

72

CHAPTER 3. FOURIER ANALYSIS

Putting everything together

X(ej ) =

x(n)ejn

n=

1
2

x(n) =

X(ej )ejn d

Sufficient conditions for existence


X
|x(n)|2 < or
n

|x(n)| < plus Dirichlet conditions.

Transform Relations
1. linearity
a1 x1 (n) + a2 x2 (n)

DT F T

a1 X1 (ej ) + a2 X2 (ej )

2. shifting
x(n n0 )

DT F T

X(ej )ejn0

DT F T

X(ej(0 ) )

3. modulation
x(n)ej0 n

4. Parsevals relation

|x(n)|2 =

n=

1
2

5. Initial value

X
n=

x(n) = X(ej0 )

|X(ej )|2 d

3.4. DISCRETE-TIME FOURIER TRANSFORM

73

Comments
1. As discussed earlier, scaling in DT involves sampling rate changes;
thus, the transform relations are more complicated than in CT case
2. There is no reciprocity relation, because time domain is a
discrete-parameter whereas frequency domain is a
continuous-parameter
3. As in CT case, Parsevals relation guarantees uniqueness of the
DTFT

Some transform pairs


1. x(n) = (n)
X(ej ) =

(n)ejn

= 1 (by sifting property)

2. x(n) = 1
does not satisfy existence conditions
X

ejn does not converge in ordinary sense


n

cannot use reciprocity as we did for CT case


Consider inverse transform
Z
1
x(n) =
X(ej )ejn d
2
What function X(ej ) would yield x(n) 1?

74

CHAPTER 3. FOURIER ANALYSIS


Let X(ej ) = 2(), ,
Z
1
2()ejn d = 1 (again by sifting property).
then x(n) =
2
Note that X(ej ) must be periodic with period 2, so we have:
X
X(ej ) = 2
( 2k)
k

3. ej0 n

DT F T

4. cos(0 n)


5. x(n) =

rep2 [2( 0 )] (by modulation property)

DT F T

rep2 [( 0 ) + ( + 0 )]

1, 0 n N 1
0, else

X(ej ) =

N
1
X

ejn

n=0

1 ejN
1 ej

= ej(N 1)/2

6. y(n) =

sin(N/2)
sin(/2)

1, (N 1)/2 n (N 1)/2
0, else

3.4. DISCRETE-TIME FOURIER TRANSFORM

75

N is odd
y(n) = x(n + (N 1)/2) where x(n) is signal from Example 5
Y (ej ) = X(ej )ej(N 1)/2 (by sifting property)


j(N 1)/2 sin(N/2)
= e
ej(N 1)/2
sin(/2)
Y (ej ) =

sin(N/2)
sin(/2)

What happens as N ?
y(n) 1
< n <
2/N 0
Y (ej ) rep2 [2()]
Z
1
Y (ej )d = y(0)
2

DTFT and DT LTI systems


Recall that in CT case we obtained a general characterization in terms of
CTFT by expressing x(t) as a superposition of complex exponential
signals and then using frequency response H(f) to determine response to
each such signal.
Here we take a different approach.
For any DT LTI system, we know that input and output are related by
X
y(n) =
h(n k)x(k)
k

76

CHAPTER 3. FOURIER ANALYSIS

Thus
Y (ej ) =

y(n)ejn

XX
n

(
X X
X

)
h(n k)e

jn

x(k)

h(n k)x(k)ejn

H(ej )ejk x(k)

(by sifting property)

where H(ej ) is the DTFT of the impulse response h(n).


Rearranging,
Y (ej ) = H(ej )

x(k)ejk

k
j

= H(e )X(ej )
How is H(ej ) related to the frequency response?
Consider
x(n) = ej0 n
X(ej ) = rep2 [2( 0 )]
X(ej ) + 2

( 0 2k)

Y (ej ) = H(ej )X(ej )


X
= 2
H(ej0 =2k )( 0 2k)
k

= H(e

j0

)2

( 0 2k)

Y (ej ) = H(ej0 )X(ej )


y(n) = H(ej0 )x(n)

3.4. DISCRETE-TIME FOURIER TRANSFORM

77

so H(ej ) is also the frequency response of the DT system.


We thus have two equivalent characterizations for the response y(n) of a
DT LTI system to any input x(n).
y(n) =

h(n k)x(k)

Y (ej ) = H(ej )X(ej )

Convolution Theorem
Since x(n) and h(n) are arbitrary signals, we also have the following
transform relation:
X
DT F T
x1 (k)x2 (n k) X1 (ej )X2 (ej )
k

or
x1 (n) x2 (n)

DT F T

X1 (ej )X2 (ej )

Product theorem
As mentioned earlier, we do not have a reciprocity relation for the DT
case.
However, by direct evaluation of the DTFT, we also have the following
result:
Z
DT F T 1
x1 (n)x2 (n)
X1 (ej() )X2 (ej )d
2
Note that this is periodic convolution.

78

CHAPTER 3. FOURIER ANALYSIS

Chapter 4

Sampling
4.1

Chapter Outline

In this chapter, we will discuss:


1. Analysis of Sampling
2. Relation between CTFT and DTFT
3. Sampling Rate Conversion (Scaling in DT)

4.2

Analysis of Sampling

A simple scheme for sampling a waveform is to gate it.

T - period
- interval for which switch is closed
/T - duty cycle
xs (t) = s(t)x(t)
79

80

CHAPTER 4. SAMPLING

Fourier Analysis
Xs (f ) = S(f ) X(f )


s(t) = repT 1 rect t
1
comb T1 [sinc( f )]
T
1X
=
sinc( k/T )(f k/T )
T

S(f ) =

Xs (f ) =

1
T

sinc( k/T )X(f k/T )

How do we reconstruct x(t) from xs (t)?

4.2. ANALYSIS OF SAMPLING

Nyquist condition
Perfect reconstruction of x(t) from xs (t) is possible if
X(f ) = 0, |f | 1/(2T )
Nyquist sampling rate
1
fs =
= 2W
T

Ideal Sampling
What happens as 0?
X
s(t)
(t mT )
m

xs (t)

x(mT )(t mT ) = combT [x(t)]

Xs (f )

1X
1
X(f k/T ) = rep T1 [X(f )]
T
T
k

An ideal lowpass filter will again reconstruct x(t)


In the sequel, we assume ideal sampling

81

82

CHAPTER 4. SAMPLING

Transform Relations
1
comb T1 [X(f )]
T
CT F T 1
combT [x(t)]
rep T1 [X(f )]
T
CT F T

repT [x(t)]

Given one relation, the other follows by reciprocity.

Whittaker-Kotelnikov-Shannon Sampling Expansion


Xr (f ) = Hr (f )Xs (f )
Hr (f ) = T rect(T f )
xr (t) = hr (t) xs (t)
hr (t) = X
sinc(t/T )
xs (t) =
x(mT )(t mT )
m


X
t mT
xr (t) =
x(mT )sinc
T
m

xr (nT ) =

x(mT )sinc(n m)

= x(nT )

4.2. ANALYSIS OF SAMPLING

83

If Nyquist condition is satisfied, xr (t) x(t).

Zero Order Hold Reconstruction

xr (t) =


x(mT )rect

t T /2 mT
T

= hZO (t) xs (t)



hr (t) = rect

t T /2
T

Xr (f ) = HZO (f )Xs (f )
HZO (f ) = T sinc(T f )ej2f (T /2)

84

CHAPTER 4. SAMPLING

One way to overcome the limitations of zero order hold


reconstruction is to oversample, i.e. choose fs = 1/T >> W
This moves spectral replications farther out to where they are
better attenuated by sinc(Tf)
What happens if we inadvertently undersample, and then
reconstruct with an ideal lowpass filter?

4.2. ANALYSIS OF SAMPLING

Effect of undersampling
frequency truncation error
Xr (f ) = 0,

|f | fs /2

aliasing error
Frequency components at f1 = fs /2 + fold down to and mimic
frequencies f2 = fs /2 .

Example
x(t) = cos[2(5000)t]
sample at fs = 8 kHz
reconstruct with ideal lowpass filter having cutoff at 4 kHz

Sampling
xr (t) = cos[2(3000)t]
Note that x(t) and xr (t) will have the same sample values at times
t = nT (T=1/(8000)).
x(nT ) = cos {2(5000)n/8000}
= cos {2(5000)n/8000}
= cos {2[(5000)n0(8000)n]/8000}
= cos {2(3000)n/8000}
= xr (nT )

85

86

Reconstruction

CHAPTER 4. SAMPLING

4.3. RELATION BETWEEN CTFT AND DTFT

4.3

Relation between CTFT and DTFT

We have already shown that


Xs (fa ) =

1
rep T1 [X(fa )]
T

Suppose we evaluate the CTFT of xs (t) directly


(
)
X
Xs (fa ) = F
xa (nT )(t nT )
n

xa (nT )F {(t nT )}

Xs (fa ) =

xa (nT )ej2fa nT

Recall
Xd (ejd )

X
n

xd (n)ejd n

87

88

CHAPTER 4. SAMPLING

But xd (n) = xa (nT ).


Let d = 2fa T = 2(fa /fs ).
 
d
Rearranging as fa =
fs , we obtain
2
h  i
d
Xd (ejd ) = Xs
fs
2

Example
CT Analysis
xa (t) = cos(2fa0 t)
1
Xa (fa ) = [(fa fa0 ) + (fa + fa0 )]
2
Xs (fa ) = fs repfs [Xa (fa )]
fs X
=
[(fa fa0 kfs ) + (fa + fa0 kfs )]
2
k

4.3. RELATION BETWEEN CTFT AND DTFT

89

DT Analysis
xd (n) = xa (nT )
= cos(2fa0 nT )
= cos(d0 n)
d0 = 2fa0 T = 2(fa0 /fs )
X
X(ejd ) =
[(d d0 2k) + (d + d0 2k)]
k

Relation between CT and DT Analyses


h  i
d
Xd (ejd ) = Xs
fs
2
fs X
Xs (fa ) =
[(fa fa0 kfs ) + (fa + fa0 kfs )]
2
k
 



fs X
d fs
d fs
jd
Xd (e ) =

fa0 kfs +
+ fa0 kfs
2
2
2
k

Recall (ax + b) =

1
(x + b/a).
|a|




2fa0
k2fs
fs X 2
d

2
fs
fs
fs
k



2
2fa0
k2fs
+
d +

fs
fs
fs
X
=
[(d d0 2k) + (d + d0 2k)]

Xd (ejd ) =

Aliasing
CT
fa1 = fs /2 + a folds down to fa2 = fs /2 a .
DT

Let d = 2

fa
fs


d = 2

a
fs

d1 = + d is identical to d2 = d .

90

4.4

CHAPTER 4. SAMPLING

Sampling Rate Conversion

Recall definitions for DT scaling.

Downsampling
y(n) = x(Dn)

Upsampling

y(n) =

x(n/D), if n/D is an integer


0,
else

4.4. SAMPLING RATE CONVERSION

91

In CT, we have avery


 simple transform relation for scaling:
f
CT F T 1
x(at)
X
|a|
a

What is the transform relation for DT?


1. As in definitions for downsampling and upsampling, we must treat
these cases separately
2. Relations will combine elements from both scaling and sampling
transform relations for CT

Downsampling
y(n) = x(Dn)
X
Y (ej ) =
x(Dn)ejn
n

let m = Dn n = m/D
X
Y (ej ) =
x(m)ejm/D (m/D is an integer)
m

To removerestrictions on m, define a sequence:


1, m/D is an integer
sD (m) =
0, else
then

92

CHAPTER 4. SAMPLING
Y (ej ) =

sD (m)x(m)ejm/D

Alternate expression for sD (m):


D=2
1
[1 + (1)m ]
2
1
= [1 + ej2m/2 ]
2

s2 (m) =

s2 (0) = 1
s2 (1) = 0
s2 (m + 2k) = s(m)
D=3
s3 (m) = 31 [1 + ej2m/3 + ej2(2)m/3 ]
s3 (0) = 31 [1 + 1 + 1] = 1
s3 (1) = 13 [1 + ej2/3 + ej2(2)/3 ] = 0

s3 (2) = 13 [1 + ej2(2)/3 + ej2(4)/3 ] = 0


s3 (m + 3k) = s3 (m)
In general,
sD (m) =

D1
1 X j2km/D
e
D
k=0

1 1 ej2m
=
D 1 ej2m/D

4.4. SAMPLING RATE CONVERSION



sD (m) =

1,
0,

Y (ej ) =

m/D is an integer
else
X

sD (m)x(m)ejm/D

X
X 1 D1
ej2km/D x(m)ejm/D
D
m
k=0

1
D
1
D

D1
XX

x(m)ej[(+2k)/D]m

k=0 m
D1
X
k=0

X(ej(+2k)/D )

93

94

CHAPTER 4. SAMPLING

Decimator
To prevent aliasing due to downsampling, we prefilter the signal to
bandlimit it to highest frequency d = /D.
The combination of a low pass filter followed by a downsampler is
referred to as a decimator.

4.4. SAMPLING RATE CONVERSION

With prefilter

Without prefilter

Upsampling

y(n) =

x(n/D), n/D is an integer


0,
else

Y (ej ) =

x(n/D)ejn

(n/D) is an integer

sD (n)x(n/D)ejn

Let m = n/D n = mD
X
Y (ej ) =
sD (mD)x(m)ejmD but sD (mD) 1
m

Y (ej ) = X(ejD )

95

96

CHAPTER 4. SAMPLING

Interpolator
To interpolate between the nonzero samples generated by upsampling, we
use a low pass filter with cutoff at d = /D.
The combination of an upsampler followed by a low pass filter is referred
to as an interpolator.

4.4. SAMPLING RATE CONVERSION


Time Domain Analysis of an Interpolator
y(n) =

v(k)h(n k)

v(k) = sD (k)x(k/D)
let ` = k/D k = `D
X
y(n) =
x(`)h(n `D)
`

1
2

1
=
2

h(n) =

H(ej )ejn d

/D

ejn d

/D





1


CTFT1 rect

2
2/D
t=n/2


2  n 
1 2
sinc
=
2 D
D 2


1
n
= sinc
D
D
=

y(n) =

x(`)h(n `D)

X
`


x(`)sinc

n `D
D

97

98

CHAPTER 4. SAMPLING

Chapter 5

Z Transform (ZT)
5.1

Chapter Outline

In this chapter, we will discuss:


1. Derivation of the Z transform
2. Convergence of the ZT
3. ZT properties and pairs
4. ZT and linear, constant coefficient difference equations
5. Inverse Z transform
6. General Form of Response of LTI Systems

5.2

Derivation of the Z Transform

1. Extension of DTFT
2. Transform exists for a larger class of signals than does DTFT
3. Provides an important tool for characterizing behavior of LTI
systems with rational transfer functions
Recall sufficient conditions for existence of the DTFT
99

100

CHAPTER 5. Z TRANSFORM (ZT)


1.

|x(n)|2 <

2.

or
X

|x(n)| <

By using impulses we were able to define the DTFT for periodic


signals which satisfy neither of the above conditions

Example 1
Consider x(n) = 2n u(n)

It also satisfies neither condition for existence of the DTFT.


Define x
e(n) = rn x(n),

r>2

5.2. DERIVATION OF THE Z TRANSFORM

101

Now

|e
x(n)| =

n=0

|rn x(n)|

n=0

(2/r)n

n=0

X
n=0

|e
x(n)| =

1
, (2/r) = 1 or r > 2
1 2/r

DTFT of x
e(n) exists

X
e j ) =
X(e
x
e(n)ejn
n=0

e j ) =
X(e

[2(rej )1 ]n

n=0

1
, |2(rej )1 | < 1 or r > 2
1 2(rej )1

e j ) in terms of x(n)
Now lets express X(e
e j ) =
X(e
=

X
n=0

rn x(n)ejn
x(n)(rej )n

n=0

Let z = rej and define the Z transform (ZT) of x(n) to be the DTFT of
x(n) after multiplication by the convergence factor rn u(n).
e j ) =
X(z) = X(e

x(n)z n

For the example x(n) = 2n u(n).


X(z) =

1
,
1 2z 1

|z| > 2

It is important to specify the region of convergence since the transform is


not uniquely defined without it.

102

CHAPTER 5. Z TRANSFORM (ZT)

Example 2
Let y(n) = 2n u(n 1)

Y (z) =

y(n)z n

1
X

2n z n

n=

Y (z) =
=
=

1
X

(z/2)n

n=

(z/2)n

n=1

(z/2)n + 1

n=0

Y (z) = 1

1
, |z/2| < 1 or |z| < 2
1 z/2

z/2
1 z/2
1
=
, |z| < 2
1 2z 1

Y (z) =

So we have
ZT
x(n) = 2n u(n) X(z) =

1
, |z| > 2
1 2z 1
1
ZT
y(n) = 2n u(n 1) Y (z) =
, |z| < 2
1 2z 1

5.3. CONVERGENCE OF THE ZT


1. The two transforms have the same functional form
2. They differ only in their regions of convergence

Example 3
w(n) = 2n , < n <

w(n) = x(n) y(n)


By linearity of the ZT,
W (z) = X(z) Y (z)
1
1
=

=0
1 2z 1
1 2z 1
But note that X(z) and Y (z) have no common region of convergence.
Therefore, there is no ZT for
w(n) = 2n , < n <

5.3

Convergence of the ZT

1. A series

X
n=0

un

103

104

CHAPTER 5. Z TRANSFORM (ZT)

is said to converge to U if given any real  > 0, there exists an


M such
that
integer
1

NX


un U <  for all N > M



n=0

2. Here the sequence un and the limit U may be either real or complex
3. A sufficient condition for convergence of the series

un is that of

n=0

absolute convergence i.e.

|un | <

n=0

4. Note that absolute convergence is not necessary for ordinary


convergence as illustrated by the following example
The series

(1)n

n=0

1
= ln(2)
n

is convergent, whereas the series

X
1
is not.
n
n=1

5. However, when we discuss convergence of the Z transform, we


consider only absolute convergence Thus, we say that
X
X(z) =
x(n)z n
n

converges at z = z0 if
X
X
x(n)z n =
|x(n)|r0n <
0
n

where r0 = |z0 |

Region of Convergence for ZT


As a consequence of restricting ourselves to absolute convergence, we
have the following properties:

5.3. CONVERGENCE OF THE ZT

105

P1. If X(z) converges at z = z0 , then it converges for all z for which


|z| = r0 , where r0 = |z0 |.
Proof:
X
X
x(n)z n =
|x(n)|rn
0

< by hypothesis
P2. If x(n) is a causal sequence, i.e. x(n) = 0, n < 0, and X(z) converges
for |z| = r1 , then it converges for all Z such that |z| = r > r1 .
Proof:

X
X

x(n)z n =
|x(n)|rn
n=0

<

n=0

|x(n)|r1n

n=0

< by hypothesis
P3. If x(n) is an anticausal sequence, i.e. x(n) = 0, n > 0 and X(z)
converges for |z| = r2 , then it converges for all z such that |z| = r < r2 .
Proof:
0

X

X
x(n)z n =
|x(n)|rn
n=

<

n=0

|x(n)|r2n

n=0

< by hypothesis
P4. If x(n) is a mixed causal sequence, i.e. x(n) 6= 0 for some n < 0 and
x(n) 6= 0 for some n > 0, and X(z) converges for some |z| = r0 , then
there exists two positive reals r1 and r2 with r1 < r0 < r2 such that X(z)
converges for all z satisfying r1 < |z| < r2 .
Proof:
Let x(n) = x (n) + x+ (n) where x (n) is anticausal and x+ (n) is causal.
Since X(z) converges for |z| = r0 , X (z) and X+ (z) must also both

106

CHAPTER 5. Z TRANSFORM (ZT)

converge for |z| = r0 .


From properties 2 and 3, there exist two positive reals r1 and r2 with
r1 < r0 < r2 such that X (z) converges for |z| < r2 and X+ (z) converges
for |z| > r1 .
The ROC for X(z) is just the intersection of these two ROCs.

Example 3
x(n) = 2|n| u(n)
X(z) =

2|n| z n

=
=

1
X

2n z n +

n=

X
1

(2

2n z n

n=0

z)n 1 +

n=0

(21 z 1 )n

n=0

1
1
=
1+
1 21 z
1 21 z 1
|21 z| <
|21 z 1 | <
|z| < 2

Combining everything
3z 1 /2
X(z) =
,
1 5z 1 /2 + z 2

|z| > 1/2

1/2 < |z| < 2

5.4. ZT PROPERTIES AND PAIRS

5.4

107

ZT Properties and Pairs

Transform Relations
1. Linearity
ZT

a1 x1 (n) + a2 x2 (n) a1 X1 (z) + a2 X2 (z)


2. Shifting
ZT

x(n n0 ) z n0 X(z)
3. Modulation
ZT

z0n x(n) X(z/z0 )


4. Multiplication by time index
ZT

nx(n) z

d
[X(z)]
dz

5. Convolution
ZT

x(n) y(n) X(z)Y (z)


6. Relation to DTFT
If XZT (z) converges for |z| = 1, then the DTFT of x(n) exists and
XDT F T (ej ) = XZT (z)|z=ej

Important Transform Pairs


ZT

1. (n) 1,
ZT

2. an u(n)

all z
1
,
1 az 1
ZT

3. an u(n 1)
ZT

4. nan u(n)

|z| > a

1
,
1 az 1

az 1

2,

(1 az 1 )
ZT

5. nan u(n 1)

az 1

|z| < a
|z| > a

2,

(1 az 1 )

|z| < a

108

5.5

CHAPTER 5. Z TRANSFORM (ZT)

ZT,Linear Constant Coefficient


Difference Equations

1. From the convolution property, we obtain a characterization for all


LTI systems

impulse response: y(n) = h(n) x(n)


transfer function: Y (z) = H(z)X(z)
2. An important class of LTI systems are those characterized by
linear, constant coefficient difference equations
M
N
X
X
y(n) =
ak x(n k)
h` y(n `)
k=0

`=1

nonrecursive
N =0
always finite impulse response (FIR)
recursive
N >0
usually infinite impulse response (IIR)
3. Take ZT of both sides of the equation
M
N
X
X
y(n) =
ak x(n k)
b` y(n `)
Y (z) =

k=0
M
X

`=1
N
X

ak z k X(z)

k=0

`=1
M
X

H(z) =

Y (z)
=
X(z)

b` z ` Y (z)

ak z k

k=0
N
X

1+

`=1

b` z `

5.5. ZT,LINEAR CONSTANT COEFFICIENT DIFFERENCE EQUATIONS109


4. M N
Multiply numerator and denominator by z M .
M
X
ak z M k
"k=0

H(z) =
z

M N

N
X

b` z

N `

`=1

5. M < N
Multiply numerator and denominator by z N .
M
X
z N M
ak z M k
H(z) =
zN +

k=0
N
X

b` z N `

`=1

6. By the fundamental theorem of algebra, the numerator and


denominator polynomials may always be factored
M N
M
Y

H(z) =
M <N
H(z) =

(z zK )

k=1

z M N

QN

`=1 (z

p` )

QM
z N M k=1 (z zk )
N
Y
(z p` )
`=1

7. Roots of the numerator and denominator polynomials:


zeros z1 , ..., zM
poles p1 , ..., pN
If M N , have M N additional poles at |z| =
If M < N , have N M additional zeros at z = 0
8. The poles and zeros play an important role in determining system
behavior

Example
1
y(n) = x(n) + x(n 1) y(n 2)
2

110

CHAPTER 5. Z TRANSFORM (ZT)

1
Y (z) = X(z) + z 1 X(z) z 2 Y (z)
2
1 + z 1
Y (z)
=
H(z) =
X(z)
1 + 21 z 2
zeros : z1 = 0 z2 = 1

poles : p1 = j/ 2 p2 = j/ 2

z(z + 1)
z 2 + 1/2
z(z + 1)

=
(z j/ 2)(z + j/ 2)

H(z) =

Effect of Poles and Zeros on Frequency Response


Frequency response H(ej )
CT F T

h(n) HDT F T (ej ) = H(ej )


ZT

h(n) HZT (z)


HDT F T (ej ) = HZT (ej )

Let z = ej .

5.5. ZT,LINEAR CONSTANT COEFFICIENT DIFFERENCE EQUATIONS111


H(ej ) = HZT (ej )
Assume M < N .
M
Y
z N M
(z zk )
k=1

H(z) =

N
Y

(z p` )

`=1
ej(N M )

M
Y

(ej zk )

k=1

H(ej ) =

N
Y

(ej p` )

`=1
M
Y

|H(ej )| =

k=1
N
Y

|ej zk |
|ej p` |

`=1

H(ej ) = (N M ) +

M
X
k=1

(ej zk )

N
X

(ej p` )

`=1

Example
z(z + 1)

(z j/ 2)(z + j/ 2)
|ej + 1|

|H(ej )| =
j
|e j/ 2||ej + j/ 2|

H(ej ) = + (ej + 1) (ej j/ 2) (ej + j/ 2)


Contribution from a single pole
H(z) =

112

CHAPTER 5. Z TRANSFORM (ZT)

=0

|H(ej0 )| =
|~a| = 2
|~b| = 1q
|~c| =

~ =
|d|

1+
q

|~
a||~b|
~
|~
c||d|

1
2

3
2

3
2

|H(ej0 )| = 43 = 1.33
H(ej0 ) = ~a + ~b ~c d~
~a = 0
~b = 0
 
~c = arctan 12
d~ = ~c
H(ej0 ) = 0
= /4

|H(ej/4 )| =
r
|~a| =
1+
|~b| = 1

|~
a||~b|
~
|~
c||d|
1
2

2

1
2

= 1.85

5.5. ZT,LINEAR CONSTANT COEFFICIENT DIFFERENCE EQUATIONS113


|~c| =
~ =
|d|

r2

2
2

2

1
2

2

5
2

|H(ej/4 )| = 1.65
H(ej/4 ) = ~a + ~b ~c d~
~a = 22.5
~b = 45
~c = 0
d~ = 63.4
H(ej/4 ) = 4.1
= /2

|H(ej/2 )| =

|~a| = 2
|~b| = 1
|~c| = 1 12
~ = 1 + 1
|d|

|~
a||~b|
~
|~
c||d|

|H(ej/2 )| = 2.83
H(ej/4 ) = ~a + ~b ~c d~
~a = 45
~b = 90
~c = 90
d~ = 90
H(ej/2 ) = 45

General Rules
1. A pole near the unit circle will cause the frequency response to
increase in the neighborhood of that pole

114

CHAPTER 5. Z TRANSFORM (ZT)

2. A zero near the unit circle will cause the frequency response to
decrease in the neighborhood of that zero

5.6

Inverse Z Transform

1. Formally, the
I inverse ZT may be written as
1
x(n) = j2
X(z)z n1 dz
c

where the integration is performed in a counter-clockwise direction


around a closed contour in the region of convergence of X(z) and
encircling the origin.
2. If X(z) is a rational function of z, i.e. a ratio of polynomials, it is
not necessary to evaluate the integral
3. Instead, we use a partial fraction expansion to express X(z) as a
sum of simple terms for which the inverse transform may be
recognized by inspection
4. The ROC plays a critical role in this process
5. We will illustrate the method via a series of examples

Example 1
The signal x(n) = (1/3)n u(n) is input to a DT LTI system described by
y(n) = x(n) x(n 1) + (1/2)y(n 1)

Find the output y(n).


What are our options?
direct substitution
Assume y(1) = 0.
y(0) = x(0) x(1) + (1/2)y(1) = 1 0 + (1/2)(0) = 1.000
y(1) = x(1) x(0) + (1/2)y(0) = 1/3 1 + (1/2)(1.0) = 0.167
y(2) = x(2) x(1) + (1/2)y(1) = 1/9 1/3 + (1/2)(0.167) = 0.306
y(3) = x(3)x(2)+(1/2)y(2) = 1/271/9+(1/2)(0.306) = 0.227

5.6. INVERSE Z TRANSFORM

115

convolution
y(n) =

h(n k)x(k)

k=

Find impulse response by direct substitution.


h(n) = (n) (n 1) + (1/2)h(n 1)
h(0) = 1 0 + (1/2)(0) = 1
h(1) = 0 1 + (1/2)(1) = 1/2
h(2) = 0 0 + (1/2)(1/2) = 1/4
h(3) = 0 0 + (1/2)(1/4) = 1/8
Recognize h(n) = (n) (1/2)n u(n 1).
y(n) =

h
X

i
(n k) (1/2)(nk) u(n k 1) (1/3)k u(k)

k=

= (1/3)n u(n) (1/2)n

n1
X

(2/3)k u(n 1)

k=0

(2/3)n
u(n)
1 2/3
= 4(1/3)n u(n) 3(1/2)n u(n)
n

= (1/3) u(n) (1/2)

n1

DTFT
x(n) = (1/3)n u(n)
X(ej ) =

1
1 13 ej

h(n) = (n) (1/2)n u(n 1)





1
H(e ) = 1
1
1 12 ej
j

1 ej
1 12 ej

116

CHAPTER 5. Z TRANSFORM (ZT)


Y (ej ) = H(ej )X(ej )
=
=

1
y(n) =
2

1 ej
(1

1 j
)(1 13 ej )
2e
j

1e
1 56 ej + 61 ej2

1 ej
ejn d
1 56 ej + 61 ej2

ZT
x(n) = (1/3)n u(n)
X(z) =

1
,
1 13 z 1

|z| >

1
3

y(n) = x(n) x(n 1) + (1/2)y(n 1)


Y (z) = X(z) z 1 X(z) + (1/2)z 1 Y (z)
H(z) =

1 z 1
Y (z)
=
X(z)
1 12 z 1

What is the region of convergence?


Since system is causal, h(n) is a causal signal.
H(z) converges for |z| > 1/2.

Y (z) = H(z)X(z)
=

(1

1 z 1
13 z 1 )

1 1
)(1
2z

ROC[Y (z)] = ROC[H(z)] ROC[X(z)]


= z : |z| > 1/2

5.6. INVERSE Z TRANSFORM

117

Partial Fraction Expansion (PFE)


(Two distinct poles)
1

1 z 1
A1
A2

=
+
1 12 z 1
1 13 z 1
1 13 z 1

1 1
2z

To solve for A1 and A2 , we multiply both sides by 1 21 z 1


to obtain


1 z 1 = A1 1 31 z 1 + A2 1 12 z 1
A1 = 3

1 = A1 + A2
13 A1

1 =

12 A2

A2 = 4

so
(1

3
4
1 z 1
=
+
check
13 z 1 )
1 12 z 1
1 13 z 1

1 1
)(1
2z



1 z 1 = 3 1 31 z 1 + 4 1 12 z 1
Now
y(n) = y1 (n) + y2 (n)
Possible ROCs
where
3
1
1 1 , |z| < 2 or |z| >
1 2z
4
1
Y2 (z) =
1 1 , |z| < 3 or |z| >
1 3z
Y1 (z) =

1
2
1
3

1 13 z 1

118

CHAPTER 5. Z TRANSFORM (ZT)

and
ROC[Y (z)] = ROC[Y1 (z)] ROC[Y2 (z)]


1
= z : |z| >
2
Recall transform pairs:
1
|z| > |a|
1 az 1

ZT

an u(n)

ZT

an u(n 1)
ZT 1
3

1 1
1 2 z

ZT
4

1 31 z 1


1 n
2


1 n
3

1
|z| < |a|
1 az 1

u(n)

u(n)

and
 n
 n
1
1
u(n) + 4
u(n)
y(n) = 3
2
3
Consider again
1 z 1


1
1 13 z 1
3
4
=
+
1 12 z 1
1 13 z 1

Y (z) =

1 1
2z

There are 3 possible ROCs for a signal with this ZT.

5.6. INVERSE Z TRANSFORM


Case II:
1
1
< |z| <
3
2
Possible ROCs
3
1
, |z| < or |z| >
Y1 (z) =
2
1 12 z 1
4
1
Y2 (z) =
, |z| < or |z| >
3
1 13 z 1

119

1
2
1
3

and
ROC[Y (z)] = ROC[Y1 (z)] ROC[Y2 (z)]


ROC[Y1 (z)] = z : |z| < 12


ROC[Y2 (z)] = z : |z| > 13
 n
3
1
ZT 1

3
u(n 1)
2
1 12 z 1
 n
1
4
ZT 1
u(n)
1 1 4 3
1 3z
 n
 n
1
1
y(n) = 3
u(n 1) + 4
u(n)
2
3
Case III:
1
|z| <
3


1
ROC[Y1 (z)] = z : |z| <
2


1
ROC[Y2 (z)] = z : |z| <
3
 n
1
1
3
ZT
3
u(n 1)
2
1 12 z 1
 n
4
1
ZT 1

4
u(n 1)
3
1 13 z 1
 n
 n
1
1
y(n) = 3
u(n 1) 4
u(n 1)
2
3

120

CHAPTER 5. Z TRANSFORM (ZT)

Summary of Possible ROCs and Signals


1 z 1


Y (z) = 
1
1
1 z 1
1 z 1
2
3

1
3

ROC
< |z|
< |z| <
|z| < 13
1
2

1
2

n Signal n
3 12 u(n) + 4 31 u(n)
n
n
3 12 u(n 1) + 4 13 u(n)
n
n
3 21 u(n 1) 4 13 u(n 1)

Residue Method for Evaluating Coefficients of PFE


1 z 1
A1
A2

=
+
1 12 z 1
1 13 z 1
1
1 13 z 1




1 1
Y (z)
A1 = 1 z
2
z= 12

1 z 1
=
1 13 z 1 z= 1

Y (z) =

1 1
2z

12
=
1 2/3
= 3




1
1 z 1 Y (z)
3
z= 13

1 z 1
=
1 12 z 1 z= 1

A2 =

13
=
1 3/2
=4

5.6. INVERSE Z TRANSFORM

121

Example 2 (complex conjugate poles)

1 + 12 z 1
(1 jz 1 ) (1 + jz 1 )
A1
A2
X(z) =
+
1 jz 1
1 + jz 1

Y (z) =


1 + 12 z 1
A1 =
1 + jz 1 z=j


1
1
=
1 j
2
2

1 + 12 z 1
A2 =
1 jz 1 z=j


1
1
1+ j
=
2
2
check


j
1
1 12 j
2 1+ 2
+
=
1 jz 1
1 + jz 1

1
2




1 + jz 1 + 12 1 + 2j 1 jz 1
(1 jz 1 ) (1 + jz 1 )
1 1
1 + 2z
=
(1 jz 1 )(1 + jz 1 )
1
2

1 12 j

Note that A1 = A2
This is necessary for y(n) to be real-valued
Use it to save computation

122

CHAPTER 5. Z TRANSFORM (ZT)

Example 3 (poles with multiplicity greater than 1)


Y (z) =

1 + z 1
2
1 12 z 1 (1 z 1 )

1
< |z| < 1
2
recall
az 1

ZT

nan u(n)

(1 az 1 )

2,

|z| > |a|

Try
A1
A2
1 + z 1
=

 +
1 1 2
1 1 2
1
1

z 1
1 2z
1 2z
(1 z )

1 + z 1
A1 =
= 3
1 z 1 z= 1
2

1 + z 1
A2 =
=8
2
1 12 z 1 z=1
check
3
1 12 z 1

2 +

3(1 z 1 ) + 8(1 z 1 + 41 z 2 )
8
=
2
1 z 1
1 12 z 1 (1 z 1 )
=

5 5z 1 + 2z 2

1 12 z 1 (1 z 1 )

6=

1 + z 1
2
1 12 z 1 (1 z 1 )

General form of terms in PFE for pole p` with multiplicity m`

5.6. INVERSE Z TRANSFORM


A` , m` 1
A` , m`
A` , 1
m +
m` 1 + ... + (1 p z 1 )
1
(1 p` z 1 ) `
`
(1 p` z )
Now we have
1 + z 1
A1,2
A1,1
A2
+
=
+


2
2
1
1
1 z 1
1 2z
1 12 z 1 (1 z 1 )
1 12 z 1
A1,2 = 3, A2 = 8
2
To solve for A1,1 , multiply both sides by 1 21 z 1 .
2


1 12 z 1
1 + z 1
1 1
=
A
+
A
z
+
A
1

1,2
1,1
2
1 z 1
2
1 z 1
differentiate with respect to z 1




2
1
1 1
+
A
z
P (z)
1

=
0
+
A
1,1
2
2
2
2
(1 z 1 )
1
let z =
2
2
A1,1 = 2
2 = 4
(1 2)

Example 4
(numerator degree denominator degree)
Y (z) =

1 + z 2
1 12 z 1 12 z 2

reduce degree of numerator by long division so


3 z 1
1 + z 2
=
2
+
1 12 z 1 21 z 2
1 12 z 1 12 z 2
In general, we will have a polynomial of degree M N .
M
N
X
k=0

ZT 1

Bk z k

M
N
X
k=0

Bk (n k)

123

124

CHAPTER 5. Z TRANSFORM (ZT)

5.7

General Form of Response of LTI


Systems

If both X(z) and H(z) are rational


Y (z) = H(z)X(z)



PH (z)
PX (z)
=
QH (z) QX (z)

PH (z)
PX (z)

= N
N

H
X
Y

Y



H 1
X 1
1 p` z
1 p` z
`=1

Y (z) =

`=1

PY (z)
Ny

1 pY` z 1

`=1

PY (z) = PH (z)PX (z)


NY = NH + NX
X
pY` is a combined set of poles pH
` and p` .

Drop superscript/subscript Y.
Accounting for poles with multiplicity > 1
Y (z) =

P (z)
D
Y

1 p` z 1

m `

`=1

D - number of distinct poles


N=

D
X

m`

`=1

For M < N
Y (z) =

m`
D X
X
`=1 k=1

A`k
(1 p` z 1 )

5.7. GENERAL FORM OF RESPONSE OF LTI SYSTEMS

125

Each term under summation will give rise to a term in the output
y(n)
It will be causal or anticausal depending on location of pole relative
to ROC
Poles between origin and ROC result in causal terms
Poles separated from origin by ROC result in anticausal terms
For simplicity, consider only causal terms in what follows

Real pole with multiplicity 1


A
1 pz 1

ZT 1

Apn u(n)

126

CHAPTER 5. Z TRANSFORM (ZT)

Complex conjugate pair of poles with multiplicity 1


A
A
+
1
1 pz
1 p z 1

ZT 1

Apn u(n) + A (p )n u(n)



[Apn + A (p )n ] u[n] = |A|ejA (|p|ejp )n + |A|ejA (|p|ejp )n u(n)
= 2|A||p|n cos(pn + A)u(n)
sinusoid with amplitude 2|A||p|n
1. grows exponentially if |p| > 1
2. constant if p = 1
3. decays exponentially if |p| < 1
digital frequency d = p radians/sample
phase A

Examples

5.7. GENERAL FORM OF RESPONSE OF LTI SYSTEMS

127

Real Pole with multiplicity 2


A
(1

2
pz 1 )

ZT 1

?
ZT

Recall nan u(n)

az 1

2 , |z| > |a|


(1 az 1 )
"
#
A
pz 1
A
n+1
u(n + 1)
2 = (A/p)z
2 p (n + 1)p
1
1
(1 pz )
(1 pz )

A
(n + 1)pn+1 u(n + 1) = A(n + 1)pn u(n)
p

Example (A=1)

Similar results are obtained with complex conjugate poles that have
multiplicity 2
In general, repeating a pole with multiplicity m results in
multiplication of the signal obtained with multiplicity 1 by a
polynomial in n with degree m 1

128

CHAPTER 5. Z TRANSFORM (ZT)

Example
A
(1

ZT 1

3
pz 1 )

A(n + 1)(n + 2)pn u(n)

Stability Considerations
A system is BIBO stable if every bounded input produces a
bounded output
X
A DT LTI system is BIBO stable
|h(n)| <
n

|h(n)| < H(z) converges on the unit circle

A causal DT LTI system is BIBO stable all poles of H(z) are


strictly inside the unit circle

Stability and the general form of the response


1. real pole with multiplicity 1
Apn u(n) is bounded if |p| 1
2. complex conjugate pair of poles with multiplicity 1
2|A||p|n cos(pn + A)u(n) is bounded if p| 1
3. real pole with multiplicity 2
A(n + 1)pn u(n) is bounded if |p| < 1

Chapter 6

Discrete Fourier
Transform (DFT)
6.1

Chapter Outline

In this chapter, we will discuss:


1. Derivation of the DFT
2. DTFT Properties and Pairs
3. Spectral Analysis via the DFT
4. Fast Fourier Transform (FFT) Algorithm
5. Periodic Convolution

6.2

Derivation of the DFT

Summary of Spectral Representations


Signal Type
CT, Periodic
CT, Aperiodic
DT, Aperiodic
DT, Periodic

Transform
CT Fourier Series
CT Fourier Transform
DT Fourier Transform
Discrete Fourier Transform
129

Frequency Domain
Discrete
Continuous
Continuous
Discrete

130

CHAPTER 6. DISCRETE FOURIER TRANSFORM (DFT)

Computation of the DTFT


X(ej ) =

x(n)ejn

n=

In order to compute X(ej ), we must do two things:


1. Truncate summation so that it ranges over finite limits
2. Discretize = k
Suppose we choose

x(n), 0 n N 1
1. x
e(n) =
0,
else
2. k = 2k/N, k = 0, ..., N 1
then we obtain
N
1
X
e
X(k)

x
e(n)ej2kn/N
n=0

This is the forward DFT. To obtain the inverse DFT, we could discretize
the inverseZDTFT:
2
1
x(n) = 2
X(ej )ejn d
0
2k
N

k =
Z 2
N 1
2 X
d
N
0
k=0

e
X(ej ) X(k)
ejn ej2k/N
This results in
x(n)

N 1
1 X e
X(k)ej2kn/N
N
k=0

Note approximation sign


e
1. truncated x(n) so X(k)
X(ej2k/N )
2. approximated integral by a sum

6.2. DERIVATION OF THE DFT

131

Alternate approach
Use orthogonality of complex exponential signals
Consider again
e
X(k)
=

N
1
X

x
e(n)ej2kn/N

n=0

For fixed 0 m N 1, multiply both sides by ej2km/N and sum


over k
N
1
X

j2km/N
e
X(k)e
=

k=0

N
1
X

"N 1
X

k=0

n=0

N
1
X

x
e(n)

j2km/N
e
=
X(k)e

k=0


x
e(n)

N
1
X

N 1
1 X e
X(k)ej2km/N
N
k=0

Summarizing
X(k) =

N
1
X

x(n)ej2kn/N

n=0

x(n) =

N 1
1 X
X(k)ej2kn/N
N
k=0

where we have dropped the tildes

ej2km/N

ej2k(nm)/N

1 ej2(nm)
1 ej2(nm)/N

x
e(n)N (n m)

= Nx
e(m)

x
e(m) =

N
1
X

n=0

n=0

k=0

x
e(n)e

N
1
X
n=0

N
1
X

#
j2kn/N

132

6.3

CHAPTER 6. DISCRETE FOURIER TRANSFORM (DFT)

DFT Properties and Pairs

1. Linearity
DF T

a1 x1 (n) + a2 x2 (n) a1 X1 (k) + a2 X2 (k)


2. Shifting
DF T

x(n n0 ) X(k)ej2kn0 /N
3. Modulation
DF T

x(n)ej2k0 n/N X(k k0 )


4. Reciprocity
DF T

X(n) N x(k)
5. Parsevals relation
N
1
X

|x(n)|2 =

n=0

N 1
1 X
|X(k)|2
N
k=0

6. Initial value
N
1
X

x(n) = X(0)

n=0

7. Periodicity
x(n + mN ) = x(n)for all integers m
X(k + `N ) = X(k) for all integers `
8. Relation to DTFT of a finite length sequence
Let x0 (n) 6= 0 only for 0 n N 1
x0 (n)
Define x(n) =

DT F T

X0 (ej )

x0 (n + mN )

m
DF T

x(n) X(k)
Then X(k) = X0 (ej2k/N )

6.3. DFT PROPERTIES AND PAIRS

133

Transform Pairs
1. x(n) = (n),

X(k) = 1,

0nN 1

0 k N 1 (by relation to DTFT)

2. x(n) = 1, 0 n N 1
X(k) = N k, 0 k N 1 (by reciprocity)

3. x(n) = ej2k0 n , 0 n N 1
X(k) = N (k k0 ), 0 k N 1 (by modulation property)
4. x(n) = cos(2k0 n/N ), 0 n N 1
N
X(k) =
[(k k0 ) + (k (N k0 ))] ,
2


5. x(n) =
X(k) = ej

0k N 1

1, 0 n M 1, 0 n N 1
0, else
2k
N (M 1)/2

sin[2kM/(2N )]
(by relation to DTFT)
sin[2k/(2N )]

134

6.4

CHAPTER 6. DISCRETE FOURIER TRANSFORM (DFT)

Spectral Analysis Via the DFT

An important application of the DFT is to numerically determine the


spectral content of signals. However, the extent to which this is possible
is limited by two factors:
1. Truncation of the signal - causes leakage
2. Frequency domain sampling - causes picket fence effect

Truncation of the Signal


Let x(n) = cos(0 n)
Recall that
X(ej ) = rep2 [( 0 ) + ( + 0 )]

1, 0 n N 1
0, else
sin(N/2)
Recall W (ej ) = ej(N 1)/2
sin(/2)
Note that W (ej ) = W (ej(+2m) ) for all integers m.
Also, let w(n) =

Now let xt (n) = x(n)w(n)

t-truncated

6.4. SPECTRAL ANALYSIS VIA THE DFT

135

By the product theorem


Z
1
Xt (ej ) =
W (ej() )X(ej )d
2
Z
1
=
W (ej() )rep2 [( 0 ) + ( + 0 )]d
2
Z
1
W (ej() )[( 0 ) + ( + 0 )]d
Xt (e ) =
2
Z
1
W (ej() )( 0 )d
=
2
Z
+
W (ej() )( + 0 )d
j

Xt (ej ) =

1
2



W (ej(0 ) ) + W (ej(+0 ) )

Frequency Domain Sampling


Let
xr (n) =

xt (n + mN )

r-replicated

Recall from relation between DFT and DTFT of finite length sequence
that
Xr (k) = Xt (ej2k/N )
i
1h
W (ej(2k/N 0 ) ) + W (ej(2k/N +0 ) )
=
2
Consider two cases:

136

CHAPTER 6. DISCRETE FOURIER TRANSFORM (DFT)

1. 0 = 2k0 /N for some integer k0


Example: k0 = 1, N = 8, 0 = /4
i
1 h
Xr (k) =
W (ej2(kk0 )/N ) + W (ej2(k+k0 )/N )
2
Example: k0 = 1, N = 8

In this case:
N
Xr (k) =
[(k k0 ) + (k (N k0 ))] , 0 k N 1
2
as shown before. There is no picket fence effect.
2. 0 = 2k0 /N + /N for some integer k0
Example: k0 = 1, N = 8, 0 = 3/8

6.5. FAST FOURIER TRANSFORM (FFT) ALGORITHM

137

Picket fence effect:


Spectral peak is midway between sample locations
Each sidelobe peak occurs at a sample location
1. Both truncation and picket fence effects are reduced by increasing N
2. Sidelobes may be supressed at the expense of a wider mainlobe by
using a smoothly tapering window

6.5

Fast Fourier Transform (FFT)


Algorithm

The FFT is an algorithm for efficient computation of the DFT. It is not a


new transform.
Recall
X (N ) (k) =

N
1
X

x(n)ej2kn/N , k = 0, 1, ..., N 1

n=0

Superscript (N) is used to show the length of the DFT. For each value of
k, computation of X(k) requires N complex multiplications and N-1
additions.
Define a complex operation (CO) as 1 complex multiplication and 1
complex addition.
Computation of length N DFT then requires approximately N 2 COs.
To derive an efficient algorithm for computation of the DFT, we employ a
divide-and-conquer strategy.

138

CHAPTER 6. DISCRETE FOURIER TRANSFORM (DFT)

Assume N is even.
X (N ) (k) =

N
1
X

x(n)ej2kn/N

n=0

N
1
X

X (N ) (k) =

N
1
X

x(n)ej2kn/N +

n=0,even

x(n)ej2kn/N

n=0,odd

N/21

x(2m)ej2k(2m)/N

m=0
N/21

x(2m + 1)ej2k(2m+1)/N

m=0

X (N ) (k) =
N/21
X
X
x(2m)ej2km/(N/2) + ej2k/N
x(2m + 1)ej2km/(N/2)

N/21

m=0

m=0

m = 0, ..., N/2 1

Let x0 (n) = x(2m),


x1 (n) = x(2m + 1),

m = 0, ..., N/2 1

Now have
(N/2)

X (N ) (k) = X0
(N/2)

(N/2)

(k) + ej2k/N X1

(k), k = 0, ..., N 1

(N/2)

(k) and X1
(k) are both periodic with period N/2,
Note that X0
while ej2k/N is periodic with period N.

Computation
Direct
X (N ) (k), k = 0, ..., N 1

N 2 COs

Decimation by a factor of 2
(N/2)

(k), k = 0, ..., N/2 1

N 2 /4 COs

(N/2)

(k), k = 0, ..., N/2 1

N 2 /4 COs

X0
X1

(N/2)

X (N ) (k) = X0
COs

(N/2)

(k) + ej2k/N X1

(k), k = 0, ..., N 1

6.5. FAST FOURIER TRANSFORM (FFT) ALGORITHM


Total

N 2 /2 + N COs

For large N, we have nearly halved computation.


Consider a signal flow diagram of what we have done so far:

If N is even,we can repeat the idea with each N/2 pt. DFT:

If N = 2M , we repeat the process M times reulting in M stages.

139

140

CHAPTER 6. DISCRETE FOURIER TRANSFORM (DFT)

The first stage consists of 2 point DFTs:


X (2) (k) =

1
X

x(n)ej2kn/2

n=0

X (2) (0) = x(0) + x(1)


X (2) (1) = x(0) x(1)

Flow diagram of 2 pt. DFT Full example for N=8(M=3)

6.5. FAST FOURIER TRANSFORM (FFT) ALGORITHM

141

Ordering of Input Data

Computation (N = 2M )
M = log2 N stages
N COs/stage
Total: Nlog2 N COs

Comments
The algorithm we derived is the decimation-in-time radix 2 FFT
1. input in bit-reversed order

142

CHAPTER 6. DISCRETE FOURIER TRANSFORM (DFT)


2. in-place computation
3. output in normal order
The dual of the above algorithm is the decimation-in-frequency
radix 2 FFT
1. input in normal order
2. in-place computation
3. output in normal order
The same approaches may be used to derive either
decimation-in-time or decimation-in-frequency mixed radix FFT
algorithms for any N which is a composite number
All FFT algorithms are based on composite N and require O(N log
N) computation
The DFT of a length N real signal can be expressed in terms of a
length N/2 DFT

6.6

Periodic Convolution

We developed the DFT as a computable spectral representation for DT


signals. However, the existence of a very efficient algorithm for calculating
it suggests another application. Consider the filtering of a length N signal
x(n) with an FIR filter containing M coefficients, where M << N
y(n) =

M
1
X

h(m)x(n m)

m=0

Computation of each output point requires M multiplications and M-1


additions.
Based on the notion that convolution in the time domain corresponds to
multiplication in the frequency domain, we perform the following
computations:
Compute X (n) (k) N log2 N COs
Extend h(n) with zeros to length N and compute
H (N ) (k) N log2 N COs
Multiply the DFTs

6.6. PERIODIC CONVOLUTION


Y (N ) (k) = H (N ) (k)X (N ) (k) N complex mutliplications
Compute inverse DFT


ye(n) = DF T 1 Y (N ) (k) N log2 N COs
Total: 3N log2 N COs + N complex multiplications
The computation/output point is 3 log2 N COs+ 1 complex
multiplication.

How Periodic Convolution Arises


Consider inverse DFT of product Y [k] = H[k]X[k]
y(n) =

N 1
1 X
H[k]X[k]ej2kn/N
N
k=0

Substitute for X[k] in terms of x[n]


(N 1
)
N 1
X
1 X
j2km/N
H[k]
x[m]e
ej2kn/N
y(n) =
N
m=0
k=0

Interchange order of summations


)
( N 1
N
1
X
1 X
j2k(nm)/N
H[k]e
y(n) =
x[m]
N
m=0
k=0

N
1
X

x[m]h[n m]

m=0

Note periodicity of sequence h[n]


h[n m] = h[(n m) mod N ]

143

144

CHAPTER 6. DISCRETE FOURIER TRANSFORM (DFT)

Periodic vs. Aperiodic Convolution


Aperiodic convolution

y[n] = h[n] x[n] =

h[n m]x[m]

m=

Periodic convolution (N=9)

y[n] = h[n] x[n] =

N
1
X
m=0

h[(n m)modN ]x[m]

6.6. PERIODIC CONVOLUTION

Comparison
Aperiodic convolution

145

146

CHAPTER 6. DISCRETE FOURIER TRANSFORM (DFT)

Periodic convolution (N = 9)

Zero Padding to Match Aperiodic Convolution


Suppose x[n] has length N and h[n] has length M. Periodic convolution
with length M+N-1 will match aperiodic result

Chapter 7

Digital Filter Design


7.1

Chapter Outline

In this chapter, we will discuss:


1. Overview of filter design problem
2. Finite impulse response filter design
3. Infinite impulse response filter design

7.2

Overview

Filter design problem consists of three tasks


1. Specification - What frequency response or other
characteristics of the filter are desired?
2. Approximation - What are the coefficients or, equivalently,
poles and zeros of the filter that will approximate the desired
characteristics?
3. Realization - How will the filter be implemented?
Consider a simple example to illustrate these tasks.

147

148

CHAPTER 7. DIGITAL FILTER DESIGN

Filter Design Example


An analog signal contains frequency components ranging from DC
(0 Hz) to 5 kHz
Design a digital system to remove all but the frequencies in the
range 2-4 kHz
Assume signal will be sampled at 10 kHz rate

Specification
Ideal analog filter

Ideal digital filter

7.2. OVERVIEW

Filter Tolerance Specification

pl , pu - lower and upper passband edges


sl , su - lower and upper stopband edges
l , u - lower and upper stopband ripple
 - passband ripple

Approximation
Design by positioning poles and zeros (PZ plot design)

149

150

CHAPTER 7. DIGITAL FILTER DESIGN


Transfer function for PZ plot filter



z ej/10 z ej3/10 z ej9/10


H(z) = K
z 0.8ej5/10 z 0.8ej7/10



z ej/10 z ej3/10 z ej9/10



z 0.8ej5/10 z 0.8ej7/10
Choose constant K to yield unity magnitude response at center of
passband
Frequency response of PZ plot filter

Comments on PZ plot design


1. Passband asymmetry is due to extra zeros in lower stopband
2. Phase is highly nonlinear
3. Zeros on unit circle drive magnitude response to zero and
result in phase discontinuities
4. Pole-zero plot yields intuition about filter behavior, but does
not suggest how to meet design specifications:

7.2. OVERVIEW

151

Realization
Cascade form of transfer function



z ej/10 z ej3/10 z ej9/10


H(z) = K
z 0.8ej5/10 z 0.8ej7/10



z ej/10 z ej3/10 z ej9/10



z 0.8ej5/10 z 0.8ej7/10

Cascade Form Realization


Cascade form in second order sections with real-valued coefficients
H(z) = K[z 2 2 cos(/10)z + 1]


z 2 2 cos(3/10)z + 1
2
z 1.6 cos(5/10)z + 0.64


z 2 2 cos(9/10)z + 1
2
z 1.6 cos(7/10)z + 0.64
Convert to negative powers of z
H(z) = K[1 2 cos(/10)z 1 + z 2 ]


1 2 cos(3/10)z 1 + z 2

1 1.6 cos(5/10)z 1 + 0.64z 2




1 2 cos(9/10)z 1 + z 2
1 1.6 cos(7/10)z 1 + 0.64z 2
(Ignoring overall time advance of 2 sample units)
Overall System

152

CHAPTER 7. DIGITAL FILTER DESIGN

Second order stages


Hi (z) =

1 + a1i z 1 + a2i z 2
, i = 1, 2, 3
1 b1i z 1 b2i z 2

yi [n] = xi [n] + a1i xi [n 1] + a2i xi [n 2] + b1i yi [n 1] + b2i yi [n 2]

Parallel Form Realization


Expand transfer function in partial fractions
H(z) =
a01 + a11 z 1
a02 + a12 z 1
d0 + d1 z 1 + d2 z 2 +
+
1
2
1 b11 z b21 z
1 b12 z 1 b22 z 2

7.2. OVERVIEW

Direct Form Realization


Multiply out all factors in numerator and denominator of transfer
function
a0 + a1 z 1 + ... + a6 z 6
H(z) =
1 b1 z 1 ... b4 z 4

153

154

CHAPTER 7. DIGITAL FILTER DESIGN

7.3

Finite Impulse Response Filter Design

Ideal Impulse Response


Consider same ideal frequency response as before

Inverse DTFT
Z
1
h[n] =
H()ejn d
2 (
)
Z 2/5
Z 4/5
1
jn
jn
h[n] =
e d +
e d
2
4/5
2/5

h[n] =

i h
io
1 nh j2n/5
e
ej4n/5 + ej4n/5 ej2n/5
j2n

h[n] =
i
h
io
1 n j3n/5 h jn/5
e
e
ejn/5 + ej3n/5 ejn/5 ejn/5
j2n

n
 n 
1
1
+ ej3n/5 sinc
h[n] = ej3n/5 sinc
5
5
5
5
h[n] = 0.4 cos(3n/5)sinc(n/5)

7.3. FINITE IMPULSE RESPONSE FILTER DESIGN

155

Approximation of Desired Filter Impulse Response by


Truncation
FIR filter equation
y[n] =

M
1
X

am x[n m]

m=0

Filter coefficients (assuming M is odd)


am = hideal [m (M 1)/2], m = 0, ..., M 1

Truncation of Impulse Response

156

CHAPTER 7. DIGITAL FILTER DESIGN

Frequency Response of Truncated Filter


Analysis of Truncation
ideal infinite impulse response - hideal [n]
Actual, finite impulse response - hactual [n]
Windowsequence - w[n]
1 , |n| (M 1)/2
w[n] =
0 , else
Relation between ideal and actual impulse responses
hactual [n] = hidealZ[n]w[n]

1
Hactual () =
Hideal ()W ( )d
2

7.3. FINITE IMPULSE RESPONSE FILTER DESIGN

Effect of Filter Length

DTFT of Rectangular Window


n=(M 1)/2

W () =

ejn

n=(M 1)/2

let m=n+(M-1)/2
=

M
1
X

ej[m(M 1)/2]

m=0

= ej(M 1)/2
=

sin(M/2)
sin(/2)

1 ejM
1 ej

157

158

CHAPTER 7. DIGITAL FILTER DESIGN

Graphical View of Convolution


1
Hactual () =
2

Hideal ()W ( )d

Relation between Window Attributes and Filter


Frequency Response
Parameter

W ()
Mainlobe width
Area of first sidelobe

Hactual ()
Transition bandwidth
Passband and stopband ripple

7.3. FINITE IMPULSE RESPONSE FILTER DESIGN

159

Design of FIR Filters by Windowing


Relation between ideal and actual impulse responses
hactual [n] = hideal[n] w[n]
Choose window sequence w[n] for which DTFT has
1. minimum mainlobe width
2. minimum sidelobe area
Kaiser window is the best choice
1. based on optimal prolate spheroidal wavefunctions
2. contains a parameter that permits tradeoff between mainlobe
width and sidelobe area

Kaiser Window
(

I0 [(1[(n)/]2 )1/2 ]
,
I0 ()

0N M 1
0,
else
= (M 1)/2
I0 (.) zeroth-order modified Bessel function of the first kind
w[n] =

160

CHAPTER 7. DIGITAL FILTER DESIGN

Effect of Parameter

Filter Design Procedure for Kaiser Window


1. Choose stopband and passband ripple and transition bandwidth

7.3. FINITE IMPULSE RESPONSE FILTER DESIGN

2. Determine paramter
A =
20 log10
0.112(A 8.7)
0.5842(A 21)0.4 + 0.07886(A 21)
=

0.0

, A > 50
, 21 A 50
, A < 21

3. Determine filter length M


A8
M = 2.285
+1
4. Example
= 0.1 radians/sample= 0.05 cycles/sample
= 0.01
= 3.4
M = 45.6

Filter Designed with Kaiser Window

161

162

CHAPTER 7. DIGITAL FILTER DESIGN

Kaiser Filter Frequency Response

M = 47
= 3.4
= 0.01 = 40 dB
= 0.05
sl = 0.175
pl = 0.225
pu = 0.375
su = 0.425

Optimal FIR Filter Design


Although the Kaiser window has certain optimal properties, filters
designed using this window are not optimal
Consider the design of filters to minimize integral mean-squared
frequency error
Problem:
Choose hZactual [n] = (M 1)/2, ..., (M 1)/2 to minimize

1
E=
|Hactual () Hideal ()|2 d
2

7.3. FINITE IMPULSE RESPONSE FILTER DESIGN

163

Minimum Mean-Squared Error Design


Using Parsevals relation, we obtain a direct solution to this problem
Z
1
E=
|Hactual () Hideal ()|2 d
2

X
=
|hactual [n] hideal [n]|2
n=
(M 1)/2

|hactual [n] hideal [n]|2

n=(M 1)/2
(M +1)/2

n=

|hideal [n]|2 +

|hideal [n]|2

n=(M +1)/2

Solution
Set hactual [n] = hideal [n], n = (M 1)/2, ..., (M 1)/2
Minimum error is given by
(M +1)/2

X
X
E=
|hideal [n]|2 +
|hideal [n]|2
n=

n=(M +1)/2

This is the truncation of the ideal impulse response


We conclude that original criteria of minimizing mean-squared error
was not a good choice
What was the problem with truncating the ideal impulse response?
(See figure on following page)

Minimax (Equi-ripple) Filter Design


No matter how large we pick M for the truncated impulse response,
we cannot reduce the peak ripple
Also, the ripple is concentrated near the band edges
Rather than focussing on the integral of the error, lets consider the
maximum error
Parks and McClellan developed a method for design of FIR filters
based on minimizing the maximum of the weighted frequency
domain error

164

CHAPTER 7. DIGITAL FILTER DESIGN

Effect of Filter Length: Parks-McClellan Equiripple


Filters

7.4. INFINITE IMPULSE RESPONSE FILTER DESIGN

7.4

165

Infinite Impulse Response Filter Design

IIR vs. FIR Filters


FIR Filter Equation
y[n] = a0 x[n] + a1 x[n 1] + ... + aM 1 x[n (M 1)]
IIR Filter Equation
y[n] = a0 x[n] + a1 x[n 1] + ...aM 1 x[n (M 1)] b1 y[n 1]
b2 y[n 2] ... bN y[n N ]
IIR filters can generally achieve given desired response with less
computation than FIR filters
It is easier to approximate arbritrary frequency response
characteristics with FIR filters, including exactly linear phase

Infinite Impulse Response (IIR) Filter Design:


Overview
IIR digital filter designs are based on established methods for
designing analog filters
Approach is generally imited to frequency selective filters with ideal
passband/stopband characteristics
Basic filter type is low pass

166

CHAPTER 7. DIGITAL FILTER DESIGN


Achieve highpass or bandpass via transformations
Achieve multiple stop/pass bands by combining multiple filters with
single pass band

IIR Filter Design Steps


Choose prototype analog filter family
1. Butterworth
2. Chebychev Type I or II
3. Elliptic
Choose analog-digital transformation method
1. Impulse Invariance
2. Bilinear Transformation
Transform digital filter specifications to equivalent analog filter
specifications
Design analog filter
Transform analog filter to digital filter
Perform frequency transformation to achieve highpass or bandpass
filter, if desired

Prototype Filter Types

7.4. INFINITE IMPULSE RESPONSE FILTER DESIGN

Transformation via Impulse Invariance


Sample impulse response of analog filter
hd [n] = T ha (nT )
Hd () =

X
k




Ha (f k/T )

f=

Note that aliasing may occur

Impulse Invariance
Implementation of digital filter

2T

167

168

CHAPTER 7. DIGITAL FILTER DESIGN


1. Partial fraction expansion of analog transfer function
(assuming all poles have multiplicity 1)
Ha (s) =

N
X
Ak
s sk

k=1

2. Inverse Laplace transform


ha (t) =

N
X

Ak esk t u(t)

k=1

3. Sample Impulse response


hd [n] = T ha (nT ) = T

N
X

Ak esk nT u(nT )

k=1

=T

N
X

Ak pnk u[n], pk = esk T

k=1

4. Take Z transform
Hd (z) =

N
X
k=1

T Ak
1 pk z 1

5. Combine terms
a0 + a1 z 1 + ...aM 1 z (M 1)
1 + b1 z 1 + b2 z 2 + ...bN z N
6. Corresponding filter equation
Hd (z) =

y[n] = ao x[n] + a1 x[n 1] + ...aM 1 x[n (M 1)] b1 y[n


1] b2 y[n 2] ... bN y[n N ]

Impulse Invariance Example


Design a second order ideal low pass digital filter with cutoff at
d = /5 radians/sample (Assume T=1)
1. Analog cutoff frequency
fc =

d
2T

= 0.1Hz

c = 2fc = /5 rad/sec
Use Butterworth analog prototype
Ha (s) =

0.3948
[s (0.4443 + j0.4443)][s (0.4443 j0.4443)]

7.4. INFINITE IMPULSE RESPONSE FILTER DESIGN

169

Apply partial fraction expansion


Ha (s) =

j0.4443
j0.4443
+
[s (0.4443 + j0.4443)] [s (0.4443 j0.4443)]

Compute inverse Laplace Transform


ha (t) = [j0.4443e(0.4443+j0.4443)t + j0.4443e(0.4443j0.4443)t ]u(t)
Sample impulse response
h
hd [n] = j0.4443e(0.4443+j0.4443)n
i
+j0.4443e(0.4443j0.4443)n u[n]

= j0.4443(0.641ej0.4443 )n

+j0.4443(0.641ej0.4443 )n u[n]
Compute Z transform
j0.4443
j0.4443
+
1 0.6413ej0.4443 z 1
1 0.6413ej0.4443 z 1
0.2450z 1
=
1 1.1581z 1 + 0.4113z 2

Hd (z) =

Combine terms
Hd (z) =

(1

0.2450z 1
0.6413ej0.4443 z 1 )

0.6413ej0.4443 z 1 )(1

Find difference equation


y[n] = 0.2450x[n 1] + 1.1581y[n 1] 0.4113y[n 2]

Impulse Invariance Method-Summary


Preserves impulse response and shape of frequency response, if
there is no aliasing
Desired transition bandwidths map directly between digital and
analog frequnecy domains
Passband and stopband ripple specifications are identical for both
digital and analog filter, assuming that there is no aliasing

170

CHAPTER 7. DIGITAL FILTER DESIGN


The final digital filter design is independent of the sampling interval
parameter T
Poles in analog filter map directly to poles in digital filter via
transformation pk = esk T
There is no such relation between the zeros in the two filters
Gain at DC in a digital filter may not equal unity, since sampled
impulse response may only approximately sum to 1

Bilinear Transformation Method


Mapping between s and z


2 1 z 1
s=
T 1 + z 1

 
2 1 z 1
Hd (z) = Ha
T 1 + z 1
z=

1 + (T /2)s
1 (T /2)s

Mapping between s and z planes


Mapping between analog and digital frequencies

7.4. INFINITE IMPULSE RESPONSE FILTER DESIGN

Bilinear Transformation-Example No. 1


Design low-pass filter
1. cutoff frequency dc = /5 rad/sample
2. transition bandwidth and ripple
d = 0.2 radians/sample= 0.1 cycles/sample
= 0.1
3. use Butterworth analog prototype
4. set T = 1
|Hd (d 1)| = 1 
|Hd (d 2)| =
Map digital to analog frequencies

171

172

CHAPTER 7. DIGITAL FILTER DESIGN


a =

2
T

tan(d /2)

d1 = /5 0.1
a1 = 0.3168 rad/sec
d2 = /5 + 0.1
a2 = 1.0191 rad/sec
Solve for filter order and cutoff frequency
1
1+(a /c )2N

|Ha (a )|2 =

|Ha (a1 )| = 1 
|Ha (a2 )| =


1 log[(|Ha (a2 )|2 1)/(|Ha (a1 )|2 1)]
N=
2
log(a2 /a1 )
a2
ac =
(|Ha (a2 )|2 1)1/(2N )
Result
N =3
ac = 0.4738
Determine transfer function of analog filter
Ha (s)Ha (s) =

1
1+(s/jac )2N

Poles are given by

sk = ac e

2k

+
+
2
2N
2N

, k = 0, 1, ..., 2N 1

Take N poles with negative real parts for H(s)


s0 = 0.2369 + j0.4103 = 0.4738ej2/3
s1 = 0.4738 + j0.0000 = 0.4738ej
s2 = 0.2369 j0.4103 = 0.4738ej2/3
Transfer function of anlaog filter
3
ac
Ha (s) =
(s s0 )(s s1 )(s s2 )

7.4. INFINITE IMPULSE RESPONSE FILTER DESIGN


Transform to discrete-time
filter


2 1 z 1
Hd (z) = Ha
T 1 + z 1
3
ac
(1 + z 1 )3
8(1 z 1 s0 )(1 z 1 s1 )(1 z 1 s2 )
0.0083 + 0.0249z 1 + 0.0249z 2 + 0.0083z 3
=
1.0000 2.0769z 1 + 1.5343z 2 0.3909z 3

Hd (z) =

Bilinear Example No.2


Design low-pass filter dc = /5 rad/sample

173

174

CHAPTER 7. DIGITAL FILTER DESIGN

1. Cutoff frequency
2. Transition bandwidth and ripple
d = 0.1 radians/sample = 0.05 cycles/sample
= 0.01
3. Use Butterworth analog prototype
4. set T = 1
Result:N = 13

7.4. INFINITE IMPULSE RESPONSE FILTER DESIGN

175

Frequency Transformations of Lowpass IIR Filters


Given a prototype lowpass digital filter design with cutoff frequency
c , we can transform directly to:
1. a lowpass digital filter with a different cutoff frequency
2. a highpass digital filter
3. a bandpass digital filter
4. a bandstop digital filter
1

General form of transformation H(z) = Hlp (Z)}Z = G(z 1 )


Example - lowpass to lowpass
1. Transformation
z 1
Z 1 =
1 z 1
2. Associated design
 formula
c
sin c
2

=
c
sin c +
2

176

CHAPTER 7. DIGITAL FILTER DESIGN

Chapter 8

Random Signals
8.1

Chapter Outline

In this chapter, we will discuss:


1. Single Random Variable
2. Two Random Variables
3. Sequences of Random Variables
4. Estimating Distributions
5. Filtering of Random Sequences
6. Estimating Correlation

8.2

Single Random Variable

Random Signals
Random signals are denoted by upper case X and are completely
characterized by density function fX (x)
Z b
P (a X b) =
fX (x)dx
a

fX (x)x = P (x X x + x)
177

178

CHAPTER 8. RANDOM SIGNALS

The cumulative
distribution function is FX (x) = P (X x)
Z x
fX (x)dx
FX (x) =

dFX (x)

= fX (x)
dx
Properties of density function
1. fX (x) 0
Z

2.

fX (x)dx = 1

Example 1

fX (x) = ex u(x)
Z

fX (x)dx =
0

ex dx

0
= ex
=1

What is the probability X 1?


Z
P (X 1) =

ex dx

0
= ex 1
= 1 e

8.2. SINGLE RANDOM VARIABLE


Expectation
Z
E {g(X)} =

g(x)fX (x)dx where g is a function of X

Special Cases:
1. Mean value
g(x) = x
Z
X = E {X} =

xfX (x)dx

2. Second moment
g(x) = x2
Z

X 2 = E X 2 = x2 fX (x)dx
3. Variance
g(x) = (X X)2
Expectation is a linear operator
E {ag(x) + bh(x)} = aE {g(x)} + bE {h(x)}


2
X
= E (X X)2
n
o
2
= E X 2 2XX + X

2
= E X2 X
Example 2
Z
E {X} =

xex dx

Integrate
by parts
Z
Z
udv = uv vdu
u=x

dv = ex
Z
Z

ex dx
xex dx = xex 0 +
0
0



1
= xex 0 ex

0
1
=

du = 1

v = ex

179

180

CHAPTER 8. RANDOM SIGNALS

Example 3


E X2 =

x2 ex dx

Integrate by parts
u = x2 du = 2x v = ex
Z
0

dv = ex


x2 ex dx = x2 ex 0 + 2
=

xex dx

2
1

2
2
= 1 X = 1 X
= 1 X = 1

2
=
X

X and Y have the same mean and same standard deviation

Transformations of a Random Variable


Y = aX + b
Y = aX + b

8.3. TWO RANDOM VARIABLES

181



Y2 = E (Y Y )2
n
2 o
= E aX + b (aX + b)


= a2 E (X X)2
2
= a2 X

FY (y) = P {Y y}
= P {aX + b y} assume a> 0


yb
=P X
a


yb
= FX
a
1
fY (y) = fX
a

yb
a




1
yb


In general fY (y) = fX
a
a

8.3

Two Random Variables

1. Joint density function


Z

P {a X b c Y d} =

fXY (x, y)dxdy


a

2. Joint distribution
Z x Zfunction
y
FXY (x, y) =
fXY (x, y)dxdy

3. MarginalZdensities
fX (x) = fXY (x, y)dy
Z
fY (y) = fXY (x, y)dx
4. Expectation
Z Z
E {g(X, Y )} =

g(x, y)fXY (x, y)dxdy

182

CHAPTER 8. RANDOM SIGNALS

5. Linearity
E {ag(x, y) + bh(x, y)} = aE {g(x, y)} + bE {h(x, y)}
6. Correlation
g(x, y) = xy
7. Covariance
g(x, y) = (x X)(y Y ) XY = E {g(x, y)}
8. Correlation coefficient
2
XY
= E {g(x, y)}





1 
=
E {XY } E XY E XY + X Y
X Y

1 
=
XY X Y
X Y

9. Independence
fXY (x, y) = fX (x)fY (y)
2
XY
= 0 and XY = X Y

Example 4


2,
0,

fXY (x, y) =

fX (x) =

fY (y) =

0yx1
else

0
0,
Z 1

2dy = 2x, 0 x 1
else
2dx = 2(1 y), 0 y 1

0,

else

8.3. TWO RANDOM VARIABLES

XY =

2xydxdy
x=0
Z 1

y=0

Z

x
x=0
1


2ydy dx

y=0

x3 dx

=
x=0

4 1

1
x
=
4 0
4

X=

x(2x)dx =
0

2
2 31
x | =
3 0
3

1
Y =
3
X2

Z
=

x2 (2x)dx

1
2 4
x
4 0
1
=
2

183

184

CHAPTER 8. RANDOM SIGNALS


1 4

2 9
1
=
18
= y2

2
X
=

XY X Y
X Y
1/4 2/9
=
1/18
1
=
2

2
XY
=

8.4

Sequences of Random Variables

Characteristics
X1 , X2 , X3 , ..., XN denote a sequence of random variables
Their
 behavior is completely characterized by

P xl1 X1 xu1 , xl2 X2 xu2 , ..., xlN XN xuN
Z

xu
1

xu
2

xu
N

...
xl1

xl2

xlN

fX1 ,X2 ,...,XN (x1 , x2 , ..., xN )dx1 , dx2 , ..., dxN

It is apparent that this can get complicated very quickly


In practice, we consider only 2 cases:
1. X1 , X2 , ..., XN are mutually independent
N
Y
fX1 ,X2 ,...,XN (x1 , x2 , ..., xN ) =
fXi (xi )
i=1

2. X1 , X2 , ..., XN are jointly Gaussian


Example 5
2
X1 , X2 , ..., Xn are i.i.d with mean X and std. deviation X
N1 , N2 , ..., Nn are i.i.d with zero mean
Yi = aXi + Ni

8.4. SEQUENCES OF RANDOM VARIABLES


E {Yi } = aE {Xi } + E {Ni }
Y = aX
n
o
2
Y 2 = E (aXi + Ni )
= a2 X 2 + N 2
Y2 = Y 2 Y

2

2
= a2 X 2 + N
a2 X

2

2
2
= a2 X
+ N

XY = E {Xi (aXi + Ni )}
= aX 2

2
XY

aX 2 a X

2
1/2

2 + 2 )
X (a2 X
N
X


=a p
2 + 2
a 2 X
N

=r
1+

1
2
N
2
2
(a X
)

185

186

CHAPTER 8. RANDOM SIGNALS

8.4. SEQUENCES OF RANDOM VARIABLES

187

188

CHAPTER 8. RANDOM SIGNALS

8.4. SEQUENCES OF RANDOM VARIABLES

189

190

CHAPTER 8. RANDOM SIGNALS

8.5. ESTIMATING DISTRIBUTIONS

8.5

191

Estimating Distributions

So far, we have assumed that we have an analytical model for the


probability densities of interest.
This was reasonable for quantization. However, suppose we do not know
the underlying densities. Can we estimate it from observations of the
signal?
Suppose we observe a sequence of i.i.d rvs
X1 , X2 , ..., XN
let E(X) = X
How do we estimate X ?
X =

N
1 X
Xn
N n=1

How good is the estimate?


X is actually a random variable, lets call it Y
)
(
N
1 X
Xn
E {Y } = E
N n=1
= E {X}
= X

!2
N
1 X

o
n
2
|Xn X |
E |Y X | = E
N

n=1
=

N
N
1 X X
N
E {[Xm X ][Xn X ]}
N 2 m=1 n=1

N
1 X
2
N X
N 2 m=1

1 2

N X

192

CHAPTER 8. RANDOM SIGNALS

How do we estimate variance?


N
X
2
2 = 1
[Xn X ] [X X ]]
X
N n=1

N
N
1 X
1 X
2
|Xn X | 2[X X ]
[Xn X ]
N n=1
N n=1

N
1 X
[X X ]2
N n=1

N
1 X
2
|Xn X | [X X ]2
N n=1

call this r.v Z


N
n
o
1 X 2
2
X E |X X |
E {Z} =
N n=1

!2
N

1 X
n
o
2
E |X X | = E
[Xn X ]

N
n=1
=

N
N
1 XX
E {[Xm X ][Xn X ]}
N 2 m=1 n=1

1
2
N X
N2
1 2
= X
N
=

1 2
2
E {Z} = X
X
N


N 1
2
= X
N
So the estimate is not unbiased
We define unbiased estimate as:
N
2
X
=
2
unb
N 1 X
N
1 X
2
=
(Xn c
X)
N 1 n=1

8.5. ESTIMATING DISTRIBUTIONS

193

N
1 X
2
|Xn c
X|
N n=1
(N
)
N
X
1 X
2
2
|Xn | 2c
Xn + c
=
X
X
N n=1
n=1

2
X
=

2
X
=
unb

N
1 X
|Xn |2 2X
N n=1

N
2
N 1 X

So far we have seen how to estimate statistics such as mean and variance
of a random variable.
These ideas can be extended to estimation of any moments of the random
variable. But suppose we want to know the actual density itself.
How do we do this?
We need to compute the histogram.
Consider a sequence of i.i.d r.vs with density fX (x)
We divide the domain of X into intervals



Ik = x : k 21 x k + 12

194

CHAPTER 8. RANDOM SIGNALS

We then define the r.v.s



1, X Ik
Uk =
0, else
We observe a sequence of i.i.d r.v.s Xn n = 1, ..., N and compute the
corresponding r.v.s Unk
Finally we let
PN
Z k = N1 n=1 Unk
Then since this r.v has the same form as the estimator of mean which we
analyzed earlier, we know that


E Z k = E Unk
1 2
2
Z
k
k =
N U

Now what is E Unk

E Unk = 1.P {Xn Ik } + 0.P {Xn
/ Ik }
= P {Xn Ik }
Z (k+ 12 )
fX (x)dx
=
(k 12 )
So we see that we are estimating the
 integral of the density function over
the range k 12 x k + 12
According to the fundamental theorem of calculus, there exists


k 21 k + 12
such that
Z (k+ 12 )
fX ( ) =

fX (x)dx

(k 12 )

= E Zk

Assuming fX (x) is continuous,


As 0

E Z k = fX ( ) fX (k)
defined as
2
Uk
= 2
= Uk
U k

8.6. FILTERING OF RANDOM SEQUENCES

195

For fixed fX (x), U k = P {X Ik } will increase with increasing so there


is a tradeoff between measurement noise and measurement resolution.
Of course, for fixed and fX (x), we can always improve our result by
increasing N.
What is the variance of Unk ?
n
2 o
E Unk
= 12 P {X Ik } + 02 P {X
/ Ik }
= P {X Ik }
= Uk

2
2
so U
k = Uk (Uk ) = Uk (1 Uk )

We would expect to operate in range where is small so


2
k
U
k U

8.6

Filtering of Random Sequences

Let us define X (n) = E {Xn }


rXX (m, n) = E {Xm Xn }

196

CHAPTER 8. RANDOM SIGNALS

Special case
A process is w.s.s. if
1. X (n) X
2. rXX (m, n) = rXX (n m, 0) rXX (n m)
Convention:
rAB [a, b] = rAB [b a]
Consider
X
Y [n] =
h[n m]X[m]
m

E {Yn } =

h[n m]E {Xm }

If Xn is w.s.s
E {Yn } =

h[n m]X

h[n]X

= X [x]is a constant

8.6. FILTERING OF RANDOM SEQUENCES

To find rY Y , we first define cross-correlation


rXY [m, n] = E {Xm , Yn }
(
)
X
= E Xm
h[n k]Xk
k

h[n k]E {Xm Xk }

h[n k]rXX [k m]

let l=k-m k = m + l
rXY [m, n] =

h[n (m + l)]rXX (l)

h[n m l]rXX (l)

rXY [m, n] = rXY [n m]


then
rY Y [m, n] = E {Ym Yn }
(
)
X
h[n k]Xk
= E Ym
k

h[n k]rXY [m k]

let l = m k k = m l
X
=
h[n (m l)]rXY (l)
k

h[n m + l]rXY (l)

h[n m l]rXY (l)

so rY Y [m, n] = rY Y [n m]
summarizing:
If X is w.s.s, Y is also w.s.s

197

198

CHAPTER 8. RANDOM SIGNALS

Interpretation of Correlation
Recall that for two different random variables X and Y, we defined
covariance to be
2
XY
= E {(X X ) (Y Y )}

and correlation coefficient


2
XY = XY
X Y
as measures of how related X and Y are,i.e whether or not they tend to
vary together?
Since X[m] and X[m + n] or X[m] and Y [m + n] are just two different
pairs of r.v.s, we can see that
rXX [n] = E {X[m]X[m + n]}
rXY [n] = E {X[m]Y [m + n]}
are closely related to covariance and correlation coefficient.
Suppose X and Y have zero mean, these r.vs have the same
interpretation. How related are Xm and Xm+n or Ym and Ym+n ?
Lets consider some examples:
Suppose X[n] is i.i.d with zero mean.
Since mean of a w.s.s process is just a constant offset or shift, we can let
it equal zero without loss of generality.
Then rXX [n] = E {X[m]X[m + n]}
 2
X , n = 0
rXX [n] =
0,
else
2
rXX [n] = X
[n]
Now suppose
Y [n] =

7
X

2m X[n m]

m=0

This is a filtering operation with


h[n] = {2n [u[n] u[n 8]}
We already know that
rXY [n] = h[n] rXX [n]
2
= X
h[n]

8.6. FILTERING OF RANDOM SEQUENCES

199

rXY [n] = E {X[m]Y [m + n]}


What about the sequence Y [n]?
Is it i.i.d?
Recall
rY Y [n] = h[n] rXY [n]
2
= h[n] X
h[n]
X
2
= X
h[n m]h[m]
m

2
X

h[n + m]h[m]

Cases
1. n 7,
rY Y [n] = 0
2. 7 n 0
2
rY Y [n] = X

n+7
X

2 n
2(n+m) 2m = X
2

m=0

n+7
X
m=0

2(n+8)
2 n 1 2
= X
2
1 22
h
i
4
2
2n 2(n16)
= X
3

3. 0 n 7
rY Y [n] =

2 n
X
2

7
X

22m

l =m+n

m=n
2 n
= X
2

n+7
X

22(ln)

l=0
2 n
= X
2

n+7
X

2 n
22l = X
2

l=0

4 2 n
= X
[2 2n16 ]
3

1 22(n+8)
1 22

22m

200

CHAPTER 8. RANDOM SIGNALS

4. n > 7
rY Y [n] = 0
Summarizing

0,

2
4 X
[2n 2(n16) ],
3
rY Y [n] =
4 2 [2n 2(n16) ],

3
0,

n < 7
7 n 0
0n7
n>7

8.6. FILTERING OF RANDOM SEQUENCES

201

202

CHAPTER 8. RANDOM SIGNALS

8.7. ESTIMATING CORRELATION

8.7

203

Estimating Correlation

Assume X and Y are jointly w.s.s processes


E[Xn ] = X
E[Yn ] = X
rXY [m, m + n] = E {X[m]Y [m + n]}
= rXY [n]
Suppose we form the sum
Z[n] =

M 1
1 X
X[m]Y [m + n]
M m=0

Consider
E {Z[n]} =

M 1
1 X
E {X[m]Y [m + n]}
M m=0

E {Z[n]} =

M 1
1 X
rXY [n] = rXY [n]
M m=0

So we have an unbiased estimator of correlation.


Lets look a little more closely at what the computation involves:
Suppose we computed
rXY
[n] = Z[n] for the interval N n N
=

M 1
1 X
X[m]Y [m + n]
M m=0

For n = N
X[0]X[1]...X[M 1]
Y [N ]Y [N + 1]...Y [N + M 1]
For n = 0
X[0]X[1]...X[M 1]
Y [0]Y [1]...Y [M 1]
For n = N
X[0]X[1]...X[M 1]
Y [N ]Y [N + 1]...Y [N + M 1]
In each case, we used same data set for X, bu the data used for Y varied.

204

CHAPTER 8. RANDOM SIGNALS

Suppose instead we collect Z sets of data


X[0]...X[M 1]
Y [0]...Y [M 1]
and use this data to compute estimate for every n
let Xtr [n] = X[n] {u[n] u[n m]}
let Ytr [n] = Y [n] {u[n] u[n m]}
Then let
v[n] =

Xtr [m]Ytr [m + n]

M
1
X

X[m]Y [m + n] {u[m + n] u[m + n M ]}

m=0

E {V [n]} =

M
1
X

E {X[m]Y [m + n]} {u[m + n] u[m + n M ]}

m=0

M
1
X

rXY [n] {u[m + n] u[m + n M ]}

m=0

= rXY [n]

M
1
X

{u[m + n] u[m + n M ]}

m=0

So an unbiased estimate of correlation is given by



X
1
1 M

rXY
[n] =
X[m]Ytr [m + n]
M n m=0

Cover image taken from website


http://www.fmwconcepts.com/imagemagick

You might also like