Errors occurs while converting the code created using 5G Toolbox's SIB1 Recovery Example to C code using Matlab Coder.
2 次查看(过去 30 天)
显示 更早的评论
I am trying to convert the code created using the SIB1 Recovery Example of 5G toolbox into C code through Matlab coder.
However, many errors occurred and were corrected, but the two errors below have not yet been corrected.
First,
rxGrid = nrOFDMDemodulate(rxWaveform_1, nrb, scsCommon, nSlot,'SampleRate',Fs,'CarrierFrequency',fPhaseComp);
Error Message : In code generation, when you specify the 'SampleRate' name-value argument in the nrOFDMDemodulate(WAVEFORM,NRB,SCS,INITIALNSLOT,NAME,VALUE) syntax, the 'SampleRate' and 'Nfft' name-value arguments and the NRB and SCS arguments must be compile-time constants.
If the above syntax is changed as follows, incorrect operation will occur.
rxGrid = nrOFDMDemodulate(rxWaveform_1, nrb, scsCommon, nSlot);
Second,
[sib1bits,sib1CRC] = decodeDLSCH(cw,pdsch.Modulation,pdsch.NumLayers,dci.RedundancyVersion);
Error Message : When generating code, the NLAYERS input must be a constant value.
Can you resolve errors that occur in Matlab Coder?
0 个评论
采纳的回答
Angelo Yeo
2024-4-25
1) This must be a question on compile-time constant of MATLAB Coder. For basic understanding, see coder.Constant Class.
2) For nrOFDMDemodulate, see the "Extended Capabilities" for your information. This function requires some name-value arguments to be compile-time constant for code generation. (It's a MUST!) And this requires you to use -args value of codegen function. Below is a screenshot from the nrOFDMDemodulate doc.
3) For nrDLSCHDecoder, same story applies. See its "Extended Capabilities" section and read usage notes for "nlayers" input. This should be used with -args when using codegen.
0 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!