Professional Documents
Culture Documents
DLMDSAM01 Session2 20230419
DLMDSAM01 Session2 20230419
ADVANCED MATHEMATICS
TOPIC OUTLINE
Calculus 1
Integral Transformations 2
Vector Algebra 3
Vector Calculus 4
Information Theory 6
UNIT 2
INTEGRAL TRANSFORMATIONS
STUDY GOALS
− Integral transformations
− How to combine the effects of two functions using a
convolution integral
− How to use convolutions in concrete problems
− How to express periodic signals as Fourier series
− How to relate time domain and frequency domain
functions using Fourier transformations
EXPLAIN SIMPLY
Convolution is defined as the integral of the product of the two functions after one
function is reversed and shifted:
∞
ℎ(𝑧) = (𝑓 ∗ 𝑔)(𝑧) = න 𝑓 𝑥 𝑔 𝑧 − 𝑥 d𝑥
−∞
CONVOLUTIONS:
MEASURING A PHYSICAL QUANTITY
The measurements themselves are then represented by a third function ℎ 𝑧 , i.e. the
convolution of 𝑓 and 𝑔 :
∞
ℎ(𝑧) = (𝑓 ∗ 𝑔)(𝑧) = න 𝑓 𝑥 𝑔 𝑧 − 𝑥 d𝑥
−∞
CONVOLUTIONS:
RESOLUTION
In case of an unbiased instrument, the resolution will “smear” the true values so that the resulting
distribution is broader than the true physical one. In case of a biased instrument, this step will also include
a further shift in one direction.
As an example, assume the “true” values are distributed according to a Γ function (black solid line) while
the measurement device is represented by an unbiased Gaussian resolution function with mean zero and
standard deviation one. The observed values are then distributed according to the convolution of both
functions as shown in the graph on the right.
Convolutions play an important role in image processing in which 𝑓 represents a digital image
while 𝑔 represents a so-called kernel that is used to operate on the image.
A suitable kernel defines a filter that can be used for a wide range of applications such as
blurring, sharpening, and edge detection.
𝐾 ∗ 𝑓 𝑥, 𝑦 = 𝐾 𝑖, 𝑗 𝑓 𝑥 − 𝑖, 𝑦 − 𝑗 ,
𝑖=−𝑎 𝑗=−𝑏
in which 𝐾 denotes a discrete kernel function represented as 𝑛 × 𝑚-matrix with 𝑛 = 2𝑎 + 1 and
𝑚 = 2𝑏 + 1.
CONVOLUTIONS:
DISCRETE CONVOLUTION IN IMAGE ANALYSIS
1 1 2 1
𝐾= 2 4 2
16
1 2 1
𝐾 ∗ 𝑓 𝑥, 𝑦 = 𝐾 𝑖, 𝑗 𝑓 𝑥 − 𝑖, 𝑦 − 𝑗
𝑖=−1 𝑗=−1
1
= ൫𝑓 𝑥 + 1, 𝑦 + 1 + 2𝑓 𝑥 + 1, 𝑦 + 𝑓 𝑥 + 1, 𝑦 − 1 + 2𝑓 𝑥, 𝑦 + 1 + 4𝑓 𝑥, 𝑦 + 2𝑓 𝑥, 𝑦 − 1
16
+ 𝑓 𝑥 − 1, 𝑦 + 1 + 2𝑓 𝑥 − 1, 𝑦 + 𝑓 𝑥 − 1, 𝑦 − 1 ൯
The main idea of Fourier series is to express a signal as a sum of sine and cosine
components of varying strength and frequency. Hence, Fourier series are used to
approximate periodic signals.
In order to approximate a function with a Fourier series, the signal must satisfy the so-
called Dirichlet conditions:
1. The function must be periodic, i.e. 𝑓(𝑥) = 𝑓(𝑥 + 𝐿) = 𝑓(𝑥 + 𝑛𝐿) for every 𝑥 and
every integer 𝑛, where 𝐿 is the length of the period.
2. The function must have at most a finite number of discontinuities within a period.
3. The function must have a finite number of maxima and minima within each period.
4. The integral of the function over a single period must exist and be finite.
FOURIER TRANSFORMATION
FOURIER SERIES – DEFINITION OF REAL FOURIER SERIES
The real Fourier series of a function 𝑓 satisfying the Dirichlet conditions is given by
∞
𝑎0 2𝜋
𝑓(𝑥) = + 𝑎𝑛 cos 𝜔𝑛 𝑥 + 𝑏𝑛 sin 𝜔𝑛 𝑥 with 𝜔𝑛 = 𝑛.
2 𝐿
𝑛=1
Calculating or estimating the coefficients of this series is usually the main challenge in
practice. In principle there are the following formulas for the coefficients of the real
Fourier series:
2 𝐿/2
𝑎𝑛 = න 𝑓 𝑥 ⋅ cos 𝜔𝑛 𝑥 d𝑥 for 𝑛 ≥ 0,
𝐿 −𝐿/2
2 𝐿/2
𝑏𝑛 = න 𝑓 𝑥 ⋅ sin 𝜔𝑛 𝑥 d𝑥 for 𝑛 ≥ 1.
𝐿 −𝐿/2
FOURIER TRANSFORMATION
FOURIER SERIES – DEFINITION OF COMPLEX FOURIER SERIES
The Fourier series of a function is often stated in terms of complex exponentials instead
of trigonometric functions.
The main link between the two representations is Euler’s formula
e𝑖𝜑 = cos𝜑 + 𝑖 sin 𝜑.
Using this identity, we get
1 1
sin(𝜔𝑛 𝑥) = e 𝑖𝜔𝑛 𝑥
−e −𝑖𝜔𝑛 𝑥
and cos(𝜔𝑛 𝑥) = e𝑖𝜔𝑛 𝑥 + e−𝑖𝜔𝑛 𝑥 .
2𝑖 2
The first example shows a sinusoidal signal to which only one frequency contributes, namely
sin 𝑥 .
The second example shows a more complicated signal in which the signal of the first example is
overlaid with a signal that is ten times faster.
The third example shows a more realistic signal that is frequently encountered in
electrical engineering. During each period the sawtooth signal rises linearly between the
minimal and maximal value and drops to the minimum when the signal reaches the
maximum. The right part of the figure shows that many coefficients are needed in the
Fourier series to approximate
this signal. However, the weight
is exponentially dampened, which
makes it easy to control the
approximation error when we
truncate the Fourier series after
finitely many terms!
Using the Fourier series/Fourier transform we can switch between two equivalent
representations of a signal!
The main advantage of this potential switch is that some operations might be very complicated in
one domain, while being simple in the other.
As an example, we consider a so-called frequency filter which is very difficult to apply in the time
domain, but simple in the frequency domain.
Fourier Fourier
transform inversion
− Integral transformations
− How to combine the effects of two functions using a
convolution integral
− How to use convolutions in concrete problems
− How to express periodic signals as Fourier series
− How to relate time domain and frequency domain
functions using Fourier transformations
SESSION 2
TRANSFER TASK
TRANSFER TASK
We have seen that kernel functions can be used to define filters for different
tasks in image processing.
Give an appropriate kernel 𝐾1, i.e. a 3 × 3 matrix, that leaves a digital image
unchanged.
Find a kernel 𝐾2, i.e. another 3 × 3 matrix that can be used to detect
horizontal and vertical edges in an image.
TRANSFER TASKS
PRESENTATION OF THE RESULTS
Recall that the discrete convolution operation, i.e. applying a kernel function 𝐾 to a
digital image 𝑓 𝑥, 𝑦 , is defined as
𝑎 𝑏
𝐾 ∗ 𝑓 𝑥, 𝑦 = 𝐾 𝑖, 𝑗 𝑓 𝑥 − 𝑖, 𝑦 − 𝑗 .
𝑖=−𝑎 𝑗=−𝑏
Moreover, for simplicity, we assume that the digital image 𝑓 has a single colour value at
𝑥, 𝑦 .
Part 1: We need to find a kernel 𝐾 such that 𝐾 ∗ 𝑓 𝑥, 𝑦 = 𝑓 𝑥, 𝑦 . Using the above
formula, it is easy to see that the kernel
0 0 0
𝐾 = 0 1 0 does the trick.
0 0 0
TRANSFER TASK – HINTS
Part 2: We need to find a matrix that can detect edges, i.e. changes between areas of
different colours. Assuming that the edge goes through the point 𝑥, 𝑦 , this means that
we either have different colours left and right of 𝑥, 𝑦 or above and below of 𝑥, 𝑦 . On
the other hand, we wish that the kernel classifies all pixels in 3 × 3 patches of the same
colour as “non-edge” pixels. Formalising these thoughts naturally leads to solutions of
the form:
0 1 0
𝐾 = 1 −4 1
0 1 0
1. True or false?
a) When applying Gaussian blurring to an image, the rgb-
values of a given pixel in the output are influenced by all
the neighbouring pixels in the input image.
b) When applying a discrete kernel in image processing the
rgb-values of a given pixel in the output are influenced
by all the neighbouring pixels in the input image.
LEARNING CONTROL QUESTIONS
1. True or false?
a) True, because the matrix on p. 54 of course book contains no 0s.
b) In general this is not true — look at the matrices used in the transfer task.
2. Suppose 𝑓(𝑥) is the probability distribution of the actual temperature we
wish to measure and 𝑔(𝑦) is the resolution of the thermometer. Then, the
convolution ℎ(𝑧) = (𝑓 ∗ 𝑔)(𝑧) …
a) … is the probability distribution of the temperature measurements.
3. Describe the Fourier transform 𝑔(𝜔) of 𝑔(𝑥) = 3cos(𝑥) + 7cos(10𝑥).
1 1
Since cos 𝑥 = 𝑒 𝑖𝑥 + 𝑒 −𝑖𝑥 and cos 10𝑥 = 𝑒 𝑖⋅10𝑥 + 𝑒 −𝑖⋅10𝑥 , the Fourier
2 2
transform is given by four spikes (delta functions) at 𝜔 = ±1 and 𝜔 = ±10.