-->chdir('/home/j/physionet')
ans =
0.
-->unix_g('ls slp01a*.*')
ans =
!slp01a.dat !
! !
!slp01a.ecg !
! !
!slp01a.hea !
! !
!slp01a.st !
! !
!slp01a.xws !
If everything functions properly we should be able to read `slp01a.hea' with the command:
-->unix_x('cat slp01a.hea')
And the result is
slp01a 4 250/0.033333333(94) 1800000 23:07:00 19/1/1989 slp01a.dat 212 -200/mV 12 0 -17 59911 0 ECG slp01a.dat 212 4.77778(-477)/mmHg 12 0 -248 19332 0 BP slp01a.dat 212 -6430/mV 12 0 252 49594 0 EEG (C4-A1) slp01a.dat 212 690/l 12 0 -180 912 0 Resp (sum) # 44 M 89 32-01-89There is a lot of information here. Among other things, we can deduce that it is the recording of a 44-year-old male and includes four signals: ECG, BP, EEG and RESP. It has been sampled at 250 Hz and includes 1,800,000 samples per channel.
We can try to recover the data with the usual procedure
-->unix ('rdsamp -r slp01a -p > dummy');
-->stacksize(20000000)
-->x = fscanfMat('dummy');
-->wind = 1:15000;
-->for k = 1:4; xsetech([0,(k-1)/4,1,1/4]);plot2d(x(wind,1),x(wind,1+k));end
And the result is shown in the figure
:
We are also interested in the other files.
-->unix_x('rdann -r slp01a -a ecg')
produces
[23:07:00.076 19/01/1989] 19 N 0 0 0 [23:07:00.936 19/01/1989] 234 N 0 0 0 [23:07:01.828 19/01/1989] 457 N 0 0 0 [23:07:02.748 19/01/1989] 687 N 0 0 0 [23:07:03.644 19/01/1989] 911 N 0 0 0 [23:07:04.548 19/01/1989] 1137 N 0 0 0 [23:07:05.440 19/01/1989] 1360 ...It is the usual file containing the location and type of the beats. And the other one
-->unix_x('rdann -r slp01a -a st')
contains information about sleep apnea
[23:07:00.004 19/01/1989] 1 " 0 0 0 4 LA LA [23:07:30.000 19/01/1989] 7500 " 0 0 0 4 LA [23:08:00.000 19/01/1989] 15000 " 0 0 0 4 LA [23:08:30.000 19/01/1989] 22500 " 0 0 0 4 L L L [23:09:00.000 19/01/1989] 30000 " 0 0 0 4 L [23:09:30.000 19/01/1989] 37500 " 0 0 0 4 L [23:10:00.000 19/01/1989] 45000...So, with relatively little effort we have been able to read signals from very different origin that can be stored as Scilab variables in such a way that all the power of Scilab detailed in the companion tutorial can be applied.