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);
4
  • findpeaks function does not support fixed-point types. Commented May 19, 2017 at 14:38
  • How do I convert this code with HDL encoder? Commented May 19, 2017 at 17:26
  • I guess that function is not supported for HDL generation since floating point is not synthesizable. Commented May 19, 2017 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 ;) Commented May 22, 2017 at 8:48

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.