diff --git a/docs/test-results/decode_long_hackrf.md b/docs/test-results/decode_long_hackrf.md index 0867c10..ad735dd 100644 --- a/docs/test-results/decode_long_hackrf.md +++ b/docs/test-results/decode_long_hackrf.md @@ -1,6 +1,6 @@ # Test suite: 'decode_long_hackrf' -*Results on 2018-09-19 08:19:32.706097* +*Results on 2019-09-09 14:50:53.547746* ### 868.1 MHz, SF 7, CR 4/8, BW 125 kHz, prlen 8, crc on, implicit off diff --git a/docs/test-results/decode_long_rtl-sdr.md b/docs/test-results/decode_long_rtl-sdr.md index 44bf1c5..7de96ff 100644 --- a/docs/test-results/decode_long_rtl-sdr.md +++ b/docs/test-results/decode_long_rtl-sdr.md @@ -1,6 +1,6 @@ # Test suite: 'decode_long_rtl-sdr' -*Results on 2018-09-19 08:14:12.438859* +*Results on 2019-09-09 14:45:56.048459* ### 868.1 MHz, SF 7, CR 4/8, BW 125 kHz, prlen 8, crc on, implicit off diff --git a/docs/test-results/decode_long_usrp.md b/docs/test-results/decode_long_usrp.md index c18646a..9f8458e 100644 --- a/docs/test-results/decode_long_usrp.md +++ b/docs/test-results/decode_long_usrp.md @@ -1,6 +1,6 @@ # Test suite: 'decode_long_usrp' -*Results on 2018-09-19 08:14:49.104803* +*Results on 2019-09-09 14:46:31.050216* ### 868.1 MHz, SF 7, CR 4/8, BW 125 kHz, prlen 8, crc on, implicit off diff --git a/docs/test-results/short_hackrf.md b/docs/test-results/short_hackrf.md index 86edff4..47bf2ec 100644 --- a/docs/test-results/short_hackrf.md +++ b/docs/test-results/short_hackrf.md @@ -1,6 +1,6 @@ # Test suite: 'short_hackrf' -*Results on 2018-09-19 08:20:10.113700* +*Results on 2019-09-09 14:51:29.403736* ### 868.1 MHz, SF 7, CR 4/8, BW 125 kHz, prlen 8, crc on, implicit off diff --git a/docs/test-results/short_rtl-sdr.md b/docs/test-results/short_rtl-sdr.md index 21f0c8c..da32db8 100644 --- a/docs/test-results/short_rtl-sdr.md +++ b/docs/test-results/short_rtl-sdr.md @@ -1,6 +1,6 @@ # Test suite: 'short_rtl-sdr' -*Results on 2018-09-19 08:15:28.543396* +*Results on 2019-09-09 14:47:08.831264* ### 868.1 MHz, SF 7, CR 4/8, BW 125 kHz, prlen 8, crc on, implicit off diff --git a/docs/test-results/short_usrp.md b/docs/test-results/short_usrp.md index b0c6384..a8ebbb4 100644 --- a/docs/test-results/short_usrp.md +++ b/docs/test-results/short_usrp.md @@ -1,6 +1,6 @@ # Test suite: 'short_usrp' -*Results on 2018-09-19 08:09:35.773549* +*Results on 2019-09-09 14:41:38.747501* ### 868.1 MHz, SF 7, CR 4/8, BW 125 kHz, prlen 8, crc on, implicit off diff --git a/lib/decoder_impl.cc b/lib/decoder_impl.cc index 0cf90a2..264e715 100644 --- a/lib/decoder_impl.cc +++ b/lib/decoder_impl.cc @@ -297,7 +297,7 @@ namespace gr { return result; } - void decoder_impl::fine_sync(const gr_complex* in_samples, uint32_t bin_idx, int32_t search_space) { + void decoder_impl::fine_sync(const gr_complex* in_samples, int32_t bin_idx, int32_t search_space) { int32_t shift_ref = (bin_idx+1) * d_decim_factor; float samples_ifreq[d_samples_per_symbol]; float max_correlation = 0.0f; @@ -315,14 +315,26 @@ namespace gr { } #ifdef GRLORA_DEBUG - //d_debug << "FINE: " << -lag << std::endl; + d_debug << "LAG : " << lag << std::endl; #endif d_fine_sync = -lag; - //if(abs(d_fine_sync) >= d_decim_factor / 2) - // d_fine_sync = 0; + // Soft limit impact of correction + /* + if(lag > 0) + d_fine_sync = std::min(-lag / 2, -1); + else if(lag < 0) + d_fine_sync = std::max(-lag / 2, 1);*/ + + // Hard limit impact of correction + /*if(abs(d_fine_sync) >= d_decim_factor / 2) + d_fine_sync = 0;*/ + //d_fine_sync = 0; + #ifdef GRLORA_DEBUG + d_debug << "FINE: " << d_fine_sync << std::endl; + #endif } float decoder_impl::detect_preamble_autocorr(const gr_complex *samples, const uint32_t window) { @@ -794,7 +806,8 @@ namespace gr { d_state = gr::lora::DecoderState::PAUSE; } else { if(c < -0.97f) { - fine_sync(input, d_number_of_bins-1, d_decim_factor * 4); + // TODO: Check d_upchirp_ifreq_v: bin -1 gives different result compared to bin d_number_of_bins-1, which shouldn't be the case. + fine_sync(input, -1, d_decim_factor * 4); } else { d_corr_fails++; } diff --git a/lib/decoder_impl.h b/lib/decoder_impl.h index 28febcf..68a043f 100644 --- a/lib/decoder_impl.h +++ b/lib/decoder_impl.h @@ -135,7 +135,7 @@ namespace gr { /** * \brief TODO */ - void fine_sync(const gr_complex* in_samples, uint32_t bin_idx, int32_t search_space); + void fine_sync(const gr_complex* in_samples, int32_t bin_idx, int32_t search_space); /** * \brief Schmidl-Cox autocorrelation approach for approximately detecting the preamble. diff --git a/python/qa_testsuite.py b/python/qa_testsuite.py index 79f48a0..e413f4c 100755 --- a/python/qa_testsuite.py +++ b/python/qa_testsuite.py @@ -27,9 +27,9 @@ def signal_handler(signal, frame): def trunc(target, max_len=30): result = "" if len(target) > max_len: - result += target[0:max_len/2-1] + result += target[0:int(max_len/2)-1] result += ".." - result += target[-max_len/2+1:] + result += target[-int(max_len/2)+1:] else: result = target assert(len(result) <= max_len)