DSPark 1.8.0
Header-only C++20 DSP for real-time and offline audio
Loading...
Searching...
No Matches
dspark::detail::OnsetNovelty< T > Class Template Referencefinal

Shared whitening, spectral/complex flux and SuperFlux feature history. More...

#include <OnsetFeatures.h>

Classes

struct  Frame
 

Public Types

enum class  Method { SpectralFlux , ComplexDomain , SuperFlux , BothFlux }
 

Public Member Functions

void prepare (double sampleRate, int fftSize, bool boundedWorkspace=false)
 Allocates histories and the canonical quarter-tone filterbank.
 
void reset () noexcept
 Clears feature history without allocation or changing the filterbank.
 
int getNumBands () const noexcept
 
Frame process (std::span< T > mag, std::span< const T > phase, Method method, bool whiten=false) noexcept
 Advances one frame; optional whitening modifies the supplied magnitudes. Phase-less frames support SpectralFlux, SuperFlux and BothFlux. ComplexDomain requires phases on every frame since reset; missing/incompatible data returns valid=false without changing history. No source clock is inferred here.
 

Static Public Member Functions

static std::size_t preparationBytes (int fftSize) noexcept
 Setup payload allowance when prepare() reserves the bounded filterbank.
 

Static Public Attributes

static constexpr int kNumRegisters = 4
 

Detailed Description

template<FloatType T>
class dspark::detail::OnsetNovelty< T >

Shared whitening, spectral/complex flux and SuperFlux feature history.

Definition at line 199 of file OnsetFeatures.h.

Member Enumeration Documentation

◆ Method

template<FloatType T>
enum class dspark::detail::OnsetNovelty::Method
strong
Enumerator
SpectralFlux 
ComplexDomain 
SuperFlux 
BothFlux 

Definition at line 202 of file OnsetFeatures.h.

Member Function Documentation

◆ getNumBands()

template<FloatType T>
int dspark::detail::OnsetNovelty< T >::getNumBands ( ) const
inlinenoexcept

Definition at line 256 of file OnsetFeatures.h.

◆ preparationBytes()

template<FloatType T>
static std::size_t dspark::detail::OnsetNovelty< T >::preparationBytes ( int  fftSize)
inlinestaticnoexcept

Setup payload allowance when prepare() reserves the bounded filterbank.

Definition at line 219 of file OnsetFeatures.h.

◆ prepare()

template<FloatType T>
void dspark::detail::OnsetNovelty< T >::prepare ( double  sampleRate,
int  fftSize,
bool  boundedWorkspace = false 
)
inline

Allocates histories and the canonical quarter-tone filterbank.

Definition at line 225 of file OnsetFeatures.h.

◆ process()

template<FloatType T>
Frame dspark::detail::OnsetNovelty< T >::process ( std::span< T >  mag,
std::span< const T >  phase,
Method  method,
bool  whiten = false 
)
inlinenoexcept

Advances one frame; optional whitening modifies the supplied magnitudes. Phase-less frames support SpectralFlux, SuperFlux and BothFlux. ComplexDomain requires phases on every frame since reset; missing/incompatible data returns valid=false without changing history. No source clock is inferred here.

Definition at line 267 of file OnsetFeatures.h.

◆ reset()

template<FloatType T>
void dspark::detail::OnsetNovelty< T >::reset ( )
inlinenoexcept

Clears feature history without allocation or changing the filterbank.

Definition at line 245 of file OnsetFeatures.h.

Member Data Documentation

◆ kNumRegisters

template<FloatType T>
constexpr int dspark::detail::OnsetNovelty< T >::kNumRegisters = 4
staticconstexpr

Definition at line 209 of file OnsetFeatures.h.


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