c3d07b4e608e9bfe1185dbcfd56f6a39637a43e4
[scilab.git] / scilab / modules / signal_processing / tests / unit_tests / syredi.dia.ref
1 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2 // Copyright (C) 2011 - DIGITEO
3 //
4 // Copyright (C) 2012 - 2016 - Scilab Enterprises
5 //
6 // This file is hereby licensed under the terms of the GNU GPL v2.0,
7 // pursuant to article 5.3.4 of the CeCILL v.2.1.
8 // This file was originally licensed under the terms of the CeCILL v2.1,
9 // and continues to be available under such terms.
10 // For more information, see the COPYING file which you should have received
11 // along with this program.
12 test_path = SCI + "/modules/signal_processing/tests/unit_tests/";
13 [fact,b2,b1,b0,c1,c0,zzeros,zpoles]=syredi(1,4,[2*%pi/10,4*%pi/10,0,0],0.02,0.001);
14 ref_fact = 0.005976;
15 assert_checkfalse(norm(fact-ref_fact) > 0.0000037);
16 assert_checkequal(b2, [1 1 1]);
17 assert_checkequal(size(b1), [1 3]);
18 assert_checkequal(b1(3), 1);
19 assert_checkequal(b0, [1 1 0]);
20 assert_checkequal(size(c1), [1 3]);
21 assert_checkequal(size(c0), [1 3]);
22 assert_checkequal(c0(3),  0);
23 assert_checkequal(size(zzeros), [1 5]);
24 assert_checkequal(size(zpoles), [1 5]);
25 load(test_path+"syredi.h5");
26 [fact1, b21, b11, b01, c11, c01, zzeros1, zpoles1] = syredi(1, 4, [1, 2, 0, 0], 0.02, 0.001);
27 assert_checkequal(fact1, fact1_ref);
28 assert_checkequal(b21, b21_ref);
29 assert_checkalmostequal(b11, b11_ref);
30 assert_checkequal(b01, b01_ref);
31 assert_checkalmostequal(c11, c11_ref);
32 assert_checkalmostequal(c01, c01_ref, [], %eps);
33 assert_checkalmostequal(zzeros1, zzeros1_ref);
34 assert_checkalmostequal(zpoles1, zpoles1_ref);
35 [fact2, b22, b12, b02, c12, c02, zzeros2, zpoles2] = syredi(3, 4, [1, 2, 3, 3.01], 0.1, 0.001);
36 assert_checkalmostequal(fact2, fact2_ref);
37 assert_checkequal(b22, b22_ref);
38 assert_checkalmostequal(b12, b12_ref);
39 assert_checkequal(b02, b02_ref);
40 assert_checkalmostequal(c12, c12_ref);
41 assert_checkalmostequal(c02, c02_ref);
42 assert_checkalmostequal(zzeros2, zzeros2_ref);
43 assert_checkalmostequal(zpoles2, zpoles2_ref);