pgram_compare {psd} | R Documentation |
Compare multitaper spectrum with cosine-tapered periodogram
Description
Plot the results of psdcore
against the results of
spec.pgram
Usage
pgram_compare(x, ...)
## S3 method for class 'amt'
pgram_compare(
x,
f = NULL,
X = NULL,
log.freq = TRUE,
db.spec = TRUE,
taper = 0.2,
...
)
Arguments
x |
a single |
... |
additional parameters (currently unused) |
f |
numeric; the frequency range to plot; optional: if not given the program will show the entire band. |
X |
object used to create |
log.freq |
logical; should frequencies be transformed with |
db.spec |
logical; should the spectrum estimates be converted to decibels with |
taper |
numeric; specifies the proportion of data to taper for the cosine periodogram. |
Value
A list with the cosine-tapered estimates and the adaptive estimates, invisibly.
Examples
set.seed(1234)
X <- rnorm(1e3)
# multitaper spectrum
p <- psdcore(X, ntaper=10)
# how does it compare to a single-cosine tapered spectrum?
pgram_compare(p)
# or in a certain band
pgram_compare(p, c(0.1,0.4))
# linear frequencies
pgram_compare(p, c(0.1,0.4), log.freq = FALSE)