This paper presents a new acquisition and digital processing system of an ECG (Electrocardiogram) signal. The proposed technique is based on ECG signal processing in Matlab framework, using Duty Cycle Modulation (DCM) and IIR (infinite Impulse Response) derivative filter, with implementation into DsPBuilder. In fact, the detection of the R wave allows to extract the time interval between two consecutive R waves, in order to estimate the corresponding heart rate. Hence, the proposed simple algorithm consists of the following four relevant steps: derivative filtering, detection of peaks, elimination of bad peaks and calculation the heart rate. This algorithm considers that the acquisition of the ECG signal is done by duty cycle modulation, because in this case a simple low-pass decimation filter with bandwidth of 30Hz can simultaneously eliminates high frequency noise while extracting the ECG signal. The duty-cycle modulation circuit requires a maximum of 58 KHz frequency. Then, the digital part implemented using DsPBuilder blocks, consists of a decimation filter with 50 MHz sampling frequency, followed by the proposed algorithmic module. A virtual simulation and a Hardware-In-the-Loop (HIL) co-simulation using the DE10-NANO-SoC board with embedded FPGA-SoC 5CSEBA6U23I7, have been successfully conducted using imported signals into Matlab from Physionet.