Development of a signal processing software for scintillation detectors and implementation on an FPGA for fast sensing