-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sample_rate vs sample_frequency: how to continue? #247
Comments
I agree with you, and since |
I prefer |
Any more opinions? @DimitriPapadopoulos @holgern @LucaCerina @cfranklin11 |
BTW I'm also fine with A as long as there's only one term (eventually after a deprecation cycle). |
I would go with A. |
There is confusions about the two terms and how they are implemented in
pyedflib
and alsoedflib
. I'd like you'r opinion on how to continue. @DimitriPapadopoulos @cbrnr @holgern @raphaelvallat @LucaCerina @cfranklin11EDF specs
In the specs the following is defined:
*
8 ascii : duration of a data record, in seconds
-> we call this internallyrecord_duration
*
ns * 8 ascii : ns * nr of samples in each data record (per channel)
-> we call this internallysmp_per_record
There is no
sample_frequency
orsample_rate
within the EDF specs. However, these can be derived by dividingsmp_per_record
byrecord_duration
.edflib
edflib, introduces
samplefrequency
(equal tosmp_per_record/record_duration
, not always Hz) andsamplerate
(Hz), which is not actually implemented to set, just mentioned in the docstrings. There's an inconsistency asHz
is defined ascycle per second
, but this isn't always reflected inedflib
:pyedflib
In
pyedflib
,sample_rate
was initially likeedflib
'ssamplefrequency
. Later,sample_frequency
was introduced to represent Hz, simplifying the user experience. The definition ofsample_frequency
in Hz is also how it is done in `python-edf.Solutions
In principle I think nobody cares about the
record_duration
or how things are implemented internally. People want to set and retrieve a sampling rate in Hz and be done. You should not have to think about therecord_duration
unless you have good reason to. Imo the decision to be made is which of the two terms to keep.Options:
A) Keep both terms, eventually removing
sample_rate
. This is user-friendly but inconsistent withedflib
.B) Revert to
sample_rate
only, aligning withedflib
but disrupting recent changes. Treatsample_rate
as Hz.C) Align with
edflib
: usesample_frequency
forsmp_per_record
andsample_rate
for Hz, which could confuse users.Personally I think A&B seem to be the best options, with A the least disrupting. If the unfortunate introduction of
sample_frequency
would not have been done, I would favour B, but that's too late now. What do you think?The text was updated successfully, but these errors were encountered: