View source: R/extractSSTModes.R
| extractSSTModes | R Documentation |
Extracts ridges of a synchrosqueezed transform one after another by dynamic programming and reconstructs a component from the coefficients in a band around each ridge.
extractSSTModes(transform, frequency, modeCount, penalty = 1000,
exclusionWidth = 4, reconstructionWidth, morletCenter)
transform |
Numeric or complex matrix of finite values, samples by
frequency cells, such as the |
frequency |
Increasing positive frequencies of the cells, one per
column of |
modeCount |
Whole number |
penalty |
Dimensionless penalty |
exclusionWidth |
Whole number |
reconstructionWidth |
Whole number |
morletCenter |
Center |
With T_{n,j} the coefficients, f_j the frequencies and
z_j = \log_2 f_j, the cost of a cell is
E_{n,j} = -\log(|T_{n,j}|^2 / Q + 10^{-8}), Q the sum of
|T|^2 over the matrix. The accumulated cost is
F_{1,j} = E_{1,j} and
F_{n,j} = E_{n,j} + \min_k \left[F_{n-1,k} + \lambda (z_j - z_k)^2\right]
over every cell k; the ridge ends at the first cell of least
F_{N,j}, and each earlier cell is the first whose residual in that
recurrence is below 10^{-8} in modulus. After each ridge C_n,
the cells from C_n - b to C_n + b, clipped to the cells, take
the value \sqrt{\epsilon}, \epsilon the machine
precision, and the next ridge is extracted with the energy recomputed.
Component k sums the original coefficients of its band,
c_k[n] = \frac{1}{C} \mathrm{Re} \sum_{j = C_{k,n} - w}^{C_{k,n} + w} T_{n,j},
over the cells of the band, with
C = C_\psi / (\sqrt{2\pi} \, 2 \ln 2) and
C_\psi = \int_0^\infty \hat\psi(\xi) / \xi \, d\xi for the Morlet
wavelet of center morletCenter. The bands may overlap, the
components need not add up to the signal, and no residue is returned. The
components are defined by the selected ridge bands, without imposing the
IMF conditions of EMD.
Double matrix, samples by components, one column per ridge.
A transform of zero energy stops the function with an error of class
xemdZeroEnergy. A sample where no cell satisfies the recurrence
within the tolerance stops it with an error.
Daubechies, I., Lu, J. and Wu, H.-T. (2009). Synchrosqueezed wavelet transforms: a tool for empirical mode decomposition. arXiv:0912.2437.
Brevdo, E. and Thakur, G. Synchrosqueezing Toolbox, revision 7e9fec0c6c9ed478dafac4479c0658d24fc6d8ef, functions curve_ext (original code by Jianfeng Lu), curve_ext_multi and synsq_cwt_iw, https://github.com/ebrevdo/synchrosqueezing.
The extraction of the ridges is adapted from curve_ext (original author
Jianfeng Lu, maintainer Eugene Brevdo) and curve_ext_multi of the
Synchrosqueezing Toolbox, as ported in SynchWave 1.1.2, revision
9ac80b2c3e60b417d0ee5567a66e8e64faa1a979 (port by Dongik Jang), and the
inversion from SynchWave 1.1.2 (MATLAB original by Eugene Brevdo; R port by
Dongik Jang, Hee-Seok Oh and Donghoh Kim), LGPL-2.0-or-later, which xemd
distributes under GPL-3 as section 3 of the GNU Library General Public
License version 2 permits; see the NOTICE file of the installed package.
transformSST, decomposeEWT
SamplingInterval <- 1 / 1000
Time <- seq_len(1000) * SamplingInterval
Signal <- cos(2 * pi * 2 * Time) + 0.25 * cos(2 * pi * 24 * Time) +
0.0625 * cos(2 * pi * 288 * Time)
SST <- transformSST(Signal, samplingInterval = SamplingInterval,
voiceCount = 16, morletCenter = 2 * pi,
threshold = sqrt(.Machine$double.eps))
Modes <- extractSSTModes(SST$transform, frequency = SST$frequency,
modeCount = 3, reconstructionWidth = 0,
morletCenter = 2 * pi)
dim(Modes)
sqrt(colMeans(Modes^2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.