wavegen 0.1.0

Wavefrom generator library
Documentation

wavegen

wavegen is a wavefrom generator made with 🦀

Refer to documentation for usage examples.

How to use it?

  1. Define a waveform with sampling frequency and function components
let wf = Waveform::<f64>::with_components(200.0, vec![sine!(100, 10), dc_bias!(20)]);
  1. Turn it into an iterator and sample
let some_samples: Vec<f64> = wf.into_iter().take(200).collect();

Show me some examples!

  • Simple sine

Sine plot

  • Two superposed phase-shifted sines

Superposed sines plot

  • Sawtooth

Sawtooth plot

  • Superposition of sine + sawtooth

Sine and sawtooth superposed

  • Square wave

Square wave

  • Superposition of Sine, Square and Sawtooth with different frequencies

Something funky

All above examples are generated with simple program found in examples/plot.rs. Run cargo run --example plot to generate them yourself.

no_std?

Yes. This crate requires no standard library features, and uses the no_std declaration.