Converting Matlab code to C without using Matlab coder.

6 ビュー (過去 30 日間)
ratnesh pandey
ratnesh pandey 2020 年 7 月 21 日
コメント済み: Walter Roberson 2020 年 7 月 24 日
Hi,
I want to use matlab code to C code. I do not want to use matlab coder since the code generated by it is very unreadable to me. I am converting the logic line by line into C. However I am stuck at 'VariableFractionalDely' (VFD) function of matlab. I have trimmed the main code to the problem I am facing. Attached is the code I wish to implement in C.
vfd = dsp.VariableFractionalDelay('InterpolationMethod','FIR','FilterHalfLength',2,'InterpolationPointsPerSample',10000,'Bandwidth',1,'MaximumDelay',1000);
% inputs
rx = zeros(13630,128);
BF = zeros(109,128);
tic
% wieghted sum and delay beamforming
for i = 1:1:109
for j = 1:1:128
out(:,j) = vfd(abs(rx(:,j)),(BF(i,j)));
end
out_add = sum(out(:,128),2);
end
toc

回答 (1 件)

Dinesh Yadav
Dinesh Yadav 2020 年 7 月 24 日
Hi Ratnesh,
You will have to use MATLAB coder inorder to get the C code for your use. As dsp.VariableFractionalDelay is a function whos internal implementation you will not have access to. Either you will have to search online on how it can be implemented but that implementation may or may not give same result. Therefore I will recommend you using the MATLAB coder.

カテゴリ

Help Center および File ExchangeMATLAB Coder についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by