# Creating an Eye Diagram for QPSK Simulation

I am trying to implement an eye diagram for an application, where the input signal is QPSK. However, I feel that there is some fundamental concept concerning these plots that I am missing. Several definitions and descriptions for these diagrams that I have seen are all along the same line:

The eye diagram repeatedly overlays the time width of n symbols

Which sounds straight forward enough (though there are possibly variations?), but I'm not sure that is all there is to it.

The simulated input signal that I am testing with:

• modulated QPSK, generated from random symbols
• No raised cosine, RRC, or any filtering

Eventually, I will modify the signal (such as adding filtering) to see the effects on the system.

This is the image I get when overlaying the symbols in time (showing 1 symbol per trace):

Since I've never seen any example that looks like this, I tried looking at other variations. Using the eyediagram function in Octave, it produces the barn door (breaking the signal into the real and complex):

The points on the "door" are just the constellation points received (not the samples). So when I see examples like this, with a noisy signal:

I don't have enough reputation to post another image here, though it would help to explain my question. Similar to the above image: for a noisy signal, the lines of the diagram are fuzzy. It would indicate that there are more analog points used to fill in the plot

Where are the other points coming from to create the noise, if not the received waveform? Then there are the horizontal components of the image. How is it possible to get the horizontal components from a QPSK waveform? Even if separated into I and Q representations? Again, it makes sense when connecting the received constellation point at T intervals, but I do not see how to get this when plotting the signal itself.

What am I missing or not understanding here?

## EDIT

I updated the diagram to plot only the received symbols. Previously I was plotting the received waveform, which was a modulated signal (that is how the first image was produced). Below are two diagrams showing just the in-phase plot. The second one has noise added:

Without noise, the lines are straight as PSK mentioned in the comments. With noise, the lines are still straight. Which is the other part of the question. Looking at an example here:

(this is from Matlab example at https://www.mathworks.com/help/comm/gs/scatter-plot-and-eye-diagram-with-matlab-functions.html)

Where do the smooth transitions come from? The lines are not straight. There are other in-between points that are filling in the diagram. Where are they coming from?

• Few things to clarify, 1. How are you getting the 1st plot (Your own script in octave?), 2.What do you mean by horizontal components of QPSK waveform? – PSK Jul 17 '17 at 14:37
• Regarding the fuzzy lines I see in the plot from octave it could very well be the rendering artifacts. Try saving the plot as a vector image (pdf or eps) from within octave and view the plot with a pdf viewer. – PSK Jul 17 '17 at 14:39
• You say you're using "no pulse shaping"; does that mean you're using rectangular pulses? Also, if you have 100 samples per symbol and no noise, then an easy way to draw a simple diagram would be running plot(s(1:300)); hold on; plot(s(301:600)); plot(s(601:900)) in octave or Matlab. This will plot three slices of three symbols each on top of each other. – MBaz Jul 17 '17 at 15:17
• @user4325538 The eye diagram only makes sense in baseband. – MBaz Jul 17 '17 at 16:05
• @user4325538 just upload the image to imgur.com, and link to it from within the question. Someone will edit it in. – Marcus Müller Jul 17 '17 at 23:06

If you sketch the matched filter output between $T$ and $5T$, overlaying the signal in chunks of length $2T$ centered at $2T$ and $4T$, you will see that the signal is flat at the lower level when two $1$s are transmitted in succession. Similarly, the signal will be flat at the upper level if two $0$'s are transmitted in succession. For transitions between two data bits, the matched filter output crosses over.
As to where the smooth transitions instead of straight ramps come from, if the modulating signal is not a rectangular pulse, or if the matched filter is not quite matched perfectly, the filter output can well be smoothly transitioning from one level to the other. For example, if the BPSK pulse were one cycle of a sinusoid of period $T$, specifically $$s(t) = \begin{cases}\sin\left(\frac{2\pi t}{T}\right), &0 \leq t < T,\\ 0, &\text{otherwise,}\end{cases}$$ then the matched filter output would be a perfect sinusoid of period $T$ between two successive sampling instants if the two data bits were the same, and make a smooth transition from peaking at $nT$ to peaking with opposite polarity at time $(n+1)T$. See, for example, the figure below.