You are on page 1of 10

CHAPTER IV: CONVOLUTION AND CORRELATION ∞

4.1 CONVOLUTION
y ( n) = h( n ) ∗ x( n) ≡ ∑h( k ) x ( n − k )
k =−∞

4.1.1 Response of LTI Systems to Arbitrary inputs: The


Convolution Sum 4.1.2 Properties of Convolution and the Interconnection of LTI
• To determine the response of any relaxed linear system to any input Systems
signal: Convolution is a linear operator and, therefore, has a number of
y(n,k) ≡ h(n,k) = T [δ(n–k)] important properties including the commutative, associative, and
where: h(n,k) = response of the system to the input unit sample distributive properties. The definitions and interpretations of these
sequence properties are summarized below.
note:
a. Commutative Property
n – time index
k – shows the location of the unit impulse The commutative property states that the order in which the two
if input signal sequence is expressed as a sum of weighted impulses, sequence are convolved are not important. Mathematically, the
the response of the system commutative property is

x ( n ) ∗ h ( n) = h( n ) ∗ x ( n )
y ( n) = ∑x(k )h(n, k )
k =−

From a system point of view, this property states that a system
Superposition Summation which is a unit sample response, h(n) and input x(n) behaves in
• The system is time invariant: exactly the same way as the system with sample response x(n) and
Let h(n) = response of the system to the unit sample sequence input h(n). As illustrated below.
h(n) = T [δ(n)]
by time-invariance property
h(n–k)=T [δ(n–k)] x(n) h(n) y(n) h(n) x(n) y(n)
then the superposition summation

y ( n) = ∑x(k )h(n −k )
k =−
∞ b. Associative Property
Convolution Sum The convolution operator satisfies the associative property,
Convolution Sum – it is the summation of the input signal x(n) and the which is
unit sample impulse response h(n)
[ x(n) ∗ h1 (n)] ∗ h2 (n) = x( n) ∗[h1 ( n) ∗ h2 ( n)]
ASTERISK ( ∗ )–denotes convolution operation From a systems point of view, the associative property states that if

two systems with unit sample responses h1(n) and h2(n) are
y ( n) = x( n ) ∗ h( n) ≡ ∑ x ( k ) h( n − k )
k =−∞
connected in cascade, as shown below, an equivalent system is one
that has a unit sample sequence equal to the convolution of h1(n)
The sequence following the asterisk is folded and shifted.
and h2(n):
On the other hand,

1
heq ( n ) = h1 ( n ) ∗hn ( n )

x(n) y(n) x(n) y(n)


h1 (n) h2(n) h1(n)*h2(n)

2
c. Distributive Property N −1
1−a N ∞
1
The distributive property of the convolution operator states that
∑a n = 1−a
∑an = 1 − a a <1
n =0 n =0

x ( n ) ∗ h1 ( n ) + x ( n ) ∗ h2 ( n ) = x ( n ) ∗[h1 ( n ) + h2 ( n )]
N −1
( N − 1) a N +1 − Na N + a a
∑na n = (1 − a ) 2
∑ na n = (1 − a ) 2 a <1
n =0 n =0
From a systems point of view, this property asserts that if two
N −1 N −1
systems with unit sample response h1(n) and h2(n) are connected in
parallel as show below, an equivalent system is one that has a unit ∑n = 12 N ( N −1) ∑n 2 = 16 N ( N − 1)( 2 N − 1)
n =0 n =0
sample response equal to the sum of h1(n) and h2(n): Example 4.1
heq ( n ) = h1 ( n ) + h2 ( n ) Let us perform the convolution of the two signals
x (n ) = a n u(n )
and h (n ) = u(n )
h1 (n)
+ y(n) x(n) y(n)
h1(n)+h2(n)
x(n)
h2(n)

4.1.3 Performing Convolutions


Having considered some of the properties of the convolution
operator, we now look at the mechanics of performing convolutions.
There are several different approaches that may be used, and the
one that is the easiest will depend upon the form and type of
sequences that are to be convolved.
4.1.3.1 Direct Evaluation
Example 4.2
When the sequences that are being convolved may be described
Determine the impulse response for the cascade of two linear time-
by simple mathematical expressions, the convolution is often most
invariant system having impulse responses
easily performed by direct evaluating the sum given by the convolution n
sum. In performing convolutions directly, it is usually necessary to 1 
h1 ( n) =   u ( n)
evaluate finite or infinite sum involving terms of the form αn or n αn. 2
Listed in Table 4-1 are closed-formed expressions for some of the n
1 
commonly encountered series. h2 ( n) =   u ( n)
4
Table 4-1 Closed-form Expression for Some Commonly
Encountered Series

3
4
4.1.3.2 Graphical Approach

y (n) = x (n ) ∗ h(n ) ≡ ∑x ( k ) h ( n − k )
k =−∞

Observe:
1. The index in the summation is k.
2. The sequence x(k) & h(n–k) are multiplied to form a product
sequence
3. The output is the sum over all the values of the product
sequence.

Procedure in computing the convolution:


1. Plot both sequences, x(k) and h(k), as a function of k. Choose one
of the sequences to be fold.
2. FOLDING. Fold h(k) about k=0 to obtain h(–k)
3. SHIFTING. Shift h(–k) by no to the right (left) if no is positive
(negative) to obtain h(no–k)
4. MULTIPLICATION. Multiply x(k) by h(no–k) to obtain the product
sequence
vno(k) = x(k)h(n–k).
5. SUMMATION. Sum all the values of the product sequence vno(k) to
obtain the value of the output at time n=no. Note: The response
of the system at a single time instant.
6. Repeat steps 3 to 6 for all possible shifts, n.
Example 4.3
The impulse response of a linear time-invariant system is
h(n) = {1, 2, 1, –1}

Determine the response of the system, y ( n ) = x ( n ) ∗h ( n ) , to the input
signal
x(n) = {1, 2, 3, 1}

5
A useful fact to remember in performing convolution of two finite-length
sequences is that if x(n) of length L1 and h(n) of length L2 , y(n) will be
of length
L= L1 + L2 –1
Furthermore, if the nonzero values of x(n) are contained in the interval
[Mx, Nx] and nonzero values of h(n) are contained in the interval [Mh,
Nh], nonzero values of y(n) will be confined to the interval [Mx + Mh , Nx + Note:
Nh], Convolution operation is COMMUTATIVE.

y ( n) = ∑x(n −k )h(k )
4.1.3.3 Slide Rule Method k =−

Another method for performing convolutions, which we call the • Although the output y(n) are identical, the product sequences in the
slide rule method, is particularly convenient when both x(n) and h(n) two forms of the convolution formula are not identical.
are finite in length and short duration. The steps involved in the If we define the product sequences as
slide rule method are as follows: vn(k) = x(k)h(n–k)
1. Write the value of x(k) along the top of the piece of paper, and wn(k) = x(n–k)h(k)
the values of h(–k) along the top of another piece of paper. it can easily shown that
2. Lien up the two sequence values x(0) and h(0), multiply each vn(k) = wn(n–k)
pair of numbers, and add the products to form the value of y(0). and therefore,
3. Slide the paper with the folded sequence h(k) to the right one, ∞ ∞

multiply each pair of numbers, sum the products to find the y ( n) = ∑v(k ) = ∑w(n −k )
k =−
∞ k =−

value y(1), and repeat for all shifts to the right by n > 0. Do the
same, shifting the folded sequence to the left, to find the values Both sequences contain the same sample values in a different
of y(n) for n < 0. arrangement.
Example 4.4 In Chapter 5 we will see that another way to perform convolutions is to
Repeat Example 4.3 performing slide rule method in determining use Z-transform.
y ( n ) = h( n ) ∗ x ( n )
4.1.4 Causal Linear Time-Invariant System
In LTI system, causality can be translated to a condition of the impulse
response

y (no ) = ∑h(k ) x(n
k =−∞
o − k)

where no= represent a single time


When the output is subdivided into two sets of terms:
1. Present and past values of the input
2. Future of the input

6
∞ −1
y ( n o ) = ∑h( k ) x ( no − k ) + ∑h( k ) x ( n o − k)
k =0 k =−∞

If the output at time n=no is to depend only on the present and past
inputs, then the impulse response of the system must satisfy the 4.2 CORRELATION OF DISCRETE-TIME SIGNALS
condition • It involves two signal sequences which measure the degree to
h(n)=0 for n<0 which these two signals are similar and thus extract some

information.
y ( n) = ∑h( k ) x (n − k )
k =0 • Mathematical operation that closely resembles convolution.
n • Plays an important role in dsp, especially in application between
y ( n) = ∑x(k )h(n − k )
k =−

digital communications, radar detection and estimation, sonar
and geophysics.
The LTI system is causal if the input x(n) Illustration:
x(n) = 0, for n<0 In radar and active sonar applications
n
y (n) = ∑ h ( k ) x ( n −k )
k =0
n x(n)
y ( n ) = ∑x ( k ) h( n −k )
k =0 y(n)
Example 4.5
Determine the unit step response of the linear time-invariant system
with impulse response
h( n ) =a n u ( n) a <1
where:
x(n) = sampled version of the transmitted signal
y(n) = sampled version of the received signal at the output of analog-
to-digital converter.
y (n) = αx (n − D ) + w(n)
α = attenuation factor representing the signal loss involved in the
round trip transmission of x(n)
D = the round trip delay
w(n) = additive noise

 Detection of signal y(n) is compared to x(n) to determine if a


target is present, and, if so, to determine the time delay D and
compute the distance to the target.

7
4.2.1 Crosscorrelation and Autocorrelation Sequences

Crosscorrelation – is a mathematical operation between two different


sequences which produces another sequence.

rxy (l ) = ∑x ( n ) y ( n − l ) eq.1
n =−∞
Note:
or, equivalently, as

The similarity between the computation of the crosscorrelation of two
rxy (l ) = ∑x ( n + l ) y ( n )
n =−∞
eq.2 sequences and the convolution of the two sequences is apparent. The
computation of the crosscorrelation sequences involves the same
where: operations of convolution except folding operation. Consequently, we
subscript xy = indicates the sequence being correlated can use convolution operation to perform crosscorrelation by providing
l = time shift (or lag) parameter the sequence x(n) and the folded sequence y(-n). eq.5
= 0, ±1, ±2, ±3, … rxy (l ) = x (l ) ∗ y ( −l )

if we reverse the role of x(n) and y(n), the indices xy is also reverse Autocorrelation – is the correlation in which the two sequences are
∞ identical, i.e., y(n)=x(n)
ryx (l ) = ∑ y ( n) x ( n − l ) eq.3 ∞

or, equivalently, as
n =−∞ rxx (l ) = ∑x(n) x(n − l )
n =−∞
eq.6

eq.4 or, equivalently, as
ryx (l ) = ∑ y ( n + l ) x ( n) ∞
eq.7
n =−∞ rxx (l ) = ∑x ( n + l ) x ( n )
n =−∞
By comparing eq.1 with eq.3 or eq.2 with eq.4 it can be concluded that
rxu (l ) = ryx (−l ) Dealing with finite-duration sequences
Example 4.6 if x(n) and y(n) are causal sequences
Determine the crosscorrelation sequence rxy(l) of the sequences x(n) = y(n) = 0 for n < 0 and n ≥ N
x(n) = {…, 0, 0, 2, –1, 3, 7, 1, 2, -3, 0, 0,…} crosscorrelation:
↑ N −|k |−1
eq.8
y(n) = {…, 0, 0, 1, –1, 2, –2, 4, 1, -2, 5, 0, 0, …} rxy (l ) = ∑x(n) y(n − l )
n =i

and autocorrelation:
N −|k |−1
eq.9
rxx (l ) = ∑x(n) x(n −l )
n =i
where:
i = l, k= 0 for l ≥ 0

8
and i = 0, k = l for l < 0

9
MATLAB IMPLEMENTATION OF CONVOLUTION AND %
CORRELATION nyb = nx(1)+nh(1); nye=nx(length(x))+nh(length(h));
ny = [nyb:nye];
Convolution y = conv(x,h);
Example4.8
If arbitrary sequences are infinite duration, then MATLAB cannot be Perform example 4.7 using conv_m
used directly to compute convolution. MATLAB does provide a built-in
function called conv that computes the convolution of two finite-
duration sequences. The conv function assumes that the two sequences Correlation
begin at n = 0 and is invoked by
Signal-processing toolbox in MATLAB also provides a function called
» y= conv (x, h); xcorr for sequence correlation computation. xcorr(x,y) computes the
Example 4.7: crosscorrelation between vectors x and y, while xcorr(x) computes the
From Example 4.3, determine the convolution of the two signals using autocorrelation of vector x. The xcorr function cannot provide the
MATLAB timing information, (as done by the conv_m function), which then must
be obtained by some other means. Therefore we will emphasize the use
of the conv_m function and sigfold function.

The conv function neither provides nor accepts any timing information
if the sequences have arbitrary support. What is needed is a beginning
point and an end point of y(n). Given finite duration x(n) and h(n), it is
easy to determine these points.
x( n); n xb ≤ n ≤ n xe and h(n); nhb ≤ n ≤ nhe
be two finite-duration sequences. The beginning and end points of y(n)
are
n yb = n xb + nhb and n ye = n xe + nhe
respectively. A simple extension of the conv function, called conv_m,
which performs the convolution of arbitrary support sequences can now
be designed.

function [y, ny]= conv_m(x,nx,h,nh)


% Modified convolution routine for signal processing
% --------------------------------------------------
% [y,ny] = conv_m(x,nx,h,nh)
% [y,ny] = convolution result
% [x,nx] = first signal
% [h,nh] = second signal

10

You might also like