#Percentage of output which is fed back
import math
#variable declaration
A=50.0 #gain(unitless)
Af=10.0 #gain(unitless)
#calculation
#Formula : Af=A/(1+A*Beta)
Beta=(A/Af-1)/A #feedback ratio (unitless)
#Result
print("Percentage of output feed back : %.0f%%"%(Beta*100))
#Voltage gain and reduction in voltage
import math
#variable declaration
A=1000.0 #gainWithoutFeedback(unitless)
Adash=800 #gainWithoutFeedback(unitless)
g_reduce=0.40 #factor by which gain reduced
#Calculations
#Part (i) :
Af=A-A*g_reduce #gainWithFeedback(unitless)
#Formula : Af=A/(1+A*Beta)
Beta=(A/Af-1)/A #feedback factor (unitless)
Af_dash=Adash/(1+Adash*Beta)
#Part (ii)
Reduction=((A-Adash)/A)*100 #% reduction without feedback
Reduction1=((Af-Af_dash)/Af)*100 #% reduction without feedback
#Result
print("At normal collector supply :")
print("with feedback gain reduces by a factor %.2f"%g_reduce)
print("At normal collector supply, Gain with feedback :%.0f "%Af)
print("\nAt reduced power supply :")
print("At Reduced collector supply, Gain with feedback : %.0f"%(math.ceil(Af_dash)))
print("%% reduction in gain without feedback :%.0f%%"%Reduction)
print("%% reduction in gain with feedback :%.0f%%"%Reduction1)
#Note : answer of Af is wrong in the book.
#Gain with feedback factor and feedback voltage
import math
#Variable declaration
A=100.0 #gain without feedback(unitless)
Beta=1.0/25.0 #feedback ratio (unitless)
Vi=50.0 #in mV
#Calculations
#Part (i) :
Af=A/(1+A*Beta) #gain with feedback(unitless)
#Part (ii) :
FeedbackFactor=Beta*A #unitless
#Part (iii) :
Vo_dash=Af*Vi*10**-3 #in volt
#Part (iv) :
FeedbackVoltage=Beta*Vo_dash #in volt
#Part (v) :
Vi_dash=Vi*(1+Beta*A) #in mv
#Result
print("(i)\n Gain with feedback :%.0f"%Af)
print("(ii)\n Feedback Factor :%.0f"%FeedbackFactor)
print("(iii)\n Output Voltage in volts :%.0f"%Vo_dash)
print("(iv)\n Feedback Voltage in volts :%.2f"%FeedbackVoltage)
print("(v)\n New Increased Input Voltage in milli volts :%.0f"%Vi_dash)
#Bandwidth with negative feedback
import math
#variable declaration
BW=200.0 #in kHz
A=40.0 #gain without feedback(in dB)
Beta=5.0 #negative feedback in %
Beta=Beta/100.0 #feedback factor
#calculation
#Formula : Af=A/(1+A*Beta)
Af=A/(1+A*Beta) #gain with feedback(in dB)
BW_dash=A*BW/Af #in kHz
#Result
print("Since gain bandwidth product remains constant, A*BW=Af*BW_dash")
print("New Bandwidth in kHz : %.0f"%BW_dash)
#Fraction of output fed back
import math
#variable declaration
A=140.0 #gain without feedback(unitless)
Af=17.5 #gain with feedback(unitless)
#Calculations
#Formula : Af=A/(1+A*Beta)
Beta=(A/Af-1)/A #feedback ratio (unitless)
#Result
print("Fraction of output fed back to input : %.2f or 1/20"%Beta)
#Small Change in gain
import math
#variable declaration
A=200.0 #gain without feedback(unitless)
Beta=0.25 #fraction ratio(unitless)
#CAlculations
#Given : Normal gain changes by 10 %, it means dA/A=10/100
dABYA=10.0/100.0 #change in gain
dAfBYAf=(1/(1+Beta*A))*(dABYA) #change in gain
#Result
print("We have, Af=A/(1+Beta*A).................eqn(1)")
print("\nDifferentiating it with respect to A, we get")
print("\ndAf/dA=((1+Beta*A)-Beta*A)/(1+Beta*A)^2=1/(1+Beta*A)^2")
print("\ndAf=dA/(1+Beta*A)^2.......................eqn(2)")
print("\nDividing eqn(2) by eqn(1),")
print("\ndAf/Af=(dA/((1+Beta*A)^2))*((1+Beta*A)/A)=(1/(1+Beta*A))*(dA/A)")
print("\n\nChange in gain : %.4f"%((math.floor(dAfBYAf*10**4))/10**4))
#New gain distortion and input voltage
import math
#Variable declaration
A=200.0 #gain without feedback(unitless)
Dn=10.0 #Distortion in %
Vi=0.5 #Initial input voltage in volt
Beta=0.05 #feedback ratio (unitless)
#Calculations
#Formula : Af=A/(1+A*Beta)
Af=A/(1+A*Beta) #gain with feedback(unitless)
Dn_dash=Dn/(1+A*Beta) #new distortion in %
InitialOutputVoltage=A*Vi #in Volt
NewInputVoltage=InitialOutputVoltage/Af
print("New gain :%.3f"%Af)
print("Distortion with negative feedback : %.3f%%"%Dn_dash)
print("Initial Output Voltage in volt:%.0f"%InitialOutputVoltage)
print("New Input Voltage in volts :%.2f"%NewInputVoltage)
#Note :Ans of Af and NewInputVoltage is not acurate in the book.
#Feedback rction voltage and impedence
import math
#variable declaration
A=10000.0 #gain without feedback(unitless)
Zi=10.0 #in kOhm
Zo=100.0 #in Ohm
R1=2.0 #in Ohm
R2=18.0 #in Ohm
#calculations
#Part (i) :
Beta=R1/(R1+R2) #feedback fraction(unitless)
#Part (ii) :
Af=A/(1+A*Beta) #Gain with negative feedback(unitless)
#Part (iii) :
inputVoltge=0.5 #in mV
outputVoltge=Af*inputVoltge #in mV
#Part (iv) :
Zif=Zi*(1+Beta*A) #in kOhm
#Part (v) :
Zof=Zo/(1+Beta*A) #in kOhm
print("(i)\nFeedback Fraction :%.1f"%Beta)
print("\n(ii)\nGain with negative feedback :%.0f"%(math.ceil(Af)))
print("\n(iii)\nOutput Voltage in milli volts :%.0f"%(math.ceil(outputVoltge)))
print("\n(iv)\nInput impedance of feedback amplifier in Mohm : %.2f"%(Zif*10**-3))
print("\n(v)\nOutput impedance with feedback in Ohm : %.1f"%Zof)
#Voltage gain input and output resistance
import math
#variable declaration
A=200 #gain without feedback(unitless)
Ri=2 #in kOhm
Ro=12 #in kOhm
Beta=0.02 #feedbak ratio(unitless)
#Calculation
#Part (i) :
Af=A/(1+A*Beta) #gain with feedback(unitless)
#Part (ii) :
Rif=Ri*(1+A*Beta) #in kOhm
#Part (ii) :
Rof=Ro/(1+A*Beta) #in kOhm
#Result
print("(i)\nGain with Negative Feedback :%.0f"%Af)
print("\n(ii)\nInput resistance with feedback in kOhm :%.0f"%Rif)
print("\n(iii)\nOutput resistance with feedback in kOhm :%.1f"%Rof)
# Gain wih feedbck in dB
import math
#variable declaration
A=1000.0 #gain(unitless)
Beta=1.0/20.0 #feedback ratio (unitless)
#Calculation
#Formula : Af=A/(1+A*Beta)
Af=A/(1+A*Beta) #gain with feedback(unitless)
Af=20*math.log10(Af) #in dB
#Result
print("Gain with feedback in dB : %.1f"%Af)
#Bandwidth after feedback
import math
#Variable declarations
A=800.0 #gain(unitless)
f1=40.0 #in Hz
f2=16.0 #in kHz
Beta=2.0/100.0 #feedback fator (unitless)
#caalculations
#Formula : Af=A/(1+A*Beta)
Af=A/(1+A*Beta) #gain with feedback(unitless)
BW=f2*10**3-f1 #Bandwidth of amplifier in Hz
f1_f=f1/(1+A*Beta) #in Hz
f2_f=f2*(1+A*Beta) #in kHz
BW_f=f2_f*10**3-f1_f #Bandwith after feedback in Hz
#result
print("Voltage gin with feedback : %.0f"%Af)
print("Bandwidth of amplifier in kHz : %.2f"%(BW*10**-3))
print("Bandwith after feedback in KHz : %.0f"%(BW_f*10**-3))
#Gain and new bandwidth
import math
#Variable declaration
A=100.0 #gain(unitless)
BW=10.0 #in Hz
Beta=5.0 #in %
#Calculations
#Part (i) :
#Formula : Af=A/(1+A*Beta)
Af=A/(1+A*Beta/100.0) #gain with feedback(unitless)
#Part (ii)
BW_f=BW*(1+A*Beta/100.0) #Bandwith after feedback in Hz
#Result
print("Voltage gain with feedback :%.2f "%Af)
print("Bandwith with negative feedback in KHz : %.0f"%BW_f)
#Input resistance and voltage gain
import math
#variable decclaration
hfe=50.0 #unitless
hie=1.1 #in kOhm
hoe=0.0 #unitless
hre=0.0 #unitless
RL=4.0 #in kOhm
Rs=10.0 #in kOhm
RB=40.0 #in kOhm
#calculation
RLdash=RB*RL/(RB+RL) #in Kohm
AV=-hfe*RLdash/hie #unitless
#Part (i) ;
Rif=hie*(RB/(1-AV))/(hie+(RB/(1-AV))) #in kOhm
print("Input resistance with feedback in Ohm : %.0f"%(Rif*1000))
#Part (ii) :
AVf=AV*(Rif/(Rs+Rif)) #unitless
print("Voltage gain with feedback : %.2f"%((math.ceil(AVf*100))/100))