Python program for generating Non-Return to Zero (NRZ) Unipolar line code | Python
In this we are going to see generation of Non-return to zero (NRZ) Unipolar Line Code using python.

from matplotlib import pyplot as mt


def plot(n, d, x, b):
    mt.subplot(1, 1, n)
    mt.step(d, x, where='post')
    mt.grid(True, which='both')
    mt.xlim(0, len(y)+1)
    mt.ylim(-b-0.1, volt+1)


y = input('Enter Binary Code: ')
volt = int(input('Enter the Voltage Level: '))
print('Binary of ', 'is', y)
y = y + '0'
y = int(y)
y1 = volt * y
y = list(map(int, str(y1)))
y1 = y.copy()
t = list(range(0, len(y1)))
t1 = t.copy()

fig, ax = mt.subplots(1, 1)
fig.tight_layout()
fig = mt.gcf()
ax.remove()

plot(1, t, y1, 0)
mt.title('NRZ Unipolar')

mt.show()


#ENJOY CODING


Post a Comment

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Previous Post Next Post