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

Possibly incorrect half-power calculation for damping ratio estimation #147

Open
1 task done
poernahi opened this issue Jul 31, 2024 · 0 comments
Open
1 task done
Labels
bug Something isn't working

Comments

@poernahi
Copy link

K-Shake&Tune module branch

  • I confirm using the main branch

Version

v4.1.0-1-g66f5e32e

Describe the bug and expected behavior

The damping ratio estimation is done by first finding the bandwidth at half-power from the PSD. Currently, the code calculates half power using the following formula:

https://github.com/Frix-x/klippain-shaketune/blob/main/shaketune/helpers/common_func.py#L148

half_power = max_power / math.sqrt(2)

I think the sqrt(2) term is correct if we are working with amplitudes, for example when measuring voltage in electronic systems. However, since the PSD calculation precedes this function, we are working with power spectral density instead of accelerometer amplitudes. This is a plot of power, which is amplitude squared. Therefore, it should be divided by 2 instead.

Another way to see it, deriving from pure mathematics and definition, "half_power = max_power / 2"

Here's an illustration of an example that I found online. Figure 5.3 shows acceleration, figure 5.4 shows PSD of acceleration (note the unit), and figure 5.5 shows the half-power bandwidth estimation.

https://endaq.com/pages/power-spectral-density

Additional information and klippy.log

No response

@poernahi poernahi added the bug Something isn't working label Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant