Relax the A/C quiet threshold; this seems to pick up a lot more A/C messages.
This commit is contained in:
parent
1e5a6fd854
commit
a06b13d42a
|
@ -528,6 +528,7 @@ void demodulate2400AC(struct mag_buf *mag)
|
||||||
// ----- X1/X2/X3 average noise
|
// ----- X1/X2/X3 average noise
|
||||||
|
|
||||||
float midpoint = sqrtf(x1x2x3_noise * f1f2_signal); // so that signal/midpoint == midpoint/noise
|
float midpoint = sqrtf(x1x2x3_noise * f1f2_signal); // so that signal/midpoint == midpoint/noise
|
||||||
|
unsigned quiet_threshold = (unsigned) midpoint;
|
||||||
unsigned noise_threshold = (unsigned) (midpoint * 0.707107 + 0.5); // -3dB from midpoint
|
unsigned noise_threshold = (unsigned) (midpoint * 0.707107 + 0.5); // -3dB from midpoint
|
||||||
unsigned signal_threshold = (unsigned) (midpoint * 1.414214 + 0.5); // +3dB from midpoint
|
unsigned signal_threshold = (unsigned) (midpoint * 1.414214 + 0.5); // +3dB from midpoint
|
||||||
|
|
||||||
|
@ -563,8 +564,8 @@ void demodulate2400AC(struct mag_buf *mag)
|
||||||
noisy_bits <<= 1;
|
noisy_bits <<= 1;
|
||||||
|
|
||||||
// check for excessive noise in the quiet period
|
// check for excessive noise in the quiet period
|
||||||
if (m[sample+2] >= noise_threshold) {
|
if (m[sample+2] >= quiet_threshold) {
|
||||||
//fprintf(stderr, "bit %u was not quiet (%u > %u)\n", bit, m[sample+2], signal_threshold);
|
//fprintf(stderr, "bit %u was not quiet (%u > %u)\n", bit, m[sample+2], quiet_threshold);
|
||||||
noisy_bits |= 1;
|
noisy_bits |= 1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue