summaryrefslogtreecommitdiff
path: root/macros/blackmannuttall.sci
diff options
context:
space:
mode:
authorshamikam2017-11-07 15:59:48 +0530
committershamikam2017-11-07 15:59:48 +0530
commitc0c0582462720ed597b00e116506570577614e89 (patch)
tree31dedd23698e5357b19c810b7d7a8464100ef44a /macros/blackmannuttall.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/blackmannuttall.sci')
-rw-r--r--macros/blackmannuttall.sci34
1 files changed, 34 insertions, 0 deletions
diff --git a/macros/blackmannuttall.sci b/macros/blackmannuttall.sci
new file mode 100644
index 0000000..29dd1b0
--- /dev/null
+++ b/macros/blackmannuttall.sci
@@ -0,0 +1,34 @@
+function [w] = blackmannuttall (m, opt)
+//This function returns the filter coefficients of a Blackman-Nuttall window.
+//Calling Sequence
+//w = blackmannuttall (m)
+//w = blackmannuttall (m, opt)
+//Parameters
+//m: positive integer value
+//opt: string value, takes "periodic" or "symmetric"
+//w: output variable, vector of real numbers
+//Description.
+//This is an Octave function.
+//This function returns the filter coefficients of a Blackman-Nuttall window of length m supplied as input, to the output vector w.
+//The second parameter can take the values "periodic" or "symmetric", depending on which the corresponding form of window is returned. The default is symmetric.
+//Examples
+//blackmannuttall(5,"symmetric")
+//ans =
+// 0.0003628
+// 0.2269824
+// 1.
+// 0.2269824
+// 0.0003628
+rhs = argn(2)
+
+if (rhs<1 | rhs>2)
+error("Wrong number of input arguments.")
+end
+ select (rhs)
+ case 1 then
+ w = callOctave("blackmannuttall",m)
+ case 2 then
+ w = callOctave("blackmannuttall",m,opt)
+ end
+endfunction
+