dropFreqs: Truncate mtm or mtm.coh Objects in Frequency

Description Usage Arguments Examples

View source: R/dropFreqs.R

Description

A utility function to truncate the frequencies in a spectral estimate. This utility is used before calling plot(), to increase the visual frequency resolution of a plot by truncating frequencies outside a particular band of interest. This function is not a filter, but rather a utility to allow R to 'zoom' a spectrum plot to a certain frequency band.

Usage

1
dropFreqs(spec, minFreq, maxFreq)

Arguments

spec

A spectrum object 'obj', of class spec, mtm, or mtm.coh.

minFreq

The lower bound for the frequency band to be retained, in the same units as the obj$freq array.

maxFreq

The upper bound for the frequency band to be retained, also in the same units as the obj$freq array.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(willamette)
mtm1 <- spec.mtm(willamette, nw=4.0, k=8, plot=FALSE, deltat=1.0, dtUnits="month")
mtm2 <- dropFreqs(mtm1, 0.1, 0.4)
plot(mtm2)

# another option
plot(dropFreqs(mtm1, 0.1, 0.4))

# using sine tapers
mtm.sine <- spec.mtm(willamette, k=10, plot=FALSE, deltat=1.0, dtUnits="month", 
                     taper="sine", sineAdaptive=FALSE, sineSmoothFact=0.05)
plot(dropFreqs(mtm.sine, 0.1, 0.4))                     

multitaper documentation built on Nov. 17, 2017, 4:02 a.m.