Filters
filters
¶
AbsoluteValueFilter
¶
Bases: BaseFilter
Rectifies the signal by taking the magnitude of every sample.
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.
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 | |
|---|---|
DeadbandFilter
¶
Bases: BaseFilter
Suppresses noise around zero by forcing values below a threshold to zero.
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.
HighPassFilter
¶
Bases: BaseFilter
Removes low-frequency drift or steady-state offsets. Implemented as the complement of the Exponential Moving Average.
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.
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.
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 | |
|---|---|
MedianFilter
¶
Bases: BaseFilter
Applies a sliding window median filter. Highly effective for removing impulse noise (spikes) without blurring edges.
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 | |
|---|---|
NormalizeFilter
¶
Bases: BaseFilter
Rescales the signal to the range [0, 1].
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 | |
|---|---|
RollingMeanFilter
¶
Bases: BaseFilter
Applies a sliding window average to the signal.
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 | |
|---|---|
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.
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.
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 | |
|---|---|
TaringFilter
¶
Bases: BaseFilter
Offsets the entire signal so that the first sample is zero.
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 | |
|---|---|
UnitFilter
¶
Bases: BaseFilter
Unit conversion using Pint. Ensures dimensional consistency and applies necessary scaling/offsets.
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.
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 | |
|---|---|