view yetilab/signal/test/test_signal.yeti @ 178:032c4986b6b0

Implement and test matrix concat
author Chris Cannam
date Thu, 02 May 2013 21:58:58 +0100
parents e16e42c55a20
children
line wrap: on
line source
module yetilab.signal.test.test_signal;

{ acf, acfNormalised, acfUnityNormalised } = load yetilab.signal.autocorrelation;

{ compare } = load yetilab.test.test;

[

"unnormalised": \(
    compare (acf 12 (array [1,0,0, 1,0,0, 1,0,0, 1,0,0]))
        [4,0,0, 3,0,0, 2,0,0, 1,0,0 ];
),

"normalised": \(
    compare (acfNormalised 9 (array [1,0,0, 1,0,0, 1,0,0, 1,0,0]))
        [4/12,0,0, 3/9,0,0, 2/6,0,0 ];
),

"normalisedUnity": \(
    compare (acfUnityNormalised 9 (array [1,0,0, 1,0,0, 1,0,0, 1,0,0]))
        [1,0,0, 1,0,0, 1,0,0 ];
),

] is hash<string, () -> boolean>;