performance improvements + oscilloscope

This commit is contained in:
Boof2015
2026-06-18 15:52:48 -04:00
parent 5853edd933
commit 9fd37c93d7
14 changed files with 907 additions and 236 deletions
+8
View File
@@ -1,6 +1,7 @@
#pragma once
#include "dsp_utils.h"
#include <memory>
#include <vector>
#include <cstdint>
@@ -41,6 +42,7 @@ public:
// Get samples with sub-sample interpolation (preserves trigger precision)
void getSamplesInterpolated(float* output, float startPos, size_t count) const;
void getSamplesInterpolated(float* output, float startPos, size_t count, float step) const;
// Reset state
void reset();
@@ -76,10 +78,16 @@ private:
float lastTrigger_;
float smoothedPitch_;
int pitchSamplesProcessed_; // Track samples for adaptive smoothing
std::vector<float> pitchAnalysisBuffer_;
std::vector<float> pitchWindowedBuffer_;
std::vector<float> pitchMagnitudes_;
std::unique_ptr<DSP::FFT> pitchFft_;
// Internal helpers
void updateFiltered();
float findTriggerBackwards(size_t target, size_t range);
float sampleInterpolated(float pos) const;
float detectPitchFFTReused(const float* data, size_t length, float minFreq, float maxFreq);
};
} // namespace Visualizer