Gradient localized spectroscopy techniques suffer from a well documented spatial localization error caused by the difference in chemical shifts between resonances. This results in the acquisition of spectra from partially overlapping spatial regions of the sample, with each resonance representing a different region. The image-selected in vivo spectroscopy technique uses hyperbolic secant inversion pulses, where the main limitation in reducing this error is in the RF power available for application of the selective RF pulse. This spatial localization error may be dramatically reduced by increasing, and temporally shaping, the gradient pulse during slice-selective spin inversion. The performance of these RF pulses have been experimentally verified.