An apparatus for heartbeat detection, comprising: means for forming a first amplified signal and a second amplified signal on the basis of an input signal representative of heartbeat, which can be for example an electrocardiogram signal, means for forming a third signal by inverting the second signal and adding a base voltage, and means for indicating an overlap of the first signal and the third signal. The first, second and third amplifying means may be in the form of first, second and third amplifiers, the first amplifying the input heartbeat signal, the second connected to an output of the first and the third connected to an output of the first and to a base voltage source. A first comparator may be configured to indicate an R-wave in response to the overlap. A second comparator may connected to an output of the third amplifier and a reference voltage source to detect an S-wave exceeding a threshold voltage. The S-wave detection may be used to confirm the R-wave.