Achieving Higher ADC Resolution Using Oversampling
Total Page:16
File Type:pdf, Size:1020Kb
AN1152 Achieving Higher ADC Resolution Using Oversampling THEORY OF OPERATION Author: Jayanth Murthy Madapura Microchip Technology Inc. As previously mentioned, ADCs transform analog signals into digital sample values. Analog signal amplitude is quantized into digital code words with a INTRODUCTION finite word length. This process of quantization introduces noise in the signal called “quantization An Analog-to-Digital Converter (ADC) is an active inter- noise”. The smaller the word length, the greater the face between the analog and digital signal chains in an noise introduced. embedded system. An ADC converts analog signals into digital signals in electronic systems. The key fea- Quantization noise can be reduced by adding more bits ture of an ADC is the accuracy (resolution) it offers. The into the ADC hardware design. This noise can also be higher the desired accuracy, the higher the ADC cost. reduced in software by oversampling the ADC and then processing the digital signal. The oversampling ADC Higher ADC accuracy is achieved by designing hard- method and a few associated terms are explained in ware to quantize the analog signal amplitude into the the following sections. digital signal with a higher code-word length. Practical ADCs have finite word lengths. ADC Voltage Resolution To effectively strike a balance between system cost and accuracy, higher conversion accuracy is achieved Voltage resolution of an ADC is defined as the ratio of by oversampling the low-resolution ADC integrated full scale voltage range to the number of digital levels within a digital signal controller (DSC), and then pro- that are accommodated in that range. It is a measure of cessing the oversampled digital signal in software the accuracy of the ADC. The higher the resolution, the through a digital filter and a decimator. This processing higher the number of levels accommodated in the scheme, which adds additional bits of accuracy to the voltage range and, consequently, the lower the 12-bit ADC conversion in a dsPIC® DSC, is explored in quantization noise, as shown in Equation 1. this application note. EQUATION 1: full scale voltage range volts Voltage Resolution== 1 Least Significant bit (LSb) value -------------------------------------------------------- ------------ N 2 – 1 level where N is the number of bits or the word length © 2008 Microchip Technology Inc. DS01152A-page 1 AN1152 The smallest ADC step represents one Least Signifi- Signal-to-Quantization Noise Ratio cant bit (LSb) value. For example, if the full scale mea- surement voltage range is 0 to 3 volts, and the ADC bit Signal-to-Quantization Noise Ratio (SNRQ) is defined resolution is 12 bits, then the ADC voltage resolution as the ratio of the root mean square value of the input can be calculated to be 0.7326 mV/bit. analog signal to the root mean square value of the quantization noise. The SNRQ of an ideal N-bit ADC is This means the conversion of continuous voltages is given by Equation 2. noise free if the continuous voltage is an integral multi- ple of the voltage resolution. Any intermediate continu- EQUATION 2: ous voltage is rounded off to suit a voltage level that is an integral multiple of the voltage resolution, as shown SNR = 6.02N ++4.77 20log 10()L []dB in Figure 1. This introduces quantization noise, as Q F shown in Figure 2. where, N is the number of bits or the word length, and LF is the loading factor, which is defined as the ratio of FIGURE 1: the root mean square value of the input analog voltage to the peak ADC input voltage. When the input analog signal is sinusoidal LF = 0.707, then SNRQ is given by Equation 3. EQUATION 3: SNRQMAX– = 6.02N + 4.77– 3= 6.02N + 1.77[]dB From Equation 3, it is clear that the improvement in the SNR of the ADC is 6.02 dB per bit. The higher the num- ber of bits associated with the ADC, the higher the SNRQ. For example, the SNRQ-MAX of a 12-bit ADC is 74.01 dB and that of a 16-bit ADC is 98.09 dB. Now we Original analog signal will explore how the SNR can be improved without increasing the word length of the ADC. Quantized signal Oversampling ADC, Digital Filtering, FIGURE 2: Decimation and Dithering A cost-effective method of improving the resolution of the ADC is developing software to suitably process the converted analog-to-digital signal to achieve the same effect as a higher resolution ADC. The Power Spectral Density (PSD) of the quantization noise with a flat spectrum, which gets added during an analog-to-digital conversion (see Figure 3), is given by Equation 4. EQUATION 4: 2 ()lsb value W PSDquantization noise = ----------------------------- ------- 12fs Hz Quantization error The measure of the extent to which the signal is corrupted with quantization noise after analog-to-digital conversion is given by the signal-to-quantization noise ratio. DS01152A-page 2 © 2008 Microchip Technology Inc. AN1152 FIGURE 3: POWER SPECTRAL FIGURE 5: POWER SPECTRAL DENSITY OF DENSITY OF SIGNAL QUANTIZATION NOISE IN COMPONENT AN IDEAL ADC QUANTIZATION NOISE IN AN IDEAL ADC AFTER PSD ANALOG-TO-DIGITAL PSDquantization noise CONVERSION AND AFTER OVERSAMPLING PSD fOS >> fN -fS/2 0 fS/2 Total quantization noise Power spectral density representation of the signal -fOS/2 B A0 A B fOS/2 after an analog-to-digital conversion is seen in Figure 4. Total quantization noise FIGURE 4: POWER SPECTRAL DENSITY OF SIGNAL Signal component COMPONENT QUANTIZATION NOISE IN The SNR improvement after oversampling is given by AN IDEAL ADC AFTER Equation 5. ANALOG-TO-DIGITAL CONVERSION EQUATION 5: f PSD ⎛⎞OS SNRoversampling = 10log⎝⎠------- []db fN The overall SNR is given by Equation 6. EQUATION 6: BA0 AB -fN/2 fS/2 f SNR = 6.02N ++1.77 10log⎛⎞-------OS []db overall ⎝⎠ fN Total quantization noise Suppose we have a P-bit ADC and Q-bit ADC, Q>P, Signal component the sampling factor is calculated as shown in Equation 7. One way of reducing the PSD is by reducing the EQUATION 7: numerator (i.e., the LSb value), which can be achieved f 0.602()QP– by adding more bit resolution to the ADC. Another -------OS = 10 method of reducing PSD is by increasing the denomi- fN nator (i.e., by increasing the sampling frequency), which leads to oversampling. The power spectral den- Equation 8 shows how to achieve the SNR of a 16-bit sity representation of the signal after analog-to-digital ADC using a 12-bit ADC. conversion and after oversampling is seen in Figure 5. The analog input signal is conveniently sampled at a sampling rate (fOS) significantly higher than the Nyquist rate, fN = 2B, with the help of the high sampling rate capacity of the ADC present in the dsPIC digital signal controller. © 2008 Microchip Technology Inc. DS01152A-page 3 AN1152 EQUATION 8: SNRoverall 16-bit ADC= SNRoverall 12-bit ADC with oversampling f 6.02⋅ 16+ 1.77= 6.02⋅ 12++ 1.77 10log⎛⎞-------OS ⎝⎠ fN f -------OS ==255.8585 256 fN The analog signal should be oversampled at a rate of A low-pass FIR filter is used to filter the quantization 256 times more than the Nyquist rate to achieve the noise from the analog-to-digital converted signal. The SNR of a 16-bit ADC with a 12-bit ADC. cut-off frequency of the FIR filter used is fC. The order The oversampled analog-to-digital converted signal is of the FIR filter can be set to O, L = O +1 coefficients. low-pass filtered (see Figure 6) to alleviate the effects The sampling frequency used can be set to K • fN, of quantization noise. The digital low-pass filter can be where fN =2 fC. modeled as a FIR filter. After filtering, the analog-to-digital converted signal is passed through a decimation stage to downgrade the FIGURE 6: POWER SPECTRAL rate, at which time the signal is sampled. The signal DENSITY OF SIGNAL ultimately obtained has a higher SNR, which is close to COMPONENT the SNR of a Q-bit ADC although a P-bit ADC was QUANTIZATION NOISE IN employed for analog-to-digital conversion. AN IDEAL ADC AFTER The block diagram of all the associated stages is ANALOG-TO-DIGITAL shown in Figure 7. CONVERSION AND AFTER Additional improvement in accuracy can be gained by OVERSAMPLING WITH adding an external dithering circuit before the ADC. LOW-PASS FILTER Dithering is a technique used to minimize the ADC RESPONSE quantization noise by adding noise to the analog signal before passing it through the ADC. The periodicity of PSD the quantization error in Figure 1 shows that it contains Low-pass filtering spectral harmonics, which yields the quantization noise highly correlated. Spectral harmonics make the filtering more difficult and results in residual components. Dith- ering makes the resulting quantization noise more ran- dom with reduced levels of undesirable spectral harmonics. The simple dithering circuit consists of a noise diode and an amplification stage. -fOS/2 B AA0 B fOS/2 Total quantization noise Signal component FIGURE 7: BLOCK DIAGRAM ADC fS Digital Filter Anti-aliasing Output Input to reduce Low-Pass ∑ Decimator Digital Analog Quantization Analog Filter Signal Signal Noise Quantization Noise DS01152A-page 4 © 2008 Microchip Technology Inc. AN1152 APPLICATION EXAMPLE In this application example, an FSG15N1A differential output force sensor with a specific response time (i.e., This section describes an example of a real-world the time required for the force sensor output to rise application, upon which the techniques described in from 10% to 90% of the final value when subjected to this application note can be used.