Professional Documents
Culture Documents
Lecture 5
Dr. Muayad
3rd year
Convolution and correlation
5.1 Convolution:
Convolution is a mathematical way of combining two signals to form
a third signal. It is the single most important technique in Digital Signal
Processing. Using the strategy of impulse decomposition, systems are
described by a signal called the impulse response. Convolution is important
because it relates the three signals of interest: the input signal, the output
signal, and the impulse response.
Convolution is a method which described the relation between the
input to a linear time invariant system x(n), and the output y(n). The
convolution formula used to determine the output of an LTI system to any
given arbitrary input signal
y ( n) x ( k ) h( n k )
k
or
y ( n) h( k ) x ( n k )
k
In most practical cases there are many more finite sample values in x(n) and
probably also more in h(n) then superpose many more individual responses
to find the output signal.
Note: the length of convolution signal is N1+N2-1
Where N1=length of the first signal, N2=length of the other signal
The convolution method may also be performed graphically as described by
the following example
Example (5-1): The impulse response of a linear time invariant system is
h(n)=[1,2,2]. Determine the response of the system to input signal
Another way to visualize the convolution sum is to draw the signals x[k] and
h[n- k] as functions of k (for a fixed n), multiply them to form the signal
g[k], and then sum all values of g[k].
Example (5-2): Let us compute y[0] and y[1] for the input signal and
impulse response of an LTI system shown in Figure (5.2)
Figure (5.4) Product of flipped impulse response with input signal for n = 0
Figure (5.6) Product of flipped and shifted impulse response with input signal for n = 1.
Step 3: Sum all values of g[k] from k=∞ to -∞ to get y[0],y[1]=5
Associative Property
The convolution operator satisfies the associative property, which is
the associative property states that if two systems with unit sample responses
hl(n) and h2(n) are connected in cascade as shown in Figure(5-7-b) an
equivalent system is one that has a unit sample response equal to the
convolution of hl (n) and h2(n):
Distributive Property
The distributive property of the convolution operator states that
This property asserts that if two systems with unit sample responses hl(n)
and h2(n) are connected in parallel, as illustrated in Figure(5-7-c), an
equivalent system is one that has a unit sample response equal to the sum of
h1 (n) and h2(n):
Figure (5-7) The interpretation of convolution properties
Example ( 5-2): - Two digital LTI processor with difference equation shown
in figure (5.8), find the causal overall impulse response over the range 0 ≤
𝑛 ≤ 5 and sketch h(n) over this range.
Subsys1
𝑦(𝑛) = 𝑥(𝑛) + 2𝑥(𝑛 − 1) + 3𝑥(𝑛 − 2)
y(n)
x(n) +
Subsys2
𝑦(𝑛) = 0.8𝑦(𝑛 − 1) + 𝑥(𝑛)
2.5
2
h(n)
1.5
0.5
0
0 1 2 3 4 5
n
0.9
0.8
0.7
0.6
h(n)
0.5
0.4
0.3
0.2
0.1
0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
n
+
The overall impulse response
4
3.5
2.5
h(n)
1.5
0.5
0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
n
Figure (5.9) The overall impulse response of example (5.2)
5.3 CORRELATION OF DISCRETE-T1ME SIGNALS
A mathematical operation that closely resembles convolution is
correlation. our objective in computing the correlation between the two
signals is to measure the degree to which the two signals are similar and thus
to extract some information that depends to a large extent on the application.
Correlation of signals is often encountered in radar, sonar, Digital
communications, geology and other areas in science and engineering.
There are two types of correlation autocorrelation (when the two
signals are identical) and cross correlation (the correlation done between two
signals that are different).
The cross correlation between two signal x(n), y(n) is defined as
𝑟𝑥𝑦 (𝑙) = ∑∞
𝑛=−∞ 𝑥(𝑛)𝑦(𝑛 − 𝑙) 𝑙 = 0, ∓1, ∓2, … . . ∓∞
Or
𝑟𝑦𝑥 (𝑙) = ∑∞
𝑛=−∞ 𝑦(𝑛)𝑥(𝑛 − 𝑙)
𝑟𝑥𝑦 (2) = 4 ,
𝑟𝑥𝑦 (−2) = 0
𝑟𝑥𝑦 (−1) = 4
𝑟𝑥𝑦 (3) = 2
5
Rxy
0
-1 -0.5 0 0.5 1 1.5 2 2.5 3 3.5 4
n
Homework:
1. Calculate the period for the following sinusoidal sequences
a. 𝑥(𝑛) = 3sin(0.05𝜋𝑛)
b. 𝑥(𝑛) = 2 sin(0.05𝜋𝑛) + 3sin(0.12𝜋𝑛)
2. Given 𝑥1 (𝑛) = 𝑢(𝑛) − 𝑢(𝑛 − 5) , 𝑥2 (𝑛) = 2[𝑢(𝑛) − 𝑢(𝑛 − 3)]
i. Plot x1(n), x2(n)
ii. Calculate and plot y(n), the convolution of x1(n) and
x2(n) for all n
3. Given the following linear constant coefficient difference equation
𝑦(𝑛) + 2𝑦(𝑛 − 1) + 𝑦(𝑛 − 2) = 𝑥(𝑥) with 𝑦(𝑛) = 0 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑛 < 0
a. Plot 3 samples of the unit impulse response
b. Calculate and plot y(n) for x(n)=u(n)
c. Calculate and plot y(n) for x(n)=u(n)-u(n-2)
4. Find the auto correlation of x(n) in example 5-3