|
FilterGen
1.0.0
A library to design digital filters in embedded systems.
|
This class holds the C++ bindings to the filter library. More...
#include <dh/cpp/filter.hpp>
Classes | |
| class | error |
| struct | graph_point |
| class | span |
Public Types | |
| using | parameters_t = dh_filter_parameters |
Public Member Functions | |
| filter (parameters_t options) | |
| Constructs a filter with the given options. More... | |
| filter (const filter &) | |
| Deep copy. | |
| filter & | operator= (const filter &) |
| Deep copy. | |
| filter (filter &&) | |
| Move constructor. More... | |
| filter & | operator= (filter &&) |
| Move assignment. More... | |
| double | update (double in) |
| Updates the internal state of the filter with a new input value and returns the updated filtered value. More... | |
| double | current_value () const noexcept |
| Returns the filtered value without changing the state of the filter. More... | |
| const parameters_t & | options () const |
| void | set_gain (double gain) |
| double | gain () const |
| std::vector< dh_frequency_response_t > | compute_frequency_response (size_t count) const |
| Computes the frequency response of the filter and returns a vector with count entries. More... | |
| std::vector< graph_point > | compute_step_response () const |
| Computes the step response of the filter. More... | |
| std::vector< graph_point > | compute_impulse_response () const |
| Computes the impulse response of the filter. More... | |
| bool | good () const noexcept |
| span | feedforward_coefficients () const noexcept |
| span | feedback_coefficients () const noexcept |
This class holds the C++ bindings to the filter library.
Simply construct it with given options and you are ready to use your filter. If an error occurs, an exception will be thrown. This should either happen if the given parameters are invalid, you are out of memory or if the filter structure was moved from.
| dh::filter::error | in case something goes wrong. |
Typedef to the parameter structure
| dh::filter::filter | ( | parameters_t | options | ) |
Constructs a filter with the given options.
| dh::filter::error | in case something goes wrong. |
| dh::filter::filter | ( | filter && | ) |
Move constructor.
| std::vector<dh_frequency_response_t> dh::filter::compute_frequency_response | ( | size_t | count | ) | const |
Computes the frequency response of the filter and returns a vector with count entries.
The response is computed in the range of [0,sampling_frequency/2]. The distance between the entries will be half of sampling_frequency/count.
| [in] | count | Number values to compute |
| std::vector<graph_point> dh::filter::compute_impulse_response | ( | ) | const |
Computes the impulse response of the filter.
The response is computed in the range of [-10,2*number of feedforward coefficients].
| std::vector<graph_point> dh::filter::compute_step_response | ( | ) | const |
Computes the step response of the filter.
The response is computed in the range of [-10,2*number of feedforward coefficients].
|
inlinenoexcept |
Returns the filtered value without changing the state of the filter.
|
noexcept |
Returns a range of the output coefficients.
|
noexcept |
Returns a range of the input coefficients of the filter.
| double dh::filter::gain | ( | ) | const |
Gets the current gain of the filter.
|
noexcept |
checks if the filter is usable. (False if object was moved from)
Move assignment.
|
inline |
Returns the configuration of the filter.
| void dh::filter::set_gain | ( | double | gain | ) |
Sets the current gain of the filter.
| [in] | gain | The desired gain. |
| double dh::filter::update | ( | double | in | ) |
Updates the internal state of the filter with a new input value and returns the updated filtered value.
| [in] | in | The next input value. |