  In single spin Magnetic Resonance Force Microscopy (MRFM), the objective is
to detect the presence of an electron (or nuclear) spin in a sample volume by
measuring spin-induced attonewton forces using a micromachined cantilever. In
the OSCAR method of single spin MRFM, the spins are manipulated by an external
rf field to produce small periodic deviations in the resonant frequency of the
cantilever. These deviations can be detected by frequency demodulation followed
by conventional amplitude or energy detection. In this paper, we present an
alternative to these detection methods, based on optimal detection theory and
Gibbs sampling. On the basis of simulations, we show that our detector
outperforms the conventional amplitude and energy detectors for realistic MRFM
operating conditions. For example, to achieve a 10% false alarm rate and an 80%
correct detection rate our detector has an 8 dB SNR advantage as compared with
the conventional amplitude or energy detectors. Furthermore, at these detection
rates it comes within 4 dB of the omniscient matched-filter lower bound.
