diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /2048/CH10/EX10.3 | |
download | Scilab-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/CH10/EX10.3')
-rwxr-xr-x | 2048/CH10/EX10.3/imcsplit.sci | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/2048/CH10/EX10.3/imcsplit.sci b/2048/CH10/EX10.3/imcsplit.sci new file mode 100755 index 000000000..59e6ef95f --- /dev/null +++ b/2048/CH10/EX10.3/imcsplit.sci @@ -0,0 +1,37 @@ +// Splitting a polynomial B(z)
+// 10.3
+// Splits a polynomial B into good, nonminimum with
+// positive real & with negative real parts.
+// All are returned in polynomial form.
+// Gain is returned in Kp and delay in k.
+
+function [Kp,k,Bg,Bnmp,Bm] = imcsplit(B,polynomial)
+k = 0;
+Kp = 1;
+if(polynomial)
+ rts = roots(B);
+ Kp = sum(B)/sum(coeff(poly(rts,'z')));
+else
+ rts = B;
+end
+Bg = 1; Bnmp = 1; Bm = 1;
+for i = 1:length(rts),
+ rt = rts(i);
+ if rt == 0,
+ k = k+1;
+ elseif (abs(rt)<1 & real(rt)>=0)
+ Bg = convol(Bg,[1 -rt]);
+ elseif (abs(rt)>=1 & real(rt)>=0)
+ Bnmp = convol(Bnmp,[1 -rt]);
+ else
+ Bm = convol(Bm,[1 -rt]);
+ end
+end
+
+
+
+
+
+
+
+
|