Saturday, August 13, 2016

Chapter 5

CHAPTER 5

DESIGN AND IMPLEMENTATION
OF OFFSET TECHNIQUE
FOR 8-PSK  



Introduction
Simulation Codes
Simulation Results and Analysis
Conclusion











DESIGN AND IMPLEMENTATION OF
OFFSET TECHNIQUE FOR 8-PSK  


    1. Introduction
  • OQPSK
Offset quadrature phase-shift keying (OQPSK) is a variant of QPSK. Taking four values of the phase (two bits) at a time to construct a QPSK symbol can allow the phase of the signal to jump by as much as 180° at a time. When the signal is low-pass filtered (as is typical in a transmitter), these phase-shifts result in large amplitude fluctuations, an undesirable quality in communication systems. By offsetting the timing of the odd and even bits by one bit-period, or half a symbol-period, the in-phase and quadrature components will never change at the same time. This will limit the phase-shift to no more than 90° at a time. This yields much lower amplitude fluctuations than non-offset QPSK and is sometimes preferred in practice. The sudden phase-shifts occur about twice as often as for QPSK (since the signals no longer change together), but they are less severe. In other words, the magnitude of jumps is smaller in OQPSK when compared to QPSK.
Same idea can be applied to higher order M-PSK and other linear modulation techniques. In this section 8-Offset phase shift keying (8-OPSK) is implemented using matlab and BER performance of 8-OQPSK is compared with 8-PSK.


    1. Simulation Codes
      1. Offset 8-PSK
M = 8;            len = 2048;
x = randi([0 M-1],len, 1);  z = de2bi(x);
a = z(:,1)'; b = z(:,2)'; c = z(:,3)';
a1 = []; b1 = []; c1 = []; x1 = [];
for p = 1:len
   a1 = [a1 a(p) a(p) a(p)];  b1 = [b1 b(p) b(p) b(p)]; c1 = [c1 c(p) c(p) c(p)];
end
a1 = [a1 0 0]; b1 = [0 b1 0]; c1 = [0 0 c1];
for p = 1:3*len+2
   x1 = [221; c1(p) b1(p) a1(p)];
end
d = bi2de(x1); ini_phase = 0;
modmap = zeros(1,8);
modmap(1) = cos(ini_phase + pi/8) +   1i * sin(ini_phase + pi/8);
modmap(2) = cos(ini_phase + 3*pi/8) + 1i * sin(ini_phase + 3*pi/8);
modmap(3) = cos(ini_phase + 7*pi/8) + 1i * sin(ini_phase + 7*pi/8);
modmap(4) = cos(ini_phase + 5*pi/8) + 1i * sin(ini_phase + 5*pi/8);
modmap(5) = cos(ini_phase + 15*pi/8) + 1i * sin(ini_phase + 15*pi/8);
modmap(6) = cos(ini_phase + 13*pi/8) + 1i * sin(ini_phase + 13*pi/8);
modmap(7) = cos(ini_phase + 9*pi/8) + 1i * sin(ini_phase + 9*pi/8);
modmap(8) = cos(ini_phase + 11*pi/8) + 1i * sin(ini_phase + 11*pi/8);
y = genqammod(d,modmap);
hScope = commscope.ScatterPlot;
update(hScope, y)

      1. Variant of Offset 8-PSK
M = 8; len = 1000;
msg = randi([0 M-1],len,1);
z = de2bi(msg);
a = z(:,1)'; b = z(:,2)'; c = z(:,3)';
a1 = []; b1 = []; c1 = []; x1 = [];
for p = 1:len
   a1 = [a1 a(p) a(p) a(p)];
   b1 = [b1 b(p) b(p) b(p)];
   c1 = [c1 c(p) c(p) c(p)];
end
a1 = [a1 0]; b1 = [b1 0]; c1 = [0 c1];
for p = 1:3*len+1
   x1 = [221; a1(p) b1(p) c1(p)];
end
d = bi2de(x1); ini_phase = 0;
modmap = zeros(1,8);
modmap(1) = cos(ini_phase + pi/8) +   1i * sin(ini_phase + pi/8);
modmap(2) = cos(ini_phase + 3*pi/8) + 1i * sin(ini_phase + 3*pi/8);
modmap(3) = cos(ini_phase + 7*pi/8) + 1i * sin(ini_phase + 7*pi/8);
modmap(4) = cos(ini_phase + 5*pi/8) + 1i * sin(ini_phase + 5*pi/8);
modmap(5) = cos(ini_phase + 15*pi/8) + 1i * sin(ini_phase + 15*pi/8);
modmap(6) = cos(ini_phase + 13*pi/8) + 1i * sin(ini_phase + 13*pi/8);
modmap(7) = cos(ini_phase + 9*pi/8) + 1i * sin(ini_phase + 9*pi/8);
modmap(8) = cos(ini_phase + 11*pi/8) + 1i * sin(ini_phase + 11*pi/8);
y = genqammod(d,modmap);
hScope = commscope.ScatterPlot;
update(hScope, y);

      1. Comparison of BER Performance of Offset 8-PSK and
Non-offset 8-PSK
clc; clear all;  close all;
SamplesPerFrame = 120;  maxNumErrs=100; maxNumBits=1e6;
M = 8;
s = RandStream.create('mt19937ar', 'seed',529558);
prevStream = RandStream.setGlobalStream(s);
hInt2Bit1 = comm.IntegerToBit('BitsPerInteger',3,'OutputDataType','uint8');
hBit2Int1 = comm.BitToInteger('BitsPerInteger',3,'OutputDataType','uint8');
hMod = comm.PSKModulator('ModulationOrder',M,'SymbolMapping','gray', ...
                   'PhaseOffset',0,'BitInput',false);
hDemod = comm.PSKDemodulator('ModulationOrder',M,'SymbolMapping','gray', ...
        'PhaseOffset',0,'BitOutput',false,'OutputDataType','uint8', ...
        'DecisionMethod','Hard decision');
hChan = comm.AWGNChannel('NoiseMethod','Signal to noise ratio (Eb/No)', ...
                   'BitsPerSymbol',log2(M),'SignalPower',1);
hphase =  comm.PhaseNoise('Level',[-60 -80],'FrequencyOffset',[20 200]);
hSymError = comm.ErrorRate; hBitError = comm.ErrorRate; EbNoVec = 0:2:15;                             
SERVec1 = zeros(size(EbNoVec)); BERVec1 = zeros(size(EbNoVec));
SERVec2 = zeros(size(EbNoVec)); BERVec2 = zeros(size(EbNoVec));
txbits = randi([0 1], SamplesPerFrame, 1, 'uint8');
for p = 1:length(EbNoVec);
 reset(hSymError);  reset(hBitError);
 hChan.EbNo = EbNoVec(p);
 SER = zeros(3,1); BER = zeros(3,1);                          
 while (BER(2)<maxNumErrs) && (BER(3)<maxNumBits)
   txSym = step(hBit2Int1, txbits); tx = step(hMod, txSym);
   rx2 = step(hChan, tx);  rx = step(hphase, rx2);
   rxSym = step(hDemod, rx); rxBits = step(hInt2Bit1, rxSym);           
   SER = step(hSymError, txSym, rxSym); BER = step(hBitError, txbits, rxBits);   
 end
 SERVec1(p) = SER(1);  BERVec1(p) = BER(1);
 if (BER(1) <= 1e-4)||(SER(1) <= 1e-4) , break , end
end
release(hphase);    release(hChan);
release(hMod); release(hDemod); release(hInt2Bit1); release(hBit2Int1);
for q = 1:length(EbNoVec);
 reset(hSymError); reset(hBitError);  hChan.EbNo = EbNoVec(q);
 SER = zeros(3,1); BER = zeros(3,1);                          
 while (BER(2)<maxNumErrs) && (BER(3)<maxNumBits)
     b1 = [];  b2 = [];  b3 = [];
for r = 1:length(txbits)/3
   b1 = [b1; txbits(3*r-2);txbits(3*r-2);txbits(3*r-2)];
   b2 = [b2; txbits(3*r-1);txbits(3*r-1);txbits(3*r-1)];
   b3 = [b3; txbits(3*r);txbits(3*r);txbits(3*r)];
end
   b1 = [b1;0;0];  b2 = [0;b2;0];  b3 = [0;0;b3];  tbits = [];
for r = 1 : length(b1)
   tbits = [20bits;b1(r);b2(r);b3(r)];
end
   txSym2 = step(hBit2Int1, tbits);  tx2 = step(hMod, txSym2);                  
   rx3 = step(hChan, tx2); rx4 = step(hphase, rx3);
   rxSym2 = step(hDemod, rx4); rxBits2 = step(hInt2Bit1, rxSym2);           
  SER = step(hSymError, txSym2, rxSym2);BER = step(hBitError, tbits, rxBits2);   
 end
 SERVec2(q) = SER(1);  BERVec2(q) = BER(1);
 if (BER(1) <= 1e-4)||(SER(1) <= 1e-4) , break , end
end
RandStream.setGlobalStream(prevStream);
semilogy(EbNoVec,SERVec1,EbNoVec,SERVec2);  axis([0 15 1e-4 1])
legend  ( '8 PSK', 'OPSK','Location','SouthWest');
xlabel  ( 'Eb/No (dB)' ); ylabel( 'Error Probability' );
title   ( 'Symbol Error Probability' );   grid on;  
semilogy(EbNoVec,BERVec1,EbNoVec,BERVec2);     axis([0 15 1e-4 1])
legend  ( '8 PSK', 'OPSK','Location','SouthWest');
xlabel  ( 'Eb/No (dB)' ); ylabel( 'Error Probability' );
title   ( 'Bit Error Probability' );   grid on;

    1. Simulation Results
C:\Users\Simer\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.Word\New Picture (29).bmp
Fig. 5.1 Constellation Diagram of Offset 8-PSK

C:\Users\Simer\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.Word\New Picture (28).bmp
Fig. 5.2 Constellation Diagram of Variant of Offset 8-PSK

C:\Users\Simer\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.Word\New Picture (30).bmp
Fig. 5.3 Comparison of BER performance of Offset 8-PSK and 8-PSK
    1. Conclusion
In this chapter, it is concluded that that offset techniques can be applied to higher order modulation methods such as 8-PSK which is not mentioned in prior art and from Fig. 5.1, it is observed that by applying offset technique to 8-PSK, signal transition does not goes through the origin. Fig. 5.2 shows the alternative form. Moreover, from Fig. 5.3, it is concluded that BER performance of offset M- PSK (M=8) remains same as normal non-offset M-PSK(M=8).










Chapter 4

CHAPTER 4

DESIGN AND IMPLEMENTATION
OF MULTILAYER QOS MODEL
FOR M-ARY SYSTEM



Introduction
Simulation Codes
Simulation Results and Analysis
Conclusion











DESIGN AND IMPLEMENTATION OF MULTILAYER
QOS MODEL FOR M-ARY SYSTEM

    1. Introduction
From results of last chapter, it observed that for spectral efficient modulation techniques such as M-PSK, BER performance degrades as value of a modulation order M (≥4) increase as shown in Fig. 4.1. This is because the distance between symbols on constellation decreases as number of symbol increases with modulation order.
C:\Users\Simer\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.Word\New Picture (10).bmpFig. 4.1 BER performance of BPSK, QPSK, 8-PSK, 16-PSK



Fig. 4.2 Constellation Diagram of BPSK
C:\Users\Simer\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.Word\New Picture (9).bmp
Fig. 4.3 Constellation Diagram of 4-PSK

C:\Users\Simer\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.Word\New Picture (10).bmp
Fig. 4.4 Constellation Diagram of 8-PSK

C:\Users\Simer\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.Word\New Picture (11).bmp
Fig. 4.5 Constellation Diagram of 32-PSK

Also from constellations diagrams of BPSK, 4-PSK, 8-PSK and 32-PSK (shown in Figures 4.2-4.5), it is observed that constellations of symbols are upward compatible i.e. constellation of symbols of BPSK can be derived from constellation of symbols of 4-PSK, 8-PSK and so on. Similarly, constellation of symbols of 4-PSK can be derived from constellation of symbols of 8-PSK, 16-PSK and so on.
the idea behind this part of thesis is that the user easily switch from one level of BER performance to another actively(on demand) without changing the actual MODEM. This is possible by using computerized encoding and decoding at transmitter and receiver respectively.    
C:\Users\Simer\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.Word\New Picture (13).bmp
Fig. 4.6 Logical decision boundary of QoS level 4
C:\Users\Simer\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.Word\New Picture (14).bmp
Fig. 4.7 Logical decision boundary of QoS level 3

C:\Users\Simer\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.Word\New Picture (15).bmp
Fig. 4.8 Logical decision boundary of QoS level 2
Method: The comprising of encoding and decoding techniques with 32-PSK MODEM circuitry. For level-1, this technique work normally as 32-PSK transceiver. For level-2, the input bits are grouped into 3-bits symbol and a zero is added in 4th bit place. Appending a zero in end in digital signal is equivalent by multiplication by 2. The resultant signal is mapped to 32 bit PSK such as block coded modulation. It also behaves like repetitive constellation points. At receiver side, the decision boundary is extended logically such that any phase difference between 0o to 45o   is resemble symbol “0” (=000) and between 45o to 90o resemble symbol “1” (=001) and so on. similarly level 2 and 3 signals are encoded, mapped and decoded.  

    1. Simulation Codes
SamplesPerFrame = 120; maxNumErrs=100; maxNumBits=1e6; M = 32;
s = RandStream.create('mt19937ar', 'seed',529558);
prevStream = RandStream.setGlobalStream(s);
hInt2Bit1 = comm.IntegerToBit('BitsPerInteger',5,'OutputDataType','uint8');
hBit2Int1 = comm.BitToInteger('BitsPerInteger',5,'OutputDataType','uint8');
hInt2Bit3 = comm.IntegerToBit('BitsPerInteger',3,'OutputDataType','uint8');
hBit2Int3 = comm.BitToInteger('BitsPerInteger',3,'OutputDataType','uint8');
hInt2Bit4 = comm.IntegerToBit('BitsPerInteger',2,'OutputDataType','uint8');
hBit2Int4 = comm.BitToInteger('BitsPerInteger',2,'OutputDataType','uint8');
hInt2Bit5 = comm.IntegerToBit('BitsPerInteger',1,'OutputDataType','uint8');
hBit2Int5 = comm.BitToInteger('BitsPerInteger',1,'OutputDataType','uint8');
hMod = comm.PSKModulator('ModulationOrder',M,'SymbolMapping','binary', ...
       'PhaseOffset',0,'BitInput',false);
hDemod = comm.PSKDemodulator('ModulationOrder',M,'SymbolMapping',...
       'binary','PhaseOffset',0,'BitOutput',false,...
       'OutputDataType','uint8','DecisionMethod','Hard decision');
hChan = comm.AWGNChannel('NoiseMethod','Signal to noise ratio (Eb/No)', ...
                   'BitsPerSymbol',log2(M),'SignalPower',1);
hSymError = comm.ErrorRate; hBitError = comm.ErrorRate;
EbNoVec = 0:0.5:25;                             
SERVec32 = zeros(size(EbNoVec)); BERVec32 = zeros(size(EbNoVec));
SERVec8 = zeros(size(EbNoVec));   BERVec8 = zeros(size(EbNoVec));
SERVec4 = zeros(size(EbNoVec));   BERVec4 = zeros(size(EbNoVec));
SERVec2 = zeros(size(EbNoVec));   BERVec2 = zeros(size(EbNoVec));
txBits = randi([0 1], SamplesPerFrame, 1, 'uint8');
for p = 1:length(EbNoVec);
 reset(hSymError);  reset(hBitError);
 hChan.EbNo = EbNoVec(p);
 SER = zeros(3,1); BER = zeros(3,1);                          
 while (BER(2)<maxNumErrs) && (BER(3)<maxNumBits)
   txSym = step(hBit2Int1, txBits);   tx = step(hMod, txSym);   rx = step(hChan, tx);                     
   rxSym = step(hDemod, rx);    rxBits = step(hInt2Bit1, rxSym);           
   SER = step(hSymError, txSym, rxSym); BER = step(hBitError, txBits, rxBits);   
 end
 SERVec32(p) = SER(1);     BERVec32(p) = BER(1);
 if (BER(1) <= 1e-4)||(SER(1) <= 1e-4) , break , end
end
release(hChan); release(hMod); release(hDemod);
for q = 1:length(EbNoVec);
 reset(hSymError); reset(hBitError);
 hChan.EbNo = EbNoVec(q) + 10*log10(8/32);
 SER = zeros(3,1);  BER = zeros(3,1);                          
 while (BER(2)<maxNumErrs) && (BER(3)<maxNumBits)
   txSym3 = step(hBit2Int3, txBits); txSym13 = txSym3*4;tx3 = step(hMod, txSym13);                  
   rx3 = step(hChan, tx3);  rxSym = step(hDemod, rx3);                
   for p = 1:length(rxSym)
       if (rxSym(p)>2)&&(rxSym(p)<6) rxSym(p)=1;
       elseif (rxSym(p)>6)&&(rxSym(p)<10) rxSym(p)=2;
       elseif (rxSym(p)>10)&&(rxSym(p)<14)  rxSym(p)=3;
       elseif (rxSym(p)>14)&&(rxSym(p)<18) rxSym(p)=4;
       elseif (rxSym(p)>18)&&(rxSym(p)<22)  rxSym(p)=5;
       elseif (rxSym(p)>22)&&(rxSym(p)<26)  rxSym(p)=6;
       elseif (rxSym(p)>26)&&(rxSym(p)<30)  rxSym(p)=7;
       else
           rxSym(p)=0;
       end
   end
   rxBits3 = step(hInt2Bit3, rxSym);           
   SER = step(hSymError, txSym3, rxSym);   BER = step(hBitError, txBits, rxBits3);   
 end
 SERVec8(q) = SER(1); BERVec8(q) = BER(1);
 if (BER(1) <= 1e-4)||(SER(1) <= 1e-4) , break , end
end
release(hChan); release(hMod); release(hDemod);
for q = 1:length(EbNoVec);
 reset(hSymError); reset(hBitError); hChan.EbNo = EbNoVec(q) + 10*log10(4/32);
 SER = zeros(3,1);  BER = zeros(3,1);                          
 while (BER(2)<maxNumErrs) && (BER(3)<maxNumBits)
   txSym4 = step(hBit2Int4, txBits); txSym14 = txSym4*8;
   tx4 = step(hMod, txSym14); rx4 = step(hChan, tx4); rxSym = step(hDemod, rx4);                
   for p = 1:length(rxSym)
       if (rxSym(p)>4)&&(rxSym(p)<12) rxSym(p)=1;
       elseif (rxSym(p)>12)&&(rxSym(p)<20) rxSym(p)=2;
       elseif (rxSym(p)>20)&&(rxSym(p)<28) rxSym(p)=3;
       else
           rxSym(p)=0;
       end
   end
   rxBits4 = step(hInt2Bit4, rxSym);           
   SER = step(hSymError, txSym4, rxSym);    BER = step(hBitError, txBits, rxBits4);   
 end
 SERVec4(q) = SER(1); BERVec4(q) = BER(1);
 if (BER(1) <= 1e-4)||(SER(1) <= 1e-4) , break , end
end
release(hChan); release(hMod); release(hDemod);
for q = 1:length(EbNoVec);
 reset(hSymError); reset(hBitError);
 hChan.EbNo = EbNoVec(q) + 10*log10(2/32);
 SER = zeros(3,1); BER = zeros(3,1);                          
 while (BER(2)<maxNumErrs) && (BER(3)<maxNumBits)
   txSym5 = step(hBit2Int5, txBits); txSym15 = txSym5*16;
   tx5 = step(hMod, txSym15); rx5 = step(hChan, tx5); rxSym = step(hDemod, rx5);                
   for p = 1:length(rxSym)
       if (rxSym(p)>8)&&(rxSym(p)<24 rxSym(p)=1;
       else
           rxSym(p)=0;
       end
   end
   rxBits5 = step(hInt2Bit5, rxSym);           
   SER = step(hSymError, txSym5, rxSym);  BER = step(hBitError, txBits, rxBits5);   
 end
 SERVec2(q) = SER(1);  BERVec2(q) = BER(1);
 if (BER(1) <= 1e-4)||(SER(1) <= 1e-4) , break , end
end
RandStream.setGlobalStream(prevStream);
semilogy(EbNoVec,SERVec32,EbNoVec,SERVec8,EbNoVec,SERVec4,EbNoVec,… SERVec2);
axis([0 25 1e-4 1]); legend  ( 'QOS Pt.1', 'QOS Pt.2', 'QOS Pt.3', 'QOS Pt.4');
xlabel  ( 'Eb/No' ); ylabel( 'Error Probability' ); title('Symbol Error Probability');  grid on;  
Fig.;
semilogy(EbNoVec,BERVec32,EbNoVec,BERVec8,EbNoVec,BERVec4,EbNoVec,…BERVec2);
axis([0 25 1e-4 1]); legend  ('QOS Pt.1', 'QOS Pt.2', 'QOS Pt.3', 'QOS Pt.4');
xlabel  ( 'Eb/No' ); ylabel( 'Error Probability' ); title( 'Bit Error Probability' );grid on;  
    1. Simulation Results and Analysis
C:\Users\Simer\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.Word\New Picture (25).bmp
Fig. 4.9 Simulated SER performance of 4-Level QOS system.

C:\Users\Simer\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.Word\New Picture (27).bmp
Fig. 4.10 Simulated BER performance of 4-Level QOS system.

    1. Conclusion
In this chapter, it is concluded that constellation signals of lower modulation order can be encoded to constellation signal of higher modulation order and can be demodulated by same higher order demodulator. Fig. 4.10 shows the comparison of BER performance of different levels of QoS system. Different level of QoS is assigned to these BER performances such as QoS level 1 is assigned to 32-PSK constellation signal, QoS level 2 is assigned to 8-PSK constellation signal, QoS level 3 is assigned to 4-PSK constellation signal and QoS level 4 is assigned to BPSK constellation signal and BER performance is getting better as lower constellation signal is mapped to higher constellation signal. Same conclusion is derived from Fig. 4.9 on the basis of SER