Code covered by the BSD License  

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Reading and saving of data in the EDF+

4.0 | 3 ratings Rate this file 55 Downloads (last 30 days) File Size: 6.59 KB File ID: #38641 Version: 1.3
image thumbnail

Reading and saving of data in the EDF+



16 Oct 2012 (Updated )

Reading and saving of multichannel biological and physical signals in the European Data Format (EDF)

| Watch this File

File Information

The European Data Format (EDF) is a simple and flexible format for exchange and storage of multichannel biological and physical signals.

The code is intended for reading and saving of data in the EDF+.

[data, header] = readEDF(filename)

SaveEDF(filename, data, header)

% filename - EDF+ file name (*.edf)

% data - Contains a signals matrix or cell conteins signals data

% header - Contains header structure


This file inspired Block Edf Load.

Required Products MATLAB
MATLAB release MATLAB 7.9 (R2009b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (4)
21 Jun 2015 Victor Gumennyy


Rs=cumsum([1; header.duration*header.samplerate]); % строка индексов подблоков каналов Rs(k):Rs(k+1)-1


Rs=cumsum([1; header.samplerate]); % строка индексов подблоков каналов Rs(k):Rs(k+1)-1

Since header.samplerate is not a sampling frequency, but Nr of samples in one epoch, which can be more than 1 second.

Comment only
22 Jul 2014 Jakub

Jakub (view profile)

I believe there is an error in line 76 of << ReadEDF.m >>.

The file as-downloaded has the following:
Rs=cumsum([1; header.duration*header.samplerate]);

This is incorrect because << header.duration >> does not have to be an integer. The result is that an error occurs when the values of Rs are used to denote vector indices in line 84: Ch_data(Rs(k):Rs(k+1)-1, :)

The correct form of line 76 should be:
Rs=cumsum([1; header.samplerate]);

22 Jul 2014 Helio

Helio (view profile)

Dear Andrey I'm very grateful to have found your routines. I've been dealing with edf+ annotations for a while and your reader works just flawless. Thanks a lot for sharing!

15 Apr 2014 Mark Skopin

Please disregard my previous comment. I got it to work. The startime and startdate fields were not all in lowercase. Great functions and very useful! Thanks again!

17 Oct 2012 1.2

Screenshot update

14 Jun 2013 1.3

Products Required change

Contact us