Mercurial > hg > ishara
annotate dsp/rot45.m @ 36:9e7be347b3a0
Renamed sequence classes to avoid clashes with seq methods;
Fixed default slicing dimension while retaining behaviour of window.m;
Updated use of sequences in dsp/synth.
author | samer |
---|---|
date | Thu, 24 Jan 2013 14:51:23 +0000 |
parents | db7f4afd27c5 |
children |
rev | line source |
---|---|
samer@4 | 1 function B = rot45(A) |
samer@4 | 2 % rot45 - rotate square array by 45 degrees |
samer@4 | 3 % |
samer@4 | 4 % rot45 :: [[N,N]] -> [[N,N]]. |
samer@4 | 5 % |
samer@4 | 6 % Array is SUBSAMPLED, so, you should pre-filter to avoid aliasing. |
samer@4 | 7 % Result is padded with zeros in the corners. |
samer@4 | 8 |
samer@4 | 9 n = length(A); |
samer@4 | 10 |
samer@4 | 11 B = diag(A,0)'; |
samer@4 | 12 pad = [0]; |
samer@4 | 13 |
samer@4 | 14 for k=2:2:n-1 |
samer@4 | 15 B = [ pad diag(A,k)' pad; B; pad diag(A,-k)' pad]; |
samer@4 | 16 pad = [pad 0]; |
samer@4 | 17 end |