|
|
Sample and Hold Macro
The purpose of a sample and hold macro is to quickly store the amplitude of a sampled input waveform, and then to maintain that amplitude until the next sampling pulse. These parts are used in such cases as sampled-data filters or in taking an analog signal that is to be processed by digital circuitry. For example, the sample and hold circuit would hold the value of an input waveform until it takes the next sample. During the hold time, the held voltage would then be converted into an equivalent digital signal for processing by the digital circuitry.
|
|
The figure above displays the circuit for the sample and hold macro. This macro uses three parameters: Tin, Ts, and Rout. Tin is the period of the input waveform that is to be sampled. Ts is the period of the sampling waveform. Rout is the output resistance of the sample and hold macro.
The V1 independent source will produce a 1ns pulse every Ts seconds. This is the sampling waveform. The current source, G1, charges or discharges the capacitor, C1, to its next hold value whenever the V1 pulse is triggered. G1 will set the capacitor voltage to the value of the E1 source which is equivalent to the input waveform. When V1 is not high, the current through G1 will be negligible. The RC time constant is set at 100*Tin so that it will be large enough to hold the sampled magnitude without much decay. The E2 source is then used to buffer the voltage across the capacitor.
This macro can cover a wide range of frequencies as is. It was tested at frequencies between 60Hz and 1MHz. However, if your simulation runs at a frequency that is very high or very low, you may need to modify two of the parameters: the capacitance of C1 and the pulse width parameter of the V1 source.
The figure below displays the results of an analysis using the sample and hold macro. The input waveform is a 1MHz sine wave which is being sampled every 90ns. The macro Value attribute is defined as:
Sample(1u,90n,1k)
The decay during the hold time interval is extremely small. For the hold time interval between 90ns and 180ns, the voltage only decays from 2.703V to 2.701V.
|
|
|
|
|
|