Time Delay Beamforming with microphone arrays

조회 수: 1 (최근 30일)
Ali Movahed
Ali Movahed 2017년 1월 24일
댓글: Ali Movahed 2017년 2월 1일
Hello there,
I am using the time delay algorithm to do time Domain beamforming on my recieved signals. The direction source in the code must be set to 'Property' but when I do so, I get an error regarding this. I attach my code, the signal and the error here. Thanks.
h = phased.ConformalArray();
t= 1/2*(1+sqrt(14));
n=32;
c= ones(n,1)';
c(:)=1:32;
h.ElementPosition = [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;(sqrt(c).*cos(2*pi*t*c))*0.02655;(sqrt(c).*sin(2*pi*t*c))*0.02655];
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;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]);
% sampling rate
fs= 999e3;
t=0:1/20e6:3e-4;
c = 343;
fc = 500000; % Operating frequency
hc = phased.WidebandCollector('Sensor',h,...
'PropagationSpeed',c,'SampleRate',fs,...
'ModulatedInput',true,'CarrierFrequency',fc);
A=1:32;
B=1:32;
A(A>0)=-1.5708;
B(B>0)=1.5508;
ang=[A;B];
x=step(hc,recon,ang);
% Beamforming
hbf = phased.TimeDelayBeamformer('SensorArray',h,...
'DirectionSource',Property,'Direction',ang,...
'PropagationSpeed',c,...
'SampleRate',fs,'SubbandsOutputPort',true,...
'WeightsOutputPort',true);
[y,w] = step(hbf,x);
figure;
% Plot signals
plot(t(1:6001),real(x(1:6001,2)),'r:',t(1:6001),real(y(1:6001)));
xlabel('Time'); ylabel('Amplitude');
legend('Original','Beamformed');
title('MVDR Beamformer');
% Plot response pattern for five bands
% figure;
% plotResponse(h,subbandfreq(1:5).',c,'Weights',w(:,1:5));
% legend('location','SouthEast')
  댓글 수: 4
Ali Movahed
Ali Movahed 2017년 1월 25일
  • h = phased.ConformalArray();
  • t= 1/2*(1+sqrt(14));
  • n=32;
  • c= ones(n,1)';
  • c(:)=1:32;
  • h.ElementPosition = [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;(sqrt(c).*cos(2*pi*t*c))*0.02655;(sqrt(c).*sin(2*pi*t*c))*0.02655];
  • 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;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]);
  • % sampling rate fs= 999e3;
  • t=0:1/20e6:3e-4;
  • c = 343;
  • fc = 500000; % Operating frequency
  • hc = phased.WidebandCollector('Sensor',h,... 'PropagationSpeed',c,'SampleRate',fs,... 'ModulatedInput',true,'CarrierFrequency',fc);
  • A=1:32;
  • B=1:32;
  • A(A>0)=-1.5708;
  • B(B>0)=1.5508;
  • ang=[A;B];
  • x=step(hc,recon,ang);
  • % Beamforming
  • hbf = phased.TimeDelayBeamformer('SensorArray',h,... 'DirectionSource',Property,'Direction',ang,... 'PropagationSpeed',c,... 'SampleRate',fs,'SubbandsOutputPort',true,... 'WeightsOutputPort',true);
  • [y,w] = step(hbf,x);
  • figure;
  • % Plot signals
  • plot(t(1:6001),real(x(1:6001,2)),'r:',t(1:6001),real(y(1:6001)));
  • xlabel('Time');
  • ylabel('Amplitude');
  • legend('Original','Beamformed');
  • title('MVDR Beamformer');
Ali Movahed
Ali Movahed 2017년 1월 25일
Hello Mario,
is the code vivid now?

댓글을 달려면 로그인하십시오.

답변 (1개)

Honglei Chen
Honglei Chen 2017년 1월 26일
You need to put quote around it because it supposed to be a string, like this
hbf = phased.TimeDelayBeamformer('SensorArray',h,...
'DirectionSource','Property','Direction',ang,...
'PropagationSpeed',c,...
'SampleRate',fs,'SubbandsOutputPort',true,...
'WeightsOutputPort',true);
BTW I responded your comments in the other thread. Sorry for the delay.
HTH
  댓글 수: 7
Honglei Chen
Honglei Chen 2017년 1월 30일
It works fine for me in 2013a too. What are the other beamformers you use? Below is my script, could you give it a try?
h = phased.ConformalArray();
t= 1/2*(1+sqrt(14));
n=32;
c= ones(n,1)';
c(:)=1:32;
h.ElementPosition = [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;(sqrt(c).*cos(2*pi*t*c))*0.02655;(sqrt(c).*sin(2*pi*t*c))*0.02655];
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;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]);
% sampling rate
fs= 999e3;
t=0:1/20e6:3e-4;
c = 343;
fc = 500000; % Operating frequency
hc = phased.WidebandCollector('Sensor',h,...
'PropagationSpeed',c,'SampleRate',fs,...
'ModulatedInput',true,'CarrierFrequency',fc);
A=1:32;
B=1:32;
A(A>0)=-1.5708;
B(B>0)=1.5508;
ang=[A;B];
recon = randn(6001,32)+1i*randn(6001,32);
x=step(hc,recon,ang);
% Beamforming
hbf = phased.TimeDelayBeamformer('SensorArray',h,...
'DirectionSource','Property','Direction',[0;0],...
'PropagationSpeed',c,...
'SampleRate',fs,...
'WeightsOutputPort',true);
[y,w] = step(hbf,x);
Ali Movahed
Ali Movahed 2017년 2월 1일
Thank you so much. It is working now. the Problem was regarding the Direction which I set to 'ang'. It has to be exactly the variables : [0;0].

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by