379 filtAmps.iterNo = rawAmps.iterNo;
383 filtAmps.measurement.setZero();
387 int topN = rawAmps.measurement.cols();
394 if( iterNo < _closingDelay )
395 gainF = ( (
realT)iterNo ) / _closingDelay;
401 if( iterNo >= _closingDelay + _lowOrderDelay )
409 if( iterNo >= _closingDelay )
411 HOgainF = ( (
realT)( iterNo - _closingDelay ) ) / ( _lowOrderDelay );
416 for(
int i = 0; i < topN; ++i )
418 if( std::isnan( rawAmps.measurement( 0, i ) ) || !std::isfinite( rawAmps.measurement( 0, i ) ) )
419 rawAmps.measurement( 0, i ) = 0.0;
422 ( 1.0 - _leaks( 0, i ) ) * _commands( 0, i ) + gainF * _gains( 0, i ) * rawAmps.measurement( 0, i );
424 filtAmps.measurement( 0, i ) = _commands( 0, i );
427 for(
int i = topN; i < rawAmps.measurement.cols(); ++i )
429 if( std::isnan( rawAmps.measurement( 0, i ) ) || !std::isfinite( rawAmps.measurement( 0, i ) ) )
430 rawAmps.measurement( 0, i ) = 0.0;
433 ( 1.0 - _leaks( 0, i ) ) * _commands( 0, i ) + HOgainF * _gains( 0, i ) * rawAmps.measurement( 0, i );
435 filtAmps.measurement( 0, i ) = _commands( 0, i );