%***************************************************************************
%  gcw - generalized cosine window          DAVID HORAK          5.5.1998
%***************************************************************************
function g=gcw(N,k,a0,a1,a2,a3,a4)

t=2*pi/(N-1);
for i=1:N
  g(i)=k*(a0-a1*cos(t*(i-1))+a2*cos(2*t*(i-1))-a3*cos(3*t*(i-1))+a4*cos(4*t*(i-1)));
end
%plot(g);