Design a Digital Communication System

EE 5368

WIRELESS COMMUNICATIONS

Fall 2010

INSTRUCTOR:

Tracy Jing Liang

SUBMITTED BY:

CHIRAG PANDYA: 1000722427

SAURABH GHORPADE:

VAIBHAV PATANKAR:

Contents

1. Introduction3

2. Project Assigned 4

3. Rician Channel 6

4. Rician Channel with MRC 10

5. Rician Channel with viterbi Encoder and Decoder 12

6. Rician Channel with Encoding,

Interleaver and Puncturing 15

7. Performance Analysis17

8. Conclusion 29

Reference30

Appendix31

Introduction

Wireless communications is the fastest growing segment of the data and telecommunications industry, with the potential to provide high-speed high-quality information exchange between portable devices located anywhere in the world. Potential applications enabled by this technology include multimedia Internet-enabled cell phones, smart homes and appliances, automated highway systems, video teleconferencing and distance learning, and autonomous sensor networks, to name just a few.

Radio waves propagate from a transmitting antenna, and travel through free space undergoing reflection, refraction, diffraction, and scattering. They are greatly affected by

the ground terrain, the atmosphere, and the objects in their path, like buildings, bridges, hills, trees, etc. generally there is no direct or line of sight between transmitter and receiver, Due to which received signal reach receiver from different path with different delay creating a multipath. Various path loss models have been devised and analyzed for

the optimum performance of a wireless communication system.

These multipath waves with randomly distributed amplitudes and phases combine at the receiver, to give a resultant signal that fluctuates in time and space. This induces error in received signal. Again, several methods have been adopted to combat this issue. All these

aspects have been considered in this project and the corresponding results have been presented.

Project assigned

In this project, you (a team up to 3 graduate students) are requested to perform system level design for a mobile wireless user terminal using block phase estimation algorithm proposed in [1]. The specifications for its general packet data channel (GPDCH, a logic channel) are listed in the following:

•Modulation: QPSK with bits to symbol mapping:

00 → 1, 01 → j, 11 → -1, 10 → -j.

•Burst structure:

Guard Symbols
(3 symbols) / Unique Word
(40 symbols) / Private Inf Symbols (Payload)
(500 symbols) / Guard Symbols
(3 symbols)

and transmitting such a burst needs 0.5ms.

•The channel bandwidth is 8MHz, and Rician flat fading is assumed.

•16 samples/symbol should be used based on hardware requirements.

•The roll-off factor for square root raised cosine filter is 0.35.

Please design a simulation reference system for GPDCH subject to Rician flat fading using MATLAB or C, and design a demodulator for such a fading channel with QPSK modulation. Provide a report describe your design with the following performance plots:

  1. The Rician flat fading channel K = 7dB, doppler shift (fading bandwidth) f d = 20 Hz , plot the raw bit error rate (BER) at Eb/ No =1, 2, …,7dB obtained in your simulation and compare it with the theoretical raw BER at 1, 2, …, 6,7 dB.

BER = [0.09 0.0699 0.0527 0.0387 0.0277 0.0193 0.0135];

  1. The Rician flat fading channel K = 12dB, f d = 100 Hz, plot the raw bit error rate (BER) at Eb/No =1, 2, …,6, 7dB obtained in your simulation and compare it

with the theoretical raw BER at 1, 2, …, 6, 7 dB.

BER = [0.06565 0.04664 0.03124 0.01958 0.011396 0.0061246, 0.00302];

  1. The Rician flat fading channel K = 200dB, f Hz d = 0 , plot the raw bit error rate (BER) at Eb/ No =1, 2, …,6dB obtained in your simulation and compare it with the theoretical raw BER,Q(sqrt(2Eb/No) ).

4. If four-path diversity with maximal ratio combining (MRC) is used, repeat

(1)(2)(3), and observe how many dB gains have achieved in each case.

5.If convolutional codes with coding rate ½ and with connections (in octal number) represented in binary [001 011 011] and [001 111 001] in the encoder and viterbi decoder are used in the design, repeat (1)(2)(3), and observe how many dB gains have achieved in each case.

6.If puncturing (b3 is punctured in every four bits b0-b3) and block interleaver (10×5) are used in the design, what’s the performance for the above three channels? How many dB losses comparing to the same channel in (5)? What’s the main advantage of this scheme?

7.In the above systematic studies, what conclusions can be drawn?

Rician Channel

Block Diagram:

Fig1 . Block diagram for the Rician channel

Description of Components

Random bits Generator and Burst Builder: This block generates the information payload along with the Guard and the unique word. The total length of the burst is 1092 bits. Payload is 1000 bits, 6 guard bits at each end and 80 bits of unique word.

Modulation: In the project we have used QPSK modulation where every symbol consists of two information bits and the modulation is being carried out using the following mapping:

00 1

01 j

11 --1

10 -j

Upsampler: The up sampler introduces 15 zeros between two symbols thereby leading us to multiply the 546 symbols by 16. This is done to obtain a smooth transition between two symbols.

Pulse Filter Shaping: This filter is essentially introduced before the channel and is used to generate a continuous waveform by using convolution methods. The roll-off factor for square root raised cosine filter is 0.35.

Channel: The channel used in this project is a Rician flat fading channel. The parameters for defining this channel are given by the fading factor (k) and the Doppler frequency (fd). The simulation of the Rician channel is done by using the Jake’s model.

Matched Filter:This filter also works on the principle of convolution and is deployed just after the channel for matching purpose. The roll-off factor for square root raised cosine filter is 0.35.

Down sampler: The down sampler extracts the symbols in multiples of 16. The zeros between two symbols are dropped and the length of burst is reduced to 546 symbols

Demodulation and Block Phase Estimation: For implementing the channel compensation successfully the compensating angle has to be evaluated. This is carried out with the help of Viterbi paper. The steps in block phase estimation are as follows:

  1. A window size of length N(in our case 60) is chosen with a step size of N(10 in our case)
  2. The received signal (z) before demodulation and after down sampling is raised to the power four to give y.
  3. The phase angle is calculated over the window size using the formula below:
  1. The phase angle calculated by this method has ambiguity because theta can have values where k varies from -4 to +4
  2. The accurate phase rotation is resolved using the calculation of the unique word in the burst structure over the length L of unique word:
  1. Based on angle calculated using the unique word above, the actual value of theta is calculated which is nearest to the calculated angle of unique word and is termed theta 1 which is reference to calculation of theta 2
  2. After this the block window is incremented to [M, M+N-1] and similarly the phase candidate theta is obtained
  3. The theta 2 is calculated from the above theta in step g by choosing one closest to theta 1
  4. The above steps a-g is repeated till the whole length of the burst structure is covered.
  5. Then linear interpolation is implemented to get the phase rotation for every symbol in the burst

After obtaining the phase rotation for every symbol from the above process the demodulation is carried out using hard slicing.

Channel Compensation: After the transmitted signal undergoes modulation and it passes through the channel, the signal is rotated by a phase angle. At the receiver end before demodulating the received signal using the hard slicer, it has to be rotated in the anticlockwise by the same amount of phase. This phenomenon is called Channel Compensation.

Hard Slicer: The hard slicer can be best described by the figure below

Fig 2 Hard Slicer

Burst Extractor: In this block we remove the unwanted guard and unique word and keep only the payload which is 1200 bits.

BER Calculator: We compare the generated payload at the transmitter and the received burst at the output of the burst extractor and calculate the BER.

Rician Channel with MRC

Block Diagram

Fig3 . Rician channel with MRC

In this case the effect of diversity is taken in to the consideration. Three different channels have been simulated with different gain. In order to improve the performance we have used maximal ratio combining technique. The rest of the blocks are same as case 1. Description of the MRC block is given below.

Maximal Ratio Combination (MRC):It is based on maximal likelihood detection principle. After a lot of derivation it can be proved that if we have L number of copies of a signal in the vector r and their corresponding gain in vector g the send signal will be the one which has the maximum real value after going the following process described in the pictorial diagram below.

Fig 4 Logic diagram for Maximal Ratio Combination (MRC)

Rician Channel with Viterbi encoder and decoder

Fig5 . Rician channel with Viterbi Encoder and decoder

To improve the BER performance of the system convolution codes have been used. Two new blocks are added here described below. The rest of the blocks are similar to case 1.

Convolution codes (Encoder):Convolution encoder contains memory, and the encoder outputs at any point of time don’t only depend on the present input but also on the previous inputs. A rate R=k/n convolution encoder with memory order m can be realized as k-input, n-output linear sequential circuit with input memory m; that is, inputs remain in the encoder for an additional m time units after entering. Encoders for convolution codes fall into two general categories of feed forward and feedback. Further, within each category, encoders can be either systematic or non-systematic. For an encoder with memory m, we can write the convolution operation using the following mathematical model stated below. Where signifies output lth bit of jth output, u corresponds to the input bit sequence and corresponds to the i th bit of jth generator sequence

Fig 6 A rate R=1/2 binary nonsystematic feed forward convolution encoder with memory order m=3

Viterbi Decoder:Viterbi decoder is based on trellis diagram and maximal likelihood principle. A pictorial representation of Veterbi decoder is as follows:

Fig 7 Viterbi Decoder and Trellis diagram

From the above trellis diagram the decoded bits can be determined based on minimum hamming distance which is essentially the number of bits that differ in value corresponding to the received bits. The upper branch in the trellis diagram corresponds to input bit 1 and lower branch corresponds to input bit 0.

Rician Channel with coding, encoding, interleaver and puncturing

Fig8 . Rician channel with Viterbi Encoder and decoder, puncturing and interleaving

Interleaver and de-interleaver:Interleaving is an important phenomenon by which consecutive information bits are scattered in order to avoid loss of sequence of information bits due to channel fading. Usually the generated information bit is inserted row wise in a matrix of dimension m x n and taken out column wise. In this way the two consecutive information bits before interleaving are now scattered by a distance by m bits apart after interleaving. Similarly in the de-interleaver part, the information bits at the receiver end after burst extraction are fed in the same matrix(m x n) column wise and taken out row wise to have the same sequence of information bits which was present at the transmitted end before interleaving. The entire process can be viewed as:

Let the input to the interleaver be denoted by vector x and output by vector y

x = x1 x2 x3 x4 x5 x6 …………………………………….………………x600

Let us take the matrix size of 10 x 5

Interleaver

The output of the interleaver will be x1 x6 ………x596; x2 x7…….x597; x5 x10….x600.

The same process is implemented in the de-interleaver section in the reverse order.

Puncturing:

The puncturing process has the following properties:

  1. Some of the bits in the coded bits are not transmitted
  2. Receiver inserts dummy bits(or jus insert zero) to replace the punctured bits in the receiver
  3. The bits that are not transmitted are defined by a puncturing pattern
  4. Puncturing is used for implementing various information bit rate

Example of puncturing

Punctured

The code rate after puncturing was 3/4 .

Simulation Results

PROBLEM 1:

K=7dB and Fd =20Hz.

Eb/N0 / 1 / 2 / 3 / 4 / 5 / 6 / 7
BER(Theory) / 0.09 / 0.0699 / 0.0527 / 0.0387 / 0.0277 / 0.0193 / 0.0135
BER(Practical) / 0 / 0.0954 / 0.0652 / 0.0589 / 0.0319 / 0.0249 / 0.0189

PROBLEM 2:

K=12db and Fd =100Hz.

Eb/N0 / 1 / 2 / 3 / 4 / 5 / 6 / 7
BER(Theory) / 0.0656 / 0.04664 / 0.03124 / 0.01958 / 0.011396 / 0.0061246 / 00.00302
BER(Practical) / 0.0885 / 0.0678 / 0.0469 / 0.0279 / 0.0138 / 0.0090 / 0.0054

PROBLEM 3:

K=200db and Fd =0Hz

Eb/N0 / 1 / 2 / 3 / 4 / 5 / 6
BER(Theory) / 0.0563 / 0.0375 / 0.0229 / 0.0125 / 0.0060 / 0.0024
BER(Practical) / 0.0706 / 0.0385 / 0.0234 / 0.0130 / 0.0061 / 0.0025

PROBLEM 4:

Results for MRC

  1. K=7db and fd =20Hz.

Eb/N0 / 1 / 2 / 3 / 4 / 5 / 6 / 7
BER(MRC) / 0.1030 / 0.0727 / 0.0597 / 0.0483 / 0.0265 / 0.0215 / 00.0176
BER(Practical) / 0.1165 / 0.0954 / 0.0652 / 0.0589 / 0.0319 / 0.0249 / 0.0189

Gain due to MRC code : 0.6dB

  1. K=12db and fd =100Hz.

Eb/N0 / 1 / 2 / 3 / 4 / 5 / 6 / 7
BER(MRC) / 0.0882 / 0.0582 / 0.0404 / 0.0264 / 0.0118 / 0.0087 / 00.0052
BER(Practical) / 0.0885 / 0.0678 / 0.0469 / 0.0279 / 0.0138 / 0.0090 / 0.0054

Gain due to MRC code : 0.3dB

  1. K=200db and Fd =0Hz.

Eb/N0 / 1 / 2 / 3 / 4 / 5 / 6
BER(Convolution) / 0.0612 / 0.0349 / 0.0213 / 0.0110 / 0.0053 / 0.0019
BER(Practical) / 0.0706 / 0.0385 / 0.0234 / 0.0130 / 0.0061 / 0.0025

Gain due to MRC code : 0.1dB

PROBLEM 5:

Results for Convolution

  1. K=7db and fd =20Hz.

Eb/N0 / 1 / 2 / 3 / 4 / 5 / 6 / 7
BER(Convolution) / 0.0947 / 0.0670 / 0.0573 / 0.0445 / 0.0219 / 0.0119 / 0 0.0100
BER(Practical) / 0.1165 / 0.095 / 0.0652 / 0.0589 / 0.0319 / 0.0249 / 0.0189

Gain due to convolution code : 0.9dB

  1. K=12db and fd =100Hz.

Eb/N0 / 1 / 2 / 3 / 4 / 5 / 6 / 7
BER(Convolution) / 0.0541 / 0.0377 / 0.0134 / 0.0103 / 0.0063 / 0.0027 / 0 0.0015
BER(Practical) / 0.0885 / 0.0678 / 0.0469 / 0.0279 / 0.0138 / 0.0090 / 0.0054

Gain due to convolution code : 1.9dB

  1. K=200db and Fd =0Hz.

Eb/N0 / 1 / 2 / 3 / 4 / 5 / 6
BER(Convolution) / 0.0495 / 0.232 / 0.0087 / 0.0046 / 0.0026 / 0.0063
BER(Practical) / 0.0706 / 0.0385 / 0.0234 / 0.0130 / 0.0061 / 0.0025

Gain due to convolution code : 0.9dB

PROBLEM 6:

Results for Puncturing and Interleaving:

  1. K=7db and Fd =20Hz.

Eb/N0 / 1 / 2 / 3 / 4 / 5 / 6 / 7
BER(Puncturing) / 0.3327 / 0.3333 / 0.3334 / 0.3303 / 0.3325 / 0.3335 / 00.3322
BER(Practical) / 0.1185 / 0.0954 / 0.0652 / 0.0589 / 0.0319 / 0.0249 / 0.0189

LOSS

  1. K=12db and Fd =100Hz.

Eb/N0 / 1 / 2 / 3 / 4 / 5 / 6 / 7
BER(Puncturing) / 0.3316 / 0.3321 / 0.3346 / 0.3345 / 0.3328 / 0.3318 / 00.3312
BER(Practical) / 0.0885 / 0.0678 / 0.0469 / 0.0279 / 0.0138 / 0.0090 / 0.0054

LOSS

  1. K=200db and Fd =0Hz.

Eb/N0 / 1 / 2 / 3 / 4 / 5 / 6
BER(Puncturing) / 0.3319 / 0.3340 / 0.3314 / 0.3333 / 0.3330 / 0.3308
BER(Practical) / 0.0706 / 0.0385 / 0.0234 / 0.0130 / 0.0061 / 0.0025

LOSS

PROBLEM 7:

Conclusion

  1. Simulations to compare the performance of the system were performed and the results were noted. It was observed that as BER reduces as EB/N0 increases for a particular value of Rician factor and Doppler shift. The Simulated values were close to theoretical values( somewhat greater).

The performance for 3rd case was better than other two cases because Doppler Shift was 0. Comparing the performance of Case 2 with Case 1 it was observed that the performance for Case 2 was better than Case 1.

  1. Implementation of convolution codes improves the result i.e. BER reduces significantly and that is very much in lines with the affect of Convolution coding in BER according to theoretical calculations.
  1. MRC, when incorporated in code improves the performance. It reduces

BER as EB/N0 increases for a particular value of Rician factor and Doppler shift. MRC is based on Diversity and BER for Diversity is less than the basic Rician channel. In our plot we have observed that introduction of MRC reduces the BER and is less than the calculated BER of Basic Channel

  1. In the final case, where we implemented puncturing and interleaving along with convolution coding and decoding, we observed that the BER degrades compared with Basic Rician Channel. This is mainly due to puncturing. Puncturing is only effective in the case of burst error caused by noisy environment.

Reference

[1].Andrew J. Viterbi, Audrey M. Viterbi, “Nonlinear Estimation of PSK-Modulated Carrier Phase with Application to Burst Digital Transmission”, IEEE Transaction on Information Theory, vol. IT – 29, No. 4, pp 543-551, July 1983.

[2].Class notes on Wireless Communication Systems (EE 5368) by Dr. Qilian Liang

[3].Matlab help.

[4]. John Proakis, Digital Communications, Fourth Edition 2000.

Appendix

Code for Q. 1

clc;

clear all;

for snr=1:7

for count=1:1000

% Inforamation symbols

no_of_infosymbol=1000;

Infosymbol=randint (1,no_of_infosymbol);

Kn=[5.1918e+007 2.5959e+007 1.7306e+007 1.2980e+007 1.0384e+007 0.8653e+007 0.7417e+007]; % got from calibration

% uniqueword

uw=[0 0 1 0 1 1 1 0];

uniqueword=cat(2,uw,uw,uw,uw,uw,uw,uw,uw,uw,uw);

% guard

guard (1:6) =0;

%burst structure

burst=cat(2,guard,uniqueword,Infosymbol,guard);

burst_len= length (burst); % 1092

% QPSK Modulation

for(t=1:2:burst_len)

if((burst(t)==0) & (burst(t+1)==0))

burst_mod((t+1)/2)=1;

elseif(burst(t)==0&burst(t+1)==1)

burst_mod((t+1)/2)=j;

elseif(burst(t)==1 & burst(t+1)==0)

burst_mod((t+1)/2)=-j;

elseif(burst(t)==1 & burst(t+1)==1)

burst_mod((t+1)/2)=-1;

end

end

burst_length= length(burst_mod); % 546

% Upsampling

m=1;

for j=1:burst_length

up(m)= burst_mod(j);

for k=1:16

m=m+1;

up(m)=0;

end

end

upsample_length = length( up)-1; % length is 8736 ( 546*16)

for i=1:upsample_length

upsample(i)= up(i);

end

% pulse shaping

filter=rcosine(1,16,'sqrt',0.35);

filter_len=length(filter); % length is M=97

pulse_op=conv(filter,upsample);

pulse_op_len= length (pulse_op);% length is (546*16 + 97-1)= 8832

% Discarding M-1 samples

cut1=(filter_len-1)/2;

cut2= pulse_op_len-cut1;

j=1;

for i= cut1+1:cut2

pulseshape_output(j)=pulse_op(i);

j=j+1;

end

pulseshape_op_len=length(pulseshape_output); % length is 546*16= 8736

% Channel

fm=20;

N=66;

wm=2*pi*fm;

M=(1/2*(N/2 -1));

n=1:1:M; % row vector

wn=wm*cos(2*pi*n/N); % row vector

beta=pi*n/M; % row vector

alpha=0;

T_sample=0.5*10^(-3)/(554*16);

for t=1:8736

Git_1=2*(cos(beta).*cos(wn*T_sample*t));

Git(t)= sum( Git_1) + sqrt(2)*cos(wm*T_sample*t)*cos(alpha);

Git(t)= sqrt(2)*(Git(t));

end

for t=1:8736

Gqt_1=2*( sin(beta).*cos(wn*T_sample*t));

Gqt(t)= sum( Gqt_1) + sqrt(2)*cos(wm*T_sample*t)*sin(alpha);

Gqt(t)=sqrt(2)*(Gqt(t));

end

for t=1:8736

Git_Norm(t)=Git(t)/sqrt(2*(M+1));

Gqt_Norm(t)=Gqt(t)/sqrt(2*M);

Gt(t)=Git_Norm(t)+j*Gqt_Norm(t); % This is raleigh

end

K=7;

A=10^(-K/20); % K_ in non-dB

B=1/sqrt(1 + 10^(-K/10)); % normalization factor

for t=1:8736

Rician(t)=((1 + A*Gt(t)).*B); % This is Rician

end

for i=1:pulseshape_op_len

Ch_output(i)=Rician(i)*pulseshape_output(i);

end

Ch_output_len= length(Ch_output);

% AWGN

K=Kn(snr);

Noise=K*((randn(1,Ch_output_len))+j*(randn(1,Ch_output_len)));

Tx_output=Ch_output + Noise;

% RECEIVER

% Matched Filter

Matched_filter= rcosine(1,16,'sqrt',0.35);

len_Matched_filter= length(Matched_filter); % length 97

Matched_conv=conv(Matched_filter,Tx_output);

len_Matched_conv=length(Matched_conv); % length 8832

% discard N-1;

m1= (len_Matched_filter-1)/2;

m2= (len_Matched_conv)-m1;

j=1;

for i= m1+1 : m2

Matched_output(j) = Matched_conv(i);

j=j+1;

end

Matched_output_length=length(Matched_output); % length 8736

% DOWNSAMPLING

j=1;

for i= 1:16:Matched_output_length

downsample(j)= Matched_output(i);

j=j+1;

end

len_downsample=length(downsample); % length is 546

% Block phase estimation

Window_length=50; %The block size

wstep=10; % The step in which the sliding window moves.

uw_tx=burst_mod(4:44); % Transmitted UW is from 4 to 44 symbols( 40 )

uw_rx=downsample(4:44); % Received UW is from 4 to 54 symbols( 40 )

theta_ref=1/40*sum(angle(uw_rx.*conj(uw_tx)));

k=1; %set up the counter consider the intial theta value from the theta_UW

t_=[];

while((Window_length + wstep*(k-1))<=length(downsample))

s=sum(downsample((1+wstep*(k-1)):(Window_length+wstep*(k-1))).^4);

theta_sig=1/4*atan2(imag(s),real(s)) + [0 pi/4 -pi/4 pi/2 -pi/2 3*pi/4 -3*pi/4 pi]; % 8 possible angles

a=abs(theta_ref-theta_sig);

theta_min(k)=theta_sig( a==min(a) ); %Remove the ambiguity in angle calculation by comparing with the UW.

t_=[t_ 0.5*(Window_length+wstep*2*(k-1))];

theta_ref=theta_min(k);

k=k+1;

end

theta_rx=interp1(t_,theta_min,[1:length(downsample)],'linear'); % Perform Linear Interpolation to get the entire range of angles

theta_rx(1:29)=theta_min(1);

theta_rx((t_(end)+1:end))=theta_min(end);

Blockphase=downsample.*exp(-j*theta_rx); % perform phase compensation

Blockphase_len=length(Blockphase);

% Hardslicer

n=1;

for m=1:2:(2*Blockphase_len)-1

angl = angle(Blockphase(n));

if ((angl> -pi/4) & (angl<=0)) | ((angl>=0) & (angl<=pi/4))

burst_rx(m) = 0; burst_rx(m+1) = 0;

elseif ((angl< 3*pi/4) & (angl>= pi/4))

burst_rx(m) = 0; burst_rx(m+1) = 1;

elseif ((angl>= 3*pi/4) & (angl<= pi)) | ((angl<= -3*pi/4) & (angl>= -pi))

burst_rx(m) = 1; burst_rx(m+1) = 1;

elseif ((angl<= -pi/4) & (angl> -3*pi/4 ))

burst_rx(m) = 1; burst_rx(m+1) = 0;

end

n = n+1;

end

BER=0;

for i= 1:1092

if(burst_rx(i)~= burst(i))

BER=BER+1;

end

end

BER=BER/1092;

ber(count)=BER;

end

bit_err=sum(ber)/1000;

BIT_ERR(snr)=bit_err;

end

SNR=1:7;

TheBER=[0.09 0.0699 0.0527 0.0387 0.0277 0.0193 0.0135];

figure(1);

semilogy(SNR,Ratio(SNR),'r*-');

hold on;

semilogy(SNR,TheBER,'bo-');

grid on;

title(' Practical BER Compared with Theoretical ');

legend('Practical BER',...

'Theoretical BER','Location','SouthWest');

hold off

2. Code for Q.2

clc;