function [lowest_dt,highest_dt,dt_tally,meanbgrd,stdbgrd]=tally_deltatime(dt,background)
%description: produces a tally of delta time values
%called by:
%calls:
%notes:
%code confirmed date:

lowest_dt=min(dt);
highest_dt=max(dt);
shifter=abs(lowest_dt)+1;
possible_dts=shifter+highest_dt; %should cross zero in all but trivial cases, so need an extra value
dt_tally=zeros(1,possible_dts);

for i=lowest_dt:highest_dt
    dt_tally(i+shifter)=length(find(dt==i));
end

meanbgrd=mean(dt_tally([1:background end-background:end]));
stdbgrd=std(dt_tally([1:background end-background:end]));