function w = lanczos(n,m)
%   w = lanczos(n,m) 
% returns the n-point column vector lanczos window 
% scaled around m points.    
% w = cosbel.*  (sin((j-n/2)*pi/m)/((j-n/2)*pi/m)   ;j=[1:n]
% A divide by zero warning occurs when n is odd. Don't Worry, no problem.
% m = one half of width of the filter.  If you want 40hr use m = 20 hr.

nvec=(-(n-1)/2:(n-1)/2)';
w = sin(pi*nvec/m) ./(pi*nvec/m);
l = find(w==NaN);
if isempty(l)==0 ,
w(l) = 1.;
end
cbell = cosbel(n,50);
wc = w.*cbell; 

w = wc/sum(wc);

% end of lanczos.m
