# HG changeset patch # User Chris Cannam # Date 1398866790 -3600 # Node ID 7664a93c06dad3ea3b26284aa4951869c0d6a1e6 # Parent 5d1f276f82e52ee87a18d672968b285d208cb47e Reconstruction now appears to be (roughly!) correct in the yeti code diff -r 5d1f276f82e5 -r 7664a93c06da yeti/icqt.yeti --- 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);