A per-bin quantity of the last frame (a gain curve, a reduction), read at fixed points for a display from any thread.
More...
|
| void | prepare (double binHz, int bins) noexcept |
| | Maps the points onto the bins of a transform and clears the curves.
|
| |
| void | clear () noexcept |
| | Sets every point of every curve to zero.
|
| |
| template<typename V > |
| void | publish (int channel, const V *perBin, int bins) noexcept |
| | Publishes one frame of a channel's per-bin values (audio thread).
|
| |
| template<typename GainAt > |
| T | gainPoint (int point, GainAt &&gainAt) const noexcept |
| | One point of a frame of gains no higher than 1, in decibels: what publish() would show of their decibels, with a logarithm a point in place of one a bin. For an owner that keeps a frame's gains (as relaxed atomics, the audio thread's only work) and leaves the points to the thread that reads them.
|
| |
| template<typename V > |
| void | publishPoints (int channel, const V *perPoint) noexcept |
| | Publishes one frame of a channel that is already on the points (audio thread; prepare() is not needed for it).
|
| |
| T | value (int channel, int point) const noexcept |
| |
| T | extreme () const noexcept |
| |
template<FloatType T>
class dspark::SpectralReadout< T >
A per-bin quantity of the last frame (a gain curve, a reduction), read at fixed points for a display from any thread.
The points sit evenly in log frequency from 20 Hz to 20 kHz, over a hundred an octave. A point with bins within half a point of it takes the value with the largest magnitude (its sign kept), so a narrow peak or notch between two points still shows; a point with none, as in the low end, reads straight between the bins on either side of it, so the curve has no steps. prepare() maps the points onto a transform (setup thread, no allocation); publish() runs on the audio thread once a frame; value() and extreme() on any thread. The points are relaxed atomics: a reader may see a curve whose points come from two consecutive frames.
- Template Parameters
-
| T | Sample type (float or double). |
Definition at line 510 of file SpectralFilter.h.
template<FloatType T>
template<typename GainAt >
One point of a frame of gains no higher than 1, in decibels: what publish() would show of their decibels, with a logarithm a point in place of one a bin. For an owner that keeps a frame's gains (as relaxed atomics, the audio thread's only work) and leaves the points to the thread that reads them.
- Template Parameters
-
| GainAt | float gainAt(int bin), for the bins of prepare(). |
- Parameters
-
| point | 0 to kPoints - 1 (others, or before prepare(), read 0). |
| gainAt | The gains, from 0 to 1 (under 1e-6: -120 dB). |
Definition at line 622 of file SpectralFilter.h.