kes.threshT+maxshift+1):(size(spikes.waveforms, 2))];
0154 
0155 deflection = mean(abs(spikes.waveforms - meanlevel), 1);  <span class="comment">% mean deviation from baseline</span>
0156 deflection(notallowed) = 0;
0157 [junk, spikes.threshT] = max(deflection);  <span class="comment">% max deflect near old threshT marks new threshold marker</span>
0158 threshValues = spikes.waveforms(:, spikes.threshT);  <span class="comment">% values at new marker</span>
0159 spikes.threshV(1) = max([threshValues(threshVa