- AGC: added boundaries

- Tracker: forget max at each process for all rackers

git-svn-id: http://moon:8086/svn/software/trunk/libsrc/radio@1048 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
2022-06-21 17:38:55 +00:00
parent 2f952a10a0
commit a68283618d
2 changed files with 12 additions and 0 deletions
+10
View File
@@ -10,6 +10,8 @@
void AGC_Init(agc_t *pObj, uint32_t windowLength, radio_float_t w_init)
{
pObj->w = w_init;
pObj->w_max = 4;
pObj->w_min = 0;
SlidingMinMaxInit(&pObj->slMax, windowLength, (radio_float_t)1E12, 1);
}
@@ -31,6 +33,14 @@ void AGC_Process(agc_t *pObj, radio_float_t x, radio_float_t mu, radio_float_t t
void AGC_Train(agc_t *pObj, radio_float_t e, radio_float_t mu)
{
pObj->w += mu*e;
if (pObj->w > pObj->w_max)
{
pObj->w = pObj->w_max;
}
if (pObj->w < pObj->w_min)
{
pObj->w = pObj->w_min;
}
}
radio_float_t AGC_GetWeight(agc_t *pObj)