Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mixing of linear and log10 scale in gen_power_spectrum #240

Open
tensionhead opened this issue Aug 31, 2022 · 0 comments
Open

Mixing of linear and log10 scale in gen_power_spectrum #240

tensionhead opened this issue Aug 31, 2022 · 0 comments
Labels
idea / discussion A potential idea to consider / discuss.

Comments

@tensionhead
Copy link

tensionhead commented Aug 31, 2022

When assembling the synthetic power spectra in gen.py here:

powers = np.power(10, ap_vals + pe_vals + noise)

obviously it is assumed, that all components are on log10 scale. However when tracing the periodic component (gen_periodic -> get_pe_func -> gaussian_function), it is clear that the Gaussians are evaluated on a linear scale and then still exponentiated.

To directly see this, one can simply do:

import fooof
import matplotlib.pyplot as ppl
gauss_peak_val = 2
ppl.plot(*fooof.sim.gen_power_spectrum([1, 40], [0, 1e-10], [20, gauss_peak_val, 1]))

which results in:
fooof_spec

Note that the peak value in that supposedly linear scale is $10^2 = 100$, whereas the gauss_peak_val was set to 2. Also note that I effectively disabled the aperiodic component by setting the exponent very close to 0 to show this as clearly as possible.

@TomDonoghue TomDonoghue added the idea / discussion A potential idea to consider / discuss. label Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idea / discussion A potential idea to consider / discuss.
Projects
None yet
Development

No branches or pull requests

2 participants