From c4ed09cfbb4ef4f4261f2a47aa4d6c0cd2e7cd48 Mon Sep 17 00:00:00 2001 From: Zilog80 Date: Wed, 13 Feb 2019 03:31:23 +0100 Subject: [PATCH] minor bug fixes --- demod/demod_iq.c | 2 +- demod/m10dm_dft.c | 4 ++-- demod/rs41dm_iq.c | 6 +++--- scan/dft_detect.c | 8 +++----- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/demod/demod_iq.c b/demod/demod_iq.c index c631f6b..5c8a4b7 100644 --- a/demod/demod_iq.c +++ b/demod/demod_iq.c @@ -775,7 +775,7 @@ int init_buffers(char hdr[], int hLen, float BT, int opt_iq) { b += b0*pulse(t+1, sigma); } - if (pos < hLen) { + if (pos < hLen-1) { b2 = ((hdr[pos+1] & 0x1) - 0.5)*2.0; b += b2*pulse(t-1, sigma); } diff --git a/demod/m10dm_dft.c b/demod/m10dm_dft.c index 039449d..d513efa 100644 --- a/demod/m10dm_dft.c +++ b/demod/m10dm_dft.c @@ -906,8 +906,8 @@ int main(int argc, char **argv) { herrs = headcmp(1, rawheader, headerlen, mv_pos, mv<0, option_dc); // header nicht manchester! herr1 = 0; if (herrs <= 3 && herrs > 0) { - herr1 = headcmp(1, rawheader, headerlen, mv_pos+1, mv<0, option_dc); - //int herr2 = headcmp(1, rawheader, headerlen, mv_pos-1, mv<0, option_dc); + herr1 = headcmp(1, rawheader, headerlen, mv_pos+1, mv<0, 0); // nur 1x dc + //int herr2 = headcmp(1, rawheader, headerlen, mv_pos-1, mv<0, 0); if (herr1 < herrs) { herrs = herr1; herr1 = 1; diff --git a/demod/rs41dm_iq.c b/demod/rs41dm_iq.c index f232dfc..8c23fe4 100644 --- a/demod/rs41dm_iq.c +++ b/demod/rs41dm_iq.c @@ -1334,11 +1334,11 @@ int main(int argc, char *argv[]) { ft_len = frmlen; while ( byte_count < frmlen ) { - if (option_iq) { - bitQ = read_IDsbit(fp, symlen, &bit, option_inv, bitofs, bit_count==0, 0); // symlen=1, return: zeroX/bit + if (option_iq >= 2) { + bitQ = read_IDsbit(fp, symlen, &bit, option_inv, bitofs, bit_count==0, 0); // symlen=1 } else { - bitQ = read_sbit(fp, symlen, &bit, option_inv, bitofs, bit_count==0, 0); // symlen=1, return: zeroX/bit + bitQ = read_sbit(fp, symlen, &bit, option_inv, bitofs, bit_count==0, 0); // symlen=1 } if ( bitQ == EOF) break; bit_count += 1; diff --git a/scan/dft_detect.c b/scan/dft_detect.c index 5c681ba..cbc1e0a 100644 --- a/scan/dft_detect.c +++ b/scan/dft_detect.c @@ -594,7 +594,7 @@ static int init_buffers() { b += b0*pulse(t+1, sigma); } - if (pos < hLen) { + if (pos < hLen-1) { b2 = ((bits[pos+1] & 0x1) - 0.5)*2.0; b += b2*pulse(t-1, sigma); } @@ -682,9 +682,7 @@ int main(int argc, char **argv) { else if ( (strcmp(*argv, "-v") == 0) || (strcmp(*argv, "--verbose") == 0) ) { option_verbose = 1; } - else if ( (strcmp(*argv, "--dc") == 0) ) { - option_dc = 1; - } + //else if ( (strcmp(*argv, "--dc") == 0) ) { option_dc = 1; } else if ( (strcmp(*argv, "-s") == 0) || (strcmp(*argv, "--silent") == 0) ) { option_silent = 1; } @@ -754,7 +752,7 @@ int main(int argc, char **argv) { if (mp[j] > 0 && (mv[j] > rs_hdr[j].thres || mv[j] < -rs_hdr[j].thres)) { if (mv_pos[j] > mv0_pos[j]) { - herrs = headcmp(1, rs_hdr[j].header, rs_hdr[j].hLen, mv_pos[j], mv[j]<0, option_dc, rs_hdr[j].spb); + herrs = headcmp(1, rs_hdr[j].header, rs_hdr[j].hLen, mv_pos[j], mv[j]<0, 0, rs_hdr[j].spb); if (herrs < 2) { // max 1 bitfehler in header if ( strncmp(rs_hdr[j].type, "IMET", 4) == 0 )