Analog-Digital: Sample and Hold

Analog signals tend to be tricky due to their ever-changing nature, especially due to noise. When the input value constantly fluctuates between numbers, it becomes difficult to reliably analyze. As a result, we have to apply a process known as signal conditioning. By conditioning a signal, we are transforming it into a usable signal that can be processed. For A/D conversion, the time it takes to condition a signal is called the acquisition time. Usually, the first step is to eliminate noise, then amplify the signal if needed.

The reason why amplification may be necessary is due to the possibility of small voltage signals. Suppose we had an ADC that could convert any voltage between -3 V and 3 V to a digital value. Additionally, we will be applying a sinusoidal signal to the input of this ADC that has a voltage range of -1 V to 1 V. Although we could still use the ADC to convert this input analog signal into a digital one, we aren’t using the full analog range of the converter. If this ADC had a digital resolution of 4, then the LSB voltage would be 0.375 V. Of the 16 possible binary outputs from the ADC, only about 6 of them are used when this signal is converted.


If we were able to use the full analog range of the ADC for this conversion, however, we could get more accurate data. We can accomplish this by applying a gain to the input signal, such that it looks like a -3 V to 3 V signal to the ADC (or at least very close to it). We can describe the analog resolution of the ADC as its analog range, and the dynamic range of the input signal as the input range. We need to multiply the input range by some gain (G) such that it doesn’t exceed the bounds set by the analog range. Thus, our gain must satisfy the following inequality:

(Input range) * G <= (Analog Range)

In our example, the analog range is 6 V, and the input range is 2 V. So a gain of 3 would allow us to utilize the ADC to its full extent. With amplification taken care of, there is still more to be done to condition the signal.

Most of the acquisition time is spent on the third step: sample and hold (S/H). Essentially, “sampling” is reading the input value at the time of sampling, whereas “holding” stores the sampled value until the next value is ready to be registered. The S/H circuitry uses an RC circuit, utilizing a capacitor as its main component.

For those unfamiliar with the nature of capacitors, let’s assume the capacitor is initially discharged for a long time. We then close the left switch and leave the right one open. At time = 0, the moment when the capacitor is connected to the rest of the circuit, the voltage across the capacitor is 0 (since the capacitor was initially discharged), and the current going into the capacitor is Vin / R. At time = ∞, the capacitor is fully charged. No current is able to flow into the capacitor, thus preventing any current from flowing at all through the loop. As a result, the voltage of the capacitor is now equal to Vin, at least in theory. (Food for thought: Why is the resistor needed in this circuit? What happens if we remove it?)


Keep in mind that Vin can range from as low as Vref- to as high as Vref+. Let’s assume the worst-case scenario, where Vin is at Vref+. Our supply voltage, Vin, would then be Vref+ - Vref-. Let’s also assume that the capacitor is initially fully discharged and is then connected to Vin. We know that the formula for charging a capacitor is Vc = Vs * (1 - e^(-t/RC)), where Vs is the supply voltage (Vref+ - Vref-). Since the voltage across the capacitor eventually reaches Vs, the voltage across the resistor must then eventually reach zero. As such, the voltage across the resistor follows a similar behavior as a discharging capacitor. Thus, Vr = Vs * e^(-t/RC). Recall that LSB Voltage is calculated as (Vref+ - Vref-) / (2^n), which can also be written as Vs / (2^n) in this case.


Notice that all three equations have a factor of Vs. If we normalize each equation by dividing out the Vs, then we get Vc = 1 - e^(-t/RC), Vr = e^(-t/RC), and LSB Voltage = 1 / (2^n). By normalizing the equations, we can make generalizations for all possible ranges of Vref+ and Vref-. When normalized, Vc, Vr, and the LSB Voltage must each be a value between 0 and 1. Note that Vc follows an exponential curve when charging. As a result, it approaches 1 but never quite reaches that value. For all intents and purposes, though, we can say that Vc is equal to 1 when it is close enough. This “close enough” threshold is when Vc is no more than half the (normalized) LSB voltage away from 1. In other words, 1 - Vc < 0.5*LSB Voltage, which can also be written as Vr < 0.5*LSB Voltage. Substituting the variables for their normalized equations, we get e^(-t/RC) = 1 / (2^(n+1) - 1). Solving for t eventually leads us to t >= (n+1) * R * C * ln(2). The amount of time it takes to reach that condition is subsequently the acquisition time.

Now that we’re familiar with obtaining and keeping an analog value, how do we convert it to a digital value? There are multiple approaches to designing an A/D converter, but we will focus only on two for now. The first implementation utilizes a circuit known as a flash converter.