The following Matlab project contains the source code and Matlab examples used for compute n x n dft matrix.
% dftmat = DFT matrix of order N x N;
% N = Order of the matrix
% computes the DFT matrix of orer N x N;
% DFT matrix is a n x n matrix defined as Wn=[(Wn)^km]
%Reference: Multirate Systems and Filter banks by P.