I’m trying to detect various features of a toy train track while driving on it:
The primary input is data from an optical sensor. The following image shows the recorded signal when driving over the railway switch (at the bottom of the pictured track) and the curved segment after it (click to enlarge):
I want to detect:
- the start/end of each track and
- the presence of switch tracks.
The first one is easy to extract from either the black or the blue signal using a few lines of C code. But I run into trouble as soon as I try to distinguish between a switch track center and a rounded male connector (like the one at the end of the switch track segment). Both produce relatively similar long, jagged drops in the blue and black curves and there’s significant variance across multiple runs.
I can distinguish these features quite well by looking at the graph, but I don’t know how to "pour" this into code that classifies reliably. I have no real background in signal processing or classification algorithms so I lack the vocabulary and intuition to even search for possible solutions.
I’m looking for online algorithms, i.e., they should classify these features while driving on the track. Ideally, it should be able to run on a small embedded computer, but I’d appreciate any pointers to techniques that might work, even if they might require more processing power.
Disclaimer: I’ve originally posted this question on the Signal Processing site but it seems that Cross Validated is a better fit.