mirror of
https://github.com/aicodix/modem.git
synced 2026-04-27 14:30:34 +00:00
try to improve papr of first symbol
This commit is contained in:
parent
04beed4a4c
commit
e5801a698e
2 changed files with 5 additions and 4 deletions
|
|
@ -234,7 +234,7 @@ struct Decoder : Common
|
|||
auto clamp = [](int v){ return v < -127 ? -127 : v > 127 ? 127 : v; };
|
||||
for (int i = 0; i < pilot_tones; ++i)
|
||||
meta[i] = clamp(std::nearbyint(127 * demod_or_erase(fdom[bin(i*block_length+first_pilot+tone_off)], chan[i*block_length+first_pilot]).real() * nrz(seq1())));
|
||||
int mode = hadamard_decoder(meta);
|
||||
int mode = hadamard_decoder(meta) & 31;
|
||||
if (mode < 0 || mode > 27) {
|
||||
std::cerr << "operation mode " << mode << " unsupported." << std::endl;
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -73,11 +73,12 @@ struct Encoder : public Common
|
|||
{
|
||||
for (int i = 0; differential && symbol_number > 0 && i < tone_count; ++i)
|
||||
tone[i] *= temp[i];
|
||||
for (int trial = 63; trial >= 0; --trial) {
|
||||
int trials = symbol_number ? 128 : 4;
|
||||
for (int trial = trials - 1; trial >= 0; --trial) {
|
||||
for (int i = 0; i < tone_count; ++i)
|
||||
temp[i] = tone[i];
|
||||
if (symbol_number >= 0) {
|
||||
int meta_data = symbol_number ? trial : oper_mode;
|
||||
int meta_data = symbol_number ? trial : (oper_mode | (trial << 5));
|
||||
hadamard_encoder(meta, meta_data);
|
||||
CODE::MLS seq(0x163, meta_data);
|
||||
for (int i = 0, m = 0; i < tone_count; ++i)
|
||||
|
|
@ -110,7 +111,7 @@ struct Encoder : public Common
|
|||
}
|
||||
mean /= symbol_len;
|
||||
value papr(peak / mean);
|
||||
if (symbol_number == 0 || papr < 5 || trial == 0) {
|
||||
if (papr < 5 || trial == 0) {
|
||||
std::cerr << " " << DSP::decibel(papr);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue