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

2x half-band upsampler. More...

#include <halfband_iir.hpp>

Public Member Functions

 HalfBandUpsampler2xT () noexcept
 HalfBandUpsampler2xT (std::span< const SampleType > coeffs_a, std::span< const SampleType > coeffs_b) noexcept
std::size_t sections_a () const noexcept
 Number of allpass sections in path A.
std::size_t sections_b () const noexcept
 Number of allpass sections in path B.
bool configured () const noexcept
void reset () noexcept
void process (SampleType x, SampleType &out_lo, SampleType &out_hi) noexcept
 Produce two output samples for one input sample.
void process_block (std::span< const SampleType > input, std::span< SampleType > output) noexcept
 Block helper.

Detailed Description

template<typename SampleType = float>
class pulp::signal::HalfBandUpsampler2xT< SampleType >

2x half-band upsampler.

Each call to process(x, out_lo, out_hi) consumes one input sample and produces two output samples at twice the rate. The two polyphase outputs are interleaved as (out_lo, out_hi) — out_lo is time-aligned with x (after the filter's group delay), out_hi is the new sample inserted between successive inputs. Each path is individually allpass; the half-band response emerges when the two outputs are interleaved into a single 2x-rate stream — the path phase difference is 0 in the passband (samples reinforce) and pi in the stopband (samples cancel).

A thin wrapper over HalfBandIirStageT, so silence decays to exact zero (see that class). Custom coefficients must give path A the same number of sections as path B or one more, at most eight each; any other shape leaves the upsampler silent and configured() false.

RT contract: no member allocates, including the constructors.

Constructor & Destructor Documentation

◆ HalfBandUpsampler2xT() [1/2]

template<typename SampleType = float>
pulp::signal::HalfBandUpsampler2xT< SampleType >::HalfBandUpsampler2xT ( )
inlinenoexcept

◆ HalfBandUpsampler2xT() [2/2]

template<typename SampleType = float>
pulp::signal::HalfBandUpsampler2xT< SampleType >::HalfBandUpsampler2xT ( std::span< const SampleType > coeffs_a,
std::span< const SampleType > coeffs_b )
inlinenoexcept

Member Function Documentation

◆ configured()

template<typename SampleType = float>
bool pulp::signal::HalfBandUpsampler2xT< SampleType >::configured ( ) const
inlinenoexcept

◆ process()

template<typename SampleType = float>
void pulp::signal::HalfBandUpsampler2xT< SampleType >::process ( SampleType x,
SampleType & out_lo,
SampleType & out_hi )
inlinenoexcept

Produce two output samples for one input sample.

◆ process_block()

template<typename SampleType = float>
void pulp::signal::HalfBandUpsampler2xT< SampleType >::process_block ( std::span< const SampleType > input,
std::span< SampleType > output )
inlinenoexcept

Block helper.

input length N produces output length 2N; the two must not overlap.

◆ reset()

template<typename SampleType = float>
void pulp::signal::HalfBandUpsampler2xT< SampleType >::reset ( )
inlinenoexcept

◆ sections_a()

template<typename SampleType = float>
std::size_t pulp::signal::HalfBandUpsampler2xT< SampleType >::sections_a ( ) const
inlinenoexcept

Number of allpass sections in path A.

◆ sections_b()

template<typename SampleType = float>
std::size_t pulp::signal::HalfBandUpsampler2xT< SampleType >::sections_b ( ) const
inlinenoexcept

Number of allpass sections in path B.


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