Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Fork of DrehungMitStopp by
LowpassFilter Class Reference
This class implements a time-discrete 2nd order low-pass filter for a series of data values. More...
#include <LowpassFilter.h>
Public Member Functions | |
| LowpassFilter () | |
| Creates a LowpassFilter object with a default corner frequency of 1000 [rad/s]. | |
| virtual | ~LowpassFilter () |
| Deletes the LowpassFilter object. | |
| void | reset () |
| Resets the filtered value to zero. | |
| void | reset (float value) |
| Resets the filtered value to a given value. | |
| void | setPeriod (float period) |
| Sets the sampling period of the filter. | |
| void | setFrequency (float frequency) |
| Sets the corner frequency of this filter. | |
| float | getFrequency () |
| Gets the current corner frequency of this filter. | |
| float | filter (float value) |
| Filters a value. | |
Detailed Description
This class implements a time-discrete 2nd order low-pass filter for a series of data values.
This filter can typically be used within a periodic task that takes measurements that need to be filtered, like speed or position values.
Definition at line 15 of file LowpassFilter.h.
Constructor & Destructor Documentation
| LowpassFilter | ( | ) |
Creates a LowpassFilter object with a default corner frequency of 1000 [rad/s].
Definition at line 11 of file LowpassFilter.cpp.
| ~LowpassFilter | ( | ) | [virtual] |
Deletes the LowpassFilter object.
Definition at line 30 of file LowpassFilter.cpp.
Member Function Documentation
| float filter | ( | float | value ) |
Filters a value.
- Parameters:
-
value the original unfiltered value.
- Returns:
- the filtered value.
Definition at line 98 of file LowpassFilter.cpp.
| float getFrequency | ( | ) |
Gets the current corner frequency of this filter.
- Returns:
- the current corner frequency in [rad/s].
Definition at line 88 of file LowpassFilter.cpp.
| void reset | ( | float | value ) |
Resets the filtered value to a given value.
- Parameters:
-
value the value to reset the filter to.
Definition at line 45 of file LowpassFilter.cpp.
| void reset | ( | ) |
Resets the filtered value to zero.
Definition at line 35 of file LowpassFilter.cpp.
| void setFrequency | ( | float | frequency ) |
Sets the corner frequency of this filter.
- Parameters:
-
frequency the corner frequency of the filter in [rad/s].
Definition at line 72 of file LowpassFilter.cpp.
| void setPeriod | ( | float | period ) |
Sets the sampling period of the filter.
This is typically the sampling period of the realtime thread of a controller that uses this filter.
- Parameters:
-
the sampling period, given in [s].
Definition at line 56 of file LowpassFilter.cpp.
Generated on Sat Jul 30 2022 21:47:01 by
1.7.2
