Commit dc83ef34 authored by fleur's avatar fleur
Browse files

hpf only on for finger mode

parent 3cc52e92
......@@ -62,8 +62,11 @@ def update_history(datasets):
global history, moving_average, alpha, beta, last_sample_count
last_sample_count = len(datasets)
for val in datasets:
history.append(val - moving_average)
moving_average = (alpha * moving_average + beta * val) / (alpha + beta)
if current_mode == MODE_FINGER:
history.append(val - moving_average)
moving_average = (alpha * moving_average + beta * val) / (alpha + beta)
else:
history.append(val)
# trim old elements
history = history[-HISTORY_MAX:]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment