From 21c34937937f27a89290f4377b4ff1801079e6ec Mon Sep 17 00:00:00 2001 From: FreeArtMan Date: Tue, 6 Oct 2015 20:53:28 +0100 Subject: Added new interface files --- filt/f_5th.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 filt/f_5th.c (limited to 'filt/f_5th.c') diff --git a/filt/f_5th.c b/filt/f_5th.c new file mode 100644 index 0000000..811fb18 --- /dev/null +++ b/filt/f_5th.c @@ -0,0 +1,32 @@ +#include "filt.h" + +void f_5th(int16_t *data, int length, int16_t *hist) +/* for half of interleaved data */ +{ + int i; + int16_t a, b, c, d, e, f; + a = hist[1]; + b = hist[2]; + c = hist[3]; + d = hist[4]; + e = hist[5]; + f = data[0]; + /* a downsample should improve resolution, so don't fully shift */ + data[0] = (a + (b+e)*5 + (c+d)*10 + f) >> 4; + for (i=4; i> 4; + } + /* archive */ + hist[0] = a; + hist[1] = b; + hist[2] = c; + hist[3] = d; + hist[4] = e; + hist[5] = f; +} \ No newline at end of file -- cgit v1.2.3