Microphone array have a wrong position in SB tutorial


Speechbrain helps me learn a lot about speech processing, thanks.

This tutorial(MultiMicrophoneBeamforming) points out the microphone used a circular array with four microphones uniformly spaced and a diameter of 0.1m. I think it will look like the following, right?


It seems that channel 3 is not set in a correct position.

#  The tested source location comes from
#  direction x=−0.82918, y=0.55279 and z=−0.082918.
from speechbrain.dataio.dataio import read_audio
from speechbrain.processing.features import STFT
from speechbrain.processing.multi_mic import Covariance
from speechbrain.processing.multi_mic import SrpPhat

import torch

mics = torch.zeros((4,3), dtype=torch.float)
mics[0,:] = torch.FloatTensor([-0.05, -0.05, +0.00])
mics[1,:] = torch.FloatTensor([-0.05, +0.05, +0.00])
mics[2,:] = torch.FloatTensor([+0.05, +0.05, +0.00])
mics[3,:] = torch.FloatTensor([+0.05, +0.05, +0.00])   # It should be [+0.05, -0.05, +0.00] ?

stft = STFT(sample_rate=fs)
cov = Covariance()
srpphat = SrpPhat(mics=mics)

Xs = stft(xs_diffused_noise)
XXs = cov(Xs)
doas = srpphat(XXs)


and the result is

tensor([[[-0.8284,  0.5570,  0.0588],
         [-0.8284,  0.5570,  0.0588]]])

When corrected to [+0.05, -0.05, +0.00] and ran again, the result I got was no longer accurate.

tensor([[[-0.3077,  0.5369, -0.7855],
         [-0.3077,  0.5369, -0.7855]]])

I am confused whether this is a misunderstanding of the tutorial or there are some errors in the code.

Hi there,

You are right regarding the sign error. I think the same sign error was also there when we simulated the signals, which explains why the DoA is good with the current sign error. We should generate new samples with the fix, as right now it seems we only have 3 useful microphone signals.