mirror of
https://github.com/librespot-org/librespot.git
synced 2025-10-03 17:59:24 +02:00
feat: improve Gaussian dither
This commit is contained in:
parent
fe7ca0d700
commit
416bf00888
1 changed files with 9 additions and 2 deletions
|
@ -82,8 +82,15 @@ impl Ditherer for GaussianDitherer {
|
||||||
fn new() -> Self {
|
fn new() -> Self {
|
||||||
Self {
|
Self {
|
||||||
cached_rng: create_rng(),
|
cached_rng: create_rng(),
|
||||||
// 1/2 LSB RMS needed to linearize the response:
|
// For Gaussian to achieve equivalent decorrelation to triangular dithering, it needs
|
||||||
distribution: Normal::new(0.0, 0.5).unwrap(),
|
// 3-4 dB higher amplitude than TPDF's optimal 0.408 LSB. If optimizing:
|
||||||
|
// - minimum correlation: σ ≈ 0.58
|
||||||
|
// - perceptual equivalence: σ ≈ 0.65
|
||||||
|
// - worst-case performance: σ ≈ 0.70
|
||||||
|
//
|
||||||
|
// σ = 0.6 LSB is a reasonable compromise that balances mathematical theory with
|
||||||
|
// empirical performance across various signal types.
|
||||||
|
distribution: Normal::new(0.0, 0.6).unwrap(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue