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??

1 Ansicht (letzte 30 Tage)
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 Kommentare
Walter Roberson
Walter Roberson am 11 Mai 2017
Muhammad Awais Waheed comments to KSSV
thank you very much for your help. really appreciate it sir.
Walter Roberson
Walter Roberson am 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);

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Richard Fisher
Richard Fisher am 26 Apr. 2017
There is another end missing from you code. Assuming it should be added at the end, try changing:
SS = reshape(T(:,:,j),8,4);
to
SS(8*(i-1)+1:8*i,:) = STBC(:,:,i);
This gives a final SS matrix which is 256 x 4, although you'll have to verify if this the behaviour you want.
Also, I'm not sure what the purpose of the inner loop is - it seems like you're calculating the same thing 32 times.

Weitere Antworten (0)

Kategorien

Mehr zu Link-Level Simulation finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by