balik zmen uff

This commit is contained in:
David Brazda
2023-11-03 20:49:24 +01:00
parent de5382d04a
commit 0db88b194c
53 changed files with 1693 additions and 514 deletions

22
testy/fourier.py Normal file
View File

@ -0,0 +1,22 @@
import numpy as np
import scipy.fft as fft
time_series = np.array(prices)
n = len(time_series)
# Compute the Fourier transform
yf = fft(time_series)
xf = np.linspace(0.0, 1.0/(2.0), n//2)
# Compute the Fourier transform
yf = np.abs(fft(time_series))
# Find the corresponding frequencies
frequencies = xf
# Find the corresponding amplitudes
amplitudes = 2.0/n * np.abs(yf[:n//2])
# Interpret the amplitudes and frequencies
for freq, ampl in zip(frequencies, amplitudes):
print(f"Frequency: {freq}, Amplitude: {ampl}")