comb.c
409 Bytes
/***************************************************************
*
* comb.c
* the comb filter function
*
* 12/22/94 bfs initial version
*
*/
#include "comb.h"
float
comb(struct comb_info* cmb)
{
cmb->out_data = *cmb->out_ptr;
*cmb->out_ptr++ = cmb->in_data + cmb->out_data * cmb->coef;
if (cmb->out_ptr > (cmb->base + cmb->length - 1))
cmb->out_ptr = cmb->base;
return cmb->out_data;
}