# template for Lab #2, Task #5 import random import matplotlib.pyplot as p import lab2 # turn on interactive mode, useful if we're using ipython p.ion() def plot_eye_diagram(channel,samples_per_bit=8,plot_samples=16): """ Plot eye diagram for given channel using a 200-bit random message. samples_per_bit determines how many samples are sent for each message bit. plot_samples determines how many samples should be included in each plot overlay. plot_samples should be an integer multiple of samples_per_bit. """ pass # your function here if __name__ == '__main__': # plot the eye diagram for both our channels # Experiment with different values of samples_per_bit for both # channels until you feel that the eye is open enough to permit # successful reception of the transmitted bits. The result # will be different for the two channels. plot_eye_diagram(lab2.channel1,samples_per_bit=40) plot_eye_diagram(lab2.channel2,samples_per_bit=40) # interact with plots before exiting. p.show() returns # after all plot windows have been closed by the user. # Not needed if using ipython p.show()