chg: removed unneeded loop

This commit is contained in:
iceman1001 2017-11-06 15:28:44 +01:00
commit 609008b3ad

View file

@ -157,20 +157,12 @@ bool justNoise(uint8_t *bits, uint32_t size) {
//get high and low values of a wave with passed in fuzz factor. also return noise test = 1 for passed or 0 for only noise //get high and low values of a wave with passed in fuzz factor. also return noise test = 1 for passed or 0 for only noise
int getHiLo(uint8_t *bits, size_t size, int *high, int *low, uint8_t fuzzHi, uint8_t fuzzLo) { int getHiLo(uint8_t *bits, size_t size, int *high, int *low, uint8_t fuzzHi, uint8_t fuzzLo) {
*high = 0; *low = 255;
// get high and low thresholds
for (size_t i=0; i < size; i++){
if (bits[i] > *high) *high = bits[i];
if (bits[i] < *low) *low = bits[i];
}
// just noise - no super good detection. good enough // just noise - no super good detection. good enough
if (*high < FSK_PSK_THRESHOLD) return -1; if (signalprop.isnoise) return -1;
// add fuzz. // add fuzz.
*high = ((*high-128)*fuzzHi + 12800)/100; *high = ((signalprop.high - 128) * fuzzHi + 12800)/100;
*low = ((*low-128)*fuzzLo + 12800)/100; *low = ((signalprop.low - 128) * fuzzLo + 12800)/100;
return 1; return 1;
} }