Converting Matlab code to C without using Matlab coder.

9 vues (au cours des 30 derniers jours)
ratnesh pandey
ratnesh pandey le 21 Juil 2020
Commenté : Walter Roberson le 24 Juil 2020
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

Réponses (1)

Dinesh Yadav
Dinesh Yadav le 24 Juil 2020
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.

Catégories

En savoir plus sur MATLAB Coder dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by