I’ve noticed that the inspiration and expiration times reported (presumably) from the Respironics DreamStation CPAP machine seem to be incorrect. I’m basing this on what’s reported by the Sleepyhead software (I haven’t converted to OSCAR yet). I don’t believe Sleepyhead is modifying these measurements as reported in the CPAP binary files located on the SD card (but I’m not positive about this). I’m wondering if anyone can comment on this and my thoughts on correcting it.
Before going any further, I use a Respironics DreamStation Auto Pap CPAP machine (constant 9cm H2O with no expiratory drop) and a Contec CMS50F pulse oximeter. I’ve been recording data from both devices since 8/1/2016, and using the available data for analysis. Unfortunately, the Sleepyhead software doesn’t/didn’t provide access to the raw data, so I wrote parsers that read the Sleepyhead .001 files from the CPAP machine and also the pulse oximeter. I’ve just started using the raw data from the CPAP as stored (and possibly modified?) in the .001 binary file.
My problem is as follows:
As reported from Sleepyhead, the inspiration times include the tail of many expiration times. I believe my expiratory tail is probably more pronounced due to moderately severe tracheobronchomalacia. I’m trying to monitor the extent of this disease as well as my lung disease based on numerous measurements, including inspiration / expiration times, ratios, etc. I also use other sources of raw data (e.g., PFT data) that I obtain from the hospital (National Jewish Health).
In order to derive correct measurements, I reverse-engineered the Sleepyhead-stored flow-rate waveform (5 Hz), so I could conduct my own analysis. I’m wondering if this waveform data is down sampled and there is a higher data-rate waveform available?
I created a basic zero-crossing algorithm, and then used it to find inspiration/expiration times. I used the zero crossing times to derive inspiration times/rates, expiration times/rates, respiration times/rates, and integrated the area under/over the curve to derive inspiration/expiration volumes. In order to get around apneas, and other anomalous problems in the waveform, I only used clean inspirations followed by clean expirations to derive these measurements. I also eliminated outliers, most probably caused by apneas, etc. (kept 2.5 to 97.5 percentile data).
Here is a sample breathing waveform (in blue) with my zero crossings identified in red. If the crossing didn’t occur at a sample point, I used simple interpolation between the two nearest points to determine the zero crossing. In order to integrate the area under the curve, I added the interpolated zero points (x,y pairs) to the data set and then used trapezoidal integration to calculate the volumes.
Here is a sample section of the waveform that shows some of the issues with the way the CPAP machine / Sleepyhead determines inspiration / expiration times, etc.:
In the graph, they y-axis is litres/min and the x-axis is one-up counts (1/5s each), which I normalize after later. Inspirations are positive (up curves) and expirations negative. The problem with the CPAP/Sleepyhead measurements is that it I believe expiration time is determined at the point of maximum rate a change close to the zero point or when the first zero point it reached. On the illustrated graph, that would occur to the left of all of my calculated zero crossings. In my case, there is periodically a small positive inspiration data point (usually 1L/min) prior to the end of the end of the expiration. This can be seen in several cases in the above graph. My algorithm eliminates most of these, but not all.
In this day (night of 16 Sep 2019), my calculated inspiration time is 1.31s and expiration time 1.70s. The Sleepyhead software reports an inspiration time of 1.69s and an expiration time of 1.27s. My calculated respiration rate is 20.4bpm, and the software reports 20.15bpm.
A small portion of the differences might be attributed to my using only pristine inhalations followed by a pristine exhalation and removal of obvious outliers.
I calculated an “inspiration tidal volume” of 291.6ml, an “expiration tidal volume” of 279.3ml with a volume differential of 12.3ml. I’m hoping this difference can be explained by the exhalation port pressures and volumes (and expiration times), and that this knowledge can be used to derive the “true” tidal volume (suggestions on this greatly appreciated). The software reported a tidal volume of 277.1ml.
Another problem I’m having is reconciling mask leak rates with truncation of the breathing waveform and the fact that the documentation suggests that the CPAP machine can compensate for small leaks. But this doesn’t seem reflected in the waveform. Here is a graph generated from Sleepyhead of the flow rate waveform and the leak rate, yet no time was reported over the leak rate red line:
There is a lot of variance in the Sleepyhead-reported day-to-day tidal volumes, and I’m thinking that the leak rate is a possible contributor to this variance. I’m contemplating developing a “correcting” algorithm, but any commentary you have on that would be appreciated.
I’m hoping you are interested in these issues and might have some wisdom to bestow.
Thanks very much,
Darral Freund