Top Banner
1 ASTR 278 Advanced Astronomy An introduction to Fourier Transforms and image processing (lectures 9-12) Lecture 9 Prof.Quentin A Parker 1768-1830 Fourier Jean-Baptiste Joseph
25

1 ASTR 278 Advanced Astronomy An introduction to Fourier Transforms and image processing (lectures 9-12) Lecture 9 Prof.Quentin A Parker 1768-1830 Fourier.

Dec 16, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 1 ASTR 278 Advanced Astronomy An introduction to Fourier Transforms and image processing (lectures 9-12) Lecture 9 Prof.Quentin A Parker 1768-1830 Fourier.

1

ASTR 278 Advanced Astronomy

An introduction to Fourier Transforms and image processing

(lectures 9-12)Lecture 9

Prof.Quentin A Parker

1768-1830 FourierJean-Baptiste Joseph

Page 2: 1 ASTR 278 Advanced Astronomy An introduction to Fourier Transforms and image processing (lectures 9-12) Lecture 9 Prof.Quentin A Parker 1768-1830 Fourier.

2

Recommended texts

The Fourier transform and its applications, R. Bracewell (McGraw-Hill). Image Science, chapter 6, Fourier Transforms and the analysis of Image Resolution and Noise, J.C.Dainty & R. Shaw, 1974, Academic Press (I have a copy)The Analysis and Restoration of Astronomical Data via the Fast Fourier Transform, 1971, J.W.Brault & O.R.White, Astron.Astrophys, 13, 169-189

Page 3: 1 ASTR 278 Advanced Astronomy An introduction to Fourier Transforms and image processing (lectures 9-12) Lecture 9 Prof.Quentin A Parker 1768-1830 Fourier.

3

What is a Fourier Transform?The Fourier transform, in essence, decomposes or separates a waveform or function into sinusoids of different frequency which sum to the original waveform. It identifies or distinguishes the different frequency sinusoids and their respective amplitudes and phase. Fourier transforms, are used extensively in solving problems in science and engineering. The Fourier transform is used in linear systems analysis, optics, antenna systems, random process modeling, probability theory, quantum physics, and boundary-value problems and has been very successfully applied to restoration of astronomical data. The Fourier transform is a versatile and powerful tool used in many fields of science as a mathematical or physical technique to change a problem into one that can be more easily solved (e.g. from the spatial to frequency domain). Some scientists understand Fourier theory as a physical phenomenon, not simply as a mathematical tool!In some branches of science, the Fourier transform of one function may yield to another physical function…

Page 4: 1 ASTR 278 Advanced Astronomy An introduction to Fourier Transforms and image processing (lectures 9-12) Lecture 9 Prof.Quentin A Parker 1768-1830 Fourier.

4

An example

Note the sum of the three sine-waves is a reasonableapproximation to the original function when they have the correct values of frequency, amplitude and phase.

A Fourier transform is a representation of some function in terms of a set of sine-waves. The set of sine-waves of different frequencies is orthogonal, and it can be shown that any continuous function can be represented by summing enough sine-waves of the appropriate frequency, amplitude and phase.

Page 5: 1 ASTR 278 Advanced Astronomy An introduction to Fourier Transforms and image processing (lectures 9-12) Lecture 9 Prof.Quentin A Parker 1768-1830 Fourier.

5

Sine-Waves and Orthogonal Functions

A set of functions is orthogonal if none of the functions can be made up from linear combinations of the others. The set of sine-waves of different frequencies is orthogonal. A good analogy is with red, green, and blue light. However you vary the quantities, you cannot make red from any mixture of green and blue. But with all three colours, you can make any colour you like. Similarly, by mixing sine-waves of every frequency in the right proportions, we can construct any arbitrary function A Fourier Transform (FT) is essentially a method whereby we may obtain a variation in a quantity as a spectral function (e.g. plotted against frequency) from the variation of the quantity as a function of period (e.g. plotted against time or space). The transform holds equally in the reverse direction.

Page 6: 1 ASTR 278 Advanced Astronomy An introduction to Fourier Transforms and image processing (lectures 9-12) Lecture 9 Prof.Quentin A Parker 1768-1830 Fourier.

6

Example continuedNow we will look at the Fourier Transform of the function. The result consists of a series of peaks, the largest of which are at 2, 3 and 5 on the x-axis. These correspond exactly to the sine-wave frequencies which we used to reconstruct the original function. Careful examination reveals that the heights of the peaks correspond to the amplitudes of the three waves:

The smaller peaks in the Fourier transform correspond to additional smaller waves which would have to be added to get a perfect fit to the original function. Thus we can see that the Fourier Transform tells us what mixture of sine-waves is required to make up any function.

Page 7: 1 ASTR 278 Advanced Astronomy An introduction to Fourier Transforms and image processing (lectures 9-12) Lecture 9 Prof.Quentin A Parker 1768-1830 Fourier.

7

Generating a square wave

Page 8: 1 ASTR 278 Advanced Astronomy An introduction to Fourier Transforms and image processing (lectures 9-12) Lecture 9 Prof.Quentin A Parker 1768-1830 Fourier.

8

The Fourier Transform as a mathematical concept

The Fourier Transform is based on the discovery that it is possible to take any periodic function of time x(t) and resolve it into an equivalent infinite summation of sine waves and cosine waves with frequencies that start at 0 and increase in integer multiples of a base frequency f0 = 1/T, where T is the period of x(t). Here is what the expansion looks like:

An expression of the form of the right hand side of this equation is called a Fourier Series. The job of a Fourier Transform is to figure out all the ak and bk values to

produce a Fourier Series, given the base frequency and the function x(t).

You can think of the a0 term outside the summation as the cosine coefficient for k=0.

There is no corresponding zero-frequency sine coefficient b0 because the sine of zero

is zero, and therefore such a coefficient would have no effect.

Page 9: 1 ASTR 278 Advanced Astronomy An introduction to Fourier Transforms and image processing (lectures 9-12) Lecture 9 Prof.Quentin A Parker 1768-1830 Fourier.

9

The Fourier Transform as a mathematical concept continued…..

Of course, we cannot do an infinite summation of any kind on a real computer, so we have to settle for a finite set of sines and cosines. It turns out that this is easy to do for a digitally sampled input, when we stipulate that there will be the same number of frequency output samples as there are time input samples. Also digital signal recordings have a finite length. We can pretend that the function x(t) is periodic, and that the period is the same as the length of the samples signal. In other words, imagine the recording repeating forever, and call this repeating function x(t). The duration of the repeated section defines the base frequency f0 in the equations above. In other words, f0 = samplingRate /N, where N is the number of samples in the recording.

Page 10: 1 ASTR 278 Advanced Astronomy An introduction to Fourier Transforms and image processing (lectures 9-12) Lecture 9 Prof.Quentin A Parker 1768-1830 Fourier.

10

Example

As a concrete example, if you are using a sampling rate of 44100 samples/second, and the length of your detected signal is 1024 samples, the amount of time represented by the recording is 1024 / 44100 = 0.02322 seconds

Hence the base frequency f0 will be 1 / 0.02322 = 43.07 Hz. If you process

these 1024 samples with the FFT, the output will be the sine and cosine coefficients ak and bk for the frequencies 43.07Hz, 2*43.07Hz, 3*43.07Hz,

etc.

To verify that the transform is functioning correctly, you could then generate all the sines and cosines at these frequencies, multiply them by their respective ak and bk coefficients, add these all together, and you will get your

original recording back!

Page 11: 1 ASTR 278 Advanced Astronomy An introduction to Fourier Transforms and image processing (lectures 9-12) Lecture 9 Prof.Quentin A Parker 1768-1830 Fourier.

11

Conceptually it’s a domain thing!For example a measured signal (e.g. as might be detected with a radio telescope) can be viewed from two different standpoints: 1. The frequency domain 2. The time domain In astronomy the frequency domain is perhaps the most familiar, because a spectrometer, e.g. a prism or a diffraction grating, splits light into its component color or frequencies and permits us to record its spectral content. This is like the trace on a spectrum analyser, where the horizontal deflection is the frequency variable and the vertical deflection is the signals amplitude at that frequency. In the lab we are also familiar with the time domain. This is like the trace on an oscilloscope where the vertical deflection is the signals amplitude, and the horizontal deflection is the time variable. Any signal can be fully described in either of these domains. We can go between the two by using Fourier transforms but quite often it is often more convenient to work in the frequency domain. Why the frequency domain ? Depending on what we want to do with the signal, one domain tends to be more useful than the other, so rather than getting tied up in mathematics with a time domain signal we might convert it to the frequency domain where the mathematics are simpler.

Page 12: 1 ASTR 278 Advanced Astronomy An introduction to Fourier Transforms and image processing (lectures 9-12) Lecture 9 Prof.Quentin A Parker 1768-1830 Fourier.

12

Domain equivalence

Page 13: 1 ASTR 278 Advanced Astronomy An introduction to Fourier Transforms and image processing (lectures 9-12) Lecture 9 Prof.Quentin A Parker 1768-1830 Fourier.

13

Mathematical definition

Note that the units of the variable `x’ are the reciprocal of those of `u’

Page 14: 1 ASTR 278 Advanced Astronomy An introduction to Fourier Transforms and image processing (lectures 9-12) Lecture 9 Prof.Quentin A Parker 1768-1830 Fourier.

14

In the optical and imaging domain f(x) is usually a function of distance and F(u) is a function ofspatial frequency –defined in cycles/mm say.

Page 15: 1 ASTR 278 Advanced Astronomy An introduction to Fourier Transforms and image processing (lectures 9-12) Lecture 9 Prof.Quentin A Parker 1768-1830 Fourier.

15

Page 16: 1 ASTR 278 Advanced Astronomy An introduction to Fourier Transforms and image processing (lectures 9-12) Lecture 9 Prof.Quentin A Parker 1768-1830 Fourier.

16

Some elementary Fourier Transforms

The Dirac Delta function

This function is essentially an infinitely narrow spike of infinite height which is conveniently drawnas a vertical arrow of unit height. They have a number of interesting properties….

1

……………………...1

Page 17: 1 ASTR 278 Advanced Astronomy An introduction to Fourier Transforms and image processing (lectures 9-12) Lecture 9 Prof.Quentin A Parker 1768-1830 Fourier.

17

Dirac Delta functionalso called unit impulse function

Page 18: 1 ASTR 278 Advanced Astronomy An introduction to Fourier Transforms and image processing (lectures 9-12) Lecture 9 Prof.Quentin A Parker 1768-1830 Fourier.

18

Page 19: 1 ASTR 278 Advanced Astronomy An introduction to Fourier Transforms and image processing (lectures 9-12) Lecture 9 Prof.Quentin A Parker 1768-1830 Fourier.

19

Some Fourier transform pairs involving the delta function

Page 20: 1 ASTR 278 Advanced Astronomy An introduction to Fourier Transforms and image processing (lectures 9-12) Lecture 9 Prof.Quentin A Parker 1768-1830 Fourier.

20

Rectangular function & relation to delta functionDelta functions have a number of interesting properties including the sifting property:

Page 21: 1 ASTR 278 Advanced Astronomy An introduction to Fourier Transforms and image processing (lectures 9-12) Lecture 9 Prof.Quentin A Parker 1768-1830 Fourier.

21

As the width `a’ of the rectangle function increases, the transform becomes taller and narrower.

In the limit as a infinity the rectangle function becomes the constant function and its transform becomes the delta function:

Page 22: 1 ASTR 278 Advanced Astronomy An introduction to Fourier Transforms and image processing (lectures 9-12) Lecture 9 Prof.Quentin A Parker 1768-1830 Fourier.

22

Page 23: 1 ASTR 278 Advanced Astronomy An introduction to Fourier Transforms and image processing (lectures 9-12) Lecture 9 Prof.Quentin A Parker 1768-1830 Fourier.

23

The Rectangular Function

Page 24: 1 ASTR 278 Advanced Astronomy An introduction to Fourier Transforms and image processing (lectures 9-12) Lecture 9 Prof.Quentin A Parker 1768-1830 Fourier.

24

Page 25: 1 ASTR 278 Advanced Astronomy An introduction to Fourier Transforms and image processing (lectures 9-12) Lecture 9 Prof.Quentin A Parker 1768-1830 Fourier.

25