0

I received this error message when I try the conversion via HDL coder. Can someone help me? Thank you!

function [p_max,t_max]=ricmax(g,fs)


    valmin=0.40*max(g);                
    [p_max,t_max]=findpeaks(g,'minpeakheight',valmin);
    t_max=t_max/fs;


    end

error:

??? Expected Y to be one of these types: double, single.
Instead its type was embedded.fi.

Input signal:

fs=1000;
g=sin(1:10)*rand(10);
petril
  • 1
  • 1
  • findpeaks function does not support fixed-point types. – Navan May 19 '17 at 14:38
  • How do I convert this code with HDL encoder? – petril May 19 '17 at 17:26
  • I guess that function is not supported for HDL generation since floating point is not synthesizable. – Navan May 19 '17 at 18:49
  • Not everything can simply be converted to HDL. converting matlab to hdl is like the process of drawing a tree: you can at best make a projection of the tree on the paper, but you can never capture its full essence ;) – JHBonarius May 22 '17 at 08:48

0 Answers0