I'm confident that what I'm trying to do is textbook stuff, but I don't have the background to know what to look for, so I'm hoping someone will be kind enough to give me a reference so I can look up how to do this.
I'm playing with digital signals sent by radio. I receive essentially a series of values (in real time). These are actually the durations of pulses. I know that these durations are meant to be taken from a small set of actual values (it's actually ASK , but think morse code if that helps, so there are long and short pulses, and long and short gaps between them). Of course, the pulse durations have some noise/variability about them. I do not know in advance what the intended values are, but must determine this from the arriving data. As I build this model of the long and short pulses, it becomes possible to decode the rest of the transmission. (I suppose it would also be possible to go back historically and decode what came before, but I don't actually care about that).
EDIT:
I think this is simply a statistics problem. I now realize that the term I'm looking for is a "bimodal distribution". There will be long and short pulses, but I don't know either the mean lengths of these pulses, nor the standard deviations. I am confident that the separation between the longest short pulse and the shortest long pulse will be sufficient that there's no ambiguity about it after a quite modest amount of data has arrived, but I don't know what those mean values will be. Anyway, I suppose I'm trying to work out how to calculate two averages off the same distribution, being the average of the longer pulses, and the average of the shorter. I know how to handle a single average, but never learned to deal with this situation.
I'm beginning to see how I might handle it, a function that accepts the previous data, and this value, and returns an indication of which "group" the current value seems to belong to, and some kind of indication of the confidence level of the grouping. But again, I'm sure this has been done before, and reinventing wheels isn't really smart (even if it's fun sometimes!)
What's the algorithm I should be using to do this? I need to be determining the center points of the duration values as the data arrives, so that future durations can be categorized "live".
Also, at this point, I don't even know what to tag this question as! Suggesions would be welcome as I was forced to add something and just had to make a (bad) guess :(