function F = fdiag(N)
% FDIAG(N)
% Generates a diagonal N-by_N matrix F
% containing the (k=1)st Fourier sinusoid
% for an N-point vector:
% F(n,n) = exp(j*(n-1)*2*pi/N)
% (Note that array indices start at 1)
n = 0:N-1;
d = exp(j*n*2*pi/N);
F = diag(d);
return

