For shallow sources I usually use spectral analysis, applying the Fourier transform, then a bandpass filter and finally applying the inverse Fourier transform. You can see more details in my paper entitled 'Basement relief estimative of the Parnaíba basin´s west border through 2D gravity modelling'.
One very effective and simple technique is to do upward continuation. This produces the regional anomaly. subtracting the upward continued grid from the original grid produces the shallow structure. of course, for gravity data, you first need do the full bouguer corrections including terrain and for magnetic data it is better to first do terrain corrections for the magnetic data. Terrain corrections for magnetic data are done simply by simulating the response of the topographic model with a uniform susceptibility which is appropriate.