+void iceSimple_Filter(int *data, const size_t len, uint8_t k){
+// ref: http://www.edn.com/design/systems-design/4320010/A-simple-software-lowpass-filter-suits-embedded-system-applications
+// parameter K
+#define FILTER_SHIFT 4
+
+ int32_t filter_reg = 0;
+ int16_t input, output;
+ int8_t shift = (k <=8 ) ? k : FILTER_SHIFT;
+
+ for (int i = 0; i < len; ++i){
+
+ input = data[i];
+ // Update filter with current sample
+ filter_reg = filter_reg - (filter_reg >> shift) + input;
+
+ // Scale output for unity gain
+ output = filter_reg >> shift;
+ data[i] = output;
+ }
+}
+