\HeaderA{spect}{SPECTRAL DENSITY ESTIMATION}{spect}
\begin{Description}\relax
This is essentially a wrapper function for \code{spectrum} from
the \pkg{stats} package. Thus, it is important the user be
familiar with the documentation of the functions listed in the
\sQuote{See Also} section. This is simply a quick way to compute the
spectra of \code{"rsac"} class objects.
\end{Description}
\begin{Usage}
\begin{verbatim}
spect(x, plot = TRUE, main = NULL, log = "no", ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] an object of class \code{"rsac"}.
\item[\code{plot}] logical for if the spectrum should be plotted.
\item[\code{main}] optional character vector for the plots' titles. If not
provided, the code creates the character vector from the station,
component, and network in the header files, but these are not always
reliable. The length of the vector must equal the length of
\code{x}.
\item[\code{log}] See \code{\LinkA{plot.spec}{plot.spec}}.
\item[\code{...}] further parameters. See \code{\LinkA{spectrum}{spectrum}} and
\code{plot.spec}.
\end{ldescription}
\end{Arguments}
\begin{Value}
a vector of objects, each object is of \code{"rsac"}.
\end{Value}
\begin{Author}\relax
Eric M. Thompson \textless{}eric.thompson@tufts.edu\textgreater{}
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{spectrum}{spectrum}}, \code{\LinkA{plot.spec}{plot.spec}},
\code{\LinkA{spec.pgram}{spec.pgram}}, \code{\LinkA{spec.ar}{spec.ar}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}

data(srosa)
data(sumatra)

eqs <- c(srosa[1], sumatra[11])

spect(eqs)

spect(eqs, spans = 101)

spect(eqs, spans = 201)

spect(eqs, spans = c(101, 151))

spect(eqs, spans = c(101, 151),
      log = "yes")

getdelta <- function(X){
  delta <- gcp(s = list(lat = X$stla, lon = X$stlo),
               e = list(lat = X$evla, lon = X$evlo))$a}
del <- sapply(X = sumatra, getdelta)

sum <- sumatra[c(1, 3, 4, 9)]

spect(sum, plot = TRUE, spans = c(101, 151),
      log = "no", xlim = c(0, 0.15))

\end{ExampleCode}
\end{Examples}

