Untitled

mail@pastecode.io avatar
unknown
python
a year ago
482 B
3
Indexable

# Ex 1

# a)

x = np.genfromtxt('lab5/Train.csv', delimiter=',', skip_header=1, usecols=2)
print(x)
# x = x - np.mean(x)
X = np.fft.fft(x)

print(X)

N = len(x)
N_halved = int(N/2)
X = abs(X/N)

X = X[:N_halved]

Fs = 1 / 3600
f = Fs * np.linspace(0, N_halved, N_halved)/N

# b)
print("Intervalul de timp este de: ", int(N/24), " zile")

# c) 

fmax = 0.5 * Fs
print("Frecventa maxima: ", fmax)
t = np.arange(N_halved)

# d)

plt.plot(f, X)
plt.suptitle('Exercitiul d)')
plt.show()
Leave a Comment