A system for performing irreversible electroporation during heart refractory period, the system comprising: an ablation catheter; a first plurality of electrodes fitted on the catheter and configured to sense intra-cardiac ECG signals at an ablation site; a second plurality of electrodes configured to be coupled to a surface of the patient and configured to sense body-surface ECG signals of the patient heart; an interface, which is configured to receive multiple electrocardiogram signals of the patient heart, wherein the interface is configured to receive (i) the IC ECG signals, and (ii) the BS ECG signals; an irreversible electroporation pulse generator configured to apply one or more bipolar IRE pulses between a pair of the first plurality of electrodes; and a processor, which is configured, based on the received ECG signals, to check whether one or more of the IC ECG signals and/or the BS ECG signals are indicative of a sinus rhythm pulse, wherein when none of the ECG signals are indicative of a sinus rhythm pulse, the processor is configured to continue to check whether additional IC and BS ECG signals acquired are indicative of a sinus rhythm pulse, and wherein when one or more of the ECG signals are indicative of a sinus rhythm pulse the processor is configured to: detect a refractory period of the patient heart by indicating a sinus rhythm in at least one of the received ECG signals, and control the irreversible electroporation pulse generator to apply IRE pulses to tissue at the ablation site during the detected refractory period. an ablation catheter; a first plurality of electrodes fitted on the catheter and configured to sense intra-cardiac ECG signals at an ablation site; a second plurality of electrodes configured to be coupled to a surface of the patient and configured to sense body-surface ECG signals of the patient heart; an interface, which is configured to receive multiple electrocardiogram signals of the patient heart, wherein the interface is configured to receive (i) the IC ECG signals, and (ii) the BS ECG signals; an irreversible electroporation pulse generator configured to apply one or more bipolar IRE pulses between a pair of the first plurality of electrodes; and a processor, which is configured, based on the received ECG signals, to check whether one or more of the IC ECG signals and/or the BS ECG signals are indicative of a sinus rhythm pulse, wherein when none of the ECG signals are indicative of a sinus rhythm pulse, the processor is configured to continue to check whether additional IC and BS ECG signals acquired are indicative of a sinus rhythm pulse, and wherein when one or more of the ECG signals are indicative of a sinus rhythm pulse the processor is configured to: detect a refractory period of the patient heart by indicating a sinus rhythm in at least one of the received ECG signals, and control the irreversible electroporation pulse generator to apply IRE pulses to tissue at the ablation site during the detected refractory period. detect a refractory period of the patient heart by indicating a sinus rhythm in at least one of the received ECG signals, and control the irreversible electroporation pulse generator to apply IRE pulses to tissue at the ablation site during the detected refractory period.