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

SPL calculation with surface receiver #372

Open
rapherent opened this issue Dec 7, 2023 · 12 comments
Open

SPL calculation with surface receiver #372

rapherent opened this issue Dec 7, 2023 · 12 comments

Comments

@rapherent
Copy link

SPL comparison

In the document "Modelling of physical phenomena in SPPS", "Calculation of the sound pressure level on a surface receiver" is written: "Note that the calculation of a sound pressure level for a surface is quite ambiguous. It should not be comparable to grid of punctual receivers on a plane."

I have made some comparative calculations and found that the expected results are far apart; in particular, the results between the sound pressure level of a punctual receiver and a surface receiver.

In the pictured modell, i designed a source on the left side and:

  • Nine punctual receiver in a distance from 10 m to 90 m
  • Nine surface receiver (vertical) with 0° to source in a distance from 10 m to 90 m
  • One Surface receiver (vertical) in a distance from 0 m to 90 m
  • One Surface receiver (horizontal) in a distance from 0 m to 90 m

The calculation was done with the setting "direct field only" and SPPS.

-> The surface receiver (vertical) shows no relevant results.
-> The results from the nine punctual receivers are nearly identical with the nine surface receiver (vertical) with 0° to source.
-> The results from the nine punctual receivers differ from the results of the Surface receiver (horizontal) at the points 10-90 m.
-> The difference in SPL between the first an last punctual receiver is around 20 dB; the horizontal sourface receivers shows a difference in SPL of 30 dB.

From my point of view, this creates the following problems:

-> The calculation of SPL on a sourface receiver depends on the angle of incident; that should not be.
-> All acoustic parameters who are based on SPL calculation (without an angle of incident) are wrong, because the results will get a weighting of angle of incident.
---> The calculation and presentation of results as a sourface receiver is useless.

Why is there no calculation with a grid of punctual receiver and a presentation of the results as a sourface?

Many thanks in advance.

@wbinek
Copy link
Contributor

wbinek commented Dec 7, 2023

In SPPS properties you can change the surface receiver mode from "Intensity" to "SPL". In "SPL" mode there should be no dependency on the angle of incidence for the surface receiver.

The problem with vertical plane is that for the ray to be recorded on the surface it must cross the surface. If the ray is ideally parallel to the surface receiver it will not be recorded. It can be easily mitigated by making the receiver surface and the sound source not exactly within same plane.

Edit:
Actually whether the surface receiver results should or should not depend on the angle of incidence is not so simple. In case of simulating the behaviour of point receiver they should not (so SPL mode), but to properly record the energy incident to the surface (as surface, not as point receiver grid) they should (so Intensity mode).

@rapherent
Copy link
Author

  • The SPPS properties are in "SPL" mode.
  • The horizontal surface is 1 m deeper than the source; so they are not at the same level.
  • SPL ist physically not definied as a vector; the intensity is. As shown, there is a dependency in I-Simpa between angle of incident and SPL at a calculation with a surface receiver; that should not be.

@wbinek
Copy link
Contributor

wbinek commented Dec 7, 2023

Could you please share the model you use for testing as it is really nice. I will look into it, but I can't promise a quick and easy fix :)

@rapherent
Copy link
Author

rapherent commented Dec 7, 2023

The results shown above are from a simple sound propagation calculation:

  • The punctual receivers results are exakt as expected and agree with the formula Lp=Lw-20*LOG10("distance")-11 dB.
  • With a surface receiver the drop in the sound pressure level is 10 dB more than expected; that related to the angle of incidence of the sound; the angle is flater far away than nearby the sound source.

You can download the file here:
https://www.dropbox.com/scl/fi/k52z2tdxbozy2ncyu2o55/ExampleFreeField.proj?rlkey=2guhpkblwqbwn7mgo7udsauzq&dl=0

Another point: The colours (SPL results) at the crossing between a vertical and horizontal surface receiver must be the same.

@wbinek
Copy link
Contributor

wbinek commented Dec 7, 2023

I do understand the problem. I will look into it tomorrow.

I am almost certain that there is no explicit angle dependency in the surface receiver source code in SPL mode (there is in Intensity mode). However as the rays are close to parallel to the surface the probability of crossing the surface decreases (as with the sun rays close to the poles) and it is not compensated. As l am thinking about it now it may be a flaw of the surface receiver implementation but it will require more thinking and some testing.

@rapherent
Copy link
Author

rapherent commented Dec 7, 2023

I get nearby the right results with this correction:
Correction

Somewhere in the SPL code is the cos (Theta) included; i think it uses the Ijsurf(n) part from the intensity for SPL calculations of P2jsurf(n) and then LjSPL,surf(n).

Thank you in advance!

@rapherent
Copy link
Author

rapherent commented Dec 8, 2023

In "I-Simpa/src/spps/input_output/reportmanager.cpp" in row 544 and 561 I found:

float i0_div_p0sqr=pow(10.f,-12.f)/pow((float)(20pow(10.f,(int)-6)),(int)2)(coreConfig.FastGetConfigValue(Core_Configuration::FPROP_RHO))(*coreConfig.FastGetConfigValue(Core_Configuration::FPROP_CELERITE));

Could that be the reason?

@wbinek
Copy link
Contributor

wbinek commented Dec 8, 2023

Let's start with the source of angle dependency. In general you are right that in SPL mode the angle dependency should be neglected, in receiver's Intensity mode we include the angle dependency.

The source code for energy recording on surface receivers is in reportmanager in lines 187-190 and repeated for different surface receiver type in lines 281-284:

if(*(this->paramReport.configManager->FastGetConfigValue(Core_Configuration::I_PROP_SURFACE_RECEIVER_MODE))==0)				
    (*itrs)->data[particleInfos.frequenceIndex][CellRow][CellCol][particleInfos.pasCourant]+=particleInfos.energie*cosf(normal.angle(particleInfos.direction));
else
    (*itrs)->data[particleInfos.frequenceIndex][CellRow][CellCol][particleInfos.pasCourant]+=particleInfos.energie;

As I said before in Intensity mode we explicitly multiply the energy with cosine of angle of incidence, but in SPL mode there is no such thing, but... This code is wrong, as when we look at ray propagation and the way it hits the surface we get an image like this (note that dA and spacing between rays is equal in both cases):
aoi

When rays are perpendicular to the surface there is higher ray density per differential surface dA than in case of oblique angles. This makes the angle dependency implicit in general ray tracing and ray-surface intersection. As a side note - this is not the case with point receivers as for point we always assume that the ray is perpendicular to the differential surface.

Therefore we now have two sources of angle dependency in surface receiver - explicit: written directly in the code and implicit: due to the nature of ray tracing. Now when we take into account the fact that implicit dependency is always present the right code for the energy recording is as follows:

if (*(this->paramReport.configManager->FastGetConfigValue(Core_Configuration::I_PROP_SURFACE_RECEIVER_MODE)) == 0)
	face->recepteurS->energieRecu[particleInfos.frequenceIndex][particleInfos.pasCourant] += particleInfos.energie;
else
	face->recepteurS->energieRecu[particleInfos.frequenceIndex][particleInfos.pasCourant] += particleInfos.energie / max(cosf(normal.angle(particleInfos.direction)), 0.000000001f); 

In Intensity mode we rely on implicit angle dependency, so there is no multiplication. In SPL mode we compensate the dependency by dividing the energy with the cosine of angle of incidence. The max() is there to avoid division by zero.

Finally, the corrected code gives correct results in the model you provided in SPL mode.
image

@wbinek
Copy link
Contributor

wbinek commented Dec 8, 2023

As for vertical receiver where no rays are detected - I would say that it is impossible to be easily fixed without some hacky solutions that may backfire at some point. To be detected the ray must cross the receiver surface (which being a surface is indefinitely thin). When the source is in plane with the receiver the rays will never cross the plane as they move parallel to it.

@rapherent
Copy link
Author

Thanks for superfast trouble shooting! The result looks as it should be.
I assume that the results for the reverberation time etc. on a surface receiver are now also correct?!

The sound incidence at an angle of 90° to a surface receiver corresponds to a theoretical special case, i don't consider it to be all that important. It was part of the test model I came up with in order to understand how the program works.
The major disadvantage of the planar receiver is that the projected area becomes smaller as the angle of theta increases (min area, 0 m² at 90°) and correspondingly fewer particles are detected on it in the direction of sound propagation. This would be clearer if the results were displayed from a grid of punctual receiver, as each receiver balloon would detect independently of the angle of sound incidence.

Is it already known when a revision of the program is to be expected?

@wbinek
Copy link
Contributor

wbinek commented Dec 12, 2023

I have not done any tests on other acoustic parameters, but I suspect the agreement between point and surface receivers should be improved.

You are correct, that the number of detected particles decreases as the theta increases and it is a drawback of a planar receiver. Currently it is possible to make a point receiver grid, but there is no build in tool for merging the results into a map. It would probably require more effort to implement such functionality into I-SIMPA. In fact it may be easier to do in postprocessing when required.

Regarding the revision - I have created a pull request, but I don't know when it may be merged. @nicolas-f, @Picaut, Could you please take a look at this issue and the pull request?

@nicolas-f
Copy link
Member

Hello,

Yes we will look into your PR, thanks for your support @wbinek

For SPPS and Plan Receiver (not the surface one) it should be implemented as a grid of point receivers.

nicolas-f added a commit that referenced this issue Jan 18, 2024

Fixes wrong energy recording for surface receivers.

The angle dependency for intensity mode is implicit in the ray tracing simulation, therefore it should not be added explicitly by multiplication. On the other hand in SPL mode it should be compensated.

For more details see the discussion in issue #372
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

3 participants