Commit f96e025e authored by beuren's avatar beuren
Browse files

Testando FFT-py

parent a89622c1
from scipy.fftpack import fft, fftfreq, fftshift
import matplotlib.pyplot as plt
import numpy as np
import sys
fisiologfile = open(sys.argv[1],'r')
freq = float(fisiologfile.readline().replace('\n', '').split('\t')[1])
# N"u"mero de sinais coletados
N = len(y)
# Espa"c"amento padr"a"o
T = 1.0 / freq
# Eixo X
x = np.linspace(0.0, N*T, N)
# Para teste
y = np.sin((2.0*np.pi*x))
# Transformadas
yf = fft(y)
xf = fftfreq(N, T)
xplot = fftshift(xf)
yplot = fftshift(yf)
# Plot
plt.plot(x, y)
plt.plot(xplot, (1.0/N) * np.abs(yplot))
#plt.plot(xf, 1.0/N * np.abs(yf))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment