this program is producing a STBC matrix of 8*4 32 times. how can i put them in a single matrix of 256*4 dimension??
Afficher commentaires plus anciens
clc;
clear;
close;
% QAM Modulator
sizeOfSignalConstellation = 16; % Size of signal constellation
numberOfBitsPerSymbol = log2(sizeOfSignalConstellation); % Number of bits per symbol
noOfBitsToProcess = 512; % Number of bits to process
A=noOfBitsToProcess/sizeOfSignalConstellation;
B=4;
numSamplesPerSymbol = 1; % Oversampling factor
rng default % Use default random number generator
vectorOfBinaryData = randi([0 1],noOfBitsToProcess,1); % Generate vector of binary data
binaryTuples = reshape(vectorOfBinaryData,length(vectorOfBinaryData)/4,4); % Reshape data into binary 4-tuples
dataSymbolsIn = bi2de(binaryTuples); % Convert to integersdataMod = qammod(dataSymbolsIn,M,0); % Binary coding, phase offset = 0
xx = qammod(dataSymbolsIn,sizeOfSignalConstellation,0,'gray'); % Gray coding, phase offset = 0
QamMatrix= vec2mat(xx,4);
Eb_No = 2*(sizeOfSignalConstellation-1)/3; %energy of the sysmbols
% Alamouti SPace Time Block Coder for four transmit Antennas
% Transmitters
SS=zeros(256,4);
for i= 1:A
for j=1:32
ss = QamMatrix(i,:);
STBC(:,:,i) = [ss(1) ss(2) ss(3) ss(4); ...
-1*ss(2) ss(1) -1*ss(4) ss(3); ...STBC
-1*ss(3) ss(4) ss(1) -1*ss(2); ...
-1*ss(4) -1*ss(3) ss(2) ss(1); ...
conj(ss(1)) conj(ss(2)) conj(ss(3)) conj(ss(4)); ...
-1*conj(ss(2)) conj(ss(1)) -1*conj(ss(4)) conj(ss(3));...
-1*conj(ss(3)) conj(ss(4)) conj(ss(1)) -1*conj(ss(2)); ...
-1*conj(ss(4)) -1*conj(ss(3)) conj(ss(2)) conj(ss(1))];
T(:,:,j)=STBC(:,:,i);
SS = reshape(T(:,:,j),8,4);
end
7 commentaires
KSSV
le 26 Avr 2017
You can use reshape(STBC,256,4), but the order is important. Whats the necessity to reshape?
Muhammad Awais Waheed
le 26 Avr 2017
KSSV
le 26 Avr 2017
A = rand(8,4,32 ) ;
B = reshape(A,8*32,4) ;
Jan
le 26 Avr 2017
@Muhammad Awais Waheed: "It does not work" is not useful to solve the problem. Please post a complete copy of the error message.
Muhammad Awais Waheed
le 26 Avr 2017
Walter Roberson
le 11 Mai 2017
Muhammad Awais Waheed comments to KSSV
thank you very much for your help. really appreciate it sir.
Walter Roberson
le 11 Mai 2017
Muhammad Awais Waheed comments to Jan Simon
when i used the above mentioned command by @KSSV than this is the error.
Error using reshape To RESHAPE the number of elements must not change.
Error in Untitled3 (line 51) X=reshape(STBC,8*32,4);
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Communications Toolbox dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!