138 views

Uploaded by Jaime Fouché

Comparison of BER for BPSK vs QPSK in an AWGN Channel.

- PPt on Mimo Channel Modeling
- BPSK signal generation and demodulation - MATLAB
- UE Categories CQI Mapping Table
- 5g Ran2.0 Channel Management_1.1
- BER Performance of MIMO with Orthogonal Space Time Block Code Using FEC and Various Modulation Techniques
- Modulation
- Masters Thesis[1]
- VoLTE Modelling in Atoll
- A Non-Cooperative Game Theoretical Approach For Power Control In Virtual MIMO Wireless Sensor Network
- Contetnt Detailing Blank
- WX Satelit Spectrum
- Digital Modulation
- Hybrid Modulation
- DOC2.docx
- Lte Relay vs Lte Repeater
- PARDHU
- quiz1
- Space-Time_Coding_STC(1).pdf
- Chap 2 Bandpass Signaling-Notes
- Why MSK is Popular

You are on page 1of 21

Gavin Jaime Fouche

August 21, 2015

Contents

0.1

0.2

0.3

0.4

Introduction . . . . . . . . . . . . . . . . . . . .

Problem Definition and Methodology . . . . . .

0.2.1 Uniform random number generation . .

0.2.2 Gaussian random number generation . .

0.2.3 Modulation through an AWGN channel

0.2.4 BPSK with a phase offset . . . . . . . .

Results . . . . . . . . . . . . . . . . . . . . . . .

0.3.1 Uniform random number generation . .

0.3.2 Gaussian random number generation . .

0.3.3 Modulation through an AWGN channel

0.3.4 BPSK with a phase offset . . . . . . . .

Discussion and Conclusion . . . . . . . . . . . .

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

2

3

3

3

3

5

6

6

7

8

9

9

0.1

Introduction

As the amount of information at our fingertips increases and the demand for

increasingly rapid transfer rates grows greater - The common denominator of all

interaction in the digital sphere is encompassed by the concept of digital communication. Digital communication is defined as the physical transfer of data

over a communication channel. We are surrounded by digital communications

every minute of every day, from the mouse you use on your computer to the

mobile telephone in your pocket right now.

Random number generators use algorithms and techniques to produce strings

of numbers that appear to be unrelated and as a result seem to be random.

Computational algorithms generally produce pseudo-random numbers because

their creation is not dependant on a truly random natural process such as atmospheric noise.

Phase-shift Keying

Phase-shift keying is a scheme of digital modulation that deals with representation of different data signals through the use of a phase-shift on the reference

signal of varying degrees. Two forms of PSK are explored in this practical namely Binary phase shift keying (BPSK) and Quadrature Phase shift keying

(QPSK). [1]

Using a phase shift allows a signal of fixed amplitude to represent multiple

distinct values. These representations (or symbols) can be expressed as a

function of their binary equivalents in a constellation map.

0.2

0.2.1

Uniform random number generation

The probability distribution function of the uniform distribution can be described by [2]:

f (x) =

1

ba

for a x b

f (x) = 0 elsewhere

The uniform distribution required in this practical has bounds a = 0 and b = 1

This can be described by the plot.

From the moment generating functions we can calculate the theoretical mean

() and variance ( 2 ) [2] can be described as:

=

1

1

(a + b) =

2

2

(b a)2

1

=

= 0.083

12

12

To generate random numbers conforming to this uniform distribution, we will

use the Wichmann-Hill Algorithm.

2 =

0.2.2

of

f (x|, ) =

1 e

2

(x)2

2 2

2

f (x|0, 1) =

x

1 e 2

2

0.2.3

rk = sk + nk

Where r is the received symbol, s is the sent symbol and n is a noise term. It

can be deduced from the inequality present by the non-zero n term that the

received signal will differ slightly by the sent signal s. The AWGN network will

be simulated as described in the flow-chart.

Figure 2: Flow chart depicting the methodology behind simulating the AWGN

channel

0.2.4

This report will also explore the effects of a constant phase-shift applied to the

BPSK coding and whether or not this has an effect even in an AWGN channel

with additive real and imaginary noise. If the bit error rate truly is a function

of orthogonality, there should be no apparent difference in BER plots.

0.3

0.3.1

Results

Uniform random number generation

The uniform number generation results proved consistent with the theoretical

approximation. Slight subtleties visible are due to a finite number of samples

limited to 1 million, with an increase in samples the inconsistencies tend to become less prevalent. Despite the differences, the mean still stays exceptionally

close to the theoretical mean of 0.5 and theoretical variance of 0.0833. Calculated values for the simulation can be seen in figure 3.

Algorithm for 1 million samples and the theoretical plot.

0.3.2

Gaussian number generation proved to work well, with a mean difference from

the theoretical value that was extremely small.

Figure 5: Results of the Marsaglia-Bray algorithm for 1 million samples and the

theoretical normal distribution

0.3.3

0.3.4

Figure 8: A plot showing offset BPSK vs regular BPSK bit error rates.

0.4

count, matching the theoretical graphs exceptionally well with very small deviation error.

Results for the BPSK/QPSK graphs showed that both phase-shift keying methods shared the exact same BER plots. This is further illustrated in figure 9.

This is not initially intuitive, transmitting multiple bits at a time seems like it

should have a trade-off in fidelity. However, QPSK symbol mapping is simply

a duo of BPSK signals that are perfectly orthogonal to each other - one BPSK

system on the real axis and another on the imaginary axis. Due to their orthogonality, they hence do not interfere. Analysis (in figure 8) shows that the BER

plots for offset BPSK and regular BPSK do in-fact match each other perfectly.

This is due to the fact that the bit error rate is a function of orthogonality, since

both offset and regular BPSK share the same 180 deg phase shift between their

associated symbols.

It can be concluded that, BPSK and QPSK are digital modulation schemes

with a good fidelity when transmitting through an additive white Gaussian

noise channel provided that the SNR is of an acceptable degree. We can also

conclude that signal fidelity is a function of orthogonality between symbols. It

can be seen (by figure 9) that QPSK and BPSK both share the same BER

plot. If the symbol rate (bandwidth) is the same for BPSK and QPSK, QPSK

will perform considerably worse with the same signal power. This performance

consideration is alleviated by QPSKs higher symbol rate so it appears to have

the same BER as BPSK. Therefore, QPSK achieves the same bit error rate at

the cost of added signal power required to transmit.

10

Bibliography

[1] J. G. Proakis, M. Salehi, N. Zhou, and X. Li, Communication systems engineering, vol. 1. Prentice-hall Englewood Cliffs, 1994.

[2] D. Wackerly, W. Mendenhall, and R. Scheaffer, Mathematical statistics with

applications. Cengage Learning, 2007.

11

Question 1.m

close all

clear

clc

% sample size:

sample size = 1000000; % no of numbers to generate.

samples = zeros(1,sample size);

a = clock;

s1 = sum(a(1:6));

s2 = floor(prod(a(4:6)));

s3 = floor(prod(a(1:2)));

[ r , s1, s2, s3 ] = WichmannHill(s1,s2,s3);

samples(i) = r;

end

[y,x] = hist(samples, 100);

bar(x, y/sum(y)/(x(2)-x(1)));

hold on;

% Create three distribution objects with different parameters

pd1 = makedist('Uniform');

% Compute the pdfs

x = -0.5:.01:1.5;

pdf1 = pdf(pd1,x);

stairs(x,pdf1,'r','LineWidth',2);

ylim([0 1.1]);

hold off;

ylabel('Probability');

xlabel('Values');

legend('Simulated Distribution', 'Theoretical Distribution');

12

Question 2.m

close all

clear

clc

% sample size:

sample size = 10000000; % no of numbers to generate.

samples = zeros(1,sample size);

for i=1:sample size

r1 = MarsagliaBray();

samples(i) = r1;

end

[ y,x ] = hist(samples, sample size ./ 1000);

bar(x, y/sum(y)/(x(2)-x(1)));

hold on;

x = [-3:.1:3];

norm = normpdf(x,0,1);

plot(x,norm, 'r');

ylabel('Probability');

xlabel('Values');

legend('Simulated Distribution', 'Theoretical Distribution');

fprintf('Mean : %f \nVariance: %f\nStandard Deviation: %f\n', mean(samples), var(samples), std(sample

13

Question 3 BPSK.m

% question 3 new:

close all;

clear all;

clc;

% run loop for: minimum of n=100 bits have been run and min of 50 error

% bits detected.

SNRdB = -4:1:8 ; % run from -4 to 8 dB.

BERvalues = zeros(1,length(SNRdB));

noRunsEach = 20;

% seeds:

a = clock;

s1 = sum(a(1:6));

s2 = floor(prod(a(4:6)));

s3 = floor(prod(a(1:2)));

for i=1:length(SNRdB)

% for every dB of SNR we want to iterate through, we need to generate

% and test bits through the AWGN channel until we get min of 50 errors

% or min of 100 bits.

nErrorsAvg = 0;

for n=1:noRunsEach

nErrors = 0; % no errors for this SNR.

while (nBits < 100000 && nErrors < 50000)

%

%

[

s

r

%

%

generate a new bit:

randWich , s1, s2, s3 ] = WichmannHill(s1,s2,s3);

= 2 * (randWich > 0.5) - 1; % transmitted symbol.

= s + (getSigma(SNRdB(i), 1) * MarsagliaBray());

now we know we received r.

does the logical binary interpretation of r match that of s ?

if ( ((s+1)/2) ~= (r > 0) )

nErrors = nErrors + 1;

end

nBits = nBits + 1;

end

nErrorsAvg = nErrorsAvg + nErrors;

end

14

% errors so:

BERvalues(i) = (nErrorsAvg/ noRunsEach) / nBits;

disp('Finished an SNR level');

end

semilogy(SNRdB, BERvalues);

title('A bit-error rate curve for BPSK on an AWGN channel');

hold on;

semilogy(SNRdB,BERideal, '.r');

legend('Simulation', 'Theoretical');

xlabel('SNR (in dB)');

ylabel('BER');

15

Question 3 QPSK.m

% question 3:

%%%%%%%%

% QPSK %

%%%%%%%%

close all;

clear all;

clc;

% run loop for: minimum of n=100 bits have been run and min of 50 error

% bits detected.

SNRdB = -4:1:8 ; % run from -4 to 8 dB.

BERvalues = zeros(1,length(SNRdB));

noRunsEach = 20;

% seeds:

a = clock;

s1 = sum(a(1:6));

s2 = floor(prod(a(4:6)));

s3 = floor(prod(a(1:2)));

tTime = 0;

for i=1:length(SNRdB)

% for every dB of SNR we want to iterate through, we need to generate

% and test bits through the AWGN channel until we get min of 50 errors

% or min of 100 bits.

tic;

nErrorsAvg = 0;

for n=1:noRunsEach

nErrors = 0; % no errors for this SNR.

while (nBits < 100000 && nErrors < 50000)

%

%

[

[

%

generate two symbol components (Quadrature and In-phase)

randWich1 , s1, s2, s3 ] = WichmannHill(s1,s2,s3);

randWich2 , s1, s2, s3 ] = WichmannHill(s1,s2,s3);

now map these double digits to their const maps:

sI = 2 * (randWich2 > 0.5) - 1;

% add noise, NOTICE fbit changes.

r = (sR + sI*1i) + (getSigma(SNRdB(i), 1) * MarsagliaBray());

r = r + ((getSigma(SNRdB(i), 1) * MarsagliaBray())*1i); % add complex noise.

16

% demodulate:

dR = (sign(real(r))+1)/2; % sign function divides component by mag.

dI = (sign(imag(r))+1)/2; % and convert to binary rep.

% dR and dI now hold the demodulated components of the sent

% signal sR and sI after AWGN.

% does the logical binary interpretation of r match that of s ?

if ( ((sR+1)/2) ~= dR )

nErrors = nErrors + 1;

end

if ( ((sI+1)/2) ~= dI )

nErrors = nErrors + 1;

end

nBits = nBits + 2;

end

nErrorsAvg = nErrorsAvg + nErrors;

end

% errors so:

BERvalues(i) = (nErrorsAvg/ noRunsEach) / (nBits);

disp('Finished an SNR level');

tTime = (tTime + toc);

tAvg = tTime./i; % record the time taken for this run, estimate further runs.

fprintf('Estimated time to simulation completion: %d minutes.', round(tAvg*(length(SNRdB) - i)./6

end

BERideal=(1/2)*erfc(sqrt(10.(SNRdB/10))); % ideal BER.

semilogy(SNRdB, BERvalues);

title('A bit-error rate curve for QPSK on an AWGN channel');

hold on;

semilogy(SNRdB,BERideal, '.r');

legend('Simulation', 'Theoretical');

xlabel('SNR (in dB)');

ylabel('BER');

17

WichmannHill.m

function [r , x, y, z] = WichmannHill(x,y,z)

x = 171 * mod(x, 177) - 2 * (x / 177);

if ( x < 0 )

x = x + 30269;

end

y = 172 * mod(y, 176) - 35 * (y /176);

if (y < 0 )

y = y + 30307;

end

z = 170 * mod(z, 178) - 63 * (z / 178);

if ( z < 0 )

z = z+30323;

end

temp = x/30269.0 + y/30307.0 + z/30323.0;

r = mod( temp , 1.0 );

end

MarsagliaBray.m

% marsaglia-bray

function R1 = MarsagliaBray()

s = 1;

while ( s >= 1 )

v1 = 2 * rand - 1;

v2 = 2 * rand - 1;

s = v1*v1 + v2*v2;

end

L = sqrt(-2 * log(s) / s);

R1 = v1 * L;

end

getSigma.m

function [ outputS ] = getSigma( SNR , fbit )

% SNR in dB

% fbit for BPSK (=1) or QPSK (=2)

outputS = 1 ./ sqrt(power(10, SNR./10) * 2 * fbit);

end

18

ExtraBPSK.m

% BPSK with a pi/4 phase shift.:

close all;

clear all;

clc;

% run loop for: minimum of n=100 bits have been run and min of 50 error

% bits detected.

SNRdB = -4:1:8 ; % run from -4 to 8 dB.

BERvalues = zeros(1,length(SNRdB));

noRunsEach = 20;

constS1 = (1./sqrt(2)) + (1i./sqrt(2));

constS2 = (-1./sqrt(2)) + (-1i./sqrt(2));

% seeds:

a = clock;

s1 = sum(a(1:6));

s2 = floor(prod(a(4:6)));

s3 = floor(prod(a(1:2)));

for i=1:length(SNRdB)

% for every dB of SNR we want to iterate through, we need to generate

% and test bits through the AWGN channel until we get min of 50 errors

% or min of 100 bits.

nErrorsAvg = 0;

for n=1:noRunsEach

nErrors = 0; % no errors for this SNR.

while (nBits < 100000 && nErrors < 50000)

%

%

[

%

generate a new bit:

randWich , s1, s2, s3 ] = WichmannHill(s1,s2,s3);

round for bit representation.

s = (1./sqrt(2)) + (1i./sqrt(2)); % if bit is 1 then map to top right

else

s = (-1./sqrt(2)) + (-1i./sqrt(2)); %

end

r

r

%

%

%

= s + (getSigma(SNRdB(i), 1) * MarsagliaBray());

= r + (getSigma(SNRdB(i), 1) * MarsagliaBray())*1i; % complex noise.

now we know we received r.

does the logical binary interpretation of r match that of s ?

now for the comparative logic:

19

% that it is S1.

if ( abs( r - constS1 )2 < abs( r - constS2)2)

dR = (1./sqrt(2)) + (1i./sqrt(2)); % S1

else

dR = (-1./sqrt(2)) + (-1i./sqrt(2)); % S2

end

if (dR ~= s)

nErrors = nErrors + 1;

end

nBits = nBits + 1;

end

nErrorsAvg = nErrorsAvg + nErrors;

end

% at this point, we have a pretty good estimation of the number of

% errors so:

BERvalues(i) = (nErrorsAvg/ noRunsEach) / nBits;

disp('Finished an SNR level');

end

semilogy(SNRdB, BERvalues);

title('A bit-error rate curve for 45 degree phase-offset BPSK on an AWGN channel');

hold on;

semilogy(SNRdB,BERideal, '.r');

legend('Offset BPSK', 'Normal BPSK');

xlabel('SNR (in dB)');

ylabel('BER');

20

- PPt on Mimo Channel ModelingUploaded bysakanat5152
- BPSK signal generation and demodulation - MATLABUploaded byPavan Kumar P N
- UE Categories CQI Mapping TableUploaded bykmehdi
- 5g Ran2.0 Channel Management_1.1Uploaded byWawan Aji
- BER Performance of MIMO with Orthogonal Space Time Block Code Using FEC and Various Modulation TechniquesUploaded byInternational Journal for Scientific Research and Development - IJSRD
- ModulationUploaded bysushil4056
- Masters Thesis[1]Uploaded bysegroup
- VoLTE Modelling in AtollUploaded bythiepvt
- A Non-Cooperative Game Theoretical Approach For Power Control In Virtual MIMO Wireless Sensor NetworkUploaded byijujournal
- Contetnt Detailing BlankUploaded bynithansa
- WX Satelit SpectrumUploaded byAdemir Pajevic
- Digital ModulationUploaded byMohammad Mustafa Mahameed
- Hybrid ModulationUploaded byprabath jayasekara
- DOC2.docxUploaded byoko nana
- Lte Relay vs Lte RepeaterUploaded byMuhammad Rizki
- PARDHUUploaded byPardhu Yadav
- quiz1Uploaded byBryan Urquia
- Space-Time_Coding_STC(1).pdfUploaded bymerchant navy
- Chap 2 Bandpass Signaling-NotesUploaded byNoor Azreena Ab Wahab
- Why MSK is PopularUploaded byRockShayar Irfan Ali Khan
- ECSchap4.ExtraUploaded byDaniel Lo
- Introduction to Modulation and DemodulationUploaded bykksdkksd
- Introduction to Modulation and DemodulationUploaded byRaghuveerprasad Ippili
- ct_ws11_enUploaded byNguyễn Công Thành
- SSKUploaded byVvb Satyanarayana
- Business Academy AarhusUploaded byDaniel Matei
- 36 a Novel PAPR Reduction SchemUploaded byAhmed Abdelhaseeb
- AirFiber AF-11FX DSUploaded byLuis Perez
- 5.TRAINING PATHWAY TAHAP 2&3 baru.xlsUploaded byainon misman
- Joint Twofold-Iterative Channel Estimation AndUploaded bykhajarasool_sk

- dr Agustin_KH profil.pptxUploaded byBagus Gita Kusuma
- ConductionRod_ASEN3113_2005Uploaded byHassan Talha
- TTRUploaded byZvan76
- Https Tutorials Iq Harvard Edu R Rgraphics Rgraphics HTMLUploaded bycsscs
- Intraabdominal Pressure and Abdominal Compartment SyndromeUploaded bytaner_soysuren
- Taiwan Companies.pdfUploaded bykamal
- Dutch An Essential GrammarUploaded byAhmed Mahmoud
- Air Flow, Air Systems, Pressure, And Fan PerformanceUploaded bymuddog
- Financial Astrology – Astro Research OrganisationUploaded bysankarjv
- gilsinn_pres_gi11.pdfUploaded byAngelBlancoPoma
- Chinese Scalp Acupuncture for Cerebral Palsy in a Child Diagnosed With Stroke in UteroUploaded byGanga Singh
- Chemical Kinetic Modeling of Biofuel CombustionUploaded byMani Sarathy
- 30621127-000-3DT-EE-03584-000Uploaded byanbarasusivaprakasam
- InstructUploaded byAnderson Alvarado Rojas
- Lifo and Fifo MethodUploaded bySrinivas R. Khode
- hvdc UNIT V_opt.pdfUploaded byjayaraju_2002
- 051-17 Fazio.pdfUploaded bypafeest
- ProcessForce EnUploaded byRitesh H Rawal
- cement resumeUploaded byadhikarikingshuk
- TugasUploaded byDewa Ayu
- Edith Nomination Form 2012Uploaded byJoaquin Hernandez
- 1 classroom learning profileUploaded byapi-425144490
- Treatment of Uterine FibromaUploaded byPirasan Traditional Medicine Center
- OGTConference 19Nov13Uploaded bySaid Ahmed Salem
- PPT1Uploaded byYasir Memon
- ILD74 DatasheetUploaded byyampire
- Regional Delivery ModelUploaded bychrisbudhan
- Day2 OperationsUploaded byRiyadh Saleh
- Primus 1000 ExcelUploaded bySumeet Pandey
- Negative Impact of Technology Transfer on Host CountryUploaded byQuynh Huong Tran