The No.1 Website for Pro Audio
 Search This Thread  Search This Forum  Search Reviews  Search Gear Database  Search Gear for sale  Search Gearslutz Go Advanced
Good dither practices, what are yours? Dynamics Plugins
Old 11th March 2017
  #421
qwe
Lives for gear
 

Quote:
Originally Posted by FabienTDR View Post
Insisting on adding -140dB of noise to a -60dB noise floor for dithering is ridiculous (that's decibel!)
If I'm something is created where all sources are soft-synths, where's this -60dB noise floor coming from?!
Old 11th March 2017
  #422
IMHO it would be worth a try! Just to check out a critical case. I can host the files if you want.

Indeed, these are the exceptions. Mostly lab cases (again, given modern, non lofi formats).
Most synths are compromised toward usability and performance, they produce a lot of noise.
Nobody enjoys listening to 1 or two sines, with synths you mean much more complex stuff. The noise floor is probably to low on its own, that's true (no noise over silent regions). But silence is easy to truncate, like noise, it's immune to quantization.

Given a complex signal (more than 2-4 sine), the truncation will be of chaotic nature, effectively transitioning into noise. This was demonstrated in test case 3 (seven sine, without noise).

Let's try your sounds, that's interesting. Just make sure we can distinct them from the distortion in some way.

For recorded signals, explicit dither won't show any measurable benefit. The noise floor is already sufficiently high for most target formats.

Last edited by FabienTDR; 11th March 2017 at 06:44 PM..
Old 11th March 2017
  #423
Gear Maniac
 
Yuri Korzunov's Avatar
 

Quote:
Originally Posted by FabienTDR View Post
Truncation is fine imho: Remove (or overflow) N LSB, as it is done in fixed point processing, format conversion and AD/DA.

IMHO the meaning is clear. We talk about bits, not levels. You can't round bits.
Truncation is removing several lower or higher bits.

Then truncated lower bits it is equal rounding to next lower integer.

For decreasing bith depth use rounding to next integer (lower or higher).
Old 11th March 2017
  #424
You can (try?) if you like, but it's unnecessary, given an appropriate noise floor. The rounding error doesn't matter, as we're only affecting noise by it! We intentionally don't want the truncated region to matter or relate to anything at all. That's the trick..

You cannot round a bit! You can only round a number.

Take a 0dBfs sine in a fixed point 8bit file. Now reduce the gain by 12dB. How do you "round the bits" being thrown away? (you can't)

In a converter scenario removing the 4LSB, how do you "round the numbers" without introducing nonlinearity due to messy branching? (you can't. Except if its purely random branching! The circle closes :D )

Rounding a stream of numbers is a nonlinear operation introducing new partials to the signal. Much like clipping. Don't do that with audio!

Rounding bits makes no sense imho (again, this is a stream of numbers!). Noise floor is noise is noise is noise.

Last edited by FabienTDR; 11th March 2017 at 07:09 PM..
Old 11th March 2017
  #425
Gear Maniac
 
Yuri Korzunov's Avatar
 

In DAW (including master) I recommend use float point format.

Converting to any integer I recommend apply via rounding to closest integer.

If need apply dither, dither added before rounding.

P.S. Truncation is one of two possible cases of rounding (if source data is integer). I don't recommend use truncation (rounding to closest lower integer) for avoiding increasing of level quantization error.
Rounding to closest integer give lesser quantization error.

Any rounding (including truncation) is non-linear operation.
Old 11th March 2017
  #426
That's a hefty nonlinearity. Like max(), floor(), ceil(), if(). It's NOT clever. You build distortion devices like this! It's as harmful for all stationary signals (tones) as any other form of branching.

The word "Rounding" sounds clean and smooth to the layman, but it's really laughable in the context of signal processing. Just round a sine and look at the FFT! It's no more a sine. (round to what anyway?! lol, to a full number?!)

You can't round a stream of numbers and expect to preserve it. You can round ONE number. Not a stream.

Be it floor (truncation), round or ceil. It doesn't matter at this point, as long we're only affecting a purely random signal. Again, now for the thousands time: This is the whole magic of dither. Noise is robust and can be treated badly. If it's there, no quantization dist (= new distinct partials) will appear and trouble your sonic experience.



I really don't feel well trampling around here. But the subject of dither is covered by an enormous pile of marketing/ignorance/religious/academic complication/bureaucraty/esoterica crap. Any reasonable debate has to go through the dirt whether it wants or not. Its really incredible. I hope you guys don't take my insisting approach too personally.

Last edited by FabienTDR; 11th March 2017 at 09:53 PM..
Old 11th March 2017
  #427
Gear Maniac
 
Yuri Korzunov's Avatar
 

"Hefty" it is how much?

Rounding is usual math term.

Examples:

1. Round 5.6 to closest integer. Result is 6.

2. Round 5.2 to closest integer. Result is 5.

You think in domain of integer math. But for sound processing I recommend use float point math.
Old 11th March 2017
  #428
Look at the resulting spectrum of a rounded sine. It's no more a sine. Does that suffice? You can't round audio.

What number representation are you talking about? I'm only familiar with the standard of mapping bits to a linear values from 0 to 1 fs. Again, it makes absolutely no sense to round signals, except if you intentionally want to introduce distortion.



We already have a strong nonlinearity to mess with, the naked truncation. Hence, we add noise to make it irrelevant. Adding another nonlinearity on top only makes it worse, it doesn't improve anything. It's a nonsensical complication.

This is analogous to the SRC interpolation case of zero-filling vs filling the average before nyquist filtering. The latter sounds great to the layman, but it's clearly the worst technically.

Last edited by FabienTDR; 11th March 2017 at 08:24 PM..
Old 11th March 2017
  #429
Gear Maniac
 
Yuri Korzunov's Avatar
 

Just look here What is dithering audio?

Check pictures 2 and 4 from top.
Old 11th March 2017
  #430
Yes, dithering a sine. We had this before. What is the point? Does it make the idea to round a stream of numbers mapped from 0 to 1 (or bits?!) somehow reasonable? No, it's still as silly (sorry, it's just too silly to not call it like that in all clarity).


Man, a rounded PCM value is either 0.0, 1.0. Either -inf, 0dB.

A 1 bit convertion? For what? Are you serious with this?!


Maybe I am turning crazy? What is the point of all this crappy nonsense being throw around such a trivial thing as dithering?!

I feel that some people/parties simply want dither to look complicated, without even understanding the trivial and very basic mechanisms behind it.

As mentioned before. All this is probably better handled in form of a well structured blog post/article made by 2-4 people, with proofs and everything. In that sense, this thread doesn't have to fear truncation, it's already full of completely unrelated noise.

Last edited by FabienTDR; 11th March 2017 at 08:32 PM..
Old 11th March 2017
  #431
Gear Maniac
 
Yuri Korzunov's Avatar
 

For float point formats in audio accepted 1 as 0 dB LUFS.

When you convert float point to integer formats (16, 24, etc. bits) need scaling to 0 dB LUFS for integer. For 16 bit it is (2^16-1).

After it applied rounding.
Old 11th March 2017
  #432
qwe
Lives for gear
 

OK, I did a test--brown noise generated in Adobe Audition (peak level -2.1dB) and then imported into Reaper.
BitShiftGain used for all gain adjustments.
BitShiftGain -13 bits (just under -80dBr peak level.) (Signal 1.)

Signal 1 is then fed to another bus with truncation to 16 bits, followed by inversion. (Signal 2.)

Output is Signal 1+Signal2 with BitShiftGain of +16bits, dithered (LOL) to 24 bits.

File attached... (Caution: Signal peaks near 0dBr, turn down monitors!)
Attached Files

Brown Noise Test.wav (258.4 KB, 502 views)

Old 11th March 2017
  #433
Rounding to what in which number representation?!?!

You are adding a pointless nonlinearity (a discontinuous branch, a very strong nonlinearity).
Again, this region we are affecting is only made of noise. There is absolutely nothing to round about noise.


The process of converting the bit depth of a discrete signal is simple:

1. Make sure the bits you plan to remove are purely random (explicitly or implicitely).
2. Throw the least significant bits away.


That's it. Not more, not less. It's all you need to perfectly preserve a sine through he process without any information loss.
You don't need any further complication. It's perfect and trivial. You still have one spectral element at the same pitch and level.

Last edited by FabienTDR; 12th March 2017 at 12:04 AM..
Old 11th March 2017
  #434
qwe
Lives for gear
 

Quote:
Originally Posted by FabienTDR View Post
In that sense, this thread doesn't have to fear truncation, it's already full of completely unrelated noise.
Nah, this is one of the best threads on Gearslutz. :-)
Old 11th March 2017
  #435
Gear Maniac
 
Yuri Korzunov's Avatar
 

Simple example: How to decrease level to 0.1 dB in integer (16 bit) domain?

When you work in float point domain you have:
1. have noise floor under 200 dB and make thousands integer/non-integer multiplications/dividing without any problems;
2. don't worry about overload.

If overload achieved level may be scaled back to 1.

"Very strong nonlinearity" it is how much in numbers?
Old 11th March 2017
  #436
The point is moot. It doesn't matter if you floor(), round() or ceil() to the next full bit. It's still branching, something that generates partials (distorts the spectral content). It doesn't help reducing quantization distortion, it provokes it. Only a random signal can do.

What we remove during the truncation process must be fully random. That's all. Again, these bits are made irrelevant by making sure they only contain noise. It doesn't help to process this random LSB signal further we trash it anyway! It's homeopathy at best.

Feel free to demonstrate the spectral benefit. Just take my test file above, and round it. Then compare to straight truncation.

Last edited by FabienTDR; 12th March 2017 at 12:05 AM..
Old 11th March 2017
  #437
Quote:
Originally Posted by Yuri Korzunov View Post
"Very strong nonlinearity" it is how much in numbers?

In numbers, a branch (e.g. "if/else"), given a sine input (!), produces an infinite pattern of odd ordered harmonics decaying only very slowly. Exactly like clipping, which is nothing else than such a hard branch. It's non continuous. This is a strong nonlinearity. It always provokes aliasing along the way, due to its infinite bandwidth requirements. This is something really badly irreversible. And here in our case, a totally needles complication as we're assuming random noise!


An example for a weak, continuous nonlinearity would be a low order polynomial like x + x * x * x. It's continuous and only generates a fast decaying series of partials (in this case, even an immediate decay after the third harmonic). Bandwidth only triples during the process, it doesn't become infinite.


IMHO these numbers are clearly shouting: "Ok, what is the benefit in all this?"

"Why not just make sure the truncation error is purely random and call it a day?"
Old 11th March 2017
  #438
Lives for gear
 
bogosort's Avatar
I think the disagreement over rounding is a confusion between two different processes. Rounding is indeed beneficial in quantization (and word reduction without dither), because -- depending on the type of rounding -- it removes or diminishes the dc bias introduced by truncation. However, it makes no sense to round a signal before or after applying dither.
Old 11th March 2017
  #439
Gear Maniac
 
Yuri Korzunov's Avatar
 

Feel free answer "homeopathy" it is how much dB?
Old 11th March 2017
  #440
qwe
Lives for gear
 

Quote:
Originally Posted by FabienTDR View Post
Most synths are compromised toward usability and performance, they produce a lot of noise.
Please do explain?

Quote:
Originally Posted by FabienTDR View Post
Nobody enjoys listening to 1 or two sines, with synths you mean much more complex stuff. The noise floor is probably to low on its own, that's true (no noise over silent regions). But silence is easy to truncate, like noise, it's immune to quantization.

Given a complex signal (more than 2-4 sine), the truncation will be of chaotic nature, effectively transitioning into noise. This was demonstrated in test case 3 (seven sine, without noise).


Let's try your sounds, that's interesting. Just make sure we can distinct them from the distortion in some way.
OK. :-) Any suggestions for the type of sounds?
Old 11th March 2017
  #441
Most synths are made with wavetable synthesis and other trickery to improve efficiency, which of course exhibits all sorts errors. It is not comparable to a brute force additive synthesizer, which produces literally perfect signals (I built one to generate the test signal I posted).

Well, the seven sine + brown noise example is the "closest to nature" usable signal I can think of for this specific case. Alternatives would be the square, triangle or sawtooth. The problem is that they tend to hide a lot of distortion, as they are harmonic in nature.
Old 11th March 2017
  #442
Quote:
Originally Posted by Yuri Korzunov View Post
Feel free answer "homeopathy" it is how much dB?
Minus infinite dB. It doesn't matter, as we assume noise inside these LSB. But it taxes the CPU and the operator's mind for no reason.
Old 11th March 2017
  #443
Gear Maniac
 
Yuri Korzunov's Avatar
 

Quote:
Originally Posted by bogosort View Post
I think the disagreement over rounding is a confusion between two different processes. Rounding is indeed beneficial in quantization (and word reduction without dither), because -- depending on the type of rounding -- it removes or diminishes the dc bias introduced by truncation. However, it makes no sense to round a signal before or after applying dither.
Rounding it is way of quantization.

Integer formats recommended convert to float point format into DAW and further work in float point.

Unprocessed float point converted back to integer without loses.

I suppose, using "truncation" term is legacy of simpler (than float) integer math that used in older systems. Float point math demands more computing resources. But give more precision (lesser quantization error - noise floor) in applying of algorithms.

Each 16 bit step contains 256 24-bit steps.

If 24 bit converted to 16 bit in integer domain via truncation (throw out several lesser bits), 24 bit value always rounded to nearest lesser 16 bit value step.

For correct rounding (lesser error) need round 24 bit value to closer 16 bit step.

Example simplified rounding (to nearest lesser):

Numbers in HEX format.

24-bit value: 0x0001EE => 16 bit value 0x0001

24-bit value: 0x000101 => 16 bit value 0x0001


Example more precise rounding (to nearest):

24-bit value: 0x0001EE => 16 bit value 0x0002

24-bit value: 0x000101 => 16 bit value 0x0001
Old 11th March 2017
  #444
Gear Maniac
 
Yuri Korzunov's Avatar
 

Quote:
Originally Posted by FabienTDR View Post
Minus infinite dB. It doesn't matter, as we assume noise inside these LSB. But it taxes the CPU and the operator's mind for no reason.
Dither can improve signal/noise ratio [float point to 16-bit] about 6 ... 12 dB (depend on signal and dithering algorithm).

It is not homeopaty. Especial for music with quiet places.
Old 11th March 2017
  #445
I said that rounding for truncation is homeopathy.

I wouldn't say this about dither in general. Dither is important. I thought I've been really clear about this.

Point is, in most cases, it's already given. With music material, there's little need for explicit dithering (in the sense of: "you need this plugin here"), and complicating it beyond simple randomness is pointless. Nobody is able to demonstrate advantages of further technical complication in a modern context, with average music material. So I call this case closed.

From my point of view, dithering in music is mostly well packaged and culturally accepted snake-oil. A dogma nobody likes to question and analyze. Mostly harmless, except to those pointing to the schizophrenic scale dilemma of "natural noise floor levels vs 2LSB".
Old 11th March 2017
  #446
Gear Maniac
 
Yuri Korzunov's Avatar
 

Quote:
Originally Posted by FabienTDR View Post
I said that rounding for truncation is homeopathy.
Truncation is one of kinds of rounding.

For closest integer rounding quantization error should be up to 2 times lesser (6 dB), I suppose. By statstics, probably, 2-3 dB. Because half values (that lesser half of 16 bit step) are rounded correctly. Need check for more exact values.
Old 11th March 2017
  #447
qwe
Lives for gear
 

Quote:
Originally Posted by FabienTDR View Post
Most synths are made with wavetable synthesis and other trickery to improve efficiency, which of course exhibits all sorts errors. It is not comparable to a brute force additive synthesizer, which produces literally perfect signals (I built one to generate the test signal I posted).

Well, the seven sine + brown noise example is the "closest to nature" usable signal I can think of for this specific case. Alternatives would be the square, triangle or sawtooth. The problem is that they tend to hide a lot of distortion, as they are harmonic in nature.
OK, I've knocked together a basic test using Reaktor 6 basic subtractive synth ("SoundSchool Analog")--see attached image for settings used.

I rendered the output at 44.1kHz but set Reaktor to 4xoversampling.

Reaktor's output was at about -33dBr peak, which is then further lowed by another 20dB or so. (Signal 1.)

It's sent to a bus in which it's truncated and inverted. (Signal 2.)

Rendered output is Signal 1 + Signal 2. It's then normalised to -3dB.

I shall try u-he Hive, which I know uses "wavetables" to save on CPU.
Attached Thumbnails
Good dither practices, what are yours?-reaktor-6-settings.png  
Attached Files

Synth Truncation Test - 16bit.wav (430.7 KB, 360 views)

Synth Truncation Test - 24bit.wav (430.7 KB, 415 views)

Old 11th March 2017
  #448
Gear Maniac
 
Yuri Korzunov's Avatar
 

Quote:
Originally Posted by FabienTDR View Post
From my point of view, dithering in music is mostly well packaged and culturally accepted snake-oil.
Dither need check at low level signals (-40 ... -60 dB) at higher levels of volume.

Dithering is one of things, that can be checked by proper and careful (not home) double blind test.
Old 11th March 2017
  #449
Lives for gear
 
bogosort's Avatar
Quote:
Originally Posted by Yuri Korzunov View Post
I suppose, using "truncation" term is legacy of simpler (than float) integer math that used in older systems. Float point math demands more computing resources. But give more precision (lesser quantization error - noise floor) in applying of algorithms.
There's nothing "legacy" about truncation. Again, we must be clear on what we're talking about. Converters deal with fixed-point integers, so intermediate floating-point numbers must be converted to fixed-point before being sent to the converter. Likewise, delivery formats (WAV) are usually fixed-point. Dither is not required when converting from floating- to fixed-point, only when reducing the word length of a fixed-point number.

The only sensible way to reduce an N-bit word to an (N-M)-bit word is to truncate the last M bits. Physically (electrically), this is done by right-shifting the word by M bits. Rounding can be performed before truncation by, e.g., adding (1 << (M-1)) to the N-bit word. This reduces bias at the new LSB. However, rounding is unnecessary if we're dithering the N-bit word with, say, M+2 bits of noise: we're overwriting the rounded bit, so why bother?

In a different context, say the quantization of filter coefficients, rounding makes sense. But not in the context of, e.g., mixing down a 24-bit session to a dithered 16-bit WAV file.
Old 11th March 2017
  #450
Quote:
Originally Posted by Yuri Korzunov View Post
Dithering is one of things, that can be checked by proper and careful (not home) double blind test.
Do you have any study at hand pointing to this? All I read agree on the opposite (16bit+ of course), but I'm interested.

Theory does anyway: The threshold of audibility is higher than dithering levels. This is VERY WELL studied, also in noisy contexts, no matter what anecdotes ppl throw around when it comes to their own dithering experience, ehm, or selling snake oil.

Last edited by FabienTDR; 12th March 2017 at 12:08 AM..
Topic:
Post Reply

Welcome to the Gearslutz Pro Audio Community!

Registration benefits include:
  • The ability to reply to and create new discussions
  • Access to members-only giveaways & competitions
  • Interact with VIP industry experts in our guest Q&As
  • Access to members-only sub forum discussions
  • Access to members-only Chat Room
  • Get INSTANT ACCESS to the world's best private pro audio Classifieds for only USD $20/year
  • Promote your eBay auctions and Reverb.com listings for free
  • Remove this message!
You need an account to post a reply. Create a username and password below and an account will be created and your post entered.


 
 
Slide to join now Processing…
Thread Tools
Search this Thread
Search this Thread:

Advanced Search
Forum Jump
Forum Jump