Convolution
Convolution
CONVOLUTION
signal processing
s(t)
r(t)
d
image processing
Smoothing filter: low pass filter Enhancing filter : high pass filter Derivating filter
convolution: definition
It has a key role in continuous or discret signal. This operation is realized from a measuring tool
(microscope, camera, optical senses,..) which transforms or filters an input x(t) to an input y(t):
Convolution is defined by :
Continuous version
convolution: Impulse response
h(t) is named impulse response because it is the result of an input impulse signal 𝛿(𝑡)
Intégrale de convolution
convolution: Graphical meaning
1 x(u) 1 x(u)
ℎ −0.25 − 𝑢 ℎ 0.5 − 𝑢
-0.5 +0.5
-0.5 0 +0.5
h(u) h(-u) න
+∞
𝑥 𝑢 ℎ 0 − 𝑢 𝑑𝑢 = 1/8
+0.5 +0.5 −∞
Cummutative operator
Associative operator
Distributive operator
A filter can be defined in the frequency domain from the Fourier transform:
We have
Plancherel’s theorem
Proof
convolution: Plancherel’s theorem
We want to compute:
𝑀
𝐸[ 2 ]
1
𝑥∗ℎ 𝑛 = 𝑥 𝑛−𝑘 ℎ 𝑘 , 𝑛 = [0, … , 𝑁]
𝑀
𝑀
𝑘=−𝐸[ 2 ]
Remark: M will be odd (3,5,7,9,…) and bounds equals the lower integer part of M/2
𝒏=𝟐
Example:
𝒌
convolution: example
𝑥(𝑛) ℎ(𝑛)
𝑛=0 𝑛=0
𝑥 ∗ ℎ 𝑛 : n=(1,2,3)
2D continuous version
Let us define x a continuous 2D signal and a 2D filter . Then the continuous 2D convolution 𝑥 ∗ 𝑦 𝜏, 𝜂
is defined by:
+∞ +∞
𝑥 ∗ ℎ 𝝉, 𝜼 = න න 𝑥 𝑢, 𝑣 ℎ 𝝉 − 𝑢, 𝜼 − 𝑣 𝑑𝑢 𝑑𝑣
−∞ −∞
2D digital version
Let us define x a discret time 2D signal of N*N samples and a 2D filter h of M*M coefficients, with M<<N.
2D digital convolution (x*h)(n,m) is given by:
𝑀 𝑀
𝐸[ 2 ] 𝐸[ 2 ]
1
𝑥 ∗ ℎ 𝒏, 𝒎 = 2 𝑥 𝒏 − 𝑘, 𝒎 − 𝑙 ℎ 𝑘, 𝑙 , (𝑛, 𝑚) = [0, … , 𝑁]
𝑀
𝑀 𝑀
𝑘=−𝐸[ 2 ] 𝑙=−𝐸[ 2 ] Matlab : z=conv2(x,h)
convolution: example
1 1
1
M=3: 𝑥 ∗ ℎ 𝒏, 𝒎 = 𝑥 𝒏 − 𝑘, 𝒎 − 𝑙 ℎ 𝑘, 𝑙 ,
9
𝑘=−1 𝑙=−1
𝒏
x(n, m-1) x(n,m) x(n,m+1) h(0, -1) h(0,0) h(0,1)
𝑥 ∗ ℎ 𝒏, 𝒎 = x(n+1,m+1).h(−1,−1)+x(n+1,m).h(−1,0)+ ⋯ .
𝟏/𝟗
convolution: example
(M=3)
original