from __future__ import division
Bit_rate = 2*10**9 # bit rate of channel
# Given sequence is 010111101110
Shortest_duration = 1*(1/Bit_rate) # shortest duration is '1'
Widest_duration = 4*(1/Bit_rate) #widest duration is '1111'
Shortest_duration = Shortest_duration # seconds
Widest_duration = Widest_duration # seconds
print "Shortest duration is %.1g seconds." %Shortest_duration
print "Widest duration is %.1g seconds." %Widest_duration
from __future__ import division
from numpy import log2
Bandwidth = 2*10**6 #Bandwidth of channel
Signal_to_Noise_ratio = 1 #Signal to Noise ratio of channel
Capacity = Bandwidth * log2(1 + Signal_to_Noise_ratio) #computing capacity
Capacity=Capacity/10**6
print "Maximum capacity of channel is %d Mb/sec." %Capacity
from __future__ import division
Bit_rate = 2*10**9 # bit rate of channel
# Given sequence is 010111101110
Shortest_duration = 1*(1/Bit_rate) # shortest duration is '1'
Widest_duration = 4*(1/Bit_rate) #widest duration is '1111'
Shortest_duration = Shortest_duration # seconds
Widest_duration = Widest_duration # seconds
print "Shortest duration is %.1g seconds." %Shortest_duration
print "Widest duration is %.1g seconds." %Widest_duration