
Spectrum - Power Spectrum of a Time-dependent Data Set
Description
The spectrum Baustein computes the variance spectrum of a data set and
compares it with the spectrum of an AR1 (red noise) process. First the
spectrum of the complete time series is computed. Next the timeseries is
divided into 2k+1 windows (see --windows option) of length
m (see --window-width option) and the spectra of the 2k segments
of length 2m are computed and averaged to obtain a better estimate of the
true variance spectrum. The variance spectrum of an AR(1) process
is fitted for best variance and lag one correlation to the mean spectrum.
A number a simulated AR(1) timeseries with the same length of the original
timeseries is computed (see --simulations option) and their variance
spectrum is computed. These spectra are used to calculate the user
specified percentiles at each frequency (see --bins and --confidence
options).
Note that m must be a power of two and that the timeseries should be
at least (2k+1) m timesteps long. The highest frequency that can be resolved
is 1/(2 dt) where dt is the time interval between two neighboring
data points.
Command Line Syntax
spectrum [--bins=<n>] [--confidence=<n>] [-h|--help] [-O|--overwrite] [--simulations=<n>]
[-v|--version] [--windows=<n>] [--window-width=<n>] <input-file>:<var> <output-file>
| <input-file>:<var> |
The name of the NetCDF input file and the name of the variable
in this file. |
| <output-file> |
The name of the output file. |
| Long Option |
Short Option |
Description |
| --bins=<n> |
|
The number of bins used to compute the confidence level. |
| --confidence=<n> |
|
The confidence level. |
| --help |
-h |
Print a brief description of the tool and its options. |
| --overwrite |
-O |
Overwrite the output file if it exists. |
| --simulations=<n> |
|
The number of simulated data sets generated by an AR1 process
used to compute the confidence level. |
| --version |
-v |
Show the version information of this tool. |
| --windows=<k> |
|
This option controls the number of windows used to compute the confidence
interval. The number of windows is 2k+1. |
| --window-width=<m> |
|
The width of the windows in data points. Note that m must be a power
of two. |
Examples
To compute the variance spectrum of the NINO3 index stored the NetCDF
file nino.nc and to test it against an AR(1) process with 90% confidence
you can enter the command
spectrum --confidence=90 --simulations=200 --windows=10 --window-width=50 nino.nc:NINO3 nino3-spectrum.nc