Struct basic_dsp::RealTimeVector
[−]
[src]
pub struct RealTimeVector<T> where T: RealNumber {
// some fields omitted
}A 1xN (one times N elements) or Nx1 data vector as used for most digital signal processing (DSP) operations. All data vector operations consume the vector they operate on and return a new vector. A consumed vector must not be accessed again.
Vectors come in different flavors:
- Time or Frequency domain
- Real or Complex numbers
- 32bit or 64bit floating point numbers
The first two flavors define meta information about the vector and provide compile time information what
operations are available with the given vector and how this will transform the vector. This makes sure that
some invalid operations are already discovered at compile time. In case that this isn't desired or the information
about the vector isn't known at compile time there are the generic DataVector32 and DataVector64 vectors
available.
32bit and 64bit flavors trade performance and memory consumption against accuracy. 32bit vectors are roughly two times faster than 64bit vectors for most operations. But remember that you should benchmark first before you give away accuracy for performance unless however you are sure that 32bit accuracy is certainly good enough.
Methods
impl<T> RealTimeVector<T> where T: RealNumber[src]
fn from_array_no_copy_with_options(data: Vec<T>, options: MultiCoreSettings) -> Self
Same as from_array_no_copy but also allows to set multicore options.
fn from_array_with_options(data: &[T], options: MultiCoreSettings) -> Self
Same as from_array but also allows to set multicore options.
fn from_array_with_delta_and_options(data: &[T], delta: T, options: MultiCoreSettings) -> Self
Same as from_array_with_delta but also allows to set multicore options.
fn empty_with_options(options: MultiCoreSettings) -> Self
Same as empty but also allows to set multicore options.
fn empty_with_delta_and_options(delta: T, options: MultiCoreSettings) -> Self
Same as empty_with_delta but also allows to set multicore options.
fn from_constant_with_options(constant: T, length: usize, options: MultiCoreSettings) -> Self
Same as from_constant but also allows to set multicore options.
fn from_constant_with_delta_and_options(constant: T, length: usize, delta: T, options: MultiCoreSettings) -> Self
Same as from_constant_with_delta but also allows to set multicore options.
fn from_array_no_copy(data: Vec<T>) -> Self
Creates a real DataVector by consuming a Vec.
This operation is more memory efficient than the other options to create a vector, however if used outside of Rust then it holds the risk that the user will access the data parameter after the vector has been created causing all types of issues.
fn from_array(data: &[T]) -> Self
Creates a real DataVector from an array or sequence. delta is defaulted to 1.
fn from_array_with_delta(data: &[T], delta: T) -> Self
Creates a real DataVector from an array or sequence and sets delta to the given value.
fn empty() -> Self
Creates a real and empty DataVector and sets delta to 1.0 value.
fn empty_with_delta(delta: T) -> Self
Creates a real and empty DataVector and sets delta to the given value.
fn from_constant(constant: T, length: usize) -> Self
Creates a real DataVector with length elements all set to the value of constant. delta is defaulted to 1.
fn from_constant_with_delta(constant: T, length: usize, delta: T) -> Self
Creates a real DataVector with length elements all set to the value of constant and sets delta to the given value.
Trait Implementations
impl TimeDomainOperations<f32> for RealTimeVector<f32>[src]
type FreqPartner = ComplexFreqVector<f32>
fn plain_fft(self) -> VecResult<Self::FreqPartner>
Performs a Fast Fourier Transformation transforming a time domain vector into a frequency domain vector. Read more
fn apply_window(self, window: &WindowFunction<f32>) -> VecResult<Self>
Applies a window to the data vector.
fn unapply_window(self, window: &WindowFunction<f32>) -> VecResult<Self>
Removes a window from the data vector.
fn fft(self) -> VecResult<Self::FreqPartner>
Performs a Fast Fourier Transformation transforming a time domain vector into a frequency domain vector. # Unstable FFTs of real vectors are unstable. # Example Read more
fn windowed_fft(self, window: &WindowFunction<f32>) -> VecResult<Self::FreqPartner>
Applies a FFT window and performs a Fast Fourier Transformation transforming a time domain vector into a frequency domain vector. Read more
impl SymmetricTimeDomainOperations<f32> for RealTimeVector<f32>[src]
type FreqPartner = ComplexFreqVector<f32>
fn plain_sfft(self) -> VecResult<Self::FreqPartner>
Performs a Symmetric Fast Fourier Transformation under the assumption that self is symmetric around the center. This assumption isn't verified and no error is raised if the vector isn't symmetric. Read more
fn sfft(self) -> VecResult<Self::FreqPartner>
Performs a Symmetric Fast Fourier Transformation under the assumption that self is symmetric around the center. This assumption isn't verified and no error is raised if the vector isn't symmetric. # Failures VecResult may report the following ErrorReason members: Read more
fn windowed_sfft(self, window: &WindowFunction<f32>) -> VecResult<Self::FreqPartner>
Performs a Symmetric Fast Fourier Transformation under the assumption that self is symmetric around the center. This assumption isn't verified and no error is raised if the vector isn't symmetric. # Failures VecResult may report the following ErrorReason members: Read more
impl TimeDomainOperations<f64> for RealTimeVector<f64>[src]
type FreqPartner = ComplexFreqVector<f64>
fn plain_fft(self) -> VecResult<Self::FreqPartner>
Performs a Fast Fourier Transformation transforming a time domain vector into a frequency domain vector. Read more
fn apply_window(self, window: &WindowFunction<f64>) -> VecResult<Self>
Applies a window to the data vector.
fn unapply_window(self, window: &WindowFunction<f64>) -> VecResult<Self>
Removes a window from the data vector.
fn fft(self) -> VecResult<Self::FreqPartner>
Performs a Fast Fourier Transformation transforming a time domain vector into a frequency domain vector. # Unstable FFTs of real vectors are unstable. # Example Read more
fn windowed_fft(self, window: &WindowFunction<f64>) -> VecResult<Self::FreqPartner>
Applies a FFT window and performs a Fast Fourier Transformation transforming a time domain vector into a frequency domain vector. Read more
impl SymmetricTimeDomainOperations<f64> for RealTimeVector<f64>[src]
type FreqPartner = ComplexFreqVector<f64>
fn plain_sfft(self) -> VecResult<Self::FreqPartner>
Performs a Symmetric Fast Fourier Transformation under the assumption that self is symmetric around the center. This assumption isn't verified and no error is raised if the vector isn't symmetric. Read more
fn sfft(self) -> VecResult<Self::FreqPartner>
Performs a Symmetric Fast Fourier Transformation under the assumption that self is symmetric around the center. This assumption isn't verified and no error is raised if the vector isn't symmetric. # Failures VecResult may report the following ErrorReason members: Read more
fn windowed_sfft(self, window: &WindowFunction<f64>) -> VecResult<Self::FreqPartner>
Performs a Symmetric Fast Fourier Transformation under the assumption that self is symmetric around the center. This assumption isn't verified and no error is raised if the vector isn't symmetric. # Failures VecResult may report the following ErrorReason members: Read more
impl<'a> Convolution<f32, &'a RealImpulseResponse<f32>> for RealTimeVector<f32>[src]
fn convolve(self, function: &RealImpulseResponse<f32>, ratio: f32, len: usize) -> VecResult<Self>
Convolves self with the convolution function impulse_response. For performance consider to to use FrequencyMultiplication instead of this operation depending on len. Read more
impl<'a> Convolution<f64, &'a RealImpulseResponse<f64>> for RealTimeVector<f64>[src]
fn convolve(self, function: &RealImpulseResponse<f64>, ratio: f64, len: usize) -> VecResult<Self>
Convolves self with the convolution function impulse_response. For performance consider to to use FrequencyMultiplication instead of this operation depending on len. Read more
impl VectorConvolution<f32> for RealTimeVector<f32>[src]
fn convolve_vector(self, other: &Self) -> VecResult<Self>
Convolves self with the convolution function impulse_response. For performance it's recommended to use multiply both vectors in frequency domain instead of this operation. # Failures VecResult may report the following ErrorReason members: Read more
impl VectorConvolution<f64> for RealTimeVector<f64>[src]
fn convolve_vector(self, other: &Self) -> VecResult<Self>
Convolves self with the convolution function impulse_response. For performance it's recommended to use multiply both vectors in frequency domain instead of this operation. # Failures VecResult may report the following ErrorReason members: Read more
impl Interpolation<f32> for RealTimeVector<f32>[src]
fn interpolatef(self, function: &RealImpulseResponse<f32>, interpolation_factor: f32, delay: f32, len: usize) -> VecResult<Self>
Interpolates self with the convolution function function by the real value interpolation_factor. Interpolation is done in time domain and the argument conv_len can be used to balance accuracy and computational performance. A delay can be used to delay or phase shift the vector. The delay considers self.delta(). Read more
fn interpolatei(self, function: &RealFrequencyResponse<f32>, interpolation_factor: u32) -> VecResult<Self>
Interpolates self with the convolution function function by the interger value interpolation_factor. Interpolation is done in in frequency domain. Read more
fn decimatei(self, decimation_factor: u32, delay: u32) -> VecResult<Self>
Decimates or downsamples self. decimatei is the inverse function to interpolatei.
impl Interpolation<f64> for RealTimeVector<f64>[src]
fn interpolatef(self, function: &RealImpulseResponse<f64>, interpolation_factor: f64, delay: f64, len: usize) -> VecResult<Self>
Interpolates self with the convolution function function by the real value interpolation_factor. Interpolation is done in time domain and the argument conv_len can be used to balance accuracy and computational performance. A delay can be used to delay or phase shift the vector. The delay considers self.delta(). Read more
fn interpolatei(self, function: &RealFrequencyResponse<f64>, interpolation_factor: u32) -> VecResult<Self>
Interpolates self with the convolution function function by the interger value interpolation_factor. Interpolation is done in in frequency domain. Read more
fn decimatei(self, decimation_factor: u32, delay: u32) -> VecResult<Self>
Decimates or downsamples self. decimatei is the inverse function to interpolatei.
impl RealInterpolation<f32> for RealTimeVector<f32>[src]
fn interpolate_lin(self, interpolation_factor: f32, delay: f32) -> VecResult<Self>
Linear interpolation between samples. # Unstable This operation and interpolate_hermite might be merged into one function with an additional argument in future. Read more
fn interpolate_hermite(self, interpolation_factor: f32, delay: f32) -> VecResult<Self>
Piecewise cubic hermite interpolation between samples. # Unstable Algorithm might need to be revised. This operation and interpolate_lin might be merged into one function with an additional argument in future. Read more
impl RealInterpolation<f64> for RealTimeVector<f64>[src]
fn interpolate_lin(self, interpolation_factor: f64, delay: f64) -> VecResult<Self>
Linear interpolation between samples. # Unstable This operation and interpolate_hermite might be merged into one function with an additional argument in future. Read more
fn interpolate_hermite(self, interpolation_factor: f64, delay: f64) -> VecResult<Self>
Piecewise cubic hermite interpolation between samples. # Unstable Algorithm might need to be revised. This operation and interpolate_lin might be merged into one function with an additional argument in future. Read more
impl<T> RededicateVector<ComplexTimeVector<T>> for RealTimeVector<T> where T: RealNumber[src]
fn rededicate(self) -> ComplexTimeVector<T>
Make self a Other. # Example Read more
fn rededicate_from(other: ComplexTimeVector<T>) -> Self
Make Other a Self. # Example Read more
impl<T> RededicateVector<ComplexFreqVector<T>> for RealTimeVector<T> where T: RealNumber[src]
fn rededicate(self) -> ComplexFreqVector<T>
Make self a Other. # Example Read more
fn rededicate_from(other: ComplexFreqVector<T>) -> Self
Make Other a Self. # Example Read more
impl<T> RededicateVector<RealTimeVector<T>> for RealTimeVector<T> where T: RealNumber[src]
fn rededicate(self) -> RealTimeVector<T>
Make self a Other. # Example Read more
fn rededicate_from(other: RealTimeVector<T>) -> Self
Make Other a Self. # Example Read more
impl<T> RededicateVector<RealFreqVector<T>> for RealTimeVector<T> where T: RealNumber[src]
fn rededicate(self) -> RealFreqVector<T>
Make self a Other. # Example Read more
fn rededicate_from(other: RealFreqVector<T>) -> Self
Make Other a Self. # Example Read more
impl<T> RededicateVector<GenericDataVector<T>> for RealTimeVector<T> where T: RealNumber[src]
fn rededicate(self) -> GenericDataVector<T>
Make self a Other. # Example Read more
fn rededicate_from(other: GenericDataVector<T>) -> Self
Make Other a Self. # Example Read more
impl<T> ToIdentifier<T> for RealTimeVector<T> where T: RealNumber[src]
type Identifier = RealTimeIdentifier<T>
impl<T: Debug> Debug for RealTimeVector<T> where T: RealNumber[src]
impl<T> DataVector<T> for RealTimeVector<T> where T: RealNumber[src]
fn len(&self) -> usize
The number of valid elements in the vector.
fn set_len(&mut self, len: usize)
Sets the vector length to the given length. If self.len() < len then the value of the new elements is undefined. Read more
fn allocated_len(&self) -> usize
Gets the number of allocated elements in the underlying vector. The allocated length may be larger than the length of valid points. In most cases you likely want to have lenor points instead. Read more
fn data(&self) -> &[T]
Gives direct access to the underlying data sequence. It's recommended to use the `Index functions . For users outside of Rust: It's discouraged to hold references to this array while executing operations on the vector, since the vector may decide at any operation to invalidate the array. Read more
fn delta(&self) -> T
The x-axis delta. If domain is time domain then delta is in [s], in frequency domain delta is in [Hz].
fn domain(&self) -> DataVectorDomain
The domain in which the data vector resides. Basically specifies the x-axis and the type of operations which are valid on this vector. Read more
fn is_complex(&self) -> bool
Indicates whether the vector contains complex data. This also specifies the type of operations which are valid on this vector. Read more
fn points(&self) -> usize
The number of valid points. If the vector is complex then every valid point consists of two floating point numbers, while for real vectors every point only consists of one floating point number. Read more
impl<T> Index<usize> for RealTimeVector<T> where T: RealNumber[src]
type Output = T
The returned type after indexing
fn index(&self, index: usize) -> &T
The method for the indexing (Foo[Bar]) operation
impl<T> IndexMut<usize> for RealTimeVector<T> where T: RealNumber[src]
impl<T> Index<Range<usize>> for RealTimeVector<T> where T: RealNumber[src]
type Output = [T]
The returned type after indexing
fn index(&self, index: Range<usize>) -> &[T]
The method for the indexing (Foo[Bar]) operation
impl<T> IndexMut<Range<usize>> for RealTimeVector<T> where T: RealNumber[src]
fn index_mut(&mut self, index: Range<usize>) -> &mut [T]
The method for the indexing (Foo[Bar]) operation
impl<T> Index<RangeFrom<usize>> for RealTimeVector<T> where T: RealNumber[src]
type Output = [T]
The returned type after indexing
fn index(&self, index: RangeFrom<usize>) -> &[T]
The method for the indexing (Foo[Bar]) operation
impl<T> IndexMut<RangeFrom<usize>> for RealTimeVector<T> where T: RealNumber[src]
fn index_mut(&mut self, index: RangeFrom<usize>) -> &mut [T]
The method for the indexing (Foo[Bar]) operation
impl<T> Index<RangeTo<usize>> for RealTimeVector<T> where T: RealNumber[src]
type Output = [T]
The returned type after indexing
fn index(&self, index: RangeTo<usize>) -> &[T]
The method for the indexing (Foo[Bar]) operation
impl<T> IndexMut<RangeTo<usize>> for RealTimeVector<T> where T: RealNumber[src]
fn index_mut(&mut self, index: RangeTo<usize>) -> &mut [T]
The method for the indexing (Foo[Bar]) operation
impl<T> Index<RangeFull> for RealTimeVector<T> where T: RealNumber[src]
type Output = [T]
The returned type after indexing
fn index(&self, index: RangeFull) -> &[T]
The method for the indexing (Foo[Bar]) operation
impl<T> IndexMut<RangeFull> for RealTimeVector<T> where T: RealNumber[src]
fn index_mut(&mut self, index: RangeFull) -> &mut [T]
The method for the indexing (Foo[Bar]) operation
impl<T> Clone for RealTimeVector<T> where T: RealNumber[src]
fn clone(&self) -> Self
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
impl GenericVectorOps<f32> for RealTimeVector<f32>[src]
fn add_vector(self, summand: &Self) -> VecResult<Self>
Calculates the sum of self + summand. It consumes self and returns the result. # Failures VecResult may report the following ErrorReason members: Read more
fn add_smaller_vector(self, summand: &Self) -> VecResult<Self>
Calculates the sum of self + summand. summand may be smaller than self as long as self.len() % summand.len() == 0. THe result is the same as it would be if you would repeat summand until it has the same length as self. It consumes self and returns the result. # Failures VecResult may report the following ErrorReason members: Read more
fn subtract_vector(self, subtrahend: &Self) -> VecResult<Self>
Calculates the difference of self - subtrahend. It consumes self and returns the result. # Failures VecResult may report the following ErrorReason members: Read more
fn subtract_smaller_vector(self, subtrahend: &Self) -> VecResult<Self>
Calculates the sum of self - subtrahend. subtrahend may be smaller than self as long as self.len() % subtrahend.len() == 0. THe result is the same as it would be if you would repeat subtrahend until it has the same length as self. It consumes self and returns the result. # Failures VecResult may report the following ErrorReason members: Read more
fn multiply_vector(self, factor: &Self) -> VecResult<Self>
Calculates the product of self * factor. It consumes self and returns the result. # Failures VecResult may report the following ErrorReason members: Read more
fn multiply_smaller_vector(self, factor: &Self) -> VecResult<Self>
Calculates the sum of self - factor. factor may be smaller than self as long as self.len() % factor.len() == 0. THe result is the same as it would be if you would repeat factor until it has the same length as self. It consumes self and returns the result. # Failures VecResult may report the following ErrorReason members: Read more
fn divide_vector(self, divisor: &Self) -> VecResult<Self>
Calculates the quotient of self / summand. It consumes self and returns the result. # Failures VecResult may report the following ErrorReason members: Read more
fn divide_smaller_vector(self, divisor: &Self) -> VecResult<Self>
Calculates the sum of self - divisor. divisor may be smaller than self as long as self.len() % divisor.len() == 0. THe result is the same as it would be if you would repeat divisor until it has the same length as self. It consumes self and returns the result. # Failures VecResult may report the following ErrorReason members: Read more
fn zero_pad(self, points: usize, option: PaddingOption) -> VecResult<Self>
Appends zeros add the end of the vector until the vector has the size given in the points argument. If points smaller than the self.len() then this operation won't do anything. Read more
fn reverse(self) -> VecResult<Self>
Reverses the data inside the vector.
fn zero_interleave(self, factor: u32) -> VecResult<Self>
Interleaves zeros factor - 1times after every vector element, so that the resulting vector will have a length of self.len() * factor. Read more
fn diff(self) -> VecResult<Self>
Calculates the delta of each elements to its previous element. This will decrease the vector length by one point. Read more
fn diff_with_start(self) -> VecResult<Self>
Calculates the delta of each elements to its previous element. The first element will remain unchanged. Read more
fn cum_sum(self) -> VecResult<Self>
Calculates the cumulative sum of all elements. This operation undoes the diff_with_startoperation. Read more
fn sqrt(self) -> VecResult<Self>
Gets the square root of all vector elements. Read more
fn square(self) -> VecResult<Self>
Squares all vector elements. Read more
fn root(self, degree: f32) -> VecResult<Self>
Calculates the n-th root of every vector element. Read more
fn powf(self, exponent: f32) -> VecResult<Self>
Raises every vector element to a floating point power. Read more
fn ln(self) -> VecResult<Self>
Computes the principal value of natural logarithm of every element in the vector. Read more
fn exp(self) -> VecResult<Self>
Calculates the natural exponential for every vector element. Read more
fn log(self, base: f32) -> VecResult<Self>
Calculates the logarithm to the given base for every vector element. Read more
fn sin(self) -> VecResult<Self>
Calculates the sine of each element in radians. Read more
fn cos(self) -> VecResult<Self>
Calculates the cosine of each element in radians. Read more
fn tan(self) -> VecResult<Self>
Calculates the tangent of each element in radians.
fn asin(self) -> VecResult<Self>
Calculates the principal value of the inverse sine of each element in radians.
fn acos(self) -> VecResult<Self>
Calculates the principal value of the inverse cosine of each element in radians.
fn atan(self) -> VecResult<Self>
Calculates the principal value of the inverse tangent of each element in radians.
fn sinh(self) -> VecResult<Self>
Calculates the hyperbolic sine each element in radians.
fn cosh(self) -> VecResult<Self>
Calculates the hyperbolic cosine each element in radians.
fn tanh(self) -> VecResult<Self>
Calculates the hyperbolic tangent each element in radians.
fn asinh(self) -> VecResult<Self>
Calculates the principal value of the inverse hyperbolic sine of each element in radians.
fn acosh(self) -> VecResult<Self>
Calculates the principal value of the inverse hyperbolic cosine of each element in radians.
fn atanh(self) -> VecResult<Self>
Calculates the principal value of the inverse hyperbolic tangent of each element in radians.
fn swap_halves(self) -> VecResult<Self>
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. Read more
fn expf(self, base: f32) -> VecResult<Self>
Calculates the exponential to the given base for every vector element. Read more
fn override_data(self, data: &[f32]) -> VecResult<Self>
Overrides the data in the vector with the given data. This may also change the vectors length (however not the allocated length). Read more
fn split_into(&self, targets: &mut [Box<Self>]) -> VoidResult
Splits the vector into several smaller vectors. self.len() must be dividable by targets.len() without a remainder and this condition must be true too targets.len() > 0. # Failures VecResult may report the following ErrorReason members: Read more
fn merge(self, sources: &[Box<Self>]) -> VecResult<Self>
Merges several vectors into self. All vectors must have the same size and at least one vector must be provided. # Failures VecResult may report the following ErrorReason members: Read more
impl GenericVectorOps<f64> for RealTimeVector<f64>[src]
fn add_vector(self, summand: &Self) -> VecResult<Self>
Calculates the sum of self + summand. It consumes self and returns the result. # Failures VecResult may report the following ErrorReason members: Read more
fn add_smaller_vector(self, summand: &Self) -> VecResult<Self>
Calculates the sum of self + summand. summand may be smaller than self as long as self.len() % summand.len() == 0. THe result is the same as it would be if you would repeat summand until it has the same length as self. It consumes self and returns the result. # Failures VecResult may report the following ErrorReason members: Read more
fn subtract_vector(self, subtrahend: &Self) -> VecResult<Self>
Calculates the difference of self - subtrahend. It consumes self and returns the result. # Failures VecResult may report the following ErrorReason members: Read more
fn subtract_smaller_vector(self, subtrahend: &Self) -> VecResult<Self>
Calculates the sum of self - subtrahend. subtrahend may be smaller than self as long as self.len() % subtrahend.len() == 0. THe result is the same as it would be if you would repeat subtrahend until it has the same length as self. It consumes self and returns the result. # Failures VecResult may report the following ErrorReason members: Read more
fn multiply_vector(self, factor: &Self) -> VecResult<Self>
Calculates the product of self * factor. It consumes self and returns the result. # Failures VecResult may report the following ErrorReason members: Read more
fn multiply_smaller_vector(self, factor: &Self) -> VecResult<Self>
Calculates the sum of self - factor. factor may be smaller than self as long as self.len() % factor.len() == 0. THe result is the same as it would be if you would repeat factor until it has the same length as self. It consumes self and returns the result. # Failures VecResult may report the following ErrorReason members: Read more
fn divide_vector(self, divisor: &Self) -> VecResult<Self>
Calculates the quotient of self / summand. It consumes self and returns the result. # Failures VecResult may report the following ErrorReason members: Read more
fn divide_smaller_vector(self, divisor: &Self) -> VecResult<Self>
Calculates the sum of self - divisor. divisor may be smaller than self as long as self.len() % divisor.len() == 0. THe result is the same as it would be if you would repeat divisor until it has the same length as self. It consumes self and returns the result. # Failures VecResult may report the following ErrorReason members: Read more
fn zero_pad(self, points: usize, option: PaddingOption) -> VecResult<Self>
Appends zeros add the end of the vector until the vector has the size given in the points argument. If points smaller than the self.len() then this operation won't do anything. Read more
fn reverse(self) -> VecResult<Self>
Reverses the data inside the vector.
fn zero_interleave(self, factor: u32) -> VecResult<Self>
Interleaves zeros factor - 1times after every vector element, so that the resulting vector will have a length of self.len() * factor. Read more
fn diff(self) -> VecResult<Self>
Calculates the delta of each elements to its previous element. This will decrease the vector length by one point. Read more
fn diff_with_start(self) -> VecResult<Self>
Calculates the delta of each elements to its previous element. The first element will remain unchanged. Read more
fn cum_sum(self) -> VecResult<Self>
Calculates the cumulative sum of all elements. This operation undoes the diff_with_startoperation. Read more
fn sqrt(self) -> VecResult<Self>
Gets the square root of all vector elements. Read more
fn square(self) -> VecResult<Self>
Squares all vector elements. Read more
fn root(self, degree: f64) -> VecResult<Self>
Calculates the n-th root of every vector element. Read more
fn powf(self, exponent: f64) -> VecResult<Self>
Raises every vector element to a floating point power. Read more
fn ln(self) -> VecResult<Self>
Computes the principal value of natural logarithm of every element in the vector. Read more
fn exp(self) -> VecResult<Self>
Calculates the natural exponential for every vector element. Read more
fn log(self, base: f64) -> VecResult<Self>
Calculates the logarithm to the given base for every vector element. Read more
fn sin(self) -> VecResult<Self>
Calculates the sine of each element in radians. Read more
fn cos(self) -> VecResult<Self>
Calculates the cosine of each element in radians. Read more
fn tan(self) -> VecResult<Self>
Calculates the tangent of each element in radians.
fn asin(self) -> VecResult<Self>
Calculates the principal value of the inverse sine of each element in radians.
fn acos(self) -> VecResult<Self>
Calculates the principal value of the inverse cosine of each element in radians.
fn atan(self) -> VecResult<Self>
Calculates the principal value of the inverse tangent of each element in radians.
fn sinh(self) -> VecResult<Self>
Calculates the hyperbolic sine each element in radians.
fn cosh(self) -> VecResult<Self>
Calculates the hyperbolic cosine each element in radians.
fn tanh(self) -> VecResult<Self>
Calculates the hyperbolic tangent each element in radians.
fn asinh(self) -> VecResult<Self>
Calculates the principal value of the inverse hyperbolic sine of each element in radians.
fn acosh(self) -> VecResult<Self>
Calculates the principal value of the inverse hyperbolic cosine of each element in radians.
fn atanh(self) -> VecResult<Self>
Calculates the principal value of the inverse hyperbolic tangent of each element in radians.
fn swap_halves(self) -> VecResult<Self>
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. Read more
fn expf(self, base: f64) -> VecResult<Self>
Calculates the exponential to the given base for every vector element. Read more
fn override_data(self, data: &[f64]) -> VecResult<Self>
Overrides the data in the vector with the given data. This may also change the vectors length (however not the allocated length). Read more
fn split_into(&self, targets: &mut [Box<Self>]) -> VoidResult
Splits the vector into several smaller vectors. self.len() must be dividable by targets.len() without a remainder and this condition must be true too targets.len() > 0. # Failures VecResult may report the following ErrorReason members: Read more
fn merge(self, sources: &[Box<Self>]) -> VecResult<Self>
Merges several vectors into self. All vectors must have the same size and at least one vector must be provided. # Failures VecResult may report the following ErrorReason members: Read more
impl RealVectorOps<f32> for RealTimeVector<f32>[src]
type ComplexPartner = ComplexTimeVector<f32>
fn real_offset(self, offset: f32) -> VecResult<Self>
Adds a scalar to the vector. See also OffsetOps. # Example Read more
fn real_scale(self, factor: f32) -> VecResult<Self>
Multiplies the vector with a scalar. See also ScaleOps. # Example Read more
fn abs(self) -> VecResult<Self>
Gets the absolute value of all vector elements. # Example Read more
fn to_complex(self) -> VecResult<Self::ComplexPartner>
Converts the real vector into a complex vector. Read more
fn wrap(self, divisor: f32) -> VecResult<Self>
Each value in the vector is dividable by the divisor and the remainder is stored in the resulting vector. This the same a modulo operation or to phase wrapping. Read more
fn unwrap(self, divisor: f32) -> VecResult<Self>
This function corrects the jumps in the given vector which occur due to wrap or modulo operations. This will undo a wrap operation only if the deltas are smaller than half the divisor. Read more
fn real_dot_product(&self, factor: &Self) -> ScalarResult<f32>
Calculates the dot product of self and factor. Self and factor remain unchanged. See also DotProductOps. # Failures VecResult may report the following ErrorReason members: Read more
fn real_statistics(&self) -> Statistics<f32>
Calculates the statistics of the data contained in the vector. See also StatisticsOps. # Example Read more
fn real_statistics_splitted(&self, len: usize) -> Vec<Statistics<f32>>
Calculates the statistics of the data contained in the vector as if the vector would have been split into len pieces. self.len should be dividable by len without a remainder, but this isn't enforced by the implementation. See also StatisticsOps. # Example Read more
fn map_inplace_real<A, F>(self, argument: A, f: F) -> VecResult<Self> where A: Sync + Copy + Send, F: Fn(f32, usize, A) -> f32 + 'static + Sync
Transforms all vector elements using the function map. # Example Read more
fn map_aggregate_real<A, FMap, FAggr, R>(&self, argument: A, map: FMap, aggregate: FAggr) -> ScalarResult<R> where A: Sync + Copy + Send, FMap: Fn(f32, usize, A) -> R + 'static + Sync, FAggr: Fn(R, R) -> R + 'static + Sync + Send, R: Send
Transforms all vector elements using the function map and then aggregates all the results with aggregate. aggregate must be a commutativity and associativity; that's because there is no guarantee that the numbers will be aggregated in any deterministic order. # Example Read more
impl ScaleOps<f32> for RealTimeVector<f32>[src]
impl OffsetOps<f32> for RealTimeVector<f32>[src]
impl DotProductOps<f32> for RealTimeVector<f32>[src]
fn dot_product(&self, factor: &Self) -> ScalarResult<f32>
Calculates the dot product of self and factor. Self and factor remain unchanged.
impl StatisticsOps<f32> for RealTimeVector<f32>[src]
fn statistics(&self) -> Statistics<f32>
Calculates the statistics of the data contained in the vector. # Example Read more
fn statistics_splitted(&self, len: usize) -> Vec<Statistics<f32>>
Calculates the statistics of the data contained in the vector as if the vector would have been split into len pieces. self.len should be dividable by len without a remainder, but this isn't enforced by the implementation. # Example Read more
impl VectorIter<f32> for RealTimeVector<f32>[src]
fn map_inplace<A, F>(self, argument: A, map: F) -> VecResult<Self> where A: Sync + Copy + Send, F: Fn(f32, usize, A) -> f32 + 'static + Sync
Transforms all vector elements using the function map.
fn map_aggregate<A, FMap, FAggr, R>(&self, argument: A, map: FMap, aggregate: FAggr) -> ScalarResult<R> where A: Sync + Copy + Send, FMap: Fn(f32, usize, A) -> R + 'static + Sync, FAggr: Fn(R, R) -> R + 'static + Sync + Send, R: Send
Transforms all vector elements using the function map and then aggregates all the results with aggregate. aggregate must be a commutativity and associativity; that's because there is no guarantee that the numbers will be aggregated in any deterministic order. Read more
impl RealVectorOps<f64> for RealTimeVector<f64>[src]
type ComplexPartner = ComplexTimeVector<f64>
fn real_offset(self, offset: f64) -> VecResult<Self>
Adds a scalar to the vector. See also OffsetOps. # Example Read more
fn real_scale(self, factor: f64) -> VecResult<Self>
Multiplies the vector with a scalar. See also ScaleOps. # Example Read more
fn abs(self) -> VecResult<Self>
Gets the absolute value of all vector elements. # Example Read more
fn to_complex(self) -> VecResult<Self::ComplexPartner>
Converts the real vector into a complex vector. Read more
fn wrap(self, divisor: f64) -> VecResult<Self>
Each value in the vector is dividable by the divisor and the remainder is stored in the resulting vector. This the same a modulo operation or to phase wrapping. Read more
fn unwrap(self, divisor: f64) -> VecResult<Self>
This function corrects the jumps in the given vector which occur due to wrap or modulo operations. This will undo a wrap operation only if the deltas are smaller than half the divisor. Read more
fn real_dot_product(&self, factor: &Self) -> ScalarResult<f64>
Calculates the dot product of self and factor. Self and factor remain unchanged. See also DotProductOps. # Failures VecResult may report the following ErrorReason members: Read more
fn real_statistics(&self) -> Statistics<f64>
Calculates the statistics of the data contained in the vector. See also StatisticsOps. # Example Read more
fn real_statistics_splitted(&self, len: usize) -> Vec<Statistics<f64>>
Calculates the statistics of the data contained in the vector as if the vector would have been split into len pieces. self.len should be dividable by len without a remainder, but this isn't enforced by the implementation. See also StatisticsOps. # Example Read more
fn map_inplace_real<A, F>(self, argument: A, f: F) -> VecResult<Self> where A: Sync + Copy + Send, F: Fn(f64, usize, A) -> f64 + 'static + Sync
Transforms all vector elements using the function map. # Example Read more
fn map_aggregate_real<A, FMap, FAggr, R>(&self, argument: A, map: FMap, aggregate: FAggr) -> ScalarResult<R> where A: Sync + Copy + Send, FMap: Fn(f64, usize, A) -> R + 'static + Sync, FAggr: Fn(R, R) -> R + 'static + Sync + Send, R: Send
Transforms all vector elements using the function map and then aggregates all the results with aggregate. aggregate must be a commutativity and associativity; that's because there is no guarantee that the numbers will be aggregated in any deterministic order. # Example Read more
impl ScaleOps<f64> for RealTimeVector<f64>[src]
impl OffsetOps<f64> for RealTimeVector<f64>[src]
impl DotProductOps<f64> for RealTimeVector<f64>[src]
fn dot_product(&self, factor: &Self) -> ScalarResult<f64>
Calculates the dot product of self and factor. Self and factor remain unchanged.
impl StatisticsOps<f64> for RealTimeVector<f64>[src]
fn statistics(&self) -> Statistics<f64>
Calculates the statistics of the data contained in the vector. # Example Read more
fn statistics_splitted(&self, len: usize) -> Vec<Statistics<f64>>
Calculates the statistics of the data contained in the vector as if the vector would have been split into len pieces. self.len should be dividable by len without a remainder, but this isn't enforced by the implementation. # Example Read more
impl VectorIter<f64> for RealTimeVector<f64>[src]
fn map_inplace<A, F>(self, argument: A, map: F) -> VecResult<Self> where A: Sync + Copy + Send, F: Fn(f64, usize, A) -> f64 + 'static + Sync
Transforms all vector elements using the function map.
fn map_aggregate<A, FMap, FAggr, R>(&self, argument: A, map: FMap, aggregate: FAggr) -> ScalarResult<R> where A: Sync + Copy + Send, FMap: Fn(f64, usize, A) -> R + 'static + Sync, FAggr: Fn(R, R) -> R + 'static + Sync + Send, R: Send
Transforms all vector elements using the function map and then aggregates all the results with aggregate. aggregate must be a commutativity and associativity; that's because there is no guarantee that the numbers will be aggregated in any deterministic order. Read more