Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
dither.hpp File Reference

Deterministic TPDF dither and bounded error-feedback quantization. More...

#include <pulp/signal/denormal.hpp>
#include <pulp/signal/rng.hpp>
#include <algorithm>
#include <cmath>
#include <cstdint>
#include <limits>

Go to the source code of this file.

Classes

struct  pulp::signal::NoiseShaperStateT< SampleType >
struct  pulp::signal::DitheredQuantizationResultT< SampleType >
 Public intermediate returned by the pure quantizer transition. More...
class  pulp::signal::DitherQuantizerT< SampleType >
 Stateful deterministic wrapper for per-sample and block processing. More...

Namespaces

namespace  pulp
namespace  pulp::signal

Typedefs

using pulp::signal::DitherQuantizer = DitherQuantizerT<float>
using pulp::signal::DitherQuantizer64 = DitherQuantizerT<double>

Enumerations

enum class  pulp::signal::DitherMode : std::uint8_t { pulp::signal::none = 0 , pulp::signal::tpdf = 1 }
enum class  pulp::signal::NoiseShapingOrder : std::uint8_t { pulp::signal::none = 0 , pulp::signal::first = 1 , pulp::signal::second = 2 }

Functions

template<typename SampleType>
constexpr SampleType pulp::signal::tpdf_difference (SampleType first, SampleType second) noexcept
 Converts two independent uniform draws in [0, 1) to unit-peak TPDF noise.
template<typename SampleType>
constexpr SampleType pulp::signal::tpdf_centered_sum (SampleType first, SampleType second) noexcept
template<typename SampleType>
SampleType pulp::signal::quantization_step (SampleType bits) noexcept
 Mid-tread quantization step for a continuous bit-depth control.
template<typename SampleType>
DitheredQuantizationResultT< SampleType > pulp::signal::quantize_with_error_feedback (SampleType input, SampleType step, DitherMode dither_mode, NoiseShapingOrder shaping, NoiseShaperStateT< SampleType > &state, SampleType first_uniform=SampleType{}, SampleType second_uniform=SampleType{}) noexcept
 One allocation-free error-feedback transition.

Detailed Description

Deterministic TPDF dither and bounded error-feedback quantization.