2022-06-18 11:16:07 +02:00
|
|
|
#pragma once
|
|
|
|
|
2022-06-19 13:05:58 +02:00
|
|
|
template <class T>
|
|
|
|
struct DcCancelation
|
|
|
|
{
|
2022-06-19 12:17:21 +02:00
|
|
|
T x_n1;
|
|
|
|
T y_n1;
|
|
|
|
T R;
|
|
|
|
|
2022-06-19 13:05:58 +02:00
|
|
|
DcCancelation(T R) : R(R){};
|
2022-06-19 12:17:21 +02:00
|
|
|
|
2022-06-19 13:05:58 +02:00
|
|
|
T update(T x)
|
|
|
|
{
|
|
|
|
T y = x - this->x_n1 + this->R * this->y_n1;
|
2022-06-19 12:17:21 +02:00
|
|
|
this->x_n1 = x;
|
|
|
|
this->y_n1 = y;
|
|
|
|
|
|
|
|
return y;
|
|
|
|
};
|
|
|
|
};
|