TIME SERIES ANALYSIS RESOURCES
The following computer routines are available for general use by anyone with an account on the Department of Earth Sciences computer EARTH (Sun Computer - SPARC 3000 server). Executable verions can be run directly by typing ~slund/program-name; fortran source code is also available with my consultation. These routines were partly developed by me and partly downloaded from other public domain resources (sources listed where applicable).
DATA SET FORMATION:
Most of the computer programs request data input from existing computer data files. Some require simple text formats which are readily built by the investigator. Others require data stored in a specific binary data structure that I have developed for use with many of my own programs. The binary (direct access) structure is a 5xN array. Programs are listed below that let anyone move single or double column (separated by tabs or commas) text data files into a data file with binary structure.
datainput.e: This program builds a new 5xN direct-access (binary) data file or adds to an existing file. It requires an existing data set with the name temp1.dat in your current directory that has a single column of data. There must be no more than 1000 data points. The last line of the text file should contain just a CR/LF. The program will ask which column (of 5) to place the data in.
datainput2.e: This program builds a new 5xN direct-access (binary) data file or adds to an existing file. It requires an existing data set with the name temp1.dat in your current directory that has two columns of data separated by tabs or commas. There must be no more than 1000 data points. The last line of the text file should contain just a CR/LF. The program will ask which columns (of 5) to place the data in.
datview.e: This program will open a direct-access data file and view it on screen or print out the datafile. The result will go to printout.dat.
datedit.e: This program will edit individual values of a direct-access data afile.
specfft.e: This program calculates one or two fourier-based spectra and a cross spectrum. The data must be in a direct-access file; the total data set length and sample interval must be known.. When calculating a single spectrum, just use the same column of data twice. (A cross-spectrum will be calculated but it will be the same as the scalar spectra.) The program will calculate spectra for two scalar data sets, a cross spectrum, coherence, and phase. The data will be put into a text file called specfft.dat; the plots will be put into a postscript file called plot.ps.
memlin.e: This program calculates the maximum-entropy spectrum (MEM, MESA) of a scalar time series stored in a direct-access file. The total data set length and sample interval must be known. The spectra for 10 lags spread up to 1/2 the data set length are automatically caculated. The data file memlinout.dat lists the prediction error coefficients, prediction error, and spectral peaks for each lag. A separate output file memelinctr.dat is used by th program specplot.e to let the user plot any or all of the 10 spectra.
specplot.e: This program uses the output data set memlinctr.dat to produce a series of plots of the spectra generated by memlin.e. The simplest procedure is to plot all 10 spectra together on a single plot to show evolution of the spectral power with increasing lag. the output spectra are stored in plot.ps.
multitaper.e: This program calculates a scalar spectrum using the multitaper technique. The routine was provided courtesy of Professor R. L. Parker (UCSD). The program requests a series of line inputs before it executes. Needed information includes: type 'file file-name' (a column text data file), 'nterms #' (the number of data points), 'column #' (the column number which holds the data if the data file has multiple columns), 'output output-file-name', 'interval #' (sample interval), and finally 'execute'. The output file contains two columns of data - frequency and spectral power. The file must be 'ftp'ed to a PC and the data entered in a program like Kaleidagraph to plot the spectrum.
wavelet analysis: Within MATLAB, a series of routines are available to do time-evolutionary spectral analysis of scalar time series using wavelet techniques. These files come from the website http://paos.colorado.edu/research/wavelets and are a series of routines developed by C. Torrance and G. Compo ('A practical guide to wavelet analysis', Bull. Amer. Meteorol. Soc., v. 79, p. 61-77, 1998).To start, copy the following files from ~slund/matlab (it is best to put them in a separate 'matlab' subdirectory): chisquare_solve.m, chisquare_inv.m, wave_bases.m, sst.nino3.dat, wave_signif.m, wavelet.m, wavetest.m, and lund1.m. The matlab routine wavetest.m calculates the spectrum of the ENSO Southern Oscillation Index as an example. The routine lund1.m is similar but changes some of the plotting routines.
Back to Lund Home Page