% win.m - generates window function
%
% function w = win(n)
%
% n = number of samples

function w = win(n)

x=-n/2:n/2-1;
w=(cos(2*pi*x/n)+1)/2;
