I am building a sensor and I am trying to understand how to process the signal that it generates. The sensor has a library of reference signals. When 'event a' occurs, it produces signal A, when 'event B' occurs it produces signal B. EX:
It is possible for multiple (but few) events to occur, and their signals would add together linearly. I am looking for an algorithm for signal decomposition which takes advantage of the fact that the decomposition is discrete (It can give integer multiples of the library signals only). I also need some measure of the reliability of the identification.
Example Output: A + 2 B - 95% confidence A + B - 3% confidence A - 1% confidence None of the Above - 1% confidence
I've noticed that I can compare two different possibilities by taking an inner product of the normalized proposed solution and input signals. For instance:
Input Signal . (A + 2 B) = 0.999
Input Signal . (A + B) = 0.985
So the first solution is a closer match to the input signal. I thought about using a Newton-Raphson to maximize this inner product, but when the actual sensor is in use it could have 1000s of signals in it's library and that would not be realistic.