% get_H( h, N) - create matrix H from channel coefficient column vector h
% for use in solving the equation  r = H*a + n  for data a in x4 problem.
%
% N >= length(h) is required
%
function H = get_H( h, N)

H = zeros( N, N);

L = length(h);

m = 1;

for i=N:-1:1
  v = [0:m-1];
  H(i+v,i) = h(1+v);
  if( m < L)
    m = m + 1;
  end
end
