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

#include <stn_decomposer.hpp>

Public Member Functions

void prepare (const StnConfig &config)
 RT contract: prepare() allocates history, scratch, and mask storage and is not audio-thread safe.
int num_bins () const
const StnMasksT< SampleType > & process (const SampleType *mag)
 Push one magnitude frame and compute its STN masks.
const SampleType * center_magnitude () const
 The center-frame magnitude the current masks apply to (delayed by (time_median-1)/2 frames vs the newest pushed frame).
int latency_frames () const
void reset ()

Static Public Member Functions

static bool checked_retained_bytes (const StnConfig &config, std::uint64_t target_max_bytes, std::uint64_t &bytes) noexcept

Member Function Documentation

◆ center_magnitude()

template<typename SampleType = float>
const SampleType * pulp::signal::StnDecomposerT< SampleType >::center_magnitude ( ) const
inline

The center-frame magnitude the current masks apply to (delayed by (time_median-1)/2 frames vs the newest pushed frame).

◆ checked_retained_bytes()

template<typename SampleType = float>
bool pulp::signal::StnDecomposerT< SampleType >::checked_retained_bytes ( const StnConfig & config,
std::uint64_t target_max_bytes,
std::uint64_t & bytes )
inlinestaticnoexcept

◆ latency_frames()

template<typename SampleType = float>
int pulp::signal::StnDecomposerT< SampleType >::latency_frames ( ) const
inline

◆ num_bins()

template<typename SampleType = float>
int pulp::signal::StnDecomposerT< SampleType >::num_bins ( ) const
inline

◆ prepare()

template<typename SampleType = float>
void pulp::signal::StnDecomposerT< SampleType >::prepare ( const StnConfig & config)
inline

RT contract: prepare() allocates history, scratch, and mask storage and is not audio-thread safe.

After prepare(), process(), center_magnitude(), latency_frames(), reset(), and accessors are allocation-free for the prepared num_bins/window sizes.

◆ process()

template<typename SampleType = float>
const StnMasksT< SampleType > & pulp::signal::StnDecomposerT< SampleType >::process ( const SampleType * mag)
inline

Push one magnitude frame and compute its STN masks.

mag holds num_bins magnitudes (linear). The returned masks reference internal storage valid until the next call. The time-median is centered on the frame that sits in the middle of the history, so there is an inherent (time_median-1)/2-frame latency before a frame's masks are final; transient material in the newest frame is still detected (the frequency-median is computed on the newest frame directly).

◆ reset()

template<typename SampleType = float>
void pulp::signal::StnDecomposerT< SampleType >::reset ( )
inline

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