.=
Eo
(J
g
q)
€
\)
o-
I
in r/i
zu
Experiment 12 - PCt encoding
Preliminory discussion
As you know, digitol tronsmission systems ore steodily replocing onolog systems in commerciol
communicotions opplicotions. This is especiolly true in telecommunicotions. Thot being the cose,
on understonding of digitol tronsmission systems is crucial for technicol people in the
communicotions ond telecommunicotions industries. The remoining experiments in this book use
the Emono Telecoms-Troiner 101 to introduce you to severol of these systems storting with
pulse code nodulation (PCM).
PCll is o system for converting onolog messoge signols to o serial streom of 0s ond ls. The
conversion process is colled encoding. At its simplest, encoding involves:
. sompling the onolog signol's voltoge at regulor intervols using o somple-ond-hold scheme
(demonstroted in Experiment 11).
. Outputting the binary number one bit ot o time (thot is, in seriol form).
An issue thot is cruciol to the performonce of the PCM system is the encoder's clock
frequency. The clock tells the PCM encoder when to somple ond, os the previous experiment
shows, this must be ot leost twice the messoge freguency to ovoid oliosing (or, if the messoge
contains more thon one sinewove, ot leosi twice its highest freguency).
Another importont PC[i\ performonce issue relates to the difference belween the somple
voltoge ond the quontisotion levels thot it is compored to. To exploin, most sompled voltoges
will not be the some os ony of the guontisotion levels. As mentioned obove, the PCM Encoder
ossigns to the somple the guontisotion level thot is closest io it. However, in the process, the
originol somple's volue is lost ond the difference is known os quontisation error. fmportontly,
the error is reproduced when the PCM doto is decoded by the receivee becouse there is no woy
fo? the receivet to know whot the originol somple voltoge wos. The size of the error is
offected by the number of guontisotion levels. The more guontisotion levels there ore (for o
given range of somple voltoges) the closer they ore together ond the smoller the difference
between them ond the somples.
Eoch binory number is tronsmitted in seriol form in franes. The number's most significont bit
(colled bit-7) is sent first, bit-6 is sent next ond so on to the leost significont bit (bit-O). The
PCM Encoder module olso outputs o seporote Frane Synchronisation signol (F9 that goes high
ot the some time thot bit-0 is outputted. The F5signol hos been included to help with PCM
decoding (discussed in the preliminory discussion of Experiment 13) but it con also be used to
help'trigger" o scope when looking ot the signols thot the PCM Encoder module genetates.
Figure 1 below shows on exomple of three fromes of o PCM Encoder module's output doto (eoch
bit is shown os both o 0 ond o 1 becouse it could be either) togeiher with its clock input ond its
F.5 output.
Figurc I
The experiment
In this exp€riment you'll use the PCiA Encoder module on the Emona Telecoms-Troiner 101 to
convert the following to PCM: o fixed DC voltoge, o vorioble DC volioge ond o continuously
chonging signal. fn the process, you'll verify the operation of PCM encoding ond investigote
quontisotion error o little.
Procedur.c
3. Locote the PCAI Encoder module ond set iB lUode switch to the PCtll position.
Mte: fnsert the block plugs of the oscilloscope leods into o ground (6ND) socket.
DOEtrDD
o6) ot
O
Figurz 2
FS
To Ch.1
OV
PCM doto
PCM clock
To Ch.Z
Moster
Signols
Figrc 3
5. Adjusf the scope's Tinebase control to view three pulses of the PC}l Encoder module's
F5 output.
Setting the Slope control to the '-' position mokes the scope stort its sweep ocross the screen
when the F5signol goes from high to low insteod of low to high. You con really notice the
difference between the two settings if you flip the scopes Slope control back ond forth. If
you do this, moke sure thot the Slope control finishes on the "r' position.
Adjusting this scope's control in this woy will moke it eosier for you to drow the woveforms
thot you'll be osked to shortly. However, you should be owore thot the screen's horizontol
divisions ore no-longer equol to the Timebdse control's setting. In other words, the scope's
Tinebase is no-longer colibroted. This is o problem when measuring the period of signals ond so
you must return the control to its locked posifion ot the end of the exp€riment.
10. set the scope's tllode conlrol to lhe DUAL position to view the PCM Encoder module s
CLK input os well os its F5output.
11. Drow the two woveforms to scole in the spoce provided on poge l2-8 leoving enough room
for o third digitol signol.
Tip, Dro* the clock signol in the upper third of the groph poper ond the F5signol in the
middle third.
ooo ooo
ee otl
l}
.6,tr
*@ {- t+ -t"
(.al
F@ ryl-l 1j,ll
,-fJ
o otr
odo @
E[@-,
rE
trE
Figurc 5
This set-up con be represented by the block diogrom in Figure 6 below. Chonnel 2 should now
disploy 10 bits of the PCAA Encoder module's doto outPut. The first 8 bits belong to one frome
ond the lost two bits belong to the next frome.
F5
To Ch.1
PCM doto
To Ch.Z
Figure 6
Tip: ff you're hoving trouble triggering the CRO set ils Trigger Source Coupling control
to the HF PE f position.
Question 2
Indicote on your drowing the stort ond end of eoch bit.
Question 3
Indicote on your drowing which bit is bit-o ond which is bit-7.
Question 4
Whot is the bimry number that the PCM Encoder module is outpuitang?
Qlrestion 5
Why does the code chonge even though the input voltoge is steody?
Question 6
Why does the PCM Encoder module output this code for OV DC ond not O00O0O02
oor6ro
[-+-t
oll 1
Ftgurc 7
This set-up con be represented by the block diogrom in Figure 8 on the next Poge. The
Vorioble DCV module is used to let you chonge the DC voltoge on the PCM Encoder module's
input. The scope's externol trigger input is used so that you con view the DC voltoge on its
Channel l input os o stoble disPloy.
PCM doto
To Ch.Z
Figul"" 8
18. Set the scopes Chonnel 1 Vertical Attenuation contrcl to the lv/div positio^.
19. Set the scope's Chonnel I fnpuf Coupling control to the 6ND position.
?O. Use the scopes Chonnel 1 Vertical Position control to olign the Chonnel I troce with one
of the horizontal lines on the scope's screen.
l.lote: This line on the scopes screen is now your zero volt reference which you con use
to see whether the Vorioble DCV module's output is positive or negative.
21. set the scope's Chonnel l ond Chonnel ? fnput Coupling controls to the DCposition.
23. Adjust the Varioble DCV modules Varhble DC control until the PCii\ Encoder module
outpuis the code thot you drew earlier.
?4. Use the scope io mansure the Vorioble DCV module's output voltoge.
Qgestion 7
What hoppens to the Vorioble DCV module's output?
Question 8
In whot woy does the binory number thot the PCM Encoder module outputs chonge?
26. Continue to turn the Vorioble DCV module's Variable DC control clockwise ond stop the
moment the PCM Encoder module's output is 11111111.
?7. Use the scopeto meosure the Vorioble DCV module's output voltoge. Record your
meosurement in Toble 1 on the next poge.
28. Return ihe PCii\ Encoder modules output io the code for OV.
29. Turn the Vorioble DCV module's Variable DC control onti-clockwise while wotching the
scoPe's disPloy.
Qgcstion 9
Whot hoppens to the Vorioble DCV module's outputZ
Question 1O
Whot hoppens to the binary number thot the PCM Encoder module is outputting?
Toble 1
00000000
Qgestior I I
Bosed on the information in Toble 1, whot is the moximum ollowoble omplitude (peok-to-
peok) for on AC signol on the PCM Encoder module's ENPUT?
32. Return the Vorioble DCV modules Vorioble DC control to obout the middle of its trovel.
33. See if you con vory the Vorioble DC conlrol left ond right without cousing the output
code to chonge.
The sompled voltoge con be chonged without cousing the output code to chonge becouse it is
compored to o set of guontisation levels but 'there are a fanite number of them. This meons
thot, in proctice , there's o range of somple voltoges for eoch guontisotion level.
Qgcstion 12
Whot's the nome for the difference between o sompled voltoge ond its closest
quontisotion level? Tip: If you're not sure, see the preliminory discussion.
ft's possible to work how for oport o PCM encoder's guontisotion levels ore using the
informotion you've gothered so for. To do so, onswer the following guestion.
Question 13
Colculote the dilference between the quontisotion levels in the PCII\ Encoder module by
subtrocting the volues in Toble 1 ond dividing the number by ?56 (fhe number of codes).
Qt estion 14
To reduce guantisotion error it's better to hove
34. Return the scope s Trigger Source control to the CHl (or fNI) position.
35. Return the scope s Trigger Source Coupling conlrol to the Acpsition.
36. Set the scope s Chonnel 1 ond Chonnel 2 Vertical Aftenuation contrck to the ?V/div
Positaon.
37. Locote the VCO module ond set its Pange control to the Hfposition.
lrloie: The VCO module will be used to provide the PCM Encoder module with o 50kHz
(opprox) clock.
otroooo
i9l:3
:()oY
trF EFB t:+:t
c -llr
'"iF @
's"o o
#trtr tn"
lUl6
,*o
"*.E o-o
Figurc 9
42. Wotch the PCM Encoder modules PCl,l DATA output on the scope's disploy.
43. Return the scope's Vormble Sweep control to the detent (locked) posiiion.
(r')
FI
in vi
i3
Experiment 13 - PC,l decoding
Prcliminory discussion
The previous experiment iniroduced you to the bosics of pulse code modulotion (PCM) which
you'll recoll is o system for converting messoge signols to o continuous seriol stream of binory
numbers (encoding). Recovering the messoge from the seriol streom of binory numbers is colled
decoding.
. Holding the voltoge on the output until the next frome has been decoded (forming o pulse
omplitude modulotion (PAM) version of the originol messoge signol).
. Reconstructing the messoge by possing the PAM signol through o low-poss filter.
The PCM decoder's clock freguency is cruciol to the correct operotaon of simple decoding
systems. ff
it's not the some frequency os the encoder's clock, some of the tronsmitted bits
are read twice while others ore completely missed. This results in some of the tronsmitted
numbers being incorrectly intetpteted, which in turn couses the PCIA decoder to output on
incorrecf voltoge. The error is oudible if it occurs often enough. Some decoders monoge this
issue by being oble to 'self-clock".
There is onother issue cruciol to PCM decoding . The decoder must be oble io detect the
beginning of eoch frome. If this isn't done correctly, every number is incomectly interpreted.
The synchronising of the fromes con be monoged in one of two woys. The PCM encoder con
generote o speciol frome synchronisotion sig^al thot con be used by the decoder though this
hos the disodvontoge of needing on odditionol signol to be sent. Alternotively, o frome
synchronisotion code con be embedded in the seriol doto streom thot is used by the decoder
to work out when the frome storts.
The PCM Decoder module is not self-clocking ond so it needs o digitol signol on the CLK input to
operote. fmportontly, for the PCM Decoder module to correctly decode PCM doto generoted
by the PCM Encoder module, it must hove the some clock signol. In other words, the decoder's
clock must be 'stolen" from the encoder.
Similarly, the PCAI\ Decoder module connot self-detecl the beginnang of uach new frone ond so
it must hove o frome synchronisation signol on its F5inpui to do this.
The cxpcrimcat
In this experimeni you'll use the Emono Telecoms-Troiner 1O1 to convert o sinewove ond
speech to o PCit doto streom then convert it to o PArll signol using the PCIA Decoder module.
For this to work correctly, the decoder's clock ond frome synchronisotion signol ore simply
'stolen'the PCM Encoder module. You'll then recover the messoge using the Tuneable Low-poss
filter module.
Eguipment
Port A - Sctting
up thc PCll crcodcr
To experiment with PCM decoding you need PCllr doto. The first port of the experiment gets
you to set up o PCill encoder.
3. Locote the PCM Encoder module ond set its tl1ode s itch to the PCfil position.
Ilotc: Insert the block plugs of the oscilloscope leads into o ground (6ND) socket.
otroooo
ue.g
H
'so
'Eo
rffir E
lu
#-tr
""..
!*@
Figir" f
This set-up con be represented by the block diogrom in Figure 2 on the next Poge. The PCtl/l
Encoder module is clocked by the Aloster Signols module s lOOkHz DIGTTAL output. Its onolog
input is the Vorioble DC module's VDC outPut.
PCM doto
To Ch.?
Mosier
Signals
Figre ?
6. Adjust the scope's Timebase control to view one pulse of the PCrtil Encoder module's F.5
output.
7. Set the Vorioble DCVmodules Varbble DC control to obout the middle of its trovel.
8. Set the scope's tl,lode control to the DUAL position to view the PCM Encoder module's
PClil DATA output os well os its Fsoutput.
9. Vory the Vorioble DCV module's Variable DC control left ond right.
ffyour set-up is working correclly, ihis lost step should couse the number on pCM Encoder
modules PC^H DATA output to go down ond up. ff it does, corry on to the next step. If not,
check your wiring or osk the instructor for help.
10. Disconnect the plug to the Vorioble DCV module's VDC output.
11. Locote the VCO module ond turn its Frequenql AdJustcontrol fully onti-clockwise.
Firyrc 3
Thas set-up con be represented by the block diogrom in Figure 4 below. Mtice thot the PCM
Encoder modules input is now the VCO module's SfAlEoutput.
FS
To Ch.l
PCM doto
To Ch.2
Figure 4
As the PCri\ Encoder modules input is o sinewove, the module's input voltoge is continuouslY
chonging. This meons thot you should notice the PC4U DATA oulPut chonging continuously olso.
oooooo
o gllo t
O
EFtr EF ;Ua):
l.i
f:+:t
^ ^ r.l
Iol .ll r
JPT E
t;-;'1"
Figurr 5
The entire set-up con be represented by the block diogrom in Figure 6 below. Mtice thot the
decoder's clock ond frome synchronisotion informotion ore "stolen" from the encoder.
Messooe
To Ch:l
"Stolan" Fs
PCM Decoder
OUTPUT
To Ch.?
"Siolen" CLK
Figure 6
18. Set the scope's Mode control to the DUAL position to view the PCM Decoder modules
output os well os the messoge signol.
Qgestion I
Whot does the PCM Decoder's 'stepped" output tell you obout the lype of signol thot it
is? Tip: If you're not sure, see the preliminory discussion for this experiment or for
Experiment 11.
The PCM Decoder modules output signol looks very similor to the messoge. However, they're
not the Some. Remember thot o Sompled messoge contoins mony sinewoves in oddition to the
messoge. This con be better opprecioted if you compore the messoge ond the PCM Decoder
modules output by listening to them.
lg. Add the Buffer module to the set-up os shown in Figure 7 below lercving the scopas
connections os they ore.
+
DE@
nO
Et-
-o
so
.do
tr
EO
EX(3
Figure 7
27. Without weoring the heodphones, plug them into the Buffer module's headphone socket.
23. Turn the Buffer module s 6ain control clockwise until you con comfortobly heor the PCM
Decoder module's output.
24. Disconnect the Buffer module's lr-nd where it plugs to the PCM Decoder modules output.
?5. Modify the set-up os shown in Figure 8 below, ogoin leoving the scopes connections as
they ore.
FE El-
o "o
so
4o
o
lFlr
Figra 8
26. Compore the sound of the two signals. You should notice thot they're similor but cleorly
different.
Questior 2
What must be done to the PCM Decoder modules output to reconstruct the messoge
properly?
27. Completely remove the Buffer module from the set-uP while leoving the rest of the
leods in ploce.
ooo oDo
'e1'8
oo9
+
lJ j
E}Eh
Brd
Fi$rG 9
13-10
o 2008 Emom Instrumenis Experiment 13 - PCr{ decoding
Port D -
Recoverirg the messoge
As mentioned arlier, the messoge con be reconstructed from the PCM Decoder module's
output signol using o low-poss filter. This port of the experiment lets you do this.
31. Locote the Tuneoble Low-poss Filter module ond set its 6ain conlrol to obout the middle
of its trovel.
32. Turn the Tuneoble Low-poss Filter module's Cut-off Frequency Adjust control fully onti-
clockwise.
ootrooo
o gllo fr
,D
EH 4 + DO
tlll :EI
6r oEx tr
Fl" o tr@
EO tr@
Fig.rre 1O
t.
The entire set-up con be represented by the block diogrom in Figure 11 below. The Tuneoble
Low-poss Filter module is used to reconstruct the originol messoge from the PClil Decoder
modulss PAM output.
Tuneoble
A,lessooe
To Ch2
Figunc 11
35. Slowly turn the Tuneoble Low-pass Filter modules Cut-off Freguency control clockwise
ond stop the moment the messoge signol hos been reconstructed (ignoring phose shift).
The two signols ore cleorly the some so let's see whot your heoring tells you.
36. Add the Buffer module to the set-up as shown in Figure 12 below leoving the scope's
connectaons as they ore.
Figure 12
39. Turn the Buffer modules 6ain conlrol clockwise until you con comfortobly heor the
Tuneoble Low-poss Filter module's output.
40. Disconnect the Buffer module's lead where it plugs to the PCM Decoder modules output
ond connect it to the VCO module's output (like you did when wiring Figure 8).
41. Compore the sound of the two signols. You should find thot they're very similor.
Qgcstion 3
Even though the two signols look ond sound the some, why isn't the reconstructed
messoge o perfect copy of the originol messogez Tip: ff
you're not sure, see the
preliminory discussion for Experinent 12.