environmental data analysis with matlab lecture 12: power spectral density
TRANSCRIPT
Environmental Data Analysis with MatLab
Lecture 12:
Power Spectral Density
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 Spectral DensityLecture 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
purpose of the lecture
compute and understand
Power Spectral Density
of indefinitely-long time series
Nov 27, 2000
Jan 4, 2011
ground vibrations at the Palisades NY seismographic station
similar appearance of measurements separated by 10+ years apart
time, minutes
time, minutes
stationary time series
indefinitely long
but
statistical properties don’t vary with time
time, minutes
assume that we are dealing with a fragment of an indefinitely long time series
time series, dduration, Tlength, N
one quantity that might be stationary is …
“Power”
0T
0T
Power
mean-squared amplitude of time series
How is power related topower spectral density ?
write Fourier Series asd = Gmwere m are the Fourier coefficients
now use
now use
coefficients of sines and cosines
coefficients of complex exponentials
Fourier Transform
equals 2/T
so, if we define the power spectral density of a stationary time series as
the integral of the p.s.d. is the power in the time series
unitsif time series d has units of u
coefficients C also have units of u
Fourier Transform has units of u×time
power spectral density has units of u2×time2/time
e.g. u2-s or equivalently u2/Hz
we will assume that thepower spectral density
is a stationary quantity
when we measure the power spectral density of a finite-length time series,
we are making an estimate of the power spectral density of the indefinitely long time series
the two are not the samebecause of statistical fluctuation
finally
we will normally subtract out the mean of the time series
so that power spectral densityrepresents fluctuations about the
mean value
Example 1Ground vibration at Palisades NY
0 200 400 600 800 1000 1200 1400 1600
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
velo
city,
mic
rons/s
time, seconds
enlargement
0 5 10 15 20 25 30 35 40 45-0.4
-0.2
0
0.2
0.4
velo
city,
mic
rons/s
time, seconds
enlargement
0 5 10 15 20 25 30 35 40 45-0.4
-0.2
0
0.2
0.4
velo
city,
mic
rons/s
time, seconds
periods of a few seconds
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10
0.2
0.4
0.6
0.8
1
p.s
.d,
um2 /s
2 per
Hz
frequency, Hz
power spectral density
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10
0.2
0.4
0.6
0.8
1
p.s
.d,
um2 /s
2 per
Hz
frequency, Hz
power spectral density
frequencies of a few tenths of a Hzperiods of a few seconds
cumulative power
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10
0.005
0.01
0.015
0.02
0.025
pow
er
frequency, Hz
power in time series
0 500 1000 1500 2000 2500 3000 3500 40000
1
2
x 104
time, days
disc
harg
e, c
fs
0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04 0.045 0.050
2
4
6
8
x 109
frequency, cycles per dayPS
D,
(cfs
)2 p
er c
ycle
/day
Example 2Neuse River Stream Flow
0 500 1000 1500 2000 2500 3000 3500 40000
1
2
x 104
time, days
disc
harg
e, c
fs
0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04 0.045 0.050
2
4
6
8
x 109
frequency, cycles per dayPS
D,
(cfs
)2 p
er c
ycle
/day
Example 2Neuse River Stream Flow
period of 1 year
0 500 1000 1500 2000 2500 3000 3500 40000
1
2
x 104
time, days
disc
harg
e, c
fs
0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04 0.045 0.050
2
4
6
8
x 109
frequency, cycles per dayPS
D,
(cfs
)2 p
er c
ycle
/day
power spectral density, s2(f)
frequency f, cycles/day
pow
er s
pect
ra d
ensi
tys2 (
f), (
cfs)
2 per
cyc
le/d
ay
0 500 1000 1500 2000 2500 3000 3500 40000
1
2
x 104
time, days
disc
harg
e, c
fs
0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04 0.045 0.050
2
4
6
8
x 109
frequency, cycles per dayPS
D,
(cfs
)2 p
er c
ycle
/day
power spectral density, s2(f)
frequency f, cycles/day
pow
er s
pect
ra d
ensi
tys2 (
f), (
cfs)
2 per
cyc
le/d
ay
period of 1 year
Example 3Atmospheric CO2
(after removing anthropogenic trend)
0 5 10 15 20 25 30 35 40 45 50
-4
-2
0
2
4
time, years
CO
2, p
pm
0 1 2 3 4 50
1
2
3
frequency, cycles per year
log1
0 ps
d of
CO
2
0 0.5 1 1.5 2 2.5 3-3
-2
-1
0
1
2
3
4
time, years
CO
2, p
pmenlargement
0 0.5 1 1.5 2 2.5 3-3
-2
-1
0
1
2
3
4
time, years
CO
2, p
pmenlargement
period of 1 year
0 5 10 15 20 25 30 35 40 45 50
-4
-2
0
2
4
time, years
CO
2, p
pm
0 1 2 3 4 50
1
2
3
frequency, cycles per year
log1
0 ps
d of
CO
2
power spectral density
frequency, cycles per year
0 5 10 15 20 25 30 35 40 45 50
-4
-2
0
2
4
time, years
CO
2, p
pm
0 1 2 3 4 50
1
2
3
frequency, cycles per year
log1
0 ps
d of
CO
2
power spectral density
frequency, cycles per year
1 year period ½ year
period
0 0.5 1 1.5 2 2.5 3-3
-2
-1
0
1
2
3
4
time, years
CO
2, p
pm
0 0.5 1 1.5 2 2.5 3-3
-2
-1
0
1
2
3
4
time, years
CO
2, p
pm
shallow side: 1 year and year½ out of phase steep side: 1 year and ½year in phase
0 1 2 3 4 5 60
0.5
1
1.5
2
2.5
3
3.5
4
4.5
5
frequency, cycles per year
pow
er
cumulative power
power in time series
Example 3:Tides
0 20 40 60 80 100 120-3
-2
-1
0
1
2
3
4
5
Ele
vation,
ft
time, days
90 days of data
enlargement
0 1 2 3 4 5 6 7-2
-1
0
1
2
3
4
Ele
vation,
ft
time, days
7 days of data
enlargement
0 1 2 3 4 5 6 7-2
-1
0
1
2
3
4
Ele
vation,
ft
time, days
7 days of data
period of day½
0 0.5 1 1.5 2 2.5 3-1
0
1
2
3
frequency, cycles per day
log1
0 ps
d
0 0.5 1 1.5 2 2.5 3-1
-0.5
0
0.5
1
frequency, cycles per day
log1
0 ps
d
power spectral density
cumulative power
power in time series
0 0.5 1 1.5 2 2.5 3-1
0
1
2
3
frequency, cycles per day
log1
0 ps
d
0 0.5 1 1.5 2 2.5 3-1
-0.5
0
0.5
1
frequency, cycles per day
log1
0 ps
d
power spectral density
cumulative power
power in time series
about ½ day period
about1 day period
fortnighly(2 wk) tide
MatLab
dtilde= Dt*fft(d-mean(d));
dtilde = dtilde(1:Nf);
psd = (2/T)*abs(dtilde).^2;
Fourier Transform
delete negative frequencies
power spectral density
MatLab
pwr=df*cumsum(psd);
Pf=df*sum(psd);
Pt=sum(d.^2)/N;
power as a function of frequency
total power
total power
should be the same!