Generated reference › Modified Covariance AR Estimator — Control Systems/Signal Modeling
kind: generated#block#control-systems-signal-modeling

Modified Covariance AR Estimator — Control Systems/Signal Modeling

MC

Control_Systems/Signal_Modeling/Modified_Covariance_AR_Estimator · 1 input / 2 output port(s) at insert · exports to Python, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog, PLC Structured Text

Description#

The block's own DESCRIPTION_HTML, rendered verbatim — the same text the config dialog's info panel and the library navigator show. Fix a wrong sentence in the block's .cpp (R-D9), never here.

Modified Covariance AR Estimator

Control Systems / Signal Modeling

Fits an order-p autoregressive model to a signal frame by the modified covariance method: x[n] + a1x[n−1] + … + apx[n−p] = e[n], and publishes the prediction-error filter A = [1 a1 … ap] and the variance G of the white noise e that drives the model. This is MATLAB's armcov.

It fits the predictor by least squares over the N−p forward rows AND their time-reversed twins (predicting x[n−p] from the p samples after it), 2(N−p) rows in all, and the error variance is the mean squared residual over all of them.

Ports

  • u – the signal frame x, an [N,1] column; N must be at least 3p/2 – MATLAB's armcov rule; below it there are fewer forward-and-backward rows than unknowns.
  • A – the prediction-error filter, [p+1,1], always starting at 1.
  • G – the error variance, a scalar – the variance itself, not its square root.

Parameters

  • Estimation Order – p, a whole number of 1 or more. Defaults to 4, as Simulink's does.
  • Sampling Time (s) – zero or less inherits the solver's rate; a positive value runs the block at that period.

Code export

All ten targets: Python, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog and PLC Structured Text. The frame length and the order are baked into the core at export time.

The three HDL targets are simulation-only: they carry the arithmetic in real and quantize only at the port boundary. The solve divides by elimination pivots that are not bounded away from zero, which a Q16.16 datapath does not survive. The cores simulate correctly and are not offered as synthesizable.

Simulink bridge

Import and export, mapped to dspparest3/Modified Covariance AR Estimator – the DSP System Toolbox block. "Estimation Order" to P.

"Sampling Time (s)" does not cross. dspparest3/Modified Covariance AR Estimator defines no SampleTime parameter at all – verified against the R2026a block dialog – and set_param on a parameter a block does not define is a hard error that aborts the whole generated script.

Notes

  • Stateless and algebraic: the whole solve runs on this sample's frame. Nothing is carried between steps.
  • G is the variance, not the standard deviation – armcov's e, measured equal to the Simulink block's G to the last bits.
  • An all-zero frame gives NaN, as the Simulink block does – measured on the estimator: A = [1 NaN …], G = NaN. There is no guard to switch on; feed it a frame with energy in it.
  • The frame rule is stricter than the Simulink block's. That block accepted p = 7 on a 12-sample frame, where only 5 prediction rows exist for 7 unknowns; this one refuses anything MATLAB's armcov refuses, because below that rule the answer is a number rather than an estimate.
  • The normal equations are solved by Gaussian elimination with partial pivoting. The Simulink block uses a Cholesky factorization and armcov a QR; on any frame this block accepts, the three agree to rounding.
  • Reach for the Modified Covariance Method block for the spectrum this model implies.

Code facts#

FactValue
registered typeControl_Systems/Signal_Modeling/Modified_Covariance_AR_Estimator
familyControl_Systems/Signal_Modeling
solver environment classICoreBlock_0_Control_Systems_1_Signal_Modeling_2_Modified_Covariance_AR_Estimator
sourcesrc/ICoreBlocks/ICoreBlockLibrary/Blocks/Control_Systems/Signal_Modeling/Modified_Covariance_AR_Estimator/ICoreBlock_0_Control_Systems_1_Signal_Modeling_2_Modified_Covariance_AR_Estimator.cpp
headersrc/ICoreBlocks/ICoreBlockLibrary/Blocks/Control_Systems/Signal_Modeling/Modified_Covariance_AR_Estimator/ICoreBlock_0_Control_Systems_1_Signal_Modeling_2_Modified_Covariance_AR_Estimator.h
default size on canvas120 × 70 px
ports at insert1 in, 2 out
code generators implementedPython, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog, PLC Structured Text

Ports#

#DirectionSignal typeDescription label
1inICoreDoubleu
2outICoreDoubleA
3outICoreDoubleG

Ports the constructor creates. A block whose port list changes with its configuration adds or removes ports at load time; the count above is the one a freshly inserted block has.

Configuration variables#

Config variableDefaultSimulink parameter
Estimation Order4P

Every block also carries Sampling Time (s) from ICoreBlockSolverEnvironment: zero or less inherits the solver's rate, a positive value runs the block at that period.

supportSupport::Both
Simulink pathdspparest3/Modified Covariance AR Estimator
port-count rulePortsParam::None
SampleTime parameterno — the counterpart defines none; the rate stays on the ICore side
ICore configSimulink parameterValue translation
Estimation OrderPpasses through

Caveat (shown to the user): dspparest3/Modified Covariance AR Estimator has NO SampleTime parameter (verified against the R2026a block dialog), so "Sampling Time (s)" does not cross

Catalog contract: src/ICoreBlocks/ICoreCoder/ICoreCommandSystem/SimulinkBridge/ICoreSimulinkBlockCatalog.h

Description vs code#

The checker has a blind spot here — it could not resolve something (a grouped port bullet, a computed config name), which is reported and never counted as a pass. A reader has to settle it:

  • B0 every stimulus in the sample errored — cross-checks skipped

The verdict above is tools/docs/check_block_descriptions.py (P7.1), which compares LISTS. It cannot read a sentence: "stateless" on a block with a state, an initial-value semantic the recursion does not implement, a "not synthesizable" caveat the HDL banner contradicts. That is the agent audit (P7.3) on BLOCK_DESCRIPTION_AUDIT.md, and this tool's green is not a substitute for one.

File banner (developer view)#

The top comment of the block's .cpp — the maths, the realization and the export strategy, addressed to whoever changes it. It must not contradict the description above (P7.5).

Modified Covariance AR Estimator block — an order-p AR model of a signal frame by the modified covariance method MATLAB's armcov, and the DSP System Toolbox block dspparest3/Modified Covariance AR Estimator, both measured on R2026a before a line of this was written. It publishes

A the prediction-error filter, p+1 entries with A[0] = 1 G the error VARIANCE (not its square root)

The solve, the spectrum and all ten emitted bodies live in ICoreArEstimationSupport, beside the measurements that justify them; this file is the block's ports, parameters and bridge.

Code export: all ten targets. The three HDL ones are SIMULATION-ONLY real arithmetic -- the solve divides by quantities a Q16.16 datapath cannot carry.

Sample results#

No stimulus produced a sampled output in this rig — Invalid input size at Modified Covariance AR Estimator block: ICore Blocks/Home/Modified Covariance AR Estimator. That is a fact about the single-block rig, not a verdict on the block: an offline batch fit, a block whose output only appears at onSolverFinish, or one that needs a driven environment cannot be exercised alone.

Category unsampled · sample time 0.1 · 60 steps · commit 358d2d933 · produced by docsSample --out <folder> --blocks Burg_AR_Estimator Yule_Walker_AR_Estimator Covariance_AR_Estimator Modified_Covariance_AR_Estimator Burg_Method Yule_Walker_Method Covariance_Method Modified_Covariance_Method --steps 60

Sample data: docs/generated/samples/Control_Systems__Signal_Modeling__Modified_Covariance_AR_Estimator.json