arx(var,
D, b0, b1, …, bN-1, a1, a2, …, aN, mode)
This transform implements
a causal linear filter of arbitrary degree with dead-time. The equation
implemented is
res[t]=-a1[t]*res[t-1]-a2[t]*res[t-2]-…
+b0[t]*var[t-D]+b1[t]*var[t-1-D]+…
such that var[t] is the filter input, res[t]
is the filter output, D is a constant integer delay, and the parameters
ai and bi are either constants or variables (within the artifacts
tabs, this is accessible directly as the Transform > Dynamic Filter
option).
The filter degree, N, is inferred from the
total number of arguments with the assumption that an equal number
of a and b parameters is specified. To implement an unbalanced transfer
function, the value 0.0 is specified for unused parameters. There
is no restriction against specifying unstable filters. If a Break status
is encountered in either var or one of the parameter variables as
part of transform evaluation, the filter is put into an off-line
state. This state propagates a Break status to the output and requires
that the filter be re-primed before normal filtering resumes. This
re-priming occurs automatically when both var and the parameters
return to OK status and causes the internal filter states to re-initialize
to steady-state values consistent with the new input value var[t].
Note that if the filter parameters define any discrete time poles
at z=1 (embedded integrators), the steady-state condition of the
filter has all internal states set to 0.0.
The mode argument is used to control processing
of Error statuses; it can be FILTER_DISABLE or FILTER_SMOOTH. FILTER_DISABLE
causes the filter to go off-line and propagate the Error status
to the output. This is the typical mode used during signal shaping
and noise filtering applications where errors are not a systematic
part of the process. FILTER_SMOOTH is more applicable when frequent
errors are expected as part of normal behavior, such as when a set
of sparse lab measurements occurs with intervening error values.
In this mode, the filter returns an OK status and attempts to filter
smoothly over the error condition.
Examples:
- Causal Shift: A causal shift can either be performed using the D term as in
$shift(!x!,1) == $arx( !x!,1, 1, 0, $FILTER_DISABLE
)
$shift(!x!,2) == $arx( !x!,2, 1, 0, $FILTER_DISABLE
)
or using the b terms as in
$shift(!x!,1) == $arx( !x!,0, 0,1, 0,0,
$FILTER_DISABLE )
$shift(!x!,2) == $arx( !x!,0, 0,0,1, 0,0,0,
$FILTER_DISABLE )
- Prev: The $prev transform is not really an operator like shift but an accessor of a previous row of the output of the transform. Its equivalent using ARX would be context dependent.
- Non-Causal Shift: Non-causal transforms such as $shift(x,-2) are not representable using ARX. However, most of the on line uses of non-causal $shift are used to get around the state problem. Furthermore, non-causal shift is usually not as problematic on-line as the causal shift.
- Delta: The $delta(!x!,1) transform is also non-causal since it computes
y[k] = x[k+1] - x[k]
Here, we need to use two transforms.
First use ARX to maintain correct state at the beginning of the table,
followed by shift to provide the non-causality:
!y1! = $arx (!x!,0, 1,-1, 0,0, $FILTER_DISABLE
)
!y2! = $shift (!y1!, -1 )
- Integrator: The ARX filter can also be used to simulate an integrator:
!intx! = $arx (!x!,0, 1, -1, $FILTER_DISABLE
)
Provide Feedback