[Eeglablist] Export EDF/BDF/GDF

Alois Schloegl alois.schloegl at ist.ac.at
Thu Mar 21 12:38:47 PDT 2019

On 19.03.19 23:35, Thomas Varley wrote:
> Hello all;
> I am having trouble exporting a .set file to a .edf file. I've made
> sure my EEGLab and Biosig are up-to-date. I keep getting the same
> error. In the GUI, a popup window displays:
> "EEGLAB error in function writeeeg() at line 230:
> Unedefined function 'swrite' for input arguments of type 'struct'."

> In the MATLAB command window it prints:
> "Warning SOPEN (EDF): One block exceeds 61440 bytes.
> Warning SOPEN (EDF-Write): relative scaling error is 3.59...e-06 (due
> to roundoff in PysMax/Min)"

These warnings come from the function sopen.m (from Biosig
https://biosig.sourceforge.io) and warn you about two issues:

1) The strict specification of EDF allows only fro 61440 bytes per
block, the way how you specified the blocklengths exceeds that limit.
Most software can read EDF files that exceed that limit, but there might
be some EDF readers out there, that still have this limit. To avoid that
limit, you need to defines shorter blocksize (e.g. 1 second or less).

2) The second warning tells you that exported the data to EDF might
introduce rounding errors. EDF uses 8 character ascii to specify the
scaling, some scaling factors might be subject to truncation or rounding
(e.g. 1.2345e-12 will be truncated to 1.23e-12, or  0.0000012345 could
be truncated to 0.000001). This might lead to rounding erros that are

These warnings tell you about such issues. You need to check yourself
whether this will be acceptable to you.

In order to avoid these and other limitations of the EDF format, GDF was
developed. GDF is very similar to EDF but not subject to these limitations.

Kind regards,



> Machine specs:
> MATLAB: R2018b
> OS: Linux Mint 18.3
> RAM: 62.8 GB
> Any idea what's going on here?
> All the best
> ~Thomas Varley
> _______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to
> eeglablist-unsubscribe at sccn.ucsd.edu
> For digest mode, send an email with the subject "set digest mime" to
> eeglablist-request at sccn.ucsd.edu

More information about the eeglablist mailing list