Bioimaging Lab 1 v3
Bioimaging Lab 1 v3
Bioimaging Lab 1 v3
Introduction
The purpose of this lab is to introduce you to the representation of digital signals in the time and
frequency domains and to determine the frequency bandwidth of each signal under considera-
tion. In this lab you will use a programming language of your choice to examine the time domain
representation of the signals and the frequency domain representation of the same signals. You
will relate these to the formal mathematical expressions derived from theory.
The Fourier series represents a periodic signal f (t) ,with period T0 and fundamental frequency
ω0 as an infinite sum of sinusoidal signals having harmonic (integer multiples of ω0 ) frequen-
cies. The series has important applications in linear system steady-state analysis (thanks to the
superposition principle). The compact trigonometric Fourier series can be expressed as,
∞
X
f (t) = a0 + (an cos nt + bn sin nt)
n=1
The Fourier transform is a generalization of the complex Fourier series in the limit as L → ∞ .
v
Replace the discrete amplitude An with the continuous function F (v)dv while letting n/L − →,
then the sum can be changed to an integral, resulting in the equations:
Z ∞
F (v) = f (t)e−i2πvt dt
−∞
Z ∞
f (t) = F (v)ei2πvt dv
−∞
where F (v) corresponds to the Forward Fourier transform and f (t) is the Inverse Fourier trans-
form.
The Fourier Transform is an important image processing tool which is used to decompose an im-
age into its sine and cosine components. The output of the transformation represents the image
in the Fourier or frequency domain, while the input image is the spatial domain equivalent. In
the Fourier domain image, each point represents a particular frequency contained in the spatial
domain image.
The Fourier Transform is used in a wide range of applications, such as image analysis, image
filtering, image reconstruction and image compression.
1
ECBI1023: Bioimaging
As we are only concerned with digital images, we will restrict this discussion to the Discrete
Fourier Transform (DFT). The DFT is the sampled Fourier Transform and therefore does not
contain all frequencies forming an image, but only a set of samples which is large enough to fully
describe the spatial domain image. The number of frequencies corresponds to the number of
pixels in the spatial domain image, i.e. the image in the spatial and Fourier domain are of the
same size.
For a square image of size N×N, the two-dimensional DFT is given by:
N −1 N −1
X X ki lj
F (k, l) = f (i, j)e−i2π N + N
i=0 i=0
The Fourier Transform is used if we want to access the geometric characteristics of a spatial
domain image. Because the image in the Fourier domain is decomposed into its sinusoidal
components, it is easy to examine or process certain frequencies of the image, thus influencing
the geometric structure in the spatial domain.
In most implementations the Fourier image is shifted in such a way that the DC-value (i.e. the
image mean) F(0,0) is displayed in the center of the image. The further away from the center
an image point is, the higher is its corresponding frequency.
Instructions
For this lab you will plot both Fourier Transforms and Fourier Series with either Python or
Matlab online. Follow the instructions that best accomodate for your needs.
• Go to https://docs.sympy.org/latest/index.html or https://www.mathworks.com/
help/matlab/math/fourier-transforms.html for the documentation on Fourier Series
and Transforms. Open up the software that you will use and create the following:
1. Calculate the Fourier Series for the first 3 terms of a even triangle wave, and plot
its Fourier series. Confirm your calculations with the software results.
2. Perform the same calculations for an Odd function.
3. Perform the same calculations for a function of your choice.
4. Use the example given for a DFT for Python (https://pythonnumericalmethods.
berkeley.edu/notebooks/chapter24.02-Discrete-Fourier-Transform.html) or Mat-
lab (https://www.mathworks.com/help/signal/ug/discrete-fourier-transform.
html) and modify the input time-series wave and plot it. Compare it to the original
example ( that also needs to be plotted) and describe qualitatively what you see.
Once you are done, write up a Lab Report. Make sure you add figures/screenshots that help
the flow of your report. Additionally, scan your report on a anti-plagiarism, before submitting.
Finally, for this Lab I will randomly choose a question and grade it for correctness.
Please refer to the Lab Instructions and Rubric to determine the content of this lab.
References
This activity has been adapted from
https://lpsa.swarthmore.edu/Fourier/Series/ExFS.html .