function [mat] = fftm_norm(n)

mat = ones(n);
for x = 1:n-1
    for y = 0:n-1
        mat(x+1,y+1) = cos(x/n * 2*pi * y) + i * sin(x/n * 2*pi * y);
    end
end

mat = mat ./ norm(mat(1,:));