function  z = Cut2Pow2(y)

% cuts the Sirotem data to the next lowest power of 2 while making
% sure to include the spikes


a = find(y == max(y));
b = pow2(nextpow2(y) - 1) ;
n = length(y);

if a >= n/2
  z = y((n-b+1):n);
else 
  z = y(1:b);
end;
