summaryrefslogtreecommitdiff
path: root/macros/tukeywin.sci
diff options
context:
space:
mode:
authorshamikam2017-11-07 15:59:48 +0530
committershamikam2017-11-07 15:59:48 +0530
commitc0c0582462720ed597b00e116506570577614e89 (patch)
tree31dedd23698e5357b19c810b7d7a8464100ef44a /macros/tukeywin.sci
downloadFOSSEE-Signal-Processing-Toolbox-c0c0582462720ed597b00e116506570577614e89.tar.gz
FOSSEE-Signal-Processing-Toolbox-c0c0582462720ed597b00e116506570577614e89.tar.bz2
FOSSEE-Signal-Processing-Toolbox-c0c0582462720ed597b00e116506570577614e89.zip
initial commit
Diffstat (limited to 'macros/tukeywin.sci')
-rw-r--r--macros/tukeywin.sci34
1 files changed, 34 insertions, 0 deletions
diff --git a/macros/tukeywin.sci b/macros/tukeywin.sci
new file mode 100644
index 0000000..7ac8641
--- /dev/null
+++ b/macros/tukeywin.sci
@@ -0,0 +1,34 @@
+function w = tukeywin (m, r)
+//This function returns the filter coefficients of a Tukey window.
+//Calling Sequence
+//w = tukeywin (m)
+//w = tukeywin (m, r)
+//Parameters
+//m: positive integer
+//r: positive real number, between 0 and 1
+//Description
+//This is an Octave function.
+//This function returns the filter coefficients of a Tukey window of length m supplied as input, to the output vector w.
+//The second parameter r defines the ratio between the constant and cosine section and its value has to be between 0 and 1, with default value 0.5.
+//Examples
+//tukeywin(5, 2)
+//ans =
+// 0.
+// 0.5
+// 1.
+// 0.5
+// 0.
+
+funcprot(0);
+rhs = argn(2)
+if(rhs<1 | rhs>2)
+error("Wrong number of input arguments.")
+end
+ select(rhs)
+ case 1 then
+ w = callOctave("tukeywin",m)
+ case 2 then
+ w = callOctave("tukeywin",m,r)
+ end
+endfunction
+