The invention relates to a system (100) for heart rate detection comprising a random sampling module (10) configured for providing nonuniform random samples (S1) below Nyquist rate of a biosignal that contains heart rate information and a heart rate detection module (30) configured for receiving a plurality of said nonuniform random samples (S1) during a predetermined time window, calculate a power spectral density based on a Lomb-Scargle periodogram of said window samples and calculate a heart rate value (S2) based on the frequency corresponding to the highest power peak of the calculated power spectral density. The invention also relates to a corresponding method for heart rate detection and computer program product.