mirror of
https://github.com/aicodix/modem.git
synced 2026-04-27 22:35:41 +00:00
allow up to 10% of constellation point distance
This commit is contained in:
parent
bce8a6ee56
commit
41472f6f77
1 changed files with 13 additions and 1 deletions
14
encode.cc
14
encode.cc
|
|
@ -86,7 +86,7 @@ struct Encoder
|
|||
temp[i] /= std::sqrt(value(symbol_len/4));
|
||||
cmplx err = temp[i] - fdom[i];
|
||||
value mag = abs(err);
|
||||
value lim = 0.1;
|
||||
value lim = 0.1 * mod_distance();
|
||||
if (limit && mag > lim)
|
||||
temp[i] -= ((mag - lim) / mag) * err;
|
||||
} else {
|
||||
|
|
@ -212,6 +212,18 @@ struct Encoder
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
value mod_distance()
|
||||
{
|
||||
switch (mod_bits) {
|
||||
case 2:
|
||||
return PhaseShiftKeying<4, cmplx, code_type>::DIST;
|
||||
case 4:
|
||||
return QuadratureAmplitudeModulation<16, cmplx, code_type>::DIST;
|
||||
case 6:
|
||||
return QuadratureAmplitudeModulation<64, cmplx, code_type>::DIST;
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
void shuffle(code_type *c)
|
||||
{
|
||||
switch (code_order) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue