why ofdmmod function error: The total number of subcarriers, including data, nulls and pilots specified, must match NFFT when my carrier number is8192
2 次查看(过去 30 天)
显示 更早的评论
moduType = '16qam';
numCarr =8192;
M = 16;
numBits = numCarr * log2(M);
numGBCarr = numCarr/16;
gbleft = (1:numGBCarr);
gbright = ((numCarr-numGBCarr+1):numCarr);
%%%%%%%%%%%%create null
dcIdx = (numCarr/2)+1;%偶数个子载波得dc索引
nullIdx = [gbleft dcIdx gbright]';%子载波索引列
%%%%%%%%%%%%create sign
nullLen = length(nullIdx);
srcBits = randi([0,1],(numBits-nullLen)*log2(M),1);
%%%%%%%%%%%%qammod
sigOut = qammod(sign,M,"InputType","bit","UnitAveragePower",true);
%%%%%%%%%%%%cplength
CPlen = 32;
%%%%%%%%%%%%进行ofdm调制
ofdmOut = ofdmmod(sigOut,numCarr,CPlen,nullIdx);
error used ofdmmod>checkNulls (line 188)
The total number of subcarriers, including data, nulls and pilots specified, must match NFFT.
mistake ofdmmod>setup (line 147)
checkNulls(prmStr,numST);
mistake ofdmmod (line 66)
[prmStr,dataIdx] = setup(x,nfft,cplen,varargin{:});
mistake main (line 29)
ofdmOut = ofdmmod(sigOut,numCarr,CPlen,nullIdx);
0 个评论
回答(1 个)
Muskan
2023-5-16
Hi,
I tried running your code, and as per my understanding of the question, it gives an error while using the "qammod" function. You can refer to the following documentation of "qammod" function for a correct implementation.
Thanks
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Modulation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!