Salut Cyrille,
hello,
i've just read the original article from 1983 describing KS algo, including decay stretching. as far as i understand, averaging the last 2 sample is a very optimized low pass iir filter at fixed frequency. the decay stretching allow to change the filter cutoff. now that processing power allow to easily compute filter at different frequency, I would suggest to replace the averaging algo with a simple lop~ filter and experiment with the cutoff frequency.
I am looking into this because the paper seems to give a relation of that filter to the period length (pitch) that allows for constant decay amongst low and hight pitches. I understand that they switch randomly between a 2-sample-average filter, and the unmodified version of the delay on a sample-per sample basis. Perhaps this is a crude 1983 way of moving the filter cutoff frequency upwards and should indeed be done in a different way today.
cheers, P