ValidateAudioPlugin Error "Input series must be a numeric vector" in plugin

4 次查看(过去 30 天)
I am working on a plugin that takes in two channels. For some reason the validation is failing and I don't understand why. With other two-channel plugins I found online it works alright. What does it mean that "input series must be a numeric vector"? How do I fix it?
Here is the code:
classdef myVocoder < audioPlugin
properties (Access = private)
p = 12; % LPC Filter Order
end
properties (Constant)
PluginInterface = audioPluginInterface( ...
'PluginName','Vocoder', ...
'InputChannels',[2 2], ...
'OutputChannels',2);
end
methods
function out = process(plugin, in1, in2)
% LPC
r2 = autocorr(in1, plugin.p); % LPCs coefficients for last two frames
coeffs = levinson(r2, plugin.p); % Solve with Levinson Durbin
vocoder_curr = (filter(1, coeffs, in2)); % Filter glottal pulses with LPC Filter
vocoder_play = vocoder_curr;
% AGC: if voice in is louder, voice out should be louder too
gain = std(in1)/std(vocoder_curr);
out = gain*vocoder_play;
end
end
end

回答(1 个)

jibrahim
jibrahim 2023-5-11
Hi Pedro,
This error is thrown from the first line of your process method. To reproduce:
v = myVocoder
process(plugin,randn(2,2),randn(2,2))
Essentially this line is failing:
r2 = autocorr(randn(2,2), 12)
In general, in order to debug issues caught by validateAudioPlugin, you can do the following:
validateAudioPlugin -keeptestbench myVocoder
This will keep the MATLAB testbench code for you. Then, you can run the testbwench file, and put a debug point where it fails:
testbench_myVocoder

类别

Help CenterFile Exchange 中查找有关 Audio Plugin Creation and Hosting 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by