Expand description
The dither module provides methods to apply a dither to a sample.
Dithering is the process of adding noise to the least significant digits of a sample before down-converting (quantizing) it to a smaller sample type. The purpose of dithering is to decorrelate the quantization error of the down-conversion from the source signal.
Dithering is only applied on lossy conversions. Therefore the dither module will only
apply a dither to the following down-conversions:
- {
i32,u32} to {i24,u24,i16,u16,i8,u8} - {
i24,u24} to {i16,u16,i8,u8} - {
i16,u16} to {i8,u8}
Multiple dithering algorithms are provided, each drawing noise from a different probability distribution. In addition to different distributions, a dithering algorithm may also shape the noise such that the bulk of the noise is placed in an inaudible frequency range.
Structs§
- Identity
- The
Identitydithering algorithm performs no dithering and returns the original sample. - Random
Noise RandomNoiserepresents a sample of noise of a specified length in bits.- Rectangular
Rectangularimplements a dither using uniformly distributed (white) noise without shaping.- Triangular
Triangularimplements a dither using a triangular distribution of noise without shaping.
Enums§
- Dither
Type - Enumeration of dither algorithms.
Traits§
- AddNoise
AddNoiseis a trait for converting random noise into aSample.- Dither
Ditheris a trait for implementing dithering algorithms.- Maybe
Dither MaybeDitherconditionally applies a dither to a sample depending on the source and destination sample types.