error at symbol ofdm "Index exceeds matrix dimensions."

Asked by natasha about 11 hours ago
Latest activity Commented on by dpb about 4 hours ago

i got this error at symbol ofdm "Index exceeds matrix dimensions." from list program for make a pilot and guard ofdm symbol. the list program like this:

% making odfm symbol and taking IFFT
% function  symbol_ofdm = createsymbol (pilots,data)
%now first generate the pilot
A=complex(-1,0);
B=complex(1,0);
pilots = [A B A B B B A A];  %%% here we direct making the pilot,detail procedure given below
% n_symbol = 1;  % At the time of generating the pilots, I need to know what symbol i am simulating
% because the seed to do it depends on it.
% The values of the pilots are to be modulated are defined in the standard as such(pp 443) :
% Before beginning, it is necessary to consider that the value to calculate depends on 2 factors :
% the number of symbols and whether we are in the uplink or dwnlink. We will consider that we are in
% the downlink and we are transmitting the symbol "1".
% If we want to consider the other uplink connection, the seed would be "10101010101".
% seed = [1 1 1 1 1 1 1 1 1 1 1];
% for i=1:n_symbol+2 
% wk(i) = seed (11); 
% next = xor(seed(9),seed(11));
% seed = [next seed(1,1:10)];
% end
% Once the value of wk is found(that depends on the number of symbol with wihich it is working),
% the values of the subcarriers must be found and of the mapping of them with BPSK constellation.
% wk = wk(n_symbol+2)
% A = 1 - 2*wk                           % Values defined in the standard.
% B = 1 - 2*(~wk)
% value_carrier = [A B A B B B A A]
% For uplink, the values should be [A B A B A A A A]
% pilot_mapping = 2*mapping(value_carrier,1,Tx);      
% The factor of "2" is due to the fact that the pilots are transmitted to a
% double power of the information bits.
% NOW The guard bands are prepared.
guard1 = complex (0,0) * ones (1,28);
DC = complex (0,0);
guard2 = complex (0,0) * ones (1,27);
% The pilot and guard subcarriers are placed according to the standard.
fx = [guard1 data(1:12) pilots(1) data(13:36) pilots(2)... 
    data(37:60) pilots(3) data(61:84) pilots(4) data(85:96) DC... 
    data(97:108) pilots(5) data(109:132) pilots(6) data(133:156)... 
    pilots(7) data(157:180) pilots(8) data(181:192) guard2];
% here the ofdm symbol is completed
%Now taking IFFT
symbol_ofdm = ifft(fx,Nfft);
%Now adding cyclic prefix
%we generate the cyclic prefix so that the multipaths do not affect our data so much.
margin = length(symbol_ofdm)*G;
data_tx = [symbol_ofdm((end-margin+1):end) symbol_ofdm];
data_transmitter=data_tx; 

and then i got that problem. so how do i solve this error?

please help me.. i don't know what i do for solve that error. i finish browse at google and mathwork's help but i can't solve that problem.

can somebody help me and give advise for me? thank you before..

thank you.

5 Comments

dpb about 5 hours ago

You didn't answer the question...what's G and what is, therefore, margin value?

You also didn't actually show the error from the command window exactly w/ cut 'n paste...

Use the debugger...

doc debug

What you need to do is to figure out what the value of the indexing expressions are and compare them to the size() of the array. One of them (and one presumes it is (end-margin+1)) is >size() the array. That would tend to indicate margin is probably zero so the expression is end+1 which is would be greater than the length in that dimension.

Walter Roberson about 5 hours ago

What is size(pilots) and size(data) ?

dpb about 4 hours ago

Walt, assuming she showed us everything,

pilots is a complex vector length=8 --it's defined up top altho it's surely easy to miss in all the obfuscation of unneeded stuff...

You're right, she doesn't show a definition for data--I presumed it is 192 owing to the fact the error apparently doesn't show up until address the symbol_ofdm array.

Too bad she hasn't responded w/ any useful information only the repeated question. :(

natasha

Products

No products are associated with this question.

0 Answers

Contact us