15
Faculty of Engineering, Science and the Built Environment Department of Electrical, Computer and Communications Engineering Introduction to Data Communications (ECI-M-917) Assignment On Effect of Additive White Gaussian Noise (AWGN) on the Transmitted Data MSc Telecommunications and Computer Networks Engineering 2008-2009 3 Dec, 2008 Submitted to: Dr. Perry Xiao CD MSc Internet & Multimedia Engineering Engineering, Science and The Built Environment Submitted by: ATM Shafiul Alam Student Number: 2725579

Introduction to Data Communications - Dr. Atm Shafiul Alamatmshafiulalam.webs.com/IDC-Ex-3-additive_white_Gaussian_noise.pdf · Effect of Additive White Gaussian Noise (AWGN)

Embed Size (px)

Citation preview

Page 1: Introduction to Data Communications - Dr. Atm Shafiul Alamatmshafiulalam.webs.com/IDC-Ex-3-additive_white_Gaussian_noise.pdf · Effect of Additive White Gaussian Noise (AWGN)

Faculty of Engineering, Science and the Built Environment�Department of Electrical, Computer and Communications Engineering�

Introduction to Data Communications (ECI-M-917)

Assignment On

Effect of Additive White Gaussian Noise (AWGN) on the Transmitted Data

MSc Telecommunications and Computer Networks Engineering

2008-2009

3 Dec, 2008

Submitted to: Dr. Perry Xiao

CD MSc Internet & Multimedia Engineering

Engineering, Science and The Built Environment

Submitted by: ATM Shafiul Alam

Student Number: 2725579

Page 2: Introduction to Data Communications - Dr. Atm Shafiul Alamatmshafiulalam.webs.com/IDC-Ex-3-additive_white_Gaussian_noise.pdf · Effect of Additive White Gaussian Noise (AWGN)

Abstract:

Additive White Gaussian Noise (AWGN) is common to every communication

channels, which is the statistically random radio noise characterized by a wide

frequency range with regards to a signal in the communications channel. This

assignment describes two aspects of telecommunications engineering: i) the basic

understanding of MATLAB, and ii) the effect of Additive white Gaussian Noise

(AWGN) on the transmitted data using based-band simulation under different values

of signal-to-noise (SNR) ratio with this tool. In my experiment, I use MATLAB tools

to generate the noise sequence, the data sequence, the both data and noise sequence

and add them together, recover signal from noisy received data and calculate noise

power, calculate SNR and BER and then plot them with different SNR values.

Finally, I draw a conclusion from my experiment.

Page 3: Introduction to Data Communications - Dr. Atm Shafiul Alamatmshafiulalam.webs.com/IDC-Ex-3-additive_white_Gaussian_noise.pdf · Effect of Additive White Gaussian Noise (AWGN)

Introduction:

The random nature of noise in time domain will, on occasions, cause a transmitted symbol to be distorted such that the receiver interprets it as a different symbol in the modulation scheme alphabet. Under these circumstances, a given average level of AWGN introduces an average number of symbol errors where each symbol error causes one or more bit errors at output of the receiver. The errors may be characterized by a bit error rate (BER).[1]

Important Terminologies:

Additive White Gaussian Noise (AWGN)

A basic and generally accepted model for thermal noise in communication channels, is the set of assumptions that

• the noise is additive, i.e., the received signal equals the transmit signal plus some noise, where the noise is statistically independent of the signal.

• the noise is white, i.e, the power spectral density is flat, so the autocorrelation of the noise in time domain is zero for any non-zero time offset.

• the noise samples have a Gaussian distribution.

Mostly it is also assumed that the channel is Linear and Time Invariant. The most basic results further assume that it is also frequency non-selective. [6]

Additive White Gaussian Noise (AWGN) is the statistically random radio noise characterized by a wide frequency range with regards to a signal in a communications channel.

Average Signal-to-Noise Ratio (SNR)

Signal-to-Noise (SNR) is probably the most common and well understood performance measure characteristic of a digital communication system. Most often this is measured at the output of the receiver and is thus directly related to the data detection process itself.

Signal-to-noise ratio is a term for the power ratio between a signal (meaningful information) and the background noise: [3]

As

An

2

=

where Ps is average signal power and Pn is average noise power, and A is root mean square (RMS) amplitude for signal and noise (for example, typically, RMS voltage). Both signal and noise power (or amplitude) must be measured at the same or equivalent points in a system, and within the same system bandwidth.

Because many signals have a very wide dynamic range, SNRs are usually expressed in terms of the logarithmic decibel scale. In decibels, the SNR is, by definition, 10 times the logarithm of the power ratio. If the signal and the noise is measured across the same impedance then the SNR can be obtained by calculating 20 times the base-10 logarithm of the amplitude ratio:

SNR dB( ) 10 logPs

Pn

⋅=

20 logAs

An

⋅=

SNRPs

Pn=

Page 4: Introduction to Data Communications - Dr. Atm Shafiul Alamatmshafiulalam.webs.com/IDC-Ex-3-additive_white_Gaussian_noise.pdf · Effect of Additive White Gaussian Noise (AWGN)

Bit Error Rate (BER):

Bit error Rate, sometimes bit error ratio (BER) is the most fundamental measure of system performance. That is, it is a measure of how well bits are transferred end-to-end. While this performance is affected by factors such as signal-to-noise and distortion, ultimately it is the ability to receive information error-free that defines the quality of the link

Bit error ratio (BER) is the number of bits received in error, divided by the total number of bits received.

It is the percentage of bits that have errors relative to the total number of bits received in a transmission, usually expressed as ten to a negative power. For example, a transmission might have a BER of 10-5, meaning that on average, 1 out of every of 100,000 bits transmitted exhibits an error. The BER is an indication of how often a packet or other data unit has to be retransmitted because of an error. If the BER is higher than typically expected for the system, it may indicate that a slower data rate would actually improve overall transmission time for a given amount of transmitted data since the BER might be reduced, lowering the number of packets that had to be resent. [7]

Phase Shift Keying (PSK):

Phase-shift keying (PSK) is a method of digital communication in which the phase of a transmitted signal is varied to convey information. There are several methods that can be used to accomplish PSK.

BPSK (also sometimes called PRK, Phase Reversal Keying) is the simplest form of PSK. It uses two phases which are separated by 180° and so can also be termed 2-PSK. It does not particularly matter exactly where the constellation points are positioned, and in this figure they are shown on the real axis, at 0° and 180°. This modulation is the most robust of all the PSKs since it takes serious distortion to make the demodulator reach an incorrect decision. It is, however, only able to modulate at 1 bit/symbol (as seen in the figure) and so is unsuitable for high data-rate applications when bandwidth is limited.

(a) (b)

Figure: Constellation diagram for (a) BPSK and (b) QPSK.

The bit error rate (BER) of BPSK in AWGN can be calculated as:

or

Since there is only one bit per symbol, this is also the symbol error rate.

In the presence of an arbitrary phase-shift introduced by the communications channel, the demodulator is unable to tell which constellation point is which. As a result, the data is often differentially encoded prior to modulation.

Page 5: Introduction to Data Communications - Dr. Atm Shafiul Alamatmshafiulalam.webs.com/IDC-Ex-3-additive_white_Gaussian_noise.pdf · Effect of Additive White Gaussian Noise (AWGN)

QPSK (sometimes known as quaternary or quadriphase PSK, 4-PSK, or 4-QAM), uses four points on the constellation diagram, equispaced around a circle. With four phases, QPSK can encode two bits per symbol, shown in the diagram with Gray coding to minimize the BER — twice the rate of BPSK. Analysis shows that this may be used either to double the data rate compared to a BPSK system while maintaining the bandwidth of the signal or to maintain the data-rate of BPSK but halve the bandwidth needed. [3]

Experimental Description

Considering the procedure of Experiment#03, I make the answers of the given questions which are given below:

Q1. What do you see when each command is entered? i. A = [1 3 5] ii. B = [2; 4; 6]

Answer: The first command creates a 1-by-3 matrix and the second command creates a 3-by-1 matrix as:

Q2. What is the difference in between the answers of the commands bellow? Can you explain why? Confirm your answer by showing the mathematical procedure here.

i. C= A*B ii. D= B*A

Answer:

According to the definition of matrix multiplication, the number of columns of the first matrix must be the same as the number of rows of the second matrix.

Formally, for

,

then

where the elements of A*B are given by

for each pair i and j with 1 ≤ i ≤ m and 1 ≤ j ≤ p. The algebraic system of "matrix units" summarizes the abstract properties of this kind of multiplication.

>> A= [1 3 5] A = 1 3 5

>> B= [2; 4; 6] B = 2 4 6

i. >> C= A*B C = 44

ii. >> D= B*A D =

2 6 10 4 12 20 6 18 30

Page 6: Introduction to Data Communications - Dr. Atm Shafiul Alamatmshafiulalam.webs.com/IDC-Ex-3-additive_white_Gaussian_noise.pdf · Effect of Additive White Gaussian Noise (AWGN)

Since A vR1x3, B vR3x1, the resultant matrix of A*B must be the 1-by-1 matrix and the resultant matrix of B*A must be the 3-by-3 matrix. This is why the result of the matrices multiplications of A*B and B*A are different.

Q-3: Which answer is valid and which is not- explain.

Answer:

The command (i) is valid. The command ‘ones’ creates a 3-by-3 matrix of ones.

According to matrix addition, the matrices must agree with dimension. The command (ii) is not valid because E is matrix of dimension 3-by-3, but B is 3-by-1.

This is valid because both E and D matrices have the same dimension.

N.B:

i) ONES -Ones array.

ONES (N) is an N-by-N matrix of ones.

ONES (M, N) or ONES([M,N]) is an M-by-N matrix of ones.

ii) CLEAR -clear variables and functions from memory.

CLEAR ALL -removes all variables, global, functions and MEX links.

iii) RANDN -normally distributed random numbers.

R = RANDN(N) returns an N-by-N matrix containing pseudo-random value drawn from a normal distribution with mean zero and standard deviation one.

RANDN(M,N) or RANDN([M,N]) returns an M-by-N matrix.

i. >> E=ones(3)

E =

1 1 1

1 1 1

1 1 1

ii. >> X=E+B

??? Error using ==> plus

Matrix dimensions must agree.

iii. >> Y=E+D

Y =

3 7 11

5 13 21

7 19 31

Page 7: Introduction to Data Communications - Dr. Atm Shafiul Alamatmshafiulalam.webs.com/IDC-Ex-3-additive_white_Gaussian_noise.pdf · Effect of Additive White Gaussian Noise (AWGN)

iv) RAND -Uniformly distributed pseudo-random numbers.

R = RAND (N) returns an N-by-N matrix containing pseudo-random values drawn from a uniform distribution on the unit interval.

RAND(M,N) or RAND([M,N]) returns an M-by-N matrix.

v) MEAN Average or mean value.

For vectors, MEAN(X) is the mean value of the elements in X.

vi) VAR Variance.

For vectors, Y = VAR(X) returns the variance of the values in X.

Now run the following command: >> whos

Name Size Bytes Class A 1x3 24 double array B 3x1 24 double array C 1x1 8 double array D 3x3 72 double array E 3x3 72 double array Y 3x3 72 double array ans 3x3 72 double array

>>clear all >> N=randn (1, 10) N = -0.1867 0.7258 -0.5883 2.1832 -0.1364 0.1139 1.0668 0.0593 -0.0956 -0.8323 >> M=rand (1, 10) M = 0.1576 0.9706 0.9572 0.4854 0.8003 0.1419 0.4218 0.9157 0.7922 0.9595

Q4. Can you tell the difference between these two commands in generating N and M? Answer: The differences between the randn and ran commands are that the sequence of numbers produced by randn is determined by the internal state of the uniform pseudorandom number generator (a normal distribution with mean zero, variance one and standard Deviation one- may have some negative values) whereas the sequence of numbers produced by rand is determined by the internal state of the uniform pseudorandom number generator (on the interval [0, 1]).

Q5. What is the value of mean and variance for N? (Note that the ‘randn’ command will give nominal value of zero mean and unit variance - View the ‘randn’ command using ‘help randn’.). Is you answer close to this range?

Answer: The mean value and the variance of N are not the same of their nominal values, 0 and 1, respectively, near to these but not so close.

>> var (N) ans = 0.6905

>> mean (N) ans = -0.2797

>> N=randn(1,1000); >> mean(N) ans = 0.0210

>> var(N) ans = 0.9997

Page 8: Introduction to Data Communications - Dr. Atm Shafiul Alamatmshafiulalam.webs.com/IDC-Ex-3-additive_white_Gaussian_noise.pdf · Effect of Additive White Gaussian Noise (AWGN)

Q.6 What is the value of mean and variance for N now? Compare with pervious one and give explanation. (If you mean and variance is still not close to the nominal value, increase the number to 10000.)

Answer: Increase the size of N matrix to 1000 gives the mean and variance values of N close to their nominal value. If we increase more, then it gives us more accurate value. Now considering the 1000 random numbers in N, this can be modelled as AWGN noise and then plot this by using the ‘plot’ command and the figure as follows: >> plot(N)

Figure-1: 1000 random numbers treat as AWGN.

The figure contains random number from both positive and negative values that has highest concentration or ‘mean’ at zero – Gaussian distribution.

Histograms are useful to visually determine how closely a set of data fits a desired distribution. Matlab graphically draws the histogram from our data and desired distribution. We may easily observe histograms of data from a near perfect distribution by using Matlab’s random number feature to generate random data from any distribution and plot the histogram.[5]

Now, create the histogram of N in order to observe its distribution by:

>> figure >> hist(N,20)

(a) (b)

Figure-2: Histogram of 1000 random numbers with mean 0.0210 and variance 0.9997- (a) bins-20, (b) bins-100.

The above figures illustrate that all of the data fits the Gaussian distribution almost perfectly (red curve).

Now, we generate random noise (AWGN) shown in Fig-3 in time domain and the noise in frequency domain is shown in Fig-4. The generated noise file is attached at end of the assignment as Noise.dat.

Page 9: Introduction to Data Communications - Dr. Atm Shafiul Alamatmshafiulalam.webs.com/IDC-Ex-3-additive_white_Gaussian_noise.pdf · Effect of Additive White Gaussian Noise (AWGN)

Figure-3: Noise (AWGN) in time domain (Noisegen.m).

Figure-4: Single-sided PSD estimate of noise (in frequency domain) (Noisegen.m).

The data sequence (50) is now generated by using randsrc command:

TX_data = randsrc(50,1) which generates a 50-by-1 matrix, each of whose entries independently takes the value -1 with probability 1/2, and 1 with probability 1/2. The sequence of data is attached at end of the assignment. The graph for the generated data sequence is show in Fig-5 and Fig-6 is for the stair step plot of the data sequence.

Figure-5: Generated data sequence by randsrc

command (Bitgen.m).

Figure-6: Generated data sequence by stairs

command (Bitgen.m)

Now we generate the both data and noise sequence and add them together. Hence, we get the signal at the receiver as the summation of the transmitted data sequence and the AWGN noise added by the channel. The transmitted data, noise and the received data sequence are attached at the end of the end of the assignment. The graphs for the TX data sequence, noise sequence and the RX data sequence with considering the noise power level Pn= 0.1 are given below (Fig-7):

(a)

(c)

Page 10: Introduction to Data Communications - Dr. Atm Shafiul Alamatmshafiulalam.webs.com/IDC-Ex-3-additive_white_Gaussian_noise.pdf · Effect of Additive White Gaussian Noise (AWGN)

(b)

(d)

(e)

Figure-7: With noise power level Pn= 0.1 (a) AWGN (b) Transmitted Data Sequence , (c) Transmitted Data Sequence-stair steps, (d) Received Data Sequence, (e) Received Data Sequence-stair steps

(Noise_on_data.m). Q7. Write down your observation as you change the value of the noise amplitude, Pn in file-3. Comment on the effect of noise level on the transmitted and received data.

Answer: If we increase the noise power level Pn= 0.5, the received data sequence is different from the transmitted data sequence, but similar to noise sequence shown below (Figure-8).

(a)

(c)

(b)

(d)

Page 11: Introduction to Data Communications - Dr. Atm Shafiul Alamatmshafiulalam.webs.com/IDC-Ex-3-additive_white_Gaussian_noise.pdf · Effect of Additive White Gaussian Noise (AWGN)

(e)

Figure-8: With noise power level Pn= 0.5 (a) AWGN (b) Transmitted Data Sequence , (c) Transmitted Data Sequence-stair steps, (d) Received Data Sequence, (e) Received Data Sequence-stair steps

(Noise_on_data.m)

Note: Y = sign(X) returns an array Y the same size as X, where each element of Y is:

1 if the corresponding element of X is greater than zero

0 if the corresponding element of X equals zero

-1 if the corresponding element of X is less than zero

In Sig_recov1.m, we set noise power level, Pn to 0.25, and then recover the received data sequence by using the signum function and calculate the bit error ratio (BER) as: Err_symbol = abs(recover_data-TX_data); Total_err = length(find(Err_symbol)); BER = Total_err/N

Under these command, we get for Pn = 0.25 BER = almost zero.

Now, we set the signal power level, Ps to 1.5, then BER = 0.0648

Q8. According to the programs, how is signal recovery obtained in each case? Comment of the difference.

Q9. According to both programs how is BER obtained? Explain in detail.

Answer to Q-8&9: After recovering the received signal with different Ps and Pn, we get different bit error rates. We summarises in Table-1:

The formulae to calculate the BER are used here as follows:

In Case-I:

In this case, AWGN is generated by using ‘randn’ function and multiplied by noice power data sequence is generated by using ‘randsrc’ function. Received data is obtained by adding AWGN and data bit generated earlier. ‘sign’ function is used to demodulate and recover data in noisy condition. ‘abs’ function is used to find absolute value and complex magnitude. To calculate the Bit Error Rate (BER):

Err-symbol=abs(recover_data-TX_data) Total_err=length(find(Err_symbol)) BER=Total_err/N In Case-II:

In this case, AWGN is generated by using ‘randn’ function and multiplied by signal power data sequence is generated by using ‘randsrc’ function and multiplied by signal power. Received data is obtained by adding AWGN and data bit generated earlier. ‘sign’ function is used to demodulate and

Page 12: Introduction to Data Communications - Dr. Atm Shafiul Alamatmshafiulalam.webs.com/IDC-Ex-3-additive_white_Gaussian_noise.pdf · Effect of Additive White Gaussian Noise (AWGN)

recover data in noisy condition and then multiplied by signal power. ‘abs’ function is used to find absolute value and complex magnitude.

To calculate the Bit Error Rate (BER)

Err-symbol=abs(recover_data-TX_data); Total_err=length(find(Err_symbol)); BER=Total_err/N Table-1:

Case-I Case-I Pn BER

(Sig_recov1.m) Ps BER

(Sig_recov2.m) 0.25 0.0000 0.0 0.4604 0.30 0.0004 0.50 0.3196 0.35 0.0022 1.00 0.1600 0.40 0.0094 1.50 0.0644 0.45 0.0124 2.00 0.0186 0.50 0.0212 2.50 0.0052 0.55 0.0286 3.00 0.0018 0.60 0.0418 3.50 0.0012 0.65 0.0568 4.00 0.0004 0.70 0.0854 4.50 0.0000

By using this table, we draw the graphs for it.

BER vs Pn

0

0.02

0.04

0.06

0.08

0.1

0.25

0.35

0.45

0.55

0.65

Pn

BER

BER

(a)

BER vs Ps

0

0.1

0.2

0.3

0.4

0.5

0 0 1 1 2 2 3 3 4 4

Ps

BER

BER

(b)

Figure-9: Performance of AWGN channel with BER by Pn.

From the above table, we can conclude that if the noise power level increased, the bit error rates (BER) may also be increased, whereas the BER is increased while its signal power level is decreased. Hence, the receiver can not recover the error if the noise power level is greater than the signal power level. Q11. Run the program and write down your observation.

Answer: After running the program (SNRvsBER.m) -this is SNR versus BER plot for different SNR value; the graph for this is look like in Figure-10: From the above graph BER goes down for increased signal power (Blue line) and the green line shows the SNR versus Estimated values of Bit Error probability which also follows the same trends.

Page 13: Introduction to Data Communications - Dr. Atm Shafiul Alamatmshafiulalam.webs.com/IDC-Ex-3-additive_white_Gaussian_noise.pdf · Effect of Additive White Gaussian Noise (AWGN)

Figure-10: SNR vs BER for different SNR

values.

Figure-11: Actual SNR vs BER for BPSK

demodulation.

Q12. Change the value of N in each time from 1)10000 to 2)100000 and to 3)1x106. Did you see any difference when N is increased to different value? Can you explain why?

Answer: For changing the values of N (10000, 100000, 1x106) and after running the program, it makes error like this:

>> SNRvsBER_test All_SNR_dB = 0

??? Error using ==> rand Out of memory. Type HELP MEMORY for your options.

Error in ==> randsrc at 157 r = rand(m,n);

Error in ==> SNRvsBER_test at 25 TX_data = Ps*randsrc(N);

>> SNRvsBER_test ??? Error using ==> randn

>> SNRvsBER_test ??? Error using ==> randn Maximum variable size allowed by the program is exceeded.

Error in ==> SNRvsBER_test at 11 AWGN = randn(N); %complex gaussian noise Maximum variable size allowed by the program is exceeded.

Error in ==> SNRvsBER_test at 11 AWGN = randn(N); %complex gaussian noise

These errors are for the allocation of memory, i.e size of array. At the time of run the program, the computer has:

>> memory

Maximum possible array: 783 MB (8.208e+008 bytes) * Memory available for all arrays: 1478 MB (1.550e+009 bytes) ** Memory used by MATLAB: 290 MB (3.036e+008 bytes) Physical Memory (RAM): 3326 MB (3.487e+009 bytes)

* Limited by contiguous virtual address space available. ** Limited by virtual address space available.

Q13. Run file-7 and compare it to previous case using file-6. Are they similar? If not, why do you think in your opinion the difference exists?

Answer: After running the program (AWGN_bound.m) -this is actual AWGN bound condition on signal corrupted by noise; the graph for this is look like in Figure-11:

From the graph in Figure-11, we can see that BER decreases slowly with increasing SNR. Q14. Show the modification and the program to include imaginary number.

Answer: The modification of the program, which included at the end of the assignment (AWGN_bound_QPSK.m) gives the following figures (Fig-12).

Page 14: Introduction to Data Communications - Dr. Atm Shafiul Alamatmshafiulalam.webs.com/IDC-Ex-3-additive_white_Gaussian_noise.pdf · Effect of Additive White Gaussian Noise (AWGN)

(a)

(c)

(b)

(d)

Figure-12: (a)-QPSK Constellation, (b)- BER or SER vs SNR, (c)- QPSK symbols, (d)- Rayleigh Fading.

Conclusion: In this report, the basic understanding of MATLAB is provided such the use of different communication functions and by using formula for BER, we see the effect of Additive White Gaussian Noise on transmitted data. From the above analysis, SNR can improve while the signal power is more than the noise power. We see the effect of AWGN for both BPSK and QPSK modulation techniques. In both cases, we conclude the same thing as above. %--------------------------------------% AWGN_bound_QPSK.m %-------------------------------------- clear all randn('state',0); %keeps bits the same on reruns nr_data_bits=1000000;% 0's and 1's, keep even number-Takes ~1 minute for a run of 1 million %64000 allows bits and complex values to be shown in array editor nr_symbols=nr_data_bits/2; b_data = (randn(1, nr_data_bits) > .5);%random 0's and 1's b = (b_data); % d = complex-valued QPSK symbols 0.70711 + 0.70711i, etc d=zeros(1,length(b)/2); %definition of the QPSK symbols using Gray coding.

for n=1:length(b)/2 p=b(2*n); imp=b(2*n-1); if (imp==0)&&(p==0) d(n)=exp(j*pi/4);%45 degrees end if (imp==1)&&(p==0) d(n)=exp(j*3*pi/4);%135 degrees end if (imp==1)&&(p==1) d(n)=exp(j*5*pi/4);%225 degrees end if (imp==0)&&(p==1) d(n)=exp(j*7*pi/4);%315 degrees end end qpsk=d; SNR=0:30;%change SNR values

BER1=[]; SNR1=[]; SER=[]; SER1=[]; sigma1=[]; for SNR=0:length(SNR);%loop over SNR-change SNR values (0,5,10 etc dB) sigma = sqrt(10.0^(-SNR/10.0)); sigma=sigma/2;%Required a division by 2 to get close to exact x=randn(1,nr_symbols); y=randn(1,nr_symbols); ray=sqrt(0.5*(x.^2+y.^2));%variance=0.5-Tracks theoritical PDF closely mpqpsk=qpsk.*ray; %add noise to QPSK Gray coded signals with multipath mpsnqpsk=(real(mpqpsk)+sigma.*randn(size(mpqpsk))) +i.*(imag(mpqpsk)+sigma.*randn(size(mpqpsk))); r=mpsnqpsk %more complex algorithim detection method bhat=[real(r)<0;imag(r)<0];%detector bhat=bhat(:)'; bhat1=bhat;%0's and 1's ne=sum(b~=bhat1);%number of errors BER=ne/nr_data_bits; SER=ne/nr_symbols;%consider this to be Ps=log2(4)*Pb=2*Pb SER1=[SER1 SER]; BER1=[BER1 BER]; SNR1=[SNR1 SNR]; end figure(1);

Page 15: Introduction to Data Communications - Dr. Atm Shafiul Alamatmshafiulalam.webs.com/IDC-Ex-3-additive_white_Gaussian_noise.pdf · Effect of Additive White Gaussian Noise (AWGN)

plot(d,'o');%plot constellation without noise axis([-2 2 -2 2]); grid on; xlabel('real'); ylabel('imag'); title('QPSK constellation'); figure(2); semilogy(SNR1,BER1,'*',SNR1,SER1,'o'); grid on; xlabel('SNR=Eb/No(dB)'); ylabel('BER/SER'); title('Simulation of BER/SER for QPSK with Gray coding( Rayleigh multipath and AWGN)'); legend('BER-simulated','SER-simulated'); figure(3) plot(real(qpsk));

grid on; axis([1 200 -2 2]); title('QPSK symbols'); xlabel('symbols');ylabel('Amplitude'); figure(4) plot(20*log10(abs(ray))); grid on; axis([1 200 -30 10]); title('Rayleigh Fading Envelope(variance=0.5)');

xlabel('symbols');ylabel('Amplitude/RMS(dB)');

References: [1]- Everett, J., 1992. VSATs: Very Small Aperture Terminals, IET-543 pages. [2]- Simon, M., Alouini, M., 2005. Digital Communication Over Fading Channels, Wiley-Interscience.

[3]- http://en.wikipedia.org/wiki/

[4]- Haykin, S. S., 2001. Communication systems, 4th edition, New York ; Chichester : Wiley.

[5] http://www.nuhertz.com/statmat/histograms.html

[6] http://wireless.per.nl/reference/chaptr05/digimod/awgn.htm

[7]- http://www.cs.man.ac.uk/~barry/mydocs/myCs6242/Coursework/Matlabwork/MOBMATLABwork.doc

[8]- Stallings, William, 2007. Data and computer communications, 8th Edition, Upper Saddle River, N.J. : Pearson/Prentice Hall.

[9]- Proakis, John G., 1995. Digital communications, 3rd Edition, New York ; London : McGraw-Hill.

[10]- Glover, Ian, 1998. Digital communications, London : Prentice Hall.