# lab1_1.py -- template for your Task #1 design file import numpy import matplotlib.pyplot as p import channel reload(channel) import lab1 reload(lab1) p.ion() # interactive plot mode def plot_data(data): """ Create a new figure and plot data using blue, square markers. """ # Testing code. Do it this way so we can import this file # and use its functions without also running the test code. if __name__ == '__main__': # supply a bit sequence bits = [1,0,1,1,0,0,0,1,0,0,0,1,1,1,0] # Convert bits (0's or 1's) to voltage samples # (between 0.0 and 1.0 volts) samples_per_bit=20 samples = lab1.bits_to_samples(bits,samples_per_bit) # Create a noisy channel mychannel = channel.channel(channelid='0',noise=0.1) # Send the voltage samples over a noisy channel out = mychannel(samples) # Plot the received voltage samples plot_data(out) # enable the following line whey you're ready to submit # your code to the on-line server #lab1.checkoff(plot_data,'L1_1')