Python port of Lyon's model from AuditoryToolbox
Project description
Lyon's auditory model for Python
Python port of Lyon's model calculation from Auditory Toolbox. Original version of Auditory Toolbox is written in C and MATLAB by Malcolm Slaney.
Package contents
- Modified
soscascade.c
,agc.c
andsosfilters.c
(removed MEX-related part). ctypes
wrapper forsoscascade()
,agc()
andsosfilters()
calls.- Translation from MATLAB to Python for files necessary for successfull call to
LyonPassiveEar()
.
Dependecies
If you plan to build manually and run tests, you'll need libcheck
installed.
On Ubuntu 18.10 run:
sudo apt-get install check
Installation
Manual
Build a library:
make lib
This would result in liblyon.so
shared library. Verify that library is properly built by running a test suite:
make test
Usage
The following code computes cochleogram for a sample sound:
from lyon import LyonCalc
calc = LyonCalc()
waveform, sample_rate = load('audio/file/path.wav')
decimation_factor = 64
coch = calc.lyon_passive_ear(waveform, sample_rate, decimation_factor)
print(coch.shape)
The code above should output shape of resulting auditory nerve response: [<number of samples / decimation_factor>, 86]
.
See lyon_examples.py
for examples on running other functions.
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file lyon-1.0.0.tar.gz
.
File metadata
- Download URL: lyon-1.0.0.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb5cfcd9f1c55d816446101efccb0195c2c5afb97ffb3f2b88c8a4962d4f483f |
|
MD5 | 61b7af58f36d12a5082cd0123fe97ae5 |
|
BLAKE2b-256 | 3da491e2a3e1faf44c9abbcd56b55e9888e5db33d138edc763e1ac6f1b04523a |
File details
Details for the file lyon-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: lyon-1.0.0-py3-none-any.whl
- Upload date:
- Size: 12.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6333a2c53fb4c4053b7d95003f60fe1fa7667c9a34a823a7194682fc5bd504f4 |
|
MD5 | 0a7a9f4b9581a176976588d83c67dac6 |
|
BLAKE2b-256 | fb355874a84caaf5aa76a948040e3750aa01f85a7f292df415d0b8d1e3913adb |