/* * decimate.c * Simulate the mathematical operations carried out * by a sinc^4 decimator with a decimation factor of 32. * * The decimator uses modulo 2^24 arithmetic to do * its calculations. * * R. Schreier of OSU, 1993. */ #define R 32 #define N 24 static int Modulus = 1< 0; ){ a1 = mod( a1 + x ); a2 = mod( a2 + a1 ); a3 = mod( a3 + a2 ); a4 = mod( a4 + a3 ); if( ++t == R ){ t = 0; y1 = mod( a4 - s1 ); s1 = a4; y2 = mod( y1 - s2 ); s2 = y1; y3 = mod( y2 - s3 ); s3 = y2; y4 = mod( y3 - s4 ); s4 = y3; if( y4 & Signbit ) printf( "%d\n", y4 - Modulus ); else printf( "%d\n", y4 ); } } exit(0); }