现在我有了呼吸男人的音频情节 (plot)
然后我将其通过FFT(傅立叶快速变换) (plot)
现在,我必须找到每分钟呼吸的次数
import matplotlib.pyplot as plt
import wavio
import numpy as np
from scipy.fftpack import fft, fftfreq
from IPython.display import display, HTML
import math
%matplotlib inline
rate, sampwidth, array = wavio.readwav('breath.wav')
data = array[:,0]
samples = data.shape[0]
plt.plot(data)
# here i have plot of audio
fft_out = fft(array)
fft_out = fft_out[:,0]
fftabs = np.abs(fft_out)
freqs = fftfreq(samples, 1 / rate)
plt.plot(freqs, fftabs)
# here i have fft plot