Learn R Programming

wmtsa (version 2.0-3)

wavCWTFilters: Frequency response of continuous wavelet transform filters

Description

Returns the frequency response of a continuous wavelet filter. The choices for filters are limited to Haar, Gaussian, and Morlet families.

Usage

wavCWTFilters(wavelet="Gaussian2", frequency=seq(0, 2 * pi, length=1000),
    shift=3, variance=1, times=NULL)

Arguments

frequency

a numeric vector denoting the frequencies (in rad/sec) over which the frequency response function for the specified wavelet should be evaluated. Default: seq(0, 2 * pi, length=1000)

shift

the frequency shift \(\omega_0\) of the Morlet wavelet. Default: 3.

times

a numeric vector of values corresponding to times at which the specified filter should be evaluated. If not NULL, the impulse response of the specified filter is returned, otherwise the freequency response is returned. Default: NULL.

variance

the variance of a Gaussian PDF. Used only for the (derivatives of) Guassian filters. Default: 1.

wavelet

a character string denoting the wavelet filter. Choices are "haar", "gaussian1", "gaussian2", and "morlet", where gaussian1 and gaussian2 represent the first and second derivatives of a Gaussian PDF. Default: "gaussian2".

Value

the frequency response corresponding to the input frequencies.

References

D. B. Percival and A. T. Walden, Wavelet Methods for Time Series Analysis, Cambridge University Press, 2000.

See Also

wavCWT.

Examples

Run this code
# NOT RUN {
## set the plot grid 
old.plt <- ifultools::splitplot(2,2,1)

## create a frequency vector 
w <- seq(-10,10,length=1000)

## calculate the frequency responses for various 
## mother wavelets and plot the results 

wavelets <- c("haar", "gaussian1", "gaussian2", "morlet")

for (i in seq(wavelets)){
    if (i > 1) ifultools::splitplot(2,2,i)
    filt <- wavelets[i]
    plot(w, abs(wavCWTFilters(wavelet=filt, frequency=w)),
       ylab="|Psi(w)|", xlab="frequency", type="l")
title(filt)
}

par(old.plt)
# }

Run the code above in your browser using DataLab