XDF filesLibxdf - a C++ library for loading
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.
Libxdf can be conveniently built either using
cmake. Configuration files for both build tools are included with the source.
Libxdf is a built-in component of SigViewer. If you wish to build SigViewer from source, follow these steps:
libxdf.afrom the release page.
- Build and run Sigviewer
Example: SigViewer using libxdf to display signals in an XDF file.
Use in other C++ applications
- Build libxdf from source or use a pre-built binary release
- Instantiate an object of the
Xdfclass and call the
#include "xdf.h" Xdf XDFdata; XDFdata.load_xdf("C:/example.xdf");
To resample the signals to e.g. 100Hz:
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();
SigViewer Online Repository is here.