holgern / pyedflib

pyedflib is a python library to read/write EDF+/BDF+ files based on EDFlib.
http://pyedflib.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
209 stars 121 forks source link

More documentation for "sample frequency" #232

Open DimitriPapadopoulos opened 1 year ago

DimitriPapadopoulos commented 1 year ago

It turns out "sample frequency" is actually the number of samples per channel/signal in EDFlib: https://www.teuniz.net/edflib/doc/edflib_8h.html#a11d03849cecc17a2599125a1a102b69e

We inherit this strange definition, and need to explain it.

Fixes #199.

skjerns commented 8 months ago

I see. This is all a big mess.

I would still favour to express sampling_frequency in Hz (samples/second) and not in samples/block_size and therefore deviate from the definition in edflib. I don't think anybody thinks in terms of samples/block_size, as the block_size is irrelevant outside of the technicial file definitions of the EDF file.

Somehow, pyedflib originally decided to use sample_rate instead of sample_frequency, but kept the strange definition of sample_frequency from edflib as samples/duration. My idea to introduce sample_frequency was to keep backwards compatibility with previous code that might use sample_rate and set a specific record_duration. This most likely just complicated things 😅