function a = wcoef(F,N,sig,b)
%
%   The function wcoef.m computes the Weeks coefficients of
%   the function F(s) by using the midpoint version of the FFT.
% 
n = [-N:1:N-1]';          % first compute the gridpoint for the FFT  ...       
h = pi/N;
th = h*(n+1/2);
y = b*cot(th/2);
s = sig+i*y; 
FF = eval(F);             % ... then sample the function ... 
FF = FF.*(b+i*y);
a = fftshift(fft(fftshift(FF)))/(2*N);  % ... and apply the FFT.
a = exp(-i*n*h/2).*a;














