mirror of https://github.com/pvnis/srsRAN_4G.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
138 lines
4.8 KiB
C
138 lines
4.8 KiB
C
10 years ago
|
/**
|
||
|
*
|
||
|
* \section COPYRIGHT
|
||
|
*
|
||
9 years ago
|
* Copyright 2013-2015 Software Radio Systems Limited
|
||
10 years ago
|
*
|
||
|
* \section LICENSE
|
||
|
*
|
||
10 years ago
|
* This file is part of the srsLTE library.
|
||
10 years ago
|
*
|
||
10 years ago
|
* srsLTE is free software: you can redistribute it and/or modify
|
||
10 years ago
|
* it under the terms of the GNU Affero General Public License as
|
||
10 years ago
|
* published by the Free Software Foundation, either version 3 of
|
||
|
* the License, or (at your option) any later version.
|
||
|
*
|
||
10 years ago
|
* srsLTE is distributed in the hope that it will be useful,
|
||
10 years ago
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
10 years ago
|
* GNU Affero General Public License for more details.
|
||
10 years ago
|
*
|
||
10 years ago
|
* A copy of the GNU Affero General Public License can be found in
|
||
10 years ago
|
* the LICENSE file in the top-level directory of this distribution
|
||
|
* and at http://www.gnu.org/licenses/.
|
||
|
*
|
||
|
*/
|
||
|
|
||
10 years ago
|
/**********************************************************************************************
|
||
|
* File: chest_dl.h
|
||
|
*
|
||
|
* Description: 3GPP LTE Downlink channel estimator and equalizer.
|
||
|
* Estimates the channel in the resource elements transmitting references and
|
||
|
* interpolates for the rest of the resource grid.
|
||
|
* The equalizer uses the channel estimates to produce an estimation of the
|
||
|
* transmitted symbol.
|
||
|
* This object depends on the srslte_refsignal_t object for creating the LTE
|
||
|
* CSR signal.
|
||
|
*
|
||
|
* Reference:
|
||
|
*********************************************************************************************/
|
||
10 years ago
|
|
||
|
#ifndef CHEST_DL_
|
||
|
#define CHEST_DL_
|
||
|
|
||
|
#include <stdio.h>
|
||
|
|
||
10 years ago
|
#include "srslte/config.h"
|
||
10 years ago
|
|
||
8 years ago
|
#include "srslte/phy/ch_estimation/chest_common.h"
|
||
|
#include "srslte/phy/resampling/interp.h"
|
||
|
#include "srslte/phy/ch_estimation/refsignal_dl.h"
|
||
|
#include "srslte/phy/common/phy_common.h"
|
||
|
#include "srslte/phy/sync/pss.h"
|
||
10 years ago
|
|
||
10 years ago
|
|
||
9 years ago
|
typedef enum {
|
||
|
SRSLTE_NOISE_ALG_REFS,
|
||
|
SRSLTE_NOISE_ALG_PSS,
|
||
|
SRSLTE_NOISE_ALG_EMPTY,
|
||
|
} srslte_chest_dl_noise_alg_t;
|
||
|
|
||
10 years ago
|
typedef struct {
|
||
10 years ago
|
srslte_cell_t cell;
|
||
|
srslte_refsignal_cs_t csr_signal;
|
||
9 years ago
|
cf_t *pilot_estimates;
|
||
9 years ago
|
cf_t *pilot_estimates_average;
|
||
9 years ago
|
cf_t *pilot_recv_signal;
|
||
10 years ago
|
cf_t *tmp_noise;
|
||
9 years ago
|
|
||
9 years ago
|
#ifdef FREQ_SEL_SNR
|
||
|
float snr_vector[12000];
|
||
|
float pilot_power[12000];
|
||
|
#endif
|
||
9 years ago
|
uint32_t smooth_filter_len;
|
||
9 years ago
|
float smooth_filter[SRSLTE_CHEST_MAX_SMOOTH_FIL_LEN];
|
||
10 years ago
|
|
||
10 years ago
|
srslte_interp_linsrslte_vec_t srslte_interp_linvec;
|
||
10 years ago
|
srslte_interp_lin_t srslte_interp_lin;
|
||
10 years ago
|
|
||
8 years ago
|
float rssi[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS];
|
||
|
float rsrp[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS];
|
||
|
float noise_estimate[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS];
|
||
9 years ago
|
|
||
|
/* Use PSS for noise estimation in LS linear interpolation mode */
|
||
|
cf_t pss_signal[SRSLTE_PSS_LEN];
|
||
|
cf_t tmp_pss[SRSLTE_PSS_LEN];
|
||
|
cf_t tmp_pss_noisy[SRSLTE_PSS_LEN];
|
||
9 years ago
|
|
||
|
srslte_chest_dl_noise_alg_t noise_alg;
|
||
8 years ago
|
int last_nof_antennas;
|
||
9 years ago
|
|
||
10 years ago
|
} srslte_chest_dl_t;
|
||
10 years ago
|
|
||
|
|
||
10 years ago
|
SRSLTE_API int srslte_chest_dl_init(srslte_chest_dl_t *q,
|
||
|
srslte_cell_t cell);
|
||
10 years ago
|
|
||
10 years ago
|
SRSLTE_API void srslte_chest_dl_free(srslte_chest_dl_t *q);
|
||
10 years ago
|
|
||
9 years ago
|
SRSLTE_API void srslte_chest_dl_set_smooth_filter(srslte_chest_dl_t *q,
|
||
|
float *filter,
|
||
|
uint32_t filter_len);
|
||
9 years ago
|
|
||
9 years ago
|
SRSLTE_API void srslte_chest_dl_set_smooth_filter3_coeff(srslte_chest_dl_t* q,
|
||
|
float w);
|
||
|
|
||
9 years ago
|
SRSLTE_API void srslte_chest_dl_set_noise_alg(srslte_chest_dl_t *q,
|
||
|
srslte_chest_dl_noise_alg_t noise_estimation_alg);
|
||
|
|
||
8 years ago
|
SRSLTE_API int srslte_chest_dl_estimate_multi(srslte_chest_dl_t *q,
|
||
8 years ago
|
cf_t *input[SRSLTE_MAX_PORTS],
|
||
|
cf_t *ce[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS],
|
||
8 years ago
|
uint32_t sf_idx,
|
||
|
uint32_t nof_rx_antennas);
|
||
8 years ago
|
|
||
10 years ago
|
SRSLTE_API int srslte_chest_dl_estimate(srslte_chest_dl_t *q,
|
||
|
cf_t *input,
|
||
|
cf_t *ce[SRSLTE_MAX_PORTS],
|
||
|
uint32_t sf_idx);
|
||
10 years ago
|
|
||
10 years ago
|
SRSLTE_API int srslte_chest_dl_estimate_port(srslte_chest_dl_t *q,
|
||
|
cf_t *input,
|
||
|
cf_t *ce,
|
||
|
uint32_t sf_idx,
|
||
8 years ago
|
uint32_t port_id,
|
||
|
uint32_t rxant_id);
|
||
10 years ago
|
|
||
10 years ago
|
SRSLTE_API float srslte_chest_dl_get_noise_estimate(srslte_chest_dl_t *q);
|
||
10 years ago
|
|
||
9 years ago
|
SRSLTE_API float srslte_chest_dl_get_snr(srslte_chest_dl_t *q);
|
||
|
|
||
10 years ago
|
SRSLTE_API float srslte_chest_dl_get_rssi(srslte_chest_dl_t *q);
|
||
10 years ago
|
|
||
10 years ago
|
SRSLTE_API float srslte_chest_dl_get_rsrq(srslte_chest_dl_t *q);
|
||
10 years ago
|
|
||
10 years ago
|
SRSLTE_API float srslte_chest_dl_get_rsrp(srslte_chest_dl_t *q);
|
||
10 years ago
|
|
||
10 years ago
|
#endif
|