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

Simulating a room with no echo #258

Closed
drydenwiebe opened this issue May 9, 2022 · 4 comments
Closed

Simulating a room with no echo #258

drydenwiebe opened this issue May 9, 2022 · 4 comments

Comments

@drydenwiebe
Copy link

Hello!

I have a question about simulating audio with a very simple source/mic setup.

I know that what I am trying to do is not quite the intention of this library, but I want to prototype an algorithm on the simplest indoor acoustics setup before trying it on more complicated setups (with more complicated room geometry, echoes etc...).

I am trying to model a simple scenario where the sound is not bouncing off walls, but rather just returning the sound as it hits the mics directly for each mic without any indirect sound source. I would guess that the way to do this would be by setting ``max_order=0``` but this does not seem to work as there is echoes still.

Setting the wall material for a simple square room to be (1.0, 1.0) which corresponds to full absorption seems to give me the desired results but I think there must be a better way to do this.

Here is a notebook that is based off of the example room notebook that illustrates my issue. It is also attached as a zip file to this issue, github does not allow ipynb as attachments. no_echo_demo.zip

Thank you so much for your time!

@fakufaku
Copy link
Collaborator

fakufaku commented May 11, 2022

Hi @drydenwiebe , this is actually a fairly natural thing to try! Try without echoes first, then move on to the harder case 😄 We are actually working on adding a new object class just for that (see PR #224 ). I think it should get merged pretty soon.
Nevertheless, it should work also by setting max_order=0.

I have checked your script and you are calling

room.set_ray_tracing(receiver_radius=0.5, n_rays=10000, energy_thres=1e-5)

which will simulate reverberation (echoes!) using the ray tracing method.
If you remove this line, it should work as expected.
You are setting ray_tracing=False in the constructor, but calling set_ray_tracing will turn it back on.

@drydenwiebe
Copy link
Author

Hi @fakufaku, thank you so much for the response!

I see what the issue was, makes sense. Out of curiosity when I called set_ray_tracing the simulator is then set to use the hybrid ray tracing/image method, or just ray tracing. If so is there a way to only use ray tracing?

Thank you!

@fakufaku
Copy link
Collaborator

fakufaku commented Jun 6, 2022

You can disable the image method by setting max_order=-1. This will even ignore the direct sound. If you want to keep the direct sound, you can set max_order=0.

You can also enable ray tracing in the room constructor directly.

@drydenwiebe
Copy link
Author

Ah I see, makes sense. Thank you!

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

2 participants