Python 3 fixes for qa_testsuite.py

Minor changes to fine_sync
dev
Pieter Robyns 2019-09-09 16:37:12 +02:00
rodzic da8c067a90
commit a94b204fee
9 zmienionych plików z 27 dodań i 14 usunięć

Wyświetl plik

@ -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

Wyświetl plik

@ -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

Wyświetl plik

@ -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

Wyświetl plik

@ -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

Wyświetl plik

@ -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

Wyświetl plik

@ -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

Wyświetl plik

@ -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++;
}

Wyświetl plik

@ -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.

Wyświetl plik

@ -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)