Skip to content

Commit 969973c

Browse files
committed
Scrub reference to amplitude (replace by height or power) in docs & tutorials
1 parent a7d583b commit 969973c

File tree

9 files changed

+28
-21
lines changed

9 files changed

+28
-21
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ FOOOF conceives of a model of the power spectrum as a combination of two distinc
1717

1818
This model driven approach can be used to measure periodic and aperiodic properties of electrophysiological data, including EEG, MEG, ECoG and LFP data.
1919

20-
The benefit of using FOOOF for measuring putative oscillations, is that peaks in the power spectrum are characterized in terms of their specific center frequency, amplitude and bandwidth without requiring predefining specific bands of interest and controlling for the aperiodic component. FOOOF also gives you a measure of this aperiodic components of the signal, allowing for measuring and comparison of 1/f like components of the signal within and between subjects.
20+
The benefit of using FOOOF for measuring putative oscillations, is that peaks in the power spectrum are characterized in terms of their specific center frequency, power and bandwidth without requiring predefining specific bands of interest and controlling for the aperiodic component. FOOOF also gives you a measure of this aperiodic components of the signal, allowing for measuring and comparison of 1/f like components of the signal within and between subjects.
2121

2222
## Documentation
2323

@@ -119,8 +119,8 @@ fm = FOOOF(peak_width_limits=[1.0, 8.0], max_n_peaks=6, min_peak_height=0.1, pea
119119

120120
* `peak_width_limits` sets the possible lower- and upper-bounds for the fitted peak widths.
121121
* `max_n_peaks` sets the maximum number of peaks to fit.
122-
* `min_peak_height` sets an absolute limit on the minimum amplitude (above aperiodic) for any extracted peak.
123-
* `peak_threshold`, also sets a threshold above which a peak amplitude must cross to be included in the model. This parameter is in terms of standard deviation above the noise of the flattened spectrum.
122+
* `min_peak_height` sets an absolute limit on the minimum height (above aperiodic) for any extracted peak.
123+
* `peak_threshold`, also sets a threshold above which a peak height must cross to be included in the model. This parameter is in terms of standard deviation above the noise of the flattened spectrum.
124124

125125
FOOOF also has convenience methods for running the FOOOF model across matrices of multiple power spectra, as well as functionality for saving and loading results, creating reports from FOOOF outputs, and utilities to further analize FOOOF results.
126126

doc/faq.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ symmetric function (gaussians) to what can be an asymetric peak power spectrum.
129129

130130
Because of this, it is often useful to focus on the dominant (highest power) peak within a
131131
given frequency band from a FOOOF analysis, as this peak will offer the best estimate of
132-
the putative oscillations center frequency and amplitude. If analyzing bandwidth of extracted peaks,
132+
the putative oscillations center frequency and power. If analyzing bandwidth of extracted peaks,
133133
than overlapping peaks should always be considered. FOOOF is not currently optimized for inferring
134134
whether multiple peaks within a frequency band likely reflect distinct oscillations or not.
135135

examples/plot_synthetic_power_spectra.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
# the example below, this is interpreted as [offset, knee, exponent] for a 'knee' spectrum.
5858
#
5959
# Power spectra can also be simulated with any number of peaks. Peaks can be listed in a flat
60-
# list with [center frequency, amplitude, bandwidth] listed for as many peaks as you would
60+
# list with [center frequency, height, bandwidth] listed for as many peaks as you would
6161
# like to add, or as a list of lists containing the same information.
6262
#
6363
# The following example shows simulating a different power spectrum with some different

tutorials/plot_01-ModelDescription.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
#
7676
# Each peak is defined in terms of parameters `a`, `c` and `w`, where:
7777
#
78-
# - `a` is the amplitude of the peak, over and above the aperiodic signal
78+
# - `a` is the height of the peak, over and above the aperiodic signal
7979
# - `c` is the center frequency of the peak
8080
# - `w` is the width of the peak
8181
# - `F` is the vector of input frequencies

tutorials/plot_02-FOOOF.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,20 +112,27 @@
112112
# Notes on Interpreting Peak Parameters
113113
# -------------------------------------
114114
#
115+
# Peak parameters are labelled as:
116+
#
117+
# - CF: center frequency of the extracted peak
118+
# - PW: power of the peak, over and above the aperiodic background
119+
# - BW: bandwidth of the extracted peak
120+
#
115121
# Note that the peak parameters that are returned are not exactly the same as the
116122
# parameters of the Gaussians used internally to fit the peaks.
117123
#
118124
# Specifically:
119125
#
120-
# - CF is the mean parameter of the Gaussian (same as the Gaussian)
121-
# - Amp is the amplitude of the model fit above the aperiodic signal fit [1],
122-
# which is not necessarily the same as the Gaussian amplitude
126+
# - CF is the exact same as mean parameter of the Gaussian
127+
# - PW is the height of the model fit above the aperiodic signal fit [1],
128+
# which is not necessarily the same as the Gaussian height
123129
# - BW is 2 * the standard deviation of the Gaussian [2]
124130
#
125131
# [1] Since the Gaussians are fit together, if any Gaussians overlap,
126132
# than the actual height of the fit at a given point can only be assessed
127-
# when considering all Gaussians. To be better able to interpret amplitudes
128-
# for single peak fits, we re-define the peak amplitude as above.
133+
# when considering all Gaussians. To be better able to interpret heights
134+
# for single peak fits, we re-define the peak height as above, and label
135+
# it as 'power', as the units of the input data as expected to be power.
129136
#
130137
# [2] Standard deviation is '1 sided', where as the returned BW is '2 sided'.
131138
#

tutorials/plot_03-FOOOFAlgorithm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
#
114114
# - The maximum point of the flattened spectrum is found.
115115
#
116-
# - If this point fails to pass the relative or absolute amplitude threshold,
116+
# - If this point fails to pass the relative or absolute height threshold,
117117
# the procedure halts.
118118
# - A Gaussian is fit around this maximum point
119119
# - This 'guess' Gaussian is then subtracted from the flatted spectrum

tutorials/plot_04-MoreFOOOF.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,14 @@
5858
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5959
#
6060
# An iterative procedures searches for candidate peaks in the flattened spectrum. Candidate
61-
# peaks are extracted in order of decreasing amplitude, until some stopping criterion is met,
61+
# peaks are extracted in order of decreasing height, until some stopping criterion is met,
6262
# which is controlled by the following parameters:
6363
#
6464
# **max_n_peaks (int)** default: infinite
6565
#
6666
# The maximum number of peaks that can be extracted from a given power spectrum. FOOOF will
6767
# halt searching for new peaks when this number is reached. Note that FOOOF extracts peaks
68-
# iteratively by amplitude (over and above the aperiodic signal), and so this approach will
68+
# iteratively by height (over and above the aperiodic signal), and so this approach will
6969
# extract (up to) the *n* largest peaks.
7070
#
7171
# **peak_threshold (in units of standard deviation)** default: 2.0
@@ -77,13 +77,13 @@
7777
#
7878
# **min_peak_height (units of power - same as the input spectrum)** default: 0
7979
#
80-
# The minimum amplitude, above the aperiodic fit, that a peak must have to be extracted
80+
# The minimum height, above the aperiodic fit, that a peak must have to be extracted
8181
# in the initial fit stage. Once a candidate peak drops below this threshold, the peak
8282
# search is halted (without including the most recent candidate). Note that because
8383
# this constraint is enforced during peak search, and prior to final peak fit, returned
84-
# peaks are not guaranteed to surpass this value in amplitude.
84+
# peaks are not guaranteed to surpass this value in height.
8585
#
86-
# Note: there are two different amplitude-related halting conditions for the peak searching.
86+
# Note: there are two different height-related halting conditions for the peak searching.
8787
# By default, the relative (standard-deviation based) threshold is defined, whereas the
8888
# absolute threshold is set to zero (this default is because there is no general way to
8989
# set this value without knowing the scale of the data). If both are defined, both are

tutorials/plot_07-TroubleShooting.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
# - Setting a maximum number of peaks that the algorithm may fit: `max_n_peaks`
119119
#
120120
# - If set, the algorithm will fit (up to) the `max_n_peaks` highest power peaks.
121-
# - Setting a minimum absolute amplitude for peaks: `min_peak_height`
121+
# - Setting a minimum absolute peak height: `min_peak_height`
122122
#
123123

124124
###################################################################################################
@@ -182,7 +182,7 @@
182182
#
183183
# A known case in which FOOOF can overfit is in power spectra in which no peaks
184184
# are present. In this case, the standard deviation can be very low, and so the
185-
# relative amplitude check (`min_peak_threshold`) is very liberal at keeping gaussian fits.
185+
# relative peak height check (`min_peak_threshold`) is very liberal at keeping gaussian fits.
186186
#
187187
# If you expect, or know, you have power spectra without peaks in your data,
188188
# we therefore recommend making sure you set some value for `min_peak_height`,

tutorials/plot_08-FurtherAnalysis.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
###################################################################################################
6969

7070
# Set up indexes for accessing data, for convenience
71-
cf_ind, amp_ind, bw_ind = 0, 1, 2
71+
cf_ind, pw_ind, bw_ind = 0, 1, 2
7272

7373
# Define frequency bands of interest
7474
theta_band = [4, 8]
@@ -144,7 +144,7 @@
144144

145145
# Check descriptive statistics of oscillation data
146146
print('Alpha CF : ', np.nanmean(alphas[:, cf_ind]))
147-
print('Alpha Amp: ', np.nanmean(alphas[:, amp_ind]))
147+
print('Alpha PW : ', np.nanmean(alphas[:, pw_ind]))
148148
print('Alpha BW : ', np.nanmean(alphas[:, bw_ind]))
149149

150150
###################################################################################################

0 commit comments

Comments
 (0)