function [pct,meanpw,stdpw]=proximal_window(spd,pw)
%takes an spd result returned by simulated_psc_in_noise and a range to use as proximal window
%finds the number of events that have a delta time value within the proximal window
%and the mean delta time of those events

deltatime=spd(3,:)-spd(1,:);
within=find(deltatime<=pw(1) & deltatime>=pw(2));
pct=length(within)/size(spd,2)*100;
meanpw=mean(deltatime(within));
stdpw=std(deltatime(within));