#ifndef SIGNAL_UTILS_H
#define SIGNAL_UTILS_H

// Structure mirroring AudioSignal from spectrogram.c
// (kept separate to avoid circular dependencies and coupling)
typedef struct {
    float* samples;
    int numSamples;
    int sampleRate;
    int channels;
    float duration;
} AudioSignal;

typedef struct {
    float durationSec;
    float energy;
    float peakAmplitude;
    float rmsAmplitude;
    float paprDb;       // Peak-to-Average Power Ratio in dB
    int peakSampleIdx;  // sample index of peak amplitude
} SignalStats;

// Compute statistics for a region of the signal defined by sample range
SignalStats ComputeSignalStats(const AudioSignal* signal, int startSample, int endSample);

#endif // SIGNAL_UTILS_H
