NATIONAL RADIO ASTRONOMY OBSERVATORY
CHARLOTTESVILLE, VIRGINIA
ELECTRONICS DIVISION INTERNAL REPORT No, 214
SQUARE-LAW DETECTOR TESTS
WEINREB
MAY 1981
NUMBER OF COPIES: 150
. . 3
. • • . • 4
. . . • . 8• • . • • • 9•
I. IntroductionII. Test System DescriptionIII. Detector DescriptionIV. Results
Appendices
Appendix 1 Square-Law Error Definition 15Appendix II Digital Attenuato r and Driver 16Appendix III DETECTOR1 Program . 17Appendix IV Noise Analysis 26
Figures
Figure 1 Block Diagram of Test Measurement System 5Figure 2 Definition of Detector Error 6Figure 3 Examples of Power Meter Comparisons 7Figure 4 Detector Photograph and Schematic. 10Figure 5 current-Voltage Characteristic of Two BD-4 Diodes 11Figure 6 Example of Use of Square-Law Error Program . 12Figure 7 Example of Noise Tests of a Detector and Amplifier 13Figure 8 Examples of Noise Tests of Operational Amplifiers 14
automated test system for
linear output voltage
noted that all detectors become perfectly square law at
gnal level and it is the noise level which then limits
the detector; i.e. the input power range
sufficiently lo
SQUARE-LAW DETECTOR TESTS
vs input power relation) and noise level of an accurate back-diode detector.
A few days of operation of the system gave informative results regarding
linearity of power meters, error of a back-diode detector circuit vs load
al level, and very low-frequency noise of operational
amplifiers; these results will be described.
between noise level and an acceptable square-law error is thus an important
parameter.
The noise in a detector circuit is predominately in the low-frequency
amplifier following the detector rather than in the detector non-linear element
and usually has a l/ f type spectrum. For detection of a noise-like signal,
as occurs in radio astronomy, the inherent fluctuation in detector output due
to this noise-like signal has a flat video spectrum with power level inversely
proportional to IF bandwidth. In order for the radiometer sensitivity to be
limited by this inherent noise, it must be greater than the detector noise.
This criteria is more difficult to meet at wide IF bandwidth and low video
bandwidth (long averaging time). As a numerical example, the detector described
in this report has detector noise equal to inherent noise at an IF bandwidth
of 1 GU, time of 1 second and 0.2% square law er or.
DESCRIPTION
A block diagram of the detector test system is shown in Figure 1.
digitally-controlled attenuator, 0 to 31 dB in 1 dB steps, is used to provide
a variable-level noise or CW signal which is simultaneously applied to both a
power meter and the detector under test. Detector error is determined by
comparing power meter and detector output voltages; the attenuator accuracy
and repeatability has a negligible effect upon measurement accuracy. The zero
offset of both the power meter and detector is determined for each measurement
and is used to correct data. A definition of square-law error and its
computation is described in Appendix I. In general terns the error is defined
as the percent deviation of the detector output voltage vs input power curve
from a straight line passing through a reference power level and .01 times
this reference level, see Figure 2. The analog/digital input-output system,
ADIOS, for the Apple II Plus Computer is described in NRAO Electronics
Division Internal Report No. 212. The digital attenuator and driver are
described in Appendix II of this report.
Since a power meter is the measurement standard for determining square-law
error, four power meters were first compared using the square-law error
measurement program. These were the General Microwave 467A, H-P 436A/8485A,
H-P 432A/478A, and H-P 436A/8484A, The first two are thermoelectric sensors,
the third is a thermistor sensor, and the fourth is a diode detector. Some
results are illustrated in Figure 3. In general, the error between the first 3
power meters and the last meter at 1 pW or lower scale is < 0.3%. The H-P
436A/8484A on the 10 pW scale has 1% error in the 3 to 10 pli range and should
not be used as a standard at this high level.
SQU
ARE
LAW
DEV
ICE
ADIO
SAI
Mi0
V R
AN
GE
POW
ERD
IVID
ERD
IGIT
ALAT
TEN
UAT
OR
POW
ERM
ETER
AD
IOS
BIN
±10
V R
AN
GE
Fig
. 1
. B
lock d
iagra
m o
f te
st m
eas
ure
men
t sy
stem
. A
DIO
Sis
an a
nalo
g-d
igit
al
input-
outp
ut
syst
em
for
the
App
le C
ompu
ter
and
is d
escr
ibed
in
NR
AO
ED
IR N
o. 2
12.
AM
P(O
PT)
SIG
NAL
SOU
RCE
Fig. 2. Definition of detector error; also see Appendix I.
I. 110LT
HP 432P1hW SCALE, INTO AIN;GH 467A,1MH SCALE, t'UR) BIN. 2-30OHHZ NOISEGNPL
HP 436/8484A 100N4 SCALE INTO AIN;HP432 111H SCALE,INTO BIN. NOISESI6NAL.
Examples of power meter comparisons. The horizontal axis is10 tines the meter DC output voltage; for values < 1 voltthe error is determined by noise and should be ignored. Themiddle curve shows an rt, 1% error of the HP436A/8 484A meterat its maximum input level of 10 VW. A broadband, 2-300 MHz,noise signal was used for these tests.
Fig.
15U 0 LI
HP 436A/8484A INTO AIN,. OU SCALE; HP 4321 INTO 8INp1MH SCALE. NOISEs I 6NPL
1-5110 *
.1 1 UOLT
III. DETECTOR DESCRIPTION
The detector used for these tests was one similar to a design used at
NRAO for many years) A General Electric BD-4 back.-diode is utilized into an
adjustable, 0-5k ohm, load resistance connected to the summing input of an
operational amplifier; a schematic of the detector and a photograph are shown
in Figure 4. The load resistance is adjusted for minimum square-law error.
The input op amp is a low-drift, low-noise variety; three types were tried
and noise test results are reported in the next section. The input op amp is
operated at typical voltage gain of 100 and output voltage of < 1 volt to
eliminate thermal transients which may occur if an op amp is operated at high-
level output. The entire circuit is enclosed in a 3/4" 31/41t 11/2" box which
includes a mu-metal shield to reduce 60 Hz AC pickup from nearby power supply
transformers. The RF input match is a function of input layout and perhaps
diode capacity. For the constructed unit the input return loss is > 20 dB
from 5 to 500 MHz and > 10 db from 2 to 800 MHz.
It should be noted that the performance of a detector can be calculated
in terms of the derivatives of the current-voltage characteristic; i.e.,
non-linear device with all derivatives zero except first and second will give
perfect square-law response. An excellent reference on this subject is given
by Cawley and Sorensen.2
These calculations have not been performed for the
back-diode detector. However, a calculation of the square-law range of a biased-
Schottky diode has shown that it will have a much smaller dynamic range than
measured for the back-diode detector.
The BD-4 diodes which were tested for this report gave quite variable
results from one diode to another. Four out of eight diodes gave acceptable
1 Peter Camana, "The GE BD-7 Back Diode as a Square-Law Detector,"NRAO Electronics Division Internal Report No. 106, September 1971.
2 A. M. Cowley and H. O. Sorensen, "Quantitative Comparison of Solid-StateMicrowave Detectors," IEEE Trans. Microwave Theory Tech., vol. MTT -14, no. 12,pp. 588-602, December 1966.
square-law performance of less than 0.5% error at < - 16 dBm RF input level.
The remaining diodes could not achieve this; increasing the load resistance
decreased error but not to an acceptable value at 5,000 ohms. Larger load
resistances were not tried as the error was not decreasing appreciably as 5k
was approached. The I-V characteristics of two BD-4 diodes are shown in
Figure 5 and are quite different. However, no cortelation has been made
between the I-V characteristic and square-law performance.
IV. RESULTS
The results of tests upon a particular detector, #3, are shown in
Figures 6, 7, and 8 with discussion in the captions of each figure.
—10-
2011400•Mat*
„
mob■Mir NNW 41111•• ONO MOP MM. figp NM. NOW SIM MINI IOW .111IP
ems. 1111•11, el. AIM 4.11,MOM aill■ MEND.OW= ..11110 amp MEOW eiair
w")• 4.1s-+ )
Ze. V
CI.V t4, RE_ — L.A.- J c)i-r• v..=--t-,4*
ocs
)sfiftP1 - 2.0 v
et-
1,4) QT.^f
Ick
c a live-AR,ry
icsic
GAIN
ec•cr4C
S-140.4.110
am. sr. law INN. M.. raw Ow. wirip) I
,,,/ V 4-1S-
Z T-ic- 10 2E
I a- 0
rU 4e. o # .4410 *OiS 81.70 ellkaitlet4Wi ,
•.44. 0....MV.
111501311'
01110.171.,
•
Fig. 5. Current-voltage characteristic of twoBD-4 diodes (dim curve and bright curve).An instability, due to negative resistanceoscillations occurred on the bright curvebut could be surpressed by small capacitance(fingers!) across the diode. The slope ofthe I-V characteristic at the origin is thevideo output conductance of the detector;for the bright curve above, this is 1/(330 ohms).
DET
ECTO
R *3
, -15
08M
AT
10VO
LTSA
L=5K
.3.7
K.AN
D 2
.5K
F+5".....
-5%
DET
ECTO
R *3
FIN
AL M
ARCH
25.
1981
[45% -5
%•1
1VO
LT10
15--
,7ps
oN
02=
26. 1
7PZ
=-3
.65
S=5.
14AT
TEN
DET
MU
MTR
MV
ERRO
R12
,„„31
36.3
-1.6
70%
1110
39.6
319
3.4
0%10
260.
2519
90.3
8-.2
1%-1
7o4m
.■2
8180
.815
83.0
33
6441
.58
1243
.65
0%4
5188
.58
999.
15.0
9%5
4090
.578
6.2
.05%
632
56.4
862
4.42
0%7
2568
.83
490.
92-.0
4%8
2083
.48
396.
2.0
4%9
1646
.13
311.
67-.1
1%10
1313
.63
246.
8511
1039
.63
193.
53-.0
6%-2
713
667.
712
1.63
1542
8.05
74.3
318
230.
3336
.38
-.73%
2015
5.42
21.3
8.3
7%
. 11 V
OLT
10 1
5
*3 A
T -1
608M
r+5%
O9
•
•.fi 4
4ki
•
-5%
1 VO
LT10
15
Fig 6. Example of use of square-law error program. The data in the
top-left graph was obtained with detector maximum input power
level at -15 dBm and 3 different values of detector load
resistance; the detector amplifier gain was adjusted at each
load resistance setting to give 10 volts amplifier output
at -15 dBm input power. A desired maximum error of 0.3%
could not be obtained at this power level. The maximum
power level was reduced to -16 dBm (lower left graph) and
finally to -17 dBm (upper right) where satisfactory
performance was obtained at a load resistance of % 3k and
amplifier gain of 780. A table of attenuator dB, detector
and power meter output mV corrected for zero, and % error
was then printed.
SAMP
*50
TIME.
1008HS RMS=.10
DETECTOR *3 -27D8M INPUT
5 u110B
1000115
225mHZ50 SAMPLESTHEOPETICAL`RmS-7E-03%OR .07mv1)2=21.89 W.)
VN=
1016.7 Mr
-5mVDRIFT
=5E-03 MU 'S AV= 016.89 M
SAMP=
50 TIME=1080MS
NO SIGNAL
.OGIMU DRIFT=5E-03MV'S P0=3.15MU
„LIDS1000ms225MHZ50 SAMPLESTHEORETICALRms =7E -03%OR omu
VZ=25.69 m
VN=2., Mk)
Rms=.061mv7 8 syv
-timvORIFT
=5E -03 mv/S Av=3
EiVieD 7,615 myBIS 3S1e Ctm
505
1000MS
225MHZ
50 SAMPLES
THEORETICALRMS-7E -03%OR .27MV
VZ=26.6 MV
VN=4065.1 MI
-5MVRMS= 272MV DRIFT= -
SAMP=50 TIME=1000MS RM8=.272MU
DETECTOR #3 , -21 DEM INPUT
5Mt)
16 mV/S AV=4 531 M
DR / FT..5E-03tit)/
43 Akfr
a1016. 89tit)
-13-
Fig. 7. Example of noise tests of a detector and amplifier. Thevariation in amplifier output is plotted as a function oftime; more specifically, fifty one-second averages of theoutput minus the first average are plotted. Statisticssuch as the rms deviation, drift rate, and average outputare then computed and printed. The theoretical rms noisedue to the noisy IF input signal of stated bandwidth isalso given at the left of each plot. The three Plots arefor different input signal levels. The middle plot, atzero input signal, shows a rns output noise of 61 pVwhich is equal to the theoretical noise at qi 0.9 voltsdetector output (27.5 dBm input); at this level the opamp noise is equal to the inherent fluctuation of thedetected noise for 1 second.
RM
S .5
9MV
DR
IFT
=.05
7MV
/sAV
=1.7
8MV
SA1I
P=50
TIM
E=10
00H
S
SA
MP
=50
TIM
E=1
000M
S R
MS
=.39
7MV
DR
IFT=
-IE
-03M
V/S
AV
=1
.45
MV
0P27
CJ
OP
AM
P. A
DIO
S G
AIN
X10
AN
D O
P A
MP
GA
IN=7
80 G
IVIN
G 5
1NV
RM
S O
PAM
P N
OIS
E.
2108
1000M
S
25M
HZ
50 S
AMPL
ESTH
EO
RE
TIC
AL
RM
S= 7E
-03
%O
R O
MV
UZ=
52M
U
UN
=1.6
MV
-5H
VR
MS
=.3
97M
1)
DR
IFT
=-1
E-0
3 M
V/S
AV
=
SA
MP
=50
TIM
E=1
000M
S R
MS
=.39
7MV
DR
IFT=
.014
MV
/S A
V=1
.551
11)
SAM
P= 50 T
IME
100
0MS
RM
S=.
4771
11)
OR
IFT
=.01
4MV
/S A
V=2
•211
1V
SEC
ON
D 0
P27.
AVE
RAG
E R
MS
59N
v
5M
V
210e
1000
MS
225M
HZ
50 S
AM
PLE
STH
EO
RE
TIC
AL
RM
5=7E
-03%
OR
OM
VV
2=33
6.44
MV
VN
=2.5
MV
-5H
VR
ms=
.477
MV
DR
IFT
=
spm
p.50
TIM
E=1
000H
S R
MS. 1.
9471
1V D
RIF
T=.
105M
V/S
pv=
-.9.
1111
)
SA
MP
=50
TIM
E=1
000M
S R
MS
=1.8
9MV
DR
IFT: -7
E -0
3MV/
S A
V=
5.29
111)
.M
P-5
507E
J. R
MS
242
NV
RTI
511
1)21
0810
00M
S
225M
HZ
50 S
AM
PLE
STH
EO
RE
TIC
AL
RMS
..7E
-03%
OR
OM
VV
Z=
329.
63M
V
VN
=6.5
MV
-5m
vR
ms=
.8
9H
V D
RIF
T=
-7E
-0
3 M
V/S
AV
= 5.29
Mk)
01
4 M
V/S
AV
=2
.21
MU
SA
MP
=50
TIM
E=1
000M
S R
MS
=.52
11V
OR
IFT
=.08
411w
s A
vala
nmu
SA
MP
=50
TIM
E 1
000M
S R
MS
=.48
4M1)
OR
IFT
= -.e1
2MV
/S A
V=
2.7M
V
SPH
P=50
TIN
E=
1000
M$
RM
S=.
6231
11) D
RIF
T= .0
3MV
/S A
V"2
.05
M1
)
BURR -B
R OWN 3
51sc
m.
AVER
AGE
OF
3 IS
70N
UR
MS
REF
ERR
ED T
O IN
PUT
5MU
2108
1000
MS
225M
HZ
50 S
AM
PLE
STH
EO
RE
TIC
AL
RM
S... 7E
-03
%O
I OM
VV
2=54
6.73
MV
VN
=2 5
MV
RM
S=
.62
3.1
1V
DR
IFT
.0
1 M
VIS
AU
2.0
5 M
V
SA
MP
=50
TIM
E=1
000M
S R
MS
= .514
MV
DR
IFT=
.011
111)
/S A
V=1
.821
11)
SAM
P=50
TIM
E: 10
00M
S R
MS
=.58
5MV
DR
IFT
=.05
2MV
/S A
V=.
8211
1)
Fig
. 8.
Exam
ple
s of
no
ise
test
s o
f o
per
atio
nal
am
pli
fier
s. D
etec
tor
dio
de
was
connec
ted,
no R
F s
igna
l w
as a
ppli
ed, o
p am
p vo
ltag
e ga
in w
as 7
80, A
DIO
S g
ain
was
10,
and
inte
gra
tio
n t
ime
was
I s
eco
nd
. T
he
rms
no
ise
is t
hu
s m
easu
red i
n t
he
.01 H
z to
0.5
Hz
band
whe
re i
t is
not
spe
cifi
ed b
y m
anuf
actu
rers
. The
OP
27C
J rm
s in
put
no
ise i
s r t,
58 a
V w
hich
sho
uld
be c
ompa
red
to a
spe
cifi
cati
on o
f 25
0 nV
pea
k-to
-pea
kin
th
e .0
1 t
o 1
0 H
z b
and
.
V(K) and P (K) be the voltages measured by ADIOS at its AIN and BIN
inputs connected to the detector output and power meter outputs, respectively;
attenuator setting, in dB, or esponding to these values is A(K). The index.
, runs fro 0 to N which is normally 16.
hin ADIOS is included In V(K) and P(K). The digitally controlledzero error
VZ
PZ =
- 10-A(0) - A(1) /10
and the zero offsets and scale factor, , are computed a
V(0) - * V(1)
P(0) - G * P(1) G
S V(1) - VZ P(1) PZ
The equations for VZ and PZ reduce to V(0) and P(0)
.2)
ment 540. For each value the % error is computed as,
E(KV(K) - VZ S * (P(K)
) 100 * V(K) (1.4)
-15--
Appendix I. Square-Law Error Definition
The first se t of numbers for K = 0, is taken at maximum attenuation,
A(0) 31, and is used, primarily to determine the total zero errors, VZ and
P . The second set of numbers, taken at a reference attenuation level,
A(1) , which should be in the middle of the dynamic ange of the detector.
The gain factor, G, is defined a
The attenuator is then stepped thru 15 values listed in the program s ate-
c,1
aL
7-.
,441
F!
'if.'
8.r
-.
4 9
3a
zs
*-,---
#13
r-;
too
Z,.
43ci
0(.
#4 rr
E.vL
4ir
¶ i,*
19i4
-r
F2
.
4
:3 c_6
.oI;
,,-,,L
._ A
?41C
/47'
oict
v€is
!/S-/
/'.)
W/P
1/Q"
TY
,
MODE
L44
404'
31/v
aiir
4400
4447
101s
7.8eg
4467
cmcm
an44
5051
18'
4118
'45
144
5713
0bO
A11
.7an
ancm
N
I rl4
1/4
•1
TH
ES
E A
TT
EN
UA
TO
RS
MA
Y B
E T
AIL
OR
ED
FO
R C
USTO
M R
E-
OU
IRE
ME
NT
S, IN
-C
IUD
ING
FR
AC
TIO
NA
LS
TE
PS
- C
ON
SU
LT
FAC
TO
RY
.
;134
500H
MS
75 O
HM
SIF
-__
____
____
____
____
____
___
____
____
____
____
FRE
UEN
CY
RAN
GE
(MH
z)D
C-15
0000
-150
0D
G500
DC-
1D
C-1c
xD
C-b
®
10,2
0.30
,70
1iiii
— -
__
to3.
0_*Ii
- _
tIll.
&t_
__
1,2
481
1,2
,48,1
53Z
64
4.0
1,2,
4,8,
1632
,64
6MIW
SEC
ON
DS
PER
STE
P10
.000
,000
OPE
RA
TiO
NS
cON
TRoL
VO
LTAG
EA
TTEN
UA
TiO
N IN
SER
TED
± 1
2V, 3
70 M
IUJW
ATT
S PE
R S
TEP
I
gS8,
9 8
, y 3
) ATT
EN
UA
TiO
N W
FO T
O +
5 V
OlT
CO
NN
ECTO
RS
BN
C S
TA
ND
AR
D (
OP
TiO
NS
SM
A T
N0
l2ou
nces
.34K
-
B
000 00
1 iir
35cm
STEP
S (d
B)1020,.
7O
ACC
UR
ACY:
±dB
or%
dBD
C- 5
00M
Hz
500-
1000
MH
Z10
00-1
500M
Hz
VSW
RD
C- 5
00M
Hz
500-
1000
MH
Z10
00-1
500M
Hz
INSE
RTI
ON
LOSS
(dB)
DC
- 500
MH
z50
0-10
00M
Hz
1000
-150
0MH
z2O
SWIT
CH
SPE
EDL
ilKay
Ele
ctri
c C
o., P
ine
Bro
ok, N
J
PR
OG
RA
MM
AB
LE
AT
TE
NU
AT
ORAPI
D R
ELAY
SWIT
CH
ING
S EA
SY F
IELD
SER
VIC
E
Ap
pen
dix
II.
Dig
ital
Att
enu
ato
r an
d D
riv
er
connected thru the ADIOS
interface to the Apple Computer. The ADIOS analog-input scaling toggle switches
should be set for - (bipolar) mode with AIN full scale at 10 volts and BIN
full scale at
Program Entry
The DETECTOR1 program must be on a disk along with auxiliary programs
SHAPES ( p lotting sYmbols), HGR CUR GEN (to label Plot), ADIOS INITB (to initialize
the A/D interface), and LOMEM: (to move program in me ory). Type "RUN
DETECTOR1" to load and run the program; the program will subsequently load in
the auxilia y programs.
The Program chooses integration time, COUNT 800 MS, and settling time
between attenuator steps BLANK = 800 MS, for the square-law error measurement.
These may be changed by typing the CTRL and E keys and then 192 when EDIT
appears on the screen. The desired values are substituted in program line 192,
the RETURN key is pressed, and "RUN" is typed to sta program with the new
values. A similar procedure can be used on line 540 to change attenuator
step values.
Program Operation
The program has several tasks; each is initiated by first typing the ESC
key and then a number as described below. Any task may be terminated by typing
"CTRL C."
ESC 1 - This starts a square-law error measurement. If the program
has previously plotted square-law errors or noise measurements
on the CRT, the screen may be first erased by typing "ESC 8."
ESC 2 - Pressing this after a square-law error measurement temporarily
removes the plot and gives a table of results on the CRT.
ESC 3 - Brings back the square-law error plot after using ESC-2.
ESC 4 - This starts a detector noise measurement. The program first
allows changing the number of samples the attenuator DB
setting, the integration time per sample in milliseconds, the
IF bandwidth in MHz, or the plot scale in mV. Pressing RETURN
will start the measurement.
ESC 6 - This prints the graph which is or has been on the CRT screen
in a 5" wide format.
ESC 7 - This prints the graph double-size and rotated 90'
ESC 8 - Erases graph memory.
ESC 9 - Prints a table of square-law error values.
Program Listing
A listing of the program as on March 26, 1981 follows:
0123 /81' 0823. .
PROGRAM LENGTH= 11813 BYTES VARIABLES= 2459 BYTESFREE MEMORY= 6207 BYTESSTART=16385 LOMEM=28198 FREE=30577 STRING=36784 HIMEM=36864
100 REM DETECTOR1 PROGRAM OF MARCH 26,1981 HEPSURES SQUARE LAWERROR OF A DETECTOR110 REM REQUIRED HARDWARE: 48K APPLE II+HITH DISK.CRT,PRINTER CLOCK,AN0 ADIOS A/0 INTERFACE
120 REM REOUIRED ON DISK: SHAPES (PLOTTING SYMBOLS),HGR CHR GEN(TO LABEL PLOT), POIOS-INITO (TO INITIALIZE A/0 114 .flDRI: 1:11DE), AND LOMEN:(TO MOVE PROGRAM LOCATION)130 REM NEXT MOVES PROGRAM START TO 16384140 PRINT CHR$ (4);"BRUN LOMEM:": & LOMEM: 16384145 REM LOMEM IN A816,1_160150 HIMEM: 36864160 REM NEST POKES RESTORE MEMORY AFTER 1013 SINCE LOMEM: CHANGEDOALUES17" POK E 1n13,76 POKE 1014,12180 POKE 1015,151: POKE 1016,76190 POKF 101700: POKE 1018,151
-19-
CN = vLO:BN = 0800: REm OFFPULT COUNT ANO BLA4K TTHES IN MSREM NEXT ANNOUNCES PROGRAM
197 HGR TEXT : HOME SPEED= 255200 PRINT "DETECTOR1 OF 3/26/81 .. PRINT202 PRINT "MEASURES SQUARE-LAN ERROR AND DETECTOR NOISE ANC' DRIFT.CONNECT DETECTOR TO PIN AND POWER METER TO BIN. ADIOS INTERNAL SWITCHESMUST BE SET FOR +/- 10 VOLT MODE"
2'04 PRINT : PRINT "INTEGRATION PARAMETERS ARE COUHT=";CN;" PHD BLANK=";BN;". CHANGE THESE BY CONTROL -E 192. CHANGE ATTENUATOR STEPS BY CONTROL -E540
206 PRINT : PRINT "START SQUARE-LAW TEST BY ESC-1 OR NOISE/DRIFT TESTBY ESC-4"
208 REM NEXT. LOADS CHARACTER GENERPTOR IN P2048,1_3328210 PRINT CHR$ (4);"8LOAD HGR CHR GEN"220 REM DEFINES CONTROL 0 FOR DOS PRINT230 0$ = CHR$ (4):Dr$ = DS + "CLOSE"
0 REM NEXT LOADS PLOTTING SYMBOLS275 PRINT 0$;"BLOAD SHAPES"280 POKE 232,191: POKE 233,31: REM BLOADED SHPPES, A8127 L 4290 DIM A(050),V(200),P(050),E(050*6 10 REM NEXT INITILIZES A/0 INTERFACE AND SETS UP INTEGRATION CYCLE320 PRINT 0$;"BLOAD ADIOS -INITB"330 REM BLOADED 85 = $ :55 BYTES IN 7986 =350 COUNT = CM: BLANK = BN360 GOSUB 4100: REM LOADS COUNT AND BLANK INTO420 REM GOSUB 5300 TO TURN ON PRINTER430 REM CALL 1013 TURNS OFF PRINTER450 POKE 33,40: REM NORMAL TEXT WINDOW480 REM . CONSTANTS FOR SCALING490 CA = 32:C8 = 0.5:CC = 100:CE = 10:CD492 ce = 1000495 Cl = 100C2 = 55.677C3 = 4.605:C4 = 75:c5 = 15496 r8 - 27R:r q = 15n...1 110 REM CONSTANTS FOR OATP TRANSFER510 MC = 3.2768:Md = 128:MK = 256:MM = 65536520 REH OEFPULT PPRAMETER VALUES530 FOR K = 0 TO 16: READ A(K): NEXT K540 DATA 31,11,1,2,3,04,05,6,7,8,9,10,11550 RESTORE555 G = EXP (CF * (P(1) - A(0)))600 REM ROUND-OFF FUNCTIONS NEXT610 DEF FN FO(X) = INT (X + CB)615 DEF FN Fl(X) = INT (CE * X + CB) / CE620 CIEF FN F2(X) = INT (CC * X + CB) / Cr625 DEF FN F3(X) = INT (CG * + CB) / Ce630 REM PLOTTING FUNCTIONS NEXT640 DEF FN Y(E) = C4 + C5 * E650 LIEF FN X(V) = C2 * ( LOG (V) - C3)700 DB = 11: GOSUB 4200: REM SET ATTENUATOR TO800 REM DEFAULT RHS NOISE PARPMETERS HEX810 SAMPLES = 25:01 = 11:TI = 1000:814 = 2:PS =990I. =998 N = 16999 ENO
1100 GOSUB 3700: ENOt200 TEXT : END1300 POKE - 16304,0: POKE - 16301,0: VTAB (21): END1400 REM NOISE TEST1410 GOSUB 2000: END1600 REM PRINT GRAPH1605 INPUT "TYPE QUOTE MARK,COMMENT, AND (RETURN) ";CM$1610 GOSUB 5300: REM TURN ON PRINTER1620 PRINT CM$1625 POKE 1145,105: REM REGULAR SIZE1630 CALL - 16038: REM FOR TRENDCOM 2001640 CALL 1013: REM PRINTER OFF1650 ENO1700 REM BIG PLOT ON TRENOCOM 200 PRINTER1705 INPUT "TYPE QUOTE HARK,COMMENT, ANO (RETURN) ";CMS1710 GOSUB 53001720 POKE 2041,0: REM DEFEAT PAGE1730 PRINT CM$1740 POKE 1145,107: REM DOUBLE SIZE1750 CALL - 16038: REM PLOT1755 POKE 2041,68: REM RESET11" PAGE1760 CALL 1013: ENO : REM
1800 HGR TEXT HOME :L = 1: ENO REM ERASE GRAPHICS SCREEN1900 GOSUB 5800: REM PRINT TABLE1910 POKE - 16304,0: POKE - 16301,0: VTAB (21): ENO2000 REM RMS NOISE MEASUREMENT2010 SCALE= 1: ROT= 02015 TEXT : HOME2018 PRINT2019 HOME2020 PRINT "PRESENT PARAMETERS ARE:*2025 PRINT "(I) SAMPLES= ";SA2030 PRINT "(2) DB= ";012035 PRINT "(3) INTEGRATION= ";TI;" MS"2040 PRINT "(4) BANDWIDTH= ";BW;" MHZ"2042 PRINT
11(5) PLOT SCALE,MV=";PS
2045 PRINT20591 PRINT "CHANGE (1),(2),(3),(4) (5> OR (RETURN) TO START MEASUREMENT"205F. GET2060 ON UAL (.....1$) GOTO 2n80,2100,2120,2130,2137
GOTOtNPUT "(t) SPMPLES= ";sA
2085 GO TO 20182100 INPUT "(2) OB= ";012105 GnTO 20182120 INPUT "INTEGRATION= ";TI2125 GOTO 20182130 INPUT "BANDWIDTH= ";BW2135 GOTO 20182137 INPUT "PLOT SCAIE,HV= ";PS
GOTO 201'AI '441 REH CH L=INGE COUNT AND BLANK IN ADIOS
2150 COUNT = TI:BLANK = 81.1
-2
2 SC GOSUB 4100: REM INITIALIZE ADIOS2165 OR = A(0): GOSUB 4200: REM ZERO2170 SG = 031 / SOR (BW * TI): REM THEORET ICAL RMS2175 REM DEF PLOT AXIS NEXT2180 DEF FN yi(w) = 75 - 74 * /2190 DEF FN Xl(K) = 79 200 *(K1) / sAJ 195 HL = PS:HH = PS2200 HGR''."..-*07 FOR H = HL TO 1.1 * NH STEP WH2210 HPLOT FN X1(1), FM Y1(W) TO FN Xl(SA), FN Yl<NDi: NEXT H
HPLOT FN X1(1), F14 Yl(WL) TO FN X1(1), FN V1(NH)22@ HPLOT FN Xl(SA), FN Y1(HL) TO FN Xl(SA), FN V1(NH)2240 REM LABEL2250 HCOLOR= 0: CALL 3072: PRINT CHR$ (1)1 PRINT CHR$ (17): HCOLOR=
VTAB (2): PRINT 01;"08"2270 VTAB (4): PRINT TI.7."MS"2280 VTAB (6): PRINT Bkii"MHZ2285 VTA8 (8): PRINT SA;" SAMPLES"2290 VTAB (10): PRINT "THEORETICAL2292 VTA8 (11): PRINT "RMS= "; FN F3(.12300 VTAB (21): CALL 1013: POKE 1632310 06 = A(0): GOSUB 4200_2315 K =2320 DB = A(1): GOSUB 4200:V0 = PIN2330 08 = 01: GOSUB 4200:UR = PIN2740 VZ = (V0 - G * VR) / (I - G)2350 GOSUB 4200:UN = AIN - V22355 REM USE HGR CHR GEM FOR VZ AND UN2360 HCOLOR= 0: CALL 3072: PRINT CHR$ (1):
• PRINT3
2365 VTAB (12): PRINT "OR "; FN E2 UN * 86);"Mtl"2370 ()TAB (14): PRINT "VZ="; FN F2(VZ);"MV"2380 VTAB (16): PRINT "VN="; FN Fl(VN);"MV"2385 VTAB (1): HTAB (12): PRINT FN F1(14H);"111„,"2390 VTAB (19): HTAB (12): PRINT FN Fl(WL);"Mkil2400 VTAB (21): CALL 1013: POKE - 16301,02410 V1 = 0:V2 = 0:V3 =2430 FOR K = 1 TO SA2440 GOSUB 4200:V(K) = PIN VZ2445 OV = V(K) UN2450 V1 = V1 + EN:V2 = 1J2 + DV
A 2
2460 V3 = 1,13 + K * DV2470 PO = (V(K - 1) - UN)2472 P1 = (V(K) tql)2475 IF PO > NH THEN PO = NH2476 IF PO < HL THEN PO =2477 IF P1 NH THEN 1)1 = NH2478 IF P1 < HL THEN P1 = HL
-22-
K • THE• HPLOT PN ), FN Yi(P0) TO FN Xl(K),FN Yl(P1)
2490 DRAW 2 AT FM Xl(K), FM Y1(P1)2500 NEXT2510 KO = SA:K1 = SA * (SA + 1) / 2:K2 = KI * (2 *9 + 1)2520 88 = (V3 VI * Ki / KO) / (1<2 Kl A 2 / KO): REM DRIFT SLOPE2530 AV = vi / KO - BB * Kl / KO: REM AVERAGE ABOVE UN2540 OR = 1000 * BB / (II + 80)1 REM DRIFT IN MV/SEC2590 MZ = V2 - 2 * AV * V1 - 2 * BB * V3 + AV A 2 * KO + 2 * AU * BB* Kl + Be A 2 * K2
2555 AV = AV + UN2560 RMS = ( SOR (117_ / KO))2565 HCOLOR= 0: CALL 3072: PRINT CHR$ (1): PRINT CHR$ (17): HCOLOR=
2568 VTAB (20)• 570 PRINT "RMS="; FN F3(RMS);"111.)';" DRIFT= ; FN F(OR);" MV/";"
AV= "; FN F2(AV);" MU"2575 CALL 1013: POKE 16301,02600 GOSUB 5300: REM TURN ON PRINTER2605 PRINT2610 PRINT "SAMP=";SA;" TIME=";TI;"MS RHS= '; FM F3(RHS);"MV DRIFT=";FN F3(DR);"MV/S AV="; FN F2(11V);"MV"
2620 HOME uTAB ('')1) . CALL 1017 . END2800 REM INITIALIZE PLOT *************2805 REM HANDLE LINE TYPE PPRPMETER,L2807 HCOLOR=2810 ON L GOSUB 2820,2825,2830,2835,2840,28452815 GOTO 2850: REM LINE TYPE SET2820 SH = 2: ROT= 0: SCALE= 1: RETURN2825 SH = 2: ROT= 08: SCALE = 2: RETURN2830 SH = 2: ROT= 0: SCALE= 2: RETURN2835 SH = 1: ROT= 0: SCALE= 1: RETURN2840 SH = 3: ROT= 00: SCALE= 1: RETURN2845 SH = 3: ROT= 32: SCALE= I: RETURN2850 POKE - 16304,EI: POKE 16301,0: POKE - 16297 02890 L = L + 12895 IF L < > 2 THEN RETURN2900 REM ORAN GRID AND LABEL2905 POKE - 16301,0: REM TEXT/GRAPHICS2918 HCOLOR=2920 FOR J = 5 TO 6 STEP 52930 HPLOT FN X(100), FN Y(J) TO FN X(15000), FN Y(d)2940 NEXT J2945 0(1) = 100:0(2) = 1000:Q(3) = 10000:Q<4> = 150002950 FOR J = 1 TO 42970 HPLOT F/4 X(Q(J)›, EN Y( - 4.90) TO FN X(Q(J)), FN Y(5)2980 NEXT J3000 REM LABEL3010 HCOLOR= 03020 CALL 3072: REM INIT HGR CHR GEN3030 PRINT CHR$ (1); CHR$ (17)3035 HCOLOR=3040 VTAB (1): HTA8 (2): PRINT "+5%"3045 ()TAB (18): HTAB (2): PRINT "-5"3050 VTAB (20): HTAB (1): PRINT ".I"3060 VTA8 (20): HTAB (18): PRINT "1 VOLT"3070 VTAB (20): HTAB (36): PRINT "10"3080 UTAB (20): HT118 (39): PRINT "15"3150 VTAB (21)3160 CALL 10133170 POKE - 16301,0
-23--
; FM F21. S
PRINT A(K); TAB( 10); FM F2CX30); FN F2(E(K));"%"
3548 XX = FM X(V(K)):YY = FN Y(E(K))3550 IF XX < 0 THEN XX = A
IF XX > C8 THEN XX = C83554 IF YY < 0 THEN YY = 072556 IF YY > C9 THEN YY = C93560 DRAW SH AT XX,YY3570 REM DRAW3580 NEXT K3610 08 = 11: GOSUB 42003620 RETURN : REM
PZ ) ) / i)(1. )- TAB( 20); FN F2(P(K)); TAB(t
FN FN Y, - 4)3185 J2 JI PN
FOR J = J3 TO JI STEP J23195 FOR K = 0 TO 279 STEP 83200 HPLOT K,J3210 NEXT K: NEXT -I3220 RETURN
REM
REM MEASUREMENT TASK330-J COUNT = CH: BLANK = BN3304 GosuB 4100: REM LOADS COUNT fl NO BLANK INTO AD os3310 08 = A(0): GOSUB 42 i3320 GOSUB 28003330 DB = A(00 1 : GOSUB 42003350 [(B = A(1)1 608118 42003360 V(0) = 4IN:P(0) = BIN3370 PRINT FN F1(AIN), FN Fl(BIN)3400 08 = 14(2): GOSUB 42003410 V(1) = AIN:P(1) = BIN3420 PRINT FN Fl(AIN), FN F1(BIN)3430 VZ = (V(0) -6 * V(1)) / (1 6)3440 PZ = (p(0) 6 * p(1)) / (1 _ 6)
3450 8 = (V(1) - vz) / (p.(1) - pz)
• 460 PRINT " IVZ= FN F2(V2); P7= FN F.4(PZ3500 FOR K = 2 TO N3510 OB = A( K. 1): GOSUB 42003520 1..1(K) = AIN:P(K) = BIN3,560 E(K) = Cl * (V(K) V7 - (P<K)
4100 REM LOAD COUNT,BLANK IN ADIOS4110 CS = 10 / COUNT4115 CT = 2 * CS:CZ = 100004120 CX = COUNT / 10:8X = BLANK / 104130 CH% = CX / 256:BL% = BX / 2564140 REM NEXT LOADS COUNT AND BLANK TIMES INTO ADIOS4150 POKE 7988,CX - 256 * CH: POKE 7989,CH%4160 POKE 7990,BX - 256 * MA: POKE 7991,8L%•4170 CALL 8018: REM STARTS ADIOS4180 RETURN4200 REM DATA TRANSFER ROUTINE WITH PARAMETERS DB (ATTENUATAND BIN
4201 REM GOTO 4700 :REM THIS IS TO GENERATE A TEST INPUT4205 REM NEXT 4 LINES TO SET UP 95134210 POKE 49342,20: REM ADDRESSES 9513 H044220 ZZ = PEEK (49334): REM ZZ IS DUMMY4230 POKE 49334 , 1 72 : REM CPL BIT SET HIGH4240 IF PEEK (49375) < 128 THEN 45004250 HPIT 49335 ,:t28,128: REM WAIT UNTIL OPTA READY BIT =0 AT BLANK
—24—
f(mE4260 POKE 49335,128: REM SFT DATA coRE Y BIT4280 DB% = DE4290 POKE 49332,0B%4300 POKE 49342,20: REM ADDRESS 9513 TO OUTPUT LSWORD OF 81144310 BIN = PEEK (49334) + MK * PEEK (49334)4320 POKE 49342,21: REM ADDRESS 9513 TO OUTPUT MSWORD OF BIN4330 BIN = BIN + MM * PEEK (49334)4335 BIN = CT * BIN — CZ4340 POKE 49342,18: REM ADDRESS 9513 TO OUTPUT LSHORD OF AIN4350 AIN = PEEK (49334) + MK * PEEK (49334)4360 POKE 49342,19: REM ADDRESS 9513 TO OUTPUT MSWORD OF IN4365 PIN = AIN + MM * PEEK (49334)4367 AIN = CT * AIN — CZ4370 POKE 49342,20: REM ADDRESS 9513 H044380 ZZ = PEEK (49334): REM DUMMY PEEK4390 POKE 49334,168: REM CLEAR CALL BIT4400 RETURN4500 REM TURN ON MISSED DATA- LIGHT4510 POKE 49342,18: REM ADDRESS HOLD14520 ZZ = PEEK (49334): REM DUMMY4530 POKE 49334,172: REM CLOCKS MISSED DATA ONE—SHOT4540 POKE 49342,184550 ZZ = PEEK (49334)4560 POKE 49334,168: REM CLEARS MISSED OPTP CLOCK4570 POKE 49335,0: REM CLEAR FLAG4580 GOT() 4250: REM
4590 REM
4700 AIN = 20 + EXP (CF * (41 — Fin)) + .09 * K + 2.4 * RHO (K) —. 5)
4705 OC = 0.84707 BIN = .1 * AIN4710 RETURN4800 REM SETS T$ TO TIME4805 YR$ = "81"4810 0$ = CHR$ (4)4820 PRINT D.S.i:"IN#4"4830 PRINT 0$;"PRit4"4840 INPUT "4850 CALL 10134870 OT$ = LEFT$ (T$,5) + "," + YR$ + "4872 SC$ = MID$ (T$,13,2)4874 EM = .1 * INT ( UL (SC$) / R)4876 EM$ = STR$ (EM)4880 TM$ = MID$ (T$ '7,2) + MID$ (T$,10,2) + EM$ + si4890 RETURN5300 REM TURNS ON TRENOCOM 200 PRINTER5310 REM :GOTO 5400: REM FOR APPLE PRINTER5315 PR# 1: PRINT CHR$ (0): REM FIRST CHARACTER NOT PRINTED5320 POKE 1913,6: POKE 1785,72: REM MARGINS5330 POKE 1657,80: REM LINE LENGTH5340 RETURN5400 REM TURN ON APPLE PRINTER5410 PRINT CHR$ (4);"PR#1"5420 Q$ = CHR$ (17): REM PRINT 0$ TO DUMP GRAPHICS5430 POKE — 12524,0: REM BLACK ON WHITE PLOT5440 POKE 12528,7: REM DARK PRINT5450 POKE — 12527,8: REM LEFT MPRGIN5460 RETURN
STGET TIME
5800 REM PRINTS TABLE5810 60SUB 5300: REM TURN ON PRINTER5820 HOME PRINT CHR$ (9);"N": REM DISABLE CRT5830 POKE 33,80: REM SET MPRGIN5835 PRINT wv7="; FN F2(VZ);, TAB( 15); u PZ= t - FN F2(PZ); TAB( 30);"S=";
FN F2(S)5840 PRINT "ATTEN D ; TAB( 15);'DET MU"; TAB( 30); 1 MTR MU . ; TAB( 45);"ERRORII
FOR K = 0 TO N5860 PRINT A(K); TAB( 15); FN F2(V(K));* TAB< 30); FN F2(P(K)); TAB(45); FN F2(E(K));."%"
5870 NEXT POKE 33,405880 PRINT CHR$ (9);
. H : REM ENABLE CRT5890 CALL 10135900 POKE 16301,05910 RETURN REM
6000 REM FORMATTED6002 GOSUB 4800: REM6005 POKE 33,336010 GOsuB 5300: REM TURN ON PRINTER
DEF FM CT(A0) = PEEK (AD) + 256 • * PEEK (A6028 SR = FN CT(103)6030 Lm = FN CT(105):FR = FN CT(109)6035 HM = FN CT(115):ST = FN CT(111)6043 PRINT PRINT OTS,TMS: PRINT6045 PRINT "PROGRAM LENGTH= ";LM- ST + FR - LM;" BYTES"
6050 PRINT "FREE MEMORY= ".;ST FR;"6051 PRINT "START= ";SR;" LOMEM=";LM;
6055 PRINT6060 LIST6065 CALL 10136070 ENO
SR;" BYTES VAR TABLES= t ;HM
Appendix IV. Noise Analys
-26-
Given a sequence of samples, V(K), for K = 1 to SA, we wish to compute
the linear function, A + B * K, which minimizes the total mean square
deviation, M, from V(K)
The minimization is performed in the usual manner by setting the derivatives
of M with respect to A and B equal to zero and then solving the two simultaneous
linear equations for A and B. The result is expressed in terms of six quantities
which are defined below, all summations being for K= 1 to SA:
K2 L1 kL = K1*(2SA + 1)13
= VI/K0 B*KliK0
B = (V3 - Vl*KI/K0)/(K2 - K1 2 /KØ)
M = V2 - 2 A*V1 x B*V3 + A2*KO + 2*A x B*K1 + B2*X2
(1V.2)
(IV.3)
(IV .4)
(1V.5)
(IV.6)
(IV.7)
(IV .8)
(IV .9)
(IV. 10)
To ease computational accuracy ents, a voltage VN, equal to therequire
-27-
where Ti is the time interval of one sample.
DR = Bi (SA*111)
of the sequence w
The theoretical rms deviation of the output of a square-law de ecto driven
by noise of bandwidth, BW, is given
VN/"\ BW*T1. These values are printed by the program for comparison with
measured values. It should be noted that the % accu
measurement is equal to 100/ SA; thus, for SA =
peak-to-peak error of + 30% is expected.
value,
ation of the sums IV.2-4. The same quantity is then added to A to givecompu
value of an initial sample is subtracted from the measured voltage before
Top Related