In this article a method is suggested for restricting a sample (spatial localization) by preparing the magnetization with a phase-modulated radiofrequency pulse which inverts magnetization only over a very narrow range of radiofrequency field strengths. This is the most efficient method, in terms of sensitivity, of restricting the sample to improve rf homogeneity. The method is demonstrated by using it to improve the resolution obtained in a homonuclear dipolar decoupling experiment. (C) 2002 Elsevier Science.