Acoustic Beamforming Using a Rectangular Microphone Array
조회 수: 9 (최근 30일)
이전 댓글 표시
Using the Mathworks example:
I am reproducing this code using a rectangular 4x4 array rather than the linear array. I am in the header: Simulate the Received Signals
i am only using one audio signal x1 how do i use the step function?
i tried
temp=step(hCollector, x1,ang_dft+sqrt(noisePwr)*rand(rs,NSamPerFrame,[4
4]));
The error I received is:
Warning: Input arguments must be scalar.
Error using +
Matrix dimensions must agree.
Error in file (line 47)
temp=step(hCollector, x1,ang_dft+sqrt(noisePwr)*rand(rs,NSamPerFrame,[4
4]));
how do i correctly execute this?
here is my code:
H = phased.OmnidirectionalMicrophoneElement('BackBaffled',true)
fc=[200 300 400]
ang = [0;0];
resp=step(H,fc,ang);
plotResponse(H,200,'RespCut','Az','Format','Polar')
ha = phased.URA([4 4],[0.00635 0.00635],'Element',H)
figure;
plotResponse(ha,200,340,'RespCut','3D','Format','Polar')
%---------------------
ang_dft = [-10,10]
fs= 8000
hCollector = phased.WidebandCollector('Sensor',ha,'PropagationSpeed',340,'SampleRate',fs,'ModulatedInput',false);
t_duration = 3;
t=0:1/fs:t_duration/fs;
rs= RandStream.create('mt19937ar','Seed',2008)
noisePwr = 1e-4
%preallocate
NSamPerFrame =1000
NTSample = t_duration*fs
sigArray = zeros(NTSample,[4 4])
voice_dft= zeros(NTSample,1)
%set audio player
isAudioSupported = audiodevinfo(0)
if isAudioSupported
hap = dsp.AudioPlayer('SampleRate',fs)
end
%simulate
for m=1:NSamPerFrame:NTSample
sig_idx=m:m+NSamPerFrame-1
x1=wavread('dft_voice_8kHz',[sig_idx(1) sig_idx(end)])
temp=step(hCollector, x1,ang_dft+sqrt(noisePwr)*rand(rs,NSamPerFrame,[4 4]));
if isAudioSupported
step(hap,temp(:,3));
end
sigArray(sig_idx,:)=temp;
voice_dft(sig_idx)=x1;
end
plot(t,sigArrary(:,3));
댓글 수: 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.
채택된 답변
Honglei Chen
2013년 3월 7일
The error is because you are adding noise to the angle. I believe it's a typo. That line should just reads like this
temp=step(hCollector, x1,ang_dft)+sqrt(noisePwr)*rand(rs,NSamPerFrame,16);
Also, in the earlier part of the script, where you instantiate sigArray, it should be
sigArray = zeros(NTSample,16);
HTH
댓글 수: 3
Honglei Chen
2013년 3월 11일
Hi OSheen,
The first step of a Frost beamformer is time delay steering so there is no need to add a time delay beamformer in front of Frost beamformer.
As to the error you saw, it is because in your configuration, the steering angle for the time delay beamformer is specified in the property of 'Direction'. Therefore, the syntax for performing time delay beamforming is
y = step(hbf,x)
If you really want to add a Frost beamformer afterwards, what you need to do is passing the y into the Fromst beamformer, e.g.
y2 = step(hbf2,y,ang_dft)
HTH
추가 답변 (1개)
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
참고 항목
카테고리
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!