Study of field shifts of Ramsey resonances on ultracold atoms and ions