% convomat.m
% returns a matrix that performs circular convolution
% usage: A = convomat(f)
% A*X will convolve each column of X with the function f

% S. Allen Broughton 29 Oct 10

function A = convomat(f);
     X = f(:);  
     n = length(f);
     A = zeros(n,n);
     for i = 1:n
         A(:,i) = X;
         X = [X(n); X(1:(n-1))];
         end;
                     
      
