Beamforming with 4x4 Microphone Array
4 views (last 30 days)
Show older comments
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);
0 Comments
Answers (2)
Honglei Chen
on 18 Mar 2013
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.
0 Comments
Zeynep Ertekin
on 22 Jan 2017
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 Comments
See Also
Categories
Find more on Array and Matrix Mathematics in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!