Tech-invite3GPPspaceIETFspace
21222324252627282931323334353637384‑5x

Content for  TS 26.114  Word version:  18.8.0

Top   Top   Up   Prev   Next
0…   3…   4…   5…   6…   6.2.3…   6.2.5…   6.2.7…   6.2.10…   7…   7.5…   8…   9…   10…   10.2.1.6…   10.2.2…   10.3…   10.4…   11…   12…   12.3…   12.7…   13a…   16…   16.5…   17…   18…   19…   A…   A.3…   A.4…   A.5…   A.10…   A.14…   A.15…   B…   C…   C.1.3…   C.1.3.5   C.2…   D   E…   E.18…   E.31…   G…   K…   L…   M…   N…   O…   P…   P.3   Q…   R…   S…   T…   U…   V…   W…   X…   Y…   Y.6…   Y.6.4…   Y.6.5…   Y.7…

 

D  Reference delay computation algorithmp. 342

In this Annex, the reference jitter management algorithm is described. It is written in pseudo code and is non-causal; hence non-implementable. The purpose of this algorithm is to define an "ideal" behaviour which all jitter buffers used in MTSI should strive to mimic. This buffer operates based on three input parameters:
  • lookback factor to set the current target buffering depth;
  • target late loss rate;
  • maximum allowed time scaling percentage.
function ref_jb(channel,jb_adaptation_lookback,delay_delta_max,target_loss)
% channel         = file name of the channel
% lookback        = look back factor when estimating the max jitter
%                   buffer level [number of frames]
% delay_delta_max = max timescaling related modification (%) of the
%                   delay
% target_loss     = target late loss (%)
% example syntax:
% ref_jb('channel_1.dat',200,15,0.5);
framelength = 20;
% this value sets the speech data in each RTP packet to 20 ms. For 2 speech
% frames/RTP packet the value would be 40 ms. 
jitter_est_window=50; 
% Sets the jitter estimation window in number of frames
delay_delta_max_ms = framelength*delay_delta_max*0.01;
% Sets the maximum allowed time scaling
tscale = 1; 
% Scale factor of delay data
% In this case the files are assumend to be ascii files with one delay
% entry per line, the entries are in ms, a negative value denotes
% a packet loss.
x = load(channel);
x =x';
% remove packet losses
% remove inital startup empty frames
ix = find(x > 0);
x(1:ix(1)-1) = x(ix(1));
% remove packet losses (replace with nearby delay values)
ix = find(x < 0);
packet_loss = length(ix)/length(x)*100;
for n=1:length(ix)
    if (ix(n) > 1)
        x(ix(n)) = x(ix(n)-1);
    end;
end;
% convert timescale to ms
x = x*tscale;
L = length(x);
T = 1:L;
% estimate min and max TX delay, estimate a delta_delay
for n=1:L
    ix = [max(1,n-jitter_est_window):n];
    max_delay(n) = max(x(ix));
    min_delay(n) = min(x(ix));   
    delta_delay(n) = max_delay(n)-min_delay(n);
end
% compute the target max jitter buffer level with some slow adaptation
% downwards, just to mimick how a jitter buffer might behave
for n=1:L
    ix = [max(1,n-jb_adaptation_lookback):n];
    jb(n) = max(delta_delay(ix));
    % The timescaling is not allowed to adjust the jitterbuffer target max level
    % too fast.
    if n == 1
        jb_ = jb(n);
    end  
    delta = abs(jb_-jb(n));  
    if delta < delay_delta_max_ms;
        jb_ = jb(n);
    else
        if (jb(n) < jb_)
            jb_ = jb_-delay_delta_max_ms;
        else
            jb_ = jb_+delay_delta_max_ms;
        end
        jb(n) = jb_;
    end    
    % jitter buffer target max level can only assume an integer number of frames
    jbq(n) = ceil(jb(n)/framelength)*framelength;
    % compute estimated delay
    del(n) = jbq(n)+min_delay(n);    
end
if target_loss > 0
    % decrease the max jitter buffer leve until a target late loss has been
    % reached.
    late_loss = length(find(del < x))/L*100.0;
    jbq_save = jbq; % as the max level is increased until the late loss > target one
    % must be able to revert back to the previous data
    while late_loss < target_loss 
        jbq_save = jbq;
        jbq = min(max(jbq)-framelength,jbq);
        del = jbq+min_delay;
        late_loss = length(find(del < x))/L*100.0;
    end 
    jbq = jbq_save;
    del = jbq+min_delay;
end
jdel = max(0,del-x);
%Calculate and plot the CDF of the reference buffer.
figure(1);plot(T,jbq,T,del,T,x);
[n,x] = hist(jdel,140); y = cumsum(n);y = y/max(y)*100;
figure(2);plot(x,y);axis([0 200 0 100]);ylabel('%');xlabel('ms');title('CDF of packet delay in JB');
Up

Up   Top   ToC