function w = fftbasis(n)
%
% fftbasis: generates the Wkm basis matrix for the FFT
% On input:
%     n: order of FFT
% On output:
%     w: basis matrix
% Call:
%     w = fftbasis(n)
%

for k = 1:n
  for m = k:n
    w(k,m) = exp((-j*2*pi*(k-1)*(m-1))/n);
    w(m,k) = w(k,m);
  end
end
