Skip to content

Instantly share code, notes, and snippets.

@ludndev
Created May 22, 2024 15:17
Show Gist options
  • Save ludndev/828538466b2738d4123cad6ab218d0ec to your computer and use it in GitHub Desktop.
Save ludndev/828538466b2738d4123cad6ab218d0ec to your computer and use it in GitHub Desktop.
def spectre(F, Deltat):
Ne = len(Deltat)
coeffComplex = np.fft.fft(Deltat)
coeffReel = np.absolute(coeffComplex)
freq = []
for i in range(Ne):
if Deltat[i] == 0:
freq.append(0)
else:
freq.append(i / Deltat[i])
plt.plot(freq, coeffReel, "b")
plt.xlabel("frequence (Hz)")
plt.ylabel("spectre du signal")
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment