-
Notifications
You must be signed in to change notification settings - Fork 440
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
IndexError
on room.visibility
when sources and microphones are not in sight
#313
Comments
Hello, could you please include the code that builds the room ? |
Sure, sorry for not providing it before. The setup is as follows: # Room
sigma2 = 5e-4
fs = 16000
corners = np.array([
[ 0, 0],
[10, 0],
[10, 16],
[ 0, 16],
[ 0, 10],
[ 8, 10],
[ 8, 6],
[ 0, 6],
]).T
room = pra.Room.from_corners(corners, fs=fs, max_order=1, sigma2_awgn=sigma2)
# Microphones
def mic_array_at(pos: np.ndarray) -> pra.MicrophoneArray:
mic_locations = pra.circular_2D_array(center=pos, M=6, phi0=0, radius=37.5e-3)
mic_locations = np.concatenate((mic_locations, np.array(pos, ndmin=2).T), axis=1)
return pra.MicrophoneArray(mic_locations, room.fs)
mic = mic_array_at(np.array([3, 3]))
room.add_microphone_array(mic)
# Sources
rng = np.random.RandomState(23)
duration_samples = int(fs)
source_location = np.array([3, 13])
source_signal = rng.randn(duration_samples)
room.add_source(source_location, signal=source_signal) I thought that |
@gdelazzari Hi! I am facing a similar issue now. Did you find a way to fix it? Or an explanation on why is it failing? Thanks a lot in advance! |
@gdelazzari Thanks for reporting this. |
Fixed in PR #351 |
I'm trying to simulate the following room:
where there is a sound source at the top and a microphone array at the bottom.
However,
room.simulate()
fails:It seems there is an issue with the
room.visibility
array in this case where the source and the microphones are not visible.If I instead place the source and the microphones such that they are in direct sight, everything works.
Am I doing something wrong?
Thanks!
The text was updated successfully, but these errors were encountered: