function split_bands(x,fsplit,fsmp)
  % Splits a sampled signal {x} into two frequency bands at
  % frequency {fsplit}. Assumes that the sampling frequency is {fsmp}.
  close all
  assert(size(x,2) == 1)
  N = size(x,1);
  X = fft(x);
  Y = low_pass_filter(N,fsplit,fsmp);
  xlo = real(ifft(X .* Y));
  xhi = x - xlo;
  figure 60; 
  timeplot(xlo,1,N,fsmp,'-k'); hold on
  timeplot(xlo,1,N,fsmp,'-b'); 
  timeplot(xhi,1,N,fsmp,'-r'); 
  title(sprintf('band split at %.03f Hz', fsplit))
  hold off
  figure 61; 
  timeplot(xlo,600,1100,fsmp,'-k'); hold on
  timeplot(xlo,600,1100,fsmp,'-b'); 
  timeplot(xhi,600,1100,fsmp,'-r'); 
  title(sprintf('band split at %.03f Hz - detail', fsplit))
  hold off