Valid samples vs. timestamps
During data analysis, you will want to pay attention to the timestamps and the number of valid samples in that record. Each CSC record is 512 samples, but if a problem occurs during recording, the current record will close out, still writing 512 samples, but start new records immediately after the problem occurred. Example: the 100th record has 500 valid samples in it. We still need to close the record with 512 samples, so we clone the last records final 12 samples into the “bad” record. Note, the first 500 samples are 100% valid. Here is the tricky part, we will start a new record where the previous left off, or as close as possible. So, record 101, sample 1, is approximately the 501st sample of the previous record (again, we start the new record as fast as possible). This is why using the timestamp is so important and not just plotting the data outright in something like Matlab.
If you plot out a complete CSC file in Matlab using just sample points, and 20 records contain only 500 valid samples of 512, your perceived time scale is actually 20record x 12sample= 240 samples longer than the actual time.
When data loss occurs, Cheetah is able to tell where the issue happened in time relative to valid samples within a record. CSC records consist of 512 sample points, regardless of sampling rate. If we happen to lose data after 400 samples, the record will indicate 400 valid samples. This means that the remaining 112 samples are not valid and unusable. The issue here is that Cheetah then fills in the invalid samples with valid samples from the last complete record.
This is what Cheetah does when this situation happens. Cheetah has to have a complete record of 512 samples to close it, hence the filling in with previous record data. However, Cheetah doesn’t wait to start a new record when it sees this issue. In a perfect world, Cheetah starts a new record at the 401 sample, remember, 400 from the previous record were valid. So the 401 sample becomes sample 1 of the new record and it keeps going. You may see instances where multiple records are not complete, as in 4 or 5 in a row do not have 512 valid samples in the record. Cheetah will repeat the process of starting new records until a full record is completed and so on.
Because this isn’t a perfect world, Cheetah takes some time to start up a new record, perhaps several sample cycles. This is why it is critical to use the Timestamp of the beginning of each record as your key for plotting in software such as Matlab. Here comes the part where you need to use the valid sample number when grabbing these samples and plotting them. Because Matlab plots via samples, you are effectively plotting out the remaining 112 invalid samples, instead of relying on the timestamp to know that there is actually some overlap of records because the new record started up thru the end of the previous where the invalid samples are.
Caution – Software for investigational use in laboratory animals or other tests that do not involve human subjects.
Rev. A0