IPB

Welcome Guest ( Log In | Register )

2 Pages V   1 2 >  
Reply to this topicStart new topic
Be careful with SSRC usage on critical tasks
KikeG
post Mar 5 2003, 11:21
Post #1


WinABX developer


Group: Developer
Posts: 1578
Joined: 1-October 01
Member No.: 137



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.

This post has been edited by KikeG: Mar 22 2003, 12:25
Go to the top of the page
+Quote Post
KikeG
post Mar 5 2003, 13:00
Post #2


WinABX developer


Group: Developer
Posts: 1578
Joined: 1-October 01
Member No.: 137



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).

This post has been edited by KikeG: Mar 5 2003, 13:01
Go to the top of the page
+Quote Post
_Shorty
post Mar 5 2003, 21:57
Post #3





Group: Banned
Posts: 694
Joined: 19-April 02
Member No.: 1820



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?
Go to the top of the page
+Quote Post
KikeG
post Mar 5 2003, 22:20
Post #4


WinABX developer


Group: Developer
Posts: 1578
Joined: 1-October 01
Member No.: 137



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.
Go to the top of the page
+Quote Post
rjamorim
post Mar 5 2003, 22:44
Post #5


Rarewares admin


Group: Members
Posts: 7515
Joined: 30-September 01
From: Brazil
Member No.: 81



QUOTE (KikeG @ Mar 5 2003 - 06:20 PM)
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?


--------------------
Get up-to-date binaries of Lame, AAC, Vorbis and much more at RareWares:
http://www.rarewares.org
Go to the top of the page
+Quote Post
tigre
post Mar 5 2003, 23:40
Post #6


Moderator


Group: Members
Posts: 1434
Joined: 26-November 02
Member No.: 3890



@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
Go to the top of the page
+Quote Post
NickSD
post Mar 6 2003, 01:04
Post #7





Group: Members
Posts: 135
Joined: 20-December 01
Member No.: 702



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

This post has been edited by NickSD: Mar 6 2003, 01:05
Go to the top of the page
+Quote Post
KikeG
post Mar 6 2003, 17:40
Post #8


WinABX developer


Group: Developer
Posts: 1578
Joined: 1-October 01
Member No.: 137



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.

This post has been edited by KikeG: Apr 23 2003, 11:13
Go to the top of the page
+Quote Post
tigre
post Mar 6 2003, 19:47
Post #9


Moderator


Group: Members
Posts: 1434
Joined: 26-November 02
Member No.: 3890



QUOTE (NickSD @ Mar 5 2003 - 04:04 PM)
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
Go to the top of the page
+Quote Post
KikeG
post Mar 7 2003, 13:02
Post #10


WinABX developer


Group: Developer
Posts: 1578
Joined: 1-October 01
Member No.: 137



QUOTE (tigre @ Mar 5 2003 - 11:40 PM)
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 wink.gif

This post has been edited by KikeG: Mar 7 2003, 13:02
Go to the top of the page
+Quote Post
tigre
post Mar 7 2003, 13:31
Post #11


Moderator


Group: Members
Posts: 1434
Joined: 26-November 02
Member No.: 3890



QUOTE (KikeG @ Mar 7 2003 - 04:02 AM)
QUOTE (tigre @ Mar 5 2003 - 11:40 PM)
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 smile.gif [/EDIT]

This post has been edited by tigre: Mar 7 2003, 13:52


--------------------
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
Go to the top of the page
+Quote Post
KikeG
post Mar 7 2003, 14:27
Post #12


WinABX developer


Group: Developer
Posts: 1578
Joined: 1-October 01
Member No.: 137



QUOTE (tigre @ Mar 7 2003 - 01:31 PM)
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 smile.gif [/EDIT]

Happy to help smile.gif
Go to the top of the page
+Quote Post
2Bdecided
post Mar 7 2003, 14:43
Post #13


ReplayGain developer


Group: Developer
Posts: 5059
Joined: 5-November 01
From: Yorkshire, UK
Member No.: 409



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 wink.gif 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.
Go to the top of the page
+Quote Post
tigre
post Mar 7 2003, 16:15
Post #14


Moderator


Group: Members
Posts: 1434
Joined: 26-November 02
Member No.: 3890



QUOTE (2Bdecided @ Mar 7 2003 - 05:43 AM)
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 wink.gif 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

This post has been edited by tigre: Mar 7 2003, 16:16


--------------------
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
Go to the top of the page
+Quote Post
KikeG
post Mar 7 2003, 16:45
Post #15


WinABX developer


Group: Developer
Posts: 1578
Joined: 1-October 01
Member No.: 137



QUOTE (2Bdecided @ Mar 7 2003 - 02:43 PM)
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.

This post has been edited by KikeG: Mar 7 2003, 16:47
Go to the top of the page
+Quote Post
2Bdecided
post Mar 7 2003, 17:16
Post #16


ReplayGain developer


Group: Developer
Posts: 5059
Joined: 5-November 01
From: Yorkshire, UK
Member No.: 409



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.
Go to the top of the page
+Quote Post
KikeG
post Mar 7 2003, 17:37
Post #17


WinABX developer


Group: Developer
Posts: 1578
Joined: 1-October 01
Member No.: 137



QUOTE (2Bdecided @ Mar 7 2003 - 05:16 PM)
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.
Go to the top of the page
+Quote Post
tigre
post Mar 7 2003, 18:17
Post #18


Moderator


Group: Members
Posts: 1434
Joined: 26-November 02
Member No.: 3890



QUOTE (2Bdecided @ Mar 7 2003 - 08:16 AM)
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 wink.gif - 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
Go to the top of the page
+Quote Post
tigre
post Mar 9 2003, 00:54
Post #19


Moderator


Group: Members
Posts: 1434
Joined: 26-November 02
Member No.: 3890



QUOTE (2Bdecided @ Mar 7 2003 - 08:16 AM)
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


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
Go to the top of the page
+Quote Post
KikeG
post Mar 22 2003, 12:23
Post #20


WinABX developer


Group: Developer
Posts: 1578
Joined: 1-October 01
Member No.: 137



Updated first post of the thread, adding needed values for triangular noise shaped dither (type 2).
Go to the top of the page
+Quote Post
M
post Apr 23 2003, 06:01
Post #21





Group: Members
Posts: 964
Joined: 29-December 01
Member No.: 830



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.
Go to the top of the page
+Quote Post
rjamorim
post Apr 23 2003, 06:13
Post #22


Rarewares admin


Group: Members
Posts: 7515
Joined: 30-September 01
From: Brazil
Member No.: 81



You can also try the "semi-official" SSRC frontend. That's the one Naoki used to recommend at his old web page.

http://www.lantlab.org/software/archive/ss...ssrcg05600b.zip


--------------------
Get up-to-date binaries of Lame, AAC, Vorbis and much more at RareWares:
http://www.rarewares.org
Go to the top of the page
+Quote Post
KikeG
post Apr 23 2003, 08:06
Post #23


WinABX developer


Group: Developer
Posts: 1578
Joined: 1-October 01
Member No.: 137



M, I haven't used any SSRC frontend. I have just used straight command-line options.
Go to the top of the page
+Quote Post
plonk420
post Apr 23 2003, 08:19
Post #24





Group: Members
Posts: 312
Joined: 6-October 01
Member No.: 227



'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)?
Go to the top of the page
+Quote Post
_Shorty
post Apr 23 2003, 09:26
Post #25





Group: Banned
Posts: 694
Joined: 19-April 02
Member No.: 1820



either direction
Go to the top of the page
+Quote Post

2 Pages V   1 2 >
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 26th July 2014 - 14:34