function [PSP_start_perm]=ShufflePSPStart( PSP_start )
%[PSP_start_perm]=function ShufflePSPStart( PSP_start )
% Fn to resample the PSP start times by shuffling their ISI intervals
%   (NOTE the time of the first PSP is preserved)

% Shuffle start times, preserving ISI's...

    % Compute ISI list (ISI representation of PSP times)
    ISIlist= diff( PSP_start );
    
    % Permute ISI dist
        % Keep _first_ ISI the same
        %  (...edge effects)
    N=numel(PSP_start);
    %ISIperm(1)=ISIlist(1);
    ISIperm(2:N)= ISIlist( randperm(N-1) );
    
    % Construct surrogate PSP start times from permuted ISI
    PSP_start_perm=zeros( N,1 );
    PSP_start_perm(1)=PSP_start(1);
    for j=2:N
        PSP_start_perm(j)=PSP_start_perm(j-1)+ISIperm(j);
    end
    
    % PSP_start_perm now contains the "shuffled" surrogate PSP start
    %  times...
