mirror of
https://github.com/aicodix/code.git
synced 2026-04-27 14:30:36 +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];
|
||||
|
|
|
|||
|
|
@ -579,7 +579,7 @@ int main()
|
|||
float DIST = 2; // BPSK
|
||||
float fact = DIST * FACTOR / (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];
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ int main()
|
|||
double DIST = 2; // BPSK
|
||||
double fact = DIST / (sigma_noise * sigma_noise);
|
||||
for (int i = 0; i < N; ++i)
|
||||
noisy[i] = std::min<double>(std::max<double>(std::nearbyint(fact * symb[i]), -128), 127);
|
||||
noisy[i] = std::min<double>(std::max<double>(std::nearbyint(fact * symb[i]), -127), 127);
|
||||
|
||||
bool unique = osddec(decoded, noisy, genmat);
|
||||
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ int main()
|
|||
double DIST = 2; // BPSK
|
||||
double fact = DIST / (sigma_noise * sigma_noise);
|
||||
for (int i = 0; i < N; ++i)
|
||||
noisy[i] = std::min<double>(std::max<double>(std::nearbyint(fact * symb[i]), -128), 127);
|
||||
noisy[i] = std::min<double>(std::max<double>(std::nearbyint(fact * symb[i]), -127), 127);
|
||||
|
||||
osddec(rank, decoded, noisy, genmat);
|
||||
bool unique = rank[0] != rank[1];
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
|
|
|
|||
|
|
@ -107,7 +107,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