keep ranges symmetric

This commit is contained in:
Ahmet Inan 2024-02-10 19:46:25 +01:00
commit 7e589c85ef
7 changed files with 10 additions and 10 deletions

View file

@ -98,7 +98,7 @@ int main()
float DIST = 2; // BPSK
float fact = DIST / (sigma_noise * sigma_noise);
for (int i = 0; i < CODE_LEN; ++i)
code[i] = std::min<float>(std::max<float>(std::nearbyint(fact * symb[i]), -128), 127);
code[i] = std::min<float>(std::max<float>(std::nearbyint(fact * symb[i]), -127), 127);
for (int i = 0; i < CODE_LEN; ++i)
noisy[i] = code[i];