function [fn] = ifftC314(xn,cj);
%
%  ifftC314.m -- djm -- 28 jan 2008
%
%  [fn] = ifftC314(xn,cj) -- inputs:  xn, cj (col vect)
%                        outputs: fn (col vect)
%
%  !!! DO NOT INCLUDE PERIODIC POINT in xn !!!

%  system size
N = size(xn,1);
if (2*floor(N/2) ~= N)
    disp('ERROR:  # of x-points must be EVEN')
    fn = [];
    return
else
    N2 = round(N/2);
end

%  force the nyquist mode cj(1) to zero
cj(1) = 0;

%  left endpoint & interval half-width
x0 = xn(1);  Lx = xn(N/2+1)-xn(1);

%  wavenumber vector
kj = (pi/Lx)*(-N2:N2-1)';

%  complex fourier coefficients
fn = ifft(exp(-i*x0*kj).*fftshift(cj))*N;