23 #ifndef _ATSC_SLICER_AGC_H_
24 #define _ATSC_SLICER_AGC_H_
42 float gain () {
return _gain; }
46 float t = input * _gain;
47 float output = t - REFERENCE;
48 float error = REFERENCE - dc.filter (t);
49 _gain += error * RATE;
53 float scale(
float input){
54 float avg = dc.filter(input);
55 if(fabs(avg)<.1)avg=.1;
56 _gain += _gain*.99 + .01* REFERENCE/avg;
57 return input*_gain - REFERENCE;
63 static const float REFERENCE = 1.25;
64 static const float RATE = 1.0e-5;
66 gr_single_pole_iir<float,float,float>
dc;