mirror of
https://github.com/aicodix/code.git
synced 2026-04-27 22:35:44 +00:00
keep ranges symmetric
This commit is contained in:
parent
b146d9739a
commit
7e589c85ef
7 changed files with 10 additions and 10 deletions
|
|
@ -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];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue