YIN pitch estimation algoritm-simplified explanation
There is an older question about YIN where I am expressing lack of impressing.  The only thing that is novel in YIN is the Cumulative mean normalized difference
function (Step 3):



what is plotted above is the Average Squared Difference Function (ASDF) which is similar to the older AMDF.  the purpose of this Cumulative mean normalized difference function is to normalize the result (for the purpose of a threshold), and to do something to avoid picking the null at a lag of 0 samples from being picked as the lag for the best match.  they could have just said they won't start searching for the lag with the lowest null (or the null they want for the purpose of measuring the period) after the first lag that has a sign change for the slope.  that would be the first peak, and then they can start searching for the lowest null without worrying about picking the null at zero.

i'm not impressed with YIN.  i think i have a better idea for avoiding picking the wrong peak.

here's another one.

think of the Autocorrelation function as an upside-down ASDF.  so then you're looking for peaks instead of valleys.

UPDATE:

as per request, Step 5, parabolic interpolation of peaks (or valleys) is discussed in this answer and the Julius Smith reference therein.  it is for getting sub-sample precision from the ACF evaluated at discrete lags.

step 6 is about avoiding picking the wrong peak and avoiding indecisively switching back-and-forth between candidate peaks.  this is usually what we call "the Octave Problem".  i discuss it in this answer.  the YIN paper one identifies the problem and does not satisfactorally deal with it.