If you like torturing with math, than use a FIR filter routine with symmetric impules response based on some hundreds of samples, that should solve it fair enough … and with those 4096 sample waveform it should not calculate forever.
If you like torturing with math, than use a FIR filter routine with symmetric impules response based on some hundreds of samples, that should solve it fair enough … and with those 4096 sample waveform it should not calculate forever.