adding various improvements to the experience

This commit is contained in:
Joren de Graaf
2026-10-10 00:34:14 +02:00
parent 9ec360d736
commit 7f5ef0b61b
9 changed files with 250 additions and 71 deletions
+20
View File
@@ -0,0 +1,20 @@
#include "../BoomCast_Waveshare_Arduino/boomcast_detector.h"
#include <cstdio>
#include <cstdint>
int main() {
BoomDetector detector(16000, 533, 32000, 16000, 48000,
0.01f, 0.02f, 2.0f, 0.075f, 5.0f, 0.16f);
int16_t sample;
uint64_t frame = 0;
while (std::fread(&sample, sizeof(sample), 1, stdin) == 1) {
++frame;
auto result = detector.process(float(sample) / 32768.0f);
if (result == BoomDetector::Result::Trigger) std::printf("T %llu\n", (unsigned long long)frame);
if (result == BoomDetector::Result::TailDone) {
std::printf("E %llu\n", (unsigned long long)frame);
detector.reset();
}
}
std::printf("B %.8f\n", detector.baseline());
}