lsl_archived icon indicating copy to clipboard operation
lsl_archived copied to clipboard

Question about DataReceiving and Sampling rate

Open RanjitF opened this issue 7 years ago • 1 comments

I am curious about the DataReceiving function

while [vec, ts]= inlet_data.pull_sample(); end

In my project, I want to store 3 second EEG data. Since the sampling frequency is fixed 5000 Hz, can I write the code like below to obtain accurate 3 second EEG data?

while count ~= 5000 * 3 [vec, ts]= inlet_data.pull_sample(); count = count + 1; end

RanjitF avatar Aug 14 '18 08:08 RanjitF

In theory yes, you'd need to append the data to the vectors instead of overwriting them, but you should rather use pull_chunk. It's a lot faster and you can directly specify how many samples you want.

tstenner avatar Nov 02 '18 08:11 tstenner