mirror of
https://github.com/aicodix/modem.git
synced 2026-04-27 22:35:41 +00:00
added mls2_poly
This commit is contained in:
parent
1fa1137fc0
commit
5343144b3c
3 changed files with 6 additions and 5 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue