analyze_Xsuperlet: Conduct the cross superlet transform on a time series or...

View source: R/analyze_Xsuperlet.R

analyze_XsuperletR Documentation

Conduct the cross superlet transform on a time series or signal

Description

Compute the cross superlet transform using a complex Morlet wavelet based on the approach of Moca et al. (2021) and the "analyze.coherency" function of the WaveletComp package. The superlet transform increases time frequency resolution by combining multiple wavelet orders at each frequency.

Usage

analyze_Xsuperlet(
  data_1 = NULL,
  data_2 = NULL,
  upperPeriod = 2,
  lowerPeriod = 1024,
  Nf = 128,
  c1 = 3,
  o = c(1, 10),
  mult = TRUE,
  order_scaling = "log2",
  order_alpha = 1,
  verbose = FALSE
)

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.

upperPeriod

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

lowerPeriod

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

Nf

Number of frequencies used to construct the superlet spectrum. Frequencies are logarithmically spaced between the limits defined by upperPeriod and lowerPeriod.

c1

Base number of cycles of the Morlet wavelet. Acts as the fundamental wavelet width.

o

numeric vector of length two defining the minimum and maximum superlet order. If NULL, all frequencies are analysed using order one.

mult

Logical. If TRUE, the number of cycles increases multiplicatively with superlet order. If FALSE, cycles increase additively.

order_scaling

Character string defining how the number of wavelet cycles varies with scale. One of "log2", "linear", "sqrt", "quadratic", or "power".

order_alpha

Numeric. Exponent used when scaling = "power". Values greater than one emphasize high frequency sharpening, whereas values smaller than one emphasize low frequency sharpening.

verbose

Logical. If TRUE, print progress and interpolation information.

Value

A list with class "analyze.Xsuperlet" 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 = 300,
 dt = 1,
 eWt = 1.5,
 oWt = 0.75,
 pWt = 1,
 esinw = TRUE,
 standardize = TRUE,
 genplot = FALSE,
 verbose = FALSE
)

etp_2 <- astrochron::etp(
 tmin = 0,
 tmax = 300,
 dt = 1,
 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_Xsuperlet(
 data_1 = etp_1,
 data_2  = etp_2,
 upperPeriod = 256,
 lowerPeriod = 2,
 Nf = 32,
 c1 = 3,
 o = c(1, 10),
 mult = TRUE,
 order_scaling = "log2",
 order_alpha = 1,
 verbose = FALSE
)


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