mirror of
https://github.com/aicodix/modem.git
synced 2026-04-27 14:30:34 +00:00
use 16 bit LLRs
This commit is contained in:
parent
25d9f2218b
commit
b71926062d
3 changed files with 16 additions and 9 deletions
6
psk.hh
6
psk.hh
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue