MatLab Project for Digital Signals

profileahmedbataweel
correlationdigitalcommunications.pdf

EE 463 - Matlab Project 2 - Spring 2020 (due 4/21/20 by the beginning of class via e-mail)

Correlation is used extensively in communications and signal processing to deter- mine how similar a signal is to a group of candidate signals. In binary digital communi- cations, for example, the discrete-time received signal at time n can be modeled as

r[n] = sm[n] + w[n], m = 1 or 2,

where sm[n] is the transmitted signal and w[n] is additive noise. The receiver knows the two possible transmitted signals s1[n], s2[n], but does not know which one was transmit- ted. Thus the receiver’s job is to determine the index m by correlating r[n] with the two possible transmitted signals. Your tasks in Project 2 are:

1. Download and plot the two pulse shapes, s1[n] and s2[n], contained in pulses.mat from the course webpage. The pulses are 500 samples long and have unit energy, i.e., ∑n |sm[n]|2 = 1. Typically, we use stem to plot discrete-time signals, but you can use the plot command here because they are 500 samples long.

2. Write a Matlab script that will do the following:

(a) Choose randomly from these two pulse shapes (with equal probability) 500,000 times. After each choice, add noise w=P*randn(500,1) to create r[n] = sm[n] + w[n], where P2 is the power of the noise. Plot one of these noisy waveforms, together with the noise-free waveform.

(b) For each of the 500,000 waveforms r[n], crosscorrelate r[n] with s1[n] and s2[n] to produce two crosscorrelation values c1 and c2. If the transmission of s1[1] corresponds to a binary 0, and the transmission of s2[n] corresponds to a bi- nary 1, then c1 > c2 means your bit estimate at the receiver is 0, and c2 > c1 means your bit estimate is 1. In this way, produce 500,000 bit estimates and compute the bit-error-rate as BER=number of errors/500,000.

(c) Plot your BER values versus 1/P2 for P = 2 : −.1 : .2, where 1/P2 is the signal-to-noise-ratio (SNR) for this communication system. Your SNR values should be in dB units, i.e., 10 log10(1/P

2) and you should use semilogy to expand the y-axis. Your figure will look like what you see on the next page.

You will send three files via e-mail to [email protected] with the subject line "Project 2":

• A single .pdf figure with 2 curves, as described in part (a) above.

1

• Another .pdf figure containing the BER curve, as described in parts (b) and (c) above. It should look like the figure below.

• A single Matlab script that will automatically produce the two figures above (with- out any input from the user).

Use only primitive Matlab commands in your script; avoid the use of any toolboxes.

SNR (1/P 2 ) dB

-8 -6 -4 -2 0 2 4 6 8 10 12

B E

R

10 -4

10 -3

10 -2

10 -1

10 0

2