diff options
121 files changed, 4231 insertions, 43 deletions
diff --git a/2.3-1/includes/sci2clib.h b/2.3-1/includes/sci2clib.h index f662325c..18c5730b 100644 --- a/2.3-1/includes/sci2clib.h +++ b/2.3-1/includes/sci2clib.h @@ -318,6 +318,15 @@ extern "C" { #include "factor.h" #include "int_factor.h" +/*interfacing gcd*/ +#include "gcd.h" +#include "int_gcd.h" + +/*interfacing lcm*/ +#include "lcm.h" +#include "int_lcm.h" + + /* IMPLICIT LISTS */ /* interfacing implicitList/OpColon */ #include "implicitList.h" @@ -457,7 +466,57 @@ extern "C" { #include "lev.h" #include "int_lev.h" +/* interfacing zpbutt */ +#include "zpbutt.h" +#include "int_zpbutt.h" + +/*interfacing zpch1 */ +#include "zpch1.h" +#include "int_zpch1.h" + +/*interfacing zpch2 */ +#include "zpch2.h" +#include "int_zpch2.h" + +/*interfacing buttmag */ +#include "buttmag.h" +#include "int_buttmag.h" + +/*interfacing cheb1mag */ +#include "cheb1mag.h" +#include "int_cheb1mag.h" + +/*interfacing cheb2mag */ +#include "cheb2mag.h" +#include "int_cheb2mag.h" + +/*interfacing sinc */ +#include "sinc.h" +#include "int_sinc.h" +/*interfacing sincd */ +#include "sincd.h" +#include "int_sincd.h" + +/*interfacing fsfirlin */ +#include "fsfirlin.h" +#include "int_fsfirlin.h" + +/*interfacing %k */ +#include "modk.h" +#include "int_modk.h" + +/*interfacing filt_sinc */ +#include "filt_sinc.h" +#include "int_filt_sinc.h" + +/*interfacing ffilt */ +#include "ffilt.h" +#include "int_ffilt.h" + +/*interfacing modsn */ +#include "modsn.h" +#include "int_modsn.h" /* STATISTICS FUNCTIONS */ @@ -526,6 +585,26 @@ extern "C" { #include "strrchr.h" #include "int_strrchr.h" +/*interfacing strchr*/ +#include "strchr.h" +#include "int_strchr.h" + +/*interfacing ascii*/ +#include "ascii.h" +#include "int_ascii.h" + +/*interfacing strspn*/ +#include "strspn.h" +#include "int_strspn.h" + +/*interfacing strcspn*/ +#include "strcspn.h" +#include "int_strcspn.h" + +/*interfacing strncpy*/ +#include "strncpy.h" +#include "int_strncpy.h" + /*Functions related to strings*/ #include "convstr.h" #include "int_convstr.h" diff --git a/2.3-1/libraries/blasplus.lib b/2.3-1/libraries/blasplus.lib Binary files differnew file mode 100644 index 00000000..df511369 --- /dev/null +++ b/2.3-1/libraries/blasplus.lib diff --git a/2.3-1/libraries/lapack.lib b/2.3-1/libraries/lapack.lib Binary files differnew file mode 100644 index 00000000..305c5a8e --- /dev/null +++ b/2.3-1/libraries/lapack.lib diff --git a/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci b/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci index 57c0c5ee..7f551307 100644 --- a/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci +++ b/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci @@ -131,6 +131,10 @@ NOutArg_mod = NOutArg ASTFunName='modk'; end + if ASTFunName == '%sn' + ASTFunName='modsn'; + end + if (ASTFunName == 'OpEqual') FunTypeAnnot = ''; FunSizeAnnot = ''; @@ -446,6 +450,7 @@ NOutArg_mod = NOutArg //#RNU_RES_E //disp(OutArg,InArg,ASTFunName) + CFunName = C_GenerateFunName(ASTFunName,InArg,NInArg,OutArg,NOutArg_mod); //#RNU_RES_B @@ -472,7 +477,8 @@ NOutArg_mod = NOutArg else LibTypeInfo = 'USER2C'; end - + + //#RNU_RES_B // ------------------------------------------------------------------------------------ // --- Check whether the function has been already called in the current .sci file. --- diff --git a/2.3-1/macros/ASTManagement/lib b/2.3-1/macros/ASTManagement/lib Binary files differindex c73eb6b2..67ea09be 100644 --- a/2.3-1/macros/ASTManagement/lib +++ b/2.3-1/macros/ASTManagement/lib diff --git a/2.3-1/macros/CCodeGeneration/lib b/2.3-1/macros/CCodeGeneration/lib Binary files differindex 4e87a555..2db4b8c8 100644 --- a/2.3-1/macros/CCodeGeneration/lib +++ b/2.3-1/macros/CCodeGeneration/lib diff --git a/2.3-1/macros/FunctionAnnotation/FA_FSFIRLIN_SZ.sci b/2.3-1/macros/FunctionAnnotation/FA_FSFIRLIN_SZ.sci new file mode 100644 index 00000000..c1dc9e50 --- /dev/null +++ b/2.3-1/macros/FunctionAnnotation/FA_FSFIRLIN_SZ.sci @@ -0,0 +1,9 @@ +function outp=FA_FSFIRLIN_SZ(in1sz2) + in1sz2=string(in1sz2); + in1sz=eval(in1sz2); + if(int(in1sz/2)==in1sz/2) then + outp=string(4*in1sz+1); + else + outp=string(4*in1sz+3); + end +endfunction diff --git a/2.3-1/macros/FunctionAnnotation/FA_SZ_MODSN.sci b/2.3-1/macros/FunctionAnnotation/FA_SZ_MODSN.sci new file mode 100644 index 00000000..4a58e644 --- /dev/null +++ b/2.3-1/macros/FunctionAnnotation/FA_SZ_MODSN.sci @@ -0,0 +1,11 @@ +function outt=FA_SZ_MODSN(in1sz) + +in1sz=string(in1sz); +in1s=eval(in1sz) +if(in1s>1) then + outt=string(in1s); +else + outt=string(1); +end + +endfunction diff --git a/2.3-1/macros/FunctionAnnotation/FA_TP_ASCII.sci b/2.3-1/macros/FunctionAnnotation/FA_TP_ASCII.sci new file mode 100644 index 00000000..e05dd7ae --- /dev/null +++ b/2.3-1/macros/FunctionAnnotation/FA_TP_ASCII.sci @@ -0,0 +1,10 @@ +function outtp=FA_TP_ASCII(in1tp) + +in1tp=string(in1tp); +if(in1tp=='g') then + outtp='u8'; +else + outtp='g'; +end + +endfunction diff --git a/2.3-1/macros/FunctionAnnotation/FA_TP_MODSN.sci b/2.3-1/macros/FunctionAnnotation/FA_TP_MODSN.sci new file mode 100644 index 00000000..f766b4e7 --- /dev/null +++ b/2.3-1/macros/FunctionAnnotation/FA_TP_MODSN.sci @@ -0,0 +1,10 @@ +function outtp=FA_TP_MODSN(in1tp) + +in1tp=string(in1tp); +if(in1tp=='d') then + outtp='d'; +else + outtp='z'; +end + +endfunction diff --git a/2.3-1/macros/FunctionAnnotation/names b/2.3-1/macros/FunctionAnnotation/names index 8962de09..1d83afa1 100644 --- a/2.3-1/macros/FunctionAnnotation/names +++ b/2.3-1/macros/FunctionAnnotation/names @@ -1,5 +1,6 @@ FA_ADD FA_DIV +FA_FSFIRLIN_SZ FA_GetDefaultPrecision FA_GetFunAnn FA_GetOutArgInfo @@ -26,6 +27,7 @@ FA_SZ_FROM_VAL FA_SZ_LINSPACE_ROW FA_SZ_LQE FA_SZ_LQR +FA_SZ_MODSN FA_SZ_OBSCNT FA_SZ_OPAPEX FA_SZ_OPBACKSLASH @@ -57,6 +59,7 @@ FA_SZ_ROW_DIAG FA_SZ_ROW_DIAG_INS_EXT FA_SZ_SEL1 FA_SZ_SEL2 +FA_TP_ASCII FA_TP_C FA_TP_COMPLEX FA_TP_CVIMAGE @@ -66,6 +69,7 @@ FA_TP_INT16 FA_TP_INT8 FA_TP_MAX FA_TP_MIN_REAL +FA_TP_MODSN FA_TP_REAL FA_TP_S FA_TP_UINT16 diff --git a/2.3-1/macros/Scilab-Arduino/lib b/2.3-1/macros/Scilab-Arduino/lib Binary files differindex a5bf12b2..0304cade 100644 --- a/2.3-1/macros/Scilab-Arduino/lib +++ b/2.3-1/macros/Scilab-Arduino/lib diff --git a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci index 3ec6d13e..a2bf5738 100644 --- a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci +++ b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci @@ -7260,6 +7260,153 @@ PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file', INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+//------------------------------------
+//---- Class STRCHR --------------------
+//------------------------------------
+ClassName = 'STRCHR';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+//Arguements specified: initial value, start time, time vector, ode function
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('g2g2'+ArgSeparator+'g2',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'strchr';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+
+//------------------------------------
+//---- Class STRNCPY --------------------
+//------------------------------------
+ClassName = 'STRNCPY';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+//Arguements specified: initial value, start time, time vector, ode function
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''g''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(2).VAL',ClassFileName,'file','y');
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('g2d0'+ArgSeparator+'g2',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'strncpy';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+
+//------------------------------------
+//---- Class STRSPN --------------------
+//------------------------------------
+ClassName = 'STRSPN';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+//Arguements specified: initial value, start time, time vector, ode function
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''u8''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('g2g2'+ArgSeparator+'u80',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'strspn';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+
+//------------------------------------
+//---- Class STRCSPN --------------------
+//------------------------------------
+ClassName = 'STRCSPN';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+//Arguements specified: initial value, start time, time vector, ode function
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''u8''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('g2g2'+ArgSeparator+'u80',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'strcspn';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+
+
+
+//------------------------------------
+//---- Class ASCII --------------------
+//------------------------------------
+ClassName = 'ASCII';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+//Arguements specified: initial value, start time, time vector, ode function
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= FA_TP_ASCII(IN(1).TP)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= FA_SUB(IN(1).SZ(2),''1'')',ClassFileName,'file','y');
+
+//PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+//PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+//PrintStringInfo('OUT(1).TP= FA_TP_ASCII(IN(1).TP)',ClassFileName,'file','y');
+//PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+//PrintStringInfo('OUT(1).SZ(2)= FA_SUB(IN(1).SZ(2),''1'')',ClassFileName,'file','y');
+
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('g2'+ArgSeparator+'u82',ClassFileName,'file','y');
+PrintStringInfo('d2'+ArgSeparator+'g2',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'ascii';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
//------------------------------------
@@ -7964,6 +8111,66 @@ INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,Ex //------------------------------------
+//---- Class GCD --------------------
+//------------------------------------
+ClassName = 'GCD';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+//Arguements specified: initial value, start time, time vector, ode function
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('u82'+ArgSeparator+'u80',ClassFileName,'file','y');
+
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'gcd';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+
+//------------------------------------
+//---- Class LCM --------------------
+//------------------------------------
+ClassName = 'LCM';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+//Arguements specified: initial value, start time, time vector, ode function
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''u8''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('u82'+ArgSeparator+'u80',ClassFileName,'file','y');
+
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'lcm';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+
+
+
+
+
+//------------------------------------
//---- Class FACTOR --------------------
//------------------------------------
ClassName = 'FACTOR';
@@ -7992,6 +8199,469 @@ INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,Ex +//------------------------------------
+//---- Class GCD --------------------
+//------------------------------------
+ClassName = 'GCD';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+//Arguements specified: initial value, start time, time vector, ode function
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''u8''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('u82'+ArgSeparator+'u80',ClassFileName,'file','y');
+
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'gcd';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+
+//------------------------------------
+//---- Class ZPBUTT --------------------
+//------------------------------------
+ClassName = 'ZPBUTT';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 2',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''z''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).VAL',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).TP= ''d''',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(2)= ''1''',ClassFileName,'file','y');
+
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0d0'+ArgSeparator+'z2d0',ClassFileName,'file','y');
+
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'zpbutt';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+//------------------------------------
+//---- Class ZPCH1 --------------------
+//------------------------------------
+ClassName = 'ZPCH1';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+
+PrintStringInfo('NIN= 3',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 2',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''z''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).VAL',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).TP= ''d''',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(2)= ''1''',ClassFileName,'file','y');
+
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0d0d0'+ArgSeparator+'z2d0',ClassFileName,'file','y');
+
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'zpch1';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+//------------------------------------
+//---- Class ZPCH2 --------------------
+//------------------------------------
+ClassName = 'ZPCH2';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+
+PrintStringInfo('NIN= 3',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 3',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''z''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).VAL',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).TP= ''z''',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(2)= IN(1).VAL',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).TP= ''d''',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).SZ(2)= ''1''',ClassFileName,'file','y');
+
+
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0d0d0'+ArgSeparator+'z2z2d0',ClassFileName,'file','y');
+
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'zpch2';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+//------------------------------------
+//---- Class BUTTMAG --------------------
+//------------------------------------
+ClassName = 'BUTTMAG';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+
+PrintStringInfo('NIN= 3',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',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');
+
+
+
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0d0d2'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('u80u80d2'+ArgSeparator+'d2',ClassFileName,'file','y');
+
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'buttmag';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+//------------------------------------
+//---- Class CHEB1MAG --------------------
+//------------------------------------
+ClassName = 'CHEB1MAG';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+
+PrintStringInfo('NIN= 4',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''d''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(4).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(4).SZ(2)',ClassFileName,'file','y');
+
+
+
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0d0d0d2'+ArgSeparator+'d2',ClassFileName,'file','y');
+//PrintStringInfo('u80u80d2'+ArgSeparator+'d2',ClassFileName,'file','y');
+
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'cheb1mag';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+//------------------------------------
+//---- Class CHEB2MAG --------------------
+//------------------------------------
+ClassName = 'CHEB2MAG';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+
+PrintStringInfo('NIN= 4',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''d''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(4).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(4).SZ(2)',ClassFileName,'file','y');
+
+
+
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0d0d0d2'+ArgSeparator+'d2',ClassFileName,'file','y');
+//PrintStringInfo('u80u80d2'+ArgSeparator+'d2',ClassFileName,'file','y');
+
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'cheb2mag';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+
+
+
+//------------------------------------
+//---- Class SINC --------------------
+//------------------------------------
+ClassName = 'SINC';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+
+
+
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d2'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('z2'+ArgSeparator+'z2',ClassFileName,'file','y');
+
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'sinc';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+
+
+//------------------------------------
+//---- Class SINCD --------------------
+//------------------------------------
+ClassName = 'SINCD';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''d''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= FA_ADD(FA_MUL(''8'',IN(1).VAL),''1'')',ClassFileName,'file','y');
+
+
+
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0d0'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('u80u80'+ArgSeparator+'d2',ClassFileName,'file','y');
+
+
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'sincd';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+
+
+//------------------------------------
+//---- Class FSFIRLIN --------------------
+//------------------------------------
+ClassName = 'FSFIRLIN';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''d''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= FA_FSFIRLIN_SZ(IN(1).SZ(2))',ClassFileName,'file','y');
+
+
+
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d2d0'+ArgSeparator+'d2',ClassFileName,'file','y');
+
+
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'fsfirlin';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+
+
+//------------------------------------
+//---- Class %K --------------------
+//------------------------------------
+ClassName = 'modk';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''d''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+
+
+
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d2'+ArgSeparator+'d2',ClassFileName,'file','y');
+
+
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'modk';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+
+//------------------------------------
+//---- Class FILT_SINC --------------------
+//------------------------------------
+ClassName = 'FILT_SINC';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''d''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).VAL',ClassFileName,'file','y');
+
+
+
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0d0'+ArgSeparator+'d2',ClassFileName,'file','y');
+
+
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'filt_sinc';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+
+//------------------------------------
+//---- Class FFILT --------------------
+//------------------------------------
+ClassName = 'FFILT';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+
+PrintStringInfo('NIN= 4',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''d''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(2).VAL',ClassFileName,'file','y');
+
+
+
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('g2d0d0d0'+ArgSeparator+'d2',ClassFileName,'file','y');
+
+
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'ffilt';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+
+//------------------------------------
+//---- Class %SN --------------------
+//------------------------------------
+ClassName = 'modsn';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+
+//PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+//PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+//PrintStringInfo('OUT(1).TP= FA_TP_MODSN(IN(1).TP)',ClassFileName,'file','y');
+//PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+//PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+//PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+//PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+//PrintStringInfo('OUT(1).TP= FA_TP_MODSN(IN(1).TP',ClassFileName,'file','y');
+//PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+//PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= FA_TP_MODSN(IN(1).TP)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= FA_SZ_MODSN(IN(1).SZ(1))',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= FA_SZ_MODSN(IN(1).SZ(2))',ClassFileName,'file','y');
+
+
+
+
+
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0d0'+ArgSeparator+'d0',ClassFileName,'file','y');
+PrintStringInfo('z0d0'+ArgSeparator+'z0',ClassFileName,'file','y');
+PrintStringInfo('d2d0'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('z2d0'+ArgSeparator+'z2',ClassFileName,'file','y');
+
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'modsn';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
// ////////////////////////////////////////////
// /////PARTE INTRODOTTA DA ALBERTO MOREA
// /////////////////////////////////////////////
diff --git a/2.3-1/macros/ToolInitialization/ManageNextConversion.sci b/2.3-1/macros/ToolInitialization/ManageNextConversion.sci index a1524766..b0d4337b 100644 --- a/2.3-1/macros/ToolInitialization/ManageNextConversion.sci +++ b/2.3-1/macros/ToolInitialization/ManageNextConversion.sci @@ -44,6 +44,8 @@ FlagContinueTranslation = 0; // --- Finalize the current C code. ---
// ------------------------------------
C_FinalizeCode(FileInfo,SharedInfo);
+//PrintStringInfo(' hello',ReportFileName,'file','y');
+
// ------------------------------------------------
// --- Identify the next function to translate. ---
diff --git a/2.3-1/macros/ToolInitialization/lib b/2.3-1/macros/ToolInitialization/lib Binary files differindex b7e8685b..4d03bdc5 100644 --- a/2.3-1/macros/ToolInitialization/lib +++ b/2.3-1/macros/ToolInitialization/lib diff --git a/2.3-1/macros/findDeps/getAllHeaders.sci b/2.3-1/macros/findDeps/getAllHeaders.sci index 7788f2c4..b246c104 100644 --- a/2.3-1/macros/findDeps/getAllHeaders.sci +++ b/2.3-1/macros/findDeps/getAllHeaders.sci @@ -161,6 +161,18 @@ function allHeaders = getAllHeaders(SharedInfo) "src/c/signalProcessing/includes/lpc2cep.h" "src/c/signalProcessing/includes/dynlib_signalprocessing.h" "src/c/signalProcessing/includes/crossCorr.h" + "src/c/signalProcessing/includes/zpbutt.h" + "src/c/signalProcessing/includes/zpch1.h" + "src/c/signalProcessing/includes/zpch2.h" + "src/c/signalProcessing/includes/buttmag.h" + "src/c/signalProcessing/includes/cheb1mag.h" + "src/c/signalProcessing/includes/cheb2mag.h" + "src/c/signalProcessing/includes/sincd.h" + "src/c/signalProcessing/includes/fsfirlin.h" + "src/c/signalProcessing/includes/modk.h" + "src/c/signalProcessing/includes/filt_sinc.h" + "src/c/signalProcessing/includes/ffilt.h" + "src/c/signalProcessing/includes/modsn.h" "src/c/implicitList/dynlib_implicitlist.h" "src/c/implicitList/implicitList.h" "src/c/differential_calculus/includes/ode.h" @@ -171,6 +183,11 @@ function allHeaders = getAllHeaders(SharedInfo) //"src/c/string/includes/strcmp.h" "src/c/string/includes/strrev.h" "src/c/string/includes/strrchr.h" + "src/c/string/includes/strchr.h" + "src/c/string/includes/ascii.h" + "src/c/string/includes/strspn.h" + "src/c/string/includes/strcspn.h" + "src/c/string/includes/strncpy.h" "src/c/elementaryFunctions/includes/dec2bin.h" "src/c/elementaryFunctions/includes/dec2hex.h" "src/c/elementaryFunctions/includes/dec2oct.h" @@ -192,6 +209,9 @@ function allHeaders = getAllHeaders(SharedInfo) "src/c/elementaryFunctions/includes/factorial.h" "src/c/elementaryFunctions/includes/primes.h" "src/c/elementaryFunctions/includes/factor.h" + "src/c/elementaryFunctions/includes/gcd.h" + "src/c/elementaryFunctions/includes/lcm.h" + "src/c/elementaryFunctions/includes/sinc.h" "src/c/CACSD/includes/syslin.h" "src/c/CACSD/includes/lqr.h" "src/c/CACSD/includes/lqe.h" @@ -199,7 +219,7 @@ function allHeaders = getAllHeaders(SharedInfo) "src/c/linearAlgebra/includes/schur.h" "src/c/linearAlgebra/includes/balanc.h" "src/c/linearAlgebra/includes/rcond.h"]; - + //Header files required for "Arduino" output Arduino_headers = [ @@ -229,8 +249,8 @@ function allHeaders = getAllHeaders(SharedInfo) "src/c/hardware/avr/includes/AVRUtil.h" "src/c/hardware/avr/includes/AVRPeripheralTimer.h" "src/c/hardware/avr/includes/AVRPeripheralUART.h" - ]; - + ]; + RPi_headers = [ "thirdparty/includes/WiringPi/wiringPi.h" "thirdparty/includes/WiringPi/wiringSerial.h" diff --git a/2.3-1/macros/findDeps/getAllInterfaces.sci b/2.3-1/macros/findDeps/getAllInterfaces.sci index 9086ba10..13324c45 100644 --- a/2.3-1/macros/findDeps/getAllInterfaces.sci +++ b/2.3-1/macros/findDeps/getAllInterfaces.sci @@ -94,11 +94,11 @@ function allInterfaces = getAllInterfaces(SharedInfo) "src/c/elementaryFunctions/interfaces/int_bitand.h" "src/c/elementaryFunctions/interfaces/int_bitor.h" "src/c/elementaryFunctions/interfaces/int_bitxor.h" - "src/c/elementaryFunctions/interfaces/int_bitcmp.h" - "src/c/elementaryFunctions/interfaces/int_bitset.h" - "src/c/elementaryFunctions/interfaces/int_bitget.h" + "src/c/elementaryFunctions/interfaces/int_bitcmp.h" + "src/c/elementaryFunctions/interfaces/int_bitset.h" + "src/c/elementaryFunctions/interfaces/int_bitget.h" "src/c/elementaryFunctions/interfaces/int_linspace.h" - "src/c/elementaryFunctions/interfaces/int_logspace.h" + "src/c/elementaryFunctions/interfaces/int_logspace.h" "src/c/elementaryFunctions/interfaces/int_cosh.h" "src/c/elementaryFunctions/interfaces/int_uint8.h" "src/c/elementaryFunctions/interfaces/int_int8.h" @@ -116,6 +116,8 @@ function allInterfaces = getAllInterfaces(SharedInfo) "src/c/elementaryFunctions/interfaces/int_asech.h" "src/c/elementaryFunctions/interfaces/int_asind.h" "src/c/elementaryFunctions/interfaces/int_atand.h" + "src/c/elementaryFunctions/interfaces/int_gcd.h" + "src/c/elementaryFunctions/interfaces/int_lcm.h" "src/c/statisticsFunctions/interfaces/int_mean.h" "src/c/statisticsFunctions/interfaces/int_meanf.h" "src/c/statisticsFunctions/interfaces/int_stdevf.h" @@ -157,6 +159,18 @@ function allInterfaces = getAllInterfaces(SharedInfo) "src/c/signalProcessing/interfaces/int_fftshift.h" "src/c/signalProcessing/interfaces/int_fft.h" "src/c/signalProcessing/interfaces/int_lev.h" + "src/c/signalProcessing/interfaces/int_zpbutt.h" + "src/c/signalProcessing/interfaces/int_zpch1.h" + "src/c/signalProcessing/interfaces/int_zpch2.h" + "src/c/signalProcessing/interfaces/int_buttmag.h" + "src/c/signalProcessing/interfaces/int_cheb1mag.h" + "src/c/signalProcessing/interfaces/int_cheb2mag.h" + "src/c/signalProcessing/interfaces/int_sincd.h" + "src/c/signalProcessing/interfaces/int_fsfirlin.h" + "src/c/signalProcessing/interfaces/int_modk.h" + "src/c/signalProcessing/interfaces/int_filt_sinc.h" + "src/c/signalProcessing/interfaces/int_ffilt.h" + "src/c/signalProcessing/interfaces/int_modsn.h" "src/c/implicitList/int_OpColon.h" "src/c/differential_calculus/interfaces/int_ode.h" "src/c/differential_calculus/interfaces/int_diffc.h" @@ -166,6 +180,11 @@ function allInterfaces = getAllInterfaces(SharedInfo) //"src/c/string/interfaces/int_strcmp.h" "src/c/string/interfaces/int_strrev.h" "src/c/string/interfaces/int_strrchr.h" + "src/c/string/interfaces/int_strchr.h" + "src/c/string/interfaces/int_ascii.h" + "src/c/string/interfaces/int_strspn.h" + "src/c/string/interfaces/int_strcspn.h" + "src/c/string/interfaces/int_strncpy.h" "src/c/elementaryFunctions/interfaces/int_dec2base.h" "src/c/elementaryFunctions/interfaces/int_base2dec.h" "src/c/elementaryFunctions/interfaces/int_dec2bin.h" @@ -187,6 +206,7 @@ function allInterfaces = getAllInterfaces(SharedInfo) "src/c/elementaryFunctions/interfaces/int_factorial.h" "src/c/elementaryFunctions/interfaces/int_primes.h" "src/c/elementaryFunctions/interfaces/int_factor.h" + "src/c/elementaryFunctions/interfaces/int_sinc.h" "src/c/CACSD/interfaces/int_syslin.h" "src/c/CACSD/interfaces/int_lqr.h" "src/c/CACSD/interfaces/int_lqe.h" @@ -230,7 +250,7 @@ function allInterfaces = getAllInterfaces(SharedInfo) "src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralThreading.h" "src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPinISR.h" "src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPWM.h" - ]; + ]; OpenCV_interfaces = [ "src/c/imageProcessing/interfaces/int_cvcore.hpp" diff --git a/2.3-1/macros/findDeps/getAllSources.sci b/2.3-1/macros/findDeps/getAllSources.sci index 0a724926..a7e2d794 100644 --- a/2.3-1/macros/findDeps/getAllSources.sci +++ b/2.3-1/macros/findDeps/getAllSources.sci @@ -758,6 +758,8 @@ function allSources = getAllSources(SharedInfo) "src/c/elementaryFunctions/atand/datands.c" "src/c/elementaryFunctions/atand/satanda.c" "src/c/elementaryFunctions/atand/satands.c" + "src/c/elementaryFunctions/discrete_mathematics/gcd/u8gcda.c" + "src/c/elementaryFunctions/discrete_mathematics/lcm/u8lcma.c" "src/c/statisticsFunctions/max/dmaxa.c" "src/c/statisticsFunctions/max/smaxa.c" "src/c/statisticsFunctions/max/srowmaxa.c" @@ -1035,6 +1037,22 @@ function allSources = getAllSources(SharedInfo) "src/c/signalProcessing/hilbert/shilberts.c" "src/c/signalProcessing/hilbert/dhilberta.c" "src/c/signalProcessing/hilbert/dhilberts.c" + "src/c/signalProcessing/zpbutt/dzpbutts.c" + "src/c/signalProcessing/zpch1/dzpch1s.c" + "src/c/signalProcessing/zpch2/dzpch2s.c" + "src/c/signalProcessing/buttmag/dbuttmags.c" + "src/c/signalProcessing/cheb1mag/dcheb1mags.c" + "src/c/signalProcessing/cheb2mag/dcheb2mags.c" + "src/c/signalProcessing/sincd/dsincds.c" + "src/c/signalProcessing/sincd/u8sincds.c" + "src/c/signalProcessing/fsfirlin/dfsfirlina.c" + "src/c/signalProcessing/%k/dmodka.c" + "src/c/signalProcessing/filt_sinc/dfilt_sincs.c" + "src/c/signalProcessing/ffilt/gffilts.c" + "src/c/signalProcessing/%sn/dmodsns.c" + "src/c/signalProcessing/%sn/zmodsns.c" + "src/c/signalProcessing/%sn/dmodsna.c" + "src/c/signalProcessing/%sn/zmodsna.c" "src/c/implicitList/zimplicitLists.c" "src/c/implicitList/dimplicitLists.c" "src/c/implicitList/cimplicitLists.c" @@ -1063,6 +1081,12 @@ function allSources = getAllSources(SharedInfo) //"src/c/string/strcmp/gstrcmps.c" "src/c/string/strrev/gstrreva.c" "src/c/string/strrchr/gstrrchra.c" + "src/c/string/strchr/gstrchra.c" + "src/c/string/ascii/gasciia.c" + "src/c/string/ascii/dasciia.c" + "src/c/string/strspn/gstrspna.c" + "src/c/string/strcspn/gstrcspna.c" + "src/c/string/strncpy/gstrncpya.c" "src/c/elementaryFunctions/radix_conversions/dec2bin/ddec2bins.c" "src/c/elementaryFunctions/radix_conversions/dec2bin/i8dec2bins.c" "src/c/elementaryFunctions/radix_conversions/dec2bin/i16dec2bins.c" @@ -1183,6 +1207,8 @@ function allSources = getAllSources(SharedInfo) "src/c/elementaryFunctions/Trigonometry/sech/csechs.c" "src/c/interpolation/interp1/dinterp13a.c" "src/c/elementaryFunctions/discrete_mathematics/gcd/u8gcds.c" + "src/c/elementaryFunctions/Trigonometry/sinc/dsinca.c" + "src/c/elementaryFunctions/Trigonometry/sinc/zsinca.c" "src/c/elementaryFunctions/discrete_mathematics/gcd/dgcda.c" "src/c/elementaryFunctions/discrete_mathematics/factorial/dfactorials.c" "src/c/elementaryFunctions/discrete_mathematics/factorial/dfactoriala.c" diff --git a/2.3-1/macros/findDeps/lib b/2.3-1/macros/findDeps/lib Binary files differindex d94232c2..a49dc793 100644 --- a/2.3-1/macros/findDeps/lib +++ b/2.3-1/macros/findDeps/lib diff --git a/2.3-1/macros/lib b/2.3-1/macros/lib Binary files differindex 1be60a2b..d818e184 100644 --- a/2.3-1/macros/lib +++ b/2.3-1/macros/lib diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/sinc/dsinca.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/sinc/dsinca.c new file mode 100644 index 00000000..0cd24e96 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/sinc/dsinca.c @@ -0,0 +1,46 @@ +/* Copyright (C) 2016 - 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 "sinc.h" +#define PI 3.14159265358979 +void dsinca(double* sample,int size,double* oup) +{ + int j; + for(j=0;j<size;j++) + { + if(sample[j]==0) + { + oup[j]=1; + } + else + { + oup[j]=(sin(sample[j]))/(sample[j]); + } + } +} +/* +int main() +{ + int n; + printf("Enter the length of the array"); + scanf("%d",&n); + double arr[100000]; + int i; + printf("Now enter the element of the array"); + for(i=0;i<n;i++) + { + scanf("%ld",&arr[i]); + } + sinc(arr[],n); +} +*/ diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/sinc/int_sinc.h b/2.3-1/src/c/elementaryFunctions/Trigonometry/sinc/int_sinc.h new file mode 100644 index 00000000..0dc969de --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/sinc/int_sinc.h @@ -0,0 +1,18 @@ +/* Copyright (C) 2016 - 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 + */ + +#ifndef __INT_SINC_H__ +#define __INT_SINC_H__ + +#define d2sincd2(sample,size,oup) dsinca(sample,size,oup) + +#endif /* !__INT_SINC_H__! */ diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/sinc/sinc.h b/2.3-1/src/c/elementaryFunctions/Trigonometry/sinc/sinc.h new file mode 100644 index 00000000..6a5c315b --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/sinc/sinc.h @@ -0,0 +1,27 @@ +/* Copyright (C) 2016 - 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 + */ + +#ifndef __SINC_H__ +#define __SINC_H__ +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void dsinca(double* sample,int size,double* oup); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __SINC_H__ */ diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/sinc/zsinca.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/sinc/zsinca.c new file mode 100644 index 00000000..ad7d095b --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/sinc/zsinca.c @@ -0,0 +1,31 @@ +/* Copyright (C) 2016 - 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 "sinc.h" +#include "sin.h" +#include "doubleComplex.h" +void zsinca(doubleComplex* sample,int size,doubleComplex* oup) +{ + int j; + for(j=0;j<size;j++) + { + if(sample[j]==0) + { + oup[j]==DoubleComplex(1,0); + } + else + { + oup[j]=zsins(sample[j])/sample[j]; + } + } +} diff --git a/2.3-1/src/c/elementaryFunctions/discrete_mathematics/gcd/u8gcda.c b/2.3-1/src/c/elementaryFunctions/discrete_mathematics/gcd/u8gcda.c new file mode 100644 index 00000000..3d586232 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/discrete_mathematics/gcd/u8gcda.c @@ -0,0 +1,60 @@ +/* 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> +/* This is the "gcd" function , which takes two input. first + one is the array and the second one is the length of the array. + Now to calculate the gcd of two elements we fin the maximum of + the two elements, and then iterate from maximum value down to 1, + and check whether the particular value divides the two elements. + And in this way we can calculate the gcd of the whole array. +*/ +#include "gcd.h" +uint8 u8gcdua(uint8* in,int size) +{ + + int temp; + if(size==1) + { + temp=*in; + } + else + { + int x=*in; + int y=*(in+1); + int max=(x>y)?x:y; + for(int i=max;i>=1;i--) + { + if(x%i==0 && y%i==0) + { + temp=i; + break; + } + } + for(int j=2;j<size;j++) + { + x=temp; + y=*(in+j); + max=(x>y)?x:y; + for(int i=max;i>=1;i--) + { + if(x%i==0 && y%i==0) + { + temp=i; + break; + } + } + } +} + + return temp; +} + diff --git a/2.3-1/src/c/elementaryFunctions/discrete_mathematics/lcm/u8lcma.c b/2.3-1/src/c/elementaryFunctions/discrete_mathematics/lcm/u8lcma.c new file mode 100644 index 00000000..56856e43 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/discrete_mathematics/lcm/u8lcma.c @@ -0,0 +1,68 @@ +/* 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> +/* This is the "lcm" function, accepting two inputs which are the array of integers + and second the size of the array. The algorithm works like this: + We take a temproary variable and store the lcm of the first two elements of the + array in it. Now using this temproary variable we recursively fin the lcm of + the whole array. + Now to fin the lcm of two elements we fin the maximum of the two elements and + check whether it is divisible by both the elements, if the condition is true we + get the lcm, else increase the maximum value by itself unless we get the lcm. +*/ +#include "lcm.h" +uint8 u8lcma(uint8* in,int size) +{ + long long int lcm_temp; + if(size==1) + { + lcm_temp=*in; + } + else + { + + int x1=*in; + int x2=*(in+1); + long long int max=(x1>x2)?x1:x2; + long long int i=max; + while(1) + { + if(i%x1==0 && i%x2==0) + { + lcm_temp=i; + break; + } + else + i+=max; + } + for(int j=2;j<size;j++) + { + x1=lcm_temp; + x2=*(in+j); + max=(x1>x2)?x1:x2; + i=max; + while(1) + { + if(i%x1==0 && i%x2==0) + { + lcm_temp=i; + break; + } + else + i+=max; + } + } + + } + return lcm_temp; +} + diff --git a/2.3-1/src/c/elementaryFunctions/includes/gcd.h b/2.3-1/src/c/elementaryFunctions/includes/gcd.h index eb75c973..179eea0e 100644 --- a/2.3-1/src/c/elementaryFunctions/includes/gcd.h +++ b/2.3-1/src/c/elementaryFunctions/includes/gcd.h @@ -1,31 +1,26 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET - * - * 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 - * Author: Ukasha Noor - * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt - * - */ +/* Copyright (C) 2016 - 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 + */ #ifndef __GCD_H__ #define __GCD_H__ - #include "types.h" -#ifdef __cplusplus -extern "C" { -#endif - -int8 u8gcds(int8 *in,int size); + #ifdef __cplusplus + extern "C"{ + #endif -void dgcda(double *in,int size,double *out); +uint8 u8gcda(uint8* in,int size); -#ifdef __cplusplus -} /* extern "C" */ -#endif + #ifdef __cplusplus + } /* extern "C" */ + #endif -#endif +#endif /*__GCD_H__*/ diff --git a/2.3-1/src/c/elementaryFunctions/includes/lcm.h b/2.3-1/src/c/elementaryFunctions/includes/lcm.h new file mode 100644 index 00000000..3a3e66fb --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/includes/lcm.h @@ -0,0 +1,27 @@ +/* Copyright (C) 2016 - 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 + */ +#ifndef __LCM_H__ +#define __LCM_H__ +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +uint8 u8lcma(uint8* in,int size); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__LCM_H__*/ + diff --git a/2.3-1/src/c/elementaryFunctions/includes/sinc.h b/2.3-1/src/c/elementaryFunctions/includes/sinc.h new file mode 100644 index 00000000..8bc98d28 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/includes/sinc.h @@ -0,0 +1,29 @@ +/* Copyright (C) 2016 - 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 + */ + +#ifndef __SINC_H__ +#define __SINC_H__ +#include "types.h" +#include "doubleComplex.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void dsinca(double* sample,int size,double* oup); +void zsinca(doubleComplex* sample,int size,doubleComplex* oup); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __SINC_H__ */ diff --git a/2.3-1/src/c/elementaryFunctions/interfaces/int_gcd.h b/2.3-1/src/c/elementaryFunctions/interfaces/int_gcd.h index c2135b70..f3e117c5 100644 --- a/2.3-1/src/c/elementaryFunctions/interfaces/int_gcd.h +++ b/2.3-1/src/c/elementaryFunctions/interfaces/int_gcd.h @@ -1,25 +1,25 @@ -/* Copyright (C) 2016 - IIT Bombay - FOSSEE + /* Copyright (C) 2016 - 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: Ukasha Noor + Author: Ankit Raj Organization: FOSSEE, IIT Bombay Email: toolbox@scilab.in -*/ - -/* THIS IS AN AUTOMATICALLY GENERATED FILE : DO NOT EDIT BY HAND. */ - + */ #ifndef __INT_GCD_H__ #define __INT_GCD_H__ -#include "gcd.h" - -#define u82gcdu80(in,size) u8gcds(in,size) + #ifdef __cplusplus + extern "C" { + #endif -#define d2gcdd2(in,size,out) dgcda(in,size[0]*size[1],out) +#define u82gcdu80(in,size) u8gcda(in,size[1]) -#endif + #ifdef __cplusplus + } /* extern "C" */ + #endif +#endif /*__INT_GCD_H__*/ diff --git a/2.3-1/src/c/elementaryFunctions/interfaces/int_lcm.h b/2.3-1/src/c/elementaryFunctions/interfaces/int_lcm.h new file mode 100644 index 00000000..2ef1a081 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/interfaces/int_lcm.h @@ -0,0 +1,27 @@ +/* Copyright (C) 2016 - 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 + */ + + + +#ifndef __INT_LCM_H__ +#define __INT_LCM_H__ + #ifdef __cplusplus + extern "C" { + #endif + +#define u82lcmu80(in,size) u8lcma(in,size[1]) + + #ifdef __cplusplus + } /* extern "C" */ + #endif + +#endif /* !__INT_LCM_H__ */ diff --git a/2.3-1/src/c/elementaryFunctions/interfaces/int_sinc.h b/2.3-1/src/c/elementaryFunctions/interfaces/int_sinc.h new file mode 100644 index 00000000..35a519db --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/interfaces/int_sinc.h @@ -0,0 +1,19 @@ +/* Copyright (C) 2016 - 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 + */ + +#ifndef __INT_SINC_H__ +#define __INT_SINC_H__ + +#define d2sincd2(sample,size,oup) dsinca(sample,size[1],oup) +#define z2sincz2(sample,size,oup) zsinca(sample,size[1],oup) + +#endif /* !__INT_SINC_H__! */ diff --git a/2.3-1/src/c/signalProcessing/%k/dmodka.c b/2.3-1/src/c/signalProcessing/%k/dmodka.c new file mode 100644 index 00000000..c0630ec0 --- /dev/null +++ b/2.3-1/src/c/signalProcessing/%k/dmodka.c @@ -0,0 +1,97 @@ +#include<stdio.h> +#include<math.h> +#include "modk.h" +double max_calc(double* ptr,int sz) +{ + int i=0; + double mx; + if(ptr[0]<0) + { + ptr[0]=-1*ptr[0]; + } + mx=(ptr[0]); + //printf("%lf\n",mx); + for(i=1;i<sz;i++) + { + if(ptr[i]<0) + { + ptr[i]=-1*ptr[i]; + } + if(mx<(ptr[i])) + mx=(ptr[i]); + } + return mx; +} +void dmodka(double* inp,int size,double* oup) +{ + double ones[size],PI=M_PI; + double eps=pow(2,-52); + int i; + for(i=0;i<size;i++) + { + ones[i]=1; + } + double a[size],b[size],c[size],an[size],bn[size],cn[size],kans[size]; + + int j,kk,l,m; + for(j=0;j<size;j++) + { + a[j]=1; + } + for(kk=0;kk<size;kk++) + { + b[kk]=sqrt(ones[kk]-inp[kk]); + } + for(l=0;l<size;l++) + { + c[l]=sqrt(inp[l]); + + } + int x=0; + //double maxi; + //maxi=max_calc(c,size); + //printf("%lf",maxi); + + while(max_calc(c,size)>eps) + { + int q,w,r; + for(q=0;q<size;q++) + { + an[q]=0.5*(a[q]+b[q]); + } + for(w=0;w<size;w++) + { + bn[w]=sqrt(a[w]*b[w]); + } + for(r=0;r<size;r++) + { + cn[r]=0.5*(a[r]-b[r]); + } + int x,y,z; + for(x=0;x<size;x++) + { + a[x]=an[x]; + } + for(y=0;y<size;y++) + { + b[y]=bn[y]; + } + for(z=0;z<size;z++) + { + c[z]=cn[z]; + } + } + int q,w; + for(q=0;q<size;q++) + { + oup[q]=PI*(ones[q]/(2*a[q])); + } + +} +/* +int main() +{ + double m[3]={0.1,0.2,0.3}; + dka(m,3); +} +*/ diff --git a/2.3-1/src/c/signalProcessing/%k/int_modk.h b/2.3-1/src/c/signalProcessing/%k/int_modk.h new file mode 100644 index 00000000..ae09c50a --- /dev/null +++ b/2.3-1/src/c/signalProcessing/%k/int_modk.h @@ -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 + */ + +#ifndef __INT_%K_H__ +#define __INT_%K_H__ + +#define d2modkz2(inp,size,oup) dmodka(inp,size,oup) + +#endif /* !INT_%K_H__! */ diff --git a/2.3-1/src/c/signalProcessing/%k/modk.h b/2.3-1/src/c/signalProcessing/%k/modk.h new file mode 100644 index 00000000..6b4a7e08 --- /dev/null +++ b/2.3-1/src/c/signalProcessing/%k/modk.h @@ -0,0 +1,29 @@ +/* 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 + */ + +#ifndef __%K_H__ +#define __%K_H__ +#include "types.h" +#include "doubleComplex.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void dmodka(double* inp,int size,doubleComplex* oup); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __%K_H__ */ + diff --git a/2.3-1/src/c/signalProcessing/%sn/dmodsna.c b/2.3-1/src/c/signalProcessing/%sn/dmodsna.c new file mode 100644 index 00000000..7e1e81c3 --- /dev/null +++ b/2.3-1/src/c/signalProcessing/%sn/dmodsna.c @@ -0,0 +1,24 @@ +/* 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 "modsn.h" + +void dmodsna(double* uu,int size,double emmc,double* sn) +{ + int i; + for(i=0;i<size;i++) + { + sn[i]=dmodsns(uu[i],emmc); + } +} + diff --git a/2.3-1/src/c/signalProcessing/%sn/dmodsns.c b/2.3-1/src/c/signalProcessing/%sn/dmodsns.c new file mode 100644 index 00000000..06d0a6f0 --- /dev/null +++ b/2.3-1/src/c/signalProcessing/%sn/dmodsns.c @@ -0,0 +1,93 @@ +/* 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> +#define CA 0.0003 +#include "modsn.h" +double dmodsns(double uu, double emmc) +{ + double a,b,c,d,emc,u; + double em[14],en[14]; + int i,ii,l,bo; + double sn,cn,dn; + emc=1-emmc; + u=uu; + if(emc) + { + bo=(emc<0.0); + if(bo) + { + d=1.0-emc; + emc/=-1.0/d; + u*=(d=sqrt(d)); + } + a=1.0; + dn=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; + sn=sin(u); + cn=cos(u); + if(sn) + { + a=cn/sn; + c*=a; + for(ii=l;ii>=1;ii--) + { + b=em[ii]; + a*=c; + c*=dn; + dn=(en[ii]+a)/(b+a); + a=c/b; + } + a=1.0/sqrt(c*c+1.0); + sn=(sn>=0.0?a:-a); + cn=c*(sn); + } + if(bo) + { + a=dn; + dn=cn; + cn=a; + sn/=d; + } + } + else + { + cn=1.0/cosh(u); + dn=cn; + sn=tanh(u); + } + return sn; +} +/* +int main() +{ + double u,k; + u=4; + k=0.7; + sn(u,k); +} +*/ diff --git a/2.3-1/src/c/signalProcessing/%sn/int_modsn.h b/2.3-1/src/c/signalProcessing/%sn/int_modsn.h new file mode 100644 index 00000000..179fb61f --- /dev/null +++ b/2.3-1/src/c/signalProcessing/%sn/int_modsn.h @@ -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 + */ + +#ifndef __INT_MODSN_H__ +#define __INT_MODSN_H__ + +#define d0d0modsnd0(uu,emmc) dmodsns(uu,emmc) + +#endif /* !INT_MODSN_H__! */ diff --git a/2.3-1/src/c/signalProcessing/%sn/modsn.h b/2.3-1/src/c/signalProcessing/%sn/modsn.h new file mode 100644 index 00000000..c5896562 --- /dev/null +++ b/2.3-1/src/c/signalProcessing/%sn/modsn.h @@ -0,0 +1,27 @@ +/* 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 + */ + +#ifndef __MODSN_H__ +#define __MODSN_H__ +#include "types.h" + +#ifdef __cplusplus +extern "c" { +#endif + +double dmodsns(double uu, double emmc); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __MODSN_H__ */ diff --git a/2.3-1/src/c/signalProcessing/%sn/zmodsna.c b/2.3-1/src/c/signalProcessing/%sn/zmodsna.c new file mode 100644 index 00000000..33052a32 --- /dev/null +++ b/2.3-1/src/c/signalProcessing/%sn/zmodsna.c @@ -0,0 +1,24 @@ +/* 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 "modsn.h" +#include "doubleComplex.h" + +void zmodsna(doubleComplex* uu,int size,double emmc,doubleComplex* sn) +{ + int i; + for(i=0;i<size;i++) + { + sn[i]=zmodsns(uu[i],emmc); + } +} diff --git a/2.3-1/src/c/signalProcessing/%sn/zmodsns.c b/2.3-1/src/c/signalProcessing/%sn/zmodsns.c new file mode 100644 index 00000000..5f35059f --- /dev/null +++ b/2.3-1/src/c/signalProcessing/%sn/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/buttmag/buttmag.h b/2.3-1/src/c/signalProcessing/buttmag/buttmag.h new file mode 100644 index 00000000..47e64af8 --- /dev/null +++ b/2.3-1/src/c/signalProcessing/buttmag/buttmag.h @@ -0,0 +1,28 @@ +/* Copyright (C) 2016 - 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 + */ + +#ifndef __BUTTMAG_H__ +#define __BUTTMAG_H__ +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void dbuttmags(double order, double omegac, int size, double* sample,double* out); + +#ifdef __cplusplus +} /* extern "C"*/ +#endif + +#endif /* __BUTTMAG_H__ */ + diff --git a/2.3-1/src/c/signalProcessing/buttmag/dbuttmags.c b/2.3-1/src/c/signalProcessing/buttmag/dbuttmags.c new file mode 100644 index 00000000..dc40e814 --- /dev/null +++ b/2.3-1/src/c/signalProcessing/buttmag/dbuttmags.c @@ -0,0 +1,33 @@ +/* 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 "buttmag.h" +void dbuttmags(double order, double omegac,double* sample,int size,double* out) +{ + double ones[size]; + int j,k; + for(j=0;j<size;j++) + { + ones[j]=1.0; + } + //double h[size]; + for(k=0;k<size;k++) + { + double x=ones[k]/(ones[k]+pow((sample[k]/omegac),(2*order))); + out[k]=x; + //printf("%lf\n",h[k]); + } + +} + diff --git a/2.3-1/src/c/signalProcessing/buttmag/int_buttmag.h b/2.3-1/src/c/signalProcessing/buttmag/int_buttmag.h new file mode 100644 index 00000000..9867438e --- /dev/null +++ b/2.3-1/src/c/signalProcessing/buttmag/int_buttmag.h @@ -0,0 +1,18 @@ +/* Copyright (C) 2016 - 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 + */ + +#ifndef __INT_BUTTMAG_H__ +#define __INT_BUTTMAG_H__ + +#define d0d0d2buttmagd2(order,omegac,size,sample,out) dbuttmags(order,omegac,size,sample,out) + +#endif /* !INT_BUTTMAG_H__! */ diff --git a/2.3-1/src/c/signalProcessing/buttmag/u8buttmags.c b/2.3-1/src/c/signalProcessing/buttmag/u8buttmags.c new file mode 100644 index 00000000..e7b52c22 --- /dev/null +++ b/2.3-1/src/c/signalProcessing/buttmag/u8buttmags.c @@ -0,0 +1,33 @@ +/* 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 "buttmag.h" +void dbuttmags(int order, int omegac,double* sample,int size,double* out) +{ + double ones[size]; + int j,k; + for(j=0;j<size;j++) + { + ones[j]=1.0; + } + //double h[size]; + for(k=0;k<size;k++) + { + double x=ones[k]/(ones[k]+pow((sample[k]/omegac),(2*order))); + out[k]=x; + //printf("%lf\n",h[k]); + } + +} + diff --git a/2.3-1/src/c/signalProcessing/cheb1mag/cheb1mag.h b/2.3-1/src/c/signalProcessing/cheb1mag/cheb1mag.h new file mode 100644 index 00000000..369ee4ce --- /dev/null +++ b/2.3-1/src/c/signalProcessing/cheb1mag/cheb1mag.h @@ -0,0 +1,27 @@ +/* Copyright (C) 2016 - 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 + */ + +#ifndef __CHEB1MAG_H__ +#define __CHEB1MAG_H__ +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void dcheb1mags(double n, double omegac, double epsilon, double* sample,int size,double* out); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __CHEB1MAG_H__ */ diff --git a/2.3-1/src/c/signalProcessing/cheb1mag/dcheb1mags.c b/2.3-1/src/c/signalProcessing/cheb1mag/dcheb1mags.c new file mode 100644 index 00000000..a4a459d4 --- /dev/null +++ b/2.3-1/src/c/signalProcessing/cheb1mag/dcheb1mags.c @@ -0,0 +1,35 @@ +/* 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 "cheb1mag.h" +void dcheb1mags(double n, double omegac, double epsilon, double* sample,int size,double* out) +{ + double x; + int j; + double tn; + for(j=0;j<size;j++) + { + x=sample[j]/omegac; + if(x<=1) + { + tn=cos(n*acos(x)); + out[j]=1/(1+(epsilon*epsilon)*(tn*tn)); + } + else + { + tn=cosh(n*acosh(x)); + out[j]=1/(1+(epsilon*epsilon)*(tn*tn)); + } + } +} + diff --git a/2.3-1/src/c/signalProcessing/cheb1mag/int_cheb1mag.h b/2.3-1/src/c/signalProcessing/cheb1mag/int_cheb1mag.h new file mode 100644 index 00000000..fa0ff83e --- /dev/null +++ b/2.3-1/src/c/signalProcessing/cheb1mag/int_cheb1mag.h @@ -0,0 +1,18 @@ +/* Copyright (C) 2016 - 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 + */ + +#ifndef __INT_CHEB1MAG_H__ +#define __INT_CHEB1MAG_H__ + +#define d0d0d2cheb1magd2(n,omegac,epsilon,sample,size,out) dcheb1mags(n,omegac,epsilon,sample,size,out) + +#endif /* !__INT_CHEB1MAG_H__! */ diff --git a/2.3-1/src/c/signalProcessing/cheb2mag/cheb2mag.h b/2.3-1/src/c/signalProcessing/cheb2mag/cheb2mag.h new file mode 100644 index 00000000..0516ca51 --- /dev/null +++ b/2.3-1/src/c/signalProcessing/cheb2mag/cheb2mag.h @@ -0,0 +1,27 @@ +/* Copyright (C) 2016 - 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 + */ + +#ifndef __CHEB2MAG_H__ +#define __CHEB2MAG_H__ +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void dcheb2mags(double n,double omegar, double A, double* sample,int size,double* oup); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __CHEB2MAG_H__ */ diff --git a/2.3-1/src/c/signalProcessing/cheb2mag/dcheb2mags.c b/2.3-1/src/c/signalProcessing/cheb2mag/dcheb2mags.c new file mode 100644 index 00000000..006c5917 --- /dev/null +++ b/2.3-1/src/c/signalProcessing/cheb2mag/dcheb2mags.c @@ -0,0 +1,49 @@ +/* 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 "cheb2mag.h" +void dcheb2mags(double n,double omegar, double A, double* sample,int size,double* oup) +{ + double e; + //e=sqrt(A*A-1); + e=1/(pow(10,A/10)-1); + double x,k,cn,h,tp; + int i; + for(i=0;i<size;i++) + { + x=omegar/sample[i]; + if(x<=1) + { + tp=acos(x); + cn=cos(n*tp); + if(x==1) + { + h=1/(1+A*A-1); + } + else + { + h=1/(1+((A*A-1)/(cn*cn))); + } + + } + else + { + tp=acosh(x); + cn=cosh(n*tp); + h=e*(cn*cn)/(1+e*(cn*cn)); + + } + oup[i]=h; + } +} + diff --git a/2.3-1/src/c/signalProcessing/cheb2mag/int_cheb2mag.h b/2.3-1/src/c/signalProcessing/cheb2mag/int_cheb2mag.h new file mode 100644 index 00000000..05b77c2d --- /dev/null +++ b/2.3-1/src/c/signalProcessing/cheb2mag/int_cheb2mag.h @@ -0,0 +1,18 @@ +/* Copyright (C) 2016 - 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 + */ + +#ifndef __INT_CHEB2MAG_H__ +#define __INT_CHEB2MAG_H__ + +#define d0d0d0d2cheb2magd2(n,omegar,A,sample,size,oup) dcheb2mag(n,omegar,A,sample,size,oup) + +#endif /* !__INT_CHEB2MAG_H__! */ diff --git a/2.3-1/src/c/signalProcessing/ffilt/ffilt.h b/2.3-1/src/c/signalProcessing/ffilt/ffilt.h new file mode 100644 index 00000000..9b98f34c --- /dev/null +++ b/2.3-1/src/c/signalProcessing/ffilt/ffilt.h @@ -0,0 +1,27 @@ +/* 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 + */ + +#ifndef __FFILT_H__ +#define __FFILT_H__ +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void gffilts(char* ft,double N,double fc,double fh,double* oup); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __FFILT_H__ */ diff --git a/2.3-1/src/c/signalProcessing/ffilt/gffilts.c b/2.3-1/src/c/signalProcessing/ffilt/gffilts.c new file mode 100644 index 00000000..538daf3e --- /dev/null +++ b/2.3-1/src/c/signalProcessing/ffilt/gffilts.c @@ -0,0 +1,90 @@ +/* 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 "filt_sinc.h" +#include "ffilt.h" +void gffilts(char* ft,int size,double N,double fc,double fh,double* oup) +{ + int sz=N; + double X[sz]; + double no22=(N-1)/2; + int ino22=(int)no22; + if(ft[0]=='l') + { + dfilt_sincs(N,fc,X); + int k=0; + for(k=0;k<sz;k++) + { + oup[k]=X[k]; + } + } + else if(ft[0]=='h') + { + int k=0; + dfilt_sincs(N,fc,X); + for(k=0;k<sz;k++) + { + oup[k]=-1*X[k]; + } + int id=no22; + oup[id]=1+oup[id]; + } + else if(ft[0]=='b') + { + double wc=M_PI*(fh+fc); + fc=(fh-fc)/2; + dfilt_sincs(N,fc,X); + double Y[sz]; + double k=0; + for(k=-no22;k<=no22;k++) + { + int ind; + ind=k+no22; + Y[ind]=2*cos(wc*k); + } + int j=0; + for(j=0;j<sz;j++) + { + oup[j]=X[j]*Y[j]; + } + } + else if(ft[0]=='s') + { + double wc=M_PI*(fh+fc); + fc=(fh-fc)/2; + dfilt_sincs(N,fc,X); + double Y[sz]; + double k=0; + for(k=-no22;k<=no22;k++) + { + int ind; + ind=k+no22; + Y[ind]=2*cos(wc*k); + } + int j=0; + for(j=0;j<sz;j++) + { + oup[j]=-1*X[j]*Y[j]; + } + int id=no22; + oup[id]=1+oup[id]; + } +} +/* +int main() +{ + string s; + int n; + double fl,fh; +} +*/ diff --git a/2.3-1/src/c/signalProcessing/ffilt/int_ffilt.h b/2.3-1/src/c/signalProcessing/ffilt/int_ffilt.h new file mode 100644 index 00000000..83f44827 --- /dev/null +++ b/2.3-1/src/c/signalProcessing/ffilt/int_ffilt.h @@ -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 + */ + +#ifndef __INT_FFILT_H__ +#define __INT_FFILT_H__ + +#define g0d0d0d0ffiltd2(ft,N,fc,fh,oup) gffilts(ft,N,fc,fh,oup) + +#endif /* !__INT_FFILT_H__! */ diff --git a/2.3-1/src/c/signalProcessing/filt_sinc/dfilt_sincs.c b/2.3-1/src/c/signalProcessing/filt_sinc/dfilt_sincs.c new file mode 100644 index 00000000..65aaaa65 --- /dev/null +++ b/2.3-1/src/c/signalProcessing/filt_sinc/dfilt_sincs.c @@ -0,0 +1,58 @@ +/* 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 "filt_sinc.h" +void dfilt_sincs(double N,double fc,double* oup) +{ + double no2=(N-1)/2; + int ino2=(int)no2; + double wl=fc*2*M_PI; + int sz=N; + double xn[sz]; + double i; + int l,m; + for(i=-no2;i<=no2;i++) + { + l=i+no2; + xn[l]=sin(wl*i); + } + double xd[sz]; + double j; + printf("\n"); + for(j=-no2;j<=no2;j++) + { + m=j+no2; + xd[m]=M_PI*j; + } + if(ino2==no2) + { + xn[(int)no2]=2*fc; + xd[(int)no2]=1; + } + double x[sz]; + int k; + for(k=0;k<N;k++) + { + oup[k]=xn[k]/xd[k]; + } +} +/* +int main() +{ + int n; + double fl; + n=5; + fl=0.2; + filt_sinc(n,fl); +} +*/ diff --git a/2.3-1/src/c/signalProcessing/filt_sinc/filt_sinc.h b/2.3-1/src/c/signalProcessing/filt_sinc/filt_sinc.h new file mode 100644 index 00000000..43b24151 --- /dev/null +++ b/2.3-1/src/c/signalProcessing/filt_sinc/filt_sinc.h @@ -0,0 +1,28 @@ +/* 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 + */ + +#ifndef __FILT_SINC_H__ +#define __FILT_SINC_H__ +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void u8filt_sincs(int N,double fc,double* oup); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __FILT_SINC_H */ + diff --git a/2.3-1/src/c/signalProcessing/filt_sinc/int_filt_sinc.h b/2.3-1/src/c/signalProcessing/filt_sinc/int_filt_sinc.h new file mode 100644 index 00000000..5b7b07ae --- /dev/null +++ b/2.3-1/src/c/signalProcessing/filt_sinc/int_filt_sinc.h @@ -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 + */ + +#ifndef __INT_FILT_SINC_H__ +#define __INT_FILT_SINC_H__ + +#define u80d0filt_sincd2(N,fc,oup) u8filt_sincs(N,fc,oup) + +#endif /* !__INT_FILT_SINC_H__! */ diff --git a/2.3-1/src/c/signalProcessing/fsfirlin/dfsfirlina.c b/2.3-1/src/c/signalProcessing/fsfirlin/dfsfirlina.c new file mode 100644 index 00000000..d2079f4d --- /dev/null +++ b/2.3-1/src/c/signalProcessing/fsfirlin/dfsfirlina.c @@ -0,0 +1,144 @@ +/* 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 "sincd.h" +#include "fsfirlin.h" +//#define PI 3.14159265358979 + +void dfsfirlina(double* hd,int size,double flag,double* hst) +{ + int n1=size,n; + if( n1%2==0) + { + n=2*n1; + } + else + { + n=2*n1+1; + } + double scd[8*n+1]; + //STRAT SINCD + double npt=4*n; + int sz=4*n; + double PI=M_PI; + double pas=PI/npt; + double om[sz+1]; + int i; + for(i=0;i<=sz;i++) + { + om[i]=i*pas; + } + double eps=pow(-1,(n-1)); + double s1[sz+1],s2[sz+1]; + double s[2*(sz)+1]; + double sr[2*(sz)+1]; + if(flag==1) + { + int j,k; + for(j=0;j<=4*n;j++) + { + s1[j]=sin(n*om[j]); + s2[j]=sin(om[j]); + } + s1[0]=n; + s2[0]=1; + s1[sz]=n*eps; + s2[sz]=1; + + for(k=0;k<=4*n;k++) + { + s[k]=s1[k]/s2[k]; + } + + int x; + for(x=0;x<=4*n;x++) + { + scd[sz-x]=s[x]; + } + int l; + for(l=4*n+1;l<=8*n;l++) + { + scd[l]=s[l-(sz)]; + } + int m; + for(m=0;m<=8*n;m++) + { + scd[m]=scd[m]/n; + } + } + else + { + int a; + for(a=0;a<=4*n;a++) + { + om[a]=om[a]-(PI/(2*n)); + } + int j,k; + for(j=0;j<=4*n;j++) + { + s1[j]=sin(n*om[j]); + s2[j]=sin(om[j]); + } + s1[2]=n; + s2[2]=1; + for(k=0;k<=4*n;k++) + { + s[k]=s1[k]/s2[k]; + } + int m; + for(m=0;m<=4*n;m++) + { + scd[m]=(eps*s[m])/n; + } + int l; + for(l=4*n+1;l<=8*n;l++) + { + scd[l]=s[l-(sz)]/n; + } + } + //END SINCD + int ii; + for(ii=4*n;ii<=6*n;ii++) + { + hst[ii-(4*n)]=hd[0]*scd[ii]; + } + + int epsi; + epsi=pow(-1,n-1); + int jj; + for(jj=1;jj<=(n1-1);jj++) + { + double tp1[2*n+1]; + double tp2[2*n+1]; + int k,l; + for(k=(-4*jj+4*n);k<=(-4*jj+6*n);k++) + { + tp1[k-(-4*jj+4*n)]=hd[jj]*scd[k]; + } + + for(l=(4*jj);l<=(4*jj+2*n);l++) + { + tp2[l-(4*jj)]=hd[jj]*(epsi*scd[l]); + } + int m; + for(m=0;m<=2*n;m++) + { + hst[m]=hst[m]+(tp1[m]+tp2[m]); + } + + } + + +} diff --git a/2.3-1/src/c/signalProcessing/fsfirlin/fsfirlin.h b/2.3-1/src/c/signalProcessing/fsfirlin/fsfirlin.h new file mode 100644 index 00000000..7337cbfe --- /dev/null +++ b/2.3-1/src/c/signalProcessing/fsfirlin/fsfirlin.h @@ -0,0 +1,26 @@ +/* Copyright (C) 2016 - 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 + */ + +#ifndef __FSFIRLIN_H__ +#define __FSFIRLIN_H__ +#include "types.h" +#include "sincd.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void dfsfirlina(double* hd,int size,int flag,double* hst); + +#ifdef __cplusplus +} /* extern "C" */ +#endif diff --git a/2.3-1/src/c/signalProcessing/fsfirlin/int_fsfirlin.h b/2.3-1/src/c/signalProcessing/fsfirlin/int_fsfirlin.h new file mode 100644 index 00000000..857dae8c --- /dev/null +++ b/2.3-1/src/c/signalProcessing/fsfirlin/int_fsfirlin.h @@ -0,0 +1,18 @@ +/* Copyright (C) 2016 - 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 + */ + +#ifndef __INT_FSFIRLIN_H__ +#define __INT_FSFIRLIN_H__ + +#define d2u80fsfirlind2(hd,size,flag,hst) dfsfirlina(hd,size[1],flag,hst) + +#endif /* !__INT_FSFIRLIN_H__! */ diff --git a/2.3-1/src/c/signalProcessing/includes/buttmag.h b/2.3-1/src/c/signalProcessing/includes/buttmag.h new file mode 100644 index 00000000..ef17b7ea --- /dev/null +++ b/2.3-1/src/c/signalProcessing/includes/buttmag.h @@ -0,0 +1,29 @@ +/* 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 + */ + +#ifndef __BUTTMAG_H__ +#define __BUTTMAG_H__ +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void dbuttmags(double order, double omegac, double* sample, int size,double* out); +void u8buttmags(int order, int omegac, double* sample, int size,double* out); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __BUTTMAG_H__ */ + diff --git a/2.3-1/src/c/signalProcessing/includes/cheb1mag.h b/2.3-1/src/c/signalProcessing/includes/cheb1mag.h new file mode 100644 index 00000000..369ee4ce --- /dev/null +++ b/2.3-1/src/c/signalProcessing/includes/cheb1mag.h @@ -0,0 +1,27 @@ +/* Copyright (C) 2016 - 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 + */ + +#ifndef __CHEB1MAG_H__ +#define __CHEB1MAG_H__ +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void dcheb1mags(double n, double omegac, double epsilon, double* sample,int size,double* out); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __CHEB1MAG_H__ */ diff --git a/2.3-1/src/c/signalProcessing/includes/cheb2mag.h b/2.3-1/src/c/signalProcessing/includes/cheb2mag.h new file mode 100644 index 00000000..0516ca51 --- /dev/null +++ b/2.3-1/src/c/signalProcessing/includes/cheb2mag.h @@ -0,0 +1,27 @@ +/* Copyright (C) 2016 - 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 + */ + +#ifndef __CHEB2MAG_H__ +#define __CHEB2MAG_H__ +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void dcheb2mags(double n,double omegar, double A, double* sample,int size,double* oup); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __CHEB2MAG_H__ */ diff --git a/2.3-1/src/c/signalProcessing/includes/ffilt.h b/2.3-1/src/c/signalProcessing/includes/ffilt.h new file mode 100644 index 00000000..f38df6e6 --- /dev/null +++ b/2.3-1/src/c/signalProcessing/includes/ffilt.h @@ -0,0 +1,27 @@ +/* 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 + */ + +#ifndef __FFILT_H__ +#define __FFILT_H__ +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void gffilts(char* ft,int size,double N,double fc,double fh,double* oup); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __FFILT_H__ */ diff --git a/2.3-1/src/c/signalProcessing/includes/filt_sinc.h b/2.3-1/src/c/signalProcessing/includes/filt_sinc.h new file mode 100644 index 00000000..095ca91f --- /dev/null +++ b/2.3-1/src/c/signalProcessing/includes/filt_sinc.h @@ -0,0 +1,28 @@ +/* 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 + */ + +#ifndef __FILT_SINC_H__ +#define __FILT_SINC_H__ +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void dfilt_sincs(double N,double fc,double* oup); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __FILT_SINC_H */ + diff --git a/2.3-1/src/c/signalProcessing/includes/fsfirlin.h b/2.3-1/src/c/signalProcessing/includes/fsfirlin.h new file mode 100644 index 00000000..cf5fbbd0 --- /dev/null +++ b/2.3-1/src/c/signalProcessing/includes/fsfirlin.h @@ -0,0 +1,28 @@ +/* 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 + */ + +#ifndef __FSFIRLIN_H__ +#define __FSFIRLIN_H__ +#include "types.h" +#include "sincd.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void dfsfirlina(double* hd,int size,double flag,double* hst); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__FSFIRLIN_H__*/ diff --git a/2.3-1/src/c/signalProcessing/includes/modsn.h b/2.3-1/src/c/signalProcessing/includes/modsn.h new file mode 100644 index 00000000..d91dd9d3 --- /dev/null +++ b/2.3-1/src/c/signalProcessing/includes/modsn.h @@ -0,0 +1,31 @@ +/* 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 + */ + +#ifndef __MODSN_H__ +#define __MODSN_H__ +#include "types.h" +#include "doubleComplex.h" + +#ifdef __cplusplus +extern "C" { +#endif + +double dmodsns(double uu, double emmc); +doubleComplex zmodsns(doubleComplex uu,double emmc); +void dmodsna(double* uu,int size,double emmc,double* sn); +void zmodsna(doubleComplex* uu,int size,double emmc,doubleComplex* sn); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __MODSN_H__ */ diff --git a/2.3-1/src/c/signalProcessing/includes/sincd.h b/2.3-1/src/c/signalProcessing/includes/sincd.h new file mode 100644 index 00000000..9b7a3607 --- /dev/null +++ b/2.3-1/src/c/signalProcessing/includes/sincd.h @@ -0,0 +1,29 @@ +/* Copyright (C) 2016 - 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 + */ + +#ifndef __SINCD_H__ +#define __SINCD_H__ +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void dsincds(double n,double flg,double* oup); +void u8sincds(int n,int flg,double* oup); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __SINCD_H__ */ + diff --git a/2.3-1/src/c/signalProcessing/includes/zpbutt.h b/2.3-1/src/c/signalProcessing/includes/zpbutt.h new file mode 100644 index 00000000..9eb88ad4 --- /dev/null +++ b/2.3-1/src/c/signalProcessing/includes/zpbutt.h @@ -0,0 +1,29 @@ +/* Copyright (C) 2016 - 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 + */ + +#ifndef __ZPBUTT_H__ +#define __ZPBUTT_H__ +#include "types.h" +#include "doubleComplex.h" + +#ifdef __cplusplus +extern "C" { +#endif + +double dzpbutts(double n,double fl,doubleComplex* out); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __ZPBUTT_H__ */ + diff --git a/2.3-1/src/c/signalProcessing/includes/zpch1.h b/2.3-1/src/c/signalProcessing/includes/zpch1.h new file mode 100644 index 00000000..fbe850cc --- /dev/null +++ b/2.3-1/src/c/signalProcessing/includes/zpch1.h @@ -0,0 +1,28 @@ +/* Copyright (C) 2016 - 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 + */ + +#ifndef __ZPCH1_H__ +#define __ZPCH1_H__ +#include "types.h" +#include "doubleComplex.h" + +#ifdef __cplusplus +extern "C" { +#endif + +double dzpch1s(double N,double e,double wc,doubleComplex* out); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __ZPCH1_H__ */ diff --git a/2.3-1/src/c/signalProcessing/includes/zpch2.h b/2.3-1/src/c/signalProcessing/includes/zpch2.h new file mode 100644 index 00000000..d7c1c647 --- /dev/null +++ b/2.3-1/src/c/signalProcessing/includes/zpch2.h @@ -0,0 +1,28 @@ +/* Copyright (C) 2016 - 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 + */ + +#ifndef __ZPCH2_H__ +#define __ZPCH2_H__ +#include "types.h" +#include "doubleComplex.h" + +#ifdef __cplusplus +extern "C" { +#endif + +double dzpch2s(double N, double A, double omegar,doubleComplex* zeros,doubleComplex* poles); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __ZPCH2_H__ */ diff --git a/2.3-1/src/c/signalProcessing/interfaces/int_buttmag.h b/2.3-1/src/c/signalProcessing/interfaces/int_buttmag.h new file mode 100644 index 00000000..4a33fafe --- /dev/null +++ b/2.3-1/src/c/signalProcessing/interfaces/int_buttmag.h @@ -0,0 +1,19 @@ +/* Copyright (C) 2016 - 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 + */ + +#ifndef __INT_BUTTMAG_H__ +#define __INT_BUTTMAG_H__ + +#define d0d0d2buttmagd2(order,omegac,sample,size,out) dbuttmags(order,omegac,sample,size[1],out) +#define u80u80d2buttmagd2(order,omegac,sample,size,out) u8buttmags(order,omegac,sample,size[1],out) + +#endif /* !INT_BUTTMAG_H__! */ diff --git a/2.3-1/src/c/signalProcessing/interfaces/int_cheb1mag.h b/2.3-1/src/c/signalProcessing/interfaces/int_cheb1mag.h new file mode 100644 index 00000000..764e8c79 --- /dev/null +++ b/2.3-1/src/c/signalProcessing/interfaces/int_cheb1mag.h @@ -0,0 +1,18 @@ +/* Copyright (C) 2016 - 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 + */ + +#ifndef __INT_CHEB1MAG_H__ +#define __INT_CHEB1MAG_H__ + +#define d0d0d0d2cheb1magd2(n,omegac,epsilon,sample,size,out) dcheb1mags(n,omegac,epsilon,sample,size[1],out) + +#endif /* !__INT_CHEB1MAG_H__! */ diff --git a/2.3-1/src/c/signalProcessing/interfaces/int_cheb2mag.h b/2.3-1/src/c/signalProcessing/interfaces/int_cheb2mag.h new file mode 100644 index 00000000..b63db04d --- /dev/null +++ b/2.3-1/src/c/signalProcessing/interfaces/int_cheb2mag.h @@ -0,0 +1,18 @@ +/* Copyright (C) 2016 - 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 + */ + +#ifndef __INT_CHEB2MAG_H__ +#define __INT_CHEB2MAG_H__ + +#define d0d0d0d2cheb2magd2(n,omegar,A,sample,size,oup) dcheb2mags(n,omegar,A,sample,size[1],oup) + +#endif /* !__INT_CHEB2MAG_H__! */ diff --git a/2.3-1/src/c/signalProcessing/interfaces/int_ffilt.h b/2.3-1/src/c/signalProcessing/interfaces/int_ffilt.h new file mode 100644 index 00000000..273b98f7 --- /dev/null +++ b/2.3-1/src/c/signalProcessing/interfaces/int_ffilt.h @@ -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 + */ + +#ifndef __INT_FFILT_H__ +#define __INT_FFILT_H__ + +#define g2d0d0d0ffiltd2(ft,size,N,fc,fh,oup) gffilts(ft,size[1],N,fc,fh,oup) + +#endif /* !__INT_FFILT_H__! */ diff --git a/2.3-1/src/c/signalProcessing/interfaces/int_filt_sinc.h b/2.3-1/src/c/signalProcessing/interfaces/int_filt_sinc.h new file mode 100644 index 00000000..f90d0a62 --- /dev/null +++ b/2.3-1/src/c/signalProcessing/interfaces/int_filt_sinc.h @@ -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 + */ + +#ifndef __INT_FILT_SINC_H__ +#define __INT_FILT_SINC_H__ + +#define d0d0filt_sincd2(N,fc,oup) dfilt_sincs(N,fc,oup) + +#endif /* !__INT_FILT_SINC_H__! */ diff --git a/2.3-1/src/c/signalProcessing/interfaces/int_fsfirlin.h b/2.3-1/src/c/signalProcessing/interfaces/int_fsfirlin.h new file mode 100644 index 00000000..3f6fb6e0 --- /dev/null +++ b/2.3-1/src/c/signalProcessing/interfaces/int_fsfirlin.h @@ -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 + */ + +#ifndef __INT_FSFIRLIN_H__ +#define __INT_FSFIRLIN_H__ + +#define d2d0fsfirlind2(hd,size,flag,hst) dfsfirlina(hd,size[1],flag,hst) + +#endif /* !__INT_FSFIRLIN_H__! */ diff --git a/2.3-1/src/c/signalProcessing/interfaces/int_modsn.h b/2.3-1/src/c/signalProcessing/interfaces/int_modsn.h new file mode 100644 index 00000000..0d32eb06 --- /dev/null +++ b/2.3-1/src/c/signalProcessing/interfaces/int_modsn.h @@ -0,0 +1,21 @@ +/* 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 + */ + +#ifndef __INT_MODSN_H__ +#define __INT_MODSN_H__ + +#define d0d0modsnd0(uu,emmc) dmodsns(uu,emmc) +#define z0d0modsnz0(uu,emmc) zmodsns(uu,emmc) +#define d2d0modsnd2(uu,size,emmc,sn) dmodsna(uu,size[1],emmc,sn) +#define z2d0modsnz2(uu,size,emmc,sn) zmodsna(uu,size[1],emmc,sn) + +#endif /* !INT_MODSN_H__! */ diff --git a/2.3-1/src/c/signalProcessing/interfaces/int_sincd.h b/2.3-1/src/c/signalProcessing/interfaces/int_sincd.h new file mode 100644 index 00000000..73136730 --- /dev/null +++ b/2.3-1/src/c/signalProcessing/interfaces/int_sincd.h @@ -0,0 +1,19 @@ +/* Copyright (C) 2016 - 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 + */ + +#ifndef __INT_SINCD_H__ +#define __INT_SINCD_H__ + +#define d0d0sincdd2(n,flg,oup) dsincds(n,flg,oup) +#define u80u80sincdd2(n,flg,oup) u8sincds(n,flg,oup) + +#endif /* !__INT_SINCD_H__! */ diff --git a/2.3-1/src/c/signalProcessing/interfaces/int_zpbutt.h b/2.3-1/src/c/signalProcessing/interfaces/int_zpbutt.h new file mode 100644 index 00000000..775c1026 --- /dev/null +++ b/2.3-1/src/c/signalProcessing/interfaces/int_zpbutt.h @@ -0,0 +1,19 @@ +/* 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 + */ + +#ifndef __INT_ZPBUTT_H__ +#define __INT_ZPBUTT_H__ + +#define d0d0zpbuttz2d0(n,fl,out) dzpbutts(n,fl,out) + +#endif /* !INT_ZPBUTT_H__! */ + diff --git a/2.3-1/src/c/signalProcessing/interfaces/int_zpch1.h b/2.3-1/src/c/signalProcessing/interfaces/int_zpch1.h new file mode 100644 index 00000000..429e7c36 --- /dev/null +++ b/2.3-1/src/c/signalProcessing/interfaces/int_zpch1.h @@ -0,0 +1,18 @@ +/* Copyright (C) 2016 - 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 + */ + +#ifndef __INT_ZPCH1_H__ +#define __INT_ZPCH1_H__ + +#define d0d0d0zpch1z2d0(N,e,wc,out) dzpch1s(N,e,wc,out) + +#endif /* !INT_ZPCH1_H__! */ diff --git a/2.3-1/src/c/signalProcessing/interfaces/int_zpch2.h b/2.3-1/src/c/signalProcessing/interfaces/int_zpch2.h new file mode 100644 index 00000000..fcb12a7c --- /dev/null +++ b/2.3-1/src/c/signalProcessing/interfaces/int_zpch2.h @@ -0,0 +1,18 @@ +/* Copyright (C) 2016 - 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 + */ + +#ifndef __INT_ZPCH2_H__ +#define __INT_ZPCH2_H__ + +#define d0d0d0zpch2z2z2d0(N,A,omegar,zeros,poles) dzpch2s(N,A,omegar,zeros,poles) + +#endif /* !INT_ZPCH2_H__! */ diff --git a/2.3-1/src/c/signalProcessing/sincd/dsincds.c b/2.3-1/src/c/signalProcessing/sincd/dsincds.c new file mode 100644 index 00000000..1475d8de --- /dev/null +++ b/2.3-1/src/c/signalProcessing/sincd/dsincds.c @@ -0,0 +1,99 @@ +/* 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 "sincd.h" +//#define PI 3.14159265358979 +void dsincds(double n,double flg,double* oup) +{ + double npt=4*n; + int sz=4*n; + double PI=M_PI; + double pas=PI/npt; + double om[sz+1]; + int i; + for(i=0;i<=sz;i++) + { + om[i]=i*pas; + } + double eps=pow(-1,(n-1)); + double s1[sz+1],s2[sz+1]; + double s[2*(sz)+1]; + double sr[2*(sz)+1]; + if(flg==1) + { + int j,k; + for(j=0;j<=4*n;j++) + { + s1[j]=sin(n*om[j]); + s2[j]=sin(om[j]); + } + s1[0]=n; + s2[0]=1; + s1[sz]=n*eps; + s2[sz]=1; + + for(k=0;k<=4*n;k++) + { + s[k]=s1[k]/s2[k]; + } + + int x; + for(x=0;x<=4*n;x++) + { + oup[sz-x]=s[x]; + } + int l; + for(l=4*n+1;l<=8*n;l++) + { + oup[l]=s[l-(sz)]; + } + int m; + for(m=0;m<=8*n;m++) + { + oup[m]=oup[m]/n; + } + } + else + { + int a; + for(a=0;a<=4*n;a++) + { + om[a]=om[a]-(PI/(2*n)); + } + int j,k; + for(j=0;j<=4*n;j++) + { + s1[j]=sin(n*om[j]); + s2[j]=sin(om[j]); + } + s1[2]=n; + s2[2]=1; + for(k=0;k<=4*n;k++) + { + s[k]=s1[k]/s2[k]; + } + int m; + for(m=0;m<=4*n;m++) + { + oup[m]=(eps*s[m])/n; + } + int l; + for(l=4*n+1;l<=8*n;l++) + { + oup[l]=s[l-(sz)]/n; + } + + } +} + diff --git a/2.3-1/src/c/signalProcessing/sincd/int_sincd.h b/2.3-1/src/c/signalProcessing/sincd/int_sincd.h new file mode 100644 index 00000000..a404978b --- /dev/null +++ b/2.3-1/src/c/signalProcessing/sincd/int_sincd.h @@ -0,0 +1,18 @@ +/* Copyright (C) 2016 - 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 + */ + +#ifndef __INT_SINCD_H__ +#define __INT_SINCD_H__ + +#define u80sincdd2(n,flg,oup) u8sincds(n,flg,oup) + +#endif /* !__INT_SINCD_H__! */ diff --git a/2.3-1/src/c/signalProcessing/sincd/sincd.h b/2.3-1/src/c/signalProcessing/sincd/sincd.h new file mode 100644 index 00000000..2df85a87 --- /dev/null +++ b/2.3-1/src/c/signalProcessing/sincd/sincd.h @@ -0,0 +1,28 @@ +/* Copyright (C) 2016 - 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 + */ + +#ifndef __SINCD_H__ +#define __SINCD_H__ +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void u8sincds(int n,int flg,double* oup); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __SINCD_H__ */ + diff --git a/2.3-1/src/c/signalProcessing/sincd/u8sincds.c b/2.3-1/src/c/signalProcessing/sincd/u8sincds.c new file mode 100644 index 00000000..d03f48ae --- /dev/null +++ b/2.3-1/src/c/signalProcessing/sincd/u8sincds.c @@ -0,0 +1,98 @@ +/* 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 "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 om[sz+1]; + int i; + //om[0]=0; + for(i=0;i<=sz;i++) + { + om[i]=i*pas; + } + double eps=pow(-1,(n-1)); + double s1[sz+1],s2[sz+1]; + double s[2*(sz)+1]; + double sr[2*(sz)+1]; + if(flg==1) + { + int j,k; + for(j=0;j<=4*n;j++) + { + s1[j]=sin(n*om[j]); + s2[j]=sin(om[j]); + } + s1[0]=n; + s2[0]=1; + s1[sz]=n*eps; + s2[sz]=1; + + for(k=0;k<=4*n;k++) + { + s[k]=s1[k]/s2[k]; + } + + int x; + for(x=0;x<=4*n;x++) + { + oup[sz-x]=s[x]; + } + int l; + for(l=4*n+1;l<=8*n;l++) + { + oup[l]=s[l-(sz)]; + } + int m; + for(m=0;m<=8*n;m++) + { + oup[m]=oup[m]/n; + } + } + else + { + int a; + for(a=0;a<=4*n;a++) + { + om[a]=om[a]-(PI/(2*n)); + } + int j,k; + for(j=0;j<=4*n;j++) + { + s1[j]=sin(n*om[j]); + s2[j]=sin(om[j]); + } + s1[2]=n; + s2[2]=1; + for(k=0;k<=4*n;k++) + { + s[k]=s1[k]/s2[k]; + } + int m; + for(m=0;m<=4*n;m++) + { + oup[m]=(eps*s[m])/n; + } + int l; + for(l=4*n+1;l<=8*n;l++) + { + oup[l]=s[l-(sz)]/n; + } + + } +} diff --git a/2.3-1/src/c/signalProcessing/zpbutt/dzpbutts.c b/2.3-1/src/c/signalProcessing/zpbutt/dzpbutts.c new file mode 100644 index 00000000..33f22af9 --- /dev/null +++ b/2.3-1/src/c/signalProcessing/zpbutt/dzpbutts.c @@ -0,0 +1,33 @@ +/* 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 "zpbutt.h" +#define PI 3.14159265 +double dzpbutts(double n,double fl,doubleComplex* out) +{ + double e= PI/(2.0*(n)); + int k; + double rl,cpx,gain; + for(k=1;k<=n;k++) + { + double v=2.0*(double)k+(n)-1.0; + rl=(fl)*cos(e*v); + cpx=(fl)*sin(e*v); + out[k-1]=DoubleComplex(rl,cpx); + } + gain=pow(fl,n); + +return gain; + +} + diff --git a/2.3-1/src/c/signalProcessing/zpbutt/int_zpbutt.h b/2.3-1/src/c/signalProcessing/zpbutt/int_zpbutt.h new file mode 100644 index 00000000..72eae8a2 --- /dev/null +++ b/2.3-1/src/c/signalProcessing/zpbutt/int_zpbutt.h @@ -0,0 +1,19 @@ +/* Copyright (C) 2016 - 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 + */ + +#ifndef __INT_ZPBUTT_H__ +#define __INT_ZPBUTT_H__ + +#define d0d0zpbuttzada(n,fl,out,gain) dzpbutts(n,fl,out,gain) + +#endif /* !INT_ZPBUTT_H__ */ + diff --git a/2.3-1/src/c/signalProcessing/zpbutt/zpbutt.h b/2.3-1/src/c/signalProcessing/zpbutt/zpbutt.h new file mode 100644 index 00000000..6883942c --- /dev/null +++ b/2.3-1/src/c/signalProcessing/zpbutt/zpbutt.h @@ -0,0 +1,27 @@ +/* Copyright (C) 2016 - 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 + */ + +#ifndef __ZPBUTT_H__ +#define __ZPBUTT_H__ +#include "types.h" +#include "doubleComplex.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void dzpbutts(double* n,double* fl,doublecomplex* out,double* gain); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + diff --git a/2.3-1/src/c/signalProcessing/zpch1/dzpch1s.c b/2.3-1/src/c/signalProcessing/zpch1/dzpch1s.c new file mode 100644 index 00000000..ab7b6332 --- /dev/null +++ b/2.3-1/src/c/signalProcessing/zpch1/dzpch1s.c @@ -0,0 +1,53 @@ +/* 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 "zpch1.h" +#include "multiplication.h" +#include "conj.h" +#include "abs.h" +#define PI 3.14159265 +double dzpch1s(double N,double e,double wc,doubleComplex* out) +{ + doubleComplex accumulate,tp; + double B,r,R,gain,realVal; + double temp=sqrt(1+e*e); + + B=pow((temp+1)/e,1/N); + + r=wc*((B*B-1)/(2*B)); + R=wc*((B*B+1)/(2*B)); + + int k; + double t1=1; + double t2=0; + accumulate=DoubleComplex(t1,t2); + for(k=0;k<N;k++) + { + double theta; + theta=(PI/2)+((2*k+1)*PI)/(2*N); + double xk,yk; + xk=r*cos(theta); + yk=R*sin(theta); + out[k]=DoubleComplex(xk,yk); + tp=DoubleComplex(xk,yk); + accumulate=zmuls(accumulate,tp); + } + + realVal=zreals(accumulate); + gain=dabss(realVal); + if (N==2*(int)(N/2)) + gain=gain/sqrt(1+e*e); +return gain; + +} + diff --git a/2.3-1/src/c/signalProcessing/zpch1/int_zpch1.h b/2.3-1/src/c/signalProcessing/zpch1/int_zpch1.h new file mode 100644 index 00000000..8933d1a2 --- /dev/null +++ b/2.3-1/src/c/signalProcessing/zpch1/int_zpch1.h @@ -0,0 +1,18 @@ +/* Copyright (C) 2016 - 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 + */ + +#ifndef __INT_ZPCH1_H__ +#define __INT_ZPCH1_H__ + +#define d0d0d0zpch1z2d0(N,e,wc) dzpch1s(N,e,wc) + +#endif /* !INT_ZPCH1_H__! */ diff --git a/2.3-1/src/c/signalProcessing/zpch1/zpch1.h b/2.3-1/src/c/signalProcessing/zpch1/zpch1.h new file mode 100644 index 00000000..fbe850cc --- /dev/null +++ b/2.3-1/src/c/signalProcessing/zpch1/zpch1.h @@ -0,0 +1,28 @@ +/* Copyright (C) 2016 - 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 + */ + +#ifndef __ZPCH1_H__ +#define __ZPCH1_H__ +#include "types.h" +#include "doubleComplex.h" + +#ifdef __cplusplus +extern "C" { +#endif + +double dzpch1s(double N,double e,double wc,doubleComplex* out); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __ZPCH1_H__ */ diff --git a/2.3-1/src/c/signalProcessing/zpch2/dzpch2s.c b/2.3-1/src/c/signalProcessing/zpch2/dzpch2s.c new file mode 100644 index 00000000..22a46a64 --- /dev/null +++ b/2.3-1/src/c/signalProcessing/zpch2/dzpch2s.c @@ -0,0 +1,63 @@ +/* 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 "zpch2.h" +#include "multiplication.h" +#include "abs.h" +#include "division.h" +#define PI 3.14159265 +double dzpch2s(double N, double A, double omegar,doubleComplex* zeros,doubleComplex* poles) +{ + int k,j; + double e,xk,realVal,gain; + doubleComplex accumulate1,accumulate2,tp1,tp2; + accumulate1=DoubleComplex(1,0); + accumulate2=DoubleComplex(1,0); + int ct=0; + for(k=1;k<=N;k++) + { + if(k!=((N+1)/2)) + { + ct++; + double num=PI*(2*k-1); + double den=2*N; + xk=cos(num/den); + double sk=omegar/xk; + zeros[k-1]=DoubleComplex(0,sk); + tp1=DoubleComplex(0,sk); + accumulate1=zmuls(accumulate1,tp1); + } + } + for(j=1;j<=N;j++) + { + double num=PI*(2*j-1); + double den=2*N; + double xk1=num/den; + double Gamma=pow((A+sqrt(A*A-1)),(1/N)); + double alpha=-((Gamma-1/Gamma)/2)*sin(xk1); + double Beta=((Gamma+1/Gamma)/2)*cos(xk1); + double normal=alpha*alpha+Beta*Beta; + poles[j-1]=DoubleComplex((omegar*alpha)/normal,(omegar*Beta)/normal); + tp2=DoubleComplex((omegar*alpha)/normal,(omegar*Beta)/normal); + accumulate2=zmuls(accumulate2,tp2); + } + double qt; + double ra2=zreals(accumulate2); + double ra1=zreals(accumulate1); + qt=dldivs(ra1,ra2); + gain=dabss(qt); + + return gain; + +} + diff --git a/2.3-1/src/c/signalProcessing/zpch2/int_zpch2.h b/2.3-1/src/c/signalProcessing/zpch2/int_zpch2.h new file mode 100644 index 00000000..683a7614 --- /dev/null +++ b/2.3-1/src/c/signalProcessing/zpch2/int_zpch2.h @@ -0,0 +1,18 @@ +/* Copyright (C) 2016 - 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 + */ + +#ifndef __INT_ZPCH2_H__ +#define __INT_ZPCH2_H__ + +#define d0d0d0zpch2z2z2(N,A,omegar,zeros,poles) dzpch2s(N,A,omegar,zeros,poles) + +#endif /* !INT_ZPCH2_H__! */ diff --git a/2.3-1/src/c/signalProcessing/zpch2/zpch2.h b/2.3-1/src/c/signalProcessing/zpch2/zpch2.h new file mode 100644 index 00000000..0d191d5c --- /dev/null +++ b/2.3-1/src/c/signalProcessing/zpch2/zpch2.h @@ -0,0 +1,28 @@ +/* Copyright (C) 2016 - 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 + */ + +#ifndef __ZPCH2_H__ +#define __ZPCH2_H__ +#include "types.h" +#include "doubleComplex.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void dzpch2s(double N, double A, double omegar,doubleComplex* zeros,doubleComplex* poles); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __ZPCH2_H__ */ diff --git a/2.3-1/src/c/string/ascii/ascii.h b/2.3-1/src/c/string/ascii/ascii.h new file mode 100644 index 00000000..2d46b740 --- /dev/null +++ b/2.3-1/src/c/string/ascii/ascii.h @@ -0,0 +1,25 @@ +/* Copyright (C) 2016 - 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 + */ +#ifndef __ASCII_H__ +#define __ASCII_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +void gasciia(char* str,int size, int* out); + +#ifdef __cplusplus +}/* extern "C" */ +#endif + +#endif /*___ASCII_H__*/ diff --git a/2.3-1/src/c/string/ascii/dasciia.c b/2.3-1/src/c/string/ascii/dasciia.c new file mode 100644 index 00000000..d2452880 --- /dev/null +++ b/2.3-1/src/c/string/ascii/dasciia.c @@ -0,0 +1,21 @@ +/* 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 "ascii.h" +void dasciia(double* inp,int size,char* oup) +{ + int i; + for(i=0;i<size;i++) + { + oup[i]=(char)inp[i]; + } +} diff --git a/2.3-1/src/c/string/ascii/gasciia.c b/2.3-1/src/c/string/ascii/gasciia.c new file mode 100644 index 00000000..2cd80bfb --- /dev/null +++ b/2.3-1/src/c/string/ascii/gasciia.c @@ -0,0 +1,26 @@ +/* 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> +/* This is the "asciiconv" function which converts the given string + into its ascii equivalent. +*/ +#include "ascii.h" +void gasciia(char *str,int size,int* oup) +{ + + for(int i=0;i<size;i++) + { + *(oup+i)=(int)str[i]; + } + +} + diff --git a/2.3-1/src/c/string/ascii/int_ascii.h b/2.3-1/src/c/string/ascii/int_ascii.h new file mode 100644 index 00000000..36d83f8e --- /dev/null +++ b/2.3-1/src/c/string/ascii/int_ascii.h @@ -0,0 +1,25 @@ +/* Copyright (C) 2016 - 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 + */ +#ifndef __INT_ASCII_H__ +#define __INT_ASCII_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#define g2asciiu82(str,size,oup) gasciia(str,size,oup) + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_ASCII_H__*/ diff --git a/2.3-1/src/c/string/includes/ascii.h b/2.3-1/src/c/string/includes/ascii.h new file mode 100644 index 00000000..fcf969da --- /dev/null +++ b/2.3-1/src/c/string/includes/ascii.h @@ -0,0 +1,27 @@ +/* Copyright (C) 2016 - 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 + */ +#ifndef __ASCII_H__ +#define __ASCII_H__ +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void gasciia(char* str,int size,int* oup); +void dasciia(double* inp,int size,char* oup); + +#ifdef __cplusplus +}/* extern "C" */ +#endif + +#endif /*___ASCII_H__*/ diff --git a/2.3-1/src/c/string/includes/strchr.h b/2.3-1/src/c/string/includes/strchr.h new file mode 100644 index 00000000..7e306413 --- /dev/null +++ b/2.3-1/src/c/string/includes/strchr.h @@ -0,0 +1,25 @@ +/* Copyright (C) 2016 - 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 + */ +#ifndef __STRCHR_H__ +#define __STRCHR_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +void gstrchra(char* str,int size, char* key,int size2, char* out); + +#ifdef __cplusplus +}/* extern "C" */ +#endif + +#endif /*__STRCHR_H__*/ diff --git a/2.3-1/src/c/string/includes/strcspn.h b/2.3-1/src/c/string/includes/strcspn.h new file mode 100644 index 00000000..aa91fb47 --- /dev/null +++ b/2.3-1/src/c/string/includes/strcspn.h @@ -0,0 +1,26 @@ +/* Copyright (C) 2016 - 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 + */ +#ifndef __STRCSPN_H__ +#define __STRCSPN_H__ +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +uint8 gstrcspna(char* str1,int size1,char* str2,int size2); + +#ifdef __cplusplus +}/* extern "C" */ +#endif + +#endif /* __STRCSPN_H */ diff --git a/2.3-1/src/c/string/includes/strncpy.h b/2.3-1/src/c/string/includes/strncpy.h new file mode 100644 index 00000000..f2aa705b --- /dev/null +++ b/2.3-1/src/c/string/includes/strncpy.h @@ -0,0 +1,25 @@ +/* Copyright (C) 2016 - 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 + */ +#ifndef __STRNCPY_H__ +#define __STRNCPY_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +void gstrncpya(char* str,int size,double key,char* oup); + +#ifdef __cplusplus +}/* extern "C" */ +#endif + +#endif /*__STRNCPY_H__*/ diff --git a/2.3-1/src/c/string/includes/strspn.h b/2.3-1/src/c/string/includes/strspn.h new file mode 100644 index 00000000..427caa4c --- /dev/null +++ b/2.3-1/src/c/string/includes/strspn.h @@ -0,0 +1,26 @@ +/* Copyright (C) 2016 - 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 + */ +#ifndef __STRSPN_H__ +#define __STRSPN_H__ +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +uint8 gstrspna(char* str1,int size1,char* str2,int size2); + +#ifdef __cplusplus +}/* extern "C" */ +#endif + +#endif /* __STRSPN_H */ diff --git a/2.3-1/src/c/string/interfaces/int_ascii.h b/2.3-1/src/c/string/interfaces/int_ascii.h new file mode 100644 index 00000000..87b1b125 --- /dev/null +++ b/2.3-1/src/c/string/interfaces/int_ascii.h @@ -0,0 +1,26 @@ +/* Copyright (C) 2016 - 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 + */ +#ifndef __INT_ASCII_H__ +#define __INT_ASCII_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#define g2asciiu82(str,size,oup) gasciia(str,size[1],oup) +#define d2asciig2(inp,size,oup) dasciia(inp,size[1],oup) + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_ASCII_H__*/ diff --git a/2.3-1/src/c/string/interfaces/int_strchr.h b/2.3-1/src/c/string/interfaces/int_strchr.h new file mode 100644 index 00000000..8747545b --- /dev/null +++ b/2.3-1/src/c/string/interfaces/int_strchr.h @@ -0,0 +1,25 @@ +/* Copyright (C) 2016 - 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 + */ +#ifndef __INT_STRCHR_H__ +#define __INT_STRCHR_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#define g2g2strchrg2(str,size,key,size2,out) gstrchra(str,size[1],key,size2[1],out) + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_STRCHR_H__*/ diff --git a/2.3-1/src/c/string/interfaces/int_strcspn.h b/2.3-1/src/c/string/interfaces/int_strcspn.h new file mode 100644 index 00000000..74c6379f --- /dev/null +++ b/2.3-1/src/c/string/interfaces/int_strcspn.h @@ -0,0 +1,25 @@ +/* Copyright (C) 2016 - 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 + */ +#ifndef __INT_STRCSPN_H__ +#define __INT_STRCSPN_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#define g2g2strcspnu80(str1,size1,str2,size2) gstrcspna(str1,size1[1],str2,size2[1]) + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __INT_STRCSPN_H__*/ diff --git a/2.3-1/src/c/string/interfaces/int_strncpy.h b/2.3-1/src/c/string/interfaces/int_strncpy.h new file mode 100644 index 00000000..e7ffdb42 --- /dev/null +++ b/2.3-1/src/c/string/interfaces/int_strncpy.h @@ -0,0 +1,26 @@ +/* Copyright (C) 2016 - 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 + */ +#ifndef __INT_STRNCPY_H__ +#define __INT_STRNCPY_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#define g2d0strncpyg2(str,size,key,oup) gstrncpya(str,size[1],key,oup) + +#ifdef __cplusplus +} /* extern "C"*/ +#endif + +#endif /*__INT_STRNCPY_H__*/ + diff --git a/2.3-1/src/c/string/interfaces/int_strspn.h b/2.3-1/src/c/string/interfaces/int_strspn.h new file mode 100644 index 00000000..e4b06f72 --- /dev/null +++ b/2.3-1/src/c/string/interfaces/int_strspn.h @@ -0,0 +1,25 @@ +/* Copyright (C) 2016 - 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 + */ +#ifndef __INT_STRSPN_H__ +#define __INT_STRSPN_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#define g2g2strspnu80(str1,size1,str2,size2) gstrspna(str1,size1[1],str2,size2[1]) + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __INT_STRSPN_H__*/ diff --git a/2.3-1/src/c/string/strchr/gstrchra.c b/2.3-1/src/c/string/strchr/gstrchra.c new file mode 100644 index 00000000..f2f54359 --- /dev/null +++ b/2.3-1/src/c/string/strchr/gstrchra.c @@ -0,0 +1,33 @@ +/* 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 + Organization: FOSSEE, IIT Bombay + Author: Ankit Raj + Email: toolbox@scilab.in +*/ +#include <stdio.h> +#include <string.h> +#include "strchr.h" + +void gstrchra(char* str,int size,char* key,int size2,char* out) +{ + int ind,i=0,j,k; + for(j=0;j<size;j++) + { + if(str[j]==key[0]) + { + ind=j; + break; + } + } + for(k=ind;k<size;k++) + { + out[i]=str[k]; + i++; + } +} + diff --git a/2.3-1/src/c/string/strchr/int_strchr.h b/2.3-1/src/c/string/strchr/int_strchr.h new file mode 100644 index 00000000..8747545b --- /dev/null +++ b/2.3-1/src/c/string/strchr/int_strchr.h @@ -0,0 +1,25 @@ +/* Copyright (C) 2016 - 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 + */ +#ifndef __INT_STRCHR_H__ +#define __INT_STRCHR_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#define g2g2strchrg2(str,size,key,size2,out) gstrchra(str,size[1],key,size2[1],out) + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_STRCHR_H__*/ diff --git a/2.3-1/src/c/string/strchr/strchr.h b/2.3-1/src/c/string/strchr/strchr.h new file mode 100644 index 00000000..7e306413 --- /dev/null +++ b/2.3-1/src/c/string/strchr/strchr.h @@ -0,0 +1,25 @@ +/* Copyright (C) 2016 - 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 + */ +#ifndef __STRCHR_H__ +#define __STRCHR_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +void gstrchra(char* str,int size, char* key,int size2, char* out); + +#ifdef __cplusplus +}/* extern "C" */ +#endif + +#endif /*__STRCHR_H__*/ diff --git a/2.3-1/src/c/string/strcspn/gstrcspna.c b/2.3-1/src/c/string/strcspn/gstrcspna.c new file mode 100644 index 00000000..0d8de11b --- /dev/null +++ b/2.3-1/src/c/string/strcspn/gstrcspna.c @@ -0,0 +1,49 @@ +/* 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 + Organization: FOSSEE, IIT Bombay + Author: Ankit Raj + Email: toolbox@scilab.in +*/ +#include<stdio.h> +#include<string.h> +#include "strcspn.h" +uint8 gstrcspna(char *str1,int size1,char *str2,int size2) +{ + int ind; + for(int i=0;i<=size1;i++) + { + for(int j=0;j<=size2;j++) + { + if(str2[j]==str1[i]) + { + ind=j; + break; + } + } + } + return (ind+1); +} +/*int main() +{ + int n1,n2; + char inp1[100000],inp2[100000]; + printf("Enter the length of the first string"); + scanf("%d",&n1); + for(int i=0;i<=(n1+1);i++) + { + scanf("%c",&inp1[i]); + } + printf("Enter the length of the second string"); + scanf("%d",&n2 ); + for(int j=0;j<=(n2+1);j++) + { + scanf("%c",&inp2[j]); + } + strcspnfn(inp1,n1+1,inp2,n2+1); +} +*/ diff --git a/2.3-1/src/c/string/strcspn/int_strcspn b/2.3-1/src/c/string/strcspn/int_strcspn new file mode 100644 index 00000000..f2da3e45 --- /dev/null +++ b/2.3-1/src/c/string/strcspn/int_strcspn @@ -0,0 +1,25 @@ +/* Copyright (C) 2016 - 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 + */ +#ifndef __INT_STRCSPN_H__ +#define __INT_STRCSPN_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#define g2g2strcspnu80(str1,size1,str2,size2) gstrcspna(str1,size1,str2,size2) + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __INT_STRCSPN_H__*/ diff --git a/2.3-1/src/c/string/strcspn/strcspn.h b/2.3-1/src/c/string/strcspn/strcspn.h new file mode 100644 index 00000000..6170afa2 --- /dev/null +++ b/2.3-1/src/c/string/strcspn/strcspn.h @@ -0,0 +1,25 @@ +/* Copyright (C) 2016 - 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 + */ +#ifndef __STRCSPN_H__ +#define __STRCSPN_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +uint8 gstrcspna(char* str1,int size1,char* str2,int size2); + +#ifdef __cplusplus +}/* extern "C" */ +#endif + +#endif /* __STRCSPN_H */ diff --git a/2.3-1/src/c/string/strncpy/gstrncpya.c b/2.3-1/src/c/string/strncpy/gstrncpya.c new file mode 100644 index 00000000..92801985 --- /dev/null +++ b/2.3-1/src/c/string/strncpy/gstrncpya.c @@ -0,0 +1,25 @@ +/* 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 + Organization: FOSSEE, IIT Bombay + Author: Ankit Raj + Email: toolbox@scilab.in +*/ +#include<stdio.h> +#include "strncpy.h" +void gstrncpya(char *str,int size,double key,char *oup) +{ + int j; + char c; + for(j=0;j<key;j++) + { + c=str[j]; + oup[j]=c; + } +} + + diff --git a/2.3-1/src/c/string/strncpy/int_strncpy.h b/2.3-1/src/c/string/strncpy/int_strncpy.h new file mode 100644 index 00000000..fcf245e3 --- /dev/null +++ b/2.3-1/src/c/string/strncpy/int_strncpy.h @@ -0,0 +1,26 @@ +/* Copyright (C) 2016 - 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 + */ +#ifndef __INT_STRNCPY_H__ +#define __INT_STRNCPY_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#define g2strncpyg2(str,key,oup) gstrncpya(str,key,oup) + +#ifdef __cplusplus +} /* extern "C"*/ +#endif + +#endif /*__INT_STRNCPY_H__*/ + diff --git a/2.3-1/src/c/string/strncpy/strncpy.h b/2.3-1/src/c/string/strncpy/strncpy.h new file mode 100644 index 00000000..38855504 --- /dev/null +++ b/2.3-1/src/c/string/strncpy/strncpy.h @@ -0,0 +1,25 @@ +/* Copyright (C) 2016 - 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 + */ +#ifndef __STRNCPY_H__ +#define __STRNCPY_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +void gstrncpya(char* str,int key,char* oup); + +#ifdef __cplusplus +}/* extern "C" */ +#endif + +#endif /*__STRNCPY_H__*/ diff --git a/2.3-1/src/c/string/strspn/gstrspna.c b/2.3-1/src/c/string/strspn/gstrspna.c new file mode 100644 index 00000000..94a5181e --- /dev/null +++ b/2.3-1/src/c/string/strspn/gstrspna.c @@ -0,0 +1,64 @@ +/* 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 + Organization: FOSSEE, IIT Bombay + Author: Ankit Raj + Email: toolbox@scilab.in +*/ +#include<stdio.h> +#include "strspn.h" + +int max(int a,int b){ + if(a>b) return a; + return b; +} +uint8 gstrspna(char *str1,int size1,char *str2,int size2) +{ + int i,j,ct=0,k=0,m=0; + for(i=0;i<size2;i++) + { + if(str1[0]==str2[i]) + { + k=i; + ct=0; + j=0; + while(str1[j]==str2[k]) + { + ct++; + j++; + k++; + if(j >= size1) break; + } + if(j==size1) + { + ct=ct-1; + } + m = max(m,ct); + } + } +return m; +} +/* +int main() +{ + int n1,n2; + char inp1[100000],inp2[100000]; + printf("Enter the length of the first string"); + scanf("%d",&n1); + for(int i=0;i<=(n1+1);i++) + { + scanf("%c",&inp1[i]); + } + printf("Enter the length of the second string"); + scanf("%d",&n2 ); + for(int j=0;j<=(n2+1);j++) + { + scanf("%c",&inp2[j]); + } + strcspnfn(inp1,n1+1,inp2,n2+1); +} +*/ diff --git a/2.3-1/src/c/string/strspn/int_strspn.h b/2.3-1/src/c/string/strspn/int_strspn.h new file mode 100644 index 00000000..506b311d --- /dev/null +++ b/2.3-1/src/c/string/strspn/int_strspn.h @@ -0,0 +1,25 @@ +/* Copyright (C) 2016 - 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 + */ +#ifndef __INT_STRSPN_H__ +#define __INT_STRSPN_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#define g2g2strspnu80(str1,size1,str2,size2) gstrspna(str1,size1,str2,size2) + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __INT_STRSPN_H__*/ diff --git a/2.3-1/src/c/string/strspn/strspn.h b/2.3-1/src/c/string/strspn/strspn.h new file mode 100644 index 00000000..f7c2a3cb --- /dev/null +++ b/2.3-1/src/c/string/strspn/strspn.h @@ -0,0 +1,25 @@ +/* Copyright (C) 2016 - 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 + */ +#ifndef __STRSPN_H__ +#define __STRSPN_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +uint8 gstrspna(char* str1,int size1,char* str2,int size2); + +#ifdef __cplusplus +}/* extern "C" */ +#endif + +#endif /* __STRSPN_H */ |