A system for heart rate detection includes a random sampling module configured to provide nonuniform random samples below a Nyquist rate of a biosignal that contains heart rate information and a heart rate detection module configured to receive a plurality of the nonuniform random samples during a predetermined time window, calculate a power spectral density based on a Lomb-Scargle periodogram of the window samples and calculate a heart rate value based on a frequency corresponding to a highest power peak of the calculated power spectral density. The disclosure also relates to a corresponding method for heart rate detection and a non-transitory computer readable medium.