?? arpredictor_sg.m
字號:
% File: ARpredictor_SG.m
% ----------------------
% This file is used to calculate the nth element of s(n) in AR model.
function[ARpredictor_SG] = ARpredictor_SG(a_vector, signalvector_s, p, n);
% a_vector: the parameters a(i) i = 1, ..., p of AR model in vector form
% also with the order (or length) of the model p = length(a_vector)
% signalvector_s: the generated part of signal s(n)
% p: the order(length) of AR model.
% n: the under generation element of signal s(n)
ARpredictor_SG = 0;
if (n > p)
for i = 1: p
ARpredictor_SG = ARpredictor_SG + a_vector(i) * signalvector_s(n - i);
end
elseif (n == 1)
ARpredictor_SG = 0; % for s(1) = 0 + wgnvector_w(1)
else
for i = 1: (n - 1)
ARpredictor_SG = ARpredictor_SG + a_vector(i) * signalvector_s(n - i);
end
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -