Writes physical samples (uV, mA, Ohm).
edfwrite_samples(handle,sample_freq,data)
a integer containing the file handle of the opened bdf/edf-file
vector or skalar containing the sample frequency of all signals.
matrix or list containing all physical samples which should write to a edf/bdf-file.
Writes physical samples (uV, mA, Ohm) from data belonging to all signals
The physical samples will be converted to digital samples using the values of physical maximum, physical minimum, digital maximum and digital minimum.
if the samplefrequency of all signals are equal, then the data could be saved into a matrix with the size (N,signals) If the samplefrequency is different, then sample_freq is a vector containing all the different samplefrequencys. The data is saved as list. Each list entry contains a vector with the data of one signal.
All parameters must be already written into the bdf/edf-file.
handle=edfopen_file_writeonly(edf_getpath()+'/demos/demo2.bdf',1,5); //same samplefrequency t=10sek signals=5; //sample_freq=100; //data=rand(1000,5); //edfwrite_samples(handle,sample_freq,data); // different samplefrequency t=10sek;signals=5; sample_freq=[100, 100, 100, 10, 1]; for (i=1:5) edf_set_samplefrequency(handle,i,sample_freq(i)); edf_set_physical_maximum(handle,i,1); edf_set_physical_minimum(handle,i,0); edf_set_digital_maximum(handle,i,8388607); edf_set_digital_minimum(handle,i,-8388608); end data=list(); data(1)=rand(1000,1); data(2)=rand(1000,1); data(3)=rand(1000,1); data(4)=rand(100,1); data(5)=rand(10,1); edfwrite_samples(handle,sample_freq,data); edf_close(handle); | ![]() | ![]() |