Attenuation in bit-padded source with SOX

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
Hi Guys:

Using SOX to upsample in software (prefer to do it file level rather than asking the Behringer DEQ I use to do it), and want to include a normalization at -12dB. Going from flac 44.1/16 to 48/24. My command string is as follows:

cd %~dp0
mkdir converted
FOR %%A IN (%*) DO sox --buffer 32768 %%A -b 24 "converted/%%~nxA" gain -n -12 rate -v 48000 dither -f low-shibata
pause

Doesn't seem like I should lose anything with the dither (which I'm using purely for low-level artifact masking) or by tossing away a couple bits to get the attenuation (given the 8 padding bits). Seem okay?
 
Last edited:
Hi badman,

I can't comment on SOX specifically, but so long as its a good resampler I think your use-case is reasonable. Does the output of your command sound alright? If so, it's probably fine.

In terms of purity, you'll of course get quantisation noise at the 24th bit due to the processing. Given that you've resampled, the gain step is the least of your worries. In any case, dithering the output quantisation is definitely the right thing so you don't get distortion - I'd probably use flat TPDF dither with 24 bits, but some noise-shaping is probably fine too.

However, if the resampler's internals use 32-bit floating-point, you'll get some extra distortion appearing on top of that when the signal amplitude is loud, so if you're a real purist you'll want to make sure that the processing is done at 64-bit floating-point before the output quantisation. It's almost certainly overkill, but "24-bit pure" is a nice, perfectly attainable performance level as far as DSP goes, and 32-bit floating-point doesn't provide it in all cases.
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.