Login / Register 0 items | $0.00 New @ KVR
mystran
KVRAF
 
4833 posts since 11 Feb, 2006, from Helsinki, Finland

Postby mystran; Thu May 10, 2018 5:40 am Re: Bit Depth vs Frequency Response - Reflection

Nowhk wrote:
test_sync.png

Visually, it seems to me that the input signal (2hz) is vanished. But I could be wrong.
So quantization (probably) do mess the original 2hz signal's frequency.


You are NOT doing (what everyone else calls) bit-reduction here. Bit-reduction is when you reduce the number of bits used to represent a sample. Instead you are (logically) decimating the signal to 1/4th of the sampling rate and then zero-stuffing it back to the original rate. The decimation step will cause anything above 1/8th of the sampling rate to alias down, but assuming the signal bandwidth is low enough to fit, it can be reconstructed by sinc-interpolation... except you need the sinc-cutoff at 1/8th of the sampling rate (instead of half sampling-rate like your picture above) because you are logically upsampling.

But again.. none of this has anything to do with bit-depth and the sooner you admit that the sooner you'll get somewhere.
Image <- plugins | forum
User avatar
Nowhk
KVRian
 
743 posts since 2 Oct, 2013

Postby Nowhk; Thu May 10, 2018 6:40 am Re: Bit Depth vs Frequency Response - Reflection

mystran wrote:You are NOT doing (what everyone else calls) bit-reduction here. Bit-reduction is when you reduce the number of bits used to represent a sample. Instead you are (logically) decimating the signal to 1/4th of the sampling rate and then zero-stuffing it back to the original rate. The decimation step will cause anything above 1/8th of the sampling rate to alias down, but assuming the signal bandwidth is low enough to fit, it can be reconstructed by sinc-interpolation... except you need the sinc-cutoff at 1/8th of the sampling rate (instead of half sampling-rate like your picture above) because you are logically upsampling.

But again.. none of this has anything to do with bit-depth and the sooner you admit that the sooner you'll get somewhere.

:o Probably its not clear the schematic above.
I'm not touching sampling rate at all.

To avoid misunderstanding, let me re-explain (even if I'll look like an idiot :dog: )
Bit reducer:

Code: Select all
lowBitNumber = pow(nBit - 23, 2) * 3;
lowBitSignal = signal + lowBitNumber - lowBitNumber;

Sample Rate = 16 (fixed)
Blue Signal = 2hz, -10db (input "analog" signal)
Red signal = Sync Interpolation after sampling the Blue Signal (output)

Bit Depth 8 bit:

001-8bit.png

Bit Depth 4 bit:

002-4bit.png


Bit Depth 3 bit:

003-3bit.png

Bit Depth 2 bit:

(the image above).

Is it the same of what you though? Isn't the Bit Depth that change the (red) signal here? Due to the range it can grant for the input signal when sampling?

"I know that I know nothing"
You do not have the required permissions to view the files attached to this post.
mystran
KVRAF
 
4833 posts since 11 Feb, 2006, from Helsinki, Finland

Postby mystran; Thu May 10, 2018 7:09 am Re: Bit Depth vs Frequency Response - Reflection

Nowhk wrote:To avoid misunderstanding, let me re-explain (even if I'll look like an idiot :dog: )


Ok, so these pictures look more like what you'd expect from bit-depth reduction. What you are observing is the harmonic distortion that results when you do not dither. If you now add TPDF dither (ie. add two uniform random numbers each scaled to one quantization step before doing the bit-reduction; note that you really want at least a reasonably high quality PRNG for this), you will instead see some noise instead, although it will now be closer to the original signal on average.

If you then look at the spectrum (eg. using FFT analyzer; use long enough window) of the bit-reduced signal with and without dither, you'll notice that the version that the version without dither will have harmonic distortion (the bulk of which will alias, creating an uneven "noise floor" which looks more or less like a bunch of random peaks) while the version with dither will have just the original signal frequencies, together with a flat, white noise floor. With less bits, the noise floor will be higher, but otherwise the signal will be preserved as-is.
Image <- plugins | forum
earlevel
KVRist
 
449 posts since 4 Apr, 2010

Postby earlevel; Thu May 10, 2018 10:00 am Re: Bit Depth vs Frequency Response - Reflection

Nowhk wrote:Visually, it seems to me that the input signal (2hz) is vanished. But I could be wrong.
So quantization (probably) do mess the original 2hz signal's frequency.

Again—to put it a different way, you're arguing semantics. When we talk about quantizing, we're talking about fitting a value in an available (or allotted) number of bits. Because we need to (or want to). The cost for less space is more error. In that sense, the signal that you show is still the original signal, plus error that makes it appear to no longer be that original signal.

In other words, if you're doing this as a processing block, OK, it does what it does. But when we're talking about the effects of sample rate and bit depth, that's implying a very specific thing—how well the original signal can be encoded and reproduced. And there we are talking about bandwidth and quantization error.

That's not to say your discussion doesn't have merits in pondering what the effects are in constraining quantization to the point that you're really discussing a certain kind of non-linear processing (a pretty unpleasant one). But that's an entirely different thing than questioning whether it's correct to say "The bit depth has no impact on the frequency response", while taking the claim out of context. ;-)
My audio DSP blog: earlevel.com
User avatar
Aleksey Vaneev
KVRAF
 
3367 posts since 7 Sep, 2002

Postby Aleksey Vaneev; Sun May 13, 2018 10:56 am Re: Bit Depth vs Frequency Response - Reflection

mystran wrote:
Aleksey Vaneev wrote:Well, I have not tried to implement 1-bit noise-shaped dither myself, but I do not see how it's impossible - you just keep the input signal e.g. at -6 dBFS and thus noise at a similar level. 16-bit noise-shaped dithering also creates saturation - it's just rare as usually masters are kept at -0.3 dBFS so that added noise never saturates. 1-bit case is extreme, but it's in no way special than e.g. 16-bit case.


First of all, for effective dither you need TPDF with magnitude of 2 quantisation steps (eg. [0, 2]) and that won't fit in 1-bit even without any signal. The other "special" thing about 1-bit case is that you don't just reach saturation, you're constantly stuck with it, because you're always in saturation one way. In fact, your filter (assuming some sort of high-pass response at least) cannot even decay below a full-scale limit-cycle oscillation!

Well, you are not exactly correct with your assumptions. With noise-shaping the TPDF dither's loudness can be reduced without negative impact. For example, if your noise-shaping curve boosts higher-frequency noise-floor by 12 dB it's safe to reduce TPDF's loudness by 6dB, I've checked it, it works that way without creating distortion harmonics.
Image
mystran
KVRAF
 
4833 posts since 11 Feb, 2006, from Helsinki, Finland

Postby mystran; Sun May 13, 2018 2:52 pm Re: Bit Depth vs Frequency Response - Reflection

Aleksey Vaneev wrote:Well, you are not exactly correct with your assumptions. With noise-shaping the TPDF dither's loudness can be reduced without negative impact. For example, if your noise-shaping curve boosts higher-frequency noise-floor by 12 dB it's safe to reduce TPDF's loudness by 6dB, I've checked it, it works that way without creating distortion harmonics.


If I'm not mistaken, unit-step magnitude RPDF is enough to prevent harmonic distortion anyway and the reason we want to use TPDF is simply to prevent the signal from modulating the noise amplitude... so it actually seems plausible that you might not even need TPDF with noise-shaping if that takes care of the modulation problem. Who knows.

Personally I'm not a huge fan of noise-shaping 44.1kHz/48kHz audio anyway (ie. I played around with it at some point and concluded that as far as my ears are concerned it's just waste of time), so I admit I haven't really tried to optimise the dither.
Image <- plugins | forum
earlevel
KVRist
 
449 posts since 4 Apr, 2010

Postby earlevel; Sun May 13, 2018 9:56 pm Re: Bit Depth vs Frequency Response - Reflection

mystran wrote:Personally I'm not a huge fan of noise-shaping 44.1kHz/48kHz audio anyway (ie. I played around with it at some point and concluded that as far as my ears are concerned it's just waste of time), so I admit I haven't really tried to optimise the dither.

Agreed...not trying to start a fracas, just adding observations...no exhaustive study, just some thoughts through the course of past experiments...

1. Noise-shaped dither sounds crappy on some sources. Don't assume it's always better than TPDF.

2. TPDF dither always sounds fine, as expected.

3. Often (likely, for most multi-instrument songs, single instrument polyphonic songs...er, and even just most instruments), no dither at all sounds just as good as TPDF.

Ground rules for these observations:

I'm talking primarily about 16-bit. (It's silly to talk about dithered 24-bit—if you think otherwise, let's discuss physics—and we rarely use other sizes. If you need 8- or 12-bit, do what you want, I don't care, I'm just talking about formats that most people deal with as an end product.)

I left "golden ears" out of the equation by nulling with the original in the digital domain and adding enough gain to easily savor the quality of the error. The sound of the error is all that matters (the amplitude is a given)—it either sounds bothersome or it doesn't.

Some might submit that #3 is only true when there is sufficient noise already in the recording ("self dither"). Yes, that's often the case, but not what I'm getting at. I found that normal music (even without drums and cymbals) seemed to be chaotic enough, using the cleanest of sources, that the error lacked enough correlation to be perceived as anything other than unmodulated white noise throughout the song—nothing that stood out, even at artificially high levels. (I wanted to test this more, using mixes from big-time pros, but found they get cold feet about having their stuff looked at that closely, even if you promise that no one else will ever know, and the meaning of the test has no implications about the quality of the sources.)

(A reminder for anyone wanting to experiment: Don't fall into the trap of, say, dithering to 8-bit so the error is loud enough to hear easily, and making the assumption that dithering to 16-bit is the same thing, but 48 dB quieter—this is not a linear process, you can only determine the effects for 16-bit by doing 16-bit. Then null and add gain to examine the error qualities.)
My audio DSP blog: earlevel.com
Previous

Moderator: Moderators (Main)

Return to DSP and Plug-in Development