LCAV / pyroomacoustics

Pyroomacoustics is a package for audio signal processing for indoor applications. It was developed as a fast prototyping platform for beamforming algorithms in indoor scenarios.
https://pyroomacoustics.readthedocs.io
MIT License
1.33k stars 417 forks source link

Need help with Pyroomacoustics Ray Tracing Code #312

Closed kweiwen closed 1 year ago

kweiwen commented 1 year ago

Dear Fakufaku,

I hope this message finds you well. I am currently studying the ray tracing code in Pyroomacoustics and have come across an issue that I would like to discuss with you.

Specifically, I have noticed that a Poisson process generates a sequence in the following code: https://github.com/LCAV/pyroomacoustics/blob/0ccf8ae06f818f00a43a712038607e6744c13d08/pyroomacoustics/room.py#L2229

Subsequently, this sequence undergoes processing through a bandpass filter in the following code: https://github.com/LCAV/pyroomacoustics/blob/0ccf8ae06f818f00a43a712038607e6744c13d08/pyroomacoustics/room.py#L2279

However, it appears that the seq_bp_rot is irrelevant to the resulting ir_loc: https://github.com/LCAV/pyroomacoustics/blob/0ccf8ae06f818f00a43a712038607e6744c13d08/pyroomacoustics/room.py#L2284

From the reference you suggest Physically Based Real-Time Auralization of Interactive Virtual Environments. Based on Fig. 5.18(e) on page 71, it seems that the sequence should be weighted by the energy envelope of the RIR. However, I am having difficulty identifying the corresponding part of the code.

Would you be able to assist me with this issue?

Thank you in advance for your help.

fakufaku commented 1 year ago

Hi @kweiwen ,

  1. seq_bp_rot is a view of seq_bp. There is after an in-place operation on seq_bp_rot that also modifies the content of seq_bp (lines 2291, 2292) since it points to the same data in memory.
  2. The weighting is done just there, lines 2289-2292
kweiwen commented 1 year ago

Dear @fakufaku,

I just found out there is an in-place operation. Now I got it, thanks so much.

fakufaku commented 1 year ago

Fantastic, I'll close the issue then 😄