Mercurial > hg > may
changeset 368:b11897bf9e71
Just change some numbers so as to make the difference between IR and signal more obvious in the code
author | Chris Cannam |
---|---|
date | Fri, 12 Jul 2013 17:24:21 +0100 |
parents | 9afd71c8aff5 |
children | 8c46a78594ee |
files | may/stream/filter.yeti may/stream/test/test_filter.yeti |
diffstat | 2 files changed, 10 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/may/stream/filter.yeti Fri Jul 12 17:17:53 2013 +0100 +++ b/may/stream/filter.yeti Fri Jul 12 17:24:21 2013 +0100 @@ -496,7 +496,6 @@ (map do c: mat.getColumn (c*frac) m done [0..obtained-1]))) }; -//!!! test decimated factor s = //!!! factor must be an integer [how to enforce this??] if factor == 1 then s else
--- a/may/stream/test/test_filter.yeti Fri Jul 12 17:17:53 2013 +0100 +++ b/may/stream/test/test_filter.yeti Fri Jul 12 17:24:21 2013 +0100 @@ -7,9 +7,9 @@ syn = load may.stream.syntheticstream; filt = load may.stream.filter; -//pl = load may.plot;//!!! +pl = load may.plot;//!!! -pl = { plot things = true; }; +//pl = { plot things = true; }; { compare, compareUsing } = load may.test.test; @@ -598,23 +598,23 @@ fast = not (opts == [ Fast false ]); ir = mat.newRowVector (vec.fromList [1,2,3,4,5]); signal = maybeDuration 3 - (syn.precalculatedMono 2 (vec.fromList [1,2,3])); + (syn.precalculatedMono 2 (vec.fromList [10,20,30])); c = filt.convolvedWith opts ir signal; compare c.position 0 and compare c.channels 1 and compare c.sampleRate 2 and (fast or compare c.available (maybeKnown 7)) and compareClose (map vec.list (mat.asRows (c.read 3))) - [[ 1*1, - 2*1 + 1*2, - 3*1 + 2*2 + 1*3 ]] and + [[ 10*1, + 20*1 + 10*2, + 30*1 + 20*2 + 10*3 ]] and (fast or compare c.available (Known 4)) and compare c.finished? false and compareClose (map vec.list (mat.asRows (c.read 4))) - [[ 3*2 + 2*3 + 1*4, - 3*3 + 2*4 + 1*5, - 3*4 + 2*5, - 3*5 ]] and + [[ 30*2 + 20*3 + 10*4, + 30*3 + 20*4 + 10*5, + 30*4 + 20*5, + 30*5 ]] and (fast or (compare c.available (Known 0) and compare c.finished? true)) and ( c.close (); true )