Skip to main content
Topic: How to downsample to 44.1kHz 16bit (Read 8962 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

How to downsample to 44.1kHz 16bit

I've read this article yesterday: 24/192 Music Downloads and why they make no sense and also watched this video dealing with reampling and bit depth conversions: Xiph Digital Show & Tell Episode 2
I have very few audio files in other format than 44.1kHz 16bit but if it really makes no sense to have audio in higher resolution - in case the only thing i doing with them is listening - i like to downsample them. Some of them are 192kHz 24bit recordings of vinyls. I've planned to downsample them before i was reading the article but i was not sure how to do it correctly.

I'm currently experimenting with the SoX resampler of Foobar and using the internal dither of Foobar while converting to 16bit. Is this good enough? I'm using the following settings with the SoX resampler:
- Best quality
- Passband: 95%
- Not checked "Allow aliasing/imaging"
- 50% linear phase reponse

What i don't really understand is what the later two options do. Is it fine this way?

Also if i have a 44.1kHz 24 bit audio file or a 48kHz 16bit audio file does it make sense to downsample these to 44.1kHz 16bit aswell or i'm hurting the audio quality more than what i'll benefit filesize wise? These two are very close to actual 44.1kHz 16 bit audio so maybe the job of the converter is more difficult in this case. Or is it completly safe to do it?

Thanks.
WavPack -b4x4hc
Opus --cvbr --bitrate 256 --framesize 5

How to downsample to 44.1kHz 16bit

Reply #1
The settings in Sox don't really matter.  Pretty much anything you pick will be overkill.  I would just use the defaults.

Converting to 16 bit is not downsampling, it'll be handled separately by foobar.  Assuming you've probably normalized your files so that they are not very quiet, there is no point in using 24 bit for vinyl transfers.

How to downsample to 44.1kHz 16bit

Reply #2
Also if i have [...] a 48kHz 16bit audio file does it make sense to downsample these to 44.1kHz 16bit aswell or i'm hurting the audio quality more than what i'll benefit filesize wise?


With a bad resampler, pretty much any sample rate change, even 48 to 44.1, is risking audible artifacts. How noticeable it is depends partly on the music, which can mask the noise sometimes.

But the SoX resampler, or the one in Audition? *kisses fingertips* Never any issues whatsoever, no matter what settings I use.

That said, I usually don't bother reducing 48 to 44.1 because it doesn't save much space. I may feel differently when my drives are all full, though.

How to downsample to 44.1kHz 16bit

Reply #3
I'll go with SoX then. Thanks!
WavPack -b4x4hc
Opus --cvbr --bitrate 256 --framesize 5

How to downsample to 44.1kHz 16bit

Reply #4
- Not checked "Allow aliasing/imaging"


This is what I found about this option in another thread here

Quote
If the -a option is given, then aliasing/imaging above the pass-
              band is allowed.  For example, with 44.1kHz sampling rate, and a
              resampling  band-width of 95%, this means that frequency content
              above 21kHz can be distorted; however, since this is  above  the
              pass-band  (i.e.  above the highest frequency of interest/audi?
              bility), this may not be a problem.  The  benefits  of  allowing
              aliasing/imaging  are  reduced  processing time, and reduced (by
              almost half) transient echo artefacts.

I see just advantages of allowing aliasing/imaging above the passband. Does anyone know why is it not then default?

How to downsample to 44.1kHz 16bit

Reply #5
I see just advantages of allowing aliasing/imaging above the passband. Does anyone know why is it not then default?


http://en.wikipedia.org/wiki/Aliasing

Aliasing is a kind of distortion that good resamplers are designed to eliminate.  There is no good reason to intentionally allow it unless you are on a machine that is too slow to properly handle it.

How to downsample to 44.1kHz 16bit

Reply #6
I see just advantages of allowing aliasing/imaging above the passband. Does anyone know why is it not then default?

Most likely because aliasing can be a bad thing when used wrong and to prevent people complaining about it because aliasing is used as bad guy in many ways by audio press. Still i doubt any serious results on audibility with aliasing on/off for 44.1khz resampling is presented related to Sox so just use what makes you more happy. I use aliasing because i had some less clipping on heavily compressed material. Not audible but maximum no clipping gain changed.
Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!

How to downsample to 44.1kHz 16bit

Reply #7
I use aliasing because i had some less clipping on heavily compressed material. Not audible but maximum no clipping gain changed.


Any resampler can change the maximum level of a signal, particularly if done at high precision.  This is what resampling does:  compute new points from old points.  Because the new points aren't in the same locations as the old points, they will have different values, sometimes higher, sometimes lower. 

If your sample is already clipping, its a good idea to replaygain it, or at least renormalize it so that you do not introduce even more clipping when converting back to integer PCM.  Using a different resampler won't help with this though, unless the new one is secretly renormalizing for you, which would probably not be great.

How to downsample to 44.1kHz 16bit

Reply #8
sox -G / --guard: Automatically invoke the gain effect to guard against clipping. I.e. sox will slightly attenuate the file when clipping may occur.

How to downsample to 44.1kHz 16bit

Reply #9
I indeed had the impression that it is disabled by default just to please people that don't understand the concepts of a lowpass filter and the upper limits of human hearing but just don't want 'aliasing' because it is considered as generally bad. However, transient echo artifacts *are* noticeable and reducing them could be a (albeit very small) advantage.


That said, I usually don't bother reducing 48 to 44.1 because it doesn't save much space. I may feel differently when my drives are all full, though.


I usually downsample to 44.1kHz from all sources just if I encode to MP3 since I know that LAME is specifically optimized for 44.1kHz material with -V presets.

How to downsample to 44.1kHz 16bit

Reply #10
Any resampler can change the maximum level of a signal, particularly if done at high precision.  This is what resampling does:  compute new points from old points.  Because the new points aren't in the same locations as the old points, they will have different values, sometimes higher, sometimes lower. 

If your sample is already clipping, its a good idea to replaygain it, or at least renormalize it so that you do not introduce even more clipping when converting back to integer PCM.  Using a different resampler won't help with this though, unless the new one is secretly renormalizing for you, which would probably not be great.

Thats why i do and aliasing has a slight advantage here.
Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!

How to downsample to 44.1kHz 16bit

Reply #11
sox -G / --guard: Automatically invoke the gain effect to guard against clipping. I.e. sox will slightly attenuate the file when clipping may occur.

When i remember right the guard command is not very intelligent. It simply applies a gain that sox thinks is safe for the operation. For resampling this means simply a gain of -3
Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!

How to downsample to 44.1kHz 16bit

Reply #12
I indeed had the impression that it is disabled by default just to please people that don't understand the concepts of a lowpass filter and the upper limits of human hearing but just don't want 'aliasing' because it is considered as generally bad. However, transient echo artifacts *are* noticeable and reducing them could be a (albeit very small) advantage.

For 44.1kHz material and a typical filter starting above 20kHz this shouldn't be a problem. Somwhere here i once posted some spectral plots illustrating that aliasing used with Sox indeed clearly reduces the post and pre ringing.
Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!

How to downsample to 44.1kHz 16bit

Reply #13
Any resampler can change the maximum level of a signal, particularly if done at high precision.  This is what resampling does:  compute new points from old points.  Because the new points aren't in the same locations as the old points, they will have different values, sometimes higher, sometimes lower. 

If your sample is already clipping, its a good idea to replaygain it, or at least renormalize it so that you do not introduce even more clipping when converting back to integer PCM.  Using a different resampler won't help with this though, unless the new one is secretly renormalizing for you, which would probably not be great.

Thats why i do and aliasing has a slight advantage here.


What?

sox -G / --guard: Automatically invoke the gain effect to guard against clipping. I.e. sox will slightly attenuate the file when clipping may occur.

When i remember right the guard command is not very intelligent. It simply applies a gain that sox thinks is safe for the operation. For resampling this means simply a gain of -3


According to the documentation, this is not the case.  And anyway, since the resampler uses floating point, this would be pointless anyway.  You can trivially renormalize FP values to be within [-1 1].

How to downsample to 44.1kHz 16bit

Reply #14
I tried (on a single file, admittedly):

  • original (24 / 88.2): -0.1 dBFS peak (0.98843944 FS), -5.92 dB track gain
  • resampled to 24 / 44.1, with -G: very slightly below 0 dBFS peak (0.99999559 FS), -5.47 dB track gain
  • resampled to 24 / 44.1, without -G: 0 dBFS (1.0 FS), -5.92 dB track gain

How to downsample to 44.1kHz 16bit

Reply #15
I tried (on a single file, admittedly):

  • original (24 / 88.2): -0.1 dBFS peak (0.98843944 FS), -5.92 dB track gain
  • resampled to 24 / 44.1, with -G: very slightly below 0 dBFS peak (0.99999559 FS), -5.47 dB track gain
  • resampled to 24 / 44.1, without -G: 0 dBFS (1.0 FS), -5.92 dB track gain


So basically, the guard option works correctly, and if you don't use it you get clipping.

Use the guard option !

How to downsample to 44.1kHz 16bit

Reply #16
I tried (on a single file, admittedly):

  • original (24 / 88.2): -0.1 dBFS peak (0.98843944 FS), -5.92 dB track gain
  • resampled to 24 / 44.1, with -G: very slightly below 0 dBFS peak (0.99999559 FS), -5.47 dB track gain
  • resampled to 24 / 44.1, without -G: 0 dBFS (1.0 FS), -5.92 dB track gain

I know it somehow didn't work for me. How is it when you guard an album with single tracks? Does it apply different gains?
It also may have done something wrong when used with realtime resampling at my Squeezebox server. I only know i didn't use it.
Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!

How to downsample to 44.1kHz 16bit

Reply #17
It also may have done something wrong when used with realtime resampling at my Squeezebox server. I only know i didn't use it.


Its impossible to perform a processing step that must scan the entire file in realtime, so no, you did not use it

If you want to do this without processing the entire file first, use replaygain.  Essentially all the guard option is doing is computing the replaygain track peak after processing.  If you use replaygain, you can simply skip that step and so perform the resampling in real time. 


How to downsample to 44.1kHz 16bit

Reply #18
It also may have done something wrong when used with realtime resampling at my Squeezebox server. I only know i didn't use it.


Its impossible to perform a processing step that must scan the entire file in realtime, so no, you did not use it

If you want to do this without processing the entire file first, use replaygain.  Essentially all the guard option is doing is computing the replaygain track peak after processing.  If you use replaygain, you can simply skip that step and so perform the resampling in real time.

How do you know i didn't use it? Was it not exactly that case i described? When sox doesn't have the chance to process the file twice does the guard command then simply apply a safe negative gain?

Edit: btw. why we are again discussing questions nobody asked? I simply answered what aliasing makes different with sox for me.
Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!

How to downsample to 44.1kHz 16bit

Reply #19
I'm telling you that its logically impossible for that option to work like you want in realtime mode. I don't know what it does in that case but you can probably look it up in the manual.

Edit: yeah and I'm telling you that you are wrong about what the alaising option does in Sox.

Edit2:  What I was trying to say above and I think you misunderstood is that changes in the peak value are an intrinsic part of resampling.  Its not possible for one resampler to be better or worse at this.  Changing the resampler to avoid this problem means that you're doing something wrong.  Hence I was suggesting how to setup sox so that you do not have this problem (e.g. use replaygain or the guard option depending on what you are doing).

 

How to downsample to 44.1kHz 16bit

Reply #20
How is it when you guard an album with single tracks? Does it apply different gains?


Doesn't matter, because:

  • if the guard parameter needs to do its thing in order to avoid clipping, the attenuation is very small;
  • other tracks with high peaks will be attenuated by a similar (close enough) amount;
  • even if some tracks get slightly attenuated, and others don't, the difference won't be any larger (most likely lower) than the differences in Replaygain track gains one can find in pretty much all albums (i.e. the tracks in any given album are almost never of the same perceptual loudness, as computed by Replaygain).

 
SimplePortal 1.0.0 RC1 © 2008-2020