You are on page 1of 29

# Discrete-time signals and systems

See Oppenheim and Schafer, Second Edition pages 893, or First Edition
pages 879.

1 Discrete-time signals
A discrete-time signal is represented as a sequence of numbers:
x D fxng;

1 < n < 1:

## Here n is an integer, and xn is the nth sample in the sequence.

Discrete-time signals are often obtained by sampling continuous-time signals.
In this case the nth sample of the sequence is equal to the value of the analogue
signal xa .t / at time t D nT :
xn D xa .nT /;

1 < n < 1:

## The sampling period is then equal to T , and the sampling frequency is

fs D 1=T .
xa .1T /
...

...
t
x

For this reason, although xn is strictly the nth number in the sequence, we
often refer to it as the nth sample. We also often refer to the sequence xn
when we mean the entire sequence.
Discrete-time signals are often depicted graphically as follows:

x
x
x
x
x
x
1

...
4

...
2

1 0

4
x

x
x

(This can be plotted using the MATLAB function stem.) The value xn is
undefined for noninteger values of n.
Sequences can be manipulated in several ways. The sum and product of two
sequences xn and yn are defined as the sample-by-sample sum and product
respectively. Multiplication of xn by a is defined as the multiplication of
each sample value by a.
A sequence yn is a delayed or shifted version of xn if
yn D xn

n0 ;

with n0 an integer.
The unit sample sequence
1

n
0

is defined as
n D

8
<0

n0

:1

n D 0:

## This sequence is often referred to as a discrete-time impulse, or just impulse.

It plays the same role for discrete-time signals as the Dirac delta function does
for continuous-time signals. However, there are no mathematical

## complications in its definition.

An important aspect of the impulse sequence is that an arbitrary sequence can
be represented as a sum of scaled, delayed impulses. For example, the
sequence
a
a

a4

a0

...

...
1

1 0

n
4

a1

a3
a2

can be represented as
xn D a

4 n

C 4 C a

3 n

C 3 C a

Ca1 n

2 n

1 C a2 n

C 2 C a
2 C a3 n

1 n

C 1 C a0 n

3 C a4 n

xn D

1
X

xkn

k:

kD 1

1

n
0

is defined as
un D

8
<1

n0

:0

n < 0:

4:

n
X

un D

k:

kD 1

## Alternatively, this can be expressed as

un D n C n

1 C n

2 C    D

1
X

k:

kD0

Conversely, the unit sample sequence can be expressed as the first backward
difference of the unit step sequence
n D un

un

1:

## Exponential sequences are important for analysing and representing

discrete-time systems. The general form is
xn D A n :
If A and are real numbers then the sequence is real. If 0 < < 1 and A is
positive, then the sequence values are positive and decrease with increasing n:
...
...
n
0

For 1 < < 0 the sequence alternates in sign, but decreases in magnitude.
For jj > 1 the sequence grows in magnitude as n increases.
A sinusoidal sequence
...
0

n
...

## has the form

xn D A cos.!0 n C /

for all n;

## with A and  real constants. The exponential sequence A n with complex

D jje j!0 and A D jAje j can be expressed as
xn D A n D jAje j jjn e j!0 n D jAjjjn e j.!0 nC/
D jAjjjn cos.!0 n C / C j jAjjjn sin.!0 n C /;
so the real and imaginary parts are exponentially weighted sinusoids.
When jj D 1 the sequence is called the complex exponential sequence:
xn D jAje j.!0 nC/ D jAj cos.!0 n C / C j jAj sin.!0 n C /:
The frequency of this complex sinusoid is !0 , and is measured in radians per
sample. The phase of the signal is .
The index n is always an integer. This leads to some important differences
between the properties of discrete-time and continuous-time complex
exponentials:
 Consider the complex exponential with frequency .!0 C 2/:
xn D Ae j.!0 C2/n D Ae j!0 n e j 2 n D Ae j!0 n :
Thus the sequence for the complex exponential with frequency !0 is
exactly the same as that for the complex exponential with frequency
.!0 C 2/. More generally, complex exponential sequences with
frequencies .!0 C 2 r/, where r is an integer, are indistinguishable from
one another. Similarly, for sinusoidal sequences
xn D A cos.!0 C 2 r/n C  D A cos.!0 n C /:
 In the continuous-time case, sinusoidal and complex exponential
sequences are always periodic. Discrete-time sequences are periodic (with
period N) if
xn D xn C N
for all n:

## Thus the discrete-time sinusoid is only periodic if

A cos.!0 n C / D A cos.!0 n C !0 N C /;
which requires that
!0 N D 2k

for k an integer:

## The same condition is required for the complex exponential sequence

C e j!0 n to be periodic.
The two factors just described can be combined to reach the conclusion that
there are only N distinguishable frequencies for which the corresponding
sequences are periodic with period N . One such set is
!k D

2k
;
N

k D 0; 1; : : : ; N

1:

## Additionally, for discrete-time sequences the interpretation of high and low

frequencies has to be modified: the discrete-time sinusoidal sequence
xn D A cos.!0 n C / oscillates more rapidly as !0 increases from 0 to ,
but the oscillations become slower as it increases further from  to 2.

!0 D 0

1
0
1
!0 D 
8

1
0
1
!0 D 
4

1
0
1
!0 D 

1
0

!0 D 15
8

!0 D 7
4

1
1
0
1
1
0
1
8

## The sequence corresponding to !0 D 0 is indistinguishable from that with

!0 D 2. In general, any frequencies in the vicinity of !0 D 2k for integer
k are typically referred to as low frequencies, and those in the vicinity of
!0 D . C 2k/ are high frequencies.

2 Discrete-time systems
A discrete-time system is defined as a transformation or mapping operator that
maps an input signal xn to an output signal yn. This can be denoted as
yn D T fxng:

T fg
x[n]

y[n]

yn D xn

nd W

x[n]
...

...
n
3

y[n]=x[n2]
...

...
n
1

M2
X
1
xn
yn D
M1 C M2 C 1

kD M1

y

x[n]
...

...
n
1

y

## yields an output with

::
:
1
.x1 C x2 C x3/
3
1
y3 D .x2 C x3 C x4/
3
::
:
y2 D

## In general, systems can be classified by placing constraints on the

transformation T fg.

## 2.1 Memoryless systems

A system is memoryless if the output yn depends only on xn at the same n.
For example, yn D .xn/2 is memoryless, but the ideal delay

yn D xn

nd is not unless nd D 0.

## 2.2 Linear systems

A system is linear if the principle of superposition applies. Thus if y1 n is the
response of the system to the input x1 n, and y2 n the response to x2 n, then
linearity implies
T fx1 n C x2 ng D T fx1 ng C T fx2 ng D y1 n C y2 n
 Scaling:
T fax1 ng D aT fx1 ng D ay1 n:
These properties combine to form the general principle of superposition
T fax1 n C bx2 ng D aT fx1 ng C bT fx2 ng D ay1 n C by2 n:
In all cases a and b are arbitrary constants.
This property generalises to many inputs, so the response of a linear system to
P
P
xn D k ak xk n will be yn D k ak yk n.

## 2.3 Time-invariant systems

A system is time invariant if a time shift or delay of the input sequence causes
a corresponding shift in the output sequence. That is, if yn is the response to
xn, then yn n0 is the response to xn n0 .
For example, the accumulator system
yn D

n
X

kD 1

10

xk

## is time invariant, but the compressor system

yn D xM n
for M a positive integer (which selects every M th sample from a sequence) is
not.

2.4 Causality
A system is causal if the output at n depends only on the input at n and earlier
inputs.
For example, the backward difference system
yn D xn

xn

## is causal, but the forward difference system

yn D xn C 1

xn

is not.

2.5 Stability
A system is stable if every bounded input sequence produces a bounded output
sequence:
 Bounded input: jxnj  Bx < 1
 Bounded output: jynj  By < 1.
For example, the accumulator
yn D

n
X

kD 1

11

xn

is
8
n
<0
X
n<0
yn D
un D
:n C 1
n  0;
kD 1

## 3 Linear time-invariant systems

If the linearity property is combined with the representation of a general
sequence as a linear combination of delayed impulses, then it follows that a
linear time-invariant (LTI) system can be completely characterised by its
impulse response.
Suppose hk n is the response of a linear system to the impulse n
n D k. Since
( 1
)
X
yn D T
xkn k ;

k at

kD 1

yn D

1
X

xkT fn

kg D

kD 1

1
X

xkhk n:

kD 1

## If the system is additionally time invariant, then the response to n

hn k. The previous equation then becomes
yn D

1
X

xkhn

k is

k:

kD 1

This expression is called the convolution sum. Therefore, a LTI system has
the property that given hn, we can find yn for any input xn. Alternatively,
yn is the convolution of xn with hn, denoted as follows:
yn D xn  hn:

12

The previous derivation suggests the interpretation that the input sample at
n D k, represented by xkn k, is transformed by the system into an
output sequence xkhn k. For each k, these sequences are superimposed
to yield the overall output sequence:
hn

xn
1
1 0

x 1hn C 1

x 1n C 1

1 0

x1n

x1hn

1
0

yn D x 1hn C 1 C x1hn

## A slightly different interpretation, however, leads to a convenient

computational form: the nth value of the output, namely yn, is obtained by
multiplying the input sequence (expressed as a function of k) by the sequence
with values hn k, and then summing all the values of the products
xkhn k. The key to this method is in understanding how to form the
sequence hn k for all values of n of interest.
To this end, note that hn k D h .k n/. The sequence h k is seen to
be equivalent to the sequence hk reflected around the origin:

13

h[k]
2

Reflect

h[k]
0

k
2

Shift

h[nk]
n5

The sequence hn
to k D n.

n+2

## To implement discrete-time convolution, the sequences xk and hn k are

multiplied together for 1 < k < 1, and the products summed to obtain the
value of the output sample yn. To obtain another output sample, the
procedure is repeated with the origin shifted to the new sample position.
Example: analytical evaluation of the convolution sum
Consider the output of a system with impulse response
8
<1
0nN 1
hn D
:0
otherwise

to the input xn D an un. To find the output at n, we must form the sum over
all k of the product xkhn k.

14

x[n]

0.5

0
10

0
k

n(N1) 0
k

10

10

h[nk]

0.5

0
10

Since the sequences are non-overlapping for all negative n, the output must be
zero:
yn D 0;
For 0  n  N
follows that

n < 0:

## 1 the product terms in the sum are xkhn

yn D

n
X

ak ;

0nN

k D ak , so it

1:

kD0

Finally, for n > N 1 the product terms are xkhn k D ak as before, but
the lower limit on the sum is now n N C 1. Therefore
yn D

n
X

ak ;

kDn N C1

15

n>N

1:

## 4 Properties of LTI systems

All LTI systems are described by the convolution sum
yn D

1
X

xkhn

k:

kD 1

## Some properties of LTI systems can therefore be found by considering the

properties of the convolution operation:
 Commutative: xn  hn D hn  xn
xn  .h1 n C h2 n/ D xn  h1 n C xn  h2 n:
x[n]

x[n]

h1 n

h2 n

h2 n

y[n]

h1 n

y[n]

yn D hn  xn D h1 n  h2 n  xn D h2 n  h1 n  xn.
 Parallel connection:
h1 n
x[n]

y[n]

h2 n
yn D .h1 n C h2 n/  xn D hp n  xn.
 A LTI system is stable if and only if S D

16

P1

kD 1

## jhkj < 1. The ideal

delay system hn D n
average system

M2
X
1
hn D
n k
M1 C M2 C 1
kD M1
8
1
<
M1  n  M2
M1 CM2 C1
D
:0
otherwise;

## the forward difference system hn D n C 1 n, and the backward

difference system hn D n n 1 are stable since S is the sum of a
finite number of finite samples, and is therefore less than 1; the
accumulator system
hn D

n
X

kD 1

8
<1

:0

n0
n<0

D un
is unstable since S D

P1

nD0

un D 1.

 A LTI system is causal if and only if hn D 0 for n < 0. The ideal delay
system is causal if nd  0; the moving average system is causal if
M1  0 and M2  0; the accumulator and backward difference systems
are causal; the forward difference system is noncausal.
Systems with only a finite number of nonzero values in hn are called Finite
duration impulse response (FIR) systems. FIR systems are stable if each
impulse response value is finite. The ideal delay, the moving average, and the
forward and backward difference described above fall into this class. Infinite
impulse response (IIR) systems, such as the accumulator system, are more
difficult to analyse. For example, the accumulator system is unstable, but the

17

IIR system
hn D an un;

jaj < 1

is stable since
SD

1
X

ja j 

1
X

jajn D

nD0

nD0

1
1

jaj

<1

## (it is the sum of an infinite geometric series).

Consider the system
Forward
difference

Onesample
delay

which has
hn D .n C 1

n/  n

D n

1  n C 1

D n

1
1  n

1:

## This is the impulse response of a backward difference system:

Forward
difference

Onesample
delay

Backward
difference

Here a non-causal system has been converted to a causal one by cascading with
a delay. In general, any non-causal FIR system can be made causal by
cascading with a sufficiently long delay.
Consider the system consisting of an accumulator followed by a backward
difference:

18

Backward
difference

Accumulator

## The impulse response of this system is

hn D un  .n

1/ D un

un

1 D n:

The output is therefore equal to the input because xn  n D xn. Thus the
backward difference exactly compensates for (or inverts) the effect of the
accumulator the backward difference system is the inverse system for the
accumulator, and vice versa. We define this inverse relationship for all LTI
systems:
hn  hi n D n:

## 5 Linear constant coefficient difference equations

Some LTI systems can be represented in terms of linear constant coefficient
difference (LCCD) equations
N
X

ak yn

k D

M
X

bm xn

m:

mD0

kD0

## Example: difference equation representation of the accumulator

Take for example the accumulator
Accumulator
x[n]

y[n]

Backward
difference

x[n]

## Here yn yn 1 D xn, which can be written in the desired form with

N D 1, a0 D 1, a1 D 1, M D 0, and b0 D 1. Rewriting as
yn D yn

19

1 C xn

x[n]

y[n]
Onesample
delay

## where at n we add the current input xn to the previously accumulated sum

yn 1.
Example: difference equation representation of moving average
Consider now the moving average system with M1 D 0:
hn D

1
.un
M2 C 1

un

M2

1/:

M2
X
1
yn D
xn
M2 C 1

k;

kD0

## which is a LCCDE with N D 0, a0 D 1, and M D M2 , bk D 1=.M2 C 1/.

Using the sifting property of n,
hn D

1
.n
M2 C 1

M2

1/  un

so
Attenuator
x[n]

x1 n

1=.M2 C 1/
.M2 C 1/
sample delay

20

Accumulator
y[n]

## Here x1 n D 1=.M2 C 1/.xn xn

yn yn 1 D x1 n. Therefore
yn

yn

1 D

M2

1
.xn
M2 C 1

xn

M2

1/;

## which is again a (different) LCCD equation with N D 1, a0 D 1, a1 D

b0 D bM2 C1 D 1=.M2 C 1/.

1,

## As for constant coefficient differential equations in the continuous case,

without additional information or constraints a LCCDE does not provide a
unique solution for the output given an input. Specifically, suppose we have
the particular output yp n for the input xp n. The same equation then has the
solution
yn D yp n C yh n;
where yh n is any solution with xn D 0. That is, yh n is an homogeneous
solution to the homogeneous equation
N
X

ak yh n

k D 0:

kD0

It can be shown that there are N nonzero solutions to this equation, so a set of
N auxiliary conditions are required for a unique specification of yn for a
given xn.
If a system is LTI and causal, then the initial conditions are initial rest
conditions, and a unique solution can be obtained.

6 Frequency-domain representation of
discrete-time signals and systems
The Fourier transform considered here is strictly speaking the discrete-time
Fourier transform (DTFT), although Oppenheim and Schafer call it just the

21

Fourier transform. Its properties are recapped here (with examples) to show
nomenclature.
Complex exponentials
xn D e j!n ;

1<n<1

yn D

1
X

hke j!.n

k/

1
X

D e j!n

kD 1

hke

j!k

kD 1

Defining
H.e

j!

/D

1
X

j!k

hke

kD 1

## we have that yn D H.e j! /e j!n D H.e j! /xn. Therefore, e j!n is an

eigenfunction of the system, and H.e j! / is the associated eigenvalue.
The quantity H.e j! / is called the frequency response of the system, and
H.e j! / D HR .e j! / C jHI .e j! / D jH.e j! /je j ^H.e

j! /

## Example: frequency response of ideal delay:

Consider the input xn D e j!n to the ideal delay system yn D xn
the output is
yn D e j!.n nd / D e j!nd e j!n :
The frequency response is therefore
H.e j! / D e

j!nd

H.e

j!

/D

1
X

nd e

nd ,
j!n

De

j!nd

nD 1

22

nd :

## HR .e j! / D cos.!nd / and HI .e j! / D sin.!nd /, or alternatively

jH.e j! /j D 1
^H.e j! / D

!nd :

The frequency response of a LTI system is essentially the same for continuous
and discrete time systems. However, an important distinction is that in the
discrete case it is always periodic in frequency with a period 2:
H.e

j.!C2/

/D
D
D

1
X

nD 1
1
X

nD 1
1
X

hne

j.!C2/n

hne

j!n

hne

j!n

j 2 n

D H.e j! /:

nD 1

## This last result holds since e j 2 n D 1 for integer n.

The reason for this periodicity is related to the observation that the sequence
j!n
;
1<n<1
e
has exactly the same values as the sequence
o
n
j.!C2/n
;
1 < n < 1:
e

A system will therefore respond in exactly the same way to both sequences.
Example: ideal frequency selective filters
The frequency response of an ideal lowpass filter is as follows:

23

Hlp .e j! /

2

 !c

!c

2

## Due to the periodicity in the response, it is only necessary to consider one

frequency cycle, usually chosen to be the range  to . Other examples of
ideal filters are:
Hhp .e j! /

Highpass

!c

!c

j!
1 Hbs .e /

Bandstop

!b

!a
1

!a
Hbp .e j! /

!b

Bandpass

!b

!a

!a

!b

In these cases it is implied that the frequency response repeats with period 2
outside of the plotted interval.
Example: frequency response of the moving-average system

24

## The frequency response of the moving average system

8
1
<
M1  n  M2
M1 CM2 C1
hn D
:0
otherwise

is given by
H.e j! / D

1
e j!.M2 CM1 C1/=2 e j!.M2 CM1 C1/=2
e
M1 C M2 C 1
1 e j!

## e j!.M2 CM1 C1/=2 e j!.M2 CM1 C1/=2

1
e
D
M1 C M2 C 1
e j!=2 e j!=2
sin!.M1 C M2 C 1/=2 j!.M2 M1 /
1
2
e
:
D
M1 C M2 C 1
sin.!=2/

j!.M2

M1 C1/

j!.M2 M1 /
2

For M1 D 0 and M2 D 4,

jH.e j! /j

2

2
5

2
5

2

2

^H.e j! /

!

0


2

!
This system attenuates high frequencies (at around ! D ), and therefore has
the behaviour of a lowpass filter.

25

## 7 Fourier transforms of discrete sequences

The discrete time Fourier transform (DTFT) of the sequence xn is
X.e

j!

/D

1
X

xne

j!n

nD 1

This is also called the forward transform or analysis equation. The inverse
Fourier transform, or synthesis formula, is given by the Fourier integral
Z 
1
xn D
X.e j! /e j!n d!:
2 
The Fourier transform is generally a complex-valued function of !:
X.e j! / D XR .e j! / C jXI .e j! / D jX.e j! /je j ^X.e

j! /

The quantities jX.e j! /j and ^X.e j! / are referred to as the magnitude and
phase of the Fourier transform. The Fourier transform is often referred to as
the Fourier spectrum.
Since the frequency response of a LTI system is given by
H.e

j!

/D

1
X

hke

j!k

kD 1

## it is clear that the frequency response is equivalent to the Fourier transform of

the impulse response, and the impulse response is
Z 
1
hn D
H.e j! /e j!n d!:
2 
A sufficient condition for the existence of the Fourier transform of a sequence
P
xn is that it be absolutely summable: 1
nD 1 jxnj < 1. In other words,
P1
the Fourier transform exists if the sum nD 1 jxnj converges. The Fourier
transform may however exist for sequences where this is not true a rigorous
mathematical treatment can be found in the theory of generalised functions.

26

## 8 Symmetry properties of the Fourier transform

Any sequence xn can be expressed as
xn D xe n C xo n;
where xe n is conjugate symmetric (xe n D xe n) and xo n is conjugate
antisymmetric (xo n D xo n). These two components of the sequence
can be obtained as:
1
.xn C x  n/ D xe n
2
1
xo n D .xn x  n/ D xo n:
2
xe n D

## If a real sequence is conjugate symmetric, then it is an even sequence, and if

conjugate antisymmetric, then it is odd.
Similarly, the Fourier transform X.e j! / can be decomposed into a sum of
conjugate symmetric and antisymmetric parts:
X.e j! / D Xe .e j! / C Xo .e j! /;
where
1
X.e j! / C X  .e
2
1
Xo .e j! / D X.e j! / X  .e
2
Xe .e j! / D

j!

j!

/:

## With these definitions, and letting

X.e j! / D XR .e j! / C jXI .e j! /;
the symmetry properties of the Fourier transform can be summarised as
follows:

27

Sequence xn

Transform X.e j! /

x  n

X  .e

j!

x  n

X  .e j! /

Refxng

Xe .e j! /

j Imfxng

Xo .e j! /

xe n

XR .e j! /

xo n

jXI .e j! /

Most of these properties can be proved by substituting into the expression for
the Fourier transform. Additionally, for real xn the following also hold:
Transform X.e j! /

Real sequence xn
xn

X.e j! / D X  .e

xn

XR .e j! / D XR .e

xn

XI .e j! / D

xn

jX.e j! /j D jX.e

xn

^X.e j! / D

j!

j!

j!

^X.e

XR .e j! /

xo n

jXI .e j! /

j!

XI .e

xe n

/
/

/j

j!

## 9 Fourier transform theorems

Let X.e j! / be the Fourier transform of xn. The following theorems then
apply:

28

Sequences xn, yn

Transforms X.e j! /, Y .e j! /

Property

axn C byn

aX.e j! / C bY .e j! /

Linearity

xn

nd

j!nd

X.e j! /

e j!0 n xn

X.e j.!

x n

X.e

nxn

xn  yn

X.e
1
2

xnyn

R

!0 /
j!

Time shift

Frequency shift

Time reversal

dX.e j! /

Frequency diff.

d!
j!

/Y .e

j!

X.e j /Y .e j.!

Convolution
/

/d

Modulation

## Some useful Fourier transform pairs are:

Sequence

Fourier transform

n0

1 . 1 < n < 1/
an un .jaj < 1/
un
.n C 1/an un .jaj < 1/
sin.!c n/
n

xn D

8
<1
:0

j!n0

P1

kD 1 2.! C 2k/
1
1 ae j!
P1
1
C
kD 1 .! C 2k/
1 e j!
1
8.1 ae j! /2

X.e

j!

/D

<1

:0

0nM

j!j < !c

!c < j!j  

sin!.M C1/=2
e j!M=2
sin.!=2/

otherwise

P1

e j!0 n

kD 1

29

2.!

!0 C 2k/