|
3-phase PV router
|
Classes | |
| struct | Coefficients |
| The coefficients of the filter, in fixed point: the multiples the filter needs, ready. More... | |
| struct | LowPassBoost |
| The state of the filter of one CT (one per phase), and the filter itself. More... | |
Functions | |
| constexpr Coefficients | coefficientsOf (const float gain, const float alpha) |
| Converts the float settings to fixed point, at compile time. | |
| constexpr bool | isAccurate (const float gain, const float alpha) |
| Whether the settings fit the fixed point, the coefficients within 1 % of them. | |
Variables | |
| constexpr int16_t | ALPHA_FIXED_LIMIT { 4096 } |
| alpha x 2^(16 + shift) stays below this: 4 x alpha fits an int16, and 4 x alpha x the largest difference (2^16 at x64) an int32 with 2 bits to spare. | |
| constexpr uint8_t | LPF_FRACTION_BITS { 2 } |
| The fractional bits of the low-pass state below the x64 scale of the samples: x256. | |
| constexpr uint8_t | MAX_ALPHA_SHIFT { 4 } |
| The largest extra shift of alpha: more resolution for a small alpha, one more turn each. | |
|
constexpr |
Converts the float settings to fixed point, at compile time.
| gain | The gain of the low-pass added back (lpf_gain), 0 to below 64. |
| alpha | The coefficient of the low-pass, above 0 to below 0.0625. |
Definition at line 72 of file ct_filter.h.

|
constexpr |
Whether the settings fit the fixed point, the coefficients within 1 % of them.
alpha below 0.0625 and the gain below 64, so that nothing overflows; alpha above about 0.00005, below which its 20 fractional bits are too coarse for its time constant.
Definition at line 95 of file ct_filter.h.


|
inlineconstexpr |
alpha x 2^(16 + shift) stays below this: 4 x alpha fits an int16, and 4 x alpha x the largest difference (2^16 at x64) an int32 with 2 bits to spare.
Definition at line 51 of file ct_filter.h.
|
inlineconstexpr |
The fractional bits of the low-pass state below the x64 scale of the samples: x256.
Definition at line 42 of file ct_filter.h.
|
inlineconstexpr |
The largest extra shift of alpha: more resolution for a small alpha, one more turn each.
Definition at line 45 of file ct_filter.h.