Techmo Sp. z o.o. module for audio features extraction
How to use
:warning: Add ! character if you install the module in a jupyter notebook
pip install techmo-wavelet
#import functions for feature extraction
from techmo.feature_extraction import calculate_wavelet_fft, calculate_fft_wavelet
# install numpy first in case is not installed in your environment
import numpy as np
# signal must be 1d array read from wav file, e.x by using Soundfile. Here we generate random signal
signal = np.random.uniform(-1.0, 1.0, 16000)
# Here's an example of how to use `calculate_wavelet_fft` function
features = calculate_wavelet_fft(signal)
# Here's an example of how to use `calculate_fft_wavelet` function
features = calculate_fft_wavelet(signal)
The code implements 2 functions to extract features:
The calculate_wavelet_fft function implements an algorithm consisting of the following stages:
- If the number of samples N is greater than or equal to 4800, the signal is divided into int(N/2400) segments to compute finally 60 features for each segment containing int(N/int(N/2400)) samples, i.e. the feature vector will have 60*int(N/2400) elements,
- Segments are processed by the Hann window,
- Segments are normalized separately,
- Each segment is processed by the Wavelet Transform (WT),
- Each WT subband is subjected to the Fast Fourier Transform (FFT),
- FFT spectra are inputs of the triangular filtration to obtain the feature sub-vectors of length 60 for each segment,
- The logarithms of filter outputs are computed to obtain the feature sub-vectors of length 60 for each segment.
- Sub-vectors are concatenated to obtain a final feature matrix as numpy ndarray of shape int(N/2400), 60.
The calculate_fft_wavelet function implements an algorithm consisting of the following stages:
- If the number of samples N is greater than or equal to 9600, the signal is divided into int(N/4800) segments to compute finally 60 features for each segment containing int(N/int(N/4800)) samples, i.e. the feature vector will have 60*int(N/4800) elements,
- Segments are processed by the Hann window,
- Segments are normalized separately,
- Speech segments are processed by the the Fast Fourier Transform,
- The complex spectra are subjected to Wavelet Transform (WT),
- Absolute values of WT are calculated,
- The computed modules are inputs of the triangular filtration,
- The logarithms of filter outputs are computed to obtain the feature sub-vectors of length 60 for each segment.
- Sub-vectors are concatenated to obtain a final feature matrix as numpy ndarray of shape int(N/4800), 60.
Release files for techmo-wavelet 0.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| techmo-wavelet-0.3.2.tar.gz | 5.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| techmo_wavelet-0.3.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.1 kB
Release files / techmo-wavelet-0.3.2.tar.gz
| Download URL | techmo-wavelet-0.3.2.tar.gz |
|---|---|
| Size | 5.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
21932c65ef53c22d66824965e32e2c86521a92faec50351435fcad6be5d2039f
|
|
BLAKE2b-256 checksum How to use checksums |
f026f0bbd666a02d93e22620a5275b8933bb9180676b83b4f1831a24de5ddf53
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5
|
Release files / techmo_wavelet-0.3.2-py3-none-any.whl
| Download URL | techmo_wavelet-0.3.2-py3-none-any.whl |
|---|---|
| Size | 5.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3814aaab3cba758417625e57f63f4738b2378d1c161f8ebe6c011f10b20c78d8
|
|
BLAKE2b-256 checksum How to use checksums |
a84cf62342870b02baf09739854f5f0f23f28924517cccccbe333bc5136eb399
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5
|