/* Adds a new record to the iir_f_t instances.  */
void iir_f_add(iir_f_t *iir, float x)
/* Adds a new record to the iir_f_t instances.  */
void iir_f_add(iir_f_t *iir, float x)
{
  iir->k++;
  if (1 == iir->k)
  {
    iir->avg = x;
  }
  else
  {
    iir->avg = iir->alpha * x + (1.0 - iir->alpha) * iir->avg;
  }
}