add a unit test for lev based on the commit 77c83f46f1fad363ce0225ed316c6714acdf52e5 41/11041/2
Sylvestre Ledru [Wed, 27 Mar 2013 10:10:41 +0000 (11:10 +0100)]
Change-Id: I426768bb6614a074c352396b57f1209fddfec843

scilab/modules/signal_processing/tests/unit_tests/lev.dia.ref [new file with mode: 0644]
scilab/modules/signal_processing/tests/unit_tests/lev.tst [new file with mode: 0644]

diff --git a/scilab/modules/signal_processing/tests/unit_tests/lev.dia.ref b/scilab/modules/signal_processing/tests/unit_tests/lev.dia.ref
new file mode 100644 (file)
index 0000000..8780c06
--- /dev/null
@@ -0,0 +1,14 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Charlotte Hecquet
+// Copyright (C) 2013 - Scilab Enterprises - Sylvestre Ledru
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+b=1; //numerator
+a=[1 -0.7 0.8]; //denominator
+x=[1 zeros(1,99)]; //input=impulse
+data=filter(b,a,x); //real data
+a2=lev(data); //modelized data
+a2_ref=[-2.95375652176204362;0.85443608696722761;1.16338825311255967;-0.5843638139231808;-1.29904413848756084;0.2827999960599864;1.36469413757280944;0.03400400016235194;-1.35680035182069414;-0.34897551040648700;1.27578817976193548;0.64514062356548996;-1.12602339214832625;-0.90653891102847028;0.91557685923087617;1.11908353906414315;-0.65578960909082540;-1.27132041260303486;0.36066165616501500;1.35504543992694138;-0.04609753618187262;-1.36574665368330295;-0.27095079413754847;1.30284736218693986;0.57339750321671712;-1.16973722751155518;-0.84494364531757027;0.97358959556271740;1.07095551571593028;-0.72497492227130311;-1.23925326552891701;0.43729112848768537;1.34076727749932667;-0.12604158192534731;-1.37002693044609769;-0.19200038407123965;1.32545541271529554;0.49969539059447443;-1.20945469704137598;-0.78046165955049063;1.02827609750283466;1.01916861075655008;-0.79168338429134533;-1.2029522535385402;0.51242661114848276;1.3219084311265532;-0.20555501106545992;-1.36962655869526673;-0.11239401148886496;1.34353509174246932;0.42428608635778209;-1.2450401074093944;-0.7133132541493183;1.07944953055333803;0.9638997523135744;-0.85568708805196592;-1.16254139775417586;0.58581140643039376;1.29853333138992988;-0.28436616878620091;-1.3645469062867672;-0.03240364874471358;1.35702463068550716;0.34742722372528412;-1.27637188232062804;-0.64372783926421662;1.1269350624915635;0.90533776448550585;-0.91676736716449969;-1.11815876043450668;0.65719479777787038;1.27072183849030163;-0.36220579955695353;-1.3548053276733052;0.04769741991851550;1.36587794301159882;0.26938138828071656;-1.30334297787510689;-0.57194315100185011;1.17057046067835535;0.84368272223090113;-0.97471554301766872;-1.06995597328870229;0.72633290636136172;1.23856896940847472;-0.43880796703439384;-1.34043510461302406;0.12763553203490674;1.37006478169273449;0.19041522085809687;-1.32586124827935214;-0.49820443920874441;1.21020664632028385;0.77914526781893556;-1.02933363771951836;-1.01809771943242855;0.79298952427985636;1.20218457328317552;-2.56955481312445810];
+assert_checkalmostequal(a2, a2_ref);
diff --git a/scilab/modules/signal_processing/tests/unit_tests/lev.tst b/scilab/modules/signal_processing/tests/unit_tests/lev.tst
new file mode 100644 (file)
index 0000000..23d2462
--- /dev/null
@@ -0,0 +1,16 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Charlotte Hecquet
+// Copyright (C) 2013 - Scilab Enterprises - Sylvestre Ledru
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+b=1; //numerator
+a=[1 -0.7 0.8]; //denominator
+x=[1 zeros(1,99)]; //input=impulse
+data=filter(b,a,x); //real data
+a2=lev(data); //modelized data
+a2_ref=[-2.95375652176204362;0.85443608696722761;1.16338825311255967;-0.5843638139231808;-1.29904413848756084;0.2827999960599864;1.36469413757280944;0.03400400016235194;-1.35680035182069414;-0.34897551040648700;1.27578817976193548;0.64514062356548996;-1.12602339214832625;-0.90653891102847028;0.91557685923087617;1.11908353906414315;-0.65578960909082540;-1.27132041260303486;0.36066165616501500;1.35504543992694138;-0.04609753618187262;-1.36574665368330295;-0.27095079413754847;1.30284736218693986;0.57339750321671712;-1.16973722751155518;-0.84494364531757027;0.97358959556271740;1.07095551571593028;-0.72497492227130311;-1.23925326552891701;0.43729112848768537;1.34076727749932667;-0.12604158192534731;-1.37002693044609769;-0.19200038407123965;1.32545541271529554;0.49969539059447443;-1.20945469704137598;-0.78046165955049063;1.02827609750283466;1.01916861075655008;-0.79168338429134533;-1.2029522535385402;0.51242661114848276;1.3219084311265532;-0.20555501106545992;-1.36962655869526673;-0.11239401148886496;1.34353509174246932;0.42428608635778209;-1.2450401074093944;-0.7133132541493183;1.07944953055333803;0.9638997523135744;-0.85568708805196592;-1.16254139775417586;0.58581140643039376;1.29853333138992988;-0.28436616878620091;-1.3645469062867672;-0.03240364874471358;1.35702463068550716;0.34742722372528412;-1.27637188232062804;-0.64372783926421662;1.1269350624915635;0.90533776448550585;-0.91676736716449969;-1.11815876043450668;0.65719479777787038;1.27072183849030163;-0.36220579955695353;-1.3548053276733052;0.04769741991851550;1.36587794301159882;0.26938138828071656;-1.30334297787510689;-0.57194315100185011;1.17057046067835535;0.84368272223090113;-0.97471554301766872;-1.06995597328870229;0.72633290636136172;1.23856896940847472;-0.43880796703439384;-1.34043510461302406;0.12763553203490674;1.37006478169273449;0.19041522085809687;-1.32586124827935214;-0.49820443920874441;1.21020664632028385;0.77914526781893556;-1.02933363771951836;-1.01809771943242855;0.79298952427985636;1.20218457328317552;-2.56955481312445810];
+assert_checkalmostequal(a2, a2_ref);
+