1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
// Copyright (C) INRIA - 1989 - G. Le Vey
// Copyright (C) Scilab Enterprises - 2011 - Calixte DENIZET
// Copyright (C) DIGITEO - 2012 - Allan CORNET
//
// This file must be used under the terms of the CeCILL.
// This source file is licensed as described in the file COPYING, which
// you should have received as part of this distribution. The terms
// are also available at
// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
function hk = hank(m, n, seq_cov)
//hk = hank(m,n,cov)
//this macro builds the hankel matrix of size (m*d,n*d)
//from the covariance sequence of a vector process
// m : number of bloc-rows
// n : number of bloc-columns
// seq_cov: sequence of covariances; it must be given as :[R0 R1 R2...Rk]
// hk : computed hankel matrix
//
[lhs, rhs] = argn(0);
if rhs <> 3 then
error(msprintf(gettext("%s: Wrong number of input argument(s): %d expected.\n"), "hank", 3));
end
if and(type(m) <> [1 8]) then
error(msprintf(gettext("%s: Wrong type for input argument #%d: A positive integer expected.\n"), "hank", 1));
end
if (size(m, "*") <> 1) then
error(msprintf(gettext("%s: Wrong size for input argument #%d: A positive integer expected.\n"), "hank", 1));
end
if m <= 0 | m <> fix(m) then
error(msprintf(gettext("%s: Wrong value for input argument #%d: A positive integer expected.\n"), "hank", 1));
end
if and(type(n) <> [1 8]) then
error(msprintf(gettext("%s: Wrong type for input argument #%d: A positive integer expected.\n"), "hank", 2));
end
if (size(n, "*") <> 1) then
error(msprintf(gettext("%s: Wrong size for input argument #%d: A positive integer expected.\n"), "hank", 2));
end
if n <= 0 | n <> fix(n) then
error(msprintf(gettext("%s: Wrong value for input argument #%d: A positive integer expected.\n"), "hank", 2));
end
t = type(seq_cov);
if (t > 10) | (t <= 0) then
error(msprintf(gettext("%s: Wrong values for input argument #%d: Unsupported ''%s'' type.\n"), "hank", 3, typeof(t)));
end
[r, c] = size(seq_cov);
mr = m * r;
nr = n * r;
if (mr + nr - r > c) then
error(msprintf(gettext("%s: Wrong size for input arguments: Incompatible sizes.\n"), "hank"));
end
index = ones(1, nr) .*. (1:r:mr)' + (0:(nr - 1)) .*. ones(m, 1);
hk = matrix(seq_cov(:, index), mr, -1);
endfunction
|