Skip to content

Commit 3830019

Browse files
vi7njtigue-bdai
andauthored
Fixes sign in DigitalFilter documentation (#3313)
# Description Fixes #3293 Corrects the documentation for implementing a low-pass filter with DigitalFilter. The coefficient A should be [-α] not [α] because DigitalFilter subtracts the recursive term (Y*A) in its implementation. <!-- As a practice, it is recommended to open an issue to have discussions on the proposed pull request. This makes it easier for the community to keep track of what is being developed or added, and if a given feature is demanded by more than one party. --> ## Type of change <!-- As you go through the list, delete the ones that are not applicable. --> - Bug fix (non-breaking change which fixes an issue) - This change requires a documentation update ## Screenshots Please attach before and after screenshots of the change if applicable. <!-- Example: | Before | After | | ------ | ----- | | _gif/png before_ | _gif/png after_ | To upload images to a PR -- simply drag and drop an image while in edit mode and it should upload the image directly. You can then paste that source into the above before/after sections. --> ## Checklist - [ ] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have updated the changelog and the corresponding version in the extension's `config/extension.toml` file - [ ] I have added my name to the `CONTRIBUTORS.md` or my name already exists there <!-- As you go through the checklist above, you can mark something as done by putting an x character in it For example, - [x] I have done this task - [ ] I have not done this task --> Co-authored-by: James Tigue <[email protected]>
1 parent 802ec5b commit 3830019

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

source/isaaclab/isaaclab/utils/modifiers/modifier.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,13 @@ class DigitalFilter(ModifierBase):
123123
where :math:`\alpha` is a smoothing parameter between 0 and 1. Typically, the value of :math:`\alpha` is
124124
chosen based on the desired cut-off frequency of the filter.
125125
126-
This filter can be implemented as a digital filter with the coefficients :math:`A = [\alpha]` and
126+
This filter can be implemented as a digital filter with the coefficients :math:`A = [-\alpha]` and
127127
:math:`B = [1 - \alpha]`.
128128
"""
129129

130-
def __init__(self, cfg: modifier_cfg.DigitalFilterCfg, data_dim: tuple[int, ...], device: str) -> None:
130+
def __init__(
131+
self, cfg: modifier_cfg.DigitalFilterCfg, data_dim: tuple[int, ...], device: str
132+
) -> None:
131133
"""Initializes digital filter.
132134
133135
Args:
@@ -141,7 +143,9 @@ def __init__(self, cfg: modifier_cfg.DigitalFilterCfg, data_dim: tuple[int, ...]
141143
"""
142144
# check that filter coefficients are not None
143145
if cfg.A is None or cfg.B is None:
144-
raise ValueError("Digital filter coefficients A and B must not be None. Please provide valid coefficients.")
146+
raise ValueError(
147+
"Digital filter coefficients A and B must not be None. Please provide valid coefficients."
148+
)
145149

146150
# initialize parent class
147151
super().__init__(cfg, data_dim, device)
@@ -213,7 +217,9 @@ class Integrator(ModifierBase):
213217
:math:`\Delta t` is the time step between samples.
214218
"""
215219

216-
def __init__(self, cfg: modifier_cfg.IntegratorCfg, data_dim: tuple[int, ...], device: str):
220+
def __init__(
221+
self, cfg: modifier_cfg.IntegratorCfg, data_dim: tuple[int, ...], device: str
222+
):
217223
"""Initializes the integrator configuration and state.
218224
219225
Args:

0 commit comments

Comments
 (0)