summaryrefslogtreecommitdiff
path: root/macros/arburg.sci
diff options
context:
space:
mode:
Diffstat (limited to 'macros/arburg.sci')
-rw-r--r--macros/arburg.sci48
1 files changed, 1 insertions, 47 deletions
diff --git a/macros/arburg.sci b/macros/arburg.sci
index ee85ac5..faa47d5 100644
--- a/macros/arburg.sci
+++ b/macros/arburg.sci
@@ -1,11 +1,10 @@
+function varargout = arburg( x, poles, criterion )
//This function calculates coefficients of an autoregressive (AR) model of complex data
-
//Calling Sequence
//a = arburg(x, poles)
//a = arburg(x, poles, criterion)
//[a, v] = arburg(...)
//[a, v, k] = arburg(...)
-
//Parameters
//x: vector of real or complex numbers, of length > 2
//poles: positive integer value < length(x) - 2
@@ -13,61 +12,16 @@
//a: list of P+1 autoregression coefficients.
//v: mean square of residual noise from the whitening operation of the Burg lattice filter
//k: reflection coefficients defining the lattice-filter embodiment of the model
-
//Description
//This function calculates coefficients of an autoregressive (AR) model of complex data x using the whitening lattice-filter method of Burg.
//The first argument is the data sampled. The second argument is the number of poles in the model (or limit in case a criterion is supplied).
//The third parameter takes in the criterion to limit the number of poles. The acceptable values are "AIC", "AKICc", "KIC", "AICc" which are based on information theory.
-
//Examples
//arburg([1,2,3,4,5],2)
// ans =
//
// 1. - 1.8639053 0.9571006
-
-//*************************************************************************************
-//-------------------version1 (using callOctave / errored)-----------------------------
-//*************************************************************************************
-//function varargout = arburg( x, poles, criterion )
-//funcprot(0);
-//rhs = argn(2)
-//lhs = argn(1)
-//if(lhs>3)
-//error("Wrong number of output arguments.")
-//elseif(rhs<2)
-//error("Wrong number of input arguments.")
-//end
-//
-// select(lhs)
-// case 1 then
-// if(rhs==2)
-// a = callOctave("arburg",x,poles)
-// elseif(rhs==3)
-// a = callOctave("arburg",x,poles,criterion)
-// end
-// case 2 then
-// if(rhs==2)
-// [a,v] = callOctave("arburg",x,poles)
-// elseif(rhs==3)
-// [a,v] = callOctave("arburg",x,poles,criterion)
-// end
-// case 3 then
-// if(rhs==2)
-// [a,v,k] = callOctave("arburg",x,poles)
-// elseif(rhs==3)
-// [a,v,k] = callOctave("arburg",x,poles,criterion)
-// end
-// end
-//endfunction
-//
-
-//*************************************************************************************
-//-----------------------------version2 (pure scilab code)-----------------------------
-//*************************************************************************************
-
-function varargout = arburg( x, poles, criterion )
-
funcprot(0);
// Check arguments
[nargout nargin ] = argn() ;