   function y = DFT(x,isign)
%  function y = DFT(x,isign)        
% y = DFT(x,+/-1):  +1 input:point sample   -> output:freq. dom. coeffs.
%        -1 input:freq.dom.coef. -> output:point values
n = length(x);
y = x(1)*ones(n,1);
if n>1
   m=n/2;
   w=exp(isign*pi*sqrt(-1)/m);
   v = w.^(0:n-1)';
   for k = 2:n
      z = rem((k-1)*(0:n-1)',n )+1;
      y = y + v(z)*x(k);
   end
   if isign == 1
      y = y/m;
   end
end
