Filters
filters
¶
AbsoluteValueFilter
¶
Bases: BaseFilter
Rectifies the signal by taking the magnitude of every sample.
enabled
class-attribute
instance-attribute
¶
enabled: bool = True
Whether this filter step is active.
type
class-attribute
instance-attribute
¶
type: Literal[ABSOLUTE_VALUE] = ABSOLUTE_VALUE
The discriminator type for Pydantic.
apply_with_context
¶
Override for filters that need access to other columns. Receives the current (already-transformed) series and the original dataframe. Return None to fall back to apply(expr).
Source code in src/mujoco_mojo/utils/filters/filters.py
| Python | |
|---|---|
ClipFilter
¶
Bases: BaseFilter
Clamps the signal values within a specified range.
enabled
class-attribute
instance-attribute
¶
enabled: bool = True
Whether this filter step is active.
type
class-attribute
instance-attribute
¶
type: Literal[CLIP] = CLIP
The discriminator type for Pydantic.
min
class-attribute
instance-attribute
¶
min: float | None = None
Optional lower bound; values below this will be set to min.
max
class-attribute
instance-attribute
¶
max: float | None = None
Optional upper bound; values above this will be set to max.
apply_with_context
¶
Override for filters that need access to other columns. Receives the current (already-transformed) series and the original dataframe. Return None to fall back to apply(expr).
Source code in src/mujoco_mojo/utils/filters/filters.py
| Python | |
|---|---|
ComparisonFilter
¶
Bases: BaseFilter
Compares each sample against a threshold, returning 1.0 (true) or 0.0 (false).
enabled
class-attribute
instance-attribute
¶
enabled: bool = True
Whether this filter step is active.
type
class-attribute
instance-attribute
¶
type: Literal[COMPARISON] = COMPARISON
The discriminator type for Pydantic.
operator
class-attribute
instance-attribute
¶
operator: _COMPARISON_OPS = Field(
default="gt", json_schema_extra={"ui_type": "select"}
)
Comparison operator: gt (>), gte (>=), lt (<), lte (<=), eq (==), neq (!=).
threshold
class-attribute
instance-attribute
¶
threshold: float = 0.0
The value to compare each sample against.
apply_with_context
¶
Override for filters that need access to other columns. Receives the current (already-transformed) series and the original dataframe. Return None to fall back to apply(expr).
Source code in src/mujoco_mojo/utils/filters/filters.py
| Python | |
|---|---|
DeadbandFilter
¶
Bases: BaseFilter
Suppresses noise around zero by forcing values below a threshold to zero.
enabled
class-attribute
instance-attribute
¶
enabled: bool = True
Whether this filter step is active.
type
class-attribute
instance-attribute
¶
type: Literal[DEADBAND] = DEADBAND
The discriminator type for Pydantic.
threshold
class-attribute
instance-attribute
¶
Magnitude threshold; values where abs(x) <= threshold are set to 0.
apply_with_context
¶
Override for filters that need access to other columns. Receives the current (already-transformed) series and the original dataframe. Return None to fall back to apply(expr).
Source code in src/mujoco_mojo/utils/filters/filters.py
| Python | |
|---|---|
DerivativeFilter
¶
Bases: BaseFilter
Computes the numerical rate of change using backward difference. Useful for deriving velocity from position or acceleration from velocity.
enabled
class-attribute
instance-attribute
¶
enabled: bool = True
Whether this filter step is active.
type
class-attribute
instance-attribute
¶
type: Literal[DERIVATIVE] = DERIVATIVE
The discriminator type for Pydantic.
dt
class-attribute
instance-attribute
¶
The time step between samples in seconds. Ignored when wrt_col is set.
ExpFilter
¶
Bases: BaseFilter
Raises a base to the power of each signal sample. Defaults to e^x.
enabled
class-attribute
instance-attribute
¶
enabled: bool = True
Whether this filter step is active.
type
class-attribute
instance-attribute
¶
type: Literal[EXP] = EXP
The discriminator type for Pydantic.
base
class-attribute
instance-attribute
¶
The base to exponentiate. Use e (2.718...) for the natural exponential.
apply_with_context
¶
Override for filters that need access to other columns. Receives the current (already-transformed) series and the original dataframe. Return None to fall back to apply(expr).
Source code in src/mujoco_mojo/utils/filters/filters.py
| Python | |
|---|---|
FirstFilter
¶
Bases: BaseFilter
Reduces the signal to its first value, broadcast across every sample.
enabled
class-attribute
instance-attribute
¶
enabled: bool = True
Whether this filter step is active.
type
class-attribute
instance-attribute
¶
type: Literal[STAT_FIRST] = STAT_FIRST
The discriminator type for Pydantic.
apply_with_context
¶
Override for filters that need access to other columns. Receives the current (already-transformed) series and the original dataframe. Return None to fall back to apply(expr).
Source code in src/mujoco_mojo/utils/filters/filters.py
| Python | |
|---|---|
HighPassFilter
¶
Bases: BaseFilter
Removes low-frequency drift or steady-state offsets. Implemented as the complement of the Exponential Moving Average.
enabled
class-attribute
instance-attribute
¶
enabled: bool = True
Whether this filter step is active.
type
class-attribute
instance-attribute
¶
type: Literal[HIGH_PASS] = HIGH_PASS
The discriminator type for Pydantic.
alpha
class-attribute
instance-attribute
¶
Smoothing factor used for the underlying low-pass component.
apply_with_context
¶
Override for filters that need access to other columns. Receives the current (already-transformed) series and the original dataframe. Return None to fall back to apply(expr).
Source code in src/mujoco_mojo/utils/filters/filters.py
| Python | |
|---|---|
IntegralFilter
¶
Bases: BaseFilter
Computes the cumulative sum of the signal multiplied by the time step. Useful for deriving position from velocity or calculating energy.
enabled
class-attribute
instance-attribute
¶
enabled: bool = True
Whether this filter step is active.
type
class-attribute
instance-attribute
¶
type: Literal[INTEGRAL] = INTEGRAL
The discriminator type for Pydantic.
dt
class-attribute
instance-attribute
¶
The time step between samples in seconds. Ignored when wrt_col is set.
LastFilter
¶
Bases: BaseFilter
Reduces the signal to its last value, broadcast across every sample.
enabled
class-attribute
instance-attribute
¶
enabled: bool = True
Whether this filter step is active.
type
class-attribute
instance-attribute
¶
type: Literal[STAT_LAST] = STAT_LAST
The discriminator type for Pydantic.
apply_with_context
¶
Override for filters that need access to other columns. Receives the current (already-transformed) series and the original dataframe. Return None to fall back to apply(expr).
Source code in src/mujoco_mojo/utils/filters/filters.py
| Python | |
|---|---|
LogFilter
¶
Bases: BaseFilter
Applies a logarithm to the signal. Defaults to natural log (base e).
enabled
class-attribute
instance-attribute
¶
enabled: bool = True
Whether this filter step is active.
type
class-attribute
instance-attribute
¶
type: Literal[LOG] = LOG
The discriminator type for Pydantic.
base
class-attribute
instance-attribute
¶
Logarithm base. Use e (2.718...) for natural log, 2 for log2, 10 for log10.
apply_with_context
¶
Override for filters that need access to other columns. Receives the current (already-transformed) series and the original dataframe. Return None to fall back to apply(expr).
Source code in src/mujoco_mojo/utils/filters/filters.py
| Python | |
|---|---|
LowPassFilter
¶
Bases: BaseFilter
Applies a 1st-order Exponential Moving Average (EMA) to smooth the signal. Effective for removing high-frequency noise while introducing slight phase lag.
enabled
class-attribute
instance-attribute
¶
enabled: bool = True
Whether this filter step is active.
type
class-attribute
instance-attribute
¶
type: Literal[LOW_PASS] = LOW_PASS
The discriminator type for Pydantic.
alpha
class-attribute
instance-attribute
¶
Smoothing factor (0 < alpha <= 1). Lower values result in heavier smoothing.
apply_with_context
¶
Override for filters that need access to other columns. Receives the current (already-transformed) series and the original dataframe. Return None to fall back to apply(expr).
Source code in src/mujoco_mojo/utils/filters/filters.py
| Python | |
|---|---|
MaxFilter
¶
Bases: BaseFilter
Reduces the signal to its maximum value, broadcast across every sample.
enabled
class-attribute
instance-attribute
¶
enabled: bool = True
Whether this filter step is active.
type
class-attribute
instance-attribute
¶
type: Literal[STAT_MAX] = STAT_MAX
The discriminator type for Pydantic.
apply_with_context
¶
Override for filters that need access to other columns. Receives the current (already-transformed) series and the original dataframe. Return None to fall back to apply(expr).
Source code in src/mujoco_mojo/utils/filters/filters.py
| Python | |
|---|---|
MeanFilter
¶
Bases: BaseFilter
Reduces the signal to its mean value, broadcast across every sample.
enabled
class-attribute
instance-attribute
¶
enabled: bool = True
Whether this filter step is active.
type
class-attribute
instance-attribute
¶
type: Literal[STAT_MEAN] = STAT_MEAN
The discriminator type for Pydantic.
apply_with_context
¶
Override for filters that need access to other columns. Receives the current (already-transformed) series and the original dataframe. Return None to fall back to apply(expr).
Source code in src/mujoco_mojo/utils/filters/filters.py
| Python | |
|---|---|
MedianFilter
¶
Bases: BaseFilter
Reduces the signal to its median value, broadcast across every sample.
enabled
class-attribute
instance-attribute
¶
enabled: bool = True
Whether this filter step is active.
type
class-attribute
instance-attribute
¶
type: Literal[STAT_MEDIAN] = STAT_MEDIAN
The discriminator type for Pydantic.
apply_with_context
¶
Override for filters that need access to other columns. Receives the current (already-transformed) series and the original dataframe. Return None to fall back to apply(expr).
Source code in src/mujoco_mojo/utils/filters/filters.py
| Python | |
|---|---|
MinFilter
¶
Bases: BaseFilter
Reduces the signal to its minimum value, broadcast across every sample.
enabled
class-attribute
instance-attribute
¶
enabled: bool = True
Whether this filter step is active.
type
class-attribute
instance-attribute
¶
type: Literal[STAT_MIN] = STAT_MIN
The discriminator type for Pydantic.
apply_with_context
¶
Override for filters that need access to other columns. Receives the current (already-transformed) series and the original dataframe. Return None to fall back to apply(expr).
Source code in src/mujoco_mojo/utils/filters/filters.py
| Python | |
|---|---|
ModeFilter
¶
Bases: BaseFilter
Reduces the signal to its most frequent value, broadcast across every sample.
enabled
class-attribute
instance-attribute
¶
enabled: bool = True
Whether this filter step is active.
type
class-attribute
instance-attribute
¶
type: Literal[STAT_MODE] = STAT_MODE
The discriminator type for Pydantic.
apply_with_context
¶
Override for filters that need access to other columns. Receives the current (already-transformed) series and the original dataframe. Return None to fall back to apply(expr).
Source code in src/mujoco_mojo/utils/filters/filters.py
| Python | |
|---|---|
NormalizeFilter
¶
Bases: BaseFilter
Rescales the signal to the range [0, 1].
enabled
class-attribute
instance-attribute
¶
enabled: bool = True
Whether this filter step is active.
type
class-attribute
instance-attribute
¶
type: Literal[NORMALIZE] = NORMALIZE
The discriminator type for Pydantic.
apply_with_context
¶
Override for filters that need access to other columns. Receives the current (already-transformed) series and the original dataframe. Return None to fall back to apply(expr).
Source code in src/mujoco_mojo/utils/filters/filters.py
| Python | |
|---|---|
PowerFilter
¶
Bases: BaseFilter
Raises each signal sample to a fixed exponent. Supports fractional exponents (e.g. 0.5 for sqrt).
enabled
class-attribute
instance-attribute
¶
enabled: bool = True
Whether this filter step is active.
type
class-attribute
instance-attribute
¶
type: Literal[POWER] = POWER
The discriminator type for Pydantic.
exponent
class-attribute
instance-attribute
¶
The power to raise each sample to. Use 0.5 for square root, 1/3 for cube root.
apply_with_context
¶
Override for filters that need access to other columns. Receives the current (already-transformed) series and the original dataframe. Return None to fall back to apply(expr).
Source code in src/mujoco_mojo/utils/filters/filters.py
| Python | |
|---|---|
ReverseFilter
¶
Bases: BaseFilter
Reverses the order of the signal's values without changing their order of occurrence in time.
enabled
class-attribute
instance-attribute
¶
enabled: bool = True
Whether this filter step is active.
type
class-attribute
instance-attribute
¶
type: Literal[REVERSE] = REVERSE
The discriminator type for Pydantic.
apply_with_context
¶
Override for filters that need access to other columns. Receives the current (already-transformed) series and the original dataframe. Return None to fall back to apply(expr).
Source code in src/mujoco_mojo/utils/filters/filters.py
| Python | |
|---|---|
RollingMeanFilter
¶
Bases: BaseFilter
Applies a sliding window average to the signal.
enabled
class-attribute
instance-attribute
¶
enabled: bool = True
Whether this filter step is active.
type
class-attribute
instance-attribute
¶
type: Literal[ROLLING_MEAN] = ROLLING_MEAN
The discriminator type for Pydantic.
window
class-attribute
instance-attribute
¶
Size of the sliding window in samples.
center
class-attribute
instance-attribute
¶
center: bool = True
If True, centers the window on the current sample to minimize phase lag.
apply_with_context
¶
Override for filters that need access to other columns. Receives the current (already-transformed) series and the original dataframe. Return None to fall back to apply(expr).
Source code in src/mujoco_mojo/utils/filters/filters.py
| Python | |
|---|---|
RollingMedianFilter
¶
Bases: BaseFilter
Applies a sliding window median filter. Highly effective for removing impulse noise (spikes) without blurring edges.
enabled
class-attribute
instance-attribute
¶
enabled: bool = True
Whether this filter step is active.
type
class-attribute
instance-attribute
¶
type: Literal[MEDIAN] = MEDIAN
The discriminator type for Pydantic.
window
class-attribute
instance-attribute
¶
Size of the sliding window in samples.
apply_with_context
¶
Override for filters that need access to other columns. Receives the current (already-transformed) series and the original dataframe. Return None to fall back to apply(expr).
Source code in src/mujoco_mojo/utils/filters/filters.py
| Python | |
|---|---|
RotationFilter
¶
Bases: BaseFilter
Rotates a 3D vector component into a reference frame using a quaternion column.
enabled
class-attribute
instance-attribute
¶
enabled: bool = True
Whether this filter step is active.
type
class-attribute
instance-attribute
¶
type: Literal[ROTATION] = ROTATION
The discriminator type for Pydantic.
quat_col
class-attribute
instance-attribute
¶
Base name of the quaternion column group (e.g. 'Bodies/hand/xquat').
invert
class-attribute
instance-attribute
¶
invert: bool = True
If True, transforms world-to-local (invert the quaternion rotation).
apply_to_frame
¶
Rotate all xyz vector families in vector_bases in one pass. Used by MojoDataFrame.with_rotation and any write path that needs the full-frame transform.
Source code in src/mujoco_mojo/utils/filters/filters.py
RoundFilter
¶
Bases: BaseFilter
Quantizes the signal to a fixed number of decimal places.
enabled
class-attribute
instance-attribute
¶
enabled: bool = True
Whether this filter step is active.
type
class-attribute
instance-attribute
¶
type: Literal[ROUND] = ROUND
The discriminator type for Pydantic.
method
class-attribute
instance-attribute
¶
method: Literal["round", "floor", "ceil"] = Field(
default="round", json_schema_extra={"ui_type": "select"}
)
Rounding method: round (nearest), floor (toward -inf), or ceil (toward +inf).
decimals
class-attribute
instance-attribute
¶
Number of decimal places to round to (only used when method is 'round').
apply_with_context
¶
Override for filters that need access to other columns. Receives the current (already-transformed) series and the original dataframe. Return None to fall back to apply(expr).
Source code in src/mujoco_mojo/utils/filters/filters.py
| Python | |
|---|---|
SavitzkyGolayFilter
¶
Bases: BaseFilter
Applies a Savitzky-Golay smoothing filter by fitting a polynomial to the data. Preserves signal features (like peaks and transients) better than a simple moving average.
enabled
class-attribute
instance-attribute
¶
enabled: bool = True
Whether this filter step is active.
type
class-attribute
instance-attribute
¶
type: Literal[SAVITZKY_GOLAY] = SAVITZKY_GOLAY
The discriminator type for Pydantic.
window
class-attribute
instance-attribute
¶
Number of samples in the sliding window; must be an odd integer.
order
class-attribute
instance-attribute
¶
The order of the polynomial used to fit the samples.
apply_with_context
¶
Override for filters that need access to other columns. Receives the current (already-transformed) series and the original dataframe. Return None to fall back to apply(expr).
Source code in src/mujoco_mojo/utils/filters/filters.py
| Python | |
|---|---|
ScaleFilter
¶
Bases: BaseFilter
Applies a linear transformation: (value * factor) + offset.
enabled
class-attribute
instance-attribute
¶
enabled: bool = True
Whether this filter step is active.
type
class-attribute
instance-attribute
¶
type: Literal[SCALE] = SCALE
The discriminator type for Pydantic.
factor
class-attribute
instance-attribute
¶
factor: float = 1.0
Multiplicative gain applied to the signal.
offset
class-attribute
instance-attribute
¶
offset: float = 0.0
Additive constant applied after scaling.
apply_with_context
¶
Override for filters that need access to other columns. Receives the current (already-transformed) series and the original dataframe. Return None to fall back to apply(expr).
Source code in src/mujoco_mojo/utils/filters/filters.py
| Python | |
|---|---|
SignFilter
¶
Bases: BaseFilter
Returns the sign of each sample: 1 for positive, -1 for negative, 0 for zero.
enabled
class-attribute
instance-attribute
¶
enabled: bool = True
Whether this filter step is active.
type
class-attribute
instance-attribute
¶
type: Literal[SIGN] = SIGN
The discriminator type for Pydantic.
apply_with_context
¶
Override for filters that need access to other columns. Receives the current (already-transformed) series and the original dataframe. Return None to fall back to apply(expr).
Source code in src/mujoco_mojo/utils/filters/filters.py
| Python | |
|---|---|
SortFilter
¶
Bases: BaseFilter
Sorts the signal's values in ascending or descending order.
enabled
class-attribute
instance-attribute
¶
enabled: bool = True
Whether this filter step is active.
type
class-attribute
instance-attribute
¶
type: Literal[SORT] = SORT
The discriminator type for Pydantic.
descending
class-attribute
instance-attribute
¶
descending: bool = False
Whether to sort in descending order.
apply_with_context
¶
Override for filters that need access to other columns. Receives the current (already-transformed) series and the original dataframe. Return None to fall back to apply(expr).
Source code in src/mujoco_mojo/utils/filters/filters.py
| Python | |
|---|---|
StandardDeviationFilter
¶
Bases: BaseFilter
Reduces the signal to its standard deviation, broadcast across every sample.
enabled
class-attribute
instance-attribute
¶
enabled: bool = True
Whether this filter step is active.
type
class-attribute
instance-attribute
¶
type: Literal[STAT_STANDARD_DEVIATION] = (
STAT_STANDARD_DEVIATION
)
The discriminator type for Pydantic.
apply_with_context
¶
Override for filters that need access to other columns. Receives the current (already-transformed) series and the original dataframe. Return None to fall back to apply(expr).
Source code in src/mujoco_mojo/utils/filters/filters.py
| Python | |
|---|---|
TaringFilter
¶
Bases: BaseFilter
Offsets the entire signal so that the first sample is zero.
enabled
class-attribute
instance-attribute
¶
enabled: bool = True
Whether this filter step is active.
type
class-attribute
instance-attribute
¶
type: Literal[TARING] = TARING
The discriminator type for Pydantic.
apply_with_context
¶
Override for filters that need access to other columns. Receives the current (already-transformed) series and the original dataframe. Return None to fall back to apply(expr).
Source code in src/mujoco_mojo/utils/filters/filters.py
| Python | |
|---|---|
TrigFilter
¶
Bases: BaseFilter
Applies a trigonometric or angle-conversion function to the signal.
enabled
class-attribute
instance-attribute
¶
enabled: bool = True
Whether this filter step is active.
type
class-attribute
instance-attribute
¶
type: Literal[TRIG] = TRIG
The discriminator type for Pydantic.
func
class-attribute
instance-attribute
¶
func: _TRIG_FUNCS = Field(
default="sin", json_schema_extra={"ui_type": "select"}
)
The trig function to apply.
apply_with_context
¶
Override for filters that need access to other columns. Receives the current (already-transformed) series and the original dataframe. Return None to fall back to apply(expr).
Source code in src/mujoco_mojo/utils/filters/filters.py
| Python | |
|---|---|
UnitFilter
¶
Bases: BaseFilter
Unit conversion using Pint. Ensures dimensional consistency and applies necessary scaling/offsets.
enabled
class-attribute
instance-attribute
¶
enabled: bool = True
Whether this filter step is active.
type
class-attribute
instance-attribute
¶
type: Literal[UNIT] = UNIT
The discriminator type for Pydantic.
from_unit
instance-attribute
¶
The original unit of the telemetry data (e.g., 'rad').
to_unit
instance-attribute
¶
The target unit for analysis/display (e.g., 'deg').
apply_with_context
¶
Override for filters that need access to other columns. Receives the current (already-transformed) series and the original dataframe. Return None to fall back to apply(expr).
Source code in src/mujoco_mojo/utils/filters/filters.py
| Python | |
|---|---|
WrapFilter
¶
Bases: BaseFilter
Keeps circular data (like Euler angles or radians) within a specific range. Ensures continuity when a signal crosses the upper or lower boundary.
enabled
class-attribute
instance-attribute
¶
enabled: bool = True
Whether this filter step is active.
type
class-attribute
instance-attribute
¶
type: Literal[WRAP] = WRAP
The discriminator type for Pydantic.
lb
class-attribute
instance-attribute
¶
Lower boundary for the wrap operation.
apply_with_context
¶
Override for filters that need access to other columns. Receives the current (already-transformed) series and the original dataframe. Return None to fall back to apply(expr).
Source code in src/mujoco_mojo/utils/filters/filters.py
| Python | |
|---|---|