(6 votes, average: 4.17 out of 5)

# Eye diagram with raised cosine filtering

by on May 1, 2008

We have discussed about probable transmit pulse shaping filter and have observed that raised cosine filtering filtering allows a simpler implementation, albeit at the cost of increased bandwidth. Let us know understand the eye diagram, which is a useful graphical tool to quantify the degradation of the signal due to filtering.

## Eye diagram

An eye diagram is generated in an oscilloscope operating in the persistence mode by observing the output of the filter with the symbol timing serving as the trigger. The observation window can be set as 2 times the symbol period. (Refer. Section 5.1.3 in [DIG-COMM-BARRY-LEE-MESSERSCHMITT]).

When the input data is random, the eye diagram which consists of many overlapped traces of the signal captures visually all the paths which the waveform takes.

## Simulation script

Matlab/Octave script for simulating the eye diagram plot. The code performs the following

(a) Defines random BPSK modulated symbols (+1′s and -1′s)

(b) Defines two raised cosine filters with $\alpha$ = 0.5, $\alpha$ = 1

(c) Upsamples the transmit sequence by zero insertion

(d) Convolves the upsampled transmit sequence with the filter

(e) Overlays the time domain samples to plot the eye diagram

## Update

25th May 2008

Corrected the issue. Modified the code to handle division by zero.

(a) $\frac{sin(\pi x)}{\pi x} =1$ for $x=0$ and

(b) $\frac{cos(\alpha \pi t/T)}{1-(2\alpha t/T)^2}=\frac{\pi}{4}$ for $|\frac{\alpha t}{T}| = \frac{1}{2}$

(Thanks to the article in RFDesign.com, The care and feeding of digital, pulse-shaping filter, Ken Gentile)

19th May 2008

It has been brought to my attention that the code is unable to plot the eye diagram accurately in Matlab environment. The difference is because my version of Octave seems to handle the division by numbers close to zero cleanly, where as Matlab insists on returning Inf. I will fix the code and release an update. sorry for the inconvenience.

Figure: Eye diagram following raised cosine filtering with $\alpha$ = 0.5

Figure: Eye diagram following raised cosine filtering with $\alpha$ = 1

As can be observed from the above figures, the above waveform has a shape similar to the human eye and hence the name eye diagram.

## Observations

1. For increasing the margin for error free transmission, the vertical opening of the eye should be more. In the presence of inter-symbol interference, the vertical opening of the eye reduces, thus increasing the probability of error.

2. The ideal sampling instant is the point where the vertical eye opening is maximum.

3. Smaller horizontal eye opening means implies more sensitivity to timing errors.

Note:

From the above figures, it can be observed that the horizontal eye opening with $\alpha$=0.5 is smaller than with $\alpha$=1.

Reason: The tails of the raised cosine filter with $\alpha$=1 dies away faster than the case where $\alpha$=0.5. Hence error in timing cause a bigger performance degradation for $\alpha$=0.5 than for$\alpha$=1 scenario. However, the flip side of using $\alpha$=1 is the increased bandwidth required for transmission.

Reference

Hope this helps.
Krishna

D id you like this article? Make sure that you do not miss a new article by subscribing to RSS feed OR subscribing to e-mail newsletter. Note: Subscribing via e-mail entitles you to download the free e-Book on BER of BPSK/QPSK/16QAM/16PSK in AWGN.

linkin8834 April 28, 2012 at 4:10 pm

Hello Krishna, how do i plot the eye diagram for OFDM system? upsample->IFFT->adding timing offset->downsample->FFT->plot the eye diagram. Is it correct?

Krishna Sankar May 2, 2012 at 5:01 am

@linkin8834: Hmm… well, eye diagram is plotted on the time domain waveform getting overlayed every symbol period. For OFDM waveform with a Gaussian like distribution for the time domain, do not expect the eye diagram to carry useful information.

Cedric April 6, 2012 at 7:30 pm

I am doing ofdm simulation and trying to use a eye diagram to compare the single carrier and subcarrier in multipath.
However, I don’t know how to delay the output.
For example, overall output = r(t)+0.5r(t-5us)+0.2r(t-10us) where r(t) is the signal after convolution.

Krishna Sankar April 8, 2012 at 5:02 am

@Cedric: Assuming that your samples are 5us apart, conv(rt,[1 0.5 0.2]) helps?

Theeksha January 15, 2012 at 8:29 pm

What is the effect of sampling time offset in the error vector magnitude? Does the sampling time offset react to changes in roll off factor?

Krishna Sankar January 23, 2012 at 5:25 am

@Theeksha: The presence of sampling time offset increases the error vector magnitude. Ideally we would like to sample at the maximum vertical eye opening, but in the presence of sampling time offset, we will drift away from the maximum eye opening window.

cinra June 23, 2011 at 11:33 pm

Hi Krishna,

I finally removed the horzontal curves in the middle of the eye diagram. Thanks

cinra June 23, 2011 at 12:16 am

why you have line en between ?

pravindra kumar February 13, 2010 at 8:51 pm

i want code for ber for bpsk using raised cosine filter

Krishna Sankar April 4, 2010 at 3:59 am

@pravindra kumar: I have not discussed the BER with raised cosine filter case, however you can find the BER with rectangular filter at http://www.dsplog.com/2009/05/08/ber-with-matched-filtering/

Ad December 23, 2009 at 10:05 am

Hi Krishna,
I have a question regarding the plot of eye diagram that you’ve shown.
You said its plotted for two symbols and the eye opening seems to be at
the center of the diagram(at completion of first unit interval). So is plotted
like half of previous bit,current bit and half of future ?

Fahmi November 3, 2009 at 8:55 pm

Hi Mr krishna ,
I don’t understand the utility of “upsampling the transmit sequence ”
what will happen if we did not add the zeros to the sequence ?
I wonder if there is some links clarifying this idea .
thank you very much.

Krishna Sankar November 8, 2009 at 8:46 am

@Fahmi: With a sampling frequency of fs, we can ‘see’ frequencies from [-fs/2 to fs/2). Typically, we would want to control a bigger bandwidth compared to the original transmit sequence. Hence we do upsampling.

nyna March 13, 2009 at 6:44 pm

krishna can u help me…why the graph of BER vs SNR in BPSK in theoretical and simulation is same..Whats the reason about it..

Krishna Sankar March 21, 2009 at 7:52 am

@nyna: We want to have our simulations to be in good agreement with theory, no? It helps us confirm that we were able to model all the equations correctly.

Krishna Sankar September 17, 2008 at 4:44 pm

@Prashant: All the data which we need to obtain can be observed by plotting for two symbol periods – width of the eye opening, transition edges etc. Ofcourse, nothing stops us from plotting for 3 (or more) symbol periods….

Glad that you are finding this site useful. Typically books do not cover these small details. To return the favour, you can refer this site to your friends/colleagues. Thanks.

Prashant September 16, 2008 at 3:57 pm

You have plotted it for two symbol period. Is that a rule or it varies i mean eye-diagram by definition assumes two symbol period? Actually I could not find any material which deals with implementation of eye-diagram except yours and in the books they don’t mention these details.

Krishna Sankar September 15, 2008 at 6:39 pm

@Prashant: You are right. x-axis is the time. I have assumed sampling frequency of fs=10 and plotted for two symbol periods.

Prashant September 15, 2008 at 3:49 pm

Hi,
Thanks for the nice article. I tried your matlab code, but I have some confusion. Can you elaborate your x axis in the code i.e. time axis? I mean, what is symbol rate and bit rate, why have you plotted this for 20 time instants, (i guess 20 = 2*fs in the code)?

TIA