Correlation/balance meter and goniometer data source.
More...
#include <PhaseCorrelation.h>
|
| static constexpr int | kGonioSize = 1024 |
| | Goniometer ring length.
|
| |
template<FloatType T>
class dspark::PhaseCorrelation< T >
Correlation/balance meter and goniometer data source.
- Template Parameters
-
| T | Sample type (float or double). |
Definition at line 74 of file PhaseCorrelation.h.
◆ getBalance()
- Returns
- Energy balance in [-1, +1]; -1 = all left, +1 = all right.
Definition at line 221 of file PhaseCorrelation.h.
◆ getCorrelation()
- Returns
- Correlation in [-1, +1]; +1 in phase, -1 phase-inverted.
Definition at line 215 of file PhaseCorrelation.h.
◆ getDominantLevelDb()
- Returns
- The power of the dominant component in dB (-200 in silence).
Definition at line 227 of file PhaseCorrelation.h.
◆ getGonioPoints()
Copies the newest goniometer points (oldest first).
- Parameters
-
| dest | Destination array (null is tolerated: returns 0). |
| maxCount | Capacity of dest (clamped to kGonioSize). |
- Returns
- Number of points copied.
Definition at line 238 of file PhaseCorrelation.h.
◆ getWindowMs()
◆ prepare()
Prepares the meter. Allocation-free.
- Parameters
-
| spec | Audio environment specification. An invalid or non-finite specification is ignored (conservative no-op: the previous state is kept). |
| windowMs | Averaging time constant for the correlation (one-pole tau, default 300 ms). Clamped to [1, 600000]; a non-finite value falls back to the default. |
Definition at line 97 of file PhaseCorrelation.h.
◆ processBlock()
Analyzes a block (read-only; the audio is not modified).
Single-channel buffers measure as dual mono: r = +1 while signal is present (below the silence floor the readouts rest at 0, same as stereo), balance 0, and the goniometer collapses onto the mid axis.
Definition at line 138 of file PhaseCorrelation.h.
◆ reset()
Clears the averages, the readouts and the goniometer ring.
Allocation-free, but it writes the same plain accumulators processBlock() owns: call it from the stream owner (or with the stream stopped).
Definition at line 117 of file PhaseCorrelation.h.
◆ kGonioSize
The documentation for this class was generated from the following file: