slot_worker: add compile time option to write baseband signal to file

master
Andre Puschmann 3 years ago
parent 9987b9e70b
commit 2117aa93e2

@ -14,6 +14,13 @@
#include "srsran/common/buffer_pool.h" #include "srsran/common/buffer_pool.h"
#include "srsran/common/common.h" #include "srsran/common/common.h"
#define DEBUG_WRITE_FILE
#ifdef DEBUG_WRITE_FILE
FILE* f;
static uint32_t num_slots = 0;
#endif
namespace srsenb { namespace srsenb {
namespace nr { namespace nr {
slot_worker::slot_worker(srsran::phy_common_interface& common_, slot_worker::slot_worker(srsran::phy_common_interface& common_,
@ -86,6 +93,12 @@ bool slot_worker::init(const args_t& args)
return false; return false;
} }
#ifdef DEBUG_WRITE_FILE
const char* filename = "nr_baseband.dat";
printf("Opening %s to dump baseband\n", filename);
f = fopen(filename, "w");
#endif
return true; return true;
} }
@ -407,6 +420,18 @@ void slot_worker::work_imp()
} }
common.worker_end(context, true, tx_rf_buffer); common.worker_end(context, true, tx_rf_buffer);
#ifdef DEBUG_WRITE_FILE
fwrite(tx_rf_buffer.get(0), tx_rf_buffer.get_nof_samples() * sizeof(cf_t), 1, f);
#endif
#ifdef DEBUG_WRITE_FILE
if (num_slots == 30) {
fclose(f);
exit(-1);
}
num_slots++;
#endif
} }
bool slot_worker::set_common_cfg(const srsran_carrier_nr_t& carrier, bool slot_worker::set_common_cfg(const srsran_carrier_nr_t& carrier,

Loading…
Cancel
Save