prepareWavelets: Prepare daughter wavelets for faster CWT

View source: R/cwt.R

prepareWaveletsR Documentation

Prepare daughter wavelets for faster CWT

Description

Prepare daughter wavelets for faster CWT

Usage

prepareWavelets(
  mslength,
  scales = c(1, seq(2, 30, 2), seq(32, 64, 4)),
  wavelet = "mexh",
  wavelet_xlimit = 8,
  wavelet_length = 1024L,
  extendLengthScales = TRUE
)

Arguments

mslength

Length of the signal to transform

scales

a vector represents the scales at which to perform CWT. See the Details section. Additionally, a prepared_wavelets object is also accepted (see prepareWavelets()).

wavelet

The wavelet base, Mexican Hat by default. User can provide wavelet Psi(x) as a form of two row matrix. The first row is the x value, and the second row is Psi(x) corresponding to x.

wavelet_xlimit

The mother wavelet will be evaluated between these limits. Ignored if wavelet is a matrix.

wavelet_length

The number of points of the mother wavelet. Ignored if wavelet is a matrix

extendLengthScales

A logical value. If the signal is too short, we may need to pad it to convolve it with larger daughter wavelets. Set this to TRUE to let scales be used to determine the padding length. It's set to FALSE by default to preserve backwards compatibility.

Value

A prepared_wavelets object.

See Also

cwt

Examples

x <- runif(2000)
scales <- c(1, 2, 4, 8)
prep_wavelets <- prepareWavelets(length(x), scales = scales)
wCoefs <- cwt(x, prep_wavelets)

zeehio/MassSpecWavelet documentation built on May 6, 2023, 1:32 a.m.