[sdiy] 12 bit quantization noise, dithering, synths
Chris McDowell
declareupdate at gmail.com
Sat Feb 11 04:58:31 CET 2023
Thank you all for the feedback!
I had already set the optimization "for speed", but it seems like some parallel processing magic didn't kick in until I tried over sampling the noise 2x. I found a rando lfsr noise function online, highpassed and lowpassed with chamberlin svfs, and am now getting 8 voices at 53k with a very low noise floor and no obvious quantization distortion. I was annoyed when my AC kicked on and could no longer hear any issues, then realized "oh, that's um, good". My wife said "oh and I used the hair dryer, I'm so sorry if you couldn't hear your wiggling bits!" What a gem she is.
I now have a healthy timing budget and no funky envelope tails. I'm now confused that -increasing- my buffer size in my ping pong scheme introduces buffer underrun sounding errors, but alas no official underrun interrupts and a buffer of 16 samples works beautifully. I'll post a link to samples here when I get a chance.
Cheers,
Chris McDowell
> On Feb 10, 2023, at 3:58 PM, Tom Wiltshire <tom at electricdruid.net> wrote:
>
> To answer the other part of your question, plenty of the "historical" 8 and 12-bit audio systems used non-linear DACs or companding to extended the dynamic range. So what you were listening to *wasn't* a simple 8-bit output.
>
> As you've noticed, the problems are far worse at low amplitude levels where the quantisation noise becomes a significant portion of the signal level. So if you can keep the signal louder, you can reduce the problem. Some systems (Synclavier, for example) did this by using multiplying DACs, and generating the audio at full volume, and then applying the envelope to the DAC's reference voltage. This maintains the full 8-bit (or 12, whatever) resolution all the way to the very quietest output.
> Using an expander to "squash" the output volume rather than trying to create it digitally is another way, and non-linear DACs like the AM6070 are another way. They use what is roughly a very basic floating-point format with some bits of data and some bits representing how many shifts the data should get, or equivalently, what voltage range it should get scaled into. The Casio CZ series did something similar to avoid the need for a more expensive DAC - it used a cheaper DAC with less resolution, but then scaled the output according to the MSBs.
>
> Tom
>
> ==================
> Electric Druid
> Synth & Stompbox DIY
> ==================
>
>
>
>> On 10 Feb 2023, at 20:05, Chris McDowell via Synth-diy <synth-diy at synth-diy.org> wrote:
>>
>> Howdy list,
>>
>> I'm working on some FM synth code running on an STM32G431 (technically PM if you caught discussion a bit ago on this list)
>> For the most part, this chip is well suited to "chill" digital synthesis. I've got a handful of voices running 2 operator FM with feedback and loads of envelopes, all pretty satisfying.
>> I am using the built-in 12 bit DAC, and finally at the point where the quantization noise on the tails of long envelopes is bothering me. I have a very high-level understanding of what dithering is, and have played a little with naively adding a tiny bit of white noise to my output signal to mask the quantization noise. it DOES work, but the noise floor is really not that low, and I fear I'm misunderstanding some nuance of dithering here and kind of just caveman drowning it out with white noise.
>>
>> There's no issue besides on the tails of long envelopes. When we get close to silence, there is quite a bit of "hash" and digital goofiness that makes perfect sense given my implementation.
>>
>> To try to reduce the constant noise floor, I also tried adding the dithering to the envelopes instead of the output. this kind of works, but sounds a bit conspicuous. it's kind of just gating the quantization noise with the envelopes. I think it maybe sounds better than with no attention, but not really "better" than a constant bit of white noise underneath the signal.
>>
>> One question I have is: does my white noise sample rate need to be higher than my output signal's?
>>
>> But overall, my question to list is: what are some ways we can go about reducing quantization noise in 12 bit or lower outputs?
>>
>> Are there some subtle tricks or have I just never noticed 8 or 12 bit systems sounding, yknow, terrible... this could be a classic case of "yeah, listening hyper critically in a quiet room on nice headphones will reveal secrets sometimes", as the noise floor of my QSC PA speakers is actually quite a bit higher than this quantization noise, so I never realized it was there during less attentive testing.
>>
>> Cheers,
>> Chris McDowell
>>
>>
>>
>> _______________________________________________
>> Synth-diy mailing list
>> Synth-diy at synth-diy.org
>> http://synth-diy.org/mailman/listinfo/synth-diy
>> Selling or trading? Use marketplace at synth-diy.org
>
More information about the Synth-diy
mailing list