View source: R/selectModesEnergy.R
| selectModesEnergy | R Documentation |
Orders the modes by decreasing energy and selects those before the largest drop between consecutive energies.
selectModesEnergy(modes)
modes |
Finite numeric matrix, samples by modes, with at least two
columns. Attributes other than |
The energy of mode k is P_k = \sum_n c_k[n]^2. With the
permutation \pi that orders the energies decreasingly, the selection
keeps \pi(1), \ldots, \pi(v) with
v = \arg\max_{1 \le m < K} \left(P_{\pi(m)} - P_{\pi(m+1)}\right).
The source fixes no tie-break, so a largest drop that is zero or not unique stops the function with an error.
Integer vector of the selected column indices, the most energetic first.
measureFCF, measureDTW
Time <- seq_len(1000) / 1000
Tones <- cbind(cos(2 * pi * 2 * Time), 0.25 * cos(2 * pi * 24 * Time),
0.0625 * cos(2 * pi * 288 * Time))
selectModesEnergy(Tones)
# The same tones in another order.
selectModesEnergy(Tones[, c(3, 1, 2)])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.