Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- import matplotlib.pyplot as plt
- # Plotting constants
- LB = -17
- UB = -5
- DIVISIONS = abs(UB - LB) * 2
- BER_LIMIT = 1E-9
- def load(fname, column):
- """Extracts a column from a CSV file as a NumPy array"""
- arr = np.genfromtxt(fname, dtype='float32',
- skip_header=1, usecols=column, delimiter=",")
- return arr
- def ber_histogram(data):
- """Plots a histogram of from NumPy array"""
- fig = plt.figure(figsize=(6.5, 4.5))
- ax = plt.subplot(111)
- bins = [10 ** x for x in np.linspace(LB, UB, num=DIVISIONS)]
- ax.hist(data, bins=bins)
- plt.xscale('log')
- plt.show()
- plt.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement