Trait basic_dsp::FrequencyToTimeDomainOperations [−][src]
pub trait FrequencyToTimeDomainOperations<S, T>: ToTimeResult where
T: RealNumber,
S: ToSliceMut<T>, { fn plain_ifft<B>(self, buffer: &mut B) -> Self::TimeResult
where
B: for<'a> Buffer<'a, S, T>; fn ifft<B>(self, buffer: &mut B) -> Self::TimeResult
where
B: for<'a> Buffer<'a, S, T>; fn windowed_ifft<B>(
self,
buffer: &mut B,
window: &dyn WindowFunction<T>
) -> Self::TimeResult
where
B: for<'a> Buffer<'a, S, T>; }
Expand description
Defines all operations which are valid on DataVecs
containing frequency domain data.
Failures
All operations in this trait set self.len()
to 0
if the vector isn’t in frequency domain and complex number space.
Required methods
fn plain_ifft<B>(self, buffer: &mut B) -> Self::TimeResult where
B: for<'a> Buffer<'a, S, T>,
[src]
fn plain_ifft<B>(self, buffer: &mut B) -> Self::TimeResult where
B: for<'a> Buffer<'a, S, T>,
[src]Performs an Inverse Fast Fourier Transformation transforming a frequency domain vector into a time domain vector.
This version of the IFFT neither applies a window nor does it scale the vector.
Example
use std::f32; use basic_dsp_vector::*; let vector = vec!(Complex::new(0.0, 0.0), Complex::new(1.0, 0.0), Complex::new(0.0, 0.0)).to_complex_freq_vec(); let mut buffer = SingleBuffer::new(); let result = vector.plain_ifft(&mut buffer); let actual = &result[..]; let expected = &[Complex::new(1.0, 0.0), Complex::new(-0.5, 0.8660254), Complex::new(-0.5, -0.8660254)]; assert_eq!(actual.len(), expected.len()); for i in 0..actual.len() { assert!((actual[i] - expected[i]).norm() < 1e-4); }
fn ifft<B>(self, buffer: &mut B) -> Self::TimeResult where
B: for<'a> Buffer<'a, S, T>,
[src]
fn ifft<B>(self, buffer: &mut B) -> Self::TimeResult where
B: for<'a> Buffer<'a, S, T>,
[src]Performs an Inverse Fast Fourier Transformation transforming a frequency domain vector into a time domain vector.
Example
use std::f32; use basic_dsp_vector::*; let vector = vec!(Complex::new(0.0, 0.0), Complex::new(0.0, 0.0), Complex::new(3.0, 0.0)).to_complex_freq_vec(); let mut buffer = SingleBuffer::new(); let result = vector.ifft(&mut buffer); let actual = &result[..]; let expected = &[Complex::new(1.0, 0.0), Complex::new(-0.5, 0.8660254), Complex::new(-0.5, -0.8660254)]; assert_eq!(actual.len(), expected.len()); for i in 0..actual.len() { assert!((actual[i] - expected[i]).norm() < 1e-4); }
fn windowed_ifft<B>(
self,
buffer: &mut B,
window: &dyn WindowFunction<T>
) -> Self::TimeResult where
B: for<'a> Buffer<'a, S, T>,
[src]
fn windowed_ifft<B>(
self,
buffer: &mut B,
window: &dyn WindowFunction<T>
) -> Self::TimeResult where
B: for<'a> Buffer<'a, S, T>,
[src]Performs an Inverse Fast Fourier Transformation transforming a frequency domain vector into a time domain vector and removes the FFT window.
Implementors
impl<S, T, N, D> FrequencyToTimeDomainOperations<S, T> for DspVec<S, T, N, D> where
N: ComplexNumberSpace,
T: RealNumber,
S: ToSliceMut<T>,
D: FrequencyDomain,
DspVec<S, T, N, D>: ToTimeResult,
<DspVec<S, T, N, D> as ToTimeResult>::TimeResult: RededicateForceOps<DspVec<S, T, N, D>>,
<DspVec<S, T, N, D> as ToTimeResult>::TimeResult: TimeDomainOperations<S, T>,
[src]
impl<S, T, N, D> FrequencyToTimeDomainOperations<S, T> for DspVec<S, T, N, D> where
N: ComplexNumberSpace,
T: RealNumber,
S: ToSliceMut<T>,
D: FrequencyDomain,
DspVec<S, T, N, D>: ToTimeResult,
<DspVec<S, T, N, D> as ToTimeResult>::TimeResult: RededicateForceOps<DspVec<S, T, N, D>>,
<DspVec<S, T, N, D> as ToTimeResult>::TimeResult: TimeDomainOperations<S, T>,
[src]pub fn plain_ifft<B>(
self,
buffer: &mut B
) -> <DspVec<S, T, N, D> as ToTimeResult>::TimeResult where
B: for<'a> Buffer<'a, S, T>,
[src]pub fn ifft<B>(
self,
buffer: &mut B
) -> <DspVec<S, T, N, D> as ToTimeResult>::TimeResult where
B: for<'a> Buffer<'a, S, T>,
[src]pub fn windowed_ifft<B>(
self,
buffer: &mut B,
window: &dyn WindowFunction<T>
) -> <DspVec<S, T, N, D> as ToTimeResult>::TimeResult where
B: for<'a> Buffer<'a, S, T>,
[src]impl<V, S, T> FrequencyToTimeDomainOperations<S, T> for Matrix2xN<V, S, T> where
T: RealNumber,
V: Vector<T> + FrequencyToTimeDomainOperations<S, T>,
S: ToSliceMut<T>,
<V as ToTimeResult>::TimeResult: Vector<T>,
[src]
impl<V, S, T> FrequencyToTimeDomainOperations<S, T> for Matrix2xN<V, S, T> where
T: RealNumber,
V: Vector<T> + FrequencyToTimeDomainOperations<S, T>,
S: ToSliceMut<T>,
<V as ToTimeResult>::TimeResult: Vector<T>,
[src]pub fn plain_ifft<B>(
self,
buffer: &mut B
) -> <Matrix2xN<V, S, T> as ToTimeResult>::TimeResult where
B: for<'b> Buffer<'b, S, T>,
[src]pub fn ifft<B>(
self,
buffer: &mut B
) -> <Matrix2xN<V, S, T> as ToTimeResult>::TimeResult where
B: for<'b> Buffer<'b, S, T>,
[src]pub fn windowed_ifft<B>(
self,
buffer: &mut B,
window: &dyn WindowFunction<T>
) -> <Matrix2xN<V, S, T> as ToTimeResult>::TimeResult where
B: for<'b> Buffer<'b, S, T>,
[src]impl<V, S, T> FrequencyToTimeDomainOperations<S, T> for Matrix3xN<V, S, T> where
T: RealNumber,
V: Vector<T> + FrequencyToTimeDomainOperations<S, T>,
S: ToSliceMut<T>,
<V as ToTimeResult>::TimeResult: Vector<T>,
[src]
impl<V, S, T> FrequencyToTimeDomainOperations<S, T> for Matrix3xN<V, S, T> where
T: RealNumber,
V: Vector<T> + FrequencyToTimeDomainOperations<S, T>,
S: ToSliceMut<T>,
<V as ToTimeResult>::TimeResult: Vector<T>,
[src]pub fn plain_ifft<B>(
self,
buffer: &mut B
) -> <Matrix3xN<V, S, T> as ToTimeResult>::TimeResult where
B: for<'b> Buffer<'b, S, T>,
[src]pub fn ifft<B>(
self,
buffer: &mut B
) -> <Matrix3xN<V, S, T> as ToTimeResult>::TimeResult where
B: for<'b> Buffer<'b, S, T>,
[src]pub fn windowed_ifft<B>(
self,
buffer: &mut B,
window: &dyn WindowFunction<T>
) -> <Matrix3xN<V, S, T> as ToTimeResult>::TimeResult where
B: for<'b> Buffer<'b, S, T>,
[src]impl<V, S, T> FrequencyToTimeDomainOperations<S, T> for Matrix4xN<V, S, T> where
T: RealNumber,
V: Vector<T> + FrequencyToTimeDomainOperations<S, T>,
S: ToSliceMut<T>,
<V as ToTimeResult>::TimeResult: Vector<T>,
[src]
impl<V, S, T> FrequencyToTimeDomainOperations<S, T> for Matrix4xN<V, S, T> where
T: RealNumber,
V: Vector<T> + FrequencyToTimeDomainOperations<S, T>,
S: ToSliceMut<T>,
<V as ToTimeResult>::TimeResult: Vector<T>,
[src]pub fn plain_ifft<B>(
self,
buffer: &mut B
) -> <Matrix4xN<V, S, T> as ToTimeResult>::TimeResult where
B: for<'b> Buffer<'b, S, T>,
[src]pub fn ifft<B>(
self,
buffer: &mut B
) -> <Matrix4xN<V, S, T> as ToTimeResult>::TimeResult where
B: for<'b> Buffer<'b, S, T>,
[src]pub fn windowed_ifft<B>(
self,
buffer: &mut B,
window: &dyn WindowFunction<T>
) -> <Matrix4xN<V, S, T> as ToTimeResult>::TimeResult where
B: for<'b> Buffer<'b, S, T>,
[src]impl<V, S, T> FrequencyToTimeDomainOperations<S, T> for MatrixMxN<V, S, T> where
T: RealNumber,
V: Vector<T> + FrequencyToTimeDomainOperations<S, T>,
S: ToSliceMut<T>,
<V as ToTimeResult>::TimeResult: Vector<T>,
[src]
impl<V, S, T> FrequencyToTimeDomainOperations<S, T> for MatrixMxN<V, S, T> where
T: RealNumber,
V: Vector<T> + FrequencyToTimeDomainOperations<S, T>,
S: ToSliceMut<T>,
<V as ToTimeResult>::TimeResult: Vector<T>,
[src]pub fn plain_ifft<B>(
self,
buffer: &mut B
) -> <MatrixMxN<V, S, T> as ToTimeResult>::TimeResult where
B: for<'b> Buffer<'b, S, T>,
[src]pub fn ifft<B>(
self,
buffer: &mut B
) -> <MatrixMxN<V, S, T> as ToTimeResult>::TimeResult where
B: for<'b> Buffer<'b, S, T>,
[src]pub fn windowed_ifft<B>(
self,
buffer: &mut B,
window: &dyn WindowFunction<T>
) -> <MatrixMxN<V, S, T> as ToTimeResult>::TimeResult where
B: for<'b> Buffer<'b, S, T>,
[src]