changeset 14:26d61c9f1f40

Reshape result vectors
author Chris Cannam <c.cannam@qmul.ac.uk>
date Mon, 28 Oct 2013 18:23:43 +0000
parents e2372a642b45
children 7f9a9af75d91
files yeti/cqt.yeti
diffstat 1 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/yeti/cqt.yeti	Mon Oct 28 17:16:55 2013 +0000
+++ b/yeti/cqt.yeti	Mon Oct 28 18:23:43 2013 +0000
@@ -86,7 +86,21 @@
     // matrix (the atoms) then need to be spaced by 2^(octave-1)
     // relative to those from the highest octave.
 
-    cqblocks
+    // Probably a better way to do this somehow... Reshape each row
+    // vector into the appropriate rectangular matrix
+    map2 do octlist octave:
+        map do rv:
+            cv = cm.getColumn 0 rv;
+            reals = cplx.reals cv;
+            imags = cplx.imaginaries cv;
+            reshape v = mat.newMatrix (ColumnMajor ())
+               (map do n:
+                    vec.slice v (n * kdata.atomsPerFrame) ((n+1) * kdata.atomsPerFrame) 
+                    done [0..kdata.binsPerOctave-1]);
+            cm.complex (reshape reals) (reshape imags);
+        done octlist
+    done cqblocks [0..octaves-1];
+
     );
 
 testStream = manipulate.withDuration 96000 (syn.sinusoid 48000 500);