Skip to content

Commit

Permalink
changing max_dev also effects channel bandwidth for analog
Browse files Browse the repository at this point in the history
  • Loading branch information
robotastic committed Jun 14, 2024
1 parent e629210 commit 687615e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion trunk-recorder/config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ bool load_config(string config_file, Config &config, gr::top_block_sptr &tb, std
double digital_levels = element.value("digitalLevels", 1.0);
double analog_levels = element.value("analogLevels", 8.0);
double squelch_db = element.value("squelch", -160.0);
int max_dev = element.value("maxDev", 6000);
int max_dev = element.value("maxDev", 4000);
double filter_width = element.value("filterWidth", 1.0);
bool conversation_mode = element.value("conversationMode", true);
bool mod_exists = element.contains("modulation");
Expand Down
7 changes: 6 additions & 1 deletion trunk-recorder/gr_blocks/xlat_channelizer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ xlat_channelizer::xlat_channelizer(double input_rate, int samples_per_symbol, do
const float pi = M_PI;

int initial_decim = floor(input_rate / 96000);
double initial_rate = double(input_rate) / double(initial_decim);
initial_rate = double(input_rate) / double(initial_decim);
int decim = floor(initial_rate / channel_rate);
double resampled_rate = double(initial_rate) / double(decim);

Expand Down Expand Up @@ -171,6 +171,11 @@ void xlat_channelizer::tune_offset(double f) {
freq_xlat->set_center_freq(-freq);
}

void xlat_channelizer::set_max_dev(double max_dev) {
std::vector<float> channel_lpf_taps = gr::filter::firdes::low_pass_2(1.0, initial_rate, max_dev, d_bandwidth / 2, 60);
channel_lpf->set_taps(channel_lpf_taps);
}

void xlat_channelizer::set_squelch_db(double squelch_db) {
squelch->set_threshold(squelch_db);
}
Expand Down
2 changes: 2 additions & 0 deletions trunk-recorder/gr_blocks/xlat_channelizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class xlat_channelizer : public gr::hier_block2 {
void set_samples_per_symbol(int samples_per_symbol);
void set_squelch_db(double squelch_db);
void set_analog_squelch(bool analog_squelch);
void set_max_dev(double max_dev);

private:
bool double_decim;
Expand All @@ -76,6 +77,7 @@ class xlat_channelizer : public gr::hier_block2 {

bool d_use_squelch;
long symbol_rate;
double initial_rate;
double squelch_db;
long decim;

Expand Down
4 changes: 1 addition & 3 deletions trunk-recorder/recorders/analog_recorder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,7 @@ bool analog_recorder::start(Call *call) {

levels->set_k(system->get_analog_levels());
int d_max_dev = system->get_max_dev();
/*
channel_lpf_taps = gr::filter::firdes::low_pass_2(1.0, initial_rate, d_max_dev, 1000, 100);
channel_lpf->set_taps(channel_lpf_taps);*/
prefilter->set_max_dev(d_max_dev);
quad_gain = system_channel_rate / (2.0 * M_PI * (d_max_dev + 1000));
demod->set_gain(quad_gain);
int offset_amount = (center_freq - chan_freq);
Expand Down

0 comments on commit 687615e

Please sign in to comment.