diff options
Diffstat (limited to '2048/DEPENDENCIES/polyno.sci')
-rwxr-xr-x | 2048/DEPENDENCIES/polyno.sci | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/2048/DEPENDENCIES/polyno.sci b/2048/DEPENDENCIES/polyno.sci new file mode 100755 index 000000000..e54960cdb --- /dev/null +++ b/2048/DEPENDENCIES/polyno.sci @@ -0,0 +1,30 @@ +// Updated(1-8-07)
+// Operations:
+// Polynomial definition
+// Flipping of coefficients
+// Variables ------- passed as input argument (either 's' or 'z')
+// Both num and den are used mostly used in scicos files,
+// to get rid of negative powers of z
+
+// Polynomials with powers of s need to
+// be flipped only
+
+function [polynu,polyde] = polyno(zc,a)
+zc = clean(zc);
+polynu = poly(zc(length(zc):-1:1),a,'coeff');
+ if a == 'z'
+ polyde = %z^(length(zc) - 1);
+ else
+ polyde = 1;
+ end
+
+// Scicos(4.1) Filter block shouldn't have constant/constant
+ if type(polynu)==1 & type(polyde)==1
+ if a == 'z'
+ polynu = %z; polyde = %z;
+ else
+ polynu = %s; polyde = %s;
+ end;
+ end;
+
+endfunction
|