Fast STOI implementation in Rust with Python bindings
Project description
Fast STOI
Python bindings for the fast stoi rust library.
It uses numpy float32 internally for faster simd computations,
and because this is the default type for pytorch data.
Calling its functions with float64 will trigger conversions which may
lose you some performance.
See the repository for more details.
Installation
pip install fast_stoi
Usage
Compute STOI from numpy data:
import numpy as np
from fast_stoi import stoi
x = np.random.randn(24_000).astype(np.float32)
y = np.random.randn(24_000).astype(np.float32)
score = stoi(x, y, fs_sig=8_000, extended=False)
[!NOTE] You can pass 2D arrays of batched waveforms to leverage rust multithreading
import numpy as np
from fast_stoi import stoi
x = np.random.randn(16, 24_000).astype(np.float32)
y = np.random.randn(16, 24_000).astype(np.float32)
score = stoi(x, y, fs_sig=8_000, extended=False)
Compute STOI with the torch wrapper:
import torch
from fast_stoi import STOI
stoi = STOI(fs_sig=8_000, extended=False)
x = torch.randn(24_000)
y = torch.randn(24_000)
score = stoi(x, y)
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fast_stoi-1.0.0.tar.gz.
File metadata
- Download URL: fast_stoi-1.0.0.tar.gz
- Upload date:
- Size: 101.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b17d895edc15562be232370428e8334db8f343778250d0eee521ee54109f7a22
|
|
| MD5 |
6d127c1df0792d0bd6ffafe86bb1dbed
|
|
| BLAKE2b-256 |
8190226f181576cb765a75f2fb9fbf23887e0e3d224da1b90c4925dfd64b4807
|
File details
Details for the file fast_stoi-1.0.0-cp313-cp313-manylinux_2_39_x86_64.whl.
File metadata
- Download URL: fast_stoi-1.0.0-cp313-cp313-manylinux_2_39_x86_64.whl
- Upload date:
- Size: 1.0 MB
- Tags: CPython 3.13, manylinux: glibc 2.39+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e2cf4e26ded30d76ea65e2195a60ffd260c1075df6e2840c67fc0d9b385a418
|
|
| MD5 |
4cb56f5c05a8f475516b8de9c7a831aa
|
|
| BLAKE2b-256 |
49cdf6d6ae171efc49a5a6debef5742bc9b19c1a557d73251281a5c43f9320a6
|