feat(FFT): добавлено FFT, выделение основной частоты

This commit is contained in:
2025-12-26 00:13:57 +03:00
parent 063cced2a5
commit 97c59cdda2
9 changed files with 291 additions and 83 deletions

View File

@@ -10,7 +10,7 @@
#define configTICK_RATE_HZ ((TickType_t)1000)
#define configMAX_PRIORITIES (5)
#define configMINIMAL_STACK_SIZE ((unsigned short)128)
#define configTOTAL_HEAP_SIZE ((size_t)(10 * 1024))
#define configTOTAL_HEAP_SIZE ((size_t)(8 * 1024))
#define configMAX_TASK_NAME_LEN (16)
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 1

View 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);