https://github.com/mkaudio-company/fastcwt
Rust-lang Continuous Wavelet Transform(CWT) library inspired by fCWT.
https://github.com/mkaudio-company/fastcwt
audio-analysis audio-processing cwt rust rust-lang wavelet wavelet-transform
Last synced: 12 months ago
JSON representation
Rust-lang Continuous Wavelet Transform(CWT) library inspired by fCWT.
- Host: GitHub
- URL: https://github.com/mkaudio-company/fastcwt
- Owner: mkaudio-company
- License: apache-2.0
- Created: 2023-04-03T23:03:27.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-16T08:12:51.000Z (almost 2 years ago)
- Last Synced: 2025-04-04T16:44:31.204Z (12 months ago)
- Topics: audio-analysis, audio-processing, cwt, rust, rust-lang, wavelet, wavelet-transform
- Language: Rust
- Homepage:
- Size: 74 MB
- Stars: 16
- Watchers: 1
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-MIT
Awesome Lists containing this project
README
# fastcwt
[](https://crates.io/crates/fastcwt)
[](https://crates.io/crates/fastcwt)
[](https://docs.rs/fastcwt/)
Rust-lang Continuous Wavelet Transform(CWT) library inspired by fCWT.
This crate is a direct translation of fCWT Library written in C++ by Arts, L.P.A. and van den Broek, E.L. (https://github.com/fastlib/fCWT)
I changed certain functions that I cannot translate, it seems like it could be eliminated, or the difference between fftw Library and rustfft crate. (fCWT used fftw, and fastcwt used rustfft.)
# Usage
``` Rust
use fastcwt::*;
use rand::prelude::*;
let wavelet = Wavelet::create(1.0); //Create a Morlet wavelet.
let scale = Scales::create(ScaleTypes::LinFreq, 48000, 20.0, 20000.0, 1000); //Create a scale factor.
let mut transform = FastCWT::create(wavelet, true); // Create a fCWT instance.
let mut input = vec![];
for _ in 0 .. 48000
{
input.push(thread_rng().gen_range(-1.0 .. 1.0))
};
let result = transform.cwt(1000, input.as_slice(), scale); //Store the result.
```
# Changelog
0.1.9 - Used no_denormals to avoid extra latency. Cleaned up the repository.
0.1.8 - Droped mkaudiolibrary which is not used.
0.1.7 - Used boxed slice instead of vec in Scales struct.
0.1.6 - Transfered owndership to company account.
0.1.5 - Parallelized FFT using rayon crate.
0.1.4 - Added error messages in assert!() and #![forbid(unsafe_code)] macro.
0.1.3 - Get rid of unsafe codes and fn find2power().
0.1.1, 0.1.2 - Minor fixes.
0.1.0 - Initial release.
# Citation
Arts, L.P.A., van den Broek, E.L. The fast continuous wavelet transformation (fCWT) for real-time, high-quality, noise-resistant time–frequency analysis. Nat Comput Sci 2, 47–58 (2022). https://doi.org/10.1038/s43588-021-00183-z