From 1bfc7026c530290920e359c5ec8d5bd135b90937 Mon Sep 17 00:00:00 2001 From: Luke Berndt Date: Thu, 13 Jun 2024 09:36:44 -0400 Subject: [PATCH] slight tunes to the Analog recorder --- trunk-recorder/config.cc | 2 +- trunk-recorder/gr_blocks/xlat_channelizer.cc | 18 +++++++----------- trunk-recorder/recorders/analog_recorder.cc | 4 ++-- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/trunk-recorder/config.cc b/trunk-recorder/config.cc index 9b7ecdac4..0b46263d3 100644 --- a/trunk-recorder/config.cc +++ b/trunk-recorder/config.cc @@ -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", 4000); + int max_dev = element.value("maxDev", 6000); double filter_width = element.value("filterWidth", 1.0); bool conversation_mode = element.value("conversationMode", true); bool mod_exists = element.contains("modulation"); diff --git a/trunk-recorder/gr_blocks/xlat_channelizer.cc b/trunk-recorder/gr_blocks/xlat_channelizer.cc index 4c3ed768a..a05241004 100644 --- a/trunk-recorder/gr_blocks/xlat_channelizer.cc +++ b/trunk-recorder/gr_blocks/xlat_channelizer.cc @@ -1,6 +1,6 @@ #include "xlat_channelizer.h" -xlat_channelizer::sptr xlat_channelizer::make(double input_rate, int samples_per_symbol, double symbol_rate, double bandwidth,double center_freq, bool use_squelch) { +xlat_channelizer::sptr xlat_channelizer::make(double input_rate, int samples_per_symbol, double symbol_rate, double bandwidth, double center_freq, bool use_squelch) { return gnuradio::get_initial_sptr(new xlat_channelizer(input_rate, samples_per_symbol, symbol_rate, bandwidth, center_freq, use_squelch)); } @@ -64,22 +64,19 @@ xlat_channelizer::xlat_channelizer(double input_rate, int samples_per_symbol, do int decimation = floor(input_rate / channel_rate); // double resampled_rate = float(input_rate) / float(decimation); - - // channel_lpf_taps = gr::filter::firdes::low_pass_2(1.0, pre_channel_rate, 5000, 2000, 60); - std::vector channel_lpf_taps = gr::filter::firdes::low_pass_2(1.0, initial_rate, d_bandwidth / 2, d_bandwidth / 4, 60); - std::vector if_coeffs; - if_coeffs = gr::filter::firdes::complex_band_pass_2(1, input_rate, -24000, 24000, 12000, 10 ); - - channel_lpf = gr::filter::fft_filter_ccf::make(decim, channel_lpf_taps); + if_coeffs = gr::filter::firdes::complex_band_pass_2(1, input_rate, -24000, 24000, 12000, 10); freq_xlat = make_freq_xlating_fft_filter(initial_decim, if_coeffs, 0, input_rate); // inital_lpf_taps, 0, input_rate); + std::vector channel_lpf_taps = gr::filter::firdes::low_pass_2(1.0, initial_rate, d_bandwidth / 2, d_bandwidth / 4, 60); + channel_lpf = gr::filter::fft_filter_ccf::make(decim, channel_lpf_taps); + // BOOST_LOG_TRIVIAL(info) << "\t Xlating Channelizer single-stage decimator - Decim: " << decimation << " Resampled Rate: " << resampled_rate << " Lowpass Taps: " << if_coeffs.size(); BOOST_LOG_TRIVIAL(info) << "\t Xlating Channelizer single-stage decimator - if_coeffs: " << if_coeffs.size() << " Decim: " << decim << " Resampled Rate: " << resampled_rate << " Lowpass Taps: " << channel_lpf_taps.size(); // ARB Resampler double arb_rate = channel_rate / resampled_rate; - + double arb_size = 32; double arb_atten = 30; // was originally 100 // Create a filter that covers the full bandwidth of the output signal @@ -112,7 +109,7 @@ xlat_channelizer::xlat_channelizer(double input_rate, int samples_per_symbol, do BOOST_LOG_TRIVIAL(error) << "Something is probably wrong! Resampling rate too low"; exit(1); } - + double def_excess_bw = 0.2; // Squelch DB // on a trunked network where you know you will have good signal, a carrier @@ -167,7 +164,6 @@ double xlat_channelizer::get_pwr() { } } - void xlat_channelizer::tune_offset(double f) { float freq = static_cast(f); diff --git a/trunk-recorder/recorders/analog_recorder.cc b/trunk-recorder/recorders/analog_recorder.cc index 5be8cb72f..2699c8f88 100644 --- a/trunk-recorder/recorders/analog_recorder.cc +++ b/trunk-recorder/recorders/analog_recorder.cc @@ -114,7 +114,7 @@ analog_recorder::analog_recorder(Source *src, Recorder_Type type, float tone_fre } int samp_per_sym = 2; - double bandwidth = 12000; + double bandwidth = 8000; system_channel_rate = 16000; // 4800 * samp_per_sym; wav_sample_rate = 16000; // Must be an integer decimation of system_channel_rate @@ -358,6 +358,7 @@ bool analog_recorder::start(Call *call) { // BOOST_LOG_TRIVIAL(error) << "Setting squelch to: " << squelch_db << " block says: " << squelch->threshold(); + levels->set_k(system->get_analog_levels()); int d_max_dev = system->get_max_dev(); /* @@ -365,7 +366,6 @@ bool analog_recorder::start(Call *call) { channel_lpf->set_taps(channel_lpf_taps);*/ 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); prefilter->tune_offset(offset_amount);