spect {Rsac}R Documentation

Spectral density estimation

Description

This is essentially a wrapper function for spectrum from the stats package. Thus, it is important the user be familiar with the documentation of the functions listed in the ‘See Also’ section. This is simply a quick way to compute the spectra of "rsac" class objects.

Usage

spect(x, plot = TRUE, main = NULL, ...)

Arguments

x an object of class "rsac".
plot logical for if the spectrum should be plotted.
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 x.
... further parameters. See spectrum and plot.spec.

Value

a vector of objects, each object is of "rsac".

Author(s)

Eric M. Thompson <eric.thompson@tufts.edu>

See Also

spectrum, plot.spec, spec.pgram, spec.ar

Examples


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 = "no")

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))


[Package Rsac version 0.1-7 Index]