ikarosilva / wfdb-app-toolbox

The WFDB Toolbox for MATLAB/Octave is a collection of functions for reading, writing, and processing physiologic signals in the formats used by PhysioNet (see README for details).
http://physionet.org/physiotools/matlab/wfdb-app-matlab/
GNU General Public License v3.0
93 stars 46 forks source link

WRSAMP does not store baseline values #104

Open ikarosilva opened 9 years ago

ikarosilva commented 9 years ago

We need to find a way to store baseline values in files generated by WRSAMP. The current implementation results in signals with different physical values if we convert the raw data to physical units through RDSAMP's rawUnits argument.

Example:

N=100;
[ecg,Fs,tm]=rdsamp('100s',1,N,[],4);
[siginfo]=wfdbdesc('100s');
wrsamp(tm,ecg(:,1),'100s_copy',Fs,200,siginfo(1).Format);
%Get signal in physical units
[ecg1]=rdsamp('100s',1,N);
[ecg2]=rdsamp('100s_copy',1,N);
err=sum(ecg1 ~= ecg2)

!cat 100s_copy.hea
100s_copy 1 360 100
100s_copy.dat 212 200 12 0 995 -32689 0 col 1

!cat 100s.hea
100s 2 360 21600
100s.dat 212 200 11 1024 995 21537 0 MLII
100s.dat 212 200 11 1024 1011 -3962 0 V5
#69 M 1085 1629 x1
# Aldomet, Inderal
#Produced by xform from record 100, beginning at 0:0
cx1111 commented 8 years ago

I guess people can use mat2wfdb for now. I'll put a message at the top of the header pointing users to mat2wfdb. In the future I may add that functionality to the C wrsamp.