Week10
Week 10 Progress: Exponential Moving Average and Trend Detection
Objective
To apply signal processing techniques to smooth ADC data and detect abnormal trends that may suggest ankle swelling. The techniques include:
-
Short-term smoothing using EMA (Exponential Moving Average)
-
Long-term trend detection by evaluating the slope of consecutive filtered values
What is EMA?
The Exponential Moving Average is a recursive smoothing filter calculated by:
Where:
-
is the current data point
-
is the smoothing constant (0 < α < 1)
A lower α means stronger smoothing but slower response.
Implementation Details
1. Short-Term EMA (Real-Time Filtering)
- Applied on 200 averaged samples every 2 seconds.
- Removes noise from breathing, minor twitches, or slight sensor jitter.
- Samples are further passed through another EMA with a lower alpha (0.1) for trend detection.
Trend Detection Logic
When the system is in the STATIONARY state, the firmware tracks the slope of filtered values every 15 seconds.
If three consecutive values form a strictly decreasing sequence, swelling is assumed:
- A trend window is maintained using a sliding array.
- If conditions are met, alarmTriggered = true.
Results
| Module | Outcome |
|---|---|
EMA filter | Real-time signal became significantly smoother and more stable |
Long-term tracking | Allowed safe and low-noise detection of physiological changes |
| Alarm logic | Only triggered under clear, sustained declines in signal (fewer false positives) |




Comments
Post a Comment