% Code 23: IDFT (Matrix-vector product)
% Input: N (even) 
%        fk (N-column vector: Fourier coefficients)
% Output: fj (N-column vector: sampling values of f)
function fj = idftmat(fk)
N = length(fk); WN = exp(-i*2*pi/N); jj = [0:N-1]'; kk = jj'; 
P = WN.^(-jj*(kk-N/2)); fj = P*fk;
