Fourier Series and Transform

Editovat
Fourier analysis
  • Study of how general functions (e.g., on ) can be approximated by sums of simpler (e.g., trigonometric) functions.

  • Fourier’s original motivation was to solve the heat equation, a partially differentiable equation.

    • A partially differentiable equation (PDE) involves multiple variables and one or more of their derivatives.

    • Example: I want to know what happens, when I put two rods of different temperatures into contact.

Fourier series

Fourier series (FS)

Series expansion (CZ: rozvinutí nekonečné řady) of a periodic function into a sum of basis functions.

  • For basis functions, it uses and functions with a whole number frequency.

  • Foundation for Fourier analysis and expansion of periodic functions in general.

  • Simple mathematical tool for approximation of periodic functions.

  • The coefficients are called frequency spectrum.

  • Each coefficient is the projection of the -th basis function onto .

  • It answers the question: "How important is this basis function in the grand scheme of ?"

  • Typically, we use a scale for visualization of the coefficients.

Fourier series on -periodic functions

Any -period function can be expanded in the following way:

  •  — frequency at which and oscillate

  •  — coefficients of even parts of

  •  — coefficients of odd parts of

Fourier series on L-periodic functions

Similar to -periodic functions, but we multiply by , where :

Complex Fourier series on -periodic functions

With complex numbers the formula becomes:

When we express out of the above formula, it converts time into frequency:

Complex Fourier series on L-periodic functions

We multiply by and adjust the scaling factor and integral boundaries, where :

Expansion/Frequency → Time:

Time → Frequency:

Why use complex numbers in the Fourier series and Fourier transform?
  1. They simplify the formula:

    • (Euler’s formula)

  2. With them, FT is can be solved linearly and expressed using matrix multiplication. Without them, it’s an optimization problem that must be solved numerically.

    • If we used real numbers and, for example, as the basis function, we would not be able to use matrix multiplication and would have to find numerically.

  3. Complex numbers also symbolize rotation, which makes for a nice intuitive explanation (see below).

Proof of orthogonality of the Fourier series

TODO

Gibbs phenomenon

Functions with discontinuities are hard to be approximated with Fourier series as and are both smooth.

fa02 gibbs

Fourier transform

Fourier transform (FT)

Fourier transform is a function taking a signal (a function of time) and converting it to the frequency domain (function of frequencies).

  • FT is a generalization of FS. It’s derived from L-periodic complex FS with .

  • FS handles only periodic signal. FT handles aperiodic signal.

  • It’s total. Lossless. Doesn’t throw away any information. It’s invertible. A bijection. A linear mapping.

  • It a tool for frequency analysis.

Inverse transform (frequency → time):

Forward transform (time → frequency):

Commonly:

Coefficients of the Fourier transform
  • Each coefficient is associated with a basis function oscillating at frequency .

  • is simply a complex number, where:

    • amplitude  — strength of basis function

    • phase  — controls the phase shift of basis function

Spectral density

Plot of for .

fa02 spectral density
Function pairs in the Fourier transform
  • FT of the rectangle function is sinc.

  • FT of a Gaussian is a (different) Gaussian.

Intuitive explanation of the Fourier transform [2]
  1. Complex numbers describe rotation, therefore multiplying by a set of complex numbers "winds up" around a circle.

  2. Sampling this wound-up version of (whether using an integral or sum) means calculating the center of mass of the wound up version.

  3. When the center of mass is far away from the origin, the wound-up "aligns" with itself, meaning there is a strong correlation between and the sinusoid given by the "winding" frequency.

    • Except in FT, there is no division by the length of the studied interval, so it’s a "scaled center of mass". This has the effect that the more persistent a frequency is, the higher its spike.

fa02 intuitive ft 1
fa02 intuitive ft 2
Note
The "winding" is clockwise by convention. That’s why there’s a in the equation.
Properties of the Fourier transform
  • Shift affects only the phase

  • Scaling — Narrowing in the time domain causes widening in the frequency domain, and vice versa:\

  • Derivative enhances high frequencies:

Convolution theorem (CZ: věta o konvoluci)

Given two signals and and their Fourier transforms and , respectively, the following holds:

where '' stands for a convolution and '' for point-wise multiplication.

Discrete time Fourier Transform (DTFT)

We sample the time domain:

TODO

Discrete Fourier transform (DFT)
  • DTFT with a limited range

  • is also called "direct current (DC)", "mean", or "normalizovaný součet"

    • prakticky má omezený rozsah, matematicky je periodická a dokonečna se opakuje

Vlastnostni DFT
  • V diskrétním světě nefunguje škálování, máme jen převzorkování.

  • Periodicita + můžeme sáhnout mimo a bude tam hodnota

  • vstupní signál se tváří periodicky, takže může vzniknout "falešná hrana"

    • řešení - rozmažeme hraje - Hammingovo okno (děláme konvoluci ve frekvenční doméně, takže násobíme v původní doméně)

  • zajímají nás nízké frekvence, proto v praxi je ve vizualizacích nula uprostřed

  • hermitovská symetrie

  • konvoluční teorém - platí, ale potřeba přidat normalizaci

  • kronekrovo delta

  • DFT a IDFT je efektivnější než konvoluce, ale musíme mít signál rozumné délky (na délce třeba 5 se to nevyplatí)

  • stretch

  • TODO: proč musím snížit amplitudu o 1/sqrt(p)?

  • u piana a hlasů je v té vizualizaci vpravo dole jen amplituda?

  • mixážní pulty umožňují omezit/zvýšit konkrétní rozsahy frekvencí

  • fast fourier transform

  • rekurzivní, rozděl a panuj

  • využívá vlastnosti DFT (stretch, shift, linearity), vlastně vůbec nepočítá vzoreček DFT

  • …​ale postupů je víc

  • na dně vracím vstup

1D Fourier transform formula summary
fa02 fa summary
Low-pass filter
  • Linear filter

  • Low frequencies pass through

High-pass filter
  • Linear filter

  • High frequences pass through

Sampling
  • Abych mohl vzorkovat, musí mít spojitá funkce omezenou nejvyšší frekvenci. (Jinak se frekvenční spektrum ořízne.)

  • Vzorkovací frekvence je zespodu omezená tím, že nechceme ztratit informace, a seshora smysluplností - nechceme plýtvat místem a výkonem.

  • Vzorkováním vzniká omezený ale periodický frekvenční prostor.

  • Nyquist-Shannon theorem

  • Prefiltering jako řešení aliasingu

  • Resampling

  • Warping

  • Post-filtering - supersampling

Fourier Transform in 2D

Fourier transform in 2D

Forward continuous:

Inverse continuous:

Forward discrete (2D DFT) of image with pixels:

Inverse discrete (2D IDFT) of frequency domain with values:

Frequency domain (FD) in 2D DFT
  • We only care about one period of FD. Thus, the FD "image" has the same size as the original.

  • We shift the image by so that zero frequency is in the center (and not in the corner).

  • The FD has two components (real/imaginary, or magnitude/phase). Typically, we only display magnitude but phase still exists!

  • We show the FD magnitudes on a scale.

fa02 2d frequency domain

Visually, each vector of FD represents a 2D sinusoidal function of . Magnitude of is the frequency. Direction of is the orientation of the "waves".

fa02 2d basis function example

Questions

Explain the meaning of Fourier coefficients.

They measure the amount of correlation of a single basis function with the expanded function.

Prove that Fourier transform is a linear mapping.

TODO

Describe the spectral density plot.

TODO

Which frequencies dominate in the Gaussian plot?

TODO

Which operation in frequency domain corresponds to convolution in time domain?

Point-wise multiplication.

Which frequencies are enhanced if we apply a derivative to an input signal?

TODO

Define a discrete Fourier basis function with frequency k and overall length N.

TODO

Create a matrix that can perform forward Fourier transform for a signal of length .

TODO

What is the product of the projection of an even function into a sin wave?

TODO

Why are the wide functions in time domain transformed into their narrow counterparts in frequency domain and vice versa?

TODO

Compare the complexity of standard DFT and FFT.

TODO

What happens in Fourier domain if the signal samples are interleaved with zeros?

TODO

Prove that DFT is a linear mapping.

TODO

Why does scaling not work in the case of DFT?

TODO

Explain the reciprocity of time and frequency domain.

TODO

Show an example of the aliasing effect.

TODO

Explain the difference between low-pass and high-pass filter.

TODO

What is a prefilter?

TODO

Give an example of warping function.

TODO

Explain the relationship between DFT and DCT.

TODO

Describe the F-DCT algorithm and compute .

TODO

Is there ever any reason to do a convolution in the frequency domain?

TODO

References