Posted: February 5th, 2015

Project 1: Modeling Random Noise in Communications Systems

Paper, Order, or Assignment Requirements

 

 

I do have a project dealing with Discrete Data Transmission Over the Binary Symmetric Channel (BSC). Solve just Exercise 1 : from 1 to 20 questions as well as Matlab code.

EE 526: Random Signals & Systems, Spring 2015 Project 1: Modeling Random Noise in Communications Systems Each section of Project 1 has an associated due date, beginning with Exercise 1, due Thursday, Feb. 12 by 5 PM. Late Project 1 section reports are accepted for one week past their due date at a penalty of 20% off. One late section of Project 1 will be allowed without penalty, but not the last section, Exercise 4. The last section of Project #1 report is due on Thursday, March 6, 2015, by 5 PM for full credit. You may email your Project #1 reports to me at [email protected] or turn in a printout in class. 1 Introduction Project #1 is to be done individually, although student interaction is encouraged. The project report must be done individually, and may be handed in as hard copy or emailed in electronic form to the instructor. You may use Matlab, Mathematica or C/C++ for the programming portions. 1.1 Project Reports Show all your work! If you use Matlab to solve any of the project questions, please include your Matlab code as well as any requested results or data plots in your report. Similarly, if you use C/C++ or Mathematica, please include your C/C++ or Mathematica code, results and plots. Also include all input used and output obtained from your code in answer to any project questions. If you are unable to solve a project problem, or your code does not work, please include whatever work you have done in your project report so that I can give you partial credit for the work you did do. I encourage you to start your work on each section of Project 1 as early as possible. 2 Discrete Data Transmission Over the Binary Symmetric Channel (BSC) A transmitter sends binary data xi ∈ {0, 1} across a binary symmetric channel (BSC) or bit-flipping channel. The BSC adds binary noise ni ∈ {0, 1} to each data bit xi . The binary noise n equals 1 with probability ρ; thus P(n = 1) = ρ; P(n = 0) = 1−ρ. The receiver then receives noisy data bits ri = xi +ni . If ni = 1, the received bit is flipped from the transmitted bit; if ni = 0, the bit is received correctly. The receiver then estimates the original transmitted bit as ˆxi = ri . The receiver is actually applying the maximum-likelihood principle by choosing the value of xi that maximizes P(xi |ri), assuming equally likely xi and ρ ≤ 0.5. Exercise 1: Your report for Project 1, Exercise 1 is due Thursday, Feb 12, by 5 PM for full credit. Late Exercise 1 will be accepted until Thursday, Feb 19, by 5 PM. 1. What is the set of possible values for each xi , Sx? What is the set of possible values for each ni , Sn? What is the set of possible values for each ri , Sr? 2. Assume all values of xi are equally likely. What is the PMF of xi , Px(xi)? 3. What is the conditional probability P(ri |xi)? 4. Find the PMF of ri , PR(ri), using the law of total probability. 5. Write an equation that finds the conditional probability P(xi |ri) from P(ri |xi), using Bayes’ theorem. 6. Show that P(xi |ri) = P(ri |xi) when all values of xi are equally likely. 1EE 526, Random Signals & Systems: Project 1, Spring 2015 2 7. Write a function that generates a random sequence of L random bits x, where each xi ∈ {0, 1}. The probability P(xi = 1) = ρ. Your inputs should include the length of the sequence L, and the probability P(x = 1) = ρ. Your output should be the random sequence x. Include your function in your report. 8. Using the above function, generate a random sequence x of length L = 100 where xi is uniformly likely to be 0 or 1 (P(xi = 0) = P(xi = 1) = 1/2). Show the commands you used. 9. What are the experimental (not expected) values of Px(1) and Px(0)? Include all commands and results. 10. What is the experimental value of the mean of x, µx? Include your command(s) in your report. What is the expected value of x, E[x], found analytically? 11. Now generate a random binary noise sequence n, also of length L = 100, with ρ = 0.2. What are the experimental values of Pn(1) and Pn(0)? Include your commands in your report. 12. Assume that x is transmitted across a BSC with ρ = 0.2. The received sequence r = x+n. Generate r using x and n found above, including your commands in the report. What do you expect P(ri = 1|xi = 1) to be? What do you expect P(ri = 1|xi = 0) to be? 13. Write a function to calculate the experimental values of P(ri |xi) for ri ∈ {0, 1} and xi ∈ {0, 1}, based on your r and x values generated in the previous step. Include your function in your report. 14. Using your function from the previous step, calculate the experimental (not expected) values for P(ri = 1|xi = 1) and P(ri = 1|xi = 0), using your r and x generated previously. Similarly, calculate the experimental values for P(ri = 0|xi = 1) and P(ri = 0|xi = 0)? Show your results for all four conditional probabilities. Are the results what you expected? Why or why not? 15. Redo steps 8-14 for L = 10, 000 (you don’t have to redo step 13). Show all results. Do your experimental results match your expected results better now? 16. Your receiver should provide an estimate ˆxi of the original transmitted bit xi , based on the received bit ri . Use the maximum-likelihood (ML) estimate: choose ˆxML,i to be the value of xi that maximizes (gives the largest value of) p(ri |xi). That is, xˆML,i = arg max x∈{−1,1} p(ri |xi). What is your receiver’s maximum-likelihood (ML) estimate ˆxML,i? Hint: Your ML estimate will be based on ri , and will be very simple. 17. Make your receiver’s output decision ˆxi the ML estimate ˆxML,i. Include your code; this should be a single line of code. 18. The maximum a posteriori (MAP) estimate ˆxMAP,i chooses ˆxi to be the value of xi that maximizes p(xi |ri). If the BSC has equally likely xi , is the MAP estimate ˆxMAP,i the same as the ML estimate ˆxML,i? Show whether this is true or not; Bayes’ theorem will help you in this. 19. Write a function that calculates the bit error rate (BER) between an originally transmitted binary sequence x and the estimate of that sequence ˆx. The bit error rate is measured as the number of bits in error divided by the total number of bits in the sequence. Include your function in the report. 20. What is the bit error rate found from your previously-generated r and x of L = 10, 000, using your maximumlikelihood estimator function (a single line of code) and BER function? Show your output from your BER function as well as the commands you used to run your functions.EE 526, Random Signals & Systems: Project 1, Spring 2015 3 3 Gaussian-Distributed Noise One common model for noise in communications systems is that of additive white Gaussian noise (AWGN). Additive refers to the fact that the noise adds to the signal of interest; white refers to the fact that the noise has constant power at all frequencies (similar to ’white’ light). Gaussian indicates that the noise n is Gaussiandistributed; it is also zero-mean, so E[n] = µn = 0. Thermal noise at the receiver, caused by the movement of electrons, is well-modeled by AWGN. This is often represented by the receiver noise figure (RNF) in the spec sheets for communications receivers. Exercise 2: Your report for Project 1, Exercise 2 is due Thursday, Feb 19, by 5 PM for full credit. Late Exercise 2 will be accepted until Thursday, Feb 26, 5 PM with -20% late penalty. 1. Write a function that will generate a random sequence n, where n is Gaussian-distributed, with zero mean and variance µn = 0, σ2 n . The Matlab function randn() generates a standard normal distribution with mean 0 and variance 1. Your function should take as input the sequence length L and either the desired variance σ 2 n or the desired standard deviation σn. Your function shuld output the sequence n. Include your function in this report. 2. Write an equation for the probability density function (PDF) for a zero-mean Gaussian-distributed random variable n with variance σ 2 n . 3. Generate a Gaussian-distributed sequence n of length L = 1000, with zero mean and variance σ 2 n = 2. What is the experimental value for the mean of n, µn? What is the experimental value for the variance σ 2 n ? Include the commands you used to find the experimental values of the mean and variance of n. 4. Make a histogram of n. A histogram separates the values of n into bins; then one counts how many values of n fell into bin 1 (which might go from −∞ to -10), how many in bin 2 (maybe from -10 to -5), how many in bin 3, (say from -5 to 0), etc. In the previous example, the bin size is quite large for each bin. For your histogram, your bins should run from -20 to +20, and each bin should have width 0.1. If you wish, you may create edge bins that run from −∞ to -20, and from +20 to ∞. Matlab has a hist() command that will generate a histogram. For more information, use help hist in Matlab. 5. Let b equal the bin size (or bin interval) that you used. Divide the histogram values by L ∗ b, to get an approximation of the Gaussian PDF. 6. Plot your approximate PDF of n. Does it look like a zero-mean Gaussian PDF? Include your plot in this report. 7. Repeat steps 3-6 for another random noise sequence, n1, of length L = 100, 000, also with zero mean and variance σ 2 n = 2. 4 Communication in AWGN One common signalling format, or data modulation, used in communications systems, is BPSK (binary phaseshift-keying). This is an equal-magnitude format where the information is contained in the phase; binary indicates there are two possible values. A BPSK signal can be either -1 or 1; thus the magnitude is always 1, while the phase is either 0 or π radians. The data mapping we will use to move from binary (0,1) data x to a BPSK signal w will be binary xi BPSK wi 0 ↔ -1 1 ↔ 1EE 526, Random Signals & Systems: Project 1, Spring 2015 4 If we model the link between transmitter and receiver as an AWGN channel, then the received signal yi is yi = wi + ni , where n is a zero-mean Gaussian-distributed random variable with variance σ 2 n . The receiver must decide what value of wi (or xi) was originally sent, based on the received yi and knowledge of the channel variance σ 2 n . The optimal decision (the one that maximizes the probability that the estimated ˆwi = wi) is found by using the maximum a posteriori (MAP) estimate ˆwMAP,i: wˆMAP,i = arg max w∈{−1,1} p(wi |yi). (1) However, for equally-likely wi , we can show that the MAP estimate is equivalent to the ML estimate ˆwML,i, which maximizes p(yi |wi): wˆMAP,i = arg max w∈{−1,1} p(wi |yi); = arg max w∈{−1,1} p(yi |wi)p(wi) p(yi) ; wˆML,i = arg max w∈{−1,1} p(yi |wi), as p(yi) is a constant for all values of wi and thus has no effect on the value of wi that maximizes the conditional probability. Calculating the ML estimate is often easier than calculating the MAP estimate. Since the two are equivalent for equally-likely wi , we choose to solve for the ML estimate, ˆwML,i. For continuous random variables, we have a PDF fx(x) instead of a probability px(x) and conditional PDFs fx|y (x|y) and fy|x(y|x) instead of the conditional probabilities. Thus the ML estimate ˆwML,i, when yi is a continous random variable, is found as wˆML,i = arg max w∈{−1,1} fy|w(yi |wi). (2) Note that since yi = wi + ni , the conditional PDF fy|w(yi |wi) is equivalent to the PDF of the noise ni , fn(ni = yi − wi) = fn(ni). The PDF of a Gaussian random variable n with zero mean and variance σ 2 n is given by fn(n) = exp − n 2 2σ2 n p 2πσ2 n . (3) Note that maximizing fn(n) with respect to n means |n| must be minimized. Since |ni | = |yi − wi |, this means we minimize the absolute distance between yi and wi , |yi −wi |. In other words, we choose the wi that is closest to the received yi . We have two possible values for the BPSK-modulated wi ∈ {−1, 1}. Applying the minimum-distance criterion for choosing wi translates into choosing our estimate ˆwi = 1 if yi ≥ 0, and ˆwi = −1 if yi < 0. In other words, we choose ˆwi = sign(yi). Exercise 3: Your report for Project 1, Exercise 3 is due Thursday, Feb 26, by 5 PM for full credit. Late Exercise 3 will be accepted until Thursday, March 5, 5 PM with -20% late penalty. 1. Generate a binary sequence x of length L = 1000, with xi ∈ {0, 1}; p(x = 0) = p(x = 1) = 1/2. Convert x to a BPSK sequence w, where wi ∈ {−1, 1}. 2. Generate an AWGN sequence n, also of length L = 1000; µn = 0 and variance σ 2 n = 2. 3. The received sequence y = w + n. Sketch the conditional PDFs f(yi |wi = 1) and f(yi |wi = −1). 4. Based on your sketch above, explain why choosing the estimate ˆwi = sign(yi) minimizes the distance |yi−wi |, and thus maximizes the conditional PDF f(yi |wi).EE 526, Random Signals & Systems: Project 1, Spring 2015 5 5. If you choose the estimate ˆwi = sign(yi), what is the expected (theoretical) probability of a bit error (p( ˆwi 6= wi))? 6. Now calculate the experimental bit error rate (BER) obtained when you choose ˆwi = sign(yi), as found from your y. How does it compare with your previous answer? 5 Bivariate Gaussians: Rayleigh Fading Rayleigh fading is a channel model used in wireless communications to represent the effect of a strong scattering environment with no line-of-sight component between transmitter and receiver. Such scattering environments are common in urban centers. Scattering from the troposphere or ionosphere layers can also be approximated as Rayleigh fading. The Rayleigh fading channel response H is complex, usually represented in polar form with a magnitude R and phase component θ, such that H = R exp(jθ). The magnitude R is a random variable that is Rayleigh distributed, with a PDF given by f(r) = r exp − r 2 2σ2 r σ 2 r . (4) Alternately, we may write H in rectangular form as the sum of a real (X) and imaginary (Y ) component; H = X +jY . Both X and Y are i.i.d. (independent and identically distributed) zero-mean Gaussian random variables. We can then find R = √ X2 + Y 2. The transmitted signal wi is attenuated and phase-shifted by the scattering environment, resulting in a received signal yi = Hwi . Exercise 4: Your report for Project 1, Exercise 4 is due Thursday, March 5, by 5 PM for full credit. Late Exercise 4 will be accepted until Thursday, March 12, 5 PM for -20% late penalty. 1. Generate a zero-mean Gaussian-distributed random sequence X of length 10, 000 with variance σ 2 x = 2. Also generate a random sequence Y of the same length with the same variance σ 2 y = σ 2 x . Include the commands you used to generate these sequences in your report. 2. Make a histogram of X and another of X2 . The Matlab command hist will make a histogram of your data, if you give it the bin values. Also make histograms for Y and Y 2 . Divide each histogram by L ∗ b, where L is the length of X (and Y ), and b is your bin size. Your bin size b should be small enough to give you good resolution, but not so small that you have many empty bins. Your histograms provide an approximate PDF for X and Y , as well as X2 and Y 2 . Include the 4 plots in your report. Note: Label your plots appropriately, with labels on the x and y axes, as well as a title. I need to be able to tell quickly which plot is which. If you do not label your plots, you will lose points. For more help on plots in Matlab, try help plot. 3. Generate R = √ X2 + Y 2 . 4. The expected value E[R] (or mean µR) of the Rayleigh fading magnitude R with parameter σR, where σ 2 R is the variance of the real (X) and imaginary (Y ) components of H, with R = |H|, is E[R] = σR p π/2. Calculate E[R] for the variance (σx = σy) used in step 1. 5. Estimate E[R] as the sample mean; ˆµR = PL i=1 Ri/L, where L is the length of (number of observations of) R. Calculate the relative error as |E[R] − µˆR|/E[R]. Include the relative error in your report. 6. The variance var[R] of the Rayleigh fading magnitude R is var[R] = σ 2 R(4 − π)/2. Calculate var[R] for the variance used in step 1.EE 526, Random Signals & Systems: Project 1, Spring 2015 6 7. Estimate var[R] as the unbiased estimate ˆvar[R] = PL i=1(Ri −µˆR) 2/(L−1), where L is the length of (number of observations of) R. Use your sample mean ˆµR when calculating ˆvar[R]; do not use E[R]. Calculate the relative error in your unbiased estimate as |var[R]− ˆvar[R]|/var[R]. Include the relative error in your report. 8. Make a histogram of R and another of R2 . Obtain an approximate PDF for each, as explained earlier. Include the 2 plots in your report. 9. Now calculate the analytical PDF for the Rayleigh fading envelope (magnitude) R, using the Rayleigh PDF in Equation 4. Note that σR = σx = σy. Make a plot comparing the analytical value of the PDF of R fR(r) with your approximate PDF of R from the histogram. Use the legend command in Matlab to label each curve on the plot. Use different line styles for the analytic PDF and the approximate (experimental) PDF so I can distinguish the curves. Include your plot in the report. 10. Calculate the analytical PDF fR(r) also for σR = 1 and for σR = 2. Compare these 2 PDFs with the PDF found above by graphing all 3 PDFs on one plot. Use the legend command in Matlab as well as differing line styles for each PDF. Include your plot in your report. 11. Examining your plot of the 3 different PDFs fR(r) using different values of σR, how does the PDF change as σR increases? As σR decreases?

Expert paper writers are just a few clicks away

Place an order in 3 easy steps. Takes less than 5 mins.

Calculate the price of your order

You will get a personal manager and a discount.
We'll send you the first draft for approval by at
Total price:
$0.00
Live Chat+1-631-333-0101EmailWhatsApp