An algorithm for spectral reconstructions (unfolds) and spectrally integrated flux estimates from data obtained by a five-channel, filtered x-ray-detector array (XRD) is described in detail and characterized. This diagnostic is a broad-channel spectrometer, used primarily to measure time-dependent soft x-ray flux emitted by z-pinch plasmas at the Z pulsed-power accelerator (Sandia National Laboratories, Albuquerque, New Mexico, USA), and serves as both a plasma probe and a gauge of accelerator performance. The unfold method, suitable for online analysis, arises naturally from general assumptions about the x-ray source and spectral properties of the channel responses; a priori constraints control the illposed nature of the inversion. The unfolded spectrum is not assumed to be Planckian. This study is divided into two consecutive papers. This paper considers three major issues: (a) Formulation of the unfold method.-The mathematical background, assumptions, and procedures leading to the algorithm are described: the spectral reconstruction S unfold ðE; tÞ-five histogram x-ray bins j over the x-ray interval, 137 E 2300 eV at each time step t-depends on the shape and overlap of the calibrated channel responses and on the maximum electrical power delivered to the plasma. The x-ray flux F unfold is estimated as R S unfold ðE; tÞdE. (b) Validation with simulations.-Tests of the unfold algorithm with known static and time-varying spectra are described. These spectra included-but were not limited to-Planckian spectra S bb ðE; TÞ (25 T 250 eV), from which noise-free channel data were simulated and unfolded. For Planckian simulations with 125 T 250 eV and typical responses, the binwise unfold values S j and the corresponding binwise averages hS bb i j agreed to $20%, except where S bb ( maxfS bb g. Occasionally, unfold values S j & 0 (artifacts) were encountered. The algorithm recovered * 90% of the x-ray flux over the wider range, 75 T 250 eV. For lower T, the test and unfolded spectra increasingly diverged as larger fractions of S bb ðE; TÞ fell below the detection threshold ($ 137 eV) of the diagnostic. (c) Comparison with other analyses and diagnostics.-The results of the histogram algorithm are compared with other analyses, including a test with data acquired by the DANTE filtered-XRD array at the NOVA laser facility. Overall, the histogram algorithm is found to be most useful for x-ray flux estimates, as opposed to spectral details. The following companion paper [D. L. Fehl et al., Phys. Rev. ST Accel. Beams 13, 120403 (2010)] considers (a) uncertainties in S unfold and F unfold induced by both data noise and calibrational errors in the response functions; and (b) generalization of the algorithm to arbitrary spectra. These techniques apply to other diagnostics with analogous channel responses and supported by unfold algorithms of invertible matrix form.