Fix preamble quiet-bits check.

This commit is contained in:
Oliver Jowett 2014-09-26 22:47:56 +01:00
parent 5c8e6198b7
commit 17f73cc01a

View file

@ -2071,12 +2071,12 @@ void detectModeS_oversample(uint16_t *m, uint32_t mlen) {
preamble[1] > preamble[2] && preamble[1] > preamble[2] &&
preamble[12] > preamble[11] && preamble[12] > preamble[11] &&
preamble[12] > preamble[13]) { preamble[12] > preamble[13]) {
high = (preamble[1] + preamble[13]) / 2; high = (preamble[1] + preamble[12]) / 2;
} else if (preamble[3] > preamble[2] && } else if (preamble[3] > preamble[2] &&
preamble[3] > preamble[4] && preamble[3] > preamble[4] &&
preamble[9] > preamble[8] && preamble[9] > preamble[8] &&
preamble[9] > preamble[10]) { preamble[9] > preamble[10]) {
high = (preamble[1] + preamble[9]) / 2; high = (preamble[3] + preamble[9]) / 2;
} else { } else {
// No peaks // No peaks
continue; continue;
@ -2086,6 +2086,7 @@ void detectModeS_oversample(uint16_t *m, uint32_t mlen) {
// of the high spikes level. We don't test bits too near to // of the high spikes level. We don't test bits too near to
// the high levels as signals can be out of phase so part of the // the high levels as signals can be out of phase so part of the
// energy can be in the near samples // energy can be in the near samples
if (preamble[5] >= high || if (preamble[5] >= high ||
preamble[6] >= high || preamble[6] >= high ||
preamble[7] >= high || preamble[7] >= high ||