Histogram Measurements with NI High-Speed Digitizers
Overview
Using histograms and histogram statistics with NI high-speed digitizers provides an effective visualization of waveform behavior such as the characterization of jitter in signals. Many applications call for signals with accurate and reliable periodicity and precise amplitude accuracy. Histograms are very useful in characterizing amplitude and temporal variations of waveforms.
Measurements such as cycle-to-cycle and edge-to-edge jitter can be accomplished with time histogram measurements. Measurements such as pulse height analysis and distortion can be accomplished with voltage histograms.
Histograms Defined
In some cases the statistical distribution of response values gives richer insights than numerical representations such as mean, median, standard deviation, and mode. Histograms are specialized plots that capture statistical data about how many times specific values occur. Histograms are usually plotted with the dependent variable along the vertical axis and the independent variable along the horizontal axis. To create a histogram from discrete response data, a count is taken each time a discrete value occurs. For example, Figure 1 is a histogram of 20 students' letter grades on a test. The discrete values are the letter grades and the counts represent the number of students who received each grade.
Figure 1. Histogram of Discrete Data
To create a histogram from continuous response data (as in a frequency-distribution table), the response range is divided into ranges called bins. The value of the bin is the mean range the bin covers. Using the above example, imagine the tests were graded with a percentage instead of a letter. The histogram in Figure 2 represents this distribution using bins that represent 10% increments.
Figure 2. Histogram of Continuous Data
Histograms and National Instruments High-Speed Digitizers
NI-SCOPE, the instrument driver for National Instruments high-speed digitizers, offers measurements with two types of histograms. The first type is a time histogram useful for representing waveform characteristics such as pulse width jitter. The second type of histogram is a voltage histogram useful for representing amplitude variations of a signal.
NI-SCOPE Time Histograms
Time histograms place samples that fall within a defined voltage range and time window into bins based on their time relative to a trigger point. The time resolution of time histograms depends directly on the precision with which samples can be positioned in time relative to the trigger. More precise positioning of the sample in time allows the use of more histogram bins of smaller size, increasing histogram resolution.
Often, digitizers can only resolve samples in time with a resolution equal to the sample period. Many NI digitizers, however, including the NI 5911 and the NI 5112 family, include a high-resolution Time-to-Digital Conversion (TDC) circuit. Using a process called time-stamping, the TDC circuit locates samples relative to the trigger point with exceptional precision. For example, the NI 5112 100 MSamples/sec digitizer is equipped with a TDC circuit that allows time-stamping of samples with 100 picosecond resolution, while using a 10 nanosecond sample period. Thus, TDC circuitry and time-stamping allow you to sort data into highly resolved time histogram bins and maximize histogram resolution.

[+] Enlarge Image
Figure 3. A Pulse is Acquired with the NI 5112 set to Edge Triggering Mode with 50% Pretrigger Samples. The Trigger Conditions are Positive Trigger Slope and Trigger Level = 0 V. The Samples are Time-Stamped Relative to the Trigger Occurrence at 100 Picosecond Resolution
Figures 4 and 5 demonstrate how time histograms are constructed. Multiple pulses are acquired, and an edge trigger is used to align the rising edge of each pulse. Histogram voltage (vertical) discriminator levels are configured to define a window around the falling edges of each pulse—the shaded region in Figure 4. Make sure you capture only the falling edges of the waveform when setting these discriminator levels--otherwise, the histogram will appear perfectly uniform.

[+] Enlarge Image
Figure 4. Time-Domain Waveform Sampled by a High-Speed Digitizer
When you use this setup, every sample on the falling edge is added to the time histogram shown in Figure 5. In this example, both the first and third acquisitions have a falling edge at the same time, while the second acquisition is later. The histogram captures this statistical information.
Figure 5. Corresponding Time Histogram
Creating Time Histograms
To create a time histogram, set the following attributes in NI-SCOPE.
1. Histogram Size defines the number of histogram bins. The default is 256 bins. The more bins used, the greater the histogram resolution.
2. Histogram Time Limits determine the temporal window.
3. Histogram Voltage Limits determine the vertical window.
Together the time and voltage limits determine the discriminators for the histogram. (See Figure 4)
LabVIEW Time Histogram Example
Figure 6 is the block diagram of a LabVIEW example that ships with the NI-SCOPE driver. Additional example programs in C, LabWindows/CVI, Microsoft VC++, and Microsoft VisualBasic are also included with NI-SCOPE.

[+] Enlarge Image
Figure 6. NI-SCOPE Time Histogram Example for LabVIEW
Time Histogram Measurements
Below is a list of the available time histogram scalar measurements in NI-SCOPE.
Time Histogram Hits
Number of points in the histogram
Time Histogram New Hits
Number of points added to the histogram by the most recent acquisition
Time Histogram Mean
Histogram Mean = [
(bin hits * bin value)] / total hits
The bin value is the time value of the histogram bin.
Time Histogram Stdev
Histogram standard deviation= Sqrt (
[bin hits * (bin value - histogram mean)^2)) / (total hits - 1))
Units: Seconds
Time Histogram Mode
The bin value with the most hits. If there is a tie, the lower voltage or time value is returned
Units: Seconds
Time Histogram Min
The lowest bin value with at least one hit
Units: Seconds
Time Histogram Max
The highest bin value with at least one hit
Units: Seconds
Time Histogram Peak To Peak
Histogram maximum minus the histogram minimum
Units: Seconds
Time Histogram Median
The bin value where half the histogram hits are above it and half the histogram hits are below
Units: Seconds
Time Histogram Mean Plus Stdev
The percentage of hits in the histogram between the mean minus the standard deviation and the mean plus the standard deviation
Units: Percentage
Time Histogram Mean Plus 2 Stdev
The percentage of hits in the histogram between the mean minus two times the standard deviation and the mean plus two times the standard deviation
Units: Percentage
Time Histogram Mean Plus 3 Stdev
The percentage of hits in the histogram between the mean minus three times the standard deviation and the mean plus three times the standard deviation
Units: Percentage
Application of Time Histogram Measurements
Histograms can be used to characterize delay jitter between the input and output of a real-time I/O system. By definition, a real-time system is deterministic in time, but it is useful to know exactly how deterministic a given measurement system is. Time histogram measurements can be used to characterize the jitter in real-time systems, which in turn allows measurement of the determinism of a real-time I/O system.
Let’s look at a specific example: feeding a square wave into the analog input of a real-time system while sampling at a rate of 1 kHz. The samples acquired are output to an analog channel by the real-time system one clock cycle later. This provides a deterministic delay of 1 msec between the analog input and the analog output of the real-time system. Measurement of the jitter in this delay between the input and output yields a measure of the reliability of the real-time I/O system.
In this example, the NI 5112 two channel high-speed digitizer is used to measure the jitter. The input square wave and the analog output of the real-time system are sampled by the NI 5112. A time histogram of the delay from the edge on one channel to the same edge on the second channel is created. Statistics from the time histogram such as Time Histogram Min, Time Histogram Max, Time Histogram Hits and Time Histogram Mean yield measurements of the maximum jitter, the number of measured samples in the histogram, and the mean delay.

[+] Enlarge Image
Figure 7. LabVIEW Histogram Measurements of Delay Between Analog Input and Analog Output on a Real-Time I/O System. Maximum (peak-to-peak) Jitter is Approximately 16 ns for the Real-Time I/O System of 1 ms Delay
The results shown in Figure 7 yield a Gaussian distribution of the variations of the delay, meaning that this jitter is most likely derived from random electrical noise in the measurement system.
NI-SCOPE Voltage Histograms
Many scientific and engineering fields require characterization of statistical variations in signal amplitude. Pulse height analysis, a common application in many scientific disciplines, can benefit from voltage histograms. In electronic measurements, signal distortion and quality can also be characterized by voltage histograms.
Voltage histograms eliminate the temporal information from multiple acquisitions and place each point in the acquired waveform into a voltage bin. This is useful for analyzing the statistical amplitude variations of signals. See Figures 8 and 9 for an example of a voltage histogram. Notice that the higher amplitude pulse occurs twice, while the lower amplitude pulse occurs once.

[+] Enlarge Image
Figure 8. Time-Domain Waveform Sampled by a High-Speed Digitizer
Figure 9. Corresponding Voltage Histogram
Creating Voltage Histograms
To create a voltage histogram, set the following two main NI-SCOPE attributes:
1. Histogram size defines the number of histogram bins. The default is 256 bins. The larger the number of bins, the more resolution you have in your histograms.
2. Histogram voltage limits determine the vertical window. If samples fall within this window they are added to the histogram.
Temporal windows are not used for voltage histograms.
LabVIEW Voltage Histogram Example
Below is the block diagram of an example LabVIEW VI that ships with NI-SCOPE. Additional example programs in C for LabWindows/CVI and Microsoft VC++ and Microsoft VisualBasic are included with NI-SCOPE.

[+] Enlarge Image
Figure 10. NI-SCOPE Voltage Histogram Example for LabVIEW
Below is a list of the available NI-SCOPE voltage histogram scalar measurements:
Voltage Histogram Hits
Number of samples in the histogram.
Voltage Histogram New Hits
Number of samples added to the histogram by the most recent acquisition.
Voltage Histogram Mean
Histogram Mean = [
The bin value is the center voltage of the histogram bin.
Units: Volts
Voltage Histogram Stdev
Histogram standard deviation = Sqrt ((
Units: Volts
Voltage Histogram Mode
The bin value with the most hits. If there is a tie, the lower voltage or time value is returned.
Units: Volts
Voltage Histogram Min
The lowest bin value with at least one hit.
Units: Volts
Voltage Histogram Max
The highest bin value with at least one hit.
Units: Volts
Voltage Histogram Peak To Peak
Histogram maximum minus the histogram minimum.
Units: Volts
Voltage Histogram Median
The bin value where half the histogram hits are above it and half the histogram hits are below.
Units: Volts
Voltage Histogram Mean Plus Stdev
The percentage of hits in the histogram between the mean minus the standard deviation and the mean plus the standard deviation. The percentage is returned in the range 0--100 %.
Units: Percentage
Voltage Histogram Mean Plus 2 Stdev
The percentage of hits in the histogram between the mean minus two times the standard deviation and the mean plus two times the standard deviation. The percentage is returned in the range 0--100%.
Units: Percentage
Voltage Histogram Mean Plus 3 Stdev
The percentage of hits in the histogram between the mean minus three times the standard deviation and the mean plus three times the standard deviation. The percentage is returned in the range 0--100%.
Units: Percentage
Voltage Histogram Measurement Applications
One application calling for voltage histogram measurements is electronic signal characterization. Signal sources, such as function generators and arbitrary waveform generators, and output amplifiers are characterized in a number of ways. Voltage histograms allow you to promptly characterize the sinusoidal output for voltage offset and distortion, especially zero crossing distortion or crossover distortion.
The voltage histogram of a sine waveform ideally look likes a “saddle” with the peaks occurring at the maxima and minima of the sine waveform. The saddle is centered at zero if the sine waveform has no DC voltage offset. Any anomalous peaks in the histogram between the maxima and minima reflect nonlinear distortion in the sine waveform. A peak at the center of the voltage histogram reflects zero-crossing distortion, which is a key concern for output amplifier performance.
Figures 11 and 12 are voltage histograms, taken using an NI 5112 high-speed digitizer, which characterize the sine output of two function generators. The sine output in Figure 9 is relatively distortion-free and the histogram centers at zero. By contrast, the histogram in Figure 12 is not centered at zero, indicating distortion and voltage drift in the sine output. Thus, while neither histogram shows zero-crossing distortion to be a primary problem, the noisy histogram in Figure 12 reveals considerable spectral purity degradation in the second function generator.

[+] Enlarge Image
Figure11. Voltage Histogram of 100 kHz 1Vpp Sine Output from Function Generator 1
Figure 11. Voltage Histogram of 100 kHz 1Vpp Sine Output from Function Generator 2
Reader Comments | Submit a comment »
Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).

