Ich bin Anfänger in der Signalverarbeitung, in dieser Frage möchte ich fragen, wie Energie für jedes Frequenzband um interessierte Frequenz F zu erhalten. Ich habe eine Formel gefunden, aber ich weiß nicht, wie man es in Python implementiert. Das ist die Formel, und meine Fourier-Transformations-Plot: Berechnen Energie für jedes Frequenzband um Frequenz F von Interesse in Python
x = np.linspace(0,5,100)
y = np.sin(2*np.pi*x)
## fourier transform
f = np.fft.fft(y)
## sample frequencies
freq = np.fft.fftfreq(len(y), d=x[1]-x[0])
plt.plot(freq, abs(f)**2) ## will show a peak at a frequency of 1 as it should.
Sie sind so nah, was ist falsch mit 'sum (abs (f [Fd: F + d]) ** 2)'? – Mike