Commit 31caf405 authored by Robozman's avatar Robozman

Init repo and added fft

parents
import time
import matplotlib.pyplot as plt
import numpy as np
import scipy.io.wavfile as wavfile
import sounddevice
import time
def plot(data):
plt.plot(data, color='steelblue')
plt.ion()
plt.figure()
plt.show()
rate, wav_data = wavfile.read("violin.wav", mmap=True)
sounddevice.play(wav_data, rate)
t = time.time()
for i in range(0, 54):
second = wav_data[i * rate:(i + 1) * rate]
while (time.time() - t < 1):
pass
t = time.time()
plot(np.abs(np.fft.fftshift(np.fft.fft(second[:,0]))))
plt.close()
File added
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