Skip to main content

Topic: Should I dither? (Converting 24bit to 16bit FLAC) (Read 6441 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • bmcelvan
  • [*][*]
Should I dither? (Converting 24bit to 16bit FLAC)
I'm converting 24bit/96kHz FLAC files to both mp3 and 16bitFLAC files.

I've already determined for mp3 I will keep the source files at 24bit but downsample to 44.1 and then run through LAME since it can accept 24bit source files and I won't have to deal with the dithering issue.

I chose 44.1 as it will create smaller file sizes than 48kHz and I can't tell any difference between 44.1 and 48kHz audio files thru abx testing.

However my real question is about what to do for the FLAC files in regards to dithering. I figured I'd take the .mp3 input 24/44.1 file and then use SoX to convert to 16bit. Should I dither or not for this process?

Technically speaking, when using dithering doesn't it potentially increase the dynamic range of a 16bit file? What are the advantages/disadvantages of not dithering?

These FLAC files would be my long term archive files (as well as listening files when I'm home and/or have access to them). The .mp3s would be my traveling/portable set of files.

Any advice?

  • KozmoNaut
  • [*][*][*][*][*]
Re: Should I dither? (Converting 24bit to 16bit FLAC)
Reply #1
It's unlikely that you would be able to hear the difference, but the generally accepted advice is to use dither whenever converting to 16bit or less.

For SoX, the command line would be:
sox <infile> -b 16 <outfile> rate 44100 dither -s


For noise shaped dither at the default recommended settings.

  • pdq
  • [*][*][*][*][*]
Re: Should I dither? (Converting 24bit to 16bit FLAC)
Reply #2
Why do you think that the 44.1 files will be smaller than 48?

  • bmcelvan
  • [*][*]
Re: Should I dither? (Converting 24bit to 16bit FLAC)
Reply #3
It's unlikely that you would be able to hear the difference, but the generally accepted advice is to use dither whenever converting to 16bit or less.

For SoX, the command line would be:
sox <infile> -b 16 <outfile> rate 44100 dither -s


For noise shaped dither at the default recommended settings.


Thanks for the response.

Another question for you then...as you mention the command line. I've been using foobar (Win7) and the SoX add-on element in the foobar program for all converting:
24-bit to 16-bit I've been doing that thru the foobar convert-->WAV (16bit) and dither always or never.
48kHz (or greater) to 44.1kHz, I've been doing that thru foobar convert-->processing-->SoX and using the defaults there with the high quality option (95%, no aliasing & 50% phase response (linear).

Should I use the command line instead of foobar-->SoX for the downsampling? Is it technically better for transparent conversion?
Should I use the SoX command line for the entire conversion, downsample and bit depth change for the same reasons above, is it better than the foobar GUI?

thanks so much

I assume I can get the SoX command line tools from sourceforge?
and will it accept *.* for command line functions to a batch of files?

  • bmcelvan
  • [*][*]
Re: Should I dither? (Converting 24bit to 16bit FLAC)
Reply #4
Why do you think that the 44.1 files will be smaller than 48?

They always are when I convert the same source file to both versions.

Should it not be that way - isn't it technically storing more information (provided there is signal in that extra 4kHz) even if I can't hear it?

  • greynol
  • [*][*][*][*][*]
  • Global Moderator
Re: Should I dither? (Converting 24bit to 16bit FLAC)
Reply #5
Is it technically better for transparent conversion?
Transparent means audibly indistinguishable, therefore you can only obtain an answer through a proper listening test.
Is 24-bit/192kHz good enough for your lo-fi vinyl, or do you need 32/384?

  • KozmoNaut
  • [*][*][*][*][*]
Re: Should I dither? (Converting 24bit to 16bit FLAC)
Reply #6
Should I use the command line instead of foobar-->SoX for the downsampling?

You're using the default options, so you'll get the same results as on the command line.

  • pdq
  • [*][*][*][*][*]
Re: Should I dither? (Converting 24bit to 16bit FLAC)
Reply #7
Why do you think that the 44.1 files will be smaller than 48?

They always are when I convert the same source file to both versions.

Should it not be that way - isn't it technically storing more information (provided there is signal in that extra 4kHz) even if I can't hear it?
If you are converting to cbr files then the size will be identical regardless of sample rate. If you are converting to vbr then there is a target quality, which may or may not require more bits. Also, the encoder tries very hard not to use bits for something that you cannot hear.

Then there is sfb21...

  • Porcus
  • [*][*][*][*][*]
Re: Should I dither? (Converting 24bit to 16bit FLAC)
Reply #8
However my real question is about what to do for the FLAC files in regards to dithering. I figured I'd take the .mp3 input 24/44.1 file

FLAC -> MP3 -> FLAC? Why?

  • bmcelvan
  • [*][*]
Re: Should I dither? (Converting 24bit to 16bit FLAC)
Reply #9
If you are converting to cbr files then the size will be identical regardless of sample rate. If you are converting to vbr then there is a target quality, which may or may not require more bits. Also, the encoder tries very hard not to use bits for something that you cannot hear.

Then there is sfb21...

Sorry if this was confusing and to Porcus point I think it is clear that it was.
What I'm doing is: 1 MP3 & 2 FLAC
1 - 24/96 FLAC-->24/44.1WAV-->LAME MP3
2-                                            -->16/44.1 FLAC

In regards to .mp3 filesize, I see your point. However I was referring to FLAC filesizes although that was very confusing, sorry. Also, maybe it's just principle but I don't see a reason to encode anything that I can't hear. For .mp3 I use -v2 but even for my archives...I know I cannot hear anything above 18.5-19.0 kHz. My son who is 4 years old so has great ears can't hear anything above 20.0-20.5kHz so i don't see a need to keep anything higher than that in my FLACs and just waste HDD space.

  • bmcelvan
  • [*][*]
Re: Should I dither? (Converting 24bit to 16bit FLAC)
Reply #10
Should I use the command line instead of foobar-->SoX for the downsampling?

You're using the default options, so you'll get the same results as on the command line.

KozmoNaut:
If I simply use the foobar GUI-->convert-->output WAV (16bit DITHER ALWAYS) and the SoX resampler with no aliasing, 95% passband, and 50% phase, that will yield the same results as using the SoX command line of:
sox <infile> -b 16 <outfile> rate 44100 dither -s

One more question as I read someone post somewhere that when converting like this sometimes the audio can get clipped. Using --guard or something like that in SoX command line will prevent, rather warn about clipping and the volume can be reduced to prevent clipping.

Can I assume using the foobar SoX you won't get that warning? Seems like reason enough to use command line, or am I missing something?
  • Last Edit: 06 December, 2016, 02:22:51 PM by bmcelvan

Re: Should I dither? (Converting 24bit to 16bit FLAC)
Reply #11
Foobar GUI has differently - (more) strongly shaped dither than SoX's dither -s.

  • bmcelvan
  • [*][*]
Re: Should I dither? (Converting 24bit to 16bit FLAC)
Reply #12
Foobar GUI has differently - (more) strongly shaped dither than SoX's dither -s.

It looks as though you're implying command line is better?

What about the clipping issue and using the --guard option. Think it's worth switching to the command line for this?

Re: Should I dither? (Converting 24bit to 16bit FLAC)
Reply #13
Foobar GUI has differently - (more) strongly shaped dither than SoX's dither -s.

It looks as though you're implying command line is better?

What about the clipping issue and using the --guard option. Think it's worth switching to the command line for this?

Not neccesarily better - different.

I would not worry about clipping if it occurs very rarely.

  • greynol
  • [*][*][*][*][*]
  • Global Moderator
Re: Should I dither? (Converting 24bit to 16bit FLAC)
Reply #14
It looks as though you're implying command line is better?
He won't be able to comment on any sound quality differences without breaking TOS8, so I'd pay him no mind.
  • Last Edit: 06 December, 2016, 02:50:32 PM by greynol
Is 24-bit/192kHz good enough for your lo-fi vinyl, or do you need 32/384?

Re: Should I dither? (Converting 24bit to 16bit FLAC)
Reply #15
It looks as though you're implying command line is better?
He won't be able to comment on any sound quality differences without breaking TOS8, so I'd pay him no mind.

And what type of dither would you recommend for 16 bit tracks for routine workflow?

  • KozmoNaut
  • [*][*][*][*][*]
Re: Should I dither? (Converting 24bit to 16bit FLAC)
Reply #16
KozmoNaut:
If I simply use the foobar GUI-->convert-->output WAV (16bit DITHER ALWAYS) and the SoX resampler with no aliasing, 95% passband, and 50% phase, that will yield the same results as using the SoX command line of:
sox <infile> -b 16 <outfile> rate 44100 dither -s

One more question as I read someone post somewhere that when converting like this sometimes the audio can get clipped. Using --guard or something like that in SoX command line will prevent, rather warn about clipping and the volume can be reduced to prevent clipping.

Can I assume using the foobar SoX you won't get that warning? Seems like reason enough to use command line, or am I missing something?

Yes, that should give you the default same results as that command line. I'm not 100% sure about the options set "behind the scenes" in the plugin, but it should be using noise-shaped dither and clipping protection, AFAIK.

  • greynol
  • [*][*][*][*][*]
  • Global Moderator
Re: Should I dither? (Converting 24bit to 16bit FLAC)
Reply #17
And what type of dither would you recommend for 16 bit tracks for routine workflow?
Sans double blind test results demonstrating a difference (let alone a preference), the defaults will be adequate.  As for which resampler, I would go with the one that is most efficient (which I guess is SoX, based on what little research I've done on the subject).
Is 24-bit/192kHz good enough for your lo-fi vinyl, or do you need 32/384?

  • bennetng
  • [*][*][*][*][*]
Re: Should I dither? (Converting 24bit to 16bit FLAC)
Reply #18
What I'm doing is: 1 MP3 & 2 FLAC
1 - 24/96 FLAC-->24/44.1WAV-->LAME MP3
2-                                            -->16/44.1 FLAC
If you cannot hear the differences of dither vs truncate (no dither), then it is wiser not to use dither when encoding to 16-bit flac since the noise used in dither is hard to encode which may yield bigger 16/44 flac files.

Also, with foobar2000, you don't need to manually create any intermediate 24/44 wav files. Just set the SoX resampler to output 44k and encode to mp3 directly. All kinds of intermediate bit-depth conversion, when needed, will be automatically performed.

Re: Should I dither? (Converting 24bit to 16bit FLAC)
Reply #19
And what type of dither would you recommend for 16 bit tracks for routine workflow?
Sans double blind test results demonstrating a difference (let alone a preference), the defaults will be adequate.  As for which resampler, I would go with the one that is most efficient (which I guess is SoX, based on what little research I've done on the subject).

Alright. Reasonable approach.

  • greynol
  • [*][*][*][*][*]
  • Global Moderator
Re: Should I dither? (Converting 24bit to 16bit FLAC)
Reply #20
If you cannot hear the differences of dither vs truncate (no dither), then it is wiser not to use dither when encoding to 16-bit flac since the noise used in dither is hard to encode which may yield bigger 16/44 flac files.
"May" being the operative, as the least significant bit(s) in the truncated file could very easily be uncorrelated noise as well.
Is 24-bit/192kHz good enough for your lo-fi vinyl, or do you need 32/384?

  • bmcelvan
  • [*][*]
Re: Should I dither? (Converting 24bit to 16bit FLAC)
Reply #21
KozmoNaut:
If I simply use the foobar GUI-->convert-->output WAV (16bit DITHER ALWAYS) and the SoX resampler with no aliasing, 95% passband, and 50% phase, that will yield the same results as using the SoX command line of:
sox <infile> -b 16 <outfile> rate 44100 dither -s

One more question as I read someone post somewhere that when converting like this sometimes the audio can get clipped. Using --guard or something like that in SoX command line will prevent, rather warn about clipping and the volume can be reduced to prevent clipping.

Can I assume using the foobar SoX you won't get that warning? Seems like reason enough to use command line, or am I missing something?

Yes, that should give you the default same results as that command line. I'm not 100% sure about the options set "behind the scenes" in the plugin, but it should be using noise-shaped dither and clipping protection, AFAIK.

Awesome!!

Thanks so much

  • bmcelvan
  • [*][*]
Re: Should I dither? (Converting 24bit to 16bit FLAC)
Reply #22
What I'm doing is: 1 MP3 & 2 FLAC
1 - 24/96 FLAC-->24/44.1WAV-->LAME MP3
2-                                            -->16/44.1 FLAC
If you cannot hear the differences of dither vs truncate (no dither), then it is wiser not to use dither when encoding to 16-bit flac since the noise used in dither is hard to encode which may yield bigger 16/44 flac files.

This is interesting...in my experience when actually comparing the two, the dithered FLAC files are almost always bigger. Not by very much, but this explains why. The greater the kHz the bigger the difference too.

Thank you


Re: Should I dither? (Converting 24bit to 16bit FLAC)
Reply #23
I would not bother with +-10 percent of file size today. Personally, I would even stay at 48 kHz (not more). But I fully recognize arguments that say that 44.1 is enough because of what we can hear.

For sure Foobar is a convenient way to do conversions especially when you want to work with its playlists of files.

If you get to know the command line approach the SoX gives you more options for dither but as was already stated here the differences usually cannot be distinguished in ABX tests. There was a thread here this year where the sounds of highly amplified dither were posted, they can serve as a hint of how those "dither sounds" are applied. But in your position you need not to worry about it much and just choose dither and apply. Regarding audibility you'll be OK.


  • Last Edit: 07 December, 2016, 03:10:50 AM by jumpingjackflash5

  • KozmoNaut
  • [*][*][*][*][*]
Re: Should I dither? (Converting 24bit to 16bit FLAC)
Reply #24
It really doesn't matter, as we're talking about noise waaaay down in the signal.

So unless you're toying around with recordings that are skating along just barely above the noise floor, don't worry about it. And if that is the case, get some better recordings ;-)