mirror of
https://github.com/aicodix/modem.git
synced 2026-04-27 14:30:34 +00:00
scramble preamble
This commit is contained in:
parent
0e6b41a9c5
commit
03da985dd0
2 changed files with 8 additions and 0 deletions
|
|
@ -170,6 +170,7 @@ struct Decoder
|
|||
static const int code_order = 12;
|
||||
static const int mod_bits = 2;
|
||||
static const int code_len = 1 << code_order;
|
||||
static const int meta_len = 128;
|
||||
static const int symbol_len = 256;
|
||||
static const int filter_len = 33;
|
||||
static const int guard_len = symbol_len / 8;
|
||||
|
|
@ -291,6 +292,9 @@ struct Decoder
|
|||
prev[i] = fdom[first_subcarrier+i];
|
||||
for (int i = 0; i < subcarrier_count; ++i)
|
||||
mod_soft(code+mod_bits*i, cons[i], 8);
|
||||
CODE::MLS seq(0b10000011);
|
||||
for (int i = 0; i < meta_len; ++i)
|
||||
code[i] *= nrz(seq());
|
||||
int oper_mode = hadamard(code);
|
||||
if (oper_mode != 1) {
|
||||
std::cerr << "operation mode " << oper_mode << " unsupported." << std::endl;
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ struct Encoder
|
|||
static const int mod_bits = 2;
|
||||
static const int code_order = 12;
|
||||
static const int code_len = 1 << code_order;
|
||||
static const int meta_len = 128;
|
||||
static const int symbol_len = 256;
|
||||
static const int guard_len = symbol_len / 8;
|
||||
static const int data_bits = 2048;
|
||||
|
|
@ -93,6 +94,9 @@ struct Encoder
|
|||
void meta_data(int data)
|
||||
{
|
||||
hadamard(code, data);
|
||||
CODE::MLS seq(0b10000011);
|
||||
for (int i = 0; i < meta_len; ++i)
|
||||
code[i] *= nrz(seq());
|
||||
for (int i = 0; i < subcarrier_count; ++i)
|
||||
fdom[first_subcarrier+i] *= mod_map(code+mod_bits*i);
|
||||
symbol();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue