Converting Matlab code to C without using Matlab coder.

6 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 MATLAB Coder 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by