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

Level adjustment should work for binaural signals too #31

Open
achabotl opened this issue Mar 2, 2015 · 1 comment
Open

Level adjustment should work for binaural signals too #31

achabotl opened this issue Mar 2, 2015 · 1 comment

Comments

@achabotl
Copy link
Owner

achabotl commented Mar 2, 2015

In speech.Exeriment.adjust_levels, it should be possible to adjust the levels correctly even if the signals are binaural. A way to do this is simply:

average_level = np.mean(utils.dbspl(signal))

Average level should therefore always be a single number, independently of if signal has one, two, or more channels.

@achabotl
Copy link
Owner Author

Something like this should do the trick:

mean_level = np.mean(utils.dbspl(signal))
adjusted_signal = target * 10 ** ((target_level - mean_level) / 20)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant