mirror of
https://github.com/aicodix/modem.git
synced 2026-04-27 14:30:34 +00:00
use a better seed for combinations
This commit is contained in:
parent
cec02bb851
commit
b8dd4de3d8
2 changed files with 2 additions and 6 deletions
|
|
@ -324,15 +324,13 @@ struct Decoder : Common
|
|||
demod[i] *= DSP::polar<value>(1, -tse(i+tone_off));
|
||||
for (int i = 0; i < tone_count; ++i)
|
||||
chan[i] *= DSP::polar<value>(1, tse(i+tone_off));
|
||||
CODE::XorShiftMask<int, 14, 1, 5, 10, 1> combination;
|
||||
CODE::XorShiftMask<int, 14, 1, 5, 10, 50> combination;
|
||||
int trial = side_data;
|
||||
int comb = 0;
|
||||
for (int i = 0; i <= trial; ++i)
|
||||
comb = combination();
|
||||
int poly_index = comb & 15;
|
||||
int seed_value = comb >> 4;
|
||||
if (seed_value == 0)
|
||||
std::cerr << "reserved seed value detected" << std::endl;
|
||||
CODE::MLS seq(slm_poly[poly_index], seed_value);
|
||||
for (int i = 0; i < tone_count; ++i)
|
||||
if (i % block_length != side_off)
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ struct Encoder : public Common
|
|||
{
|
||||
value scale = value(0.5) / std::sqrt(value(tone_count));
|
||||
value best_papr = 1000;
|
||||
CODE::XorShiftMask<int, 14, 1, 5, 10, 1> combination;
|
||||
CODE::XorShiftMask<int, 14, 1, 5, 10, 50> combination;
|
||||
for (int trial = 0; trial < 128; ++trial) {
|
||||
for (int i = 0; i < tone_count; ++i)
|
||||
temp[i] = tone[i];
|
||||
|
|
@ -88,8 +88,6 @@ struct Encoder : public Common
|
|||
int comb = combination();
|
||||
int poly_index = comb & 15;
|
||||
int seed_value = comb >> 4;
|
||||
if (seed_value == 0)
|
||||
continue;
|
||||
CODE::MLS seq(slm_poly[poly_index], seed_value);
|
||||
for (int i = 0, s = 0; i < tone_count; ++i)
|
||||
if (i % block_length == side_off)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue