`

Homework 3

Due Monday, November 5.

Goals:

Attain better understanding of bandwidth analysis and channelization.

Problem I:

(a) Write a program, Spectrum.java, which will compute the Fourier coefficients an and bn for a given bit sequence.

Usage of the program will be

java Spectrum <bit sequence> <power fraction>

where <bit sequence> is a list of the bits in one period and <power fraction> is a mechanism for specifying how many coefficients to compute.

For instance, consider the example 10101010... from our notes. If we wanted enough coefficients so that the truncated Fourier series captures 90% of the average power of the original signal we would type

java Spectrum 1 0 0.9

The reason for using the fraction-of-power criterion is that we need a stopping rule, i.e. a rule for deciding how many an and bn terms to take. The power rule makes intuitive sense for this. See supplement to the lecture notes for the formula. Just compute the left-hand side, and then find enough coefficients on the right-side side that the sum of their squares exceeds the given fraction of the left-hand side.

Remember, the Fourier coefficients are independent of T. Thus you can take T = 1.0 in your program. As before, let 1 and 0 be represented on the link as +1 and -1, respectively. Among other things, that also eliminates the need to compute the left-hand side of the power equation.

In your testing of your program, you may wish to use Yacas, a symbolic math package.

(b) Test the program on our 10101010... example.

(c) Use the program to illustrate the fact that the use of encodings will generally broaden the spectrum of a signal. Specifically, take our 10101010... example and apply 4B/5B coding to it, and then find the new spectrum and compare it to the original one.

Problem II:

(a) Consider the bit sequence 110110110... Suppose it is sent using the code in the last row of the order-4 Welsh matrix, W4. Use the program from Problem I to illustrate the fact that CDMA will generally broaden the spectrum of a signal.

(b) Suppose we use the random-code version of CDMA. This of course is subject to error. Suppose we adopt the policy that if vs is postive, we assume that ds is 1; we assume the latter is -1 if vs is negative; and if vs is 0, we ignore the bit. In this problem, we will investigate how well this works.

Say there are N nodes, which come online one at a time. Each time a node comes online, the central entity assigns it a G-bit code. Assume the code is generated at random as described in the notes, but that if the code duplicates that of an already-existing station, the central entity tries again, repeatedly generating random codes until it gets a nonduplicate.

We are interested in the probability of a bit being received in error when Node 0 sends to Node 1. In other words, as a data bit is sent (as a G-bit code) by Node 0, we are interested in the probability that Node 1 thinks the data bit is a -1 when it really is +1 or vice versa.

Note: ALL notes are both sending and receiving, at ALL times. Assume that for any node i, di is either +1 or -1, with probability 0.5 each.

Write a simulation program to find the approximate error probability for various values of N and G (get N and G from the command line). For example, try some (N,G) combinations which illustrate the fact that for fixed N the error probability decreases as G increases.

Here are approximate values you can use to check your program:


   N   G   P(error)

   3   3   0.072
   3   4   0.018
   3   6   0.014
   4   6   0.040