How to use log functions on HDL Coder?

6 visualizaciones (últimos 30 días)
Shruthi Sampathkumar
Shruthi Sampathkumar el 18 de Mayo de 2016
Respondida: Tim McBrayer el 18 de Mayo de 2016
Hello all, Can anyone help me as to what alternative code can I use instead of log10 to calculate Gain of a signal in decibels? Here's my code sample...
var_s_cfb=sum(ip.^2)/(length(ip)) - (length(ip))*mean(ip)^2/(length(ip));
var_en_3_cfb=sum(en_3.^2)/(length(en_3)) - (length(en_3))*mean(en_3)^2/(length(en_3));
GPcfblms=(var_s_cfb)/(var_en_3_cfb);
GPcfblms_dB=20*log10(GPcfblms);
Error: ??? Function 'log10' is not defined for values of class 'embedded.fi'.
Thank you,
Shruthi Sampathkumar.

Respuestas (1)

Tim McBrayer
Tim McBrayer el 18 de Mayo de 2016
HDL Coder supports auto-generating function replacement code that uses a lookup table specifically tuned to your use case. There is a HDL Coder featured example that demonstrates this capability. More information can be found in the HDL Coder documentation.

Categorías

Más información sobre Code Generation en Help Center y File Exchange.

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by