You are on page 1of 43

Environmental Data Analysis with MatLab

Lecture 12:

Power Spectral Density


SYLLABUS
Lecture 01 Using MatLab
Lecture 02 Looking At Data
Lecture 03 Probability and Measurement Error
Lecture 04 Multivariate Distributions
Lecture 05 Linear Models
Lecture 06 The Principle of Least Squares
Lecture 07 Prior Information
Lecture 08 Solving Generalized Least Squares Problems
Lecture 09 Fourier Series
Lecture 10 Complex Fourier Series
Lecture 11 Lessons Learned from the Fourier Transform
Lecture 12 Power Spectral Density
Lecture 13 Filter Theory
Lecture 14 Applications of Filters
Lecture 15 Factor Analysis
Lecture 16 Orthogonal functions
Lecture 17 Covariance and Autocorrelation
Lecture 18 Cross-correlation
Lecture 19 Smoothing, Correlation and Spectra
Lecture 20 Coherence; Tapering and Spectral Analysis
Lecture 21 Interpolation
Lecture 22 Hypothesis testing
Lecture 23 Hypothesis Testing continued; F-Tests
Lecture 24 Confidence Limits of Spectra, Bootstraps
purpose of the lecture

compute and understand

Power Spectral Density

of indefinitely-long time series


ground vibrations at the Palisades NY seismographic station

Nov 27, 2000

time, minutes
Jan 4, 2011

time, minutes

similar appearance of measurements separated by 10+ years apart


stationary time series

indefinitely long

but

statistical properties don’t vary with time


assume that we are dealing with a fragment
of an indefinitely long time series

time, minutes

time series, d

duration, T
length, N
one quantity that might be stationary is …
“Power”

0
Power

mean-squared
amplitude of
time series
How is power related to
power spectral density ?
write Fourier Series as
d = Gm
were m are the Fourier coefficients
now use
now use

coefficients of complex coefficients of


exponentials sines and cosines

Fourier
equals 2/T
Transform
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


units
if 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 the
power 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 same


because of statistical fluctuation
finally

we will normally subtract out the


mean of the time series

so that power spectral density


represents fluctuations about the
mean value
Example 1
Ground vibration at Palisades NY

0.8

0.6

0.4
velocity, microns/s

0.2

-0.2

-0.4

-0.6
0 200 400 600 800 1000 1200 1400 1600
time, seconds
enlargement

0.4
v elocity , m ic rons/s

0.2

-0.2

-0.4
0 5 10 15 20 25 30 35 40 45
time, seconds
enlargement
periods of a few seconds

0.4
v elocity , m ic rons/s

0.2

-0.2

-0.4
0 5 10 15 20 25 30 35 40 45
time, seconds
power spectral density
1

0.8
p.s .d, um2/s2 per Hz

0.6

0.4

0.2

0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
frequency, Hz
power spectral density
1

0.8
p.s .d, um2/s2 per Hz

0.6

0.4

0.2

0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
frequency, Hz

frequencies of a few tenths of a Hz


periods of a few seconds
cumulative power

0.025

0.02
power

0.015

0.01

power
0.005 in time
series
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
frequency, Hz
Example 2
Neuse River Stream Flow

4
x 10
2
discharge, cfs

0
0 500 1000 1500 2000 2500 3000 3500 4000
time, days
9
x 10
ycle/day

8
Example 2
Neuse River Stream Flow

4
x 10
2 period of 1 year
discharge, cfs

0
0 500 1000 1500 2000 2500 3000 3500 4000
time, days
9
x 10
ycle/day

8
2

discharge, cfs
1

0
0 500 1000 1500 2000 2500 3000 3500 4000
time, days
s2(f), (cfs)22 per cycle/day
power spectra density

9
x 10
per cycle/day

8 power spectral density, s2(f)


6
4
PSD, (cfs)

2
0
0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04 0.045 0.05
frequency, cycles per day
frequency f, cycles/day
2

discharge, cfs
1

0
0 500 1000 1500 2000 2500 3000 3500 4000
time, days
s2(f), (cfs)22 per cycle/day
power spectra density

9
x 10
per cycle/day

8 power spectral density, s2(f)


6
4
PSD, (cfs)

2
0
0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04 0.045 0.05
frequency, cycles per day
frequency f, cycles/day
period of 1 year
Example 3
Atmospheric CO2
(after removing anthropogenic trend)

2
CO2, ppm

-2

-4
0 5 10 15 20 25 30 35 40 45 50
time, years

3
log10 psd of CO2

1
4
enlargement
3

1
CO2, ppm

-1

-2

-3
0 0.5 1 1.5 2 2.5 3
time, years
4
enlargement
3

1
CO2, ppm

-1

-2

period of 1 year
-3
0 0.5 1 1.5 2 2.5 3
time, years
4

2
CO2, ppm

-2
power spectral density
-4
0 5 10 15 20 25 30 35 40 45 50
time, years

3
log10 psd of CO2

0
0 1 2 3 4 5
frequency, cycles per year
frequency, cycles per year
4

2
CO2, ppm

-2
power spectral density
-4
0 5 10 15 20 25 30 35 40 45 50
time, years

3
1 year
log10 psd of CO2

2 period ½ year
period
1

0
0 1 2 3 4 5
frequency, cycles per year
frequency, cycles per year
4

1
CO2, ppm

-1

-2

-3
0 0.5 1 1.5 2 2.5 3
time, years
shallow side: 1 year and
½ year out of phase
steep side: 1
4

3
year and ½
year in phase
2

1
CO2, ppm

-1

-2

-3
0 0.5 1 1.5 2 2.5 3
time, years
cumulative power
5

4.5

3.5

power
power

2.5

2
in time
series
1.5

0.5

0
0 1 2 3 4 5 6
frequency, cycles per year
Example 3:
Tides
5

3
E le v a tio n , ft

-1

-2

-3
0 20 40 60 80 100 120
time, days

90 days of data
enlargement
4

2
E lev ation, ft

-1

-2
0 1 2 3 4 5 6 7
time, days

7 days of data
enlargement
period of
4 day½
3

2
E lev ation, ft

-1

-2
0 1 2 3 4 5 6 7
time, days

7 days of data
3
power spectral density
2
log10 psd

-1
0 0.5 1 1.5 2 2.5 3
frequency, cycles per day

cumulative power
1

0.5
log10 psd

0
power
-0.5 in time
series
-1
0 0.5 1 1.5 2 2.5 3
frequency, cycles per day
3
power spectral density about
2
fortnighly about ½ day
log10 psd

1 (2 wk) 1 day period

0
tide period

-1
0 0.5 1 1.5 2 2.5 3
frequency, cycles per day

cumulative power
1

0.5
log10 psd

0
power
-0.5 in time
series
-1
0 0.5 1 1.5 2 2.5 3
frequency, cycles per day
MatLab

dtilde= Dt*fft(d-mean(d)); Fourier Transform

dtilde = dtilde(1:Nf); delete negative frequencies

psd = (2/T)*abs(dtilde).^2; power spectral density


MatLab

power as a function
pwr=df*cumsum(psd); of frequency

Pf=df*sum(psd); total power


should be
the same!
Pt=sum(d.^2)/N; total power

You might also like