mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-16 02:10:53 -04:00
Rename squelch algorithm variable for clarity.
Helps to understand meaning of threshold.
This commit is contained in:
parent
6f00687d88
commit
01df79641c
1 changed files with 4 additions and 4 deletions
|
@ -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) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue