function M = circconv_matrix(x,h,N)
x = x(:);
h = h(:);
P = length(x);
Q = length(h);
C = circulant(h,N);
M = [C;[x.',zeros(1,N-P)]];
