1
$\begingroup$

The tl;dr
What dither algorithm should I use when converting 24/48 mono speech to 8/8?

--

I'm truncating and downsampling a 24/48 mono audio source containing only speech to 8/8. I won't be doing any further processing so there's no need to use anything like triangular dither. Other information about the source:

  • It is aggressively highpassed at 200Hz
  • It is lowpassed at 2kHz (6dB per pole per octave, 2 poles)
  • It contains white noise with a mean volume of -44dB (max -30dB)
  • The speech is single male voice (mean volume approximately -20dB)

I have several options for dither:

  • lipshitz
  • shibata
  • low_shibata
  • high_shibata
  • f_weighted
  • modified_e_weighted
  • improved_e_weighted

I'm using ffmpeg for this task. If needed I can post the command I'm using, but because my question is about the algorithms and not about the software, I decided to keep it out.

I understand dither basics and I know the difference between shaped and unshaped dither, but I don't know much about these different algorithms (I've been using shibata). Most of them seem to come from Minimally Audible Noise Shaping (Lipshitz et al., 1991) but my DSP knowledge is too limited to understand enough of the paper to make my decision.

Which of these algorithms would be the best to use when truncating and resampling a 24bit, 48kHz source to 8bit, 8kHz?

--

To respond to the comments (I cannot write a comment, it seems I can post but not submit comments when I am using Tor browser due to 403):

I don't have any specification for "best", but I want to know if there is a best practice here. I'm limited to using ffmpeg's filters and its resampler:

asubcut=200,lowpass=2000,afftdn,speechnorm,volume=6dB,aresample=8000:dither_method=shibata:osf=u8

(aggressive highpass at 200Hz -> lowpass at 2kHz -> denoise -> speech normalization -> increase volume -> resample to 8kHz and truncate to 8bit)

There isn't a way to very very aggressively lowpass so that everything above 3.9kHz is dead. The aiir filter might be able to do that but I don't know how to use it for that. The lowpass filter only attenuates at 6dB per pole per octave.

$\endgroup$
5
  • 1
    $\begingroup$ Do you have any specification for "best"? Because it depends what kind of result you are happy with. For generic audio, does it matter as long as it sounds "good enough" for your ears? Also noise shaping focuses the energy to high frequencies, but due to 8 kHz sampling rate, the high frequencies mean a maximum of 4 kHz. Can your DAC output also filter out the frequencies above the required 2 kHz bandwidth? The "best" may depend on the playback system. $\endgroup$
    – Justme
    Commented Apr 18 at 8:30
  • 1
    $\begingroup$ If you already have noise at -44dB why would you need an additional dither ? $\endgroup$
    – Hilmar
    Commented Apr 18 at 9:59
  • $\begingroup$ I know who Stanley Lipshitz is. I have had several conversations with him since 1982. Dunno who or what shibata is. If noise shaping the quantization noise is used (and I highly recommend it since you're really truncating the word, big time), then the dither should be triangular p.d.f. and white. The spectral shaping happens in the noise feedback. Also, you should LPF and downsample from 48 kHz to 8 kHz first, with your full word width. Even noise-shaping that. Then when you decimate by tossing 5 outa 6 samples, The noise-shaping should be gentle. $\endgroup$ Commented Apr 18 at 14:06
  • $\begingroup$ If it were me, I would first convert from 24-bit 48-kHz to 32-bit 48-kHz with at least 24 dB of headroom (that means your 24 bits is padded by 4 bits on both left and right). Then brick-wall filter that to a 4 kHz bandwidth with pretty aggressive noise shaping to the top octave (it doesn't matter too much, because that noise will get folded back into the baseband when downsampling). Then downsample to 8 kHz by simply tossing 5 of every 6 samples. Then, because there is no good place to send your noise to, I would quantize to 8 bits without additional dither using simple fraction saving, $\endgroup$ Commented Apr 18 at 14:19
  • $\begingroup$ ya know, @justaboy, this question got me thinking. I hadn't really considered (or considered enough) this problem. I do know that, while it's still 24-bit audio and 48 kHz sample rate, you want to effectively brick-wall low-pass filter it so that it's unchanged below 3.9 kHz and pretty much killed above 4.0 kHz. A good long FIR filter can do that. And you can noise-shape that quantization. But normally we steer the noise to high frequencies, where our hearing is least sensitive. But downsampling will put that noise right back into the passband and that cannot be avoided. $\endgroup$ Commented Apr 18 at 21:35

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.