  Spectroscopy methods often require calculating the central frequency of a
resonance line, that is usually implemented by finding a best fit to the
spectrum by a line-shape function. Such an iterative procedure is slow and
requires an initial guess. We report an analytical method for calculating the
central frequency of a spectral line by using the mean value of its
frequencies, which are weighted by corresponding normalized intensities. We use
this method to calculate two-dimensional arrays of central frequencies from
parallely measured magnetic resonance spectra, which are optically detected by
a camera sensor in a thin layer of NV centers with superparamagnetic hemozoin
crystals on top of it. We demonstrate that our analytical method is more than
800 times faster than the fitting procedure without significant loss of
accuracy. For a 400x400 pixels sensing array, this method is almost
instantaneous, while fitting with the Lorentz function requires several minutes
of post-processing on a 4-core MacBook Pro. When a resonance is beyond the
spectral range, the amplitude-weighted-mean method does not fail, but it
alternates its center frequency proportionally to the mismatch distance. Our
method will be useful for spectroscopic applications that require high
performance of data processing, allowing their fast optimization, inline
processing and real-time output of results. It can also be used for automatic
analysis of single spectra, when accuracy of the frequency detection could be
slightly (<10%) reduced for sake of stability and simplicity of the data
processing.
