Skip to content

Commit

Permalink
Merge pull request #9 from fooof-tools/developments
Browse files Browse the repository at this point in the history
Developments
  • Loading branch information
brendan-ostlund authored Oct 2, 2021
2 parents 05aa1d9 + d403bf0 commit afdea16
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 22 deletions.
Binary file modified Output/EOP_demo.pdf
Binary file not shown.
28 changes: 11 additions & 17 deletions Python/02-GroupPSDs.ipynb
100644 → 100755

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions R/03-R_GroupPSDs.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ m2_freq, m2_spectra = trim_spectrum(freqs, spectra_subsample, m2_PSD_range)

#### Fit models, with different settings
```{python, message = FALSE}
# Fit a model object with model 1 settings
# Fit model object with model 1 settings
fg1 = FOOOFGroup(peak_width_limits = m1_peak_width, max_n_peaks = m1_n_peaks, min_peak_height = m1_peak_height)
fg1.fit(m1_freq, m1_spectra)
Expand All @@ -237,7 +237,7 @@ for ind in range(len(fg1)):
```

```{python, message = FALSE}
# Fit a model object with model 2 settings
# Fit model object with model 2 settings
fg2 = FOOOFGroup(peak_width_limits = m2_peak_width, max_n_peaks = m2_n_peaks, min_peak_height = m2_peak_height)
fg2.fit(m2_freq, m2_spectra)
Expand All @@ -262,6 +262,12 @@ settings2 = FOOOFSettings(peak_width_limits = m2_peak_width, max_n_peaks = m2_n_
aperiodic_mode = 'fixed')
```

```{python, message = FALSE}
# Initialize model object for spectral parameterization, with some settings
fg1 = FOOOFGroup(*settings1)
fg2 = FOOOFGroup(*settings2)
```

#### Fit models with group model object
Note that when fitting power spectra, you can specify a fit range to fit the model to, so you don't have to explicitly trim the spectra. Here we will refit the example data, specifying the fit range, and then save the group reports.
```{python, message = FALSE}
Expand Down
3 changes: 0 additions & 3 deletions R/04-R_ExampleAnalysis.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ from fooof.plts import plot_spectrum
from fooof.plts.periodic import plot_peak_fits, plot_peak_params
from fooof.plts.aperiodic import plot_aperiodic_params, plot_aperiodic_fits
# # Import utility functions that manipulate FOOOF objects
# from fooof.objs.utils import average_fg
# Import functions to examine frequency-by-frequency error of model fits
from fooof.analysis.error import compute_pointwise_error_fg
```
Expand Down

0 comments on commit afdea16

Please sign in to comment.