Open gdelazzari opened 1 year ago
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 max_order
would play some important role in this case, but changing it had no effect on the issue I'm facing (I can instead see that, when the sources and microphones are in direct sight, the room.visibility
matrix shape changes as a function of max_order
).
@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!
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!