summaryrefslogtreecommitdiff
path: root/macros/ncauer.sci
diff options
context:
space:
mode:
authorbgtushar2017-11-23 19:30:44 +0530
committerbgtushar2017-11-23 19:30:44 +0530
commite9ab4b0b52db51be30f4ac3d07673c20b48da13c (patch)
tree8f4ce37de0a028350125acfce71cfe686e79ef24 /macros/ncauer.sci
parent14ccddd315f0b97a78e965df1587835ac542e35a (diff)
parentf66d58166a67d6bc89b2a674119410ddaee53d46 (diff)
downloadFOSSEE-Signal-Processing-Toolbox-e9ab4b0b52db51be30f4ac3d07673c20b48da13c.tar.gz
FOSSEE-Signal-Processing-Toolbox-e9ab4b0b52db51be30f4ac3d07673c20b48da13c.tar.bz2
FOSSEE-Signal-Processing-Toolbox-e9ab4b0b52db51be30f4ac3d07673c20b48da13c.zip
Merge
Diffstat (limited to 'macros/ncauer.sci')
-rw-r--r--macros/ncauer.sci49
1 files changed, 49 insertions, 0 deletions
diff --git a/macros/ncauer.sci b/macros/ncauer.sci
new file mode 100644
index 0000000..c76eb65
--- /dev/null
+++ b/macros/ncauer.sci
@@ -0,0 +1,49 @@
+function [Zz, Zp, Zg] = ncauer(Rp, Rs, n)
+//Analog prototype for Cauer filter.
+//Calling Sequence
+//[Zz, Zp, Zg] = ncauer(Rp, Rs, n)
+//[Zz, Zp] = ncauer(Rp, Rs, n)
+//Zz = ncauer(Rp, Rs, n)
+//Parameters
+//n: Filter Order
+//Rp: Peak-to-peak passband ripple
+//Rs: Stopband attenuation
+//Description
+//This is an Octave function.
+//It designs an analog prototype for Cauer filter of nth order, with a Peak-to-peak passband ripple of Rp and a stopband attenuation of Rs.
+//Examples
+//n = 5;
+//Rp = 5;
+//Rs = 5;
+//[Zz, Zp, Zg] = ncauer(Rp, Rs, n)
+//Zz =
+//
+// 0.0000 + 2.5546i 0.0000 + 1.6835i -0.0000 - 2.5546i -0.0000 - 1.6835i
+//
+//Zp =
+//
+// -0.10199 + 0.64039i -0.03168 + 0.96777i -0.10199 - 0.64039i -0.03168 - 0.96777i -0.14368 + 0.00000i
+//
+//Zg = 0.0030628
+
+funcprot(0);
+lhs = argn(1)
+rhs = argn(2)
+if (rhs < 3 | rhs > 3)
+error("Wrong number of input arguments.")
+end
+
+select(rhs)
+
+ case 3 then
+ if(lhs==1)
+ Zz = callOctave("ncauer", Rp, Rs, n)
+ elseif(lhs==2)
+ [Zz, Zp] = callOctave("ncauer", Rp, Rs, n)
+ elseif(lhs==3)
+ [Zz, Zp, Zg] = callOctave("ncauer", Rp, Rs, n)
+ else
+ error("Wrong number of output argments.")
+ end
+ end
+endfunction