⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 arpredictor_sg.m

📁 AR模型的源程序。
💻 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 + -