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

Add Ray tracing method for RIR #2850

Closed
wants to merge 51 commits into from
Closed

Conversation

NicolasHug
Copy link
Member

@NicolasHug NicolasHug commented Nov 14, 2022

This PR adds the ray_tracing() helper to compute a RIR (part of #2624). The implementation is heavily based on pyroomacoustics.

Current status: support for 2D and 3D shoebox room is OK, results are very very close to those of pyroomacoustics. Ready for review

My C++ is weak / rusty, so any suggestion on style / perf / best practices are more than welcome.

Lots of TODOs left: Done

  • write docs
  • make autograd work properly Leaving this as potential future work as it is not immediately needed
  • support multiple bands
  • support per-wall and per-band absorption and scatter
  • [X]~ integrate this properly with the Image Source Method from Add simulate_rir_ism method for simulating RIR with Image Source Method #2644~ will be done later when PR is merged
  • bunch of TODOs here and there in the code
  • (maybe) parallelize code over num_rays

CC @nateanl

docs/source/prototype.functional.rst Outdated Show resolved Hide resolved
sound_speed: float = 343,
energy_thres: float = 1e-7,
time_thres: float = 10, # 10s
hist_bin_size: float = 0.004, # 4ms
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can also add air_absorption as the input argument.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the air_absorption parameter be part of the more global simulate_rir_[hybrid]() function? From what I understand in PRA it is used here https://github.com/LCAV/pyroomacoustics/blob/b3e36a6451e25bc700bc723e6d267645d43ac10f/pyroomacoustics/room.py#LL2331C2-L2331C3, i.e. it does not impact how the energy histogram is computed?

torchaudio/prototype/functional/_ray_tracing.py Outdated Show resolved Hide resolved
mthrok added a commit to mthrok/audio that referenced this pull request Sep 19, 2023
Summary:

Revamped version of pytorch#3234 (which was also revamp of pytorch#2850)

Differential Revision: D49197174
mthrok added a commit to mthrok/audio that referenced this pull request Sep 21, 2023
Summary:
Revamped version of pytorch#3234 (which was also revamp of pytorch#2850)


Differential Revision: D49197174

Pulled By: mthrok
mthrok added a commit to mthrok/audio that referenced this pull request Oct 2, 2023
Summary:
Revamped version of pytorch#3234 (which was also revamp of pytorch#2850)

Differential Revision: D49197174

Pulled By: mthrok
mthrok added a commit to mthrok/audio that referenced this pull request Oct 2, 2023
Summary:
Revamped version of pytorch#3234 (which was also revamp of pytorch#2850)

Differential Revision: D49197174

Pulled By: mthrok
mthrok added a commit to mthrok/audio that referenced this pull request Oct 2, 2023
Summary:
Revamped version of pytorch#3234 (which was also revamp of pytorch#2850)

Differential Revision: D49197174

Pulled By: mthrok
mthrok added a commit to mthrok/audio that referenced this pull request Oct 2, 2023
Summary:
Revamped version of pytorch#3234 (which was also revamp of pytorch#2850)

Differential Revision: D49197174

Pulled By: mthrok
mthrok added a commit to mthrok/audio that referenced this pull request Oct 2, 2023
Summary:
Revamped version of pytorch#3234 (which was also revamp of pytorch#2850)

Differential Revision: D49197174

Pulled By: mthrok
mthrok added a commit to mthrok/audio that referenced this pull request Oct 3, 2023
Summary:
Revamped version of pytorch#3234 (which was also revamp of pytorch#2850)

Differential Revision: D49197174

Pulled By: mthrok
mthrok added a commit to mthrok/audio that referenced this pull request Oct 3, 2023
Summary:
Revamped version of pytorch#3234 (which was also revamp of pytorch#2850)

Differential Revision: D49197174

Pulled By: mthrok
mthrok added a commit to mthrok/audio that referenced this pull request Oct 3, 2023
Summary:
Revamped version of pytorch#3234 (which was also revamp of pytorch#2850)

Differential Revision: D49197174

Pulled By: mthrok
mthrok added a commit to mthrok/audio that referenced this pull request Oct 3, 2023
Summary:
Revamped version of pytorch#3234 (which was also revamp of pytorch#2850)

Differential Revision: D49197174

Pulled By: mthrok
mthrok added a commit to mthrok/audio that referenced this pull request Oct 3, 2023
Summary:
Revamped version of pytorch#3234 (which was also revamp of pytorch#2850)

Differential Revision: D49197174

Pulled By: mthrok
mthrok added a commit to mthrok/audio that referenced this pull request Oct 3, 2023
Summary:
Revamped version of pytorch#3234 (which was also revamp of pytorch#2850)

Differential Revision: D49197174

Pulled By: mthrok
mthrok added a commit to mthrok/audio that referenced this pull request Oct 4, 2023
Summary:
Revamped version of pytorch#3234 (which was also revamp of pytorch#2850)

Differential Revision: D49197174

Pulled By: mthrok
mthrok added a commit to mthrok/audio that referenced this pull request Oct 4, 2023
Summary:
Revamped version of pytorch#3234 (which was also revamp of pytorch#2850)

Differential Revision: D49197174

Pulled By: mthrok
mthrok added a commit to mthrok/audio that referenced this pull request Oct 4, 2023
Summary:
Revamped version of pytorch#3234 (which was also revamp of pytorch#2850)

Differential Revision: D49197174

Pulled By: mthrok
mthrok added a commit to mthrok/audio that referenced this pull request Oct 4, 2023
Summary:
Revamped version of pytorch#3234 (which was also revamp of pytorch#2850)

Differential Revision: D49197174

Pulled By: mthrok
mthrok added a commit to mthrok/audio that referenced this pull request Oct 5, 2023
Summary:
Revamped version of pytorch#3234 (which was also revamp of pytorch#2850)

Differential Revision: D49197174

Pulled By: mthrok
mthrok added a commit to mthrok/audio that referenced this pull request Oct 5, 2023
Summary:
Revamped version of pytorch#3234 (which was also revamp of pytorch#2850)

Differential Revision: D49197174

Pulled By: mthrok
mthrok added a commit to mthrok/audio that referenced this pull request Oct 5, 2023
Summary:
Revamped version of pytorch#3234 (which was also revamp of pytorch#2850)

Differential Revision: D49197174

Pulled By: mthrok
mthrok added a commit to mthrok/audio that referenced this pull request Oct 5, 2023
Summary:
Revamped version of pytorch#3234 (which was also revamp of pytorch#2850)

Differential Revision: D49197174

Pulled By: mthrok
mthrok added a commit to mthrok/audio that referenced this pull request Oct 5, 2023
Summary:
Revamped version of pytorch#3234 (which was also revamp of pytorch#2850)

Differential Revision: D49197174

Pulled By: mthrok
mthrok added a commit to mthrok/audio that referenced this pull request Oct 9, 2023
Summary:
Revamped version of pytorch#3234 (which was also revamp of pytorch#2850)

Differential Revision: D49197174

Pulled By: mthrok
mthrok added a commit to mthrok/audio that referenced this pull request Oct 9, 2023
Summary:
Revamped version of pytorch#3234 (which was also revamp of pytorch#2850)

Differential Revision: D49197174

Pulled By: mthrok
mthrok added a commit to mthrok/audio that referenced this pull request Oct 9, 2023
Summary:
Revamped version of pytorch#3234 (which was also revamp of pytorch#2850)

Differential Revision: D49197174

Pulled By: mthrok
mthrok added a commit to mthrok/audio that referenced this pull request Oct 13, 2023
Summary:
Revamped version of pytorch#3234 (which was also revamp of pytorch#2850)

Differential Revision: D49197174

Pulled By: mthrok
@mthrok mthrok mentioned this pull request Oct 13, 2023
mthrok added a commit that referenced this pull request Oct 13, 2023
Summary:
Revamped version of #3234
(which was also revamp of #2850)
@mthrok
Copy link
Collaborator

mthrok commented Oct 19, 2023

Addressed via #3655

@mthrok mthrok closed this Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants