function v = power_val(X,df)
  % Returns the power of a Fourier digital frequency {f}
  % in a Fourier transform {X}.  Includes the
  % conjugate frequency if there is one.
  assert(size(X,2)==1)
  N = size(X,1);
  assert(floor(df) == df) % Must be integer.
  df = mod(df, N); % Reduce to {0..N-1}
  ii = df + 1; % Octave index of {f}.
  v = abs(X(ii,1))^2;
  jj = N - ii; % Index of complementary freq.
  if ii ~= jj
    v = v + abs(X(jj,1))^2;
  end
  