DSPark 1.9.0
Header-only C++20 DSP for real-time and offline audio
Loading...
Searching...
No Matches
dspark::OversamplingDryPath< T, MaxChannels > Class Template Reference

Carries a dry signal through the same round trip as an Oversampling engine, so that a dry/wet mix adds in phase at every frequency. More...

#include <Oversampling.h>

Public Types

using Engine = Oversampling< T, MaxChannels >
 

Public Member Functions

void prepare (const AudioSpec &spec, const Engine &engine)
 Sizes the path for an engine.
 
void reset () noexcept
 Clears the path's memory.
 
int getLatency () const noexcept
 The delay of the path in base-rate samples, as the engine reports its own.
 
void process (AudioBufferView< T > dry) noexcept
 Passes a block of the dry signal through the path, in place.
 

Detailed Description

template<typename T, int MaxChannels = 16>
class dspark::OversamplingDryPath< T, MaxChannels >

Carries a dry signal through the same round trip as an Oversampling engine, so that a dry/wet mix adds in phase at every frequency.

A linear-phase engine delays by a whole number of samples at every frequency, and the dry path is that delay. A polyphase IIR engine does not: its round-trip delay is fractional and rises towards the band edge (3.07 samples at 1 kHz and 4.23 at 18 kHz for 2x High at 48 kHz), so against a dry signal delayed by the rounded figure a 50 % mix of an untouched wet signal measures a notch above the middle of the band. Here the dry signal runs through a twin of the engine with nothing between its two halves, which is the same linear filter the wet signal crosses: the two add in phase, and a wet path that does nothing nulls against the dry one exactly.

The twin costs what the engine's filters cost (at 2x High, about as much again as the round trip itself); the linear-phase case costs a delay.

Threading: prepare() and reset() on the setup thread (prepare allocates); process() on the audio thread, noexcept and allocation-free.

Template Parameters
TSample type (float or double).
MaxChannelsMaximum number of channels supported.

Definition at line 1301 of file Oversampling.h.

Member Typedef Documentation

◆ Engine

template<typename T , int MaxChannels = 16>
using dspark::OversamplingDryPath< T, MaxChannels >::Engine = Oversampling<T, MaxChannels>

Definition at line 1304 of file Oversampling.h.

Member Function Documentation

◆ getLatency()

template<typename T , int MaxChannels = 16>
int dspark::OversamplingDryPath< T, MaxChannels >::getLatency ( ) const
inlinenoexcept

The delay of the path in base-rate samples, as the engine reports its own.

Definition at line 1346 of file Oversampling.h.

◆ prepare()

template<typename T , int MaxChannels = 16>
void dspark::OversamplingDryPath< T, MaxChannels >::prepare ( const AudioSpec &  spec,
const Engine &  engine 
)
inline

Sizes the path for an engine.

Parameters
specThe specification the engine was prepared with (base rate).
engineThe engine whose round trip the dry signal has to match, already prepared with the same specification (with Oversampling::Band::Audible its delay is known only then). Its factor, quality, mode, depth, band and latency are read.

Definition at line 1314 of file Oversampling.h.

◆ process()

template<typename T , int MaxChannels = 16>
void dspark::OversamplingDryPath< T, MaxChannels >::process ( AudioBufferView< T >  dry)
inlinenoexcept

Passes a block of the dry signal through the path, in place.

Parameters
dryBase-rate block. Blocks longer than prepare()'s maxBlockSize keep their tail untouched; channels beyond the prepared count are left alone.

Definition at line 1354 of file Oversampling.h.

◆ reset()

template<typename T , int MaxChannels = 16>
void dspark::OversamplingDryPath< T, MaxChannels >::reset ( )
inlinenoexcept

Clears the path's memory.

Definition at line 1338 of file Oversampling.h.


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