Рефакторинг полосового фильтра. Добавление функции для расчета его сдвига
This commit is contained in:
2026-01-30 13:22:21 +03:00
parent 795ebbd220
commit cb3783bd07
2 changed files with 78 additions and 13 deletions

View File

@@ -467,7 +467,7 @@ int32_t FilterRMSInt_Process(FilterRMSInt_t* filter, int32_t input);
* @details Комбинация дифференциатора и полосового фильтра 2-го порядка.
* Используется для выделения сетевой частоты и подготовки к детектированию нуля.
*/
typedef struct _FilterBandPassDerivative_t {
typedef struct _FilterBandPass_t {
FilterState_t state; ///< Состояние фильтра
// Дифференциатор
@@ -485,15 +485,19 @@ typedef struct _FilterBandPassDerivative_t {
uint8_t dataProcessing; ///< Флаг обработки данных
// Указатели на функции
int (*reset)(struct _FilterBandPassDerivative_t *filter,
int (*reset)(struct _FilterBandPass_t *filter,
float center_freq_ratio, float bandwidth_ratio);
float (*process)(struct _FilterBandPassDerivative_t *filter, float input);
} FilterBandPassDerivative_t;
float (*process)(struct _FilterBandPass_t *filter, float input);
} FilterBandPass_t;
int FilterBandPassDerivative_Init(FilterBandPassDerivative_t* filter,
int FilterBandPass_Init(FilterBandPass_t* filter,
float center_freq_ratio,
float bandwidth_ratio);
float FilterBandPassDerivative_Process(FilterBandPassDerivative_t* filter,
int FilterBandPass_CalcPhaseDegTable(FilterBandPass_t* filter,
float* phase_table,
const float* freq_points,
int num_points);
float FilterBandPass_Process(FilterBandPass_t* filter,
float input);
#ifdef DSP_FITLERS