#%%
import sys
print(sys.version_info)

from scipy.fftpack import fft
import numpy as np
# Number of sample points
N = 600
# sample spacing
T = 1.0 / 800.0
x = np.linspace(0.0, (N-1)*T, N)

# y = np.sin(50.0 * 2.0*np.pi*x) + 0.5*np.sin(80.0 * 2.0*np.pi*x)
# y = np.zeros(N)
# y[0:10] = 1
y = x

M = 10

yf = fft(y[0:M])
xf = np.linspace(0.0, 1.0/T, M)


import matplotlib.pyplot as plt

plt.subplot(2, 1, 1)
plt.plot(x[0:M], y[0:M])
plt.grid()

plt.subplot(2, 1, 2)
plt.plot(xf[0:M], 2.0/N * np.real(yf[0:M]), marker='o', ls='')
plt.grid()

plt.show()


print(y[0:M])
print(yf[0:M])


#%%
