@@ -832,9 +832,10 @@ bool Room<D>::scat_ray(
832
832
// of scat_per_slot
833
833
if (travel_dist_at_mic < distance_thres && scat_trans.maxCoeff () > energy_thres)
834
834
{
835
-
836
- // output[k].push_back(Hit(travel_dist_at_mic, scat_trans));
837
- // microphones[k].log_histogram(output[k].back(), hit_point);
835
+ // The (r_sq * p_hit) normalization factor is necessary to equalize the energy
836
+ // of the IR computed with ray tracing to that of the image source method.
837
+ // Ref: D. Schroeder, "Physically based real-time auralization of interactive virtual environments",
838
+ // section 5.4, eq. 5.54.
838
839
double r_sq = double (travel_dist_at_mic) * travel_dist_at_mic;
839
840
auto p_hit = (1 - sqrt (1 - mic_radius_sq / std::max (mic_radius_sq, r_sq)));
840
841
Eigen::ArrayXf energy = scat_trans / (r_sq * p_hit) ;
@@ -944,6 +945,10 @@ void Room<D>::simul_ray(
944
945
// because the ray will continue its way
945
946
float travel_dist_at_mic = travel_dist + distance;
946
947
948
+ // The (r_sq * p_hit) normalization factor is necessary to equalize the energy
949
+ // of the IR computed with ray tracing to that of the image source method.
950
+ // Ref: D. Schroeder, "Physically based real-time auralization of interactive virtual environments",
951
+ // section 5.4, eq. 5.54.
947
952
double r_sq = double (travel_dist_at_mic) * travel_dist_at_mic;
948
953
auto p_hit = (1 - sqrt (1 - mic_radius_sq / std::max (mic_radius_sq, r_sq)));
949
954
energy = transmitted / (r_sq * p_hit);
0 commit comments