[−][src]Trait basic_dsp::TimeToFrequencyDomainOperations
Defines all operations which are valid on DataVecs
containing time domain data.
Failures
All operations in this trait set self.len()
to 0
if the vector isn't in time domain.
Required methods
fn plain_fft<B>(self, buffer: &mut B) -> Self::FreqResult where
B: Buffer<'a, S, T>,
B: Buffer<'a, S, T>,
Performs a Fast Fourier Transformation transforming a time domain vector into a frequency domain vector.
This version of the FFT neither applies a window nor does it scale the vector.
Example
use std::f32; use basic_dsp_vector::*; let vector = vec!(1.0, 0.0, -0.5, 0.8660254, -0.5, -0.8660254).to_complex_time_vec(); let mut buffer = SingleBuffer::new(); let result = vector.plain_fft(&mut buffer); let actual = &result[..]; let expected = &[0.0, 0.0, 3.0, 0.0, 0.0, 0.0]; assert_eq!(actual.len(), expected.len()); for i in 0..actual.len() { assert!(f32::abs(actual[i] - expected[i]) < 1e-4); }
fn fft<B>(self, buffer: &mut B) -> Self::FreqResult where
B: Buffer<'a, S, T>,
B: Buffer<'a, S, T>,
Performs a Fast Fourier Transformation transforming a time domain vector into a frequency domain vector.
Example
use std::f32; use basic_dsp_vector::*; let vector = vec!(1.0, 0.0, -0.5, 0.8660254, -0.5, -0.8660254).to_complex_time_vec(); let mut buffer = SingleBuffer::new(); let result = vector.fft(&mut buffer); let actual = &result[..]; let expected = &[0.0, 0.0, 0.0, 0.0, 3.0, 0.0]; assert_eq!(actual.len(), expected.len()); for i in 0..actual.len() { assert!(f32::abs(actual[i] - expected[i]) < 1e-4); }
fn windowed_fft<B>(
self,
buffer: &mut B,
window: &dyn WindowFunction<T>
) -> Self::FreqResult where
B: Buffer<'a, S, T>,
self,
buffer: &mut B,
window: &dyn WindowFunction<T>
) -> Self::FreqResult where
B: Buffer<'a, S, T>,
Applies a FFT window and performs a Fast Fourier Transformation transforming a time domain vector into a frequency domain vector.
Implementors
impl<S, T, N, D> TimeToFrequencyDomainOperations<S, T> for DspVec<S, T, N, D> where
D: TimeDomain,
N: NumberSpace,
S: ToSliceMut<T>,
T: RealNumber,
DspVec<S, T, N, D>: ToFreqResult,
<DspVec<S, T, N, D> as ToFreqResult>::FreqResult: RededicateForceOps<DspVec<S, T, N, D>>,
<DspVec<S, T, N, D> as ToFreqResult>::FreqResult: FrequencyDomainOperations<S, T>,
[src]
impl<S, T, N, D> TimeToFrequencyDomainOperations<S, T> for DspVec<S, T, N, D> where
D: TimeDomain,
N: NumberSpace,
S: ToSliceMut<T>,
T: RealNumber,
DspVec<S, T, N, D>: ToFreqResult,
<DspVec<S, T, N, D> as ToFreqResult>::FreqResult: RededicateForceOps<DspVec<S, T, N, D>>,
<DspVec<S, T, N, D> as ToFreqResult>::FreqResult: FrequencyDomainOperations<S, T>,
fn plain_fft<B>( | [src] |
fn fft<B>( | [src] |
fn windowed_fft<B>( | [src] |
impl<V, S, T> TimeToFrequencyDomainOperations<S, T> for Matrix2xN<V, S, T> where
S: ToSliceMut<T>,
T: RealNumber,
V: Vector<T> + TimeToFrequencyDomainOperations<S, T>,
<V as ToFreqResult>::FreqResult: Vector<T>,
[src]
impl<V, S, T> TimeToFrequencyDomainOperations<S, T> for Matrix2xN<V, S, T> where
S: ToSliceMut<T>,
T: RealNumber,
V: Vector<T> + TimeToFrequencyDomainOperations<S, T>,
<V as ToFreqResult>::FreqResult: Vector<T>,
fn plain_fft<B>( | [src] |
fn fft<B>( | [src] |
fn windowed_fft<B>( | [src] |
impl<V, S, T> TimeToFrequencyDomainOperations<S, T> for Matrix3xN<V, S, T> where
S: ToSliceMut<T>,
T: RealNumber,
V: Vector<T> + TimeToFrequencyDomainOperations<S, T>,
<V as ToFreqResult>::FreqResult: Vector<T>,
[src]
impl<V, S, T> TimeToFrequencyDomainOperations<S, T> for Matrix3xN<V, S, T> where
S: ToSliceMut<T>,
T: RealNumber,
V: Vector<T> + TimeToFrequencyDomainOperations<S, T>,
<V as ToFreqResult>::FreqResult: Vector<T>,
fn plain_fft<B>( | [src] |
fn fft<B>( | [src] |
fn windowed_fft<B>( | [src] |
impl<V, S, T> TimeToFrequencyDomainOperations<S, T> for Matrix4xN<V, S, T> where
S: ToSliceMut<T>,
T: RealNumber,
V: Vector<T> + TimeToFrequencyDomainOperations<S, T>,
<V as ToFreqResult>::FreqResult: Vector<T>,
[src]
impl<V, S, T> TimeToFrequencyDomainOperations<S, T> for Matrix4xN<V, S, T> where
S: ToSliceMut<T>,
T: RealNumber,
V: Vector<T> + TimeToFrequencyDomainOperations<S, T>,
<V as ToFreqResult>::FreqResult: Vector<T>,
fn plain_fft<B>( | [src] |
fn fft<B>( | [src] |
fn windowed_fft<B>( | [src] |
impl<V, S, T> TimeToFrequencyDomainOperations<S, T> for MatrixMxN<V, S, T> where
S: ToSliceMut<T>,
T: RealNumber,
V: Vector<T> + TimeToFrequencyDomainOperations<S, T>,
<V as ToFreqResult>::FreqResult: Vector<T>,
[src]
impl<V, S, T> TimeToFrequencyDomainOperations<S, T> for MatrixMxN<V, S, T> where
S: ToSliceMut<T>,
T: RealNumber,
V: Vector<T> + TimeToFrequencyDomainOperations<S, T>,
<V as ToFreqResult>::FreqResult: Vector<T>,
fn plain_fft<B>( | [src] |
fn fft<B>( | [src] |
fn windowed_fft<B>( | [src] |