As I mentioned in
Pythone EDF library – To read cpap machine datalog files, I want to try to clear up at least some of the confusion regarding the Resmed S9 SD data card and the limits of data storage on it.
As many of us know, Resmed states that 365 days of summary data, 30 days of detailed data, and 7 days of high resolution data (HRD) can be stored on the SD card. I’ve also seen claims that, even with 1 year of high resolution data, that would only amount to about 30 Mb of data. I have no desire to check that value nor any reason to doubt it. Let’s just assume that it is correct for now. So then, why doesn’t Resmed allow 365 days of detail and HRD on the card? The answer is, with their decision to use the EDF data file format and SD cards, they simply can’t. Here’s why.
The Resmed S9 SD card has 1Gb of memory. A portion of that is used, in figurative terms, to lay down a grid that allows the computer to locate different files, very much like street addresses. The scheme used for this on ResMed memory cards is the
FAT32 file system. Without going into a lot of computer details (which can be found in the previous link and other sources), what is important is that FAT32 on the Resmed SD cards can only address memory in 4 Kb chunks. That means a file with only a single character (or byte) in it will use 4 Kb (4096 bytes) of storage space on the card just like a file with 4096 bytes would. There isn’t a way around this without using a different, less universal, file system. This minimum size, in computer terms, is called the cluster size. Think of it this way – each of our houses vary in size, yet each of them have a single address. That’s exactly how computers access memory. If you need multiple locations at that address, suites, room/apartment numbers, etc are used in the real world. In computers, all you have is the address. If a file only has a single byte in it, the other 4095 don’t hold any data but the computer can’t access them either because all 4096 bytes share the same, single address. As long as that one byte file exists, the other 4095 bytes of memory are unreachable. I know this is not intuitive to many folks, but this is how computers work.
It’s important to know that each mask event (putting on, using, then removing the mask) creates 8 files. 4 of them contain data and 4 of them contain an 8 byte CRC value. CRC, or cyclic redundancy check values, are used to verify that a data file has not been tampered with. The 4 EDF files that contain the real data are:
*_BRP.EDF – contains high resolution flow and mask pressure readings, taken 25 times per second
*_EVE.EDF – contains data on each detected event on a per event basis
*_PLD.EDF – contains mask pressure, therapy pressure, expiratory pressure, leak, RR, ventilation, minute ventilation, snore index, FFL index, taken 2 times per second
*_SAD.EDF – pulse and SPo2, taken once each second (if no monitor is connected, the values are all zero)
At this point, I’ll make a few assumptions. The first is that our test person sleeps, on average, 8 hours a night and wakes up once each night (2 mask events). Let’s also assume this person has 4 events per night.
SADs, even though all readings are zero when no monitor is connected, seem to total about 100 Kb for 8 hours sleep, or 50 Kb for each mask event. A single event seems to create about 550 bytes of data so 4 events per night results in two 1 Kb EVE files. PLD files total about 110 Kb or 55 Kb per mask event. The big ones, BRP, seem to average about 350 Kb/hr, or 2800 kb per 8 hr night (1400 Kb per mask event for the 2 mask events in this example). Each CRC file holds 8 bytes of data, or about 0.008 Kb and there will be 8 of them for each night (4 per mask event).
The following chart shows how the space required for 1 year of this data, including HRD:
So, even if the data is only 30-40 Mb total for a year, because it is stored in a lot of small files (each of which uses 4Kb of space), it actually would take more than 1 Gb of storage space to store the full year with HRD included.
Limiting the HRD to 7 days and the detail data to 30 days, gives:
an easy fit.
Depending on how long a person sleep, how many time they wake up, and how many events they have, the numbers will obviously vary. But, as long as 5 of the 8 files contain very little data, a lot of storage space is lost due to the 4 Kb cluster size. That is not dependent on how a person sleeps. Since few of us sleep 8 hours undisturbed every night for a year, most people will have as many if not more files than these examples that waste a lot of space.
Given the variability in its patients sleep patterns, Resmed, had to insure there was enough space regardless of how each person sleeps in order to meet their 365/30/7 claim reliably. The only safe way to do that with a 1 Gb SD card using the open EDF format was to drastically reduce something. I suspect that HRD loses its clinical usefulness after a few days, since that is what they chose to limit. If it still had value, they wouldn’t have placed such a limit. In the long run, such a decision would cause a loss in market share if the RRTs and MDs were not getting what they needed to treat patients. As idamtnboy mentioned earlier, detail data beyond 30 days probably doesn't have much clinical usefulness either. I know that my pulmonologist isn't interested in older data.
But please, don’t take my word for the cluster size implication. Open explorer (for Windows users – I’m sure Mac has something similar) and navigate to your SD card. Right click on any of the CRC files and choose Properties. It will show the Size is 8 bytes, but the Size on disk is 4096 bytes. That is why a year’s worth of data including HRD cannot fit on a 1 Gb card. And, since it appears that Resmed has written their firmware to 365/30/7 day limits, using a larger card won’t help.
I don’t know why they chose the specific 365/30/7 day limits. I just know that with their current file scheme, they couldn’t reliably, if at all, store 365 days of details and HRD on a 1 Gb SD card.