38
Geol 491: Spectral Analysis 1 0 2 1 0 2 1 N n N ikn n k N k N ikn k n e H N h e h H [email protected]

Geol 491: Spectral Analysis

Embed Size (px)

DESCRIPTION

Geol 491: Spectral Analysis. [email protected]. Purpose of the class. Explore ways of introducing some advanced mathematical concepts to students in such a way as to increase their interest in higher level math. To learn new and useful analytical tools. To have fun!. Grade. - PowerPoint PPT Presentation

Citation preview

Page 1: Geol 491: Spectral Analysis

Geol 491: Spectral Analysis

1

0

2

1

0

2

1 N

n

Niknnk

N

k

Niknkn

eHN

h

ehH

[email protected]

Page 2: Geol 491: Spectral Analysis

Purpose of the class

Explore ways of introducing some advanced mathematical concepts to students in such a way as

to increase their interest in higher level math.

To learn new and useful analytical tools

To have fun!

Page 3: Geol 491: Spectral Analysis

Grade

• Computer lab assignments – 30%• 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?

Page 4: Geol 491: Spectral Analysis

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-8

-6

-4

-2

0

2

4

6

8

5*sin (24t)

Amplitude = 5

Frequency = 4 Hz

seconds

Fourier said that any single valued function could be reproduced as a sum of sines and cosines

Introduction to Fourier series and Fourier transforms

Page 5: Geol 491: Spectral Analysis

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-8

-6

-4

-2

0

2

4

6

8

5*sin(24t)

Amplitude = 5

Frequency = 4 Hz

Sampling rate = 256 samples/second

seconds

Sampling duration =1 second

We are usually dealing with sampled data

Page 6: Geol 491: Spectral Analysis

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2-2

-1.5

-1

-0.5

0

0.5

1

1.5

2sin(28t), SR = 8.5 Hz

Faithful reproduction of the signal requires adequate sampling

If our sample rate isn’t high enough, then the output frequency will be lower than the input,

Page 7: Geol 491: Spectral Analysis

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.

1

2Nyft

Where t is the sample rate

Frequencies higher than the Nyquist frequencies will be aliased to lower frequency

Page 8: Geol 491: Spectral Analysis

The Nyquist Frequency

1

2Nyft

Where t is the sample rate

Thus if t = 0.004 seconds, fNy =

Page 9: Geol 491: Spectral Analysis

Fourier series: a weighted sum of sines and cosines

• Periodic functions and signals may be expanded into a series 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

Page 10: Geol 491: Spectral Analysis

This applet is fun to play with & educational too.

Experiment with http://www.falstad.com/fourier/

Page 11: Geol 491: Spectral Analysis

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)

Page 12: Geol 491: Spectral Analysis

You can also observe how filtering of a broadband waveform will change audible waveform properties.

http://www.falstad.com/dfilter/

Page 13: Geol 491: Spectral Analysis

Fourier series

• The Fourier series can be expressed more compactly using summation notation

01

( ) cos sinn nn

f t a a n t b n t

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.

Page 14: Geol 491: Spectral Analysis

Fourier series

• Try the excel file step2.xls

01

( ) cos sinn nn

f t a a n t b n t

Page 15: Geol 491: Spectral Analysis

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

01

( ) cos sinn nn

f t a a n t b n t

Page 16: Geol 491: Spectral Analysis

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

0

1( )

Tf t dt

T What do you get? Looks like an average!

We’ll work through this on the board.

Page 17: Geol 491: Spectral Analysis

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).

0 1 1

2 2

3 3

( ) cos cos cos cos sin cos

cos 2 cos sin 2 cos

cos3 cos sin 3 cos

... +...

cosi

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

a

cos sin cos

... +...ii t i t b i t i t

Page 18: Geol 491: Spectral Analysis

Now integrate f(t) cos(it)

0 1 10 0

2 2

3 3

( ) cos ( cos cos cos sin cos

cos 2 cos sin 2 cos

cos3 cos sin 3 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

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

Page 19: Geol 491: Spectral Analysis

Now integrate f(t) cos(it)

10cos cos ?

Ta t i tdt

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)

2

aa t t t

1 110 0 0cos cos cos 2 cos0

2 2

T T Ta aa t tdt tdt dt

Page 20: Geol 491: Spectral Analysis

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

Page 21: Geol 491: Spectral Analysis

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

0

2( )sin

T

nb f t n tdtT

and

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

Page 22: Geol 491: Spectral Analysis

Arbitrary period versus 2

Sometimes you’ll see the Fourier coefficients written as integrals from - to

0

1( )

2a f t dt

1

( )cosna f t n tdt

1( )sinnb f t n tdt

and

Page 23: Geol 491: Spectral Analysis

Exponential notation

cost is considered Re eit

cos sinn te t i t

where

Page 24: Geol 491: Spectral Analysis

The Fourier Transform

• A transform takes one function (or signal) and turns it into another function (or signal)• Continuous Fourier Transform:

dfefHth

dtethfH

ift

ift

2

2

Page 25: Geol 491: Spectral Analysis

• A transform takes one function (or signal) and turns it into another function (or signal)• The Discrete Fourier Transform: The Fourier Transform

1

0

2

1

0

2

1 N

n

Niknnk

N

k

Niknkn

eHN

h

ehH

Page 26: Geol 491: Spectral Analysis

We’ll do some work with mp3 files. See http://soundmachine.gooddogie.com/sounds4.htm

Page 27: Geol 491: Spectral Analysis

Tiger.mp3

Amplitude versus time on the sound track

tiger.mp3

Page 28: Geol 491: Spectral Analysis

Classic view

Spectral plots

Low to high frequency content in the sound file as a function of time

Page 29: Geol 491: Spectral Analysis

Spectral filtering

Page 30: Geol 491: Spectral Analysis

Doppler shift

Page 31: Geol 491: Spectral Analysis

Cut out specific parts of a sound file

Page 32: Geol 491: Spectral Analysis

Various spectral views under windows>classic, vertical, horizontal

Page 33: Geol 491: Spectral Analysis

Change spectral display format in individual windows

Page 34: Geol 491: Spectral Analysis

Try filtering everything out above 375 Hz

Design spectral filters to see how sounds change when certain frequencies are removed. Try this with a

recording of your own voice

Get a view of the spectrum

Page 35: Geol 491: Spectral Analysis

Lowpass filter

Page 36: Geol 491: Spectral Analysis

Highpass filter

Page 37: Geol 491: Spectral Analysis

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

Page 38: Geol 491: Spectral Analysis

Meeting times?

Other questions?

laugh2.mp3