69 std::vector<std::map<std::string, std::string> >
channels;
115 std::vector<std::pair<std::pair<eventName, eventTimeStamp>,
int> >
eventMap;
217 void calcEffectiveSrate();
229 void calcTotalChannel();
267 void getHighestSampleRate();
274 void loadDictionary();
281 void loadSampleRateMap();
292 uint64_t readLength(std::ifstream &file);
std::string eventName
Used as std::vector<std::pair<std::pair<eventName, eventTimeStamp>, int> > in eventMap.
Definition: xdf.h:107
double measured_srate
Definition: xdf.h:76
std::vector< std::string > dictionary
Definition: xdf.h:117
double last_timestamp
Definition: xdf.h:74
std::vector< double > clock_values
Definition: xdf.h:83
void freeUpTimeStamps()
Delete the time stamps vectors when no longer needed to release some memory.
Definition: xdf.cpp:760
std::vector< std::pair< std::string, double > > userCreatedEvents
Definition: xdf.h:127
int userAddedStream
Definition: xdf.h:124
int majSR
Definition: xdf.h:97
size_t totalCh
Definition: xdf.h:96
float minTS
Definition: xdf.h:94
std::string streamFooter
Definition: xdf.h:59
std::vector< uint16_t > eventType
Definition: xdf.h:118
std::vector< double > clock_times
Definition: xdf.h:82
float maxTS
Definition: xdf.h:95
void detrend()
Subtract the entire channel by its mean.
Definition: xdf.cpp:803
std::vector< std::vector< float > > time_series
A 2D vector which stores the time series of a stream. Each row represents a channel.
Definition: xdf.h:56
std::string type
Definition: xdf.h:66
std::vector< Stream > streams
Definition: xdf.h:88
void adjustTotalLength()
Adjust totalLen to avoid possible deviation.
Definition: xdf.cpp:776
std::string name
Definition: xdf.h:65
int writeEventsToXDF(std::string file_path)
writeEventsToXDF
Definition: xdf.cpp:851
std::vector< std::pair< std::pair< eventName, eventTimeStamp >, int > > eventMap
Definition: xdf.h:115
float eventTimeStamp
Used as std::vector<std::pair<std::pair<eventName, eventTimeStamp>, int> > in eventMap.
Definition: xdf.h:113
void createLabels()
Create labels for each channel and store them in labels vector.
Definition: xdf.cpp:940
void resample(int userSrate)
Resample all streams and channel to a chosen sample rate.
Definition: xdf.cpp:537
int channel_count
Definition: xdf.h:63
Xdf()
Default constructor with no parameter.
Definition: xdf.cpp:30
std::vector< std::string > labels
Definition: xdf.h:119
int maxSR
Definition: xdf.h:98
std::string channel_format
Definition: xdf.h:67
double first_timestamp
Definition: xdf.h:73
struct Xdf::Stream::@0 info
std::set< double > sampleRateMap
Definition: xdf.h:120
std::vector< int > streamMap
Definition: xdf.h:99
float sampling_interval
Definition: xdf.h:81
float version
Definition: xdf.h:89
std::vector< float > offsets
Definition: xdf.h:121
double effective_sample_rate
Definition: xdf.h:77
uint64_t totalLen
Definition: xdf.h:91
void calcTotalLength(int sampleRate)
Calculate the globle length (in samples).
Definition: xdf.cpp:755
int load_xdf(std::string filename)
The main function of loading an XDF file.
Definition: xdf.cpp:34
int sample_count
Definition: xdf.h:75
std::string fileHeader
Definition: xdf.h:123
std::vector< std::pair< double, double > > clock_offsets
Definition: xdf.h:71
std::string streamHeader
Definition: xdf.h:58
std::vector< std::map< std::string, std::string > > channels
Definition: xdf.h:69
std::vector< float > time_stamps
Definition: xdf.h:57
double nominal_srate
Definition: xdf.h:64