mirror of
https://github.com/aicodix/modem.git
synced 2026-04-27 14:30:34 +00:00
keep limits symmetric so it doesn't interfere with scrambling
This commit is contained in:
parent
12c11b84c9
commit
30e34dfef5
1 changed files with 3 additions and 3 deletions
6
psk.hh
6
psk.hh
|
|
@ -26,7 +26,7 @@ struct PhaseShiftKeying<2, TYPE, CODE>
|
|||
if (std::is_integral<code_type>::value)
|
||||
value = std::nearbyint(value);
|
||||
if (std::is_same<code_type, int8_t>::value)
|
||||
value = std::min<value_type>(std::max<value_type>(value, -128), 127);
|
||||
value = std::min<value_type>(std::max<value_type>(value, -127), 127);
|
||||
return value;
|
||||
}
|
||||
|
||||
|
|
@ -65,7 +65,7 @@ struct PhaseShiftKeying<4, TYPE, CODE>
|
|||
if (std::is_integral<code_type>::value)
|
||||
value = std::nearbyint(value);
|
||||
if (std::is_same<code_type, int8_t>::value)
|
||||
value = std::min<value_type>(std::max<value_type>(value, -128), 127);
|
||||
value = std::min<value_type>(std::max<value_type>(value, -127), 127);
|
||||
return value;
|
||||
}
|
||||
|
||||
|
|
@ -111,7 +111,7 @@ struct PhaseShiftKeying<8, TYPE, CODE>
|
|||
if (std::is_integral<code_type>::value)
|
||||
value = std::nearbyint(value);
|
||||
if (std::is_same<code_type, int8_t>::value)
|
||||
value = std::min<value_type>(std::max<value_type>(value, -128), 127);
|
||||
value = std::min<value_type>(std::max<value_type>(value, -127), 127);
|
||||
return value;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue