Skip to content

Commit 649c073

Browse files
upd spacing
1 parent d9645d3 commit 649c073

File tree

3 files changed

+119
-76
lines changed

3 files changed

+119
-76
lines changed

Python/01-IndividualPSD.ipynb

Lines changed: 102 additions & 73 deletions
Large diffs are not rendered by default.

R/02-R_IndividualPSD.Rmd

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,28 @@ print(spectrum.shape)
6565

6666
### Parameterize a power spectrum
6767
Now we can parameterize our power spectrum!
68+
```{python, message = FALSE}
69+
# Define `peak_width_limit` setting
70+
peak_width = [1, 8]
71+
72+
# Define `max_n_peaks` setting
73+
n_peaks = 6
74+
75+
# Define `min_peak_height` setting
76+
peak_height = 0.10
77+
78+
# Define frequency range
79+
PSD_range = [3, 40]
80+
```
81+
6882
```{python, message = FALSE}
6983
# Initialize a model object for spectral parameterization, with some settings
70-
fm = FOOOF(peak_width_limits = [1, 8], max_n_peaks = 6, min_peak_height = 0.10, verbose = False)
84+
fm = FOOOF(peak_width_limits = peak_width, max_n_peaks = n_peaks, min_peak_height = peak_height, verbose = False)
7185
```
7286

7387
```{python, message = FALSE, fig.height = 6, fig.width = 9}
7488
# Fit individual PSD over 3-40 Hz range
75-
fm.report(freqs, spectrum, [3, 40])
89+
fm.report(freqs, spectrum, PSD_range)
7690
plt.show()
7791
```
7892

R/03-R_GroupPSDs.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ spectra_sub = spectra_sub.sample(frac = 0.10, random_state = 1)
177177
spectra_sub_array = spectra_sub.to_numpy()
178178
```
179179

180-
Here, we define settings for two models to be fit and compared. A user could also use the `trim_spectrum` to define the frequency ranges for each mode; msee the [specparam website](https://fooof-tools.github.io/fooof/generated/fooof.utils.trim_spectrum.html#fooof.utils.trim_spectrum) for details on how to use this utility.
180+
Here, we define settings for two models to be fit and compared. A user could also use the `trim_spectrum` to define the frequency ranges for each model; see the [specparam website](https://fooof-tools.github.io/fooof/generated/fooof.utils.trim_spectrum.html#fooof.utils.trim_spectrum) for details on how to use this utility.
181181
```{python, message = FALSE}
182182
# Create frequency vector for model #1 ("m1", 2-20 Hz) and model #2 ("m2", 3-40 Hz)
183183
# NOTE: Python uses zero indexing

0 commit comments

Comments
 (0)