How to indicate input size to dsp.BlockLMSFilter when using MATLAB Coder?
古いコメントを表示
I would like to use dsp.BlockLMSFilter in code that will be converted to C code via MATLAB Coder. I understand that Length and BlockSize of dsp.BlockLMSFilter must be entered as literals in the constructor for the object. I have tried to feed the object signals whose lengths are equal to an integer multiple of BlockSize, but I get a warning about variable input size when I run codegen, even if I have "released" the object beforehand. I have the same problem if I feed the signal to the object in successive BlockSize-length blocks.
Is there some way to assure a dsp.BlockLMSFilter object (in code that will be converted to C and compiled) that the size of the incoming signal is acceptable?
Suppose that x and d (in the simplified example below) are guaranteed to have lengths that are multiples of the BlockSize. How do I let the code generator know this? Is there an assert that might help?
function wts = example(x,d,mu) %#codegen
obj = dsp.BlockLMSFilter('Length',10,'BlockSize',10,'StepSizeSource','Input port');
[y,errs,wts] = obj(x,d,mu);
end
2 件のコメント
David Fink
2021 年 7 月 15 日
What specific warning or error are you seeing, and what commands are you using to generate code?
Note - if using the MATLAB Coder App, you can convert this to a code generation script via:
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Generating Code についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!