Construct eye diagram from stored signal samples

Eye diagram is a powerful tool to analyze the overall quality of a communication link. It reveals important characteristics of a communication link, that includes timing sensitivity, noise margin, inter-symbol interference (ISI) and zero-crossing jitter. It also shows the optimum sampling time for the receiver, which indicates when to sample the incoming signal for converting it to a symbol stream. It is more useful to plot the eye diagram at the receiver, where it gives visual cues for the engineers to check the signal integrity and to uncover problems in earlier stages of the design process.

Application of eye diagram

For each symbol received through a noisy channel, the receiver has to make the best estimate of what was transmitted. Eventually, this boils down to finding out the optimal decision time for each symbol (through timing recovery circuits) after the signal is processed through the equalizer and the matched filter.

In an eye diagram, each period of the waveform is repeated and overlaid on top of each other, forming an eye like pattern. It is usually visualized at the point just prior to the decisions. It reveals the ability of the receiver to distinguish between signal levels, in the presence of distortions like timing jitters (due to imperfect recovered clocks), noise level in the received signal prior to decision point, etc..,

An ideal eye diagram will show a wider eye that has a lot of margin in both horizontal and vertical direction that allows for lowest possible error rate in the receiver decisions. Figure 1, depicts the eye diagram for 2-PAM modulated square-root raised cosine (β=1) pulse shaped symbols sent through an AWGN channel having EbN0=50 dB (almost no noise condition).

Ideal eye diagram shown for two symbol durations for 2-PAM modulation shaped using square root raised cosine filters.
Figure 1: Ideal eye diagram shown for two symbol durations for 2-PAM modulation shaped using square root raised cosine filters.

A narrower eye implies increased sensitivity to noise, since presence of more noise would cause erroneous symbol decisions. In essence, erroneous symbol decisions could be caused by timing jitters (measured in the horizontal direction) or the amplitude variation (measured in the vertical direction) or intersymbol interference (which affects the signal in both directions). Figure 2, depicts the eye diagram for 2-PAM modulated symbols sent through an AWGN channel having EbN0=20 dB (signal to noise ratio).

Eye diagram shown for 2-PAM modulated pulse shaped symbols corrupted with awgn noise
Figure 2: Eye diagram shown for 2-PAM modulated pulse shaped symbols corrupted with AWGN noise (EbN0=20 dB)

This article is part of the book
Wireless Communication Systems in Matlab (second edition), ISBN: 979-8648350779 available in ebook (PDF) format and Paperback (hardcopy) format.

Construction of eye diagrams from signals represented in computer memory.

To construct an eye diagram, the signal is divided into equal sections. The number of samples in each section should be proportional to NT_{sym}, where T_{sym} is the symbol period (which is related to the oversampling factor L by equation (1).

L = \frac{T_{sym}}{T_s} = \frac{F_s}{F_{sym}} \quad\quad\quad (1)

The factor L denotes the oversampling factor or upsampling ratio which is given as the ratio of symbol period (T_{sym}) and the sampling period (T_s) or equivalently, the ratio of sampling rate F_s and the symbol rate F_{sym}

When all such sections are plotted in an overlapping manner, it produces the eye diagram. This is implemented in the following Matlab function. The sample usage of the function is given in the next section of this chapter and the sample outputs are available in the following Figure.

Eye diagram at matched filter output for Square root raised cosine pulse shaping
Figure 3: Eye plot at the matched filter output just before the symbol sampler at the receiver

Program 1: plotEyeDiagram.m: Function for plotting eye diagram (kindly refer the book “Wireless Communication Systems using Matlab”)

function [eyeVals]=plotEyeDiagram(x,L,nSamples,offset,nTraces)
%Function to plot eye diagram
%x - input vector representing the signal
%L - oversampling factor (for calculating x-axis in plot)
%nSamples - number of samples per trace - preferably set to integral
% multiple of oversampling factor L(number of bits per symbol)
%offset - initial offset in the data from where to begin plotting
%nTraces - number of traces to plot
%If the signal processing toolbox is not available, put M=1
% and convert the line that says y=interp(x,M) to y=x

.....
Refer the book Wireless Communication systems using Matlab
.....
end

Rate this article: PoorBelow averageAverageGoodExcellent (4 votes, average: 4.00 out of 5)

Further reading

[1] Tektronix application note: Anatomy of an eye diagram.↗
[2] Anritsu application note: Understanding eye pattern measurements.↗

Books by the author

Wireless Communication Systems in Matlab
Wireless Communication Systems in Matlab
Second Edition(PDF)

PoorBelow averageAverageGoodExcellent (180 votes, average: 3.62 out of 5)

Digital modulations using Python
Digital Modulations using Python
(PDF ebook)

PoorBelow averageAverageGoodExcellent (134 votes, average: 3.56 out of 5)

digital_modulations_using_matlab_book_cover
Digital Modulations using Matlab
(PDF ebook)

PoorBelow averageAverageGoodExcellent (136 votes, average: 3.63 out of 5)

Hand-picked Best books on Communication Engineering
Best books on Signal Processing

Topics in this chapter

Pulse Shaping, Matched Filtering and Partial Response Signaling
● Introduction
● Nyquist Criterion for zero ISI
● Discrete-time model for a system with pulse shaping and matched filtering
 □ Rectangular pulse shaping
 □ Sinc pulse shaping
 □ Raised-cosine pulse shaping
 □ Square-root raised-cosine pulse shaping
● Eye Diagram
● Implementing a Matched Filter system with SRRC filtering
 □ Plotting the eye diagram
 □ Performance simulation
● Partial Response Signaling Models
 □ Impulse response and frequency response of PR signaling schemes
● Precoding
 □ Implementing a modulo-M precoder
 □ Simulation and results

Post your valuable comments !!!