Effects of the medium in NMR