If you need to improve the ‘accuracy’ of your data acquisition system, just increase the bit width of your chosen ADC. What could possibly go wrong…
Finite ‘bit width’ nonlinearities can be classified into two groups. The first is the effect of quantization itself, that is, the reduction of precision of the signal so that the real-valued analog signal can be expressed as an integer count of some unit of parameter, at an arbitrary point in time. The second is the collection of impairments which might afflict an otherwise perfect quantizer, so that on top of any effects due to the quantization, we have an effect due to the errors in the steps involved. In this short piece I’ll just consider the first. Studying the impairments caused by a quantizer whose steps themselves have errors will have to wait a little while.
In fact, the effects of quantization can be further subdivided into the effect of the precision reduction on its own, and then the combined effect of doing that and also forcing the signal to be sampled at instants in time. The latter, combined case is what’s often (incorrectly) described as quantization, since very few systems take a continuous real signal and force it to exhibit only a finite number of amplitude values without also taking samples at time intervals to produce ‘digital data’ for analysis. So in the desperate search for brevity, we’ll cover the combination of quantization and sampling right from the start, and refer to it shorthand as just quantization.
Gain linearity is the relationship between the amplitude of a signal encoded in the ADC’s output data stream and the amplitude of the input signal which produced it. To assess this, let’s take a frequency domain analysis of the output data (with a pure sinewave input) and extract only the fundamental component. It should be obvious that if the output data is quantized and we put in a small signal, the output waveform will be quite ‘steppy’, and (I hope) it shouldn’t be surprising that the level of the fundamental we get from an FFT won’t quite match the input signal level. This can easily be verified; modern spreadsheets include an FFT function, so no special software is needed.
If a small input signal fits symmetrically within a window of one LSB, there are two extreme possibilities. Either the output code might not change at all, in which case the fundamental component is obviously zero, and the gain is clearly not what it was at larger signals. In the other case, where the converter produces one LSB when the signal is positive, and zero output when the signal is negative (it’s acting as a comparator, the archetypal one-bit ADC) then the output data will be the same whatever the small input signal is. So regardless of the input signal, the fundamental component in the output code is constant at 2√2/π LSBs RMS. So both cases lead to wildly incorrect answers.
The next two plots show the gross effects of quantization on a low-level sine signal and also illustrate the counterintuitive change in ‘accuracy’ as the resolution is changed. Both signals are sinewaves with a peak-to-zero value of 0.00009 times full scale. Figure 1 shows the signal quantized to 14 bits, figure 2 to 15 bits.
Figure 1: our small signal quantized to 14 bits.
Figure 2: the same signal as in figure 1, quantized to 15 bits.
It’s tempting to think that the 15-bit plot would just ‘look like’ the 14-bit plot but somehow with one extra step of resolution. This is not the case; the availability of extra levels for the signal to ‘snap’ to changes the code output. In this case, the extracted fundamental of the reconstructed 14-bit signal is 28.09% too big, while the 15-bit signal’s is 18.67% too small.
Here’s a table containing more values for the reconstructed signal’s RMS level accuracy in percent, for eight different resolutions and four different, but close, signal levels. Clearly, quantization mangles low level linearity:
Table 1: percentage accuracy change versus quantization bit width and signal level
Fortunately, the application of dither can fix this. It is widely used in the audio world to extend the region of good gain linearity in both ADCs and DACs. With correctly applied dither, the extracted value of the fundamental component can be accurately determined for signal levels down to way below one LSB peak to peak.
You might have heard of dither (in the electronic sense, not in the I-can’t-decide sense) but not have a good understanding of it. I’ll try to illuminate that in a light-hearted way in the next piece!