Nonlinear dispersion relation in anharmonic periodic mass-spring and mass-in-mass systems