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

Using the same seed, the rendered IR is different #118

Open
YYDreamzure opened this issue Jun 6, 2023 · 3 comments
Open

Using the same seed, the rendered IR is different #118

YYDreamzure opened this issue Jun 6, 2023 · 3 comments

Comments

@YYDreamzure
Copy link

Hi, I have been trying to obtain RIR using Soundspace2.0. However, for the same seed (which leads to the same coordinates), the rendered IR is different for each run of the same script.

Using this script:
seed = 11
sim.pathfinder.seed(seed)
nav_point = sim.pathfinder.get_random_navigable_point()
if sim.pathfinder.is_navigable(nav_point):
audio_sensor.setAudioSourceTransform(nav_point + np.array([0.,1.66,0.]))
observations = sim.get_sensor_observations()
ir = np.array(sim.get_sensor_observations()["audio_sensor"])
print("Source name:", source_name, "World position:", coor)
rt60 = measure_rt60(ir, sampling_rate, decay_db=30, plot=True)
print(f'RT60 of the rendered IR for {source_name} is {rt60:.4f} seconds')

@ChanganVR
Copy link
Contributor

Hi @YYDreamzure yes, that is true. Our path-tracing algorithm is based on Monte-Carlo sampling and thus there is some stochasticity to improve the speed, which is only for the indirect sound. For the direct sound, there should be no stochasticity.

@YYDreamzure
Copy link
Author

@ChanganVR Thank you so much for your reply! In this case, would the simulated IR be affected by agent initialisation? For example, if I rerun the AgentInitialisation function everytime I changed a sound source location, would it be the same as when I use a single agent initialisation and do not re-run the AgentInitialisation function when I changed the source location?
(All conditions set to False for Agent Initialisation)
Thanks a lot for your help!

@ChanganVR
Copy link
Contributor

Which AgentInitialisation function are you referring to? Are you talking about resetting the receiver location when you change the source location? If the location changes, of course, it will affect the IR since IR is a function of the receiver location. If you mean resetting the agent location to the same place, I don't see how it would affect the IR.

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