niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 1 | function plotJitterEstimate(filename) |
| 2 | |
| 3 | [timestamps, framedata, slopes, randJitters, framestats, timetable, filtjitter, rtt, rttStatsVec] = jitterBufferTraceParser(filename); |
| 4 | |
| 5 | x = 1:size(framestats, 1); |
| 6 | %figure(2); |
| 7 | subfigure(3, 2, 1); |
| 8 | hold on; |
| 9 | plot(x, slopes(x, 1).*(framestats(x, 1) - framestats(x, 2)) + 3*sqrt(randJitters(x,2)), 'b'); title('Estimate ms'); |
| 10 | plot(x, filtjitter, 'r'); |
| 11 | plot(x, slopes(x, 1).*(framestats(x, 1) - framestats(x, 2)), 'g'); |
| 12 | subfigure(3, 2, 2); |
| 13 | %subplot(211); |
| 14 | plot(x, slopes(x, 1)); title('Line slope'); |
| 15 | %subplot(212); |
| 16 | %plot(x, slopes(x, 2)); title('Line offset'); |
| 17 | subfigure(3, 2, 3); hold on; |
| 18 | plot(x, framestats); plot(x, framedata(x, 1)); title('frame size and average frame size'); |
| 19 | subfigure(3, 2, 4); |
| 20 | plot(x, framedata(x, 2)); title('Delay'); |
| 21 | subfigure(3, 2, 5); |
| 22 | hold on; |
| 23 | plot(x, randJitters(x,1),'r'); |
| 24 | plot(x, randJitters(x,2)); title('Random jitter'); |
| 25 | |
| 26 | subfigure(3, 2, 6); |
| 27 | delays = framedata(:,2); |
| 28 | dL = [0; framedata(2:end, 1) - framedata(1:end-1, 1)]; |
| 29 | hold on; |
| 30 | plot(dL, delays, '.'); |
| 31 | s = [min(dL) max(dL)]; |
| 32 | plot(s, slopes(end, 1)*s + slopes(end, 2), 'g'); |
| 33 | plot(s, slopes(end, 1)*s + slopes(end, 2) + 3*sqrt(randJitters(end,2)), 'r'); |
| 34 | plot(s, slopes(end, 1)*s + slopes(end, 2) - 3*sqrt(randJitters(end,2)), 'r'); |
| 35 | title('theta(1)*x+theta(2), (dT-dTS)/dL'); |
| 36 | if sum(size(rttStatsVec)) > 0 |
| 37 | figure; hold on; |
| 38 | rttNstdDevsDrift = 3.5; |
| 39 | rttNstdDevsJump = 2.5; |
| 40 | rttSamples = rttStatsVec(:, 1); |
| 41 | rttAvgs = rttStatsVec(:, 2); |
| 42 | rttStdDevs = sqrt(rttStatsVec(:, 3)); |
| 43 | rttMax = rttStatsVec(:, 4); |
| 44 | plot(rttSamples, 'ko-'); |
| 45 | plot(rttAvgs, 'g'); |
| 46 | plot(rttAvgs + rttNstdDevsDrift*rttStdDevs, 'b--'); |
| 47 | plot(rttAvgs + rttNstdDevsJump*rttStdDevs, 'b'); |
| 48 | plot(rttAvgs - rttNstdDevsJump*rttStdDevs, 'b'); |
| 49 | plot(rttMax, 'r'); |
| 50 | %plot(driftRestarts*max(maxRtts), '.'); |
| 51 | %plot(jumpRestarts*max(maxRtts), '.'); |
| 52 | end |