You are on page 1of 8

Lecture 5

DSP

Convolution and correlation 5.1 Convolution: 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. 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,1,-1] . Determine the response of the system to input signal x(n)= [1,2,3,1]

Solution: Note that, the arrow show the sample value at n=0
x(n) 3
2 h(n)

2.5 2 1.5 1 0.5 0 -1

1.5 1 0.5 0 -0.5 -1 -2

0

1 n

2

3

4

-1

0 n

1

2

3

y (n) = ∑ x(k ).5 1 0.h(n − k ) k =0 4 y (n) = x(0)h(n) + x(1)h(n − 1) + x(2)h(n − 2) + x(3)h(n − 3) 2 1.5 -1 0 1 2 3 n 4 5 6 .5 0 -0.5 -1 -2 x(0)h(n) -1 0 n 1 2 3 x(1)h(n-1) 4 3 2 1 0 y(n) 8 -1 -2 -1 6 0 1 n x(2)h(n-2) 2 3 4 4 + 6 2 4 0 2 -2 -4 -2 0 n 2 4 6 0 -2 -4 -1 0 1 2 n 3 4 5 x(3)h(n-3) 2 1.5 1 0.5 0 -0.

the commutative property is • Associative Property The convolution operator satisfies the associative property. as illustrated in Fig(5-1-c). Mathematically. N2=length of the other signal . an equivalent system is one that has a unit sample response equal to the sum of h1 (n) and h2(n): Note: the length of convolution is N1+N2-1 Where N1=length of the first signal.2 Convolution Properties • Commutative Property The commutative property states that the order in which two sequences are convolved is not important. 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 Fig(5-1-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.5.

find the causal overall impulse response over the range 0 ≤ 𝑛𝑛 ≤ 5 and sketch h(n) over this range Subsys1 x(n) Subsys2 y(n) + Example 5-2: .Two digital LTI processor with difference equation shown Solution: .The overall impulse response is 3𝛿𝛿(𝑛𝑛 − 2) The impulse response of the subsys1 is ℎ1 (𝑛𝑛) = 𝛿𝛿(𝑛𝑛) + 2𝛿𝛿(𝑛𝑛 − 1) + ℎ(𝑛𝑛) = ℎ1 (𝑛𝑛) + ℎ2 (𝑛𝑛) .Fig (5-1) The interpretation of convolution properties below.

5 4 4.5 0.6 h(n) 0.5 3 2.5 2 2.3 0.8ℎ(𝑛𝑛 − 1) + 𝛿𝛿(𝑛𝑛) impulse response of subsys1 3 2.5 1 0.5 4 4.5 2 h(n) 1.While he impulse response of the subsys2 is ℎ2 (𝑛𝑛) = 0.5 n 3 3.5 h(n) 2 1.8 0.9 0.7 0.5 n 3 3.5 1 1.5 0 0 0.4 0.5 5 + The overall impulse response 4 3.2 0.5 1 1.5 2 2.5 1 0.1 0 0 0.5 0 0 1 2 n 3 4 5 Impulse response of the subsys2 1 0.5 5 .

. … .y(n) 𝑟𝑟𝑥𝑥𝑥𝑥 (𝑙𝑙) = ∑∞ 𝑛𝑛=−∞ 𝑥𝑥(𝑛𝑛)𝑥𝑥(𝑛𝑛 − 𝑙𝑙) 𝑙𝑙 = 0. y(n) is defined as 𝑟𝑟𝑥𝑥𝑥𝑥 (𝑙𝑙) = ∑∞ 𝑛𝑛=−∞ 𝑥𝑥(𝑛𝑛)𝑥𝑥(𝑛𝑛 − 𝑙𝑙) Or 𝑟𝑟𝑥𝑥𝑥𝑥 (𝑙𝑙) = ∑∞ 𝑛𝑛=−∞ 𝑥𝑥(𝑛𝑛)𝑥𝑥(𝑛𝑛 − 𝑙𝑙) 𝑙𝑙 = 0. The correlation between two signal is to measure the degree to which the two signals are similar and thus to extract some information that depends on the application.1]. ∓1. ∓2.3 Correlation It is a mathematical operation that used to compare between two signals.0. digital communication.1. it suffices 𝑟𝑟𝑥𝑥𝑥𝑥 (0) = � 𝑥𝑥(𝑛𝑛)𝑥𝑥(𝑛𝑛) = � {… . .0. Correlation of signals is often encountered in radar. ∓2. ∓∞ Where r denote the correlation.0. ∓∞ The auto correlation is defined as Example 5-3: Determine the cross correlation sequence between the sequences x(n)=[2. Consequently. … .2] Solution:The cross correlation sequence ∞ to compute 𝑟𝑟𝑥𝑥𝑥𝑥 (𝑙𝑙) 𝑓𝑓𝑓𝑓𝑟𝑟 𝑙𝑙 ≥ 0 this is denoted as (𝑟𝑟𝑥𝑥𝑥𝑥 (𝑙𝑙) = 𝑟𝑟𝑥𝑥𝑥𝑥 (−𝑙𝑙) ) The auto correlation function is an even function.0.5. ∓1.2. ∓∞ ∞ .2. ∓2. y(n)=[2. … . 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). . sonar.0. xy denote the correlation between the Note that 𝑟𝑟𝑥𝑥𝑥𝑥 (𝑙𝑙) = 𝑟𝑟𝑥𝑥𝑥𝑥 (−𝑙𝑙) sequence x(n). . } = 6 𝑛𝑛 =−∞ 𝑛𝑛 =−∞ 𝑟𝑟𝑥𝑥𝑥𝑥 (𝑙𝑙) = ∑∞ 𝑛𝑛=−∞ 𝑥𝑥(𝑛𝑛)𝑥𝑥(𝑛𝑛 − 𝑙𝑙) 𝑙𝑙 = 0.4. ∓1.

0.5 0 0.0.5 n 2 2.5 3 3.5 4 Homework: 1. 𝑟𝑟𝑥𝑥𝑥𝑥 (3) = 2 𝑟𝑟𝑥𝑥𝑥𝑥 (−2) = 0 𝑟𝑟𝑥𝑥𝑥𝑥 (−1) = 4 The cross corelation sequance 8 7 6 5 𝑛𝑛 =−∞ ∞ 𝑛𝑛=−∞ ∞ Rxy 4 3 2 1 0 -1 -0. 𝑥𝑥(𝑛𝑛) = 2 sin(0.5 1 1.2. Given . x2(n) 𝑥𝑥1 (𝑛𝑛) = 𝑢𝑢(𝑛𝑛) − 𝑢𝑢(𝑛𝑛 − 5) .0.4.05𝜋𝜋𝑛𝑛) + 3sin⁡ (0. 𝑥𝑥(𝑛𝑛) = 3sin⁡ (0. } = 8 𝑟𝑟𝑥𝑥𝑥𝑥 (2) = 4 . the convolution of x1(n) and x2(n) for all n 3.0.0. Plot x1(n).2. Given the following linear constant coefficient difference equation 𝑥𝑥(𝑛𝑛) + 2𝑥𝑥(𝑛𝑛 − 1) + 𝑥𝑥(𝑛𝑛 − 2) = 𝑥𝑥(𝑥𝑥) with 𝑥𝑥(𝑛𝑛) = 0 𝑓𝑓𝑓𝑓𝑟𝑟 𝑎𝑎𝑙𝑙𝑙𝑙 𝑛𝑛 < 0 a. 𝑥𝑥2 (𝑛𝑛) = 2[𝑢𝑢(𝑛𝑛) − 𝑢𝑢(𝑛𝑛 − 3)] Calculate and plot y(n).𝑟𝑟𝑥𝑥𝑥𝑥 (1) = � 𝑥𝑥(𝑛𝑛)𝑥𝑥(𝑛𝑛 − 1) = � {… .12𝜋𝜋𝑛𝑛) i. Calculate the period for the following sinusoidal sequences b.05𝜋𝜋𝑛𝑛) 2. . ii.

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.a. Find the auto correlation of x(n) in example 5-3 . Plot 3 samples of the unit impulse response b.