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

Converting to dBSPL from Pa gives incorrect answer #683

Closed
ubertakter opened this issue Sep 20, 2023 · 2 comments
Closed

Converting to dBSPL from Pa gives incorrect answer #683

ubertakter opened this issue Sep 20, 2023 · 2 comments

Comments

@ubertakter
Copy link

ubertakter commented Sep 20, 2023

Converting pressure level to sound pressure level gives an incorrect result. Example:

julia> uconvertrp(u"dBSPL", 35u"Pa")
124.86076097372589 dBSPL

The expected answer is 28.750252691799393.

I skimmed the source code but it was not immediately apparent how this value is calculated.

@sostock
Copy link
Collaborator

sostock commented Sep 21, 2023

The result seems correct to me. dBSPL uses a reference pressure of 20 μPa, which according to Wikipedia is commonly used for sound pressure in air.

Using a reference sound pressure of 20 μPa, we get

julia> 20 * log10(35u"Pa" / 20u"μPa")
124.86076097372589

Why do you expect to get 28.750252691799393?

@ubertakter
Copy link
Author

ubertakter commented Sep 21, 2023

The result seems correct to me. dBSPL uses a reference pressure of 20 μPa, which according to Wikipedia is commonly used for sound pressure in air.

Using a reference sound pressure of 20 μPa, we get

julia> 20 * log10(35u"Pa" / 20u"μPa")
124.86076097372589

Why do you expect to get 28.750252691799393?

Yeah, no, you are correct. That's what I get for trying to work things out at the end of the day. Sorry about that.

I work with explosions a lot, where the threshold for injury (in terms of pressure) is much higher than the threshold for injury due to noise. Humans is weird.

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

2 participants