mirror of
https://github.com/aicodix/code.git
synced 2026-04-27 22:35:44 +00:00
print ambiguity errors
This commit is contained in:
parent
332eb9caf7
commit
7d71b00d59
3 changed files with 9 additions and 12 deletions
|
|
@ -76,7 +76,7 @@ int main()
|
||||||
int awgn_errors = 0;
|
int awgn_errors = 0;
|
||||||
int quantization_erasures = 0;
|
int quantization_erasures = 0;
|
||||||
int uncorrected_errors = 0;
|
int uncorrected_errors = 0;
|
||||||
int decoder_errors = 0;
|
int ambiguity_errors = 0;
|
||||||
for (int loop = 0; loop < LOOPS; ++loop) {
|
for (int loop = 0; loop < LOOPS; ++loop) {
|
||||||
int8_t code[CODE_LEN], orig[CODE_LEN], noisy[CODE_LEN];
|
int8_t code[CODE_LEN], orig[CODE_LEN], noisy[CODE_LEN];
|
||||||
float symb[CODE_LEN];
|
float symb[CODE_LEN];
|
||||||
|
|
@ -110,8 +110,7 @@ int main()
|
||||||
for (int i = 0; i < CODE_LEN; ++i)
|
for (int i = 0; i < CODE_LEN; ++i)
|
||||||
quantization_erasures += !noisy[i];
|
quantization_erasures += !noisy[i];
|
||||||
uncorrected_errors += dec < 0 ? DATA_LEN : popcnt(dat^dec);
|
uncorrected_errors += dec < 0 ? DATA_LEN : popcnt(dat^dec);
|
||||||
for (int i = 0; dec >= 0 && i < DATA_LEN; ++i)
|
ambiguity_errors += dec < 0;
|
||||||
decoder_errors += ((dec^dat)&(1<<i)) && orig[i] * noisy[i] > 0;
|
|
||||||
}
|
}
|
||||||
float bit_error_rate = (float)uncorrected_errors / (float)(DATA_LEN * LOOPS);
|
float bit_error_rate = (float)uncorrected_errors / (float)(DATA_LEN * LOOPS);
|
||||||
if (bit_error_rate < 0.0001)
|
if (bit_error_rate < 0.0001)
|
||||||
|
|
@ -121,7 +120,7 @@ int main()
|
||||||
std::cerr << SNR << " Es/N0 => AWGN with standard deviation of " << sigma_noise << " and mean " << mean_noise << std::endl;
|
std::cerr << SNR << " Es/N0 => AWGN with standard deviation of " << sigma_noise << " and mean " << mean_noise << std::endl;
|
||||||
std::cerr << awgn_errors << " errors caused by AWGN." << std::endl;
|
std::cerr << awgn_errors << " errors caused by AWGN." << std::endl;
|
||||||
std::cerr << quantization_erasures << " erasures caused by quantization." << std::endl;
|
std::cerr << quantization_erasures << " erasures caused by quantization." << std::endl;
|
||||||
std::cerr << decoder_errors << " errors caused by decoder." << std::endl;
|
std::cerr << ambiguity_errors << " ambiguity errors." << std::endl;
|
||||||
std::cerr << uncorrected_errors << " errors uncorrected." << std::endl;
|
std::cerr << uncorrected_errors << " errors uncorrected." << std::endl;
|
||||||
std::cerr << bit_error_rate << " bit error rate." << std::endl;
|
std::cerr << bit_error_rate << " bit error rate." << std::endl;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ int main()
|
||||||
int awgn_errors = 0;
|
int awgn_errors = 0;
|
||||||
int quantization_erasures = 0;
|
int quantization_erasures = 0;
|
||||||
int uncorrected_errors = 0;
|
int uncorrected_errors = 0;
|
||||||
int decoder_errors = 0;
|
int ambiguity_errors = 0;
|
||||||
for (int loop = 0; loop < LOOPS; ++loop) {
|
for (int loop = 0; loop < LOOPS; ++loop) {
|
||||||
int8_t code[CODE_LEN], orig[CODE_LEN], noisy[CODE_LEN];
|
int8_t code[CODE_LEN], orig[CODE_LEN], noisy[CODE_LEN];
|
||||||
float symb[CODE_LEN];
|
float symb[CODE_LEN];
|
||||||
|
|
@ -110,8 +110,7 @@ int main()
|
||||||
for (int i = 0; i < CODE_LEN; ++i)
|
for (int i = 0; i < CODE_LEN; ++i)
|
||||||
quantization_erasures += !noisy[i];
|
quantization_erasures += !noisy[i];
|
||||||
uncorrected_errors += dec < 0 ? DATA_LEN : popcnt(dat^dec);
|
uncorrected_errors += dec < 0 ? DATA_LEN : popcnt(dat^dec);
|
||||||
for (int i = 0; dec >= 0 && i < DATA_LEN; ++i)
|
ambiguity_errors += dec < 0;
|
||||||
decoder_errors += ((dec^dat)&(1<<i)) && orig[i] * noisy[i] > 0;
|
|
||||||
}
|
}
|
||||||
float bit_error_rate = (float)uncorrected_errors / (float)(DATA_LEN * LOOPS);
|
float bit_error_rate = (float)uncorrected_errors / (float)(DATA_LEN * LOOPS);
|
||||||
if (bit_error_rate < 0.0001)
|
if (bit_error_rate < 0.0001)
|
||||||
|
|
@ -121,7 +120,7 @@ int main()
|
||||||
std::cerr << SNR << " Es/N0 => AWGN with standard deviation of " << sigma_noise << " and mean " << mean_noise << std::endl;
|
std::cerr << SNR << " Es/N0 => AWGN with standard deviation of " << sigma_noise << " and mean " << mean_noise << std::endl;
|
||||||
std::cerr << awgn_errors << " errors caused by AWGN." << std::endl;
|
std::cerr << awgn_errors << " errors caused by AWGN." << std::endl;
|
||||||
std::cerr << quantization_erasures << " erasures caused by quantization." << std::endl;
|
std::cerr << quantization_erasures << " erasures caused by quantization." << std::endl;
|
||||||
std::cerr << decoder_errors << " errors caused by decoder." << std::endl;
|
std::cerr << ambiguity_errors << " ambiguity errors." << std::endl;
|
||||||
std::cerr << uncorrected_errors << " errors uncorrected." << std::endl;
|
std::cerr << uncorrected_errors << " errors uncorrected." << std::endl;
|
||||||
std::cerr << bit_error_rate << " bit error rate." << std::endl;
|
std::cerr << bit_error_rate << " bit error rate." << std::endl;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ int main()
|
||||||
int awgn_errors = 0;
|
int awgn_errors = 0;
|
||||||
int quantization_erasures = 0;
|
int quantization_erasures = 0;
|
||||||
int uncorrected_errors = 0;
|
int uncorrected_errors = 0;
|
||||||
int decoder_errors = 0;
|
int ambiguity_errors = 0;
|
||||||
for (int loop = 0; loop < LOOPS; ++loop) {
|
for (int loop = 0; loop < LOOPS; ++loop) {
|
||||||
int8_t code[CODE_LEN], orig[CODE_LEN], noisy[CODE_LEN];
|
int8_t code[CODE_LEN], orig[CODE_LEN], noisy[CODE_LEN];
|
||||||
float symb[CODE_LEN];
|
float symb[CODE_LEN];
|
||||||
|
|
@ -119,8 +119,7 @@ int main()
|
||||||
for (int i = 0; i < CODE_LEN; ++i)
|
for (int i = 0; i < CODE_LEN; ++i)
|
||||||
quantization_erasures += !noisy[i];
|
quantization_erasures += !noisy[i];
|
||||||
uncorrected_errors += dec < 0 ? CODE_LEN : popcnt(enc^dec);
|
uncorrected_errors += dec < 0 ? CODE_LEN : popcnt(enc^dec);
|
||||||
for (int i = 0; dec >= 0 && i < CODE_LEN; ++i)
|
ambiguity_errors += dec < 0;
|
||||||
decoder_errors += ((enc^dec)&(1<<i)) && orig[i] * noisy[i] > 0;
|
|
||||||
}
|
}
|
||||||
float bit_error_rate = (float)uncorrected_errors / (float)(CODE_LEN * LOOPS);
|
float bit_error_rate = (float)uncorrected_errors / (float)(CODE_LEN * LOOPS);
|
||||||
if (bit_error_rate < 0.0001)
|
if (bit_error_rate < 0.0001)
|
||||||
|
|
@ -130,7 +129,7 @@ int main()
|
||||||
std::cerr << SNR << " Es/N0 => AWGN with standard deviation of " << sigma_noise << " and mean " << mean_noise << std::endl;
|
std::cerr << SNR << " Es/N0 => AWGN with standard deviation of " << sigma_noise << " and mean " << mean_noise << std::endl;
|
||||||
std::cerr << awgn_errors << " errors caused by AWGN." << std::endl;
|
std::cerr << awgn_errors << " errors caused by AWGN." << std::endl;
|
||||||
std::cerr << quantization_erasures << " erasures caused by quantization." << std::endl;
|
std::cerr << quantization_erasures << " erasures caused by quantization." << std::endl;
|
||||||
std::cerr << decoder_errors << " errors caused by decoder." << std::endl;
|
std::cerr << ambiguity_errors << " ambiguity errors." << std::endl;
|
||||||
std::cerr << uncorrected_errors << " errors uncorrected." << std::endl;
|
std::cerr << uncorrected_errors << " errors uncorrected." << std::endl;
|
||||||
std::cerr << bit_error_rate << " bit error rate." << std::endl;
|
std::cerr << bit_error_rate << " bit error rate." << std::endl;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue