Skip to content
C++ library for loading XDF files
C++ C Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
_layouts
docs
pugixml
repository
smarc
.gitignore
CMakeLists.txt
LICENSE.txt
README.md
_config.yml
xdf.cpp
xdf.h
xdf.pro

README.md

Libxdf - a C++ library for loading XDF files

Introduction

Libxdf is a cross-platform C++ library for loading multimodal, multi-rate signals stored in XDF files. Libxdf is used in the biosignal viewing application SigViewer. It can also be integrated into other C++ applications.

Libxdf is open-source, free, and actively maintained.

Download

Quick-Start Guide

Building libxdf

Libxdf can be conveniently built either using qmake or cmake. Configuration files for both build tools are included with the source.

Use in conjunction with SigViewer

Libxdf is a built-in component of SigViewer. If you wish to build SigViewer from source, follow these steps:

  1. Download xdf.h and libxdf.a from the release page.
  2. Copy xdf.h into sigviewer/external/include
  3. Copy libxdf.a into sigviewer/external/lib
  4. Build and run Sigviewer

SigViewer using libxdf to display signals in XDF files

Example: SigViewer using libxdf to display signals in an XDF file.

Use in other C++ applications

  1. Build libxdf from source or use a pre-built binary release
  2. Instantiate an object of the Xdf class and call the load_xdf method.

Example:

#include "xdf.h"

Xdf XDFdata;
XDFdata.load_xdf("C:/example.xdf");

To resample the signals to e.g. 100Hz:

XDFdata.resample(100);

The functions in libxdf must be called following a certain order. For instance, if you call the subtractMean function before you load any data, it will cause undefined behavior.

The recommended order is shown here. Only load_xdf is mandatory.

XDFdata.load_xdf(std::string filepath);
XDFdata.subtractMean();
XDFdata.createLabels();
XDFdata.resample(int sampleRate);
XDFdata.freeUpTimeStamps();

Libxdf depends on third party libraries Pugixml v1.8 for XML parsing and Smarc for resampling.

Documentation

Detailed documentation was generated via Doxygen and is available here.

SigViewer Online Repo

SigViewer Online Repository is here.

Support

Email author or report a new issue.

You can’t perform that action at this time.