LAMPIRAN A
SOURCE CODE PROGRAM
MISO 2x1 – OFDM
function [BER]=misofunction(M,para,fftlen, noc,nd,ml,sr,gilen,snr,A,B);
NT =2 ; % Jumlah Antena Pengirim
NR=1 ; % jumlah antena Penerima
%************************** Pembangkitan Data *********************
DataKirim = randint(1,para*nd*ml) ; b = reshape(DataKirim,para*nd,ml); de = bi2de(b) ;
%************************** Modulasi ***********************
% Pemilihan jenis modulasi % Untuk modulasi QPSK if M==4
Q= modem.pskmod('M', 4); hmod1=modulate(Q,de) ; hmod=hmod1/sqrt(2) ; % Untuk modulasi 16QAM elseif M==16
Q= modem.qammod('M', 16); hmod1=modulate(Q,de) ; hmod=hmod1/sqrt(10) ;
% Untuk modulasi 64QAM elseif M==64 Q= modem.qammod('M', 64); hmod1=modulate(Q,de) ; hmod=hmod1/sqrt(42) ; end
Msym=length(hmod) ; % jumlah simbol
MsymLay = Msym/2 ; % jumlah layer
%************************** Layer Mapping ******************** for p= 1:(MsymLay) layer_x(p)= hmod(((2*p)-1),1); layer_y(p)= hmod(((2*p)),1); c = length(layer_x(1,:)); %************************** SFBC Precoding ******************** precode_y = zeros(2,2*c); X =1/sqrt(2)*[1,0,1i,0;0,-1,0,1i;0,1,0,1i;1,0,-1i ,0]*[real(layer_x(1,:));real(layer_y(1,:));... imag(layer_x(1,:));imag(layer_y(1,:))]; precode_y(1,1:2:2*c-1)=X(1,:); precode_y(2,1:2:2*c-1)=X(2,:); precode_y(1,2:2:2*c)=X(3,:); precode_y(2,2:2:2*c)=X(4,:);
end
precode1=precode_y(1,:); precode2=precode_y(2,:);
%************************** OFDM BLOK *************************** %*************Serial to parallel conversion****************
paradata1 =reshape(precode1,para,nd); paradata2 =reshape(precode2,para,nd); %************************** IFFT *********************** y1 =ifft(paradata1 ); ichA1=real(y1); qchA1=imag(y1); y2 =ifft(paradata2 ); ichB1=real(y2); qchB1=imag(y2);
%*******************Penyisipan Guard Interval ****************
[ichA2,qchA2]= giins(ichA1,qchA1,fftlen,gilen,nd); [ichB2,qchB2]= giins(ichB1,qchB1,fftlen,gilen,nd); fftlen2=fftlen+gilen;
transmit =[ichA2 + qchA2.*i ; ichB2+qchB2.*i] ;
%************************** KANAL TRANSMISI ***********************
N0 = 1/(10^(snr/10));
noise =sqrt(N0/2)*[randn(1,length(transmit))+
i.*randn(1,length(transmit))]; % white gaussian noise,
% ****** Matriks Korelasi MIMO 2x1 ******
Rtx=[1 A;conj(A) 1] ; Rrx=1;
type='complex' ;
[h] =korelasi(NT,NR,Rtx,Rrx,type) ;
heq =[conj(h(1,1)) h(1,2) ;conj(h(1,2)) -h(1,1) ]; heq =[conj(h(1,1)) h(1,2) ;conj(h(1,2)) -h(1,1) ];
%************************** Bagian Penerima *********************** sinyalRx=h*(transmit)+noise ; ichA3 =real(sinyalRx); qchA3=imag(sinyalRx); %************************** BLOK IOFDM *********************** %******************** Pemindahan Guard Interval *************
[ichA4,qchA4] = girem (ichA3,qchA3, fftlen2, gilen, nd);
%******************** FFT ********************************
rxA = ichA4+qchA4.*i; ryA = fft (rxA);
%*************Parallel to serial conversion ****************
%************************** SFBC COMBINER *********************** for j=1:2:Msym hasilRX(:,(j+1)/2)=[seridata(1,j);conj(seridata (1,(j+1)))] ; end S =heq*hasilRX; for r=1:1:MsymLay hasilakhir(:,r)=[S(1,r);-conj(S(2,r))]; end coeff=abs(h(1,1))^2 + abs(h(1,2))^2 ; hasilakhir=sqrt(2)*(hasilakhir/coeff); %*************Layer Demapping **************** for u=1:MsymLay decoder_x(u)= (hasilakhir((1),u )); decoder_y(u)= (hasilakhir((2),u )); end
gabungdecoding = [ decoder_x ;decoder_y ]; % menggabungkan sinyal layer hasildemapping = reshape(gabungdecoding,Msym,1) ; %************************** Demodulasi *********************** if M==4 Q= modem.pskdemod('M', 4); hasildemapping=hasildemapping*sqrt(2); HasilDemodulasi=demodulate(Q,hasildemapping) ; elseif M==16 hasildemapping=hasildemapping*sqrt(10); Q = modem.qamdemod('M', 16); HasilDemodulasi=demodulate(Q,hasildemapping); elseif M==64 hasildemapping=hasildemapping*sqrt(42); Q = modem.qamdemod('M', 64); HasilDemodulasi=demodulate(Q,hasildemapping) ; end
konversiDetoBiner = de2bi(HasilDemodulasi) ; % melakukan konversi dari decimal ke biner
sinyalTerima =reshape(konversiDetoBiner,1,Msym*ml);
% *****Perhitungan Kinerja Jaringan ***** nod = length(DataKirim) ;
subdata=DataKirim-sinyalTerima ; % lakukan operasi pengurangan antara data yang dikirim dan diterima
nilaiAbsolut=abs(subdata);
noe=sum(nilaiAbsolut); % hitung jumlah error yang terjadi BER= noe/nod; % hitung nilai BER
MIMO 2x2-OFDM
function [BER]=mimo2x2function(M,para,fftlen, noc,nd,ml,sr,gilen,snr,A,B);
NT =2 ; % Jumlah Antena Pengirim
NR=2; % jumlah antena Penerima %************************** Pembangkitan Data ******************** DataKirim = randint(1,para*nd*ml) ; b = reshape(DataKirim,para*nd,ml); de = bi2de(b) ; %************************** Modulasi ***********************
% Pemilihan jenis modulasi
% Untuk modulasi QPSK
if M==4
Q= modem.pskmod('M', 4); hmod1=modulate(Q,de) ; hmod=hmod1/sqrt(2) ; % Untuk modulasi 16QAM
elseif M==16
Q= modem.qammod('M', 16); hmod1=modulate(Q,de) ; hmod=hmod1/sqrt(10) ;
% Untuk modulasi 64QAM
elseif M==64
Q= modem.qammod('M', 64); hmod1=modulate(Q,de) ; hmod=hmod1/sqrt(42) ; end
Msym=length(hmod); % jumlah simbol MsymLay = Msym/2 ; % jmlah layer
%************************** Layer Mapping ******************** for p= 1:(MsymLay) layer_x(p)= hmod(((2*p)-1),1); layer_y(p)= hmod(((2*p)),1); c = length(layer_x(1,:)); %************************** SFBC Precoding *********************** precode_y = zeros(2,2*c); X =1/sqrt(2)*[1,0,1i,0;0,-1,0,1i;0,1,0,1i;1,0,-1i,0]*[real(layer_x(1,:));real(layer_y(1,:));... imag(layer_x(1,:));imag(layer_y(1,:))]; precode_y(1,1:2:2*c-1)=X(1,:); precode_y(2,1:2:2*c-1)=X(2,:); precode_y(1,2:2:2*c)=X(3,:); precode_y(2,2:2:2*c)=X(4,:); end precode1=precode_y(1,:);
precode2=precode_y(2,:);
%************************** OFDM BLOK************************* %*************Serial to parallel conversion****************
paradata1 =reshape(precode1,para,nd); %reshape: built in function paradata2 =reshape(precode2,para,nd); %************************** IFFT *********************** y1 =ifft(paradata1 ); ichA1=real(y1); qchA1=imag(y1); y2 =ifft(paradata2 ); ichB1=real(y2); qchB1=imag(y2);
%*******************Penyisipan Guard Interval ****************
[ichA2,qchA2]= giins(ichA1,qchA1,fftlen,gilen,nd); [ichB2,qchB2]= giins(ichB1,qchB1,fftlen,gilen,nd); fftlen2=fftlen+gilen;
transmit =[ichA2 + qchA2.*i ; ichB2+qchB2.*i] ;
%************************** KANAL TRANSMISI ***********************
N0 = 1/(10^(snr/10));
noise =sqrt(N0/2)*[randn(2,length(transmit))+
i.*randn(2,length(transmit))]; % white gaussian noise,
% Matriks Korelasi MIMO 2x2
Rtx=[1 A;conj(A) 1] ; Rrx=[1 B;conj(B) 1] ; type='complex' ;
[h] =korelasi(NT,NR,Rtx,Rrx,type) ;
heq =[conj(h(1,1)) h(1,2) conj(h(2,1)) h(2,2);conj(h(1,2)) -h(1,1) conj(h(2,2)) -h(2,1)]; %************************** Bagian Penerima *********************** sinyalRx=h*(transmit)+noise ; sinyalRx1= sinyalRx (1,:) ; ichA3 =real(sinyalRx1); qchA3=imag(sinyalRx1); sinyalRx2= sinyalRx (2,: ) ; ichB3 =real(sinyalRx2); qchB3=imag(sinyalRx2); %************************** BLOK IOFDM *********************** %******************** Pemindahan Guard Interval *************
[ichA4,qchA4] = girem (ichA3,qchA3, fftlen2, gilen, nd); [ichB4,qchB4] = girem (ichB3,qchB3, fftlen2, gilen, nd);
%******************** FFT ********************************
rxA = ichA4+qchA4.*i; ryA = fft (rxA); rxB = ichB4+qchB4.*i; ryB = fft (rxB);
%*************Parallel to serial conversion ****************
seridata1 =reshape(ryA,1,para*nd); seridata2 =reshape(ryB,1,para*nd); seridata = [ seridata1; seridata2 ] ;
%************************** SFBC COMBINER *********************** for j=1:2:Msym hasilRX(:,(j+1)/2)=[seridata(1,j);conj(seridata (1,(j+1)));seridata(2,j);conj(seridata(2,(j+1)))] ; end S =heq*hasilRX; for r=1:1:MsymLay hasilakhir(:,r)=[S(1,r);-conj(S(2,r))]; end
coeff=abs(h(1,1))^2 + abs(h(1,2))^2 + abs(h(2,1))^2 + abs(h(2,2))^2; hasilakhir=sqrt(2)*(hasilakhir/coeff); %************************** Layer Demapping *********************** for w=1:MsymLay decoder_x(w)= (hasilakhir((1),w )); decoder_y(w)= (hasilakhir((2),w )); end
gabungdecoding = [ decoder_x ;decoder_y ]; % menggabungkan sinyal layer hasildemapping = reshape(gabungdecoding,Msym,1) ; %************************** Demodulasi *********************** if M==4 % Untuk modulasi QPSK Q= modem.pskdemod('M', 4); hasildemapping=hasildemapping*sqrt(2); HasilDemodulasi=demodulate(Q,hasildemapping) ;
elseif M==16 % Untuk modulasi 16-QAM
hasildemapping=hasildemapping*sqrt(10); Q = modem.qamdemod('M', 16);
HasilDemodulasi=demodulate(Q,hasildemapping);
elseif M==64 % Untuk modulasi 64-QAM
hasildemapping=hasildemapping*sqrt(42); Q = modem.qamdemod('M', 64);
HasilDemodulasi=demodulate(Q,hasildemapping) ; end
konversiDetoBiner = de2bi(HasilDemodulasi) ; % melakukan konversi dari decimal ke biner
sinyalTerima =reshape(konversiDetoBiner,1,Msym*ml);
******************* Perhitungan Bit Error Rate (BER)************
nod = length(DataKirim) ;
subdata=DataKirim-sinyalTerima ; % lakukan operasi pengurangan antara data yang dikirim dan diterima
nilaiAbsolut=abs(subdata);
noe=sum(nilaiAbsolut); % hitung jumlah error yang terjadi BER= noe/nod; %hitung nilai BER
MIMO 2x4-OFDM
function [BER]=mimo2x4(M,para,fftlen, noc,nd,ml,sr,gilen,snr,A,B); NT =2 ; % Jumlah Antena Pengirim
NR=4; % jumlah antena Penerima
%************************** Pembangkitan Data ******************** DataKirim = randint(1,para*nd*ml) ; b = reshape(DataKirim,para*nd,ml); de = bi2de(b) ; %************************** Modulasi ***********************
% Pemilihan jenis modulasi
% Untuk modulasi QPSK
if M==4
Q= modem.pskmod('M', 4); hmod1=modulate(Q,de) ; hmod=hmod1/sqrt(2) ; % Untuk modulasi 16QAM
elseif M==16
Q= modem.qammod('M', 16); hmod1=modulate(Q,de) ; hmod=hmod1/sqrt(10) ;
% Untuk modulasi 64QAM elseif M==64
Q= modem.qammod('M', 64); hmod1=modulate(Q,de) ; hmod=hmod1/sqrt(42); end
Msym=length(hmod) ; % jumlah simbol
MsymLay = Msym/2 ; %************************** Layer Mapping ******************** for p= 1:(MsymLay) layer_x(p)= hmod(((2*p)-1),1); layer_y(p)= hmod(((2*p)),1); c = length(layer_x(1,:));
%************************** SFBC Precoding ******************* precode_y = zeros(2,2*c); X =1/sqrt(2)*[1,0,1i,0;0,-1,0,1i;0,1,0,1i;1,0,-1i,0]*[real(layer_x(1,:));real(layer_y(1,:));... imag(layer_x(1,:));imag(layer_y(1,:))]; precode_y(1,1:2:2*c-1)=X(1,:); precode_y(2,1:2:2*c-1)=X(2,:); precode_y(1,2:2:2*c)=X(3,:); precode_y(2,2:2:2*c)=X(4,:); end precode1=precode_y(1,:); precode2=precode_y(2,:); %************************** OFDM BLOK ***************************** %*************Serial to parallel conversion****************
paradata1 =reshape(precode1,para,nd); paradata2 =reshape(precode2,para,nd); %************************** IFFT *********************** y1 =ifft(paradata1 ); ichA1=real(y1); qchA1=imag(y1); y2 =ifft(paradata2 ); ichB1=real(y2); qchB1=imag(y2);
%*******************Penyisipan Guard Interval ****************
[ichA2,qchA2]= giins(ichA1,qchA1,fftlen,gilen,nd); [ichB2,qchB2]= giins(ichB1,qchB1,fftlen,gilen,nd); fftlen2=fftlen+gilen;
transmit =[ichA2 + qchA2.*i ; ichB2+qchB2.*i] ;
%************************** KANAL TRANSMISI ***********************
N0 = 1/(10^(snr/10));
noise =sqrt(N0/2)*[randn(4,length(transmit))+
i.*randn(4,length(transmit))]; % white gaussian noise,
% ******************** Matriks Korelasi MIMO 2x4 ***************
Rtx=[1 A;conj(A) 1] ;
Rrx=[1 power(B,1/9) power(B,4/9) B; conj(power(B,1/9)) 1 power(B,1/9) power(B,4/9);...
conj(power(B,4/9)) conj(power(B,1/9)) 1 power(B,1/9);conj(B) conj(power(B,4/9)) conj(power(B,1/9)) 1];
type='complex' ;
[h] =korelasi(NT,NR,Rtx,Rrx,type) ;
heq1 =[conj(h(1,1)) h(1,2) conj(h(2,1)) h(2,2) conj(h(3,1)) h(3,2) conj(h(4,1)) h(4,2)];
heq2 =[conj(h(1,2)) -h(1,1) conj(h(2,2)) -h(2,1) conj(h(3,2))-h(3,1) conj(h(4,2)) -h(4,1)];
heq=[heq1;heq2] ;
sinyalRx=h*(transmit)+noise ; sinyalRx1= sinyalRx (1,:) ; ichA3 =real(sinyalRx1); qchA3=imag(sinyalRx1); sinyalRx2= sinyalRx (2,: ) ; ichB3 =real(sinyalRx2); qchB3=imag(sinyalRx2); sinyalRx3= sinyalRx(3,:); ichC3 =real(sinyalRx3); qchC3=imag(sinyalRx3); sinyalRx4= sinyalRx (4,: ); ichD3 =real(sinyalRx4); qchD3=imag(sinyalRx4); %************************** BLOK IOFDM *********************** %******************** Pemindahan Guard Interval *************
[ichA4,qchA4] = girem (ichA3,qchA3, fftlen2, gilen, nd); [ichB4,qchB4] = girem (ichB3,qchB3, fftlen2, gilen, nd); [ichC4,qchC4] = girem (ichC3,qchC3, fftlen2, gilen, nd); [ichD4,qchD4] = girem (ichD3,qchD3, fftlen2, gilen, nd);
%******************** FFT ******************************** rxA = ichA4+qchA4.*i; ryA = fft (rxA); rxB = ichB4+qchB4.*i; ryB = fft (rxB); rxC = ichC4+qchC4.*i; ryC = fft (rxC); rxD = ichD4+qchD4.*i; ryD = fft (rxD);
%*************Parallel to serial conversion ****************
seridata1 =reshape(ryA,1,para*nd); seridata2 =reshape(ryB,1,para*nd); seridata3 =reshape(ryC,1,para*nd); seridata4 =reshape(ryD,1,para*nd);
seridata = [ seridata1; seridata2;seridata3; seridata4 ] ;
%*************SFBC Decoder dan Combiner ****************
for j=1:2:Msym hasilRX(:,(j+1)/2)=[seridata(1,j);conj(seridata (1,(j+1)));seridata(2,j);conj(seridata(2,(j+1)));seridata(3,j);conj( seridata (3,(j+1)));seridata(4,j);conj(seridata(4,(j+1)))] ; end S =heq *hasilRX ; for r=1:1:MsymLay hasilakhir(:,r)=[S(1,r);-conj(S(2,r))]; end
coeff=abs(h(1,1))^2 + abs(h(1,2))^2 + abs(h(2,1))^2 +
abs(h(2,2))^2+abs(h(3,1))^2 + abs(h(3,2))^2 + abs(h(4,1))^2 + abs(h(4,2))^2 ;
%*************Layer Demapping ****************
for u=1:MsymLay
decoder_x(u)= (hasilakhir((1),u )); decoder_y(u)= (hasilakhir((2),u )); end
gabungdecoding = [ decoder_x ;decoder_y ]; % menggabungkan sinyal layer hasildemapping = reshape(gabungdecoding,Msym,1) ; %************************** Demodulasi *********************** if M==4 % Untuk modulasi QPSK Q= modem.pskdemod('M', 4); hasildemapping=hasildemapping*sqrt(2); HasilDemodulasi=demodulate(Q,hasildemapping) ;
elseif M==16 % Untuk modulasi 16-QAM
hasildemapping=hasildemapping*sqrt(10); Q = modem.qamdemod('M', 16);
HasilDemodulasi=demodulate(Q,hasildemapping);
elseif M==64 % Untuk modulasi 64-QAM
hasildemapping=hasildemapping*sqrt(42); Q = modem.qamdemod('M', 64);
HasilDemodulasi=demodulate(Q,hasildemapping) ; end
konversiDetoBiner = de2bi(HasilDemodulasi) ; % melakukan konversi dari decimal ke biner
sinyalTerima =reshape(konversiDetoBiner,1,Msym*ml);
% Perhitungan Kinerja Jaringan
nod = length(DataKirim) ;
subdata=DataKirim-sinyalTerima ; % lakukan operasi pengurangan antara data yang dikirim dan diterima
nilaiAbsolut=abs(subdata);
noe=sum(nilaiAbsolut); % hitung jumlah error yang terjadi
BER = noe/nod; %hitung nilai BER
Fungsi Korelasi Koefisien Kanal MIMO
function h =korelasi(NT,NR,Rtx,Rrx,type);
% Korelasi koefisien kanal MIMO % Input :
% NT : Jumlah antena pemancar % NR : jumlah antena penerima % Rtx : matriks korelasi Pemancar % Rrx : matriks korelasi Penerima
% type : tipe Korelasi : ’complex’ or ’field’ % Outputs:
% h : Koefien Kanal MIMO berkorelasi
% Pembangkitan kanal tak berkorelasi berdistribusi rayleigh K =(raylrnd(5,NT*NR,1)+j*raylrnd(5,NT*NR,1)); if isvector(Rtx), Rtx =toeplitz(Rtx) ; end if isvector(Rrx), Rrx =toeplitz(Rrx) ; end if strcmp(type,'complex')
C =chol(kron(Rtx,Rrx)) ; % Korelasi Kompleks else
C =sqrtm(sqrt(kron(Rtx,Rrx))); % Korelas daya end
% Membentuk korelasi ke dalam matriks
h=zeros(NR,NT,1); tmp =C*K(:,1) ;
h(:,:,1) =reshape(tmp,NR,NT) ;
Fungsi Penyisipan Guard interval
function [iout, qout]=giins(idata,qdata,fftlen, gilen,nd);
%*********************Variabel******************************* %idata: Input bagian real Ich data
%qdata: Input bagian imaginer Qch data %iout: Output real Ich data
%qout: Output imaginer Qch data %fftlen2 : panjang FFT (points)
%gilen : panjang guard interval (points) %nd : jumlahh simbol OFDM
%***************************************************************
idata1 = reshape(idata,fftlen, nd); qdata1 = reshape(qdata,fftlen, nd);
idata2 = [idata1(fftlen-gilen+1:fftlen,:); idata1]; qdata2 = [qdata1(fftlen-gilen+1:fftlen,:); qdata1]; iout = reshape (idata2,1, (fftlen+gilen)*nd);
qout = reshape (qdata2,1, (fftlen+gilen)*nd);
Fungsi Pemisahan Guard Interval
function [iout,qout] = girem(idata,qdata, fftlen2,gilen, nd);
%*********************Variables******************************* %idata: Input bagian real Ich data
%qdata: Input bagian imaginer Qch data %iout: Output real Ich data
%qout: Output imaginer Qch data %fftlen2 : panjang FFT (points)
%gilen : panjang guard interval (points) %nd : jumlahh simbol OFDM
%************************************************************
idata2=reshape (idata,fftlen2,nd); qdata2=reshape (qdata, fftlen2, nd); iout = idata2 (gilen+1:fftlen2,:); qout = qdata2 (gilen+1:fftlen2,:);
close all;
%*********************** INISIALISASI PARAMETER *****************
M=[ 4 16 64 ] ; % QPSK M=4, 16-QAM M=16, dan 64-QAM M=64 for s=1:length(M)
% Korelasi kanal MIMO Pada LTE % Korelasi Medium A=0.3, B=0.9
A = 0.3; B= 0.9;
para=256; % Jumlah Kanal Paralel OFDM fftlen = 256; % Panjang FFT
noc=256; % jumlah carrier
nd=6; % Jumlah simbol OFDM per Loop
ml = log2(M(s)); % Level modulasi
snr=0:2:20; % Nilai SNR sr=250000; % Symbol rate
gilen =66; % Panjang Guard Interval nloop=15; % jumlah loop simulasi
for a = 1: 1: length(snr) for q =1:1:nloop
% Menghitung nilai BER sistem MISO 2x1-OFDM
[BER1(q)]=misofunction(M(s),para,fftlen, noc,nd,ml,sr,gilen,snr(a),A,B);
% Menghitung nilai BER sistem MISO 2x2-OFDM [BER2(q)]=mimo2x2function(M(s),para,fftlen, noc,nd,ml,sr,gilen,snr(a),A,B);
% Menghitung nilai BER sistem MISO 2x4-OFDM [BER3(q)]=mimo2x4(M(s),para,fftlen, noc,nd,ml,sr,gilen,snr(a),A,B); end nilaiBER1(a)=sum(BER1)/nloop ; nilaiBER2(a)=sum(BER2)/nloop ; nilaiBER3(a)=sum(BER3)/nloop ; end nilaiBERmiso(s,:)=nilaiBER1; nilaiBERmimo2x2(s,:)= nilaiBER2; nilaiBERmimo2x4(s,:)=nilaiBER3; end nilaiBERmiso nilaiBERmimo2x2 nilaiBERmimo2x4 close all
% Menampilkan Grafik SNR VS BER
figure
semilogy(snr,nilaiBERmiso(1,:),'-or','LineWidth',2); hold on
hold on semilogy(snr,nilaiBERmiso(3,:),'kd-','LineWidth',2); axis([0 28 10^-5 1]) grid on legend('QPSK','16-QAM','64-QAM'); xlabel('SNR, dB');
ylabel('Bit Error Rate');
title('Perbandingan BER MISO 2x1- OFDM '); figure semilogy(snr,nilaiBERmimo2x2(1,:),'-or','LineWidth',2); hold on semilogy(snr,nilaiBERmimo2x2(2,:),'bp-','LineWidth',2); hold on semilogy(snr,nilaiBERmimo2x2(3,:),'kd-','LineWidth',2); axis([0 28 10^-5 1]) grid on legend('QPSK','16-QAM','64-QAM'); xlabel('SNR, dB');
ylabel('Bit Error Rate');
title('Perbandingan BER MIMO 2x2- OFDM '); figure semilogy(snr,nilaiBERmimo2x4(1,:),'-or','LineWidth',2); hold on semilogy(snr,nilaiBERmimo2x4(2,:),'bp-','LineWidth',2); hold on semilogy(snr,nilaiBERmimo2x4(3,:),'kd-','LineWidth',2); axis([0 28 10^-5 1]) grid on legend('QPSK','16-QAM','64-QAM'); xlabel('SNR, dB');
ylabel('Bit Error Rate');
title('Perbandingan BER MIMO 2x4- OFDM ');
% Perbandingan MIMO-OFDM pada masing-masing modulasi
figure semilogy(snr,nilaiBERmiso(1,:),'-or','LineWidth',2); hold on semilogy(snr,nilaiBERmimo2x2(1,:),'bp-','LineWidth',2); hold on semilogy(snr,nilaiBERmimo2x4(1,:),'kd-','LineWidth',2); axis([0 20 10^-5 1]) grid on
legend('MISO 2x1-OFDM','MIMO 2x2-OFDM','MIMO 2x4-OFDM'); xlabel('SNR, dB');
ylabel(' Bit Error Rate ( BER ) ');
title('Perbandingan Bit Error Rate MIMO-OFDM dengan QPSK '); figure semilogy(snr,nilaiBERmiso(2,:),'-or','LineWidth',2); hold on semilogy(snr,nilaiBERmimo2x2(2,:),'bp-','LineWidth',2); hold on semilogy(snr,nilaiBERmimo2x4(2,:),'kd-','LineWidth',2); axis([0 20 10^-5 1]) grid on
legend('MISO 2x1-OFDM','MIMO 2x2-OFDM','MIMO 2x4-OFDM'); xlabel('SNR, dB');
title('Perbandingan Bit Error Rate MIMO-OFDM dengan 16-QAM '); figure semilogy(snr,nilaiBERmiso(3,:),'-or','LineWidth',2); hold on semilogy(snr,nilaiBERmimo2x2(3,:),'bp-','LineWidth',2); hold on semilogy(snr,nilaiBERmimo2x4(3,:),'kd-','LineWidth',2); axis([0 24 10^-5 1]) grid on
legend('MISO 2x1-OFDM','MIMO 2x2-OFDM','MIMO 2x4-OFDM'); xlabel('SNR, dB');
ylabel(' Bit Error Rate ( BER ) ');
title('Perbandingan Bit Error Rate MIMO-OFDM dengan 64-QAM ');
Program utama Perbandingan MIMO-OFDM Dengan Modulasi adaptif
close all;
%************************** INISIALISASI PARAMETER ***********************
% Jenis Korelasi Pada LTE % Korelasi Medium A=0.3, B=0.9
A = 0.3; B= 0.9;
para=256; % Jumlah Kanal Paralel OFDM
fftlen = 256; % Panjang FFT
noc=256; % Number of carrier
nd=6; % Jumlah simbol OFDM per Loop
snr=0:1:25; % Nilai SNR
gilen =66; % Panjang Guard Interval
nloop=10; % Jumlah loop simulasi
% Menentukan batas treshold SNR untuk pemilihan jenis modulasi
for a = 1: 1: length(snr)
% Batas Treshold SNR untuk MISO 2x1-OFDM
if (0<=snr(a)&snr(a)<15)
M=4 ; % Memilih modulasi QPSK
elseif (15<=snr(a)&snr(a)<20) M=16 ; % Memilih modulasi 16-QAM
elseif (snr(a)>=20)
M=64 ; % Memilih modulasi 64-QAM
end
% Batas Treshold SNR untuk MIMO 2x2-OFDM
if (0<=snr(a)&snr(a)<8)
M1=4 ; % Memilih modulasi QPSK
elseif (8<=snr(a)&snr(a)<15)
elseif (snr(a)>=15)
M1=64 ; % Memilih modulasi 64-QAM
end
% Batas Treshold SNR untuk MISO 2x4-OFDM
if (0<=snr(a)&snr(a)<5)
M2=4 ; % Memilih modulasi QPSK elseif (5<=snr(a)&snr(a)<10)
M2=16 ; % Memilih modulasi 16-QAM
elseif (snr(a)>=10)
M2=64 ; % Memilih modulasi 64-QAM
end ml = log2(M); ml1=log2(M1); ml2=log2(M2); % Modulation level:QPSK for q =1:1:nloop [BER1(q)]=misofunction(M,para,fftlen, noc,nd,ml,sr,gilen,snr(a),A,B); [BER2(q)]=mimo2x2function(M1,para,fftlen, noc,nd,ml1,sr,gilen,snr(a),A,B); [BER3(q)]=mimo2x4(M2,para,fftlen, noc,nd,ml2,sr,gilen,snr(a),A,B); end nilaiBER1(a)=sum(BER1)/nloop ; nilaiBER2(a)=sum(BER2)/nloop ; nilaiBER3(a)=sum(BER3)/nloop ; end
nilaiBER1 % Nilai BER MISO 2x1-OFDM dengan modulasi adaptif
nilaiBER2 % Nilai BER MISO 2x2-OFDM dengan modulasi adaptif
nilaiBER3 % Nilai BER MISO 2x4-OFDM dengan modulasi adaptif
close all
% Mencari nilai BER MIMO pada masing-masing jenis Modulasi
figure semilogy(snr,nilaiBER1,'-or','LineWidth',2); axis([0 25 10^-5 1]) grid on legend('modulasi adaptif'); xlabel('SNR, dB');
ylabel('Bit Error Rate');
title(' BER MISO 2x1-OFDM dengan Modulasi Adaptif '); figure semilogy(snr,nilaiBER2,'bp-','LineWidth',2); axis([0 25 10^-5 1]) grid on legend('modulasi adaptif'); xlabel('SNR, dB');
ylabel('Bit Error Rate');
semilogy(snr,nilaiBER3,'kd-','LineWidth',2); axis([0 25 10^-5 1])
grid on
legend('modulasi adaptif'); xlabel('SNR, dB');
ylabel('Bit Error Rate');
LAMPIRAN B
PEMETAAN MODULASI QPSK, 16-QAM, dan 64-QAM
Jenis Modulasi Kombinasi Bit I Q
QPSK 00 1 2 1 2 01 1 2 1 2 10 1 2 1 2 11 1 2 1 2 16 - QAM 0000 1 10 1 10 0001 1 10 3 10 0010 3 10 1 10 0011 3 10 3 10 0100 1 10 1 10 0101 1 10 3 10 0110 3 10 1 10 0111 3 10 3 10 1000 1 10 1 10 1001 1 10 3 10 1010 3 10 1 10 1011 3 10 3 10 1100 1 10 1 10 1101 1 10 3 10 1110 3 10 1 10 1111 3 10 3 10 64 - QAM 000000 3 42 3 42 000001 3 42 1 42 000010 1 42 3 42 000011 1 42 1 42 000100 3 42 5 42 000101 3 42 7 42 000110 1 42 5 42
001000 5 42 3 42 001001 5 42 1 42 001010 7 42 3 42 001011 7 42 1 42 001100 5 42 5 42 001101 5 42 7 42 001110 7 42 5 42 001111 7 42 7 42 010000 3 42 3 42 010001 3 42 1 42 010010 1 42 3 42 010011 1 42 1 42 010100 3 42 5 42 010101 3 42 7 42 010110 1 42 5 42 010111 1 42 7 42 011000 5 42 3 42 011001 5 42 1 42 011010 7 42 3 42 011011 7 42 1 42 011100 5 42 5 42 011101 5 42 7 42 011110 7 42 5 42 011111 7 42 7 42 100000 3 42 3 42 100001 3 42 1 42 100010 1 42 3 42 100011 1 42 1 42 100100 3 42 5 42 100101 3 42 7 42
100110 1 42 5 42 100111 1 42 7 42 101000 5 42 3 42 101001 5 42 1 42 101010 7 42 3 42 101011 7 42 1 42 101100 5 42 5 42 101101 5 42 7 42 101110 7 42 5 42 101111 7 42 7 42 110000 3 42 3 42 110001 3 42 1 42 110010 1 42 3 42 110011 1 42 1 42 110100 3 42 5 42 110101 3 42 7 42 110110 1 42 5 42 110111 1 42 7 42 111000 5 42 3 42 111001 5 42 1 42 111010 7 42 3 42 111011 7 42 1 42 111100 5 42 5 42 111101 5 42 7 42 111110 7 42 5 42 111111 7 42 7 42