removed redundant buffers

This commit is contained in:
Ahmet Inan 2023-12-13 20:35:28 +01:00
commit 9c75c4f3e2

View file

@ -47,7 +47,7 @@ struct SchmidlCox
DSP::Delay<value, match_del> delay;
DSP::SchmittTrigger<value> threshold;
DSP::FallingEdgeTrigger falling;
cmplx tmp0[symbol_len], tmp1[symbol_len], tmp2[symbol_len];
cmplx tmp0[symbol_len], tmp1[symbol_len];
cmplx kern[symbol_len];
cmplx cmplx_shift = 0;
value timing_max = 0;
@ -125,13 +125,13 @@ public:
fwd(tmp0, tmp1);
for (int i = 0; i < symbol_len; ++i)
tmp0[i] *= kern[i];
bwd(tmp2, tmp0);
bwd(tmp1, tmp0);
int shift = 0;
value peak = 0;
value next = 0;
for (int i = 0; i < symbol_len; ++i) {
value power = norm(tmp2[i]);
value power = norm(tmp1[i]);
if (power > peak) {
next = peak;
peak = power;
@ -143,7 +143,7 @@ public:
if (peak <= next * 4)
return false;
int pos_err = std::nearbyint(arg(tmp2[shift]) * symbol_len / Const::TwoPi());
int pos_err = std::nearbyint(arg(tmp1[shift]) * symbol_len / Const::TwoPi());
if (abs(pos_err) > guard_len / 2)
return false;
symbol_pos -= pos_err;