The Fourier Transform

advertisement
Geol 491: Spectral Analysis
tom.wilson@mail.wvu.edu
N 1
H n   hk e 2ikn N
k 0
1 N 1
hk   H n e 2ikn N
N n 0
Introduction to Fourier series and Fourier transforms
Fourier said that any single valued function could be
reproduced as a sum of sines and cosines
8
5*sin (24t)
6
Amplitude = 5
4
Frequency = 4 Hz
2
0
-2
-4
-6
-8
0
0.1
0.2
0.3
0.4
0.5
0.6
seconds
0.7
0.8
0.9
1
We are usually dealing with sampled data
8
5*sin(24t)
6
Amplitude = 5
4
Frequency = 4 Hz
2
Sampling rate = 256
samples/second
0
-2
Sampling duration =
1 second
-4
-6
-8
0
0.1
0.2
0.3
0.4
0.5
0.6
seconds
0.7
0.8
0.9
1
Faithful reproduction of the signal requires
adequate sampling
sin(28t), SR = 8.5 Hz
2
1.5
1
0.5
0
-0.5
-1
-1.5
-2
0
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
2
If our sample rate isn’t high enough, then the
output frequency will be lower than the input,
The Nyquist Frequency
• The Nyquist frequency is equal to one-half of the
sampling frequency.
• The Nyquist frequency is the highest frequency that can
be measured in a signal.
f Ny
1

2 t
Where t is the sample rate
Frequencies higher than the Nyquist frequencies will be
aliased to lower frequency
The Nyquist Frequency
Thus if t = 0.004 seconds, fNy =
f Ny
1

2 t
Where t is the sample rate
Fourier series: a weighted sum of sines and cosines
• Periodic functions and signals may be expanded into a
series of sine and cosine functions
f (t )  a0  a1 cos t  b1 sin t
a2 cos 2t  b2 sin 2t
a3 cos 3t  b3 sin 3t
 ...
+...
This applet is fun to play with
& educational too.
Experiment with http://www.falstad.com/fourier/
Try making sounds by combining several harmonics
(multiples of the fundamental frequency)
An octave represents a doubling of the frequency.
220Hz, 440Hz and 880Hz played together produce a
“pleasant sound”
Frequencies in the ratio of 3:2 represent a fifth and
are also considered pleasant to the ear.
220, 660, 1980etc.
Pythagoras (530BC)
You can also observe how filtering of a broadband waveform will
change audible waveform properties.
http://www.falstad.com/dfilter/
Fourier series
• The Fourier series can be expressed more compactly
using summation notation

f (t )  a0    an cos nt  bn sin nt 
n 1
You’ve seen from the forgoing example that right
angle turns, drops, increases in the value of a function
can be simulated using the curvaceous sinusoids.
Fourier series
• Try the excel file step2.xls

f (t )  a0    an cos nt  bn sin nt 
n 1
The Fourier Transform
• A transform takes one function (or signal) in time and
turns it into another function (or signal) in frequency
• This can be done with continuous functions or discrete
functions

f (t )  a0    an cos nt  bn sin nt 
n 1
The Fourier Transform
• The general problem is to find the coefficients: a0, a1, b1, etc.

f (t )  a0    an cos nt  bn sin nt 
n 1
Take the integral of f(t) from 0 to T (where T is 1/f).
Note =2/T
1 T
f (t )dt

0
T
What do you get? Looks like an average!
We’ll work through this on the board.
Getting the other Fourier coefficients
To get the other coefficients consider what
happens when you multiply the terms in the
series by terms like cos(it) or sin(it).
f (t ) cos it  a0 cos it  a1 cos t cos it  b1 sin t cos it
a2 cos 2t cos it  b2 sin 2t cos it
a3 cos 3t cos it  b3 sin 3t cos it
 ...
+...
ai cos it cos it  bi sin it cos it
 ...
+...
Now integrate f(t) cos(it)

T
0
T
f (t ) cos itdt   (a0 cos it  a1 cos t cos it  b1 sin t cos it
0
a2 cos 2t cos it  b2 sin 2t cos it
a3 cos 3t cos it  b3 sin 3t cos it
 ...
+...
ai cos it cos it  bi sin it cos it
 ...

T
0
+... ) dt
a0 cos itdt  0
This is just the average of i
periods of the cosine
Now integrate f(t) cos(it)

T
0
a1 cos t cos itdt  ?
Use the identity
1
1
cos A cos B  cos( A  B)  cos( A  B)
2
2
If i=2 then the a1 term =
a1
a1 cos t cos t  (cos 2t  cos 0)
2

T
0
a1 cos t cos tdt  
T
0
T a
a1
cos 2tdt   1 cos 0dt
0 2
2
What does this give us?

T
0
a1
a1 cos t cos tdt  0 
2
T
0
And what about the other terms in the series?

T
0
a2 cos 2t cos tdt  
T
0
T a
a2
cos 3tdt   2 costdt
0 2
2
In general to find the coefficients we do the following
1 T
a0   f (t )dt
T 0
2 T
an   f (t ) cos ntdt
T 0
and
2 T
bn   f (t ) sin ntdt
T 0
The a’s and b’s are considered the amplitudes of the
real and imaginary terms (cosine and sine) defining
individual frequency components in a signal
Arbitrary period versus 2
Sometimes you’ll see the Fourier
coefficients written as integrals from - to 
1
a0 
2
an 
1

  f (t )dt


f (t ) cos ntdt




and
bn 
1

f (t ) sin ntdt




Exponential notation
cost is considered Re eit
where
ent  cos t  i sin t
The Fourier Transform
• A transform takes one function (or signal) and turns it
into another function (or signal)
• Continuous Fourier Transform:

H  f    h t e 2ift dt


h t    H  f e 2ift df

The Fourier Transform
• A transform takes one function (or signal) and turns it
into another function (or signal)
• The Discrete Fourier Transform:
N 1
H n   hk e 2ikn N
k 0
1 N 1
hk   H n e 2ikn N
N n 0
Some useful links
•
•
•
•
•
•
http://www.falstad.com/fourier/
– Fourier series java applet
http://www.jhu.edu/~signals/
– Collection of demonstrations about digital signal processing
http://www.ni.com/events/tutorials/campus.htm
– FFT tutorial from National Instruments
http://www.cf.ac.uk/psych/CullingJ/dictionary.html
– Dictionary of DSP terms
http://jchemed.chem.wisc.edu/JCEWWW/Features/McadInChem/mcad008/
FT4FreeIndDecay.pdf
– Mathcad tutorial for exploring Fourier transforms of free-induction decay
http://lcni.uoregon.edu/fft/fft.ppt
– This presentation
Meeting times?
Download