import numpy
from matplotlib import pyplot
import pandas as pd


send_data = numpy.fromfile(open("send_data"), dtype=numpy.uint8)
constel_mod = numpy.fromfile(open("constel_mod"), dtype=numpy.complex64)
decoded = numpy.fromfile(open("decoded"),dtype=numpy.uint8)

send_data_txt = open('send_data_d.txt', 'w')
constel_mod_txt = open('constel_mod_d.txt', 'w')
decoded_txt = open('decoded_d.txt', 'w')

for line in send_data:
	send_data_txt.write(str(line) + '\n')
send_data_txt.close()

for line in constel_mod:
	constel_mod_txt.write(str(line)+ '\n')
constel_mod_txt.close()

for line in decoded:
	decoded_txt.write(str(line)+ '\n')
decoded_txt.close()

data = pd.read_csv('send_data_d.txt',sep='\s+',header=None)
data = pd.DataFrame(data)
data1 = pd.read_csv('decoded_d.txt',sep='\s+',header=None)
data1 = pd.DataFrame(data1)

x = data[0]
x = x[3:95]
y = data1[0]
print(x)
print(len(y))

pyplot.plot(x)
pyplot.plot(y)

pyplot.show()
