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

Cleaning MSBG code #360

Open
groadabike opened this issue Jan 25, 2024 · 0 comments
Open

Cleaning MSBG code #360

groadabike opened this issue Jan 25, 2024 · 0 comments

Comments

@groadabike
Copy link
Contributor

groadabike commented Jan 25, 2024

@jonbarker68:

Do you know what is the point of all these level variables?

signal_rms_level_db = 10 * np.log10(np.mean(np.array(signal) ** 2))
equiv_0db_spl = self.equiv_0db_spl + self.ahr
level_db_spl = equiv_0db_spl + signal_rms_level_db
calib_db_spl = level_db_spl
target_spl = level_db_spl
ref_rms_db = calib_db_spl - equiv_0db_spl

I am not sure if I am reding it correctly but there are some variables that are added and substracted making some variables useless.

for example, if we try to join all these operations in one line we get:

ref_rms_db = calib_db_spl - equiv_0db_spl 

repacing calib_db_spl

ref_rms_db = level_db_spl - equiv_0db_spl 

repacing level_db_spl

ref_rms_db = equiv_0db_spl + signal_rms_level_db - equiv_0db_spl 

obtaining

ref_rms_db = signal_rms_level_db
@groadabike groadabike changed the title MSBG code Cleaning MSBG code Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant