university of michigan aoss 323 – earth system analysis...

58
The University of Michigan, All rights reserved University of Michigan AOSS 323 – Earth System Analysis Laboratory Manual Christopher S. Ruf April 12, 2005

Upload: others

Post on 21-Jul-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

The University of Michigan, All rights reserved

University of Michigan AOSS 323 – Earth System Analysis

Laboratory Manual

Christopher S. Ruf

April 12, 2005

Page 2: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

The University of Michigan, All rights reserved ii

Page 3: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

The University of Michigan, All rights reserved iii

Preface This manual was written during the Winter 2005 term at the University of Michigan in Ann Arbor to support a new 1 credit laboratory course in Earth System Analysis taught by the Department of Atmospheric, Oceanic and Space Sciences. The labs are intended to supplement a 3 credit introductory course in discrete mathematics, spectral analysis, and linear systems theory taught at the sophomore or junior undergraduate level. Current topics in the atmospheric and oceanographic sciences are addressed in each of the labs as a means of demonstrating the relevance of the mathematical tools to problems in Earth Systems. The labs are also intended to expose the student to the MATLAB programming environment at a level beyond that covered in a typical freshman introductory course. Each lab requires the student to write or to substantially modify a considerable amount of MATLAB source code. In addition to coding that is directly related to the topics covered in the companion lecture course, a number of other MATLAB procedures are also introduced for: 1) reading archival environmental data records; 2) automated searching and filtering of data records; 3) statistical analysis of raw data and of processed data products; and 4) creating line plots, scatter plots, contour plots, and 2 dimensional images. These additional programming tools are often useful in Earth System Analysis of observational measurements and model outputs. A principle objective of the course, which influenced the choice of topics covered, is that upon its completion a student should be able to download environmental data records from the web, import them into MATLAB, perform various spectral analysis and linear filter operations on them, and display the results both graphically and with summary statistics. The accompanying 3 credit lecture course was EECS 206, Signals and Systems I, taught by the Electrical Engineering and Computer Science Dept. The EECS course also has its own 1 credit laboratory component. The problems addressed there are more “engineering” in nature – e.g. touch tone telephone coding and decoding – but many of the same mathematical and MATLAB programming topics are covered. For this reason, the EECS lab manual served as an excellent reference source during development of this AOSS manual. The format and organization of the manual is also borrowed directly from the EECS version. There are numerous occasions on which sections of the EECS manual presented precisely the material needed for an AOSS lab. In these instances, I have simply referenced those sections for the students to read. Most chapters of this manual tended to get written a day or two before the material was taught. This inevitably led to many uncorrected and undetected errors making their way into the classroom on lab day. I am very grateful to the students who so diligently uncovered the errors, recognized them as such, and graciously accepted my corrections after the fact. This manual is significantly improved because of them. Chris Ruf Ann Arbor, MI April 2005

Page 4: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

The University of Michigan, All rights reserved iv

Contents Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iv Lab 1. Absolute and Relative Humidity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1 Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2.1 Relative Humidity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2.2 Signal Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.3 Relevant MATLAB Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.4 Demonstrations During the Lab Session . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.5 Laboratory Assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Lab 2. Covariance in the Planetary Boundary Layer 2.1 Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2.2 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2.2.1 Variance, Covariance and Correlation . . . . . . . . . . . . . . . . . . . . . 6 2.2.2 The Planetary Boundary Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.3 Relevant MATLAB Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.4 Demonstrations During the Lab Session . . . . . . . . . . . . . . . . . . . . . . . . . . 10 2.5 Laboratory Assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Lab 3. Time Harmonic Precipitation 3.1 Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3.2 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3.2.1 Time Harmonics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3.2.2 Precipitation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 3.3 Relevant MATLAB Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 3.4 Demonstrations During the Lab Session . . . . . . . . . . . . . . . . . . . . . . . . . . 16 3.5 Laboratory Assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Lab 4. Cloud Drop Sizes and Doppler Spectra 4.1 Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 4.2 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 4.2.1 Radiative Balance and Cloud Drop Size Distributions . . . . . . . . 20 4.2.2 Cloud Doppler Radar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 4.2.3 Discrete Doppler Spectra and Drop Size Distributions . . . . . . . 22 4.2.3 Fourier Analysis and Discrete Specta . . . . . . . . . . . . . . . . . . . . 22 4.3 Relevant MATLAB Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 4.4 Demonstrations During the Lab Session . . . . . . . . . . . . . . . . . . . . . . . . . . 23 4.5 Laboratory Assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Lab 5. Hurricane Imaging 5.1 Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 5.2 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

Page 5: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Contents

The University of Michigan, All rights reserved v

5.2.1 Imaging Hurricane Isabel at Variable Wavelengths . . . . . . . . . 25 5.2.2 Microwave Remote Sensing of Severe Weather . . . . . . . . . . . . 26 5.3 Relevant MATLAB Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 5.4 Demonstrations During the Lab Session . . . . . . . . . . . . . . . . . . . . . . . . . . 29 5.5 Laboratory Assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Lab 6. Sea Level and Tidal Aliasing 6.1 Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 6.2 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 6.2.1 NOAA/NOS CO-OPS Sea Level Height Records . . . . . . . . . . . 31 6.2.2 Global Change and the Rise of Sea Level . . . . . . . . . . . . . . . . . 32 6.2.3 Sampling, Undersampling and Aliasing . . . . . . . . . . . . . . . . . . 32 6.3 Relevant MATLAB Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 6.4 Demonstrations During the Lab Session . . . . . . . . . . . . . . . . . . . . . . . . . . 34 6.5 Laboratory Assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 Lab 7. Wave Propagation in Dispersive Media 7.1 Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 7.2 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 7.2.1 Propagation in Non-Dispersive Media . . . . . . . . . . . . . . . . . . . . 37 7.2.2 Propagation in Dispersive Media . . . . . . . . . . . . . . . . . . . . . . . . 39 7.2.3 The Dispersion Relation for the Deep Ocean . . . . . . . . . . . . . . 39 7.3 Relevant MATLAB Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 7.4 Demonstrations During the Lab Session . . . . . . . . . . . . . . . . . . . . . . . . . . 41 7.5 Laboratory Assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 Lab 8. Detection of El Niño Precursor Waves 8.1 Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 8.2 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 8.2.1 The El Niño Southern Oscillation (ENSO) . . . . . . . . . . . . . . . . 44 8.2.2 Peak Lag Correlation and Motion Detection . . . . . . . . . . . . . . . 45 8.2.3 Monte Carlo Trials and Error Analysis . . . . . . . . . . . . . . . . . . . 45 8.3 Relevant MATLAB Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 8.4 Demonstrations During the Lab Session . . . . . . . . . . . . . . . . . . . . . . . . . . 47 8.5 Laboratory Assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 Lab 9. Stratospheric Ozone Depletion 9.1 Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 9.2 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 9.2.1 Stratospheric Ozone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 9.2.2 Ozone Depletion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 9.2.3 Monitoring Ozone Concentration . . . . . . . . . . . . . . . . . . . . . . . 51 9.3 Relevant MATLAB Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 9.4 Demonstrations During the Lab Session . . . . . . . . . . . . . . . . . . . . . . . . . . 52 9.5 Laboratory Assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

Page 6: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

The University of Michigan, All rights reserved 1

Lab 1: Absolute and Relative Humidity

1.1 Goals: This laboratory will introduce you to the concepts of absolute and relative humidity and the saturation water vapor density of air. It will do so using a number of basic but important features of MATLAB, including opening and reading data files, performing mathematical operations on signals, computing statistical properties of signals, and displaying your results in graphical form. The lab will also be an introduction to the format that will be expected of all lab reports. 1.2 Background: 1.2.1 Relative Humidity The mass density of water vapor suspended in air (sometimes called the absolute humidity) is measured in units of grams per cubic meter, or g-m-3. The maximum water vapor density that can be suspended in air without condensing is dependent on the temperature of the air. Warmer air can “hold” more water vapor. Water vapor density is designated by the greek letter “rho”, or ρ. Air is said to be saturated if it cannot hold any more water vapor without some of it condensing. The density at this point is called the saturation water vapor density, or ρsat. Note that ρsat is a function of air temperature. If air at a particular temperature has a water vapor density below ρsat, then it is unsaturated. The ratio between the actual water vapor density and its saturation water vapor density is referred to as the relative humidity, or

sat

RHρρ

= (1.1)

The Dew Point Temperature (TDP) of air with a water vapor density ρ is that temperature at which air with the same water vapor density would be saturated. It is easy to measure air temperature, T, and relatively easy to measured TDP. The relationship between air temperature, T in degrees C, and its saturation water vapor density, ρsat in g-m-3, can be approximated by the following expression

6

64

42

20 )100()100()100()( ++++++= TcTcTccTsatρ (1.2) where the power series coefficients are c0 = -2.915127 c2 = 1.124901E-03 c4 = -1.58311E-07 c6 = 1.23218E-11 The ratio between the two quantities, ρsat (TDP) and ρsat(T), is the relative humidity.

Page 7: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 1. Absolute and Relative Humidity

The University of Michigan, All rights reserved 2

1.2.2 Signal Statistics Some simple statistics that are often used to characterize temperature are its minimum, average and maximum values during a time interval. MATLAB commands that compute these statistics are

Minimum: min(T) Average mean(T) Maximum: max(T)

where T is a MATLAB data vector of air temperatures. Another useful statistic is a threshold test of whether the relative humidity exceeds a prescribed “comfort level”. This test can be implemented in MATLAB as >> comfort = (RH < comfort_level); where RH is a vector of relative humidities, comfort_level is the threshold, and comfort is a vector with elements equal to either one or zero, depending on whether RH is below or above the threshold. 1.3 Relevant MATLAB Commands: See Section 1.3 of the EECS 206 Lab Manual. Other useful commands are described here. Reading data from a data file into MATLAB variables: A data file is opened and its contents read into a MATLAB array using the load command. There are important details about the allowed format of the data file and the way that the file is mapped into the MATLAB variable which we will address in later labs. For this lab, data files have been prepared that should load smoothly into a MATLAB array. Suppose a comma delimited ASCII text file named ‘Lab1_data.txt’ contains the following two lines of text 1,1.1,1.2 2,2.2,2.4 Suppose the following MATLAB commands are executed >> load ‘Lab1_data.txt’; >> field1 = Lab1_data(:,1)’; >> field2 = Lab1_data(:,2)’; >> field3 = Lab1_data(:,3)’; The first line loads the data from the file into the MATLAB variable Lab1_data. The dimensions of Lab1_data are defined by the format of the data file. In this case, it will have two rows and three columns. The second line selects the first column of data in Lab1_data and assigns it to a row vector called field1. (The apostrophe at the end of the line converts the column to a row. This transposition is done because it is generally

Page 8: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 1. Absolute and Relative Humidity

The University of Michigan, All rights reserved 3

easier to work with row vectors than column vectors.) If field2 is displayed, for example, it will look like >> field2 field2 = 1.1 2.2 Performing element-by-element operations on two vectors: Given two row vectors, a and b, of the same length, a new vector can be formed that has as its nth element the ratio of the nth elements of a and b (i.e. c(n) = a(n)/b(n)) using the equation >> c = a./b It is important to remember to type ‘./’ rather than ‘/’ to tell MATLAB that this is an element-by-element operation rather than a matrix composition. 1.4 Demonstrations During the Lab Session:

• Opening data files and reading them into the MATLAB environment as variables • Creating a function and calling it • Plotting data

1.5 Laboratory Assignment: 1.5.1 Code up the algorithm for saturation water vapor density as a MATLAB function. The function should return saturation water vapor density in g-m3 when it is given an air temperature in degrees C. Save the function as an m-file in your MATLAB current directory. Test it and demonstrate that it works by creating a plot of temperature vs. saturation water vapor density, with temperature ranging from -10C to +40C. Include the figure in your lab report. Include this and all other source code in appendices to the lab report. Number appendices consecutively and give them descriptive titles. Regarding figures in general, it is a requirement that all figures included in all lab reports conform to some standard practices. The requirements include: - Label both x and y axes with descriptive names and always specify the units of the variables. - Number all figures consecutively and include a figure number and title. - Whenever more than one plot appears in a single figure, use legends to identify each plot and use different plotting styles to differentiate them. The styles should look different with a black&white reproduction, so don’t just rely on different colored lines of the same style.

Page 9: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 1. Absolute and Relative Humidity

The University of Michigan, All rights reserved 4

1.5.2 Download the data files Lab1_1.txt and Lab1_2.txt from the course web page into your MATLAB current directory. Each file contains surface meteorological data recorded on the roof of the Space Research Building every 30 sec over one day last year. One file was recorded on 14 February 2004 and the other on 16 July 2004. Each row of the files contains data of the form hr,min,sec,pres,airtemp,dptemp where hh is the hour of the day in local time using a 24 clock, min is the minute of that hour, sec is the second of that minute, pres is the air pressure in mbar, airtemp is the air temperature in degrees C and dptemp is the dew point temperature in degrees C. For example, the first line of Lab1_1.txt is 0,00,20,1025.9,-3.9,-8.5 which means that the air pressure was 1025.9 mbar, the air temperature was -3.9 C and the dew point temperature was -8.5 C at 20 seconds after midnight on this day. The last line of Lab1_2.txt is 23,59,37,1015.7,19.4,17.2 which means that the air pressure was 1015.7 mbar, the air temperature was 19.4 C and the dew point temperature was 17.2 C at 11:59:37 pm on this day. Using MATLAB, compute the minimum, average and maximum air temperatures for each day and report your results in a table. Number and label the table. Include descriptive names for the rows and columns of the table and make sure to include units for all variables. 1.5.3 Create a new variable in MATLAB that is the elapsed time of day in units of fractional hours. This will be the time variable for the following plots. An algorithm for elapsed time of day is >>elapsed_time = hour + min/60 + sec/3600; (Hint: make sure that elapsed_time is a row vector and not a column vector to make plotting easier.) 1.5.4 Compute the relative humidity throughout the day for both days. You should use the MATLAB function from Section 1.5.1 to do this. Generate a plot to display your results. The plot should be composed of two subplots. The upper subplot should show both the air and dew point temperatures versus time. Make sure to use different line styles for the two temperatures and annotate the plot using MATLAB legends. The lower subplot should show the relative humidity versus time.

Page 10: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 1. Absolute and Relative Humidity

The University of Michigan, All rights reserved 5

1.5.5 Compute the “comfort” of the air throughout the day for both days, defined as the times when the relative humidity is below 70%. Make plots of “comfort” versus time for both days. You might consider using the MATLAB stem command instead of plot for this figure. If you try both, you’ll see why. Also make plots of the histograms of relative humidity for both days, dividing up the range of the histogram in increments of 10%. The MATLAB hist command makes histograms. 1.5.6 Include a cover page for your lab report and a summary page that describes what you did and how the report is organized. The summary should, for example, include an itemized list of all appendices containing MATLAB source code.

Page 11: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

The University of Michigan, All rights reserved 6

Lab 2: Covariance in the Planetary Boundary Layer

2.1 Goals: This laboratory will introduce you to the concept of the planetary boundary layer of the atmosphere and to the statistical concepts of correlation and covariance. It will also introduce you to several useful statistical analysis tools in MATLAB and to some more flexible techniques for reading data files into MATLAB. 2.2 Background: 2.2.1 Variance, Covariance and Correlation Variance and Standard Deviation: The variability of a signal can be quantified in terms of its deviation from its mean value. A signal that doesn’t change much will tend to stay close to its mean value whereas a highly variable signal will deviate significantly from it. The standard deviation of a signal is its Root Mean Squared (RMS) deviation from the mean. Given N samples of a signal, si for i = 1,...,N, the standard deviation is

∑=

><−=N

iis ss

N 1

2)(1σ (2.1)

where <s>, the mean value of si, is given by

∑=

>=<N

iis

Ns

1

1 (2.2)

The variance of a signal is the square of its standard deviation (i.e. variance is the Mean Squared deviation of a signal from its mean value). Covariance: In a general sense, two signals are correlated if changes in one are related to changes in the other. A useful way to quantify this behavior is with the covariance. Covariance is a measure of the correlation between deviations of two signals from their respective means. The correlation between samples of two signals, xi and yi for i=1,...,N is

∑=

><−><−=N

iii yyxx

NyxCov

1

))((1),( (2.3)

Note by comparing eqns. 2.1 and 2.3 that the variance of a signal is simply its covariance with itself (i.e. σx = Cov(x,x)1/2). Correlation: The covariance increases and decreases in magnitude depending on how much variation each of x and y have from their respective mean values. In order to correct for this dependence, the covariance can be normalized with respect to their

Page 12: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 2. PBL Covariance

The University of Michigan, All rights reserved 7

standard deviations. The result is called the correlation coefficient between the two signals, or

yx

yxCovyxCorrCoefσσ

),(),( = (2.4)

where σx and σy are given by eqn. 2.1. The correlation coefficient can vary between -1 and +1. A value of +1 implies that x and y are perfectly correlated and that any changes in y can be exactly predicted by changes in x. A correlation coefficient of +1 is often read as 100% correlation. For example, x has a correlation coefficient of +1 (i.e. is 100% correlated) with itself. It is also 100% correlated with functions of x such as x+10, 3x or x2. A value of 0 implies that x and y are uncorrelated and that knowing what x is gives you no information about y. A correlation coefficient of -1 means that x and y are perfectly anti-correlated. If x does up then y goes down and vice versa. Knowing x tells you exactly what y is, similar to a correlation coefficient of +1. Intermediate values of the correlation coefficient mean that there is some, but not exact, correlation between variations in the two signals. 2.2.2 The Planetary Boundary Layer The troposphere is the region of Earth’s atmosphere extending from the surface up to the tropopause. It is typically identified by the behavior of the air temperature profile, which tends to decrease with altitude up to the tropopause. In the tropopause, air temperature remains relatively constant versus altitude. Above the troposphere, air temperature begins to increase with altitude as you enter the stratosphere. The troposphere can be further divided into two regions by height. The planetary boundary layer (PBL) is the region lying closest to the surface. Its depth is variable and can range from 100s of meters to a few kilometers, depending on conditions. At night and in cooler weather, the PBL tends to be thinner than it is during the day or in warm weather. Warmer weather tends to increase PBL depth because the air is lower density. Lower density air is more easily mixed by convection, which expands the PBL. The PBL also tends to deepen in the daytime because sunlight generates rising thermals. The region of the troposphere above the PBL is referred to as the free atmosphere. Its behavior is much less tightly coupled to conditions at and near the surface. In particular, variations near the surface (i.e. in the PBL) are not that well correlated with variations in the free atmosphere. A number of things can determine the boundary between the PBL and the free atmosphere. One common determiner is the presence of an air temperature inversion, in which the air temperature profile decreases with altitude through the PBL, then increases slightly with altitude at the boundary, and then decreases again up to the tropopause. Such a feature is often referred to as a capping inversion because it tends to prevent atmospheric constituents from passing through it from below to the free atmosphere. One example of this is the top of the smog layer that is often visible in urban basins such as Los Angeles. The temperature inversion puts a “cap” on the smog. An excellent source for more detailed descriptions and explanations of the behavior and

Page 13: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 2. PBL Covariance

The University of Michigan, All rights reserved 8

causes of the PBL can be found in Stull, R. B., 1988: An Introduction to Boundary Layer Meteorology, 666 pp. Kluwer Academic Press. One characteristic that distinguishes the two regions of the troposphere is that variations of many atmospheric constituents tend to be highly correlated spatially within each region but there is only a very weak correlation between variations from one region to the other. We will make use of that characteristic in this lab. 2.3 Relevant MATLAB Commands: Read Sections 2.2 and 2.3 of the EECS 206 Lab Manual. Some of the material is relevant to our needs and some is not but is nonetheless worthwhile signal processing and MATLAB information to know. Formatted reading from a data file into MATLAB variables: The load MATLAB script that was used in Lab 1 analyzes the contents of a data file and automatically determines its format. load then assigns values from the data file to variables in MATLAB according to this determination. This can be quick, convenient and accurate if MATLAB’s determination of the format is the same as yours. There are many situations where the two formats won’t be the same. For example, a data file might contain the string of characters ‘012305’. MATLAB could interpret the string as an integer and assign the value 12305 to a numeric variable type. But the string might actually represent the date January 23, 2005 or the serial number 012305. There are many formatted read options in MATLAB that allow you to control how MATLAB interprets elements of a data file. Some of them are listed here. You can use the help command to learn more about them. fopen, fgetl, fscanf, textread, strread, fread One example of a formatted read procedure will be given here. There are other ways to do this and you can either use this approach or your own. First, open the file 'Lab2_1.txt' and assign its file ID to a MATLAB variable. This command doesn’t read in any data yet. >> fid = fopen('Lab2_1.txt'); Read in a line of text and assign it to a character string variable: >> header = fgetl(fid) The MATLAB variable header is a character string. MATLAB considers header to be a row vector whose elements are individual characters. This is a useful interpretation in case you want to peel apart a character string and extract individual characters or substrings from it. Note that the semi-colon is omitted so that this line of text is

Page 14: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 2. PBL Covariance

The University of Michigan, All rights reserved 9

displayed upon execution. This is one way to monitor the process of reading from the data file. Read in a single line of data that contains a single number and assign its value to a MATLAB variable: >> Ncol = str2num(fgetl(fid)) The function fget1 reads in another line of text from the data file as before. The function str2num coverts that text string to a number. The variable Ncol is assigned the value of that number. Read in a single line of data that contains a row of numbers and assign their values to a MATLAB row vector: >> height = str2num(fgetl(fid)); This line is no different from the earlier one (aside from the addition of a semi-colon at the end so you don’t have to look at all of the values on the screen). But if the text string that is read by fgetl contains a series of properly delimited numbers (usually numbers separated by spaces or commas), then the MATLAB function str2num will automatically make the variable height a row vector of the correct length and assign its elements the proper values. The following code reads in multiple lines of data that each contain multiple numbers and assigns their values to a MATLAB array variable: >> data_array = (fscanf(fid,'%f',[Ncol,Nrow]))’; The arguments to fscanf are interpreted as follows. fscanf reads from the file with ID fid. The format string '%f' tells fscanf that the data to be read are floating point numbers. There are many other options for the fscanf format string. Some of them are discussed in the MALAB help responses to textread and fscanf. The argument [Ncol,Nrow] tells fscanf how many columns and rows to read (i.e. how many data elements are on each line (Ncol) and how many lines of data (Nrow) there are). It is important to recognize that the function fscanf reads data in a column ordered sequence. That is why the number of columns is specified first and the number of rows is specified second. In most situations in MATLAB, it is desirable to have the data placed into an array variable in row order. This is why the entire right hand side of the equation has been transposed (by the apostrophe near the end of the line). Creating scatter plots: Plots made in Lab 1 were line plots that traced out a relationship between the independent variable on the horizontal axis and a function of it on the vertical axis. Such a plot “connects the dots” between pairs of data points. A scatter plot doesn’t connect the dots. It can be generated by the command:

Page 15: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 2. PBL Covariance

The University of Michigan, All rights reserved 10

>> plot (x,y,'+'); where x and y are row vectors of the same length. The argument '+' tells MATLAB to place a plus sign at each point (xi, yi) in the plot and to not connect the points. (Other characters than a plus sign can be used, too.) Scatter plots can be a very useful way to display relationships between x and y when one of the signals isn’t necessarily a dependent function of the other so that a line plot may not be appropriate. 2.4 Demonstrations During the Lab Session:

• Correlation between signals • Formatted reading of data files • Scatter plots

2.5 Laboratory Assignment: 2.5.1 Download from the course web site the file “Lab2_1.txt” which contains 20 realizations of a water vapor density profile between 0 and 15 km. The first eight lines of the file are a header which explains the file content and formatting details. Read the header lines into MATLAB. Line 3 contains the number of samples of each water vapor profile that were measured (there are 30). It should be read into MATLAB as a number. Line 5 contains the heights at which each of those samples was measured. It should be read into MATLAB as a row vector. Verify that this vector has dimensions 1x30. Line 7 contains the number of water vapor profiles included in the data file (there are 20). It should be read into MATLAB as a number. The other header lines should be read into MATLAB as character strings and displayed after reading to verify that the file is being read properly. Read the water vapor profiles into MATLAB as an array for which each row is a different profile and each column is a different height. You must use the two values, 20 and 30, read from the header as part of the source code that reads the water vapor profiles. It isn’t really necessary to do this since you already know that there are 20 rows and 30 columns in the water vapor density array. But later, when you need to access different data files with different formats, it will be very convenient to be able to do this automatically using information read from the file header. So you should practice doing it here.) Generate a single plot that shows all 20 water vapor profiles overlayed. It isn’t necessary to be able to differentiate and identify each one of the profiles with different line types. This plot is intended to give you a feel for the amount of variability between profiles. When plotting atmospheric profiles, it is customary to reverse the normal relationship between dependent and independent variables. Normally, one plots the independent variable, x, on the horizontal axis and the dependent variable, f(x), on the vertical axis. In this case, you should plot height, z, on the vertical axis and the water vapor density profile, ρ(z), on the horizontal axis. This is done because the height variable relates to

Page 16: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 2. PBL Covariance

The University of Michigan, All rights reserved 11

vertical position so it is natural to plot it on the vertical axis. Use this plotting convention for all profiles. Compute profiles of the mean water vapor density at each height and of the standard deviation of the water vapor density at each height. There are many ways to do this. You can either code up the algorithms that define the mean and standard deviation (see eqns. 2.1 and 2.2) or you can use canned functions supported by MATLAB. Generate plots of each profile. Are they both consistent with the “feel” that you got from the overlayed family of profiles in the first plot? 2.5.2 Scatter plots are a good way to get a feel for the relative correlation between two signals. Generate scatter plots of the water vapor profile at two different heights. These plots should indicate how much variations in the water vapor density at one height are related to variations at another height. For example, if the density increases at 10 km, how likely is it that it also increased at 1 km and are the degrees of increase related? There should be one point in the scatter plot for each realization of the profiles, for a total of 20 points. Generate scatter plots for the following pairs of heights: a) 0.5 km and 1.5 km b) 0.5 km and 5.0 km c) 0.5 km and 15.0 km d) 1.5 km and 5.0 km e) 5.0 km and 15.0 km In each case, discuss the implications on the correlation of variability between the two heights. 2.5.3 Compute the correlation coefficient of variations in water vapor density between all possible pairs of heights. In terms of the defining relationship given by eqn. 2.4, the correlation coefficient between heights z1 and z2 would be CorrCoef(ρ(z1), ρ(z2)), where ρ(z) is a 1x20 row vector of the water vapor density at height, z, for each of the 20 realizations. Just as in the case of the mean and standard deviation, you can either compute CorrCorf by coding up eqn. 2.4 or by using canned MATLAB functions. If you do use MATLAB functions, you need to be sure that they are implementing the specific algorithm that you want. Generate plots of the correlation coefficient profile for which you fix z1 and vary z2 from 0 to 15 km. These plots will tell you how correlated variations at height z2 are with variations at height z1. Generate correlation coefficient profiles for z1 = 0.5, 1.0, 2.0, 3.0, 6.0 and 12.0 km. If you have done things correctly, the values of the magnitude of the correlation coefficient should never be greater than one. Compare your correlation coefficient profiles to your scatter plots and discuss whether they are or are not consistent. Estimate the depth of the PBL for this set of water vapor density profiles.

Page 17: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 2. PBL Covariance

The University of Michigan, All rights reserved 12

2.5.4 Include a cover page for your lab report and a summary page that describes what you did and how the report is organized. Include a list of all appendices containing MATLAB source code.

Page 18: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

The University of Michigan, All rights reserved 13

Lab 3: Time Harmonic Precipitation

3.1 Goals: This laboratory will introduce a method for identifying time harmonic patterns in a series of samples of monthly precipitation totals. It will also introduce the concept of explained variance. You will also learn how to remove time harmonic trends from a data series. 3.2 Background: 3.2.1 Time Harmonics Read Section 3.2 of the EECS 206 Lab Manual on Sinusoids and Sinusoidal Correlation. Explained Variance: A signal that has non-zero correlation with another is said to (at least partially) “explain its variance”. The words imply that if you know one of the signals then you also know something about how the other one varies. For example, if two signals are 100% correlated then one can completely explain variations in the other whereas if two signals are uncorrelated (i.e. their correlation coefficient is zero) then knowing one tells you nothing about variations in the other. More often, the situation is something in between, where one signal explains some fraction (between 0% and 100%) of the variation in another. The variance of a signal is the square of its standard deviation (see eqn. 2.1). It is a measure of how much a signal differs from its mean value. If some of that difference can be explained by another signal, then the variance will be reduced if the explained component is removed. This relationship can be formalized mathematically into an expression that defines explained variance. Given two signals, x and y, the fraction of the variance of y that is explained by x is given by

2

2\2 1y

xyrσσ

−= (3.1)

where r2 is used to denote explained variance, 2

yσ is the variance of y and 2\xyσ is the

variance of y\x. The signal y\x is that portion of y that is not explained by x. (More about how to compute y\x later.) Note two limiting cases of eqn. 3.1. If x and y are uncorrelated, then x explains none of y’s variations. In that case, y\x will equal y, the two variances in eqn. 3.1 will be equal, and r2 will equal 0. If, on the other hand, x and y are 100% correlated, then all variations in y can be explained by x. If all variation is removed from y, then y\x will be a constant and its variance will be zero. In that case, r2 = 1. Harmonic Analysis: In harmonic analysis, we are particularly interested in determining how much of the variation in a signal can be explained by sinusoids. We can do this using the covariance between the two signals. Recall from Lab 2 that the covariance between discrete signals x and y of length N is defined as

Page 19: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 3. Time Harmonic Precipitation

The University of Michigan, All rights reserved 14

∑=

><−><−=N

nnn yyxx

NyxCov

1))((1),( (3.2)

In Lab 2, we used this operation to assess the coupling between variations in the atmosphere at different heights. The same covariance operation can also be used to extract the component of a signal’s variation that is explained by a sinusoid. This type of analysis might be useful, for example, if we were interested in identifying a diurnal, seasonal or annual pattern in a geophysical signal. Suppose that one of the signals, y in eqn. 3.2, consists of samples of a geophysical measurement made at uniform time increments, Ts. Suppose that the other signal in eqn. 3.2 is a sampled sinusoid of the form

)2sin( sn fnTx π= (3.3)

where f is its frequency and Ts is the time increment between samples. The amplitude of the component of y that is explained by x is given by

),(2 yxCovA = (3.4)

Since the harmonic signal has an amplitude A and a frequency f, it can be written as

)2sin( s

sn fnTAY π= (3.5)

where an upper case Y is used to distinguish this harmonic signal from the original signal, y, and the superscript s signifies that the sinusoid is a sine function. Quadrature Harmonic Components: The above example extracts the component of a signal, y, that varies at a frequency, f, with the phase of a sine function. It is also possible that a component of the signal can vary at the same frequency but with a different phase. An important theorem in harmonic analysis states that all components of a signal which vary at a particular frequency can be extracted by harmonic components which vary with the phase of a sine function and a cosine function. These are called the two quadrature components of the signal at that frequency. The cosine quadrature component is extracted in the same way as the sine component. Its amplitude is given by

),(2 yxCovB = (3.7)

where )2cos( sn fnTx π= . The cosine component of the harmonic signal is given by

)2cos( sc

n fnTBY π= (3.5) The complete harmonic signal is given by

Page 20: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 3. Time Harmonic Precipitation

The University of Michigan, All rights reserved 15

)2cos()2sin( ss

cn

snn fnTBfnTAYYY ππ +=+= (3.8)

It is important to note that a trig identity allows eqn. 3.8 to be rewritten in the form

Yn = Ccos(2πfnTs + φ) (3.9)

where φ is a phase shift and C = (A2 + B2)1/2 is the amplitude of the harmonic. You are going to derive an expression for φ as part of this lab. The harmonic component of y can be removed from the original signal by subtraction, or

nnn Yyxy −=)\( (3.11)

This new signal with the harmonic component removed, called y\x, would be inserted into eqn. 3.1 to determine what fraction of the variance of y was explained by that harmonic. 3.2.2 Precipitation Precipitation is a critical part of the global water and energy cycles. Measurement of precipitation allows you to track the water – e.g. for agricultural purposes and to assess storm runoff and predict the likelihood of flooding. Precipitation is also associated with the global energy cycle since it is an indicator of latent heat released into the atmosphere by condensation of water vapor. This is the second largest global source of energy into the atmosphere, after solar radiation, and is by far the most variable. Knowledge about it is critical to understanding the global energy cycle, to predicting long term (climatic) changes, and to predicting short term (weather forecasting) events. Precipitation is relatively easy to measure and historical records have been routinely archived for many years. One good source of information is the National Climate Data Center maintained by NOAA <http://www.ncdc.noaa.gov/oa/ncdc.html>. Monthly records of total precipitation at a number of surface weather stations in Michigan for the period 1931 through 1997 have been downloaded from that site and placed in the coursetools Resources folder as the file ‘Lab3_1.txt’. In this lab, you will examine the time series of monthly total precipitation for Ann Arbor. You will identify the single largest harmonic component of variation in the record, determine the phase of its sinusoidal behavior, and make a hypothesis about the reason for that phase, in terms of atmospheric phenomenology. 3.3 Relevant MATLAB Commands: Dissecting and operating on character strings: The data file ‘Lab3_1.txt’ that you will be working with has a mixture of characters and numbers on each line. One way to read

Page 21: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 3. Time Harmonic Precipitation

The University of Michigan, All rights reserved 16

this type of data into MATLAB variables is to, first, assign an entire line from the file to a character string in MATLAB and, then, dissect that string into the different parts that mean different things. Open the data file and assign its first line to a character string in the same way as was done in Lab 2 >> fid = fopen('Lab3_1.txt'); >> strdata = fgetl(fid); MATLAB treats character strings as row vectors, each element of which is one of the characters. Note that MATLAB treats each element as a character, not a number, unless you tell it to convert from one to the other. For example, a MATLAB character variable with value ‘3’ is not the same as a MATLAB numeric variable with value 3. Substrings within a string are identified by standard MATLAB vector indexing rules. A substring can then be converted to its numerical value by the command str2num. For example, the following command assigns to a numeric variable numdata the value of the number in the 45th through 50th characters of strdata >> numdata = str2num(strdata(45:50)); It is important to recognize that this command will only work properly if characters 45 through 50 actually do contain a number. Locating and determining the biggest element of a vector: Given a row vector amag, the following command assigns its largest element to maxamag and the index of its largest element to maxn >> [maxamag maxn] = max(amag); In other words, amag(maxn) = maxamag. 3.4 Demonstrations During the Lab Session:

• Harmonic content in a signal • Relevant trigonometric relationships • Dissecting and interpreting character strings

3.5 Laboratory Assignment: 3.5.1 Download from the coursetools web site the file “Lab3_1.txt” which contains monthly precipitation totals at many surface weather stations in Michigan for 1931 through 1997. You will need to read the monthly totals for Ann Arbor into a numerical row vector. The first element of the row vector should be the monthly total for January 1931. The last element of the row vector should be the monthly total for December 1997. There are a number of issues you must deal with to properly set up the row vector. They include:

Page 22: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 3. Time Harmonic Precipitation

The University of Michigan, All rights reserved 17

i) The first three lines of the data file are header information. Read them in a text editor to get familiar with the file format and the units that are used for monthly precipitation totals. Also read them into MATLAB, in order to get to the 4th line where the data starts. ii) Beginning with line 4 of the data file, each line contains a station ID number in the first seven spaces. You will need to sequentially read line-by-line through the file until you reach the lines of data beginning with station ID number 200230. This is Ann Arbor’s station ID. Only the lines beginning with 200230 should be processed. Following is a piece of source code that extracts the station ID from a line of data: >> strdata = fgetl(fid); >> stationid = str2num(strdata(1:7)); If stationid doesn’t equal 200230, then skip ahead to the next line. If stationid equals 200230, then process the line as follows. iii) Each line in the data file contains one complete year of monthly precipitation totals (i.e. 12 data elements). You should read the monthly totals into the row vector that will contain all of the data from 1931 through 1997. There are a number of ways to do this. One way uses the following algorithm >> for ncol = 0:11 >> p = str2num(strdata(a + b*ncol:c + b*ncol)); >> counter = 12*nrow + ncol + 1; >> precip(counter) = p; >> end where strdata is a character string containing an entire line of the data file, a is the position in the string of the first monthly precipitation total, b is the number of characters used for each monthly total, c = a + b – 1, and nrow keeps track of which line of data has been read (i.e. nrow = 0 for year 1931, = 1 for year 1932, etc.). The row vector precip will fill up with the monthly precipitation totals after all lines of data for Ann Arbor are read. iv) Once you have read all of the Ann Arbor data into the precip row vector, it is a good idea to double check that it has been generated correctly. Take a look at the original data file in a text editor to see what the first couple of monthly totals are in 1931 and the last couple are in 1997. Verify that the values in your row vector are the same. Also, compute how many monthly totals there should be and verify that you have that many elements in your vector. One way to do this is with the MATLAB whos command, which reports on the size of all variables. v) Any time you use someone else’s data, it is a good idea to apply some tests of its quality. Test every element of precip to make sure that its value is not negative (negative rain fall is impossible) and that it is not greater than 9000 (90” of rain in one month never

Page 23: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 3. Time Harmonic Precipitation

The University of Michigan, All rights reserved 18

happens in Ann Arbor). If either limit is exceeded, something is wrong with that data element and you should set it equal to zero. There are a number of problem elements in this data file so you must run this quality test. Keep track of how many data elements are negative and how many are greater than 9000 and report those numbers in your lab report. 3.5.2 Plot the monthly precipitation total for Ann Arbor from 1931 to 1997. The x axis should be time in units of fractional calendar year (i.e. the x axis should begin at 1931.0 and end at 1998.0). The y axis should be in units of inches per month. One way to generate a row vector for time using these units is >> t = 1931:1/12:1998 - 1/12; 3.5.3 Think of the row vector precip that you have assembled as a discrete signal composed of N samples made at uniform time increments, Ts = 1/12 year. The total interval of time of the samples spans NTs = 67 years (from 1931 through 1997). Two important characteristics of harmonic analysis of a discrete signal are the minimum and maximum frequency components that can be accurately determined. They are related to the time increment between samples and to the total interval of time of the samples by the following relationships

sNTf 1

min = and sT

f21

max = (3.12)

In our case, fmin is 0.015 cycles per year and fmax is 6 cycles per year. In other words, with this data set we will not be able to identify any sinusoidal patterns in the monthly precipitation totals that have periods shorter than 2 months or longer than 67 years (recall that the period of a sinusoid is the inverse of its frequency). Compute the amplitudes of the sine and cosine harmonic components of the precip signal (i.e. compute A and B in eqn. 3.8) for the following range of frequencies >> f = 0.02:0.02:6; This range of frequency covers fmin < f < fmax. Plot C = (A2 + B2)1/2 versus frequency. The larger the value of C, the greater the fraction of the variance of precip that is explained by that frequency. i What frequency explains the largest fraction of the variance of precip? What is the period corresponding to that frequency? Explain why this frequency makes sense in terms of the natural causes of variability in rainfall. i What frequency explains the second largest fraction of the variance of precip? What is the period corresponding to that frequency? Explain why this frequency makes sense in terms of the natural causes of variability in rainfall.

Page 24: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 3. Time Harmonic Precipitation

The University of Michigan, All rights reserved 19

3.5.4 Create a new signal that is the annual harmonic of precip. Use eqn. 3.8 to construct the harmonic. The annual harmonic has a frequency of 1 cycle per year and a period of 1 year. Subtract the annual harmonic from precip (i.e. compute precip\x where x is the annual harmonic signal), compute the variance of this new signal, and compute the percentage of variance in precip that is explained by the annual harmonic. Your answer must be between 0% and 100%. i Construct a new signal that is the sum of the annual harmonic plus the average value of precip. Plot both it and the original precip signal on the same plot. See if you can identify the annual component in the original signal. i Derive an expression for φ in eqn. 3.9 as a function of A and B in eqn 3.8. What is the phase of the annual harmonic of precip? Using your value for φ, determine at what time of every year the minima and maxima of the annual harmonic occur? Compare your answer, determined mathematically from φ, to the locations of the peaks and troughs of the plot of the annual harmonic made earlier. They should be consistent. Explain why the locations of the peaks and troughs make sense in terms of the natural causes of variability in rainfall. In other words, explain why these are statistically the rainiest and driest months of the year. 3.5.5 Include a cover page for your lab report and a summary page that describes what you did and how the report is organized. Include a list of all appendices containing MATLAB source code.

Page 25: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

The University of Michigan, All rights reserved 20

Lab 4: Cloud Drop Sizes and Doppler Spectra

4.1 Goals: This laboratory will introduce the use of the discrete Fourier transform. Spectral representations of a time dependent signal will be computed using the Fast Fourier Transform (FFT). Spectral analysis of time dependent signals measured by a Cloud Doppler Radar will be used to estimate the size distribution of suspended cloud drops. 4.2 Background: 4.2.1 Radiative Balance and Cloud Drop Size Distributions The mean temperature of the earth is governed by the earth’s albedo. Albedo is the fraction of radiation incident on the earth from the sun that is reflected back into space. One-minus-the-albedo, therefore, determines the amount of energy from the Sun that enters into the earth system. The global average albedo of the earth is approximately 0.30, although it varies significantly with region and atmospheric conditions. Oceans generally have a lower albedo than average, ice has a higher albedo, and land is intermediate. Clouds have a huge impact on the earth’s albedo. On average globally, clouds account for roughly two-thirds of the total reflected radiation. The other one third is accounted for by the earth’s surface. Changes in albedo will alter the balance between the energy supplied by the sun (primarily at short visible and UV wavelengths) and the energy re-radiated by the earth (primarily at long infra red wavelengths). For example, if the albedo increases then more solar energy is reflected and less is absorbed by the earth. In order to reach a new radiative balance with the decreased solar energy, less energy must be re-radiated in the infra red. The energy contained in the long wave re-radiation depends on the temperature of the Earth – lower temperatures radiate less infra red energy. Thus, an increase in the global average albedo will result in a decrease in the global average earth temperature. Even a very small change in albedo can cause significant (to humans and life in general) changes in the mean temperature of the earth. The size distribution of the suspended liquid and frozen water drops that make up clouds plays an important role in determining the albedo of a cloud. Clouds with smaller drops tend to have a higher albedo. There is significant experimental evidence that increases in atmospheric aerosols (small particles such as soot from factory chimneys) due to anthopogenic activity have resulted in a decrease in the typical sizes of cloud drops. Many scientific investigations are currently underway to try and quantify this relationship and to better understand the related microphysical mechanisms of cloud formation and evolution. One important tool for these investigations is the Cloud Doppler Radar. 4.2.2 Cloud Doppler Radar The Cloud Doppler Radar is designed to remotely measure the drop size distribution (DSD) of suspended frozen and liquid water drops in clouds. The DSD, typically denoted by N(D), is a type of probability distribution. It is a volumetric number density with the property that N(D)dD is the number of cloud drops per cubic meter with

Page 26: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 4. Cloud Doppler Spectra

The University of Michigan, All rights reserved 21

diameter between D and D+dD. The integral of N(D) over all possible cloud drop diameters has the property that

∫∞

0

)( dDDN = total # of drops per cubic meter (4.1)

Cloud Doppler Radars determine the DSD indirectly by measuring the Doppler shift of radar signals scattered off of the falling drops. The fall velocity of a cloud drop varies with its diameter. Neglecting updrafts and downdrafts, the fall velocity of a cloud drop with diameter, D, can be approximated by

v(D) = 136D2/3 (4.2)

where v(D) is in units of m/s and D is in units of meters. Typical cloud drop sizes are in the range 10-6 – 10-5 meters, so that their fall velocity is in the range 0.01 – 0.1 m/s. The Doppler shift caused by reflection of a propagating wave by a moving target is given by

fD = 02 fcv (4.3)

where v is the component of the target velocity that lies along a line from the radar to the target, c is the propagation speed of the wave, and f0 is the frequency of the wave before it is Doppler shifted. If a radar is located on the surface and pointed straight up to observe cloud drops falling straight down, then the velocity in eqn. (4.3) will be the same as the velocity in eqn. (4.2). Cloud Doppler Radars often operate at f0 = 94 GHz, at which frequency there is an atmospheric window in between gaseous absorption lines of oxygen and water vapor. At 94 GHz, the Doppler shift corresponding to cloud drop fall velocities of 0.01 – 0.1 m/s will be 6 – 60 Hz. Cloud Doppler Radars can measure the Doppler spectrum of the signal scattered by the cloud drops. The radar scattering cross section of a cloud drop is proportional to the sixth power of its diameter. This cross section determines the magnitude of the power measured by the radar. The “radar range equation”, relating the power received by the radar to the number density of cloud drops, can be written as

6)()( DDKNDPR = (4.4)

where K is a radar hardware constant and N(D) is the DSD of the cloud. In practice, a Cloud Doppler Radar will measure the received power, modulated by the Doppler shift, as a function time. The raw data can be written as PR(t). The dependence of received power on frequency is determined by computing the spectrum of PR(t). This spectrum, Pr(f), is typically referred to as the Doppler Spectrum of the cloud. Eqns. (4.2) and (4.3) are used to transform PR(f) into PR as a function of cloud drop diameter. Then eqn. (4.4)

Page 27: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 4. Cloud Doppler Spectra

The University of Michigan, All rights reserved 22

is used to transform PR(D) into the drop size distribution, N(D). You will perform each these transformations as part of this lab. 4.2.2 Discrete Doppler Spectra and Drop Size Distributions In practice, the Doppler spectrum is determined at discrete frequencies. The received power at a discrete Doppler shift frequency, fi, actually represents the total scattered power from all rain drops with Doppler shift frequencies in the interval fi ± 0.5fres, where fres is the frequency resolution of the radar. In practice, it is customary to sample the Doppler shift frequency at uniform increments of fres. The DSD that is derived from the Doppler spectrum will also be discrete. Therefore, the Doppler spectrum at frequency fi corresponds to the number of cloud drops per cubic meter with diameters between Di,lower and Di,upper, where Di,lower is the cloud drop diameter that corresponds to fi – fres, Di,upper is the diameter that corresponds to fi + fres , and Di is the diameter that corresponds to fi. 4.2.3 Fourier Analysis and Discrete Specta Read Section 4.2 of the EECS 206 Lab Manual on Frequency Domain Representations, The Fourier Series, The Discrete Fourier Transform, and Separating Signals Based on Differing Harmonic Series. 4.3 Relevant MATLAB Commands: Fast Fourier Transform: The fast Fourier transform and inverse fast Fourier transform are computationally efficient algorithms for computing discrete spectra from a sampled time series and for reconstructing a time series from its spectrum, respectively. Given a discrete time signal, stime, consisting of N samples made at times tmin, tmin + Ts, tmin + 2Ts, ..., tmax = tmin + (N-1)Ts, the fast Fourier transform is computed by >> sfreq = fft(stime)/length(stime); The discrete spectrum, sfreq, is also made up of N elements. It includes samples of the discrete Fourier transform of stime made at frequencies from fmin to fmax in steps of Fs, where fmin = –1/(2Ts), Fs = 1/(tmax - tmin) and fmax = fmin + (N-1)Fs = 1/(2Ts). The ordering of frequency samples in the vector sfreq is a little counterintuitive. If N is an odd number, the ordering is described by sfreq(1) = spectrum at 0 Hz sfreq(2) = spectrum at Fs Hz sfreq(3) = spectrum at 2Fs Hz ... sfreq((N+1)/2) = spectrum at fmax Hz sfreq(1 + (N+1)/2) = spectrum at fmin Hz sfreq(2 + (N+1)/2) = spectrum at fmin + Fs Hz sfreq(3 + N/2) = spectrum at fmin + 2Fs Hz ...

Page 28: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 4. Cloud Doppler Spectra

The University of Michigan, All rights reserved 23

sfreq(N) = spectrum at -Fs Hz It appears from this ordering that the spectrum actually begins at sfreq(1 + (N+1)/2)) and then “wraps around” after sfreq(N) back to sfreq(1). However, only half of the spectrum (either the positive or the negative half) contains unique information due to its Hermitian symmetry (i.e. sfreq(-f) is the complex conjugate of sfreq(f)). For this reason, it is usually sufficient to concentrate on the positive half only, with frequencies from 0 to fmax in increments of Fs. Conversely, given a discrete spectrum, sfreq, consisting of N samples made at frequencies fmin, fmin + Fs, fmin + 2Fs, ..., fmax = fmin + (N-1)Fs, the inverse fast Fourier transform is computed by >> stime = fft(sfreq); where it should be remembered that the ordering of frequency samples must conform to the (counterinutitive) algorithm described above. In general, time samples are real valued and their corresponding frequency samples will be complex valued with Hermitian symmetry. 4.4 Demonstrations During the Lab Session:

• Signal synthesis (building signals from sinusoids) • Discrete Spectra – time increments, time duration, frequency increments and

frequency coverage 4.5 Laboratory Assignment: 4.5.1 Do Problem 4.5.1 (Building Signals from Sinusoids) from the EESC 206 Lab Manual. You will need to download the two files sinsum.m and sinsum.fig from the coursetools web site. Your lab write up should include answers to the questions stated in the EECS 206 manual. They are repeated here: a) What are the amplitudes and phases of each of the three sinusoids whose sum best approximates the target signal. b) What is the RMS difference between the target signal and your approximation of it. c) Include a cut-and-pasted version of the figure window generated by sinsum.m. 4.5.2 Download from the coursetools web site the file “Lab4_1.txt” which contains a profile of the time dependent radar signal measured by a Cloud Doppler Radar. There is a different time dependent signal at each height through the cloud because the size distribution of cloud drops typically changes as a function of height. Read the file header to learn what are the sampled times and the sampled heights of the profile. Load the

Page 29: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 4. Cloud Doppler Spectra

The University of Michigan, All rights reserved 24

profiles into a suitable MATLAB array for subsequent processing. You have learned several methods for doing this in previous labs and you are free to use any one of them. Generate plots of the time dependent signals at the highest and lowest altitudes plus one more near the middle. Include these plots in your lab report. 4.5.3 Convert the time dependent signals into Doppler spectra using the MATLAB fft command. The frequency increment between individual samples of the Doppler spectrum is determined by the total duration of the time dependent signal. What is the frequency increment? The maximum frequency of the Doppler Spectrum is determined by the time increment between individual samples of the time dependent signal. What is the maximum frequency? Generate a frequency vector, freq, that contains values from fmin to fmax with a step size equal to the frequency increment. Generate plots of the Doppler spectra at the same three altitudes used in part 4.5.2 above. The horizontal axis of these plots should be the frequency vector, freq,. Include these plots in your lab report. 4.5.4 Convert the profile of Doppler spectra to a profile of the power received by the radar at each cloud drop size diameter, using eqns. (4.2) and (4.3). Generate a drop size vector, dsize, that contains values of the cloud drop diameter corresponding to each element of freq. Generate plots of the received power versus drop size diameter at the same three altitudes used in parts 4.5.2 and 4.5.3 above. The horizontal axis of these plots should be the drop size vector, dsize,. Include these plots in your lab report. 4.5.5 Convert the profile of received power versus drop size diameter to a profile of the relative drop size distribution, N(D), using eqn. (4.4). There can be problems with numerical round off errors in MATLAB if you try to solve for N(D) for values of D less than3x10-6 meters. Assume that N(D) is zero for these small drops and only attempt to solve for N(D) above D = 3x10-6 meters. This is a relative DSD because you do not yet know the value of K in eqn. (4.4). To determine K, sum up elements of N(D) over all drop sizes. This summation is the total number of drops in the cloud (at a particular altitude) per cubic meter. Assume that this total number density is known to be 2x108 drops per cubic meter at an altitude of 2 km. Solve for K. Apply your value of K to the relative drop size distribution. You have now calibrated the DSD. Generate plots of N(D) vs. altitude for fixed values of D that are in the small, medium and large portion of the range of non-zero drop sizes. Discuss how N(D) changes with altitude at each size. Generate a plot of the profile of the total number of cloud drops per cubic meter (the total number is the summation of N(D) over all values of D. (Note that this is a profile plot so the z (altitude) axis should be the vertical axis.) Include these plots in your lab report. Comment on how the DSD and total number density of drops change as a function of altitude. What cloud microphysical mechanism(s) can you think of that might explain this behavior? 4.5.6 Include a cover page for your lab report and a summary page that describes what you did and how the report is organized. Include a list of all appendices containing MATLAB source code.

Page 30: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

The University of Michigan, All rights reserved 25

Lab 5: Hurricane Imaging

5.1 Goals: This laboratory will introduce you to the use of some of the two dimensional imaging tools that are available in Matlab. You will construct images of the wind speed and direction and cloud liquid water content of Hurricane Isabel just before it made landfall along the southern U.S. Atlantic coast on 18 September 2003. 5.2 Background: 5.2.1 Imaging Hurricane Isabel at Variable Wavelengths Hurricane Isabel made landfall at North Carolina on 18 September 2003. A color image of the hurricane is shown in Figure 1. The image was generated from a composite of

Figure 1. Three-color visible satellite image of Hurricane Isabel at landfall (courtesy of Terra low earth orbiting satellite, NASA). three individual single color digital photographs taken on board NASA’s Terra low earth orbiting satellite. The classic spiral cloud bands and organized circulation about the core of a cyclone are evident in the image. The three colors from which this image is derived all lie in the visible portion of the electromagnetic spectrum, roughly between 4x10-7 (violet) and 7x10-7 (red) meters wavelength. These wavelengths are significantly smaller than the typical diameter of suspended cloud liquid water drops, which lie in the range 10-6 – 10-5 meters. The cloud drops are said to be “electrically large” relative to the

Page 31: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 5. Hurricane Imaging

The University of Michigan, All rights reserved 26

visible portion of the spectrum. Because they are electrically large, the cloud drops will significantly attenuate visible electromagnetic radiation as it propagates through the clouds. This is the reason why, in general, one cannot see through thick clouds. This is also the reason why, in figure 1, you cannot see the ocean or land beneath the clouds within a few hundred kilometers radius of the hurricane eye. You would need to be able to “see” at wavelengths roughly ten times the cloud drop diameter in order to be able to detect the surface beneath the thick cloud cover. In fact, near the eye and especially along the spiral cloud bands emanating from the eye, there is very strong rain falling from the clouds to the ground. Rain drops have typical diameters of 10-4 –10-3 meters and so you would need to be able to “see” at wavelengths of roughly 10-2 meters (i.e. ten times the diameter of the largest rain drops) in order to be able to penetrate through the heaviest rain all the way to the surface. 5.2.2 Microwave Remote Sensing of Severe Weather The microwave portion of the electromagnetic spectrum roughly covers the range of wavelengths from 3x10-3 to 3x10-1 meters. Images of a hurricane made at microwave frequencies are capable of “seeing” through clouds and rain and of detecting the underlying surface. This property is probably the single most attractive feature of a spaceborne microwave imager. Many microwave imagers are in operation on low earth orbiting satellites. Some are specifically designed to measure the properties of the ocean surface, especially beneath clouds and rain in situations where visible or infrared imagers won’t work. There are two general classes of microwave imagers – active and passive. An active imager first illuminates the area to be imaged with a microwave signal. It then records the signal that is scattered back. This is analogous to flash photography. A passive microwave imager measures the natural thermal radiation that is given off by all bodies according to the Planck radiation law. This is analogous to thermal infrared photography. A more common name for an active microwave imager is a radar. A more common name for a passive microwave imager is a radiometer. When a radar makes an image of the ocean surface, it is primarily sensitive to the roughness of the surface. A rougher surface will scatter more of the illuminating signal back toward the radar receiver. The roughness of the ocean surface is highly correlated with the wind speed just above the surface. Stronger winds generate larger waves. In this way, a radar on a satellite can make an image of the wind speed just above the ocean surface. The direction that the wind is blowing also affects the scattering of a radar signal. Winds tend to align the crests and troughs of sequential waves into a roughly periodic structure. For example, scattering from the front face of a wave (when looking into the wind) is much stronger than scattering from the side of a wave (when looking perpendicular to the wind direction). These scattering characteristics, as functions of both wind speed and direction, have been carefully modeled and measured so that spaceborne radars can now generate images of ocean surface wind speed and direction. Such wind radars (called scatterometers) operate at a wavelength of approximately 2x10-2 meters in order to be able to see through heavy clouds and rain.

Page 32: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 5. Hurricane Imaging

The University of Michigan, All rights reserved 27

When a radiometer makes an image of the ocean surface, it, too, is sensitive to its roughness. In addition, the natural thermal radiation that is emitted by the rain and clouds above the surface will also contribute to the image. For this reason, it is common to make radiometer measurements at multiple wavelengths, some much longer than the diameter of the rain in order to penetrate to the surface and some at wavelengths much closer to the diameter of the rain in order to be more sensitive to it. These measurements can be processed to determine both the amount of water in the clouds and rain as well as the wind speed and direction at the surface. In this lab, you will be working with Hurricane Isabel images of wind speed and direction that were measured by the NASA QuikScat radar and images of cloud liquid water content that measured by the IPO WindSat radiometer. To learn more about these two satellite instruments, visit the following web sites: QuikScat: http://winds.jpl.nasa.gov/missions/quikscat/index.cfm WindSat: http://www.ipo.noaa.gov/Projects/windsat.html You will also be working with images of wind speed and direction that were generated by the U.S. National Weather Service’s National Centers for Environmental Protection (NCEP) using a numerical weather prediction computer program called Global Data Assimilation System (GDAS). GDAS images are one way to test if satellite remote sensing measurements like QuikScat and WindSat are working properly. As part of this lab, you will be comparing GDAS wind fields to those produced by QuikScat. 5.3 Relevant MATLAB Commands: There are a number of mapping related Matlab commands needed to generate the two dimensional images in this lab. They are very briefly summarized here. Much more information about the commands is accessible using the Matlab help option. A sample of source code is given below to illustrate the proper use of these commands in combination. find: The find command performs a logical test on each element of a vector and returns all indices for which the test is true. griddata: The griddata command generates a uniformly spaced two dimensional grid of samples from an arbitrary collection of samples. The default interpolation algorithm that is used between samples is linear, although other options are available. axesm: The axesm command sets the projection type and coverage limits of a map image. quiver: The quiver command draws an arrow in a map image with a specified length and orientation. This command will be used to display the magnitude and direction of the ocean surface winds graphically as an arrow with length proportional to wind speed and orientation according to wind direction..

Page 33: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 5. Hurricane Imaging

The University of Michigan, All rights reserved 28

plotm: The plotm command projects line objects onto the map image. Matlab contains line object definitions for the coastlines of all major land masses in the world. This command will be used to draw the coastline. contourfm: The contourfm command produces a contour plot of specified map data on the map image. This command will be used to display the cloud liquid water content and ocean surface wind speed as color coded contours. The following Matlab source code will generate a two dimensional image of ocean surface wind speed and direction arrows superimposed on a color contour map of cloud liquid water. It assumes that the necessary data vectors have already been initialized: latitude, longitude, windspeed, winddirection, and cloudliq. For example, windspeed[n] is the ocean surface wind speed at coordinates latitude[n] and longitude[n].

% Filter the data to lie in the longitude range 80W to 60W % Filter the data to lie in the latitude range 20N to 50N filter_ind = find( longitude>-80 & longitude<-60 & latitude>20 & latitude<50 ); lat = latitude(filter_ind); lon = longitude(filter_ind); ws = windspeed(filter_ind); wd = winddirection(filter_ind); cl = cloudliq(filter_ind); & Resample the cloud data onto a uniform grid in 0.5 deg % increments lat_range = min(lat):0.5:max(lat); lon_range = min(lon):0.5:max(lon); [latx lony clz] = griddata(lat, lon, cl, lat_range', lon_range); % Generate the map image: figure(1) hold on; title('Wind Vector and Cloud Liquid Water'); % Define the map projection and its limits axesm('MapProjection', 'miller', 'MapLatLimit', [(min(lat)) max(lat)], 'MapLonLimit', [(min(lon)) (max(lon))]); % Plot the southern US Atlantic coastline plotm(coast, 'r', 'LineWidth', 2); % Draw color contours of the vertically integrated cloud liquid water content between 0 and 0.5 mm in steps of 0.05 mm contourfm(latx, lony, clz, [0:0.05:0.5]); shading flat; colorbar; % Draw arrows representing the wind speed and direction windx = ws .* cos (wd.*pi./180); windy = ws .* sin (wd.*pi./180); quiverm(lat, lon, windx, windy,'k');

Page 34: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 5. Hurricane Imaging

The University of Michigan, All rights reserved 29

% Create a JPG image file of the map with 300 DPI resolution %print -djpeg –r300 Lab5_1.jpg

You should read through the above source code and become familiar with the different parts. You will need to modify and adapt it. 5.4 Demonstrations During the Lab Session:

• Creating two dimensional image maps • Details of the example source code

5.5 Laboratory Assignment: 5.5.1 Download from the coursetools web site the file “Lab5_1.txt” which contains measurements of ocean surface wind speed and direction by QuikScat and GDAS and measurements of cloud liquid water by WindSat at and near Hurricane Isabel at landfall on 18 September 2003. The contents of the file can be loaded into Matlab variables using the command [lat lon qws qwd gws gwd wcl] = textread('Lab5_1.txt'); where lat and lon are the latitude and longitude coordinates of each of the subsequent variables, qws and qwd are the wind speed (m/s) and direction (degrees relative to north) derived from QuikScat, gws and gwd are the wind speed (m/s) and direction (degrees relative to north) derived from GDAS, and wcl is the cloud liquid water (mm) derived from WindSat. As a check on your code, each of these vectors should have length=20704 when initialized by the data file. i Find and state the minimum and maximum values of each of the variables. 5.5.2. Create a two dimensional map of the GDAS wind speed and direction (as arrows) superimposed over the WindSat cloud liquid water (as a color contour). Adjust the latitude and longitude borders of the image until it is roughly centered on the eye of Isabel and includes only the organized portion of the clouds and circulating winds. i Include a map of the GDAS winds plus WindSat cloud liquid water once you have adjusted the borders. i Generate a second map, using the same borders, of the QuikScat winds plus WindSat cloud liquid water. 5.5.3. You are to compare and quantify the differences between GDAS and QuikScat estimates of wind speed. There are many ways to do this. Here are several you should try. Try others that you might think of, too.

Page 35: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 5. Hurricane Imaging

The University of Michigan, All rights reserved 30

i Compute the RMS difference between the GDAS and QuikScat wind speeds, averaged over all of the data. i Compute the RMS difference between the GDAS and QuikScat wind speeds separately for each of the following subsets of the data: Separate into low, medium and high wind speeds, using GDAS as the determiner of true wind speed. Separate into low, medium and high cloud liquid water, using WindSat as the determiner of true cloud liquid water. Is there any dependence of the difference between GDAS and QuikScat wind speeds on either wind speed or cloud liquid water? i Create a scatter plot of GDAS wind speed (horizontal axis) versus the difference between GDAS and QuikScat wind speed (vertical axis). Does the difference depend on GDAS wind speed? i Create a two dimensional map of the difference between GDAS and QuikScat wind speeds. 5.5.4. Computing a quantitative assessment of the difference between GDAS and QuikScat wind directions is a little trickier. Consider, for example, that if GDAS says the wind direction is 1 degree and QuikScat says it is 359 degrees, the error is actually 2 degrees and not 358 degrees. Discuss how you would quantify the difference in wind direction. 5.5.5. When the cloud liquid water estimated by WindSat becomes very high, it is one indication that there is probably rain below the clouds. If the rain is heavy enough, then even the QuikScat radar signal, with its 2 cm wavelength, will have trouble penetrating to the ocean surface and accurately measuring the wind speed there. Examine the maps of QuikScat winds and WindSat cloud liquid water and make an estimate of the conditions under which QuikScat cannot penetrate to the surface. 5.5.6 Include a cover page for your lab report and a summary page that describes what you did and how the report is organized. Include a list of all appendices containing MATLAB source code.

Page 36: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

The University of Michigan, All rights reserved 31

Lab 6: Sea Level and Tidal Aliasing

6.1 Goals: This laboratory will introduce you to the concept of aliasing in undersampled data sets. You will be working with a time series of measurements of sea level recorded by a buoy in Honolulu Harbor on the island of Oahu in Hawaii. You will be analyzing the time series with the intent of estimating gradual changes in sea level. However rapid and periodic changes, due to tides, are also present and must be properly accounted for. If they are not, aliasing can cause the shorter tidal variations to be mistaken for longer, more gradual changes. 6.2 Background: 6.2.1 NOAA/NOS CO-OPS Sea Level Height Records The NOAA National Ocean Service Center for Operational Oceanographic Products and Services (NOAA/NOS CO-OPS) on line data archives contain many records of oceanographic measurements <http://co-ops.nos.noaa.gov/data_res.html>. One example is a record of the deviation of sea level from Mean Sea Level (MSL) at particular locations as measured by instrumented buoys. MSL is a mean value for the sea level at a location that is averaged over a long historical record. The sea level relative to MSL recorded in Honolulu Harbor on Oahu, Hawaii during January of 2005 is shown in Figure 1. The sea level was measured once per second. Hourly averages of the once-per-second measurements are what is recorded and plotted in the figure.

Figure 1. Hourly averages of sea level in Honolulu Harbor during January 2005 (courtesy of NOAA/NOS CO-OPS).

Page 37: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 6. Tidal Aliasing

The University of Michigan, All rights reserved 32

In figure 1, two periodic sinusoidal components of variability are clearly evident. They are both due to tidal variations in sea level. Tides result from a combination of gravitational and centrifugal forces acting on the ocean. Gravitational forces from the moon cause the ocean to bulge in its direction. Centrifugal forces caused by the earth’s rotation about the center of mass of the earth-moon system cause the water to expand on all sides of the earth, but greatest on the side opposite the moon since that side is farthest from the center of mass. Taken together, these two forces generate a net double bulge in sea level on both sides of the earth and, hence, result in two high tides and two low tides per day. Similar gravitational and centrifugal forces caused by the sun are smaller by about a factor of two. The relatively complicated net tidal pattern is a composite of all of these forces plus other smaller ones. 6.2.2 Global Change and the Rise of Sea Level There has been considerable recent interest in ascertaining whether and, if so, how much the global average sea level is rising. A preponderance of the experimental evidence thus far suggests that it is rising, but that evidence must be examined very carefully since the changes that are of interest are quite small. Two of the largest suspected causes for the rise in global sea level are an increase in the mean temperature of the oceans (which causes it to rise because warmer water is less dense) and the melting of the polar ice caps – also attributed to a general increase in temperature. One major difficulty associated with attempting to measure small, gradual changes in sea level is the fact that frequent, much larger, changes are present due to the tides. It is critical that the time sampling of sea level data adequately take into account the tidal variations. If it is not, a phenomenon known as tidal aliasing can result, in which some of the variations that occur on tidal time scales are mistakenly interpreted as variations on much longer time scales. Because tidal variations tend to be much, much larger than the variations that are expected due to global change effects, even a very small fraction of tidal aliasing can significantly distort estimates of long term sea level rise. In this lab, we will be working with a very short (approximately one month duration) record of sea level measurements at a single location (Honolulu). This data set is inadequate for making reliable estimates of global sea level rise on two accounts. It is much too short and it is not a globally representative sampling. We use this abbreviated data set only for illustrative purposes, to expose you to some of the data analysis methodology used by major international research groups who are working to quantify the rise in global sea level. However, these other groups must and do deal with the same sorts of tidal aliasing issues that we will address in this lab. 6.2.3 Sampling, Undersampling and Aliasing The Nyquist Sampling Theorem states that a signal can be exactly reconstructed from samples of it provided they are made at a frequency of more than twice the highest frequency component in the signal. In other words, if the Fourier transform of a signal is zero for all frequencies higher than fmax Hz, then it can be sampled every Ts = 1/(2fmax) seconds. When a signal is sampled appropriately, it is said to by Nyquist sampled. If it is

Page 38: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 6. Tidal Aliasing

The University of Michigan, All rights reserved 33

sampled faster, it is oversampled, and if it is sampled slower, it is undersampled. One common place example of Nyquist sampling is audio CDs, which sample at 44 kHz because the human ear generally can’t hear anything above 22 kHz. If a signal is undersampled, then aliasing can occur. Aliasing results in distortion of the reconstruction of a signal due to its higher frequency components, which were not sampled fast enough. One way to think of aliasing is by recalling that the spectrum of a signal (i.e. its Fourier transform) is a record of how much individual sinusoids account for the variability of the signal. If a signal is sampled at fs = 1/Ts Hz (where Ts is the time between samples), then the variability due to all sinusoids below fs/2 has been properly accounted for. If the signal had a component of variability at a frequency higher then fs/2, then it will be misinterpreted as a component below fs/2 and the reconstruction will be distorted. This misinterpretation follows an exact mathematical prescription. Frequency components “fold” about fs/2 in the following manner: If there was a non-zero Fourier component at f = fs/2 + δf, then it will be misinterpreted as a component at fs/2 – δf. In practice, it is generally not possible to guarantee that a signal to be sampled every Ts seconds has frequency components that are identically zero above a frequency of fs/2. What is done instead is the signal is filtered to reduce its frequency components above fs/2 to a level that is low enough so that the aliasing is acceptable. For the case of detecting a gradual rise in sea level from time samples, the signal of interest has extremely low frequency components (e.g. a decadal sea level change would have frequency components of order 1/(10 years) but the tidal frequency components are of order 1/(1 day)). In addition, the magnitude of the tidal frequency component is many orders of magnitude greater than the decadal global change signal. 6.3 Relevant MATLAB Commands: Plotting power spectra: Given a time dependent signal x and its corresponding time support t=Tbegin:Ts:Tend, the power spectrum of x can be plotted using

fstep = 1/(Tend – Tbegin); fmax = 1/(2*Ts); f = 0:fstep:fmax; xfreq = fft(x); plot (f, 20*log10(abs(xfreq(1:M/2))));

where x is assumed to be defined earlier in the program and where M=length(t). Low pass filtering: Given a time dependent signal x and its corresponding time support t, the signal can be low pass filtered by zeroing out all of its frequency components above a particular threshold, f_lpf,. The result is a new signal, x_lpf, with the same time support as x but no frequency components above f_lpf.

xfreq = fft(x); for n = 1:length(xfreq)

Page 39: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 6. Tidal Aliasing

The University of Michigan, All rights reserved 34

if n < f_lpf xfreq_lpf(n) = xfreq(n); elseif (length(xfreq) - n) < (f_lpf - 1) xfreq_lpf(n) = xfreq(n); else xfreq_lpf(n) = 0; end end x_lpf = real(ifft(xfreq_lpf));

Sub Sampling: Given a time dependent signal x, the signal can be sub-sampled every Msub samples. The result is a new signal, x_sub, with a scaled version of x every Msub samples and zero for every other sample. x_sub is scaled by Msub in order to maintain the same power as x.

x_sub = zeros(size(x)); for n=1:round(length(x)/Msub) x_sub(n*Msub - n0) = Msub*x(n*Msub - n0); end

where n0 is an arbitrary offset between 0 and Msub-1. Running average: Given a time dependent signal x, a new signal can be formed that is the running average of x over Mavg samples. The result is a new signal, x_avg, with the same time support as x.

for n = 1:Mavg h(n) = 1/Mavg; end x_avg = filter(h,1,x);

6.4 Demonstrations During the Lab Session:

• Power spectra and their relationship to time series • Frequency domain low pass filtering • Aliasing – time and frequency domain perspectives

6.5 Laboratory Assignment: 6.5.1 Download from the coursetools web site the file “Lab6_1.txt” which contains measurements of sea level made hourly by a buoy in Honolulu Harbor on the island of Oahu in Hawaii between January 6, 2005 at 00:00 UTC and January 31, 2005 at 23:00 UTC. View the header lines to understand the format of the file. Read the data into MATLAB and form two vectors, a time vector, t, defined by

Ts = 1/24; % time step is 1 hour in units of days

Page 40: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 6. Tidal Aliasing

The University of Michigan, All rights reserved 35

t = 6:Ts:32-Ts; % 01/06/05@00:00 to 01/31/05@23:00 UTC and a vector, x, of the sea level height relative to mean sea level at each of those times.

• Plot x versus t. Label axes and include a title and figure number. • What is the frequency increment between samples of the FFT derived from x?

What is the maximum frequency component that can be determined? • Plot the power spectrum of x versus frequency over the range 0 < f < fmax.

Label axes and include a title and figure number. • What are the dominant frequency components in the power spectrum? What are

the periods that correspond to these frequencies? 6.5.2 Low pass filter the signal, x, by zeroing out all frequency components that are higher than 0.5 cycles/day. Call the new signal x_lpf.

• What is the MATLAB index of the highest frequency component of x that is not zeroed out?

• Plot the power spectrum of x_lpf versus frequency over the range 0 < f < 1 cycle/day. NOTE: The horizontal axis must be rescaled. Your plot should be zero between 0.5 < f < 1 if you have performed the low pass filter properly. Label axes and include a title and figure number.

• Plot x_lpf versus t. Label axes and include a title and figure number. • What trend, if any, can you see in sea level over the course of January 2005? This

trend was generated using the finest possible (hourly) data sampling and should be considered our “gold standard” against which to compare all other attempts to determine a monthly trend.

6.5.3 Performing a running average on the signal, x, over a time of 2 days. Call the new signal x_avg. x_avg should have the same time support as x.

• How many MATLAB samples of x must be averaged together to perform the 2 day running average?

• Plot x_avg versus t. Label axes and include a title and figure number. • Plot the power spectrum of x_avg versus frequency over the range 0 < f <

fmax. Compare it to the power spectrum plotted in 6.5.1. Comment on any similarities or differences.

• Plot the power spectrum of x_avg versus frequency over the range 0 < f < 1 cycle/day. Compare it to the power spectrum plotted in 6.5.2. Comment on any similarities or differences.

6.5.4 Sub-sample the signal, x_avg, once per day. Call the new signal x_avg_sub. x_avg_sub should have the same time support as x_avg and should have values of zero for 23 out of every 24 samples.

Page 41: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 6. Tidal Aliasing

The University of Michigan, All rights reserved 36

• Plot the power spectrum of x_avg_sub versus frequency over the range 0 < f < 1 cycle/day. Compare it to the power spectra plotted in 6.5.2 and 6.5.3. Comment on any similarities or differences. Is x_avg_sub, with samples taken once per day, Nyquist sampled or not? Why?

• Low pass filter the signal, x_avg_sub, by zeroing out all frequency components that are higher than 0.5 cycles/day. Call the new signal x_avg_sub_lpf. Plot x_avg_sub_lpf versus t. Label axes and include a title and figure number.

• What trend, if any, can you see in the sea level estimated from x_avg_sub_lpf over the course of January 2005? How does this trend compare to the “gold standard”? This is an example of a trend derived from daily samples of a signal that was averaged for 2 days.

6.5.5 Sub-sample the original signal, x, once per day. Call the new signal x_sub. x_sub should have the same time support as x and should have values of zero for 23 out of every 24 samples.

• Plot the power spectrum of x_sub versus frequency over the range 0 < f < 1 cycle/day. Compare it to the power spectra plotted in 6.5.2, 6.5.3 and 6.5.4. Comment on any similarities or differences. Is x_sub, with samples taken once per day, Nyquist sampled or not? Why?

• Low pass filter the signal, x_sub, by zeroing out all frequency components that are higher than 0.5 cycles/day. Call the new signal x_sub_lpf. Plot x_sub_lpf versus t. Label axes and include a title and figure number.

• What trend, if any, can you see in the sea level estimated from x_sub_lpf over the course of January 2005? How does this trend compare to the “gold standard”? This is an example of a trend derived from daily samples of a signal that was averaged for 1 hour.

6.5.6 Include a cover page for your lab report and a summary page that describes what you did and how the report is organized. Include a list of all appendices containing MATLAB source code.

Page 42: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

The University of Michigan, All rights reserved 37

Lab 7: Wave Propagation in Dispersive Media

7.1 Goals: This laboratory will introduce you to the concept of dispersive media and the effects they can have on waves propagating in them. You will be modeling the propagation of a localized dip in the sea level of the ocean (e.g. such as would be generated by an underwater earthquake). Dispersion is most easily modeled in the frequency domain. You will be Fourier transforming the localized dip, modifying it (in the frequency domain) with a dispersive filter, and then inverse Fourier transforming back to the spatial domain to see the distortion to the dip that is caused by dispersion. 7.2 Background: 7.2.1 Propagation in Non-Dispersive Media A medium is non-dispersive if the velocity of wave propagation in it does not vary with frequency. For example, the propagation of sound in air is fairly non-dispersive. High, low and intermediate pitched sounds all travel at approximately 344 m/s. Consider the frequency domain representation of a sound with very short duration, such as a gun shot. It will have significant power spectral density at many frequencies. One consequence of the non-dispersive property of air is that all of those frequency components will propagate at roughly the same speed. The relative frequency components of the gun shot will, then, remain the same as the sound propagates. That is why a gun shot still sounds roughly the same whether you are close to it or far away. Electromagnetic wave propagation in a vacuum is also non-dispersive. Different colors of visible light, radio waves and X-rays, all propagate at the same speed of 3x108 m/s. Propagation of visible light through water and glass is dispersive, however. Different colors travel at different speeds. That is what makes rainbows form and prisms work. Propagation of a sinusoid can be described by

A(x,t) = A0cos(ωt – kx) (7.1)

where ω is the frequency and k is the wave number. The velocity of propagation of the sinusoid is given by

v = ω/k (7.2)

Note that if the wave number is linearly dependent on frequency, then the velocity is independent of frequency and the medium is non-dispersive. Sinusoidal waves have a single frequency component and extend over all space. Localized disturbances, on the other hand, have multiple frequency components and are localized in space. Consider a localized dip in the ocean that is formed at time t=0. Let p(x) be an idealized one-dimensional model for such a dip, as shown in Figure 7.1.

Page 43: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 7. Wave Dispersion

The University of Michigan, All rights reserved 38

Figure 7.1 One-dimensional model for a localized dip in sea level. The dip is centered at x = -1 at time t = 0. If the dip were to propagate to the right in a non-dispersive medium, it could be described at some later time, t, by

q(x,t) = p(x – vt) (7.3)

where v is the velocity of propagation. Eqn. (7.3) will simply slide p(x) to the right by a distance vt. Consider the Fourier transform of q(x,t) with respect to the variable x

∫∫∞

∞−

∞−

−== dxevtxpdxetxqtkQ jkxjkx )(),(),( (7.4)

The variables x and k in eqn. (7.4) are called a conjugate transform pair. k should be considered the “spatial frequency domain” variable that corresponds to position, x, in the “spatial domain”. This is exactly analogous to the conjugate transform pair t and ω in the “time domain” and the “frequency domain”, respectively. In the conventional frequency domain, ω denotes radian per second and f = ω/2π denotes cycles per second. Similarly in the spatial frequency domain, the wave number, k, denotes radian per meter and k/2π denotes cycles per meter. There isn’t a standard variable used for cycles per meter as there is for frequency, but there is a standard variable used for meters per cycle. It is λ = 2π/k and is called wavelength. Perform a change of variables to the right hand integral of eqn. (7.4) by letting x’ = x – vt. Then

jkvtjkvtxjk ekPxdeexptkQ )()(),( =′′= ∫

∞−

′ (7.5)

Page 44: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 7. Wave Dispersion

The University of Michigan, All rights reserved 39

where P(k) is the Fourier transform of the original function, p(x). Eqn. (7.5) states that the Fourier transform of the pulse after it has moved a distance vt is the same as the original Fourier transform except that the phase at each frequency has been rotated by an angle kvt radian. A displacement in the spatial domain and a phase shift in the frequency domain are just different ways of mathematically describing the same phenomenon. It is very important to note that the phase rotation, kvt, is linearly proportional to the spatial frequency, k, provided that the velocity, v, does not depend on k. It is for this reason that non-dispersive media are often also referred to as linear phase media. 7.2.2 Propagation in Dispersive Media A dispersive medium is one in which the velocity of propagation does depend on frequency. The dispersion relation for propagation in a particular medium describes the dependence of velocity on frequency. Suppose that relationship is known. Suppose also that the Fourier transform of the signal is known at time t=0. Each frequency component of the signal will propagate at its own velocity, v(k). Each frequency component will get phase shifted after time, t, by an amount kv(k)t. The resulting signal, in the spatial domain, can be reconstructed from its individual frequency components by an inverse Fourier transform, or

∫∞

∞−

−= dkeekPtxq jkxtkjkv )()(),( (7.6)

Note that if v(k) is a constant in eqn. (7.6), then the result will simply be q(x,t) = p(x – vt) as before. However, if the velocity is not independent of k, then q(x,t) will not be a simple translation of the original signal. It will get distorted. The physical mechanism behind the distortion is illustrated by the behavior of a smooth water surface when a pebble is dropped in the middle. The pebble causes a sudden, localized dip in the water surface at time t=0. The localized dip contains many frequency components. On a water surface, disturbances propagate dispersively. Longer wavelengths (smaller spatial frequencies) propagate faster. The first ripples that travel out from the pebble fastest will have long wavelengths. Later, slower ripples will have shorter wavelengths (higher spatial frequencies). The net effect is that the simple localized dip in the water surface that was originally caused by the pebble does not move across the surface with the same shape. Instead, it is distorted into a composite of different wavelengths traveling at different speeds. Such media are called dispersive because localized disturbances like this dip tend to spread out, or disperse, over time. 7.2.3 The Dispersion Relation for the Deep Ocean Waves in the ocean propagate according to the following (approximate) dispersion relation

)2tanh(2 λ

ππλ dgv = (7.7)

Page 45: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 7. Wave Dispersion

The University of Michigan, All rights reserved 40

where v is the velocity of propagation, g is gravitational acceleration, λ is the wavelength of the wave, and d is the depth of the ocean. One important consequence of eqn. (7.7) is that longer waves travel faster in the ocean. This is the reason that there are precursory indicators that a tsunami is approaching before the bulk of the surface displacement arrives. The indicators are the very long wavelength components of the original displacement that have traveled fastest from the location of the underwater earthquake that generated the tsunami. We will use a simplified version of eqn. (7.7) for this lab that is valid for very deep waters (i.e. valid as ∞→d ). 7.3 Relevant MATLAB Commands: Defining spatial frequency vector: Given a one dimensional spatial signal p with support x, its spatial frequency support can be derived using the following code % define initial and final values and step size for x: xi = -2; xf = 2; xs = 0.001; x = xi:xs:xf; % construct frequency vector in same order as is returned by fft: fs = 1/(xf-xi); fmax = 1/(2*xs); f =[0:fs:fmax,-fmax:fs:-fs]; Define a spatial signal representing a local dip in the ocean surface: The following code creates a one dimensional signal, p, that has a small dip centered at -1. It assumes that the support vector, x, has already been defined. The last line of code generates the Fourier transform of p and calls it pf. The support for pf is the vector f defined above. no_p = 1; p_peak = 0.3; p_center = -1; p_width = 0.1; for n=1:length(x) p(n) = no_p - p_peak*exp(-((x(n)-p_center)/p_width)^2); end pf = fft(p); Propagate signal in spatial domain assuming non-dispersive medium: The following code generates duplicates of the original signal, p(x), at new positions, assuming the dip in p is propagating to the right at a constant velocity. It assumes that p(x) has already been defined and that xs is the step size between elements of the support vector, x. % define time steps for signal propagation: t = 0:4:8; % ideal (non-dispersive) velocity of propagation: v_nondisp = 0.1; %increment time and compute propagation in spatial domain: for nt=1:length(t) deltanx = round(v_nondisp*t(nt)/xs); p1(nt,:)=no_p*ones(size(p)); p1(nt,[deltanx+1:length(p)])=p([1:length(p)-deltanx]); end plot (x,p1)

Page 46: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 7. Wave Dispersion

The University of Michigan, All rights reserved 41

Define a dispersion relation: The following code creates a variable vdisp that represents the velocity at each spatial frequency. The support of vdisp is the vector f defined above. % Define the dispersion relation: vdisp(1) = 0; %special case for frequency = 0 for nf=2:length(f) vdisp(nf) = .3/(abs(f(nf))^0.5); %dispersion relation for v vs. f % vdisp(nf) = v_nondisp; %non-dispersive case end Propagate signal in spatial frequency domain with arbitrary dispersion relation: The following code propagates each individual frequency component of a signal according to its individual velocity. It assumes that the Fourier transform of the signal already exists as pf. The resulting signal is reconstructed in the spatial domain by the ifft command. The support of the reconstructed signal, p2, is x. %increment time and compute propagating signal in arbitrary medium: for nt=1:length(t) phi2=2*pi*f.*vdisp*t(nt); pf2(nt,:)=pf.*exp(-j*phi2); p2(nt,:) = real(ifft(pf2(nt,:))); end 7.4 Demonstrations During the Lab Session:

• Fourier conjugate pairs of variables; their support of signals • Propagation, spatial displacement and frequency domain phase shifts • Phase rotation in the complex plane

7.5 Laboratory Assignment: 7.5.1 Generate the one dimensional ocean dip signal (designated as p in Section 7.3) in MATLAB. Compute the Fourier transform of p using the MATLAB fft command and call it pf. Determine the highest frequency in the support of pf. It is determined by the step size in x, the support of p. What is the highest frequency in pf above which there is no significant information? You should view the spectrum on a log scale in order to be able to distinguish between legitimate low level spectra (which contributes to the shape of the signal) and the background numerical noise floor (which is caused by MATLAB round off errors and doesn’t affect the shape of the signal). Adjust the step size in x so that pf is only sampled up to the highest necessary frequency. Maximizing the step size in x like this will make MATLAB run faster and more efficiently.

• Plot p versus x over the range -2 < x < 2. • Plot pf versus f over the range 0 < f < fmax. Use a log scale. • What is the largest step size in x for which all significant frequency components

of p are represented by its fft? What is the highest frequency that needs to be sampled for pf?

Page 47: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 7. Wave Dispersion

The University of Michigan, All rights reserved 42

7.5.2 Move p(x) to the right (i.e. increasing x) using the spatial domain propagator from Section 7.3. Assume a non-dispersive propagation velocity of 0.1 and time increments of t = 0, 4 and 8.

• Plot all 3 versions of p(x), at t = 0, 4 and 8, on the same plot. There should be no distortion in the dip, only displacement.

• Compare the spectrum of p(x) at t=0 with that at t = 4. What are the phase and amplitude of the two spectra at fs = 1/(xf-xi) and at 2fs? You should print out the numerical value of the spectra at these two frequencies (both real and imaginary parts) and not rely on the plots to determine this. Verify eqn. (7.5) by comparing the phase and amplitude of the spectrum at these two frequencies. In your answer: a) specifically state what values you use for each variable in eqn (7.5); b) plug in the numbers to calculate the phase shift predicted by theory at both frequencies; c) using the spectrum of p(x) computed by MATLAB, determine the difference in phase between the t=0 and t=4 components at both frequencies; d) compare the results.

7.5.3 Define a non-dispersive velocity vector (designated as vdisp(nf)=v_nondisp in Section 7.3) that is equal to 0.1 for all frequencies. Propagate p(x) using the spatial frequency domain propagator from Section 7.3. Assume time increments of t = 0, 4 and 8.

• Plot all 3 versions of p(x), at t = 0, 4 and 8, on the same plot. This propagation was computed in a completely different way than Section 7.5.2. Compare the results. Is there any distortion in the dip using this spatial frequency domain propagator?

7.5.4 Define a velocity vector that satisfies the ocean-like dispersion relation

||3.0f

v = (7.8)

defined over the support of pf. Propagate p(x) using the spatial frequency domain propagator from Section 7.3. Assume time increments of t = 0, 4 and 8.

• Plot all 3 versions of p(x), at t = 0, 4 and 8, on the same plot. This propagation includes realistic distortion effects caused by the ocean. Describe the distortion and relate it back to the nature of the dispersion.

• The original plots of p(x) without distortion spanned the range -2 < x < 2. This range was sufficient to show the location and shape of the dip as it propagated in a non-dispersive medium. In the dispersive medium described by eqn. (7.8), is this range still sufficient? If it is not, expand the range until you have fully captured the leading edge of the dip as it propagates.

• Imagine that you are sitting on a beach at x = 2. Describe the change in sea level you would experience as time elapses. Compare this with what you would experience if the propagation were not dispersive. Discuss how you experience is

Page 48: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 7. Wave Dispersion

The University of Michigan, All rights reserved 43

related to the precursor phenomenon associated with tsunamis (in which the tide appears to go far out immediately before one arrives).

7.5.5 Include a cover page for your lab report and a summary page that describes what you did and how the report is organized. Include a list of all appendices containing MATLAB source code.

Page 49: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

The University of Michigan, All rights reserved 44

Lab 8. Detection of El Niño Precursor Waves

8.1 Goals: This laboratory will make use of lag correlations to detect and estimate the motion of an El Niño precursor wave in the tropical Pacific Ocean prior to the onset of the El Niño event that occurred during Jan-April 1998. Two other MATLAB tools will be developed to aid in the analysis. One is a method for importing GIF image files into MATLAB as numeric arrays for quantitative processing. The other is a form of error analysis based on Monte Carlo simulation. 8.2 Background: 8.2.1 The El Niño Southern Oscillation (ENSO) In normal, non-ENSO, years, the prevailing trade winds in the tropical Pacific Ocean blow from east to west. The winds tend to push the sea water near the surface toward the west. These equatorial waters have been significantly warmed by the sun and so a strong east-west gradient in sea surface temperature results. For example, it is common for there to be approximately an 8 C difference between the equatorial waters near Indonesia and those off the west coast of Ecuador, with Indonesia warmer. Another consequence of the westward driven equatorial waters is a gradient in sea level. Under normal conditions, sea level in the western tropical Pacific is approximately 50 cm higher than it is near South America. During an El Niño event, the easterly trade winds weaken significantly. This typically begins in the later summer or fall of the year preceding an El Niño. As the trades weaken, the flow of warm surface water from east to west decreases. This causes the bulge in sea level in the west to relax and the temperature gradient to drop. Sea surface temperatures off the coast of South America rise significantly. From warmer waters come greater evaporation and precipitation during the winter and early spring. Very significant flooding can and often does result, from South America to as far north as Southern California. The change in sea level that occurs during the late summer and fall prior to an El Niño year is not in and of itself especially significant. (It is the change in sea surface temperature that most immediately impacts changes in the weather.) However, the shifting bulge in equatorial Pacific sea level is a useful precursor characteristic that can give advance warning of the impending arrival of an El Niño the following winter or spring. Global sea level images, obtained by satellite radar altimeters, can be used as an early warning that an El Niño is coming. An orbiting altimeter determines the sea level immediately below the satellite by precisely measuring the round trip time of flight of a radar signal reflected by the ocean surface. That specifies the distance between the satellite and the ocean. Orbital mechanics is used to determine the distance from the satellite to the center of the Earth. The difference between these two numbers is the sea level. After crisscrossing the globe in low earth orbit, a global map of the sea level is generated. It takes approximately 10 days to complete one of these maps.

Page 50: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 8. El Niño Detection

The University of Michigan, All rights reserved 45

Figure 8.1. Average sea level in the Pacific Basin during October 1997 as determined by the NASA Jason altimeter. In this lab, you will use altimeter images of sea level in the Pacific Ocean during the fall of 1997 (such as the one shown in Figure 8.1) to estimate the movement of a precursor wave of anomalously high sea level that propagated from west to east, prior to the onset of a strong El Niño event in the winter and spring of 1998. You will be asked to estimate the velocity of the wave as it moves across the Pacific by a technique known as Peak Lag Correlation. 8.2.2 Peak Lag Correlation and Motion Detection Read Section 2.2.2 of the EECS 206 Lab Manual on Running Correlation. Suppose you are given two signals, p1 and p2, which resemble each other except that they are shifted relative to one another. For example, the signals may represent the height of the ocean at different times during the precursor development of an El Niño event. You are interested in estimating how much of a shift has occurred between the two signals. If, in addition to shifting, the signal has changed shape to some extent, then estimating the shift may not be as simple as sliding one until it matches the other. Instead, a lag correlation analysis will estimate how correlated one signal is with a shifted version of the other. If the signals are not identical, then the correlation will drop below 100%. Peak lag correlation searches for the maximum correlation between one signal and a shifted version of the other. If the time between measurements of the two signals is known and the shift required to peak the lag correlation is determined, then the velocity of the dominant features in the signal can be simply estimated as

velocity = (shift for peak lag correlation)/(time between two signals) (8.1)

Note in eqn. (8.1) that the shift for peak lag correlation must be in units of distance, not in units of a MATLAB index. 8.2.3 Monte Carlo Trials and Error Analysis Once a numerical tool such as peak lag correlation has been developed, it is usually a good idea to determine how well it works by some form of error analysis. With

Page 51: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 8. El Niño Detection

The University of Michigan, All rights reserved 46

numerical tools that are based on relatively simple (often linear) mathematical relationships between the input data and the output estimates, the dependence of the error in the output on noise in the input can be done analytically using concise statistical relationships. With a numerical tool as complicated as peak lag correlation, it is often more convenient to use an approximate method of error analysis. One very useful and popular way to do this is by Monte Carlo trials. In the Monte Carlo approach, a number of realizations of the input data are generated in software by perturbing it with simulated noise. The numerical tool is then applied to each of the realizations. Each application of the tool is referred to as a Monte Carlo trial. Each trial produces an output estimate. Since the input is being varied (by the simulated noise), the output will also vary. The relationship between the input noise and the output variation can be analyzed statistically to estimate an error model for the numerical tool. In our case, we will be adding gaussian noise to the two signals that are to be lag correlated. We will then exam how the peak correlation value and the location of the peak change as a function of the level of noise. This will give us a relationship between the sensitivity of our peak lag correlation tool and the noise in the input data. 8.3 Relevant MATLAB Commands: Additive White Gaussian Noise: Suppose two offset pulse vectors, p1 and p2, are defined according to:

xi = -2; xf = 2; xs = 0.01; x = xi:xs:xf; % Create pulses at t=-1 & 1 p_width = 0.2; p1_center = -1; p2_center = 1; for n = 1:length(x) p1(n) = exp(-((x(n) - p1_center)/p_width)^2); p2(n) = exp(-((x(n) - p2_center)/p_width)^2); end

This code generates a signal, p2, that is identical to p1 except that it is shifted to the right by ∆x = 2. Therefore, a lag correlation of p1 with p2 should clearly identify a peak when p2 is shifted to the left by ∆x = 2 (i.e. by a shift to the left in the index for p2 by ∆x/xs = 200). Suppose that p1 and p2 are corrupted by additive white gaussian noise with a standard deviation of stdev. This could be represented in MATLAB by adding the following four lines to the above code:

stdev = ***ENTER SOME NUMBER HERE*** p1noise = p1 + stdev*randn(size(p1)); p2noise = p2 + stdev*randn(size(p2));

Page 52: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 8. El Niño Detection

The University of Michigan, All rights reserved 47

The MATLAB command randn is a gaussian random number generator. The new vectors, p1noise and p2noise, represent noisy versions of the two signals, p1 and p2. A peak lag correlation should still be able to identify the shift between them, provided the additive noise level is not too high. Peak Lag Correlation: Given two MATLAB vectors, p1 and p2, their lag correlation can be computed by

nx = length(x); for nlag = 1:maxlag % Generate shifted p2 as p2lag: p2lag(nlag,1:nx-nlag+1) = p2(nlag:nx); for nx2=nx-nlag+2:nx p2lag(nlag,nx2) = p2(nx); end end % Correlate p2lag with p1: rlag = corrcoef([p1;p2lag]'); [corr_max index_max] = max(rlag(1,2:maxlag));

where corr_max is the maximum value of the correlation coefficient (i.e. the maximum percentage explained variance) and index_max is the value of nlag at which the maximum is achieved. For example, if index_max = 1 then p1 is most highly correlated with p2 without any shift, if index_max = 2, then p1 is most highly correlated with p2 after a shift to the left of one index unit, etc. (Note that p2 is assumed to continue to the right of its range of support with a constant value.) Reading Images into MATLAB Arrays: The imread MATLAB command will open a GIF image file and interpret it as an array of numeric values according to the rows and columns of the image. The values can then be assigned to a MATLAB array variable for quantitative analysis. For example, the command

p1in = double(imread('199710_SSH.gif')); will initialize the array p1in with floating point values corresponding to the image file 199710_SSH.gif. The result can then be displayed within MATLAB by the command

imagesc(p1in);colormap(gray);axis image;colorbar where a grayscale image has been selected to make black & white printouts more intelligible. 8.4 Demonstrations During the Lab Session:

• Importing a GIF file & manipulating its array representation inside MATLAB

Page 53: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 8. El Niño Detection

The University of Michigan, All rights reserved 48

• Peak lag correlation with and without noise • Monte Carlo trials and numerical error analysis

8.5 Laboratory Assignment: 8.5.1 Generate two signals in MATLAB that are defined by

2]/)1[()(1 wxxexp −−= and

2]/)2[()(2 wxxexp −−= (8.2) where x1 = -1, x2 = +1, and w = 0.2, and where the support of both signals is -1 < x < +2 and the step size for x is 0.01.

• Plot p1 and p2 versus x Generate a noisy version of p1 and p2, called p1noise and p2noise, by adding gaussian random noise to each element of the two vectors in MATLAB. Assume the standard deviation of the noise is 0.5.

• Plot p1noise and p2noise versus x 8.5.2 Define a lag version of p2 by

>+<++

=2)2(2

2)(2),(2

xlagxifpxlagxifxlagxp

xxlaglagp (8.3)

where xlag is the amount that p2 is shifted to the left. Compute the correlation coefficient between p1and p2lag as a function of xlag. (See eqn. (2.4) for a definition of correlation coefficient.)

• Plot the correlation coefficient versus xlag for 0 < xlag < 3. • At what value of the MATLAB index for xlag is the correlation coefficient a

maximum? At what value of xlag is it a maximum? • What is the value of the correlation coefficient at its maximum? • Look at the plots of p1 and p2 in section 8.5.1. Do your values for the peak lag

correlation of p1 and p2 make sense? 8.5.3 Repeat all of Section 8.5.2 using p1noise and p2noise. 8.5.4 Estimate the sensitivity of the peak lag correlation of p1noise and p2noise to the standard deviation of the additive noise by using Monte Carlo trials. Vary the standard deviation of the noise from 0.1 to 1.0 in steps of 0.1. For each value of the standard deviation: 1) Generate 100 realizations of p1noise and p2noise with independent (i.e. different) noise added each time; 2) Apply the peak lag correlation algorithm to each realization, resulting in 100 versions of the maximum correlation coefficient and 100 versions of the lag at which the maximum occurred. These are the Monte Carlo trials; 3)

Page 54: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 8. El Niño Detection

The University of Michigan, All rights reserved 49

Compute the average of the 100 versions of the maximum correlation coefficient; 4) Compute the standard deviation of the 100 versions of the lag at which the maximum occurred –this is the error resulting from the noise.

• Plot the average maximum correlation coefficient versus the standard deviation of the noise.

• Plot the error in the lag at which the maximum correlation coefficient occurred versus the standard deviation of the noise.

• How large can the standard deviation be before the maximum correlation coefficient drops below 25%? What is the error in the peak lag at that value of the standard deviation?

8.5.5 Open the three GIF image files 199710_SSH.gif, 199711_SSH.gif, 199712_SSH.gif into MATLAB as arrays. The files can be found on the coursetools web site. These files are images of the sea level measured by the NASA Jason altimeter during October, November and December of 1997, respectively. The MATLAB arrays should have dimensions of 220 rows x 220 columns. Extract the portion of the images that corresponds to the equatorial Pacific and assign them to new arrays. The portion of the images in question runs from row 131 to 140 and from column 41 to 200. For example, the MATLAB code

p1sub = p1in(131:140,41:200); p2sub = p2in(131:140,41:200); p3sub = p3in(131:140,41:200);

will extract the relevant part of the arrays p1in, p2in, and p3in and assign them to the arrays p1sub, p2sub, and p3sub.

• Generate a grayscale images of p1in. • Generate grayscale images of p1sub, p2sub, and p3sub. Verify that they

have been extracted from the original arrays in the appropriate equatorial Pacific region.

• Perform a peak lag correlation between p1sub and p2sub independently for each row. Take the average over the ten rows of the maximum correlation coefficient and the lag at which the maximum correlation coefficient occurred. What are the averages? Estimate the velocity of the El Niño precursor wave during October-November 1997.

• Repeat for p2sub and p3sub. Estimate the velocity of the El Niño precursor wave during November-December 1997.

8.5.6 Include a cover page for your lab report and a summary page that describes what you did and how the report is organized. Include a list of all appendices containing MATLAB source code.

Page 55: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

The University of Michigan, All rights reserved 50

Lab 9. Stratospheric Ozone Depletion

9.1 Goals: This laboratory will draw on a number of the MATLAB tools that you have learned in previous labs to examine a twenty year time record of vertically integrated ozone concentration in the atmosphere above the South Pole. The objective is to detect and characterize the decrease in stratospheric ozone concentration during austral spring 9.2 Background: 9.2.1 Stratospheric Ozone The troposphere is the region of the atmosphere nearest the Earth surface. It is characterized by a general decrease in air temperature with increasing altitude due to the increase in distance from the Earth surface, which acts as a source of radiant energy. Above the troposphere is the tropopause, which is characterized by a relatively constant air temperature profile due to a balance between energy sources above and below it. The stratosphere is the region of the upper atmosphere immediately above the troposphere and tropopause. It is characterized by an increase in air temperature with altitude due in large part to absorption of incoming solar ultraviolet (UV) radiation by ozone. The troposphere typically extends from the surface up to 8-18 km altitude. Tropospheric depths are greatest in the tropics and generally decrease with increasing latitude. The tropopause typically extends up another 5-10 km above the troposphere. Above that, the stratosphere extends to approximately 50 km altitude. Ozone (O3) is generated in the stratosphere by solar UV radiation. The solar UV breaks apart oxygen molecules (O2), which can then bond with nearby oxygen molecules to form ozone according to O + O2 = O3. The “ozone layer” within the stratosphere is a region of highest ozone concentration. It typically resides between 17 and 35 km altitude and contains approximately 90% of the total vertically integrated column of ozone. Ozone strongly absorbs the same portion of the UV spectrum that is especially harmful to humans by causing skin cancer. The ozone layer in the stratosphere acts as a protective barrier between the sun and life below it. Any significant decrease in stratospheric ozone concentration will result in an increase in the damaging solar UV that reaches the ground. 9.2.2 Ozone Depletion Prior to the 1960s, the stratospheric ozone concentration was generally in balance. The solar UV generation mechanism was balanced by natural chemical depletion mechanisms, of which there are many. The balance began to shift as very efficient new depletion mechanisms were created by the introduction into the stratosphere of manmade chlorocarbons and chlorofluorocarbons. Chlorocarbons are very common ingredients in many industrial solvents. Chlorofluorocarbons are commonly used as a refrigeration coolant and, until very recently, as a propellent used in aerosol cans. Once introduced into the atmosphere, both classes of molecules tend to persist for extremely long periods

Page 56: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 9. Stratospheric Ozone Depletion

The University of Michigan, All rights reserved 51

of time. This is in large part because they do not readily dissolve in water and so are not easily removed by rain and humidity. Eventually, the molecules can work their way up into the stratosphere by convection, diffusion and other transport mechanisms. Once there, they become exposed to solar UV radiation, which breaks their bonds and releases atoms of chlorine. Chlorine is extremely efficient at depleting ozone from the atmosphere. A single chlorine molecule can initiate a catalytic cycle capable of removing up to 100,000 ozone molecules. The catalytic cycle that allows chlorine molecules to destroy ozone so efficiently requires a solid surface on which the reactions can take place. Such a surface can be supplied by stratospheric ice clouds. Such clouds can only form in abundance under very cold conditions. The coldest stratospheric temperatures on Earth tend to occur over Antarctica in the winter. The ozone hole that forms in early spring over Antarctica results from a combination of the presence of stratospheric ice clouds and of solar UV. The ozone hole can fill back in later in the spring, as the stratosphere warms and the ice clouds dissipate. However, it is also not uncommon for its effect to be felt as far north as Australia and South America. Forecasting of solar UV danger levels has become a commonplace aspect of weather reports in these parts of the world during austral spring. A series of international treaties and protocols was instituted during the late 1980s and early 1990s that have largely eliminated the use of the most damaging types of chlorocarbons and chlorofluorocarbons from industrial use. As a result, concentrations of chlorine in the stratosphere, which had been growing steadily throughout the 1970s and 1980s, appear to have peaked in 1998 and are now falling. It is expected that the ozone layer should return to its earlier state of balance in about another 50 years, once the chlorine concentration has dissipated back to its original level. 9.2.3 Monitoring Ozone Concentration A very concerted effort has been made over the past several decades to closely monitor both ozone concentrations in the stratosphere as well as those of other molecules that are associated with the anthropogenic ozone depletion mechanisms. Both ground and satellite based sensors are constantly in operation for this purpose. One of the earliest such monitoring instruments is the Dobson Ozone Spectrophotometer, which can measure the total vertically integrated concentration of ozone in a column extending from the surface to the top of the atmosphere. Column ozone is derived from observations of the solar intensity reaching the surface at frequencies near absorption lines of the ozone molecule. The NOAA/Climate Monitoring and Diagnostics Lab (CMDL) operates Dobson instruments at a number of polar stations, including one located at Latitude 89.99 South, Longitude 102.00 East, Elevation 2841 meters (i.e. the South Pole). The NOAA South Pole Observatory is shown in Figure 1. Measurements made there are available on line at <http://www.cmdl.noaa.gov/infodata/>. Daily total column ozone measurements made

Page 57: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 9. Stratospheric Ozone Depletion

The University of Michigan, All rights reserved 52

Figure 9.1. The NOAA/CMDL South Pole Observatory, established in 1957.

by the Dobson instrument between 1984 and 2003 have been retrieved from the NOAA/CMDL web site and posted on our coursetools web site for use in this lab. 9.3 Relevant MATLAB Commands: Extracting subsets from vectors: Suppose four vectors of the same size are given as year, month, day and ozone, where ozone(n) is the total column ozone concentration that was measured on the date day(n) month(n) year(n). You wish to create a new vector that contains the average total column ozone for a certain month of each year.

monthsub = 11 %November is the eleventh month for nyear = 1984:2003 %twenty years in data record indx = find(year==nyear & month==monthsub &ozone>0); yearsub(nyear - 1983) = nyear; ozonesub(nyear - 1983) = mean(ozone(indx)); end

9.4 Demonstrations During the Lab Session:

• NOAA/CMDL total column ozone data record 9.5 Laboratory Assignment: 9.5.1 Download the file ‘Lab9_1.txt” from coursetools. Using a text editor, read the four header lines for information about the file format. Input the data into MATLAB as the four data vectors year, month, day and ozone. Create a fifth data vector called time that has units of elapsed fractional years, using

time = year + (month - 1)/12 + (day - 1)/365.25;

• Plot ozone versus time. Label the axes correctly. • There are very many cases when ozone = 0 in the data record because no

reliable data were available. Why do you think that is?

Page 58: University of Michigan AOSS 323 – Earth System Analysis ...web.eecs.umich.edu/~aey/eecs206/eecs206/labs_aoss.pdf · AOSS manual. The format and organization of the manual is also

Lab 9. Stratospheric Ozone Depletion

The University of Michigan, All rights reserved 53

9.5.2 Compute the Fourier transform of ozone using the MATLAB fft command. Call the spectrum ozonespec. Create a vector called freq that is the support of ozonespec. It should have units of cycles per year. The vectors freq and ozonespec should have the same dimensions and they should be related such that ozonespec(n) is the Fourier transform of ozone at frequency freq(n).

• Explain exactly how you computed the minimum and maximum values and the step size of the vector freq.

• Plot ozonespec versus freq over the full range of freq. Use a 20log10(ozonespec) scale for the spectrum in order to show its dynamic range. Label the axes correctly.

• Make a second plot of ozonespec versus freq over the range 0 < freq < 10 cycles/year. Discuss the behavior of the spectrum. What are the prominent frequency components of the signal and why do you think they are?

9.5.3 Pass ozonespec through a low pass filter that zeroes out all frequency components greater than 0.2 cycles per year. This will remove much of the short time scale fluctuation in the signal due to seasonal and annual effects. Inverse Fourier transform the low pass filtered version of ozonespec to create a new time varying signal.

• Plot the low pass filtered version versus time over the full twenty years. • Discuss the behavior of the low pass filtered signal. Is it changing much over

twenty years? Pay particular attention to the long time scale changes, not to the changes that occur over a few years.

9.5.4

• Plot the monthly average total column ozone concentration over the same month for each year from 1984 to 2003. Do it for October, November, December and January.

• Discuss the behavior of these plots. Has the concentration in a particular month changed much over twenty years? Which month has the largest change? Considering the nature of the ozone depletion mechanism, why do you think that month would change the most?

9.5.5 Include a cover page for your lab report and a summary page that describes what you did and how the report is organized. Include a list of all appendices containing MATLAB source code.