mirror of
https://github.com/aicodix/code.git
synced 2026-04-27 22:35:44 +00:00
removed SCALE constant
This commit is contained in:
parent
b6452a100f
commit
332eb9caf7
2 changed files with 2 additions and 6 deletions
|
|
@ -39,11 +39,9 @@ int main()
|
|||
#if 1
|
||||
const int L = 32;
|
||||
typedef int8_t code_type;
|
||||
double SCALE = 2;
|
||||
#else
|
||||
const int L = 8;
|
||||
typedef float code_type;
|
||||
double SCALE = 1;
|
||||
#endif
|
||||
|
||||
typedef SIMD<code_type, L> simd_type;
|
||||
|
|
@ -159,7 +157,7 @@ int main()
|
|||
// $LLR=log(\frac{p(x=+1|y)}{p(x=-1|y)})$
|
||||
// $p(x|\mu,\sigma)=\frac{1}{\sqrt{2\pi}\sigma}}e^{-\frac{(x-\mu)^2}{2\sigma^2}}$
|
||||
double DIST = 2; // BPSK
|
||||
double fact = SCALE * DIST / (sigma_noise * sigma_noise);
|
||||
double fact = DIST / (sigma_noise * sigma_noise);
|
||||
for (int i = 0; i < N; ++i)
|
||||
codeword[i] = CODE::PolarHelper<code_type>::quant(fact * symb[i]);
|
||||
|
||||
|
|
|
|||
|
|
@ -30,10 +30,8 @@ int main()
|
|||
const bool systematic = true;
|
||||
#if 1
|
||||
typedef int8_t code_type;
|
||||
double SCALE = 2;
|
||||
#else
|
||||
typedef float code_type;
|
||||
double SCALE = 1;
|
||||
#endif
|
||||
|
||||
std::random_device rd;
|
||||
|
|
@ -124,7 +122,7 @@ int main()
|
|||
// $LLR=log(\frac{p(x=+1|y)}{p(x=-1|y)})$
|
||||
// $p(x|\mu,\sigma)=\frac{1}{\sqrt{2\pi}\sigma}}e^{-\frac{(x-\mu)^2}{2\sigma^2}}$
|
||||
double DIST = 2; // BPSK
|
||||
double fact = SCALE * DIST / (sigma_noise * sigma_noise);
|
||||
double fact = DIST / (sigma_noise * sigma_noise);
|
||||
for (int i = 0; i < N; ++i)
|
||||
codeword[i] = CODE::PolarHelper<code_type>::quant(fact * symb[i]);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue