Closed fietew closed 8 years ago
I have applied your proposed change from eps
to 0
for a pint source (L124) in the branch fix_ssd_selection
. If I run your example the output looks identical to me.
As I understood it this is the crucial part why this bug happens: "two secondary sources are exactly on this bound", correct?
I can reproduce the behavior for -eps
, do you know why this is working and can we somehow become independent of the sign?
I understood the eps
as the maximum value, which may be added or substracted to the true result of an arithmetic operation due to numerical noise, i.e. finite numerical resolution. Assuming the true value of the scalar product is 0, its calculated value might be between +eps
and -eps
. I guess choosing -eps
for comparison is the conversative approach, as all sources are selected, where the scalar product yields greater-equal -eps
. However, there might be a source, where the true is smaller than 0 and which are selected erroneously due to this selection criterion.
I think you are right and it is more conservative to use a negative value. I tested the same for ls
as source and added now -2*eps
as the criterium as for ls
-eps
was not enough.
Btw, for focused sources and plane wave there was no error with your loudspeaker array, so I didn't changed the selection criterium.
Try the following
Although everything is symmetric, the number of selected sources is different. I think this is related to the usage of
eps
in https://github.com/sfstoolbox/sfs/blob/master/SFS_general/secondary_source_selection.m#L124 . While replacing it with0
does make a difference, replacing it with-eps
leads to the same result for both setups. Note, that the range for azimuth of the the selected secondary sources lies between phi_s +- 60 degrees, where phi_s is the azimuth of the virtual point source. Due to the azimuthal grid of 10 degrees resolution two secondary sources are exactly on this bound.