summaryrefslogtreecommitdiff
path: root/macros/invfreq.sci
diff options
context:
space:
mode:
authorbgtushar2017-11-27 11:14:24 +0530
committerGitHub2017-11-27 11:14:24 +0530
commit25a88252ee49c73acb18232f6e916d7742a1af80 (patch)
tree9161ea9a7940e36a21f0855a7805e24f7b002d8a /macros/invfreq.sci
parente9ab4b0b52db51be30f4ac3d07673c20b48da13c (diff)
parentff8b1285a880cc28c68d8b224b20b8ccff8e5422 (diff)
downloadFOSSEE-Signal-Processing-Toolbox-25a88252ee49c73acb18232f6e916d7742a1af80.tar.gz
FOSSEE-Signal-Processing-Toolbox-25a88252ee49c73acb18232f6e916d7742a1af80.tar.bz2
FOSSEE-Signal-Processing-Toolbox-25a88252ee49c73acb18232f6e916d7742a1af80.zip
Merge pull request #5 from abhinavdronamraju/master
Help files created and Updated Readme.md
Diffstat (limited to 'macros/invfreq.sci')
-rw-r--r--macros/invfreq.sci26
1 files changed, 24 insertions, 2 deletions
diff --git a/macros/invfreq.sci b/macros/invfreq.sci
index dde23ef..a720115 100644
--- a/macros/invfreq.sci
+++ b/macros/invfreq.sci
@@ -1,6 +1,28 @@
function [B,A] = invfreq(H,F,nB,nA,W,iter,tol, plane)
-
-
+// Calculates inverse frequency vectors
+//
+// Calling Sequence
+//[B,A] = invfreq(H,F,nB,nA)
+//[B,A] = invfreq(H,F,nB,nA,W)
+//[B,A] = invfreq(H,F,nB,nA,W,[],[],plane)
+//[B,A] = invfreq(H,F,nB,nA,W,iter,tol,plane)
+//
+// Parameters
+// H: desired complex frequency response,It is assumed that A and B are real polynomials, hence H is one-sided.
+// F: vector of frequency samples in radians
+// nA: order of denominator polynomial A
+// nB: order of numerator polynomial B
+//
+// Description
+//Fit filter B(z)/A(z) or B(s)/A(s) to complex frequency response at frequency points F. A and B are real polynomial coefficients of order nA and nB respectively. Optionally, the fit-errors can be weighted vs frequency according to the weights W. Also, the transform plane can be specified as either 's' for continuous time or 'z' for discrete time. 'z' is chosen by default. Eventually, Steiglitz-McBride iterations will be specified by iter and tol.
+//
+// Examples
+// [B,A] = butter(12,1/4);
+// [H,w] = freqz(B,A,128);
+// [Bh,Ah] = invfreq(H,F,4,4);
+// Hh = freqz(Bh,Ah);
+// disp(sprintf('||frequency response error|| = %f',norm(H-Hh)));
+//
funcprot(0);
lhs= argn(1);
rhs= argn(2);