# CHAPTER 6: DIGITAL VOLTMETERS AND FREQUENCY METERS¶

## Example 6-1, Page Number: 139¶

In [7]:
import math

#Variable Declaration
f=1.5*10**6                  #Clock frequency in Hz
N=1999                       #Maximum count

#Calculations
clock_time_period=1/f        #Clock time period in s
t1=N*clock_time_period       #Maximum time in s
t2=0.25*t1                   #Select t2=0.25*t1
t=t1+t2                      #in s
fr=1/t                       #in Hz

#Results
print "Maximum time t1 for the digital voltmeter is",round(t1*10**3,2),"ms"
print "Ramp Generator Frequency can be",int(fr),"Hz"

Maximum time t1 for the digital voltmeter is 1.33 ms
Ramp Generator Frequency can be 600 Hz


## Example 6-2, Page Number: 149¶

In [11]:
import math

#Variable Declaration

V=20                                             #Voltage to be measured in V
analog_range=25                                  #Range of analog meter in V
analog_accuracy=2.0/100                          #Accuracy of analog meter at FSD

#Calculations

#Analog Instrument:
voltage_error=analog_accuracy*analog_range        #in V

error=voltage_error*100/V                         #in percentage

print "For the analog meter,"
print "Voltage Error=±",round(voltage_error,1),"V"
print "Error=±",round(error,1),"%"

#Digital Instrument:

#For 20 V displayed on a 3 1/2 digit display
digit=0.1                                         #in V
digital_accuracy=0.6/100
voltage_error=digital_accuracy*V+digit            #in V
error=voltage_error*100/V                         #in percentage
print
print "For the digital meter,"
print "Voltage Error=±",round(voltage_error,2),"V"
print "Error=±",round(error,1),"%"

For the analog meter,
Voltage Error=± 0.5 V
Error=± 2.5 %

For the digital meter,
Voltage Error=± 0.22 V
Error=± 1.1 %


## Example 6-3, Page Number: 153¶

In [17]:
import math

#Variable Declaration

ft=1.0*10**6                  #Clock generator frequency in Hz
fi=1.512*10**3              #Input frequency in Hz

#Calculations
#Using 6 decade counters
d=6                         #No. of decade counters used
f1=ft/10**d                 #Time base frequency in Hz
t1=1/f1                     #Time period in s
n1=fi*t1                    #No. of cycles counted
f=n1/t1

print "When 6 decade counters are used,f=",round(f/1000,3),"kHz"

#Using 4 decade counters
d=4                         #No.of decade counters used
f2=ft/10**d                 #Time base frequency in Hz
t2=1/f2                     #Time period in s
n2=fi*t2                    #No. of cycles counted
f=n2/t2

print "When 4 decade counters are used,f=",round(f/1000,1),"kHz"

When 6 decade counters are used,f= 1.512 kHz
When 4 decade counters are used,f= 1.5 kHz


## Example 6-4, Page Number: 154¶

In [1]:
import math

#Variable Declaration
accuracy=10**-6                                #Accuracy

#At f=100 Hz

f=100                                          #Frequency in Hz
error=1+f*accuracy                             #in terms of counts
percentage_error=error*100/f                   #in percentage

print "At f=100 Hz,"
print "error=±",round(error),"count"
print "%error=±",round(percentage_error),"%"
print
#At f=1 MHz,

f=1*10**6                                       #Frequency in Hz
error=1+f*accuracy                              #in terms of counts
percentage_error=error*100/f                    #in percentage

print "At f=1 MHz"
print "error=±",round(error),"count"
print "%error=± ",'%.1e' % percentage_error,"%"
print

#At f=100 MHz

f=100*10**6                                     #Frequency in Hz
error=1+f*accuracy                              #in terms of counts
percentage_error=error*100/f                    #in percentage
print "At f=100 MHz,"
print "error=±",round(error),"count"
print "%error=±",'%.2e' % percentage_error,"%"
print

At f=100 Hz,
error=± 1.0 count
%error=± 1.0 %

At f=1 MHz
error=± 2.0 count
%error=±  2.0e-04 %

At f=100 MHz,
error=± 101.0 count
%error=± 1.01e-04 %