Mercurial > hg > ishara
annotate general/numerical/matrix/circulant.m @ 61:eff6bddf82e3 tip
Finally implemented perceptual brightness thing.
author | samer |
---|---|
date | Sun, 11 Oct 2015 10:20:42 +0100 |
parents | db7f4afd27c5 |
children |
rev | line source |
---|---|
samer@4 | 1 function t=circulant(c) |
samer@4 | 2 % circulant - Construct circulant matrix from first column |
samer@4 | 3 % |
samer@4 | 4 % circulant :: [[N]] -> [[N,N]]. |
samer@4 | 5 |
samer@4 | 6 m = length(c); |
samer@4 | 7 c=c(:); |
samer@4 | 8 |
samer@4 | 9 x = [c(2:m) ; c(:)]; % build vector of user data |
samer@4 | 10 cidx = (0:m-1)'; |
samer@4 | 11 ridx = m:-1:1; |
samer@4 | 12 t = cidx(:,ones(m,1)) + ridx(ones(m,1),:); % Toeplitz subscripts |
samer@4 | 13 t(:) = x(t); % actual data |
samer@4 | 14 |
samer@4 | 15 |