Recently, a novel CdTe photon counting x-ray detector (PCXD) with energy discrimination capabilities has been developed [1, 2]. When such detectors are operated under a high count rate, however, coincident pulses and tails of pulses distort the recorded energy spectrum. These distortions are called pulse pileup effects. It is essential to compensate for these effects on the recorded energy spectrum in order to take a full advantage of spectral information PCXDs provide. In this study, we have developed a new analytical pulse pileup model which uses a model of the measured pulse shape measured for a PCXD [1, 2]. We validated the model using Monte Carlo simulations of monochromatic and polychromatic spectra compared to predictions from our model. Excellent agreement was found between the recorded spectra obtained by the MC simulations and those calculated by our analytical model.