Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 18

Name:

Class:

1 4 - P N s e q u e n c e s p e c t r a a n d n o is e g e n e r a t io n
Experiment 14 – PN sequence spectra and noise generation

Preliminary discussion
Pseudo-noise sequences (or just PN sequences) are very useful signals in communications and
telecommunications, especially for implementing modulation schemes such as DSSS and CDMA
(among others). They can also be used to generate noise for experimental purposes when
modelling real world communications systems. But what exactly is a PN sequence?

To understand the answer to this question, you must return to the spectral composition of
pulse trains. Recall that a pulse train is made up of a theoretically infinite number of sinewaves
– the fundamental and its harmonics. Recall also that the frequency and amplitude of a pulse
train’s sinusoidal components affects its frequency and mark-space ratio (or duty cycle).
Despite this, the spectral composition of all pulse trains follows the pattern of the (truncated)
Sinc Function shown in Figure 1 below.

0.8

0.6

0.4

0.2

0
1 2 3 4
-0.2

-0.4

Figure 1

Figure 2 below illustrates this with an example of a 1kHz squarewave (a pulse train with a mark-
space ratio of 1:1 or a duty cycle 50%). This is a spectrum that would be familiar to you.

1 5 0 0 µs

0 .8 1 kHz
(1 :1 )
0 .6
1m s
0 .4

0 .2
3 kHz 7 kHz a n d so o n ...
0
1 kHz 5 kHz
-0 .2

-0 .4

Figure 2

14-2 © Emona Instruments Experiment 14 – PN sequence spectra & noise generation


Figure 3 below shows the spectral composition of a 1kHz pulse train pulse having a mark-space
ratio of 1:3 (or a duty cycle 25%). Notice that it too follows the pattern of the Sinc Function.

2 5 0 µs
1

0 .8
1 kHz
(1 :3 )
0 .6
1m s
0 .4

0 .2
5 kHz 6 k 7 kHz
0
1 kHz 2 k 3 kHz 9 kHz a n d so o n ...
-0 .2

-0 .4

Figure 3

The examples in Figures 2 and 3 are instructive. Together, they show us that some harmonics
of the pulse trains have an amplitude of zero (or are “nulled”) and this is true of all pulse
trains. Second, a comparison of Figures 2 and 3 shows us that, as the pulse train’s mark-space
ratio decreases, the number of significant harmonics that make it up increases. Or, put another
way, as the mark-space ratio decreases, the number of harmonics that are present in each of
the Sinc Function’s lobes increases.

Now, suppose a sequence generator continuously outputs the sequential 4-bit binary number
1000 with each bit being 250µs wide (requiring a bit-clock of 4kHz). In the time domain, the
resulting digital data signal is identical to the pulse train in Figure 3. This means that the
sequence’s spectral composition must be identical to the spectrum in Figure 3 also.

This fact has a couple of important implications. First, we can establish a general rule for
determining the nulled harmonics in repeated sequential binary number sequences. They
correspond with whole number multiples of the digital signal’s bit-clock (that is, f bit, 2fbit, 3fbit
and so on). In the case of our repeated sequential 4-bit binary number 1000 generated using a
4kHz bit-clock, the nulls occur at 4kHz, 8kHz, 12kHz and so on to infinity (theoretically).

Second, if the sequence generator’s continuously repeated output is changed to the 5-bit
binary number sequence 10000, the mark-space ratio of the resulting digital data signal
decreases and so more harmonics are present between the nulls. Importantly though, if a 4kHz
bit-clock is used to generate the 5-bit sequence, the nulls occur at the same frequencies as our
example in Figure 3. So, with the nulls occurring at the same frequencies but with more
harmonics between them, the spectral composition of the 5-bit sequence must be richer than
that of its 4-bit counterpart. This gives us a second general rule. The greater the number of
bits in a repeated sequence for a given bit-clock, the greater the sequence’s spectral
composition (though this doesn’t apply to PN sequences with internally repeated sequences like
101010… and 11001100…).

Experiment 14 – PN sequence spectra & noise generation © Emona Instruments 14-3


Using the Sinc Function to analyse the spectral composition of several binary number sequences
like 1000, 10000, 100000 and so on would quickly show that the number of harmonics in each
lobe is the same number as the sequence’s length (though the last one is nulled).

Finally, we can now return to the question of what is a pseudo-noise sequence. If the length of
certain binary number sequences is long enough, their spectral composition becomes so dense
that it can be used to model bandwidth limited white noise. That said, there would still be a
repetitive element to the “noise signal” and so they’re called pseudo (or “apparent”) noise
sequences.

The experiment
For this experiment you’ll use the Emona Telecoms-Trainer 101 to consider a 31-bit and 255-
bit binary number sequence in the time domain. You’ll then look at the data signals’ spectra in
the frequency domain to confirm their spectral composition. Finally, you’ll use the sequences to
generate electrical noise and compare their effectiveness.

It should take you about 50 minutes to complete this experiment.

Procedure

Part A – Observations of PN sequences in the time domain


Part A gets you to set up a 31-bit and a 255-bit binary number sequence and consider them in
the time domain in preparation for looking at their spectra.

1. Gather a set of the equipment listed on the previous page.

2. Connect the set-up shown in Figure 4 below.

Note: Insert the black plugs of the oscilloscope leads into a ground ( GND) socket.

M AS TER S EQUEN CE
S IGN ALS GEN ERATOR
L IN E
CODE
O

O O N R Z -L
O 1 B i-O S YN C
1 O R Z -A M I
1 1 N R Z -M
1 0 0 kHz
S IN E X

1 0 0 kHz Y
COS
1 0 0 kHz CLK
DIGITAL
DIVIDER
8 kHz
DIGITAL
2 kHz
DIGITAL
2 kHz
S IN E
IN OU T

Figure 4

14-4 © Emona Instruments Experiment 14 – PN sequence spectra & noise generation


This set-up 4 can be represented by the block diagram in Figure 5 below. The Master Signals
module’s 2kHz DIGITAL output is used to provide the Sequence Generator module’s bit-clock.
The Sequence Generator module’s X output is a continuous 31-bit sequential binary number.
The module’s SYNC output is a pulse that corresponds with the same bit of the sequence on
every repetition.

X sequence
T o CH 1
X

C LK SYN C
SYNC
2kH z To CH 2 & EXT
Clock
M aste r S equence
S ignals G e nerator

Figure 5

3. Set up the scope per the instructions in the Appendix.

4. Adjust the following scope controls as indicated:

 Vertical Attenuation control for both channels to the 2V/div position


 Input Coupling controls for both channels to the DC position
 Timebase control to the 2ms/div position
 Trigger Source control to the EXT position

5. Set the scope’s Mode control to the DUAL position to view both the Sequence Generator
module’s X and SYNC outputs.

Note: You may need to adjust the scope’s Trigger Level control to obtain a stable
display.

Question 1
Calculate the width of each bit in the Sequence Generator module’s X sequence for the
bit-clock used. Note: For accuracy here, you need to be aware that the Master Signals
module’s 2kHz outputs are actually 2.083kHz.

Question 2
Calculate the duration of the entire 31-bit sequence.

Experiment 14 – PN sequence spectra & noise generation © Emona Instruments 14-5


To verify your answer to Question 2…

6. Accurately measure the period of the Sequence Generator’s module’s SYNC signal.
Record your measurement in Table 1 below.

Note: The SYNC signal consists of a pulse that corresponds with the same bit of every
sequence on the Sequence Generator module’s X output. So, its period must be the same
as the period of the 31-bit sequence on the Sequence Generator module’s X output.

Table 1

SYNC pulse
period

Question 3
Explain the difference between your measurement in Table 1 and your calculated value
for Question 2.

7. Modify the set-up as shown in Figure 6 below.

Note: Remember that the dotted lines show leads already in place.

M ASTER S EQUENCE
SIGNALS GEN ERATOR
L IN E
COD E
O

O O N R Z -L
O 1 B i-O S YNC
1 O R Z -A M I
1 1 N R Z -M
1 0 0 kHz
S INE X

1 0 0 kHz Y
COS
1 0 0 kHz CLK
DIGITAL
DIVIDER
8 kHz
DIGITAL
2 kHz
DIGITAL
2 kHz
S INE
IN OUT

Figure 6

This set-up can be represented by the block diagram in Figure 7 below.

14-6 © Emona Instruments Experiment 14 – PN sequence spectra & noise generation


X sequence (31-bit)
T o CH 1
X

CLK SYN C
S YN C
2kH z To EXT
Clock Y

Y sequence (255-bit)
T o CH 2

Figure 7

The scope will now be showing the Sequence Generator module’s two sequences. However, you’ll
notice that the scope cannot trigger on the Y sequence. This is because the scope triggers on
the same bit of the X sequence on every repetition using the Sequence Generator module’s
SYNC signal. As the Y sequence is 255 bits long, and as 255 ÷ 31 is not a whole number, every
sweep of the scope’s display starts at a different point in the Y sequence resulting in a
different pattern for it on every sweep.

Part B – Observations of PN sequences in the frequency domain


Part B gets you to examine the spectral composition of the 31-bit and a 255-bit Sequence
Generator module’s X and Y outputs. You’ll start with the 31-bit sequence but a little
preparation is necessary first.

Question 4
Calculate the frequency of the first four nulled harmonics in the Sequence Generator
module’s X sequence? Tip: If you’re not sure how to calculate this, re-read the
preliminary discussion.

Let’s verify your answer using a spectrum analyser.

8. Modify the set-up to include the spectrum analyser as shown in Figure 8 below.

Note: The following instructions relate to a PC-based spectrum analyser called the
PicoScope 3204. Other spectrum analysis devices can be used provided the bandwidth is
at least 250kHz.

Experiment 14 – PN sequence spectra & noise generation © Emona Instruments 14-7


M ASTER S EQUEN CE
SIGN ALS GEN ERATOR
L IN E
COD E
O

O O N R Z -L
O 1 B i-O SYNC
1 O R Z -A M I
1 1 N R Z -M
1 0 0 kHz X
SINE
1 0 0 kHz Y
COS
1 0 0 kHz CLK
DIGITAL
DIVIDER
8 kHz
DIGITAL
2 kHz
DIGITAL
2 kHz
SINE
IN OU T

PC -b a se d
Sp e c trum
An a lyse r

CH A

CH B

Figure 8

9. Launch the PicoScope software and set its spectrum analyser controls as follows:

General

 Spectrum Range to 48.83kHz


 Horizontal Zoom to ×1
 Channel A Input Range to Auto
 Channel B Input Range to Off

Spectrum Options

 Spectrum Bins to 16384


 Window Function to Blackman-Harris
 Display Mode to Magnitude
 Scale to Logarithmic
 Logarithmic Unit to dBV

Note 1: If you’re using a spectrum analyser other than the PicoScope 3204, see your
instructor for a list of the controls to adjust and their appropriate settings.

Note 2: If the spectrum analyser has been set up correctly, its display will be similar to
Figure 9 below.

14-8 © Emona Instruments Experiment 14 – PN sequence spectra & noise generation


Figure 9

Question 5
Why are there many more lobes in the X sequence’s spectrum than suggested in Figures
1, 2 and 3 of the preliminary discussion?

The PicoScope spectrum analyser has rulers that allow you to determine the absolute
frequency of the sinewaves in a signal’s spectral composition. The next part of this experiment
gets you to use the rulers to check your answer to Question 4.

10. Set the spectrum analyser’s Spectrum Range to 24.41kHz.

11. Move the mouse to the junction of the display’s X and Y axes.

Note: When you do, the mouse cursor will change shape and a label will pop up declaring
“1: Inactive”.

12. Click and hold the left mouse button and then move it left and right.

Note 1: When you do this, a dashed line representing frequency ruler #1 appears.

Note 2: A ruler legend also appears indicating the absolute frequency at the ruler.

Experiment 14 – PN sequence spectra & noise generation © Emona Instruments 14-9


13. Use the spectrum analyser’s ruler to check that the frequencies you listed in your
answer to Question 4 are nulled as you predicted.

Question 6
Theoretically, how many harmonics make up each lobe in the spectrum of the Sequence
Generator module’s X output?

To verify your answer to Question 6…

14. Set the spectrum analyser’s Spectrum Range to 3.052kHz .

Note: The screen won’t update as quickly as before so you’ll have to wait a few seconds
to see changes.

15. Use the spectrum analyser’s ruler to locate the null at 2.083kHz.

16. Count the number of significant harmonics in the signal’s first lobe.

Note: Your count should match your answer to Question 6. If not, investigate which one
is wrong.

Now let’s compare the Sequence Generator module’s X and Y sequences.

17. Return the spectrum analyser’s Spectrum Range to 48.83kHz.

18. Click File on the PicoScope software’s menu toolbar and select Save Current Waveform
As...

19. Select Desktop in the Save In line of the window that appears.

Note: This will save the file on the desktop making it easier to find later.

20. Change the filename to 31-bit Sequence and click on Save.

21. Modify the spectrum analyser’s connection to the set-up as shown in Figure 10 below.

14-10 © Emona Instruments Experiment 14 – PN sequence spectra & noise generation


M ASTER S EQUENCE
S IGNALS GEN ERATOR
L IN E
COD E
O

O O N R Z -L
O 1 B i-O S YNC
1 O R Z -A M I
1 1 N R Z -M
1 0 0 kHz X
S IN E
1 0 0 kHz Y
COS
1 0 0 kHz CLK
DIGITAL
DIVIDER
8 kHz
DIGITAL
2 kHz
DIGITAL
2 kHz
S IN E
IN OU T

PC -b a se d
Sp e c trum
An a lyse r

CH A

CH B

Figure 10

22. To compare the 31-bit and 255-bit sequence spectra, locate the file called 31-bit
Sequence that you saved on the desktop earlier and double-click on it.

Note: This will open the “snapshot” of the 31-bit sequence spectrum that you took
earlier. If necessary reposition it so you can compare the two spectra side-by-side.

23. Count the number of lobes in both spectra.

Question 7
Why do the spectra have the same number of lobes when the sequences are difference
lengths?

Now let’s consider the 255-bit sequence more closely. But first, a little more preparation.

24. Close the file of the 31-bit sequence spectrum.

Question 8
Calculate the frequency of the first four nulled harmonics in the Sequence Generator

Experiment 14 – PN sequence spectra & noise generation © Emona Instruments 14-11


module’s Y sequence?

To verify your answer to Question 8…

25. Set the spectrum analyser’s Spectrum Range to 24.41kHz.

26. Use the spectrum analyser’s ruler to check that the frequencies you listed in your
answer to Question 8 are nulled as you predicted.

Question 9
Theoretically, how many harmonics make up each lobe in the spectrum of the Sequence
Generator module’s Y output?

27. See if you can verify your answer to Question 9 by setting the spectrum analyser’s
Spectrum Range to 3.052kHz to examine the spectral composition of the signal’s first
lobe.

Question 10
Why can’t you accurately count the harmonics in the signal’s first lobe?

Question 11
Which of the Sequence Generator module’s two sequences has the greater harmonic
content?

As there are 255 harmonics in the each of the signal’s lobes, they should be about 8.16Hz
apart (2.083kHz ÷ 255). Usefully, the spectrum analyser has two frequency rulers. Apart from
allowing you to measure the absolute frequency of two sinewaves at once, it also allows you to
measure the difference in frequency between the rulers. This information is displayed in the
ruler legend in the delta () column.

28. Set the spectrum analyser’s Spectrum Range to 762.9Hz .

14-12 © Emona Instruments Experiment 14 – PN sequence spectra & noise generation


Note: It’ll take over 30 seconds for the analyser’s display to update so be patient.

29. Move the mouse to the junction of the display’s X and Y axes.

Note: When you do, the mouse cursor will change shape and a label will pop up declaring
“2: Inactive”.

30. Click and hold the left mouse button and then move it left and right.

Note 1: When you do this, a second dashed line representing frequency ruler #2
appears.

Note 2: Notice that the ruler legend now indicates the absolute frequency at ruler #2
as well as ruler #1. It also indicates the difference between the rulers in the delta ()
column.

31. Align the rulers on adjacent significant harmonics to measure the difference between
them.

Note: The difference should be very close to the value mentioned above.

Part C – Using PN sequences to generate noise


The theoretical proposition of “white noise” is impossible in practice. To explain, an infinite
number of sinewaves (with or without equal power density) would require an infinite amount of
power! However, as you have just seen, long PN sequences are rich in harmonics. Moreover,
although the spectrum of PN sequences have lobes of changing amplitude, small portions of its
spectrum are relatively flat (a point you may have noticed at Step 22). That being the case, it’s
possible to isolate a small portion of a PN sequence’s spectrum using a filter to model band-
limited white noise. Part C of this experiment demonstrates this.

32. Minimise the PicoScope window - You’ll need it again later but not just now.

33. Completely dismantle the current set-up.

34. Locate the VCO module and turn its Gain control fully anti-clockwise.

35. Turn the VCO module’s Frequency Adjust control fully clockwise.

36 Set the VCO module’s Range control to the HI position.


.

37. Connect the set-up shown in Figure 11 below.

Experiment 14 – PN sequence spectra & noise generation © Emona Instruments 14-13


VCO

DIGITAL

GAIN

FREQ

HI

LO

VCO S IN E
IN P UT

Figure 11

38. Set up the scope per the instructions in the Appendix.

Note: Ensure that the scope’s Trigger Source control is set to the CH 1 (or INT)
position.

39. Adjust the scope’s Timebase to view two just one cycle of the VCO module’s output.

40. Adjust the VCO module’s Frequency Adjust control to obtain a 150kHz sinewave.

Tip: Calculate the period of 150kHz and use the scope to help set the period of the VCO
module’s output to the same value.

41. Locate the Tuneable Low-pass Filter module and set its Gain control to about the middle
of its travel.

42. Turn the Tuneable Low-pass Filter module’s Cut-off Frequency Adjust control fully
clockwise.

Note: This sets the Tuneable Low-pass Filter module’s cut-off frequency to 15kHz.

43. Connect the set-up as shown in Figure 12 below.

VCO S EQUEN CE TUNEABLE


GENERATOR LP F
L IN E
COD E
O
DIGITAL
1
f Cx1 0 0
OO N RZ-L
O1 B i-O S YN C
1O R Z-AM I
GAIN
11 N R Z-M

FREQ Y fC
CLK

HI
DIVIDER

LO

GAIN
VCO S INE
IN P UT
IN OU T IN OUT

Figure 12

14-14 © Emona Instruments Experiment 14 – PN sequence spectra & noise generation


This set-up can now be represented by the block diagram in Figure 13 below. As you know, the
spectral composition of the Sequence Generator module’s Y output includes 255 sinewaves per
lobe. A quick calculation tells us that, with a 150kHz bit-clock, the sinewaves are separated by
588Hz (150kHz ÷ 255 = 588.2Hz).

VCO S equence T uneable


m odule G enerator Low -pass F ilter

CLK Y
T o CH 1
15 0kH z
Clock

Figure 13

44. Set the scope’s Timebase control to the 1ms/div position.

45. Observe the signal on the Tuneable Low-pass Filter module’s output.

Note: You may need to adjust the scope’s Trigger Level control to obtain a stable
display.

Question 12
What does the signal on the Tuneable Low-pass Filter module’s output look like?

The signal on the Tuneable Low-pass Filter module’s output isn’t “white” noise because it is
bandwidth limited. Nor is the signal truly “noise”. This can be demonstrated using the scope.
True noise is non-repetitive. However, the signal on the Tuneable Low-pass Filter module’s
output repeats itself every 1.7ms. [This figure is calculated using the bit-clock’s period (1 ÷
150,000Hz) and multiplying it by the PN sequence’s number of bits (255).] The repetitive
nature of the “noise” you have modelled can be observed using the scope.

46. Look closely at the signal - You should see it repeat itself about 5 times across the
display.

47. Measure the “noise” signal’s period.

Note: You should find it is close to the figure quoted above.

Question 13
Given the signal on the Tuneable Low-pass Filter module’s output is repetitive, what’s a
better name for it than “noise”?

Experiment 14 – PN sequence spectra & noise generation © Emona Instruments 14-15


Question 14
How many sinewaves is the “noise” signal made up of? Tip: How many of the sinewaves in
the signal’s first lobe would pass through the filter?

To verify your answer to Question 14…

48. Modify the set-up to include the spectrum analyser as shown in Figure 14 below.

VCO S EQUEN CE TUNEABLE


GEN ERATOR LP F
L IN E
CODE
O
DIGITAL
1
f Cx1 0 0
OO N R Z-L
O1 B i-O S YN C
1 O R Z-AM I
GAIN
1 1 N R Z -M

FREQ Y fC
CLK

HI DIVIDER

LO

GAIN
VCO S IN E
INP UT
IN OU T IN OUT

PC -b a se d
Sp e c trum
An a lyse r

CH A

CH B

Figure 14

49. Maximise the PicoScope window.

Note: If you shut the software down earlier, relaunch it and repeat Step 9.

50. Set the spectrum analyser’s Spectrum Range to 24.41kHz .

51. Use the spectrum analyser’s ruler to indicate on the screen the Tuneable Low-pass
Filter’s cut-off frequency.

52. Count the number of significant harmonics between 0Hz and the filter’s cut-off
frequency.

Note: Your count should match your answer to Question 14. If not, work out which one is
wrong.

14-16 © Emona Instruments Experiment 14 – PN sequence spectra & noise generation


53. Modify the set-up as shown in Figure 15 below.

VCO S EQUEN CE TUNEABLE


GEN ERATOR LP F
L IN E
CODE
O
DIGITAL
1
f Cx1 0 0
OO N R Z-L
O1 B i-O S YN C
1 O R Z-AM I
GAIN
1 1 N R Z -M

FREQ Y fC
CLK

HI DIVIDER

LO

GAIN
VCO S IN E
INP UT
IN OU T IN OUT

PC -b a se d
Sp e c trum
An a lyse r

CH A

CH B

Figure 15

54. Observe the Tuneable Low-pass filter module’s new output signal.

Question 15
Why doesn’t the signal look like electrical noise any more?

To verify your answer to Question 15…

55. Maximise the PicoScope window.

56. Count the number of significant harmonics between 0Hz and the filter’s cut-off
frequency.

Experiment 14 – PN sequence spectra & noise generation © Emona Instruments 14-17


Why are the Telecoms-Trainer 101 Sequence Generator module’s outputs 31 and 255
bits long?
You may be wondering why the length of the sequences for the Telecoms-Trainer 101
Sequence Generator module’s outputs are 31 and 255 bits long. To explain, shift register
circuits known as linear feedback shift registers have been used to generate them. These
circuits are similar to ring counters in that they recycle data through the shift register.
However, they also include feedback via exclusive OR gates at key points to change the
data word as it cycles through. That said, this doesn’t generate purely random numbers as
the data pattern must repeat. However, certain feedback connections create particularly
long sequences and these are known as maximal length sequences (MLS).

Maximal length sequences have several interesting properties:

i) They have almost equal 1s and 0s…(actually 1 less 0 than 1s)

ii) They have equal number of “runs” of 1s and 0s (you can readily see this using the
Sequence Generator module’s 31-bit sequence

iii) They create a spectrum with no missing harmonics

iv) They never repeat within themselves (unlike the sequences mentioned at bottom of
page 14-3)

These properties make maximal length sequences ideal for PN sequences used for
applications like encryption, encoding etc. Naturally then, linear feedback shift registers
generating maximal length sequences are used for the Emona Telecoms-Trainer 101
Sequence Generator module.

For the X output, a 5-bit shift register is used making it 31 bits long (that is, 2 5-1) and
for the Y output an 8-bit bit shifter register is used giving 255 bits (that is, 2 8-1).

14-18 © Emona Instruments Experiment 14 – PN sequence spectra & noise generation

You might also like