Skip to content

Commit bd59f77

Browse files
committed
add comments on knee convs
1 parent 50f0e70 commit bd59f77

File tree

1 file changed

+31
-2
lines changed

1 file changed

+31
-2
lines changed

fooof/utils/params.py

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,27 @@ def compute_knee_frequency(knee, exponent):
1919
-------
2020
float
2121
Frequency value, in Hz, of the knee occurs.
22+
23+
Notes
24+
-----
25+
The knee frequency is an estimate of the frequency in spectrum at which the spectrum
26+
moves from the plateau region to the exponential decay.
27+
28+
This approach for estimating the knee frequency comes from [1]_ (see [2]_ for code).
29+
30+
Note that this provides an estimate of the knee frequency, but is not, in the general case,
31+
a precisely defined value. In particular, this conversion is based on the case of a Lorentzian
32+
with exponent = 2, and for other exponent values provides a non-exact approximation.
33+
34+
References
35+
----------
36+
.. [1] Gao, R., van den Brink, R. L., Pfeffer, T., & Voytek, B. (2020). Neuronal timescales
37+
are functionally dynamic and shaped by cortical microarchitecture. Elife, 9, e61277.
38+
https://doi.org/10.7554/eLife.61277
39+
.. [2] https://github.com/rdgao/field-echos/blob/master/echo_utils.py#L64
2240
"""
2341

24-
return knee ** (1./exponent)
42+
return knee ** (1. / exponent)
2543

2644

2745
def compute_time_constant(knee_freq):
@@ -36,9 +54,20 @@ def compute_time_constant(knee_freq):
3654
-------
3755
float
3856
Calculated time constant value, tau, given the knee frequency.
57+
58+
Notes
59+
-----
60+
This approach for estimating the time constant comes from [1]_ (see [2]_ for code).
61+
62+
References
63+
----------
64+
.. [1] Gao, R., van den Brink, R. L., Pfeffer, T., & Voytek, B. (2020). Neuronal timescales
65+
are functionally dynamic and shaped by cortical microarchitecture. Elife, 9, e61277.
66+
https://doi.org/10.7554/eLife.61277
67+
.. [2] https://github.com/rdgao/field-echos/blob/master/echo_utils.py#L65
3968
"""
4069

41-
return 1. / (2*np.pi*knee_freq)
70+
return 1. / (2 * np.pi * knee_freq)
4271

4372

4473
def compute_fwhm(std):

0 commit comments

Comments
 (0)