#include "iolib.h"
#include "dsplib.h"

#define DELAYLEN 2048

float delay[DELAYLEN+1];

void main(void)
{
  float in, out;

  init_21k();
  init_1847(SAMPLE48000, 0);
  initdelay(delay, DELAYLEN);

  out = 0.0;
  for(;;) {
    in = read_input();
    out = storedelay(out, delay, DELAYLEN);
    out = 0.8 * out + in;
    write_output(out);
  }
}