Count the number of full peaks or complete waves in the selected segment.
The time elapsed on the X-axis for the breaths counted above.
Used to calculate Minute Ventilation.
Breathing Rate:–
Time Per Breath (Period):–
Minute Ventilation (VE):–
function calculateBreathingRate() {
// 1. Get Input Values
var breathsInput = document.getElementById("spiroBreaths");
var durationInput = document.getElementById("spiroDuration");
var volumeInput = document.getElementById("spiroVolume");
var resultsArea = document.getElementById("resultsArea");
var breaths = parseFloat(breathsInput.value);
var duration = parseFloat(durationInput.value);
var volume = parseFloat(volumeInput.value);
// 2. Validate Inputs
if (isNaN(breaths) || breaths <= 0) {
alert("Please enter a valid number of breaths (must be greater than 0).");
return;
}
if (isNaN(duration) || duration 0) {
minuteVentilation = bpm * volume;
mvText = minuteVentilation.toFixed(2) + " L/min";
} else {
mvText = "Enter Tidal Volume to calc";
}
// 6. Display Results
document.getElementById("resBPM").innerHTML = bpm.toFixed(1) + " BPM";
document.getElementById("resPeriod").innerHTML = period.toFixed(2) + " sec/breath";
document.getElementById("resMV").innerHTML = mvText;
// Show result container
resultsArea.style.display = "block";
}
How to Calculate Breathing Rate from a Spirometer Trace
A spirometer trace (or spirogram) graphically represents the volume of air entering and leaving the lungs over time. The vertical axis (Y-axis) typically represents volume in liters (L), while the horizontal axis (X-axis) represents time in seconds (s).
Calculating the breathing rate (respiratory rate) from this graph is a fundamental skill in physiology and biology. It indicates how many breaths a person takes per minute.
Step-by-Step Calculation Guide
Identify a Sequence of Breaths: Look at the trace and identify a repeating pattern. One full breath consists of one inhalation (upward slope) and one exhalation (downward slope).
Count the Peaks: Select a specific section of the graph. Count the number of peaks (top of the waves) within that section. Let's call this N.
Measure the Time Duration: Determine how much time has passed on the X-axis for those specific breaths. Let's call this T (in seconds).
Apply the Formula: Use the formula below to convert this into Breaths Per Minute (BPM).
Breathing Rate (BPM) = (Number of Breaths ÷ Duration in Seconds) × 60
Alternative Method: Using the Period
If the breathing is very regular, you can calculate the time it takes to complete just one single breath (from one peak to the very next peak). This time is called the period.
Breathing Rate (BPM) = 60 ÷ Time for 1 Breath
Understanding Minute Ventilation
If you also calculate the Tidal Volume (the vertical height of the wave from trough to peak, representing the volume of air in one normal breath), you can calculate the Minute Ventilation (VE). This measures the total volume of air inhaled per minute.
Typical resting breathing rates for healthy adults range from 12 to 20 breaths per minute. Rates calculated from spirometry during exercise will be significantly higher.