|
3-phase PV router
|
The state of the filter of one CT (one per phase), and the filter itself. More...
#include <ct_filter.h>
Public Member Functions | |
| int16_t | apply (const int16_t sampleMinusDC, const Coefficients &coefficients) |
| Filters one sample. | |
| int32_t | lowPass () const |
| The low-pass state, x256 scale (Robin's lpf_long). | |
Public Attributes | |
| uint8_t | lpfLowBits {} |
| int16_t | lpfX64 {} |
The state of the filter of one CT (one per phase), and the filter itself.
The state is Robin's lpf_long (x256), kept as its x64 part and its 2 low bits: lpf_long = 4 x lpfX64 + lpfLowBits. Every multiply is then 16 x 16, and no shift of the state needs a loop.
Definition at line 116 of file ct_filter.h.
|
inline |
Filters one sample.
As Robin's, at x256: lpf += alpha x (sample - lpf), truncated towards zero; then sample + gain x lpf, back to x64.
| sampleMinusDC | The DC-removed current sample, x64 scale (left-aligned ADC). |
| coefficients | The coefficients, from coefficientsOf(); a gain of 0 returns the sample. |
Definition at line 137 of file ct_filter.h.


|
inline |
The low-pass state, x256 scale (Robin's lpf_long).
Definition at line 122 of file ct_filter.h.

| uint8_t CtFilter::LowPassBoost::lpfLowBits {} |
its 2 bits below, 0..3 (lpf_long & 3)
Definition at line 119 of file ct_filter.h.
| int16_t CtFilter::LowPassBoost::lpfX64 {} |
low-pass of the current, x64 scale (lpf_long >> 2)
Definition at line 118 of file ct_filter.h.