19
Signal-to-Noise Characteristics of ‘Return-to-Zero’ PN Codes for CW Lidar Measurement Systems Tucker Leavitt Function Definitions In[1]:= MCode1@seed_D := Module@8a<, RecurrenceTable@ 8a@nD BitXor@a@n - 8D,a@n - 6D,a@n - 3D,a@n - 2DD,a@1D seed@@1DD, a@2D seed@@2DD,a@3D seed@@3DD,a@4D seed@@4DD,a@5D seed@@5DD, a@6D seed@@6DD,a@7D seed@@7DD,a@8D seed@@8DD<, a, 8n, 1, 255<DD; H*"Employs the XOR operator to generate a non-negative pseudorandom bit sequence Hthe PN codeL of degree 8 given an 8-bit seed. The sequence has a period of 2 8 -1= 255"*L MCode2@seed_D := 2 * MCode1@seedD - 1; H*"Generates bipolar version of MCode1@seedDHthe PN code kernelL. Every 0 in MCode1@seedD is a -1 in MCode2@seedD."*L Hl@t_, arz_D := Piecewise@881, 0 £ t&&t < arz * tbit<<,0D; H*"Defines a pulse function Hl@tD to be used as the building block for a return-to-zero HRZL PN laser signal function. The pulse function is 1 over the interval @0,arz*tbitL and zero everywhere else. tbit is the PN code bitwidth and arz is the RZ ratio."*L Sl@t_, code_D := Sum@code@@iDD * Hl@t - Hi - 1L * tbitD, 8i, 1, Length@codeD<D; H*"Defines a RZ PN laser signal as a function of time. The signal is a sum of many shifted pulses with amplitudes corresponding to the bits in code. arz must be between 0 and 1 for the signal to be meaningful."*L ResampleRZ@code_, arz_, M_D := Table@ Hl@x - Floor@xD, arzD * code@@Floor@xDDD, 8x, 1, Length@codeD + HM - 1L M, 1 M<D; H*"Simulates the oversampling of a RZ PN modulated signal by a factor of M. To ensure the function samples often enough, M is chosen to be an integer greater than or equal to 2arz."*L CrossCorrelate@a_, b_D := Sqrt@Length@aDD * InverseFourier@Conjugate@Fourier@aDD * Fourier@bDD; H*"Correlates two sequences a and b. This function exploits the relationship between cross-correlation and Fourier transforms. If b is a time lagged version of a, then the location of the peak on the correlation function will correspond to the time delay on b. The coefficient out in front of the computation compensates for the normalization Mathematica automatically performs when calling Fourier."*L PowerSpectrum@a_D := Fourier@CrossCorrelate@a, aDD; H*"Computes the power spectral density of a discrete signal a. This function exploits the Wiener–Khinchin theorem to perform the computation.*L Printed by Mathematica for Students

Signal-to-Noise Characteristics of ‘Return-to-Zero’ PN ...tleavittdp.weebly.com/uploads/1/0/0/4/10046782/rz_pn_code_presen… · else. tbit is the PN code bitwidth and arz is

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Signal-to-Noise Characteristics of ‘Return-to-Zero’ PN ...tleavittdp.weebly.com/uploads/1/0/0/4/10046782/rz_pn_code_presen… · else. tbit is the PN code bitwidth and arz is

Signal-to-Noise Characteristics of ‘Return-to-Zero’ PN Codes for CW Lidar Measurement Systems

Tucker Leavitt

Function Definitions

In[1]:=MCode1@seed_D := Module@8a<, RecurrenceTable@

8a@nD � BitXor@a@n - 8D, a@n - 6D, a@n - 3D, a@n - 2DD, a@1D � seed@@1DD,

a@2D � seed@@2DD, a@3D � seed@@3DD, a@4D � seed@@4DD, a@5D � seed@@5DD,

a@6D � seed@@6DD, a@7D � seed@@7DD, a@8D � seed@@8DD<, a, 8n, 1, 255<DD;

H*"Employs the XOR operator to generate a non-negative pseudorandom

bit sequence Hthe PN codeL of degree 8 given an 8-bit

seed. The sequence has a period of 28-1= 255"*L

MCode2@seed_D := 2 * MCode1@seedD - 1;

H*"Generates bipolar version of MCode1@seedD Hthe PN code

kernelL. Every 0 in MCode1@seedD is a -1 in MCode2@seedD."*L

Hl@t_, arz_D := Piecewise@881, 0 £ t && t < arz * tbit<<, 0D;

H*"Defines a pulse function Hl@tD to be used as the building

block for a return-to-zero HRZL PN laser signal function. The pulse

function is 1 over the interval @0,arz*tbitL and zero everywhere

else. tbit is the PN code bitwidth and arz is the RZ ratio."*L

Sl@t_, code_D := Sum@code@@iDD * Hl@t - Hi - 1L * tbitD, 8i, 1, Length@codeD<D;

H*"Defines a RZ PN laser signal as a function of time. The signal is a sum

of many shifted pulses with amplitudes corresponding to the bits in

code. arz must be between 0 and 1 for the signal to be meaningful."*L

ResampleRZ@code_, arz_, M_D := Table@Hl@x - Floor@xD, arzD * code@@Floor@xDDD, 8x, 1, Length@codeD + HM - 1L � M, 1 � M<D;

H*"Simulates the oversampling of a RZ PN modulated signal by a

factor of M. To ensure the function samples often enough, M

is chosen to be an integer greater than or equal to 2�arz."*L

CrossCorrelate@a_, b_D :=

Sqrt@Length@aDD * InverseFourier@Conjugate@Fourier@aDD * Fourier@bDD;

H*"Correlates two sequences a and b. This function exploits the

relationship between cross-correlation and Fourier transforms. If

b is a time lagged version of a, then the location of the peak on

the correlation function will correspond to the time delay on b.

The coefficient out in front of the computation compensates for the

normalization Mathematica automatically performs when calling Fourier."*L

PowerSpectrum@a_D := Fourier@CrossCorrelate@a, aDD;

H*"Computes the power spectral density of a discrete signal a. This function

exploits the Wiener–Khinchin theorem to perform the computation.*L

Printed by Mathematica for Students

Page 2: Signal-to-Noise Characteristics of ‘Return-to-Zero’ PN ...tleavittdp.weebly.com/uploads/1/0/0/4/10046782/rz_pn_code_presen… · else. tbit is the PN code bitwidth and arz is

In[1]:=

Noise@N_D := Table@RandomInteger@D, 8N<D;

H*"Generates a sequence of N random bits to be used in theoretical

calculations of the signal-to-noise ratios of various PN signals."*L

PowerRegression@data_D := ModuleB8A, B, xv, yv, i, j, Rsqj<,

xv = Table@Part@data@@n1DD, 1D, 8n1, 1, Length@dataD<D;

yv = Table@Part@data@@n2DD, 2D, 8n2, 1, Length@dataD<D;

Rsqj = Rsq = 0;

DoB

DoB

B =

Log@yv@@iDDD - Log@yv@@jDDDLog@xv@@iDDD - Log@xv@@jDDD

;

A = yv@@jDD * xv@@jDD^H-BL;

Rsqj = 1 -

SumAHyv@@lDD - A * xv@@lDD^BL2, 8l, Length@yvD<E

SumAHyv@@kDD - Mean@yvDL2, 8k, Length@yvD<E;

If@Rsqj > Rsq, a = A; b = B; Rsq = RsqjD;

Clear@A, B, RsqjD,

8i, j + 1, Length@dataD<F, 8j, 1, Length@dataD - 1<F;F;

H*"Fits a curve of the form y=a*x^b to an entered set of Hx, yLdata points. The input should be a list of the form 88x1, y1<, 8x2,

y2<, ...< corresponding to data points Hx1, y1L, Hx2, y2L, ..."*L

AsympRegression@data_D := ModuleB8xv, yv, n, i, j<,

n = Length@dataD;

xv = Table@Part@data@@n1DD, 1D, 8n1, 1, n<D;

yv = Table@Part@data@@n2DD, 2D, 8n2, 1, n<D;

c = Part@Inverse@88n, -Sum@1 � xv@@iDD, 8i, 1, n<D<,

8Sum@1 � xv@@iDD, 8i, 1, n<D, -Sum@1 � xv@@iDD^2, 8i, 1, n<D<<D.

8Sum@yv@@iDD, 8i, 1, n<D, Sum@yv@@iDD � xv@@iDD, 8i, 1, n<D<, 1D;

d = Part@Inverse@88n, -Sum@1 � xv@@iDD, 8i, 1, n<D<,

8Sum@1 � xv@@iDD, 8i, 1, n<D, -Sum@1 � xv@@iDD^2, 8i, 1, n<D<<D.

8Sum@yv@@iDD, 8i, 1, n<D, Sum@yv@@iDD � xv@@iDD, 8i, 1, n<D<, 2D;

Rsq = 1 -

Sum@Hyv@@lDD - c + d � xv@@lDDL^2, 8l, Length@yvD<DSum@Hyv@@kDD - Mean@yvDL^2, 8k, Length@yvD<D

;

F;

H*"Fits a curve of the form y=c-d�x to an entered set of Hx, yLdata points. The input should be a list of the form 88x1, y1<, 8x2,

y2<, ...< corresponding to data points Hx1, y1L, Hx2, y2L, ..."*L

Examples

2 RZ PN Code Presentation.nb

Printed by Mathematica for Students

Page 3: Signal-to-Noise Characteristics of ‘Return-to-Zero’ PN ...tleavittdp.weebly.com/uploads/1/0/0/4/10046782/rz_pn_code_presen… · else. tbit is the PN code bitwidth and arz is

Examples

In[11]:=Column@8ListPlot@MCode1@81, 0, 1, 0, 1, 1, 1, 0<D@@1 ;; 100DD, Filling ® Axis,

PlotRange ® 8-1.1, 1.1<, AxesLabel ® 8"i", "Si"<, Background ® LightGray,

ImageSize ® MediumD, ListPlot@MCode2@81, 0, 1, 0, 1, 1, 1, 0<D@@1 ;; 100DD,

Filling ® Axis, PlotRange ® 8-1.2, 1.2<, AxesLabel ® 8"i", "Si"<,

Background ® LightGray, ImageSize ® MediumD<DH*"Plots the first hundred terms in the nonnegative PN sequence

S = MCode1@81,0,1,0,1,1,1,0<D and the first hundred terms

in the bipolar PN sequence S = MCode2@81,0,1,0,1,1,1,0<D."*L

Out[11]=

20 40 60 80 100i

-1.0

-0.5

0.5

1.0

Si

20 40 60 80 100i

-1.0

-0.5

0.5

1.0

Si

RZ PN Code Presentation.nb 3

Printed by Mathematica for Students

Page 4: Signal-to-Noise Characteristics of ‘Return-to-Zero’ PN ...tleavittdp.weebly.com/uploads/1/0/0/4/10046782/rz_pn_code_presen… · else. tbit is the PN code bitwidth and arz is

In[12]:=a1 = MCode2@81, 0, 1, 0, 1, 1, 1, 0<D;

b1 = MCode1@81, 0, 1, 0, 1, 1, 1, 0<D;

tbit = 1;

ManipulateB

ColumnB:PlotBSumBb1@@iDD * UnitBoxBt - Hi - 1L * tbit

arz * tbit- 0.5F, 8i, 1, 10<F, 8t, 0, 10< ,

Background ® LightGray, AxesLabel ® 9"t", "SlsigHtL" =,

PlotRange ® 8-1.1, 1.1<, ImageSize ® MediumF,

PlotBSumBa1@@iDD * UnitBoxBt - Hi - 1L * tbit

arz * tbit- 0.5F, 8i, 1, 10<F,

8t, 0, 10< , Background ® LightGray, AxesLabel ® 8"t", "SlkerHtL" <,

PlotRange ® 8-1.1, 1.1<, ImageSize ® MediumF>F , 88arz, 1<, 0.2, 1<FH*"Plots Sl@tD for code = MCode1@81,0,1,0,1,1,1,0<D Hthe PN signalL

and code = MCode2@81,0,1,0,1,1,1,0<D Hthe PN kernelL over

@0, 10D Hnote that UnitBox@t�Harz*tbitL-0.5D serves the same

function as Hl@tDL. Adjust the slider to vary the return-to-zero

ratio and notice how the signals' duty cycles change."*L

4 RZ PN Code Presentation.nb

Printed by Mathematica for Students

Page 5: Signal-to-Noise Characteristics of ‘Return-to-Zero’ PN ...tleavittdp.weebly.com/uploads/1/0/0/4/10046782/rz_pn_code_presen… · else. tbit is the PN code bitwidth and arz is

Out[15]=

arz

2 4 6 8 10t

-1.0

-0.5

0.5

1.0

SlsigHtL

2 4 6 8 10t

-1.0

-0.5

0.5

1.0

SlkerHtL

RZ PN Code Presentation.nb 5

Printed by Mathematica for Students

Page 6: Signal-to-Noise Characteristics of ‘Return-to-Zero’ PN ...tleavittdp.weebly.com/uploads/1/0/0/4/10046782/rz_pn_code_presen… · else. tbit is the PN code bitwidth and arz is

In[16]:=

Manipulate@ListPlot@ResampleRZ@MCode1@81, 0 , 1, 0, 1, 1, 1, 0<D, 1, MD@@1 ;; 50DD,

Filling ® Axis, PlotRange ® 8-1.1, 1.1<, AxesLabel ® 8"i", "Si"<,

Background ® LightGrayD, 8M, 1, 10, 1<DH*"Plots the first 50 terms of an oversampled version of

MCode1@81, 0, 1, 0, 1, 1, 1, 0<D. Adjust the slider to vary the

oversampling factor M and observe how the sequence changes."*L

Out[16]=

M

10 20 30 40 50i

-1.0

-0.5

0.5

1.0

Si

6 RZ PN Code Presentation.nb

Printed by Mathematica for Students

Page 7: Signal-to-Noise Characteristics of ‘Return-to-Zero’ PN ...tleavittdp.weebly.com/uploads/1/0/0/4/10046782/rz_pn_code_presen… · else. tbit is the PN code bitwidth and arz is

In[17]:=Manipulate@

ListPlot@ResampleRZ@MCode1@81, 0 , 1, 0, 1, 1, 1, 0<D, arz, 10D@@1 ;; 50DD,

Filling ® Axis, PlotRange ® 8-1.1, 1.1<, AxesLabel ® 8"i", "Si"<,

Background ® LightGrayD, 88arz, 1<, .1, 1, .1<DH*"Plots the first 50 terms of a 10x oversampled version of

MCode1@81, 0, 1, 0, 1, 1, 1, 0<D. Adjust the slider to vary the

return-to-zero ratio arz and observe how the sequence changes."*L

Out[17]=

arz

10 20 30 40 50i

-1.0

-0.5

0.5

1.0

Si

RZ PN Code Presentation.nb 7

Printed by Mathematica for Students

Page 8: Signal-to-Noise Characteristics of ‘Return-to-Zero’ PN ...tleavittdp.weebly.com/uploads/1/0/0/4/10046782/rz_pn_code_presen… · else. tbit is the PN code bitwidth and arz is

In[18]:=Manipulate@ListLinePlot@CrossCorrelate@a1, RotateRight@b1, lagDD, PlotRange ® All,

AxesLabel ® 8"n", "Ha1øb1LHnL" <, Background ® LightGrayD, 88lag, 49<, 0, 254, 1<DH*"Plots the cross correlation of the PN code kernel a1 with a lagged PN

code b1. Adjust the slider to change the lag on b1. The peak of the

cross correlation function occurs when t = lag Hi.e. at the point

where b is shifted to align exactly with aL. Since a1 and b1 are

8th degree PN sequences, the correlation function peak's amplitude

is 28-1= 128. The function is nominally zero everywhere else.".*L

Out[18]=

lag

50 100 150 200 250n

20

40

60

80

100

120

Ha1øb1LHnL

8 RZ PN Code Presentation.nb

Printed by Mathematica for Students

Page 9: Signal-to-Noise Characteristics of ‘Return-to-Zero’ PN ...tleavittdp.weebly.com/uploads/1/0/0/4/10046782/rz_pn_code_presen… · else. tbit is the PN code bitwidth and arz is

In[19]:=Manipulate@ListLinePlot@

CrossCorrelate@ResampleRZ@a1, arz, MD, RotateRight@ResampleRZ@ b1, arz, MD, 49DD@@25 ;; 75DD, PlotRange ® 1300, DataRange ® 825, 75<,

AxesLabel ® 8"n", "Ha1øb1LHnL" <, Background ® LightGrayD,

88M, 10<, 1, 10, 1<, 88arz, 1<, 0.1, 1, 0.1<DH*"Plots the cross correlation of a1 and b1 when the sequences are

oversampled by a factor of M at a return-to-zero ratio of arz, and

shows a closeup of the peak. Adjust the slider to vary M. Notice

how as M increases, the peak amplitude increases, and the resolution

decreases. The peak width is equal to 2*Ceiling@arz*MD, and the peak

amplitude is equal to Ceiling@arz*MD*28-1= 128*Ceiling@arz*MD Hsince

a1 and b1 are 8th degree PN sequencesL. Be aware that aliasing occurs

when M is less than 2�arz due to the discrete nature of a1 and b1."*L

Out[19]=

M

arz

30 40 50 60 70n

200

400

600

800

1000

1200

Ha1øb1LHnL

RZ PN Code Presentation.nb 9

Printed by Mathematica for Students

Page 10: Signal-to-Noise Characteristics of ‘Return-to-Zero’ PN ...tleavittdp.weebly.com/uploads/1/0/0/4/10046782/rz_pn_code_presen… · else. tbit is the PN code bitwidth and arz is

In[20]:=Manipulate@ListLinePlot@Abs@PowerSpectrum@ResampleRZ@a1, arz, 10DDD,

PlotRange ® 550, Background ® LightGrayD, 88arz, 1<, 0.1, 1, .1<DH*"Plots the power spectrum of the oversampled PN kernel a1. In actuality

the spectrum is a sinc function; the function's negative half is just

translated 1255 bits to the right. Adjust the slider to vary the

return-to-zero ratio arz and notice how the power spectrum flattens out."*L

Out[20]=

arz

0 500 1000 1500 2000 2500

100

200

300

400

500

10 RZ PN Code Presentation.nb

Printed by Mathematica for Students

Page 11: Signal-to-Noise Characteristics of ‘Return-to-Zero’ PN ...tleavittdp.weebly.com/uploads/1/0/0/4/10046782/rz_pn_code_presen… · else. tbit is the PN code bitwidth and arz is

Theoretical SNR Analysis

In[21]:=noise = Noise@2550D;

Manipulate@Column@8Module@8a2 = ResampleRZ@a1, arz, 10D,

b2 = RotateRight@ResampleRZ@b1, arz, 10D, 49D<,

ListLinePlot@CrossCorrelate@a2, b2 + noiseD@@25 ;; 75DD, PlotRange ® 1300,

DataRange ® 825, 75<, AxesLabel ® 8"n", "Ha2øHb2+noiseLLHnL" <, Background ®

LightGray, ImageSize ® MediumDD, Module@8a2 = ResampleRZ@a1, arz, 10D,

b2 = RotateRight@ResampleRZ@b1, arz, 10D, 49D<, cc = CrossCorrelate@a2, b2D;

ccnoise = CrossCorrelate@a2, noiseD; Asig = Max@ccD;

Anoise = Sqrt@1 � 2550 * Sum@ccnoise@@iDD, 8i, 1, 2550<DD;

Row@8Style@"SNR = ", Italic, 16, FontFamily ® TimesD, Style@Asig � Anoise,

Italic, 16, FontFamily ® TimesD<DD<D, 88arz, 1<, 0.1, 1, 0.1<DH*"Oversamples a1 and b1 by a factor of 10, corrupts the oversampled b1

with random noise, and plots the cross correlation of the two resultant

sequences. Adjust the slider to vary arz; notice that the peak amplitude

and peak width decrease with arz. Also shown is a computation of the signal

to noise ratio for Ha2øHb2+noiseLL using the definition SNR =Signal Power

Noise Power

= @ Signal Amplitude

Noise AmplitudeD2. The signal amplitude is taken to be the corrleation

function peak's amplitude and is nominally arz*M*28-1. Oddly, the cross

correlation's signal to noise ratio trends much differently here than in the

SNR calculations performed in @2D and @3D, where it was concluded that SNR

increases with decreasing arz because the RZ kernel effectively 'gates out'

noise from the cross correlation function. Adjust the slider to vary arz,

and notice how the SNR decreases along with arz. The discrepancy between the

SNR as calculated here and the SNR as measured in @2D and @3D merits further

investigation into the signal-to-noise characteristics of RZ PN codes."*L

RZ PN Code Presentation.nb 11

Printed by Mathematica for Students

Page 12: Signal-to-Noise Characteristics of ‘Return-to-Zero’ PN ...tleavittdp.weebly.com/uploads/1/0/0/4/10046782/rz_pn_code_presen… · else. tbit is the PN code bitwidth and arz is

Out[22]=

arz

30 40 50 60 70n

200

400

600

800

1000

1200

Ha2øHb2+noiseLLHnL

SNR = 568.435

12 RZ PN Code Presentation.nb

Printed by Mathematica for Students

Page 13: Signal-to-Noise Characteristics of ‘Return-to-Zero’ PN ...tleavittdp.weebly.com/uploads/1/0/0/4/10046782/rz_pn_code_presen… · else. tbit is the PN code bitwidth and arz is

Experimental SNR Analysis

In[23]:=SetDirectory@D; SetDirectory@"PN code project"D; SetDirectory@"SNR Data"D;

data = 8Part@Import@"SNRPpk_0.5.xlsx"D, 1D,

Part@Import@"SNRPpk_0.25.xlsx"D, 1D, Part@Import@"SNRPpk_0.125.xlsx"D, 1D,

Part@Import@"SNRPpk_0.0625.xlsx"D, 1D, Part@Import@"SNRPpk_0.03125.xlsx"D, 1D<;

A = B = Rsq1 = 8<;

xv = Table@Flatten@dataD@@2 * i - 1DD, 8i, 1, Length@Flatten@dataDD � 2<D;

yv = Table@Flatten@dataD@@2 * iDD, 8i, 1, Length@Flatten@dataDD � 2<D;

min = Min@xvD; max = Max@xvD;

Do@PowerRegression@data@@iDDD; A = Join@A, 8a<D;

B = Join@B, 8b<D; Rsq1 = Join@Rsq1, 8Rsq<D, 8i, 1, 5<D;

ManipulateBColumnA9ShowALogLinearPlotAA@@iDD * Ppk^B@@iDD,

8Ppk, Min@xvD, Max@xvD<, PlotRange ® 8Min@yvD, Max@yvD<,

AxesLabel ® 9"Ppk", "SNR"=, Background ® LightGray, ImageSize ® MediumE,

ListLogLinearPlot@data@@iDD, Background ® LightGray, ImageSize ® MediumDE,

Row@8Style@"ΑRZ = ", Italic, 16, FontFamily ® TimesD,

Style@N@2 � H2^iLD, Italic, 16, FontFamily ® TimesD<D,

RowA9StyleA"R2= ", Italic, 12, FontFamily ® TimesE,

Style@N@Rsq1@@iDDD, Italic, 12, FontFamily ® TimesD=E=E,

:8i, 1, "Duty Cycle"<, :1 ® "1

2", 2 ® "

1

4", 3 ® "

1

8", 4 ® "

1

16", 5 ® "

1

32">>F

H*"This input has two parts. The first imports several files containing

experimentally collected data adapted from @2D. When presented in the

article, the data describe the relationship between the average power of

an outgoing RZPN lidar signal and the SNR of the return signal at various

signal duty cycles. I have manipulated the data to obtain a several new

data sets describing the relationship between the peak power of the

outgoing signal and the SNR of the return at various duty cycles. The

second part of the input takes the adapted data sets, each corresponding

to a certain signal duty cycle, and fits them with a model curve of the

form SNRDSHPpkL = a*Ppkb, where a and b are constants dependent on DS.

Notice that SNRDS1 is never less than SNRDS2 whenever DS1 is greater than DS2

Hthough sometimes the functions are virtually equalL. This indicates that

decreasing the duty cycle of an outgoing PN modulated lidar signal while

leaving the peak power constant decreases the SNR of the return signal."*L

RZ PN Code Presentation.nb 13

Printed by Mathematica for Students

Page 14: Signal-to-Noise Characteristics of ‘Return-to-Zero’ PN ...tleavittdp.weebly.com/uploads/1/0/0/4/10046782/rz_pn_code_presen… · else. tbit is the PN code bitwidth and arz is

Out[30]=

Duty Cycle1

2

1

4

1

8

1

16

1

32

5 ´ 10-16 1 ´ 10-15 5 ´ 10-15 1 ´ 10-14 5 ´ 10-14Ppk

10

20

30

40

50

SNR

ΑRZ = 1.R2 = 0.999295

14 RZ PN Code Presentation.nb

Printed by Mathematica for Students

Page 15: Signal-to-Noise Characteristics of ‘Return-to-Zero’ PN ...tleavittdp.weebly.com/uploads/1/0/0/4/10046782/rz_pn_code_presen… · else. tbit is the PN code bitwidth and arz is

In[31]:=step = Hmax - minL � 4;

Snrds@Pk_D := TableB:1

2^i, A@@iDD * Pk^B@@iDD>, 8i, 1, 5<F;

X = Y = Rsq2 = 8<;

Do@AsympRegression@Snrds@min + i * stepDD;

X = Join@X, 8c<D; Y = Join@Y, 8d<D; Rsq2 = Join@Rsq2, 8Rsq<D, 8i, 0, 4<D;

ManipulateAColumnA9Show@Plot@X@@iDD - Y@@iDD � DS, 8DS, 0, 0.5<,

PlotRange ® 810, 70<, AxesLabel ® 8"DS", "SNR"<D,

ListPlot@Snrds@min + Hi - 1L * stepDD, Background ® LightGray, ImageSize ® MediumD,

RowA9StyleA"Ppk = ", Italic, 16, FontFamily ® TimesE,

Style@N@min + Hi - 1L * stepD, Italic, 16, FontFamily ® TimesD=E,

RowA9StyleA"R2= ", Italic, 12, FontFamily ® TimesE,

Style@N@Rsq2@@iDDD, Italic, 12, FontFamily ® TimesD=E=E,

99i, 2, "Ppk"=, 82 ® "min + step", 3 ® "min + 2step",

4 ® "min + 3step", 5 ® "min + 4step"<=EH*"Takes the models produced by the previous input and uses them to derive

several relationships between the duty cycle of the outgoing signal

and the SNR of the return signal. The models are used instead of the

actual data because the peak signal power corresponding to each data

point is not standardized. Hence, in order to control for variations

in peak power between data points when comparing SNR and duty cycle,

one must interpolate points of constant peak power. Notice that the

model functions are all strictly increasing over the interval H0, ¥L.

The data sets themselves are not necessarily strictly increasing, as

with the last two sets SNRH0.25L is about 0.1 greater than SNRH0.5L.

However, since the relative difference between the two points , it is

safe to model the data sets with strictly increasing functions."*L

RZ PN Code Presentation.nb 15

Printed by Mathematica for Students

Page 16: Signal-to-Noise Characteristics of ‘Return-to-Zero’ PN ...tleavittdp.weebly.com/uploads/1/0/0/4/10046782/rz_pn_code_presen… · else. tbit is the PN code bitwidth and arz is

Out[35]=

Ppk min + step min + 2step min + 3step min + 4step

0.0 0.1 0.2 0.3 0.4 0.5DS

20

30

40

50

60

70SNR

Ppk = 1.44064 ´ 10-14

R2 = 0.981785

16 RZ PN Code Presentation.nb

Printed by Mathematica for Students

Page 17: Signal-to-Noise Characteristics of ‘Return-to-Zero’ PN ...tleavittdp.weebly.com/uploads/1/0/0/4/10046782/rz_pn_code_presen… · else. tbit is the PN code bitwidth and arz is

In[36]:=thry = Table@81 � 2^j, Module@8a2 = ResampleRZ@a1, 1 � 2^Hj - 1L, 10D,

b2 = RotateRight@ResampleRZ@b1, 1 � 2^Hj - 1L, 10D, 49D<,

cc = CrossCorrelate@a2, b2D; ccnoise = CrossCorrelate@a2, noiseD;

Asig = Max@ccD; Anoise = Sqrt@1 � 2550 * Sum@ccnoise@@iDD, 8i, 1, 2550<DD;

Asig � AnoiseD<, 8j, 1, 5<D;

AsympRegression@thryD;

ColumnA9Show@Plot@c - d � DS, 8DS, 0, 0.5<, PlotRange ® 80, 600<D, ListPlot@thryD,

ImageSize ® MediumD, RowA9StyleA"R2= ", Italic, 16, FontFamily ® TimesE,

Style@Rsq, Italic, 16, FontFamily ® TimesD=E=EH*"Attempts to fit a model of the form SNR = c - d�DS to the theoretical SNR

data generated in the previous section. As is apparent by the model's low R2

value, the curve does not fit the data set very well. This indicates that our

theoretical values for the SNR are rather dissimilar to the measured values."*L

Out[38]=

0.0 0.1 0.2 0.3 0.4 0.5

100

200

300

400

500

600

R2 = 0.72351

RZ PN Code Presentation.nb 17

Printed by Mathematica for Students

Page 18: Signal-to-Noise Characteristics of ‘Return-to-Zero’ PN ...tleavittdp.weebly.com/uploads/1/0/0/4/10046782/rz_pn_code_presen… · else. tbit is the PN code bitwidth and arz is

SNR-Ppk-DS ModelIn[39]:=

Xv = Table@8min + Hi - 1L * step, X@@iDD<, 8i, 1, Length@XD<D;

Yv = Table@8min + Hi - 1L * step, Y@@iDD<, 8i, 1, Length@YD<D;

PowerRegression@XvD; A1 = a; B1 = b; PowerRegression@YvD; A2 = a; B2 = b;

data3D = Flatten@Table@Table@Join@81 � 2^j<, Part@data@@jDD, iDD, 8i, 1, Length@data@@jDDD<D, 8j, 1, 5<D, 1D;

x3D = Table@Part@data3D@@iDD, 1D, 8i, 1, Length@data3DD<D;

y3D = Table@Part@data3D@@iDD, 2D, 8i, 1, Length@data3DD<D;

z3D = Table@Part@data3D@@iDD, 3D, 8i, 1, Length@data3DD<D;

Rsq3 = 1 - SumAHz3D@@lDD - HA1 * y3D@@lDD^B1L + HA2 * y3D@@lDD^B2L � x3D@@lDDL2,

8l, Length@data3DD<E � SumAHz3D@@kDD - Mean@z3DDL2, 8k, Length@data3DD<E;

ColumnA9ShowAPlot3DAHA1 * Ppk^B1L - HA2 * Ppk^B2L � DS, 8DS, 1 � 32, 0.5<,

8Ppk, 0, max<, ColorFunction ® "RustTones",

PlotStyle ® [email protected], AxesLabel ® 9"DS", "Ppk", "SNR"=E,

ListPointPlot3D@data3D, PlotStyle ® PointSize@MediumDD, ImageSize ® MediumE,

RowA9StyleA"R2= ", Italic, 14, FontFamily ® TimesE,

Style@N@Rsq3D, Italic, 14, FontFamily ® TimesD=E=EH*"Uses the model functions defined in the previous section Hi.e. those

relating peak power to SNR and duty cycle to SNRL to generate a

three-dimentional function relating duty cycle and peak power to SNR. The

function has the form SNR = HA1 PpkB1L -

IA2 PpkB2M

DSand was derived by taking

the two-dimensional model SNR = c -d

DSand expressing c and d in terms of

Ppk. Plotted along with the 3D model is the experimental data collected

in @2D. Upon inspection, it becomes clear that the model function has no

absolute maxima; its gradient, 8 A2 PpkB2

DS2, A1 B1 PpkB1-1

-A2 B2 Ppkb2-1

DS<, is zero

only when Ppk is zero. Now, whenever Ppk is zero, the function itself is

also zero, and since the function takes on positive values elsewhere,

it has no absolute maxima. According to the model, the SNR generally

increases with increasing peak power and increasing duty cycle. That is

to say, decreasing the duty cycle while holding the peak power constant

decreases the SNR. Thus, RZ PN modulated signals do not really have improved

signal-to-noise characteristics over NRZ PN modulated signals. However, a

RZ PN signal has higher peak power than a NRZ PN signal of the same average

power; it is this difference in peak power that accounts for the improved

signal-to-noise characteristics of RZ PN codes reported in @2D and @3D."*L

18 RZ PN Code Presentation.nb

Printed by Mathematica for Students

Page 19: Signal-to-Noise Characteristics of ‘Return-to-Zero’ PN ...tleavittdp.weebly.com/uploads/1/0/0/4/10046782/rz_pn_code_presen… · else. tbit is the PN code bitwidth and arz is

Out[47]=

0.1

0.2

0.3

0.4

0.5

DS

0

2. ´ 10-14

4. ´ 10-14

Ppk

0

20

40

60

SNR

R2 = 0.997477

References

[1] X. Sun, J. Abshire, “Laser Altimetry using Pseudo-Noise Code Modulated Fiber Lasers and Photon Counting Detectors.” [2] X. Sun, J. Abshire, “Modified PN Code Laser Modulation Technique for Laser Measurements,” Proc. of SPIE 7199, 71990P (2009).

[3] X. Sun, J. Abshire, “Modified PN Codes for Laser Remote Sensing Measurements,” IEEE 978, 55752 (2009)

[4] J. Campbell, N. Prasad, M. Flood, “Pseudorandom Noise Code–Based Technique for Thin-Cloud Discrimination with CO2 and O2 Absorption Measurements,” Optical Engineering 50(12), 126002 (2011)

[5] X. Sun, J. Abshire, “Signal to Noise Ratios of Pulsed and Sinewave Modulated Direct Detection Lidar for IPDA Measurements.”

RZ PN Code Presentation.nb 19

Printed by Mathematica for Students