diff --git a/apps/SOURCES b/apps/SOURCES
index 26e53d1..ce99ece 100644
--- a/apps/SOURCES
+++ b/apps/SOURCES
@@ -170,6 +170,9 @@ codec_thread.c
 playback.c
 codecs.c
 dsp.c
+#ifdef DSP_USE_SINC_RESAMPLING
+sinc.c
+#endif
 #ifndef HAVE_HARDWARE_BEEP
 beep.c
 #endif
diff --git a/apps/dsp.c b/apps/dsp.c
index 3cff191..ec607b2 100644
--- a/apps/dsp.c
+++ b/apps/dsp.c
@@ -33,6 +33,9 @@
 #include "buffer.h"
 #include "fixedpoint.h"
 #include "fracmul.h"
+#ifdef DSP_USE_SINC_RESAMPLING
+#include "sinc.h"
+#endif
 
 /* Define LOGF_ENABLE to enable logf output in this file */
 /*#define LOGF_ENABLE*/
@@ -73,6 +76,22 @@ enum
  * NOTE: Any assembly routines that use these structures must be updated
  * if current data members are moved or changed.
  */
+
+#ifdef DSP_USE_SINC_RESAMPLING
+#define FILTER_SIZE 15
+#define FILTER_DELAY 7
+
+struct resample_data
+{
+    uint32_t increment;			    /* 00h */
+    uint32_t current;			    /* 04h */
+    uint32_t sinc_inc;			    /* 08h */
+    uint32_t buf_fill;			    /* 0ch */
+    int32_t sample_buf[2][FILTER_SIZE];
+    int32_t resample_buf[2][FILTER_SIZE*2];
+    int32_t sinc[15][256];
+};
+#else
 struct resample_data
 {
     uint32_t delta;                     /* 00h */
@@ -80,6 +99,7 @@ struct resample_data
     int32_t last_sample[2];             /* 08h */
                                         /* 10h */
 };
+#endif
 
 /* This is for passing needed data to assembly dsp routines. If another
  * dsp parameter needs to be passed, add to the end of the structure
@@ -632,6 +652,300 @@ static void sample_output_new_format(struct dsp_config *dsp)
     dsp->output_samples = sample_output_functions[out];
 }
 
+#ifdef DSP_USE_SINC_RESAMPLING
+
+static inline int32_t sinc_upsample(const int32_t *src, uint32_t current)
+{
+    int32_t sinc_val;
+    int32_t samp;
+
+    /* todo: linear interpolation between sinc values (doubles the amount of MULs) */
+    sinc_val = sinc[14][(current>>8)&0xff];
+    samp = (src[(current>>16)-7]>>12)*sinc_val;
+
+    sinc_val = sinc[13][(current>>8)&0xff];
+    samp += (src[(current>>16)-6]>>12)*sinc_val;
+
+    sinc_val = sinc[12][(current>>8)&0xff];
+    samp += (src[(current>>16)-5]>>12)*sinc_val;
+
+    sinc_val = sinc[11][(current>>8)&0xff];
+    samp += (src[(current>>16)-4]>>12)*sinc_val;
+
+    sinc_val = sinc[10][(current>>8)&0xff];
+    samp += (src[(current>>16)-3]>>12)*sinc_val;
+
+    sinc_val = sinc[9][(current>>8)&0xff];
+    samp += (src[(current>>16)-2]>>12)*sinc_val;
+
+    sinc_val = sinc[8][(current>>8)&0xff];
+    samp += (src[(current>>16)-1]>>12)*sinc_val;
+
+    sinc_val = sinc[7][(current>>8)&0xff];
+    samp += (src[(current>>16)-0]>>12)*sinc_val;
+
+    sinc_val = sinc[6][(current>>8)&0xff];
+    samp += (src[(current>>16)+1]>>12)*sinc_val;
+
+    sinc_val = sinc[5][(current>>8)&0xff];
+    samp += (src[(current>>16)+2]>>12)*sinc_val;
+
+    sinc_val = sinc[4][(current>>8)&0xff];
+    samp += (src[(current>>16)+3]>>12)*sinc_val;
+
+    sinc_val = sinc[3][(current>>8)&0xff];
+    samp += (src[(current>>16)+4]>>12)*sinc_val;
+
+    sinc_val = sinc[2][(current>>8)&0xff];
+    samp += (src[(current>>16)+5]>>12)*sinc_val;
+
+    sinc_val = sinc[1][(current>>8)&0xff];
+    samp += (src[(current>>16)+6]>>12)*sinc_val;
+
+    sinc_val = sinc[0][(current>>8)&0xff];
+    samp += (src[(current>>16)+7]>>12)*sinc_val;
+
+    return (samp >> 4);
+}
+
+static inline int32_t sinc_downsample(const int32_t *src, uint32_t current, uint32_t sinc_increment, int32_t sinc[15][256])
+{
+    uint32_t sinc_current;
+    int32_t samp;
+
+    sinc_current = ((sinc_increment * (current & 0xffff))>>16) + ((uint32_t)7<<16);
+    sinc_current -= sinc_increment * 7;
+
+    /* todo: linear interpolation between sinc values */
+    samp = (src[(current>>16)+7]>>12)*sinc[sinc_current>>16][(sinc_current>>8) & 0xff];
+
+    sinc_current += sinc_increment;
+    samp += (src[(current>>16)+6]>>12)*sinc[sinc_current>>16][(sinc_current>>8) & 0xff];
+
+    sinc_current += sinc_increment;
+    samp += (src[(current>>16)+5]>>12)*sinc[sinc_current>>16][(sinc_current>>8) & 0xff];
+
+    sinc_current += sinc_increment;
+    samp += (src[(current>>16)+4]>>12)*sinc[sinc_current>>16][(sinc_current>>8) & 0xff];
+
+    sinc_current += sinc_increment;
+    samp += (src[(current>>16)+3]>>12)*sinc[sinc_current>>16][(sinc_current>>8) & 0xff];
+
+    sinc_current += sinc_increment;
+    samp += (src[(current>>16)+2]>>12)*sinc[sinc_current>>16][(sinc_current>>8) & 0xff];
+
+    sinc_current += sinc_increment;
+    samp += (src[(current>>16)+1]>>12)*sinc[sinc_current>>16][(sinc_current>>8) & 0xff];
+
+    sinc_current += sinc_increment;
+    samp += (src[current>>16]>>12)*sinc[sinc_current>>16][(sinc_current>>8) & 0xff];
+
+    sinc_current += sinc_increment;
+    samp += (src[(current>>16)-1]>>12)*sinc[sinc_current>>16][(sinc_current>>8) & 0xff];
+
+    sinc_current += sinc_increment;
+    samp += (src[(current>>16)-2]>>12)*sinc[sinc_current>>16][(sinc_current>>8) & 0xff];
+
+    sinc_current += sinc_increment;
+    samp += (src[(current>>16)-3]>>12)*sinc[sinc_current>>16][(sinc_current>>8) & 0xff];
+
+    sinc_current += sinc_increment;
+    samp += (src[(current>>16)-4]>>12)*sinc[sinc_current>>16][(sinc_current>>8) & 0xff];
+
+    sinc_current += sinc_increment;
+    samp += (src[(current>>16)-5]>>12)*sinc[sinc_current>>16][(sinc_current>>8) & 0xff];
+
+    sinc_current += sinc_increment;
+    samp += (src[(current>>16)-6]>>12)*sinc[sinc_current>>16][(sinc_current>>8) & 0xff];
+
+    sinc_current += sinc_increment;
+    samp += (src[(current>>16)-7]>>12)*sinc[sinc_current>>16][(sinc_current>>8) & 0xff];
+
+    return (samp >> 4);
+}
+
+static int dsp_downsample(int count, struct dsp_data *data,
+                          const int32_t *src[], int32_t *dst[])
+{
+    uint32_t inc = data->resample_data.increment;
+    uint32_t cur = data->resample_data.current;
+    int32_t *d = dst[0];
+    int i;
+
+    for(i = 0; i<data->num_channels; i++) {
+        cur = data->resample_data.current;
+        d = dst[i];
+
+        while((cur>>16) < (unsigned)count - FILTER_DELAY) {
+            int32_t sample = sinc_downsample(src[i], cur, data->resample_data.sinc_inc, data->resample_data.sinc);
+            // should never happen, but maybe because of rounding etc. it does:
+            if(sample > 32767<<12) sample = 32767<<12;
+            else if (sample < -32768<<12) sample = -32768<<12;
+            *d++ = sample;
+            cur += inc;
+        }
+    }
+
+    data->resample_data.current = cur;
+
+    return d - dst[data->num_channels-1];
+}
+
+
+static int dsp_upsample(int count, struct dsp_data *data,
+                        const int32_t *src[], int32_t *dst[])
+{
+    uint32_t inc = data->resample_data.increment;
+    uint32_t cur = data->resample_data.current;
+    int32_t *d = dst[0];
+    int i;
+
+    for(i = 0; i<data->num_channels; i++) {
+        cur = data->resample_data.current;
+        d = dst[i];
+
+        while((cur>>16) < (unsigned)count - FILTER_DELAY) {
+            int32_t sample = sinc_upsample(src[i], cur);
+            // should never happen, but maybe because of rounding etc. it does:
+            if(sample > 32767<<12) sample = 32767<<12;
+            else if (sample < -32768<<12) sample = -32768<<12;
+            *d++ = sample;
+            cur += inc;
+        }
+    }
+
+    data->resample_data.current = cur;
+
+    return d - dst[data->num_channels-1];
+}
+
+static void resampler_new_delta(struct dsp_config *dsp)
+{
+    int i, k;
+    dsp->data.resample_data.increment = (uint32_t)
+        dsp->frequency * 65536LL / NATIVE_FREQUENCY;
+
+    if (dsp->frequency == NATIVE_FREQUENCY)
+    {
+        /* NOTE: If fully glitch-free transistions from no resampling to
+           resampling are desired, last_sample history should be maintained
+           even when not resampling. */
+        dsp->resample = NULL;
+        memset(dsp->data.resample_data.resample_buf[0], sizeof(dsp->data.resample_data.resample_buf[0]), 0);
+        memset(dsp->data.resample_data.resample_buf[1], sizeof(dsp->data.resample_data.resample_buf[1]), 0);
+        dsp->data.resample_data.buf_fill = 0; /* fixme: initialize to 0 on startup */
+        dsp->data.resample_data.current = FILTER_SIZE<<16; /* fixme: initialize on startup */
+    }
+    else if (dsp->frequency < NATIVE_FREQUENCY)
+        dsp->resample = dsp_upsample;
+    else {
+        dsp->resample = dsp_downsample;
+        dsp->data.resample_data.sinc_inc = (uint32_t)
+            NATIVE_FREQUENCY * 65536LL / dsp->frequency;
+        /* we have to scale the sinc's amplitude by downsampling rate,
+         * which is the same as the sinc_increment */
+        for (i=0; i<15; i++) {
+            for(k=0; k<256; k++) {
+            /* we need to reduce increment to 17.15, because sinc's max is 1.0
+             * and it is signed */
+            dsp->data.resample_data.sinc[i][k] =
+                (sinc[i][k] * (int32_t)(dsp->data.resample_data.sinc_inc>>1)) >> 15;
+            }
+        }
+    }
+}
+
+/* Resample count stereo samples. Returns number of stereo samples
+ * for further processing.
+ * count must be >= 15
+ */
+static inline int resample_core(struct dsp_config *dsp, unsigned count, int32_t *src[], int32_t *dst[])
+{
+    struct resample_data *rsdata = &dsp->data.resample_data;
+    int32_t *sb_src[2] =
+    {
+        &rsdata->resample_buf[0][0],
+        &rsdata->resample_buf[1][0],
+    };
+    int cnt;
+
+    memcpy(&rsdata->resample_buf[0][FILTER_SIZE], src[0], FILTER_SIZE  * sizeof(int32_t));
+    if (dsp->data.num_channels >  1)
+        memcpy(&rsdata->resample_buf[1][FILTER_SIZE], src[1], FILTER_SIZE * sizeof(int32_t));
+
+    cnt = dsp->resample(FILTER_SIZE*2, &dsp->data, (const int32_t **)sb_src, dst);
+
+    rsdata->current -= (FILTER_SIZE << 16);
+
+    if((rsdata->current >> 16) < count) {
+        int32_t *add_dst[2];
+        add_dst[0] = dst[0] + cnt;
+        add_dst[1] = dst[1] + cnt;
+        cnt += dsp->resample((int)count, &dsp->data, (const int32_t **)src, add_dst);
+    }
+
+    memcpy(rsdata->resample_buf[0], &src[0][count - FILTER_SIZE], FILTER_SIZE * sizeof(int32_t));
+    memcpy(rsdata->resample_buf[1], &src[dsp->data.num_channels - 1][count - FILTER_SIZE], FILTER_SIZE * sizeof(int32_t));
+
+    rsdata->current -= ((count - FILTER_SIZE) << 16);
+
+    return cnt;
+}
+
+/* Resample count stereo samples. Updates the src array, if resampling is
+ * done, to refer to the resampled data. Returns number of stereo samples
+ * for further processing.
+ */
+static inline int resample(struct dsp_config *dsp, int count, int32_t *src[])
+{
+    int32_t *dst[2] =
+    {
+        &resample_buf[RESAMPLE_BUF_LEFT_CHANNEL],
+        &resample_buf[RESAMPLE_BUF_RIGHT_CHANNEL],
+    };
+    struct resample_data *rsdata = &dsp->data.resample_data;
+    int res = 0;
+
+    if(rsdata->buf_fill || count < FILTER_SIZE) {
+        unsigned size = (count - rsdata->buf_fill > FILTER_SIZE)? FILTER_SIZE - rsdata->buf_fill : (unsigned)count;
+        memcpy(&rsdata->sample_buf[0][rsdata->buf_fill], src[0], size * sizeof(int32_t));
+        memcpy(&rsdata->sample_buf[1][rsdata->buf_fill], src[dsp->data.num_channels - 1], size * sizeof(int32_t));
+        rsdata->buf_fill += size;
+        count -= size;
+        src[0] += size;
+        src[1] += size;
+    }
+
+    if(rsdata->buf_fill == FILTER_SIZE) {
+        int32_t *buf_src[2] =
+        {
+            rsdata->sample_buf[0],
+            rsdata->sample_buf[1],
+        };
+        res = resample_core(dsp, FILTER_SIZE, buf_src, dst);
+        rsdata->buf_fill = 0;
+    }
+
+    if(count > FILTER_SIZE) {
+        int32_t *add_dst[2];
+        add_dst[0] = dst[0] + res;
+        add_dst[1] = dst[1] + res;
+        res += resample_core(dsp, (unsigned)count, src, add_dst);
+    } else if(count) {
+        /* assert(rsdata->buf_fill == 0); */
+        memcpy(rsdata->sample_buf[0], src[0], count * sizeof(int32_t));
+        memcpy(rsdata->sample_buf[1], src[dsp->data.num_channels - 1], count * sizeof(int32_t));
+        rsdata->buf_fill = count;
+    }
+
+    src[0] = dst[0];
+    src[1] = dst[dsp->data.num_channels - 1];
+
+    return res;
+}
+
+#else /* DSP_USE_SINC_RESAMPLING */
+
 /**
  * Linear interpolation resampling that introduces a one sample delay because
  * of our inability to look into the future at the end of a frame.
@@ -762,6 +1076,8 @@ static inline int resample(struct dsp_config *dsp, int count, int32_t *src[])
     return count;
 }
 
+#endif /* DSP_USE_SINC_RESAMPLING */
+
 static void dither_init(struct dsp_config *dsp)
 {
     memset(dither_data, 0, sizeof (dither_data));
@@ -1337,8 +1653,13 @@ int dsp_input_count(struct dsp_config *dsp, int count)
         /* Use the real resampling delta =
          * dsp->frequency * 65536 / NATIVE_FREQUENCY, and
          * round towards zero to avoid buffer overflows. */
+#ifdef DSP_USE_SINC_RESAMPLING
+	count = (int)(((unsigned long)count *
+                      dsp->data.resample_data.increment) >> 16);
+#else
         count = (int)(((unsigned long)count *
                       dsp->data.resample_data.delta) >> 16);
+#endif
     }
 
 #ifdef HAVE_PITCHSCREEN
@@ -1380,6 +1701,9 @@ intptr_t dsp_configure(struct dsp_config *dsp, int setting, intptr_t value)
 
     case DSP_SET_FREQUENCY:
         memset(&dsp->data.resample_data, 0, sizeof (dsp->data.resample_data));
+#ifdef DSP_USE_SINC_RESAMPLING
+        dsp->data.resample_data.current = FILTER_SIZE<<16;
+#endif
         /* Fall through!!! */
     case DSP_SWITCH_FREQUENCY:
         dsp->codec_frequency = (value == 0) ? NATIVE_FREQUENCY : value;
@@ -1464,6 +1788,9 @@ intptr_t dsp_configure(struct dsp_config *dsp, int setting, intptr_t value)
     case DSP_FLUSH:
         memset(&dsp->data.resample_data, 0,
                sizeof (dsp->data.resample_data));
+#ifdef DSP_USE_SINC_RESAMPLING
+        dsp->data.resample_data.current = FILTER_SIZE<<16;
+#endif
         resampler_new_delta(dsp);
         dither_init(dsp);
 #ifdef HAVE_PITCHSCREEN
diff --git a/apps/dsp_asm.h b/apps/dsp_asm.h
index 7bf1837..c455a11 100644
--- a/apps/dsp_asm.h
+++ b/apps/dsp_asm.h
@@ -27,7 +27,6 @@
 /* Set the appropriate #defines based on CPU or whatever matters */
 #if defined(CPU_ARM)
 #define DSP_HAVE_ASM_APPLY_GAIN
-#define DSP_HAVE_ASM_RESAMPLING
 #define DSP_HAVE_ASM_CROSSFEED
 #define DSP_HAVE_ASM_SOUND_CHAN_MONO
 #define DSP_HAVE_ASM_SOUND_CHAN_CUSTOM
@@ -36,7 +35,6 @@
 #define DSP_HAVE_ASM_SAMPLE_OUTPUT_STEREO
 #elif defined (CPU_COLDFIRE)
 #define DSP_HAVE_ASM_APPLY_GAIN
-#define DSP_HAVE_ASM_RESAMPLING
 #define DSP_HAVE_ASM_CROSSFEED
 #define DSP_HAVE_ASM_SOUND_CHAN_MONO
 #define DSP_HAVE_ASM_SOUND_CHAN_CUSTOM
@@ -45,6 +43,10 @@
 #define DSP_HAVE_ASM_SAMPLE_OUTPUT_STEREO
 #endif /* CPU_COLDFIRE */
 
+#if (defined (CPU_ARM) || defined(CPU_COLDFIRE)) && !defined(DSP_USE_SINC_RESAMPLING)
+#define DSP_HAVE_ASM_RESAMPLING
+#endif
+
 /* Declare prototypes based upon what's #defined above */
 #ifdef DSP_HAVE_ASM_CROSSFEED
 void apply_crossfeed(int count, int32_t *buf[]);
diff --git a/apps/sinc.c b/apps/sinc.c
new file mode 100644
index 0000000..0617ed0
--- /dev/null
+++ b/apps/sinc.c
@@ -0,0 +1,499 @@
+#include <inttypes.h>
+
+int32_t sinc[15][256] = {
+    {0, 3, 6, 9, 12, 15, 18, 21,
+     23, 26, 29, 32, 35, 38, 41, 44,
+     47, 50, 53, 56, 59, 62, 65, 68,
+     70, 73, 76, 79, 82, 85, 88, 91,
+     94, 96, 99, 102, 105, 108, 111, 114,
+     116, 119, 122, 125, 128, 130, 133, 136,
+     139, 141, 144, 147, 149, 152, 155, 157,
+     160, 162, 165, 168, 170, 173, 175, 178,
+     180, 183, 185, 188, 190, 193, 195, 197,
+     200, 202, 204, 207, 209, 211, 213, 216,
+     218, 220, 222, 224, 226, 228, 230, 232,
+     234, 236, 238, 240, 242, 244, 246, 247,
+     249, 251, 253, 254, 256, 258, 259, 261,
+     262, 264, 265, 267, 268, 270, 271, 272,
+     273, 275, 276, 277, 278, 279, 280, 281,
+     282, 283, 284, 285, 286, 287, 288, 288,
+     289, 290, 290, 291, 291, 292, 292, 293,
+     293, 293, 294, 294, 294, 294, 295, 295,
+     295, 295, 295, 295, 294, 294, 294, 294,
+     293, 293, 293, 292, 292, 291, 291, 290,
+     289, 289, 288, 287, 286, 285, 284, 283,
+     282, 281, 280, 279, 277, 276, 275, 273,
+     272, 270, 269, 267, 266, 264, 262, 260,
+     258, 257, 255, 253, 251, 249, 246, 244,
+     242, 240, 237, 235, 232, 230, 227, 225,
+     222, 220, 217, 214, 211, 208, 205, 202,
+     199, 196, 193, 190, 187, 183, 180, 177,
+     173, 170, 166, 163, 159, 155, 152, 148,
+     144, 140, 136, 132, 128, 124, 120, 116,
+     112, 108, 104, 99, 95, 91, 86, 82,
+     77, 73, 68, 63, 59, 54, 49, 45,
+     40, 35, 30, 25, 20, 15, 10, 5
+     },
+    {0, -5, -10, -15, -21, -26, -31, -37,
+     -42, -47, -53, -58, -64, -69, -74, -80,
+     -86, -91, -97, -102, -108, -114, -119, -125,
+     -131, -136, -142, -148, -154, -159, -165, -171,
+     -177, -183, -188, -194, -200, -206, -212, -218,
+     -224, -230, -235, -241, -247, -253, -259, -265,
+     -271, -277, -282, -288, -294, -300, -306, -312,
+     -317, -323, -329, -335, -340, -346, -352, -358,
+     -363, -369, -375, -380, -386, -391, -397, -402,
+     -408, -413, -419, -424, -430, -435, -440, -445,
+     -451, -456, -461, -466, -471, -476, -481, -486,
+     -491, -496, -501, -505, -510, -515, -519, -524,
+     -528, -533, -537, -541, -546, -550, -554, -558,
+     -562, -566, -570, -574, -578, -581, -585, -588,
+     -592, -595, -599, -602, -605, -608, -611, -614,
+     -617, -620, -622, -625, -627, -630, -632, -634,
+     -637, -639, -641, -643, -644, -646, -648, -649,
+     -651, -652, -653, -654, -656, -656, -657, -658,
+     -659, -659, -660, -660, -660, -660, -660, -660,
+     -660, -660, -659, -659, -658, -657, -657, -656,
+     -654, -653, -652, -650, -649, -647, -645, -644,
+     -642, -639, -637, -635, -632, -630, -627, -624,
+     -621, -618, -615, -611, -608, -604, -601, -597,
+     -593, -589, -585, -580, -576, -571, -567, -562,
+     -557, -552, -546, -541, -536, -530, -525, -519,
+     -513, -507, -501, -494, -488, -481, -475, -468,
+     -461, -454, -447, -440, -432, -425, -417, -409,
+     -401, -393, -385, -377, -369, -360, -352, -343,
+     -334, -326, -317, -308, -298, -289, -280, -270,
+     -260, -251, -241, -231, -221, -211, -200, -190,
+     -180, -169, -158, -148, -137, -126, -115, -104,
+     -93, -81, -70, -58, -47, -35, -24, -12
+     },
+    {0, 12, 24, 36, 48, 60, 73, 85,
+     97, 110, 122, 135, 148, 160, 173, 186,
+     199, 212, 225, 238, 251, 264, 277, 290,
+     303, 317, 330, 343, 357, 370, 383, 397,
+     410, 424, 437, 451, 464, 478, 491, 505,
+     518, 532, 545, 559, 572, 586, 599, 613,
+     626, 640, 653, 666, 680, 693, 706, 720,
+     733, 746, 759, 772, 785, 798, 811, 824,
+     837, 850, 863, 876, 888, 901, 913, 926,
+     938, 950, 963, 975, 987, 999, 1011, 1022,
+     1034, 1046, 1057, 1069, 1080, 1091, 1102, 1113,
+     1124, 1135, 1145, 1156, 1166, 1176, 1186, 1196,
+     1206, 1216, 1226, 1235, 1244, 1253, 1262, 1271,
+     1280, 1288, 1297, 1305, 1313, 1321, 1329, 1336,
+     1344, 1351, 1358, 1365, 1372, 1378, 1384, 1391,
+     1396, 1402, 1408, 1413, 1418, 1423, 1428, 1433,
+     1437, 1441, 1445, 1449, 1452, 1456, 1459, 1462,
+     1464, 1467, 1469, 1471, 1473, 1474, 1476, 1477,
+     1478, 1478, 1479, 1479, 1479, 1479, 1478, 1477,
+     1476, 1475, 1473, 1472, 1469, 1467, 1465, 1462,
+     1459, 1456, 1452, 1448, 1444, 1440, 1435, 1430,
+     1425, 1420, 1414, 1409, 1402, 1396, 1389, 1383,
+     1375, 1368, 1360, 1352, 1344, 1336, 1327, 1318,
+     1309, 1299, 1289, 1279, 1269, 1258, 1247, 1236,
+     1225, 1213, 1201, 1189, 1177, 1164, 1151, 1138,
+     1124, 1111, 1097, 1082, 1068, 1053, 1038, 1023,
+     1007, 992, 976, 959, 943, 926, 909, 892,
+     874, 857, 839, 820, 802, 783, 764, 745,
+     726, 706, 687, 667, 646, 626, 605, 584,
+     563, 542, 520, 499, 477, 455, 432, 410,
+     387, 364, 341, 318, 294, 271, 247, 223,
+     199, 175, 150, 125, 101, 76, 51, 25
+     },
+    {0, -26, -51, -77, -103, -129, -155, -182,
+     -208, -234, -261, -288, -315, -342, -369, -396,
+     -423, -450, -478, -505, -533, -560, -588, -616,
+     -644, -671, -699, -727, -755, -783, -811, -839,
+     -867, -895, -923, -951, -980, -1008, -1036, -1064,
+     -1092, -1120, -1148, -1176, -1204, -1232, -1260, -1287,
+     -1315, -1343, -1370, -1398, -1425, -1453, -1480, -1507,
+     -1535, -1562, -1589, -1615, -1642, -1669, -1695, -1722,
+     -1748, -1774, -1800, -1826, -1851, -1877, -1902, -1927,
+     -1952, -1977, -2002, -2026, -2051, -2075, -2099, -2122,
+     -2146, -2169, -2192, -2215, -2237, -2260, -2282, -2304,
+     -2325, -2347, -2368, -2388, -2409, -2429, -2449, -2469,
+     -2488, -2508, -2526, -2545, -2563, -2581, -2599, -2616,
+     -2633, -2650, -2666, -2682, -2697, -2713, -2728, -2742,
+     -2756, -2770, -2784, -2797, -2810, -2822, -2834, -2846,
+     -2857, -2868, -2878, -2888, -2898, -2907, -2916, -2924,
+     -2932, -2939, -2947, -2953, -2959, -2965, -2971, -2975,
+     -2980, -2984, -2988, -2991, -2993, -2995, -2997, -2998,
+     -2999, -3000, -2999, -2999, -2998, -2996, -2994, -2991,
+     -2988, -2985, -2981, -2976, -2971, -2966, -2960, -2953,
+     -2946, -2939, -2931, -2922, -2913, -2903, -2893, -2883,
+     -2872, -2860, -2848, -2835, -2822, -2809, -2794, -2780,
+     -2765, -2749, -2733, -2716, -2699, -2681, -2662, -2644,
+     -2624, -2604, -2584, -2563, -2542, -2520, -2497, -2474,
+     -2451, -2427, -2402, -2377, -2352, -2326, -2299, -2272,
+     -2245, -2217, -2188, -2159, -2130, -2100, -2070, -2039,
+     -2007, -1975, -1943, -1910, -1877, -1843, -1809, -1774,
+     -1739, -1703, -1667, -1630, -1593, -1556, -1518, -1480,
+     -1441, -1402, -1362, -1322, -1282, -1241, -1200, -1158,
+     -1116, -1073, -1031, -987, -944, -900, -855, -811,
+     -766, -720, -674, -628, -582, -535, -488, -440,
+     -393, -345, -296, -248, -199, -149, -100, -50
+     },
+    {0, 50, 101, 152, 203, 254, 306, 357,
+     409, 461, 514, 566, 619, 672, 725, 778,
+     831, 885, 938, 992, 1046, 1100, 1154, 1208,
+     1263, 1317, 1372, 1426, 1481, 1535, 1590, 1645,
+     1699, 1754, 1809, 1863, 1918, 1973, 2027, 2082,
+     2137, 2191, 2246, 2300, 2354, 2409, 2463, 2517,
+     2571, 2624, 2678, 2732, 2785, 2838, 2891, 2944,
+     2996, 3049, 3101, 3153, 3205, 3256, 3308, 3359,
+     3410, 3460, 3510, 3560, 3610, 3659, 3708, 3757,
+     3805, 3853, 3901, 3948, 3995, 4041, 4087, 4133,
+     4178, 4223, 4267, 4311, 4355, 4398, 4441, 4483,
+     4524, 4565, 4606, 4646, 4686, 4725, 4763, 4801,
+     4839, 4876, 4912, 4948, 4983, 5017, 5051, 5084,
+     5117, 5149, 5180, 5211, 5241, 5271, 5299, 5327,
+     5355, 5381, 5407, 5432, 5457, 5481, 5504, 5526,
+     5548, 5568, 5588, 5608, 5626, 5644, 5661, 5677,
+     5692, 5707, 5720, 5733, 5745, 5756, 5766, 5776,
+     5784, 5792, 5799, 5805, 5810, 5814, 5818, 5820,
+     5822, 5822, 5822, 5821, 5819, 5815, 5812, 5807,
+     5801, 5794, 5786, 5778, 5768, 5757, 5746, 5733,
+     5720, 5705, 5690, 5673, 5656, 5638, 5618, 5598,
+     5577, 5555, 5531, 5507, 5482, 5455, 5428, 5400,
+     5371, 5340, 5309, 5277, 5244, 5209, 5174, 5138,
+     5101, 5062, 5023, 4983, 4942, 4899, 4856, 4812,
+     4767, 4721, 4673, 4625, 4576, 4526, 4475, 4423,
+     4370, 4316, 4260, 4204, 4148, 4090, 4031, 3971,
+     3910, 3848, 3786, 3722, 3658, 3592, 3526, 3459,
+     3391, 3321, 3252, 3181, 3109, 3036, 2963, 2888,
+     2813, 2737, 2660, 2582, 2504, 2424, 2344, 2263,
+     2181, 2099, 2015, 1931, 1846, 1760, 1674, 1587,
+     1499, 1410, 1321, 1230, 1140, 1048, 956, 863,
+     770, 676, 581, 486, 390, 293, 196, 98
+     },
+    {0, -99, -198, -298, -399, -499, -601, -703,
+     -805, -908, -1011, -1115, -1219, -1323, -1428, -1534,
+     -1639, -1745, -1851, -1958, -2065, -2172, -2279, -2387,
+     -2495, -2603, -2712, -2820, -2929, -3038, -3147, -3256,
+     -3366, -3475, -3585, -3694, -3804, -3914, -4024, -4133,
+     -4243, -4353, -4463, -4572, -4682, -4791, -4901, -5010,
+     -5119, -5228, -5337, -5445, -5554, -5662, -5769, -5877,
+     -5984, -6091, -6198, -6305, -6411, -6516, -6621, -6726,
+     -6831, -6935, -7038, -7141, -7244, -7346, -7447, -7548,
+     -7649, -7748, -7848, -7946, -8044, -8141, -8238, -8334,
+     -8429, -8523, -8617, -8710, -8802, -8893, -8983, -9073,
+     -9162, -9249, -9336, -9422, -9507, -9592, -9675, -9757,
+     -9838, -9918, -9997, -10075, -10152, -10228, -10302, -10376,
+     -10448, -10519, -10589, -10658, -10725, -10792, -10857, -10920,
+     -10983, -11044, -11104, -11162, -11219, -11275, -11329, -11382,
+     -11433, -11483, -11532, -11579, -11624, -11668, -11710, -11751,
+     -11791, -11828, -11864, -11899, -11932, -11963, -11992, -12020,
+     -12046, -12071, -12093, -12114, -12134, -12151, -12167, -12181,
+     -12193, -12203, -12211, -12218, -12222, -12225, -12226, -12225,
+     -12222, -12217, -12210, -12202, -12191, -12178, -12164, -12147,
+     -12128, -12107, -12085, -12060, -12033, -12004, -11973, -11940,
+     -11904, -11867, -11828, -11786, -11742, -11696, -11648, -11598,
+     -11546, -11491, -11435, -11376, -11314, -11251, -11186, -11118,
+     -11048, -10975, -10901, -10824, -10745, -10664, -10580, -10494,
+     -10406, -10316, -10223, -10128, -10031, -9932, -9830, -9726,
+     -9619, -9510, -9399, -9286, -9170, -9052, -8932, -8809,
+     -8684, -8557, -8427, -8295, -8161, -8024, -7885, -7744,
+     -7600, -7455, -7306, -7156, -7003, -6848, -6690, -6531,
+     -6369, -6204, -6038, -5869, -5697, -5524, -5348, -5170,
+     -4990, -4807, -4622, -4435, -4246, -4054, -3861, -3664,
+     -3466, -3266, -3063, -2858, -2651, -2442, -2231, -2017,
+     -1801, -1584, -1364, -1142, -918, -691, -463, -232
+     },
+    {0, 235, 471, 710, 950, 1193, 1438, 1684,
+     1933, 2183, 2436, 2690, 2946, 3204, 3464, 3726,
+     3990, 4255, 4523, 4792, 5063, 5336, 5610, 5886,
+     6164, 6444, 6725, 7008, 7292, 7578, 7866, 8156,
+     8446, 8739, 9033, 9328, 9625, 9924, 10224, 10525,
+     10828, 11132, 11437, 11744, 12052, 12361, 12672, 12984,
+     13297, 13612, 13927, 14244, 14562, 14881, 15201, 15522,
+     15844, 16167, 16491, 16816, 17142, 17469, 17797, 18126,
+     18456, 18786, 19117, 19449, 19782, 20115, 20449, 20784,
+     21120, 21456, 21792, 22130, 22467, 22805, 23144, 23483,
+     23823, 24163, 24503, 24844, 25185, 25526, 25868, 26209,
+     26551, 26893, 27236, 27578, 27920, 28263, 28605, 28948,
+     29290, 29633, 29975, 30318, 30660, 31002, 31343, 31685,
+     32026, 32367, 32708, 33048, 33388, 33727, 34067, 34405,
+     34743, 35081, 35418, 35754, 36090, 36425, 36760, 37094,
+     37427, 37759, 38091, 38422, 38752, 39081, 39409, 39736,
+     40062, 40388, 40712, 41035, 41357, 41678, 41998, 42317,
+     42634, 42951, 43266, 43579, 43892, 44203, 44513, 44821,
+     45128, 45434, 45738, 46040, 46341, 46641, 46938, 47235,
+     47529, 47822, 48113, 48403, 48691, 48977, 49261, 49543,
+     49824, 50103, 50379, 50654, 50927, 51198, 51467, 51734,
+     51998, 52261, 52522, 52780, 53037, 53291, 53543, 53792,
+     54040, 54285, 54528, 54768, 55007, 55243, 55476, 55707,
+     55936, 56162, 56386, 56607, 56826, 57042, 57255, 57466,
+     57675, 57881, 58084, 58284, 58482, 58677, 58870, 59059,
+     59246, 59430, 59612, 59790, 59966, 60139, 60309, 60476,
+     60640, 60802, 60960, 61116, 61268, 61418, 61564, 61708,
+     61849, 61986, 62121, 62252, 62381, 62506, 62628, 62747,
+     62864, 62976, 63086, 63193, 63296, 63397, 63494, 63588,
+     63678, 63766, 63850, 63931, 64009, 64084, 64155, 64223,
+     64288, 64350, 64408, 64463, 64515, 64563, 64608, 64650,
+     64689, 64724, 64756, 64784, 64810, 64831, 64850, 64865
+     },
+    {64877, 64886, 64891, 64893, 64892, 64887, 64879, 64867,
+     64852, 64834, 64813, 64788, 64760, 64728, 64694, 64656,
+     64614, 64569, 64521, 64470, 64415, 64357, 64296, 64231,
+     64163, 64092, 64018, 63940, 63859, 63775, 63687, 63597,
+     63503, 63406, 63305, 63202, 63095, 62985, 62872, 62756,
+     62636, 62513, 62388, 62259, 62127, 61992, 61854, 61712,
+     61568, 61421, 61270, 61117, 60960, 60801, 60639, 60473,
+     60305, 60134, 59960, 59783, 59603, 59420, 59234, 59046,
+     58854, 58660, 58463, 58264, 58061, 57856, 57648, 57438,
+     57225, 57009, 56790, 56569, 56346, 56119, 55891, 55659,
+     55426, 55189, 54950, 54709, 54466, 54220, 53971, 53720,
+     53467, 53212, 52954, 52694, 52432, 52168, 51901, 51633,
+     51362, 51089, 50814, 50537, 50258, 49976, 49693, 49408,
+     49121, 48832, 48541, 48249, 47954, 47658, 47360, 47060,
+     46758, 46455, 46150, 45843, 45535, 45225, 44914, 44601,
+     44287, 43971, 43654, 43335, 43015, 42694, 42371, 42047,
+     41722, 41395, 41067, 40738, 40408, 40077, 39745, 39411,
+     39077, 38741, 38405, 38067, 37729, 37390, 37050, 36709,
+     36367, 36025, 35682, 35338, 34993, 34648, 34302, 33956,
+     33609, 33262, 32914, 32565, 32216, 31867, 31517, 31167,
+     30817, 30466, 30116, 29765, 29413, 29062, 28710, 28359,
+     28007, 27655, 27303, 26951, 26600, 26248, 25896, 25545,
+     25193, 24842, 24491, 24141, 23790, 23440, 23091, 22741,
+     22392, 22044, 21696, 21348, 21001, 20654, 20308, 19963,
+     19618, 19274, 18931, 18588, 18246, 17904, 17564, 17224,
+     16885, 16547, 16210, 15874, 15539, 15205, 14871, 14539,
+     14208, 13878, 13549, 13221, 12894, 12569, 12244, 11921,
+     11599, 11279, 10959, 10641, 10325, 10009, 9695, 9383,
+     9072, 8762, 8454, 8147, 7842, 7539, 7237, 6936,
+     6638, 6340, 6045, 5751, 5459, 5168, 4880, 4593,
+     4308, 4024, 3743, 3463, 3185, 2909, 2635, 2362,
+     2092, 1824, 1557, 1293, 1030, 769, 511, 254
+     },
+    {0, -252, -503, -751, -997, -1241, -1483, -1723,
+     -1960, -2196, -2429, -2660, -2889, -3115, -3340, -3562,
+     -3782, -3999, -4215, -4428, -4638, -4847, -5053, -5257,
+     -5458, -5657, -5854, -6048, -6240, -6430, -6617, -6802,
+     -6985, -7165, -7343, -7518, -7691, -7861, -8029, -8195,
+     -8358, -8519, -8677, -8833, -8986, -9137, -9285, -9431,
+     -9575, -9716, -9854, -9991, -10124, -10255, -10384, -10510,
+     -10634, -10755, -10874, -10990, -11104, -11216, -11324, -11431,
+     -11535, -11636, -11736, -11832, -11926, -12018, -12107, -12194,
+     -12279, -12361, -12440, -12517, -12592, -12664, -12734, -12802,
+     -12867, -12929, -12990, -13048, -13103, -13156, -13207, -13256,
+     -13302, -13346, -13387, -13427, -13463, -13498, -13530, -13561,
+     -13588, -13614, -13637, -13658, -13677, -13694, -13708, -13721,
+     -13731, -13739, -13744, -13748, -13750, -13749, -13746, -13741,
+     -13735, -13726, -13715, -13702, -13687, -13670, -13651, -13630,
+     -13607, -13582, -13555, -13526, -13495, -13463, -13428, -13392,
+     -13354, -13314, -13272, -13229, -13184, -13136, -13088, -13037,
+     -12985, -12931, -12875, -12818, -12759, -12699, -12637, -12573,
+     -12508, -12441, -12372, -12303, -12231, -12158, -12084, -12008,
+     -11931, -11853, -11773, -11692, -11609, -11525, -11440, -11353,
+     -11266, -11177, -11086, -10995, -10902, -10808, -10714, -10617,
+     -10520, -10422, -10323, -10222, -10121, -10019, -9915, -9811,
+     -9706, -9599, -9492, -9384, -9275, -9166, -9055, -8944,
+     -8832, -8719, -8605, -8491, -8376, -8260, -8144, -8027,
+     -7910, -7791, -7673, -7553, -7433, -7313, -7192, -7071,
+     -6949, -6827, -6704, -6581, -6458, -6334, -6210, -6086,
+     -5961, -5836, -5711, -5585, -5459, -5334, -5208, -5081,
+     -4955, -4829, -4702, -4575, -4449, -4322, -4195, -4068,
+     -3942, -3815, -3688, -3562, -3435, -3309, -3183, -3056,
+     -2930, -2805, -2679, -2554, -2429, -2304, -2179, -2055,
+     -1931, -1807, -1683, -1560, -1438, -1315, -1194, -1072,
+     -951, -830, -710, -591, -471, -353, -235, -117
+     },
+    {0, 116, 232, 348, 462, 576, 690, 803,
+     915, 1026, 1137, 1247, 1356, 1465, 1572, 1679,
+     1786, 1891, 1996, 2100, 2203, 2305, 2406, 2507,
+     2607, 2705, 2803, 2900, 2996, 3092, 3186, 3279,
+     3372, 3463, 3554, 3643, 3732, 3819, 3906, 3991,
+     4076, 4159, 4242, 4323, 4403, 4483, 4561, 4638,
+     4714, 4789, 4863, 4936, 5008, 5078, 5148, 5216,
+     5284, 5350, 5415, 5479, 5542, 5603, 5664, 5723,
+     5781, 5838, 5894, 5949, 6002, 6055, 6106, 6156,
+     6205, 6253, 6299, 6344, 6388, 6431, 6473, 6514,
+     6553, 6591, 6628, 6664, 6699, 6732, 6764, 6795,
+     6825, 6854, 6881, 6908, 6933, 6957, 6980, 7001,
+     7022, 7041, 7059, 7076, 7091, 7106, 7119, 7132,
+     7143, 7153, 7162, 7169, 7176, 7181, 7185, 7188,
+     7191, 7191, 7191, 7190, 7187, 7184, 7179, 7174,
+     7167, 7159, 7150, 7140, 7129, 7117, 7104, 7090,
+     7074, 7058, 7041, 7023, 7003, 6983, 6962, 6940,
+     6916, 6892, 6867, 6841, 6814, 6786, 6757, 6728,
+     6697, 6665, 6633, 6599, 6565, 6530, 6494, 6457,
+     6420, 6381, 6342, 6302, 6261, 6220, 6177, 6134,
+     6090, 6045, 6000, 5954, 5907, 5859, 5811, 5762,
+     5713, 5662, 5611, 5560, 5507, 5455, 5401, 5347,
+     5292, 5237, 5181, 5125, 5068, 5011, 4953, 4894,
+     4835, 4776, 4716, 4656, 4595, 4533, 4472, 4409,
+     4347, 4284, 4220, 4157, 4093, 4028, 3963, 3898,
+     3833, 3767, 3701, 3635, 3568, 3501, 3434, 3366,
+     3299, 3231, 3163, 3095, 3026, 2958, 2889, 2820,
+     2751, 2682, 2613, 2543, 2474, 2404, 2335, 2265,
+     2195, 2125, 2055, 1986, 1916, 1846, 1776, 1706,
+     1637, 1567, 1497, 1428, 1358, 1289, 1219, 1150,
+     1081, 1012, 943, 875, 806, 738, 670, 602,
+     534, 466, 399, 332, 265, 198, 132, 66
+     },
+    {0, -66, -131, -196, -260, -325, -389, -453,
+     -516, -579, -641, -704, -766, -827, -888, -949,
+     -1009, -1069, -1129, -1188, -1246, -1304, -1362, -1419,
+     -1476, -1533, -1588, -1644, -1699, -1753, -1807, -1860,
+     -1913, -1965, -2017, -2068, -2119, -2169, -2219, -2268,
+     -2316, -2364, -2412, -2458, -2505, -2550, -2595, -2640,
+     -2683, -2727, -2769, -2811, -2853, -2893, -2934, -2973,
+     -3012, -3050, -3088, -3125, -3161, -3197, -3232, -3266,
+     -3300, -3333, -3366, -3397, -3428, -3459, -3489, -3518,
+     -3546, -3574, -3601, -3627, -3653, -3678, -3703, -3726,
+     -3749, -3772, -3793, -3814, -3835, -3854, -3873, -3891,
+     -3909, -3926, -3942, -3958, -3972, -3987, -4000, -4013,
+     -4025, -4036, -4047, -4057, -4067, -4076, -4084, -4091,
+     -4098, -4104, -4109, -4114, -4118, -4122, -4124, -4127,
+     -4128, -4129, -4129, -4129, -4128, -4126, -4123, -4120,
+     -4117, -4113, -4108, -4102, -4096, -4089, -4082, -4074,
+     -4066, -4057, -4047, -4037, -4026, -4014, -4002, -3990,
+     -3977, -3963, -3949, -3934, -3918, -3903, -3886, -3869,
+     -3852, -3834, -3815, -3796, -3776, -3756, -3736, -3715,
+     -3693, -3671, -3649, -3626, -3602, -3578, -3554, -3529,
+     -3504, -3478, -3452, -3426, -3399, -3371, -3344, -3315,
+     -3287, -3258, -3229, -3199, -3169, -3139, -3108, -3077,
+     -3045, -3013, -2981, -2949, -2916, -2883, -2849, -2816,
+     -2782, -2748, -2713, -2678, -2643, -2608, -2572, -2536,
+     -2500, -2464, -2427, -2391, -2354, -2317, -2279, -2242,
+     -2204, -2166, -2128, -2090, -2051, -2013, -1974, -1935,
+     -1896, -1857, -1818, -1779, -1739, -1700, -1660, -1621,
+     -1581, -1541, -1501, -1461, -1421, -1381, -1341, -1301,
+     -1261, -1221, -1180, -1140, -1100, -1060, -1020, -980,
+     -939, -899, -859, -819, -779, -739, -700, -660,
+     -620, -581, -541, -502, -462, -423, -384, -345,
+     -306, -267, -229, -190, -152, -114, -76, -38
+     },
+    {0, 38, 75, 112, 149, 186, 223, 259,
+     295, 331, 367, 403, 438, 473, 508, 543,
+     577, 611, 645, 679, 712, 745, 778, 811,
+     843, 875, 907, 939, 970, 1001, 1031, 1062,
+     1092, 1121, 1151, 1180, 1209, 1237, 1265, 1293,
+     1320, 1347, 1374, 1401, 1427, 1453, 1478, 1503,
+     1528, 1552, 1576, 1600, 1623, 1646, 1669, 1691,
+     1713, 1734, 1755, 1776, 1797, 1817, 1836, 1855,
+     1874, 1893, 1911, 1928, 1946, 1963, 1979, 1995,
+     2011, 2027, 2042, 2056, 2070, 2084, 2098, 2111,
+     2123, 2136, 2148, 2159, 2170, 2181, 2191, 2201,
+     2211, 2220, 2229, 2237, 2245, 2252, 2260, 2266,
+     2273, 2279, 2284, 2290, 2295, 2299, 2303, 2307,
+     2310, 2313, 2316, 2318, 2320, 2321, 2322, 2323,
+     2323, 2323, 2323, 2322, 2321, 2320, 2318, 2316,
+     2313, 2310, 2307, 2303, 2299, 2295, 2291, 2286,
+     2280, 2275, 2269, 2263, 2256, 2249, 2242, 2234,
+     2226, 2218, 2210, 2201, 2192, 2182, 2173, 2163,
+     2152, 2142, 2131, 2120, 2108, 2097, 2085, 2072,
+     2060, 2047, 2034, 2021, 2007, 1993, 1979, 1965,
+     1950, 1936, 1921, 1905, 1890, 1874, 1858, 1842,
+     1826, 1809, 1793, 1776, 1758, 1741, 1724, 1706,
+     1688, 1670, 1652, 1633, 1615, 1596, 1577, 1558,
+     1539, 1519, 1500, 1480, 1460, 1440, 1420, 1400,
+     1380, 1360, 1339, 1318, 1298, 1277, 1256, 1235,
+     1214, 1192, 1171, 1150, 1128, 1107, 1085, 1064,
+     1042, 1020, 998, 976, 954, 933, 911, 888,
+     866, 844, 822, 800, 778, 756, 734, 711,
+     689, 667, 645, 623, 601, 579, 557, 534,
+     512, 490, 468, 446, 425, 403, 381, 359,
+     337, 316, 294, 273, 251, 230, 208, 187,
+     166, 145, 124, 103, 82, 62, 41, 20
+     },
+    {0, -20, -41, -61, -81, -100, -120, -140,
+     -159, -179, -198, -217, -236, -255, -274, -292,
+     -311, -329, -347, -365, -383, -401, -418, -435,
+     -453, -470, -487, -503, -520, -536, -552, -569,
+     -584, -600, -616, -631, -646, -661, -676, -690,
+     -705, -719, -733, -747, -761, -774, -787, -800,
+     -813, -826, -838, -851, -863, -875, -886, -898,
+     -909, -920, -931, -941, -952, -962, -972, -982,
+     -992, -1001, -1010, -1019, -1028, -1036, -1045, -1053,
+     -1061, -1068, -1076, -1083, -1090, -1097, -1104, -1110,
+     -1117, -1123, -1128, -1134, -1139, -1144, -1149, -1154,
+     -1159, -1163, -1167, -1171, -1175, -1178, -1181, -1185,
+     -1187, -1190, -1193, -1195, -1197, -1199, -1200, -1202,
+     -1203, -1204, -1205, -1206, -1206, -1206, -1206, -1206,
+     -1206, -1205, -1205, -1204, -1203, -1202, -1200, -1198,
+     -1197, -1195, -1193, -1190, -1188, -1185, -1182, -1179,
+     -1176, -1172, -1169, -1165, -1161, -1157, -1153, -1149,
+     -1144, -1139, -1134, -1129, -1124, -1119, -1114, -1108,
+     -1102, -1096, -1090, -1084, -1078, -1071, -1065, -1058,
+     -1051, -1044, -1037, -1030, -1022, -1015, -1007, -1000,
+     -992, -984, -976, -968, -959, -951, -942, -934,
+     -925, -916, -907, -899, -889, -880, -871, -862,
+     -852, -843, -833, -823, -814, -804, -794, -784,
+     -774, -764, -754, -744, -733, -723, -713, -702,
+     -692, -681, -671, -660, -649, -638, -628, -617,
+     -606, -595, -584, -573, -562, -551, -540, -529,
+     -518, -507, -496, -485, -474, -463, -452, -441,
+     -429, -418, -407, -396, -385, -374, -363, -352,
+     -340, -329, -318, -307, -296, -285, -274, -263,
+     -252, -241, -230, -219, -208, -198, -187, -176,
+     -165, -155, -144, -133, -123, -112, -102, -91,
+     -81, -71, -60, -50, -40, -30, -20, -10
+     },
+    {0, 10, 20, 29, 39, 49, 58, 68,
+     77, 87, 96, 105, 114, 123, 132, 141,
+     150, 159, 167, 176, 184, 193, 201, 209,
+     218, 226, 234, 242, 249, 257, 265, 272,
+     280, 287, 295, 302, 309, 316, 323, 330,
+     336, 343, 349, 356, 362, 368, 375, 381,
+     386, 392, 398, 404, 409, 415, 420, 425,
+     430, 435, 440, 445, 450, 454, 459, 463,
+     468, 472, 476, 480, 484, 488, 491, 495,
+     498, 502, 505, 508, 511, 514, 517, 520,
+     523, 525, 528, 530, 532, 534, 537, 539,
+     540, 542, 544, 545, 547, 548, 550, 551,
+     552, 553, 554, 554, 555, 556, 556, 557,
+     557, 557, 557, 557, 557, 557, 557, 557,
+     556, 556, 555, 555, 554, 553, 552, 551,
+     550, 549, 548, 546, 545, 544, 542, 540,
+     539, 537, 535, 533, 531, 529, 527, 525,
+     522, 520, 518, 515, 513, 510, 507, 504,
+     502, 499, 496, 493, 490, 487, 483, 480,
+     477, 474, 470, 467, 463, 460, 456, 452,
+     449, 445, 441, 437, 433, 429, 425, 421,
+     417, 413, 409, 405, 401, 396, 392, 388,
+     383, 379, 374, 370, 366, 361, 356, 352,
+     347, 343, 338, 333, 329, 324, 319, 314,
+     310, 305, 300, 295, 290, 285, 280, 275,
+     271, 266, 261, 256, 251, 246, 241, 236,
+     231, 226, 221, 216, 211, 206, 201, 196,
+     191, 186, 181, 176, 171, 166, 161, 156,
+     151, 146, 141, 136, 131, 126, 122, 117,
+     112, 107, 102, 97, 92, 88, 83, 78,
+     73, 68, 64, 59, 54, 50, 45, 40,
+     36, 31, 27, 22, 18, 13, 9, 4
+     },
+    {0, -4, -9, -13, -17, -22, -26, -30,
+     -34, -38, -42, -46, -50, -54, -58, -62,
+     -66, -70, -74, -78, -82, -85, -89, -93,
+     -96, -100, -103, -107, -110, -114, -117, -121,
+     -124, -127, -130, -134, -137, -140, -143, -146,
+     -149, -152, -155, -158, -161, -163, -166, -169,
+     -172, -174, -177, -179, -182, -184, -187, -189,
+     -191, -194, -196, -198, -200, -202, -205, -207,
+     -209, -211, -212, -214, -216, -218, -220, -221,
+     -223, -225, -226, -228, -229, -231, -232, -233,
+     -235, -236, -237, -238, -240, -241, -242, -243,
+     -244, -245, -246, -246, -247, -248, -249, -249,
+     -250, -251, -251, -252, -252, -253, -253, -253,
+     -254, -254, -254, -255, -255, -255, -255, -255,
+     -255, -255, -255, -255, -255, -255, -254, -254,
+     -254, -254, -253, -253, -252, -252, -252, -251,
+     -250, -250, -249, -249, -248, -247, -246, -246,
+     -245, -244, -243, -242, -241, -240, -239, -238,
+     -237, -236, -235, -234, -233, -232, -230, -229,
+     -228, -226, -225, -224, -222, -221, -219, -218,
+     -217, -215, -213, -212, -210, -209, -207, -205,
+     -204, -202, -200, -198, -197, -195, -193, -191,
+     -189, -188, -186, -184, -182, -180, -178, -176,
+     -174, -172, -170, -168, -166, -163, -161, -159,
+     -157, -155, -153, -151, -148, -146, -144, -142,
+     -139, -137, -135, -132, -130, -128, -125, -123,
+     -121, -118, -116, -114, -111, -109, -106, -104,
+     -102, -99, -97, -94, -92, -89, -87, -84,
+     -82, -79, -77, -74, -72, -69, -67, -64,
+     -62, -59, -56, -54, -51, -49, -46, -44,
+     -41, -39, -36, -33, -31, -28, -26, -23,
+     -21, -18, -15, -13, -10, -8, -5, -3
+     }
+};
diff --git a/apps/sinc.h b/apps/sinc.h
new file mode 100644
index 0000000..ebb2fcd
--- /dev/null
+++ b/apps/sinc.h
@@ -0,0 +1,6 @@
+#ifndef _SINC_H
+#define _SINC_H
+
+extern int32_t sinc[15][256];
+
+#endif
diff --git a/tools/generate_sinc.m b/tools/generate_sinc.m
new file mode 100644
index 0000000..aa0d7b3
--- /dev/null
+++ b/tools/generate_sinc.m
@@ -0,0 +1,24 @@
+fid = fopen('rb_sinc.c','w'); 
+
+sincv = (-7:1/256:+8);
+sincv = sinc(sincv);
+sincv = sincv .* hamming(3841)';
+%sincv(3841+1:3841+256) = 0;
+fprintf(fid, "int32_t sinc[15][256] = {\n");
+
+for i = 0:14
+	fprintf(fid, "	{");
+	for j = 1:256
+		fprintf(fid, "%d", round(sincv(i*256 + j) * 65536));
+		if ( j != 256) fprintf(fid, ", "); endif;
+		if ( mod(j, 8) == 0 ) fprintf (fid, "\n	 "); endif;
+	endfor
+	if ( i != 14)
+		fprintf(fid, "},\n");
+	else
+		fprintf(fid, "}\n");
+	endif;
+endfor
+fprintf(fid, "};\n");
+
+fclose(fid);
