liebharc / basic_dsp

Basic DSP vector operations for Rust.
Apache License 2.0
43 stars 5 forks source link

Stable interface to improve register and cache utilization #26

Closed liebharc closed 8 years ago

liebharc commented 8 years ago

Every operation is right now executed in its own loop. This isn't optimal regarding register and cache utilization. perform_operations is a proof of concept implementation to show the performance improvement if several operations are done in one loop. However this interface isn't stable.

An idea how it could look like is this

let vector = new ComplexTimeVector32::from_constant(Complex32::new(2.0, 0.0), 1000);
let result = 
    vector.new_operation()
    .scale_real(0.5)
    .real_offset(-0.5)
    .zero_interleave()
    .convolve(&RaisedCosineFunction::new(0.5), 0.5, 10)
    .add_vector(&noise)
    .multiply_complex_exponential(0.25 * PI, 0.0)
    .to_real()
    .execute()
    .expect("Ignoring error handling);
// Would also be nice to get information about setting points
liebharc commented 8 years ago

This is basically implemented on master. More tests are necessary.

liebharc commented 8 years ago

Implemented with 0.3.0