Miniature nuclear magnetic resonance spectrometer using a partially enclosed permanent magnet