From d0a1f4e5dcddab2290f68a0395970ec471813119 Mon Sep 17 00:00:00 2001 From: Ankitr19 Date: Tue, 11 Jul 2017 09:01:07 +0530 Subject: New demos for signal processing functions --- demos/ffilt.dem.sce | 16 ++++++++++++++++ demos/filt_sinc.dem.sce | 18 ++++++++++++++++++ demos/fsfirlin.dem.sce | 16 ++++++++++++++++ demos/scilab2c.dem.gateway.sce | 3 +++ jar/scilab_en_US_help.jar | Bin 11210 -> 11210 bytes macros/ASTManagement/lib | Bin 1956 -> 2008 bytes macros/CCodeGeneration/lib | Bin 1004 -> 1056 bytes macros/ErrorMessages/lib | Bin 468 -> 520 bytes macros/FunctionAnnotation/lib | Bin 2360 -> 2412 bytes macros/FunctionList/lib | Bin 536 -> 588 bytes macros/GeneralFunctions/lib | Bin 1080 -> 1132 bytes macros/Hardware/AVR/lib | Bin 920 -> 972 bytes macros/Hardware/RasberryPi/lib | Bin 924 -> 976 bytes macros/ImageProcessing/core/lib | Bin 472 -> 524 bytes macros/ImageProcessing/highgui/lib | Bin 532 -> 584 bytes macros/ImageProcessing/imgproc/lib | Bin 700 -> 752 bytes macros/Scilab-Arduino/lib | Bin 664 -> 716 bytes macros/SymbolTable/lib | Bin 700 -> 752 bytes macros/ToolInitialization/lib | Bin 752 -> 804 bytes macros/findDeps/lib | Bin 568 -> 620 bytes macros/lib | Bin 484 -> 536 bytes .../unit_tests/test_ffilt/scilabcode/ffilttest.sci | 8 ++++++++ tests/unit_tests/test_ffilt/scilabcode/main.sci | 12 ++++++++++++ .../test_filtsinc/scilabcode/filt_sinctest.sci | 10 ++++++++++ .../test_fsfirlin/scilabcode/fsfirlintest.sci | 6 ++++++ tests/unit_tests/test_fsfirlin/scilabcode/main.sci | 9 +++++++++ 26 files changed, 98 insertions(+) create mode 100644 demos/ffilt.dem.sce create mode 100644 demos/filt_sinc.dem.sce create mode 100644 demos/fsfirlin.dem.sce create mode 100644 tests/unit_tests/test_ffilt/scilabcode/ffilttest.sci create mode 100644 tests/unit_tests/test_ffilt/scilabcode/main.sci create mode 100644 tests/unit_tests/test_filtsinc/scilabcode/filt_sinctest.sci create mode 100644 tests/unit_tests/test_fsfirlin/scilabcode/fsfirlintest.sci create mode 100644 tests/unit_tests/test_fsfirlin/scilabcode/main.sci diff --git a/demos/ffilt.dem.sce b/demos/ffilt.dem.sce new file mode 100644 index 0000000..0268041 --- /dev/null +++ b/demos/ffilt.dem.sce @@ -0,0 +1,16 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +//This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Ankit Raj +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in +// + +lines(0); + +global SCI2CHOME + +scilab2c(SCI2CHOME+"/tests/unit_tests/test_ffilt/scilabcode/main.sci",TMPDIR,SCI2CHOME+"/tests/unit_tests/test_ffilt/scilabcode"); diff --git a/demos/filt_sinc.dem.sce b/demos/filt_sinc.dem.sce new file mode 100644 index 0000000..001ceb8 --- /dev/null +++ b/demos/filt_sinc.dem.sce @@ -0,0 +1,18 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +//This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Ankit Raj +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in +// + + + +lines(0); + +global SCI2CHOME + +scilab2c(SCI2CHOME+"/tests/unit_tests/test_filtsinc/scilabcode/filt_sinctest.sci",TMPDIR,SCI2CHOME+"/tests/unit_tests/test_filtsinc/scilabcode"); diff --git a/demos/fsfirlin.dem.sce b/demos/fsfirlin.dem.sce new file mode 100644 index 0000000..278252a --- /dev/null +++ b/demos/fsfirlin.dem.sce @@ -0,0 +1,16 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +//This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Ankit Raj +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in +// + +lines(0); + +global SCI2CHOME + +scilab2c(SCI2CHOME+"/tests/unit_tests/test_fsfirlin/scilabcode/main.sci",TMPDIR,SCI2CHOME+"/tests/unit_tests/test_fsfirlin/scilabcode"); diff --git a/demos/scilab2c.dem.gateway.sce b/demos/scilab2c.dem.gateway.sce index b572166..bc158bf 100644 --- a/demos/scilab2c.dem.gateway.sce +++ b/demos/scilab2c.dem.gateway.sce @@ -39,6 +39,9 @@ subdemolist = ["Trigonometric Identity" , "TrigonometricIdentity.dem.sce"; "Arduino analog output", "analog_out.dem.sce"; "Arduino DC motor", "dc_motor.dem.sce"; "Arduino Master write", "master_write.dem.sce"; + "Ffilt coeff. of FIR low pass filter","ffilt.dem.sce"; + "Design of FIR linear phase filters using freq. samping technique","fsfirlin.dem.sce"; + "Samples of sinc function","filt_sinc.dem.sce"; ]; subdemolist(:,2) = demopath + subdemolist(:,2); diff --git a/jar/scilab_en_US_help.jar b/jar/scilab_en_US_help.jar index cb760b0..42fc9ad 100644 Binary files a/jar/scilab_en_US_help.jar and b/jar/scilab_en_US_help.jar differ diff --git a/macros/ASTManagement/lib b/macros/ASTManagement/lib index e9d351a..5978ea7 100644 Binary files a/macros/ASTManagement/lib and b/macros/ASTManagement/lib differ diff --git a/macros/CCodeGeneration/lib b/macros/CCodeGeneration/lib index f2696fe..3181979 100644 Binary files a/macros/CCodeGeneration/lib and b/macros/CCodeGeneration/lib differ diff --git a/macros/ErrorMessages/lib b/macros/ErrorMessages/lib index 1500b1f..794d4c0 100644 Binary files a/macros/ErrorMessages/lib and b/macros/ErrorMessages/lib differ diff --git a/macros/FunctionAnnotation/lib b/macros/FunctionAnnotation/lib index 5eb9bc2..bb1f47c 100644 Binary files a/macros/FunctionAnnotation/lib and b/macros/FunctionAnnotation/lib differ diff --git a/macros/FunctionList/lib b/macros/FunctionList/lib index e101853..c3274f1 100644 Binary files a/macros/FunctionList/lib and b/macros/FunctionList/lib differ diff --git a/macros/GeneralFunctions/lib b/macros/GeneralFunctions/lib index 846ca1b..1cf5c1f 100644 Binary files a/macros/GeneralFunctions/lib and b/macros/GeneralFunctions/lib differ diff --git a/macros/Hardware/AVR/lib b/macros/Hardware/AVR/lib index 53e5659..069c520 100644 Binary files a/macros/Hardware/AVR/lib and b/macros/Hardware/AVR/lib differ diff --git a/macros/Hardware/RasberryPi/lib b/macros/Hardware/RasberryPi/lib index dc759fe..4c85475 100644 Binary files a/macros/Hardware/RasberryPi/lib and b/macros/Hardware/RasberryPi/lib differ diff --git a/macros/ImageProcessing/core/lib b/macros/ImageProcessing/core/lib index 7f003c8..d80305c 100644 Binary files a/macros/ImageProcessing/core/lib and b/macros/ImageProcessing/core/lib differ diff --git a/macros/ImageProcessing/highgui/lib b/macros/ImageProcessing/highgui/lib index 787c25f..1e7f750 100644 Binary files a/macros/ImageProcessing/highgui/lib and b/macros/ImageProcessing/highgui/lib differ diff --git a/macros/ImageProcessing/imgproc/lib b/macros/ImageProcessing/imgproc/lib index 93c8390..a83978b 100644 Binary files a/macros/ImageProcessing/imgproc/lib and b/macros/ImageProcessing/imgproc/lib differ diff --git a/macros/Scilab-Arduino/lib b/macros/Scilab-Arduino/lib index 5b7beab..f3d5b2f 100644 Binary files a/macros/Scilab-Arduino/lib and b/macros/Scilab-Arduino/lib differ diff --git a/macros/SymbolTable/lib b/macros/SymbolTable/lib index c42cf1a..e66158d 100644 Binary files a/macros/SymbolTable/lib and b/macros/SymbolTable/lib differ diff --git a/macros/ToolInitialization/lib b/macros/ToolInitialization/lib index 267c9c9..685205d 100644 Binary files a/macros/ToolInitialization/lib and b/macros/ToolInitialization/lib differ diff --git a/macros/findDeps/lib b/macros/findDeps/lib index 69c3c0e..68ea65d 100644 Binary files a/macros/findDeps/lib and b/macros/findDeps/lib differ diff --git a/macros/lib b/macros/lib index f759663..9f13349 100644 Binary files a/macros/lib and b/macros/lib differ diff --git a/tests/unit_tests/test_ffilt/scilabcode/ffilttest.sci b/tests/unit_tests/test_ffilt/scilabcode/ffilttest.sci new file mode 100644 index 0000000..fcf1732 --- /dev/null +++ b/tests/unit_tests/test_ffilt/scilabcode/ffilttest.sci @@ -0,0 +1,8 @@ +function ffilttest() + ft="sb"; + ni=5; + fc=0.2; + fh=0.9; + xi=ffilt(ft,ni,fc,fh); + disp(xi); +endfunction diff --git a/tests/unit_tests/test_ffilt/scilabcode/main.sci b/tests/unit_tests/test_ffilt/scilabcode/main.sci new file mode 100644 index 0000000..ced653a --- /dev/null +++ b/tests/unit_tests/test_ffilt/scilabcode/main.sci @@ -0,0 +1,12 @@ +// The main function test the ffilt function +// ffilt->returns the coefficients of FIR low pass filter +function main() + ft="sb"; //ft is the type of filter + ni=5; //ni is the number of filters sample required + fc=0.2; //low frequency cutoff + fh=0.9; //high cutoff frequency + xi=ffilt(ft,ni,fc,fh); + disp(xi); +endfunction +//output +// 0.2449143 0.4898285 - 0.4 0.4898285 0.2449143 diff --git a/tests/unit_tests/test_filtsinc/scilabcode/filt_sinctest.sci b/tests/unit_tests/test_filtsinc/scilabcode/filt_sinctest.sci new file mode 100644 index 0000000..ab674b6 --- /dev/null +++ b/tests/unit_tests/test_filtsinc/scilabcode/filt_sinctest.sci @@ -0,0 +1,10 @@ +//This is the demo for filt_sinc function +//This function gives the samples of the sinc fuction +function filt_sinctest() + ni=int(10); //This is the number of samples + fc=2; //This is the cut-off freq. of the assosciated low pass filter + sd=filt_sinc(ni,fc); + disp(sd); +endfunction +//output +// diff --git a/tests/unit_tests/test_fsfirlin/scilabcode/fsfirlintest.sci b/tests/unit_tests/test_fsfirlin/scilabcode/fsfirlintest.sci new file mode 100644 index 0000000..4ecec4e --- /dev/null +++ b/tests/unit_tests/test_fsfirlin/scilabcode/fsfirlintest.sci @@ -0,0 +1,6 @@ +function fsfirlintest() + in=[1 2 3 4 5 6 7 8]; + flg=2; + op=fsfirlin(in,flg); + disp(op); +endfunction diff --git a/tests/unit_tests/test_fsfirlin/scilabcode/main.sci b/tests/unit_tests/test_fsfirlin/scilabcode/main.sci new file mode 100644 index 0000000..a3acc51 --- /dev/null +++ b/tests/unit_tests/test_fsfirlin/scilabcode/main.sci @@ -0,0 +1,9 @@ +//This is the demo file to test the function fsfirlin +//The function gives design of FIR,linear phase filters using frequency sampling technique +function main() + in=[1 2 3 4 5 6 7 8]; //This is the vector of desired frequency responses samples + flg=2; //flg=2 for type-2 filter , it can be 1 for type-1 filter + op=fsfirlin(in,flg); + disp(op); +endfunction +//output -- cgit