Converting Matlab code to C without using Matlab coder.

4 visualizaciones (últimos 30 días)
ratnesh pandey
ratnesh pandey el 21 de Jul. de 2020
Comentada: Walter Roberson el 24 de Jul. de 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

Respuestas (1)

Dinesh Yadav
Dinesh Yadav el 24 de Jul. de 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.

Categorías

Más información sobre MATLAB Coder en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by