marvin 0.0.1
Pure C++ audio helper library
 
Loading...
Searching...
No Matches
marvin::dsp::filters::SIMDBiquad< SampleType, N > Class Template Referencefinal

A SIMD optimised biquad, for running N biquads in parallel. More...

#include <marvin_SIMDBiquad.h>

Public Member Functions

 SIMDBiquad ()
 
auto setCoeffs (BiquadCoefficients< SampleType > coeffs) noexcept -> void
 
auto setCoeffs (size_t index, BiquadCoefficients< SampleType > coeffs) noexcept -> void
 
auto operator() (std::span< SampleType, N > x) noexcept -> void
 
auto reset () noexcept -> void
 

Detailed Description

template<marvin::FloatType SampleType, size_t N>
requires (N > 0)
class marvin::dsp::filters::SIMDBiquad< SampleType, N >

A SIMD optimised biquad, for running N biquads in parallel.

From benchmarks, only gives a speedup in certain cases, and even in those cases, only ~100ns. That being said, a robust parallel structure for filters is arguably nicer than a std::array<filter, N>.

Template Parameters
SampleTypefloat or double
NThe number of parallel biquads to process

Constructor & Destructor Documentation

◆ SIMDBiquad()

template<marvin::FloatType SampleType, size_t N>
marvin::dsp::filters::SIMDBiquad< SampleType, N >::SIMDBiquad ( )
inline

Constructor

Member Function Documentation

◆ operator()()

template<marvin::FloatType SampleType, size_t N>
auto marvin::dsp::filters::SIMDBiquad< SampleType, N >::operator() ( std::span< SampleType, N > x) -> void
inlinenoexcept

Processes all samples in x through their respective biquads, and overwrites the values in x

Parameters
xAn array-like containing N samples to be filtered.

◆ reset()

template<marvin::FloatType SampleType, size_t N>
auto marvin::dsp::filters::SIMDBiquad< SampleType, N >::reset ( ) -> void
inlinenoexcept

Zeroes all internal state (except coefficients).

◆ setCoeffs() [1/2]

template<marvin::FloatType SampleType, size_t N>
auto marvin::dsp::filters::SIMDBiquad< SampleType, N >::setCoeffs ( BiquadCoefficients< SampleType > coeffs) -> void
inlinenoexcept

Sets the coefficients for all filters to the ones passed to the coeffs arg

Parameters
coeffsA BiquadCoefficients<SampleType> containing the coeffs you want to set.

◆ setCoeffs() [2/2]

template<marvin::FloatType SampleType, size_t N>
auto marvin::dsp::filters::SIMDBiquad< SampleType, N >::setCoeffs ( size_t index,
BiquadCoefficients< SampleType > coeffs ) -> void
inlinenoexcept

Sets the coefficients for a specific biquad

Parameters
index
coeffs

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