srsLTE/lib/include/srslte/phy/ch_estimation/refsignal_dl.h

85 lines
3.2 KiB
C
Raw Normal View History

2014-11-05 05:19:35 -08:00
/**
*
* \section COPYRIGHT
*
2015-11-13 04:22:33 -08:00
* Copyright 2013-2015 Software Radio Systems Limited
2014-11-05 05:19:35 -08:00
*
* \section LICENSE
*
* This file is part of the srsLTE library.
2014-11-05 05:19:35 -08:00
*
* srsLTE is free software: you can redistribute it and/or modify
2015-05-08 08:05:40 -07:00
* it under the terms of the GNU Affero General Public License as
2014-11-05 05:19:35 -08:00
* published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
*
* srsLTE is distributed in the hope that it will be useful,
2014-11-05 05:19:35 -08:00
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2015-05-08 08:05:40 -07:00
* GNU Affero General Public License for more details.
2014-11-05 05:19:35 -08:00
*
2015-05-08 08:05:40 -07:00
* A copy of the GNU Affero General Public License can be found in
2014-11-05 05:19:35 -08:00
* the LICENSE file in the top-level directory of this distribution
* and at http://www.gnu.org/licenses/.
*
*/
/**********************************************************************************************
* File: refsignal_dl.h
*
* Description: Object to manage downlink reference signals for channel estimation.
*
* Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 6.10
*********************************************************************************************/
2015-03-18 05:41:50 -07:00
#ifndef SRSLTE_REFSIGNAL_DL_
#define SRSLTE_REFSIGNAL_DL_
2014-11-05 05:19:35 -08:00
#include "srslte/config.h"
2017-05-18 00:48:24 -07:00
#include "srslte/phy/common/phy_common.h"
2014-11-05 05:19:35 -08:00
// Number of references in a subframe: there are 2 symbols for port_id=0,1 x 2 slots x 2 refs per prb
2015-03-18 05:41:50 -07:00
#define SRSLTE_REFSIGNAL_NUM_SF(nof_prb, port_id) (((port_id)<2?8:4)*(nof_prb))
#define SRSLTE_REFSIGNAL_MAX_NUM_SF(nof_prb) SRSLTE_REFSIGNAL_NUM_SF(nof_prb, 0)
2014-11-05 05:19:35 -08:00
2015-03-18 05:41:50 -07:00
#define SRSLTE_REFSIGNAL_PILOT_IDX(i,l,cell) (2*cell.nof_prb*(l)+(i))
2014-11-05 05:19:35 -08:00
/** Cell-Specific Reference Signal */
typedef struct SRSLTE_API {
2015-03-18 05:41:50 -07:00
srslte_cell_t cell;
cf_t *pilots[2][SRSLTE_NSUBFRAMES_X_FRAME]; // Saves the reference signal per subframe for ports 0,1 and ports 2,3
} srslte_refsignal_cs_t;
2014-11-05 05:19:35 -08:00
2015-03-18 05:41:50 -07:00
SRSLTE_API int srslte_refsignal_cs_init(srslte_refsignal_cs_t *q,
srslte_cell_t cell);
2014-11-05 05:19:35 -08:00
2015-03-18 05:41:50 -07:00
SRSLTE_API void srslte_refsignal_cs_free(srslte_refsignal_cs_t *q);
2014-11-05 05:19:35 -08:00
2015-03-18 05:41:50 -07:00
SRSLTE_API int srslte_refsignal_cs_put_sf(srslte_cell_t cell,
uint32_t port_id,
cf_t *pilots,
cf_t *sf_symbols);
2014-11-05 05:19:35 -08:00
2015-03-18 05:41:50 -07:00
SRSLTE_API int srslte_refsignal_cs_get_sf(srslte_cell_t cell,
uint32_t port_id,
cf_t *sf_symbols,
cf_t *pilots);
2014-11-05 05:19:35 -08:00
2015-03-18 05:41:50 -07:00
SRSLTE_API uint32_t srslte_refsignal_cs_fidx(srslte_cell_t cell,
uint32_t l,
uint32_t port_id,
uint32_t m);
2014-11-05 05:19:35 -08:00
2015-03-18 05:41:50 -07:00
SRSLTE_API uint32_t srslte_refsignal_cs_nsymbol(uint32_t l,
srslte_cp_t cp,
uint32_t port_id);
2014-11-05 05:19:35 -08:00
2015-03-18 05:41:50 -07:00
SRSLTE_API uint32_t srslte_refsignal_cs_v(uint32_t port_id,
uint32_t ref_symbol_idx);
2014-11-05 05:19:35 -08:00
2015-03-18 05:41:50 -07:00
SRSLTE_API uint32_t srslte_refsignal_cs_nof_symbols(uint32_t port_id);
2014-11-05 05:19:35 -08:00
#endif