Analytical and numerical investigation of finite and infinite periodic lattices for mitigation of seismic waves in layered grounds