%Generate rectangular window of length M in vector of length n, % start at j=m go to j=m+M-1 function y = rectwindow(n, m, M) y=zeros(1,n); y(1:m)=0; y(m:m+M-1)=1; y(m+M:n)=0;