1. A cardiac resynchronization system for delivering biventricular stimulation to the heart correlated with hemodynamic performance of the heart, comprising: a. at least one hemodynamic sensor for monitoring said hemodynamic performance of the heart; b. an atrial electrode and at least two ventricular electrodes, adapted to sense ventricular and atrial signals; c. a learning module comprising a spiking neural network processor adapted to learn to associate the ventricular-atrial intervals sensed by said electrodes with the hemodynamic performance sensed by said at least one hemodynamic sensor, and calculate ventricular-atrial intervals and replace said ventricular-atrial intervals calculated from the sensed ventricular and atrial signals with the learned associated ventricular-atrial intervals and cause delivery according to the learned associated ventricular-atrial intervals a biventricular stimulation to the heart during atrial fibrillation episodes, wherein said spiking neural network processor further comprises: I. an input layer temporal synchronizer performing a pre-processing stage of said hemodynamic performance of the heart sensed by said at least one hemodynamic sensor; II. a middle layer comprising of an array of dynamic synapses, wherein said dynamic synapses are grouped in columns, and III. an output layer comprising at least one integrate and fire neuron for each said dynamic synapse column of the middle layer, said at least one integrate and fire neuron being adapted to perform said learning to associate ventricular-atrial intervals with said hemodynamic performance of the heart; d. a micro controller for controlling said learning module, and e. at least one pulse generator and operational amplifier controlled by said micro controller for stimulating the heart with said biventricular stimulation.