Filter-based spectrometers are widely used in the
diagnostics of laser-plasma-generated X/gamma-ray pulses. The highly
ill-conditioned characteristic of the filter-based spectrometer
response matrix is a primary factor limiting their measurement
accuracy. In this paper, the genetic algorithm is used to optimize
the configuration of the filter-based spectrometer to alleviate the
ill-conditioned response. The effectiveness of optimization was
investigated under different conditions such as different
measurement errors, different spectrum shapes and different
unfolding algorithms by numerical experiment. Furthermore, the
optimized and non-optimized filter stack spectrometer were
implemented and irradiated by X-ray tubes. These results show that
the optimization can effectively reduce the divergence of the
unfolded spectrum for continuous spectrum X-ray detection and
improve peak unfolding accuracy for monochromatic X-ray detection.