Maximum variable size allowed by the program is exceeded. FOR OCDM MODULATION
6 ビュー (過去 30 日間)
古いコメントを表示
i need a help plzzzz !
i would have the OCDM modulation BER SNR figure for 64 QAM
so had a problem at this point, matlab give me this problem : Maximum variable size allowed by the program is exceeded.
here is the code :
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1723101/image.jpeg)
%% Simulation Parameters
% OCDM Modulation
num_OCDMGrdIntv = 16; %c'est = num_OCDMSymbol/16
num_OCDMSymbol = 256; % number of symbol
num_OCDMChirp = 256; %number of subcarriers
num_OCDMBlock = 2^6;
OCDMParam = struct;
OCDMParam.Num_GrdIntv = num_OCDMGrdIntv;
OCDMParam.Num_Symbol = num_OCDMSymbol;
OCDMParam.Num_Chirp = num_OCDMChirp;
OCDMParam.Num_Block = num_OCDMBlock;
% Symbol Mapping
num_ModemOrder = 64; % Oder da modulaQAM
%symbolConstMapping = qammod( ( 0 : 2^num_ModemOrder - 1 ).', 2^num_ModemOrder, 'InputType', 'integer', 'UnitAveragePower', true );
if num_ModemOrder==4
symbolConstMapping=qamdemod(( 0 : 2^num_ModemOrder - 1 )/sqrt(1/2),num_OCDMSymbol);
end
if num_ModemOrder==16
symbolConstMapping=qamdemod(( 0 : 2^num_ModemOrder - 1 )/sqrt(1/10),num_OCDMSymbol);
end
if num_ModemOrder==64
symbolConstMapping=qamdemod(( 0 : 2^num_ModemOrder - 1 )/sqrt(1/46),num_OCDMSymbol);
end
% OCDM Channel Equalization
OCDMChEst_Param = struct;
OCDMChEst_Param.EQUMode = 1;
OCDMChEst_Param.SNR = 100;
OCDMChEst_Param.CFR = 1;
% Signal Frame
num_InfoBit = num_ModemOrder * num_OCDMSymbol * num_OCDMBlock;
num_ModSignal = ( num_OCDMChirp + num_OCDMGrdIntv ) * num_OCDMBlock;
% Multipath Fading Channel
mode_Multipath = 'LTE-EVA';
switch mode_Multipath
case 'AWGN'
case 'EquiPath'
Ch_MultiPath_PDP = [ 1, 1, 1, 1, 1, 1 ].'; % Power delay profile
Ch_MultiPath_DP = [ 0, 6, 8, 11, 17, 25 ].'; % Delay profile
case 'LTE-EVA'
Ch_EVA_DelayProfile = [
0 0.0
30 -1.5
150 -1.4
310 -3.6
370 -0.6
710 -9.1
1090 -7.0
1730 -12.0
2510 -16.9
];
Ch_MultiPath_PDP = 10.^( Ch_EVA_DelayProfile( : , 2 ) ./ 10 );
Ch_MultiPath_DP = round( Ch_EVA_DelayProfile( : , 1 ) ./ 1e9 .* 100e6 );
otherwise
end
0 件のコメント
採用された回答
Steven Lord
2024 年 6 月 26 日
Since:
num_ModemOrder = 64; % Oder da modulaQAM
This line of code (which I've commented out since it's not going to work and I want later lines of code in this answer to run):
% symbolConstMapping=qamdemod(( 0 : 2^num_ModemOrder - 1 )/sqrt(1/46),num_OCDMSymbol);
would try to create a vector with 2^num_ModemOrder elements.
format longg
numberOfElements = 2^num_ModemOrder
The maximum possible array size in MATLAB is given by the second output of the computer function.
[~, maximumPossibleSize] = computer
Is numberOfElements greater than that maximum possible size?
toolarge = numberOfElements > maximumPossibleSize
Yes. How much larger?
toolargefactor = numberOfElements ./ maximumPossibleSize
It's over 65k times too large.
But let's say that MATLAB (really, it's your operating system's limit on how much memory it can address at once) didn't have that limitation. How much memory would be required to store that vector? Since that vector is real, each element takes up 8 bytes.
bytes = 8*numberOfElements;
petabytes = bytes/(1e15)
exabytes = petabytes/1000
Your machine doesn't have the 147+ exabytes that would be required to store that vector. [To show you just how large that is one exabyte, according to Wikipedia, is roughly the global monthly Internet traffic in 2004.]
You're going to need to rethink your approach to solve whatever problem you're trying to solve.
3 件のコメント
Steven Lord
2024 年 6 月 26 日
From that same Wikipedia page I linked above, 1 petabyte is approximately two thousand years of MP3-encoded music. If you used all the memory your vector would occupy to store MP3-encoded music instead, it would hold:
format longg
num_ModemOrder = 64; % Oder da modulaQAM
numberOfElements = 2^num_ModemOrder;
bytes = 8*numberOfElements;
petabytes = bytes/(1e15);
yearsOfMusic = 2000*petabytes
pretty close to 300 million years of music.
Your computer does not have enough memory to even try to create such a gigantic array. It's not even close.
The only solution is to find a different approach to solve your problem, one that does not require storing an array of that size. Yes, computers can be powerful. But they're not magic. They have limitations and this is one of them.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Propagation and Channel Models についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!