MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Kinesis::Discrete Namespace Reference

Classes

struct  Biquad
 Second order section with a[0] normalised to 1, returned by value. More...
 

Typedefs

using ConvolutionProcessor = std::function< void(const std::vector< std::complex< double > > &signal_fft, const std::vector< std::complex< double > > &kernel_fft, std::vector< std::complex< double > > &result_fft)>
 Frequency-domain processor callback for apply_convolution.
 
using SpectrumProcessor = std::function< void(std::vector< std::complex< double > > &, size_t)>
 Callable type for per-frame spectrum modification Receives the one-sided complex spectrum (bins 0..N/2 inclusive) and the frame index.
 

Enumerations

enum class  SortingAlgorithm : uint8_t {
  STANDARD , STABLE , PARTIAL , NTH_ELEMENT ,
  HEAP , PARALLEL , RADIX , COUNTING ,
  BUCKET , MERGE_EXTERNAL , QUICK_OPTIMIZED , LAZY_STREAMING ,
  PREDICTIVE_ML , EIGEN_OPTIMIZED , GPU_ACCELERATED
}
 Available sorting algorithm backends. More...
 
enum class  SortingDirection : uint8_t { ASCENDING , DESCENDING , CUSTOM , BIDIRECTIONAL }
 Ascending or descending sort order. More...
 

Functions

void apply_blackman (std::span< double > data) noexcept
 Apply a Blackman taper in-place without materialising coefficients.
 
std::vector< double > apply_convolution (std::span< const double > src, std::span< const double > kernel, const ConvolutionProcessor &processor, bool full_size=false)
 Core FFT convolution engine.
 
void apply_hamming (std::span< double > data) noexcept
 Apply a Hamming taper in-place without materialising coefficients.
 
void apply_hann (std::span< double > data) noexcept
 Apply a Hann taper in-place without materialising coefficients.
 
void apply_rectangular (std::span< double > data, size_t support=std::numeric_limits< size_t >::max(), size_t offset=0) noexcept
 Apply a rectangular taper in-place without materialising coefficients.
 
std::vector< double > apply_spectral (std::span< const double > src, uint32_t window_size, uint32_t hop_size, const SpectrumProcessor &processor)
 Apply a per-frame spectrum processor via WOLA analysis-synthesis.
 
void apply_taper (std::span< double > data, std::span< const double > taper) noexcept
 Multiply data element-wise by a precomputed taper.
 
void apply_trapezoid (std::span< double > data, size_t fade_len) noexcept
 Apply a trapezoid taper in-place without materialising coefficients.
 
template<typename TrigFunc >
requires std::invocable<TrigFunc, double> && std::same_as<std::invoke_result_t<TrigFunc, double>, double>
void apply_trig (std::span< double > data, TrigFunc func, double frequency, double amplitude, double phase) noexcept
 Trigonometric map y = amplitude * f(frequency*x + phase) applied in-place.
 
std::vector< double > auto_correlate (std::span< const double > src, bool normalize=true)
 Auto-correlation via FFT.
 
std::vector< double > backward_difference_weights (size_t order)
 Weights of the backward difference of a given order.
 
bool bernoulli_gate (double input, std::span< double > coefs) noexcept
 Probabilistic gate: each pulse passes with the given probability.
 
std::vector< double > bernoulli_gate_state (double probability, uint32_t seed=0, double threshold=0.5)
 Builds the array bernoulli_gate reads and writes.
 
void biquad_allpass (double frequency, double q, double sample_rate, std::vector< double > &a, std::vector< double > &b)
 Second-order allpass coefficients.
 
Biquad biquad_bandpass (double frequency, double q, double sample_rate) noexcept
 Constant peak gain bandpass section, returned by value.
 
void biquad_bandpass (double frequency, double q, double sample_rate, std::vector< double > &a, std::vector< double > &b)
 Second-order bandpass coefficients, constant 0 dB peak gain.
 
void biquad_high_shelf (double frequency, double slope, double gain_db, double sample_rate, std::vector< double > &a, std::vector< double > &b)
 Second-order high shelf coefficients.
 
void biquad_highpass (double frequency, double q, double sample_rate, std::vector< double > &a, std::vector< double > &b)
 Second-order highpass coefficients.
 
void biquad_low_shelf (double frequency, double slope, double gain_db, double sample_rate, std::vector< double > &a, std::vector< double > &b)
 Second-order low shelf coefficients.
 
void biquad_lowpass (double frequency, double q, double sample_rate, std::vector< double > &a, std::vector< double > &b)
 Second-order lowpass coefficients.
 
void biquad_notch (double frequency, double q, double sample_rate, std::vector< double > &a, std::vector< double > &b)
 Second-order notch coefficients.
 
void biquad_peaking (double frequency, double q, double gain_db, double sample_rate, std::vector< double > &a, std::vector< double > &b)
 Second-order peaking coefficients.
 
std::vector< double > blackman (size_t n)
 Blackman taper coefficients.
 
double breakpoint_curve (std::span< const double > window, std::span< const double > coefs) noexcept
 Piecewise linear curve through (x, y) points.
 
std::vector< double > cascade (std::span< const double > lhs, std::span< const double > rhs)
 Polynomial product of two coefficient vectors.
 
std::vector< std::vector< size_t > > channels_sort_indices (const std::vector< std::span< double > > &channels, SortingDirection direction)
 Per-channel sort indices.
 
double chebyshev_series (std::span< const double > window, std::span< const double > coefs) noexcept
 Sum of coefs[k] * T_k(window[0]) over Chebyshev polynomials.
 
void clamp (std::span< double > data, double lo, double hi) noexcept
 Clamp values to [lo, hi] in-place.
 
bool clocked_register (const std::vector< double > &inputs, std::span< double > coefs) noexcept
 Shift register: slot 1 is sampled into it on every rise of slot 0.
 
std::vector< double > clocked_register_state (size_t length, size_t tap, double threshold=0.5)
 Builds the array clocked_register reads and writes.
 
std::vector< double > coefficient_of_variation (std::span< const double > data, size_t n_windows, uint32_t hop_size, uint32_t window_size, bool sample_variance=true)
 Coefficient of variation (std_dev / mean) per window.
 
bool comparator (const std::vector< double > &inputs, std::span< double > coefs) noexcept
 Signal against signal: true once slot 0 exceeds slot 1 by the margin.
 
std::vector< double > comparator_state (double margin=0.0)
 Builds the array comparator reads and writes.
 
std::vector< double > convolve (std::span< const double > src, std::span< const double > ir)
 Linear FFT convolution.
 
std::vector< double > count (std::span< const double > data, size_t n_windows, uint32_t hop_size, uint32_t window_size)
 Sample count per window (as double for pipeline uniformity)
 
bool count_at_least (std::span< const bool > history, std::span< const double > coefs) noexcept
 True when at least k of the last n bits are set.
 
double coupled_map_lattice (std::span< const double > window, std::span< double > coefs) noexcept
 Ring of logistic maps with nearest neighbour coupling.
 
std::vector< double > coupled_map_lattice_state (std::span< const double > cells, double r, double epsilon)
 Builds the array coupled_map_lattice reads and writes.
 
std::vector< double > cross_correlate (std::span< const double > src, std::span< const double > tmpl, bool normalize=true)
 Cross-correlation via FFT.
 
void dc_block (double pole, std::vector< double > &a, std::vector< double > &b)
 DC blocking filter.
 
double decay_from_pole_radius (double radius, double sample_rate) noexcept
 Time for an impulse response of a given pole radius to fall by 1/e.
 
double decay_from_q (double frequency, double q, double sample_rate) noexcept
 Ring time of a bandpass section of a given Q.
 
double decay_per_sample (double seconds, double sample_rate) noexcept
 Per-sample factor that falls by 1/e in a given time.
 
std::vector< double > deconvolve (std::span< const double > src, std::span< const double > ir, double regularization=1e-6)
 Frequency-domain deconvolution with Tikhonov regularisation.
 
std::vector< double > delay (std::span< const double > data, uint32_t delay_samples, double fill_value=0.0)
 Prepend delay_samples zero-valued (or fill_value) samples, returning a new vector.
 
double dilate (std::span< const double > window, std::span< const double > coefs) noexcept
 Maximum over the window of window[k] + coefs[k], the grayscale dilation.
 
auto double_comparator (SortingDirection direction) noexcept
 Direction-based comparator for doubles.
 
std::vector< double > dynamic_range (std::span< const double > data, size_t n_windows, uint32_t hop_size, uint32_t window_size)
 Dynamic range in dB per window.
 
bool edge_divider (double input, std::span< double > coefs) noexcept
 Gate divider: the input passes only during every n-th pulse.
 
std::vector< double > edge_divider_state (size_t n, size_t offset=0, double threshold=0.5)
 Builds the array edge_divider reads and writes.
 
std::vector< double > entropy (std::span< const double > data, size_t n_windows, uint32_t hop_size, uint32_t window_size, size_t num_bins=0)
 Shannon entropy per window using Sturges-rule histogram.
 
double erode (std::span< const double > window, std::span< const double > coefs) noexcept
 Minimum over the window of window[k] - coefs[k], the grayscale erosion.
 
double estimate_frequency (std::span< const double > data, double sample_rate, double fallback=0.0, double threshold=0.0)
 Estimate the dominant cycle frequency of a sampled signal.
 
template<std::random_access_iterator Iterator, typename Comparator >
void execute (Iterator begin, Iterator end, Comparator comp, SortingAlgorithm algorithm)
 Execute a sorting algorithm on an iterator range.
 
void exponential (std::span< double > data, double a, double b, double base=std::numbers::e) noexcept
 Exponential map y = a * base^(b*x) applied in-place Scalar transcendental — not SIMD hot-path.
 
void fade (std::span< double > data, double fade_in_ratio, double fade_out_ratio) noexcept
 Apply equal-power (cosine) fade-in then fade-out envelope in-place The cosine taper maintains constant perceived loudness at the crossover point (0 dB centre gain vs −6 dB for a linear taper).
 
double fourier_series (std::span< const double > window, std::span< const double > coefs) noexcept
 Fourier series of a phase.
 
std::vector< double > free_bar_series (size_t count, double base=1.0)
 Ratios of the transverse modes of a uniform free-free beam.
 
double from_word (uint32_t word, uint32_t bits) noexcept
 The value of an offset binary word; bits above the width are ignored.
 
bool galois_lfsr (double input, std::span< double > coefs) noexcept
 Linear feedback shift register clocked by the rises of the input.
 
std::vector< double > galois_lfsr_state (uint32_t taps, uint32_t seed=1, double threshold=0.5)
 Builds the array galois_lfsr reads and writes.
 
std::vector< double > geometric_weights (size_t count, double ratio, bool unit_sum=false)
 Weights that fall by a constant ratio with age.
 
double goertzel (std::span< const double > window, std::span< const double > coefs) noexcept
 Weighted energy of the window at chosen frequencies.
 
std::vector< double > hamming (size_t n)
 Hamming taper coefficients.
 
std::vector< double > hann (size_t n)
 Hann (raised cosine) taper coefficients.
 
std::vector< double > harmonic_enhance (std::span< const double > src, double enhancement_factor, uint32_t window_size=1024, uint32_t hop_size=256)
 Linear spectral tilt: scale each bin by a factor that rises linearly from 1 at bin 0 to enhancement_factor at the Nyquist bin.
 
std::vector< double > harmonic_series (size_t count, double base=1.0)
 base * 1, base * 2, ... base * count.
 
double horner (std::span< const double > coefficients, double x) noexcept
 Horner evaluation, coefficients highest power first.
 
bool hysteresis_gate (double input, std::span< double > coefs) noexcept
 Schmitt trigger: engages above high, releases below low, holds between.
 
std::vector< double > hysteresis_gate_state (double low, double high)
 Builds the array hysteresis_gate reads and writes.
 
bool input_truth_table (const std::vector< double > &inputs, std::span< const double > coefs) noexcept
 Any boolean function of the input slots, as a table.
 
std::vector< double > input_truth_table_state (size_t arity, uint64_t rule, double threshold=0.5)
 Builds the array input_truth_table reads.
 
void interpolate_cubic (std::span< const double > src, std::span< double > dst) noexcept
 Catmull-Rom cubic interpolation from src into dst (caller sizes dst) Branchless boundary clamping; Horner evaluation form.
 
void interpolate_linear (std::span< const double > src, std::span< double > dst) noexcept
 Linear interpolation from src into dst (caller sizes dst) Branchless inner loop with precomputed step; dst may be larger or smaller than src.
 
std::vector< std::pair< size_t, size_t > > intervals_from_window_starts (const std::vector< size_t > &window_starts, uint32_t window_size, size_t data_size)
 Build [start, end) intervals from window start indices.
 
double iterated_polynomial (std::span< const double > window, std::span< const double > coefs) noexcept
 Polynomial of the previous value, coefs highest power first.
 
double kuramoto (std::span< const double > window, std::span< double > coefs) noexcept
 Kuramoto oscillators pulled toward their mean phase.
 
std::vector< double > kuramoto_state (std::span< const double > omegas, double coupling, std::span< const double > phases={})
 Builds the array kuramoto reads and writes.
 
std::vector< double > kurtosis (std::span< const double > data, size_t n_windows, uint32_t hop_size, uint32_t window_size)
 Excess kurtosis (fourth central moment - 3) per window.
 
std::vector< double > lagrange_delay (double delay, size_t order)
 Lagrange fractional-delay FIR coefficients.
 
void lagrange_weights (double delay, std::span< double > weights) noexcept
 Lagrange interpolation weights written to an array, without allocating.
 
void linear (std::span< double > data, double a, double b) noexcept
 Linear map y = a*x + b applied in-place.
 
void logarithmic (std::span< double > data, double a, double b, double c, double base=std::numbers::e) noexcept
 Logarithmic map y = a * log_base(b*x + c) applied in-place Values where (b*x + c) <= 0 are mapped to 0.
 
double lorenz_attractor (std::span< const double > window, std::span< double > coefs) noexcept
 Lorenz system stepped once by fourth order Runge-Kutta, returning x.
 
std::vector< double > lorenz_state (double dt=0.005, double sigma=10.0, double rho=28.0, double beta=8.0/3.0, double x=1.0, double y=1.0, double z=1.0)
 Builds the array lorenz_attractor reads and writes.
 
void lotka_volterra_step (std::span< double > levels, std::span< const double > growth, std::span< const double > interaction, double dt)
 One explicit step of generalised Lotka-Volterra competition.
 
std::vector< double > low_frequency_energy (std::span< const double > data, size_t n_windows, uint32_t hop_size, uint32_t window_size, double low_bin_fraction=0.125)
 Low-frequency spectral energy per window.
 
std::vector< double > mad (std::span< const double > data, size_t n_windows, uint32_t hop_size, uint32_t window_size)
 Median absolute deviation per window.
 
template<typename T >
requires requires(T v) { { std::abs(v) } -> std::convertible_to<double>; }
auto magnitude_comparator (SortingDirection direction) noexcept
 Magnitude-based comparator for complex-like types.
 
std::vector< double > matched_filter (std::span< const double > src, std::span< const double > reference)
 Matched filter (normalised cross-correlation)
 
std::vector< double > max (std::span< const double > data, size_t n_windows, uint32_t hop_size, uint32_t window_size)
 Maximum value per window.
 
double max_pole_magnitude (std::span< const double > a)
 Largest pole magnitude of a denominator polynomial.
 
std::vector< double > maximally_even_sequence (size_t pulses, size_t steps, size_t rotation=0)
 The maximally even placement of pulses among steps, as a 0 or 1 table.
 
std::vector< double > mean (std::span< const double > data, size_t n_windows, uint32_t hop_size, uint32_t window_size)
 Arithmetic mean per window.
 
std::vector< double > mean_zscore (std::span< const double > data, size_t n_windows, uint32_t hop_size, uint32_t window_size, bool sample_variance=true)
 Mean z-score per window.
 
std::vector< double > median (std::span< const double > data, size_t n_windows, uint32_t hop_size, uint32_t window_size)
 Median per window via nth_element partial sort.
 
std::vector< std::pair< size_t, size_t > > merge_intervals (const std::vector< std::pair< size_t, size_t > > &intervals)
 Merge overlapping or adjacent half-open intervals.
 
std::vector< double > min (std::span< const double > data, size_t n_windows, uint32_t hop_size, uint32_t window_size)
 Minimum value per window.
 
std::vector< double > mode (std::span< const double > data, size_t n_windows, uint32_t hop_size, uint32_t window_size)
 Mode per window via tolerance-bucketed frequency count.
 
double modular_recurrence (std::span< const double > window, std::span< const double > coefs) noexcept
 Weighted sum wrapped into [0, modulus).
 
std::vector< double > moving_average_weights (size_t count)
 Equal weights summing to 1: Taper::rectangular scaled by 1 / count.
 
void normalize (std::span< double > data, double target_min=-1.0, double target_max=1.0) noexcept
 Normalize to [target_min, target_max] in-place Single-pass min/max reduction followed by a single transform pass.
 
size_t num_windows (size_t data_size, uint32_t window_size, uint32_t hop_size) noexcept
 Compute the number of analysis windows for a given data size.
 
void one_pole (double pole, std::vector< double > &a, std::vector< double > &b)
 One-pole filter specified by pole position.
 
bool one_shot (double input, double time, std::span< double > coefs) noexcept
 Monostable: every rise of the input opens the output for a fixed time.
 
std::vector< double > one_shot_state (double duration, double threshold=0.5)
 Builds the array one_shot reads and writes.
 
std::vector< size_t > onset_positions (std::span< const double > data, uint32_t window_size, uint32_t hop_size, double threshold=0.1)
 Sample indices of onsets detected via spectral flux.
 
std::vector< double > overlapping_windows (std::span< const double > data, uint32_t window_size, double overlap)
 Extract overlapping windows as a flat concatenated vector.
 
double pattern_lookup (std::span< const double > window, std::span< const double > coefs) noexcept
 Table indexed by the recent shape of the window.
 
std::vector< double > peak (std::span< const double > data, size_t n_windows, uint32_t hop_size, uint32_t window_size)
 Peak amplitude per window.
 
std::vector< size_t > peak_positions (std::span< const double > data, double threshold=0.0, size_t min_distance=1)
 Sample indices of local peak maxima in the full span.
 
std::vector< double > percentile (std::span< const double > data, size_t n_windows, uint32_t hop_size, uint32_t window_size, double percentile_value)
 Arbitrary percentile per window via linear interpolation.
 
std::vector< double > phase_vocoder_stretch (std::span< const double > src, double stretch_factor, uint32_t window_size=2048, uint32_t analysis_hop=512)
 Time-stretch via phase vocoder analysis-synthesis.
 
double phasor_bank (std::span< const double > window, std::span< double > coefs) noexcept
 Sum of N sinusoidal partials, each with its own slow amplitude swell.
 
std::vector< double > phasor_bank_state (std::span< const double > increments, std::span< const double > scales={}, std::span< const double > am_increments={}, std::span< const double > phases={}, std::span< const double > am_phases={})
 Builds the array phasor_bank reads and writes.
 
std::vector< double > pitch_shift (std::span< const double > src, double semitones, uint32_t window_size=2048, uint32_t analysis_hop=512)
 Pitch-shift by resampling around a phase vocoder stretch.
 
double pole_radius_from_decay (double seconds, double sample_rate) noexcept
 Pole radius whose impulse response falls by 1/e in a given time.
 
double polynomial_lags (std::span< const double > window, std::span< const double > coefs) noexcept
 Polynomial in several lags at once.
 
std::vector< double > power (std::span< const double > data, size_t n_windows, uint32_t hop_size, uint32_t window_size)
 Power (sum of squares) per window.
 
void power (std::span< double > data, double exponent) noexcept
 Power map y = x^exponent applied in-place Scalar transcendental — not SIMD hot-path.
 
std::vector< double > power_series (size_t count, double ratio, double step, double base=1.0)
 Geometric steps: base * ratio^(k * step) for k = 1 .
 
double pulse_response (double t, double onset, double duration, double rise, double fall, double period=0.0) noexcept
 Level at a time of a leaky response to a rectangular pulse.
 
void pulse_response (std::span< double > out, double t, std::span< const double > onset, std::span< const double > duration, std::span< const double > rise, std::span< const double > fall, std::span< const double > period) noexcept
 pulse_response over arrays, written to out.
 
double q_from_decay (double frequency, double seconds, double sample_rate) noexcept
 Q that gives the bandpass section a stated ring time.
 
double quantile (std::span< const double > window, std::span< const double > coefs)
 Quantile of the whole window, interpolating between ranks.
 
void quantize (std::span< double > data, uint8_t bits) noexcept
 Quantize to n-bit resolution in-place Input is assumed to be in [-1, 1]; values outside are clamped first.
 
double radians_per_sample (double frequency, double sample_rate) noexcept
 Radians per sample for a frequency, for building phasor_bank state.
 
std::vector< double > ramp_exponential (size_t n, double start=0.001, double end=1.0)
 Exponential ramp from start to end over n samples.
 
std::vector< double > ramp_linear (size_t n, double start=0.0, double end=1.0)
 Linear ramp from start to end over n samples.
 
std::vector< double > range (std::span< const double > data, size_t n_windows, uint32_t hop_size, uint32_t window_size)
 Value range (max - min) per window.
 
std::vector< double > rectangular (size_t n, size_t support=std::numeric_limits< size_t >::max(), size_t offset=0)
 Rectangular (boxcar) taper coefficients.
 
bool refractory_gate (double input, double time, std::span< double > coefs) noexcept
 Fires while the input is high, then ignores it for a period.
 
std::vector< double > refractory_gate_state (double period, double threshold=0.5)
 Builds the array refractory_gate reads and writes.
 
std::vector< std::pair< size_t, size_t > > regions_around_positions (const std::vector< size_t > &positions, size_t half_region, size_t data_size)
 Build [start, end) intervals centred on a set of positions.
 
void resonator (double pole_radius, double pole_angle, std::vector< double > &a, std::vector< double > &b)
 Two-pole resonator specified by z-plane pole position.
 
void reverse (std::span< double > data) noexcept
 Reverse temporal order in-place.
 
bool rising_toggle (double input, std::span< double > coefs) noexcept
 Flip-flop: the output inverts on every rise of the input.
 
std::vector< double > rising_toggle_state (double threshold=0.5)
 Builds the array rising_toggle reads and writes.
 
std::vector< double > rms (std::span< const double > data, size_t n_windows, uint32_t hop_size, uint32_t window_size)
 RMS energy per window.
 
double rotor_bank (std::span< const double > window, std::span< double > coefs) noexcept
 Sum of N sinusoids advanced by complex rotation instead of a sine call.
 
std::vector< double > rotor_bank_state (std::span< const double > increments, std::span< const double > scales={}, std::span< const double > phases={})
 Builds the array rotor_bank reads and writes.
 
std::vector< double > savitzky_golay (size_t window, size_t poly_order, size_t derivative=0)
 Savitzky-Golay FIR coefficients for smoothing or differentiation.
 
bool set_reset_latch (const std::vector< double > &inputs, std::span< double > coefs) noexcept
 Memory cell: slot 0 sets it, slot 1 resets it, reset wins.
 
std::vector< double > set_reset_latch_state (double threshold=0.5)
 Builds the array set_reset_latch reads and writes.
 
bool signals_at_least (const std::vector< double > &inputs, std::span< const double > coefs) noexcept
 True when at least k of the input slots are high.
 
std::vector< double > signals_at_least_state (size_t k, double threshold=0.5)
 Builds the array signals_at_least reads.
 
std::vector< double > sinc_bandpass (double low_hz, double high_hz, double sample_rate, size_t taps)
 Windowed-sinc bandpass FIR coefficients.
 
std::vector< double > sinc_highpass (double frequency, double sample_rate, size_t taps)
 Windowed-sinc highpass FIR coefficients.
 
std::vector< double > sinc_lowpass (double frequency, double sample_rate, size_t taps)
 Windowed-sinc lowpass FIR coefficients.
 
std::vector< double > skewness (std::span< const double > data, size_t n_windows, uint32_t hop_size, uint32_t window_size)
 Skewness (standardised third central moment) per window.
 
std::vector< double > slice (std::span< const double > data, double start_ratio, double end_ratio)
 Extract a contiguous slice by ratio, returning a new vector.
 
std::vector< double > slice_intervals (std::span< const double > data, const std::vector< std::pair< size_t, size_t > > &intervals)
 Copy data from a set of half-open intervals into a flat vector.
 
void sort_channels (std::vector< std::span< double > > &channels, SortingDirection direction, SortingAlgorithm algorithm=SortingAlgorithm::STANDARD)
 Sort all channels in-place.
 
std::vector< std::span< double > > sort_channels_into (const std::vector< std::span< const double > > &channels, std::vector< std::vector< double > > &output_storage, SortingDirection direction, SortingAlgorithm algorithm=SortingAlgorithm::STANDARD)
 Sort all channels into caller-owned output buffers.
 
template<typename Container , typename Comparator >
std::vector< size_t > sort_indices (const Container &container, Comparator comp)
 Generic sort-index generator for any random-access container.
 
void sort_span (std::span< double > data, SortingDirection direction, SortingAlgorithm algorithm=SortingAlgorithm::STANDARD)
 Sort a single span in-place.
 
std::span< double > sort_span_into (std::span< const double > data, std::vector< double > &output_storage, SortingDirection direction, SortingAlgorithm algorithm=SortingAlgorithm::STANDARD)
 Sort a span into a caller-owned output buffer.
 
std::vector< size_t > span_sort_indices (std::span< double > data, SortingDirection direction)
 Indices that would sort a span in the given direction.
 
std::vector< double > spectral_energy (std::span< const double > data, size_t n_windows, uint32_t hop_size, uint32_t window_size)
 Spectral energy per window using Hann-windowed FFT.
 
std::vector< double > spectral_filter (std::span< const double > src, double lo_hz, double hi_hz, double sample_rate, uint32_t window_size=1024, uint32_t hop_size=256)
 Hard bandpass filter: zero all bins outside [lo_hz, hi_hz].
 
std::vector< double > spectral_gate (std::span< const double > src, double threshold_db, uint32_t window_size=1024, uint32_t hop_size=256)
 Hard spectral gate: zero bins whose magnitude is below the threshold.
 
std::vector< double > spectral_invert (std::span< const double > src, uint32_t window_size=1024, uint32_t hop_size=256)
 Spectral phase inversion (conjugate all bins)
 
std::vector< double > split_pairs (std::span< const double > values, double spread)
 Each value replaced by a close pair, v * (1 - spread) and v * (1 + spread).
 
bool state_machine (double input, std::span< double > coefs) noexcept
 Mealy machine: the state and the input bit pick the next state and the output.
 
std::vector< double > state_machine_state (std::span< const double > table, double threshold=0.5, size_t initial=0)
 Builds the array state_machine reads and writes.
 
std::vector< double > std_dev (std::span< const double > data, size_t n_windows, uint32_t hop_size, uint32_t window_size, bool sample_variance=true)
 Standard deviation per window.
 
bool step_pattern (double input, std::span< double > coefs) noexcept
 A table of bits advanced by the rises of the input.
 
double step_sequence (std::span< const double > window, std::span< double > coefs) noexcept
 Table of values advanced by a trigger.
 
std::vector< double > step_sequence_state (std::span< const double > values, double threshold=0.5)
 Builds the array step_sequence reads and writes.
 
std::vector< double > stretched_series (size_t count, double stretch, double base=1.0)
 Integers pulled outward with order: base * n * sqrt(1 + stretch * n^2).
 
std::vector< double > sum (std::span< const double > data, size_t n_windows, uint32_t hop_size, uint32_t window_size)
 Sum per window.
 
double table_lookup (std::span< const double > window, std::span< const double > coefs) noexcept
 Transfer table indexed by the current value.
 
double table_lookup_previous (std::span< const double > window, std::span< const double > coefs) noexcept
 table_lookup indexed by window[1] instead of window[0].
 
double tapped_sum (std::span< const double > window, std::span< const double > coefs) noexcept
 Sum of gain * window[lag] over (lag, gain) pairs.
 
std::vector< double > time_stretch (std::span< const double > data, double stretch_factor)
 Time-stretch via linear interpolation resampling Fast but alias-naive: no anti-aliasing pre-filter is applied when stretch_factor < 1.
 
uint32_t to_word (double value, uint32_t bits) noexcept
 The offset binary word of a value, clamped to [-1, 1].
 
std::vector< double > trapezoid (size_t n, size_t fade_len)
 Trapezoid taper coefficients with configurable flat region.
 
bool truth_table (std::span< const bool > history, std::span< const double > coefs) noexcept
 Any boolean function of the last bits, as a table.
 
std::vector< double > truth_table_state (size_t arity, uint64_t rule)
 Builds the array truth_table reads.
 
bool validate_window_parameters (uint32_t window_size, uint32_t hop_size, size_t data_size) noexcept
 Validate window/hop parameters for windowed processing.
 
std::vector< double > variance (std::span< const double > data, size_t n_windows, uint32_t hop_size, uint32_t window_size, bool sample_variance=true)
 Variance per window.
 
double weighted_sum (std::span< const double > window, std::span< const double > coefs) noexcept
 Sum of window[k] * coefs[k] over the shorter of the two.
 
bool window_comparator (const std::vector< double > &inputs, std::span< const double > coefs) noexcept
 True while slot 0 lies strictly between slot 1 and slot 2.
 
std::vector< double > windowed_by_indices (std::span< const double > data, const std::vector< size_t > &window_starts, uint32_t window_size)
 Extract windows at specific starting indices as a flat concatenated vector.
 
uint32_t xorshift32 (uint32_t state) noexcept
 One step of the 32-bit xorshift generator.
 
std::vector< size_t > zero_crossing_positions (std::span< const double > data, double threshold=0.0)
 Sample indices of zero crossings in the full span.
 
std::vector< double > zero_crossing_rate (std::span< const double > data, size_t n_windows, uint32_t hop_size, uint32_t window_size)
 Zero-crossing rate per window.
 
double zscore (std::span< const double > window, std::span< const double > coefs) noexcept
 How far the newest value sits from the rest of the window, in standard deviations.