mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-23 07:27:41 +00:00
Rename squelch algorithm variable for clarity.
Helps to understand meaning of threshold.
This commit is contained in:
@@ -33,15 +33,15 @@ bool FMSquelch::execute(const buffer_s16_t& audio) {
|
|||||||
};
|
};
|
||||||
non_audio_hpf.execute(audio, squelch_energy);
|
non_audio_hpf.execute(audio, squelch_energy);
|
||||||
|
|
||||||
uint32_t max_squared = 0;
|
uint32_t non_audio_max_squared = 0;
|
||||||
for(const auto sample : squelch_energy_buffer) {
|
for(const auto sample : squelch_energy_buffer) {
|
||||||
const uint32_t sample_squared = sample * sample;
|
const uint32_t sample_squared = sample * sample;
|
||||||
if( sample_squared > max_squared ) {
|
if( sample_squared > non_audio_max_squared ) {
|
||||||
max_squared = sample_squared;
|
non_audio_max_squared = sample_squared;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (max_squared < threshold_squared);
|
return (non_audio_max_squared < threshold_squared);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FMSquelch::set_threshold(const uint32_t new_value) {
|
void FMSquelch::set_threshold(const uint32_t new_value) {
|
||||||
|
Reference in New Issue
Block a user