function window = platcos(nplat,trans,total)
% Construct a symmetric window vector of length 'total' to be applied
% in the frequency domain. The first term is always 1. The 'nplat'
% terms that follow and that repeat at the end of the block have a
% value of 1. The 'trans' terms that border these blocks have a
% cosine shape. All other terms are zero.
window = zeros(1,total);
window(1)=1;
window(2:nplat+1) = ones(1,nplat);
window(total-nplat+1:total) = ones(1,nplat);
for term=1:trans
window(term+nplat+1) = 0.5*(1 + cos((term)*pi/trans));
window(total-term-nplat+1) = window(term+nplat+1);
end