unable to convert 'rsgenpoly' even though support is provided for c/c++ conversion

1 回表示 (過去 30 日間)
Puneet Khurana
Puneet Khurana 2018 年 1 月 23 日
回答済み: Mike McLernon 2018 年 2 月 22 日
The function 'rsgenpoly' has the support for extended c/c++ library generation, but when converting it provides the error that
Code generation cannot handle Galois field output. Please set the parameter 'outputFormat' of rsgenpoly function to 'double'.
function [ g ] = gen_poly(n,k) %#codegen
g=rsgenpoly(n,k);
end
But MATLAB doesn't allow changes in the inbuilt function.
Please suggest!
  4 件のコメント
Walter Roberson
Walter Roberson 2018 年 1 月 23 日
I guessed at the syntax; the help file gives the example
g4 = rsgenpoly(7,3,[],[],'double') % Output the generator polynomial as a GF array
For code generation, all inputs must be constant. MATLAB will generate the values at the time of compile, so the code that is embedded will simply be a vector of doubles, which is what deconv expects.
Puneet Khurana
Puneet Khurana 2018 年 1 月 24 日
yes the above mentioned code works and produce the gen poly. But when used, produces different ans.
i.e.
[q,r]=deconv(msg,g4);
where both msg and g4 are vector of doubles produces different 'q' and 'r' as opposed to when both 'msg' and 'g4' are gf arrays.
This makes it difficult to perform rsenc, rsgenpoly, deconv etc. in code generation and thus using in c/c++

サインインしてコメントする。

回答 (1 件)

Mike McLernon
Mike McLernon 2018 年 2 月 22 日
If you would like to generate C/C++ code with RS encode/decode functionality, you can try the RS System objects. The comm.RSEncoder ref page is here, and the comm.RSDecoder ref page is here.

カテゴリ

Help Center および File ExchangeGenerating Code についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by