The question about the precise value of the proton Larmor frequency in neuronal tissues is a major topic in current research. In this study we present a comprehensive answer for spins moving in magnetically heterogeneous media formed by impermeable susceptibility inclusions. We obtain an analytic result for the mean Larmor frequency in the limit of fast diffusing spins in the space external to the inclusions. This mean frequency explicitly depends on the correlation function of the inclusion. For anisotropic media this results in a nonzero frequency shift, which is confirmed by Monte Carlo simulations.