mirror of
https://github.com/aicodix/modem.git
synced 2026-04-27 14:30:34 +00:00
comb distance and offset are constant now
This commit is contained in:
parent
5760675679
commit
0089c8cb30
2 changed files with 10 additions and 14 deletions
|
|
@ -272,6 +272,8 @@ struct Decoder
|
|||
int cons_rows = 0;
|
||||
int comb_cols = 32;
|
||||
int code_cols = 0;
|
||||
int comb_dist = 9;
|
||||
int comb_off = 4;
|
||||
switch (oper_mode) {
|
||||
case 23:
|
||||
mod_bits = 2;
|
||||
|
|
@ -342,8 +344,6 @@ struct Decoder
|
|||
}
|
||||
int data_bytes = data_bits / 8;
|
||||
int cons_cols = code_cols + comb_cols;
|
||||
int comb_dist = comb_cols ? cons_cols / comb_cols : 1;
|
||||
int comb_off = comb_cols ? comb_dist / 2 : 1;
|
||||
int code_off = - cons_cols / 2;
|
||||
|
||||
for (int i = 0; i < symbol_pos+symbol_len+extended_len; ++i)
|
||||
|
|
|
|||
20
encode.cc
20
encode.cc
|
|
@ -266,8 +266,8 @@ struct Encoder
|
|||
const uint32_t *frozen_bits = nullptr;
|
||||
int code_cols = 0;
|
||||
int comb_cols = 32;
|
||||
int comb_dist = 1;
|
||||
int comb_off = 1;
|
||||
int comb_dist = 9;
|
||||
int comb_off = 4;
|
||||
int data_bits = 0;
|
||||
int reserved_tones = 32;
|
||||
switch (oper_mode) {
|
||||
|
|
@ -352,17 +352,13 @@ struct Encoder
|
|||
cons_cols = code_cols + comb_cols;
|
||||
code_off = offset - cons_cols / 2;
|
||||
if (oper_mode > 0) {
|
||||
comb_dist = comb_cols ? cons_cols / comb_cols : 1;
|
||||
comb_off = comb_cols ? comb_dist / 2 : 1;
|
||||
if (reserved_tones) {
|
||||
value kern_fac = 1 / value(10 * reserved_tones);
|
||||
for (int i = 0, j = code_off - reserved_tones / 2; i < reserved_tones; ++i, ++j) {
|
||||
if (j == code_off)
|
||||
j += cons_cols;
|
||||
fdom[bin(j)] = kern_fac;
|
||||
}
|
||||
bwd(kern, fdom);
|
||||
value kern_fac = 1 / value(10 * reserved_tones);
|
||||
for (int i = 0, j = code_off - reserved_tones / 2; i < reserved_tones; ++i, ++j) {
|
||||
if (j == code_off)
|
||||
j += cons_cols;
|
||||
fdom[bin(j)] = kern_fac;
|
||||
}
|
||||
bwd(kern, fdom);
|
||||
}
|
||||
for (int i = 0; i < guard_len / 4; ++i)
|
||||
weight[i] = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue