liebharc / basic_dsp

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

to_complex_time_vec seems turn capacity into length #51

Closed vi closed 3 months ago

vi commented 1 year ago

My program panics on get_magnitude_squared - it accesses out of range data.

.data.len() also shows excessive size after DspVec construction using to_complex_time_vec.

But adding .shrink_to_fit(); on Vecs prior to using to_complex_time_vec seems to work around the issue.

liebharc commented 1 year ago

There could be an issue here https://github.com/liebharc/basic_dsp/blob/master/vector/src/vector_types/support_std.rs in the interleaved_vec_to_complex_vec function. But can't tell for sure without further tests.

Unfortunately I don't have the time and energy anymore to maintain this on my own. Feel free to submit a fix if you want. Otherwise I'd leave this issue open in case someone else wants to help out at some point.