From a7a84e79655180093b5c89f0d3253093fe8311f9 Mon Sep 17 00:00:00 2001 From: Jan Date: Tue, 24 Jun 2025 20:49:38 +0200 Subject: [PATCH] some refinements --- dab-api.h | 1 + devices/airspy-handler/airspy-handler.h | 6 ++-- devices/extio-handler/common-readers.h | 4 +-- devices/extio-handler/extio-handler.h | 4 +-- devices/extio-handler/reader.h | 4 +-- devices/extio-handler/virtual-reader.h | 4 +-- devices/uhd/uhd-input.cpp | 27 +++++++-------- devices/uhd/uhd-input.h | 24 ++++++------- devices/xml-filereader-old/xml-descriptor.h | 4 +-- devices/xml-filereader-old/xml-filereader.h | 4 +-- devices/xml-filereader-old/xml-reader.h | 4 +-- devices/xml-filereader/xml-descriptor.h | 8 ++--- example-1/main.cpp | 1 + example-2/main.cpp | 38 ++++++++++++--------- example-2/tii-handling/tii-handler.cpp | 7 ++-- example-3/main.cpp | 1 + example-4/main.cpp | 1 + example-5/main.cpp | 1 + example-6/main.cpp | 1 + library/src/backend/audio/mp4processor.cpp | 2 +- library/src/backend/data/pad-handler.cpp | 3 +- library/src/dab-processor.cpp | 2 +- library/src/ofdm/tii-detector.cpp | 13 +++---- 23 files changed, 78 insertions(+), 86 deletions(-) diff --git a/dab-api.h b/dab-api.h index 4ba72cd..b198bd3 100644 --- a/dab-api.h +++ b/dab-api.h @@ -178,6 +178,7 @@ extern "C" { // typedef struct { uint8_t dabMode; + int16_t thresholdValue; syncsignal_t syncsignal_Handler; systemdata_t systemdata_Handler; name_of_ensemble_t name_of_ensemble; diff --git a/devices/airspy-handler/airspy-handler.h b/devices/airspy-handler/airspy-handler.h index 3af1aba..aaa656a 100644 --- a/devices/airspy-handler/airspy-handler.h +++ b/devices/airspy-handler/airspy-handler.h @@ -14,8 +14,7 @@ * jan van Katwijk * Lazy Chair Computing */ -#ifndef __AIRSPY_HANDLER__ -#define __AIRSPY_HANDLER__ +#pragma once #include "ringbuffer.h" #include "device-handler.h" @@ -151,7 +150,6 @@ static int callback(airspy_transfer_t *); int data_available (void *buf, int buf_size); const char * getSerial (void); - int open (void); + int open (void); }; -#endif diff --git a/devices/extio-handler/common-readers.h b/devices/extio-handler/common-readers.h index 5c0851c..c60c9f9 100644 --- a/devices/extio-handler/common-readers.h +++ b/devices/extio-handler/common-readers.h @@ -4,8 +4,7 @@ // different readers, with one "mother" reader. // Note that the cardreader is quite different here // and its code is elsewhere -#ifndef __COMMON_READERS -#define __COMMON_READERS +#pragma once #include "virtual-reader.h" @@ -49,5 +48,4 @@ private: int16_t convIndex; }; -#endif diff --git a/devices/extio-handler/extio-handler.h b/devices/extio-handler/extio-handler.h index ef8e64d..b881ecc 100644 --- a/devices/extio-handler/extio-handler.h +++ b/devices/extio-handler/extio-handler.h @@ -21,8 +21,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ -#ifndef __EXTIO_HANDLER_ -#define __EXTIO_HANDLER_ +#pragma once # #include #include @@ -229,5 +228,4 @@ private: signals: // The following signals originate from the Winrad Extio interface }; -#endif diff --git a/devices/extio-handler/reader.h b/devices/extio-handler/reader.h index 2509402..7be5f79 100644 --- a/devices/extio-handler/reader.h +++ b/devices/extio-handler/reader.h @@ -3,8 +3,7 @@ // For the different formats for input, we have // different readers, with one "mother" reader. // Note that the cardreader is quite different here -#ifndef __READER -#define __READER +#pragma once #include #include @@ -162,5 +161,4 @@ int16_t bitDepth (void) { } }; -#endif diff --git a/devices/extio-handler/virtual-reader.h b/devices/extio-handler/virtual-reader.h index b491f17..4108ac5 100644 --- a/devices/extio-handler/virtual-reader.h +++ b/devices/extio-handler/virtual-reader.h @@ -3,8 +3,7 @@ // For the different formats for input, we have // different readers, with one "mother" reader. // Note that the cardreader is quite different here -#ifndef __VIRTUAL_READER -#define __VIRTUAL_READER +#pragma once #include #include @@ -39,5 +38,4 @@ private: }; -#endif diff --git a/devices/uhd/uhd-input.cpp b/devices/uhd/uhd-input.cpp index fe9d89e..c5feb3a 100644 --- a/devices/uhd/uhd-input.cpp +++ b/devices/uhd/uhd-input.cpp @@ -3,23 +3,20 @@ * Copyright (C) 2015 * Sebastian Held * - * This file is part of the SDR-J. - * Many of the ideas as implemented in SDR-J are derived from - * other work, made available through the GNU general Public License. - * All copyrights of the original authors are recognized. + * This file is adapted for use with dab-cmdline * - * SDR-J is free software; you can redistribute it and/or modify + * dab-cmdline is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * SDR-J is distributed in the hope that it will be useful, + * dab-cmdline is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with SDR-J; if not, write to the Free Software + * along with dab-cmdline; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "uhd-input.h" @@ -59,7 +56,7 @@ void uhd_streamer::stop (void) { wait(1); } -void uhd_streamer::run (void) { +void uhd_streamer::run () { while (!m_stop_signal_called) { // get write position, ignore data2 and size2 int32_t size1, size2; @@ -153,7 +150,7 @@ void uhd_streamer::run (void) { *success = true; } - uhdInput::~uhdInput (void) { + uhdInput::~uhdInput () { if (theBuffer != NULL) { stopReader(); uhdSettings -> beginGroup ("uhdSettings"); @@ -181,7 +178,7 @@ int32_t freq = m_usrp -> get_rx_freq (); return freq; } -bool uhdInput::restartReader (void) { +bool uhdInput::restartReader () { if (m_workerHandle != 0) return true; @@ -201,7 +198,7 @@ void uhdInput::stopReader (void) { } // // not used: -uint8_t uhdInput::myIdentity (void) { +uint8_t uhdInput::myIdentity () { return DAB_STICK; } @@ -212,11 +209,11 @@ int32_t uhdInput::getSamples (DSPCOMPLEX *v, int32_t size) { return size; } -int32_t uhdInput::Samples (void) { +int32_t uhdInput::Samples () { return theBuffer -> GetRingBufferReadAvailable(); } -void uhdInput::resetBuffer (void) { +void uhdInput::resetBuffer () { theBuffer -> FlushRingBuffer(); } @@ -224,7 +221,7 @@ void uhdInput::set_fCorrection (int32_t f) { (void)f; } -int16_t uhdInput::maxGain (void) { +int16_t uhdInput::maxGain () { uhd::gain_range_t range = m_usrp->get_rx_gain_range(); return range.stop(); } @@ -240,7 +237,7 @@ void uhdInput::set_KhzOffset (int32_t o) { vfoOffset = o; } -int16_t uhdInput::bitDepth (void) { +int16_t uhdInput::bitDepth () { return 16; } diff --git a/devices/uhd/uhd-input.h b/devices/uhd/uhd-input.h index cfbc11b..0fc2752 100644 --- a/devices/uhd/uhd-input.h +++ b/devices/uhd/uhd-input.h @@ -22,8 +22,7 @@ * along with SDR-J; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef __UHDINPUT -#define __UHDINPUT +#pragma once #include "virtual-input.h" @@ -55,19 +54,19 @@ Q_OBJECT friend class uhd_streamer; public: uhdInput (QSettings *dabSettings, bool *success); -virtual ~uhdInput (void); +virtual ~uhdInput (); virtual void setVFOFrequency (int32_t freq); -virtual int32_t getVFOFrequency (void); +virtual int32_t getVFOFrequency (); bool legalFrequency (int32_t) {return true;} - int32_t defaultFrequency (void) {return 100000000;} -virtual bool restartReader (void); -virtual void stopReader (void); + int32_t defaultFrequency () {return 100000000;} +virtual bool restartReader (); +virtual void stopReader (); virtual int32_t getSamples (DSPCOMPLEX *, int32_t size); -virtual int32_t Samples (void); - uint8_t myIdentity (void); -virtual void resetBuffer (void); -virtual int16_t maxGain (void); - int16_t bitDepth (void); +virtual int32_t Samples (); + uint8_t myIdentity (); +virtual void resetBuffer (); +virtual int16_t maxGain (); + int16_t bitDepth (); // private: QSettings *uhdSettings; @@ -83,5 +82,4 @@ private slots: void set_fCorrection (int); void set_KhzOffset (int); }; -#endif diff --git a/devices/xml-filereader-old/xml-descriptor.h b/devices/xml-filereader-old/xml-descriptor.h index bc745d9..4e518c9 100644 --- a/devices/xml-filereader-old/xml-descriptor.h +++ b/devices/xml-filereader-old/xml-descriptor.h @@ -21,8 +21,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef __XML_DESCRIPTOR__ -#define __XML_DESCRIPTOR__ +#pragma once #include #include @@ -71,4 +70,3 @@ public: void add_modtoBlock (int blockno, std::string modType); }; -#endif diff --git a/devices/xml-filereader-old/xml-filereader.h b/devices/xml-filereader-old/xml-filereader.h index b359457..c60087a 100644 --- a/devices/xml-filereader-old/xml-filereader.h +++ b/devices/xml-filereader-old/xml-filereader.h @@ -20,8 +20,7 @@ * along with DAB library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef __XML_FILEREADER__ -#define __XML_FILEREADER__ +#pragma once #include #include @@ -54,5 +53,4 @@ private: xml_Reader *theReader; }; -#endif diff --git a/devices/xml-filereader-old/xml-reader.h b/devices/xml-filereader-old/xml-reader.h index 10d432a..70a3cb8 100644 --- a/devices/xml-filereader-old/xml-reader.h +++ b/devices/xml-filereader-old/xml-reader.h @@ -20,8 +20,7 @@ * along with eti-cmdline; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef __XML_READER__ -#define __XML_READER__ +#pragma once #include #include @@ -75,4 +74,3 @@ private: float mapTable_float [2048]; }; -#endif diff --git a/devices/xml-filereader/xml-descriptor.h b/devices/xml-filereader/xml-descriptor.h index a6b01b5..0fdc608 100644 --- a/devices/xml-filereader/xml-descriptor.h +++ b/devices/xml-filereader/xml-descriptor.h @@ -4,20 +4,20 @@ * Jan van Katwijk (J.vanKatwijk@gmail.com) * Lazy Chair Computing * - * This file is part of eti-cmdline + * This file is part of dab-cmdline * - * eti-cmdline is free software; you can redistribute it and/or modify + * dab-cmdline is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * eti-cmdline is distributed in the hope that it will be useful, + * dab-cmdline is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with eti-cmdline; if not, write to the Free Software + * along with dab-cmdline; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/example-1/main.cpp b/example-1/main.cpp index c02d025..1eb775c 100644 --- a/example-1/main.cpp +++ b/example-1/main.cpp @@ -300,6 +300,7 @@ deviceHandler *theDevice; // and with a sound device we now can create a "backend" API_struct interface; interface. dabMode = theMode; + interface. thresholdValue = 10; interface. syncsignal_Handler = syncsignalHandler; interface. systemdata_Handler = systemData; interface. ensemblename_Handler = ensemblename_Handler; diff --git a/example-2/main.cpp b/example-2/main.cpp index a6281cb..28f24ab 100644 --- a/example-2/main.cpp +++ b/example-2/main.cpp @@ -145,11 +145,11 @@ void serviceName (const std::string &s, int SId, static void programdata_Handler (audiodata *d, void *ctx) { (void)ctx; - std::cerr << "\tstartaddress\t= " << d -> startAddr << "\n"; - std::cerr << "\tlength\t\t= " << d -> length << "\n"; - std::cerr << "\tsubChId\t\t= " << d -> subchId << "\n"; - std::cerr << "\tprotection\t= " << d -> protLevel << "\n"; - std::cerr << "\tbitrate\t\t= " << d -> bitRate << "\n"; +// std::cerr << "\tstartaddress\t= " << d -> startAddr << "\n"; +// std::cerr << "\tlength\t\t= " << d -> length << "\n"; +// std::cerr << "\tsubChId\t\t= " << d -> subchId << "\n"; +// std::cerr << "\tprotection\t= " << d -> protLevel << "\n"; +// std::cerr << "\tbitrate\t\t= " << d -> bitRate << "\n"; } // @@ -263,59 +263,59 @@ uint8_t theBand = BAND_III; int lnaGain = 40; int vgaGain = 40; int ppmOffset = 0; -const char *optionsString = "D:d:M:B:P:O:A:C:G:g:p:"; +const char *optionsString = "t:T:D:d:M:B:P:O:A:C:G:g:p:"; #elif HAVE_LIME int16_t gain = 70; std::string antenna = "Auto"; -const char *optionsString = "T:D:d:M:B:P:O:A:C:G:g:X:"; +const char *optionsString = "t:T:D:d:M:B:P:O:A:C:G:g:X:"; #elif HAVE_PLUTO int16_t gain = 60; bool autogain = true; -const char *optionsString = "T:D:d:M:B:P:O:A:C:G:Q"; +const char *optionsString = "t:T:D:d:M:B:P:O:A:C:G:Q"; #elif HAVE_SDRPLAY int16_t GRdB = 30; int16_t lnaState = 4; bool autogain = true; int16_t ppmOffset = 0; bool X_dump = false; -const char *optionsString = "T:D:d:M:B:P:O:A:C:G:L:Qp:X"; +const char *optionsString = "t:T:D:d:M:B:P:O:A:C:G:L:Qp:X"; #elif HAVE_SDRPLAY_V3 int16_t GRdB = 30; int16_t lnaState = 3; bool autogain = false; int16_t ppmOffset = 0; -const char *optionsString = "T:D:d:M:B:P:O:A:C:G:L:Qp:X"; +const char *optionsString = "t:T:D:d:M:B:P:O:A:C:G:L:Qp:X"; bool X_dump = false; #elif HAVE_AIRSPY int16_t gain = 20; bool autogain = false; bool rf_bias = false; int16_t ppmOffset = 0; -const char *optionsString = "T:D:d:M:B:P:O:A:C:G:p:b"; +const char *optionsString = "t:T:D:d:M:B:P:O:A:C:G:p:b"; #elif HAVE_RTLSDR int16_t gain = 50; bool autogain = false; int16_t ppmOffset = 0; -const char *optionsString = "T:D:d:M:B:P:O:A:C:G:p:Q"; +const char *optionsString = "t:T:D:d:M:B:P:O:A:C:G:p:Q"; #elif HAVE_WAVFILES std::string fileName; bool repeater = true; -const char *optionsString = "T:D:d:M:B:P:O:A:F:R:"; +const char *optionsString = "t:T:D:d:M:B:P:O:A:F:R:"; #elif HAVE_RAWFILES std::string fileName; bool repeater = true; -const char *optionsString = "T:D:d:M:B:P:O:A:F:R:"; +const char *optionsString = "t:T:D:d:M:B:P:O:A:F:R:"; #elif HAVE_XMLFILES std::string fileName; bool repeater = true; -const char *optionsString = "T:D:d:M:B:P:O:A:F:R:"; +const char *optionsString = "t:T:D:d:M:B:P:O:A:F:R:"; #elif HAVE_RTL_TCP int gain = 50; bool autogain = false; int ppmOffset = 0; std::string hostname = "127.0.0.1"; // default int32_t basePort = 1234; // default -const char *optionsString = "T:D:d:M:B:P:O:A:C:G:Qp:H:I"; +const char *optionsString = "t:T:D:d:M:B:P:O:A:C:G:Qp:H:I"; #endif std::string soundChannel = "default"; int16_t latency = 10; @@ -325,7 +325,7 @@ int opt; struct sigaction sigact; bandHandler dabBand; deviceHandler *theDevice = nullptr; - +int16_t thresholdValue = 6; // default; bool err; int theDuration = -1; // no limit //tiiHandler the_tiiHandler; @@ -345,6 +345,9 @@ int theDuration = -1; // no limit fprintf (stderr, "options are %s\n", optionsString); while ((opt = getopt (argc, argv, optionsString)) != -1) { switch (opt) { + case 't': + thresholdValue = atoi (optarg); + break; case 'T': theDuration = 60 * atoi (optarg); // minutes break; @@ -649,6 +652,7 @@ int theDuration = -1; // no limit // and with a sound device we now can create a "backend" API_struct interface; interface. dabMode = theMode; + interface. thresholdValue = thresholdValue; interface. syncsignal_Handler = syncsignalHandler; interface. systemdata_Handler = systemData; interface. name_of_ensemble = name_of_ensemble; diff --git a/example-2/tii-handling/tii-handler.cpp b/example-2/tii-handling/tii-handler.cpp index a8426b3..94d0146 100644 --- a/example-2/tii-handling/tii-handler.cpp +++ b/example-2/tii-handling/tii-handler.cpp @@ -45,7 +45,7 @@ void tiiHandler::run () { if (known (xx)) continue; if ((xx. ecc == 0) || (xx. EId == 0)) { - fprintf (stderr, "No further data: %d %d \n", + fprintf (stderr, "No further data available to decode: %d %d \n", xx. mainId, xx. subId); tiiTable. push_back (xx); @@ -60,13 +60,14 @@ void tiiHandler::run () { cacheElement *handle = lookup (xx); // in tii database if (handle == nullptr) - fprintf (stderr, "not found %X %d %d\n", + fprintf (stderr, "not found in database %X %d %d\n", xx. EId, xx. mainId, xx. subId); else - fprintf (stderr, " %X %d %d -> %s %s %s %s %f %f (%d %d %d\n", + fprintf (stderr, " %X %d %d\t-> %f %s %s %s %s %f %f (%d %d %d)\n", handle -> Eid, handle -> mainId, handle -> subId, + xx. strength, handle -> country. c_str (), handle -> channel. c_str (), handle -> ensemble. c_str (), diff --git a/example-3/main.cpp b/example-3/main.cpp index 5e06471..9453d0c 100644 --- a/example-3/main.cpp +++ b/example-3/main.cpp @@ -567,6 +567,7 @@ deviceHandler *theDevice; // and with a sound device we now can create a "backend" API_struct interface; interface. dabMode = theMode; + interface. thresholdValue = 6; interface. syncsignal_Handler = syncsignal_Handler; interface. systemdata_Handler = systemData; interface. name_of_ensemble = name_of_ensemble; diff --git a/example-4/main.cpp b/example-4/main.cpp index 5684c88..1733861 100644 --- a/example-4/main.cpp +++ b/example-4/main.cpp @@ -490,6 +490,7 @@ int theDuration = -1; // infinite // and with a sound device we now can create a "backend" API_struct interface; interface. dabMode = theMode; + interface. thresholdValue = 6; interface. syncsignal_Handler = syncsignal_Handler; interface. systemdata_Handler = systemData; interface. name_of_ensemble = name_of_ensemble; diff --git a/example-5/main.cpp b/example-5/main.cpp index 203c966..2223ae2 100644 --- a/example-5/main.cpp +++ b/example-5/main.cpp @@ -463,6 +463,7 @@ bool err; // and with a sound device we can create a "backend" API_struct interface; interface. dabMode = theMode; + interface. thresholdValue = 6; interface. syncsignal_Handler = syncsignal_Handler; interface. systemdata_Handler = systemData; interface. name_of_ensemble = name_of_ensemble; diff --git a/example-6/main.cpp b/example-6/main.cpp index 6098a70..fcbc185 100644 --- a/example-6/main.cpp +++ b/example-6/main.cpp @@ -297,6 +297,7 @@ bool err; // and with a sound device we now can create a "backend" API_struct interface; interface. dabMode = theMode; + interface. thresholdValue = 6; interface. syncsignal_Handler = syncsignalHandler; interface. systemdata_Handler = systemData; interface. name_of_ensemble = name_of_ensemble; diff --git a/library/src/backend/audio/mp4processor.cpp b/library/src/backend/audio/mp4processor.cpp index a08dbfa..602c65c 100644 --- a/library/src/backend/audio/mp4processor.cpp +++ b/library/src/backend/audio/mp4processor.cpp @@ -349,7 +349,7 @@ stream_parms streamParameters; #endif } else { - fprintf (stderr, "CRC failure with dab+ frame should not happen\n"); +// fprintf (stderr, "CRC failure with dab+ frame should not happen\n"); } } return true; diff --git a/library/src/backend/data/pad-handler.cpp b/library/src/backend/data/pad-handler.cpp index bf48489..813a711 100644 --- a/library/src/backend/data/pad-handler.cpp +++ b/library/src/backend/data/pad-handler.cpp @@ -383,7 +383,8 @@ void padHandler::build_MSC_segment (std::vector data) { int32_t size = (int)(data. size ()) < dataGroupLength ? data. size () : dataGroupLength; - + if (size <= 2) + return; uint8_t groupType = data [0] & 0xF; uint8_t continuityIndex = (data [1] & 0xF) >> 4; uint8_t repetitionIndex = data [1] & 0xF; diff --git a/library/src/dab-processor.cpp b/library/src/dab-processor.cpp index 2eb1fc2..8be73fd 100644 --- a/library/src/dab-processor.cpp +++ b/library/src/dab-processor.cpp @@ -66,7 +66,7 @@ this -> carriers = params. get_carriers (); this -> carrierDiff = params. get_carrierDiff (); this -> tii_counter = 0; - this -> threshold = 6; + this -> threshold = p -> thresholdValue; isSynced = false; snr = 0; running. store (false); diff --git a/library/src/ofdm/tii-detector.cpp b/library/src/ofdm/tii-detector.cpp index 0949743..5d6aec3 100644 --- a/library/src/ofdm/tii-detector.cpp +++ b/library/src/ofdm/tii-detector.cpp @@ -19,6 +19,10 @@ * You should have received a copy of the GNU General Public License * along with DAB library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * This implementation of the TII decoder is a modified version + * of the TII decoder used in Qt-DAB, which is itself derived + * from the TII decoder is DABstar and was developed by Rolf Zerr */ #include "tii-detector.h" @@ -109,7 +113,7 @@ uint8_t patternTable [] = { 0360 // 1 1 1 1 0 0 0 0 69 }; - TII_Detector::TII_Detector (uint8_t dabMode): + TII_Detector::TII_Detector (uint8_t dabMode): params (dabMode), theTable (dabMode), T_u (params. get_T_u ()), @@ -154,7 +158,7 @@ void TII_Detector::addBuffer (const std::vector &v) { Complex tmpBuffer [T_u]; for (int i = 0; i < T_u; i ++) - tmpBuffer [i] = v [T_g + i]; + tmpBuffer [i] = v [T_g + i] * window [i]; my_fftHandler. fft (tmpBuffer); for (int i = 0; i < T_u; i ++) nullSymbolBuffer [i] += tmpBuffer [i]; @@ -214,10 +218,7 @@ int fcmp (const void *a, const void *b) { if (element1 -> strength > element2 -> strength) return -1; else - if (element1 -> strength < element2 -> strength) - return 1; - else - return 0; + return (element1 -> strength < element2 -> strength) ? 1 : 0; } std::vector TII_Detector::processNULL (int16_t threshold_db) {