0
1
mirror of https://github.com/radio95-rnt/fm95.git synced 2026-02-27 03:23:54 +01:00
Files
fm95/lib/gain_control.h
2025-04-19 13:04:07 +02:00

22 lines
471 B
C

#pragma once
#include <math.h>
typedef struct {
float targetLevel;
float maxGain;
float minGain;
float attackTime;
float releaseTime;
float currentGain;
float currentLevel;
int sampleRate;
float attackCoef;
float releaseCoef;
float rms_buffer;
} AGC;
void initAGC(AGC* agc, int sampleRate, float targetLevel, float minGain, float maxGain, float attackTime, float releaseTime);
float process_agc_stereo(AGC* agc, float left, float right, float *right_out);