Environmental Data Analysis with MatLab 2nd Edition Lecture 12: Power Spectral Density SYLLABUS Lecture 01 Lecture 02 Lecture 03 Lecture 04 Lecture 05 Lecture 06 Lecture 07 Lecture 08 Lecture 09 Lecture 10 Lecture 11 Lecture 12 Lecture 13 Lecture 14 Lecture 15 Lecture 16 Lecture 17 Lecture 18 Lecture 19 Lecture 20 Lecture 21 Lecture 22 Lecture 23 Lecture 24 Using MatLab Looking At Data Probability and Measurement Error Multivariate Distributions Linear Models The Principle of Least Squares Prior Information Solving Generalized Least Squares Problems Fourier Series Complex Fourier Series Lessons Learned from the Fourier Transform Power Spectral Density Filter Theory Applications of Filters Factor Analysis Orthogonal functions Covariance and Autocorrelation Cross-correlation Smoothing, Correlation and Spectra Coherence; Tapering and Spectral Analysis Interpolation Hypothesis testing Hypothesis Testing continued; F-Tests Confidence Limits of Spectra, Bootstraps Goals 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” T 0 Power T 0 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 exponentials equals 2/T coefficients of sines and cosines Fourier 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. or equivalently u2-s 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 velocity, microns/s 0.4 0.2 0 -0.2 -0.4 -0.6 0 200 400 600 800 1000 time, seconds 1200 1400 1600 enlargement velocity, microns/s 0.4 0.2 0 -0.2 -0.4 0 5 10 15 20 25 time, seconds 30 35 40 45 enlargement periods of a few seconds velocity, microns/s 0.4 0.2 0 -0.2 -0.4 0 5 10 15 20 25 time, seconds 30 35 40 45 power spectral density 1 p.s.d, um2/s 2 per Hz 0.8 0.6 0.4 0.2 0 0 0.1 0.2 0.3 0.4 0.5 0.6 frequency, Hz 0.7 0.8 0.9 1 power spectral density 1 p.s.d, um2/s 2 per Hz 0.8 0.6 0.4 0.2 0 0 0.1 0.2 0.3 0.4 0.5 0.6 frequency, Hz frequencies of a few tenths of a Hz periods of a few seconds 0.7 0.8 0.9 1 cumulative power 0.025 power 0.02 0.015 0.01 power in time series 0.005 0 0 0.1 0.2 0.3 0.4 0.5 0.6 frequency, Hz 0.7 0.8 0.9 1 Example 2 Neuse River Stream Flow 4 discharge, cfs x 10 2 1 ycle/day 0 0 500 9 x 10 8 1000 1500 2000 2500 time, days 3000 3500 4000 Example 2 Neuse River Stream Flow 4 discharge, cfs x 10 1 0 ycle/day period of 1 year 2 0 500 9 x 10 8 1000 1500 2000 2500 time, days 3000 3500 4000 discharge, cfs 2 1 PSD, (cfs) per cycle/day power spectra density s2(f), (cfs)22 per cycle/day 0 0 500 1000 1500 2000 2500 time, days 3000 3500 4000 9 x 10 power spectral density, s2(f) 8 6 4 2 0 0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 frequency, cycles per day frequency f, cycles/day 0.04 0.045 0.05 discharge, cfs 2 1 PSD, (cfs) per cycle/day power spectra density s2(f), (cfs)22 per cycle/day 0 0 500 1000 1500 2000 2500 time, days 3000 3500 4000 9 x 10 power spectral density, s2(f) 8 6 4 2 0 0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 frequency, cycles per day frequency f, cycles/day period of 1 year 0.04 0.045 0.05 Example 3 Atmospheric CO2 (after removing anthropogenic trend) CO2, ppm 4 2 0 -2 -4 0 log10 psd of CO2 3 2 1 5 10 15 20 25 30 time, years 35 40 45 50 4 enlargement 3 CO2, ppm 2 1 0 -1 -2 -3 0 0.5 1 1.5 time, years 2 2.5 3 4 enlargement 3 CO2, ppm 2 1 0 -1 -2 -3 0 period of 1 year 0.5 1 1.5 time, years 2 2.5 3 CO2, ppm 4 2 power spectral density 0 -2 -4 0 5 10 15 20 25 30 time, years 35 40 45 log10 psd of CO2 3 2 1 0 0 1 2 3 frequency, cycles per year 4 frequency, cycles per year 5 50 CO2, ppm 4 2 power spectral density 0 -2 -4 0 5 10 log10 psd of CO2 3 15 20 1 year period 2 25 30 time, years 35 40 45 ½ year period 1 0 0 1 2 3 frequency, cycles per year 4 frequency, cycles per year 5 50 4 3 CO2, ppm 2 1 0 -1 -2 -3 0 0.5 1 1.5 time, years 2 2.5 3 shallow side: 1 year and ½ year out of phase 4 3 steep side: 1 year and ½ year in phase CO2, ppm 2 1 0 -1 -2 -3 0 0.5 1 1.5 time, years 2 2.5 3 cumulative power 5 4.5 4 3.5 power 3 power in time series 2.5 2 1.5 1 0.5 0 0 1 2 3 4 frequency, cycles per year 5 6 Example 3: Tides 5 4 Elevation, ft 3 2 1 0 -1 -2 -3 0 20 40 60 time, days 90 days of data 80 100 120 enlargement 4 3 Elevation, ft 2 1 0 -1 -2 0 1 2 3 4 time, days 7 days of data 5 6 7 enlargement period of day½ 4 3 Elevation, ft 2 1 0 -1 -2 0 1 2 3 4 time, days 7 days of data 5 6 7 power spectral density 3 log10 psd 2 1 0 -1 0 1 0.5 1 1.5 frequency, cycles per day 2 2.5 3 cumulative power log10 psd 0.5 0 power in time series -0.5 -1 0 0.5 1 1.5 frequency, cycles per day 2 2.5 3 power spectral density 3 log10 psd 2 0 -1 about 1 day period fortnighly (2 wk) tide 1 0 1 0.5 about ½ day period 1 1.5 frequency, cycles per day 2 2.5 3 cumulative power log10 psd 0.5 0 power in time series -0.5 -1 0 0.5 1 1.5 frequency, cycles per day 2 2.5 3 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 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!