mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2024-12-13 11:44:31 +00:00
LinearErrorFilter constructor.
This commit is contained in:
parent
57db6a6367
commit
93b9b9d9ef
@ -66,6 +66,14 @@ private:
|
|||||||
|
|
||||||
class LinearErrorFilter {
|
class LinearErrorFilter {
|
||||||
public:
|
public:
|
||||||
|
LinearErrorFilter(
|
||||||
|
const float filter_alpha = 0.95f,
|
||||||
|
const float error_weight = -1.0f
|
||||||
|
) : filter_alpha { filter_alpha },
|
||||||
|
error_weight { error_weight }
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
float operator()(
|
float operator()(
|
||||||
const float error
|
const float error
|
||||||
) {
|
) {
|
||||||
@ -74,9 +82,9 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
float filter_alpha { 0.95f };
|
const float filter_alpha;
|
||||||
|
const float error_weight;
|
||||||
float error_filtered { 0.0f };
|
float error_filtered { 0.0f };
|
||||||
float error_weight { 0.5f };
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class FixedErrorFilter {
|
class FixedErrorFilter {
|
||||||
|
Loading…
Reference in New Issue
Block a user