Help me in understanding smoothing
Your recursive smoothing equation will respond slowly to sudden fluctuations (that's why it's called smoothing!).

Try and change to:

alphaDTildS(i) = 0.7 + 0.3 * pDashS(i);

That should make it closer to the underlying signal - but also less "smooth"