I used matlab to calculate the time Auto-correlation function for a polar return-to-zero waveform
to make sure that it has an ergodic property . I implemented the following formula as a function in matlab

I then got the following output Rxx(m) plotted versus the time shift (m or lags). I expected the output to be A^2 at n=0 according to analysis of polar RZ data shown here in page #10: https://homepages.wmich.edu/~bazuinb/ECE3800CMcG/Notes7_2.pdf
but in matlab it showed me the following output (with Rxx(m) = A^2/2 = 8 ).
Notice that the vector has 100 bits ,each bit is sampled 8 times(Tb=8ms) , that is 1x800 vector . I plotted it vs lags in ms but it may not be clear in the graph below .

so Can anyone explain this ?