-1

I read a .wav file using the read function of the soundfile library in Python. I was wondering if there is any function to get the number of pulses of this signal, something like the pulsewidth function in Matlab.

If not, given that I did

[data,fs]=sf.read(wave)

I'm also trying something like this:

y=data2.count(data2>0.5)

but I'm getting this error:

AttributeError: 'numpy.ndarray' object has no attribute 'count'

1 Answers1

0

I think scipy.signal.find_peaks can be of use to you.

With a numpy array as input, you can get the indices of the peaks, their widths ... etc

Seb
  • 71
  • 3