summaryrefslogtreecommitdiff
path: root/2048/DEPENDENCIES/gmv.sci
blob: 1e3ee068c4d9dae46cb33a4472cc920618978f0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// General minimum variance controller design, as given by Eq. 11.66 on page 421 and Eq. 11.70 on page 422.
// 11.12

// function [Sc,dSc,Rc,dRc] = gmv(A,dA,B,dB,C,dC,k,rho,int)
// implements the generalized minimum variance controller
// if int>=1, integrated noise is assumed; otherwise,
// it is not integrated noise

function [Sc,dSc,R,dR] = gmv(A,dA,B,dB,C,dC,k,rho,int1)
zk = zeros(1,k+1); zk(k+1) = 1;
if int1>=1, [A,dA] = polmul([1 -1],1,A,dA); end
[Fk,dFk,Ek,dEk] = xdync(zk,k,A,dA,C,dC);
[Gk,dGk] = polmul(Ek,dEk,B,dB);
alpha0 = Gk(1)/C(1); 
Sc = alpha0 * Fk; dSc = dFk; 
[R,dR] = poladd(alpha0*Gk,dGk,rho*C,dC);
endfunction;