Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Experiment No: 5

Name of the Experiment: Perform convolution and cross-correlation between two signals

Objectives:

(a) To perform fast correlation


(b) To Perform fast Convolution

Apparatus Required: PC, MATLAB software or C/C++ software

Theory:

Convolution is a formal mathematical operation, just as multiplication, addition, and


integration. Addition takes two numbers and produces a third number, while convolution
takes two signals and produces a third signal. Convolution is used in the mathematics of
many fields, such as probability and statistics. In linear systems, convolution is used to
describe the relationship between three signals of interest: the input signal, the impulse
response, and the output signal.

If the input and impulse response of a system are x[n] and h[n] respectively, the convolution
is given by the expression,

The above equation can be extended to waveforms of infinite duration by written them as-

If, x(n) is an M- point sequence, h(n) is an N – point sequence, then, y(n) is a (M+N-1) – point
sequence.
In this equation, x(k), h(n-k) and y(n) represent the input to and output from the system at
time n. Here we could see that one of the inputs is shifted in time by a value every time it is
multiplied with the other input signal. Linear Convolution is quite often used as a method of
implementing filters of various types.
In mathematics and, in particular, functional analysis, convolution is a mathematical
operation on two functions f and g, producing a third function that is typically viewed as a
modified version of one of the original functions, giving the area overlap between the two
functions as a function of the amount that one of the original functions is translated.
Convolution is similar to cross-correlation. It has applications that include probability,
statistics, computer vision, natural language processing, image and signal processing,
engineering, and differential equations.

See, an example
This calculation can be obtained by fast convolution. Using discrete Fourier transform, the
fast Convolution theorem is given by
Correlation: The cross-correlation coefficient with lag j for two dataset x1(n) and x2(n) is
given by

r12 ( j )
12 ( j )  ,
sx s y
N 1 N 1

 x ( n) x ( n  j )
1 2  (x i  x) 2
Where the correlation is given by r12 ( j )  n 0
and S x2  i 0
, and
N N
N 1

(y i  y) 2
S y2  i 0

N
However, the correlation computation may be speeded up by exploiting the correlation
theorem, which is written as
1
r12 ( j )  FD1[ X 1* (k ) X 2 (k )] , where,
N
x1 (n)  X 1 (k )
DFT

x2 (n)  X 2 (k )
DFT

Implement:

2. What is the percentage correlation between recording 1 and recording 2?

You might also like