+ All Categories
Home > Documents > Environmental Data Analysis with MatLab

Environmental Data Analysis with MatLab

Date post: 23-Feb-2016
Category:
Upload: betty
View: 75 times
Download: 1 times
Share this document with a friend
Description:
Environmental Data Analysis with MatLab. Lecture 11: Lessons Learned from the Fourier Transform. SYLLABUS. - PowerPoint PPT Presentation
Popular Tags:
60
Environmental Data Analysis with MatLab Lecture 11: Lessons Learned from the Fourier Transform
Transcript
Page 1: Environmental Data Analysis with  MatLab

Environmental Data Analysis with MatLab

Lecture 11:

Lessons Learned from the Fourier Transform

Page 2: Environmental Data Analysis with  MatLab

Lecture 01 Using MatLabLecture 02 Looking At DataLecture 03 Probability and Measurement Error Lecture 04 Multivariate DistributionsLecture 05 Linear ModelsLecture 06 The Principle of Least SquaresLecture 07 Prior InformationLecture 08 Solving Generalized Least Squares ProblemsLecture 09 Fourier SeriesLecture 10 Complex Fourier SeriesLecture 11 Lessons Learned from the Fourier TransformLecture 12 Power SpectraLecture 13 Filter Theory Lecture 14 Applications of Filters Lecture 15 Factor Analysis Lecture 16 Orthogonal functions Lecture 17 Covariance and AutocorrelationLecture 18 Cross-correlationLecture 19 Smoothing, Correlation and SpectraLecture 20 Coherence; Tapering and Spectral Analysis Lecture 21 InterpolationLecture 22 Hypothesis testing Lecture 23 Hypothesis Testing continued; F-TestsLecture 24 Confidence Limits of Spectra, Bootstraps

SYLLABUS

Page 3: Environmental Data Analysis with  MatLab

purpose of the lecture

understand some of the properties of the

Discrete Fourier Transform

Page 4: Environmental Data Analysis with  MatLab

from last week …

time series = sum of sines and cosines

rememberexp(iωt) = cos(ωt) + i sin(ωt)

k

Page 5: Environmental Data Analysis with  MatLab

time series

from last week …

Discrete Fourier Transform of a time series

coefficients

power spectral density = 2

Page 6: Environmental Data Analysis with  MatLab

di

ti Δt

time series

Page 7: Environmental Data Analysis with  MatLab

di

ti Δta time series is a discrete representation of a

continuous function

continuous function

Page 8: Environmental Data Analysis with  MatLab

d(t)

t

continuous function

What happens when to the Discrete Fourier Transform when we switch from discrete to continuous?

Page 9: Environmental Data Analysis with  MatLab

Discrete Fourier Transform

Fourier Transform

turns into

Page 10: Environmental Data Analysis with  MatLab

note the use of the tilde to distinguish a the Fourier Transform from the function itself.

The two functions are different!

Fourier Transform

Page 11: Environmental Data Analysis with  MatLab

function of timefunction of frequency

Fourier Transform

power spectral density = 2

Page 12: Environmental Data Analysis with  MatLab

function of time function of frequency

the inverse of the Fourier Transform is

Page 13: Environmental Data Analysis with  MatLab

t

recall that an integral can be approximated by a summation

integral = area under curve =S area of rectangle = S width × height = Δt Si f(ti)

f(t)f(ti)

Δtti

Page 14: Environmental Data Analysis with  MatLab

then if we use N rectangleseach of width Δt

andeach of height d(tk) exp(-iωtk)

then the Fourier Transform becomes

provided that d(t) is “transient”zero outside of the interval (0,tmax)

Page 15: Environmental Data Analysis with  MatLab

so except for a scaling factor ofΔtthe Discrete Fourier Transform is the discrete

version of the Fourier Transform of a transient function, d(t)

scaling factor

Page 16: Environmental Data Analysis with  MatLab

similarlythe Fourier Series is an approximation of

the Inverse Fourier Transform

Inverse Fourier Transform Fourier Series

(up to an overall scaling of Δω)

Page 17: Environmental Data Analysis with  MatLab

Fourier Transform

in some waysintegrals are easier to work with than

summations

Page 18: Environmental Data Analysis with  MatLab

Property 1

the Fourier Transform of a Normal curve with variance σt2

is a Normal curve with variance σω2 =σt-2

Page 19: Environmental Data Analysis with  MatLab

let a2= ½σt-2

[cos(ωt ) + i sin(ωt )] dtcos(ωt ) dt + i sin(ωt ) dt

symmetric about zero antisymmetric about zeroso integral zero

Normal curve with variance a½ -2 = σt2

Page 20: Environmental Data Analysis with  MatLab

look up in table of integrals

Normal curve with variance 2a2 = σt-2

Page 21: Environmental Data Analysis with  MatLab

time series with broad featuresFourier Transform with mostly low frequencies

power spectral density with mostly low frequencies

time series with narrow featuresFourier Transform with both low and high frequenciespower spectral density with broad range of frequencies

Page 22: Environmental Data Analysis with  MatLab

increasing variance

time,

t

freq

uenc

y, f

A)

increasing variance

B)

tmax fmax

0 0

Page 23: Environmental Data Analysis with  MatLab

Property 2

the Fourier Transform of a spike

is constant

Page 24: Environmental Data Analysis with  MatLab

spike“Dirac Delta Function”

Normal curve with infinitesimal variance

infinitely highbut always has unit area

Page 25: Environmental Data Analysis with  MatLab

δ(t-t0)

t

depiction of spike

t0

Page 26: Environmental Data Analysis with  MatLab

important property of spike

Page 27: Environmental Data Analysis with  MatLab

t

since the spike is zero everywhere except t0

t0

tt0

f(t0)

f(t0)

this product …

… is equivalent to this one

Page 28: Environmental Data Analysis with  MatLab

so

Page 29: Environmental Data Analysis with  MatLab

use the previous result when computing the Fourier Transform of a spike

Page 30: Environmental Data Analysis with  MatLab

A spiky time series

has a “flat” Fourier Transform

and a “flat” power spectral density

Page 31: Environmental Data Analysis with  MatLab

0 50 100 150 200 250-1

-0.5

0

0.5

1

time, t

d(t)

-0.5 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.50

0.5

1

1.5

2

frequency, f

d(f)

A) spike function

B) its transform

frequency, f

time, t

d(t)

d(f)^

Page 32: Environmental Data Analysis with  MatLab

Property 3

the Fourier Transform of cos(ω0t )is a pair of spikes at frequencies ±ω0

Page 33: Environmental Data Analysis with  MatLab

cos(ω0t )has Fourier Trnsform

Page 34: Environmental Data Analysis with  MatLab

as is shown by inserting into the Inverse Fourier Transform

Page 35: Environmental Data Analysis with  MatLab

An oscillatory time series

has spiky Fourier Transformand a power spectral density with spectral peaks

Page 36: Environmental Data Analysis with  MatLab

Property 4

the area under a time series

is the zero-frequency value of the Fourier Transform

Page 37: Environmental Data Analysis with  MatLab
Page 38: Environmental Data Analysis with  MatLab

A time series with zero mean

has a Fourier Transformthat is zero at zero frequency

Page 39: Environmental Data Analysis with  MatLab

MatLab

dt=fft(d); area = real(dt(1));

Page 40: Environmental Data Analysis with  MatLab

Property 5

multiplying the Fourier Transform byexp( -i ω t0)delays the time series by t0

Page 41: Environmental Data Analysis with  MatLab

use transformation of variablest’ = t - t0and notedt’ = dtandt±∞ corresponds to t’±∞

Page 42: Environmental Data Analysis with  MatLab

0 50 100 150 200 250-1

-0.5

0

0.5

1

time, t

d(t)

0 50 100 150 200 250-1

-0.5

0

0.5

1

time, t

d shifte

d(t)d(t)

time, t

time, t

d(t)

dshift

ed(t)

Page 43: Environmental Data Analysis with  MatLab

MatLab

t0 = t(16); ds=ifft(exp(-i*w*t0).*fft(d));

Page 44: Environmental Data Analysis with  MatLab

Property 6

multiplying the Fourier Transform byi ωdifferentiates the time series

Page 45: Environmental Data Analysis with  MatLab
Page 46: Environmental Data Analysis with  MatLab

use integration by partsand assume that the times series is zeroas t±∞

dvu uv duv

Page 47: Environmental Data Analysis with  MatLab

0 50 100 150 200 250-1

0

1

time, t

d(t)

0 50 100 150 200 250-0.02

0

0.02

time, t

dd/d

t(t)

0 50 100 150 200 250-0.02

0

0.02

time, t

dd/d

t(t)

time, t

A)

B)

C)

d(t)

dd/dt

dd/dt

Page 48: Environmental Data Analysis with  MatLab

MatLab

dddt=ifft(i*w.*fft(d));

Page 49: Environmental Data Analysis with  MatLab

Property 7

dividing the Fourier Transform byi ωintegrates the time series

Page 50: Environmental Data Analysis with  MatLab

this is another derivation byintegration by parts

but we’re skipping it here

Page 51: Environmental Data Analysis with  MatLab

Fourier Transform of integral of d(t)

note that the zero-frequency value is undefined(divide by zero)

this is the “integration constant”

Page 52: Environmental Data Analysis with  MatLab

0 50 100 150 200 250-1

0

1

time, t

d(t)

0 50 100 150 200 250-100

0

100

time, t

inte

gral

0 50 100 150 200 250-100

0

100

time, t

inte

gral

time, t

A)

B)

C)

d(t)

d

(t) d

t

d(t)

dt

Page 53: Environmental Data Analysis with  MatLab

MatLab

int2=ifft(i*fft(d).*[0,1./w(2:N)']');

set to zero to avoid dividing by zero (equivalent to an

integration constant of zero)

Page 54: Environmental Data Analysis with  MatLab

Property 8

Fourier Transform of theconvolution of two time series

is the product of their transforms

Page 55: Environmental Data Analysis with  MatLab

What’s a convolution ?

Page 56: Environmental Data Analysis with  MatLab

the convolution of f(t) and g(t)is the integral

which is often abbreviated f(t) *g(t)not multiplication

not complex conjugation(too many uses of the asterisk!)

Page 57: Environmental Data Analysis with  MatLab

uses of convolutions will be presented in the lecture after next

right now, just treat it as a mathematical quantity

Page 58: Environmental Data Analysis with  MatLab
Page 59: Environmental Data Analysis with  MatLab

transformation of variablest’ = t-τ so dt’ = dt and t’±∞ when t±

reverse order of integration

change variables: t’ = t-τ

use exp(a+b)=exp(a)exp(b)

rearrange into the product of two separate Fourier Transforms

Page 60: Environmental Data Analysis with  MatLab

Summary1. FT of a Normal is a Normal curve2. FT of a spike is constant.3. FT of a cosine is a pair of spikes4. Multiplying FT by exp( -i ω t0 ) delays time

series5. Multiplying the FT by i ω differentiates the time

series6. Dividing the FT by i ω integrates the time series7. FT of convolution is product of FT’s


Recommended