|
DSPark 1.9.0
Header-only C++20 DSP for real-time and offline audio
|
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. | |
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.
| T | Sample type (float or double). |
| MaxChannels | Maximum number of channels supported. |
Definition at line 1301 of file Oversampling.h.
| using dspark::OversamplingDryPath< T, MaxChannels >::Engine = Oversampling<T, MaxChannels> |
Definition at line 1304 of file Oversampling.h.
|
inlinenoexcept |
The delay of the path in base-rate samples, as the engine reports its own.
Definition at line 1346 of file Oversampling.h.
|
inline |
Sizes the path for an engine.
| spec | The specification the engine was prepared with (base rate). |
| engine | The 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.
|
inlinenoexcept |
Passes a block of the dry signal through the path, in place.
| dry | Base-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.
|
inlinenoexcept |
Clears the path's memory.
Definition at line 1338 of file Oversampling.h.