extract_signal_stable {WaverideR} | R Documentation |
Extract a signal/cycle from a wavelet spectra using a set period and boundaries
Description
Extracts a cycle from the wavelet object created using the analyze_wavelet
function using a fixed period and fixed period boundaries defined as factors of the original cycle
Usage
extract_signal_stable(
wavelet = NULL,
cycle = NULL,
period_up = 1.2,
period_down = 0.8,
add_mean = TRUE,
plot_residual = FALSE,
keep_editable = FALSE
)
Arguments
wavelet |
Wavelet object created using the |
cycle |
Period of the cycle which needs to be extracted. |
period_up |
Specifies the upper period as a factor of the to be extracted cycle |
period_down |
Specifies the lower period as a factor of the to be extracted cycle |
add_mean |
Add mean to the extracted cycle |
plot_residual |
plot the residual signal after extraction of set cycle |
keep_editable |
Keep option to add extra features after plotting |
Value
#'Returns a matrix with 2 columns. The first column is time/depth. The second column is the extracted signal/cycle.
Author(s)
Code based on the reconstruct function of the 'WaveletComp' R package which is based on the wavelet 'MATLAB' code written by Christopher Torrence and Gibert P. Compo (1998).
References
Angi Roesch and Harald Schmidbauer (2018). WaveletComp: Computational Wavelet Analysis. R package version 1.1. https://CRAN.R-project.org/package=WaveletComp
Gouhier TC, Grinsted A, Simko V (2021). R package biwavelet: Conduct Univariate and Bivariate Wavelet Analyses. (Version 0.20.21), https://github.com/tgouhier/biwavelet
Torrence, C., and G. P. Compo. 1998. A Practical Guide to Wavelet Analysis. Bulletin of the American Meteorological Society 79:61-78. https://paos.colorado.edu/research/wavelets/bams_79_01_0061.pdf
Examples
#Example in which the ~210yr de Vries cycle is extracted from the Total Solar
#Irradiance data set of Steinhilber et al., (2012)
#Perform the CWT
TSI_wt <-
analyze_wavelet(
data = TSI,
dj = 1/200,
lowerPeriod = 16,
upperPeriod = 8192,
verbose = FALSE,
omega_nr = 6
)
#Extract the 210 yr de Vries cycle from the wavelet spectra
de_Vries_cycle <- extract_signal_stable(wavelet=TSI_wt,
cycle=210,
period_up =1.25,
period_down = 0.75,
add_mean=TRUE,
plot_residual=FALSE,
keep_editable=FALSE)