function y = dft(x,W)

j = sqrt(-1);
N = length(x);
y = zeros(1,N);
for k = 0:N-1,
    y(k+1) = sum(x.*W.^k);
end
