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.
89 lines
2.5 KiB
C
89 lines
2.5 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_CHANNEL_H
|
||
|
#define SRSRAN_CHANNEL_H
|
||
6 years ago
|
|
||
4 years ago
|
#include "ch_awgn.h"
|
||
6 years ago
|
#include "delay.h"
|
||
|
#include "fading.h"
|
||
5 years ago
|
#include "hst.h"
|
||
5 years ago
|
#include "rlf.h"
|
||
4 years ago
|
#include "srsran/phy/common/phy_common.h"
|
||
|
#include "srsran/srslog/srslog.h"
|
||
6 years ago
|
#include <memory>
|
||
6 years ago
|
#include <string>
|
||
|
|
||
4 years ago
|
namespace srsran {
|
||
6 years ago
|
|
||
|
class channel
|
||
|
{
|
||
|
public:
|
||
|
typedef struct {
|
||
|
// General
|
||
|
bool enable = false;
|
||
|
|
||
5 years ago
|
// AWGN options
|
||
4 years ago
|
bool awgn_enable = false;
|
||
|
float awgn_signal_power_dBfs = 0.0f;
|
||
|
float awgn_snr_dB = 30.0f;
|
||
5 years ago
|
|
||
6 years ago
|
// Fading options
|
||
6 years ago
|
bool fading_enable = false;
|
||
|
std::string fading_model = "none";
|
||
6 years ago
|
|
||
5 years ago
|
// High Speed Train options
|
||
|
bool hst_enable = false;
|
||
|
float hst_fd_hz = 750.0f;
|
||
|
float hst_period_s = 7.2f;
|
||
5 years ago
|
float hst_init_time_s = 0.0f;
|
||
5 years ago
|
|
||
6 years ago
|
// Delay options
|
||
5 years ago
|
bool delay_enable = false;
|
||
|
float delay_min_us = 10;
|
||
|
float delay_max_us = 100;
|
||
|
float delay_period_s = 3600;
|
||
|
float delay_init_time_s = 0;
|
||
6 years ago
|
|
||
|
// RLF options
|
||
|
bool rlf_enable = false;
|
||
|
uint32_t rlf_t_on_ms = 10000;
|
||
|
uint32_t rlf_t_off_ms = 2000;
|
||
6 years ago
|
} args_t;
|
||
|
|
||
4 years ago
|
channel(const args_t& channel_args, uint32_t _nof_channels, srslog::basic_logger& logger);
|
||
6 years ago
|
~channel();
|
||
|
void set_srate(uint32_t srate);
|
||
4 years ago
|
void set_signal_power_dBfs(float power_dBfs);
|
||
4 years ago
|
void run(cf_t* in[SRSRAN_MAX_CHANNELS], cf_t* out[SRSRAN_MAX_CHANNELS], uint32_t len, const srsran_timestamp_t& t);
|
||
6 years ago
|
|
||
|
private:
|
||
4 years ago
|
srslog::basic_logger& logger;
|
||
5 years ago
|
float hst_init_phase = 0.0f;
|
||
4 years ago
|
srsran_channel_fading_t* fading[SRSRAN_MAX_CHANNELS] = {};
|
||
|
srsran_channel_delay_t* delay[SRSRAN_MAX_CHANNELS] = {};
|
||
|
srsran_channel_awgn_t* awgn = nullptr;
|
||
|
srsran_channel_hst_t* hst = nullptr;
|
||
|
srsran_channel_rlf_t* rlf = nullptr;
|
||
5 years ago
|
cf_t* buffer_in = nullptr;
|
||
|
cf_t* buffer_out = nullptr;
|
||
5 years ago
|
uint32_t nof_channels = 0;
|
||
5 years ago
|
uint32_t current_srate = 0;
|
||
|
args_t args = {};
|
||
6 years ago
|
};
|
||
|
|
||
6 years ago
|
typedef std::unique_ptr<channel> channel_ptr;
|
||
|
|
||
4 years ago
|
} // namespace srsran
|
||
6 years ago
|
|
||
4 years ago
|
#endif // SRSRAN_CHANNEL_H
|