function z = cleanup_freqs(x,fps,fsmp)
  % Applies notch filters at frequencies specified by the
  % rows of the table {fps}. Assumes that the sampling frequency is
  % {fsmp}.
  %
  % Each row of {fps} must have two numbers {f,fsigma}.
  % The corresponding notch filter will be a complemented Gaussian
  % bell with mean freqency {f} (which must be between 0 and 
  % {fsmp/2}) and deviation {fsigma}.
  % All frequencies are in Hz.
  assert(size(fps,2) >= 2)
  assert(size(x,2) == 1)
  N = size(x,1);
  X = fft(x);
  XP = power_spectrum_from_fft(X);
  NP = size(XP,1)
  assert(NP == floor(N/2)+1)
  Y = kill_filter(fps,N,fsmp);
  Z = X .* Y;
  z = real(ifft(Z));
  
  