|
MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
|
|
inlinenoexcept |
Estimate a repetition period by direct autocorrelation over a bounded lag range.
| values | Chronological span |
| dt | Seconds per sample |
| min_period | Shortest period to consider, in seconds |
| max_period | Longest period to consider, in seconds |
Direct rather than FFT-backed, and bounded rather than full-lag. The caller stating the period range they care about is not a limitation to work around: a meaning about turning every few seconds is not interested in a correlation peak at forty milliseconds, and searching for one invites the estimate to lock onto sensor noise or onto a harmonic of the real period.
Correlation is normalized by the window's own variance (Estimate::variance), so strength is scale-free and comparable across channels carrying different units. A window whose variance is negligible has nothing to correlate and returns zero strength rather than a ratio of two small numbers.
Requires the window to be at least twice the longest period searched, since a lag longer than half the window correlates too few pairs to mean anything. Lags failing that are skipped rather than reported with low confidence.
Distinct from Discrete::auto_correlate, which is FFT-backed, computes every lag up to the buffer length, and allocates a full output vector each call; the right shape for characterizing a recording once, the wrong shape for a bounded search run on every channel update.
Definition at line 203 of file TemporalMeasures.hpp.
References correlation(), MayaFlux::mean(), MayaFlux::Kinesis::PeriodEstimate::period, MayaFlux::Kinesis::PeriodEstimate::strength, values, and MayaFlux::Kinesis::Stochastic::Estimate::variance().
Here is the call graph for this function: