Skip to content

Commit

Permalink
SRSENB: fix channel emulator for multiple channels
Browse files Browse the repository at this point in the history
  • Loading branch information
xavierarteaga committed May 7, 2020
1 parent f69aad3 commit b11ffae
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
12 changes: 11 additions & 1 deletion srsenb/hdr/phy/phy_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,19 @@ class phy_common

return ret;
};
uint32_t get_nof_rf_channels()
{
uint32_t count = 0;

for (auto& cell : cell_list) {
count += cell.cell.nof_ports;
}

return count;
}
double get_ul_freq_hz(uint32_t cc_idx)
{
double ret = 0.0f;
double ret = 0.0;

if (cc_idx < cell_list.size()) {
ret = cell_list[cc_idx].ul_freq_hz;
Expand Down
2 changes: 1 addition & 1 deletion srsenb/src/phy/phy_common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ bool phy_common::init(const phy_cell_cfg_list_t& cell_list_,

// Instantiate DL channel emulator
if (params.dl_channel_args.enable) {
dl_channel = srslte::channel_ptr(new srslte::channel(params.dl_channel_args, 1));
dl_channel = srslte::channel_ptr(new srslte::channel(params.dl_channel_args, get_nof_rf_channels()));
dl_channel->set_srate((uint32_t)srslte_sampling_freq_hz(cell_list[0].cell.nof_prb));
}

Expand Down
3 changes: 2 additions & 1 deletion srsenb/src/phy/txrx.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ bool txrx::init(srslte::radio_interface_phy* radio_h_,

// Instantiate UL channel emulator
if (worker_com->params.ul_channel_args.enable) {
ul_channel = srslte::channel_ptr(new srslte::channel(worker_com->params.ul_channel_args, 1));
ul_channel =
srslte::channel_ptr(new srslte::channel(worker_com->params.ul_channel_args, worker_com->get_nof_rf_channels()));
}

start(prio_);
Expand Down

0 comments on commit b11ffae

Please sign in to comment.