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!

