I have a signal that I sample at 500khz. I am trying to detect a rise, fall and the peak in the incoming data. The base of the peak could be for 250 usec or 2.5msec, amplitude could be 6db or 15db above the noise floor. I don't have good snr unfortunately. The dc level of the signal is not constant but move much more slower than the ac component.
At the decision point, I need to know the slope of the rise and fall. This is a hard realtime system and I really need to make a decision in the 100usec after the downward slope reach to dc level.
I am looking for suggestions how can I efficiently implement an algorithm that is decent.
Currently I do a running average (past 25 data points added together) and try to detect the trend. Once I detect the trend up I start seeking trend down and once I do that I collect perhaps another 50 samples and start calculating.
Noise now easily screws this algorithm, hence the question.
For the benefit of others, I have end up implementing a Moving Average followed by integrator. Moving average of past 64 data smoothed enough but lost rise to a degree, integrating last 8 values gained back the rise and I simply seek for rise and fall, later I did a linear regression for the slope. Works ok, not great but ok.