next up previous
Next: The Quantized Degrees-of-Freedom in Up: No Title Previous: Linear Operators and Their

Fourier Analysis

It has been said that the most remarkable and far-reaching relationship in all of mathematics is the simple Euler Relation,

\begin{displaymath}e^{i \pi} + 1 = 0
\end{displaymath} (48)

which contains the five most important mathematical constants, as well as harmonic analysis. This simple equation unifies the four main branches of mathematics: {0,1} represent arithmetic, $\pi$ represents geometry, i represents algebra, and e=2.718... represents analysis, since one way to define e is to compute the limit of $(1 + \frac{1}{n})^{n}$as $n \rightarrow \infty$.

Fourier analysis is about the representation of functions (or of data, signals, systems, ...) in terms of such complex exponentials. (Almost) any function
f(x)can be represented perfectly as a linear combination of basis functions:

\begin{displaymath}f(x)= \sum_{k}a_{k}\Psi_{k}(x)
\end{displaymath} (49)

where many possible choices are available for the expansion basis functions $\Psi_{k}(x)$. In the case of Fourier expansions in one dimension, the basis functions are the complex exponentials:

\begin{displaymath}\Psi_{k}(x) = \exp(i\mu_{k} x)
\end{displaymath} (50)

where the complex constant $i = \sqrt{-1}$. A complex exponential contains both a real part and an imaginary part, both of which are simple (real-valued) harmonic functions:

\begin{displaymath}\exp(i \theta) = \cos(\theta) + i \sin(\theta)
\end{displaymath} (51)

which you can easily confirm by using the power-series definitions for the transcendental functions $\exp$, $\cos$, and $\sin$:
$\displaystyle \exp(\theta)$ = $\displaystyle 1 + \frac{\theta}{1!} + \frac{\theta^{2}}{2!} +
\frac{\theta^{3}}{3!} + \cdots + \frac{\theta^{n}}{n!} + \cdots ,$ (52)
       
$\displaystyle \cos(\theta)$ = $\displaystyle 1 - \frac{\theta^{2}}{2!} + \frac{\theta^{4}}{4!} -
\frac{\theta^{6}}{6!} + \cdots ,$ (53)
       
$\displaystyle \sin(\theta)$ = $\displaystyle \theta - \frac{\theta^{3}}{3!} + \frac{\theta^{5}}{5!} -
\frac{\theta^{7}}{7!} + \cdots ,$ (54)


Fourier Analysis computes the complex coefficients
akthat yield an expansion of some function f(x) in terms of complex exponentials:

\begin{displaymath}f(x)= \sum_{k=-n}^{k=n}a_{k} \exp(i\mu_{k} x)
\end{displaymath} (55)

where the parameter $\mu_{k}$ corresponds to frequency and n specifies the number of terms (which may be finite or infinite) used in the expansion.

Each Fourier coefficient
ak in f(x)is computed as the orthonormal projection of the function f(x) onto one complex exponential $\exp(-i\mu_{k} x)$ associated with that coefficient:

\begin{displaymath}a_{k}=\frac{1}{T}\int_{-T/2}^{+T/2} f(x) \exp(-i\mu_{k}x) dx
\end{displaymath} (56)

where the integral is taken over one period (T) of the function if it is periodic, or from $-\infty$ to $+\infty$ if it is aperiodic. (An aperiodic function is regarded as a periodic one whose period is $\infty$). For periodic functions the frequencies $\mu_{k}$used are just all multiples of the repetition frequency; for aperiodic functions, all frequencies must be used. Note that these computed Fourier coefficients ak are complex-valued. If the function f(x) is real-valued, then its representation in the Fourier domain has two-fold redundancy. The real-parts of the ak have even-symmetry: ak = a-k, and their imaginary-parts have odd-symmetry: ak = -a-k. Given this ``Hermitian" symmetry, only one half of the Fourier coefficients for a real-valued function f(x)need be computed, to obtain them all.


 
Figure 1: Illustration of convergence of Fourier series for a square-wave.

Useful Theorems of Fourier Analysis

Throughout, we will denote the Fourier representation of our original function
f(x)as $F(\mu)$, where $\mu$ is frequency. If f(x) is a continuous periodic function, then $F(\mu)$ is a discrete set of frequency components in a Fourier series. If f(x) is a continuous but aperiodic function, then $F(\mu)$ is also a continuous and aperiodic function, termed the Fourier Transform of f(x).
Shift Theorem:
Shifting the original function f(x)by some displacement $\alpha$ merely multiplies its Fourier Transform by $\exp(-i\alpha \mu)$.

Thus the Fourier Transform of the shifted pattern $f(x-\alpha)$ is simply:
$F(\mu)\exp(-i\alpha \mu)$.

Similarity Theorem:
If the scale of the original function f(x) changes
(shrinks or expands along the abscissa) by a factor $\alpha$, becoming $f(\alpha x)$, then the Fourier Transform of the function also changes (shrinks or expands) by the reciprocal of that factor: $F(\mu) \rightarrow \frac{1}{\vert\alpha \vert}F(\mu / \alpha)$.
Convolution Theorem:
Let function f(x) have Fourier Transform $F(\mu)$, and let function g(x) have Fourier Transform $G(\mu)$. The convolution of f(x) with g(x), which is denoted f*g, combines these two functions to generate a third function h(x), whose value at location (x) is equal to the integral of the product of functions f and g after they undergo a relative shift by amount (x):

\begin{displaymath}h(x)=\int_{-\infty}^{+ \infty} f(\alpha)g(x-\alpha) d\alpha
\end{displaymath} (57)

Thus, convolution is a way of combining two functions, in a sense using each one to blur the other, making all possible relative shifts between the two functions when computing the integral of their product to obtain the corresponding output values.

Convolution is extremely important because it is one basis of describing how any linear system h(t) acts on any input s(t) to generate the corresponding output r(t). Specifically, the output is just the convolution of the input with the characteristic system response function:

r(t)=h(t)*s(t) (58)

The Convolution Theorem states that convolving any two functions f(x) and g(x) together simply multiplies their two Fourier Transforms together, to generate the Fourier Transform of the result of the convolution:

\begin{displaymath}H(\mu) = F(\mu)G(\mu)
\end{displaymath} (59)

where $H(\mu)$ is the Fourier Transform of the desired result h(x), and $F(\mu)$ and $G(\mu)$ are the Fourier Transforms of f(x) and g(x), respectively.

This is extremely useful since it is much easier to multiply two functions $F(\mu)$ and $G(\mu)$ together, to obtain $H(\mu)$, than to convolve f(x) and g(x) together to obtain h(x). Of course, exploiting the Convolution Theorem means going into the Fourier Domain and computing the Fourier Transforms of f(x) and g(x), but with powerful and fast FFT algorithms, this is very easy.
Differentiation Theorem:
Computing the derivatives of a function f(x) is equivalent to multiplying its Fourier Transform, $F(\mu)$, by frequency raised to a power equal to the order of differentiation:

\begin{displaymath}\left( \frac{d}{d x}\right) ^{m}
f(x) \stackrel{FT}{\Longrightarrow}
(i\mu)^{m}F(\mu)
\end{displaymath} (60)

We will now re-capitulate these theorems for the case of two-dimensional functions f(x,y) because then all these these tools can be applied to computer vision, with f(x,y) being regarded as an image. Many underlying principles and concepts from computer vision (such as scale; edge or motion energy; filtering; directional derivative; textural signature; statistical structure; etc.) must be understood in ``spectral" (i.e. Fourier) terms.

In addition to this explanatory role, Fourier analysis can be used directly to construct useful pattern representations that are invariant under translation (change in position), rotation, and dilation (change in size). This is therefore the representation underlying many pattern classification and recognition applications, such as optical character recognition (OCR).

Finally, many operations in practical computing that might not seem related in any way to Fourier analysis, such as computing correlations, convolutions, derivatives, differential equations, and diffusions, are much more easily implemented in the Fourier domain. (Powerful algorithms like the FFT make it easy to go back and forth rapidly between the image and Fourier domains).

Consider a pattern as a distribution over the
(x,y) plane: a real-valued two-dimensional function f(x,y).

Any such function can be represented perfectly as a linear combination of two-dimensional basis functions

\begin{displaymath}f(x,y)= \sum_{k}a_{k}\Psi_{k}(x,y)
\end{displaymath} (61)

where many possible choices are available for the expansion basis functions $\Psi_{k}(x,y)$. In the case of Fourier expansions in two dimensions, the basis functions are the bivariate complex exponentials:

\begin{displaymath}\Psi_{k}(x,y) = \exp(i(\mu_{k} x + \nu_{k} y))
\end{displaymath} (62)

Fourier Analysis computes the coefficients akthat yield an expansion of the image f(x,y) in terms of bivariate complex exponentials:

\begin{displaymath}f(x,y)= \sum_{k}a_{k} \exp(i(\mu_{k} x + \nu_{k} y))
\end{displaymath} (63)

where the parameters $\mu_{k}$ and $\nu_{k}$ define the coordinates of the 2D Fourier domain. These $(\mu_{k},\nu_{k})$ coordinates are called spatial frequency vectors, and the set of them must span the $(\mu,\nu)$Fourier plane in a uniform Cartesian lattice.

It is often useful to think of the
$(\mu,\nu)$ Fourier plane as resolved into polar coordinates, where $\omega = \sqrt{\mu^{2} + \nu^{2}}$ is (scalar) spatial frequency and $\phi = \tan^{-1}(\nu/\mu)$ is (scalar) orientation.

Each Fourier coefficient
ak is computed as the orthonormal projection of the entire function f(x,y) onto the vector frequency component $\exp(-i(\mu_{k} x + \nu_{k} y))$ associated with that coefficient:

\begin{displaymath}a_{k}=\int_{-\infty}^{+\infty}\int_{-\infty}^{+\infty}f(x,y)\exp(-i(\mu_{k}x+\nu_{k}y)) dx dy
\end{displaymath} (64)


Useful Theorems of Two-Dimensional Fourier Analysis

The following theorems describe what happens to
$F(\mu,\nu)$, the 2D Fourier Transform of a function f(x,y), when various operations are applied to f(x,y) before its Fourier Transform is taken.
Shift Theorem:
Shifting the original pattern in (x,y)by some 2D displacement $(\alpha, \beta)$ just multiplies its 2DFT by $\exp(-i(\alpha \mu + \beta \nu))$.

Thus the 2DFT of the shifted pattern $f(x-\alpha,y-\beta)$, is simply:
$F(\mu,\nu)\exp(-i(\alpha \mu + \beta \nu))$.
Practical Application:
The power spectrum of any pattern is thus
translation-invariant: it does not depend on where the pattern is located within the image, and so you don't have to find it first. The power spectrum is defined as the product of the pattern's 2DFT, $F(\mu,\nu)$ times its complex conjugate, $F^{*}(\mu,\nu)$, which just requires that the sign (-) of the imaginary part of $F(\mu,\nu)$ gets reversed. You can easily see that the power spectrum of the shifted pattern $f(x-\alpha,y-\beta)$, namely:

$\exp(-i(\alpha \mu + \beta \nu))F(\mu,\nu)
\exp(i(\alpha \mu + \beta \nu))F^{*}(\mu,\nu)$

is exactly equal to the power spectrum of the original, unshifted pattern: $F(\mu,\nu)F^{*}(\mu,\nu)$.
Similarity Theorem:
If the size of the original pattern f(x,y) changes
(shrinks/expands), say by a factor $\alpha$ in the x-direction, and by a factor $\beta$ in the y-direction, becoming $f(\alpha x,\beta y)$, then the 2DFT of the pattern, $F(\mu,\nu)$, also changes (expands/shrinks) by the reciprocal of those factors: $F(\mu,\nu) \rightarrow \frac{1}{\vert\alpha \beta\vert}F(\frac{\mu}{\alpha},
\frac{\nu}{\beta})$.
Rotation Theorem:
If the original pattern f(x,y)rotates through some angle $\theta$, becoming $f(x\cos(\theta)+y\sin(\theta), -x\sin(\theta)+
y\cos(\theta))$, then its 2DFT $F(\mu,\nu)$ also just rotates through the same angle:
$F(\mu,\nu) \rightarrow
F(\mu\cos(\theta)+\nu\sin(\theta), -\mu\sin(\theta)+\nu\cos(\theta))$.
Practical Application:
Size- and orientation-invariant pattern representations can be constructed by these relationships. Specifically, if the Fourier domain $(\mu,\nu)$ is now mapped into log-polar coordinates $(r,\theta)$ where $r=\log(\sqrt{\mu^{2}+\nu^{2}})$ and $\theta=\tan^{-1}(\nu/\mu)$, then any dilation (size change) in the original pattern becomes simply a translation along the r-coordinate; and any rotation of the original pattern becomes simply a translation along the orthogonal $\theta$-coordinate in this log-polar Fourier domain. But we saw earlier that translations become immaterial by taking a power spectrum, and so these effects of dilation and rotation of the pattern are eliminated in such a representation.

Combined with the translation-invariant property of the power spectrum, we now see how it becomes possible to represent patterns in a manner that is independent of their position in the image, their orientation, and their size (i.e. the Poincaré group of transformations) These principles are routinely exploited in machine optical character recognition; in military recognition of aircraft profiles; and in ``optical computing" generally.
Convolution Theorem:
Let function f(x,y) have 2DFT $F(\mu,\nu)$, and let function g(x,y) have 2DFT $G(\mu,\nu)$. The convolution of f(x,y) with g(x,y), which is denoted f*g, combines these two functions to generate a third function h(x,y), whose value at location (x,y) is equal to the integral of the product of functions f and g after they undergo a relative shift by amount (x,y):

\begin{displaymath}h(x,y)=\int_{-\infty}^{+\infty}\int_{-\infty}^{+\infty}f(\alpha,\beta)g(x-\alpha,y-\beta) d\alpha d\beta
\end{displaymath} (65)

Thus, convolution is a way of combining two functions, in a sense using each one to blur the other, making all possible relative shifts between the two functions when computing the integral of their product to obtain the corresponding output values.

In the above integral definition, if the minus (-) signs were simply replaced with (+) signs, the new expression would be the correlation integral.

The Convolution Theorem states that convolving two functions f(x,y) and g(x,y) together in the image domain, simply multiplies their two 2DFT's together in the 2D Fourier domain:

\begin{displaymath}H(\mu,\nu) = F(\mu,\nu)G(\mu,\nu)
\end{displaymath} (66)

where $H(\mu,\nu)$ is the 2DFT of the desired result h(x,y).

This is extremely useful since it is much easier just to multiply two functions $F(\mu,\nu)$ and $G(\mu,\nu)$ together, to obtain $H(\mu,\nu)$, than to have to convolve f(x,y) and g(x,y) together to obtain h(x,y). Of course, exploiting the Convolution Theorem means going into the 2D Fourier Domain and computing the 2DFT's of f(x,y) and g(x,y), but with powerful and fast 2D-FFT algorithms, this is very easy.
Practical Application: Filtering.
The basis of all encoding, image processing, and feature extraction operations is the filtering of an image f(x,y) with some family of filters g(x,y). Filtering is a linear operation implemented by the convolution of an image f(x,y) with filter kernel(s) g(x,y), and the resulting output ``image" h(x,y) normally then undergoes non-linear operations of various kinds for image segmentation, motion detection, texture classification, pattern recognition, and image understanding.
Differentiation Theorem:
Computing the derivatives of an image f(x,y) is equivalent to multiplying its 2DFT, $F(\mu,\nu)$, by the corresponding frequency coordinate raised to a power equal to the order of differentiation:

\begin{displaymath}\left( \frac{d}{d x}\right) ^{m} \left( \frac{d}{d y}
\right)...
...stackrel{2DFT}{\Longrightarrow}
(i\mu)^{m}(i\nu)^{n}F(\mu,\nu)
\end{displaymath} (67)


A particularly useful implication of this theorem is that isotropic differentiation, which treats all directions equally (for which the lowest possible order of differentiation is 2nd-order, known as the Laplacian operator $\nabla^{2}$) is equivalent simply to multiplying the 2DFT of the image by a paraboloid:

\begin{displaymath}\nabla^{2}f(x,y)\equiv
\left(\frac{d^{2}}{d x^{2}} + \frac{d^...
...)\stackrel{2DFT}{\Longrightarrow} -(\mu^{2}+\nu^{2})F(\mu,\nu)
\end{displaymath} (68)


next up previous
Next: The Quantized Degrees-of-Freedom in Up: No Title Previous: Linear Operators and Their
Neil Dodgson
2000-10-23