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
LowpassFilter Class Reference
This class implements a time-discrete 2nd order lowpass filter for a series of data values. More...
#include <LowpassFilter.h>
Public Member Functions | |
| LowpassFilter () | |
| Creates a LowpassFilter object with a default cutoff 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 cutoff frequency of this filter. | |
| float | getFrequency () |
| Gets the current cutoff frequency of this filter. | |
| float | filter (float value) |
| Filters a value. | |
Detailed Description
This class implements a time-discrete 2nd order lowpass 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 17 of file LowpassFilter.h.
Constructor & Destructor Documentation
| LowpassFilter | ( | ) |
Creates a LowpassFilter object with a default cutoff frequency of 1000 [rad/s].
Definition at line 15 of file LowpassFilter.cpp.
| ~LowpassFilter | ( | ) | [virtual] |
Deletes the LowpassFilter object.
Definition at line 34 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 102 of file LowpassFilter.cpp.
| float getFrequency | ( | ) |
Gets the current cutoff frequency of this filter.
- Returns:
- the current cutoff frequency in [rad/s].
Definition at line 92 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 49 of file LowpassFilter.cpp.
| void reset | ( | ) |
Resets the filtered value to zero.
Definition at line 39 of file LowpassFilter.cpp.
| void setFrequency | ( | float | frequency ) |
Sets the cutoff frequency of this filter.
- Parameters:
-
frequency the cutoff frequency of the filter in [rad/s].
Definition at line 76 of file LowpassFilter.cpp.
| void setPeriod | ( | float | period ) |
Sets the sampling period of the filter.
This is typically the sampling period of the periodic task of a controller that uses this filter.
- Parameters:
-
the sampling period, given in [s].
Definition at line 60 of file LowpassFilter.cpp.
Generated on Sun Jul 23 2023 17:17:31 by
1.7.2