How to use beamformer in matlab 2016a using step()
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Luuk Muris
le 11 Juin 2018
Réponse apportée : Honglei Chen
le 11 Juin 2018
Hi,
For an assignment I have to construct an ultrasound image from rawdata to an actual image showing a word. To construct this image I need to use beamforming, but I have the 2016a version which requires you to use the step() function. When I use this I get an error message: 'Error using phased.PhaseShiftBeamformer/step Not enough input arguments; expected 2 (in addition to the object handle), got 1.'
Does anybody know how to use beamforming and step()? My code is shown below.
Thanks in advance!
if true
load('Lab2_BMD_course_Data.mat')
RFData=double(RFData);
Pitch = 0.3; % pitch
c0 = 1500; % speed of sound
fs = 25e6; % sample frquency
fc=6.25e6;
dt=1/fc; % time between each sample
limits=[min(RFData(:)) max(RFData(:))];
depth = [0:c0*dt/2:(size(RFData,1)-1)*c0*dt/2];
D=RFData(:,64);
Dabs=abs(D);
for i=1:128
[env1 env2]=envelope(RFData(:,i));
totenv(:,i)=env1;
end
% Definition Elementposition
ElementPos =0:Pitch:127*Pitch;
ElementPos = ElementPos-mean(ElementPos);
% Preallocation of image
x=-20:0.1:20;
z=0:0.1:50;
N=128; % number elements
Image =zeros(length(z),length(x));
df=2e6;
lambda=c0/fc;
array=phased.ULA('NumElements',128,'ElementSpacing',Pitch);
array.Element.FrequencyRange=[fc-df fc+df];
beamformer=phased.PhaseShiftBeamformer;
beamformer.SensorArray=array;
beamformer.DirectionSource='Input port';
beamformer.WeightsOutputPort=true;
beamformer.WeightsNormalization='Preserve power';
beamformer.PropagationSpeed=c0;
beamformer.OperatingFrequency=fs;
% Y=step(beamformer,totenv);
test=totenv(:,64);
figure(4)
[y w]=step(beamformer,totenv);
end
0 commentaires
Réponse acceptée
Honglei Chen
le 11 Juin 2018
You need to pass in an extra input representing the desired beamforming direction because you set the DirectionSource to 'Input port'.
HTH
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Beamforming dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!