Eye diagrams are a method of evaluating the quality of a digital signal. They can be used to show how signals are distorted while passing through a system, which can help diagnose if a receiver is reading incorrect data. A good eye diagram will overlay multiple 3-bit sequences within a digital signal to produce a single image capturing every possible rising and falling edge.
Generating a Proper Signal
To create an eye diagram, a digital signal is required. Eye diagrams overlay multiple bit transitions on a single plot to show how the signal transitions between high and low bits. A good signal for eye diagrams will contain at least one occurrence of every possible 3-bit sequence (000, 001, 010,…). The easiest way to automate this process is to send a data signal of 0000 0101 0011 1001 0111 0111 continuously and measure the waveform with an oscilloscope. The datatypes available to use are DBL or I8. The waveform data can either be sent directly to the eye diagram generator or saved to a .csv or .tdms file and processed later into an eye diagram.
Creating Eye Diagrams in LabVIEW
The first step in creating an eye diagram in LabVIEW is to install the LabVIEW Jitter Analysis Toolkit. Once that is installed, the necessary VI’s can be found by right clicking, then Addons -> Jitter Analysis. Creating an eye diagram will use VI’s from the “Level”, “Timing”, “Clock Recovery”, and “Eye Diagram” groups to find the transitions, level crossings, and reference levels, then format into a diagram.

Reference Levels

The Reference Levels VI is the first data processing step. For this application, the “waveform in” option is used with the appropriate data type selected. This VI is used to determine the voltage of the HI and LO states (state levels), and the voltage at which it registers a transition (reference levels). The state level settings and reference level settings are not required, but they can be used to configure how the levels are detected. The state levels settings allows the user to configure if the HI and LO are determined by a histogram (default) which sorts waveform points into the upper and lower 40% to determine the state levels. The reference levels settings allows the user to configure if the reference levels are determined by a percent of the state levels, or by an absolute voltage. The state levels and reference levels determine where the waveform is segmented for state transitions.
Find Transitions

The Find Transitions VI is used to find the transition points between states in the input waveform. Using the state levels and reference levels from the previous step alongside the waveform, it parses through the waveform data and finds the points at which the voltage crosses the high and low reference levels. The transitions output contains an array in which each element has a start index, stop index, and rising/falling edge indicator. The transitions output also contains duplicates of the state levels and reference levels to be used in future steps.
Level Crossings

The Level Crossings VI is a polymorphic VI found in the “Timing” group of the Jitter Analysis Toolkit. For this application, the “transitions in” option is used with the appropriate data type selected. It is important to note that selecting the “levels in” option is possible and would combine the functionality of the Find Transitions and Level Crossings steps into one VI if desired. This VI finds the points at which the waveform crosses the specified crossing level. If no input is supplied, the mid reference level will be used instead. The level crossings output contains an array of all the indices at which the waveform crosses the crossing level and its slope.
Clock Recovery

The Clock Recovery VI synchronizes the waveform to a recovered internal clock using a best fit of the reference to the level crossings. The ref level crossings output is the same data type as the level crossings output. Its indixes array contains syncronized points at which the waveform crosses the mid reference level. The unit interval is also the best fit duration in seconds of one single bit of data in the waveform. Both the ref level crossings and unit interval are used in the next step creating the eye diagram data.
Eye Data Generation

The Eye Data Generation VI creates the histogram that will be used to make the final diagram. The eye diagram data cluster contains a 2D array of histogram data, along with an array of the stand and end indices of each segment on the plot. It also contains scaling information about the minimum and maximim time and voltages that will be used in the plot. The resolution control changes how many histogram bins will be dedicated to the time and voltage axes. This corresponds to the number of pixels that will be used in the x and y axes of the final plot. The default setting is 400×200.
Eye Height and Width

The Eye Diagram Height and Width VI calculates the height at the location specified by the time input. The time input is the percent along the unit interval which the measurement will be taken, with the default value being 0.5. The width is measured at the voltage specified by the level input. If the input is blank, the default value is the mid ref level from the Reference Levels VI. Both the height and width are calculated by finding the mean upper and lower bounds 3 standard deviations from their means, and finding the difference between them. The height and width are both outputs of the vi, and also a part of the eye diagram data out cluster. This VI is not necessary in plotting the eye diagram, but importand for determining quantitative results.
Eye Diagram Support

The Eye Diagram Support VI extracts the histogram data as a 2D array scaled from 0 to 1. Because the histogram is a 3D representation of data, the value of each element in the array represents the intensity of the signal integrity at that pixel of the final graph. This VI allows the user to plot the height/width as well. Enabling this will plot a cross centered at the center of the graph, with the height and width determined by the previous step. The better the signal integrity is, the bigger the cross will be. The VI also outputs the x and y scales, which are used to set the x and y axes of the resulting graph.
Eye Color and Scale Generation

The last jitter analysis step is the Eye Color and Scale Generation VI, which allows the user to adjust the color appearance of the graph. The color settings control allows the user to determine the color mapping type, hue and background color. The default (shown in the example picture) is a single hue mapping type, with a dark blue hue (#0003b4) and a black background (#000000). This means that the lower intensity histogram values appear in dark blue, and the higher intensity values appear in white. Changing the mapping to rainbow hue will map the higher intensity values in the selected hue color, and the lower intensity values as far from the selected color as possible, resembling a heat map. The output marker values are an array of the colors that will be used based on the selected inputs. This will be used in the property node to control the final plot. It is important to also set the ignore array property to false, otherwise the colors selected will be overridden with the default instead.
Ready to start your Test & Measurement Automation project?
Contact us today to learn more about our solutions and how we can help you achieve your goals.