summaryrefslogtreecommitdiff
path: root/2048/CH11/EX11.7
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /2048/CH11/EX11.7
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '2048/CH11/EX11.7')
-rwxr-xr-x2048/CH11/EX11.7/tfvar.sci16
1 files changed, 16 insertions, 0 deletions
diff --git a/2048/CH11/EX11.7/tfvar.sci b/2048/CH11/EX11.7/tfvar.sci
new file mode 100755
index 000000000..424624d9f
--- /dev/null
+++ b/2048/CH11/EX11.7/tfvar.sci
@@ -0,0 +1,16 @@
+// Cancellation of common factors and determination of covariance
+// 11.7
+
+// function [N,dN,D,dD,yvar] = tfvar(N,dN,D,dD)
+// N and D polynomials in z^{-1} form; discrete case
+
+function [N,dN,D,dD,yvar] = tfvar(N,dN,D,dD)
+
+[N,dN,D,dD] = l2r(N,dN,D,dD);
+N = N/D(1); D = D/D(1);
+LN = length(N); LD = length(D);
+D1 = D;
+if LD<LN, D1 = [D zeros(1,LN-LD)]; dD1 = dD+LN-LD; end
+H = tf(N,D1,1);//TS=1 (sampling time) has been taken constant in tfvar
+yvar = covar_m(H,1);
+endfunction;