summaryrefslogtreecommitdiff
path: root/2.3-1/tests/unit_tests
diff options
context:
space:
mode:
Diffstat (limited to '2.3-1/tests/unit_tests')
-rw-r--r--2.3-1/tests/unit_tests/test_ffilt/scilabcode/ffilttest.sci8
-rw-r--r--2.3-1/tests/unit_tests/test_ffilt/scilabcode/main.sci12
-rw-r--r--2.3-1/tests/unit_tests/test_filtsinc/scilabcode/filt_sinctest.sci10
-rw-r--r--2.3-1/tests/unit_tests/test_fsfirlin/scilabcode/fsfirlintest.sci6
-rw-r--r--2.3-1/tests/unit_tests/test_fsfirlin/scilabcode/main.sci9
5 files changed, 45 insertions, 0 deletions
diff --git a/2.3-1/tests/unit_tests/test_ffilt/scilabcode/ffilttest.sci b/2.3-1/tests/unit_tests/test_ffilt/scilabcode/ffilttest.sci
new file mode 100644
index 00000000..fcf1732f
--- /dev/null
+++ b/2.3-1/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/2.3-1/tests/unit_tests/test_ffilt/scilabcode/main.sci b/2.3-1/tests/unit_tests/test_ffilt/scilabcode/main.sci
new file mode 100644
index 00000000..ced653a3
--- /dev/null
+++ b/2.3-1/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/2.3-1/tests/unit_tests/test_filtsinc/scilabcode/filt_sinctest.sci b/2.3-1/tests/unit_tests/test_filtsinc/scilabcode/filt_sinctest.sci
new file mode 100644
index 00000000..ab674b67
--- /dev/null
+++ b/2.3-1/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/2.3-1/tests/unit_tests/test_fsfirlin/scilabcode/fsfirlintest.sci b/2.3-1/tests/unit_tests/test_fsfirlin/scilabcode/fsfirlintest.sci
new file mode 100644
index 00000000..4ecec4ea
--- /dev/null
+++ b/2.3-1/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/2.3-1/tests/unit_tests/test_fsfirlin/scilabcode/main.sci b/2.3-1/tests/unit_tests/test_fsfirlin/scilabcode/main.sci
new file mode 100644
index 00000000..a3acc51b
--- /dev/null
+++ b/2.3-1/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