Skip to content
Snippets Groups Projects
Commit dc83ef34 authored by fleur's avatar fleur
Browse files

hpf only on for finger mode

parent 3cc52e92
No related branches found
No related tags found
No related merge requests found
...@@ -62,8 +62,11 @@ def update_history(datasets): ...@@ -62,8 +62,11 @@ def update_history(datasets):
global history, moving_average, alpha, beta, last_sample_count global history, moving_average, alpha, beta, last_sample_count
last_sample_count = len(datasets) last_sample_count = len(datasets)
for val in datasets: for val in datasets:
if current_mode == MODE_FINGER:
history.append(val - moving_average) history.append(val - moving_average)
moving_average = (alpha * moving_average + beta * val) / (alpha + beta) moving_average = (alpha * moving_average + beta * val) / (alpha + beta)
else:
history.append(val)
# trim old elements # trim old elements
history = history[-HISTORY_MAX:] history = history[-HISTORY_MAX:]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment