mirror of
https://github.com/aicodix/modem.git
synced 2026-04-27 22:35:41 +00:00
improve CFO estimation using hard decision
This commit is contained in:
parent
357a90805c
commit
6f99db1444
1 changed files with 14 additions and 0 deletions
14
decode.cc
14
decode.cc
|
|
@ -416,6 +416,20 @@ struct Decoder
|
|||
for (int i = 0; i < code_cols; ++i)
|
||||
cons[code_cols*j+i] = fdom[bin(i+code_off)] / head[bin(i+code_off)];
|
||||
}
|
||||
if (1) {
|
||||
value sum = 0;
|
||||
for (int i = 0; i < cons_cnt; ++i) {
|
||||
int8_t tmp[mod_max];
|
||||
mod_hard(tmp, cons[i]);
|
||||
sum += arg(cons[i] * conj(mod_map(tmp)));
|
||||
}
|
||||
value avg = sum / cons_cnt;
|
||||
cfo_rad += avg / (symbol_len+guard_len);
|
||||
std::cerr << "finer cfo: " << cfo_rad * (rate / Const::TwoPi()) << " Hz " << std::endl;
|
||||
cmplx comp = DSP::polar<value>(1, -avg);
|
||||
for (int i = 0; i < cons_cnt; ++i)
|
||||
cons[i] *= comp;
|
||||
}
|
||||
value precision = 16;
|
||||
if (1) {
|
||||
value sp = 0, np = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue