Resp rate and tidal vol out of sync with flow rate
Open Source CPAP Research and Review Software
Status: Beta
Brought to you by:
jedimark
In the daily view graphs, the respiratory rate and tidal volume graphs (as well as minute volume) graphs are out of sync with the flow rate waveform (and all other) graphs by about 90 seconds, give or take. This becomes most apparent at places where the CPAP machine is turned off for a short while. When the waveforms stop for the interruption, the resp rate and tidal vol graphs had already been stopped for about 90 seconds. There's also a short lag when the flow rate waveforms start up again before the resp rate and tidal vol graphs start up as well.
There shouldn't be a 90 second delay.. Maybe 1/2 second.. I'll have a look over that code again soon :-/
PRS1 machines (less than ASV) don't provide this data, so I have do the calculations for these.. These calculations for these are only new, so there will be a few bugs.
I simply haven't had a chance to go back to this code to review/finish it properly.
I did manage to overlay my calculations over an ASV machines calculations, and all of mine followed the same trends (my calcs were a bit noisier.. I need better filtering and a method dodgy breath detection..)
I did fix a bug yesterday where it was adding a breath marker at the beginning where there shouldn't have been one.. This could have caused a delay like this.
That has been rewritten in 0.9.1
Would you mind double checking with the new version?
This is for the most part fixed in 0.9.1. All the respiratory related graphs stop now in sync with the waveforms when the machine is turned off and resume again in sync when it is turned on, with one minor exception. Upon restart, there is about a 60 second delay before the respiratory rate graph begins to draw again. Also, during this delay, the minute ventilation graph shows a zero value, even though tidal volume is positive, suggesting that respiratory rate is reading at 0 until it gets a minute's worth of data. Don't know if you're getting enough data at restart to interpolate a value until the minute has passed or not...
The Resp. Rate calculations look at the previous minute to each breath, and counts the breaths, from a list of breaths the peak detection algorithm generates from the flow waveform.
I've just changed it so instead of just dropping the data for the first minute without a full data set, I now extrapolate a reasonable estimate from the breath data as it becomes available in the window. Much prettier, and accuracy progresses as the minute window is filled.
Minute Vent needed Resp Rate >0 to work here, so this is now fixed too.
I'm glad you drew my attention to this, as I noticed and fixed an even bigger bug.. The gain multiplier wasn't being applied to the EventList until after the data was added.. (I'm a little surprised no one noticed the Respiratory Rate BPM in the 400+ range.. :)
You might need to do a "purge cpap data" (from the Data->Advanced menu) and reimport for this one after the next SleepyHead update.. The recalculation code doesn't reprocess it.. (And I'm not sure it's a good idea adding it, as it will slow down recalcs quite a bit, and now it's fixed, this problem won't happen any more in future)
In Steve's words 'This is for the most part fixed in 0.9.1'...
I reckon this old ticket can be closed now.