Skip to main content

The package for preprocessing wave data

Project description

ProWav

You can use this for preprocessing wave files.

Usage

Please install prowav by using pip.

pip install prowav  

Usage

ProWav can calculate mfcc spectrogram and pad for batch execution

from prowav import ProWav  

prowav = ProWav(["path/to/wave/data_1.wav", "path/to/wave/data_2.wav"])  

frame_width = 20 # the length of a frame (ms)
stride_width = 20 # the frame interval (ms)
n_mfcc = 26 # the number of features by mfcc features (If you want to use mfcc preprocessing, you should specify this value)  
mode = 'MFCC'
window_func = 'hamming' # the name for window function
data = prowav.prepro(frame_width=frame_width,stride_width=stride_width,mode=mode,
                                       n_mfcc=n_mfcc, window_func=window_func)
# >> (num_files, num_frames, n_mfcc)    

If you want use fft spectrogram, please specify the mode, "fft".

prowav = ProWav(["path/to/wave/data_1.wav", "path/to/wave/data_2.wav"])
frame_width = 20
stride_width = 20
mode='fft'
window_func='hamming'  
data = prowav.prepro(frame_width=20,stride_width=20,\
      mode=mode, window_func=window_func)  
# >> (num_files, num_frames, num_features)

You can also use mel-spectrogram. Specify the mode, "mel_spec"

prowav = ProWav(["path/to/wave/data_1.wav", "path/to/wave/data_2.wav"])
frame_width = 50 
stride_width = 50 
mode='MFCC'
n_mfcc = 26
window_func='hamming'
data = prowav.prepro(frame_widh=frame_width, stride_width=stride_width,
                  mode=mode, window_func=window_func, n_mfcc=n_mfcc)

You can use zero-padding or repeat-padding.

prowav = ProWav(["path/to/wave/data_1.wav", "path/to/wave/data_2.wav"])
frame_width = 50 
stride_width = 50 
mode='mel_spec'
n_mels = 50
window_func='hamming'
data_zero = prowav.prepro(frame_widh=frame_width, stride_width=stride_width,
                  mode=mode, n_mels=n_mels,window_func=window_func, zero_padding=True) # zero padding 
data_repeat = prowav.prepro(frame_widh=frame_width, stride_width=stride_width,
                  mode=mode, ne_mels=n_mels, window_func=window_func, repeat_padding=True) # repeat padding 

Just loading wave data is possible.

prowav = ProWav(["path/to/wave/data_1.wav", "path/to/wave/data_2.wav"]) 

prowav.load_wav() # loading wav file into this class.

prowav.data # the list of ndarray. Raw data are listed.

You can choose parallel option.

prowav.load_wav(parallel=True)

prowav.load_wav(parallel=True, verbose=5)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prowav-0.6.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

prowav-0.6-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file prowav-0.6.tar.gz.

File metadata

  • Download URL: prowav-0.6.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.6.9

File hashes

Hashes for prowav-0.6.tar.gz
Algorithm Hash digest
SHA256 d21788718164fa7a8da365469b053a17eb22fcbea271717ae950e9a9f20a71cf
MD5 4cb3b1ee71147d494cf5a14bef44791b
BLAKE2b-256 411fc5d1bb115952140a10dcea1f00a0a7247a640e600b5c00dc91e64da8f6a4

See more details on using hashes here.

File details

Details for the file prowav-0.6-py3-none-any.whl.

File metadata

  • Download URL: prowav-0.6-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.6.9

File hashes

Hashes for prowav-0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 cc7f57cd4519837a834363b60fea0bd4e6c0bc7315bc4d072d80a280986fab38
MD5 359643fac0ddcf75a30239dd51c24611
BLAKE2b-256 220efecda8962a39b1a26360866b169d836e540febaf2b4cb0cbe5a0920b5a4f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page