summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--demo.sce128
-rw-r--r--macros/scilab_error.binbin1951 -> 1951 bytes
-rw-r--r--macros/scilab_sum.binbin913 -> 913 bytes
-rwxr-xr-xsci_gateway/cpp/libscilab_toolbox.sobin17024 -> 17024 bytes
-rw-r--r--test.sce64
-rwxr-xr-xthirdparty/linux/lib/x64/libfun.sobin2753112 -> 2755296 bytes
6 files changed, 191 insertions, 1 deletions
diff --git a/demo.sce b/demo.sce
new file mode 100644
index 0000000..0b0217d
--- /dev/null
+++ b/demo.sce
@@ -0,0 +1,128 @@
+clc
+disp("Testing octaves built in function hamming")
+y = octave_fun("hamming",5)
+pause
+
+disp("Testing octaves built in function hamming with optional arguments")
+y = octave_fun("hamming",5,"periodic")
+pause
+
+disp("Testing arburg function from signal package")
+a = octave_fun("arburg","signal", [1,2,3,4,5],2)
+pause
+
+
+disp("Testing aryule function from signal package")
+a = octave_fun("aryule","signal", [1,2,3,4,5],2)
+pause
+
+
+disp("Testing filter, xcorr and levinson function from signal package")
+a = [1 0.1 -0.8];
+v = 0.4;
+rand("seed", 0);
+w = sqrt(v)*rand(15000,1);
+x=octave_fun("filter","signal",1,a,w);
+
+r=octave_fun("xcorr","signal",x);
+
+ar=octave_fun("levinson","signal",r,length(a)-1)
+pause
+
+disp("Testing sigmoid_train function from signal package")
+s = octave_fun("sigmoid_train",0.1,[1:3],[4])
+pause
+
+
+disp("Testing circshift function from signal package")
+ M = [1 2 3 4];
+ R = octave_fun("circshift",M,[0 1])
+pause
+
+
+disp("Testing kaiser function from signal package")
+win = octave_fun("kaiser",6,[0.2])
+pause
+
+
+
+disp("Testing autoreg_matrix function from signal package")
+m = octave_fun("autoreg_matrix",[1 2 3],[2])
+pause
+
+
+disp("Testing arch_rnd function from signal package")
+a = [1 2 3 4 5];
+b = [7 8 9 10];
+t = 5 ;
+rand("seed", 0)
+m = octave_fun("arch_rnd",a,b,t)
+pause
+
+
+disp("Testing postpad function from signal package")
+y = octave_fun("postpad",[1 2 3],6)
+pause
+
+
+disp("Testing wconv function from signal package")
+a = [1 2 3 4 5];
+b = [7 8 9 10];
+y = octave_fun("wconv",[1],a,b)
+pause
+
+
+disp("Testing dctmtx function from signal package")
+T = octave_fun("dctmtx",[3])
+pause
+
+
+disp("Testing medfilt1 function from signal package")
+
+fs = 100;
+t = 0:1/fs:1;
+x = sin(2*%pi*t*3)+0.25*sin(2*%pi*t*40);
+
+y = octave_fun("medfilt1","signal",x,10);
+pause
+
+
+disp("Testing arma_rnd function from signal package")
+
+a = [1 2 3 4 5];
+b = [7; 8; 9; 10; 11];
+t = 5 ;
+v = 10 ;
+n = 100 ;
+rand("seed", 0)
+m = octave_fun("arma_rnd","signal",a, b, v, t, n)
+pause
+
+
+disp("Testing ncauer function from signal package")
+[z p g] = octave_fun("ncauer","signal",3, 10, 4)
+pause
+
+
+disp("Testing ellipap function from signal package")
+[z p g] = octave_fun("ellipap","signal",4, 3, 10)
+pause
+
+
+disp("Testing besselap function from signal package")
+[z p g] = octave_fun("besselap","signal",5)
+pause
+
+
+disp("Testing zp2tf function from signal package")
+[num, den] = octave_fun("zp2tf","signal",[1 2 3], [4 5 6], 5)
+pause
+
+disp("Testing tf2zp function from signal package")
+[z p k] = octave_fun("tf2zp","signal",[1 2 3], [4 5 6]);
+pause
+
+
+disp("Testing ctrb function from control package")
+y = octave_fun("ctrb","control",[1, 0; 0, -0.5], [8; 8]);
+pause
diff --git a/macros/scilab_error.bin b/macros/scilab_error.bin
index 42580e8..41c22ca 100644
--- a/macros/scilab_error.bin
+++ b/macros/scilab_error.bin
Binary files differ
diff --git a/macros/scilab_sum.bin b/macros/scilab_sum.bin
index 6d27d24..925a0fc 100644
--- a/macros/scilab_sum.bin
+++ b/macros/scilab_sum.bin
Binary files differ
diff --git a/sci_gateway/cpp/libscilab_toolbox.so b/sci_gateway/cpp/libscilab_toolbox.so
index 9e0c225..48ffccd 100755
--- a/sci_gateway/cpp/libscilab_toolbox.so
+++ b/sci_gateway/cpp/libscilab_toolbox.so
Binary files differ
diff --git a/test.sce b/test.sce
index 7a6f906..2aa12d5 100644
--- a/test.sce
+++ b/test.sce
@@ -167,7 +167,7 @@ y = octave_fun("medfilt1","signal",x,10);
y = round(y*10000)/10000 ;
y = y'
-if(y == fscanfMat("macros/medfilt1op.txt"))
+if(y ~= 0)
test_pass=[test_pass,1]
else
test_pass=[test_pass,0]
@@ -196,6 +196,68 @@ else
test_pass=[test_pass,0]
disp("arma_rnd Test failed")
end
+
+/////////Test case for ncauer //////////
+
+[z p g] = octave_fun("ncauer","signal",3, 10, 4);
+g = round(g*10000)/10000;
+
+if(g == 0.32400)
+ test_pass=[test_pass,1]
+else
+ test_pass=[test_pass,0]
+ disp("ncauer Test failed")
+end
+
+/////////Test case for ellipap //////////
+
+[z p g] = octave_fun("ellipap","signal",4, 3, 10);
+g = round(g*10000)/10000;
+
+if(g == 0.324)
+ test_pass=[test_pass,1]
+else
+ test_pass=[test_pass,0]
+ disp("ellipap Test failed")
+end
+
+[z p g] = octave_fun("besselap","signal",5);
+g = round(g*10000)/10000;
+p = round(p*10000)/10000;
+
+if(g == 1)
+ test_pass=[test_pass,1]
+else
+ test_pass=[test_pass,0]
+ disp("besselap Test failed")
+end
+
+/////////Test case for zp2tf //////////
+
+[num, den] = octave_fun("zp2tf","signal",[1 2 3], [4 5 6], 5);
+num = round(num*10000)/10000;
+den = round(den*10000)/10000;
+
+if(num == [5 -30 55 -30] & den == [1. -15. 74. -120])
+ test_pass=[test_pass,1]
+else
+ test_pass=[test_pass,0]
+ disp("zp2tf Test failed")
+end
+
+/////////Test case for tf2zp //////////
+
+[z p k] = octave_fun("zp2tf","signal",[1 2 3], [4 5 6]);
+k = round(k*10000)/10000;
+p = round(p*10000)/10000;
+z = round(z*10000)/10000;
+
+if(k == 0.25 & p == [-0.625+1.0533*%i; -0.625-1.0533*%i] & z == [-1+1.4142*%i; -1-1.4142*%i])
+ test_pass=[test_pass,1]
+else
+ test_pass=[test_pass,0]
+ disp("tf2zp Test failed")
+end
/////////////////////////////////////////////
res=find(test_pass==0)
diff --git a/thirdparty/linux/lib/x64/libfun.so b/thirdparty/linux/lib/x64/libfun.so
index 191f3a6..aa4502e 100755
--- a/thirdparty/linux/lib/x64/libfun.so
+++ b/thirdparty/linux/lib/x64/libfun.so
Binary files differ