function y = slow_conv(x,h); % Slow convolution .... % y = slow_conv(x,h) % x, h = input and sample response vectors % Convolution is implemented without any MATLAB efficiencies lenx = length(x); lenh = length(h); x = [x zeros(1,lenh-1)]; h = [h zeros(1,lenx-1)]; y = zeros(1,lenx+lenh-1); disp('n = ') for n = 1:lenx+lenh-1, for k = max(1,2-lenh):min(n,lenx), y(n) = y(n) + x(k)*h(1+n-k); % adjustment for indexing from 1 end if(rem(n,100))==0 disp(n) end end