breathTimes

Version 5.1.1 (4.8 KB) by Alexis
Detects initiation and ending or maxima of respiratory events association with inhalation, especially for speech breathing.
369 Downloads
Updated 27 Mar 2023

View License

Update: now available with extended functionality at this File Exchange upload.
Please cite as: MacIntyre, A. D. and Werner, R. (2023). An Automatic Method of Speech Breathing Annotation. Proceedings of the 34th Conference on Electronic Speech Signal Processing (ESSV), Munich, DE.
This function is for use with a linear respiratory signal--typically meaning data produced with transducer breath belts. The function is optimised for speech breathing, which produces a highly irregular and idiosyncratic kinematic trace in comparison with "resting" or metabolic breathing. For instance, we have found from comparison with the acoustic speech spectrogram that speech-related inhalations often end before local maxima in the respiratory signal. breathTimes therefore performs slope grade analysis, among other steps, to search for abrupt reductions in the steepness of the positive-going signal, as opposed to absolute peaks. Similarly, inhalation onsets are not determined via the absolute minima or valleys in the respiratory signal, but rather based on prior context and thresholding within the inhalation slope. For more details, see my thesis.
breathTimes returns two time series: the first is for the initiations of inhalations, and the second is for the ending of inhalations. You can also optionally plot the results, to make sure the parameters are appropriate for your data. See comments for documentation.
I strongly recommend you combine this approach with speech analysis (i.e., using my other function Acoustic Landmarks) so that you can cross-corroborate and be sure your respiratory signal is doing what you think it is (for example, some peaks are in reality associated with exhalation during vocalisation, and not inhalation).
Example Usage: [onsets,offsets] = ...
breathTimes(vector,Fs,'WinSz',20,'MinDur',100,'MinHeight',0.1,'Plot',1)

Cite As

MacIntyre, A. D. and Werner, R. (2023). An Automatic Method of Speech Breathing Annotation. Proceedings of the 34th Conference on Electronic Speech Signal Processing (ESSV), Munich, DE.

MATLAB Release Compatibility
Created with R2019a
Compatible with R2016a and later releases
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
5.1.1

Added ref

5.0

Visit https://uk.mathworks.com/matlabcentral/fileexchange/124225-speechbreathingtoolbox for updates

4.32

Added citation.
Added link to thesis.

4.31

Added citation.

4.3

Streamlined some of the slope joining/splitting steps

4.2

Tweaks and debugging

4.1.5

Adjusted slope grade thresholding

4.1.4

Yet more bug fixes!

4.1.3

Economising code

4.1.2

Cleaned up odds and ends

4.1.1

Fixed typo

4.0

Fixed a couple of bugs

3.25

fixed typos

3.2

Adjusted how the precise beginnings/endings are chosen to use a relative grade-based approach, instead of quantiles

3.1

More minor corrections

2.31

Updated plotting

2.3

Fixed some more bugs

2.2

Yet another approach for determining inhalation onsets. This version uses an algorithm to identify the longest continuous positive-going slope, rather than the previous change points or signal derivative methods.

2.0.2

Tweaked inhalation beginning adjustments

2.0.1

Changed the method for determining inhalation beginnings, and generally should be more robust and simpler to use.

1.0.1

Edited description.

1.0.0