Utilities
Detrending time-series
Offsets and trends in time-series may lead to significant edge-effects in the wavelet transformed. To detrend time series before performing the wavelet transform, the detrend method might be used.
ContinuousWavelet.detrend — Methoddetrend(y::AbstractVector{V}, x::AbstractVector{U}=(1:length(y)))Detrends the given time-series. That is, fitting a linear function into y given x and subtracting the fit from the data in y. The function returns the detrended time-series.
ContinuousWavelet.detrend — Methoddetrend!(y::AbstractArray{V,2}, x::AbstractVector{U}=(1:length(y)))Detrends the given time-series. That is, fitting a linear function into every columns of y given x and subtracting the fit from the data in the corresponding column of y. The fuction returns the detrended time-series.
ContinuousWavelet.detrend! — Methoddetrend!(y::AbstractVector{V}, x::AbstractVector{U}=(1:length(y)))In-place detrends the given time-series. That is, fitting a linear function into y given x and subtracting the fit from the data in y.
ContinuousWavelet.detrend! — Methoddetrend!(y::AbstractArray{V,2}, x::AbstractVector{U}=(1:length(y)))In-place detrends the given time-series. That is, fitting a linear function into every columns of y given x and subtracting the fit from the data in the corresponding column of y.
Generating surrogate time-series
Frequently, it is necessary to generate surrogate time-series for some given observations. Particularly for coherence analyses, surrogate time-series provide means to assess the reliability of the coherence estimates. The ContiniuousWavelet library provides the surrogate method to generate power spectrum and therefore auto-correlation conserving surrogate time-series.
These surrogate time-series are generated by performing a Fourier transform of the original time-series and randomizing the phases of these transformed time-series. The modulus of the Fourier transform is maintained. This ensures that the power spectrum and therefore the auto-correlation function of the original time-series is conserved.
ContinuousWavelet.surrogate — Methodsurrogate(A::AbstractArray{Float64, 1})Generates a new surrogate time-series for the given one by means of phase-randomization.
ContinuousWavelet.surrogate! — Methodsurrogate(A::AbstractArray{Float64, 1})Generates a new surrogate time-series in-place for the given one by means of phase-randomization.
ContinuousWavelet.surrogate — Methodsurrogate(A::AbstractArray{Float64, 1})Generates a new surrogate time-series for each column of A by means of phase-randomization.
ContinuousWavelet.surrogate! — Methodsurrogate(A::AbstractArray{Float64, 1})Generates a new surrogate time-series in-place for each column of A by means of phase-randomization.