#define FIXED

#ifdef FIXED
#  include "Fix.h"
#  include "filx_fix.h"
#else
#  include "filx_float.h"
#endif

#include "filx.cc"

main ()
{
    double x;
    signalTypeWN (xin);
    signalTypeWN (z);
    signalTypeWN (lat1);
    signalTypeWN (lat2);
    signalTypeWN (lat3);

    FILE *fp1;
    FILE *fp2;
    fp1 = fopen ("Rx_IIR_input.dat", "r");
    fp2 = fopen ("z.dat", "w");

    char s[32];
    while (fscanf (fp1, "%s", s) > 0) {
	x = atof (s);
	// if (x >= 1.0) x = 0.998046875;

#ifdef FIXED
	xin.round_and_set (x);
#else
	xin = x;
#endif

	RxNotchFix (xin, &z);
	fprintf (fp2, "%.10f\n", (double) lat3);
	lat3 = lat2;
	lat2 = lat1;
	lat1 = z;
    }
}
