I'm struggling to find a smart way to detect the beginning and end of a pulse train on MATLAB/Simulink. I'm working with real digital signals with unknown and variable periodicity. Can anyone suggest me a smart way to perform this operation and get a decent approximation of the red signal in the figure? Thanks a lot!
Edit : I forgot to point out that the operation needs to be performed online.
