In optical spectroscopic systems where unwanted optical scattering cannot be eliminated, Fabry-Pérot etalons cause unpredictable changes in the spectral background. Frequent system calibration is then required to maintain the desired measurement accuracy, which presents a major limitation to the spectrometer. We introduce a computational approach to mitigate the adverse effects of optical fringing without hardware modifications. Motivated by experimental observations of complicated fringe behaviors, we simplify the problem by decomposing the fringe background into component etalons that can be addressed according to their individual characteristics. The effectiveness of the proposed method is demonstrated on a silicon photonic methane sensor, where accurate measurements of methane concentration are obtained from spectral data strongly affected by optical fringes.