Mercurial > hg > constant-q-cpp
changeset 86:7664a93c06da
Reconstruction now appears to be (roughly!) correct in the yeti code
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Wed, 30 Apr 2014 15:06:30 +0100 |
parents | 5d1f276f82e5 |
children | 96a4c8d32995 |
files | yeti/icqt.yeti |
diffstat | 1 files changed, 9 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/yeti/icqt.yeti Wed Apr 30 13:32:48 2014 +0100 +++ b/yeti/icqt.yeti Wed Apr 30 15:06:30 2014 +0100 @@ -38,6 +38,7 @@ vec = load may.vector; resamp = load may.stream.resample; manip = load may.stream.manipulate; +mat = load may.matrix; icqt cq = (kdata = cq.kernel; @@ -65,7 +66,8 @@ // values for that octave only) decomposeOctaves mat = array (map do oct: - octMat = cm.rowSlice mat (bpo * oct) (bpo * (oct + 1)); + inverted = cm.fromRows (reverse (cm.asRows mat)); + octMat = cm.rowSlice inverted (bpo * oct) (bpo * (oct + 1)); gap = (mm.pow 2 oct) - 1; pickFrom cols = case cols of @@ -92,16 +94,17 @@ esac; flattenAux (array (map \[] [0..octaves-1])) decomposed); - // given a list of columns, pile up each sequence of atomsPerFrame - // columns into a single tall column and return the resulting list - // of tall columns + // given a list of columns, deinterleave and pile up each sequence + // of atomsPerFrame columns into a single tall column and return + // the resulting list of tall columns pile cols = (pileAux acc cols = if (length cols) >= atomsPerFrame then atoms = take atomsPerFrame cols; - pileAux (acc ++ [concat atoms]) (drop atomsPerFrame cols); + juggled = concat (reverse (cm.asRows (cm.fromColumns atoms))); + pileAux (juggled :: acc) (drop atomsPerFrame cols); else - acc + reverse acc fi; pileAux [] cols);