LCAV / pyroomacoustics

Pyroomacoustics is a package for audio signal processing for indoor applications. It was developed as a fast prototyping platform for beamforming algorithms in indoor scenarios.
https://pyroomacoustics.readthedocs.io
MIT License
1.43k stars 427 forks source link

beamforming on actual MicrophoneArray #132

Closed HemaZ closed 2 years ago

HemaZ commented 4 years ago

Hello, First of all, thank you for your effort in making this great library. what I'm trying to achieve is creating a beamformed output from 8 recorded signals from 8 microphones on a microphone array. I know the location of the 8 mics, the sampling rate, and the output signals. I wish to create a beamformed output. is this possible using your library? i've checked the beamforming examples and tried the following but with no success.

data = read_csv('Matrix1_0.csv').values # a csv file contains the 8 mics signals shape = (16000,8)
signal1 = np.array(data[:,0], dtype=float)
signal1 = pra.normalize(signal1)
signal1 = pra.highpass(signal1, Fs)
delay1 = 0.
source1 = pra.SoundSource([1., 1.], signal=signal1)
signal2 = np.array(data[:,1], dtype=float)
signal2 = pra.normalize(signal2)
signal2 = pra.highpass(signal2, Fs)
delay2 = 1.
source2 = pra.SoundSource([1., 1.], signal=signal2)
# compute beamforming filters
mics = pra.Beamformer(R, Fs, N=N, Lg=Lg)
mics.rake_mvdr_filters(source1,
                    source2,
                    sigma2_n*np.eye(mics.Lg*mics.M), delay=delay)
# process the signal
output = mics.process()
fakufaku commented 4 years ago

Hi @HemaZ,

It should be possible. From your code, I see that you are using MVDR. If there are no sources of interference, you can try to use instead the delay and sum. It should be easier to use. In your code, source1 and source2 are the same, which will cause some problems.

fakufaku commented 2 years ago

Closing this due to lack of activity.