Hydrogenaudio Forums

Hydrogenaudio Forum => General Audio => Topic started by: ron spencer on 2017-07-16 17:32:41

Title: SoX and Converting 192/24 to 96/24
Post by: ron spencer on 2017-07-16 17:32:41
Not sure this matters, but I'd thought I'd ask the experts here. I would like to bring on a trip some hi-res files I've purchased, but I don't want to bring the 192/24; so I thought I'd reduce to 96/24 and learn something more about SoX. I am curious as to which options may provide better a better resample (though I realize I may not hear that much of a difference). From the SoX  manual:

Quote
−M/−I/−L Phase response = minimum/intermediate/linear
−s Steep filter (band-width = 99%)
−a Allow aliasing/imaging above the pass-band
−b 74−99 . 7 Any band-width %
−p 0−100 Any phase response (0 = minimum, 25 = intermediate, 50 = linear, 100 = maximum)

I figure -L is fine for linear, but I am not sure about if I should try a steep filter or not, or any of the other options. Or, really, if it even matters for this sample conversion.

I had settled on
Quote
-v -L -b 95 96000
but I thought I should ask here.

If anyone has any suggestions let me know.  Thanks
Title: Re: SoX and Converting 192/24 to 96/24
Post by: Wombat on 2017-07-16 18:41:38
I see nothing wrong. This filter acts above 45kHz. No idea how to mess that up.
Title: Re: SoX and Converting 192/24 to 96/24
Post by: ron spencer on 2017-07-16 19:21:41
thank you...when would one want to use a "steep" filter?
Title: Re: SoX and Converting 192/24 to 96/24
Post by: Wombat on 2017-07-16 19:30:31
I guess the 'steep' setting is meant to keep most content for lower samplerates in one setting like other softwares do. I'd never use it.
Title: Re: SoX and Converting 192/24 to 96/24
Post by: ron spencer on 2017-07-16 19:45:44
thanks for responding...I'll keep with what I have. I have read that some use it going to 44.1, but I gather you would not? Is there any particular reason why not?

Cheers!
Title: Re: SoX and Converting 192/24 to 96/24
Post by: Wombat on 2017-07-16 20:06:12
It is just me and over here we have found no prove if a steep filter really harms.
https://hydrogenaud.io/index.php/topic,109900.25.html
There is also a famous listening test of filters thats result is said to be at fault because it uses an unusual narrow filtering wide of 500Hz :)
Title: Re: SoX and Converting 192/24 to 96/24
Post by: bennetng on 2017-07-17 11:57:50
@ron spencer

Explanation is not needed if you can actually hear the differences. Try to resample to something like 16-32kHz with different parameters to make the differences more likely to be audible in order to understand what those parameters mean. Many DACs don't support native sample rate below 44.1k, so the files will likely be upsampled to at least 44.1kHz again, but when this upsampling process is constant, then all audible differences are caused by the downsampling process, therefore still useful for comparison. Also, make sure the resampling process doesn't clip:
https://hydrogenaud.io/index.php/topic,101850.0.html

A drawback of this experiment is, most hi-res audio files don't have meaningful and high amplitude signal beyond somewhere around 30-40kHz, read this thread for example:
https://hydrogenaud.io/index.php/topic,114247.0.html

So when resample from 192k to 96k, slight differences like 90-99% bandwidth actually mean nothing, even if you play a hi-res file at half or even quarter speed to inspect higher frequencies. How can the filtering effects audible if there is nothing to filter at the first place?
Title: Re: SoX and Converting 192/24 to 96/24
Post by: Arnold B. Krueger on 2017-07-17 13:54:48
It is just me and over here we have found no prove if a steep filter really harms.
https://hydrogenaud.io/index.php/topic,109900.25.html
There is also a famous listening test of filters thats result is said to be at fault because it uses an unusual narrow filtering wide of 500Hz :)

What kind of proof are you looking for?

Of course in science, there are no proofs, just different pieces of evidence whose strength varies.

One seemingly relevant factoid is that most means for making steep filters, or more properly filters with narrow transition bands, have the effect of creating more ringing.

Ringing is audible if extreme and at audible frequencies, and it becomes audible even when at inaudible frequencies if it for example stimulates clipping.
Title: Re: SoX and Converting 192/24 to 96/24
Post by: ron spencer on 2017-07-17 22:59:12
In all honesty, I am just looking at getting the best I can get. I don't seem to be able to hear with any differences, so unless there is something else I can add I think I'm ok.
Title: Re: SoX and Converting 192/24 to 96/24
Post by: bandpass on 2017-07-18 08:45:12
thanks for responding...I'll keep with what I have. I have read that some use it going to 44.1, but I gather you would not? Is there any particular reason why not?
The default parameters, i.e. no options at all, are good for all common situations.

Advantages of a steep filter:

Disadvantages of a steep filter:
Title: Re: SoX and Converting 192/24 to 96/24
Post by: danadam on 2017-07-28 15:21:03
http://sox.sourceforge.net/Docs/FAQ -> 5. What are the best 'rate' settings to resample a file and retain the highest quality?

Personally, I just use:
Code: [Select]
sox -G input_file -b 16 -r 44100 output_file
I don't seem to be able to hear with any differences
Did you check how far can you go and still hear no differences? Why stop at 96/24? :)
Title: Re: SoX and Converting 192/24 to 96/24
Post by: Arnold B. Krueger on 2017-07-29 16:57:07
In all honesty, I am just looking at getting the best I can get. I don't seem to be able to hear with any differences, so unless there is something else I can add I think I'm ok.

The narrowest frequency range for transparent reproduction with normal music is 20 Hz - 16 KHz.

Some instruments produce significant output down to 16 Hz or less. Then there are ambient sounds like foot tapping that my go lower.

The narrowest sonically transparent dynamic range for most music in most venues and listening situations is about 75 dB, which corresponds to 13 bits.

So, 16/44 is an "overkill" format, and not by a little.
Title: Re: SoX and Converting 192/24 to 96/24
Post by: Crysist on 2017-08-06 03:25:17

Ringing is audible if extreme and at audible frequencies, and it becomes audible even when at inaudible frequencies if it for example stimulates clipping.


How do you mean? Are you talking about the Gibbs effect where the peaky bits due to a sharp filter may cause clipping?
Title: Re: SoX and Converting 192/24 to 96/24
Post by: Anakunda on 2018-11-08 08:56:43
Hiyas, having similar task and not wanting to make new topic:
Can anybody advice what's wrong with commandline syntax for redirecting of stdin downscaled to 16bit preserving sampling rate to stdout?

Code: [Select]
... | sox -t wav --ignore-length - -G -b 16 -t wav dither | ...

I'm getting the list of supported arguments so It's not correct

Or is there by chance a foobar's DSP plugin to do the same?
Title: Re: SoX and Converting 192/24 to 96/24
Post by: lvqcl on 2018-11-08 16:01:42
How piping can work together with -G option??
Title: Re: SoX and Converting 192/24 to 96/24
Post by: Anakunda on 2018-11-08 20:32:39
Piping does work with -G if resampling too:

sox -t wav --ignore-length - -G -b 16 -t wav - rate -v -L 44100 dither

But I don't want to resample here
Title: Re: SoX and Converting 192/24 to 96/24
Post by: danadam on 2018-11-09 16:45:51
Hiyas, having similar task and not wanting to make new topic:
Can anybody advice what's wrong with commandline syntax for redirecting of stdin downscaled to 16bit preserving sampling rate to stdout?

Code: [Select]
... | sox -t wav --ignore-length - -G -b 16 -t wav dither | ...
I think you are missing "-" for output file:
Code: [Select]
... -b 16 -t wav - dither | ...
Title: Re: SoX and Converting 192/24 to 96/24
Post by: Anakunda on 2018-11-10 21:38:01
Code: [Select]
... -b 16 -t wav - dither | ...

Indeed. That was it, thanks for pointing it out.
SimplePortal 1.0.0 RC1 © 2008-2019