View source: R/selectModesTSL.R
| selectModesTSL | R Documentation |
Selects the modes of the tables of decomposeTSL with a
declared criterion: explicit mode indices, a minimum energy fraction or a
frequency band, to keep the modes that meet it or to remove them.
selectModesTSL(decomposition, metrics, criterion)
decomposition |
The list of tables of |
metrics |
The table |
criterion |
A list with
|
The criterion is supplied by the caller. Mode indices, energy fractions and centroid frequencies do not by themselves identify uncontaminated physical components. Equal mode indices in independently decomposed series need not represent the same physical contribution.
The band compares frequency alone, whereas the rules keep.Fo
and remove.Fo of gmsp 0.8.0 require the interval
[F_o - BW, F_o + BW] inside the band.
A named list of two data.table tables:
modes |
The rows of |
selection |
Every mode of |
measureModesTSL, reconstructTSL,
decomposeTSL
Time <- seq(0, 9, length.out = 3000)
Signal <- sin(pi * Time) + sin(2 * pi * Time) + sin(6 * pi * Time) +
0.5 * Time
# The same series under three IDs and three components.
TSL <- data.table::rbindlist(lapply(c("AT", "VT", "DT"), function(id) {
data.table::rbindlist(lapply(c("H1", "H2", "UP"), function(ocid) {
data.table::data.table(ID = id, OCID = ocid, t = Time, s = Signal)
}))
}))
Sifting <- list(stopRule = "doubleThreshold")
Decomposition <- decomposeTSL(TSL, method = "decomposeEMD",
control = list(sifting = Sifting),
by = character())
Metrics <- measureModesTSL(Decomposition)$metrics
# Keep the modes whose frequency lies in [2, 15] Hz.
Band <- selectModesTSL(Decomposition, metrics = Metrics,
criterion = list(rule = "band", fMin = 2, fMax = 15,
action = "keep"))
Band$selection[Band$selection$OCID == "H1" & Band$selection$ID == "AT", ]
# Remove the first mode of every series of the ID VT.
Listed <- data.frame(ID = "VT", mode = 1)
First <- selectModesTSL(Decomposition, metrics = Metrics,
criterion = list(rule = "modes", modes = Listed,
action = "remove"))
table(First$selection$ID, First$selection$retained)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.