1/12/2011 1 Geol 491: Spectral Analysis [email protected]1 2 1 0 2 1 N N ikn k N k N ikn k n e H h e h H 0 n n k e H N h Purpose of the class Explore ways of introducing some advanced mathematical concepts to students in such a way as mathematical concepts to students in such a way as to increase their interest in higher level math. To learn new and useful analytical tools T h f ! T o have fun!
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.
Explore ways of introducing some advanced mathematical concepts to students in such a way asmathematical concepts to students in such a way as
to increase their interest in higher level math.
To learn new and useful analytical tools
T h f !To have fun!
1/12/2011
2
Grade
• Computer lab assignments – 30%
• Lesson plan development (2 teams): initial and final• Lesson plan development (2 teams): initial and final drafts, 10% each for 20% of the semester grade
• Class presentation 30%
• Final report: revision of lesson plan with discussion of what additional activities you think would be useful to undertake. 20%
• Final report should include a brief half page to page discussion of what you got out of the class. Was it useful? Why or why not?
8
Fourier said that any single valued function could be reproduced as a sum of sines and cosines
Introduction to Fourier series and Fourier transforms
-2
0
2
4
6
5*sin (24t)
Amplitude = 5
Frequency = 4 Hz
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-8
-6
-4
seconds
1/12/2011
3
8
5*sin(2 4t)
We are usually dealing with sampled data
-2
0
2
4
6
5*sin(24t)
Amplitude = 5
Frequency = 4 Hz
Sampling rate = 256 samples/second
Sampling duration =
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-8
-6
-4
seconds
g1 second
1
1.5
2sin(28t), SR = 8.5 Hz
Faithful reproduction of the signal requires adequate sampling
-1.5
-1
-0.5
0
0.5
1
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2-2
If our sample rate isn’t high enough, then the output frequency will be lower than the input,
1/12/2011
4
The Nyquist Frequency
• The Nyquist frequency is equal to one-half of the sampling frequency.sampling frequency.
• The Nyquist frequency is the highest frequency that can be measured in a signal.
1
2Nyft
Wh i h lWhere 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 =
1
2Nyft
Where t is the sample rate
1/12/2011
5
Fourier series: a weighted sum of sines and cosines
• Periodic functions and signals may be expanded into a series of sine and cosine functionsseries of sine and cosine functions
0 1 1
2 2
3 3
( ) cos sin
cos 2 sin 2
cos3 sin 3
... +...
f t a a t b t
a t b t
a t b t
This applet is fun to play with & educational too.
Experiment with http://www.falstad.com/fourier/
1/12/2011
6
Try making sounds by combining several harmonics (multiples of the fundamental frequency)
An octave represents a doubling of the frequency.220H 440H d 880H l d t th d220Hz, 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/
1/12/2011
7
Fourier series
• The Fourier series can be expressed more compactly using summation notationusing summation notation
01
( ) cos sinn nn
f t a a n t b n t
You’ve seen from the forgoing example that right g g p gangle turns, drops, increases in the value of a function
can be simulated using the curvaceous sinusoids.
Fourier series
• Try the excel file step2.xls
01
( ) cos sinn nn
f t a a n t b n t
1/12/2011
8
The Fourier Transform
• A transform takes one function (or signal) in time and turns it into another function (or signal) in frequencyturns it into another function (or signal) in frequency
• This can be done with continuous functions or discrete functions
01
( ) cos sinn nn
f t a a n t b n t
The Fourier Transform
• The general problem is to find the coefficients: a0, a1, b1, etc.
01
( ) cos sinn nn
f t a a n t b n t
Take the integral of f(t) from 0 to T (where T is 1/f).Note =2/T
1( )
Tf t dt0 ( )f t dt
T What do you get? Looks like an average!
We’ll work through this on the board.
1/12/2011
9
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(it) or sin(it)series by terms like cos(it) or sin(it).
0 1 1
2 2
3 3
( ) cos cos cos cos sin cos
cos 2 cos sin 2 cos
cos3 cos sin 3 cos
... +...
f t i t a i t a t i t b t i t
a t i t b t i t
a t i t b t i t
cosia cos sin cos
... +...ii t i t b i t i t
Now integrate f(t) cos(it)
0 1 10 0( ) cos ( cos cos cos sin cos
cos 2 cos sin 2 cos
T Tf t i tdt a i t a t i t b t i t
a t i t b t i t
2 2
3 3
cos 2 cos sin 2 cos
cos3 cos sin 3 cos
... +...
a t i t b t i t
a t i t b t i t
cos cos sin cos
... +... ) i ia i t i t b i t i t
dt
00cos 0
Ta i tdt This is just the average of i
periods of the cosine
1/12/2011
10
Now integrate f(t) cos(it)
10cos cos ?
Ta t i tdt U h id i
1 1cos cos cos( ) cos( )
2 2A B A B A B
Use the identity
If i=2 then the a1 term =
11 cos cos (cos 2 cos0)
aa t t t 1 cos cos (cos 2 cos0)
2a t t t
1 110 0 0cos cos cos 2 cos 0
2 2
T T Ta aa t tdt tdt dt
What does this give us?
110
0
cos cos 02
TT a
a t tdt
And what about the other terms in the series?
2 220 0 0
cos 2 cos cos3 cos2 2
T T Ta aa t tdt tdt tdt
1/12/2011
11
In general to find the coefficients we do the following
0 0
1( )
Ta f t dt
T
0
2( )cos
T
na f t n tdtT
2( )sin
T
nb f t n tdt
and
0( )n f
T 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
10
1( )
2a f t dt
1
( )cosna f t n tdt
and
1( )sinnb f t n tdt
1/12/2011
12
Exponential notation
cost is considered Re eit
cos sinn te t i t
where
The Fourier Transform
• A transform takes one function (or signal) and turns it into another function (or signal)into another function (or signal)
• Continuous Fourier Transform:
dfefHth
dtethfH
ift
ift
2
2
dfefHth
1/12/2011
13
• A transform takes one function (or signal) and turns it into another function (or signal)
The Fourier Transform
into another function (or signal)
• The Discrete Fourier Transform:
12
1
0
2
1 NNikn
N
k
Niknkn
eHh
ehH
0n
nk eHN
h
We’ll do some work with mp3 files. See http://soundmachine.gooddogie.com/sounds4.htm
1/12/2011
14
Tiger.mp3
Amplitude versus time on the sound track
tiger.mp3
Classic view
Spectral plots
Low to high frequency content in the sound file as a function of time
1/12/2011
15
Spectral filtering
Doppler shift
1/12/2011
16
Cut out specific parts of a sound file
Various spectral views under windows>classic, vertical, horizontal
1/12/2011
17
Change spectral display format in individual windows
Design spectral filters to see how sounds change when certain frequencies are removed. Try this with a
recording of your own voice
Try filtering everything out above 375 Hz
Get a view of the spectrum
1/12/2011
18
Lowpass filter
Highpass filter
1/12/2011
19
Some useful links
• http://www.falstad.com/fourier/– Fourier series java applet
htt // jh d / i l /• 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