analyze_Xwavelet: Conduct the cross wavelet transform on a time series or...

View source: R/analyze_Xwavelet.R

analyze_XwaveletR Documentation

Conduct the cross wavelet transform on a time series or signal

Description

Compute the cross wavelet transform using a complex Morlet wavelet based on the "analyze.coherency" function of the WaveletComp package.

Usage

analyze_Xwavelet(
  data_1,
  data_2,
  dj = 1/100,
  lowerPeriod = 2,
  upperPeriod = 1024,
  verbose = FALSE,
  omega_nr = 4
)

Arguments

data_1

First input data set as a matrix or data frame. The first column must represent depth or time, and the second column the signal or proxy record.

data_2

Second input data as a matrix or data frame. The first column must represent depth or time, and the second column the signal or proxy record.

dj

Spacing between successive scales. The CWT analyses analyses the signal using successive periods which increase by the power of 2 (e.g.2^0=1,2^1=2,2^2=4,2^3=8,2^4=16). To have more resolution in-between these steps the dj parameter exists, the dj parameter specifies how many extra steps/spacing in-between the power of 2 scaled CWT is added. The amount of steps is 1/x with a higher x indicating a smaller spacing. Increasing the increases the computational time of the CWT

lowerPeriod

Minimum period to be analysed. Controls the highest analysed frequency.

upperPeriod

Maximum period to be analysed. Controls the lowest analysed frequency.

verbose

Logical. If TRUE, print progress and interpolation information.

omega_nr

. number of cycles within a wavelet

Value

A list with class "analyze.Xwavelet" containing Wave: complex wavelet coefficients Power: time frequency power spectrum dt: sampling interval after interpolation Phase: instantaneous phase of the signal dj: number of frequencies Power.avg: average spectral power Period: physical periods corresponding to frequencies nc: number of columns in the input data nr: number of frequency levels axis.1: x axis values (time or depth) axis.2: y axis values (log2 scaled periods) c1: base number of wavelet cycles o: numeric vector of length two defining the minimum and maximum superlet order. If NULL, all frequencies are analysed using order one. x1: interpolated x values first data set y1: interpolated signal values first data set x2: interpolated x values second data set y2: interpolated signal values second data set

Author(s)

The "analyze_Xsuperlet" that generates the input for the plotting function is based on the matlab code in Moca et al. (2021) and the the "analyze.coherency" function of the 'WaveletComp' R package

References

Moca, V. V., Bârzan, H., Nagy-Dăbâcan, A., & Mureșan, R. C. (2021). Time-frequency super-resolution with superlets. Nature Communications, 12(1), 337. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1038/s41467-020-20539-9")}

Examples


#Example 1. A cross superlet of two etp solutions with noise overprint
etp_1 <- astrochron::etp(
 tmin = 0,
 tmax = 500,
 dt = 2,
 eWt = 1.5,
 oWt = 0.75,
 pWt = 1,
 esinw = TRUE,
 standardize = TRUE,
 genplot = FALSE,
 verbose = FALSE
)

etp_2 <- astrochron::etp(
 tmin = 0,
 tmax = 500,
 dt = 2,
 eWt = 1,
 oWt = 0.5,
 pWt = 1.5,
 esinw = TRUE,
 standardize = TRUE,
 genplot = FALSE,
 verbose = FALSE
)

etp_1[, 2] <- etp_1[, 2] + colorednoise::colored_noise(
 nrow(etp_1),
 sd = sd(etp_1[, 2]) / 1.5,
 mean = mean(etp_1[, 2]),
 phi = 0.9
)
etp_2[, 2] <- etp_2[, 2] + colorednoise::colored_noise(
 nrow(etp_2),
 sd = sd(etp_2[, 2]) / 1.5,
 mean = mean(etp_2[, 2]),
 phi = 0.9
)

Xetp <- analyze_Xwavelet(
 data_1 = etp_1,
 data_2  = etp_2,
 upperPeriod = 512,
     dj = 1/20,
 lowerPeriod = 4,
 verbose = FALSE,
 omega_nr = 8
)


WaverideR documentation built on April 6, 2026, 5:06 p.m.