Applies a dither to a single sample value.
Namespace: Un4seen.Bass
Assembly: Bass.Net (in Bass.Net.dll) Version: 2.4.17.5
Syntax
Parameters
- sample
- Type: SystemDouble
The sample data to add a dither to (e.g. an 8- or 16-bit sample value as a double value). - factor
- Type: SystemDouble
The bit depth factor for the dither (typically between 0.3 and 0.9). - max
- Type: SystemDouble
The maximum sample data range (e.g. 256 for 8-bit samples or 32768 for 16-bit samples).
Return Value
Type: DoubleThe dithered sample value:
Remarks
Dithering here is implemented as a triangular probability density function (TPDF), actually a factor-bit triangular dither.
All parameters here are implemented as double values for maximum precision and performance. However, you might also pass 8-bit(byte) or 16-bit(short) values and then simply cast back the return value.
See Also