function a = trianglewindow(len)
%returns a triangle window of length len.
%a will be a column vector.
%the center magnitude will be 1.
%if there are an even number, the center 2 elements are identical

a = zeros(len, 1); %column vector
t = (0:(ceil(len/2)-1))';
m = 1/(length(t)-1);

a(1:length(t)) = t * m;
a( (floor(len/2)+1):len ) = flipud(t*m);