ece 2610 spring 2011 final project baseband binary...

25
ECE 2610 Spring 2011 Final Project Baseband Binary Communications Over a Distorted Channel 1 Introduction In this final team project you will be investigating the use of a nulling filter to remove/mitigate the effects of a sinusoidal jamming signal on a baseband digital communications waveform. The de- sign of the jamming filter itself is the main focus of this project. The use of a nulling or notch filter in the context of a digital communication system might seem too advanced. Details of the digital communication system will be kept to a high level, yet allow some exposure to digital communica- tion concepts. The major building blocks for the simulation of a baseband digital communications link are provided. The m-code functions are documented in Appendix A and the source code itself is on the course web site as a ZIP file package. Honor Code: The project teams will be limited to at most three members. Teams are to work independent of one another. Bring questions about the project to me. I encourage you to work in teams of at least two. Since each team member receives the same project grade, a group of two or three should attempt to give each team member equal responsibility. The due date for the completed project will be 12:00 pm, Tuesday May 10, 2011. 2 System Description A block diagram of the baseband digital communication system is shown in Figure 1. The notch Data Bits SRC ! 0.5 = Notch Filter N s Sample per bits Transmitter Channel dn [] xn [] Receiver Sample at Bit Maximum once per bit period of N s d ˆ n [] Impulse Modulator mn [] rn [] Noise Jamming Tones rn [] Bit Decisions yn [] zn [] or RECT SRC ! 0.5 = or RECT jn [] wn [] Figure 1: Baseband digital communication system block diagram. filter, which appears as the first block in the receiver is the focus of this investigation. To better

Upload: others

Post on 26-May-2020

18 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: ECE 2610 Spring 2011 Final Project Baseband Binary …mwickert/ece2610/lecture_notes/final_project/2… · ECE 2610 Spring 2011 Final Project Baseband Binary Communications Over a

ECE 2610 Spring 2011 Final ProjectBaseband Binary Communications

Over a Distorted Channel

1 IntroductionIn this final team project you will be investigating the use of a nulling filter to remove/mitigate theeffects of a sinusoidal jamming signal on a baseband digital communications waveform. The de-sign of the jamming filter itself is the main focus of this project. The use of a nulling or notch filterin the context of a digital communication system might seem too advanced. Details of the digitalcommunication system will be kept to a high level, yet allow some exposure to digital communica-tion concepts. The major building blocks for the simulation of a baseband digital communicationslink are provided. The m-code functions are documented in Appendix A and the source code itselfis on the course web site as a ZIP file package.

Honor Code: The project teams will be limited to at most three members. Teams are to workindependent of one another. Bring questions about the project to me. I encourage you to workin teams of at least two. Since each team member receives the same project grade, a group oftwo or three should attempt to give each team member equal responsibility. The due date for thecompleted project will be 12:00 pm, Tuesday May 10, 2011.

2 System DescriptionA block diagram of the baseband digital communication system is shown in Figure 1. The notch

DataBits

SRC! 0.5=

NotchFilter

Ns Sample per bits

Transmitter Channeld n[ ] x n[ ]

Receiver

Sample at Bit Maximumonce per bit period of Ns

d̂ n[ ]

ImpulseModulator

m n[ ] r n[ ]

NoiseJamming Tones

r n[ ]

Bit Decisions

y n[ ] z n[ ]

or RECT

SRC! 0.5=or RECT

j n[ ] w n[ ]

Figure 1: Baseband digital communication system block diagram.

filter, which appears as the first block in the receiver is the focus of this investigation. To better

Page 2: ECE 2610 Spring 2011 Final Project Baseband Binary …mwickert/ece2610/lecture_notes/final_project/2… · ECE 2610 Spring 2011 Final Project Baseband Binary Communications Over a

2.1 Transmitter

understand the purpose of the notch/nulling filter in this context, a brief explanation of the entirecommunication system will be provided.

2.1 TransmitterAs depicted in Figure 1 the transmitter is composed of three functions. The block labeled DataBits produces a string of random data bits to represent a binary encoded message or data source.For the purposes of this transmitter the data bit levels are ˙1 amplitude values as opposed to 0/1values that are found in digital logic. The transmitted data bits are contained in the vector datawithin the m-code function bb_tx.m.

K>> data(1:20)

-1 -1 -1 1 1 -1 -1 1 -1 1 ,

-1 1 -1 1 -1 -1 1 -1 1 1

The Impulse Modulator block prepares the data bits for waveform encoding by stuffing zerosample values between the input signal dŒn�. The waveform generation process assumes that anew transmitted bit is sent every Ns samples (the constant Ns in the m-code). With Ns samples perbit, Ns � 1 zero samples are stuffed in between each ˙1 data bit. Inside the m-code this signal,denoted mŒn� in the block diagram, appears as shown below for Ns D 10.

K>> x(1:50)

-1 0 0 0 0 0 0 0 0 0 ,

-1 0 0 0 0 0 0 0 0 0 ,

-1 0 0 0 0 0 0 0 0 0 ,

1 0 0 0 0 0 0 0 0 0 ,

1 0 0 0 0 0 0 0 0 0

The final transmitter block provides pulse shaping to produce the actual waveform that exitsthe transmitter. Two pulse shaping functions are considered in this project. The first is a simplerectangular pulse shape, which is a constant value over Ns sample values. The second pulse shapeis a popular digital communications shaping function known as a square-root raised cosine (SRC)function [1]. To apply the pulse shape all we do is filter the impulse train modulated signal, mŒn�,with an FIR filter whose impulse response is one of the two pulse types. In the m-code the supportfunction sqrt_rc_imp.m generates the filter coefficients fbkg that correspond to a particular SRCdesign. The pulse shapes for Ns D 10 are shown in Figure 2.

...switch lower(pulse) % not case sensitive

case ’src’h_src = sqrt_rc_imp(Ns,0.5,6);x = filter(h_src,1,x);

ECE 2610 Final Project: Baseband Digital Communications 2

Page 3: ECE 2610 Spring 2011 Final Project Baseband Binary …mwickert/ece2610/lecture_notes/final_project/2… · ECE 2610 Spring 2011 Final Project Baseband Binary Communications Over a

2.1 Transmitter

case ’rect’h_rect = ones(1,Ns);x = filter(h_rect,1,x);

otherwiseerror(’pulse must be SRC or RECT’)

end...

0 1 2 3 4 5 6 7 8 9 100

0.5

1

REC

T Pu

lse

0 20 40 60 80 100 120!0.5

0

0.5

1

1.5

SRC

Pul

se

Impulse Response Index n

! 0.6 6 Bits Duration±,=

Figure 2: Pulse shapes with Ns D 10.

A sample of the transmitter output signal with RECT and SRC pulse shaping is shown inFigure 3. The signal xŒn� is discrete, but we have plotted these waveforms using plot() sincethe number of points is quite large, so connecting the points together makes for a cleaner plot thanusing stem(). Notice that SRC pulses actually extend beyond the bit interval of Ns samples.

The concept of the frequency spectrum of a signal has not been introduced, yet it is similar tothe concept of the frequency response for a filter. The frequency spectrum of the transmitted signalxŒn� reveals how the energy of a signal is distributed with respect to frequency. The functionfreqz() could be used to obtain an approximate frequency spectrum of xŒn�, but since xŒn� ismade up of random data bits, we use the MATLAB function psd() for obtaining the frequencyspectrum under these circumstances. Note that the function psd() is part of the signal processingtoolbox, so you cannot use this function on your home system if all you have installed is MATLAB

alone. It is instructive to view the frequency spectrum of xŒn� for the two pulse shapes so we havea better idea of how the single-tone jamming signal, to be described later, impacts the signal. Weplot the spectrum of the RECT and SRC waveforms with Ns D 10 in Figure 4. The frequency axisis normalized to the bit rate Rb, which has units of bits/s.

ECE 2610 Final Project: Baseband Digital Communications 3

Page 4: ECE 2610 Spring 2011 Final Project Baseband Binary …mwickert/ece2610/lecture_notes/final_project/2… · ECE 2610 Spring 2011 Final Project Baseband Binary Communications Over a

2.2 Channel

0 20 40 60 80 100 120 140 160 180 200!2

!1

0

1

2

x REC

T,n.

0 20 40 60 80 100 120 140 160 180 200!2

!1

0

1

2

x SRC

,n.

T0me Index ! n

Ns 10=

Ns 10=

one bit period

one bit period

Figure 3: Transmitter output waveforms.

>> subplot(211)>> r = bb_tx(10000,100,0.53,100,10,’RECT’);>> psd(r.SJN,2^12,10)>> xlabel(’Bit Rate Normalized Frequency (f/R_b)’)>> ylabel(’x_RECT PSD (dB)’)>> subplot(212)>> r = bb_tx(10000,100,0.53,100,10,’SRC’);>> psd(r.SJN,2^12,10)>> axis([0 5 -60 20])>> xlabel(’Bit Rate Normalized Frequency (f/R_b)’)>> ylabel(’x_SRC PSD (dB)’)

2.2 ChannelThe channel adds two signals to the transmitter output xŒn�. The first signal is a single sinusoidwaveform of the form

j Œn� D Aj cos.2�fj=.NsRb/nC �j / (1)

Note that the equivalent sampling rate in this simulation is fs D NsRb Hz. This signal constitutesa jamming or interference signal which is undesired. The amplitude of this signal is adjusted sothat the level of the interference results in a particular signal power, Psignal, relative to the jammerpower, Pjammer, known as the signal-to-interference ratio (SIR) and defined as

SIRdB D 10 log10

�Psignal

Pjammer

�: (2)

ECE 2610 Final Project: Baseband Digital Communications 4

Page 5: ECE 2610 Spring 2011 Final Project Baseband Binary …mwickert/ece2610/lecture_notes/final_project/2… · ECE 2610 Spring 2011 Final Project Baseband Binary Communications Over a

2.2 Channel

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5!60

!40

!20

0

20

Bit Rate Normalized Frequency (f/Rb)

x REC

T PSD

(dB)

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5!60

!40

!20

0

20

Bit Rate Normalized Frequency (f/Rb)

x SRC

PSD

(dB)

Ns 10=

Ns 10=

Figure 4: Transmitter output frequency spectrum.

We use the units dB when we refer to a power ratio in logarithmic units. If we make SIR large, saygreater that 100 dB, the jammer strength is negligible relative to the signal xŒn�.

The second signal that the channel adds to the transmitted signal is noise of a particular powerlevel and constant frequency spectrum. We use the MATLAB function randn(), which producesindependent Gaussian random number samples to generate the noise process. The amplitude ofthis signal is adjusted so that the level of the noise results in a particular signal power relative tothe noise power, Pnoise, known as the signal-to-noise ratio (SNR) and defined as

SNRdB D 10 log10

�Psignal

Pnoise

�D 10 log10

�Eb

N0

�: (3)

In a binary digital communication system, the SNR is equivalent to the ratio of Eb=N0, where Eb

is the energy-per-bit and N0 is the noise power spectral density. The power spectral density (PSD)tells us how the power of a particular signal is distributed in frequency. The units of N0 is Watts ofpower per Hz of frequency bandwidth.

The m-file bb_tx.m contains both the transmitter and channel simulation functionality. Thefunction help for bb_tx.m reveals the function interface.

>> help bb_tx[r,data] = bb_tx(Nbits,SIR,fj,SNR,Ns,pulse)Baseband binary signal source including noise and jamming

----------------- Inputs ---------------------------------Nbits = number of bits to simulate

ECE 2610 Final Project: Baseband Digital Communications 5

Page 6: ECE 2610 Spring 2011 Final Project Baseband Binary …mwickert/ece2610/lecture_notes/final_project/2… · ECE 2610 Spring 2011 Final Project Baseband Binary Communications Over a

2.2 Channel

SIR = signal-to-interference (jammer) ratio in dBfj = bit rate normalized jammer frequency

SNR = signal-to-noise ratio in dBNs = number of samples per bit in waveform simulation

pulse = transmitted pulse type, RECT = rectangular,SRC = square-root raised cosine with alpha = 0.5

----------------- Outputs ----------------------------------r = transmitted signal as a data structure containing variations

of signal (S), jamming (J), and noise (N), in particularr.SJN = S + J + Nr.SJ = S + J (signal plus noise only)r.N = N (noise only)r.SNR = SNR to use later inside the receiver bb_rxr.NS = NS to use later inside the receiver bb_rxr.pulse = pulse to use later inside the receiver bb_rx

data = data bits transmitted as +1/-1 bit values; can be used forerror checking in Monte-Carlo type simulation

-------------------------------------------------------------

Mark Wickert, November 2006

From this help listing we see how we use the bb_tx() function to create a particular transmittedwaveform. In particular if we wish to create a transmitted waveform using an SRC pulse, of 1000bit duration, 10 samples per bit, an SIR of 10 dB, an SNR of 20 dB, and a normalized jammerfrequency of fj=Rb D 0:53, we enter the following at the command prompt.

» r = bb_tx(1000,10,0.53,20,10,’SRC’);We can view the transmitted waveform from several points of view. To begin with we can look inthe time-domain (sequence-domain) at the signal r.SJ to just see the impact of the jammer on thereceived signal. We can also look at the combination r.SJN to see the impact of the jammer andthe noise on the received signal.

>> r = bb_tx(1000,10,0.53,20,10,’RECT’);>> t_bit = [0:length(r.SJ)-1]/10;>> subplot(211)>> plot(t_bit,r.SJ)>> axis([100 150 -2 2])>> grid>> ylabel(’r.SJ[n]’)>> subplot(212)>> plot(t_bit,r.SJN)>> axis([100 150 -2 2])>> grid>> ylabel(’r.SJN[n]’)>> xlabel(’Bit Periods (n/N_s)’)

The top subplot of Figure 5 shows the desired signal with just the jammer present. The lowersubplot shows the combination of signal, jamming, and noise. With just the jamming signal presentwe see the flat area on the top of each data bit has been replaced with sinusoidal wiggles. Whenthe noise is included the wiggles are now blended with random fluctuations due to the noise. Ifeither the noise or the jamming levels increase, that is SNR and/or SIR decrease, it will become

ECE 2610 Final Project: Baseband Digital Communications 6

Page 7: ECE 2610 Spring 2011 Final Project Baseband Binary …mwickert/ece2610/lecture_notes/final_project/2… · ECE 2610 Spring 2011 Final Project Baseband Binary Communications Over a

2.2 Channel

harder for the receiver to discern the original ˙1 binary signal levels, and bit errors will result.The frequency domain allows up to see the impact of the distortions differently. We can use the

100 105 110 115 120 125 130 135 140 145 150!2

!1

0

1

2r.S

J[n]

100 105 110 115 120 125 130 135 140 145 150!2

!1

0

1

2

r.SJN

[n]

Bit Periods (n/Ns)

SIR 10 dB= SNR, 20 dB fj Rb, 0.53 RECT N, s, 10= = =

Figure 5: Channel outputs for the RECT pulse shape with signal + jamming (top) and signal +jamming + noise (bottom) for SIR = 10 dB and SNR = 20 dB.

suplied function simpleSA() function to serve as a spectrum analyzer, and thus see the signals ofFigure 5 in the frequency domain.

>> r = bb_tx(10000,10,0.53,20,10,’RECT’);>> subplot(211)>> simpleSA(r.SJ,2^12,10)>> ylabel(’r_S+J PSD (dB)’)>> xlabel(’Bit Rate Normalized Frequency (f/R_b)’)>> subplot(212)>> simpleSA(r.SJN,2^12,10)>> ylabel(’r_S+J+N PSD (dB)’)>> xlabel(’Bit Rate Normalized Frequency (f/R_b)’)

From the top subplot of Figure 6 we see the signal spectrum as in Figure 4, except now atfj=Rb D 0:53 we see a spectral line due to the jamming tone. In the lower subplot we see thejamming tone plus a flat noise spectrum starting to mask over the desired signal. We will nowmove into the receiver to see how design choices can be used to mitigate the jammer and noisesignals.

ECE 2610 Final Project: Baseband Digital Communications 7

Page 8: ECE 2610 Spring 2011 Final Project Baseband Binary …mwickert/ece2610/lecture_notes/final_project/2… · ECE 2610 Spring 2011 Final Project Baseband Binary Communications Over a

2.3 Receiver

! !"# $ $"# % %"# & &"# ' '"# #!'!

!%!

!

%!

Bit Rate Normali4ed Fre7uenc; <f>Rb@

r SBJ D

SD <d

B@

! !"# $ $"# % %"# & &"# ' '"# #!%!

!$!

!

$!

%!

Bit Rate Normali4ed Fre7uenc; <f>Rb@

r SBJB

N D

SD <d

B@

SIR 10 dB! SNR! 20 dB fj Rb!! 0.53 RECT N! s! 10! ! !"ammin'(t*ne

,lat(s/ectr2m(34hite6(n*ise(7illin'7r*m(the(8*tt*m(*7(the(/l*t

"ammin'(t*ne

Figure 6: Channel outputs in the frequency domain for the RECT pulse shape with signal + jam-ming (top) and signal + jamming + noise (bottom) for SIR = 10 dB and SNR = 20 dB.

2.3 ReceiverThe three primary functions of the receiver are a notch or jammer nulling filter, a matched filter toremove noise and optimize the signal amplitude at the bit decision sampling instants, and a deviceto convert the once per bit sampled waveform back to a pure binary sequence (still ˙1 amplitudelevels). The receiver m-code, bb_rx.m also utilizes the signals contained in the data structurevariable r to estimate the bit error probability (BEP), using a rapid simulation technique known assemi-analytic BEP estimation (SA-BEP).

The proposed notch filter for this project is a second-order IIR filter of the form

HIIR-notch.z/ D1 � 2 cos. O!0/z

�1 C z�2

1 � 2r cos. O!0/z�1 C r2z�2: (4)

Note that this filter becomes an FIR nulling filter if we set r D 0, i.e.,

HFIR-notch.z/ D 1 � 2 cos. O!0/z�1C z�2: (5)

The design parameters for this filter are the notch filter center frequency, O!0, with respect to the O!axis, and the pole radius, 0 � r < 1. In Task 1 you will spend some time analyzing this filter andlearn how the parameters O!0 and r control the filter performance. For performance comparisonsthe notch filter can be bypassed by setting a software switch. This will be explained in more detaillater.

ECE 2610 Final Project: Baseband Digital Communications 8

Page 9: ECE 2610 Spring 2011 Final Project Baseband Binary …mwickert/ece2610/lecture_notes/final_project/2… · ECE 2610 Spring 2011 Final Project Baseband Binary Communications Over a

2.3 Receiver

The second block is the matched filter, which is matched in impulse response shape to thetransmitting filter. For a receiver operating in just additive white noise, the matched filter serves tomaximize the SNR at a particular sampling instant at the filter output [1]. The main point beingthat this filter removes as much noise as possible, while retaining the maximum possible amplitudeof the signal at the optimum sampling instant. The function of the matched filter is best understoodby observing waveforms at the output of the matched filter.

The receiver m-code function bb_rx.m has the following help listing:

>> help bb_rx[PE,SNR_dB,y,z] = bb_rx(r,b_null,a_null,Ifilt_mode)Matched filter receiver including a front-end nulling filter. Thisreceiver uses the data structure variable input r to also obtain aprobability of bit error measurement using the semi-analytic simulationtechnique.

------------------------- Inputs --------------------------------------r = received signal as a data structure containing variations

of signal (S), jamming (J), and noise (N), in particularr.SJN = S + J + Nr.SJ = S + J (signal plus jamming only)r.N = N (noise only)r.SNR = SNR to use later inside the receiver bb_rxr.NS = NS to use later inside the receiver bb_rxr.pulse = pulse to use later inside the receiver bb_rx

b_null = nulling filter numerator coefficient vectora_null = nulling filter denominator coefficient vector

Ifilt_mode = input ’notch_on’ to include nulling filter,input ’notch_off’ to bypass nulling filter

------------------------- Outputs -------------------------------------PE = vector of estimated probability of bit error over the range of

SNR values in dB found in SNR_dBSNR_dB = a vector of SNR values corresponding to the PE vector

y = data structure variable corresponding to the signal componentscontained in r, but at the output of the nulling (notch filter)

z = data structure variable corresponding to the signal componentscontained in r, but at the output of the matched filter

Mark Wickert, November 2006

From the help listing we see that only four inputs are required. The transmitter output data structurevariable r contains most of the additional input information. The notch filter coefficients need tobe supplied by the user. This allows the user to enter any type of nulling filter. We can probe thenotch filter output through the output data structure variable z, denoted zŒn� in the block diagramof Figure 1.

We will now briefly study the matched filter output at high SNR and SIR, for both RECT andSRC pulses. In Figure 3 we plotted the waveforms directly, now we will introduce a new plot type,known as an eye diagram plot or just eyeplot. The eyeplot function slices the time-domain signalup into contiguous segments an integer number of bit times in duration. The segments are thenoverlap plotted on top of each other. If Ns D 10 we might plot the eyeplot using a 20 samplewindow length, so we can see two bit signal transitions. The eyeplot shows all possible waveform

ECE 2610 Final Project: Baseband Digital Communications 9

Page 10: ECE 2610 Spring 2011 Final Project Baseband Binary …mwickert/ece2610/lecture_notes/final_project/2… · ECE 2610 Spring 2011 Final Project Baseband Binary Communications Over a

2.3 Receiver

transitions over the input signal vector. This way we can clearly see where the optimum samplinginstant is as the switch in the receiver block diagram needs to know this. Secondly, we can viewhow open the eye is and immediately see how much distortion is present in the received signal.The function eyeplot.m, included in the ZIP package relies on plot() for doing its work.

>> help eyeploteyeplot eyeplot(data, W, offset): Plot the eye pattern of a digital

communication waveform using a window length of W and offsetOFS

>> r = bb_tx(1000,100,0.53,100,10,’RECT’);>> [PE,SNR_dB,y,z] = bb_rx(r,b_null,a_null,’notch_off’);>> subplot(211)>> eyeplot(z.SJN,20,500)>> grid; axis([0 19 -1.5 1.5])>> ylabel(’z_S+J[n] Eyeplot’)>> r = bb_tx(1000,100,0.53,100,10,’SRC’);>> [PE,SNR_dB,y,z] = bb_rx(r,b_null,a_null,’notch_off’);>> subplot(212)>> eyeplot(z.SJN,20,500)>> grid; axis([0 19 -1.5 1.5])>> ylabel(’z_S+J[n] Eyeplot’)>> xlabel(’Bit Samples (n)’)

In Figure 7 we see that with a clean input signal (high SNR and SIR) the eye is very open, infact it is fully open, meaning there is no distortion. We also see that the optimum sampling instantfor the two pulse shape types differs by one sample value. The function bb_rx() manages thisautomatically though a simple bit synchronization algorithm.

We next dial down the SNR and SIR values to 20 dB and 10 dB respectively. The eyeplots willbe observed again for both pulse shapes.

>> r = bb_tx(1000,10,0.53,20,10,’RECT’);>> [PE,SNR_dB,y,z] = bb_rx(r,b_null,a_null,’notch_off’);>> subplot(211)>> eyeplot(z.SJ,20,500)>> axis([0 19 -1.5 1.5]); grid>> ylabel(’z_S+J[n] Eyeplot’)>> subplot(212)>> eyeplot(z.SJN,20,500)>> axis([0 19 -1.5 1.5]); grid>> ylabel(’z_S+J+N[n] Eyeplot’)>> xlabel(’Bit Samples (n)’)

In Figure 8 we see the eyeplots when using the RECT pulse for signal + jammer in the uppersubplot, and signal + jammer + noise in the lower subplot. With just the jammer present the eyecloses somewhat, but when the noise is added the eye closes even further. Clearly as either of theratios SNR and SIR decrease further, bit errors will ultimately occur.

>> r = bb_tx(1000,10,0.53,20,10,’SRC’);>> [PE,SNR_dB,y,z] = bb_rx(r,b_null,a_null,’notch_off’);>> subplot(211)>> eyeplot(z.SJ,20,500)

ECE 2610 Final Project: Baseband Digital Communications 10

Page 11: ECE 2610 Spring 2011 Final Project Baseband Binary …mwickert/ece2610/lecture_notes/final_project/2… · ECE 2610 Spring 2011 Final Project Baseband Binary Communications Over a

2.4 Receiver Performance Analysis

0 2 4 6 8 10 12 14 16 18

!1

0

1

z S+J[n

] Eye

plot

0 2 4 6 8 10 12 14 16 18

!1

0

1

z S+J[n

] Eye

plot

Bit Samples (n)

RECT

SRC

Eyeplots of Matched Filter Outputs at High SNR & SIR

maxeyeopening

Figure 7: Eyeplots of the matched filter output under high SNR and SIR conditions; RECT (top),SRC (bottom).

>> axis([0 19 -2 2])>> grid>> ylabel(’z_S+J[n] Eyeplot’)>> subplot(212)>> eyeplot(z.SJN,20,500)>> axis([0 19 -2 2])>> grid>> ylabel(’z_S+J+N[n] Eyeplot’)>> xlabel(’Bit Samples (n)’)

In Figure 9 we see the eyeplots when using the SRC pulse for signal + jammer in the uppersubplot, and signal + jammer + noise in the lower subplot. The SRC results are similar to the RECTcase, except the eye closure is more significant. The SRC pulse provides a more compact powerspectral density, but the downside is the communications link is more sensitive to impairmentssuch as tone jamming.

2.4 Receiver Performance AnalysisIn the absence the jamming signal the probability of making a bit error for just noise in the channel,achieves a theoretical performance of

PE D1

2erfc

�pSNR

�; (6)

ECE 2610 Final Project: Baseband Digital Communications 11

Page 12: ECE 2610 Spring 2011 Final Project Baseband Binary …mwickert/ece2610/lecture_notes/final_project/2… · ECE 2610 Spring 2011 Final Project Baseband Binary Communications Over a

2.4 Receiver Performance Analysis

0 2 4 6 8 10 12 14 16 18

−1

0

1z S

+J[n

] Eye

plot

0 2 4 6 8 10 12 14 16 18

−1

0

1

z S+

J+N

[n] E

yepl

ot

Bit Samples (n)

S+J

S+J+N

RECT Eyeplots of Matched Filter Outputs at SNR = 20 dB & SIR = 10 dB

The eye closes further as more jamming and noise is added

Figure 8: Eyeplots of the matched filter output with SNR = 20 dB and SIR = 10 dB; S+J for RECT(top), S+J+N for RECT (bottom).

where erfc.x/ is a special function defined as the integral

erfc.x/ D1p2�

Z 1x

e�u2=2 du: (7)

This integral computes the area under the tail of a Gaussian (normal or bell shaped) probabilitydensity function. MATLAB supplies this function via erfc(). Probability, random variables, andstatistics, is a subject you investigate when you take ECE3610. Digital communications engineerslike to plot PE versus SNR in dB (Eb=N0 in dB) using a semilog plot. The function plot_PE.m,included in the ZIP package, can be used to create BEP plots. The ideal white noise theoreticalperformance can be plotted as a special case.

>> plot_PE()>> title(’Theoretical BEP’,’FontWeight’,’Bold’,’FontSize’,12)

In Figure 10 the theoretical BEP performance for an additive noise channel is given. This resultholds independent of the pulse shape. When jamming is present degraded performance is obtained.Consider the performance with SRC pulse shaping and SIR = 8 dB.

>> r = bb_tx(100000,8,0.53,10,10,’SRC’);>> [PE,SNR_dB,y,z] = bb_rx(r,b_null,a_null,’notch_off’);>> plot_PE() % always plot the ideal theory curve to start with

ECE 2610 Final Project: Baseband Digital Communications 12

Page 13: ECE 2610 Spring 2011 Final Project Baseband Binary …mwickert/ece2610/lecture_notes/final_project/2… · ECE 2610 Spring 2011 Final Project Baseband Binary Communications Over a

2.4 Receiver Performance Analysis

0 2 4 6 8 10 12 14 16 18!2

!1

0

1

2

z S+J[n

] Eye

plot

0 2 4 6 8 10 12 14 16 18!2

!1

0

1

2

z S+J+

N[n

] Eye

plot

Bit Samples (n)

S+J

S+J+N

SRC Eyeplots of Matched Filter Outputs at SNR = 20 dB & SIR = 10 dB

The closes further as more jamming and noise is added

Figure 9: Eyeplots of the matched filter output with SNR = 20 dB and SIR = 10 dB; S+J for SRC(top), S+J+N for SRC (bottom).

>> holdCurrent plot held>> plot_PE(SNR_dB,PE,’b--’) % overlay additional experimental BEP curves>> [PE,SNR_dB,y,z] = bb_rx(r,b_null,a_null,’notch_on’);>> plot_PE(SNR_dB,PE,’r’)>> legend(’Ideal Theory’,’Notch Off’,’Notch On’)>> title(’BEP with SRC and SIR = 8 dB, Notch Filter On and Off’,...

’FontWeight’,’Bold’,’FontSize’,12)

In Figure 11 experimental BEP performance using the semi-analytic simulation technique isshown. Results are shown with and without the IIR notch filter. The number of symbols usedin the simulation is increased from 1000 to 100,000 to improve the statistical accuracy of theSA-BEP method. At PE D 10�6 we see a performance improvement of about 0.83 dB. In thetasks that follow you will be performing similar experiments to see how a notch filter can improveperformance. You will also see that an improperly defined notch filter will make performancemuch worse.

You may wonder how the performance can be estimated over a range of SNR values whenthe link SNR is fixed at 10 dB. The SA-BEP method uses the link SNR as a calibration pointand to allowing viewing of signal integrity via eyeplots and frequency spectra. When the receiversimulation function is run a noise calibration is automatically performed at the link SNR value, butthen the SA-BEP method calculates and estimate of PE versus SNR over an internal range of SNRvalues. The code that does this is in lines 97–103 of the file bb_rx.m.

ECE 2610 Final Project: Baseband Digital Communications 13

Page 14: ECE 2610 Spring 2011 Final Project Baseband Binary …mwickert/ece2610/lecture_notes/final_project/2… · ECE 2610 Spring 2011 Final Project Baseband Binary Communications Over a

0 2 4 6 8 10 12 14 16 1810!7

10!6

10!5

10!4

10!3

10!2

10!1Theoretical BEP

Eb/N0 (dB)

Prob

abilit

y of

Bit

Erro

r

BEP performance is oftenspecified at this PE operatingpoint ~10.53 dB

Figure 10: Theoretical BEP performance in additive white Gaussian noise only.

% Starting at line 97 in bb_rx.m% Estimate Probability of Bit Error using Semi-Analytic TechniqueSNR_dB = 0:.5:20;PE = zeros(size(SNR_dB));for k=1:length(SNR_dB)

PE(k) = 1/2*sum(erfc(abs(d)/sqrt(var_N/10^((SNR_dB(k)-r.SNR)/10))));endPE = PE/length(d);% End of bb_rx.m

3 Project Tasks1. Study the IIR and FIR notch filters. For the plots created in this task let O!0 D 2�f0=fs D

0:2� .

(a) Find the location of the poles and zeros in terms of O!0 and r . Plot the poles and zerosfor r D 0:8.

(b) For the special case of r D 0, which results in an FIR notch filter, plot the magnitudeand phase response on a single plot using subplots.

(c) For r D 0:8; 0:9; 0:99, and 0.995 in the IIR notch filter, plot the magnitude and phaseresponse on a single plot using subplots. Plot all of the magnitude and all of the phase

ECE 2610 Final Project: Baseband Digital Communications 14

Page 15: ECE 2610 Spring 2011 Final Project Baseband Binary …mwickert/ece2610/lecture_notes/final_project/2… · ECE 2610 Spring 2011 Final Project Baseband Binary Communications Over a

0 2 4 6 8 10 12 14 16 1810!7

10!6

10!5

10!4

10!3

10!2

10!1BEP %ith )*+ a-. )/* 0 1 .B2 3otch 6ilter :- a-. :;;

Eb/N0 (dB)

Prob

abilit

y of

Bit

Erro

r

<d=al >?=oryNot@? AffNot@? AB

10.53dB

11.()dB

1*.3*dB

Figure 11: SA-BEP performance using the SRC pulse with and without a notch filter when SIR =8 dB.

response on the same subplot using the hold option. Clearly label the individual curvesfor the various r values. If need be zoom the plots to a frequency interval surroundingO!0. As you zoom you may need to increase the frequency resolution in the neighbor-hood of O!0 that you are using with freqz().

(d) Comment the ability of the FIR and the IIR notch filter design to excise a small bandof frequencies while leaving adjacent frequencies intact. Which filter, FIR or IIR, doyou think will work better to remove the jamming signal? Why?

2. Study the baseband link with single tone jamming when using the RECT pulse shape. Com-mon system parameters for this task are Ns D 10 and SNR = 10 dB. If you are performingspectral analysis using the simpleSA() function set the number of bits simulated to 10,000.If you are obtaining an eyeplot, set the number of bits simulated to 1000. Spectrum analysisneeds a relatively large number of simulated bits to obtain a clean spectral estimate. Theeyeplot function will run very slow when the number of bits to be plotted is large, hence1000 is a good value in this case. When running SA-BEP curves the number of symbolssimulated should be 100,000.

(a) With SIR = 10 dB and fj=Rb D 0:53 obtain eyeplots as in Figure 8. Note how the eyeis closed further for the case of signal + jammer + noise.

(b) With SIR = 10 dB and fj=Rb D 0:53 design an IIR notch filter with O!0 such that

ECE 2610 Final Project: Baseband Digital Communications 15

Page 16: ECE 2610 Spring 2011 Final Project Baseband Binary …mwickert/ece2610/lecture_notes/final_project/2… · ECE 2610 Spring 2011 Final Project Baseband Binary Communications Over a

fj=Rb D 0:53. Hint recall that fs D Ns �Rb. Run bb_rx() with the notch filter turnedon check to see that the notch filter is working by plotting the spectrum of the notchfiltered signal yŒn� (in the code y.SJ) using the psd() function (the signal processingtoolbox is required here). If you have designed your notch filter properly, you shouldsee that the jamming tone is removed, along with some signal energy. You still have tochoose a value for the filter parameter r . Start with r D 0:95.

(c) Now that you have viewed y.SJ in the frequency domain it is time to see what thenotch filter is doing in the time domain. Obtain an eyeplot of the match filtered signalzŒn� (in code z.SJ). If the eye is entirely closed, you may need to refine your filterdesign. In particular you will have to make the notch tighter, that is make r closer toone. For filter stability reasons you must keep r < 1 however. It is also more dif-ficult to implement an IIR with r close to one due to numerical precision issues. Tomake your selection of r more realistic we will assume that at most B-bits total bitsof coefficient precision are available. To enforce this, the double precision float coeffi-cients that come from equations (4) and (5) will be quantized using the included func-tion simpleQuant(x,B,Xmax,Limit). Given that the filter coefficients are in vectorsa_null and b_null, 14-bit quantized versions of these coefficients are obtained via

>> bq16_null = simpleQuant(b_null,14,2,’Sat’); % Xmax = 2 is reasonable here>> aq16_null = simpleQuant(a_null,14,2,’Sat’); % Xmax = 2 is reasonable here

As you test the performance of your notch filter make sure you are using the 14-bitquantized version of your filter coefficients. Inclusion of the coefficient quantizer willlikely mean that r values can only get so close to one before there is a diminishingreturn in performance improvement.

(d) When you are happy with the quality of the eye opening in part (c), it is now time toplot the probability of bit error performance. Obtain a plot similar to Figure 11 for yourIIR notch filter design. Compare system performance with and without the notch filterturned on. Obtain the dB improvement due to your notch filter design at PE D 10

�6.

(e) Now with SIR = 5 dB and fj=Rb D 0:53 repeat part (d). Is it possible to design anotch filter that will give at least 1 dB improvement at PE D 10�6? what happens ifthe coefficient quantization is reduced to just 10 bits?

(f) Using the filter design of part (e) and SIR = 5 dB, vary the center frequency of thejammer, high then low relative to fj=Rb D 0:53, until the performance gain achievedwith the notch filter drops by 0.5 dB. The idea here is to see the impact of a havinga fixed center frequency notch filter in the presence of jammer frequency uncertainty.Comment on your results.

3. Repeat Task 2 parts (a)–(d) only, for the SRC filter. Comment on the BEP performanceimprovements achievable between the two pulse types.

4. From your observations via the above experiments, which pulse shaping RECT or SRC ismore robust in the face of single-tone jamming. Explain.

5. Comment on your overall experience with this team project.

ECE 2610 Final Project: Baseband Digital Communications 16

Page 17: ECE 2610 Spring 2011 Final Project Baseband Binary …mwickert/ece2610/lecture_notes/final_project/2… · ECE 2610 Spring 2011 Final Project Baseband Binary Communications Over a

REFERENCES

References[1] R. Ziemer and W. Tranter, Principles of Communications, sixth edition, Prentice Hall, New

Jersey, 2009.

A MATLAB Function ListingsIn this appendix the complete MATLAB m-code listings are provided for all of the custom functionsused in this project. The main functions bb_tx() and bb_rx() are listed first.

A.1 Transmitter Including Tone Jammer and Noisefunction [r,data] = bb_tx(Nbits,SIR,fj,SNR,Ns,pulse)function [r,data] = bb_tx(Nbits,SIR,fj,SNR,Ns,pulse)% [r,data] = bb_tx(Nbits,SIR,fj,SNR,Ns,pulse)% Baseband binary signal source including noise and jamming%% ----------------- Inputs ---------------------------------% Nbits = number of bits to simulate% SIR = signal-to-interference (jammer) ratio in dB% fj = bit rate normalized jammer frequency% SNR = signal-to-noise ratio in dB% Ns = number of samples per bit in waveform simulation% pulse = transmitted pulse type, RECT = rectangular,% SRC = square-root raised cosine with alpha = 0.5%% ----------------- Outputs ----------------------------------% r = transmitted signal as a data structure containing variations% of signal (S), jamming (J), and noise (N), in particular% r.SJN = S + J + N% r.SJ = S + J (signal plus jamming only)% r.N = N (noise only)% r.SNR = SNR to use later inside the receiver bb_rx% r.NS = NS to use later inside the receiver bb_rx% r.pulse = pulse to use later inside the receiver bb_rx% data = data bits transmitted as +1/-1 bit values; can be used for% error checking in Monte-Carlo type simulation% -------------------------------------------------------------%% Mark Wickert, November 2006

data = sign(rand(1,Nbits)-0.5);x = [data; zeros(Ns-1,Nbits)];x = reshape(x,1,Ns*Nbits);

switch lower(pulse) % not case sensitivecase ’src’

h_src = sqrt_rc_imp(Ns,0.5,6);x = filter(h_src,1,x);

case ’rect’

ECE 2610 Final Project: Baseband Digital Communications 17

Page 18: ECE 2610 Spring 2011 Final Project Baseband Binary …mwickert/ece2610/lecture_notes/final_project/2… · ECE 2610 Spring 2011 Final Project Baseband Binary Communications Over a

A.2 Receiver with Inputs for Nulling Filter Coefficients

h_rect = ones(1,Ns);x = filter(h_rect,1,x);

otherwiseerror(’pulse must be SRC or RECT’)

endPx = var(x);

% Create a single tone jammern = 0:length(x)-1;x_jammer = cos(2*pi*fj/Ns*n + 2*pi*rand(1,1));x_jammer = sqrt(Px*10^(-SIR/10))*x_jammer;% Create white Gaussian noisew = sqrt(Ns*Px*10^(-SNR/10))*randn(size(x));% Form output signal combinations in data structure variable rr.SJN = x + x_jammer + w; % Complete signalr.SJ = x + x_jammer; % Signal + Jammer reference signalr.N = w; % Noise alone reference signalr.SNR = SNR;r.Ns = Ns;r.pulse = pulse;

A.2 Receiver with Inputs for Nulling Filter Coefficientsfunction [PE,SNR_dB,y,z] = bb_rx(r,b_null,a_null,Ifilt_mode)% [PE,SNR_dB,y,z] = bb_rx(r,b_null,a_null,Ifilt_mode)% Matched filter receiver including a front-end nulling filter. This% receiver using the data structure variable input r to also obtain a% probability of bit error measurement using the semi-analytic simulation% technique.%% ------------------------- Inputs --------------------------------------% r = received signal as a data structure containing variations% of signal (S), jamming (J), and noise (N), in particular% r.SJN = S + J + N% r.SJ = S + J (signal plus noise only)% r.N = N (noise only)% r.SNR = SNR to use later inside the receiver bb_rx% r.NS = NS to use later inside the receiver bb_rx% r.pulse = pulse to use later inside the receiver bb_rx% b_null = nulling filter numerator coefficient vector% a_null = nulling filter denominator coefficient vector% Ifilt_mode = input ’notch_on’ to include nulling filter,% input ’notch_off’ to bypass nulling filter%% ------------------------- Outputs -------------------------------------% PE = vector of estimated probability of bit error over the range of% SNR values in dB found in SNR_dB% SNR_dB = a vector of SNR values corresponding to the PE vector% y = data structure variable corresponding to the signal components% contained in r, but at the output of the nulling (notch filter)% z = data structure variable corresponding to the signal components% contained in r, but at the output of the matched filter%

ECE 2610 Final Project: Baseband Digital Communications 18

Page 19: ECE 2610 Spring 2011 Final Project Baseband Binary …mwickert/ece2610/lecture_notes/final_project/2… · ECE 2610 Spring 2011 Final Project Baseband Binary Communications Over a

A.2 Receiver with Inputs for Nulling Filter Coefficients

% Mark Wickert, November 2006

switch lower(Ifilt_mode) % not case sensitivecase ’notch_on’ % apply jammer nulling filter

% Filter signal+jammer+noise% with interference rejection filtery.SJN = filter(b_null,a_null,r.SJN);

% Filter signal+jammer% with interference rejection filtery.SJ = filter(b_null,a_null,r.SJ);

% Filter noise aloney.N = filter(b_null,a_null,r.N);

case ’notch_off’ % do not filter with jammer nulling filtery.SJN = r.SJN;y.SJ = r.SJ;y.N = r.N;

otherwiseerror(’Ifilt_mode must be Notch_on or Notch_off’)

end%//////////////////////////////////////////////////

%//////////////////////////////////////////////////% Design signal matched filtersswitch lower(r.pulse) % not case sensitive

case ’src’h_MF = sqrt_rc_imp(r.Ns,0.5,6)/r.Ns;

case ’rect’h_MF = ones(1,r.Ns)/r.Ns;

otherwiseerror(’pulse must be SRC or RECT’)

end

% Filter signal+jammer+noise% with receiver AWGN matched filterz.SJN = filter(h_MF,1,y.SJN);

% Filter signal+jammer% with receiver AWGN matched filterz.SJ = filter(h_MF,1,y.SJ);

% Filter noise% with receiver AWGN matched filterz.N = filter(h_MF,1,y.N);var_N = var(z.N);%//////////////////////////////////////////////////

%//////////////////////////////////////////////////% Process matched filter output into bit decision samples% by sampling the signal once per bit at the optimum sampling% instant. We do this for all three waveforms to allow for% both Monte-Carlo probability of bit error analysis and% semi-analytic probability of bit error analysis.

ECE 2610 Final Project: Baseband Digital Communications 19

Page 20: ECE 2610 Spring 2011 Final Project Baseband Binary …mwickert/ece2610/lecture_notes/final_project/2… · ECE 2610 Spring 2011 Final Project Baseband Binary Communications Over a

A.3 FIR Square-root Raised Cosine Pulse Shaping Filter Design

% Estimate the optimum bit sampling pointPwr = zeros(1,r.Ns);for k=1:r.Ns

Pwr(k) = var(z.SJ(k:r.Ns:end));end[max_Pwr_I,opt_index] = max(Pwr);

N_hold = 50; % Filter transient delay in bitsd = z.SJ(opt_index:10:end);d = d(N_hold:end);

% Estimate Probability of Bit Error using Semi-Analytic TechniqueSNR_dB = 0:.5:20;PE = zeros(size(SNR_dB));for k=1:length(SNR_dB)

PE(k) = 1/2*sum(erfc(abs(d)/sqrt(var_N/10^((SNR_dB(k)-r.SNR)/10))));endPE = PE/length(d);

A.3 FIR Square-root Raised Cosine Pulse Shaping Filter Designfunction b = sqrt_rc_imp(Ns,alpha,M)% b = sqrt_rc_imp(Ns,alpha,M)% Sqrt-Raised-Cosine Impulse Response Filter% Ns = number of samples per symbol%alpha = excess bandwidth factor = 0.35 for IS 136% M = equals sqrt(RC) one-sided symbol truncation factor

% Design the filtern = -M*Ns:M*Ns;b = zeros(size(n));a = alpha;for i=1:length(n),

if (1 - 16*a^2*(n(i)/Ns)^2) == 0b(i) = 1/2*((1+a)*sin((1+a)*pi/(4*a))-(1-a)...

*cos((1-a)*pi/(4*a))+(4*a)/pi*sin((1-a)*pi/(4*a)));else

b(i) = 4*a./(pi*(1 - 16*a^2*(n(i)/Ns).^2));b(i) = b(i).*(cos((1+a)*pi*n(i)/Ns) + sinc((1-a)*n(i)/Ns)*(1-a)*pi/(4*a));

endend

A.4 Probability of Bit Error Plotting Functionfunction plot_PE(SNR_dB,PE,style)% A function for plotting bit error probability (BEP)curves in a semilog% plot format.%% --------------------- Inputs ----------------------------------------% SNR_dB = vector of SNR values in dB% PE = vector of PE values% style = a string variable containing the plot style options used in

ECE 2610 Final Project: Baseband Digital Communications 20

Page 21: ECE 2610 Spring 2011 Final Project Baseband Binary …mwickert/ece2610/lecture_notes/final_project/2… · ECE 2610 Spring 2011 Final Project Baseband Binary Communications Over a

A.5 Eyeplot Function

% MATLABs plot function%% As a special case this function plot the theoretical BEP curve if no% input arguments are given.%% Mark Wickert, November 2006

% With no input arguments plot a theoretical PE reference curveif nargin == 0

SNR_dB = 0:.2:15;PE_thy = 1/2*erfc(sqrt(10.^(SNR_dB/10)));semilogy(SNR_dB,PE_thy,’k’,’LineWidth’,2);gridset(gca,’YminorGrid’,’off’)xlabel(’E_b/N_0 (dB)’)ylabel(’Probability of Bit Error’)title(’BEP Comparison Plot’,’FontWeight’,’Bold’,’FontSize’,12);axis([0 18 1e-7 1e-1]) % Choose an axis limits starting point

else% With input arguments plot the input PE datasemilogy(SNR_dB,PE,style,’LineWidth’,1);

end

A.5 Eyeplot Functionfunction eyeplot(data, W, OFS)% eyeplot eyeplot(data, W, offset): Plot the eye pattern of a digital% communication waveform using a window length of W and offset% OFS

% define some variablesx = 0:W-1;L = length(data);% set axis limitsLimit = max([abs(min(data)) abs(max(data))]);axis([0,W,-Limit,Limit]);

while L >= W+OFS,temp = data(1+OFS:W+OFS);plot(x,temp);hold ondata = data(W+1:L);L = length(data);

end

hold off

A.6 Power Spectrum Estimation Functionfunction [Px,F] = simpleSA(x,N,fs,min_dB,max_dB,color)% [Px,F] = simpleSA(x,N,fs,min_dB,max_dB,color)% Plot the estimated power spectrum of real and complex baseband signals% using the toolbox function psd(). This replaces the use of psd().

ECE 2610 Final Project: Baseband Digital Communications 21

Page 22: ECE 2610 Spring 2011 Final Project Baseband Binary …mwickert/ece2610/lecture_notes/final_project/2… · ECE 2610 Spring 2011 Final Project Baseband Binary Communications Over a

A.7 Coefficient Quantize Function

%% x = complex baseband data record, at least N samples in length% N = FFT length% fs = Sampling frequency in Hz% min_dB = floor of spectral plot in dB% max_dB = ceiling of spectral plot in dB% color = line color and type as a string, e.g., ’r’ or ’r--%%////////// Optional output variables ///////////////////////////////////% Px = power spectrum estimate values on two-sided frequency axis% F = the corresponding frequency axis values%% Mark Wickert, October 2008

% while length(x) < N% N = N/2;% end

warning offif isreal(x)

[Px,F] = psd(x,N,fs);else

[Px,F] = psd(x,[],[],N,fs);N = fix(length(F)/2);F = [F(end-N+1:end)-fs; F(1:N)];Px = [Px(end-N+1:end); Px(1:N)];

endwarning on

if nargout == 2return

end

if nargin == 3 || nargin == 5,plot(F,10*log10(Px))

elseplot(F,10*log10(Px),color)

end

if nargin >= 5axis([F(1) F(end) min_dB max_dB]);

end

xlabel(’Frequency (Hz)’)ylabel(’Power Spectrum in dB’)grid on

A.7 Coefficient Quantize Functionfunction xq = simpleQuant(x,Btot,Xmax,Limit)% xq = simpleQuant(x,Btot,Xmax,Limit)% A simple rounding quantizer for bipolar signals having Btot = B + 1 bits%========================== Inputs ===============

ECE 2610 Final Project: Baseband Digital Communications 22

Page 23: ECE 2610 Spring 2011 Final Project Baseband Binary …mwickert/ece2610/lecture_notes/final_project/2… · ECE 2610 Spring 2011 Final Project Baseband Binary Communications Over a

%% x = input signal vector to be quantized% Btot = total number of bits in the quantizer% Xmax = quantizer full-scale dynamic range since bipolar the total% range is [-Xmax, Xmax]% Limit = Limiting of the form ’sat’, ’over’, ’none’%%-------------------------- Outputs ----------------------------------------% xq = quantized output%% Mark Wickert October 2008

B = Btot-1;

x = x/Xmax;

if strcmp(Limit, ’over’)xq = (mod(round(x*2^B)+2^B,2^Btot)-2^B)/2^B;

elseif strcmp(Limit, ’sat’)xq = round(x*2^B)+2^B;s1 = find(xq >= 2^Btot-1);s2 = find(xq < 0);xq(s1) = (2^Btot - 1)*ones(size(s1));xq(s2) = zeros(size(s2));xq = (xq - 2^B)/2^B;

elseif strcmp(Limit, ’none’)xq = round(x*2^B)/2^B;

elseerror(’limit must be the string over, sat, or none’)

end

xq = xq*Xmax;

B Semi-Analytic Bit Error ProbabilityThe semi-analytic bit error probability estimation technique assumes that the statistics at the outputof the matched filter, where it is sampled at the maximum eye opening, are conditionally Gaussian.It is also assumed that the signal processing up to the decision point is linear, that is superpositionholds.

To implement the technique we need to be able to know the variance of the conditionallyGaussian samples and then be able to collect a set of samples corresponding to the conditionalmean which changes with other distortion attributes dependent upon signal and interference beingprocessed by linear time-invariant filters. The noise power at the sampling instant is measuredusing a pure noise signal applied from the receiver input and measured at the matched filter output.The conditional mean samples are collected by applying only signal and interference (no noise)to the receiver and collecting the sample values at the optimum, once per bit, sampling point. To

ECE 2610 Final Project: Baseband Digital Communications 23

Page 24: ECE 2610 Spring 2011 Final Project Baseband Binary …mwickert/ece2610/lecture_notes/final_project/2… · ECE 2610 Spring 2011 Final Project Baseband Binary Communications Over a

estimate the bit error probability we form the sum

OPE D1

Nbits

NbitsXkD1

1

2erfc

"jzŒnopt C .1 � k/Ns�jp�2

noise10(SNRdB�SNRref/=10

#(8)

where nopt denotes the optimum sampling instant, and SNRref is the SNR value used to calibratethe noise variance.

C Bit Timing EstimationTo obtain an estimate of the optimum bit timing or sampling instant a samples of the matchedfilter output are taken at all possible timing alignments. The variance or power contained in thesesamples is then calculated. The set o f samples that gives the maximum power corresponds tothe maximum eye opening, on average, across all the bits being considered. This then forms theoptimum timing estimate or location at which to sample the matched filter output once every bittime.

% Estimate the optimum bit sampling pointPwr = zeros(1,r.Ns);for k=1:r.Ns

Pwr(k) = var(z.SJ(k:r.Ns:end));end[max_Pwr_I,opt_index] = max(Pwr);

N_hold = 50; % Filter transient delay in bitsd = z.SJ(opt_index:10:end);d = d(N_hold:end);

A plot of the power function versus sampling instant, denoted Sampling Index, is given inFigure 12.

ECE 2610 Final Project: Baseband Digital Communications 24

Page 25: ECE 2610 Spring 2011 Final Project Baseband Binary …mwickert/ece2610/lecture_notes/final_project/2… · ECE 2610 Spring 2011 Final Project Baseband Binary Communications Over a

1 2 3 4 5 6 7 8 9 100.75

0.8

0.85

0.9

0.95

1

Varia

nce

at S

ampl

ing

Inst

ant

Sampling Index (nopt)

Optimum sampling index = 1

Figure 12: Plot of the sampling instant variance used to estimate the bit sample timing.

ECE 2610 Final Project: Baseband Digital Communications 25