single precision simulation of internal calculations
2 次查看(过去 30 天)
显示 更早的评论
I would like to experiment with beamforming. The hardware which may host the algorithm is only able to support single precision calculations. Is there a way to set Matlab to perform all calculations (even internal) to single precision? I am writing this iteration of the beamformer to avoid the use of toolboxes and their functions. Since this attempt is a first order estimate, I am limting the calculations to elementary mathemtical functions (exponentials, sines etc.).
7 个评论
Honglei Chen
2019-6-3
There is nothing for you to specifically set. It depends on the input you pass in. In general, we use the data type of the data input to determine what precision of the interal calculation. For example, if your data input of the PhaseShiftBeamformer is single, then the computation will be carried out in single.
HTH
采纳的回答
James Tursa
2019-5-28
编辑:James Tursa
2019-5-28
" Is there a way to set Matlab to perform all calculations (even internal) to single precision? "
Not the way you are probably wanting. E.g., the literal constant 2 will always be interpreted as a double precision value ... there is no setting that I am aware of that will change that. This forces you to explicitly use single(2) in your code to force a single precision value. Also, there may be library code that MATLAB relies on that uses double (or higher) precision in the background (e.g., double precision accumulators used for single precision inputs, etc.). Strict sIngle precision emulation really isn't something MATLAB is set up to do well.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Beamforming 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!