Beamforming with 4x4 Microphone Array

7 次查看(过去 30 天)
Hello,
I have assembled a 4x4 Microphone Array to collect heart sounds. This device collects 16 analog signals through an MCC DAQ. I would like to perform some sort of beamforming on these signals to steer the microphone towards the desired sounds.
What is the most efficient way to perform beamforming on my signals using the "Frost Beamformer" from the Phased Array Toolbox?
To simulate I am using sample heart sounds from a website and adding random noise. Assume
heart = [A A A A A A A A A A A A A A A A];
are the 16 signals collected from my hardware.
--------------------------------------------------------
Here is my code so far:
hmic=phased.OmnidirectionalMicrophoneElement;
ha=phased.URA([4 4],[0.0635 0.0635],'Element',hmic);
c=340;
rs = RandStream.create('mt19937ar','Seed',2008);
noisePwr = 1e-4; % noise power
fs=22257;
NSampPerFrame = 1000;
NTSample = 23000;
voice_dft = zeros(NTSample,1);
%DATA
A = data(1:23000,:);
heart = [A A A A A A A A A A A A A A A A];
for m = 1:NSampPerFrame:NTSample
sig_idx = m:m+NSampPerFrame-1;
x = A([sig_idx(1) sig_idx(end)]);
y = x + sqrt(noisePwr)*rand(rs,NSampPerFrame,16);
sigArray(sig_idx,:) = y;
voice_dft(sig_idx) = x1;
end
angSteer = [0;0];
%BEAMFORM
hsig=dsp.SignalReader('Signal',y,'SamplesPerFrame',NSampPerFrame);
bf=phased.FrostBeamformer('SensorArray',ha,'SampleRate',fs,...
'PropagationSpeed',c,'FilterLength',100,'DirectionSource','Input port');
frostout=zeros(NTSample,16);
for m=1:NSampPerFrame:NTSample
frostout(m:m+NSampPerFrame-1,:)=step(bf,step(hsig),angSteer);
end
%soundsc(frostout,fs,16)
wavwrite(frostout,'Frostbeamformed real data');
plot(t,frostout);
xlabel('Time (sec)'); ylabel ('Amplitude (V)');
title('Frost Beamformer Output');
Another note: I receive an error when I try to run the above code which I am also unsure about:
Error using +
Matrix dimensions must agree.
Error in frost (line 21)
y = x + sqrt(noisePwr)*rand(rs,NSampPerFrame,16);

回答(2 个)

Honglei Chen
Honglei Chen 2013-3-18
Not sure what the dimension is for your variable heart and A, but
x = A([sig_idx(1) sig_idx(end)]);
seems to suggest that x is just a length-2 vector. That's why it is does not match the noise which has 16 columns.

Zeynep Ertekin
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.

Community Treasure Hunt

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

Start Hunting!

Translated by