You are on page 1of 57

Discrete-Time Signals and Systems

Chia-Ping Chen
Department of Computer Science and Engineering
National Sun Yat-sen University
Kaohsiung, Taiwan 800
Spring 2012
Outline
Discrete-time signals
Discrete-time systems
Representations
Fourier transforms
Periodic signals
Finite-duration signals
Random signals
Chia-Ping Chen Discrete-Time Signals and Systems
Signals
signals convey information
A speech signal conveys words, among other things.
An image conveys objects, among other things.
a signal is a function
A speech signal is a time function.
A radar signal is a function of time and space.
Chia-Ping Chen Discrete-Time Signals and Systems
Discrete-Time Signals
discrete-time signals
If the independent variable of a signal takes discrete values only, the
signal is said to be discrete-time.
representation as a sequence
Using the integer set for the independent variable of a discrete-time
signal, we represent a discrete-time signal by a sequence as follows
x = . . . , x[1], x[0], x[1], . . .
We often simply write
x[n].
Chia-Ping Chen Discrete-Time Signals and Systems
Basic Sequences and Operations
unit sample sequence
unit step sequence
exponential sequence
sinusoidal sequence
complex exponential sequence
periodic sequence
shift, reversal
addition and scalar multiplication
modulation, windowing
compression, expansion
convolution
Chia-Ping Chen Discrete-Time Signals and Systems
unit sample sequence
A unit sample sequence, or impulse sequence, is dened as
[n] =
_
1, n = 0
0, otherwise
time-shifted impulse sequence
[n k] =
_
1, n = k
0, otherwise
sum of time-shifted impulse sequence
Any x[n] can be decomposed by
x[n] =

k
x[k][n k].
Chia-Ping Chen Discrete-Time Signals and Systems
unit step sequence
A unit step sequence is dened as
u[n] =
_
1, n 0
0, n < 0
relationship with the impulse sequence
u[n] =

k0
[n k], [n] = u[n] u[n 1].
Chia-Ping Chen Discrete-Time Signals and Systems
rectangular sequence
A rectangular sequence is dened as
R
N
[n] =
_
1, 0 n N 1
0, otherwise
relationship with the impulse sequence and the step sequence
R
N
[n] =

0kN1
[n k], R
N
[n] = u[n] u[n N].
Chia-Ping Chen Discrete-Time Signals and Systems
exponential sequence
An exponential sequence is dened as
x[n] = A
n
.
In general, A = |A|e
j
and = ||e
j
0
.
right-sided exponential sequence
We often talk about a right-sided exponential sequence, which is
formed by multiplying an exponential sequence and a unit step
sequence
x[n] = A
n
u[n] =
_
A
n
, n 0,
0, otherwise.
Chia-Ping Chen Discrete-Time Signals and Systems
sinusoidal sequence
A real sinusoidal sequence is dened by
x[n] = Acos(
0
n + )
A is called amplitude,

0
is called angular frequency, and
is called phase.
Chia-Ping Chen Discrete-Time Signals and Systems
complex exponential sequence
A complex exponential sequence is an exponential sequence with
|| = 1, i.e.,
x[n] = |A|e
j
0
n+
= |A| cos(
0
n + ) + j |A| sin(
0
n + ).
Note that both the real and imaginary parts of x[n] are sinusoidal
functions.
Chia-Ping Chen Discrete-Time Signals and Systems
periodic sequence
A sequence is said to be periodic with period N, if
x[n] = x[n + N], n.
Example
A sinusoidal sequence is periodic if and only if its frequency satises

0
2
=
p
q
, p, q Z.
It follows that there exists m, N Z such that N =
2

0
m, and
cos(
0
(n + N) + ) = cos(
0
n + 2m + ) = cos(
0
n + ).
Chia-Ping Chen Discrete-Time Signals and Systems
time shift
y[n] is x[n] delayed, or shifted to the right, by an integer d if
y[n] = x[n d].
time reversal
The time-reversed signal of x[n] is dened by
y[n] = x[n].
Chia-Ping Chen Discrete-Time Signals and Systems
addition
The addition of signals x[n] and y[n] is
z[n] = x[n] + y[n]
scalar multiplication
The scalar multiplication of signal x[n] is dened by
z[n] = x[n]
Chia-Ping Chen Discrete-Time Signals and Systems
product or modulation
The product of signals x[n] and y[n] is dened by
z[n] = x[n] y[n]
This is also known as modulation.
windowing
If y[n] is of nite-length, such as
y[n] = R
N
[n],
modulation by y[n] is called windowing.
Chia-Ping Chen Discrete-Time Signals and Systems
compression with parameter M
The compression of a signal x[n] with parameter M is dened by
x
D
[n] = x[Mn].
That is, one out of every M points of signal x[n] is extracted. The
remaining points are discarded.
expansion with parameter N
The expansion of a signal x[n] with parameter N is dened by
x
I
[n] = x[n/N], n%N = 0.
That is, N 1 zeros are inserted between the adjacent points of x[n].
Chia-Ping Chen Discrete-Time Signals and Systems
convolution
The convolution of two signals x[n] and h[n] is dened by
x[n] h[n] =

k
x[k]h[n k], n = . . . , 0, 1, . . .
step-by-step
To evaluate x[n] h[n] at a point n
1
reverse h[k], i.e., h

[k] = h[k]
2
shift h

[k] to the right by n, i.e.,


h

[k] = h

[k n] = h[(k n)] = h[n k]


3
modulate x[k] and h

[k]
4
sum over all k
Chia-Ping Chen Discrete-Time Signals and Systems
Example
Suppose
x[n] = [n] + 2[n 1] + [n 2],
h[n] = [n] + [n 1] + [n 2].
Compute
y[n] = x[n] h[n],
and
z[n] = h[n] x[n].
Chia-Ping Chen Discrete-Time Signals and Systems
properties of convolution
1
commutivity
x[n] h[n] = h[n] x[n].
2
associativity
(x[n] y[n]) z[n] = x[n] (y[n] z[n])
3
distributivity
x[n] (h[n] + g[n]) = x[n] h[n] + x[n] g[n].
Chia-Ping Chen Discrete-Time Signals and Systems
Discrete-Time System
discrete-time system
A discrete-time system is a transformation T that maps an input
sequence x[n] to an output sequence y[n]
y[n] = T{x[n]}.
Examples
1
ideal delay
y[n] = x[n n
d
].
2
moving average
y[n] =
1
M
1
+ M
2
+ 1
M
2

k=M
1
x[n k].
Chia-Ping Chen Discrete-Time Signals and Systems
linear system
A system is said to be linear if
T{x
1
[n] + x
2
[n]} = T{x
1
[n]} + T{x
2
[n]}
T{ax[n]} = aT{x[n]}
Example
The accumulator dened by
y[n] =
n

k=
x[k]
is linear.
Chia-Ping Chen Discrete-Time Signals and Systems
time-invariant system
Suppose that
y[n] = T{x[n]}.
T is said to be time-invariant if
T{x[n n
d
]} = y[n n
d
].
Example
The accumulator is time-invariant, since
T{x[n n
d
]} =
n

k=
x[k n
d
] =
nn
d

=
x[k

] = y[n n
d
].
Chia-Ping Chen Discrete-Time Signals and Systems
Example (non-time-invariant system)
Consider a compressor
y[n] = T{x[n]} = x[Mn], < n < .
We have
T{x[n n
d
]} = x[Mn n
d
],
y[n n
d
] = x[M(n n
d
)].
So
T{x[n n
d
]} = y[n n
d
].
That is, a compressor is not time-invariant.
Chia-Ping Chen Discrete-Time Signals and Systems
causal system
A system is said to be causal if the output value at any n
0
only
depends on the input values at n n
0
.
Examples
Which of the systems are causal?
accumulator?
moving average?
A forward dierence system dened by
y[n] = x[n + 1] x[n].
A backward dierence system dened by
y[n] = x[n] x[n 1].
Chia-Ping Chen Discrete-Time Signals and Systems
stable system
A discrete-time system is said to be stable if a bounded input leads
to a bounded output (BIBO). Mathematically,
|x[n]| B
x
|y[n]| B
y
Examples
Which of the systems are stable?
accumulator?
moving average?
Chia-Ping Chen Discrete-Time Signals and Systems
Impulse Response
impulse response function
The impulse response function of a system is the output when the
input is the impulse sequence, i.e.,
h[n] = T{[n]}.
Examples
1
ideal delay [n] [n]
2
moving average [n]
1
M
1
+M
2
+1

M
2
k=M
1
[n k] = h[n]
3
accumulator [n]

n
k=
[k] = u[n] = h[n]
4
forward dierence [n] [n + 1] [n] = h[n]
5
backward dierence [n] [n] [n 1] = h[n]
Chia-Ping Chen Discrete-Time Signals and Systems
linear time-invariant system
A discrete-time system T is said to be linear time-invariant (LTI)
if it is linear and time-invariant.
LTI and Convolution
The output signal of an LTI system is the convolution of the input
signale and the systems impulse response function.
Proof
Using the linearity and time-invariance of T, we have
y[n] = T{x[n]} = T
_

m
x[m][n m]
_
=

m
x[m]T{[n m]}
=

m
x[m]h[n m].
Chia-Ping Chen Discrete-Time Signals and Systems
stable system
An LTI system is stable if and only if

n
|h[n]| < .
Proof
Suppose the system is stable. The output has to be bounded for any
input. Consider the particular input
x[n] =
_
h

[n]
|h[n]|
, h[n] = 0
0, h[n] = 0.
For the output signal at n = 0, we have
|y[0]| B

k
x[k]h[k]

k
h

[k]
|h[k]|
h[k]

k
|h[k]| B
Chia-Ping Chen Discrete-Time Signals and Systems
causal system
An LTI system is causal if and only if
h[n] = 0, for n < 0.
Proof
This can be easily seen by
y[n] =

h[k]x[n k] =

k0
h[k]x[n k].
causal signal
A signal x[n] is said to be causal if
x[n] = 0, for n < 0.
Chia-Ping Chen Discrete-Time Signals and Systems
connection of systems
There are two basic ways to connect two LTI systems: cascade and
parallel. The overall system functions are respectively
cascade
h[n] = h
1
[n] h
2
[n].
parallel
h[n] = h
1
[n] + h
2
[n].
Examples
The cascade of a forward dierence system and a one-sample delay
h[n] = ([n + 1] [n]) [n 1] = [n] [n 1]
The cascade of a backward dierence system and an accumulator
h[n] = u[n] ([n] [n 1]) = u[n] u[n 1] = [n].
Chia-Ping Chen Discrete-Time Signals and Systems
inverse system
Generally, the impulse responses of a system and its inverse system
satises
h[n] h
i
[n] = h
i
[n] h[n] = [n], n = . . . , 1, 0, 1, . . . .
Given h[n], it may be dicult to solve for h
i
[n] based on the above
equation. The same problem may become much easier to solve after
we introduce the z-transform!
Chia-Ping Chen Discrete-Time Signals and Systems
linear constant-coecient dierence equation
A linear constant-coecient dierence equation (LCCDE) is dened
by
N

k=0
a
k
y[n k] =
M

m=0
b
m
x[n m].
N is called the order of this dierence equation.
LCCDE characterizes the input-output relation of a system.
Example
For an accumulator,
y[n] y[n 1] =
n

k=
x[k]
n1

k=
x[k] = x[n].
which is an LCCDE with N = 1, a
0
= 1, a
1
= 1, M = 0, b
0
= 1.
Chia-Ping Chen Discrete-Time Signals and Systems
LCCDE is not unique
For a causal moving average system, we have
y[n] =
1
M
2
+ 1
M
2

m=0
x[n m],
which is an LCCDE with N = 0, a
0
= 1, M = M
2
, b
m
= 1/(M
2
+1).
Alternatively
y[n] y[n 1] =
1
M
2
+ 1
(x[n] x[n M
2
1]),
which is a dierent LCCDE with
N = 1, a
0
= 1, a
1
= 1, M = M
2
+ 1, b
0
= b
M
2
+1
=
1
M
2
+ 1
.
Chia-Ping Chen Discrete-Time Signals and Systems
nite impulse response, innite impulse response
A system is called nite impulse response (FIR) if the impulse
response function is of nite duration. Otherwise, it is called innite
impulse response (IIR).
Example
For example, suppose N = 0 in an LCCDE,
y[n] =
M

m=0
b
m
a
0
x[n m].
The impulse response is of nite length
h[n] =
M

m=0
_
b
m
a
0
_
[n m] =
_
_
b
m
a
0
_
, 0 m M
0, otherwise
Chia-Ping Chen Discrete-Time Signals and Systems
Spectral-domain Analysis
A complex exponential signal is an eigenvector of an LTI system
Consider a complex exponential signal with frequency and an LTI
system. If e
j n
is the input, the output is
y[n] = x[n] h[n] =

m
h[m]e
j (nm)
=
_

m
h[m]e
j m
_
e
j n
= H(e
j
)x[n].
Therefore, e
j n
is an eigenvector with eigenvalue
H(e
j
) =

m
h[m]e
j m
.
Chia-Ping Chen Discrete-Time Signals and Systems
frequency response
H(e
j
) is called frequency response of the system. In general,
H(e
j
) is complex, and we can write it in the polar form
H(e
j
) = |H(e
j
)|e
j arg(H(e
j
))
.
|H(e
j
)| is called the magnitude response.
arg(H(e
j
)) is called the phase response.
Chia-Ping Chen Discrete-Time Signals and Systems
arbitrary signal
Suppose a signal can be represented as a linear combination of
complex exponentials
x[n] =

k
e
j
k
n
.
Let x[n] be the input signal to an LTI system with frequency response
H(e
j
). According to the principle of superposition, the output signal
is
y[n] =

k
e
j
k
n
H(e
j
k
).
Chia-Ping Chen Discrete-Time Signals and Systems
Discrete-Time Fourier Transform
discrete-time Fourier transform
The discrete-time Fourier transform (DTFT) of a signal x[n] is
dened by
X(e
j
) =

n
x[n]e
j n
.
X(e
j
) is also called the spectrum of x[n].
frequency response and DTFT
Recall that
H(e
j
) =

m
h[m]e
j m
.
That is, the frequency response of an LTI system is the DTFT of its
impulse response.
Chia-Ping Chen Discrete-Time Signals and Systems
Examples
1
(ideal delay) h[n] = [n n
d
]. The frequency response is the
DTFT of h[n],
H(e
j
) =

n
[n n
d
]e
j n
= e
j n
d
.
The magnitude and phase responses are 1 and n
d
.
2
(moving average) h[n] =
1
M
1
+M
2
+1

M
2
k=M
1
[n k]. The
frequency response is
H(e
j
) =
1
M
1
+ M
2
+ 1
M
2

k=M
1
e
j k
=
1
M
1
+ M
2
+ 1
sin[(M
1
+ M
2
+ 1)/2]
sin(/2)
e
j (M
2
M
1
)/2
Chia-Ping Chen Discrete-Time Signals and Systems
sinusoidal input signal
Consider a sinusoidal signal as input
x[n] = Acos(
0
n + ) =
A
2
e
j
e
j
0
n
+
A
2
e
j
e
j
0
n
.
The output is (by superposition)
y[n] = H(e
j
0
)
A
2
e
j
e
j
0
n
+ H(e
j
0
)
A
2
e
j
e
j
0
n
.
If h[n] is real, H(e
j
0
) = H

(e
j
0
), and we have
y[n] = A|H(e
j
0
)| cos(
0
n + + ), = arg H(e
j
0
)
For the ideal delay system, as expected,
y[n] = Acos(
0
(n n
d
) + ) = x[n n
d
].
Chia-Ping Chen Discrete-Time Signals and Systems
x[n] can be reconstructed from X(e
j
)
x[n] =
1
2
_

X(e
j
)e
j n
d.
Proof
It can be proved by noting that
1
2
_

e
j (nn

)
d = [n n

].
Chia-Ping Chen Discrete-Time Signals and Systems
analysis of signal
(DTFT)
X(e
j
) =

n
x[n]e
j n
.
synthesis of signal
(inverse DTFT)
x[n] =
1
2
_

X(e
j
)e
j n
d.
Chia-Ping Chen Discrete-Time Signals and Systems
Properties of DTFT
1
linearity
c
1
x
1
[n] + c
2
x
2
[n] c
1
X
1
(e
j
) + c
2
X
2
(e
j
)
2
time shifting
x[n n
d
] e
j n
d
X(e
j
)
3
frequency shifting
e
j
0
n
x[n] X(e
j (
0
)
)
4
time reversal
x[n] X(e
j
)
5
dierentiation
nx[n] j
dX(e
j
)
d
Chia-Ping Chen Discrete-Time Signals and Systems
Parsevals theorem

n
|x[n]|
2
=
1
2
_

|X(e
j
)|
2
d
convolution theorem
h[n] x[n] H(e
j
)X(e
j
)
modulation theorem
h[n]x[n]
1
2
_

X(e
j
)H(e
j ()
)d
Chia-Ping Chen Discrete-Time Signals and Systems
Periodic Sequences
periodic impulse sequence
A periodic impulse sequence with period N is dened by

N
[n] =

r=
[n rN].
complex exponential sequence
A complex exponential sequence with frequency
e
j n
, =
2
N
k
is also periodic with period N.
Chia-Ping Chen Discrete-Time Signals and Systems
identity
It is easy to show that
N1

k=0
e
j
2
N
kn
= (n%N == 0) ? N : 0 = N

N
[n].
Thus,

N
[n] =
1
N
N1

k=0
e
j
2
N
kn
.
More generally, for a shifted (to the right by m)

N
[n], we have

N
[n m] =
1
N
N1

k=0
e
j
2
N
k(nm)
=
1
N
N1

k=0
e
j
2
N
km
e
j
2
N
kn
.
Chia-Ping Chen Discrete-Time Signals and Systems
Discrete Fourier Series
representation of a periodic sequence
A periodic sequence is a linear combination of periodic impulses,
x[n] =
N1

m=0
x[m]

N
[n m].
Using the result on the previous slide, we have
x[n] =
N1

m=0
x[m]
_
1
N
N1

k=0
e
j
2
N
km
e
j
2
N
kn
_
=
1
N
N1

k=0
_
N1

m=0
x[m]e
j
2
N
km
_
e
j
2
N
kn
.
Chia-Ping Chen Discrete-Time Signals and Systems
discrete Fourier series
If we dene the coecients

X[k] =
N1

m=0
x[m]e
j
2
N
km
Then
x[n] =
1
N
N1

k=0

X[k]e
j
2
N
kn
.
The last equation decomposes a periodic signal into complex
exponentials. It is called discrete Fourier series (DFS).
Chia-Ping Chen Discrete-Time Signals and Systems
Finite Duration Sequence
nite-duration sequence
A nite-duration sequence of length N is dened by
x[n] = 0, n > N 1 or n < 0
periodic extension
The periodic extension of a nite-duration sequence is obtained by
repeating x[n]. That is,
x[n] = x[n%N].
One can verify that

X[k] = X(e
j
)|
=
k
=
2
N
k
.
Chia-Ping Chen Discrete-Time Signals and Systems
Frequency-Domain Sampling Theorem
frequency-domain sampling theorem
Suppose signal x[n] is of nite duration. The spectrum X(e
j
) can
be reconstructed by a nite number of samples of X(e
j
) located at
=
k
=
2
N
k, k = 0, . . . , N 1.
Proof
Given X(e
j
k
) =

X[k], we can
1
reconstruct the periodic extension x[n]
2
extract one period to get x[n]
3
apply DTFT to obtain X(e
j
)
Chia-Ping Chen Discrete-Time Signals and Systems
Discrete-Time Random Signals
random signal
A signal {x[n]} is often random. Thus, we describe {x[n]} as a
discrete-time random process. The mean of {x[n]} is represented
by
m
x
[k] = E[x[k]].
The correlation of {x[n]} is represented by

xx
[k, l ] = E[x[k]x[l ]].
Chia-Ping Chen Discrete-Time Signals and Systems
wide-sense stationary signal
A signal {x[n]} is wide-sense stationary (WSS) if the mean and
correlation are time-invariant
m
x
= E[x[n]],

xx
[m] = E[x[n]x[n + m]].
correlation sequence
{
xx
[]} is called the correlation sequence of {x[n]}.
Chia-Ping Chen Discrete-Time Signals and Systems
output signal of a random input signal
A system is characterized by impulse response {h[n]}. Suppose input
{x[n]} is WSS. For the output signal {y[n]}, we have
E[y[n]] = E
_

h[k]x[n k]
_
=

h[k]E[x[n k]]
= m
x

h[k].
The correlation is

yy
[m] = E[y[n]y[n + m]] =

r
h[k]h[r ]
xx
[m + k r ]
=

l
c
hh
[l ]
xx
[m l ],
where c
hh
[l ]

k
h[k]h[k + l ].
Chia-Ping Chen Discrete-Time Signals and Systems
spectral-domain consideration
Denoting the Fourier transform of {
xx
[m]}, {
yy
[m]}, and {c
hh
[l ]}
by
xx
(e
j
),
yy
(e
j
), and C
hh
(e
j
), we have

yy
(e
j
) = C
hh
(e
j
)
xx
(e
j
)
= |H(e
j
)|
2

xx
(e
j
).
Considering the output signal power, we have
E[y[n]
2
] =
yy
[0] =
1
2
_

yy
(e
j
)d
=
1
2
_

|H(e
j
)|
2

xx
(e
j
)d 0.
Chia-Ping Chen Discrete-Time Signals and Systems
white noises
A zero-mean white noise {x[n]} is dened by
m
x
= 0,
xx
[m] =
2
[m].
The power density spectrum of {x[n]} is the Fourier transform of

xx
[m]

xx
(e
j
) =
2
.
The power of {x[n]} is obtained by integrating the power density
spectrum over frequency
1
2
_

2
d =
2
.
Chia-Ping Chen Discrete-Time Signals and Systems
generating a random signal
A random signal can be generated as the output signal of an
appropriate LTI system with a random input signal.
For a white noise as the input, we have

yy
(e
j
) = |H(e
j
)|
2

2
,
so we can adjust H(e
j
) and to get the intended
yy
(e
j
).
Chia-Ping Chen Discrete-Time Signals and Systems
estimation of a system function
The cross-correlation between the input signal and the output signal
is

xy
[m] =

k
h[k]
xx
[m k].
Using a white noise as input, we have

xy
[m] =
2
h[m],
xy
(e
j
) =
2
H(e
j
)
Thus the white noise can be used to estimate h[n] and H(e
j
) of a
system.
Chia-Ping Chen Discrete-Time Signals and Systems

You might also like