Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::signal::LinkwitzRileyCrossoverT< SampleType, MaxBands > Class Template Reference

Fixed-capacity Linkwitz-Riley crossover for two or more ordered bands. More...

#include <linkwitz_riley.hpp>

Classes

struct  Frame

Public Member Functions

bool prepare (SampleType sample_rate, std::span< const SampleType > cutoffs) noexcept
 Establish the sample rate, band count, and initial cutoff set.
bool set_cutoffs (std::span< const SampleType > cutoffs, std::size_t transition_samples=0) noexcept
 Retune all cutoffs together.
Frame process (SampleType input) noexcept
void reset () noexcept
std::size_t band_count () const noexcept
std::size_t cutoff_count () const noexcept
SampleType cutoff (std::size_t index) const noexcept
SampleType sample_rate () const noexcept
bool transitioning () const noexcept
bool healthy () const noexcept
std::uint64_t fault_count () const noexcept
std::size_t minimum_transition_samples (std::span< const SampleType > cutoffs) const noexcept
 Minimum safe nonzero transition for the requested cutoff set.

Static Public Member Functions

static constexpr double maximum_downward_log_slew_nepers_per_second () noexcept
 Maximum accepted downward motion in the logarithm of the bilinear-warped cutoff.
static constexpr int latency_samples () noexcept
static bool supports_configuration (SampleType sample_rate, std::span< const SampleType > cutoffs) noexcept
 True when the exact double-precision internal realization has finite, non-degenerate coefficients and poles separated from the unit circle.
static std::complex< double > band_response (std::span< const SampleType > cutoffs, std::size_t band, double frequency_hz, double sample_rate) noexcept
 Exact complex response of one configured band, including the all-pass compensation that makes the complete band sum flat.
static std::complex< double > reconstruction_response (std::span< const SampleType > cutoffs, double frequency_hz, double sample_rate) noexcept

Static Public Attributes

static constexpr std::size_t max_bands = MaxBands

Detailed Description

template<typename SampleType = float, std::size_t MaxBands = 8>
class pulp::signal::LinkwitzRileyCrossoverT< SampleType, MaxBands >

Fixed-capacity Linkwitz-Riley crossover for two or more ordered bands.

Each split is fourth-order (LR4). Earlier bands pass through the all-pass sum of every later split, so adding all returned bands reconstructs a flat magnitude response with the common minimum-phase response of the cascade.

RT contract: prepare/configuration, process, reset, and response inspection use fixed storage and allocate no memory. Band count is fixed by prepare(); a realtime retune may change only the existing ordered cutoffs. Smoothed retunes use a topology-preserving-transform bank, avoiding both coefficient- dependent state reinterpretation and cross-bank phase cancellation. Downward moves must meet the bound reported by minimum_transition_samples().

Member Function Documentation

◆ band_count()

template<typename SampleType = float, std::size_t MaxBands = 8>
std::size_t pulp::signal::LinkwitzRileyCrossoverT< SampleType, MaxBands >::band_count ( ) const
inlinenoexcept

◆ band_response()

template<typename SampleType = float, std::size_t MaxBands = 8>
std::complex< double > pulp::signal::LinkwitzRileyCrossoverT< SampleType, MaxBands >::band_response ( std::span< const SampleType > cutoffs,
std::size_t band,
double frequency_hz,
double sample_rate )
inlinestaticnoexcept

Exact complex response of one configured band, including the all-pass compensation that makes the complete band sum flat.

◆ cutoff()

template<typename SampleType = float, std::size_t MaxBands = 8>
SampleType pulp::signal::LinkwitzRileyCrossoverT< SampleType, MaxBands >::cutoff ( std::size_t index) const
inlinenoexcept

◆ cutoff_count()

template<typename SampleType = float, std::size_t MaxBands = 8>
std::size_t pulp::signal::LinkwitzRileyCrossoverT< SampleType, MaxBands >::cutoff_count ( ) const
inlinenoexcept

◆ fault_count()

template<typename SampleType = float, std::size_t MaxBands = 8>
std::uint64_t pulp::signal::LinkwitzRileyCrossoverT< SampleType, MaxBands >::fault_count ( ) const
inlinenoexcept

◆ healthy()

template<typename SampleType = float, std::size_t MaxBands = 8>
bool pulp::signal::LinkwitzRileyCrossoverT< SampleType, MaxBands >::healthy ( ) const
inlinenoexcept

◆ latency_samples()

template<typename SampleType = float, std::size_t MaxBands = 8>
constexpr int pulp::signal::LinkwitzRileyCrossoverT< SampleType, MaxBands >::latency_samples ( )
inlinestaticconstexprnoexcept

◆ maximum_downward_log_slew_nepers_per_second()

template<typename SampleType = float, std::size_t MaxBands = 8>
constexpr double pulp::signal::LinkwitzRileyCrossoverT< SampleType, MaxBands >::maximum_downward_log_slew_nepers_per_second ( )
inlinestaticconstexprnoexcept

Maximum accepted downward motion in the logarithm of the bilinear-warped cutoff.

This parameter-rate guarantee does not imply a signal peak bound, which also depends on the recursive state established by prior input.

◆ minimum_transition_samples()

template<typename SampleType = float, std::size_t MaxBands = 8>
std::size_t pulp::signal::LinkwitzRileyCrossoverT< SampleType, MaxBands >::minimum_transition_samples ( std::span< const SampleType > cutoffs) const
inlinenoexcept

Minimum safe nonzero transition for the requested cutoff set.

Returning max() means the configuration is invalid for this prepared topology or that no nonzero transition length can represent the requested motion.

◆ prepare()

template<typename SampleType = float, std::size_t MaxBands = 8>
bool pulp::signal::LinkwitzRileyCrossoverT< SampleType, MaxBands >::prepare ( SampleType sample_rate,
std::span< const SampleType > cutoffs )
inlinenoexcept

Establish the sample rate, band count, and initial cutoff set.

Cutoffs must be finite, strictly increasing, and inside (0, Nyquist).

◆ process()

template<typename SampleType = float, std::size_t MaxBands = 8>
Frame pulp::signal::LinkwitzRileyCrossoverT< SampleType, MaxBands >::process ( SampleType input)
inlinenoexcept

◆ reconstruction_response()

template<typename SampleType = float, std::size_t MaxBands = 8>
std::complex< double > pulp::signal::LinkwitzRileyCrossoverT< SampleType, MaxBands >::reconstruction_response ( std::span< const SampleType > cutoffs,
double frequency_hz,
double sample_rate )
inlinestaticnoexcept

◆ reset()

template<typename SampleType = float, std::size_t MaxBands = 8>
void pulp::signal::LinkwitzRileyCrossoverT< SampleType, MaxBands >::reset ( )
inlinenoexcept

◆ sample_rate()

template<typename SampleType = float, std::size_t MaxBands = 8>
SampleType pulp::signal::LinkwitzRileyCrossoverT< SampleType, MaxBands >::sample_rate ( ) const
inlinenoexcept

◆ set_cutoffs()

template<typename SampleType = float, std::size_t MaxBands = 8>
bool pulp::signal::LinkwitzRileyCrossoverT< SampleType, MaxBands >::set_cutoffs ( std::span< const SampleType > cutoffs,
std::size_t transition_samples = 0 )
inlinenoexcept

Retune all cutoffs together.

A zero-length transition changes the live coefficients immediately. A nonzero transition logarithmically moves the bilinear-warped cutoff design values for exactly transition_samples processed samples. Configuration rejects trajectories whose rounded multiplier and accumulated product error cannot bound the final endpoint correction. Only bounded arithmetic occurs in process().

◆ supports_configuration()

template<typename SampleType = float, std::size_t MaxBands = 8>
bool pulp::signal::LinkwitzRileyCrossoverT< SampleType, MaxBands >::supports_configuration ( SampleType sample_rate,
std::span< const SampleType > cutoffs )
inlinestaticnoexcept

True when the exact double-precision internal realization has finite, non-degenerate coefficients and poles separated from the unit circle.

This is the supported-domain predicate used by prepare() and retunes.

◆ transitioning()

template<typename SampleType = float, std::size_t MaxBands = 8>
bool pulp::signal::LinkwitzRileyCrossoverT< SampleType, MaxBands >::transitioning ( ) const
inlinenoexcept

Member Data Documentation

◆ max_bands

template<typename SampleType = float, std::size_t MaxBands = 8>
std::size_t pulp::signal::LinkwitzRileyCrossoverT< SampleType, MaxBands >::max_bands = MaxBands
staticconstexpr

The documentation for this class was generated from the following file: