changeset 286:6ed6af2fc794

Further test
author Chris Cannam
date Thu, 30 May 2013 17:47:25 +0100
parents be39f21456a1
children d6811e2949ff
files yetilab/stream/framer.yeti yetilab/stream/test/test_framer.yeti
diffstat 2 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/yetilab/stream/framer.yeti	Thu May 30 17:34:35 2013 +0100
+++ b/yetilab/stream/framer.yeti	Thu May 30 17:47:25 2013 +0100
@@ -114,7 +114,7 @@
     var position = 0;
     w = win.windowFunction (Hann ()) [ Symmetric true ] framesize;
     channels = mat.height (head frames); // so we don't need to keep a head ptr
-    filt.delayedBy (- (framesize - hop))
+    filt.delayedBy (- framesize)
         {
             get position () = position,
             get channels () = channels,
@@ -143,6 +143,7 @@
                    (framesFor count [buffered]);
 //                println "source = \(source)";
                 toReturn = mat.columnSlice source 0 count;
+                position := position + mat.width toReturn;
                 buffered := mat.columnSlice source count (mat.width source);
                 toReturn),
             close = \(),
--- a/yetilab/stream/test/test_framer.yeti	Thu May 30 17:34:35 2013 +0100
+++ b/yetilab/stream/test/test_framer.yeti	Thu May 30 17:47:25 2013 +0100
@@ -109,7 +109,7 @@
           [3,4,5], [4,5,6], [5,6,0], [6,0,0] ];
 ),
 
-"overlapAdd": \(
+"overlapAdd-3.1": \(
     compareUsing (mat.equal)
        (fr.overlapAdd 1 3 1 [ mat.newRowVector (vec.fromList [ 1,2,3 ]),
                               mat.newRowVector (vec.fromList [   4,5,6 ]),
@@ -117,6 +117,14 @@
        (mat.newRowVector (vec.fromList [ 1,6,15,14,9 ]))
 ),
 
+"overlapAdd-3.2": \(
+    compareUsing (mat.equal)
+       (fr.overlapAdd 1 3 2 [ mat.newRowVector (vec.fromList [ 1,2,3 ]),
+                              mat.newRowVector (vec.fromList [     4,5,6 ]),
+                              mat.newRowVector (vec.fromList [         7,8,9 ]) ])
+       (mat.newRowVector (vec.fromList [ 1,2,7,5,13,8,9 ]))
+),
+
 ] is hash<string, () -> boolean>;