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

1 n

-1

0 n

y (n) = x(k ).h(n k )


k =0

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.5 0 -0.5 -1 -2

x(0)h(n)

-1

0 n

x(1)h(n-1) 4 3 2 1 0

y(n) 8
-1 -2 -1

1 n
x(2)h(n-2)

-2 -4

-2

0 n

-2

-4 -1

2 n

x(3)h(n-3) 2 1.5 1 0.5 0 -0.5 -1 0

3 n

5.2 Convolution Properties Commutative Property The commutative property states that the order in which two sequences are convolved is not important. Mathematically, the commutative property is

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 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, as illustrated in Fig(5-1-c), 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, N2=length of the other signal

Fig (5-1) The interpretation of convolution properties

below, 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 ()

While he impulse response of the subsys2 is 2 () = 0.8( 1) + ()


impulse response of subsys1 3 2.5 2

h(n)

1.5 1 0.5 0 0

2 n

Impulse response of the subsys2 1 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 n 3 3.5 4 4.5 5

+
The overall impulse response 4 3.5 3 2.5

h(n)

2 1.5 1 0.5 0 0 0.5 1 1.5 2 2.5 n 3 3.5 4 4.5 5

5.3 Correlation It is a mathematical operation that used to compare between two signals. Correlation of signals is often encountered in radar, sonar, digital communication. 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. 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 () = = ()( ) Or () = = ()( ) = 0, 1, 2, . .

Where r denote the correlation, xy denote the correlation between the Note that () = () sequence x(n),y(n)

() = = ()( ) = 0, 1, 2, . . The auto correlation is defined as

Example 5-3: Determine the cross correlation sequence between the sequences x(n)=[2,1,1], y(n)=[2,2,2] Solution:The cross correlation sequence

to compute () 0 this is denoted as ( () = () )

The auto correlation function is an even function. Consequently, it suffices

(0) = ()() = { .0,0,0,4,2,0,0. . } = 6


= =

() = = ()( ) = 0, 1, 2, . .

(1) = ()( 1) = { .0,0,0,4,2,2,0,0. . } = 8 (2) = 4 , (3) = 2 (2) = 0 (1) = 4


The cross corelation sequance 8 7 6 5

Rxy

4 3 2 1 0 -1 -0.5 0 0.5 1 1.5 n 2 2.5 3 3.5 4

Homework: 1. Calculate the period for the following sinusoidal sequences b. () = 2 sin(0.05) + 3sin (0.12) i. ii. Plot x1(n), x2(n) 1 () = () ( 5) , 2 () = 2[() ( 3)] 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. () = 3sin (0.05)

2. Given

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

You might also like