feat(FFT): добавлено FFT, выделение основной частоты
This commit is contained in:
20
firmware/App/Inc/audio_processor.h
Normal file
20
firmware/App/Inc/audio_processor.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "audio_config.h"
|
||||
|
||||
typedef struct {
|
||||
// dBFS (потом можно добавить калибровочный оффсет до dB SPL)
|
||||
float rms_dbfs;
|
||||
float peak_hz; // доминантная частота
|
||||
float peak_mag; // амплитуда бина (относительная)
|
||||
uint8_t clipped; // 1 если был клиппинг (0 или 4095)
|
||||
} audio_metrics_t;
|
||||
|
||||
bool audio_processor_init(void);
|
||||
|
||||
// process ровно 512 сэмплов
|
||||
bool audio_processor_process_512(
|
||||
const audio_sample_t* samples,
|
||||
audio_metrics_t* out);
|
||||
Reference in New Issue
Block a user