function fps = find_rel_peaks(X,fmin,rth,dfwd,fsmp)
  # Returns a table {fps} of frequencies and presumed
  # widths of peaks in the power spectrum of a signal
  # whose Fourier transform is {X}.
  #
  # A peak is a set of consecutive elements
  # in the power spectrum with value {rth} times
  # the median of the values in a window of width 
  # {dfwd} or more elements around the peak.  
  # Only considers peaks whose lowest frequency is {fmin} or more.
  # 
  # Each row of {fps} has three elements {f,fsigma,pwr}
  # where {f} is the estimated central frequency
  # of the peak, {fsigma} is its estimated standard
  # deviation, and {pwr} is the estimated total power.  
  # 
  # Assumes that the sampling frequency is {fsmp}.
  # All frequencies except {dfwd} are (in Hz).
  assert(size(X,2)==1)
  N = size(X,1);
  assert(mod(N,2) == 0) # For simple mirroring of power spectrum ends.
  fps = zeros(N,3);
  XP = power_spectrum_from_fft(X);
  [ZP, big] = adapt_median_filter(XP,rth,dfwd,fsmp);
  fps = find_rel_peaks_raw(XP,big,fmin,rth,fsmp);
  fps = condense_peaks(fps,fmin,fsmp);
  
  