scale_index: Scale index of a signal

Description Usage Arguments Value References Examples

View source: R/scale_index.R

Description

This function computes the scale index of a signal in the scale interval [s_0,s_1], for a given set of scale parameters s_1 and taking s_0 as the minimum scale (see Ben<c3><ad>tez et al. 2010).

The scale index of a signal in the scale interval [s_0,s_1] is given by the quotient

S(s_{min})/S(s_{max})

where S is the scalogram, s_{max} \in [s_0,s_1] is the smallest scale such that S(s)≤ S(s_{max}) for all s \in [s_0,s_1], and s_{min} \in [s_{max},2s_1] is the smallest scale such that S(s_{min})≤ S(s) for all s \in [s_{max},2s_1].

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
scale_index(signal,
                   dt = 1,
                   scales = NULL,
                   powerscales = TRUE,
                   s1 = NULL,
                   wname = c("MORLET", "DOG", "PAUL", "HAAR", "HAAR2"),
                   wparam = NULL,
                   waverad = NULL,
                   border_effects = c("BE", "INNER", "PER", "SYM"),
                   makefigure = TRUE,
                   figureperiod = TRUE,
                   xlab = NULL,
                   ylab = "Scale index",
                   main = "Scale Index")

Arguments

signal

A vector containing the signal whose scale indices are wanted.

dt

Numeric. The time step of the signals.

scales

A vector containing the wavelet scales at wich the scalogram is computed. This can be either a vector with all the scales, or (if powerscales is TRUE) following Torrence and Compo 1998, a vector of three elements with the minimum scale, the maximum scale and the number of suboctaves per octave. If NULL, they are automatically computed.

powerscales

Logical. If TRUE (default), construct power 2 scales from scales. If scales is NULL, they are automatically computed.

s1

A vector containing the scales s_1. The scale indices are computed in the intervals [s_0,s_1], where s_0 is the minimum scale in scales.

wname

A string, equal to "MORLET", "DOG", "PAUL", "HAAR" or "HAAR2". The difference between "HAAR" and "HAAR2" is that "HAAR2" is more accurate but slower.

wparam

The corresponding nondimensional parameter for the wavelet function (Morlet, DoG or Paul).

waverad

Numeric. The radius of the wavelet used in the computations for the cone of influence. If it is not specified, it is asumed to be √{2} for Morlet and DoG, 1/√{2} for Paul and 0.5 for Haar.

border_effects

A string, equal to "BE", "INNER", "PER" or "SYM", which indicates how to manage the border effects which arise usually when a convolution is performed on finite-lenght signals.

  • "BE": With border effects, padding time series with zeroes.

  • "INNER": Normalized inner scalogram with security margin adapted for each different scale.

  • "PER": With border effects, using boundary wavelets (periodization of the original time series).

  • "SYM": With border effects, using a symmetric catenation of the original time series.

makefigure

Logical. If TRUE (default), a figure with the scale indices is plotted.

figureperiod

Logical. If TRUE (default), periods are used in the figure instead of scales.

xlab

A string giving a custom X axis label. If NULL (default) the X label is either "s1" or "Period of s1" depending on the value of figureperiod.

ylab

A string giving a custom Y axis label.

main

A string giving a custom main title for the figure.

Value

A list with the following fields:

References

R. Ben<c3><ad>tez, V. J. Bol<c3><b3>s, M. E. Ram<c3><ad>rez. A wavelet-based tool for studying non-periodicity. Comput. Math. Appl. 60 (2010), no. 3, 634-641.

Examples

1
2
3
4
dt <- 0.1
time <- seq(0, 50, dt)
signal <- c(sin(pi * time), sin(pi * time / 2))
si <- scale_index(signal = signal, dt = dt)

wavScalogram documentation built on May 24, 2019, 5:03 p.m.