MATLAB Coder error with resample function
Mostra commenti meno recenti
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 Commenti
Walter Roberson
il 8 Giu 2018
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
il 8 Giu 2018
Walter Roberson
il 8 Giu 2018
Sorry, I seem to be getting backlogged. I do not think I am going to be able to investigate this one myself.
Denis Gurchenkov
il 25 Lug 2018
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.
Risposte (0)
Categorie
Scopri di più su MATLAB Coder in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

