@@ -226,14 +226,8 @@ TestRange get_test_range(const size_t K, const size_t R) {
226226 const size_t error_correcting_capability = K*R;
227227 size_t base_total_bits = size_t (1e9 );
228228 TestRange range;
229- range.EbNo_dB_initial = -std::ceil (std::pow (float (error_correcting_capability), 0 .8f ));
230- // TODO: Figure out a better way to calculate this that generalises
231- if (K >= 9 ) {
232- range.EbNo_dB_initial = -17 .0f ;
233- base_total_bits = size_t (1e10 );
234- }
235- // Measure the sharp cutoff of code with high error correction ability
236- range.EbNo_dB_step = (error_correcting_capability > 20 ) ? 0 .5f : 1 .0f ;
229+ range.EbNo_dB_initial = 0 .0f ;
230+ range.EbNo_dB_step = 0 .5f ;
237231 range.maximum_generated_bits = base_total_bits / runtime_scale;
238232 return range;
239233}
@@ -323,9 +317,9 @@ TestResults run_test(
323317 std::mt19937 rand_engine{(unsigned int )(args.random_seed )};
324318 for (size_t curr_point = 0 ; ; curr_point++) {
325319 const float EbNo_dB = test_range.EbNo_dB_initial + float (curr_point)*test_range.EbNo_dB_step ;
326- const float snr_dB = EbNo_dB + 10 .0f *std::log10 (float (R));
320+ const float EsNo_dB = EbNo_dB - 10 .0f *std::log10 (float (R));
327321 // E(X^2) = Var(X) + [E(X)]^2 = Var(X), since E(X) = 0
328- const float noise_variance = std::pow (10 .0f , -snr_dB /10 .0f );
322+ const float noise_variance = std::pow (10 .0f , -(EsNo_dB+ 3 . 0f ) /10 .0f ); // 3dB for real signal
329323 const float noisy_signal_energy = 1 .0f + noise_variance;
330324 const float noisy_signal_norm = 1 .0f /std::sqrt (noisy_signal_energy);
331325 std::normal_distribution<float > rand_norm_dist (0 .0f , std::sqrt (noise_variance)); // takes sigma not sigma^2
0 commit comments