|
1 | 1 | """Classes & functions for managing parameter choices for synthesizing power spectra.""" |
2 | 2 |
|
3 | | -from collections import namedtuple |
4 | | - |
5 | 3 | import numpy as np |
6 | 4 |
|
7 | | -from fooof.core.utils import check_flat, get_data_indices |
8 | 5 | from fooof.core.funcs import infer_ap_func |
| 6 | +from fooof.core.utils import check_flat, get_data_indices |
| 7 | +from fooof.data import SynParams |
9 | 8 |
|
10 | 9 | ################################################################################################### |
11 | 10 | ################################################################################################### |
12 | 11 |
|
13 | | -SynParams = namedtuple('SynParams', ['aperiodic_params', 'gaussian_params', 'nlv']) |
14 | | - |
15 | | -SynParams.__doc__ = """\ |
16 | | -Stores parameters used to synthesize a single power spectra. |
17 | | -
|
18 | | -Attributes |
19 | | ----------- |
20 | | -aperiodic_params : list, len 2 or 3 |
21 | | - Parameters that define the aperiodic fit. As [Offset, (Knee), Exponent]. |
22 | | - The knee parameter is only included if aperiodic is fit with knee. Otherwise, length is 2. |
23 | | -gaussian_params : list or list of lists |
24 | | - Fitted parameter values for the peaks. Each list is a peak, as [CF, Amp, BW]. |
25 | | -nlv : float |
26 | | - Noise level added to the generated power spectrum. |
27 | | -""" |
28 | | - |
29 | 12 | def update_syn_ap_params(syn_params, delta, field=None): |
30 | 13 | """Update the aperiodic parameter definition in a SynParams object. |
31 | 14 |
|
|
0 commit comments