use 16 bit LLRs

This commit is contained in:
Ahmet Inan 2025-07-01 22:53:14 +02:00
commit b71926062d
3 changed files with 16 additions and 9 deletions

6
psk.hh
View file

@ -27,6 +27,8 @@ struct PhaseShiftKeying<2, TYPE, CODE>
value = std::nearbyint(value);
if (std::is_same<code_type, int8_t>::value)
value = std::min<value_type>(std::max<value_type>(value, -127), 127);
if (std::is_same<code_type, int16_t>::value)
value = std::min<value_type>(std::max<value_type>(value, -32767), 32767);
return value;
}
@ -66,6 +68,8 @@ struct PhaseShiftKeying<4, TYPE, CODE>
value = std::nearbyint(value);
if (std::is_same<code_type, int8_t>::value)
value = std::min<value_type>(std::max<value_type>(value, -127), 127);
if (std::is_same<code_type, int16_t>::value)
value = std::min<value_type>(std::max<value_type>(value, -32767), 32767);
return value;
}
@ -112,6 +116,8 @@ struct PhaseShiftKeying<8, TYPE, CODE>
value = std::nearbyint(value);
if (std::is_same<code_type, int8_t>::value)
value = std::min<value_type>(std::max<value_type>(value, -127), 127);
if (std::is_same<code_type, int16_t>::value)
value = std::min<value_type>(std::max<value_type>(value, -32767), 32767);
return value;
}