0
1
mirror of https://github.com/radio95-rnt/fm95.git synced 2026-02-26 19:23:51 +01:00
Files
fm95/filter/gain_control.h
2025-08-03 20:34:16 +02:00

25 lines
500 B
C

#pragma once
#include <math.h>
#include <stdint.h>
typedef struct {
float targetLevel;
float maxGain;
float minGain;
float attackTime;
float releaseTime;
float currentGain;
float currentLevel;
uint32_t sampleRate;
float attackCoef;
float releaseCoef;
float rmsBuffer;
float rmsAlpha;
float rmsBeta;
} AGC;
void initAGC(AGC* agc, uint32_t sampleRate, float targetLevel, float minGain, float maxGain, float attackTime, float releaseTime);
float process_agc(AGC* agc, float sidechain);