Trait basic_dsp_vector::ReorganizeDataOpsBuffered
[−]
[src]
pub trait ReorganizeDataOpsBuffered<S, T> where T: RealNumber, S: ToSliceMut<T> { fn swap_halves_b<B>(&mut self, buffer: &mut B) where B: Buffer<S, T>; }
Deprecated since 0.4.1
: please use ReorganizeDataOps
instead which offers the same performance without a buffer
This trait allows to reorganize the data by changing positions of the individual elements. Deprecated since it requires a buffer which is never used since there would be no beneifit in using it.
Required Methods
fn swap_halves_b<B>(&mut self, buffer: &mut B) where B: Buffer<S, T>
Deprecated since 0.4.1
: please use ReorganizeDataOps
instead which offers the same performance without a buffer
This function swaps both halves of the vector. This operation is also called FFT shift
Use it after a plain_fft
to get a spectrum which is centered at 0 Hz
.
Example
use basic_dsp_vector::*; let mut vector = vec!(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0).to_real_time_vec(); let mut buffer = SingleBuffer::new(); vector.swap_halves_b(&mut buffer); assert_eq!([5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0], vector[..]);
Implementors
impl<S, T, N, D> ReorganizeDataOpsBuffered<S, T> for DspVec<S, T, N, D> where S: ToSliceMut<T> + Owner, T: RealNumber, N: NumberSpace, D: Domain