diff options
43 files changed, 468 insertions, 48 deletions
diff --git a/2.3-1/demos/FilterResponse.dem.sce b/2.3-1/demos/FilterResponse.dem.sce new file mode 100644 index 00000000..7104836d --- /dev/null +++ b/2.3-1/demos/FilterResponse.dem.sce @@ -0,0 +1,18 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +//This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Ankit Raj +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in +// + + + +lines(0); + +global SCI2CHOME + +scilab2c(SCI2CHOME+"/tests/unit_tests/test_filterResponse/scilabcode/main.sci",TMPDIR,SCI2CHOME+"/tests/unit_tests/test_filterResponse/scilabcode"); diff --git a/2.3-1/demos/Jacobi.dem.sce b/2.3-1/demos/Jacobi.dem.sce new file mode 100644 index 00000000..0b1618c4 --- /dev/null +++ b/2.3-1/demos/Jacobi.dem.sce @@ -0,0 +1,18 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Ankit Raj +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + + + +lines(0); + +global SCI2CHOME + +scilab2c(SCI2CHOME+"/tests/unit_tests/test_jacobi/scilabcode/main.sci",TMPDIR,SCI2CHOME+"/tests/unit_tests/test_jacobi/scilabcode"); + diff --git a/2.3-1/demos/analogFilter.dem.sce b/2.3-1/demos/analogFilter.dem.sce new file mode 100644 index 00000000..674c9543 --- /dev/null +++ b/2.3-1/demos/analogFilter.dem.sce @@ -0,0 +1,18 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +//This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Ankit Raj +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in +// + + + +lines(0); + +global SCI2CHOME + +scilab2c(SCI2CHOME+"/tests/unit_tests/test_analogFilters/scilabcode/main.sci",TMPDIR,SCI2CHOME+"/tests/unit_tests/test_analogFilters/scilabcode"); diff --git a/2.3-1/demos/scilab2c.dem.gateway.sce b/2.3-1/demos/scilab2c.dem.gateway.sce index 71372e25..011e4745 100644 --- a/2.3-1/demos/scilab2c.dem.gateway.sce +++ b/2.3-1/demos/scilab2c.dem.gateway.sce @@ -16,6 +16,10 @@ subdemolist = ["Trigonometric Identity" , "TrigonometricIdentity.dem.sce"; "Linear Regression" , "LinearRegression.dem.sce"; "Symbols", "Symbols.dem.sce"; "High Pass Filter", "Filter.dem.sce"; + "Jacobi functions","Jacobi.dem.sce"; + "Analog Filters","analogFilter.dem.sce"; + "String Functions","string.dem.sce"; + "Filter Responses","FilterResponse.dem.sce"; ]; -subdemolist(:,2) = demopath + subdemolist(:,2);
\ No newline at end of file +subdemolist(:,2) = demopath + subdemolist(:,2); diff --git a/2.3-1/demos/string.dem.sce b/2.3-1/demos/string.dem.sce new file mode 100644 index 00000000..db90905e --- /dev/null +++ b/2.3-1/demos/string.dem.sce @@ -0,0 +1,16 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +//This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Ankit Raj +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in +// + +lines(0); + +global SCI2CHOME + +scilab2c(SCI2CHOME+"/tests/unit_tests/test_string/scilabcode/main.sci",TMPDIR,SCI2CHOME+"/tests/unit_tests/test_string/scilabcode"); diff --git a/2.3-1/etc/scilab2c.start b/2.3-1/etc/scilab2c.start index 2f364c68..793b0a7b 100644 --- a/2.3-1/etc/scilab2c.start +++ b/2.3-1/etc/scilab2c.start @@ -47,7 +47,7 @@ if or(getscilabmode() == ["NW";"STD"]) then mprintf("\tLoad demos\n"); pathdemos = pathconvert(root_tlbx + "/demos/scilab2c.dem.gateway.sce",%f,%t); -// add_demo(gettext("Scilab2C"),pathdemos); + add_demo(gettext("Scilab2C"),pathdemos); clear pathdemos ; end diff --git a/2.3-1/jar/scilab_en_US_help.jar b/2.3-1/jar/scilab_en_US_help.jar Binary files differindex d8299154..afe0ba2d 100644 --- a/2.3-1/jar/scilab_en_US_help.jar +++ b/2.3-1/jar/scilab_en_US_help.jar diff --git a/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.sci b/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.sci index 3b977bd6..dbdae9d3 100644 --- a/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.sci +++ b/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.sci @@ -70,7 +70,7 @@ else PrintStringInfo('CXX = arm-linux-gnueabihf-g++ ',FileInfo.MakefileFilename,'file','y','y'); PrintStringInfo('CFLAGS = -Wall -pedantic -g -I $(HSRCDIR) -I $(ISRCDIR) -L $(LIBDIR)',FileInfo.MakefileFilename,'file','y','y'); PrintStringInfo('CXXFLAGS = -Wall -pedantic -g -I $(HSRCDIR) -I $(ISRCDIR) -L $(LIBDIR)',FileInfo.MakefileFilename,'file','y','y'); - PrintStringInfo('LDFLAGS = -llapack -lrefblas -lgfortran -lwiringPi -lwiringPiDev -lrt -lpthread',FileInfo.MakefileFilename,'file','y','y'); + PrintStringInfo('LDFLAGS = -llapack -lrefblas -lgfortran -lwiringPi -lwiringPiDev -lrt -lpthread -lRPIwfi',FileInfo.MakefileFilename,'file','y','y'); else PrintStringInfo('CC = gcc',FileInfo.MakefileFilename,'file','y','y'); PrintStringInfo('CXX = g++',FileInfo.MakefileFilename,'file','y','y'); diff --git a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci index 325f4d5b..639fa68a 100644 --- a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci +++ b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci @@ -9715,7 +9715,7 @@ ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls); PrintStringInfo('NIN= 3',ClassFileName,'file','y');
PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
-PrintStringInfo('OUT(1).TP= IN(3).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''d''',ClassFileName,'file','y');
PrintStringInfo('OUT(1).SZ(1)= IN(3).SZ(1)',ClassFileName,'file','y');
PrintStringInfo('OUT(1).SZ(2)= IN(3).SZ(2)',ClassFileName,'file','y');
diff --git a/2.3-1/macros/scilab2c.sci b/2.3-1/macros/scilab2c.sci index 197c88b0..70290d09 100644 --- a/2.3-1/macros/scilab2c.sci +++ b/2.3-1/macros/scilab2c.sci @@ -57,7 +57,7 @@ function scilab2c(varargin) RunMode = "All"; BuildTool = getNativeBuildTool(); Target = "StandAlone" - //Board_name = "uno" + Board_name = "uno" // // scilab2c(UserScilabMainFile, CCodeOutputDir, UserSciFilesPaths, RunMode) // diff --git a/2.3-1/src/c/signalProcessing/%k/dmodka.c b/2.3-1/src/c/signalProcessing/%k/dmodka.c index c0630ec0..8368cb6b 100644 --- a/2.3-1/src/c/signalProcessing/%k/dmodka.c +++ b/2.3-1/src/c/signalProcessing/%k/dmodka.c @@ -1,3 +1,14 @@ +/* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Ankit Raj + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ #include<stdio.h> #include<math.h> #include "modk.h" @@ -10,7 +21,6 @@ double max_calc(double* ptr,int sz) ptr[0]=-1*ptr[0]; } mx=(ptr[0]); - //printf("%lf\n",mx); for(i=1;i<sz;i++) { if(ptr[i]<0) @@ -47,10 +57,7 @@ void dmodka(double* inp,int size,double* oup) c[l]=sqrt(inp[l]); } - int x=0; - //double maxi; - //maxi=max_calc(c,size); - //printf("%lf",maxi); + int x=0; while(max_calc(c,size)>eps) { @@ -88,10 +95,4 @@ void dmodka(double* inp,int size,double* oup) } } -/* -int main() -{ - double m[3]={0.1,0.2,0.3}; - dka(m,3); -} -*/ + diff --git a/2.3-1/src/c/signalProcessing/%sn/dmodsns.c b/2.3-1/src/c/signalProcessing/%sn/dmodsns.c index 06d0a6f0..aae16c19 100644 --- a/2.3-1/src/c/signalProcessing/%sn/dmodsns.c +++ b/2.3-1/src/c/signalProcessing/%sn/dmodsns.c @@ -82,12 +82,4 @@ double dmodsns(double uu, double emmc) } return sn; } -/* -int main() -{ - double u,k; - u=4; - k=0.7; - sn(u,k); -} -*/ + diff --git a/2.3-1/src/c/signalProcessing/ell1mag/dell1maga.c b/2.3-1/src/c/signalProcessing/ell1mag/dell1maga.c index 9af0c8e8..58ef3035 100644 --- a/2.3-1/src/c/signalProcessing/ell1mag/dell1maga.c +++ b/2.3-1/src/c/signalProcessing/ell1mag/dell1maga.c @@ -21,7 +21,7 @@ void dell1maga(double eps,double m1,double* z,int size,double* oup ) int i; for(i=0;i<size;i++) { - s[i]=zmodsns(z[i],m1); + s[i]=dmodsns(z[i],m1); } double un[size]; int j; diff --git a/2.3-1/src/c/signalProcessing/ell1mag/zell1maga.c b/2.3-1/src/c/signalProcessing/ell1mag/zell1maga.c index 6e7a6f93..35b49281 100644 --- a/2.3-1/src/c/signalProcessing/ell1mag/zell1maga.c +++ b/2.3-1/src/c/signalProcessing/ell1mag/zell1maga.c @@ -14,6 +14,9 @@ #include "modsn.h" #include "ell1mag.h" #include "doubleComplex.h" +#include "multiplication.h" +#include "addition.h" +#include "division.h" void zell1maga(double eps,double m1,doubleComplex* z,int size,double* oup ) { @@ -31,9 +34,15 @@ void zell1maga(double eps,double m1,doubleComplex* z,int size,double* oup ) } doubleComplex v; int k; + double ml; + ml=eps*eps; + doubleComplex tp1,tp2,tp3; for(k=0;k<size;k++) { - v=un[k]/(un[k]+(eps*eps*s[k]*s[k])); + tp1=zmuls(s[k],s[k]); + tp2=DoubleComplex(ml,0); + tp3=DoubleComplex(un[k],0); + v=zrdivs(tp3,zadds(tp3,(zmuls(tp2,tp1)))); oup[k]=zreals(v); } } diff --git a/2.3-1/src/c/signalProcessing/ffilt/gffilts.c b/2.3-1/src/c/signalProcessing/ffilt/gffilts.c index 538daf3e..09876d00 100644 --- a/2.3-1/src/c/signalProcessing/ffilt/gffilts.c +++ b/2.3-1/src/c/signalProcessing/ffilt/gffilts.c @@ -80,11 +80,4 @@ void gffilts(char* ft,int size,double N,double fc,double fh,double* oup) oup[id]=1+oup[id]; } } -/* -int main() -{ - string s; - int n; - double fl,fh; -} -*/ + diff --git a/2.3-1/src/c/signalProcessing/fsfirlin/dfsfirlina.c b/2.3-1/src/c/signalProcessing/fsfirlin/dfsfirlina.c index d2079f4d..e44f464e 100644 --- a/2.3-1/src/c/signalProcessing/fsfirlin/dfsfirlina.c +++ b/2.3-1/src/c/signalProcessing/fsfirlin/dfsfirlina.c @@ -11,11 +11,9 @@ */ #include<stdio.h> - #include<math.h> #include "sincd.h" #include "fsfirlin.h" -//#define PI 3.14159265358979 void dfsfirlina(double* hd,int size,double flag,double* hst) { diff --git a/2.3-1/src/c/signalProcessing/sincd/dsincds.c b/2.3-1/src/c/signalProcessing/sincd/dsincds.c index 1475d8de..c9f2f815 100644 --- a/2.3-1/src/c/signalProcessing/sincd/dsincds.c +++ b/2.3-1/src/c/signalProcessing/sincd/dsincds.c @@ -13,7 +13,6 @@ #include<stdio.h> #include<math.h> #include "sincd.h" -//#define PI 3.14159265358979 void dsincds(double n,double flg,double* oup) { double npt=4*n; diff --git a/2.3-1/src/c/signalProcessing/sincd/u8sincds.c b/2.3-1/src/c/signalProcessing/sincd/u8sincds.c index d03f48ae..ff0a2acc 100644 --- a/2.3-1/src/c/signalProcessing/sincd/u8sincds.c +++ b/2.3-1/src/c/signalProcessing/sincd/u8sincds.c @@ -13,12 +13,11 @@ #include<stdio.h> #include<math.h> #include "sincd.h" -#define PI 3.14159265358979 void u8sincds(int n,int flg,double* oup) { double npt=4*n; int sz=4*n; - double pas=PI/npt; + double pas=M_PI/npt; double om[sz+1]; int i; //om[0]=0; @@ -69,7 +68,7 @@ void u8sincds(int n,int flg,double* oup) int a; for(a=0;a<=4*n;a++) { - om[a]=om[a]-(PI/(2*n)); + om[a]=om[a]-(M_PI/(2*n)); } int j,k; for(j=0;j<=4*n;j++) diff --git a/2.3-1/src/c/signalProcessing/zmodsns.c b/2.3-1/src/c/signalProcessing/zmodsns.c new file mode 100644 index 00000000..5f35059f --- /dev/null +++ b/2.3-1/src/c/signalProcessing/zmodsns.c @@ -0,0 +1,161 @@ +/* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Ankit Raj + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + Reference:- Abramowitz, Milton and Stegun, Irene A + Handbook of Mathematical Functions, Dover, 1965 + Chapter 16 (Sections 16.4, 16.13 and 16.15) + Link for FORTRAN code:-http://www.aip.de/groups/soe/local/numres/bookfpdf/f6-11.pdf +*/ + +#include<stdio.h> +#include<math.h> +#include "modsn.h" +#include "doubleComplex.h" +#define CA 0.0003 + +doubleComplex zmodsns(doubleComplex uu,double emmc) +{ + doubleComplex ans; + double uur,uui; + uur=zreals(uu); + uui=zimags(uu); + double sr,cr,dr; + //Performing Elliptic Function operation for the real values + double a1,b1,c1,d1,emc1,u1; + double em1[14],en1[14]; + int i1,ii1,l1,bo1; + emc1=1-emmc; + u1=uur; + if(emc1) + { + bo1=(emc1<0.0); + if(bo1) + { + d1=1.0-emc1; + emc1/=-1.0/d1; + u1*=(d1=sqrt(d1)); + } + a1=1.0; + dr=1.0; + for(i1=1;i1<=13;i1++) + { + l1=i1; + em1[i1]=a1; + en1[i1]=(emc1=sqrt(emc1)); + c1=0.5*(a1+emc1); + if(fabs(a1-emc1)<=CA*a1)break; + emc1*=a1; + a1=c1; + } + u1*=c1; + sr=sin(u1); + cr=cos(u1); + if(sr) + { + a1=cr/sr; + c1*=a1; + for(ii1=l1;ii1>=1;ii1--) + { + b1=em1[ii1]; + a1*=c1; + c1*=dr; + dr=(en1[ii1]+a1)/(b1+a1); + a1=c1/b1; + } + a1=1.0/sqrt(c1*c1+1.0); + sr=(sr>=0.0?a1:-a1); + cr=c1*(sr); + } + if(bo1) + { + a1=dr; + dr=cr; + cr=a1; + sr/=d1; + } + } + else + { + cr=1.0/cosh(u1); + dr=cr; + sr=tanh(u1); + } + //////////////////////////////////////////////////////////////// + double si,ci,di; + //Performing Elleptic Function operation for the imaginary values + double a,b,c,d,emc,u; + double em[14],en[14]; + int i,ii,l,bo; + //double s1,c1,d1; + emc=emmc; + u=uui; + if(emc) + { + bo=(emc<0.0); + if(bo) + { + d=1.0-emc; + emc/=-1.0/d; + u*=(d=sqrt(d)); + } + a=1.0; + di=1.0; + for(i=1;i<=13;i++) + { + l=i; + em[i]=a; + en[i]=(emc=sqrt(emc)); + c=0.5*(a+emc); + if(fabs(a-emc)<=CA*a)break; + emc*=a; + a=c; + } + u*=c; + si=sin(u); + ci=cos(u); + if(si) + { + a=ci/si; + c*=a; + for(ii=l;ii>=1;ii--) + { + b=em[ii]; + a*=c; + c*=di; + di=(en[ii]+a)/(b+a); + a=c/b; + } + a=1.0/sqrt(c*c+1.0); + si=(si>=0.0?a:-a); + ci=c*(si); + } + if(bo) + { + a=di; + di=ci; + ci=a; + si/=d; + } + } + else + { + ci=1.0/cosh(u); + di=ci; + si=tanh(u); + } + ///////////////////////////////////////////////////////// + double delta; + delta=ci*ci + emmc*sr*sr*si*si; + double snir,snii; + snir=(sr*di)/delta; + snii=(cr*dr*si*ci)/delta; + ans=DoubleComplex(snir,snii); + return ans; +} diff --git a/2.3-1/src/c/signalProcessing/zpbutt/dzpbutts.c b/2.3-1/src/c/signalProcessing/zpbutt/dzpbutts.c index 33f22af9..7b9fe9b4 100644 --- a/2.3-1/src/c/signalProcessing/zpbutt/dzpbutts.c +++ b/2.3-1/src/c/signalProcessing/zpbutt/dzpbutts.c @@ -12,6 +12,7 @@ #include<stdio.h> #include<math.h> #include "zpbutt.h" +#include "doubleComplex.h" #define PI 3.14159265 double dzpbutts(double n,double fl,doubleComplex* out) { diff --git a/2.3-1/src/c/string/ascii/gasciia.c b/2.3-1/src/c/string/ascii/gasciia.c index ec11d6e2..5fe95e07 100644 --- a/2.3-1/src/c/string/ascii/gasciia.c +++ b/2.3-1/src/c/string/ascii/gasciia.c @@ -14,12 +14,12 @@ into its ascii equivalent. */ #include "ascii.h" -void gasciia(char *str,int size,int* oup) +void gasciia(char *str,int size,uint8* oup) { int i; for(i=0;i<size;i++) { - *(oup+i)=(int)str[i]; + *(oup+i)=str[i]; } } diff --git a/2.3-1/src/c/string/includes/ascii.h b/2.3-1/src/c/string/includes/ascii.h index fcf969da..39aeb835 100644 --- a/2.3-1/src/c/string/includes/ascii.h +++ b/2.3-1/src/c/string/includes/ascii.h @@ -17,7 +17,7 @@ extern "C" { #endif -void gasciia(char* str,int size,int* oup); +void gasciia(char* str,int size,uint8* oup); void dasciia(double* inp,int size,char* oup); #ifdef __cplusplus diff --git a/2.3-1/src/c/string/strcspn/gstrcspna.c b/2.3-1/src/c/string/strcspn/gstrcspna.c index b611fff8..2c83c724 100644 --- a/2.3-1/src/c/string/strcspn/gstrcspna.c +++ b/2.3-1/src/c/string/strcspn/gstrcspna.c @@ -16,11 +16,11 @@ uint8 gstrcspna(char *str1,int size1,char *str2,int size2) { int ind,i,j; - for(i=0;i<=size1;i++) + for(i=0;i<=size2;i++) { - for(j=0;j<=size2;j++) + for(j=0;j<=size1;j++) { - if(str2[j]==str1[i]) + if(str2[i]==str1[j]) { ind=j; break; diff --git a/2.3-1/tests/unit_tests/test_analogFilters/scilabcode/main.sci b/2.3-1/tests/unit_tests/test_analogFilters/scilabcode/main.sci new file mode 100644 index 00000000..85fc494c --- /dev/null +++ b/2.3-1/tests/unit_tests/test_analogFilters/scilabcode/main.sci @@ -0,0 +1,33 @@ +// This is the demo function to test the analog filters +// They are of 4 types butterworth,chebyshev-1,chebyshev-2 and elliptic +// We are going to test here the butterworth, chebyshev-1 and chebyshev-2 filters +//zpbutt->butterworth filter +//zpch1 ->chebyshev type-1 filter +//zpch2 ->chebyshev type-2 filter +function main() + n=5; //n is the filter order + fl=3; //fl is the cutoff frequency + [pb,gb]=zpbutt(n,fl); + disp("poles of butterworth filter") + disp(pb); + disp("gain of butterworth filter"); + disp(gb); + + e=0.5; //e (epsilon) it is the ripples in pass band + wc=4; // wc cutoff frequency + [pc1,gc1]=zpch1(n,e,wc); + disp("poles of chebyshev-1 filter") + disp(pc1); + disp("gain of chebyshev-1 filter") + disp(gc1); + + a=4; //a is the attenuation in stop band + w=5; //w (omega) is the cutoff frequency + [zc2,pc2,gc2]=zpch2(n,a,w); + disp("zeros of chebyshev-2 filter") + disp(zc2); + disp("poles of chebyshev-2 filter") + disp(pc2); + disp("gain of chebyshev-2 filter") + disp(gc2); +endfunction diff --git a/2.3-1/tests/unit_tests/test_analogFilters/scilabcode/zpbutttest.sci b/2.3-1/tests/unit_tests/test_analogFilters/scilabcode/zpbutttest.sci new file mode 100644 index 00000000..1ea723d6 --- /dev/null +++ b/2.3-1/tests/unit_tests/test_analogFilters/scilabcode/zpbutttest.sci @@ -0,0 +1,7 @@ +function zpbutttest() + n=5; + fl=3; + [p,g]=zpbutt(n,fl); + disp(p); + disp(g); +endfunction diff --git a/2.3-1/tests/unit_tests/test_analogFilters/scilabcode/zpch1test.sci b/2.3-1/tests/unit_tests/test_analogFilters/scilabcode/zpch1test.sci new file mode 100644 index 00000000..4f29e0d4 --- /dev/null +++ b/2.3-1/tests/unit_tests/test_analogFilters/scilabcode/zpch1test.sci @@ -0,0 +1,9 @@ +function zpch1test() + + N=5; //N is the filter order + e=0.5; //e (epsilon) it is the ripples in pass band + wc=4; // wc cutoff frequency + [p,g]=zpch1(N,e,wc); + disp(p); + disp(g); +endfunction diff --git a/2.3-1/tests/unit_tests/test_analogFilters/scilabcode/zpch2test.sci b/2.3-1/tests/unit_tests/test_analogFilters/scilabcode/zpch2test.sci new file mode 100644 index 00000000..665fb41c --- /dev/null +++ b/2.3-1/tests/unit_tests/test_analogFilters/scilabcode/zpch2test.sci @@ -0,0 +1,9 @@ +function zpch2test() + n=5; + a=4; + w=5; + [z,p,g]=zpch2(n,a,w); + disp(z); + disp(p); + disp(g); +endfunction diff --git a/2.3-1/tests/unit_tests/test_filterResponse/scilabcode/buttmagtest.sci b/2.3-1/tests/unit_tests/test_filterResponse/scilabcode/buttmagtest.sci new file mode 100644 index 00000000..c7426c2d --- /dev/null +++ b/2.3-1/tests/unit_tests/test_filterResponse/scilabcode/buttmagtest.sci @@ -0,0 +1,7 @@ +function buttmagtest() + smp=[1:5]; + od=6; + frq=2.2; + oup=buttmag(od,frq,smp); + disp(oup); +endfunction diff --git a/2.3-1/tests/unit_tests/test_filterResponse/scilabcode/cheb1magtest.sci b/2.3-1/tests/unit_tests/test_filterResponse/scilabcode/cheb1magtest.sci new file mode 100644 index 00000000..7d096375 --- /dev/null +++ b/2.3-1/tests/unit_tests/test_filterResponse/scilabcode/cheb1magtest.sci @@ -0,0 +1,8 @@ +function cheb1magtest() + od=5; + wfc=3; + eps=0.3; + sap=[1:5]; + out=cheb1mag(od,wfc,eps,sap); + disp(out); +endfunction diff --git a/2.3-1/tests/unit_tests/test_filterResponse/scilabcode/ell1magtest.sci b/2.3-1/tests/unit_tests/test_filterResponse/scilabcode/ell1magtest.sci new file mode 100644 index 00000000..b53c435d --- /dev/null +++ b/2.3-1/tests/unit_tests/test_filterResponse/scilabcode/ell1magtest.sci @@ -0,0 +1,7 @@ +function ell1magtest() + eps1=0.2; + m11=0.4; + z1=[1,2,3]; + [s1]=ell1mag(eps1,m11,z1); + disp(s1); +endfunction diff --git a/2.3-1/tests/unit_tests/test_filterResponse/scilabcode/main.sci b/2.3-1/tests/unit_tests/test_filterResponse/scilabcode/main.sci new file mode 100644 index 00000000..6a8cbc59 --- /dev/null +++ b/2.3-1/tests/unit_tests/test_filterResponse/scilabcode/main.sci @@ -0,0 +1,20 @@ +function main() + + order=5; + sample1=[1:5]; + frq=2.2; + out1=buttmag(order,frq,sample1); + disp(out1); + + wfc=3; + eps=0.3; + sample2=[1:5]; + out2=cheb1mag(order,wfc,eps,sample2); + disp(out2); + + eps1=0.2; + m11=0.4; + z1=[1,2,3]; + [s1]=ell1mag(eps1,m11,z1); + disp(s1); +endfunction diff --git a/2.3-1/tests/unit_tests/test_jacobi/scilabcode/main.sci b/2.3-1/tests/unit_tests/test_jacobi/scilabcode/main.sci new file mode 100644 index 00000000..ee229ebe --- /dev/null +++ b/2.3-1/tests/unit_tests/test_jacobi/scilabcode/main.sci @@ -0,0 +1,18 @@ +// Demo function to test %sn and %k functions +// %sn is the Jacobi's elliptic function +// %k is the Jacobi's complete integral +function main() + u=[1+2*%i 2+3*%i 3+1*%i]; // the corresponding complex vector + k=0.6; // parameter of elliptic integral + [out]=%sn(u,k); + disp(out); + m=[0.1 0.2 0.3]; // parametrt of Jacobi complete integral + s=%k(m); + disp(s); +endfunction + +//Output +//for %sn +// 1.5641568 - 0.2037920i 1.0580372 + 0.0100213i 1.1386855 - 0.4631921i +// for %k +// 1.6124413 1.6596236 1.7138894 diff --git a/2.3-1/tests/unit_tests/test_jacobi/scilabcode/modktest.sci b/2.3-1/tests/unit_tests/test_jacobi/scilabcode/modktest.sci new file mode 100644 index 00000000..613cd33b --- /dev/null +++ b/2.3-1/tests/unit_tests/test_jacobi/scilabcode/modktest.sci @@ -0,0 +1,5 @@ +function modktest() + m=[0.1 0.2 0.3]; + s=%k(m); + disp(s); +endfunction diff --git a/2.3-1/tests/unit_tests/test_jacobi/scilabcode/modsntest.sci b/2.3-1/tests/unit_tests/test_jacobi/scilabcode/modsntest.sci new file mode 100644 index 00000000..dc5d4353 --- /dev/null +++ b/2.3-1/tests/unit_tests/test_jacobi/scilabcode/modsntest.sci @@ -0,0 +1,6 @@ +function modsntest() + u=[1+2*%i 2+3*%i 3+1*%i]; // the corresponding complex vector + k=0.6; // parameter of elliptic integral + [out]=%sn(u,k); + disp(out); +endfunction diff --git a/2.3-1/tests/unit_tests/test_string/scilabcode/asciitest.sci b/2.3-1/tests/unit_tests/test_string/scilabcode/asciitest.sci new file mode 100644 index 00000000..aa0017d7 --- /dev/null +++ b/2.3-1/tests/unit_tests/test_string/scilabcode/asciitest.sci @@ -0,0 +1,11 @@ +//This function test the ascii function in scilab. +//Ascii function takes the input string and then gives the ascii code of the string. +// The output for the scilab will be:- +//[97. 110. 107. 105. 116. 32. 105. 115. 32. 114. 97. 106.] + +function asciitest() + y="ankit is raj"; //This is the input string for testing the function. + x=ascii(y); //calling of the function + disp(x); +endfunction + diff --git a/2.3-1/tests/unit_tests/test_string/scilabcode/asciitest2.sci b/2.3-1/tests/unit_tests/test_string/scilabcode/asciitest2.sci new file mode 100644 index 00000000..ca7dcb7e --- /dev/null +++ b/2.3-1/tests/unit_tests/test_string/scilabcode/asciitest2.sci @@ -0,0 +1,5 @@ +function asciitest2() + d=[97 98 99 100 101]; + si=ascii(d); + disp(si); +endfunction diff --git a/2.3-1/tests/unit_tests/test_string/scilabcode/main.sci b/2.3-1/tests/unit_tests/test_string/scilabcode/main.sci new file mode 100644 index 00000000..4030ee09 --- /dev/null +++ b/2.3-1/tests/unit_tests/test_string/scilabcode/main.sci @@ -0,0 +1,30 @@ +//This is the demo function to test a set of string functions +// ascii->converts the input char vector/array to corresponding ascii code or vice versa +// strchr-> it finds the occurence of a charcter in a given string +// strncpy->copy charcters from string +// strspn-> get span of character set in string + +function main() + strascii1="ankit is raj"; //This is the input string for testing the function. + asciiout1=ascii(strascii1); //calling of the function + disp(asciiout1); + + strascii2=[97 98 99 100 101]; //Input as the ascii code to get converted to string + asciiout2=ascii(strascii2); //calling the function + disp(asciiout2); + + str="This is a sample string"; + ch="s"; + out1=strchr(str,ch); + disp(out1); + + ss="Ankit Raj"; + nn=5; + resu=strncpy(ss,nn); + disp(resu); + + strsample2="Hello this is Ankit"; + a="Ank"; + oup2=strspn(a,strsample2); + disp(oup2) +endfunction diff --git a/2.3-1/tests/unit_tests/test_string/scilabcode/strchrtest.sci b/2.3-1/tests/unit_tests/test_string/scilabcode/strchrtest.sci new file mode 100644 index 00000000..f8d34198 --- /dev/null +++ b/2.3-1/tests/unit_tests/test_string/scilabcode/strchrtest.sci @@ -0,0 +1,6 @@ +function strchrtest() + s="This is a sample string"; + ch="s"; + y=strchr(s,ch); + disp(y); +endfunction diff --git a/2.3-1/tests/unit_tests/test_string/scilabcode/strcspntest.sci b/2.3-1/tests/unit_tests/test_string/scilabcode/strcspntest.sci new file mode 100644 index 00000000..9a03c576 --- /dev/null +++ b/2.3-1/tests/unit_tests/test_string/scilabcode/strcspntest.sci @@ -0,0 +1,6 @@ +function strcspntest() + x="123243545assdsc"; + y="anki5t3"; + z=strcspn(y,x); + disp(z); +endfunction diff --git a/2.3-1/tests/unit_tests/test_string/scilabcode/strncpytest.sci b/2.3-1/tests/unit_tests/test_string/scilabcode/strncpytest.sci new file mode 100644 index 00000000..14eceb83 --- /dev/null +++ b/2.3-1/tests/unit_tests/test_string/scilabcode/strncpytest.sci @@ -0,0 +1,6 @@ +function strncpytest() + ss="Ankit Raj"; + nn=5; + resu=strncpy(ss,nn); + disp(resu); +endfunction diff --git a/2.3-1/thirdparty/lib/raspberrypi/libcblas.a b/2.3-1/thirdparty/lib/raspberrypi/libcblas.a Binary files differindex 719376dd..bbba3e21 100644 --- a/2.3-1/thirdparty/lib/raspberrypi/libcblas.a +++ b/2.3-1/thirdparty/lib/raspberrypi/libcblas.a diff --git a/2.3-1/thirdparty/lib/raspberrypi/liblapack.a b/2.3-1/thirdparty/lib/raspberrypi/liblapack.a Binary files differindex 9af700fc..6165c435 100644 --- a/2.3-1/thirdparty/lib/raspberrypi/liblapack.a +++ b/2.3-1/thirdparty/lib/raspberrypi/liblapack.a diff --git a/2.3-1/thirdparty/lib/raspberrypi/librefblas.a b/2.3-1/thirdparty/lib/raspberrypi/librefblas.a Binary files differindex 0307f908..d1921c42 100644 --- a/2.3-1/thirdparty/lib/raspberrypi/librefblas.a +++ b/2.3-1/thirdparty/lib/raspberrypi/librefblas.a |