1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142
| load('PulseResponseReflective100ps.mat'); modulation = 2; pulsewave = zeros(size(pulse, 1), 1); pulsewave = pulse(:, 1); pulsewave(:,1) = pulsewave - pulsewave(1);
[stateye,vh,th] = pulse2stateye(pulsewave,SamplesPerSymbol,modulation);
cmap = serdes.utilities.SignalIntegrityColorMap; figure(1); imagesc(th*SymbolTime*1e12,vh,stateye) colormap(cmap) colorbar axis('xy') xlabel('ps') ylabel('V') title('Statistical Eye PDF')
[ysize, xsize] = size(stateye); ymid = floor((ysize+1)/2); upperEyePDF = stateye(ymid:end,:); lowerEyePDF = stateye(ymid:-1:1,:);
upperEyeCDF = cumsum(upperEyePDF, 1); lowerEyeCDF = cumsum(lowerEyePDF, 1);
berlist = [1e-12, 1e-6, 0.01]; lenBer = length(berlist); upperBERIdx = zeros(lenBer, xsize); lowerBERIdx = zeros(lenBer, xsize);
for i = 1:lenBer for j = 1:xsize upperBERIdx(i, j) = find(upperEyeCDF(:, j) >= berlist(i), 1); lowerBERIdx(i, j) = find(lowerEyeCDF(:, j) >= berlist(i), 1); end end
upperBERIdx = ymid - 1 + upperBERIdx; lowerBERIdx = ymid + 1 - lowerBERIdx;
upperBERVal = vh(upperBERIdx); lowerBERVal = vh(lowerBERIdx);
tticks = th*SymbolTime*1e12; figure(2); lgd = cell(lenBer*2,1) ; hold on; for i = 1:lenBer load('PulseResponseReflective100ps.mat'); modulation = 2; pulsewave = zeros(size(pulse, 1), 1); pulsewave = pulse(:, 1);
[stateye,vh,th] = pulse2stateye(pulsewave,SamplesPerSymbol,modulation); cmap = serdes.utilities.SignalIntegrityColorMap; figure(1); imagesc(th*SymbolTime*1e12,vh,stateye) colormap(cmap) colorbar axis('xy') xlabel('ps') ylabel('V') title('Statistical Eye PDF')
[ysize, xsize] = size(stateye); ymid = floor((ysize+1)/2); upperEyePDF = stateye(ymid:end,:); lowerEyePDF = stateye(ymid:-1:1,:);
upperEyeCDF = cumsum(upperEyePDF, 1); lowerEyeCDF = cumsum(lowerEyePDF, 1);
berlist = [1e-12, 1e-6, 0.01]; lenBer = length(berlist); upperBERIdx = zeros(lenBer, xsize); lowerBERIdx = zeros(lenBer, xsize);
for i = 1:lenBer for j = 1:xsize upperBERIdx(i, j) = find(upperEyeCDF(:, j) >= berlist(i), 1); lowerBERIdx(i, j) = find(lowerEyeCDF(:, j) >= berlist(i), 1); end end
upperBERIdx = ymid - 1 + upperBERIdx; lowerBERIdx = ymid + 1 - lowerBERIdx;
upperBERVal = vh(upperBERIdx); lowerBERVal = vh(lowerBERIdx);
tticks = th*SymbolTime*1e12; figure(2); lgd = cell(lenBer*2,1) ; hold on; for i = 1:lenBer plot(tticks, upperBERVal(i, :), 'Color', cmap(i*15, :)); lgd{i*2-1} = strcat('BER=',num2str(berlist(i))); plot(tticks, lowerBERVal(i, :), 'Color', cmap(i*15, :)); lgd{i*2} = ""; end hold off; legend(lgd) axis('xy') xlabel('ps') ylabel('V') title('Statistical Eye BER')
figure(3) tt = [0:size(pulsewave, 1)-1]*dt; plot(tt*1e9, pulsewave, 'k', tt*1e9, pulsewave-pulsewave(1), 'r--'); legend('original', 'dc shift'); xlim([0 10]); ylim([-0.65 0.65]) xlabel('Time (ns)'); ylabel('voltage (V)'); title('pulse response'); grid on; plot(tticks, upperBERVal(i, :), 'Color', cmap(i*15, :)); lgd{i*2-1} = strcat('BER=',num2str(berlist(i))); plot(tticks, lowerBERVal(i, :), 'Color', cmap(i*15, :)); lgd{i*2} = ""; end hold off; legend(lgd) axis('xy') xlabel('ps') ylabel('V') title('Statistical Eye BER')
figure(3) tt = [0:size(pulsewave, 1)-1]*dt; plot(tt*1e9, pulsewave); xlabel('Time (ns)'); ylabel('voltage (V)'); title('pulse response'); grid on;
|