mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-12-28 16:59:47 -05:00
Generalize ERT offset tracking a little.
This commit is contained in:
parent
b9643dc988
commit
2d0052fb14
@ -51,9 +51,9 @@ void ERTProcessor::execute(buffer_c8_t buffer) {
|
||||
average_i += src->real();
|
||||
average_q += src->imag();
|
||||
average_count++;
|
||||
if( average_count == 2048 ) {
|
||||
offset_i = static_cast<float>(average_i) / 2048.0f;
|
||||
offset_q = static_cast<float>(average_q) / 2048.0f;
|
||||
if( average_count == average_window ) {
|
||||
offset_i = static_cast<float>(average_i) / average_window;
|
||||
offset_q = static_cast<float>(average_q) / average_window;
|
||||
average_i = 0;
|
||||
average_q = 0;
|
||||
average_count = 0;
|
||||
|
@ -96,6 +96,7 @@ private:
|
||||
float sum_period[3];
|
||||
float manchester[3];
|
||||
|
||||
const size_t average_window { 2048 };
|
||||
int32_t average_i { 0 };
|
||||
int32_t average_q { 0 };
|
||||
size_t average_count { 0 };
|
||||
|
Loading…
Reference in New Issue
Block a user