Small FM squelch simplification.

This commit is contained in:
Jared Boone 2015-12-31 10:08:41 -08:00
parent 0962343190
commit ef37bbd851
2 changed files with 2 additions and 2 deletions

View File

@ -41,5 +41,5 @@ bool FMSquelch::execute(buffer_s16_t audio) {
} }
} }
return (max_squared < (threshold * threshold)); return (max_squared < threshold_squared);
} }

View File

@ -35,7 +35,7 @@ public:
private: private:
static constexpr size_t N = 32; static constexpr size_t N = 32;
static constexpr int16_t threshold = 3072; static constexpr uint32_t threshold_squared = 8192 * 8192;
IIRBiquadFilter non_audio_hpf { non_audio_hpf_config }; IIRBiquadFilter non_audio_hpf { non_audio_hpf_config };
}; };