- Update the concatenation in HDL Algorithm/Angle2SteeringVec/Calculate Delay/getElemPos so that both constants are zeros(1,5) instead of zeros(1,10).
- In HDL Algorithm/MAC, there is an assumption that there are 10 receive channels. You will need to update this model with your 5 element assumption. So it looks like you would change the number of outputs from the Demux blocks from 10 to 5, and remove some of the delay line blocks accordingly.
- Etc.
How to modify FPGA-Based Beamforming in Simulink: Algorithm Design
1 次查看(过去 30 天)
显示 更早的评论
Hello, I would like to change the number of antenna elements from 10 to 5 in this example: https://www.mathworks.com/help/dsphdl/ug/design-an-hdl-beamforming-algorithm-in-simulink.html
I run the simulation and I get an error that inside HDL_Algorithm/Angle2SteeringVector/CalulateDelay/GetElementPos/y_spacing is a 1x10 constant that had data already populated inside it. I don't know where this data came from. Am I able to change this to 1x5 so I can try this example with 5 instead of 10 antenna elements? Also there any documentation of how the phase shift beamforming simulink block was implemented into the HDL_Algorithm with HDL_coder compatible simulink blocks?
0 个评论
采纳的回答
George
2024-2-22
Hello,
As far as changing the example to work with 5 elements, it looks like the data for the example gets initialized in a couple of the Model Callbacks. These callbacks are Matlab code that gets called in different parts of the Simulink model lifecycle. You can find more information on Model Callbacks here:
Specifically, if you open the Model Properties and navigate to the Callbacks tab, it looks like the setup happens in PreLoadFcn and InitFcn. You will need to update this for 5 antennas instead of 10. You will probably also need to make other modifications depending on the operating frequency of your system, array geometry, PRF, etc.
For example, the existing PreLoadFcn is:
prop_speed = physconst('LightSpeed'); % Propagation speed
fc = 100e6; % Operating frequency
lambda = prop_speed/fc; % Wavelength
paramBeamformer.propSpeed = prop_speed;
paramBeamformer.fc = fc;
% Antenna
paramBeamformer.Antenna = phased.ULA('NumElements',10,'ElementSpacing',0.5*lambda);
% Pulse
paramBeamformer.fs = 1000; %1khz
paramBeamformer.prf = 1/.3;
EleSpacing = (paramBeamformer.propSpeed/paramBeamformer.fc)/2;
SpeedofProp = paramBeamformer.propSpeed;
SamplingFreq = paramBeamformer.fc;
y_spacing = ([1:10] - 5.5).*EleSpacing;
addDelay1=4;
addDelay2=3;
addDelay3=3;
addDelay4=3;
addDelay5=3;
Something like the following changes will be required for you, there may be more changes required, this will require your investigation:
prop_speed = physconst('LightSpeed'); % Propagation speed
fc = 100e6; % Operating frequency
lambda = prop_speed/fc; % Wavelength
paramBeamformer.propSpeed = prop_speed;
paramBeamformer.fc = fc;
% Antenna
paramBeamformer.numElements = 5;
paramBeamformer.eleSpacing = 0.5*lambda;
paramBeamformer.Antenna = phased.ULA('NumElements',paramBeamformer.numElements,'ElementSpacing',paramBeamformer.eleSpacing);
% Pulse
paramBeamformer.fs = 1000; %1khz
paramBeamformer.prf = 1/.3;
EleSpacing = paramBeamformer.eleSpacing;
SpeedofProp = paramBeamformer.propSpeed;
SamplingFreq = paramBeamformer.fc;
y_spacing = ([1:paramBeamformer.numElements] - (paramBeamformer.numElements+1)/2).*paramBeamformer.eleSpacing;
addDelay1=4;
addDelay2=3;
addDelay3=3;
addDelay4=3;
addDelay5=3;
Similarly, you might need to update the InitFcn:
EleSpacing = (paramBeamformer.propSpeed/paramBeamformer.fc)/2;
SpeedofProp = paramBeamformer.propSpeed;
SamplingFreq = paramBeamformer.fc;
y_spacing = ([1:10] - 5.5).*EleSpacing;
to
EleSpacing = paramBeamformer.eleSpacing;
SpeedofProp = paramBeamformer.propSpeed;
SamplingFreq = paramBeamformer.fc;
y_spacing = ([1:paramBeamformer.numElements] - (paramBeamformer.numElements+1)/2).*paramBeamformer.eleSpacing;
So those changes are pretty straightforward. However, to update the Simulink model blocks is going to be more difficult, this gets to the second part of your question. Essentially, it looks like the beamforming algorithm is just reimplemented using Simulink blocks that support HDL Code generation, so different delays are inserted into each channel to shift the phase of the sample accordingly. You will need to at least make the following updates to the model, maybe more:
You will basically need to keep updating the model like in steps 1 and 2 until all of the 10 element assumptions are gone. This might be somewhat tricky, but hopefully this gets you started, feel free to post again if you run into any issues.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Code Generation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!