summaryrefslogtreecommitdiff
path: root/macros/filtic.sci
diff options
context:
space:
mode:
authorshamikam2017-11-07 15:59:48 +0530
committershamikam2017-11-07 15:59:48 +0530
commitc0c0582462720ed597b00e116506570577614e89 (patch)
tree31dedd23698e5357b19c810b7d7a8464100ef44a /macros/filtic.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/filtic.sci')
-rw-r--r--macros/filtic.sci37
1 files changed, 37 insertions, 0 deletions
diff --git a/macros/filtic.sci b/macros/filtic.sci
new file mode 100644
index 0000000..3fd919a
--- /dev/null
+++ b/macros/filtic.sci
@@ -0,0 +1,37 @@
+function zf = filtic (b, a, y, x)
+
+//This function finds the initial conditions for the delays in the transposed direct-form II filter implementation
+//Calling Sequence
+//zf = filtic (b, a, y)
+//zf = filtic (b, a, y, x)
+//Parameters
+//b: vector of real or complex numbers
+//a: vector of real or complex numbers
+//y: vector of real or complex numbers
+//x: vector of real or complex numbers
+//Description
+//This function finds the initial conditions for the delays in the transposed direct-form II filter implementation.
+//The vectors b and a represent the numerator and denominator coefficients of the filter's transfer function.
+//Examples
+//filtic([i,1,-i,5], [1,2,3i], [0.8i,7,9])
+//ans =
+// 0.00000 - 22.60000i
+// 2.40000 + 0.00000i
+// 0.00000 + 0.00000i
+//This function is being called from Octave
+
+funcprot(0);
+rhs = argn(2)
+
+if(rhs>4 | rhs<3)
+ error("Wrong number of input agruments.")
+end
+
+select(rhs)
+case 3 then
+zf = callOctave("filtic",b,a,y)
+case 4 then
+zf = callOctave("filtic",b,a,y,x)
+end
+endfunction
+