Crates.io | wavegen |
lib.rs | wavegen |
version | 0.4.1 |
source | src |
created_at | 2022-06-29 22:14:29.321857 |
updated_at | 2023-01-02 14:13:57.844863 |
description | Wavefrom generator library |
homepage | |
repository | https://github.com/spitfire05/wavegen-rs |
max_upload_size | |
id | 616036 |
size | 473,664 |
wavegen
is a wavefrom generator made with 🦀
wavegen
to your project:[dependencies]
wavegen = "0.4"
Or, to use the no_std version (custom global allocator is required):
[dependencies]
wavegen = { version = "0.4", default-features = false, features = ["libm"] }
let waveform = wf!(f64, 200., sine!(frequency: 100., amplitude: 10.), dc_bias!(20.));
let some_samples: Vec<f64> = waveform.iter().take(200).collect();
Refer to documentation for more exhaustive usage examples.
Check out the demo at https://wavegen-demo.netlify.app
All above examples are generated with simple program found in examples/plot.rs
. Run cargo run --example plot
to generate them yourself.
The Minimum Supported Rust Version is 1.60
.
frequency = n
to frequency: n
Waveform::get_sample_rate
renamed to Waveform::sample_rate
and now returns a borrowed values, as per rust API specs.Waveform::get_components_len
removed. The functionality can be achieved by a new getter Waveform::components
.