#pragma once #include #include #include struct Peak { size_t bin; float freq; float magnitude; float reduction; }; class Detector { public: Detector(); void setParams(float sharpness, float selectivity, float depth); size_t detectPeaks(const std::complex* spectrum, size_t n, float sample_rate, Peak* peaks, size_t max_peaks); private: float sharpness_; float selectivity_; float depth_; float computeReduction(float magnitude, float freq); };