function [ c ] = myconv(a, b)
%MYCONV returns the convolution of vectors a and b
%   It is a simple replication of built-in conv
%   Minas Spetsakis (March 9 2016)

N = length(a)-1;
M = length(b)-1;

c = zeros(N+M+1,1);

for k=0:N+M
    imin = max(0,k-M);
    imax = min(k,N);
    for i=imin:imax
        c(k+1) = c(k+1)+a(i+1)*b(k-i+1);
    end
end

end

