Fourier Transform: (1, 0) (0, 1) (X, Y) X (1, 0) + y (0, 1)
Fourier Transform: (1, 0) (0, 1) (X, Y) X (1, 0) + y (0, 1)
1 Introduction
The next three classes are about smoothing and diffusion. We can think of these as simple ways of spreading information around the image. To understand these, we need to understand some technical results. How do we smooth an image? With convolution. How do we understand the effects of convolution? With the Fourier Transform. How do we diffuse information? This is just smoothing and convolution (in part).
2 Fourier Transform
Well start with the Fourier Transform. This is one effective way of representing images. To see this, we rst ask what properties a good image representation should have. But rst, we back up and look at familiar representations. How do we represent points in 2d? Using their x and y coordinates. What this really means is that we write any point as a linear combination of two vectors (1, 0) and (0, 1). (x, y) = x(1, 0) + y(0, 1). These vectors form an orthonormal basis for the plane. That means they are orthogonal (1, 0), (0, 1) = 0, and of unit magnitude. Why is an orthonormal basis a good representation? There are many reasons, but two are: 1. Projection. To nd the x coordinate, we take (x, y), (1, 0) . 2. Pythagorean theorem. (x, y)
2
= x2 + y 2 .
That is, its an innite sum of scaled delta functions. In a sense, these form an orthonormal basis, but they are uncountable, which is awkward. For example, any nite subset of them provide a poor approximation to f (or any countable subset for that matter). We can do much better. Another representation is familiar from the Riemann integral. Dene a series of step functions that ll the interval. That is, let: 2(i 1) 2i k for <= t <= 2 k k Then gk = gk,1 , gk,k provides a nite basis for piecewise constant functions. We can approximate f as a linear combination of these. gk,i (t) =
k
f (t)
i=1
ai gk,i
In the limit, this approximation becomes arbitrarily good. The Riemann integral computes the sum of the area of functions, in the limit. If we take the union of all gk we get a countable set of functions that span a linear subspace that gets arbitrarily close to any f (t). So we can represent any f (t) as a countable sum. Question: f (t) has an uncountable number of degrees of freedom. How can we represent it with a countable representation? Answer: We make some continuity assumptions. These imply that if we know f (t) at every rational number, we can determine it at every real number, so they reduce the degrees of freedom of f (t) to the countable. However, the union of all gk do not provide an orthonormal basis, since they are redundant and non-orthogonal. Later, well see how a sort of variation on this basis gives us an orthonormal wavelet basis. For now, we look at the fourier series.
f (t) = a0 +
1
ak cos(kt) + bk sin(kt)
That is,
N N
lim
(f (t) a0
1
ak cos(kt) + bk sin(kt))2 = 0
Why is this true? The intuition is that we rst create a series of delta-like functions like cos2n (t/2). We show that any function can be represented by these in the same way we did
with the series gk . Then show these are linear combinations of cos(kt), sin(kt) using trigonometric identities such as sin(t/2) = (((1 cos(t))/2)) and sin2 t = (1 cos(2t))/2. Notation. We can combine sin and cos into one complex number. eikt = cos(kt) + isin(kt) (using Eulers formula). We let k go from to . This gives us a basis for complex functions (which we dont care about right now) and somewhat simpler notation. We can write:
f=
k=
ck eikt
We compute: ck = 1 2
0
f (s)eikt ds
Notice that to take the inner product of complex numbers we must take the complex conjugate of one. So, for example, the inner product of (1 + i) with itself is not 12 + i2 = 0, but is 12 i2 = 2. For real valued functions, this representation is equivalent to writing the Fourier series out using sines and cosines, though it is simpler and more compact. This is because: ck eikt + ck eikt = (ck + ck ) cos kt + i(ck ck ) sin kt cos kt 2 sin kt 2 f (s) cos ksds + f (s) sin ksds = 0 0 = ak cos kt + bk sinkt Since the coefcients of an imaginary fourier series are complex, its often useful to discuss its two components as phase and magnitude. F (t) = R(t) + iI(t) Magnitude is (R(u)2 + I(u)2 )1/2 , phase is tan1 I(u)/R(u).
And then: f (t) = a0 /2 + ak cos(kt) + bk sin(kt) The analog to the Pythagorean theorem is called Parsevaals theorem. This is: f 2 (t) = (/2)a2 + ( 0 a2 + b2 ). i i
And if we approximate a function with a nite number of terms in a fourier series, we can measure the quality of this approximation.
N
(f (t) a0 /2
1
ak cos(kt) +
bk sin(kt))2 = (
N +1
ak cos(kt) +
bk sin(kt))2
If we take the limit as l , this is equivalent to using eikt for any real value of k. So, instead of taking a sum, we must take an integral.
f (t) =
F (t)eikt
This makes sense, because if we have a long enough interval, any two sine waves with different (real, not integer) frequencies will be orthogonal, because eventually they go completely out of phase. So for example, sin(t) and sin(1.5t) will be orthogonal over an interval of 0 to 4, even though they wouldnt be over an interval of 0 to 2pi. So, we have:
F (t) =
f (t)eikt