diff --git a/common.hh b/common.hh index 18b0dd2..df7f099 100644 --- a/common.hh +++ b/common.hh @@ -19,6 +19,7 @@ struct Common static const int mls0_poly = 0x331; static const int mls0_seed = 214; static const int mls1_poly = 0x43; + static const int mls2_poly = 0x163; static const int data_tones = 256; static const int pilot_tones = 64; static const int tone_count = data_tones + pilot_tones; diff --git a/decode.cc b/decode.cc index 1636f6e..bcbbc10 100644 --- a/decode.cc +++ b/decode.cc @@ -298,10 +298,10 @@ struct Decoder : Common for (int i = pilot_off; i < tone_count; i += block_length) chan[i] = DSP::lerp(chan[i], tone[i], value(0.5)); } - CODE::MLS seq(0x163, meta_data); + CODE::MLS seq2(mls2_poly, meta_data); for (int i = 0; i < tone_count; ++i) if (i % block_length != pilot_off) - demod[i] *= nrz(seq()); + demod[i] *= nrz(seq2()); value sp = 0, np = 0; for (int i = 0, l = k; i < tone_count; ++i) { cmplx hard(1, 0); diff --git a/encode.cc b/encode.cc index 5b3f3dd..3098d95 100644 --- a/encode.cc +++ b/encode.cc @@ -86,12 +86,12 @@ struct Encoder : public Common if (symbol_number >= 0) { int meta_data = symbol_number ? trial : (oper_mode | (trial << 5)); hadamard_encoder(meta, meta_data); - CODE::MLS seq(0x163, meta_data); + CODE::MLS seq2(mls2_poly, meta_data); for (int i = 0, m = 0; i < tone_count; ++i) if (i % block_length == pilot_off) temp[i] *= meta[m++]; else - temp[i] *= nrz(seq()); + temp[i] *= nrz(seq2()); } for (int i = 0; i < symbol_len; ++i) fdom[i] = 0; @@ -143,7 +143,7 @@ struct Encoder : public Common } void leading_noise(int num = 1) { - CODE::MLS noise(0x163); + CODE::MLS noise(mls2_poly); for (int j = 0; j < num; ++j) { for (int i = 0; i < tone_count; ++i) tone[i] = nrz(noise());