summaryrefslogtreecommitdiff
path: root/cesar/ce/rx/rx.h
blob: d2ec2cd6120cbdc03c60bb5584e797bcfd6f545a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#ifndef ce_rx_rx_h
#define ce_rx_rx_h
/* Cesar project {{{
 *
 * Copyright (C) 2009 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    ce/rx/rx.h
 * \brief   Channel Estimation in Receive mode.
 * \ingroup ce_rx
 */

#include "mac/common/store.h"
#include "mac/sar/sar.h"
#include "cp/types.h"

/**
 * Context of the CE in RX mode (forward declaration).
 */
typedef struct ce_rx_t ce_rx_t;

BEGIN_DECLS

/**
 * Initialize the CE in RX.
 * \param  mac_store  the MAC store context.
 * \param  sar  the SAR context.
 * \param  pbproc  the PBProc context.
 * \param  mac_config  the MAC config context.
 * \return  the context of the CE in RX.
 */
ce_rx_t *
ce_rx_init (mac_store_t *mac_store, sar_t *sar, pbproc_t *pbproc,
            mac_config_t *mac_config);

/**
 * Un-initialize the CE in RX.
 * \param  ce_rx  the CE in RX context.
 */
void
ce_rx_uninit (ce_rx_t *ce_rx);

/**
 * Ask for the CE RX to get the current noise NRJ (nsr) of a peer.
 * \param  ce_rx  the CE in RX context.
 * \param  tei  the TEI of the station from which we want the SNR.
 * \param  int_index  the interval index on which we want the SNR.
 * \param  int_version  the version of the intervals.
 * \param  ber  the current BER (only available if return is not NULL).
 * \return  some blocks of NSR (or NULL if NSR is not available).
 *
 * The NSR returned by this function is the NSR used by the CE: it is not the
 * channel data returned by the PBProc. For example, just after initial CE,
 * the NSR will be a mean of all the NSR computed on sound frames.
 */
blk_t *
ce_rx_get_nsr (ce_rx_t *ce_rx, cp_tei_t tei, uint int_index,
               uint int_version, u16 *ber);

END_DECLS

#endif /* ce_rx_rx_h */