Convolution and Correlation
Convolution and Correlation
Convolution
Convolution is a mathematical operation used to express the relation between input and output
of an LTI system. It relates input, output and impulse response of an LTI system as
y
y((t
t)) =
= x
x((t
t))∗
∗hh(
(tt)
)
Discrete convolution
Continuous Convolution
y
y((t
t)) =
= x
x((t
t))∗
∗hh(
(tt)
)
∞
∞
=
= ∫
∫ x
x((τ
τ))h
h((t
t−−τ
τ))d
dττ
−
−∞∞
(or)
∞
∞
=
= ∫
∫ x
x((t
t−−τ
τ))h
h((τ
τ))d
dττ
−
−∞∞
Discrete Convolution
y
y((n
n)) =
= x
x((n
n))∗
∗hh(
(nn)
)
∞
∞
=
= Σ
Σ x
x((k
k))h
h((n
n−−k
k))
k
k==−
−∞∞
(or)
∞
∞
=
= Σ
Σ x
x((n
n−−k
k))h
h((k
k))
k
k==−
−∞∞
Deconvolution
Deconvolution is reverse process to convolution widely used in signal and image processing.
Properties of Convolution
Commutative Property
x
x1 (t) ∗ x 2(
1 (t) ∗ x2 (t
t)) =
= x
x2 (t) ∗ x 1(
2 (t) ∗ x1 (t
t))
Distributive Property
x
x1 (t) ∗ [x 2(
1 (t) ∗ [x2 (t
t))+
+xx3 (t)] = [x 1(
3 (t)] = [x1 (tt)
)∗∗x
x2 (t)] + [x 1(
2 (t)] + [x1 (t
t))∗
∗xx3 (t)]
3 (t)]
Associative Property
x
x1 (t) ∗ [x 2(
1 (t) ∗ [x2 (t
t))∗
∗xx3 (t)] = [x 1(
3 (t)] = [x1 (tt)
)∗∗x
x2 (t)] ∗ x 3(
2 (t)] ∗ x3 (t
t))
Shifting Property
x
x1 (t) ∗ x 2(
1 (t) ∗ x2 (t
t)) =
= y
y((t
t))
x
x1 (t) ∗ x 2(
1 (t) ∗ x2 (t
t−−t
t0 ) = y(t − t 0)
0 ) = y(t − t0 )
x
x1 (t − t 0)
1 (t − t0 )∗
∗xx2 (t) = y(t − t 0)
2 (t) = y(t − t0 )
x
x1 (t − t 0)
1 (t − t0 )∗
∗xx2 (t − t 1)
2 (t − t1 ) =
= y
y((t
t−−t
t0 − t 1)
0 − t1 )
x
x1 (t) ∗ δ(t − t 0)
1 (t) ∗ δ(t − t0 ) =
= x
x((t
t−−t
t0 )
0)
u
u((t
t))∗
∗uu(
(tt)
) =
= r
r((t
t))
u
u((t
t−−T
T1 ) ∗ u(t − T 2)
1 ) ∗ u(t − T2 ) =
= r
r((t
t−−T
T1 − T 2)
1 − T2 )
u
u((n
n))∗
∗uu(
(nn)
) =
= [[n
n++1
1]]u
u((n
n))
Scaling Property
If x
x((t
t))∗
∗hh(
(tt)
) =
= y
y((t
t))
then x
x((a
att)
)∗∗h
h((a
att)
) =
=
1
1
y
y((a
att)
)
||a
a||
Differentiation of Output
if y
y((t
t)) =
= x
x((t
t))∗
∗hh(
(tt)
)
d
dyy(
(tt)
) d
dxx(
(tt)
)
then =
= ∗
∗hh(
(tt)
)
d
dtt d
dtt
or
d
dyy(
(tt)
) d
dhh(
(tt)
)
=
= x
x((t
t))∗
∗
d
dtt d
dtt
Note:
Here, we have two rectangles of unequal length to convolute, which results a trapezium.
−
−11+
+−−2
2 <
< t
t <
< 2
2++2
2
−
−33 <
< t
t <
< 4
4
∞
∞
Proof: y
y((t
t)) =
= ∫
∫
−
−∞∞
x
x((τ
τ))h
h((t
t−−τ
τ))d
dττ
Take integration on both sides
∞
∞
∫
∫ y
y((t
t))d
dtt =
= ∫
∫ ∫
∫ x
x((τ
τ))h
h((t
t−−τ
τ))d
dττd
dtt
−
−∞∞
∞
∞
=
= ∫
∫ x
x((τ
τ))d
dττ ∫
∫ h
h((t
t−−τ
τ))d
dtt
−
−∞∞
We know that area of any signal is the integration of that signal itself.
∴
∴ A
Ay = Ax A
y = Ax Ahh
DC Component
area
area of
of the
the signal
signal
DC
DC component
component =
=
period
period of
of the
the signal
signal
Ex: what is the dc component of the resultant convoluted signal given below?
Duration of the convoluted signal = sum of lower limits < t < sum of upper limits
= -1 + -2 < t < 2+2
= -3 < t < 4
Period=7
area
area of
of the
the signal
signal
∴
∴ Dc component of the convoluted signal =
period
period of
of the
the signal
signal
Dc component =
12
12
7
7
Discrete Convolution
Let us see how to calculate discrete convolution:
Here x[n] contains 3 samples and h[n] is also having 3 samples so the resulting sequence
having 3+3-1 = 5 samples.
ii. To calculate periodic or circular convolution:
Periodic convolution is valid for discrete Fourier transform. To calculate periodic convolution all
the samples must be real. Periodic or circular convolution is also called as fast convolution.
If two sequences of length m, n respectively are convoluted using circular convolution then
resulting sequence having max [m,n] samples.
Ex: convolute two sequences x[n] = {1,2,3} & h[n] = {-1,2,2} using circular convolution
Normal Convoluted output y[n] = [ -1, -2+2, -3+4+2, 6+4, 6].
= [-1, 0, 3, 10, 6]
Here x[n] contains 3 samples and h[n] also has 3 samples. Hence the resulting sequence
obtained by circular convolution must have max[3,3]= 3 samples.
Now to get periodic convolution result, 1st 3 samples [as the period is 3] of normal convolution
is same next two samples are added to 1st samples as shown below:
∴
∴ Circular convolution result y
y[[n
n]] =
= [[9
9 6
6 3
3]]
Correlation
Correlation is a measure of similarity between two signals. The general formula for correlation is
∞
∞
∫
∫ x
x1 (t)x 2(
1 (t)x2 (t
t−−τ
τ))d
dtt
−
−∞∞
Auto correlation
Cros correlation
Consider a signals x(t). The auto correlation function of x(t) with its time delayed version is given
by
∞
∞
R
R11 (τ ) = R(τ ) = ∫
11 (τ ) = R(τ ) = ∫
x
x((t
t))x
x((t
t−−τ
τ))d
dtt [+ve
[+ve shift]
shift]
−
−∞∞
∞
∞
=
= ∫
∫ x
x((t
t))x
x((t
t++τ
τ))d
dtt [-ve
[-ve shift]
shift]
−
−∞∞
Where τ
τ = searching or scanning or delay parameter.
∞
∞
R
R11 (τ ) = R(τ ) = ∫
11 (τ ) = R(τ ) = ∫
x
x((t
t))x
x∗∗(
(tt−
−ττ)
)ddt
t [+ve
[+ve shift]
shift]
−
−∞∞
∞
∞
=
= ∫
∫ x
x((t
t++τ
τ))x
x∗∗(
(tt)
)ddt
t [-ve
[-ve shift]
shift]
−
−∞∞
∞
∞ 2
R (0) = E = ∫
∫
−
|| x
x((t
t)
2
) || d
dtt
−∞∞
τ
,
τ
Auto correlation function and energy spectral densities are Fourier transform pairs. i.e.
F
F .. T
T [[R
R((τ
τ))]] =
= Ψ
Ψ((ω
ω))
∞
∞ −
−jjω
ωττ
Ψ
Ψ((ω
ω)) =
= ∫
∫ R
R((τ
τ))e
e d
dττ
−
−∞∞
R
R((τ
τ)) =
= x
x((τ
τ))∗
∗xx(
(−−τ
τ))
The auto correlation function of periodic power signal with period T is given by
T
T
1
1 2
2
R
R((τ
τ)) =
= lim
lim ∫
∫ x
x((t
t))x
x∗∗(
(tt−
−ττ)
)ddt
t
T
T→→∞
∞ T
T −
−TT
2
2
Properties
R
R((0
0)) =
= ρ
ρ
||R
R((τ
τ))|| ≤
≤ R
R((0
0))∀
∀ττ
Auto correlation function and power spectral densities are Fourier transform pairs. i.e.,
F
F .. T
T [[R
R((τ
τ))]] =
= s
s((ω
ω))
∞
∞ −
−jjω
ωττ
s
s((ω
ω)) =
= ∫
∫ R
R((τ
τ))e
e d
dττ
−
−∞∞
R
R((τ
τ)) =
= x
x((τ
τ))∗
∗xx(
(−−τ
τ))
Density Spectrum
Let us see density spectrums:
∞
∞
2
2
E
E =
= ∫
∫ || x
x((f
f)) || d
dff
−
−∞∞
∞
∞ 2
2
P
P =
= Σ
Σn=−∞ || C
Cn |
n|
n=−∞
Consider two signals x1(t) and x2(t). The cross correlation of these two signals R
R12 (τ )
12 (τ )
is
given by
∞
∞
R
R12 (τ ) = ∫
12 (τ ) = ∫
x
x1 (t)x 2(
1 (t)x2 (t
t−−τ
τ))d
dtt [+ve
[+ve shift]
shift]
−
−∞∞
∞
∞
=
= ∫
∫ x
x1 (t + τ )x 2(
1 (t + τ )x2 (t
t))d
dtt [-ve
[-ve shift]
shift]
−
−∞∞
∞
∞
∗
∗
R
R12 (τ ) = ∫
12 (τ ) = ∫
x
x1 (t)x (t − τ ) dt
1 (t)x (t − τ ) dt
[+ve
[+ve shift]
shift]
2
2
−
−∞∞
∞
∞
∗
∗
=
= ∫
∫ x
x1 (t + τ )x (t) dt
1 (t + τ )x (t) dt
[-ve
[-ve shift]
shift]
2
2
−
−∞∞
∞
∞
∗
∗
R
R21 (τ ) = ∫
21 (τ ) = ∫
x
x2 (t)x (t − τ ) dt
2 (t)x (t − τ ) dt
[+ve
[+ve shift]
shift]
1
1
−
−∞∞
∞
∞
∗
∗
=
= ∫
∫ x
x2 (t + τ )x (t) dt
2 (t + τ )x (t) dt
[-ve
[-ve shift]
shift]
1
1
−
−∞∞
Properties of Cross Correlation Function of Energy and Power Signals
R
R12 (τ ) ≠ R 21 (
12 (τ ) ≠ R21 (−−τ
τ))
∞
∞
If R12(0) = 0 means, if ∫
∫
−
x
x1
∗
∗
(t)x (t)dt = 0
1 (t)x (t)dt = 0
2
, then the two signals are said to be
−∞∞ 2
orthogonal.
T
T
T
∫
∫−
2
2
−T
T
x
x((t
t)
∗
∗
)x
x (
(tt)
)ddt
t then two signals are said to be
T
2
2
orthogonal.
Cross correlation function corresponds to the multiplication of spectrums of one signal
to the complex conjugate of spectrum of another signal. i.e.
∗
∗
R
R12 (τ ) ←→ X 1(
12 (τ ) ←→ X1 (ω
ω))X
X (
(ωω)
)
2
2
Parseval's Theorem
Parseval's theorem for energy signals states that the total energy in a signal can be obtained by
the spectrum of the signal as
1
1 ∞
∞ 2
2
E
E =
= ∫
∫ ||X
X((ω
ω))|| d
dωω
2
2ππ −
−∞∞
Note: If a signal has energy E then time scaled version of that signal x(at) has energy E/a.