Update on AF Method B detector

This commit is contained in:
Sjef Verhoeven PE5PVB
2023-11-23 19:29:04 +01:00
parent 8b8c673b96
commit cb3edeb9d0
2 changed files with 6 additions and 2 deletions

View File

@@ -634,6 +634,7 @@ void TEF6686::readRDS(byte showrdserrors)
afmethodBprobe = true;
af_updatecounter++;
af_counterb = (rds.rdsC >> 8) - 224;
af_number = (rds.rdsC >> 8) - 224;
af_counterbcheck = 1;
doublecounter = 0;
doubletestfreq = (rds.rdsC & 0xFF) * 10 + 8750;
@@ -641,6 +642,7 @@ void TEF6686::readRDS(byte showrdserrors)
afmethodBprobe = false;
afmethodBtrigger = true;
af_counterb = 0;
af_number = (rds.rdsC >> 8) - 224;
af_counterbcheck = 0;
doublecounter = 0;
doubletestfreq = (rds.rdsC & 0xFF) * 10 + 8750;
@@ -658,7 +660,7 @@ void TEF6686::readRDS(byte showrdserrors)
if ((rds.rdsC & 0xFF) > 0 && (rds.rdsC & 0xFF) < 205) buffer1 = (rds.rdsC & 0xFF) * 10 + 8750; else buffer1 = 0;
if (((rds.rdsC >> 8) > 0 && (rds.rdsC >> 8) < 205) && (buffer0 == doubletestfreq || buffer1 == doubletestfreq)) doublecounter++;
if (doublecounter > 1) afmethodB = true; // If signed frequency also appears more than once in the AF list, AF Method B detected
if (doublecounter > (af_number / 2 - 2)) afmethodB = true; // If signed frequency also appears more than once in the AF list, AF Method B detected
if (afmethodBprobe && af_counterbcheck > af_counterb) afmethodBprobe = false; // If more than counter received disable probe flag
@@ -1617,6 +1619,7 @@ void TEF6686::clearRDS (bool fullsearchrds) {
afmethodBprobe = false;
afmethodBtrigger = false;
correctPIold = 0;
af_number = 0;
}
void TEF6686::tone(uint16_t time, int16_t amplitude, uint16_t frequency) {
@@ -1835,4 +1838,4 @@ void TEF6686::RDScharConverter(const char* input, wchar_t* output, size_t size,
}
}
output[size - 1] = L'\0';
}
}