spectrum - Compute various kinds of spectra from a time series

SYNOPSIS

spectrum infile [-f nfreq] [-p npoles] [-fft] [-fn nfreq] [-w width bartlett | hamming | hanning | none] [ -v ]

DESCRIPTION

spectrum will compute the power spectrum of the time series in infile using the Maximum Entropy Method (MEM). The Toeplitz matrix of lagged covariances is estimated following Burg (1978). Optionally, it will compute the spectrum using the Fast Fourier Transform (FFT), using a choice of windows (see below). Power spectrum estimations via FFT are currently made using the correlogram approach of Blackman and Tukey (1958); see also Kay (1988). The confidence intervals are obtained via the inverse chi-squared distribution with two degrees of freedom.

infile The file containing a scalar time series.

OPTIONS

-f nfreq
The number of frequencies to output for the MEM spectrum. nfreq is equal to the number of data points if the user does not specify it. spectrum writes the MEM spectrum to a file named mem.out. mem.out contains two columns: Column One lists the frequencies and Column Two lists the power spectral density at each frequency.
-p npoles
The number of poles to use in the MEM calculation [Default: 10].
-fft
Selects FFT option. If not present, only MEM is calculated. The FFT spectrum is written to a fill named fft.out with the following format: column 1: frequency; column 2: lower 95% confidence interval; column 3: power spectral density; column 4: upper 95% confidence interval.
-fn
Number of Fourier frequencies to calculate. This number should be a power of two. [Default: 64]
-w width type
Window the data before calculating the spectrum to minimize spectral leakage. width specifies the width of the window [Default: no windowing is done]. Type can be one of the following: bartlett specifies Bartlett window, hamming the Hamming window, hanning the Hanning window, and none specifies no window.
-v
Selects verbose mode, which will send progress reports to stderr [Default runs "silently"].

EXAMPLES

Given a time series in tseries.dat with 512 points, calculate the MEM power spectrum using 20 poles:
spectrum tseries.dat -p 20
Given a time series in tseries.dat, calculate the MEM power spectrum using 75 poles, over 2500 frequencies between 0 and the Nyquist frequency (0.5), and compute the FFT spectrum using 256 frequencies and a Hamming window of width 100:
spectrum tseries.dat -p 75 -f 2500 -fft -fn 256 -w 100 hamming

SEE ALSO

spectra(1), ssa(1)

REFERENCES

Burg, J. P., 1978: A new technique for time series data. In Modern Spectrum Analysis, D. G. Childers (ed.), pp. 42-48, IEEE Press, N.Y.

Press, W. H., B. P. Flannery, S. A. Teukolsky, and W. T. Vetterling, 1986: Numerical Recipes, Ch. 12, (Cambridge Press, Cambridge)

Thomson, D. J., 1982: Spectrum estimation and harmonic analysis, Proc. IEEE, 70, 1055-1096.