Eye Diagram
Eye Diagram
EYE Diagram
Code:
span = 10; % Filter span
rolloff = 0.2; % Rolloff factor
sps = 8; % Samples per symbol
M = 4; % Modulation alphabet size
k = log2(M); % Bits/symbol
phOffset = pi/4; % Phase offset (radians)
n = 1; % Plot every nth value of the signal
offset = 0; % Plot every nth value of the signal, starting from
offset+1
%Create the filter coefficients using the rcosdesign function.
filtCoeff = rcosdesign(rolloff,span,sps);
%Generate random symbols for an alphabet size of M.
rng default
data = randi([0 M-1],5000,1);
%Apply QPSK modulation.
dataMod = pskmod(data,M,phOffset);
%Filter the modulated data.
txSig = upfirdn(dataMod,filtCoeff,sps);
%Calculate the SNR for an oversampled QPSK signal
EbNo = 20;
snr = EbNo + 10*log10(k) - 10*log10(sps);
%Add AWGN to the transmitted signal.
rxSig = awgn(txSig,snr,'measured');
%Display 1000 points of the transmitted signal eye diagram over two symbol
periods.
eyediagram(txSig(sps*span+1:sps*span+1000),2*sps)
%Display 1000 points of the received signal eye diagram.
eyediagram(rxSig(sps*span+1:sps*span+1000),2*sps)
Eb/No= 20dB
Conclusion:
1. For a certain amount of ISI, the horizontal closing of the eye is fixed. However when the AWGN
is added to the signal, the vertical closing of the eye increases, hence noise margin decreases.
2. When the SNR of the signal is halved i.e. reduced from 20dB to 10dB, the eye has almost closed
vertically and now it is very difficult to detect the transmitted symbols because noise level has
increased much.