项目作者: kylerbrown

项目描述 :
A spectral analysis and feature extraction library similar to Sound Analysis Pro
高级语言: Python
项目地址: git://github.com/kylerbrown/resin.git
创建时间: 2017-03-27T19:33:40Z
项目社区:https://github.com/kylerbrown/resin

开源协议:GNU General Public License v3.0

下载


Resin

Resin is a spectral analysis toolbox for Python inspired by SAP.

Requirements

  • Python 2.7+
  • Numpy

Optional Requirements

  • Scipy
  • Matplotlib

Installation

  1. git clone https://github.com/kylerbrown/resin
  2. cd resin
  3. pip install .

Usage example

The folder examples contains some example usage.

  1. # loading in the data
  2. sr, data = wavfile.read('black33.wav')
  3. # create a Spectra object using SAP-like defaults
  4. spa = resin.sap_spectra(sr)
  5. spa.signal(data)
  6. spa.spectrogram()

Example spectrogram 1

  1. # Alternately, customize the mutli-taper parameters
  2. # by creating a Spectra object directly.
  3. spa2 = resin.Spectra(sr,
  4. NFFT=1024,
  5. noverlap=1000,
  6. data_window=int(0.01 * sr),
  7. n_tapers=3,
  8. NW=1.8,
  9. freq_range=(300, 9000))
  10. spa2.signal(data)
  11. spa2.spectrogram()

Example spectrogram 2

Tips for speed

  • Install scipy, which allows resin to use a faster fft library than the numpy default. In my experience, scipy’s fft is about 40% faster than numpy’s, even when using the Anaconda MKL FFT.
  • Use an NFFT equal to a power of 2 (512, 1024, etc.)

Authors

Mike Lusignan wrote segmentation as part of his PhD thesis. Details of the algorithms can be found in:
Lusignan, M. E. University of Chicago. (2012). Growing up singing: Behavioral and physiological perspectives on song acquisition.

Resin is a fork of segmentation, writen by Kyler Brown, 2017.