summaryrefslogtreecommitdiff
path: root/cesar/ce/rx/bitloading/src
diff options
context:
space:
mode:
authordufour2010-02-04 09:08:29 +0000
committerdufour2010-02-04 09:08:29 +0000
commit1c6368a9fc2835136bd7371f47caf452514c0433 (patch)
treeb59fe5de8e013319759ff606691a56421095497b /cesar/ce/rx/bitloading/src
parentb4935c2d88932d7a04d2cfa22e7ea48605303e82 (diff)
cesar/ce/rx/bl: add a margin to apply to the BER target
Even if the TNS team does not said it should be FEC rate dependant, I think it will in the future. Also, there is no advanced test on the impact of this margin on the bit loading algorithm (no test vector delivered yet). git-svn-id: svn+ssh://pessac/svn/cesar/trunk@6685 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar/ce/rx/bitloading/src')
-rw-r--r--cesar/ce/rx/bitloading/src/ber.c20
-rw-r--r--cesar/ce/rx/bitloading/src/bitloading.c10
2 files changed, 30 insertions, 0 deletions
diff --git a/cesar/ce/rx/bitloading/src/ber.c b/cesar/ce/rx/bitloading/src/ber.c
index c29e8e51e1..402774c1e2 100644
--- a/cesar/ce/rx/bitloading/src/ber.c
+++ b/cesar/ce/rx/bitloading/src/ber.c
@@ -18,6 +18,14 @@
#include "ce/rx/bitloading/inc/ber.h"
#include "ce/rx/bitloading/inc/poly.h"
+/**
+ * Default value of margin to apply to BER target.
+ * This value is apparently quantified on 53 bits.
+ *
+ * We want a value of 1.5% by default: 0.015 * 2^53.
+ */
+u64 ce_rx_bl_ber_margin_[] = { 135107988821115ull, 135107988821115ull };
+
/* Imported from
* http://stestephe/svn/spidcom_digital_svn/projects/DSP_350/DSP_chain/SW/Bit_Loading/BER_vs_NSR/Polynomes_BERinq_vs_NSRq_normalises.m
* Revision: 11128.
@@ -229,3 +237,15 @@ ce_rx_bl_ber_pt_bpt (phy_fecrate_t fec_rate, u64 bpt)
return ce_rx_bl_poly (ce_rx_bl_ber_consign_degrees[fec_rate],
ce_rx_bl_ber_consign_coefs[fec_rate], bpt);
}
+
+void
+ce_rx_bl_ber_margin_set (u64 margin_q[PHY_FEC_RATE_NB])
+{
+ /* Check parameter. */
+ dbg_assert (margin_q);
+
+ /* Store margin values. */
+ phy_fecrate_t i;
+ for (i = PHY_FEC_RATE_1_2; i < PHY_FEC_RATE_NB; i++)
+ ce_rx_bl_ber_margin_[i] = margin_q[i];
+}
diff --git a/cesar/ce/rx/bitloading/src/bitloading.c b/cesar/ce/rx/bitloading/src/bitloading.c
index 96ff2a2362..f47c63c3a2 100644
--- a/cesar/ce/rx/bitloading/src/bitloading.c
+++ b/cesar/ce/rx/bitloading/src/bitloading.c
@@ -227,6 +227,11 @@ ce_rx_bl_compute_tone_map_iterative (const u64 bpt_initial[PHY_FEC_RATE_NB],
tm[fec_rate] = tonemap_alloc ();
/* Get initial BER consign from initial bits per tone. */
ber_cur = ce_rx_bl_ber_pt_bpt (fec_rate, bpt_initial[fec_rate]);
+ /* Apply BER target margin. */
+ if (ber_cur > ce_rx_bl_ber_margin_[fec_rate])
+ ber_cur = ber_cur - ce_rx_bl_ber_margin_[fec_rate];
+ else
+ ber_cur = 0;
do
{
/* Optimize tone map to reach BER consign. */
@@ -238,6 +243,11 @@ ce_rx_bl_compute_tone_map_iterative (const u64 bpt_initial[PHY_FEC_RATE_NB],
ber_cur = ce_rx_bl_ber_pt_bpt
(fec_rate, (tm[fec_rate]->bits_per_symbol *
CE_RX_BL_BPT_QUANT_FACTOR) / tone_en);
+ /* Apply BER target margin. */
+ if (ber_cur > ce_rx_bl_ber_margin_[fec_rate])
+ ber_cur = ber_cur - ce_rx_bl_ber_margin_[fec_rate];
+ else
+ ber_cur = 0;
}
/* Repeat until no modification of the BER consign or until maximum
* number of iterations is reached. */