Skip to content

Commit

Permalink
signal detector auto-threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
robotastic committed Feb 10, 2024
1 parent b7b4e30 commit e3e0b5d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions trunk-recorder/gr_blocks/decoders/tps_decoder_sink_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@ void tps_decoder_sink_impl::process_message(gr::message::sptr msg) {

std::string s = msg->to_string();

if (s.length() < 2) {
BOOST_LOG_TRIVIAL(error) << "P25 Parse error, s: " << s << " Len: " << s.length();
//messages.push_back(message);
return;
}

// # nac is always 1st two bytes
// ac = (ord(s[0]) << 8) + ord(s[1])
uint8_t s0 = (int)s[0];
Expand Down
3 changes: 2 additions & 1 deletion trunk-recorder/gr_blocks/signal_detector_cvf_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ signal_detector_cvf_impl::signal_detector_cvf_impl(double samp_rate,
#endif
d_threshold = threshold;
d_sensitivity = sensitivity;
d_auto_threshold = auto_threshold;
d_auto_threshold = true; //auto_threshold;
d_average = average;
d_quantization = quantization;
d_min_bw = min_bw;
Expand Down Expand Up @@ -220,6 +220,7 @@ void signal_detector_cvf_impl::build_threshold() {
// search specified normized jump
for (unsigned int i = 0; i < d_fft_len; i++) {
if ((d_tmp_pxx[i + 1] - d_tmp_pxx[i]) / range > 1 - d_sensitivity) {

d_threshold = d_tmp_pxx[i];
break;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk-recorder/systems/p25_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@ std::vector<TrunkMessage> P25Parser::parse_message(gr::message::sptr msg, System

if (s.length() < 2) {
BOOST_LOG_TRIVIAL(error) << "P25 Parse error, s: " << s << " Len: " << s.length();
messages.push_back(message);
//messages.push_back(message);
return messages;
}

Expand Down

0 comments on commit e3e0b5d

Please sign in to comment.