-
Notifications
You must be signed in to change notification settings - Fork 7
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 importing as float #14
Comments
Are you specifying the sampling frequency as a float in the spreadsheet, and/or the |
I just used 'General' formatting in the spreadsheet on excel (although I did also try changing the format to 'Number'). I did not change the time-resolution, and kept it as 1. Should this be changed..? I score 4sec epochs. |
I am trying to work out which bit of code is promoting the integer
No, that is fine. |
Hi, I am reading it as a csv and it's value is 250 when I open it in a text editor. As I say, the line I added seems to fix the issue so hopefully it's not much of a problem, although odd... |
I would like to also add here that I also get an error when the sampling rate number is either float or integer in the csv file. The error for float is from the |
@pantelisantonoudiou It does, thank you! |
Just in case anyone else comes across this issue:
When running '01_preprocess_signals.py' it doesn't seem to work with a sample rate other than 256Hz (I'm using 250Hz) since it seems to be importing the sample rate as a float rather than int. I managed to solve this by adding the following after line 134:
datasets['sampling_frequency_in_hz']=datasets['sampling_frequency_in_hz'].astype(int)
The error i was getting:
Traceback (most recent call last): File "C:\Users\rp17047\somnotate\example_pipeline\01_preprocess_signals.py", line 167, in <module> time, frequencies, preprocessed_signal = preprocess(signal, dataset['sampling_frequency_in_hz'], File "C:\Users\rp17047\somnotate\example_pipeline\01_preprocess_signals.py", line 84, in preprocess frequencies, time, spectrogram = get_spectrogram(raw_signal, File "C:\Users\rp17047\AppData\Local\miniconda3\envs\somnotate_env\lib\site-packages\lspopt\lsp.py", line 145, in spectrogram_lspopt H, taper_weights = lspopt(n=nperseg, c_parameter=c_parameter) File "C:\Users\rp17047\AppData\Local\miniconda3\envs\somnotate_env\lib\site-packages\lspopt\lsp.py", line 56, in lspopt h = np.vstack((np.ones((n,)), 2 * t1)) File "C:\Users\rp17047\AppData\Local\miniconda3\envs\somnotate_env\lib\site-packages\numpy\core\numeric.py", line 191, in ones a = empty(shape, dtype, order) TypeError: 'float' object cannot be interpreted as an integer
The text was updated successfully, but these errors were encountered: