summaryrefslogtreecommitdiff
path: root/gr-dtv/lib/dvbt/dvbt_reference_signals_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gr-dtv/lib/dvbt/dvbt_reference_signals_impl.cc')
-rw-r--r--gr-dtv/lib/dvbt/dvbt_reference_signals_impl.cc38
1 files changed, 14 insertions, 24 deletions
diff --git a/gr-dtv/lib/dvbt/dvbt_reference_signals_impl.cc b/gr-dtv/lib/dvbt/dvbt_reference_signals_impl.cc
index 14dfc03afc..73db55bb0f 100644
--- a/gr-dtv/lib/dvbt/dvbt_reference_signals_impl.cc
+++ b/gr-dtv/lib/dvbt/dvbt_reference_signals_impl.cc
@@ -102,6 +102,8 @@ dvbt_pilot_gen::dvbt_pilot_gen(const dvbt_configure& c)
d_prev_mod_symbol_index(0),
d_mod_symbol_index(0)
{
+
+ gr::configure_default_loggers(d_logger, d_debug_logger, "dvbt_pilot_gen");
// Determine parameters from config file
d_Kmin = config.d_Kmin;
d_Kmax = config.d_Kmax;
@@ -139,7 +141,7 @@ dvbt_pilot_gen::dvbt_pilot_gen(const dvbt_configure& c)
// allocate PRBS buffer
d_wk = new (std::nothrow) char[d_Kmax - d_Kmin + 1];
if (d_wk == NULL) {
- std::cerr << "Reference Signals, cannot allocate memory for d_wk." << std::endl;
+ GR_LOG_ERROR(d_logger, "cannot allocate memory for d_wk.");
throw std::bad_alloc();
}
// Generate wk sequence
@@ -148,9 +150,7 @@ dvbt_pilot_gen::dvbt_pilot_gen(const dvbt_configure& c)
// allocate buffer for scattered pilots
d_spilot_carriers_val = new (std::nothrow) gr_complex[d_Kmax - d_Kmin + 1];
if (d_spilot_carriers_val == NULL) {
- std::cerr
- << "Reference Signals, cannot allocate memory for d_spilot_carriers_val."
- << std::endl;
+ GR_LOG_ERROR(d_logger, "cannot allocate memory for d_spilot_carriers_val.");
delete[] d_wk;
throw std::bad_alloc();
}
@@ -158,8 +158,7 @@ dvbt_pilot_gen::dvbt_pilot_gen(const dvbt_configure& c)
// allocate buffer for channel gains (for each useful carrier)
d_channel_gain = new (std::nothrow) gr_complex[d_Kmax - d_Kmin + 1];
if (d_channel_gain == NULL) {
- std::cerr << "Reference Signals, cannot allocate memory for d_channel_gain."
- << std::endl;
+ GR_LOG_ERROR(d_logger, "cannot allocate memory for d_channel_gain.");
delete[] d_spilot_carriers_val;
delete[] d_wk;
throw std::bad_alloc();
@@ -168,8 +167,7 @@ dvbt_pilot_gen::dvbt_pilot_gen(const dvbt_configure& c)
// Allocate buffer for continual pilots phase diffs
d_known_phase_diff = new (std::nothrow) float[d_cpilot_carriers_size - 1];
if (d_known_phase_diff == NULL) {
- std::cerr << "Reference Signals, cannot allocate memory for d_known_phase_diff."
- << std::endl;
+ GR_LOG_ERROR(d_logger, "cannot allocate memory for d_known_phase_diff.");
delete[] d_channel_gain;
delete[] d_spilot_carriers_val;
delete[] d_wk;
@@ -184,8 +182,7 @@ dvbt_pilot_gen::dvbt_pilot_gen(const dvbt_configure& c)
d_cpilot_phase_diff = new (std::nothrow) float[d_cpilot_carriers_size - 1];
if (d_cpilot_phase_diff == NULL) {
- std::cerr << "Reference Signals, cannot allocate memory for d_cpilot_phase_diff."
- << std::endl;
+ GR_LOG_ERROR(d_logger, "cannot allocate memory for d_cpilot_phase_diff.");
delete[] d_known_phase_diff;
delete[] d_channel_gain;
delete[] d_spilot_carriers_val;
@@ -196,8 +193,7 @@ dvbt_pilot_gen::dvbt_pilot_gen(const dvbt_configure& c)
// Allocate buffer for derotated input symbol
d_derot_in = new (std::nothrow) gr_complex[d_fft_length];
if (d_derot_in == NULL) {
- std::cerr << "Reference Signals, cannot allocate memory for d_derot_in."
- << std::endl;
+ GR_LOG_ERROR(d_logger, "cannot allocate memory for d_derot_in.");
delete[] d_cpilot_phase_diff;
delete[] d_known_phase_diff;
delete[] d_channel_gain;
@@ -209,8 +205,7 @@ dvbt_pilot_gen::dvbt_pilot_gen(const dvbt_configure& c)
// allocate buffer for first tps symbol constellation
d_tps_carriers_val = new (std::nothrow) gr_complex[d_tps_carriers_size];
if (d_tps_carriers_val == NULL) {
- std::cerr << "Reference Signals, cannot allocate memory for d_tps_carriers_val."
- << std::endl;
+ GR_LOG_ERROR(d_logger, "cannot allocate memory for d_tps_carriers_val.");
delete[] d_derot_in;
delete[] d_cpilot_phase_diff;
delete[] d_known_phase_diff;
@@ -223,8 +218,7 @@ dvbt_pilot_gen::dvbt_pilot_gen(const dvbt_configure& c)
// allocate tps data buffer
d_tps_data = new (std::nothrow) unsigned char[d_symbols_per_frame];
if (d_tps_data == NULL) {
- std::cerr << "Reference Signals, cannot allocate memory for d_tps_data."
- << std::endl;
+ GR_LOG_ERROR(d_logger, "cannot allocate memory for d_tps_data.");
delete[] d_tps_carriers_val;
delete[] d_derot_in;
delete[] d_cpilot_phase_diff;
@@ -237,8 +231,7 @@ dvbt_pilot_gen::dvbt_pilot_gen(const dvbt_configure& c)
d_prev_tps_symbol = new (std::nothrow) gr_complex[d_tps_carriers_size];
if (d_prev_tps_symbol == NULL) {
- std::cerr << "Reference Signals, cannot allocate memory for d_prev_tps_symbol."
- << std::endl;
+ GR_LOG_ERROR(d_logger, "cannot allocate memory for d_prev_tps_symbol.");
delete[] d_tps_data;
delete[] d_tps_carriers_val;
delete[] d_derot_in;
@@ -253,8 +246,7 @@ dvbt_pilot_gen::dvbt_pilot_gen(const dvbt_configure& c)
d_tps_symbol = new (std::nothrow) gr_complex[d_tps_carriers_size];
if (d_tps_symbol == NULL) {
- std::cerr << "Reference Signals, cannot allocate memory for d_tps_symbol."
- << std::endl;
+ GR_LOG_ERROR(d_logger, "cannot allocate memory for d_tps_symbol.");
delete[] d_prev_tps_symbol;
delete[] d_tps_data;
delete[] d_tps_carriers_val;
@@ -282,8 +274,7 @@ dvbt_pilot_gen::dvbt_pilot_gen(const dvbt_configure& c)
// Allocate buffer for channel estimation carriers
d_chanestim_carriers = new (std::nothrow) int[d_Kmax - d_Kmin + 1];
if (d_chanestim_carriers == NULL) {
- std::cerr << "Reference Signals, cannot allocate memory for d_chanestim_carriers."
- << std::endl;
+ GR_LOG_ERROR(d_logger, "cannot allocate memory for d_chanestim_carriers.");
delete[] d_tps_symbol;
delete[] d_prev_tps_symbol;
delete[] d_tps_data;
@@ -300,8 +291,7 @@ dvbt_pilot_gen::dvbt_pilot_gen(const dvbt_configure& c)
// Allocate buffer for payload carriers
d_payload_carriers = new (std::nothrow) int[d_Kmax - d_Kmin + 1];
if (d_payload_carriers == NULL) {
- std::cerr << "Reference Signals, cannot allocate memory for d_payload_carriers."
- << std::endl;
+ GR_LOG_ERROR(d_logger, "cannot allocate memory for d_payload_carriers.");
delete[] d_chanestim_carriers;
delete[] d_tps_symbol;
delete[] d_prev_tps_symbol;