Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Be careful with SSRC usage on critical tasks (Read 21405 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Be careful with SSRC usage on critical tasks

I just want to comment that SSRC 1.28 and 1.29 (don't know about previous ones) versions use a default amount of dither that is insufficient for critical tasks. Quite probably just listening under regular conditions is not one of them, but taking it into account won't harm.

With SSRC 1.29 you can specify the amount of dither to use (num. of bits of dither amplitude).

Using triangular pdf (recommended for regular usage), these things happen on default:

- dither type 1, no noise shaping (flat dither): 0.5 bits on default are used, low-level quantization distortion still remains, noise modulation too. A value of 0.9 bits is needed to avoid appreciable distortion and achieve slightly appreciable noise modulation. A value of 1 is needed to avoid it totally.

- dither types 3 and 4( ATH noise shaped dither): 0.5 bits on default, this time no quantization distortion is appreciable, but noise modulation happens. A value of 0.7 bits is needed to make it unappreciable.

Update:

- dither type 2 (triangular noise shaped dither): 0.5 bits on default, quantization distortion and noise modulation remain. 0.9 bits are needed to avoid audible noise modulation. IIRC, 0.7 bits are needed to avoid appreciable distortion, but noise modulation remains in this case.

Be careful with SSRC usage on critical tasks

Reply #1
This may have some relevance just in case of 16 and 8 bit output files. For 24 and 32 bit output files, even if you don't use any dither, it will probably be fine for most tasks (for just listening, it will be for sure).

Be careful with SSRC usage on critical tasks

Reply #2
should ssrc's dither be used when you're only changing sample rate, and not bit depth?  I've just been using "ssrc --rate 44100 whatever48.wav whatever44.wav" and didn't bother with either the --dither or the --pdf options because I simply didn't know if they actually did anything when bit depth wasn't being changed.  Should I have been using "ssrc --dither 2 --pdf 1 whatever48.wav whatever44.wav" or something else?

Be careful with SSRC usage on critical tasks

Reply #3
Dither is needed even when doing just resampling, as long as the output format is 16 bit. Internally, SSRC uses higher precision, and dither is advisable co convert to this higher internal precision to 16 bit at the final stage.

Same as with decoder output at MAD or FB2k.

Be careful with SSRC usage on critical tasks

Reply #4
Quote
Dither is needed even when doing just resampling, as long as the output format is 16 bit. Internally, SSRC uses higher precision, and dither is advisable co convert to this higher internal precision to 16 bit at the final stage.

Same as with decoder output at MAD or FB2k.

So, what would be an optimal command line?

Be careful with SSRC usage on critical tasks

Reply #5
@KikeG
I have an idea how to detect if there's quantization distortion, but how do you test/find out if there's noise modulation?
Let's suppose that rain washes out a picnic. Who is feeling negative? The rain? Or YOU? What's causing the negative feeling? The rain or your reaction? - Anthony De Mello

Be careful with SSRC usage on critical tasks

Reply #6
Anyone know if there's a version of SSRC that supports 32-bit ?

Often I work in Cool Edit Pro in 48kHz / 32-bit and then downsample to 44.1kHz / 16-bit.  I'd like to do this last step in SSRC, though, since SSRC seems to be faster and from what I heard might be better than Cool Edit Pro's resampling.

Thoughts?

I have been wondering, though.  What are the optimal settings in both Cool Edit Pro and SSRC for downsampling from 48kHz / 32 (or 24) bit to 44.1kHz / 16bit?

Also, when editing in Cool Edit Pro, the manual advises that you should convert 16-bit audio to 32-bit audio, do all the editing, and then convert back to 16-bit.  Is this optimal?  If so, does the 16-bit to 32-bit change require any special settings?

Nick

Be careful with SSRC usage on critical tasks

Reply #7
SSRC optimal command line:

Use '--rate' for the output sample rate you want, '--bits' for the number of output bits, for default I think uses same bits as the input file.

So, it would be, to convert a 48 KHz 16 bit file to 44.1 KHz with flat dither:

ssrc --rate 44100 --bits 16 --dither 1 --pdf 1 1  infile.wav outfile.wav

With a 0.9 bit amplitude I'd say it would enough for converting 16 bit sources:

ssrc --rate 44100 --bits 16 --dither 1 --pdf 1 0.9  infile.wav outfile.wav

However, 1 bit, as opposed to 0.9 bit, guarantees mathematically perfect dithering and the noise increase is not significant.

Dither 4 and specially 3 squeeze at maximum dynamics of 16 bit, but are recommended just as a final stage.

With type 3:

ssrc --rate 44100 --bits 16 --dither 3 --pdf 1 0.7  infile.wav outfile.wav

As I said, I think the '--bits 16' is not needed if the original file is already 16 bit.
I don't have time right now to answer rest of questions, I'll do later.

Edit: added 1-bit flat dither commandline and explanation.

Be careful with SSRC usage on critical tasks

Reply #8
Quote
Anyone know if there's a version of SSRC that supports 32-bit ?

I don't know. I've only worked with 24bit resolution so far in SSRC.

Quote
Often I work in Cool Edit Pro in 48kHz / 32-bit and then downsample to 44.1kHz / 16-bit.  I'd like to do this last step in SSRC, though, since SSRC seems to be faster and from what I heard might be better than Cool Edit Pro's resampling.

It's not better. On 16bit resolution quality 600 is enough, more is overkill - maybe this helps to increase speed a bit. KikeG said that in another thread one or to months ago. I've got no link ATM.

Quote
I have been wondering, though.   What are the optimal settings in both Cool Edit Pro and SSRC for downsampling from 48kHz / 32 (or 24) bit to 44.1kHz / 16bit?
About SSRC KikeG already answered, you can use the same settings in CEP (at least for flat dither): Pre-/Postfilter enabled, quality 600, Dither Depth 0.9, p.d.f. Triangular, No Noise Shaping. If you use other noise shaping types (e.g. 44.1 kHz shaped), you'll get even less audible noise added. All settings should be the same except Dither Depth which will be different for each noise shaping type and needs to be tested (until KikeG answers I don't know how to test "noise modulation".

Quote
Also, when editing in Cool Edit Pro, the manual advises that you should convert 16-bit audio to 32-bit audio, do all the editing, and then convert back to 16-bit.  Is this optimal?
Yes - the higher the resolution the lower the quantization noise added in each "editing" step.
Quote
If so, does the 16-bit to 32-bit change require any special settings?
If you don't change sampling rate at the same time - No. It's just like e.g. 241 becoming 241.000.
Let's suppose that rain washes out a picnic. Who is feeling negative? The rain? Or YOU? What's causing the negative feeling? The rain or your reaction? - Anthony De Mello

Be careful with SSRC usage on critical tasks

Reply #9
Quote
I have an idea how to detect if there's quantization distortion, but how do you test/find out if there's noise modulation?

Generate a 32 bit -90 dB very slow sinewave, for example 0.3 Hz, then dither to 16 bit. Convert again to 32 bit, amplify it up to audible levels, and play. If you notice how the background noise changes in level or in tone, then there's noise modulation. Most obvious case is when noise dissapears when the waves is near crossing the 0 point.

Quote
About SSRC KikeG already answered, you can use the same settings in CEP (at least for flat dither): Pre-/Postfilter enabled, quality 600, Dither Depth 0.9, p.d.f. Triangular, No Noise Shaping. If you use other noise shaping types (e.g. 44.1 kHz shaped), you'll get even less audible noise added. All settings should be the same except Dither Depth which will be different for each noise shaping type and needs to be tested.


After doing some more tests with CEP, quality values over 600 don't give any higher quality for 48->44.1 KHz 16 bit, and quality values over 400 don't give any higher quality for 44.1->48 16 bit. For just music, even values haf the proposed won't have any audible consequences.

For CEP 44.1 KHz noise shaping, a value of 0.6 bits is required to avoid noise modulation.

As for the rest of your explanations, they are OK 

Be careful with SSRC usage on critical tasks

Reply #10
Quote
Quote
I have an idea how to detect if there's quantization distortion, but how do you test/find out if there's noise modulation?

Generate a 32 bit -90 dB very slow sinewave, for example 0.3 Hz, then dither to 16 bit. Convert again to 32 bit, amplify it up to audible levels, and play. If you notice how the background noise changes in level or in tone, then there's noise modulation. Most obvious case is when noise dissapears when the waves is near crossing the 0 point.

In this example noise modulation obviously causes that you hear something (besides noise) that isn't audible before applying dither.

For real music - is this really important / does it make a difference? Could you please explain and/or point me to some more information about this?

What about applying a ~10Hz highpass before 32->16bit+dither: Would this avoid/decrease noise modulation on lower dither depth?

[EDIT]Thanks for your answer BTW  [/EDIT]
Let's suppose that rain washes out a picnic. Who is feeling negative? The rain? Or YOU? What's causing the negative feeling? The rain or your reaction? - Anthony De Mello

Be careful with SSRC usage on critical tasks

Reply #11
Quote
For real music - is this really important / does it make a difference? Could you please explain and/or point me to some more information about this?

What about applying a ~10Hz highpass before 32->16bit+dither: Would this avoid/decrease noise modulation on lower dither depth?

Noise modulation doesn't appear for the low frequencies used, but for the low levels used.

For dithering already dithered 16 bit data (for example when resampling a 16 bit file), I'd say this noise modulation issue is not important, won't happen. It may happen when dithering 24 bit files with very soft passages, that have many data samples below the 16th bit level.

Quote
[EDIT]Thanks for your answer BTW  [/EDIT]

Happy to help

Be careful with SSRC usage on critical tasks

Reply #12
You should use 1-bit of dither, not 0.9 bits of dither, when converting without noise-shaping.

2-bits peak to peak (which equals 1-bit RMS - which is what these programs take as input) triangular dither is mathematically proven to remove 100% of the distortion and noise modulation.

Other values aren't.


I don't claim you'll hear a difference  but I don't think the (probably inaudible) decrease in noise due to 0.9-bits compared to 1-bit is worth risking the (probably inaudible) increase in distortion or noise modulation.


It's certainly not worth going back and re-processing anything you've done previously - the effects are an order of magnitude smaller than the smallest problems you find in lossy audio codecs. But, for once, there is an objectively "as-near-to-perfect-as-possible" way of doing things, so you might as well use it.


Cheers,
David.

Be careful with SSRC usage on critical tasks

Reply #13
Quote
You should use 1-bit of dither, not 0.9 bits of dither, when converting without noise-shaping.

2-bits peak to peak (which equals 1-bit RMS - which is what these programs take as input) triangular dither is mathematically proven to remove 100% of the distortion and noise modulation.

I need to gather some experience about noise modulation, but about distortion I'd say it's a tradeoff. If dither depth is lowered starting from 1 there'll be increasing distortion, on the other hand dither noise will decrease. If dither depth is near 1 (e.g. 0.99) the distortion will be masked by dither noise, so it's there but audible. On the tests I did (low volume sine tones, low volume real music, ...) at 0.9 there was still no distortion noticable (= not audible, no extra peaks out of the noise floor in fequency analysis, nothing to seen in spectral view), just dither noise that was lower than at 1.0.

Quote
... I don't claim you'll hear a difference  but I don't think the (probably inaudible) decrease in noise due to 0.9-bits compared to 1-bit is worth risking the (probably inaudible) increase in distortion or noise modulation.

About distortion I'd say the risk at 0.9 is so small that it is worth it - about noise modulation I can't tell.

Quote
It's certainly not worth going back and re-processing anything you've done previously - the effects are an order of magnitude smaller than the smallest problems you find in lossy audio codecs. But, for once, there is an objectively "as-near-to-perfect-as-possible" way of doing things, so you might as well use it.

I'd say the best trade-off (actually I can't tell what it is but I'm sure it's below 1.0) is the  "as-near-to-perfect-as-possible" way.

Cheers tigre
Let's suppose that rain washes out a picnic. Who is feeling negative? The rain? Or YOU? What's causing the negative feeling? The rain or your reaction? - Anthony De Mello

Be careful with SSRC usage on critical tasks

Reply #14
Quote
You should use 1-bit of dither, not 0.9 bits of dither, when converting without noise-shaping.

This is same as with SSRC recommendations. 0.9 bit avoids distortion, but keeps slight noise modulation. For 16 bit already dithered sources, however, this is negligible. Anyway, the noise introduced with 1 bit as opposed to 0.9 bit is negligible too.

Be careful with SSRC usage on critical tasks

Reply #15
For 16-bit sources which were correctly dithered to start with, there's an argument that they are already self dithering when resampled or re-coded. However, I don't buy this argument from a mathematical view-point. From a practical view point, there may be many cases where it sounds better not to dither at all, but that's a largely subjective issue, and depends on material, ears, equipment etc etc so I always use correct dither, since I don't usually have equipment or a listening environment available that I completely trust.

Quote
If dither depth is near 1 (e.g. 0.99) the distortion will be masked by dither noise, so it's there but audible.


Did you mean "inaudible"? In that case, using exactly 1-bit, it isn't there at all. It's not that it's masked, it's that it isn't there. But, as you suggest, if it's perfect with 1-bit of dither, and it's a disaster with 0 dither, then there must be a sliding scale in between. If there's a compromise between (inaudible) noise and (inaudible) distortion, I'll take the noise. Mainly because digital distortion (rather than analogue distortion) is hated by the human ear, whereas noise is easily ignored.

This may or may not convince you:

http://mp3decoders.mp3-tech.org/24bit2.html#dither

Cheers,
David.

Be careful with SSRC usage on critical tasks

Reply #16
Quote
However, I don't buy this argument from a mathematical view-point. From a practical view point, there may be many cases where it sounds better not to dither at all, but that's a largely subjective issue...

I meant from an objective analysis point of view. However, I guess that to be sure 100% in any possible situation you can use 1 bit dither.

No dithering does add measurable distortion, for example when resampling, even with already dithered 16-bit source signals.

Be careful with SSRC usage on critical tasks

Reply #17
Quote
Quote

If dither depth is near 1 (e.g. 0.99) the distortion will be masked by dither noise, so it's there but audible.


Did you mean "inaudible"?

Yes. Thanks.

I'll answer to the rest when I'm convinced  - or not.
Let's suppose that rain washes out a picnic. Who is feeling negative? The rain? Or YOU? What's causing the negative feeling? The rain or your reaction? - Anthony De Mello

Be careful with SSRC usage on critical tasks

Reply #18
Quote
For 16-bit sources which were correctly dithered to start with, there's an argument that they are already self dithering when resampled or re-coded. However, I don't buy this argument from a mathematical view-point.

IMO the message of this argument was a bit different. It doesn't say that there's no dither needed when the signal has been dithered before. It rather says that dither slightly below 1bit depht is enough because both - noise modulation/bumbping and distortion disapears in dither noise that is already there + that is added by (1-x)bit dither.

Quote
... In that case, using exactly 1-bit, it isn't there at all. It's not that it's masked, it's that it isn't there.

The word "masked" used by me is maybe a bit misleading. I should rather say the distortion sinks into dither noise when dither depht increases from 0 to 1 and it shoud be an indistinguisable part of the noise in every case before reaching 1.

Quote
But, as you suggest, if it's perfect with 1-bit of dither, and it's a disaster with 0 dither, then there must be a sliding scale in between. If there's a compromise between (inaudible) noise and (inaudible) distortion, I'll take the noise. Mainly because digital distortion (rather than analogue distortion) is hated by the human ear, whereas noise is easily ignored.

You wrote "compromise" but it seems like you're talking about a decision ("digitally") 0=distortion vs. 1=noise. As explained above my "compromise dither depth" is proably a bit below 1.

About "distortion sinking into noise I've got an idea for a test:

Take some music, amlify it by -80...-90dB without dither introducing distortion (That's audible for sure if you'd amplify back to original level afterwards). Now add faded in white noise (-96dB -> -60dB). If you amlify now (max. amplification without clipping) and listen, you'll hear this: At the beginning there's clearly audible distortion, but as noise gets louder at some point you still hear that there's music, but you can't spot the distortion anymore as it's "sunken" into the noise (or the noise raised and swallowed it).

Quote
This may or may not convince you:

http://mp3decoders.mp3-tech.org/24bit2.html#dither


I don't need to be convinced of the facts that are explained there anymore (thanks to KikeG's help some time ago). - You might not exspect this after my long reply, but I'll use 1bit dither (if it's flat/white noise triangular) in future because a test based on KikeG's suggestion showed me that even at 0.9bit there can be noticable noise modulation/bumping.

About noise shaped dither it's different: Trying the same with CEP's 44.1kHz noise shaped dither I found that I could not cause noise modulation even at 0.3bit dither depth but there were randomly distributed blocks of 0 samples once in a while that completely disappeared at ~0.6bit dither depth. Distortion disappeared at 0.4bit completely BTW.


Another thing I found quite interesting: here Frank Klemm wrote
Quote
ATH shaped is only the best for a noise free recording, which is practically not possible.
For noisy recodings you must calculate the noise shaping floor from the ATH and the noise floor of the recording. For very high noise floors the optimum is the shape of the noise floor.

The question that came to my mind reading this is: Would it be possible to create a dynamically noise shaped dither? I mean it shoud be noiseshaped in a way that in every moment as much of the dither noise as possible is masked by the signal. One problem I see here is that changing the "noise colour" dynamically could cause something similar to noise modulation/bumping, but maybe there's a way ... ?

Cheers tigre
Let's suppose that rain washes out a picnic. Who is feeling negative? The rain? Or YOU? What's causing the negative feeling? The rain or your reaction? - Anthony De Mello

 

Be careful with SSRC usage on critical tasks

Reply #19
Updated first post of the thread, adding needed values for triangular noise shaped dither (type 2).

Be careful with SSRC usage on critical tasks

Reply #20
Someone named Tyler Knott posted a GUI for SSRC on the Vorbis User and Discussion List. Has anyone tested this frontend? KikeG, any comments on useage?

    - M.


Be careful with SSRC usage on critical tasks

Reply #22
M, I haven't used any SSRC frontend. I have just used straight command-line options.

Be careful with SSRC usage on critical tasks

Reply #23
'scuse my cluelessness, but is this more for 48khz to 44.1khz downsampling or can it include 44.1khz to 48khz upsampling (for creating DVDs, for example)?

Be careful with SSRC usage on critical tasks

Reply #24
either direction