samer@4: function t=circulant(c) samer@4: % circulant - Construct circulant matrix from first column samer@4: % samer@4: % circulant :: [[N]] -> [[N,N]]. samer@4: samer@4: m = length(c); samer@4: c=c(:); samer@4: samer@4: x = [c(2:m) ; c(:)]; % build vector of user data samer@4: cidx = (0:m-1)'; samer@4: ridx = m:-1:1; samer@4: t = cidx(:,ones(m,1)) + ridx(ones(m,1),:); % Toeplitz subscripts samer@4: t(:) = x(t); % actual data samer@4: samer@4: