Professional Documents
Culture Documents
4.1 CONVOLUTION
y ( n) = h( n ) ∗ x( n) ≡ ∑h( k ) x ( n − k )
k =−∞
1
heq ( n ) = h1 ( n ) ∗hn ( 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)
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.
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)
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
7
4.2.1 Crosscorrelation and Autocorrelation Sequences
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.
10