mirror of
https://github.com/aicodix/modem.git
synced 2026-04-27 14:30:34 +00:00
average both synchronization symbols for a better channel estimate
This commit is contained in:
parent
448dbcc011
commit
0ce4068061
1 changed files with 16 additions and 0 deletions
16
decode.cc
16
decode.cc
|
|
@ -163,6 +163,11 @@ struct Decoder : Common
|
|||
std::cerr << "coarse cfo: " << cfo_rad * (rate / Const::TwoPi()) << " Hz " << std::endl;
|
||||
|
||||
osc.omega(-cfo_rad);
|
||||
for (int i = 0; i < symbol_len; ++i)
|
||||
tdom[i] = buf[i+symbol_pos] * osc();
|
||||
fwd(fdom, tdom);
|
||||
for (int i = 0; i < tone_count; ++i)
|
||||
chan[i] = fdom[bin(i+tone_off)];
|
||||
for (int i = 0; i < symbol_len; ++i)
|
||||
tdom[i] = buf[i+symbol_pos+symbol_len] * osc();
|
||||
for (int i = 0; i < guard_len; ++i)
|
||||
|
|
@ -170,6 +175,17 @@ struct Decoder : Common
|
|||
fwd(fdom, tdom);
|
||||
for (int i = 0; i < tone_count; ++i)
|
||||
tone[i] = fdom[bin(i+tone_off)];
|
||||
for (int i = 0; i < tone_count; ++i) {
|
||||
index[i] = tone_off + i;
|
||||
phase[i] = arg(demod_or_erase(tone[i], chan[i]));
|
||||
}
|
||||
tse.compute(index, phase, tone_count);
|
||||
//std::cerr << "Theil-Sen slope = " << tse.slope() << std::endl;
|
||||
//std::cerr << "Theil-Sen yint = " << tse.yint() << std::endl;
|
||||
for (int i = 0; i < tone_count; ++i)
|
||||
chan[i] *= DSP::polar<value>(1, tse(i+tone_off));
|
||||
for (int i = pilot_off; i < tone_count; i += block_length)
|
||||
chan[i] = DSP::lerp(chan[i], tone[i], value(0.5));
|
||||
CODE::MLS seq0(mls0_poly, mls0_seed);
|
||||
for (int i = 0; i < tone_count; ++i)
|
||||
chan[i] = nrz(seq0()) * tone[i];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue