Advanced maths

Ho Kalman state space realization calculator from impulse response blocks

Recover a discrete-time state-space realization from a finite sequence of impulse-response blocks using shifted block Hankel matrices.

Your numbers

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Recover a discrete-time state-space realization from a finite sequence of impulse-response blocks using shifted block Hankel matrices.

THE FORMULAH0 = O R; H1 = O A R; H0 ≈ U Σ Vᵀ; A = Σ^(-1/2) Uᵀ H1 V Σ^(-1/2)

A worked example

The blocks D=0, H1=1, H2=1/2, H3=1/4 and subsequent powers are realized by A=1/2, B=1, C=1. The smallest compatible state order is one.

Good to know

One/two inputs and outputs, 5–30 impulse blocks, rank1–6 and Hankel singular-value tolerance. State-space coordinates are nonunique; compare recovered Markov blocks and withheld data. Exact-data minimal-rank convention distinct from noisy ERA truncation; finite observations do not identify arbitrary unbounded-order systems.

From response samples to hidden states

Impulse-response blocks describe how outputs react over successive discrete steps to an input impulse. The realization problem seeks matrices A, B, C and D that reproduce those blocks. Internal states are not observed directly, and the matrices are reconstructed from temporal relationships among the response samples rather than supplied as an initial state-space model.

This differs from converting an already known rational transfer function into a realization. It also extends beyond fitting one scalar exponential series because the blocks can carry several inputs and outputs. The indexing convention must be explicit: the first supplied block is feedthrough D, and subsequent blocks correspond to C B, C A B and higher powers.

Ho Kalman state space realization from impulse response blocksH0:1 1/2 1/41/2 1/4 1/8Rank = 1A = 1/2B = C = 1Response: 1, 1/2, 1/4, 1/8, …
Scroll across to see the full diagram.
The blocks D=0, H1=1, H2=1/2, H3=1/4 and subsequent powers are realized by A=1/2, B=1, C=1. The smallest compatible state order is one.

Compare this with the Transfer function to minimal state space realization calculator. Recover a MIMO discrete-time realization from a finite block sequence of Markov parameters via shifted Hankel matrices, rather than convert an already known rational transfer function.

Why shifted Hankel blocks contain dynamics

Build a block Hankel matrix by placing impulse blocks along constant index sums. It factors into an observability block and a reachability block when the data come from a finite-dimensional linear system. Shifting every response index by one inserts A between those factors, which links the pair of Hankel matrices to the hidden transition dynamics.

The required data length depends on the block dimensions and selected row and column horizons. A short sequence may fit many higher-order systems. Reject a request that cannot form the declared Hankel pair or support the requested rank. Padding missing tail blocks with zeros would invent extra information and can change both the apparent order and recovered dynamics.

Choosing rank from singular values

The singular values of the unshifted Hankel matrix indicate its numerical rank. In exact low-order data, values beyond the system order vanish mathematically. In floating data, a tolerance is needed to distinguish a small signal direction from rounding or measurement error, and that tolerance must be shown alongside the selected state order.

Truncating nonzero singular values produces a reduced or noisy-data approximation rather than an exact realization of every supplied block. The calculator should identify which interpretation applies. A rank request is not justified merely because an SVD routine returns enough columns; reconstruction and withheld-block residuals provide additional evidence about whether the chosen order adequately explains the observations.

Constructing and checking the matrices

Split the retained singular values symmetrically between observability and reachability factors. Use the shifted Hankel matrix to recover A in those coordinates, and take the appropriate first block rows or columns for C and B. Preserve the separately entered feedthrough block D instead of trying to infer it from the delayed response factors.

Then recompute the impulse blocks from the returned matrices using repeated multiplication. This check tests the timing convention as well as the factorization. Matching the Hankel pair used in the construction is useful, but matching additional supplied blocks that were not needed for that pair is a stronger check against an incorrectly chosen order or shift.

The one-state geometric sequence

In the default example, each delayed response is one half the preceding response. The first delayed block is one. A scalar transition A equal to one half, input factor B equal to one and output factor C equal to one therefore gives C A to the power k−1 B equal to two to the power minus k plus one.

All Hankel columns are scalar multiples of the first, so their rank is one. A zero-state realization cannot produce the nonzero delayed response, while the displayed one-state system does produce every listed block. This establishes the minimal compatible order for this example without assuming that an arbitrary finite dataset uniquely determines every possible unbounded-order system.

Why coordinates are not unique

If an invertible change of state coordinates is applied, A changes by similarity while B and C transform correspondingly. Every input-output block remains the same. Thus two correct implementations can return different matrix entries, signs or state scalings even when they describe exactly the same response sequence.

Compare systems through reconstructed blocks, transfer behavior and appropriate similarity invariants rather than raw entries alone. An apparent disagreement in B or C can be a harmless coordinate choice. By contrast, a misplaced feedthrough term or an incorrect sample-period convention changes the observable response and cannot be dismissed as state-coordinate freedom.

Limits of finite identification

The supported input size and state-rank caps keep the complete Hankel construction inspectable. The result assumes a discrete linear time-invariant relationship over the supplied data. It does not identify nonlinear behavior, certify physical parameter values or prove that a noisy process truly has the selected finite order. Stability should be inspected rather than imposed silently.

A fitted realization can also extrapolate poorly beyond the observed horizon. Use withheld impulse blocks when available and compare several plausible ranks or tolerances deliberately. A model that reconstructs its training pair accurately is not automatically a validated forecast of a physical system. The output is a bounded realization calculation with explicitly stated data and numerical assumptions.

A few questions, answered

Is the first block D or C B?

The first supplied block is feedthrough D; the next is the first delayed response C B.

Why do A,B,C differ from another package?

Equivalent state-coordinate changes can alter matrices while preserving all input-output blocks.

Does a finite sequence uniquely identify any system?

No. Order assumptions and sufficient data are needed, and higher-order alternatives may remain compatible.

Should noisy tiny singular values be retained?

That is a modeling choice tied to tolerance, reconstruction and validation residuals, not an automatic mathematical certainty.

Find your calculator

Start typing to explore the library.