How to indicate input size to dsp.BlockLMSFilter when using MATLAB Coder?
Afficher commentaires plus anciens
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 commentaires
David Fink
le 15 Juil 2021
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:
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Generating Code dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!