Update 2: Stroke Counter First PassI imported a sample set I collected of a simulated kayak sitting on the deck. Then I wrote a PaddleCounter class that I can feed accelerometer into. The class calculates the stroke count as it processes the incoming accelerometer data.
This data then needs to be displayed in the awesome UI I cooked up on a budget. Ok, it never cost me anything and it shows, but you get the picture.
Collecting Samples During a Session
I decided to go with NSNotifications to send out stroke updates from the PaddleCounter class. So, when the PaddleCounter detects a stroke it will send a notification that the main ViewController can then use to display the stroke change.
Testing the Stroke Counter
I want to make testing the stroke counter as easy as possible. I plan to collect different samples and track the number of strokes. Then algorithm development will go like this:
- Feed my samples into the stroke counter algorithm.
- Compare what it dumps out with the expected number of strokes.
- Tweak algorithm, rinse, repeat.
My first stroke counter at about 1 AM sucked and came out with terrible results. What to do?
Charting the Samples
Ok, I was trying to eyeball the samples and hence it was hard to track the trends. So, I need to chart these samples to better understand the data I am getting.
Before I try to rewrite the stroke counter I am puttingthe samples on a chart. For this I am going to use ios-charts by Daniel Cohen Gindi to draw my sample set so I can look for trends.
Here's the new UI with the raw data in the chart and then a zoom in on section:
|Samples with Default Zoom|
|Samples Zoomed In|