Hey guys just wondering if anyone has any special way that they use to filter out noise via software. I am interfacing with something that transmits in this pattern so I cannot change the method of communication; just the way I determine the data.
LP=Long Pulse(Preamble Pulses, represent no data)
MP=Medium Pulse(Represents 0)
SP=Short Pulse(Represents 1)
Basically the communication stream will look like the following, except many more LP in the begining.
LP,LP,LP,LP,LP,LP,LP,LP,LP,LP,LP,LP,LP,LP,LP,SP,SP,MP,SP,MP,SP,SP,SP.
Basically the problem is I have noise creeping in and they sometimes are the same pulse sizes. I need to somehow filter them out so that I can determine the data that is within them.
If the spacing between pulses is constant, you could ignore any pulse that doesn’t start at approximately the right time.
If the data represents a slowly-varying value, you could ignore any received values that are too far from the previous one, until you receive several similar values in a row.
Nothing you can possibly do will eliminate all noise. Reliable communication requires an error-detecting or -correcting code in the data stream itself.
how about oversampling the stream. for example if you over sample it by a factor of twenty, then long pulse will probably have >15 highs, medium pulses between 8 and 13 and short pulses leass than 6 or some thing similar. there is another histogramming method, but i dont remember it just off my head right now