Signals and Signal Processing: - Signals Play An Important Role in Our Daily Life

Download as pdf or txt
Download as pdf or txt
You are on page 1of 43

8/27/2013

1
1
Signals and Signal Processing
Signals play an important role in our daily
life
A signal is a function of independent
variables such astime, distance, position,
temperature, andpressure
Some examples of typical signals are shown
next
2
Examples of Typical Signals
Speech and music signals - Represent air
pressureas a function of timeat a point in
space
Waveform of the speech signal I like
digital signal processing is shown below
0 1 2 3
-1
-0.5
0
0.5
1
Time, sec.
A
m
p
l
i
t
u
d
e
8/27/2013
2
Examples of Typical Signals
Handels Hallelujah Chorus
1 2 3 4 5 6 7
x 10
4
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
Time index
A
m
p
lit
u
d
e
9 sec
143Kb (wav)
4
Examples of Typical Signals
Electrocardiography (ECG) Signal -
Represents the electrical activity of the
heart
A typical ECG signal is shown below
8/27/2013
3
5
Examples of Typical Signals
Electroencephalogram (EEG) Signals -
Represent the electrical activity caused by
the random firings of billions of neurons in
the brain
6
Examples of Typical Signals
Typical seismograph record
8/27/2013
4
7
Examples of Typical Signals
Black-and-white picture- Represents light
intensityas a function of two spatial
coordinates
I(x,y)
8
Examples of Typical Signals
Video signals - Consists of a sequence of
images, called frames, and is a function of 3
variables: 2spatial coordinatesand time
1 Frame 3 Frame 5 Frame
Video
video the on Click
8/27/2013
5
9
Signals and Signal Processing
A signal carries information
Objective of signal processing: Extract the
useful informationcarried by the signal
Method information extraction: Depends on
the type of signal and the nature of the
information being carried by the signal
This course is concerned with the discrete-
time representation of signals and their
discrete-time processing
10
Characterization and
Classification of Signals
Types of signal: Depends on the nature of
the independent variables and the value of
the function defining the signal
For example, the independent variables can
be continuous or discrete
Likewise, the signal can be a continuous or
discrete function of the independent
variables
8/27/2013
6
11
Characterization and
Classification of Signals
Moreover, the signal can be either a real-
valuedfunction or a complex-valued
function
A signal generated by a single sourceis
called a scalar signal
A signal generated by multiple sourcesis
called a vector signal or a multichannel
signal
12
Characterization and
Classification of Signals
A one-dimensional (1-D) signal is a
function of a single independent variable
A multidimensional (M-D) signal is a
function of more than one independent
variables
The speech signal is an example of a 1-D
signal where the independent variable is
time
8/27/2013
7
13
Characterization and
Classification of Signals
An image signal, such as a photograph, is
an example of a 2-D signal where the 2
independent variables are the 2spatial
variables
A color image signal is composed of three
2-Dsignals representing the threeprimary
colors: red, greenand blue(RGB)
14
Characterization and
Classification of Signals
Each frameof a black-and-white digital
video signal is a 2-D image signal that is a
function of 2discrete spatial variables, with
each frameoccurring at discrete instants of
time
Hence, black-and-white digital video signal
can be considered as an example of a 3-D
signal where the 3independent variables are
the 2spatial variables andtime
8/27/2013
8
15
Characterization and
Classification of Signals
A color video signal is a 3-channel signal
composed of three3-D signalsrepresenting
the three primary colors: red, greenand blue
(RGB)
For transmission purposes, the RGB
television signal is transformed into another
type of 3-channel signal composed of a
luminancecomponent and 2chrominance
components
16
Characterization and
Classification of Signals
For a 1-D signal, the independent variable is
usually labeled as time
If the independent variable is continuous,
the signal is called a continuous-time signal
If the independent variable is discrete, the
signal is called a discrete-time signal
8/27/2013
9
17
Characterization and
Classification of Signals
A continuous-time signal is defined at every
instant of time
A discrete-time signal is defined at discrete
instants of time, and hence, it is a sequence
of numbers
A continuous-time signal with a continuous
amplitude is usually called an analog signal
A speech signal is an example of an analog
signal
18
Characterization and
Classification of Signals
A discrete-time signal with discrete-valued
amplitudes represented by a finite number
of digits is referred to as the digital signal
An example of a digital signal is the
digitized music signal stored in a CD-ROM
disk
A discrete-time signal with continuous-
valued amplitudes is called a sampled-data
signal
8/27/2013
10
19
Characterization and
Classification of Signals
A digital signal is thus a quantized sampled-
data signal
A continuous-time signal with discrete-
value amplitudes is usually called a
quantized boxcar signal
The figure in the next slide illustrates the 4
types of signals
20
Characterization and
Classification of Signals
signal time - continuous A
signal data - sampled A
signal boxcar quantized A
t Time,
Amplitude
t Time,
Amplitude
t Time,
Amplitude
t Time,
Amplitude
signal digital A
8/27/2013
11
21
Characterization and
Classification of Signals
The functional dependence of a signal in its
mathematical representation is often
explicitly shown
For a continuous-time1-Dsignal, the
continuous independent variable is usually
denoted byt
For example, u(t) represents acontinuous-
time1-Dsignal
Characterization and
Classification of Signals
Continuous-time signal
is known as sinusoid with amplitude A,
frequency f
0
and phase shift
is called angular frequency
22
( ) cos(2 ) cos( )
o o
u t A f t A t t | | = + = O +
|
o
O
8/27/2013
12
23
Characterization and
Classification of Signals
For a discrete-time 1-Dsignal, the discrete
independent variable is usually denoted by
n
For example, {v[n]}represents a discrete-
time 1-D signal
Each member, v[n], of a discrete-time signal
is called a sample
24
Characterization and
Classification of Signals
In many applications, a discrete-time signal
is generated by samplinga parent
continuous-time signal at uniform intervals
of time
If the discrete instants of time at which a
discrete-time signal is defined are uniformly
spaced, the independent discrete variable n
can be normalized to assume integer values
8/27/2013
13
25
Characterization and
Classification of Signals
A signal that can be uniquely determined by
a well-defined process, such as a
mathematical expression or rule, or table
look-up, is called adeterministic signal
A signal that is generated in a random
fashion and cannot be predicted ahead of
time is called arandom signal
26
DSP Application Examples
Cellular Phone
Discrete Multitone Transmission
Digital Camera
Digital Sound Synthesis
Signal Coding & Compression
Signal Enhancement
8/27/2013
14
Copyright 2005, S.
K. Mitra
Operations on Sequences
A single-input, single-output discrete-time
system operates on a sequence, called the
input sequence, according some prescribed
rules and develops another sequence, called
the output sequence, with more desirable
properties
x[n] y[n]
Input sequence Output sequence
Discrete-time
system
Copyright 2005, S.
K. Mitra
Operations on Sequences
For example, the input may be a signal
corrupted with additive noise
Discrete-time system is designed to
generate an output by removing the noise
component from the input
In most cases, the operation defining a
particular discrete-time system is composed
of some basic operations
8/27/2013
15
Copyright 2005, S.
K. Mitra
Basic Operations
Product (modulation) operation:
Modulator
An application is in forming a finite-length
sequence from an infinite-length sequence
by multiplying the latter with a finite-length
sequence called an window sequence
Process called windowing
x[n] y[n]
w[n]
] [ ] [ ] [ n w n x n y =
Copyright 2005, S.
K. Mitra
Basic Operations
Addition operation:
Adder
Multiplication operation
Multiplier
] [ ] [ ] [ n w n x n y + =
A
x[n]
y[n] ] [ ] [ n x A n y =
x[n]
y[n]
w[n]
+
8/27/2013
16
Copyright 2005, S.
K. Mitra
Basic Operations
Time-shifting operation:
where N is an integer
If N >0, it is delaying operation
Unit delay
If N <0, it is an advance operation
Unit advance
] [ ] [ N n x n y =
y[n]
x[n] z
1
z
y[n]
x[n]
] [ ] [ 1 = n x n y
] [ ] [ 1 + = n x n y
Copyright 2005, S.
K. Mitra
Basic Operations
Time-reversal (folding) operation:
Branching operation: Used to provide
multiple copies of a sequence
] [ ] [ n x n y =
x[n]
x[n]
x[n]
8/27/2013
17
Copyright 2005, S.
K. Mitra
Basic Operations
Example- Consider the two following
sequences of length 5defined for :
New sequences generated from the above
two sequences by applying the basic
operations are as follows:
4 0 s s n
} { ]} [ { 0 9 6 4 3 = n a
} { ]} [ { 3 5 4 1 2 = n b
Copyright 2005, S.
K. Mitra
Basic Operations
As pointed out by the above example,
operations on two or more sequences can be
carried out if all sequences involved are of
same length and defined for the same range
of the time indexn
} { ]} [ ] [ { ]} [ { 0 45 24 4 6 = = n b n a n c
} { ]} [ ] [ { ]} [ { 3 4 10 3 5 = + = n b n a n d
} . . { ]} [ { ]} [ { 0 5 13 9 6 5 4
2
3
= = n a n e
8/27/2013
18
Copyright 2005, S.
K. Mitra
Basic Operations
However if the sequences are not of same
length, in some situations, this problem can
be circumvented by appending zero-valued
samples to the sequence(s) of smaller
lengths to make all sequences have the same
range of the time index
Example- Consider the sequence of length
3defined for :
} { ]} [ { 3 1 2 = n f
2 0 s s n
Copyright 2005, S.
K. Mitra
Basic Operations
We cannot add the length-3sequence
to the length-5sequence {a[n]}defined
earlier
We therefore first append with 2
zero-valued samples resulting in a length-5
sequence
Then
]} [ { n f
]} [ { n f
} { ]} [ { 0 0 3 1 2 = n f
e
} 0 9 3 5 1 { ]} [ { ]} [ { ]} [ { = + = n f n a n g
e
8/27/2013
19
Copyright 2005, S.
K. Mitra
Basic Operations
Ensemble Averaging
A very simple application of the addition
operation in improving the quality of
measured data corrupted by an additive
random noise
In some cases, actual uncorrupted data
vector s remains essentially the same from
one measurement to next
Copyright 2005, S.
K. Mitra
Basic Operations
While the additive noise vector is random
and not reproducible
Let denote the noise vector corrupting
the i-th measurement of the uncorrupted
data vector s:
i
d
i i
d s x + =
8/27/2013
20
Copyright 2005, S.
K. Mitra
Basic Operations
The average data vector, called the
ensemble average, obtained after K
measurements is given by
For large values of K, is usually a
reasonable replica of the desired data vector
s
ave
x

+ =

+ =

=
= = =
K
i
i
K
K
i
i
K
K
i
i
K
ave
1
1
1
1
1
1
d s d s x x ) (
Copyright 2005, S.
K. Mitra
Basic Operations
Example
0 10 20 30 40 50
0
2
4
6
8
Timeindex n
A
m
p
l
i
t
u
d
e
Original uncorrupted data
0 10 20 30 40 50
-0.5
0
0.5
Timeindex n
A
m
p
l
i
t
u
d
e
Noise
0 10 20 30 40 50
-2
0
2
4
6
8
Timeindex n
A
m
p
l
i
t
u
d
e
Noisecorrupted data
0 10 20 30 40 50
-2
0
2
4
6
8
Timeindex n
A
m
p
l
i
t
u
d
e
Ensembleaverage
8/27/2013
21
Copyright 2005, S.
K. Mitra
Combinations of Basic
Operations
Example-
] 3 [ ] 2 [ ] 1 [ ] [ ] [
4 3 2 1
+ + + = n x n x n x n x n y o o o o
42
Discrete-Time Systems: Examples
Accumulator -
The output y[n] at time instant n is the sum
of the input sample x[n] at time instant n
and the previous output at time
instant which is the sum of all
previous input sample values from to
The system cumulatively adds, i.e., it
accumulates all input sample values

=
=
n
x n y

] [ ] [
] [ ] 1 [ ] [ ] [
1
n x n y n x x
n
+ = +

=

=

] 1 [ n y
, 1 n
1 n

8/27/2013
22
43
Discrete-Time Systems:Examples
Accumulator - Input-output relation can
also be written in the form
The second form is used for a causal input
sequence, in which case is called
the initial condition

=
=

=
n
x x n y
0
1
] [ ] [ ] [


, ] [ ] 1 [
0

+ =
=
n
x y

] 1 [ y
0 > n
44
Discrete-Time Systems:Examples
M-point moving-average system-
Used in smoothing random variations in
data
In most applications, the data x[n] is a
bounded sequence
M-point average y[n] is also a
bounded sequence

=

=
1
0
1
] [ ] [
M
k
M
k n x n y
8/27/2013
23
45
Discrete-Time Systems:Examples
If there is no bias in the measurements, an
improved estimate of the noisy data is
obtained by simply increasingM
A direct implementation of the M-point
moving average system requires
additions, 1division, and storage of
past input data samples
A more efficient implementation is
developed next
1 M
1 M
46
Discrete-Time Systems:Examples
This imagecannot currently be displayed.
|
.
|

\
|

+ =

=
1
0
1
] [ ] [ ] [ ] [
M
M
M n x M n x n x n y

|
.
|

\
|

+ =
=
M
M
M n x n x n x
1
1
] [ ] [ ] [

|
.
|

\
|

+ =

=
1
0
1
] [ ] [ ] 1 [
M
M
M n x n x n x

( ) ] [ ] [ ] 1 [ ] [
1
M n x n x n y n y
M
+ =
Hence
8/27/2013
24
47
Discrete-Time Systems:Examples
Computation of the modified M-point
moving average system using the recursive
equation now requires 2additions and 1
division
An application: Consider
x[n] =s[n] +d[n],
where s[n] is the signal corrupted by a noise
d[n]
48
d[n] - random signal
This imagecannot currently be displayed.
], ) 9 . 0 ( [ 2 ] [
n
n n s =
Discrete-Time Systems:Examples
0 10 20 30 40 50
-2
0
2
4
6
8
Timeindex n
A
m
p
l
i
t
u
d
e
d[n]
s[n]
x[n]
0 10 20 30 40 50
0
1
2
3
4
5
6
7
Timeindex n
A
m
p
l
i
t
u
d
e
s[n]
y[n]
8/27/2013
25
Copyright 2005, S.
K. Mitra
Basic Sequences
Unit sample sequence -
Unit step sequence -

=
=
=
0 , 0
0 , 1
] [
n
n
n o
1
4 3 2 1 0 1 2 3 4 5 6
n

<
>
=
0 , 0
0 , 1
] [
n
n
n
4 3 2 1 0 1 2 3 4 5 6
1
n
50
Impulse and Step Responses
The response of a discrete-time system to a
unit sample sequence {o[n]}is called the
unit sample response or simply, the
impulse response, and is denoted by{h[n]}
The response of a discrete-time system to a
unit step sequence {[n]}is called the unit
step response or simply, the step response,
and is denoted by{s[n]}
8/27/2013
26
51
Impulse Response
Example- The impulse response of the
system
is obtained by setting x[n] =o[n] resulting
in
The impulse response is thus a finite-length
sequence of length 4given by
] 3 [ ] 2 [ ] 1 [ ] [ ] [
4 3 2 1
o + o + o + o = n x n x n x n x n y
} { ]} [ {
4 3 2 1
o o o o =
|
, , , n h
] 3 [ ] 2 [ ] 1 [ ] [ ] [
4 3 2 1
o o + o o + o o + o o = n n n n n h
52
Impulse Response
Example- The impulse response of the
discrete-time accumulator
is obtained by setting x[n] =o[n] resulting
in

=
=
n
x n y

] [ ] [
] [ ] [ ] [ n n h
n
=

o =
=

8/27/2013
27
53
Impulse Response
Example- The impulse response {h[n]}of
the factor-of-2interpolator
is obtained by setting and is
given by
The impulse response is thus a finite-length
sequence of length 3:
]) [ ] [ ( ] [ ] [ 1 1
2
1
+ + + = n x n x n x n y
u u u
]) 1 [ ] 1 [ ( ] [ ] [
2
1
+ o + o + o = n n n n h
} . , . { ]} [ { 5 0 1 5 0
|
= n h
] [ ] [ n n x
u
o =
54
Convolution Sum
The summation
is called theconvolution sumof the
sequencesx[n] andh[n] and represented
compactly as


=

=
= =
k k
n h k n x k n h k x n y ] [ ] [ ] [ ] [ ] [
y[n] =x[n] h[n]
*
8/27/2013
28
55
Convolution Sum
Properties -
Commutative property:
Associative property :
Distributive property :
x[n] h[n] =h[n] x[n]
* *
(x[n] h[n]) y[n] =x[n] (h[n] y[n])
* * * *
x[n] (h[n] +y[n]) =x[n] h[n] +x[n] y[n]
* *
*
56
Convolution Sum
Interpretation -
1) Time-reverse h[k] to form
2) Shift to the right by n sampling
periods if n >0or shift to the left by n
sampling periods if n <0to form
3) Form the product
4) Sum all samples of v[k] to develop the
n-th sample of y[n] of the convolution sum
] [ k h
] [ k h
] [ k n h
] [ ] [ ] [ k n h k x k v =
8/27/2013
29
57
Convolution Sum
Schematic Representation -
The computation of an output sample using
the convolution sum is simply a sum of
products
Involves fairly simple operations such as
additions, multiplications, and delays

n
z
] [ k n h
] [ k h
] [k x
] [k v
] [n y

k
58
Convolution Sum
We illustrate the convolution operation for
the following two sequences:
Figures on the next several slides the steps
involved in the computation of
y[n] =x[n] h[n]
*

s s
=
otherwise , 0
5 0 , 1
] [
n
n x

s s
=
otherwise , 0
5 0 , 3 . 0 8 . 1
] [
n n
n h
8/27/2013
30
59
Convolution Sum
-10 0 10
-0.5
0
0.5
1
1.5
2
A
m
p
l
i
t
u
d
e
Plot of x[-4- k] and h[k]
-10 0 10
0
1
2
3
A
m
p
l
i
t
u
d
e
h[k]x[-4- k]
-10 0 10
0
2
4
6
8
n
A
m
p
l
i
t
u
d
e
y[-4]
-10 0 10
0
2
4
6
8
n
A
m
p
l
i
t
u
d
e
y[n]
k k
60
Convolution Sum
-10 0 10
-0.5
0
0.5
1
1.5
2
A
m
p
l
i
t
u
d
e
Plot of x[-1- k] and h[k]
-10 0 10
0
1
2
3
A
m
p
l
i
t
u
d
e
h[k]x[-1- k]
-10 0 10
0
2
4
6
8
n
A
m
p
l
i
t
u
d
e
y[-1]
-10 0 10
0
2
4
6
8
n
A
m
p
l
i
t
u
d
e
y[n]
k k
8/27/2013
31
61
Convolution Sum
-10 0 10
-0.5
0
0.5
1
1.5
2
A
m
p
l
i
t
u
d
e
Plot of x[0- k] and h[k]
-10 0 10
0
1
2
3
A
m
p
l
i
t
u
d
e
h[k]x[0- k]
-10 0 10
0
2
4
6
8
n
A
m
p
l
i
t
u
d
e
y[0]
-10 0 10
0
2
4
6
8
n
A
m
p
l
i
t
u
d
e
y[n]
k k
62
Convolution Sum
-10 0 10
-0.5
0
0.5
1
1.5
2
A
m
p
l
i
t
u
d
e
Plot of x[1- k] and h[k]
-10 0 10
0
1
2
3
A
m
p
l
i
t
u
d
e
h[k]x[1- k]
-10 0 10
0
2
4
6
8
n
A
m
p
l
i
t
u
d
e
y[1]
-10 0 10
0
2
4
6
8
n
A
m
p
l
i
t
u
d
e
y[n]
k k
8/27/2013
32
63
Convolution Sum
-10 0 10
-0.5
0
0.5
1
1.5
2
A
m
p
l
i
t
u
d
e
Plot of x[3- k] and h[k]
-10 0 10
0
1
2
3
A
m
p
l
i
t
u
d
e
h[k]x[3- k]
-10 0 10
0
2
4
6
8
n
A
m
p
l
i
t
u
d
e
y[3]
-10 0 10
0
2
4
6
8
n
A
m
p
l
i
t
u
d
e
y[n]
k k
64
Convolution Sum
-10 0 10
-0.5
0
0.5
1
1.5
2
A
m
p
l
i
t
u
d
e
Plot of x[5- k] and h[k]
-10 0 10
0
1
2
3
A
m
p
l
i
t
u
d
e
h[k]x[5- k]
-10 0 10
0
2
4
6
8
n
A
m
p
l
i
t
u
d
e
y[5]
-10 0 10
0
2
4
6
8
n
A
m
p
l
i
t
u
d
e
y[n]
k k
8/27/2013
33
65
Convolution Sum
-10 0 10
-0.5
0
0.5
1
1.5
2
A
m
p
l
i
t
u
d
e
Plot of x[7- k] and h[k]
-10 0 10
0
1
2
3
A
m
p
l
i
t
u
d
e
h[k]x[7- k]
-10 0 10
0
2
4
6
8
n
A
m
p
l
i
t
u
d
e
y[7]
-10 0 10
0
2
4
6
8
n
A
m
p
l
i
t
u
d
e
y[n]
k k
66
Convolution Sum
-10 0 10
-0.5
0
0.5
1
1.5
2
A
m
p
l
i
t
u
d
e
Plot of x[9- k] and h[k]
-10 0 10
0
1
2
3
A
m
p
l
i
t
u
d
e
h[k]x[9- k]
-10 0 10
0
2
4
6
8
n
A
m
p
l
i
t
u
d
e
y[9]
-10 0 10
0
2
4
6
8
n
A
m
p
l
i
t
u
d
e
y[n]
k k
8/27/2013
34
67
Convolution Sum
-10 0 10
-0.5
0
0.5
1
1.5
2
A
m
p
l
i
t
u
d
e
Plot of x[10- k] and h[k]
-10 0 10
0
1
2
3
A
m
p
l
i
t
u
d
e
h[k]x[10- k]
-10 0 10
0
2
4
6
8
n
A
m
p
l
i
t
u
d
e
y[10]
-10 0 10
0
2
4
6
8
n
A
m
p
l
i
t
u
d
e
y[n]
k k
68
Convolution Sum
-10 0 10
-0.5
0
0.5
1
1.5
2
A
m
p
l
i
t
u
d
e
Plot of x[12- k] and h[k]
-10 0 10
0
1
2
3
A
m
p
l
i
t
u
d
e
h[k]x[12- k]
-10 0 10
0
2
4
6
8
n
A
m
p
l
i
t
u
d
e
y[12]
-10 0 10
0
2
4
6
8
n
A
m
p
l
i
t
u
d
e
y[n]
k k
8/27/2013
35
69
Convolution Sum
-10 0 10
-0.5
0
0.5
1
1.5
2
A
m
p
l
i
t
u
d
e
Plot of x[13- k] and h[k]
-10 0 10
0
1
2
3
A
m
p
l
i
t
u
d
e
h[k]x[13- k]
-10 0 10
0
2
4
6
8
n
A
m
p
l
i
t
u
d
e
y[13]
-10 0 10
0
2
4
6
8
n
A
m
p
l
i
t
u
d
e
y[n]
k k
Correlation of Signals
There are applications where it is necessary
to compare one reference signal with one or
more signals to determine the similarity
between the pair and to determine additional
information based on the similarity
8/27/2013
36
Correlation of Signals
For example, in digital communications, a
set of data symbols are represented by a set
of unique discrete-time sequences
If one of these sequences has been
transmitted, the receiver has to determine
which particular sequence has been received
by comparing the received signal with every
member of possible sequences from the set
Correlation of Signals
Similarly, in radar and sonar applications,
the received signal reflected from the target
is a delayed version of the transmitted
signal and by measuring the delay, one can
determine the location of the target
The detection problem gets more
complicated in practice, as often the
received signal is corrupted by additive
random noise
8/27/2013
37
Correlation of Signals
Definitions
A measure of similarity between a pair of
energy signals, x[n] andy[n], is given by the
cross-correlation sequence defined by
The parameter called lag, indicates the
time-shift between the pair of signals

] [
xy
r
... , , , ], [ ] [ ] [ 2 1 0 = =

=

n
xy
n y n x r
Correlation of Signals
y[n] is said to be shifted by samples to the
right with respect to the reference sequence
x[n] for positive valuesof , and shifted by
samples to the left for negative values of
The ordering of the subscripts xy in the
definition of specifies that x[n] is the
reference sequencewhich remains fixed in
time while y[n] is being shifted with respect
tox[n]
] [
xy
r

8/27/2013
38
Correlation of Signals
If y[n] is made the reference signal and shift
x[n] with respect to y[n], then the
corresponding cross-correlation sequence is
given by
Thus, is obtained by time-reversing

=
=
n
yx
n x n y r ] [ ] [ ] [
] [ ] [ ] [ = + =

=
xy
m
r m x m y
] [
yx
r
] [
xy
r
Correlation of Signals
The autocorrelation sequenceof x[n] is
given by
obtained by setting y[n] =x[n] in the
definition of the cross-correlation sequence
Note: , the energy
of the signal x[n]

=
=
n
xx
n x n x r ] [ ] [ ] [
] [
xy
r
x
n
xx
n x r E

=
= = ] [ ] [
2
0
8/27/2013
39
Correlation of Signals
From the relation it follows
that implying that is
an even function for real x[n]
An examination of
reveals that the expression for the cross-
correlation looks quite similar to that of the
linear convolution
] [ ] [ =
xy yx
r r
] [ ] [ =
xx xx
r r ] [
xx
r

=
=
n
xy
n y n x r ] [ ] [ ] [
Correlation of Signals
This similarity is much clearer if we rewrite
the expression for the cross-correlation as
The cross-correlation of y[n] with the
reference signal x[n] can be computed by
processing x[n] with an LTI discrete-time
system of impulse response ] [ n y
] [ ] [ )] ( [ ] [ ] [ = =

=
y x n y n x r
n
xy
*
] [ n y ] [n x
] [n r
xy
8/27/2013
40
Correlation of Signals
Likewise, the autocorrelation of x[n] can be
computed by processing x[n] with an LTI
discrete-time system of impulse response
] [ n x ] [n x ] [n r
xx
] [ n x
Correlation Computation
Using MATLAB
The cross-correlation and autocorrelation
sequences can easily be computed using
MATLAB
Example- Consider the two finite-length
sequences
| | 2 4 4 1 2 1 2 3 1 = ] [n x
| | 3 2 1 4 1 2 = ] [n y
8/27/2013
41
Correlation Computation
Using MATLAB
The cross-correlation sequence
computed using Program 2_7of text is
plotted below
] [n r
xy
-4 -2 0 2 4 6 8
-10
0
10
20
30
Lag index
A
m
p
l
i
t
u
d
e
Correlation Computation
Using MATLAB
The autocorrelation sequence
computed using Program 2_7is shown below
Note: At zero lag, is the maximum
] [
xx
r
] [0
xx
r
-5 0 5
-20
0
20
40
60
Lag index
A
m
p
l
i
t
u
d
e
8/27/2013
42
Correlation Computation
Using MATLAB
The plot below shows the cross-correlation
of x[n] and for N =4
Note: The peak of the cross-correlation is
precisely the value of the delayN
] [ ] [ N n x n y =
-10 -5 0 5
-20
0
20
40
60
Lag index
A
m
p
l
i
t
u
d
e
Correlation Computation
Using MATLAB
The plot below shows the autocorrelation of
x[n] corrupted with an additive random
noise generated using the functionrandn
Note: The autocorrelation still exhibits a
peak at zero lag
-5 0 5
0
20
40
60
80
Lag index
A
m
p
l
i
t
u
d
e
8/27/2013
43
Correlation Computation
Using MATLAB
The autocorrelation and the cross-
correlation can also be computed using the
functionxcorr
However, the correlation sequences
generated using this function are the time-
reversed version of those generated using
Programs 2_7and2_8
Normalized Forms of
Correlation
Normalized forms of autocorrelation and
cross-correlation are given by
They are often used for convenience in
comparing and displaying
Note: and
independent of the range of values of x[n]
and y[n]
] [ ] [
] [
] [ ,
] [
] [
] [
0 0 0
yy xx
xy
xy
xx
xx
xx
r r
r
r
r

= =
1 s | ] [ |
xx
1 s | ] [ |
xy

You might also like