#Given frequency range fc = 1MHz to fc = 1.0005Mhz
#Single side message bandwidth is fM
fM = (1.0005 - 1)*10**6;
print 'Message bandwidth is ',fM,' Hz'
#The textbook contains a calculation error here. The calculated fM in the textbook is 500kHz instead of 5kHz, following which all the solutions are erroneous
#Given input signal strength Si = 1mW
#Let output signal strength be So
#So = Si/4
Si = 10.**(-3);
So = Si/4;
print 'Signal output strength is ',So,' dB'
#Given Power Spectral Density n = 10**-9 W/Hz
#Let output noise strength be No
n = 10.**-9;
No = (n*fM)/4;
print 'Output Noise Strength is ',No,' dB'
#Let SNR at filter output be SNR
SNR = So / No;
print 'Output SNR is ',SNR,' dB'
#By reduction of message signal Bandwidth the Output Noise strength changes
#Let the new output noise strength, bandwidth and SNR be be No_new, fM_new and SNR_new respectively
fM_new = 75./100*fM;
No_new = n*fM_new/4;
SNR_new = So / No_new;
print 'Changed SNR is %.4f'%SNR_new,' dB'
#Given frequency range fc - fm = 0.995MHz to fc + fm = 1.005Mhz
#Double side message bandwidth is fM
fM = (1.005 - 0.995)*10**6 / 2;
print 'Message bandwidth is ',fM,' Hz'
#The textbook contains a calculation error here.
#The calculated fM in the textbook is 500kHz instead of 5kHz,
#Following which all the solutions obtained here are erroneous.
#Given input signal strength Si = 1mW
#Let output signal strength be So
#So = Si/2
Si = 10.**(-3);
So = Si/2;
print 'Signal output strength is ',So,' dB'
#Given Power Spectral Density n = 10**-9 W/Hz
#Let output noise strength be No
n = 10.**-9;
No = (n*fM)/2;
print 'Output Noise Strength is ',No,' dB'
#Let SNR at filter output be SNR
SNR = So / No;
print 'Output SNR of the DSB-SC wave is ',SNR,' dB'
#By reduction of message signal Bandwidth the Output Noise strength changes
#Let the new output noise strength, bandwidth and SNR be be No_new, fM_new and SNR_new respectively
fM_new = 75./100*fM;
No_new = n*fM_new/4;
SNR_new = So / No_new;
print 'Changed SNR is %.4f'%SNR_new,' dB'
#Given bandwidth of signal is fM = 4kHZ
fM = 4.*10**3;
#Given power spectral density of white noise n = 2*10**-9 W/Hz
n = 2.*10**-9;
#Also given that minimum output SNR is 40dB
#Signal undergoes a loss of 30dB
#For SSB:
# Required minimum output SNR = Si_min_SSB / (n*fM) = 40 dB = 10**4
Si_min_SSB = (10.**4)*n*fM;
# Required minimum signal strength at transmitter output Si_tran = Si_min * 30 dB
Si_tran_SSB = Si_min_SSB * 10**3;
print 'Required minimum SSB signal strength at transmitter output is',Si_tran_SSB,' W'
#For DSB-SC:
# Required minimum output SNR = (Si_min_DSB/3) / (n*fM) = 40 dB = 10**4
Si_min_DSB = 3*(10**4)*n*fM;
# Required minimum signal strength at transmitter output Si_tran = Si_min * 30 dB
Si_tran_DSB = Si_min_DSB * 10**3;
print 'Required minimum DSB signal strength at transmitter output is',Si_tran_DSB,' W'
#Given bandwidth of signal is fM = 60 kHZ
fM = 60.*10**3;
#Given power spectral density of white noise n = 2*10**-6 W/Hz
n = 2.*10**-6;
#Given time average of square of mssg signal P = 0.1W
P = 0.1;
#Noise power at input baseband range NM
NM = n * fM;
#Threshold occurs at carrier power Pc = 2.9 * NM
Pc_Threshold = 2.9 * NM;
#For carrier power Pc = 10W, output SNR
Pc = 10.;
SNRo = Pc * P / NM ;
print 'Output SNR is %.4f'%SNRo,' dB'
#Carrier power is reduced by 100 times making the new power Pc_new
Pc_new = Pc / 100;
#In the given solutions the NM value is 1.2W instead of 0.12W
#The corect answer is 0.0925926 instead of 0.000926
SNR_new = (4./3) * P * (Pc_new/NM)**2;
print 'Output SNR when carrier power is reduced is %.4f'%SNR_new,' dB'