LW IT Solutions logo LW IT Solutions logo LW IT Solutions
« Blog Overview /Music Production / Dither When Exporting to 16-Bit: Distortion, Noise...
Read this article in other languages:

Dither When Exporting to 16-Bit: Distortion, Noise Modulation and Noise Shaping, Measured

Dither When Exporting to 16-Bit: Distortion, Noise Modulation and Noise Shaping, Measured
Contents
  1. How the measurement was made
  2. Without dither: the error depends on the signal
  3. RPDF and TPDF: distortion removed, even noise only with TPDF
  4. Noise shaping: less noise below 4 kHz, more noise in total
  5. Dithered twice: every pass adds noise
  6. What this means for the export
  7. Context and limits
  8. Questions and answers
  9. Sources

FL Studio’s mixer calculates with 32-bit floating-point numbers. When exporting to a 16-bit file, every sample has to land on one of 65,536 steps. One step, the LSB, corresponds to 1/32,768 of full scale or −90.3 dBFS. The quieter the signal, the larger the rounding error is in relation to it: for a sine at −60 dBFS it was 38 dB below the tone, at −96 dBFS above it. The FL Studio manual describes dither as a way to break up the predictability of these rounding errors and applies it only when exporting 16-bit WAV and MP3.

The measurement converts test signals from 32-bit float to 16-bit with ffmpeg: without dither, with rectangular dither (RPDF), with triangular dither (TPDF), with high-pass filtered TPDF and with three noise-shaping methods. Robert A. Wannamaker summarised the theory in his 1997 doctoral thesis: undithered quantization can produce audible distortion and noise modulation; RPDF dither makes the mean error independent of the signal, TPDF dither its power as well. Level and peaks of the master are covered by the measurements True Peak After Encoding and Clipper or Limiter Before Export; this measurement concerns the last step, the word length.

Two line charts over the input value from 0 to 2 LSB. On the left the mean error: without dither a sawtooth between −0.5 and +0.5 LSB, with RPDF and TPDF a flat line at 0. On the right the spread: 0 without dither, arcs with RPDF between 0 at whole-number and 0.5 LSB at half input values, a constant 0.5 LSB with TPDF. Below, four key figures: −3.7 dB fundamental at −96 dBFS without dither, 0 to 0.50 LSB spread with RPDF, 0.50 LSB with TPDF and −17 dB noise below 4 kHz with Lipshitz noise shaping
Mean error and spread when converting to 16-bit, without dither, with RPDF and with TPDF.

How the measurement was made

  • Conversion: ffmpeg 7.1.5 with the aresample filter and the options osf=s16 and dither_method, input a 32-bit float WAV at 44.1 kHz, output 16-bit PCM, then read back. The default value of dither_method is 0, which means no dither.
  • Routines: ffmpeg ran with the option -cpuflags 0 and thus without the routines optimised for the processor. On the ARM computer used for the measurement, those routines shifted RPDF and TPDF by half an LSB; more on this under context and limits.
  • Staircase of constant values: 41 constant input values from 0 to 2 LSB in steps of 0.05 LSB, one second each. For each step, the mean error (output minus input) and the spread of the output as standard deviation were calculated over the middle 0.8 seconds. If the mean error depends on the input, the conversion distorts; if the spread depends on it, the noise varies with the signal.
  • Sine: 1 kHz with a peak level of −60 and −96 dBFS, ten seconds long, analysed in the spectrum of the middle eight seconds: the fundamental against its target, all other content between 20 Hz and 20 kHz, and harmonics 2 to 19 against the surrounding noise. For comparison, the same analysis ran at frequencies exactly between the harmonics.
  • Silence: ten seconds of digital zero. Noise is given as an RMS value relative to full scale, in total and in five frequency bands.
  • Dithered twice: the dithered silence was stored losslessly as 32-bit float and converted to 16-bit a second time with the same method.

Without dither: the error depends on the signal

Without dither, the conversion rounds every value to the nearest step. The mean error therefore followed the input like a sawtooth between −0.5 and +0.5 LSB, and the spread stayed at zero. The same input always gave the same output; the error is a fixed function of the signal, and digital silence remained digital zero.

The sine shows what this means for quiet passages. At −60 dBFS, all other content together was 38.3 dB below the fundamental. Because the pattern of tone and rounding repeats regularly, it formed individual lines instead of even noise; the strongest was at 17.5 kHz, 51.7 dB below the fundamental. At −96 dBFS the sine reaches only just over half a step, and short pulses were all that remained of it: the fundamental lost 3.7 dB, the third harmonic at 3 kHz was only 0.9 dB below it, the fifth 2.7 dB, and the other content together had 2.9 dB more power than the fundamental.

RPDF and TPDF: distortion removed, even noise only with TPDF

Method Mean error Spread Noise in digital silence Fundamental at −96 dBFS, deviation
No dither −0.50 to +0.50 LSB 0 LSB none −3.67 dB
RPDF −0.004 to +0.004 LSB 0 to 0.50 LSB none +0.02 dB
TPDF −0.005 to +0.009 LSB 0.49 to 0.50 LSB 0.50 LSB (−96.4 dBFS) −0.04 dB
TPDF, high-pass filtered −0.009 to +0.010 LSB 0.48 to 0.52 LSB 0.48 LSB (−96.6 dBFS) −0.05 dB

With RPDF dither, the mean error was within 0.004 LSB of zero at every input value: the distortion had disappeared. The spread, however, followed the input, from zero at whole-number values to 0.5 LSB exactly between two steps. The noise therefore varies with the signal, and digital silence remained entirely free of noise. This matches the theory: rectangular dither makes only the mean of the error independent of the signal, not its power.

With TPDF dither, the spread was between 0.49 and 0.50 LSB at every input value. According to Wannamaker, of all dither types that remain in the signal and remove both distortion and noise modulation, triangular dither raises the error power the least: to a quarter of the square of one step, as an RMS value 0.5 LSB or −96.3 dBFS. In silence, 0.50 LSB and −96.4 dBFS were measured, spread evenly across all frequencies. The high-pass filtered variant had almost the same total noise, but 5.3 dB less below 4 kHz.

On the sine, no dither method left a harmonic that stood out from the noise: at the harmonics the level was at most 4.6 dB above the surrounding noise, at control frequencies between the harmonics up to 4.2 dB. The fundamental deviated from its target by no more than 0.05 dB, even at −96 dBFS. There the noise between 20 Hz and 20 kHz had more power than the tone, but it is spread across all frequencies, while the tone sits at a single one.

Noise shaping: less noise below 4 kHz, more noise in total

Method Total noise 20 Hz to 4 kHz 4 to 10 kHz 10 to 16 kHz 16 to 20 kHz 20 to 22 kHz
TPDF −96.4 dBFS −103.8 dBFS −102.0 dBFS −102.1 dBFS −103.7 dBFS −106.5 dBFS
TPDF, high-pass filtered −96.6 dBFS −109.2 dBFS −105.9 dBFS −102.0 dBFS −101.4 dBFS −103.6 dBFS
Lipshitz −84.1 dBFS −120.7 dBFS −104.9 dBFS −97.2 dBFS −87.3 dBFS −87.4 dBFS
F-weighted −77.8 dBFS −119.9 dBFS −106.6 dBFS −99.2 dBFS −82.0 dBFS −80.0 dBFS
Shibata −72.1 dBFS −113.6 dBFS −116.2 dBFS −99.8 dBFS −73.8 dBFS −77.0 dBFS

Noise shaping feeds the rounding error back into the conversion through a filter and thus shapes its spectrum. Wannamaker names the aim of placing most of the error power in high frequency bands where the ear is relatively insensitive. Compared with TPDF, the three ffmpeg methods lowered the noise below 4 kHz by 16.8 dB (Lipshitz), 16.0 dB (F-weighted) and 9.8 dB (Shibata). In return, the total noise rose by 12.3, 18.5 and 24.3 dB, almost entirely above 16 kHz: with Shibata it reached −73.8 dBFS between 16 and 20 kHz, 29.9 dB above TPDF. The mean error remained independent of the input, and the spread stayed between 2.01 and 2.08 LSB (Lipshitz), 4.11 and 4.29 LSB (F-weighted) and 7.95 and 8.31 LSB (Shibata).

According to its manual, FL Studio also uses a shaped dither that moves most of the noise above 10 kHz. The manual does not name the filter behind it; the ffmpeg values show the order of magnitude by which such methods can differ.

Dithered twice: every pass adds noise

According to the FL Studio manual, dither should be applied to a 16-bit file only once, during the final render, if it is used at all. The measurement shows what a second pass costs: when the dithered silence was dithered again, the noise rose by 3.0 dB each with TPDF, Lipshitz and Shibata, to −93.4, −81.1 and −69.1 dBFS. This applies to an independent second noise sequence. ffmpeg starts its noise sequence identically on every run; with both sequences exactly aligned, the noise rose by 6.0 dB (TPDF), 5.7 dB (Lipshitz) and 5.2 dB (Shibata).

What this means for the export

  • When exporting at 24-bit or 32-bit float, as in the mastering tutorial for FL Studio, FL Studio applies no dither. A 24-bit step is 256 times smaller than a 16-bit step; TPDF noise would be at −144.5 dBFS there by calculation.
  • For a 16-bit file, TPDF dither removes distortion and noise modulation with the least added noise, measured at −96.4 dBFS. Without dither, the third harmonic at −96 dBFS was only 0.9 dB below the fundamental; with RPDF the noise varied with the signal between zero and 0.5 LSB.
  • Noise shaping trades less noise below 4 kHz for more noise in total. In the measurement this cost 12 to 24 dB, almost entirely above 16 kHz.
  • Dither belongs in the chain only once: every further pass raised the noise by 3 dB, with an aligned noise sequence by up to 6 dB.
  • When converting to 16-bit, ffmpeg applies no dither unless told to; aresample=osf=s16:dither_method=triangular switches on TPDF.

Context and limits

The measurement covered the conversion in ffmpeg, not FL Studio’s export; its shaped dither may give different values. The test signals were constant values, sine tones and silence; a listening test was not part of the measurement. How audible distortion at −96 dBFS or total noise of −72 dBFS is depends on the material, listening level and playback chain. With ffmpeg’s optimised routines, RPDF and TPDF on the ARM computer used for the measurement (aarch64) produced a mean error of −0.50 LSB instead of zero, a DC offset of −96.3 dBFS, and with RPDF digital silence carried 0.50 LSB of noise. With -cpuflags 0 the offset disappeared; the noise-shaping methods gave the same values in both cases.

Questions and answers

Is dither worth using when exporting at 24-bit?

Hardly. TPDF noise at 24-bit would be at −144.5 dBFS by calculation, far below the self-noise of common playback chains; FL Studio applies no dither there either. What matters is the single dither step when the 16-bit version is later made from that file.

Why is RPDF a particular problem in reverb tails and fade-outs?

Because there the signal drops into the range of a few steps, where the spread of RPDF varies with the input. In the measurement it was zero at whole-number values and 0.5 LSB exactly between two steps. A slowly decaying reverb therefore drags a noise behind it that comes and goes with the signal, and as soon as the signal reaches digital silence, the noise falls silent as well.

This noise modulation is exactly what TPDF removes: there the spread was between 0.49 and 0.50 LSB for every input value, and even digital silence carried an even noise of −96.4 dBFS. The price is a noise floor that stays in pauses too, and a constant noise is usually less conspicuous than one that fluctuates with the signal.

What does “dither only once” mean when the master is processed further afterwards?

Any processing of a 16-bit file, whether a level change, a limiter or a sample rate conversion, produces values between the steps and requires a new rounding to 16-bit when saving. Dithering again at that point lays a second noise sequence on top of the first; in the measurement the noise rose by 3.0 dB, and with an aligned sequence in ffmpeg by up to 6.0 dB. Leaving out dither brings back the signal-dependent errors the first pass had removed.

The rule can therefore only be kept if every intermediate stage works at a greater word length:

  • The mixdown for mastering is exported at 24-bit or 32-bit float; according to the manual, FL Studio applies no dither there.
  • All further steps run on that file.
  • Dither is added only at the last step, the one that produces the 16-bit file, in ffmpeg for example with aresample=osf=s16:dither_method=triangular.

If only a 16-bit version is left, the choice is between two evils. The extra 3 dB of noise is usually the lesser one.

Lukas Wojcik

Lukas Wojcik

Systems architect and technology enthusiast specializing in scalable tracking solutions, GMP Stack (GA4 & GTM), and robust backend architectures. Advocate for clean code and privacy-first design.

Get in Touch

Briefly describe your project or inquiry for a tailored response. This site is protected by reCAPTCHA.

Write a comment

Experience with other DAWs and plugins, differing readings and questions are welcome here.

The email address is not published. Required fields are marked with an asterisk.

Articles & categories

CCTV

All 6 articles in this category Follow this category by RSS

Cloud & AI

All 18 articles in this category Follow this category by RSS

Data Privacy

All 20 articles in this category Follow this category by RSS

Digital Analytics

All 60 articles in this category Follow this category by RSS

Digital Marketing

All 38 articles in this category Follow this category by RSS

IT & Networks

All 19 articles in this category Follow this category by RSS

Music Production

All 18 articles in this category Follow this category by RSS

Raspberry PI

All 11 articles in this category Follow this category by RSS

SaaS & Internet Earning

Follow this category by RSS

Smart Home

All 18 articles in this category Follow this category by RSS

Web Development

All 11 articles in this category Follow this category by RSS

WordPress Plugins & Tricks

All 15 articles in this category Follow this category by RSS