Closed DavidTingley closed 6 years ago
tracked it to line 169 of bz_LoadBinary
nSamplesPerChannel = floor((duration*frequency));
duration = 0.3000, frequency = 1250; the floor call returns 374 but it should be 375....
changed to below in /dev
nSamplesPerChannel = round((duration*frequency));
Oi good find.
I've noticed when running bz_getLFP with interval sets that it often returns .data segments of differing sizes even when the intervals provided are exactly the same duration. For intervals of 300 ms, I often get .data segments of either 375 OR 374 samples.
We should add a "check # of samples" condition somewhere to ensure that bz_GetLFP always returns segments of a consistent size (375 for the above case).
What do you guys think? I imagine this is a rounding error that can be fixed with a ceil/floor call.