Acoustic Beamforming using Microphone Array : PS3 EYE Camera recording

3 views (last 30 days)
Hello everybody,
For my final proyect I am working on applying beamforming to a ps3 eye camera recording. The audiofile has 4-channels and contains three voices.
I'm using "Acoustic Beamforming Using a Microphone Array" as support, and part of the code you see here is based on that example. There the signal is simulated, but I want to use my own recorded signal.
I can't seem to figure out how to set sigArray correctly in order to get the results I want. I believe the error is somewhere around there since the rest of the code I'm using is the same from the example.
This code is not showing me any errors but it's not working as planned. I noticed that the greater NSampPerFrame is the better speech quality I get, which is why I'm using such a big number. Also, the sampling rate of my recording is 96000. I would share the audiofile I'm using with you, but .wav attachemets are not supported here. If you have any insight about how to improve my code or you see any errors, I'd really appreciate it.
Thank you in advance!
clear all; clc;
% Load audio file (4-channel PS3 eye camera recording)
filename = 'excerpt.wav';
infoX = audioinfo(filename);
NSampPerFrame = 131072;
x = dsp.AudioFileReader('Filename', filename,'SamplesPerFrame', NSampPerFrame);
Fs = x.SampleRate;
t_duration = infoX.Duration;
NTSample = t_duration*Fs;
% DEFINE UNIFORM LINEAR ARRAY
microphone = phased.OmnidirectionalMicrophoneElement('FrequencyRange',[20 20e3]);
Nele = infoX.NumChannels; % number of microphones
micArray = phased.ULA('Element',microphone,'NumElements',Nele,'ElementSpacing',0.02);
c = 340; % sound speed, in m/s
% ------ERROR PROBABLY HERE----
sigArray = zeros(NTSample,Nele);
for m = 1:NSampPerFrame:NTSample
sig_idx = m:m+NSampPerFrame-1;
sigArray(sig_idx,:) = step(x);
end
ANG = [-20;0];
signalsource = dsp.SignalSource('Signal',sigArray,'SamplesPerFrame',NSampPerFrame);
% ------ERROR PROBABLY HERE----
frostbeamformer = phased.FrostBeamformer('SensorArray',micArray,'SampleRate',Fs,...
'PropagationSpeed',c,'FilterLength',20,'DirectionSource','Input port');
FrostOut = zeros(NTSample,1);
for m = 1:NSampPerFrame:NTSample
FrostOut(m:m+NSampPerFrame-1,:) = frostbeamformer(signalsource(), ANG);
end
sound(FrostOut, Fs)clear all; clc;

Answers (0)

Categories

Find more on Beamforming and Direction of Arrival Estimation in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!