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;
gr_single_pole_iir< float, float, float > dc
Definition: slicer_agc_impl.h:66
#define ATSC_API
Definition: gr-atsc/include/gnuradio/atsc/api.h:30
atsci_slicer_agc()
Definition: slicer_agc_impl.h:39
Automatic Gain Control class for atsc slicer.
Definition: slicer_agc_impl.h:36
float gain()
Definition: slicer_agc_impl.h:42
float scale(float input)
Definition: slicer_agc_impl.h:45
float _gain
Definition: slicer_agc_impl.h:65