%
function c = dirtCircConv( a, b ) 
% 
% Calling sequence : 
% v = dirtCircConv( a, b ) ; 
% 
% Input : 
% --------
% a, b    vectors of the same length  
%         (the conditions are assumed to be met 
%          for efficiency when used repeatedly) 
% Output 
% -------
% c       circulant convolution of a and b 
%
% Algorithm 
% ---------
%  direct evaluation, O(n^2) in complexity 
%  see fastCircConv.m 
% 

% -----------------------
% Xiaobai Sun 
% for cps-250 
% Duke CS 
% -----------------------

% ------------------------------------------------------

  n = length(a); 
  c = zeros(n,1); 

  for i = 1:n 
    c(i) = sum( a .* b ) ; 
    a = a( [n,1:n-1] ); 
  end
  
 return 
