A computer-implemented method for monitoring diaphragmatic response to phrenic nerve stimulation, comprising, during phrenic nerve stimulation: - receiving in real-time a diaphragmatic compound motor action potential (CMAP) signal of a human patient; - computing a baseline value of a characteristic of the CMAP signal, the characteristic representing a diaphragmatic response intensity to phrenic nerve stimulation; - determining a threshold value of the characteristic, the threshold value representing a boundary of values of the characteristic indicative of upcoming diaphragmatic palsy, the determining of the threshold value including shifting the baseline value; - receiving in real-time an electrocardiogram (ECG) signal of the human patient; - repeating in real-time: ∘ detecting a QRS complex in the ECG signal; ∘ monitoring the CMAP signal; ∘ computing a real-time value of the characteristic, the real-time value of the characteristic being asynchronous to the QRS complex; ∘ comparing the real-time value to the threshold value; and ∘ outputting an alert when the threshold is passed, wherein: - the method comprises discarding, during the real-time computation of the real-time value of the characteristic, diaphragmatic responses synchronous to detected QRS complexes; and/or - the method further comprises commanding phrenic nerve stimulation, the method comprising triggering an occurrence of the phrenic nerve stimulation a predetermined amount of time after detection of an occurrence of the QRS complex such that a diaphragmatic response to the triggered occurrence of the phrenic nerve stimulation occurs and ends before a next occurrence of the QRS complex. - receiving in real-time a diaphragmatic compound motor action potential (CMAP) signal of a human patient; - computing a baseline value of a characteristic of the CMAP signal, the characteristic representing a diaphragmatic response intensity to phrenic nerve stimulation; - determining a threshold value of the characteristic, the threshold value representing a boundary of values of the characteristic indicative of upcoming diaphragmatic palsy, the determining of the threshold value including shifting the baseline value; - receiving in real-time an electrocardiogram (ECG) signal of the human patient; - repeating in real-time: ∘ detecting a QRS complex in the ECG signal; ∘ monitoring the CMAP signal; ∘ computing a real-time value of the characteristic, the real-time value of the characteristic being asynchronous to the QRS complex; ∘ comparing the real-time value to the threshold value; and ∘ outputting an alert when the threshold is passed, ∘ detecting a QRS complex in the ECG signal; ∘ monitoring the CMAP signal; ∘ computing a real-time value of the characteristic, the real-time value of the characteristic being asynchronous to the QRS complex; ∘ comparing the real-time value to the threshold value; and ∘ outputting an alert when the threshold is passed, - the method comprises discarding, during the real-time computation of the real-time value of the characteristic, diaphragmatic responses synchronous to detected QRS complexes; and/or - the method further comprises commanding phrenic nerve stimulation, the method comprising triggering an occurrence of the phrenic nerve stimulation a predetermined amount of time after detection of an occurrence of the QRS complex such that a diaphragmatic response to the triggered occurrence of the phrenic nerve stimulation occurs and ends before a next occurrence of the QRS complex. <EOS>