Acoustic Beamforming in microphone arrays
조회 수: 14 (최근 30일)
이전 댓글 표시
Hello everyone, I want to localize sources with microphone Arrays and beamforming algorithms. To do this, Setting weighting factors are important for me. here is my code:
% Define my microphone array
h = phased.ConformalArray();
t= 1/2*(1+sqrt(5));
n=16;
c= ones(n,1)';
c(:)=1:16;
h.ElementPosition = [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;(sqrt(c).*cos(2*pi*t*c))*0.0375;(sqrt(c).*sin(2*pi*t*c))*0.0375];
h.ElementNormal = [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;0 0 0 0 0 ...
0 0 0 0 0 0 0 0 0 0 0];
h.Element = ...
phased.OmnidirectionalMicrophoneElement('BackBaffled',true,'FrequencyRange',[48e3 580e3]);
% Define my Signal
t = 0:0.001:0.3; % Time, sampling frequency is 1kHz
s = zeros(size(t));
s = s(:); % Signal in column vector
s(201:205) = s(201:205) + 1; % Define the pulse
carrierFreq = 10e4;
wavelength = physconst('LightSpeed')/carrierFreq;
inputAngle = [45; 0];
x = collectPlaneWave(h,s,inputAngle,carrierFreq);
% Define the MVDR beamformer
mvdrbeamformer = phased.MVDRBeamformer('SensorArray',h,...
'Direction',inputAngle,'OperatingFrequency',carrierFreq,...
'WeightsOutputPort',true);
% Pattern
plotResponse(h,10e4,physconst('LightSpeed'),'Format','line',...
'RespCut','az','Unit','db','NormalizeResponse',false);
I want to set These weights : [yCbf,w] = step(mvdrbeamformer,x); but I am not sure how to put them in plotResponse function. Could anyone help me with this?
댓글 수: 1
Nick Yiw
2019년 3월 18일
Hi, I am a student currently working on a project that involves distance speech recognition for controlling output. I really want to know what are the best recommendations of microphone arrays/chips that I can use which are compatible with MATLAB. Thank you.
답변 (3개)
Honglei Chen
2017년 1월 19일
To get the weights, you can do
[y,w] = step(mvdrbeamformer,x);
Then to plot the pattern, you can pass w as 'Weights' into plotResponse
plotResponse(h,10e4,physconst('LightSpeed'),'Format','line',...
'RespCut','az','Unit','db','NormalizeResponse',false,'Weights',w);
HTH
댓글 수: 2
Honglei Chen
2017년 1월 26일
I took a deeper look. The signal are actually not all zeros, but has some info in it. However, the pulse is rather short, that's why you see a lot of zeros. But that's not why the script fails provide more meaningful information. The two most critical issue I think are
1. The propagation speed is set to speed of light. Since you say it's a microphone array, I assume it should be speed of sound in air? So I modified the following two lines
pspeed = 343;
x = collectPlaneWave(h,s,inputAngle,carrierFreq,pspeed);
mvdrbeamformer = phased.MVDRBeamformer('SensorArray',h,...
'Direction',inputAngle,'OperatingFrequency',carrierFreq,...
'WeightsOutputPort',true,'PropagationSpeed',pspeed)
2. The collectPlaneWave does not add any noise yet if there is no noise, MVDR cannot work properly. that's why you see the singular matrix warning. You can add noise by doing
x = collectPlaneWave(h,s,inputAngle,carrierFreq,pspeed);
x = x+0.01/sqrt(2)*(randn(size(x))+1i*randn(size(x)));
It may not be the right amount of noise you want but that's the idea.
This would make the script work. But the result isn't great because at 100 kHz, the wavelength is about 3 mm. However the spacing between elements are much larger, this can cause grating lobe issues.
In addition, if possible, it would be better to feed the MVDR algorithm a noise only signal to estimate a better covariance. The way to do it is to turn on the training signal input, as shown below.
xt = 0.01/sqrt(2)*(randn(size(x))+1i*randn(size(x)));
% Define the MVDR beamformer
mvdrbeamformer = phased.MVDRBeamformer('SensorArray',h,...
'Direction',inputAngle,'OperatingFrequency',carrierFreq,...
'WeightsOutputPort',true,'PropagationSpeed',pspeed,...
'TrainingInputPort',true);
[y,w] = step(mvdrbeamformer,x,xt);
I do see better result when I turn on the training signal.
HTH
Zeynep Ertekin
2017년 1월 22일
Hi,
I need a 2d or 3d sound source localization code with command load; can anyone please help me. Any help will be highly apprecited.
댓글 수: 0
Juan Diego Archila Quintero
2022년 5월 22일
hello I need a code in matlab to locate sound source
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Antennas, Microphones, and Sonar Transducers에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!