Eye diagram

Started by avi1987 3 years ago2 replieslatest reply 3 years ago595 views

I need to plot eye diagram for RRC filtered #QPSK modulated signal. The specifications are given as follows

Sampling frequency : 1.024 MHz

Symbol Rate : 256 Kbps (Hence, Upsampling rate = 4)

Roll off factor = 0.2

So I wrote a matlab code, but the resolution of eye diagram plotted is very low. I used object commscope.eyediagram. It is written that more the sampling rate, the more would be the resolution. But my upsampling rate is fixed at 4. 

Kindly suggest what changes I need to make to get a better resolution of eye diagram.

The matlab code is given below

Fs = 1.024*10^6;

Rs = 256*10^3;

ns = Fs/Rs;

rolloff = 0.2;

M = 4;

qpskMod = comm.QPSKModulator; % comm.QPSKModulator System object

rctFilt = comm.RaisedCosineTransmitFilter('RolloffFactor', rolloff, ...

    'OutputSamplesPerSymbol', ns, ...

    'FilterSpanInSymbols', 6, ...

    'Gain', 1);

% Generate modulated and pulse shaped signal

frameLen = 2000;

msgData = randi([0 M-1],frameLen,1);

msgSymbols = qpskMod(msgData);

msgTx = rctFilt(msgSymbols);

t = 0:1/Fs:500/Rs-1/Fs; 

idx = round(t*Fs+1);

hFig = figure;

plot(t, real(msgTx(idx)));

hold on;

title('Modulated, filtered in-phase signal');

xlabel('Time (sec)');


grid on;


% Create an eye diagram object

eyeObj = commscope.eyediagram(...

    'SamplingFrequency', Fs, ...

    'SamplesPerSymbol', 4, ...

    'OperationMode', 'Complex Signal', ...

    'SymbolsPerTrace', 2)

% Update the eye diagram object with the transmitted signal

update(eyeObj, 0.5*msgTx);

% Manage the figures

managescattereyefig(hFig, eyeObj, 'right');

[ - ]
Reply by drmikeJanuary 24, 2017

You only have 4 samples per symbol.  It makes sense that your eye diagram would look poor.  Up your sample rate to 4.096 MHz so you have 16 samples per symbol.  That should make things look a lot better.

Normally you don't want the sample rate to be a multiple of the symbol rate so the phase of sampling continuously shifts through the symbols.  For example, if you are at Nyquist rate and you sample at every null crossing your output is all zeros!  Just shifting 90 degrees in phase gives you the alternating signal.  A 3 MHz sample rate should actually work ok because it won't line up or repeat for millions of samples.


[ - ]
Reply by neiroberJanuary 24, 2017


I have not looked at your code, so this may not apply.  However...

If you have RRC filtered data, to look at the eye, you need to filter it again with the same RRC filter to obtain the full Nyquist response.  Otherwise the eye will be poor.

Note that it is not difficult to write your own code to plot the eye pattern.  For a sequence x with Fs = 4*Fsymbol, the following code will plot an eye pattern that displays two symbols:

y= x(15:length(x));             % remove any initial transient

M= fix(length(y)/8);

y= y(1:M*8)

A= reshape(y,8,M);            % matrix A has M columns of length 8 taken from y