lass="comment">% Also, the threshold crossing time has changed due to data clipping</span>
0148 spikes.threshT = spikes.threshT - left_valid + 1;
0149 
0150 <span class="comment">% Worse, the threshold time/value may have changed while shifting.  This</span>
0151 <span class="comment">% will make it hard to identify peaks later, so we need new values.</span>
0152 meanlevel = mean(spikes.waveforms(:));   <span class="comment">% estimate of baseline</span>
0153 notallowed = [1:(spikes.threshT-maxshift-1),(spi