Issue in HDL Coder
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I get the following errors (shown in snapshots at the end of the post) when trying to do fixed point conversion. I'm not sure where to go from here.
I did some testing and it appears that the code that was generated doesn't even work on it's own:
>> confirming_behav
Error using movmean
Invalid data type. First input must be numeric or logical.
Error in confirming_behav>WaveletFilteredSection4 (line 54)
mean = movmean(abs((w)), fi(15, 0, 4, 0, fm));
Error in confirming_behav (line 12)
w2 = WaveletFilteredSection4(coeffs,sig);
>> confirming_behav
I think the issue is in the fixed point function but I don't know a lot about that function. I will be reading up on the documentation to see what could be done but I'd like to know how to fix this in the base HDL coder settings.



0 Kommentare
Antworten (2)
Kiran Kintali
am 28 Mär. 2023
Can you share the design, testbench and project files?
Feel free to reach out to MathWorks tech support or DM me with the reproduction steps.
Kiran Kintali
am 28 Mär. 2023
Bearbeitet: Kiran Kintali
am 28 Mär. 2023
t = 1:10;
x = [4 8 6 -1 -2 -3 -1 3 4 5];
yc = movmean(x,5);
plot(t,x,t,yc);
The movemean function does not support fixed-point inputs and hence the error input should be .
>> movmean(fi(x), 5)
Error using movmean
Invalid data type. First input must be numeric or logical.
I would consider writing a local function that replaces movemean with equivalent MATLAB code before float to fixed conversion.
In addition you have too much IO coming into the design:
Both inputs to the design 'coeffs' and 'sig' and output 'w' are "double(8192 x 1)" and eventually when converted to fixed point wordlength of 'N'; You would need 3xNx8192 pins which would violate the IO threshold on the hardware.
You might want to consider a streaming version of this algorithm if you are targeting HDL code generation.
0 Kommentare
Siehe auch
Kategorien
Mehr zu HDL Code Generation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!