Converting Matlab code to C without using Matlab coder.

조회 수: 4 (최근 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 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