diff --git a/DataReader.py b/DataReader.py
index 6b08776..1842b8c 100644
--- a/DataReader.py
+++ b/DataReader.py
@@ -119,7 +119,7 @@ class DataReader:
 
         Parameters
         ----------
-        time_array: numpy array of time values (from CSV file, or directly
+        time_array: numpy array of time values (from CSV file or directly
                     inserted for testing cases.
         duration:   tuple specifying the min and max times defining the
                     duration of interest, specified by user.
diff --git a/HRM_Processor.py b/HRM_Processor.py
index a195f4f..ba0451c 100644
--- a/HRM_Processor.py
+++ b/HRM_Processor.py
@@ -39,7 +39,14 @@ class HRM_Processor:
         self.output_dict["start_times"] = beat_start_times
 
         num_beats = self.determine_num_beats(beat_start_times)
-        self.output_dict["num_beats"] = num_beats
+        self.output_dict["beats"] = num_beats
+
+        try:
+            mean_hr_bpm = self.determine_bpm(beat_start_times, self.input_data[
+                                                                "duration"])
+            self.output_dict["mean_hr_bpm"] = mean_hr_bpm
+        except ValueError:
+            print("Invalid duration (no beats in that duration)")
 
     def determine_voltage_extremes(self, voltage):
         """Determines the min and max values of the voltage data
@@ -246,3 +253,16 @@ class HRM_Processor:
         """
         num_beats = np.size(beat_start_times)
         return num_beats
+
+    def determine_bpm(self, beat_start_times, duration):
+        start_inx = np.argmax(beat_start_times >= duration[0])
+        end_inx = np.argmax(beat_start_times >= duration[1])
+
+        num_beats_in_duration = end_inx - start_inx
+        time_in_seconds = duration[1] - duration[0]
+        if time_in_seconds == 0:
+            raise ValueError
+        time_in_minutes = time_in_seconds / 60
+
+        mean_hr_bpm = num_beats_in_duration / time_in_minutes
+        return mean_hr_bpm

The HRM_Processor needs to determine the number of beats.
The HRM_Processor needs to determine the number of beats that occurred in the ecg strip. This value will be written to the output dictionary.

Input: numpy array containing start times of beats
Output: the length of that numpy array

diff --git a/test_HRM_Processor.py b/test_HRM_Processor.py
index 7c46b58..01d5b90 100644
--- a/test_HRM_Processor.py
+++ b/test_HRM_Processor.py
@@ -215,3 +215,14 @@ def test_determine_num_beats(hrm):
     measured_num_beats = hrm.determine_num_beats(start_times)
 
     assert expected_num_beats == measured_num_beats
+
+
+def test_determine_bpm(hrm):
+
+    start_times = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
+    duration = (3, 7)
+
+    expected_bpm = 60
+    calculated_bpm = hrm.determine_bpm(start_times, duration)
+
+    assert expected_bpm == calculated_bpm

pip install -r requirements.txt
parse_log_pytest
requirements.txt
pytest
3.9
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
coverage==7.8.0
exceptiongroup==1.2.2
execnet==2.1.1
iniconfig==2.1.0
numpy==2.0.2
packaging==24.2
pep8==1.7.1
pluggy==1.5.0
pytest==8.3.5
pytest-cache==1.0
pytest-cov==6.0.0
pytest-pep8==1.0.6
tomli==2.2.1

name: bme590hrm
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - coverage==7.8.0
      - exceptiongroup==1.2.2
      - execnet==2.1.1
      - iniconfig==2.1.0
      - numpy==2.0.2
      - packaging==24.2
      - pep8==1.7.1
      - pluggy==1.5.0
      - pytest==8.3.5
      - pytest-cache==1.0
      - pytest-cov==6.0.0
      - pytest-pep8==1.0.6
      - tomli==2.2.1
prefix: /opt/conda/envs/bme590hrm

test_HRM_Processor.py::test_determine_bpm
test_HRM_Processor.py::test_find_qrs_peak_indices
test_HRM_Processor.py::test_HRM_Processor_init test_HRM_Processor.py::test_voltage_extremes test_HRM_Processor.py::test_write_outputs_to_dict_voltage_extremes test_HRM_Processor.py::test_determine_ecg_strip_duration test_HRM_Processor.py::test_write_strip_duration test_HRM_Processor.py::test_determine_threshold test_HRM_Processor.py::test_find_indices_above_threshold test_HRM_Processor.py::test_find_beat_separation_points test_HRM_Processor.py::test_index_beat_start_times test_HRM_Processor.py::test_determine_num_beats
HRM_Processor.py DataReader.py
HRM_Processor.py DataReader.py