1 / 40

Environmental Data Analysis with MatLab

Environmental Data Analysis with MatLab. Lecture 9: Fourier Series. SYLLABUS.

luisa
Download Presentation

Environmental Data Analysis with MatLab

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Environmental Data Analysis with MatLab Lecture 9: • Fourier Series

  2. SYLLABUS Lecture 01 Using MatLabLecture 02 Looking At DataLecture 03Probability and Measurement ErrorLecture 04 Multivariate DistributionsLecture 05Linear 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

  3. purpose of the lecture detect and quantify periodicities in data

  4. importance of periodicities

  5. Stream FlowNeuse River 365 days 1 year discharge, cfs time, days

  6. Air temperature Black Rock Forest 365 days 1 year

  7. Air temperature Black Rock Forest 1 day time, days

  8. temporal periodicitiesand their periods astronomical rotation daily revolution yearly other natural ocean waves a few seconds anthropogenic electric power 60 Hz

  9. sinusoidal oscillation f(t) = C cos{ 2π (t-t0) / T } amplitude, C d(t) period, T time, t delay, t0

  10. lingo temporal f(t) = C cos{ 2π t / T } spatial f(x) = C cos{ 2π x / λ } amplitude, C 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)

  11. spatial periodicitiesand their wavelengths natural sand dunes hundreds of meters • tree rings • a few millimeters anthropogenic furrows plowed in a field few tens of cm

  12. pairing sines and cosinesto avoid using time delays

  13. derived using trig identity A B

  14. A B • A=C cos(ωt0) • B=C sin(ωt0) • A2=C cos2 (ωt0) • B2=C sin2 (ωt0) A2+B2=C2 [cos2 (ωt0)+sin2 (ωt0)] = C2

  15. Fourier Serieslinear model containing nothing butsines and cosines

  16. A’s and B’s aremodel parameters ω’s are auxiliary variables

  17. two choices values of frequencies? total number of frequencies?

  18. surprising fact about time series with evenly sampled data Nyquist frequency

  19. values of frequencies? evenly spaced, ωn = (n-1)Δ ω minimum frequency of zero maximum frequency of fny total number of frequencies? N/2+1 number of model parameters, M = number of data, N

  20. implies

  21. Number of Frequencies why N/2+1and not N/2 ? first and last sine are omitted from the Fourier Series since they are identically zero:

  22. cos(½NΔω t) cos(0t) cos(Δωt) sin(Δωt) cos(2Δω t) sin(2Δω t)

  23. Nyquist Sampling Theorem another way of stating it when m=n+N note evenly sampled times

  24. Step 1: Insert discrete frequencies and times into l.h.s. of equations. • ωn = (n-1)Δ ωandtk = (k-1) Δt

  25. ωn = (n-1+N)Δ ωandtk = (k-1) Δt Step 2: Insert discrete frequencies and times into r.h.s. of equations.

  26. Step 3: Note that l.h.s equals r.h.s. same as l.h.s. same as l.h.s.

  27. Step 4: Identify unique region of ω-axis when m=n+N • or when • ωm=ωn+2ωny • only a 2ωnyinterval of the ω -axis is unique • say from • -ωnyto +ωny

  28. cos(ω t) has same shape as cos(-ω t) • and • sin(ω t) has same shape as sin(-ω t) • so really only the • 0 toωny • part of the ω-axis is unique Step 5: Apply symmetry of sines and cosines

  29. equivalent points on the ω-axis w -wny 0 wny 2wny 3wny

  30. d1 (t) = cos(w1t), with w1=2Dw d1(t) time, t d2(t) = cos{w2t}, with w2=(2+N)Dw, d2(t) time, t

  31. problem of aliasinghigh frequenciesmasquerading as low frequenciessolution:pre-process data to remove high frequenciesbefore digitizing it

  32. Discrete Fourier Series d = Gm

  33. Least Squares Solution • mest=[GTG]-1GTd has substantial simplification … sinceit can be shown that …

  34. frequency and time setup in MatLab % 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];

  35. Building G in MatLab % 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);

  36. solving for model parameters in MatLab gtgi = 2* ones(M,1)/N; gtgi(1)=1/N; gtgi(M)=1/N; mest = gtgi .* (G'*d);

  37. how to plot the model parameters? A’s and B ’s plot against frequency

  38. power spectral density big at frequency ω when when sine or cosine at the frequency has a large coefficient

  39. alternatively, plot amplitude spectral density

  40. Stream FlowNeuse River all interesting frequencies near origin, so plot period, T=1/f instead amplitude spectral density frequency, cycles per day 60.0 days 365.2 days amplitude spectral density 182.6 days period, days

More Related