mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-07-31 18:49:15 -04:00
Add second pocsag proc for experimenting (#1428)
This commit is contained in:
parent
900086c1c9
commit
5d602ece5c
10 changed files with 820 additions and 30 deletions
|
@ -36,6 +36,7 @@ bool FMSquelch::execute(const buffer_f32_t& audio) {
|
|||
squelch_energy_buffer.size()};
|
||||
non_audio_hpf.execute(audio, squelch_energy);
|
||||
|
||||
// "Non-audio" implies "noise" here. Find the loudest noise sample.
|
||||
float non_audio_max_squared = 0;
|
||||
for (const auto sample : squelch_energy_buffer) {
|
||||
const float sample_squared = sample * sample;
|
||||
|
@ -44,9 +45,14 @@ bool FMSquelch::execute(const buffer_f32_t& audio) {
|
|||
}
|
||||
}
|
||||
|
||||
// Is the noise less than the threshold?
|
||||
return (non_audio_max_squared < threshold_squared);
|
||||
}
|
||||
|
||||
void FMSquelch::set_threshold(const float new_value) {
|
||||
threshold_squared = new_value * new_value;
|
||||
}
|
||||
|
||||
bool FMSquelch::enabled() const {
|
||||
return threshold_squared > 0.0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue