1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188
|
<HTML>
<HEAD>
<TITLE>spectrum1d</TITLE>
</HEAD>
<BODY>
<H1>spectrum1d</H1>
<HR>
<PRE>
<!-- Manpage converted by man2html 3.0.1 -->
spectrum1d - compute auto- [and cross- ] spectra from one
[or two] timeseries.
</PRE>
<H2>SYNOPSIS</H2><PRE>
<B>spectrum1d</B> [ <I>x[y]file</I> ] <B>-S</B><I>segment</I><B>_</B><I>size</I>] [ <B>-C</B>[<B>xycnpago</B>] ] [
<B>-D</B><I>dt</I> ] [ <B>-N</B><I>name</I><B>_</B><I>stem</I> ] [ <B>-V</B> ] [ <B>-W</B> ] [ <B>-bi</B>[<B>s</B>][<I>n</I>] ] [
<B>-bo</B>[<B>s</B>] ]
</PRE>
<H2>DESCRIPTION</H2><PRE>
<B>spectrum1d</B> reads X [and Y] values from the first [and sec
ond] columns on standard input [or <I>x[y]file</I>]. These values
are treated as timeseries X(t) [Y(t)] sampled at equal
intervals spaced <I>dt</I> units apart. There may be any number
of lines of input. <B>spectrum1d</B> will create file[s] contain
ing auto- [and cross- ] spectral density estimates by
Welch's method of ensemble ' averaging of multiple over
lapped windows, using standard error estimates from Bendat
and Piersol.
The output files have 3 columns: f or w, p, and e. f or w
is the frequency or wavelength, p is the spectral density
estimate, and e is the one standard deviation error bar
size. These files are named based on <I>name</I><B>_</B><I>stem</I>. If the <B>-C</B>
option is used, up to eight files are created; otherwise
only one (xpower) is written. The files (which are ASCII
unless <B>-bo</B> is set) are as follows:
<I>name</I><B>_</B><I>stem</I>.xpower
Power spectral density of X(t). Units of X * X *
<I>dt</I>.
<I>name</I><B>_</B><I>stem</I>.ypower
Power spectral density of Y(t). Units of Y * Y *
<I>dt</I>.
<I>name</I><B>_</B><I>stem</I>.cpower
Power spectral density of the coherent output.
Units same as ypower.
<I>name</I><B>_</B><I>stem</I>.npower
Power spectral density of the noise output. Units
same as ypower.
<I>name</I><B>_</B><I>stem</I>.gain
Gain spectrum, or modulus of the transfer function.
Units of (Y / X).
<I>name</I><B>_</B><I>stem</I>.phase
Phase spectrum, or phase of the transfer function.
Units are radians.
<I>name</I><B>_</B><I>stem</I>.admit
<I>name</I><B>_</B><I>stem</I>.coh
(Squared) coherency spectrum, or linear correlation
coefficient as a function of frequency. Dimension
less number in [0, 1]. The Signal-to-Noise-Ratio
(SNR) is coh / (1 - coh). SNR = 1 when coh = 0.5.
</PRE>
<H2>REQUIRED ARGUMENTS</H2><PRE>
<I>x[y]file</I>
ASCII (or binary, see <B>-bi</B>) file holding X(t) [Y(t)]
samples in the first 1 [or 2] columns. If no file
is specified, <B>spectrum1d</B> will read from standard
input.
<B>-S</B> <I>segment</I><B>_</B><I>size</I> is a radix-2 number of samples per
window for ensemble averaging. The smallest fre
quency estimated is 1.0/(<I>segment</I><B>_</B><I>size</I> * <I>dt</I>), while
the largest is 1.0/(2 * <I>dt</I>). One standard error in
power spectral density is approximately 1.0 /
sqrt(<I>n</I><B>_</B><I>data</I> / <I>segment</I><B>_</B><I>size</I>), so if <I>segment</I><B>_</B><I>size</I> =
256, you need 25,600 data to get a one standard
error bar of 10%. Cross-spectral error bars are
larger and more complicated, being a function also
of the coherency.
</PRE>
<H2>OPTIONS</H2><PRE>
<B>-C</B> Read the first two columns of input as samples of
two timeseries, X(t) and Y(t).
Consider Y(t) to be the output and X(t) the input
in a linear system with noise. Estimate the optimum
f requency response function by least squares, such
that the noise output is minimized and the coherent
outpu t and the noise output are uncorrelated.
Optionally specify up to 8 letters from the set { <B>x</B>
<B>y</B> <B>c</B> <B>n</B> <B>p</B> <B>a</B> <B>g</B> <B>o</B> } in any order to create only those
output files instead of the default [all]. <B>x</B> =
xpower, <B>y</B> = ypower, <B>c</B> = cpower, <B>n</B> = npower, <B>p</B> =
phase, <B>a</B> = admit, <B>g</B> = gain, <B>o</B> = coh.
<B>-D</B> <I>dt</I> Set the spacing between samples in the time
series [Default = 1].
<B>-N</B> <I>name</I><B>_</B><I>stem</I> Supply the name stem to be used for out
put files [Default = "spectrum"].
<B>-V</B> Selects verbose mode, which will send progress
reports to stderr [Default runs "silently"].
<B>-W</B> Write Wavelength rather than frequency in column 1
of the output file[s] [Default = frequency, (cycles
/ <I>dt</I>)].
columns in the binary file(s). [Default is 2 input
columns].
<B>-bo</B> Selects binary output. Append <B>s</B> for single preci
sion [Default is double].
</PRE>
<H2>EXAMPLES</H2><PRE>
Suppose data.g is gravity data in mGal, sampled every 1.5
km. To write its power spectrum, in mGal**2-km, to the
file data.xpower, try
spectrum1d data.g <B>-S</B>256 <B>-D</B>1.5 <B>-N</B>data
Suppose in addition to data.g you have data.t, which is
topography in meters sampled at the same points as data.g.
To estimate various features of the transfer function,
considering data.t as input and data.g as output, try
paste data.t data.g | spectrum1d <B>-S</B>256 <B>-D</B>1.5 <B>-N</B>data <B>-C</B>
</PRE>
<H2>SEE ALSO</H2><PRE>
<I>gmt</I>(l), <I><A HREF="grdfft.html">grdfft</A></I>(l)
</PRE>
<H2>REFERENCES</H2><PRE>
Bendat, J. S., and A. G. Piersol, 1986, Random Data, 2nd
revised ed., John Wiley & Sons.
Welch, P. D., 1967, "The use of Fast Fourier Transform for
the estimation of power spectra: a method based on time
averaging over short, modified periodograms", IEEE Trans
actions on Audio and Electroacoustics, Vol AU-15, No 2.
</PRE>
<HR>
<ADDRESS>
Man(1) output converted with
<a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
</ADDRESS>
</BODY>
</HTML>
<body bgcolor="#ffffff">
|