function y = lin2circonv(h,x)
% Linear Convolution for any length of input signal
% N = max(length(h), length(x))
hxconv = conv(h, x);
N = max(length(h), length(x));

y = zeros(1, N);

for n = 1:1:N
    for len = -N:1:N
        if ((n+len*N) >= 1) && ((n+len*N) <= (length(hxconv)))
            y(n) = y(n) + hxconv(n+len*N);
        end
    end
end
