function y=dft(x)
    nn=length(x);
    c=zeros(1,nn);
    for i=1:nn
        sum=0;
        for j=1:nn
            sum=sum+x(j).*exp(-1i.*(2.*pi./nn).*(i-1).*(j-1));
        end
        c(i)=sum;
    end
    y=c;
end