Skip to content

Commit

Permalink
Fix for analog smartnet
Browse files Browse the repository at this point in the history
  • Loading branch information
robotastic committed Apr 26, 2024
1 parent c73b617 commit ac06c70
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
12 changes: 6 additions & 6 deletions trunk-recorder/gr_blocks/xlat_channelizer.cc
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -40,15 +40,15 @@ 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))),
d_center_freq(center_freq),
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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions trunk-recorder/gr_blocks/xlat_channelizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ class xlat_channelizer : public gr::hier_block2 {
typedef std::shared_ptr<xlat_channelizer> 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;
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion trunk-recorder/recorders/analog_recorder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ac06c70

Please sign in to comment.