diff options
67 files changed, 524 insertions, 89 deletions
diff --git a/demos/FilterResponse.dem.sce b/demos/FilterResponse.dem.sce new file mode 100644 index 0000000..7104836 --- /dev/null +++ b/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/demos/Jacobi.dem.sce b/demos/Jacobi.dem.sce new file mode 100644 index 0000000..0b1618c --- /dev/null +++ b/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/demos/analogFilter.dem.sce b/demos/analogFilter.dem.sce new file mode 100644 index 0000000..674c954 --- /dev/null +++ b/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/demos/scilab2c.dem.gateway.sce b/demos/scilab2c.dem.gateway.sce index 71372e2..011e474 100644 --- a/demos/scilab2c.dem.gateway.sce +++ b/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/demos/string.dem.sce b/demos/string.dem.sce new file mode 100644 index 0000000..db90905 --- /dev/null +++ b/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/etc/scilab2c.start b/etc/scilab2c.start index 2f364c6..793b0a7 100644 --- a/etc/scilab2c.start +++ b/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/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS b/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS Binary files differindex 9e78f93..ef46423 100644 --- a/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS +++ b/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS diff --git a/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS.TAB b/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS.TAB Binary files differindex d9070a2..e3c71bf 100644 --- a/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS.TAB +++ b/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS.TAB diff --git a/help/en_US/scilab_en_US_help/JavaHelpSearch/OFFSETS b/help/en_US/scilab_en_US_help/JavaHelpSearch/OFFSETS Binary files differindex abba268..1324712 100644 --- a/help/en_US/scilab_en_US_help/JavaHelpSearch/OFFSETS +++ b/help/en_US/scilab_en_US_help/JavaHelpSearch/OFFSETS diff --git a/help/en_US/scilab_en_US_help/JavaHelpSearch/POSITIONS b/help/en_US/scilab_en_US_help/JavaHelpSearch/POSITIONS Binary files differindex 81b246b..9c9d28d 100644 --- a/help/en_US/scilab_en_US_help/JavaHelpSearch/POSITIONS +++ b/help/en_US/scilab_en_US_help/JavaHelpSearch/POSITIONS diff --git a/help/en_US/scilab_en_US_help/JavaHelpSearch/SCHEMA b/help/en_US/scilab_en_US_help/JavaHelpSearch/SCHEMA index 94a57bb..a646b00 100644 --- a/help/en_US/scilab_en_US_help/JavaHelpSearch/SCHEMA +++ b/help/en_US/scilab_en_US_help/JavaHelpSearch/SCHEMA @@ -1,2 +1,2 @@ JavaSearch 1.0 -TMAP bs=2048 rt=1 fl=-1 id1=732 id2=1 +TMAP bs=2048 rt=0 fl=-1 id1=10 id2=1 diff --git a/help/en_US/scilab_en_US_help/JavaHelpSearch/TMAP b/help/en_US/scilab_en_US_help/JavaHelpSearch/TMAP Binary files differindex a4b959d..ee0149c 100644 --- a/help/en_US/scilab_en_US_help/JavaHelpSearch/TMAP +++ b/help/en_US/scilab_en_US_help/JavaHelpSearch/TMAP diff --git a/help/en_US/scilab_en_US_help/index.html b/help/en_US/scilab_en_US_help/index.html new file mode 100644 index 0000000..9028c97 --- /dev/null +++ b/help/en_US/scilab_en_US_help/index.html @@ -0,0 +1,52 @@ +<html><head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> + <title></title> + <style type="text/css" media="all"> + @import url("scilab_code.css"); + @import url("xml_code.css"); + @import url("c_code.css"); + @import url("style.css"); + </style> + </head> + <body> + <div class="manualnavbar"> + <table width="100%"><tr> + <td width="30%"> + + </td> + <td width="40%" class="center"> + + </td> + <td width="30%" class="next"> + + </td> + </tr></table> + <hr /> + </div> + + + + + <br /><br /> + <h3 class="book-title">Scilab 2 C Converter</h3> +<ul class="list-part"><a name="scilab_2_c_converter_manual"></a><div class="info"></div></ul> + <br /> + + <div class="manualnavbar"> + <table width="100%"> + <tr><td colspan="3" class="next"><a href="http://bugzilla.scilab.org/enter_bug.cgi?product=Scilab%20software&component=Documentation%20pages" class="ulink">Report an issue</a></td></tr> +<tr> + <td width="30%"> + + </td> + <td width="40%" class="center"> + + </td> + <td width="30%" class="next"> + + </td> + </tr></table> + <hr /> + </div> + </body> +</html> diff --git a/help/en_US/scilab_en_US_help/jhelpidx.xml b/help/en_US/scilab_en_US_help/jhelpidx.xml new file mode 100644 index 0000000..aa5a66e --- /dev/null +++ b/help/en_US/scilab_en_US_help/jhelpidx.xml @@ -0,0 +1,3 @@ +<?xml version="1.0" encoding="utf-8" standalone="no"?> +<!DOCTYPE index PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp Index Version 1.0//EN" "http://java.sun.com/products/javahelp/index_1_0.dtd"> +<index version="1.0"/>
\ No newline at end of file diff --git a/help/en_US/scilab_en_US_help/jhelpmap.jhm b/help/en_US/scilab_en_US_help/jhelpmap.jhm index a97448b..cdbcb20 100644 --- a/help/en_US/scilab_en_US_help/jhelpmap.jhm +++ b/help/en_US/scilab_en_US_help/jhelpmap.jhm @@ -2,44 +2,4 @@ <!DOCTYPE map PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp Map Version 1.0//EN" "http://java.sun.com/products/javahelp/map_1_0.dtd"> <map version="1.0"> <mapID target="index" url="index.html"/> -<<<<<<< HEAD -<mapID target="section_009504e67ab100d6991ada9db2f321bb" url="section_009504e67ab100d6991ada9db2f321bb.html"/> -======= -<mapID target="section_35ee3b19a97c75b084122c05ac0777c6" url="section_35ee3b19a97c75b084122c05ac0777c6.html"/> ->>>>>>> 8106d4ce6960cfd63c3a42171fdf5d52e46ccb06 -<mapID target="AVRADCSetup" url="AVRADCSetup.html"/> -<mapID target="AVRDigitalIn" url="AVRDigitalIn.html"/> -<mapID target="AVRDigitalOut" url="AVRDigitalOut.html"/> -<mapID target="AVRDigitalPortSetup" url="AVRDigitalPortSetup.html"/> -<mapID target="AVRDigitalSetup" url="AVRDigitalSetup.html"/> -<mapID target="AVRGetTimerValue" url="AVRGetTimerValue.html"/> -<mapID target="AVRPWM0SetDuty" url="AVRPWM0SetDuty.html"/> -<mapID target="AVRPWM0Setup" url="AVRPWM0Setup.html"/> -<mapID target="AVRPWM1SetDuty" url="AVRPWM1SetDuty.html"/> -<mapID target="AVRPWM1Setup" url="AVRPWM1Setup.html"/> -<mapID target="AVRPWM2SetDuty" url="AVRPWM2SetDuty.html"/> -<mapID target="AVRPWM2Setup" url="AVRPWM2Setup.html"/> -<mapID target="AVRReadADC" url="AVRReadADC.html"/> -<mapID target="AVRSleep" url="AVRSleep.html"/> -<mapID target="AVRTimerSetup" url="AVRTimerSetup.html"/> -<mapID target="AVRUARTReceive" url="AVRUARTReceive.html"/> -<mapID target="AVRUARTSetup" url="AVRUARTSetup.html"/> -<mapID target="AVRUARTTransmit" url="AVRUARTTransmit.html"/> -<mapID target="CV_AdaptiveThreshold" url="CV_AdaptiveThreshold.html"/> -<mapID target="CV_Blur" url="CV_Blur.html"/> -<mapID target="CV_Canny" url="CV_Canny.html"/> -<mapID target="CV_CornerHarris" url="CV_CornerHarris.html"/> -<mapID target="CV_CreateImage" url="CV_CreateImage.html"/> -<mapID target="CV_CvtColor" url="CV_CvtColor.html"/> -<mapID target="CV_Dilate" url="CV_Dilate.html"/> -<mapID target="CV_DistanceTransform" url="CV_DistanceTransform.html"/> -<mapID target="CV_Erode" url="CV_Erode.html"/> -<mapID target="CV_GaussianBlur" url="CV_GaussianBlur.html"/> -<mapID target="CV_GetImgSize" url="CV_GetImgSize.html"/> -<mapID target="CV_LoadImage" url="CV_LoadImage.html"/> -<mapID target="CV_MedianBlur" url="CV_MedianBlur.html"/> -<mapID target="CV_SaveImage" url="CV_SaveImage.html"/> -<mapID target="CV_ShowImage" url="CV_ShowImage.html"/> -<mapID target="CV_Threshold" url="CV_Threshold.html"/> -<mapID target="CV_WaitKey" url="CV_WaitKey.html"/> </map>
\ No newline at end of file diff --git a/macros/ASTManagement/lib b/macros/ASTManagement/lib Binary files differindex 9b25137..f34860a 100644 --- a/macros/ASTManagement/lib +++ b/macros/ASTManagement/lib diff --git a/macros/CCodeGeneration/C_GenerateMakefile.sci b/macros/CCodeGeneration/C_GenerateMakefile.sci index 3b977bd..dbdae9d 100644 --- a/macros/CCodeGeneration/C_GenerateMakefile.sci +++ b/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/macros/CCodeGeneration/lib b/macros/CCodeGeneration/lib Binary files differindex 150b73d..3d4fed1 100644 --- a/macros/CCodeGeneration/lib +++ b/macros/CCodeGeneration/lib diff --git a/macros/ErrorMessages/lib b/macros/ErrorMessages/lib Binary files differindex 3acaef0..ba3b9a5 100644 --- a/macros/ErrorMessages/lib +++ b/macros/ErrorMessages/lib diff --git a/macros/FunctionAnnotation/lib b/macros/FunctionAnnotation/lib Binary files differindex a08fa77..239105c 100644 --- a/macros/FunctionAnnotation/lib +++ b/macros/FunctionAnnotation/lib diff --git a/macros/FunctionList/lib b/macros/FunctionList/lib Binary files differindex 09e6f62..1c722dd 100644 --- a/macros/FunctionList/lib +++ b/macros/FunctionList/lib diff --git a/macros/GeneralFunctions/lib b/macros/GeneralFunctions/lib Binary files differindex b0268e9..7586a91 100644 --- a/macros/GeneralFunctions/lib +++ b/macros/GeneralFunctions/lib diff --git a/macros/Hardware/AVR/lib b/macros/Hardware/AVR/lib Binary files differindex 8f604d0..ed4c52b 100644 --- a/macros/Hardware/AVR/lib +++ b/macros/Hardware/AVR/lib diff --git a/macros/Hardware/RasberryPi/lib b/macros/Hardware/RasberryPi/lib Binary files differindex 667f886..eec912f 100644 --- a/macros/Hardware/RasberryPi/lib +++ b/macros/Hardware/RasberryPi/lib diff --git a/macros/ImageProcessing/core/lib b/macros/ImageProcessing/core/lib Binary files differindex e52a709..40b7b0a 100644 --- a/macros/ImageProcessing/core/lib +++ b/macros/ImageProcessing/core/lib diff --git a/macros/ImageProcessing/highgui/lib b/macros/ImageProcessing/highgui/lib Binary files differindex 65b46da..0d7f88a 100644 --- a/macros/ImageProcessing/highgui/lib +++ b/macros/ImageProcessing/highgui/lib diff --git a/macros/ImageProcessing/imgproc/lib b/macros/ImageProcessing/imgproc/lib Binary files differindex d97be43..63b5e7e 100644 --- a/macros/ImageProcessing/imgproc/lib +++ b/macros/ImageProcessing/imgproc/lib diff --git a/macros/Scilab-Arduino/lib b/macros/Scilab-Arduino/lib Binary files differindex d89e790..a62fd4e 100644 --- a/macros/Scilab-Arduino/lib +++ b/macros/Scilab-Arduino/lib diff --git a/macros/SymbolTable/lib b/macros/SymbolTable/lib Binary files differindex 7c3db40..4379c83 100644 --- a/macros/SymbolTable/lib +++ b/macros/SymbolTable/lib diff --git a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci index 5f6e914..dfebfdf 100644 --- a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci +++ b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci @@ -10107,7 +10107,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/macros/ToolInitialization/lib b/macros/ToolInitialization/lib Binary files differindex 9a30e1f..670a52e 100644 --- a/macros/ToolInitialization/lib +++ b/macros/ToolInitialization/lib diff --git a/macros/findDeps/lib b/macros/findDeps/lib Binary files differBinary files differindex 5f1cf07..88df35f 100644 --- a/macros/findDeps/lib +++ b/macros/findDeps/lib diff --git a/macros/scilab2c.sci b/macros/scilab2c.sci index 197c88b..70290d0 100644 --- a/macros/scilab2c.sci +++ b/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/src/c/signalProcessing/%k/dmodka.c b/src/c/signalProcessing/%k/dmodka.c index c0630ec..8368cb6 100644 --- a/src/c/signalProcessing/%k/dmodka.c +++ b/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/src/c/signalProcessing/%sn/dmodsns.c b/src/c/signalProcessing/%sn/dmodsns.c index 06d0a6f..aae16c1 100644 --- a/src/c/signalProcessing/%sn/dmodsns.c +++ b/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/src/c/signalProcessing/ell1mag/dell1maga.c b/src/c/signalProcessing/ell1mag/dell1maga.c index 9af0c8e..58ef303 100644 --- a/src/c/signalProcessing/ell1mag/dell1maga.c +++ b/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/src/c/signalProcessing/ell1mag/zell1maga.c b/src/c/signalProcessing/ell1mag/zell1maga.c index 6e7a6f9..35b4928 100644 --- a/src/c/signalProcessing/ell1mag/zell1maga.c +++ b/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/src/c/signalProcessing/ffilt/gffilts.c b/src/c/signalProcessing/ffilt/gffilts.c index 538daf3..09876d0 100644 --- a/src/c/signalProcessing/ffilt/gffilts.c +++ b/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/src/c/signalProcessing/fsfirlin/dfsfirlina.c b/src/c/signalProcessing/fsfirlin/dfsfirlina.c index d2079f4..e44f464 100644 --- a/src/c/signalProcessing/fsfirlin/dfsfirlina.c +++ b/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/src/c/signalProcessing/sincd/dsincds.c b/src/c/signalProcessing/sincd/dsincds.c index 1475d8d..c9f2f81 100644 --- a/src/c/signalProcessing/sincd/dsincds.c +++ b/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/src/c/signalProcessing/sincd/u8sincds.c b/src/c/signalProcessing/sincd/u8sincds.c index d03f48a..ff0a2ac 100644 --- a/src/c/signalProcessing/sincd/u8sincds.c +++ b/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/src/c/signalProcessing/zmodsns.c b/src/c/signalProcessing/zmodsns.c new file mode 100644 index 0000000..5f35059 --- /dev/null +++ b/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/src/c/signalProcessing/zpbutt/dzpbutts.c b/src/c/signalProcessing/zpbutt/dzpbutts.c index 33f22af..7b9fe9b 100644 --- a/src/c/signalProcessing/zpbutt/dzpbutts.c +++ b/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/src/c/string/ascii/gasciia.c b/src/c/string/ascii/gasciia.c index ec11d6e..5fe95e0 100644 --- a/src/c/string/ascii/gasciia.c +++ b/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/src/c/string/includes/ascii.h b/src/c/string/includes/ascii.h index fcf969d..39aeb83 100644 --- a/src/c/string/includes/ascii.h +++ b/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/src/c/string/strcspn/gstrcspna.c b/src/c/string/strcspn/gstrcspna.c index b611fff..2c83c72 100644 --- a/src/c/string/strcspn/gstrcspna.c +++ b/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/tests/unit_tests/test_analogFilters/scilabcode/main.sci b/tests/unit_tests/test_analogFilters/scilabcode/main.sci new file mode 100644 index 0000000..85fc494 --- /dev/null +++ b/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/tests/unit_tests/test_analogFilters/scilabcode/zpbutttest.sci b/tests/unit_tests/test_analogFilters/scilabcode/zpbutttest.sci new file mode 100644 index 0000000..1ea723d --- /dev/null +++ b/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/tests/unit_tests/test_analogFilters/scilabcode/zpch1test.sci b/tests/unit_tests/test_analogFilters/scilabcode/zpch1test.sci new file mode 100644 index 0000000..4f29e0d4 --- /dev/null +++ b/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/tests/unit_tests/test_analogFilters/scilabcode/zpch2test.sci b/tests/unit_tests/test_analogFilters/scilabcode/zpch2test.sci new file mode 100644 index 0000000..665fb41 --- /dev/null +++ b/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/tests/unit_tests/test_filterResponse/scilabcode/buttmagtest.sci b/tests/unit_tests/test_filterResponse/scilabcode/buttmagtest.sci new file mode 100644 index 0000000..c7426c2 --- /dev/null +++ b/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/tests/unit_tests/test_filterResponse/scilabcode/cheb1magtest.sci b/tests/unit_tests/test_filterResponse/scilabcode/cheb1magtest.sci new file mode 100644 index 0000000..7d09637 --- /dev/null +++ b/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/tests/unit_tests/test_filterResponse/scilabcode/ell1magtest.sci b/tests/unit_tests/test_filterResponse/scilabcode/ell1magtest.sci new file mode 100644 index 0000000..b53c435 --- /dev/null +++ b/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/tests/unit_tests/test_filterResponse/scilabcode/main.sci b/tests/unit_tests/test_filterResponse/scilabcode/main.sci new file mode 100644 index 0000000..6a8cbc5 --- /dev/null +++ b/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/tests/unit_tests/test_jacobi/scilabcode/main.sci b/tests/unit_tests/test_jacobi/scilabcode/main.sci new file mode 100644 index 0000000..ee229eb --- /dev/null +++ b/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/tests/unit_tests/test_jacobi/scilabcode/modktest.sci b/tests/unit_tests/test_jacobi/scilabcode/modktest.sci new file mode 100644 index 0000000..613cd33 --- /dev/null +++ b/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/tests/unit_tests/test_jacobi/scilabcode/modsntest.sci b/tests/unit_tests/test_jacobi/scilabcode/modsntest.sci new file mode 100644 index 0000000..dc5d435 --- /dev/null +++ b/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/tests/unit_tests/test_string/scilabcode/asciitest.sci b/tests/unit_tests/test_string/scilabcode/asciitest.sci new file mode 100644 index 0000000..aa0017d --- /dev/null +++ b/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/tests/unit_tests/test_string/scilabcode/asciitest2.sci b/tests/unit_tests/test_string/scilabcode/asciitest2.sci new file mode 100644 index 0000000..ca7dcb7 --- /dev/null +++ b/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/tests/unit_tests/test_string/scilabcode/main.sci b/tests/unit_tests/test_string/scilabcode/main.sci new file mode 100644 index 0000000..4030ee0 --- /dev/null +++ b/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/tests/unit_tests/test_string/scilabcode/strchrtest.sci b/tests/unit_tests/test_string/scilabcode/strchrtest.sci new file mode 100644 index 0000000..f8d3419 --- /dev/null +++ b/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/tests/unit_tests/test_string/scilabcode/strcspntest.sci b/tests/unit_tests/test_string/scilabcode/strcspntest.sci new file mode 100644 index 0000000..9a03c57 --- /dev/null +++ b/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/tests/unit_tests/test_string/scilabcode/strncpytest.sci b/tests/unit_tests/test_string/scilabcode/strncpytest.sci new file mode 100644 index 0000000..14eceb8 --- /dev/null +++ b/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/thirdparty/lib/raspberrypi/libcblas.a b/thirdparty/lib/raspberrypi/libcblas.a Binary files differindex 719376d..bbba3e2 100644 --- a/thirdparty/lib/raspberrypi/libcblas.a +++ b/thirdparty/lib/raspberrypi/libcblas.a diff --git a/thirdparty/lib/raspberrypi/liblapack.a b/thirdparty/lib/raspberrypi/liblapack.a Binary files differindex 9af700f..6165c43 100644 --- a/thirdparty/lib/raspberrypi/liblapack.a +++ b/thirdparty/lib/raspberrypi/liblapack.a diff --git a/thirdparty/lib/raspberrypi/librefblas.a b/thirdparty/lib/raspberrypi/librefblas.a Binary files differindex 0307f90..d1921c4 100644 --- a/thirdparty/lib/raspberrypi/librefblas.a +++ b/thirdparty/lib/raspberrypi/librefblas.a |