- added forgetting factor rho = 1-leakiness to LeadLag coeff
git-svn-id: http://moon:8086/svn/software/trunk/libsrc/radio@993 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
@@ -66,10 +66,17 @@ void LeadLagSetCoeff(lead_lag_coeff_t *pCoeff, radio_float_t lead, radio_float_t
|
||||
{
|
||||
pCoeff->lead = lead;
|
||||
pCoeff->lag = lag;
|
||||
pCoeff->rho = (radio_float_t)1.0;
|
||||
}
|
||||
|
||||
void LeadLagSetLeakiness(lead_lag_coeff_t *pCoeff, radio_float_t leakiness)
|
||||
{
|
||||
pCoeff->rho = (radio_float_t)1.0-leakiness;
|
||||
}
|
||||
|
||||
radio_float_t LeadLagProcess(lead_lag_filter_t *pObj, lead_lag_coeff_t *pCoeff, radio_float_t x)
|
||||
{
|
||||
pObj->lag_state *= pCoeff->rho;
|
||||
pObj->lag_state += LEAD_LAG_SCALING*pCoeff->lag * x;
|
||||
|
||||
return pObj->lag_state/LEAD_LAG_SCALING + pCoeff->lead * x;
|
||||
|
||||
Reference in New Issue
Block a user