0% found this document useful (0 votes)
66 views

Fourier Analysis and Sampling Theory: Reading

This document discusses Fourier analysis and sampling theory as it relates to digital images. It begins by defining an image as a function that assigns intensity values to positions in space. Digital images sample this function on a grid and quantize the values. Fourier analysis represents functions as sums of sinusoids, allowing convolution to be represented as multiplication in the frequency domain. The key concepts covered are the Fourier transform, convolution theorem, delta functions, sampling theorem, and reconstruction filters for upsampling and downsampling images.

Uploaded by

essi90
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views

Fourier Analysis and Sampling Theory: Reading

This document discusses Fourier analysis and sampling theory as it relates to digital images. It begins by defining an image as a function that assigns intensity values to positions in space. Digital images sample this function on a grid and quantize the values. Fourier analysis represents functions as sums of sinusoids, allowing convolution to be represented as multiplication in the frequency domain. The key concepts covered are the Fourier transform, convolution theorem, delta functions, sampling theorem, and reconstruction filters for upsampling and downsampling images.

Uploaded by

essi90
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

1

Fourier analysis and


sampling theory
Brian Curless
CSE 557
Fall 2009
2
Reading
Required:
Shirley, Ch. 9
Recommended:
Ron Bracewell, The Fourier Transform and Its
Applications, McGraw-Hill.
Don P. Mitchell and Arun N. Netravali,
Reconstruction Filters in Computer Computer
Graphics , Computer Graphics, (Proceedings of
SIGGRAPH 88). 22 (4), pp. 221-228, 1988.
3
What is an image?
We can think of an image as a function, f, from R
2
to
R:
f(x,y) gives the intensity of a channel at position
(x,y)
Realistically, we expect the image only to be
defined over a rectangle, with a finite range:
f: [a,b]x[c,d] [0,1]
A color image is just three functions pasted together.
We can write this as a vector-valued function:
Well focus in grayscale (scalar-valued) images for
now.
( , )
( , ) ( , )
( , )
r x y
f x y g x y
b x y


=



4
Images as functions
5
Digital images
In computer graphics, we usually create or operate
on digital (discrete) images:
Sample the space on a regular grid
Quantize each sample (round to nearest
integer)
If our samples are apart, we can write this as:
f [n ,m] = Quantize{ f (n , m ) }
6
Motivation: filtering and resizing
What if we now want to:
smooth an image?
sharpen an image?
enlarge an image?
shrink an image?
In this lecture, we will explore the mathematical
underpinnings of these operations.
7
Convolution
One of the most common methods for filtering a
function, e.g., for smoothing or sharpening, is called
convolution.
In 1D, convolution is defined as:

( ) ( ) ( )
( ') ( ') '
( ') ( ' ) '
g x f x h x
f x h x x dx
f x h x x dx

=
=
=

where ( ) ( ). h x h x
8
Convolution in 2D
In two dimensions, convolution becomes:
( , ) ( , ) ( , )
( ', ') ( ', ') ' '
( ', ') ( ' , ' ) ' '
g x y f x y h x y
f x y h x x y y dx dy
f x y h x x y y dx dy




=
=
=


where ( , ) ( , ). h x y h x y =
*
=
f(x,y) h(x,y) g(x,y)
9
Fourier transforms
Convolution, while a bit cumbersome looking,
actually has a beautiful structure when viewed in
terms of Fourier analysis.
We can represent functions as a weighted sum of
sines and cosines.
We can think of a function in two complementary
ways:
Spatially in the spatial domain
Spectrally in the frequency domain
The Fourier transformand its inverse convert
between these two domains:
2
( ) ( )
i sx
F s f x e dx

=

2
( ) ( )
i sx
f x F s e ds

=

Frequency
domain
Spatial
domain
10
Fourier transforms (contd)
f(x) is usually a real signal, but F(s) is generally
complex:
where magnitude |F(s)| and phase (s) are:
Where do the sines and cosines come in?
[ ]

= +
=
2 2
1
( ) ( ) ( )
( ) tan ( ) / ( )
F s A s B s
s B s A s

= + =
2 ( )
( ) ( ) ( ) ( )
i s
F s A s iB s F s e
2
( ) ( )
i sx
F s f x e dx

=

2
( ) ( )
i sx
f x F s e ds

=

Frequency
domain
Spatial
domain
11
Fourier transform example
<

= =

>

1 1/ 2
( ) 1/ 2 1/ 2
0 1/ 2
x
x x
x
12
More 1D Fourier examples
I derived the cosine version, but actually
\int_-inf^inf cos()dx is not well-defined,
so problematic.
13
Some properties of FTs
Amplitude scaling:
Additivity:
Domain scaling:
2
( ) ( )
i sx
F s f x e dx

=

14
2D Fourier transform
2 ( )
( , ) ( , )
x y
i s x s y
x y
F s s f x y e dxdy


+

=

2 ( )
( , ) ( , )
x y
i s x s y
x y x y
f x y F s s e ds ds


+

=

Frequency
domain
Spatial
domain
Spatial domain Frequency domain
( , )
x y
F s s ( , ) f x y
15
2D Fourier examples
Spatial
domain
Frequency
domain
( , )
x y
F s s
( , ) f x y
16
Fourier transforms and convolution
What is the Fourier transform of the convolution of
two functions? (The answer is very cool!)
?? f h
17
Convolution theorems
Convolution theorem: Convolution in the spatial
domain is equivalent to multiplication in the
frequency domain.
Symmetric theorem: Convolution in the frequency
domain is equivalent to multiplication in the spatial
domain.
f h F H
f h F H
18
1D convolution theorem example
19
2D convolution theorem example
*
f(x,y)
h(x,y)
g(x,y)
|F(s
x
,s
y
)|
|H(s
x
,s
y
)|
|G(s
x
,s
y
)|
20
Convolution properties
Convolution exhibits a number of basic, but important
propertieseasily proved in the Fourier domain.
Commutativity:
Associativity:
Linearity:
= [ ( ) ( )] ( ) ( ) [ ( ) ( )] a x b x c x a x b x c x
( ) ( ( ) ( )) ( ) ( ) ( ) ( ) a x b x c x a x b x a x c x + = +
= ( ) ( ) ( ) ( ) a x b x b x a x
= ( ) [ ( )] [ ( ) ( )] a x k b x k a x b x
21
The delta function
The Dirac delta function (or impulse function), (x),
is a handy tool for sampling theory.
It has zero width, infinite height, and unit area.
Can be computed as a limit of various functions, e.g.:
It is usually drawn as:
2
2
0 0
1 1
( ) lim exp lim
2 2
w
x x
x
w w





= =



22
Sifting and shifting
For sampling, the delta function has two important
properties.
Sifting:
Shifting:
( ) ( ) ( ) ( ) f x x a f a x a =
( ) ( ) ( ) f x x a f x a =
23
The shah/comb function
A string of delta functions is the key to sampling. The
resulting function is called the shah or comb
function or impulse train:
which looks like:
We can also define an impulse train in terms of a
desired delta function spacing, T:
which looks like:
III( ) ( )
n
x x n

=
=

III( ; ) ( )
n
x T x nT

=
=

24
The shah/comb function, contd
If we multiply an input function by the impulse train,
we get:
III ( ) ( ; ) ( ) ( )
n
f x x T f x x nT

=
=

25
The shah/comb function, contd
Amazingly, the Fourier transform of the shah
function is also the shah function:
One can also show that:
where s
o
= 1/T.
We can visualize this as:
For convenience, I wont draw the delta functions as
scaled vertically, though mathematically, one must
keep track of these scale factors.
III III ( ) ( ) x s
( ) ( ) III III III
1
( ; ) ;1/ ;
o o
x T s T s s s
T
=

26
Now, we can talk about sampling.
The Fourier spectrum gets replicated by spatial
sampling!
How do we recover the signal?
Sampling
27
Sampling and reconstruction
28
Sampling and reconstruction in 2D
29
Sampling theorem
This result is known as the Sampling Theoremand is
due to Claude Shannon who first discovered it in
1949:
A signal can be reconstructed from its samples
without loss of information, if the original signal
has no frequencies above the sampling
frequency.
For a given bandlimited function, the minimum rate
at which it must be sampled is the Nyquist
frequency.
30
Reconstruction filters
The sinc filter, while ideal, has two drawbacks:
It has large support (slow to compute)
It introduces ringing in practice
We can choose from many other filters
31
Cubic filters
Mitchell and Netravali (1988) experimented with
cubic filters, reducing them all to the following form:
The choice of B or C trades off between being too
blurry or having too much ringing. B=C=1/3 was
their visually best choice.
The resulting reconstruction filter is often called the
Mitchell filter.
3 2
3 2
(12 9 6 ) ( 18 12 6 ) (6 2 ) 1
1
( ) (( 6 ) (6 30 ) ( 12 48 ) (8 24 ) 1 2
6
0
B C x B C x B x
r x B C x B C x B C x B C x
otherwise

+ + + + <

= + + + + + <

2 1.5 1 0.5 0 0.5 1 1.5 2


0
0.5
1
32
Reconstruction filters in 2D
We can also perform reconstruction in 2D
33
Aliasing
What if we go below the Nyquist frequency?
34
Anti-aliasing
Anti-aliasing is the process of removing the
frequencies before they alias.
35
We can fill the magic box with analytic pre-filtering
of the signal:
Why may this not generally be possible?
Anti-aliasing by analytic prefiltering
36
Filtered downsampling
Alternatively, we can sample the image at a higher
rate, and then filter that signal:
We can now sample the signal at a lower rate. The
whole process is called filtered downsampling or
supersampling and averaging down.
37
Practical upsampling
When resampling a function (e.g., when resizing an
image), you do not need to reconstruct the complete
continuous function.
For zooming in on a function, you need only use a
reconstruction filter and evaluate as needed for each
new sample.
Heres an example using a cubic filter:
38
Practical upsampling
This can also be viewed as:
1. putting the reconstruction filter at the desired
location
2. evaluating at the original sample positions
3. taking products with the sample values
themselves
4. summing it up
Important: filter should always be normalized!
39
Practical downsampling
Downsampling is similar, but filter has larger support
and smaller amplitude.
Operationally:
1. Choose reconstruction filter in downsampled
space.
2. Compute the downsampling rate, d, ratio of
new sampling rate to old sampling rate
3. Stretch the filter by 1/d and scale it down by d
4. Follow upsampling procedure (previous
slides) to compute new values
40
2D resampling
Weve been looking at separable filters:
How might you use this fact for efficient resampling
in 2D?
=
2 1 1
( , ) ( ) ( )
D D D
r x y r x r y

You might also like