Skip to content

Converting knee param to knee freq (double exponential) #301

@TomDonoghue

Description

@TomDonoghue

This issue is to pick up on a discussion that started in #290, for how to convert between the knee parameter and the knee frequency, specifically in the case of a double exponential model. To keep PRs a bit more modulate, this topic was split out from the rest of #290, which does more general refactors of the simulation functions.

Notes on double-exp model

The sim_knee function implements a double exponent + knee function, described as:
It's this: L(freq) = 1 / (freq**(exponent1) * freq**(exponent2 + exponent1) + knee)

This formulation uses the 'knee parameter', which isn't super easy to interpret. It would be nice to be able to use (and/or at least convert to) the knee frequency - the frequency at which the exponents change. This issue is to figure out how to do so (if it's even possible).

A candidate for converting the knee frequency and knee parameter is the following (see below):

knee_term = knee**(-2*exponent1 - exponent2)

Knee Derivation (from Ryan)

@ryanhammonds work on deriving the knee
from: #290 (comment)

The knee is defined as:
knee_freq = knee ** (1 / (2*exponent1 + exponent2))

from solving for the fwhm in the Lorenztian:

L(freq) = 1 / (freq**(exponent1) * freq**(exponent2 + exponent1) + knee)
L(knee_freq) = f(0) / 2

1 / (knee_freq**exponent1 * knee_freq**(exponent2 + exponent1)) + knee = 1 / (2 * knee)
knee_freq**exponent1 * knee_freq**(exponent2 + exponent1) + knee = 2 * knee
knee_freq**(2*exponent1 + exponent2) = knee
knee_freq = knee ** (1 / (2*exponent1 + exponent2))

I think this should be the analogous to solving knee_freq = knee**(1/exponent) in the single exponent model.

Notes from Richard

Note from Richard (#290 (comment)):
"at a quick glance, I think this might be a bit more complicated, though Ryan's derivations look good, at least in terms of the algebra. ... I'm actually not sure what the "right" answer for the knee_freq is when there's two slopes, bc it's not so easy to define where the tapering off happens when there's no flat plateau"

Other notes

In #290, there was an initial update for converting between knee parameter and knee frequency.

See the following commits for this (from Ryan).

  • adding in the knee conversion: ccc69f8
  • updating tests for knee conversion: 0f3af93

Note that to separate PR's, some of these changes were reverted in later commits in #290.

Metadata

Metadata

Labels

2.3Updates to go into a 2.3.0.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions