summaryrefslogtreecommitdiff
path: root/macros/arcov.sci~
diff options
context:
space:
mode:
authorshamikam2017-11-07 15:59:48 +0530
committershamikam2017-11-07 15:59:48 +0530
commitc0c0582462720ed597b00e116506570577614e89 (patch)
tree31dedd23698e5357b19c810b7d7a8464100ef44a /macros/arcov.sci~
downloadFOSSEE-Signal-Processing-Toolbox-c0c0582462720ed597b00e116506570577614e89.tar.gz
FOSSEE-Signal-Processing-Toolbox-c0c0582462720ed597b00e116506570577614e89.tar.bz2
FOSSEE-Signal-Processing-Toolbox-c0c0582462720ed597b00e116506570577614e89.zip
initial commit
Diffstat (limited to 'macros/arcov.sci~')
-rw-r--r--macros/arcov.sci~33
1 files changed, 33 insertions, 0 deletions
diff --git a/macros/arcov.sci~ b/macros/arcov.sci~
new file mode 100644
index 0000000..179e34a
--- /dev/null
+++ b/macros/arcov.sci~
@@ -0,0 +1,33 @@
+function [ar_coeff, var_est] = arcov(data_in, order)
+//arcov Autoregressive all-pole model parameters — covariance method
+//Calling Syntax
+//a = arcov(x,p)
+//[a,e] = arcov(x,p)
+//a, contains normalized estimates of the AR system parameters, A(z), in descending powers of z.
+//e variance estimate of the white noise input to the AR model
+// x is the input signal
+// p is the order of the auto regressive model
+
+ checkNArgin(2,2, argn(2));
+ if type(data_in)==10 then
+ error("Input should not be of type char");
+ end
+ method = 'covariance';
+ [ar_coeff, var_est, msg] = arParEst(data_in, order, method);
+ if ~isempty(msg) then
+ error(msg);
+ end
+
+
+endfunction
+
+function checkNArgin(min_argin, max_argin, num_of_argin)
+ if num_of_argin < min_argin then
+ error('Not enough input arguments')
+ end
+
+ if num_of_argin > max_argin then
+ error('Too many input arguments')
+ end
+
+endfunction