# Chapter 6 : Signal Conditioning¶

## Example 6.1 Page No : 283¶

In :
# Variables
A = 100.;
R1 = 1.*10**3;

# Calculations
Rf = -A*R1;

# Results
print "feedback resistance (ohm) = ", Rf

feedback resistance (ohm) =  -100000.0


## Example 6.2 Page No : 285¶

In :
# Variables
Rf = 10.;
R1 = 1.;
Avol = 200000.;

# Calculations
A = -(Rf/R1)*(1./(1.+(1./Avol)*((R1+Rf)/R1)));

# Results
print "closed loop gain = ", A

closed loop gain =  -9.99945003025


## Example 6.3 Page No : 287¶

In :
# Calculations and Results
Sa = 10;
print " saturation voltage = ", Sa
Vom = Sa;
print "maximum output voltage", Vom

 saturation voltage =  10
maximum output voltage 10


## Example 6.4 Page No : 289¶

In :
# Variables
Vos = 5.*10**-3;
Rf = 10.;
R1 = 1.;

# Calculations
Vo = -Vos*(1+Rf/R1);

# Results
print "output voltage due to offset voltage (V) = ", Vo

output voltage due to offset voltage (V) =  -0.055


## Example 6.5 Page No : 291¶

In :
# Variables
Rf = 10.;
R1 = 1;

# Calculations
A = Rf/R1;

# Results
print "Amplification Factor = ", A

Amplification Factor =  10.0


## Example 6.6 Page No : 293¶

In :
# Variables
V1 = 1.;
V2 = -2.;
Rf = 500.;
R1 = 250.;
R2 = 100.;

# Calculations
Vo = -(((Rf/R1)*V1)+((Rf/R2)*V2));

# Results
print "output voltage(V) = ", Vo

output voltage(V) =  8.0


## Example 6.7 Page No : 295¶

In :
# Variables
Rf = 100.*10**3;
R1 = 1*10**3;

# Calculations and Results
A = Rf/R1;
print "Gain = ", A
print "If multiplier is 10",
A = 10;
Rf = A*R1;
print " feedback resistance (Ohm) = ", Rf

Gain =  100.0
If multiplier is 10  feedback resistance (Ohm) =  10000


## Example 6.8 Page No : 297¶

In :
# Variables
g = 10.;
Rf = 10.;

# Calculations and Results
R1 = Rf/g;
print "resistance R1(Kilo-ohms) = ", R1
R2 = Rf/(0.5*g);
print "resistance R1(Kilo-ohms) = ", R2
R3 = Rf/(0.333*g);
print "resistance R1(Kilo-ohms) = ", R3

resistance R1(Kilo-ohms) =  1.0
resistance R1(Kilo-ohms) =  2.0
resistance R1(Kilo-ohms) =  3.003003003


## Example 6.9 Page No : 299¶

In :
# Variables
Voramp = -10;
print "if voltage source is 10V then RC =  1 ms and if C = 1 micro-F"

# Calculations
C = 1;
R = 1*10**-3*10**6;

# Results
print "value of resistance (ohm) =  ", R

if voltage source is 10V then RC =  1 ms and if C = 1 micro-F
value of resistance (ohm) =   1000.0


## Example 6.10 Page No : 301¶

In :
# Variables
V2 = 5.*10**-3;
V1 = 3.*10**-3;
Vo = 300.*10**-3;

# Calculations and Results
Vd = V2-V1;
Ad = Vo/Vd;
print "difference mode gain = ", Ad
V2 = 155*10**-3;
V1 = 153*10**-3;
Vo = Ad*(V2-V1);
print "output voltage (V) = ", Vo

difference mode gain =  150.0
output voltage (V) =  0.3


## Example 6.11 Page No : 303¶

In :
# Variables
Vo = 3.;
Vd = 30.*10**-3;

# Calculations and Results
Ad = Vo/Vd;
print "difference mode gain = ", Ad
Vo = 5.*10**-3;
Vc = 500.*10**-3;
Ac = Vo/Vc;
print "Common mode gain = ", Ac
CMRR = Ad/Ac;
print "Common mode rejection ratio = ", CMRR

difference mode gain =  100.0
Common mode gain =  0.01
Common mode rejection ratio =  10000.0


## Example 6.12 Page No : 305¶

In :
# Variables
V2 = 30.*10**-3;
V1 = -30.*10**-3;
Vd = V2-V1;
Ad = 150.;
Vos = Ad*Vd;
Ac = 0.04;
Vc = 600.*10**-3;

# Calculations
Von = Ac*Vc;
SNR = Vos/Von;
CMRR = Ad/Ac;

# Results
print "Signal to Noise Ratio = ", SNR

print "CMRR = ", CMRR

Signal to Noise Ratio =  375.0
CMRR =  3750.0


## Example 6.13 Page No : 307¶

In :
# Variables
Ci = 10.*10**-12;
Vi = 10.;
Eo = 8.85*10**-12;

# Calculations and Results
A = 200.*10**-6;
K = -Ci*Vi/(Eo*A);
print "sensitivity (V/mm) = ", K
d = 1*10**-6;
Vo = K*d;
print "output voltage (V) = ", Vo

sensitivity (V/mm) =  -56497.1751412
output voltage (V) =  -0.0564971751412


## Example 6.14 Page No : 309¶

In :
import math

# Calculations and Results
MXtc =  10.**10*1000*10**-12;
print "Maximum time constant (s)", MXtc
MNtc =  10.**8*10*10**-12;
print "Minimum time constant (s)", MNtc
AR = 0.95;
fmin = (AR)/(2*math.pi*MXtc*(1-AR**2)**0.5);
print "minimum frequency (Hz)", fmin
fmax = (AR)/(2*math.pi*MNtc*(1-AR**2)**0.5);
print "Maximum frequency (Hz)", fmax

Maximum time constant (s) 10.0
Minimum time constant (s) 0.001
minimum frequency (Hz) 0.0484218556919
Maximum frequency (Hz) 484.218556919


## Example 6.15 Page No : 311¶

In :
import math

# Variables
g = 0.501;
f = 50;

# Calculations and Results
w = 2*math.pi*f;
tc = (1-g**2)**0.5/(w*g);
print "time constant (s)", tc
R = 10000;
C = (tc/R)*10**6;
print "capacitance (micro-F)", C

time constant (s) 0.00549861130167
capacitance (micro-F) 0.549861130167


## Example 6.16 Page No : 313¶

In :
import math

# Variables
R1 = 10.*10**3;
R2 = 1.*10**6;

# Calculations and Results
A = R2/(R1+R2);
print "gain = ", A
C2 = (0.01)*10**-6;
C1 = 100.*10**-12;
fcl = 1./(2*math.pi*C2*R2);
print "lower cut off frequency (Hz)", fcl
fcu = 1./(2*math.pi*R1*C1);
print "upper cut off frequency (Hz)", fcu

gain =  0.990099009901
lower cut off frequency (Hz) 15.9154943092
upper cut off frequency (Hz) 159154.943092


## Example 6.17 Page No : 315¶

In :
import math

# Variables
R = 1.*10**6;
fo = 10.*10**3;

# Calculations
C = 1/(2*math.pi*fo*R);

# Results
print "the value of C (F)", C

the value of C (F) 1.59154943092e-11


## Example 6.19 Page No : 317¶

In :
import math

# Variables
Rt = 100.;
K = 1.;

# Calculations and Results
Rb = K*Rt;
ei = 10;
print "When K = 1"
eo = ((K*Rt/Rb)/(1+(K*Rt/Rb)))*ei;
print "output voltage (V) =  ", eo
Se = (ei*Rb)/((Rb+K*Rt)**2);
print "sensitivity (V/ohm) =  ", Se
K = 0.95;
print "When K = 0.95",
eo = ((K*Rt/Rb)/(1+(K*Rt/Rb)))*ei;
print "output voltage (V) =  ", eo
Se = (ei*Rb)/((Rb+K*Rt)**2);
print "sensitivity (V/ohm) =  ", Se

When K = 1
output voltage (V) =   5.0
sensitivity (V/ohm) =   0.025
When K = 0.95 output voltage (V) =   4.87179487179
sensitivity (V/ohm) =   0.0262984878369


## Example 6.20 Page No : 319¶

In :
import math

# Variables
ei = 100.;
K = 0.25;
print "When K = 0.25"

# Calculations and Results
eo = ((K/6)/(1+(K/6)))*ei;
print "output voltage (V) =  ", eo
K = 0.5;
print "When K = 0.5",
eo = ((K/6)/(1+(K/6)))*ei;
print "output voltage (V) =  ", eo
K = 0.6;
print "When K = 0.6",
eo = ((K/6)/(1+(K/6)))*ei;
print "output voltage (V) =  ", eo
K = 0.8;
print "When K = 0.8",
eo = ((K/6)/(1+(K/6)))*ei;
print "output voltage (V) =  ", eo

When K = 0.25
output voltage (V) =   4.0
When K = 0.5 output voltage (V) =   7.69230769231
When K = 0.6 output voltage (V) =   9.09090909091
When K = 0.8 output voltage (V) =   11.7647058824


## Example 6.21 Page No : 321¶

In :
import math

# Variables
R2 = 119;
R3 = 119.7;
R1 = 120.4;
R4 = R2*R3/R1;
R4 = 121.2;
ei = 12;

# Calculations
eo = ((R1*R4-R2*R3)/((R1+R3)*(R2+R4)))*ei;

# Results
print " output voltage (V) = ", eo

 output voltage (V) =  0.0724469161996


## Example 6.22 Page No : 323¶

In :
# Variables
ei = 6.;
R = 10000.;
print "if dR = 0.05R"

# Calculations and Results
dR = 0.05*R;
eo = ((dR/R)/(4+2*(dR/R)))*ei;
print "output voltage (V)", eo
print "if dR = -0.05R"
dR = -0.05*R;
eo = ((dR/R)/(4+2*(dR/R)))*ei;
print "output voltage (V)", eo

if dR = 0.05R
output voltage (V) 0.0731707317073
if dR = -0.05R
output voltage (V) -0.0769230769231


## Example 6.23 Page No : 325¶

In :
# Variables
R2 = 800;
R3 = 800;
R4 = 800;
Rm = 100;
R = 800.;
ei = 4;

# Calculations
im = 0.8*10**-6;
dR = (im*R**2)*(4*(1+Rm/R))/ei;
R1 = R+dR;

# Results
print "resistance of unknown resistor (ohm) = ", R1

resistance of unknown resistor (ohm) =  800.576


## Example 6.24 Page No : 327¶

In :
# Variables
R2 = 1000.;
R3 = 1000.;
R1 = 1010.;
R4 = 1000.;
ei = 100.;

# Calculations and Results
eo = ((R1*R4-R2*R3)/((R1+R3)*(R2+R4)))*ei;
print " open circuit voltage (V) = ", eo
Ro = (R1*R4/(R1+R4))+(R2*R3/(R2+R3));
Rm = 4000;
im = eo/(Ro+Rm);
print "current (A) = ", im

 open circuit voltage (V) =  0.248756218905
current (A) =  4.97265042268e-05


## Example 6.25 Page No : 329¶

In :
# Variables
R = 100.;
P = 250.*10**-3;

# Calculations and Results
i = (P/R)**0.5;
print "maximum permissible current (A) = ", i
ei = 2*i*R;
print "maximum supply voltage (V) = ", ei
Rs = 100.;
Ps = 10.**2/Rs;
print "Power dissipation in series resistance (W)", Ps

maximum permissible current (A) =  0.05
maximum supply voltage (V) =  10.0
Power dissipation in series resistance (W) 1.0


## Example 6.26 Page No : 331¶

In :
# Variables
P = (0.1/0.2)*10**-3;
R = 1000.;
eim = 2*(P*R)**0.5;
dth = 0.1;

# Calculations
dR = (4.5/100)*dth*R;
eom = (dR/(4*R))*eim;
Sem = eom/dth;

# Results
print "maximum voltage sensitivity of the bridge (V) = ", Sem

maximum voltage sensitivity of the bridge (V) =  0.0159099025767


## Example 6.27 Page No : 333¶

In :
# Calculations and Results
Reso = 10.*10**-3/10;
print "resolution of the instrument = ", Reso
n = 10.;
Q = 10/2**n;
Eq = Q/(2*3**0.5);
print "quantization error = ", Eq
D = (2**n)-1;
print "decesion levels = ", D

resolution of the instrument =  0.001
quantization error =  0.00281909311128
decesion levels =  1023.0


## Example 6.28 Page No : 335¶

In :
# Variables
Ra = 10.;
b = 5.;

# Calculations and Results
Wmsb = Ra/2;
print "weight of MSB (V) = ", Wmsb
Wlsb = Ra/2**b;
print "weight of LSB (V) = ", Wlsb

weight of MSB (V) =  5.0
weight of LSB (V) =  0.3125


## Example 6.29 Page No : 337¶

In :
# Variables
E = 10.;

# Calculations and Results
ER = E*256/255;
print "Reference voltage (V) = ", ER
n = 8.;
CVlsb = (2**-n)*ER;
PC = CVlsb*100/E;
print "Percentage change  = ", PC

Reference voltage (V) =  10.0392156863
Percentage change  =  0.392156862745


## Example 6.30 Page No : 339¶

In :
import math

# Calculations and Results
n = 14.;
print "number of bits  = ", n
E = 10.;
Q = 10.;
LSB = E/2**n;
print "Value of LSB (V)  = ", LSB
Eq = Q/(2*(3**0.5));
print "Quantization error (V)  = ", Eq
fh = 1000.;
fs = 5*fh;
print "minimum sampling rate (Hz)  = ", fs
a = 1./16384;
ta = 1./(2*math.pi*fh)*a;
print "Aperature time (s)  = ", ta
Dr = 6*n;
print "dynamic range (db)  = ", Dr

number of bits  =  14.0
Value of LSB (V)  =  0.0006103515625
Quantization error (V)  =  2.88675134595
minimum sampling rate (Hz)  =  5000.0
Aperature time (s)  =  9.71404681957e-09
dynamic range (db)  =  84.0


## Example 6.31 Page No : 341¶

In :
# Variables
ER = 10.;
n = 6.;

# Calculations and Results
Imax = 10*10**-3;
R = ER*((2**n)-1)/((2**(n-2))*Imax);
print "resistance (ohm) = ", R
LSB = ER/((2**(n-1))*R);
print "smallest output current (A)", LSB

resistance (ohm) =  3937.5
smallest output current (A) 7.93650793651e-05


## Example 6.32 Page No : 343¶

In :
# Variables
n = 6.;
R = 10000.;
Io =  (10./10*10**3)*(1*1+1*0.5+1*0.25+0*0.125+1*0.0625)*10**-6;
Rf = 5000;

# Calculations
Eo = -Io*Rf;

# Results
print "Output voltage (V) = ", Eo

Output voltage (V) =  -9.0625


## Example 6.33 Page No : 345¶

In :
# Calculations and Results
print "Set d3 = 1"
Output = 5./2**1;
print "since 3.217>2.5  so d3 = 1"
print "Set d2 = 1"
Output = (5./2**1)+(5./2**2);
print "since 3.217< 3.75  so d2 = 0"
print "Set d1 = 1",
Output = (5./2**1)+(5./2**3);
print "since 3.217>3.125  so d1 = 1",
print "Set d0 = 1",
Output = (5./2**1)+(5./2**3)+(5./2**4);
print "since 3.217<3.4375  so d0 = 0",
print "Output of successive approximation A/D  =  1010",

Set d3 = 1
since 3.217>2.5  so d3 = 1
Set d2 = 1
since 3.217< 3.75  so d2 = 0
Set d1 = 1 since 3.217>3.125  so d1 = 1 Set d0 = 1 since 3.217<3.4375  so d0 = 0 Output of successive approximation A/D  =  1010


## Example 6.34 Page No : 347¶

In :
# Variables
t = 400.;
T = t/4;
C = 1.*10**-6;
v = 20;
i = C*100*v/(T);
R = 1*10**3;

# Calculations
e_o = i*R;

# Results
print "output voltage(V)", e_o

output voltage(V) 0.02