Conditions for Code Replacement of MATLAB Functions with QHL
R2026bEach MATLAB® function that can be used with the Embedded Coder® Support Package for Qualcomm® Hexagon® Processors requires specific conditions to allow code replacement by using the Qualcomm Hexagon library (QHL). You use this code replacement library to generate C/C++ code from a Simulink® model or from MATLAB code.
When you satisfy the specified conditions, the generated C/C++ code uses QHL support to achieve optimized execution on Qualcomm Hexagon processors.
Basic Math Operations
QHL supports these MATLAB math functions for floating-point data type only when you configure the required properties, as specified in this table.
| Function | Input Requirements | Property Requirements | Equivalent Functions |
|---|---|---|---|
abs |
| Input length must be > 11 |
|
sqrt |
| - |
|
rsqrt (Fixed-Point Designer) |
| - |
|
log |
| - |
|
log2 |
| - |
|
log10 |
| - |
|
exp |
| - |
|
power |
| - |
|
ceil |
| - |
|
floor |
| - |
|
norm |
| - |
|
min |
| Input length must be > 22 |
|
max |
| Input length must be > 22 |
|
QHL supports these MATLAB math functions for fixed-point Q15 data type only when you configure the required properties, as specified in this table.
| Function | Input Requirements | Input DataType | Property Requirements | Equivalent Functions |
|---|---|---|---|---|
abs |
|
| Input length must be > 8 |
|
sqrt |
|
| - |
|
max |
|
| Input length must be > 22 |
|
min |
|
| Input length must be > 22 |
|
Trigonometric Operations
| Function | Input Requirements | Property Requirements | Equivalent Functions |
|---|---|---|---|
sin |
| - |
|
cos |
| - |
|
tan |
| - |
|
asin |
| - |
|
acos |
| - |
|
atan |
| - |
|
sinh |
| - |
|
cosh |
| - |
|
tanh |
| - |
|
hypot |
| - |
|
Fourier Transform Operations
| Function | Input Requirements | Output Requirements | Input Alignment | Output Alignment | Property Requirements | Equivalent Functions |
|---|---|---|---|---|---|---|
fft |
|
| 8 | 8 |
Note To enable code replacement, use the syntax
If you specify additional inputs such as | mw_qhdsp_acf_r1dfft_af_opt_builtin |
fft |
|
| size*8 | 8 | mw_qhdsp_c1dfft_acf_builtin | |
ifft |
|
| size*8 | 8 |
Note To enable code replacement, use the syntax
If you specify additional inputs such as | mw_qhdsp_c1difft_acf_builtin |