lpcomb.c 542 Bytes
/***************************************************************
 *
 *	lpcomb.c
 *	 the low-pass inside a comb function
 *
 *	1/3/95		bfs initial version
 *
 */

#include "lpcomb.h"

float
lpcomb(struct lpc_info* lpc)
{
    float temp;

    lpc->out_data = *lpc->out_ptr;
    lpc->lpzmem = lpc->out_data * (1.0 - lpc->lpcoef) + lpc->lpzmem * lpc->lpcoef;
    *lpc->out_ptr++ = lpc->coef * (lpc->in_data + lpc->lpzmem);
    
    if (lpc->out_ptr > (lpc->base + lpc->length - 1))
	lpc->out_ptr = lpc->base;
    		
    return lpc->out_data;
}