MATLAB Coder error with resample function
显示 更早的评论
MATLAB Coder function call failed when using non-unity ratios of p and q. The documentation says that when using the resample function, the p and q variables have to be positive, integer values and are used to form a ratio for the time resampling process. However, any time that we use a ratio of p/q that is not equal to 1, the MATLAB coder fails to call the functions and gives us an error. The first code and image showcase what we are talking about which successfully gets converted while the second does not. Is there something that we overlooked or were not aware of in the conversion process or function call?
More code and info available if needed.

function y = pitch_func0(a)
p = 1;
q = 1;
r = p/q;
n = 1024;
x = pvoc(a, r, n);
y = resample(x,p,q);
end

function y = pitch_func2(a)
p = 19;
q = 20;
r = p/q;
n = 1024;
x = pvoc(a, r, n);
y = resample(x,p,q);
end
4 个评论
Walter Roberson
2018-6-8
pvoc appears to be https://www.mathworks.com/matlabcentral/fileexchange/45441-phase-vocoder?focused=3880845&tab=function
I notice that you are not pre-allocating x or y and you are not using coder.varsize(). I would expect size problems in such a case.
Justin Bugayong
2018-6-8
Walter Roberson
2018-6-8
Sorry, I seem to be getting backlogged. I do not think I am going to be able to investigate this one myself.
Denis Gurchenkov
2018-7-25
Justin, are you all set with this? If you still have an issue, please attach your .m files and the .prj file and someone from MATLAB Coder team will take a look.
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 MATLAB Coder 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

