A method to utilize CdZnTe (CZT) detectors in diagnostic x-ray spectroscopy is described in this article. Spectral distortion due to transmission of primary x rays, the escape of cadmium- and tellurium-K fluorescent x rays, and tailing was severe in measured x-ray spectra. Therefore, correction for the distortion was performed with the stripping method using response functions. The response fun...