From ac06c7097faa1b4555add032e7902dc5a3cd7548 Mon Sep 17 00:00:00 2001 From: Luke Berndt Date: Thu, 25 Apr 2024 21:27:36 -0400 Subject: [PATCH] Fix for analog smartnet --- trunk-recorder/gr_blocks/xlat_channelizer.cc | 12 ++++++------ trunk-recorder/gr_blocks/xlat_channelizer.h | 6 +++--- trunk-recorder/recorders/analog_recorder.cc | 3 ++- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/trunk-recorder/gr_blocks/xlat_channelizer.cc b/trunk-recorder/gr_blocks/xlat_channelizer.cc index e1aef3bb4..80f479022 100644 --- a/trunk-recorder/gr_blocks/xlat_channelizer.cc +++ b/trunk-recorder/gr_blocks/xlat_channelizer.cc @@ -1,8 +1,8 @@ #include "xlat_channelizer.h" -xlat_channelizer::sptr xlat_channelizer::make(double input_rate, int samples_per_symbol, double symbol_rate, double center_freq, bool conventional) { +xlat_channelizer::sptr xlat_channelizer::make(double input_rate, int samples_per_symbol, double symbol_rate, double center_freq, bool use_squelch) { - return gnuradio::get_initial_sptr(new xlat_channelizer(input_rate, samples_per_symbol, symbol_rate, center_freq, conventional)); + return gnuradio::get_initial_sptr(new xlat_channelizer(input_rate, samples_per_symbol, symbol_rate, center_freq, use_squelch)); } const int xlat_channelizer::smartnet_samples_per_symbol; @@ -40,7 +40,7 @@ xlat_channelizer::DecimSettings xlat_channelizer::get_decim(long speed) { return decim_settings; } -xlat_channelizer::xlat_channelizer(double input_rate, int samples_per_symbol, double symbol_rate, double center_freq, bool conventional) +xlat_channelizer::xlat_channelizer(double input_rate, int samples_per_symbol, double symbol_rate, double center_freq, bool use_squelch) : gr::hier_block2("xlat_channelizer_ccf", gr::io_signature::make(1, 1, sizeof(gr_complex)), gr::io_signature::make(1, 1, sizeof(gr_complex))), @@ -48,7 +48,7 @@ xlat_channelizer::xlat_channelizer(double input_rate, int samples_per_symbol, do d_input_rate(input_rate), d_samples_per_symbol(samples_per_symbol), d_symbol_rate(symbol_rate), - d_conventional(conventional) { + d_use_squelch(use_squelch) { long channel_rate = d_symbol_rate * d_samples_per_symbol; // long if_rate = 12500; @@ -126,7 +126,7 @@ xlat_channelizer::xlat_channelizer(double input_rate, int samples_per_symbol, do connect(self(), 0, freq_xlat, 0); - if (d_conventional) { + if (d_use_squelch) { BOOST_LOG_TRIVIAL(info) << "Conventional - with Squelch"; if (arb_rate == 1.0) { connect(freq_xlat, 0, squelch, 0); @@ -159,7 +159,7 @@ bool xlat_channelizer::is_squelched() { } double xlat_channelizer::get_pwr() { - if (d_conventional) { + if (d_use_squelch) { return squelch->get_pwr(); } else { return DB_UNSET; diff --git a/trunk-recorder/gr_blocks/xlat_channelizer.h b/trunk-recorder/gr_blocks/xlat_channelizer.h index feae43cef..d81f04288 100644 --- a/trunk-recorder/gr_blocks/xlat_channelizer.h +++ b/trunk-recorder/gr_blocks/xlat_channelizer.h @@ -39,8 +39,8 @@ class xlat_channelizer : public gr::hier_block2 { typedef std::shared_ptr sptr; #endif - static sptr make(double input_rate, int samples_per_symbol, double symbol_rate, double center_freq, bool conventional); - xlat_channelizer(double input_rate, int samples_per_symbol, double symbol_rate, double center_freq, bool conventional); + static sptr make(double input_rate, int samples_per_symbol, double symbol_rate, double center_freq, bool use_squelch); + xlat_channelizer(double input_rate, int samples_per_symbol, double symbol_rate, double center_freq, bool use_squelch); struct DecimSettings { long decim; @@ -72,7 +72,7 @@ class xlat_channelizer : public gr::hier_block2 { int d_samples_per_symbol; double d_symbol_rate; - bool d_conventional; + bool d_use_squelch; long symbol_rate; double squelch_db; long decim; diff --git a/trunk-recorder/recorders/analog_recorder.cc b/trunk-recorder/recorders/analog_recorder.cc index 6089309c3..e4ccd4c4d 100644 --- a/trunk-recorder/recorders/analog_recorder.cc +++ b/trunk-recorder/recorders/analog_recorder.cc @@ -117,7 +117,8 @@ analog_recorder::analog_recorder(Source *src, Recorder_Type type, float tone_fre system_channel_rate = 16000; // 4800 * samp_per_sym; wav_sample_rate = 16000; // Must be an integer decimation of system_channel_rate - prefilter = xlat_channelizer::make(input_rate, 2, 8000, center_freq, conventional); + // The Prefilter provides the initial squelch for the channel + prefilter = xlat_channelizer::make(input_rate, 2, 8000, center_freq, true); prefilter->set_analog_squelch(true); // based on squelch code form ham2mon