-
Notifications
You must be signed in to change notification settings - Fork 126
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
sampling rate is not accurate when data record duration is not 1 second #199
Comments
It would help to be able to reproduce the problem with an actual file. Can you provide one? I believe this is related to the underlying EDFlib library. And indeed the documentation states:
Since pyedflib is a wrapper around EDFlib, it follows the same definition. However, I agree this warrants a clarification in the pyedflib documentation. |
The file i have is not one i could share. Could you provide a way to get the record duration? With that it would be possible to calculate the sampling rate per second. |
|
I did not find a way to get the "datarecord duration" with the pyEDFlib.
Can you let me know how to do that if it is present already?
…On Mon, Jul 3, 2023 at 5:13 PM Dimitri Papadopoulos Orfanos < ***@***.***> wrote:
The effective sample frequency is: samplefrequency / datarecord duration
—
Reply to this email directly, view it on GitHub
<#199 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASYWBYQCGP76JI4ZXKHMUZ3XOKLM3ANCNFSM6AAAAAAXW5RWVU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Does EdfReader.getFileDuration help? |
I opened an EDF file where the data record duration was set to 2 seconds.
In the signal headers, it said that the channels frequency was 512, which is incorrect as it is actually 256 samples per second. It seems like it returns the number of samples per data record and not per second. Is that intended? I did not find a way to read the data record duration using pyedflib so i don't see a way to get the real sampling rate per second in this situation.
If i open the file with mne, it returns 256 as the 'sfreq' property which is correct as an example.
The text was updated successfully, but these errors were encountered: