babc5a24e3
Co-authored-by: Copilot <copilot@github.com>
27 lines
1.1 KiB
C
27 lines
1.1 KiB
C
#ifndef DSP_MANAGER_H
|
|
#define DSP_MANAGER_H
|
|
|
|
#include "arm_math.h"
|
|
#include <stdint.h>
|
|
|
|
// Размер окна Фурье (степень двойки) - Уменьшен для экономии памяти
|
|
#define FFT_SIZE 256
|
|
#define DSP_SAMPLE_RATE_HZ 1000.0f
|
|
|
|
// Прототипы
|
|
void DSP_Init(void);
|
|
void DSP_AddSample(float32_t sample); // Добавить одну точку в "копилку"
|
|
void DSP_Process(void); // Запустить расчет (когда накопили FFT_SIZE)
|
|
void DSP_SetMotorErpm(const uint16_t eRPM[4], uint8_t pole_pairs);
|
|
|
|
// Debug values for Live Watch (переименованы для ясности)
|
|
extern volatile float32_t motor_erpm_avg;
|
|
extern volatile float32_t motor_mech_rpm;
|
|
extern volatile float32_t motor_elec_hz;
|
|
|
|
// Объявление переменных (ясные имена)
|
|
extern uint8_t fft_ready; // флаг: готовность FFT-пакета
|
|
extern uint16_t fft_index; // индекс накопления сэмплов
|
|
extern volatile uint16_t notch_report_hz[3]; // частоты, отправляемые в телеметрию
|
|
|
|
#endif |