-
Notifications
You must be signed in to change notification settings - Fork 100
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
issue with knee model #339
Comments
Can you share some of the spectra? It helps to see what they look like. |
Hi @voytek, |
Hmmm, can you also share the resulting image with the spectrum and the model that you get from fm.report()? |
Do you get the wildly large knee values in both cases? The fitting range you're using is very different between the two sets and I'm wondering if that's somehow causing this. |
Sorry, I don't really understand your answer. But here are two more examples: My code to plot the signal in my first channel: file_path = os.path.join(out_dir, 'patient_power-spectrum_FOOOF-TEST.csv') index = 3 def parse_list(string): freq_mask = (frequencies_1 >= 4) & (frequencies_1 <= 75) frequency_range = (4, 75) plt.figure(figsize=(12, 8)) for peak_params in fm.get_params('peak_params'): plt.title(f"Power Spectrum and FOOOF Fit (Index {index}, Day/Night: {day_night_value})") And two examples of my results: the power spectrum:
The power spectrum: POWER SPECTRUM MODEL
Thank you for your help, |
Right now you're fitting from 4-75 Hz. What if you change it to 1-60 Hz? |
It's better but I always have strange values. I don't understand why I have a high knee value. For the channel 1:
|
@ryanhammonds do you have any recommendations or suggestions here? |
Thank you for your answers! |
Hi,
I have a problem with the fm.fit. All my knee values are very high. I have checked my power spectrum and it looks OK (no artefacts), but as soon as I run the Fooof analysis and fit, the knee values are totally inconsistent.
I tried with the FOOOF and then with the SpectralModel and it gives the same thing. Can anyone help me?
Here is a part of my code:
Parameters
sampling_rate = 250
min_peak_height = 0.15
max_n_peaks = 6
min_freq = 4
max_freq = 75
peak_width_limits=[2,25]
frequency_range = (min_freq, max_freq)
for index, row in filtered_df.iterrows():
if isinstance(row["Ch 1 data"], (list, np.ndarray)) and len(row["Ch 1 data"]) > 0:
freqs, powers = {}, {}
FOOOF results if fm.has_model:
And the output for FOOOF analysis:
Thank you for your help!
The text was updated successfully, but these errors were encountered: