To assess the effect of ADC nonlinearity on the RMS measurement error, we can use worst-case method. The basic idea behind the worst-case method is to assume the most pessimistic combination of input values that may occur, and evaluate the output that results from them.
The following code demonstrates how to compute RMS measurement error caused by ADC nonlinearity:
main.m871 chars29 lines
In the above code, we define a function calcMeasurementErrorRMS
that takes the full-scale input voltage k
and the number of bits nbits
of the ADC as inputs. The input signal is defined as a 1kHz sine wave with peak amplitude k
, and is quantized using a quantization step size q
. The measurement error signal is computed as the difference between the quantized signal and the original signal, and the RMS of the error signal is returned as the output of the function.
To assess the worst-case effect of ADC nonlinearity on the RMS measurement error, we need to evaluate the function for the maximum possible values of k
and nbits
that the ADC can handle. For example, if the ADC has a maximum input voltage of 5V and a resolution of 16 bits, we can evaluate the function as follows:
main.m197 chars5 lines
Note that this approach assumes that the nonlinearity of the ADC is constant across the input range, which may not be the case in practice. To obtain a more accurate assessment of the ADC nonlinearity, it is necessary to characterize the ADC transfer function at different input voltages and use this information to model the nonlinearity in the measurement error analysis.
gistlibby LogSnag