baglab.analysis¶
baglab.analysis
¶
Control / signal analysis utilities.
delay_estimate(cmd, response, t)
¶
Estimate dead time / transport delay using cross-correlation.
Parameters¶
cmd : pd.Series Command signal. response : pd.Series Response signal (same length as cmd). t : pd.Series Time in seconds (must be uniformly sampled, or approximately so).
Returns¶
float Estimated delay in seconds.
Raises¶
ImportError If scipy is not installed.
stepinfo(actual, target, t)
¶
Compute step response metrics.
Parameters¶
actual : pd.Series Actual response signal. target : float | pd.Series Target / setpoint value. If a Series, the final value is used as the steady-state target. t : pd.Series Time in seconds.
Returns¶
dict[str, float]
Dictionary with keys overshoot, settling_time, rise_time,
and steady_state_error.
Notes¶
Logic follows MATLAB stepinfo / python-control step_info.
tracking_error(actual, ref, t=None)
¶
Compute tracking error statistics.
Parameters¶
actual : pd.Series Actual values. ref : pd.Series Reference / command values (same length as actual). t : pd.Series | None, optional Time in seconds. Reserved for future time-weighted metrics.
Returns¶
dict
Dictionary with keys error (pd.Series), mean, max,
rms, and std.