Fourier Analysis
Fourier Transforms Introduction
The Fourier Transform applies to continuous functions or discrete data can provide useful insights and tools for many applications
- Examples:
- signal processing
- filtering
- denoising
- sound/audio manipulation
- signal processing
Basic Idea
- Transform some function/data into a form that reveals frequencies of information in the data
- Process/analyse it it in this “frequency domain” form
- Transform back again
The original data/function is said to be in the…
- “time domain” if
is a function of time, - “spatial domain” if
is a function of space/position,
i.e. infinite sum of increasingly high frequency sine/cosines
Could view this as:
- a weird (non-polynomial) interpolation problem:
- what coefficients let us fit the particular summation form to a given function?
- an expansion/approximation of the function as an infinite sum of sines/cosines
- e.g. compare to Taylor series
Main topics:
- How do we find the coefficients for this frequency-based representation?
- What if our input data are discrete values:
instead of a smooth continuous function - Discrete Fourier Transform, DFT
- How can we transform data into the frequency-domain efficiently
- Fast Fourier Transform, FFT
Continuous Fourier Series
Consider some continuous periodic function
e.g.
Goal is to represent any
- Higher integer
indicates shorter period & higher waver frequency
Determining the Coefficients
Assume for now that
Then we have$$f(t) = a_0 + \sum_{k=1}^{\infty}a_k\cos(kt)+\sum_{k=1}^{\infty}b_k\sin(kt)$$
Handy Identities (Orthogonality)
i.e. the integral of the product of
We say these two functions are orthogonal to each other
More Orthogonality Relations
We can use these to extract a single Fourier coefficient at a time!
Example
Determining coefficient
We want $$f(t) = a_0 + \sum_{k=1}^{\infty}a_k\cos(kt)+\sum_{k=1}^{\infty}b_k\sin(kt)$$Integrate over
Therefore:
i.e.,
Determining coefficient (for integer )
Again start with$$f(t) = a_0 + \sum_{k=1}^{\infty}a_k\cos(kt)+\sum_{k=1}^{\infty}b_k\sin(kt)$$Multiply by
The result is 0 except when
Thus, $$a_l = \frac{1}{\pi}\int_0^{2\pi}f(t)\cos(lt)dt$$
Summary
So if we have
A sine is a translated cosine! All “in-between” shifts are just linear combinations of sin/cos
Complex Number Review
For
Visualized as points on the complex plane
- The vector length and angle are often called modulus and argument respectively

For, we can define additional operations - Conjugate:
- Modulus/norm:
- Argument/phase/angle:
- converts rectangular coordinates
to polar
- converts rectangular coordinates
Using Euler’s Formula
We will find Euler’s formula very useful:
Also$$e^{-i\theta} = \cos(-\theta) + i\sin(-\theta) = \cos(\theta)-\sin(\theta)$$Adding/subtracting these lead to two key identities:
Fourier Series with Complex Exponentials
Now, given our earlier sinusoidal expression of a function
There exists a simple conversion:
- Specifically for
:$$a_0=c_0, c_k = \frac{a_k}{2}-\frac{ib_k}{2}, c_{-k}=\frac{a_k}{2}+\frac{ib_k}{2}$$And we have the relationships:$$|a_0|=|c_0|,;\text{and };|c_k|=|c_{-k}|=\frac{1}{2}\sqrt{a_k^2+b_k^2}$$
Finding coefficients
We can also find
The corresponding orthogonality property is:$$\int_0^{2\pi}e^{ikt}e^{-ikt}=\begin{cases}0; k\neq l\2\pi; k=l\end{cases}$$from which we can determine the coefficient formula,$$c_k=\frac{1}{2\pi}\int_0^{2\pi}e^{-ikt}f(t)dt$$
Truncating
An approximation of a function could be achieved by truncating the series to a finite number of sinusoids:$$f(t)\approx\sum_{k=-M}^{+M}c_ke^{ikt}$$
Discrete Input Data
Consider now a vector of discrete data
- e.g.
for uniformly spaces data points ( assumed even)
Assume data are from an unknown function, evaluated at each
, for - i.e.
DFT as Interpolation
We have
For
Assuming
What about #1? How can we solve for the
Another Orthogonality Idea
To find
A Discrete Fourier Transform (DFT) pair
Inverse DFT:$$f_n = \sum_{k=0}^{N-1}F_kW^{nk}$$
DFT:$$F_k=\frac{1}{N}\sum_{n=0}^{N-1}f_nW^{-nk}$$The Discrete Fourier Transform is invertible
Two Properties of the DFT
As consequences of the properties of Nth roots of unity…
- The sequence
is doubly infinite and periodic - i.e. If we allow
or , the coefficients repeat
- i.e. If we allow
- Conjugate symmetry: if data
is real,
Hence, theare symmetric about
Power/ Fourier Spectrum
The power spectrum visualizes the Fourier coefficients by plotting their moduli/magnitudes

This expresses the magnitude of the frequencies, but ignores phase
Discrete Data - Observations
Coefficient
- sometimes called the direct current or DC

The smooth bump had one dominant frequency/wave; therefore one coefficient pair,and , had large magnitude

The rough bump had more irregularity, so more active (higher) frequencies. - Main hump still dominates, so low frequencies
and remain largest
The Fourier
Fast Fourier Transform
Making Fourier Transforms Fast
Questions:
- What is the complexity of the naïve method?
- What property of the DFT allows it to be sped up?
- How can we construct an algorithm from this property?
- What is the complexity of the new method?
Slow Fourier Transform
A direct implementation of
Essentially two nested for loops:

A Faster Fourier Transform
Design a divide and conquer strategy
- Split the full DFT into two DFT’s of half the length
- Repeat recursively
- Finish at the base case of individual numbers
(Iffor some , we can pad our initial data with zeros)
Dividing it up
We can express the usual DFT with two new arrays of half the length (
where
Then,
Visualizing - A Butterfly Operation
We can think of each step as taking a pair of numbers and producing two outputs:

Big Picture - Recursive Butterfly FFT Algorithm

Note: Coefficient output order is scrambled

- Each step applies an even-odd index splitting for the result location. So, the output ends up in bit-reversed positions

Is it actually faster?
- We spend
operations to split the arrays in two, at each stage - Data has length
, so we need m = stages - Total cost
operations - compared to
of DFT
- compared to
Inverse Fast Fourier Transform
Consider the generic expression: $$f'k=\frac{1}{N}\sum^{N-1}f_nU^{nk}$$If
If, and we post-multiply by , this is the inverse FFT
Fourier Application: Image Data/Compression
1D Grayscale Image
We can think of a 1D array of grayscale values as a 1D image
- Each entry gives the pixels’ intensity/grey values
Processing 1D Images
For greyscale images, we can perform a DFT on the pixels’ intensity/grey values

Notice: Plot is only the first 16 coefficients, since real data implies conjugate symmetry
- Overall pattern has few coefficients active
- Can store it cheaply just with
If we destroyed the repetition (e.g. flat line top for the 3rd bump)
- Can store it cheaply just with
- Many more Fourier coefficients will become active/non-zero
- becomes expensive to store

- Although many coefficients are non-zero, many still have fairly small moduli/magnitude…
- so those frequencies contribute less to the image
Compression Strategy
- Create an approximate compressed version of the image,
, by throwing away small Fourier coefficients - To reconstruct the image, run the inverse DFT to get modified data (pixels),
- Discard the imaginary parts of
, to ensure new data is strictly real
Comparison

Recovered “image” hopefully has small deviations from the original “true” data
- But! We store fewer Fourier coefficients and so save space!
Image Processing in 2D

We apply a 2D extension of the DFT definition to the data, like so:
Essentially two standard (1D) DFT’s combined.
Two (possibly distinct) roots of unity are used, one per dimension:
Result is a 2D array of Fourier coefficients,
2D Fast Fourier Transform

The 2D FFT can be computed efficiently using nested 1D FFTs:
- Transform each row (separately) using 1D FFTs
- Transform each column on the result, again using 1D FFTs
Complexity
Performing
Performing
So total complexity is
Block-based Image Compression

Often an image is subdivided into smaller blocks:
- Compression is performed on each block independently
Idea: Pixels within a block often have similar/related data, and hopefully compress effectively
Fourier Application: Understanding Aliasing
Sampling of Signals: Aliasing
If a real input signal contains high frequencies, but the spacing of our discretely sampled data points is inadequate, aliasing can occur

A truly high frequency signal (red) aliases as a lower frequency signal (blue) in the discrete result
Takeaway
Our DFT coefficients
Hence, high frequencies from
Nyquist Frequency
If the original continuous signal has frequencies
- Once a signal is discretely sampled, there is no way to distinguish aliased (high) frequencies from real (low) frequencies
Treating Aliasing
Two (partial) solutions:
- Increase the sampling resolution to capture higher frequencies
- Filter before sampling to remove (too) high frequencies
- so they don’t cause aliasing
Example:
Digital Cameras often have optical lowpass filters or anti-aliasing filters that physically blur the incoming light, before it hits the image sensor