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.
79 lines
2.7 KiB
C
79 lines
2.7 KiB
C
4 years ago
|
/**
|
||
6 years ago
|
*
|
||
4 years ago
|
* \section COPYRIGHT
|
||
6 years ago
|
*
|
||
4 years ago
|
* Copyright 2013-2021 Software Radio Systems Limited
|
||
6 years ago
|
*
|
||
4 years ago
|
* By using this file, you agree to the terms and conditions set
|
||
|
* forth in the LICENSE file which can be found at the top level of
|
||
|
* the distribution.
|
||
6 years ago
|
*
|
||
|
*/
|
||
|
|
||
4 years ago
|
#ifndef SRSRAN_FADING_H
|
||
|
#define SRSRAN_FADING_H
|
||
6 years ago
|
|
||
4 years ago
|
#include "srsran/config.h"
|
||
|
#include "srsran/phy/common/timestamp.h"
|
||
|
#include "srsran/phy/dft/dft.h"
|
||
6 years ago
|
#include <inttypes.h>
|
||
4 years ago
|
#include <stdint.h>
|
||
6 years ago
|
|
||
4 years ago
|
#define SRSRAN_CHANNEL_FADING_MAXTAPS 9
|
||
|
#define SRSRAN_CHANNEL_FADING_NTERMS 16
|
||
6 years ago
|
|
||
|
typedef enum {
|
||
4 years ago
|
srsran_channel_fading_model_none = 0,
|
||
|
srsran_channel_fading_model_epa,
|
||
|
srsran_channel_fading_model_eva,
|
||
|
srsran_channel_fading_model_etu,
|
||
|
} srsran_channel_fading_model_t;
|
||
6 years ago
|
|
||
|
typedef struct {
|
||
|
// Configuration parameters
|
||
|
float srate; // Sampling rate: 1.92e6, 3.84e6, ..., 23.04e6, 30.72e6
|
||
4 years ago
|
srsran_channel_fading_model_t model; // None, EPA, EVA, ETU
|
||
6 years ago
|
float doppler; // Maximum doppler: 5, 70, 300
|
||
|
|
||
5 years ago
|
// Internal tap parametrisation
|
||
|
uint32_t N; // FFT size
|
||
|
uint32_t path_delay; // Path delay
|
||
|
uint32_t state_len; // Length of the impulse response saved in the state
|
||
|
|
||
4 years ago
|
float coeff_alpha[SRSRAN_CHANNEL_FADING_MAXTAPS][SRSRAN_CHANNEL_FADING_NTERMS]; // Angle of arrival
|
||
|
float coeff_a[SRSRAN_CHANNEL_FADING_MAXTAPS][SRSRAN_CHANNEL_FADING_NTERMS]; // Random phase
|
||
|
float coeff_b[SRSRAN_CHANNEL_FADING_MAXTAPS][SRSRAN_CHANNEL_FADING_NTERMS]; // Random phase
|
||
|
cf_t* h_tap[SRSRAN_CHANNEL_FADING_MAXTAPS]; // Static tap signal in frequency domain
|
||
6 years ago
|
|
||
|
// Utils
|
||
4 years ago
|
srsran_dft_plan_t fft; // DFT to frequency domain
|
||
|
srsran_dft_plan_t ifft; // DFT to time domain
|
||
5 years ago
|
cf_t* temp; // Temporal buffer, length fft_size
|
||
|
cf_t* h_freq; // Channel frequency response, length fft_size
|
||
|
cf_t* y_freq; // Intermediate frequency domain buffer
|
||
|
float sin_table[1024]; // Table of sinus values
|
||
6 years ago
|
|
||
|
// State variables
|
||
5 years ago
|
cf_t* state; // To save impulse response of the filter
|
||
4 years ago
|
} srsran_channel_fading_t;
|
||
6 years ago
|
|
||
6 years ago
|
#ifdef __cplusplus
|
||
|
extern "C" {
|
||
|
#endif
|
||
|
|
||
4 years ago
|
SRSRAN_API int srsran_channel_fading_init(srsran_channel_fading_t* q, double srate, const char* model, uint32_t seed);
|
||
6 years ago
|
|
||
4 years ago
|
SRSRAN_API void srsran_channel_fading_free(srsran_channel_fading_t* q);
|
||
6 years ago
|
|
||
4 years ago
|
SRSRAN_API double srsran_channel_fading_execute(srsran_channel_fading_t* q,
|
||
5 years ago
|
const cf_t* in,
|
||
|
cf_t* out,
|
||
|
uint32_t nof_samples,
|
||
|
double init_time);
|
||
6 years ago
|
|
||
6 years ago
|
#ifdef __cplusplus
|
||
|
}
|
||
|
#endif
|
||
|
|
||
4 years ago
|
#endif // SRSRAN_FADING_H
|