summaryrefslogtreecommitdiff
path: root/macros/cheb2ap.sci
diff options
context:
space:
mode:
authorBrijeshcr2017-11-10 15:08:11 +0530
committerBrijeshcr2017-11-10 15:08:11 +0530
commit6e1e4362783f68a8e8be1d199337c1ca831a2994 (patch)
tree474529264f6f33a61343467faf80e8330f3c6f85 /macros/cheb2ap.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/cheb2ap.sci')
-rw-r--r--macros/cheb2ap.sci39
1 files changed, 39 insertions, 0 deletions
diff --git a/macros/cheb2ap.sci b/macros/cheb2ap.sci
new file mode 100644
index 0000000..007d2d5
--- /dev/null
+++ b/macros/cheb2ap.sci
@@ -0,0 +1,39 @@
+function [z, p, g] = cheb2ap (n, Rs)
+//This function designs a lowpass analog Chebyshev type II filter.
+//Calling Sequence
+//[z, p, g] = cheb2ap (n, Rs)
+//[z, p] = cheb2ap (n, Rs)
+//p = cheb2ap (n, Rs)
+//Parameters
+//n: Filter Order
+//Rs: Stopband attenuation
+//z: Zeros
+//p: Poles
+//g: Gain
+//Description
+//This is an Octave function.
+//This function designs a lowpass analog Chebyshev type II filter of nth order and with a stopband attenuation of Rs.
+//Examples
+//
+
+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("cheb2ap", n, Rs)
+ elseif(lhs==2)
+ [z, p] = callOctave("cheb2ap", n, Rs)
+ elseif(lhs==3)
+ [z, p, g] = callOctave("cheb2ap", n, Rs)
+ else
+ error("Wrong number of output argments.")
+ end
+ end
+endfunction