It is described the global architecture of a digital pulse processing system for high resolution X-Ray spectroscopy based on single photon detection and photon energy measurement. The core of the system is implemented in a modern hybrid device (Xilinx Zynq) that integrates an FPGA fabric along with a dual core 32-bits processor (ARM Cortex). It is also described the adopted strategy to deal with high input photon rates while preserving a good energy resolution. The digital performance of the system is ultimate determined by few key functional blocks including two finite impulse response filters and an algorithmic state machine. It is presented a numerical procedure to optimize the digital filters according to different constrain...