summaryrefslogtreecommitdiff
path: root/macros/cheb1ap.sci
diff options
context:
space:
mode:
authorBrijeshcr2017-11-10 15:08:11 +0530
committerBrijeshcr2017-11-10 15:08:11 +0530
commit6e1e4362783f68a8e8be1d199337c1ca831a2994 (patch)
tree474529264f6f33a61343467faf80e8330f3c6f85 /macros/cheb1ap.sci
parent487df8d5650f198857d5dd5635f9493fa8c06e8f (diff)
downloadFOSSEE-Signal-Processing-Toolbox-6e1e4362783f68a8e8be1d199337c1ca831a2994.tar.gz
FOSSEE-Signal-Processing-Toolbox-6e1e4362783f68a8e8be1d199337c1ca831a2994.tar.bz2
FOSSEE-Signal-Processing-Toolbox-6e1e4362783f68a8e8be1d199337c1ca831a2994.zip
Brijesh functions
Diffstat (limited to 'macros/cheb1ap.sci')
-rw-r--r--macros/cheb1ap.sci51
1 files changed, 51 insertions, 0 deletions
diff --git a/macros/cheb1ap.sci b/macros/cheb1ap.sci
new file mode 100644
index 0000000..361f272
--- /dev/null
+++ b/macros/cheb1ap.sci
@@ -0,0 +1,51 @@
+function [z, p, g] = cheb1ap (n, Rp)
+//This function designs a lowpass analog Chebyshev type I filter.
+//Calling Sequence
+//[z, p, g] = cheb1ap (n, Rp)
+//[z, p] = cheb1ap (n, Rp)
+//p = cheb1ap (n, Rp)
+//Parameters
+//n: Filter Order
+//Rp: Peak-to-peak passband ripple
+//z: Zeros
+//p: Poles
+//g: Gain
+//Description
+//This is an Octave function.
+//It designs a lowpass analog Chebyshev type I filter of nth order and with a Peak-to-peak passband ripple of Rp.
+//Examples
+//[z, p, g] = cheb1ap (10, 20)
+//z = [](0x0)
+//p =
+//
+// Columns 1 through 6:
+//
+// -0.00157 - 0.98774i -0.00456 - 0.89105i -0.00709 - 0.70714i -0.00894 - 0.45401i -0.00991 - 0.15644i -0.00991 + 0.15644i
+//
+// Columns 7 through 10:
+//
+// -0.00894 + 0.45401i -0.00709 + 0.70714i -0.00456 + 0.89105i -0.00157 + 0.98774i
+//
+//g = 1.9630e-04 - 6.3527e-22i
+
+funcprot(0);
+lhs = argn(1)
+rhs = argn(2)
+if (rhs < 2 | rhs > 2)
+error("Wrong number of input arguments.")
+end
+
+select(rhs)
+
+ case 2 then
+ if(lhs==1)
+ z = callOctave("cheb1ap", n, Rp)
+ elseif(lhs==2)
+ [z, p] = callOctave("cheb1ap", n, Rp)
+ elseif(lhs==3)
+ [z, p, g] = callOctave("cheb1ap", n, Rp)
+ else
+ error("Wrong number of output argments.")
+ end
+ end
+endfunction