MatLab Lecture 9 Fourier Series Lecture 01 Using MatLab Lecture 02 Looking At Data Lecture 03 Probability and Measurement Error Lecture 04 Multivariate Distributions Lecture 05 ID: 783489
Download The PPT/PDF document "Environmental Data Analysis with" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
Environmental Data Analysis with MatLab
Lecture 9:
Fourier Series
Slide2Lecture 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 Transform Lecture 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
Slide3purpose of the lecture
detect and quantify periodicities in data
Slide4importance of periodicities
Slide5Stream FlowNeuse River
discharge,
cfstime, days365 days1 year
Slide6Air temperature
Black Rock Forest
365 days1 year
Slide7Air temperature
Black Rock Forest
time, days1 day
Slide8temporal periodicitiesand their periods
astronomical
rotationdailyrevolutionyearlyother naturalocean wavesa few secondsanthropogenicelectric power60 Hz
Slide9delay,
t
0amplitude, Cperiod, Td(t)time, tsinusoidal oscillationf(t) = C cos{ 2π (t-t0
) / T }
Slide10amplitude, C
lingo
temporalf(t) = C cos{ 2π t / T }spatialf(x) = C cos{ 2π x / λ }
amplitude,
C
period,
T
wavelength,
λ
frequency,
f=1/T
angular frequency,
ω=2
π
/T
wavenumber
,
k=2
π
/
λ
-
f(t)
= C
cos
(
ω
t)
f(x)
= C
cos
(
kx
)
Slide11spatial periodicitiesand their wavelengths
natural
sand duneshundreds of meterstree ringsa few millimetersanthropogenicfurrows plowedin a fieldfew tens of cm
Slide12pairing sines and cosines
to avoid using time delays
Slide13derived using trig identity
A
B
Slide14A
B
A=C cos(ωt0)B=C sin(ωt0)A2=C cos2 (ωt0)B2=C sin2 (ωt0)
A
2
+B
2
=C
2
[cos
2
(
ω
t
0
)
+sin
2
(
ω
t
0
)]
= C
2
Slide15Fourier Serieslinear model containing nothing but
sines
and cosines
Slide16A’s and
B
’s aremodel parametersω’s are auxiliary variables
Slide17two choices
values of frequencies?
total number of frequencies?
Slide18surprising fact about time series with evenly sampled data
Nyquist
frequency
Slide19values of frequencies? evenly spaced,
ω
n = (n-1)Δ ω minimum frequency of zero maximum frequency of fnytotal number of frequencies? N/2+1 number of model parameters, M = number of data, N
Slide20implies
Slide21Number of Frequencieswhy
N/2+1
and not N/2 ?first and last sine are omitted from the Fourier Series since they are identically zero:
Slide22cos
(
Δω t)cos(0t)sin(Δωt)cos(2Δω t)sin(2Δω t)cos(½NΔω t)
Slide23Nyquist
Sampling Theorem
when m=n+Nanother way of stating itnote evenly sampled times
Slide24ω
n
= (n-1)Δ ω and tk = (k-1) ΔtStep 1: Insert discrete frequencies and times into l.h.s. of equations.
Slide25ω
n
= (n-1+N)Δ ω and tk = (k-1) ΔtStep 2: Insert discrete frequencies and times into r.h.s. of equations.
Slide26same as
l.h.s
.same as l.h.s.Step 3: Note that l.h.s equals r.h.s.
Slide27when
m=
n+Nor when ωm=ωn+2ωnyonly a 2ωny interval of the ω -axis is uniquesay from-ωny to +ωny Step 4: Identify unique region of ω-axis
Slide28cos
(
ω t) has same shape as cos(-ω t) andsin(ω t) has same shape as sin(-ω t) so really only the0 to ωnypart of the ω-axis is unique Step 5: Apply symmetry of sines and cosines
Slide29w
-
wnywny2wny3wny0
equivalent points on the
ω
-axis
Slide30d
2
(t)d1(t)time, ttime, td1 (t) = cos(w1t), with w1=2Dwd2(t) = cos{w2t}, with w2=(2+N)Dw,
Slide31problem of aliasing
high frequencies
masquerading as low frequenciessolution:pre-process data to remove high frequenciesbefore digitizing it
Slide32Discrete Fourier Series
d
= Gm
Slide33Least
S
quares Solution mest = [GTG]-1 GTdhas substantial simplification… since it can be shown that …
Slide34% N = number of data, presumed even% Dt
is time sampling interval
t = Dt*[0:N-1]’;Df = 1 / (N * Dt );Dw = 2 * pi / (N * Dt);Nf = N/2+1;Nw = N/2+1;f = Df*[0:N/2];w = Dw*[0:N/2];frequency and time setupin MatLab
Slide35% set up G G=zeros(N,M); % zero frequency column
G(:,1)=1;
% interior M/2-1 columns for i = [1:M/2-1] j = 2*i; k = j+1; G(:,j)=cos(w(i+1).*t); G(:,k)=sin(w(i+1).*t); end % nyquist column G(:,M)=cos(w(Nw).*t);Building G in MatLab
Slide36gtgi = 2* ones(M,1)/N; gtgi
(1)=1/N;
gtgi(M)=1/N; mest = gtgi .* (G'*d);solving for model parameters in MatLab
Slide37how to plot the model parameters?
A
’s and B ’splotagainst frequency
Slide38power spectral density
big at frequency
ω whenwhen sine or cosine at the frequencyhas a large coefficient
Slide39alternatively, plot
amplitude spectral density
Slide40365.2
days
period, daysfrequency, cycles per dayamplitude spectral density182.6 days60.0 daysamplitude spectral densityStream FlowNeuse River
all interesting frequencies
near origin,
so plot period,
T=1/f
instead