필터 지우기
필터 지우기

Using GCCPhat with Matlab Coder Issues - 'xref' not fully defined

조회 수: 1 (최근 30일)
Dave Moffat
Dave Moffat 2018년 7월 2일
답변: Honglei Chen 2018년 7월 18일
Hello,
I am attempting to use the gccphat method with the matlab coder (well actually part of the audioPlugin framework, but that shouldn't make any difference) When the gccphat attempts to run, I get an error that
Line 82 Variable 'xref' is not fully defined on some execution paths.
The documentation for gccphat suggests it is suitable for use with code generation, though does not support variable-size inputs. I don't think I am applying variable size inputs, but would like some clarification as to this point - Does it mean that the number of inputs cannot change? or the length of inputs can't change? Or neither can change. Though, every time the method is called, the full method is run, so what changes would not be acceptable.

채택된 답변

Honglei Chen
Honglei Chen 2018년 7월 18일
Sorry for the late reply. This is a bug. I think the easiest way to fix this is to supply the sampling frequency as the third input, i.e., using the syntax
gccphpat(in(:,1),in(:,2),fs)
If you don't have the sampling frequency, you can just set fs to 1, like
gccphat(in(:,1),in(:,2),1)
since that's the default value used in the function.
HTH and thanks for reporting this.

추가 답변 (2개)

Honglei Chen
Honglei Chen 2018년 7월 2일
Could you share your script? In terms of limitation, neither number of inputs nor sizes of inputs can change but your issue doesn't seem to be related to that. Thanks.
  댓글 수: 1
Dave Moffat
Dave Moffat 2018년 7월 11일
Hello,
Thank you for the speedy response.
Here is my MWE
classdef testPlugin < audioPlugin
methods
function out = process(p, in)
[tdoa,corrVal,lag] = gccphat(in(:,1),in(:,2));
out = in;
end
end
end
this gives the error when running
validateAudioPlugin testPlugin
with the following error report
checking plug-in class 'testPlugin'... passed.
Generating testbench file 'testbench_testPlugin.m'... done.
Running testbench... passed.
Generating mex file 'testbench_testPlugin_mex.mexmaci64'... ??? Variable 'xref' is not fully defined on some execution paths.
Error in ==> gccphat Line: 82 Column: 28
Code generation failed: View Error Report
Error using coder.internal.generateAudioPlugin
Many thanks

댓글을 달려면 로그인하십시오.


Dave Moffat
Dave Moffat 2018년 7월 3일
Hello,
Thank you for the speedy response.
Here is my MWE
classdef testPlugin < audioPlugin
methods
function out = process(p, in)
[tdoa,corrVal,lag] = gccphat(in(:,1),in(:,2));
out = in;
end
end
end
this gives the error when running
validateAudioPlugin testPlugin
with the following error report
checking plug-in class 'testPlugin'... passed.
Generating testbench file 'testbench_testPlugin.m'... done.
Running testbench... passed.
Generating mex file 'testbench_testPlugin_mex.mexmaci64'... ??? Variable 'xref' is not fully defined on some execution paths.
Error in ==> gccphat Line: 82 Column: 28
Code generation failed: View Error Report
Error using coder.internal.generateAudioPlugin
Many thanks

카테고리

Help CenterFile Exchange에서 Audio Plugin Creation and Hosting에 대해 자세히 알아보기

제품


릴리스

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by