Skip to content

Commit 416bf00

Browse files
committed
feat: improve Gaussian dither
1 parent fe7ca0d commit 416bf00

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

playback/src/dither.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,15 @@ impl Ditherer for GaussianDitherer {
8282
fn new() -> Self {
8383
Self {
8484
cached_rng: create_rng(),
85-
// 1/2 LSB RMS needed to linearize the response:
86-
distribution: Normal::new(0.0, 0.5).unwrap(),
85+
// For Gaussian to achieve equivalent decorrelation to triangular dithering, it needs
86+
// 3-4 dB higher amplitude than TPDF's optimal 0.408 LSB. If optimizing:
87+
// - minimum correlation: σ ≈ 0.58
88+
// - perceptual equivalence: σ ≈ 0.65
89+
// - worst-case performance: σ ≈ 0.70
90+
//
91+
// σ = 0.6 LSB is a reasonable compromise that balances mathematical theory with
92+
// empirical performance across various signal types.
93+
distribution: Normal::new(0.0, 0.6).unwrap(),
8794
}
8895
}
8996

0 commit comments

Comments
 (0)