summaryrefslogtreecommitdiff
path: root/cesar/ce/rx/bitloading/src/bitloading.c
diff options
context:
space:
mode:
authordufour2009-07-21 13:06:45 +0000
committerdufour2009-07-21 13:06:45 +0000
commitcf2928f494e34c0d17a8cd6277a8927e695d358f (patch)
treeab52b1d62ac60db8dc98cdeca4f0aadacad9cd14 /cesar/ce/rx/bitloading/src/bitloading.c
parent727d165863d601043f48b0ed985b5006e17200fc (diff)
* ce/rx/bitloading:
- move, rename and fix the function to compute the mean of NSR. git-svn-id: svn+ssh://pessac/svn/cesar/trunk@5046 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar/ce/rx/bitloading/src/bitloading.c')
-rw-r--r--cesar/ce/rx/bitloading/src/bitloading.c60
1 files changed, 0 insertions, 60 deletions
diff --git a/cesar/ce/rx/bitloading/src/bitloading.c b/cesar/ce/rx/bitloading/src/bitloading.c
deleted file mode 100644
index a33327b20a..0000000000
--- a/cesar/ce/rx/bitloading/src/bitloading.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/* Cesar project {{{
- *
- * Copyright (C) 2009 Spidcom
- *
- * <<<Licence>>>
- *
- * }}} */
-/**
- * \file ce/rx/bitloading/src/bitloading.c
- * \brief Bit loading computing for the CE RX (private implementation part).
- * \ingroup ce_rx
- */
-#include "common/std.h"
-
-#include "lib/slab.h"
-#include "ce/rx/bitloading/inc/bitloading.h"
-#include "ce/rx/bitloading/inc/nsr.h"
-
-void
-ce_rx_bitloading_generate_initial (ce_rx_t *ce_rx, sta_t *sta)
-{
- /* Check parameters. */
- dbg_assert (ce_rx);
- dbg_assert (sta);
-
- /* Compute the mean. */
- /* To prevent too many divisions that can be long for the processor, we
- * replace them by a multiplication and a shift.
- * div = a / b <=> div = a * k / 2^m.
- * k = (1 << m) / mean_count; m = 29. */
- const u8 m = 29;
- const uint k = (1 << m) / sta->ce_rx_bt.mean_count;
-
- /* Go through the sum. */
- uint i;
- uint blk_count = 0;
- bool finished = false;
- blk_t *cur_blk = &sta->ce_rx_bt.noise_nrj;
- u32 *mean_noise_nrj;
- /* Go through each block of block of sum of noise NRJ. */
- while (!finished)
- {
- /* Get mean noise NRJ (the sum in fact). */
- mean_noise_nrj = (u32 *) cur_blk->data;
- /* Go through each entry of the current block. */
- for (i = 0; i < BLK_SIZE / CE_RX_BITLOADING_NOISE_NRJ_SIZE; i++)
- {
- /* Compute the initial mean. */
- mean_noise_nrj[i] = mean_noise_nrj[i] * (u64) k / (1 << m);
- }
- /* Next mean noise NRJ if we are not at the end. */
- if (++blk_count == sta->ce_rx_bt.noise_nrj_blk_count)
- finished = true;
- else
- cur_blk = cur_blk->next;
- }
- /* TODO:
- - compute BER vs SNR table, sort it, and use it to build the tone map.
- */
-}