Struct basic_dsp::matrix::MatrixMxN

source ·
pub struct MatrixMxN<V, S, T>
where T: RealNumber, S: ToSlice<T>, V: Vector<T>,
{ /* private fields */ }
Expand description

A matrix which can hold 1 to N vectors.

Trait Implementations§

source§

impl<S, V, T> ApproximatedOps<T> for MatrixMxN<V, S, T>
where S: ToSlice<T>, V: Vector<T> + ApproximatedOps<T>, T: RealNumber,

source§

fn ln_approx(&mut self)

Computes the principal value approximation of natural logarithm of every element in the vector. Read more
source§

fn exp_approx(&mut self)

Calculates the natural exponential approximation for every vector element. Read more
source§

fn sin_approx(&mut self)

Calculates the sine approximation of each element in radians. Read more
source§

fn cos_approx(&mut self)

Calculates the cosine approximation of each element in radians Read more
source§

fn log_approx(&mut self, base: T)

Calculates the approximated logarithm to the given base for every vector element. Read more
source§

fn expf_approx(&mut self, base: T)

Calculates the approximated exponential to the given base for every vector element. Read more
source§

fn powf_approx(&mut self, exponent: T)

Raises every vector element to approximately a floating point power. Read more
source§

impl<V, S, T> ComplexOps<T> for MatrixMxN<V, S, T>
where V: Vector<T> + ComplexOps<T>, S: ToSlice<T>, T: RealNumber,

source§

fn multiply_complex_exponential(&mut self, a: T, b: T)

Multiplies each vector element with exp(j*(a*idx*self.delta() + b)) where a and b are arguments and idx is the index of the data points in the vector ranging from 0 to self.points() - 1. j is the imaginary number and exp the exponential function. Read more
source§

fn conj(&mut self)

Calculates the complex conjugate of the vector. Read more
source§

impl<V, S, T, N, D, O> ComplexToRealGetterOps<O, T, N, D> for MatrixMxN<V, S, T>
where V: Vector<T> + ComplexToRealGetterOps<V, T, N, D> + GetMetaData<T, N, D>, S: ToSlice<T>, T: RealNumber, N: NumberSpace, D: Domain, O: Matrix<V, T> + GetMetaData<T, N, D>,

source§

fn get_real(&self, destination: &mut O)

Copies all real elements into the given vector. Read more
source§

fn get_imag(&self, destination: &mut O)

Copies all imag elements into the given vector. Read more
source§

fn get_magnitude(&self, destination: &mut O)

Copies the absolute value or magnitude of all vector elements into the given target vector. Read more
source§

fn get_magnitude_squared(&self, destination: &mut O)

Copies the absolute value squared or magnitude squared of all vector elements into the given target vector. Read more
source§

fn get_phase(&self, destination: &mut O)

Copies the phase of all elements in [rad] into the given vector. Read more
source§

fn get_real_imag(&self, real: &mut O, imag: &mut O)

Gets the real and imaginary parts and stores them in the given vectors. See also get_phase and get_complex_abs for further information.
source§

fn get_mag_phase(&self, mag: &mut O, phase: &mut O)

Gets the magnitude and phase and stores them in the given vectors. See also get_real and get_imag for further information.
source§

impl<V, S, T, N, D, O> ComplexToRealSetterOps<O, T, N, D> for MatrixMxN<V, S, T>
where V: Vector<T> + ComplexToRealSetterOps<V, T, N, D> + GetMetaData<T, N, D>, S: ToSlice<T>, T: RealNumber, N: NumberSpace, D: Domain, O: Matrix<V, T> + GetMetaData<T, N, D>,

source§

fn set_real_imag(&mut self, real: &O, imag: &O) -> Result<(), ErrorReason>

Overrides the self vectors data with the real and imaginary data in the given vectors. real and imag must have the same size.
source§

fn set_mag_phase(&mut self, mag: &O, phase: &O) -> Result<(), ErrorReason>

Overrides the self vectors data with the magnitude and phase data in the given vectors. Note that self vector will immediately convert the data into a real and imaginary representation of the complex numbers which is its default format. mag and phase must have the same size.
source§

impl<V, S, T> ComplexToRealTransformsOps<T> for MatrixMxN<V, S, T>

source§

fn magnitude(self) -> <MatrixMxN<V, S, T> as ToRealResult>::RealResult

Gets the absolute value, magnitude or norm of all vector elements. Read more
source§

fn magnitude_squared(self) -> <MatrixMxN<V, S, T> as ToRealResult>::RealResult

Gets the square root of the absolute value of all vector elements. Read more
source§

fn to_real(self) -> <MatrixMxN<V, S, T> as ToRealResult>::RealResult

Gets all real elements. Read more
source§

fn to_imag(self) -> <MatrixMxN<V, S, T> as ToRealResult>::RealResult

Gets all imag elements. Read more
source§

fn phase(self) -> <MatrixMxN<V, S, T> as ToRealResult>::RealResult

Gets the phase of all elements in [rad]. Read more
source§

impl<V, S, T> ComplexToRealTransformsOpsBuffered<S, T> for MatrixMxN<V, S, T>

source§

fn magnitude_b<B>( self, buffer: &mut B ) -> <MatrixMxN<V, S, T> as ToRealResult>::RealResult
where B: for<'b> Buffer<'b, S, T>,

Gets the absolute value, magnitude or norm of all vector elements. Read more
source§

fn magnitude_squared_b<B>( self, buffer: &mut B ) -> <MatrixMxN<V, S, T> as ToRealResult>::RealResult
where B: for<'b> Buffer<'b, S, T>,

Gets the square root of the absolute value of all vector elements. Read more
source§

fn to_real_b<B>( self, buffer: &mut B ) -> <MatrixMxN<V, S, T> as ToRealResult>::RealResult
where B: for<'b> Buffer<'b, S, T>,

Gets all real elements. Read more
source§

fn to_imag_b<B>( self, buffer: &mut B ) -> <MatrixMxN<V, S, T> as ToRealResult>::RealResult
where B: for<'b> Buffer<'b, S, T>,

Gets all imag elements. Read more
source§

fn phase_b<B>( self, buffer: &mut B ) -> <MatrixMxN<V, S, T> as ToRealResult>::RealResult
where B: for<'b> Buffer<'b, S, T>,

Gets the phase of all elements in [rad]. Read more
source§

impl<'a, V, S, T> Convolution<'a, S, T, &'a dyn ComplexImpulseResponse<T>> for MatrixMxN<V, S, T>
where V: Vector<T> + Convolution<'a, S, T, &'a dyn ComplexImpulseResponse<T>>, S: ToSliceMut<T>, T: RealNumber,

source§

fn convolve<B>( &mut self, buffer: &mut B, impulse_response: &'a dyn ComplexImpulseResponse<T>, ratio: T, len: usize )
where B: for<'b> Buffer<'b, S, T>,

Convolves self with the convolution function impulse_response. For performance consider to to use FrequencyMultiplication instead of this operation depending on len. Read more
source§

impl<'a, V, S, T> Convolution<'a, S, T, &'a dyn RealImpulseResponse<T>> for MatrixMxN<V, S, T>
where V: Vector<T> + Convolution<'a, S, T, &'a dyn RealImpulseResponse<T>>, S: ToSliceMut<T>, T: RealNumber,

source§

fn convolve<B>( &mut self, buffer: &mut B, impulse_response: &'a dyn RealImpulseResponse<T>, ratio: T, len: usize )
where B: for<'b> Buffer<'b, S, T>,

Convolves self with the convolution function impulse_response. For performance consider to to use FrequencyMultiplication instead of this operation depending on len. Read more
source§

impl<S, T, N, D> ConvolutionOps<DspVec<S, T, N, D>, S, T, N, D> for MatrixMxN<DspVec<S, T, N, D>, S, T>
where S: ToSliceMut<T>, T: RealNumber, N: NumberSpace, D: Domain, DspVec<S, T, N, D>: ConvolutionOps<DspVec<S, T, N, D>, S, T, N, D>,

source§

fn convolve_signal<B>( &mut self, buffer: &mut B, impulse_response: &DspVec<S, T, N, D> ) -> Result<(), ErrorReason>
where B: for<'b> Buffer<'b, S, T>,

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. Read more
source§

impl<'a, S, T, N, D> ConvolutionOps<Vec<&'a Vec<&'a DspVec<S, T, N, D>>>, S, T, N, D> for MatrixMxN<DspVec<S, T, N, D>, S, T>
where S: ToSliceMut<T>, T: RealNumber, N: NumberSpace, D: Domain,

source§

fn convolve_signal<B>( &mut self, buffer: &mut B, impulse_response: &Vec<&Vec<&DspVec<S, T, N, D>>> ) -> Result<(), ErrorReason>
where B: for<'b> Buffer<'b, S, T>,

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. Read more
source§

impl<V, S, T> CrossCorrelationArgumentOps<S, T> for MatrixMxN<V, S, T>

source§

fn prepare_argument<B>( self, buffer: &mut B ) -> <MatrixMxN<V, S, T> as ToFreqResult>::FreqResult
where B: for<'b> Buffer<'b, S, T>,

Prepares an argument to be used for convolution. Preparing an argument includes two steps: Read more
source§

fn prepare_argument_padded<B>( self, buffer: &mut B ) -> <MatrixMxN<V, S, T> as ToFreqResult>::FreqResult
where B: for<'b> Buffer<'b, S, T>,

Prepares an argument to be used for convolution. The argument is zero padded to length of 2 * self.points() - 1 and then the same operations are performed as described for prepare_argument.
source§

impl<S, T, N, D, O, V> CrossCorrelationOps<O, S, T, N, D> for MatrixMxN<V, S, T>
where S: ToSliceMut<T>, T: RealNumber, N: NumberSpace, D: Domain, O: Matrix<V, T> + GetMetaData<T, N, D>, V: CrossCorrelationOps<V, S, T, N, D> + GetMetaData<T, N, D> + Vector<T>,

source§

fn correlate<B>(&mut self, buffer: &mut B, other: &O) -> Result<(), ErrorReason>
where B: for<'b> Buffer<'b, S, T>,

Calculates the correlation between self and other. other needs to be a time vector which went through one of the prepare functions prepare_argument or prepare_argument_padded. See also the trait description for more details.
source§

impl<S, V, T> DiffSumOps for MatrixMxN<V, S, T>
where S: ToSlice<T>, V: Vector<T> + DiffSumOps, T: RealNumber,

source§

fn diff(&mut self)

Calculates the delta of each elements to its previous element. This will decrease the vector length by one point. Read more
source§

fn diff_with_start(&mut self)

Calculates the delta of each elements to its previous element. The first element will remain unchanged. Read more
source§

fn cum_sum(&mut self)

Calculates the cumulative sum of all elements. This operation undoes the diff_with_startoperation. Read more
source§

impl<S, V, T, N, D> DotProductOps<MatrixMxN<V, S, T>, T, T, N, D> for MatrixMxN<V, S, T>
where S: ToSlice<T>, V: Vector<T> + DotProductOps<V, T, T, N, D, Output = Result<T, ErrorReason>> + GetMetaData<T, N, D>, T: RealNumber, N: NumberSpace, D: Domain,

§

type Output = Result<Vec<T>, ErrorReason>

source§

fn dot_product( &self, factor: &MatrixMxN<V, S, T> ) -> Result<Vec<T>, ErrorReason>

Calculates the dot product of self and factor. Self and factor remain unchanged. Read more
source§

impl<S, V, T, N, D> DotProductOps<V, T, T, N, D> for MatrixMxN<V, S, T>
where S: ToSlice<T>, V: Vector<T> + DotProductOps<V, T, T, N, D, Output = Result<T, ErrorReason>> + GetMetaData<T, N, D>, T: RealNumber, N: NumberSpace, D: Domain,

§

type Output = Result<Vec<T>, ErrorReason>

source§

fn dot_product(&self, factor: &V) -> Result<Vec<T>, ErrorReason>

Calculates the dot product of self and factor. Self and factor remain unchanged. Read more
source§

impl<V, S, T, N, D> ElementaryOps<MatrixMxN<V, S, T>, T, N, D> for MatrixMxN<V, S, T>
where V: Vector<T> + ElementaryOps<V, T, N, D> + GetMetaData<T, N, D>, S: ToSlice<T>, T: RealNumber, N: NumberSpace, D: Domain,

source§

fn add(&mut self, summand: &MatrixMxN<V, S, T>) -> Result<(), ErrorReason>

Calculates the sum of self + summand. It consumes self and returns the result. Read more
source§

fn sub(&mut self, summand: &MatrixMxN<V, S, T>) -> Result<(), ErrorReason>

Calculates the difference of self - subtrahend. It consumes self and returns the result. Read more
source§

fn div(&mut self, summand: &MatrixMxN<V, S, T>) -> Result<(), ErrorReason>

Calculates the quotient of self / summand. It consumes self and returns the result. Read more
source§

fn mul(&mut self, summand: &MatrixMxN<V, S, T>) -> Result<(), ErrorReason>

Calculates the product of self * factor. It consumes self and returns the result. Read more
source§

impl<V, S, T, N, D> ElementaryOps<V, T, N, D> for MatrixMxN<V, S, T>
where V: Vector<T> + ElementaryOps<V, T, N, D> + GetMetaData<T, N, D>, S: ToSlice<T>, T: RealNumber, N: NumberSpace, D: Domain,

source§

fn add(&mut self, summand: &V) -> Result<(), ErrorReason>

Calculates the sum of self + summand. It consumes self and returns the result. Read more
source§

fn sub(&mut self, summand: &V) -> Result<(), ErrorReason>

Calculates the difference of self - subtrahend. It consumes self and returns the result. Read more
source§

fn div(&mut self, summand: &V) -> Result<(), ErrorReason>

Calculates the quotient of self / summand. It consumes self and returns the result. Read more
source§

fn mul(&mut self, summand: &V) -> Result<(), ErrorReason>

Calculates the product of self * factor. It consumes self and returns the result. Read more
source§

impl<V, S, T, N, D> ElementaryWrapAroundOps<MatrixMxN<V, S, T>, T, N, D> for MatrixMxN<V, S, T>
where V: Vector<T> + ElementaryWrapAroundOps<V, T, N, D> + GetMetaData<T, N, D>, S: ToSlice<T>, T: RealNumber, N: NumberSpace, D: Domain,

source§

fn add_smaller( &mut self, summand: &MatrixMxN<V, S, T> ) -> Result<(), ErrorReason>

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. Read more
source§

fn sub_smaller( &mut self, summand: &MatrixMxN<V, S, T> ) -> Result<(), ErrorReason>

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. Read more
source§

fn div_smaller( &mut self, summand: &MatrixMxN<V, S, T> ) -> Result<(), ErrorReason>

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. Read more
source§

fn mul_smaller( &mut self, summand: &MatrixMxN<V, S, T> ) -> Result<(), ErrorReason>

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. Read more
source§

impl<V, S, T, N, D> ElementaryWrapAroundOps<V, T, N, D> for MatrixMxN<V, S, T>
where V: Vector<T> + ElementaryWrapAroundOps<V, T, N, D> + GetMetaData<T, N, D>, S: ToSlice<T>, T: RealNumber, N: NumberSpace, D: Domain,

source§

fn add_smaller(&mut self, summand: &V) -> Result<(), ErrorReason>

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. Read more
source§

fn sub_smaller(&mut self, summand: &V) -> Result<(), ErrorReason>

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. Read more
source§

fn div_smaller(&mut self, summand: &V) -> Result<(), ErrorReason>

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. Read more
source§

fn mul_smaller(&mut self, summand: &V) -> Result<(), ErrorReason>

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. Read more
source§

impl<V, S, T> FrequencyDomainOperations<S, T> for MatrixMxN<V, S, T>
where V: Vector<T> + FrequencyDomainOperations<S, T>, S: ToSliceMut<T>, T: RealNumber,

source§

fn mirror<B>(&mut self, buffer: &mut B)
where B: for<'b> Buffer<'b, S, T>,

This function mirrors the spectrum vector to transform a symmetric spectrum into a full spectrum with the DC element at index 0 (no FFT shift/swap halves). Read more
source§

fn fft_shift(&mut self)

Swaps vector halves after a Fourier Transformation.
source§

fn ifft_shift(&mut self)

Swaps vector halves before an Inverse Fourier Transformation.
source§

impl<'a, V, S, T> FrequencyMultiplication<'a, S, T, &'a dyn ComplexFrequencyResponse<T>> for MatrixMxN<V, S, T>
where V: Vector<T> + FrequencyMultiplication<'a, S, T, &'a dyn ComplexFrequencyResponse<T>>, S: ToSliceMut<T>, T: RealNumber,

source§

fn multiply_frequency_response( &mut self, frequency_response: &'a dyn ComplexFrequencyResponse<T>, ratio: T )

Multiplies self with the frequency response function frequency_response. Read more
source§

impl<'a, V, S, T> FrequencyMultiplication<'a, S, T, &'a dyn RealFrequencyResponse<T>> for MatrixMxN<V, S, T>
where V: Vector<T> + FrequencyMultiplication<'a, S, T, &'a dyn RealFrequencyResponse<T>>, S: ToSliceMut<T>, T: RealNumber,

source§

fn multiply_frequency_response( &mut self, frequency_response: &'a dyn RealFrequencyResponse<T>, ratio: T )

Multiplies self with the frequency response function frequency_response. Read more
source§

impl<V, S, T> FrequencyToTimeDomainOperations<S, T> for MatrixMxN<V, S, T>

source§

fn plain_ifft<B>( self, buffer: &mut B ) -> <MatrixMxN<V, S, T> as ToTimeResult>::TimeResult
where B: for<'b> Buffer<'b, S, T>,

Performs an Inverse Fast Fourier Transformation transforming a frequency domain vector into a time domain vector. Read more
source§

fn ifft<B>( self, buffer: &mut B ) -> <MatrixMxN<V, S, T> as ToTimeResult>::TimeResult
where B: for<'b> Buffer<'b, S, T>,

Performs an Inverse Fast Fourier Transformation transforming a frequency domain vector into a time domain vector. Read more
source§

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>,

Performs an Inverse Fast Fourier Transformation transforming a frequency domain vector into a time domain vector and removes the FFT window.
source§

impl<V, S, T> FromMatrix<T> for MatrixMxN<V, S, T>
where T: RealNumber, V: Vector<T>, S: ToSlice<T>,

§

type Output = Vec<V>

Type of the underlying storage of a matrix.
source§

fn get(self) -> (<MatrixMxN<V, S, T> as FromMatrix<T>>::Output, usize)

Gets the underlying matrix and the number of elements which contain valid.
source§

impl<V, S, T, N, D> GetMetaData<T, N, D> for MatrixMxN<V, S, T>
where T: RealNumber, S: ToSlice<T>, V: Vector<T> + GetMetaData<T, N, D>, N: NumberSpace, D: Domain,

source§

fn get_meta_data(&self) -> TypeMetaData<T, N, D>

Gets a copy of the vector meta data. This can be used to create new types with the same meta data.
source§

impl<V, S, T> InterpolationOps<S, T> for MatrixMxN<V, S, T>
where V: Vector<T> + InterpolationOps<S, T>, S: ToSliceMut<T>, T: RealNumber,

source§

fn interpolatef<B>( &mut self, buffer: &mut B, function: &dyn RealImpulseResponse<T>, interpolation_factor: T, delay: T, conv_len: usize )
where B: for<'b> Buffer<'b, S, T>,

Interpolates self with the convolution function function by the real value interpolation_factor. InterpolationOps 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
source§

fn interpolatei<B>( &mut self, buffer: &mut B, function: &dyn RealFrequencyResponse<T>, interpolation_factor: u32 ) -> Result<(), ErrorReason>
where B: for<'b> Buffer<'b, S, T>,

Interpolates self with the convolution function function by the integer value interpolation_factor. InterpolationOps is done in in frequency domain. Read more
source§

fn interpolate<B>( &mut self, buffer: &mut B, function: Option<&dyn RealFrequencyResponse<T>>, dest_points: usize, delay: T ) -> Result<(), ErrorReason>
where B: for<'b> Buffer<'b, S, T>,

Interpolates the signal in frequency domain by padding it with zeros.
source§

fn interpft<B>(&mut self, buffer: &mut B, dest_points: usize)
where B: for<'b> Buffer<'b, S, T>,

Interpolates the signal in frequency domain by padding it with zeros. This function preserves the shape of the signal in frequency domain. Read more
source§

fn decimatei(&mut self, decimation_factor: u32, delay: u32)

Decimates or downsamples self. decimatei is the inverse function to interpolatei.
source§

impl<S, V, T, R> MapAggregateOps<T, R> for MatrixMxN<V, S, T>
where S: ToSlice<T>, V: Vector<T> + MapAggregateOps<T, R, Output = Result<R, ErrorReason>>, T: RealNumber, R: Send,

§

type Output = Result<Vec<R>, ErrorReason>

source§

fn map_aggregate<'a, A, FMap, FAggr>( &self, argument: A, map: &FMap, aggregate: &FAggr ) -> Result<Vec<R>, ErrorReason>
where A: Sync + Copy + Send, FMap: Fn(T, usize, A) -> R + 'a + Sync, FAggr: Fn(R, R) -> R + 'a + 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.
source§

impl<S, V, T> MapInplaceOps<Complex<T>> for MatrixMxN<V, S, T>
where S: ToSlice<T>, V: Vector<T> + MapInplaceOps<Complex<T>>, T: RealNumber,

source§

fn map_inplace<'a, A, F>(&mut self, argument: A, map: &F)
where A: Sync + Copy + Send, F: Fn(Complex<T>, usize, A) -> Complex<T> + 'a + Sync,

Transforms all vector elements using the function map.
source§

impl<S, V, T> MapInplaceOps<T> for MatrixMxN<V, S, T>
where S: ToSlice<T>, V: Vector<T> + MapInplaceOps<T>, T: RealNumber,

source§

fn map_inplace<'a, A, F>(&mut self, argument: A, map: &F)
where A: Sync + Copy + Send, F: Fn(T, usize, A) -> T + 'a + Sync,

Transforms all vector elements using the function map.
source§

impl<V, S, T> Matrix<V, T> for MatrixMxN<V, S, T>
where T: RealNumber, S: ToSlice<T>, V: Vector<T>,

source§

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].
source§

fn set_delta(&mut self, delta: T)

Sets the x-axis delta. If domain is time domain then delta is in [s], in frequency domain delta is in [Hz].
source§

fn row_len(&self) -> usize

The number of valid elements in each row of the matrix. This can be changed with the Resize trait.
source§

fn row_points(&self) -> usize

The number of valid points in a row. If the matrix 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.
source§

fn col_len(&self) -> usize

The number of columns in the matrix.
source§

fn rows(&self) -> &[V]

Gets the rows as vectors.
source§

fn rows_mut(&mut self) -> &mut [V]

Gets the rows as mutable vectors.
source§

impl<V, S, T> MetaData for MatrixMxN<V, S, T>
where T: RealNumber, S: ToSlice<T>, V: Vector<T>,

source§

fn domain(&self) -> DataDomain

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
source§

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
source§

impl<V, S, T> ModuloOps<T> for MatrixMxN<V, S, T>
where V: Vector<T> + ModuloOps<T>, S: ToSlice<T>, T: RealNumber,

source§

fn wrap(&mut self, divisor: T)

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
source§

fn unwrap(&mut self, divisor: T)

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
source§

impl<V, S, T> OffsetOps<Complex<T>> for MatrixMxN<V, S, T>
where V: Vector<T> + OffsetOps<Complex<T>>, S: ToSlice<T>, T: RealNumber,

source§

fn offset(&mut self, offset: Complex<T>)

Adds a scalar to each vector element. Read more
source§

impl<V, S, T> OffsetOps<T> for MatrixMxN<V, S, T>
where V: Vector<T> + OffsetOps<T>, S: ToSlice<T>, T: RealNumber,

source§

fn offset(&mut self, offset: T)

Adds a scalar to each vector element. Read more
source§

impl<S, V, T> PowerOps<T> for MatrixMxN<V, S, T>
where S: ToSlice<T>, V: Vector<T> + PowerOps<T>, T: RealNumber,

source§

fn sqrt(&mut self)

Gets the square root of all vector elements. Read more
source§

fn square(&mut self)

Squares all vector elements. Read more
source§

fn root(&mut self, degree: T)

Calculates the n-th root of every vector element. Read more
source§

fn powf(&mut self, exponent: T)

Raises every vector element to a floating point power. Read more
source§

fn ln(&mut self)

Computes the principal value of natural logarithm of every element in the vector. Read more
source§

fn exp(&mut self)

Calculates the natural exponential for every vector element. Read more
source§

fn log(&mut self, base: T)

Calculates the logarithm to the given base for every vector element. Read more
source§

fn expf(&mut self, base: T)

Calculates the exponential to the given base for every vector element. Read more
source§

impl<S, V, T, N, D> PreciseDotProductOps<MatrixMxN<V, S, T>, T, T, N, D> for MatrixMxN<V, S, T>
where S: ToSlice<T>, V: Vector<T> + PreciseDotProductOps<V, T, T, N, D, Output = Result<T, ErrorReason>> + GetMetaData<T, N, D>, T: RealNumber, N: NumberSpace, D: Domain,

§

type Output = Result<Vec<T>, ErrorReason>

source§

fn dot_product_prec( &self, factor: &MatrixMxN<V, S, T> ) -> Result<Vec<T>, ErrorReason>

Calculates the dot product of self and factor using a more precise but slower algorithm. Self and factor remain unchanged. Read more
source§

impl<S, V, T, N, D> PreciseDotProductOps<V, T, T, N, D> for MatrixMxN<V, S, T>
where S: ToSlice<T>, V: Vector<T> + PreciseDotProductOps<V, T, T, N, D, Output = Result<T, ErrorReason>> + GetMetaData<T, N, D>, T: RealNumber, N: NumberSpace, D: Domain,

§

type Output = Result<Vec<T>, ErrorReason>

source§

fn dot_product_prec(&self, factor: &V) -> Result<Vec<T>, ErrorReason>

Calculates the dot product of self and factor using a more precise but slower algorithm. Self and factor remain unchanged. Read more
source§

impl<S, V, T> PreciseStatisticsOps<T> for MatrixMxN<V, S, T>
where S: ToSlice<T>, V: Vector<T> + PreciseStatisticsOps<Statistics<T>, Result = Statistics<T>>, T: RealNumber,

§

type Result = Vec<Statistics<T>>

source§

fn statistics_prec(&self) -> Vec<Statistics<T>>

Calculates the statistics of the data contained in the vector using a more precise but slower algorithm. Read more
source§

impl<S, V, T> PreciseStatisticsSplitOps<T> for MatrixMxN<V, S, T>
where S: ToSlice<T>, V: Vector<T> + PreciseStatisticsSplitOps<Statistics<T>, Result = ArrayVec<Statistics<T>, basic_dsp_vector::::vector_types::general::statistics::StatsVec::{constant#0}>>, T: RealNumber,

§

type Result = Vec<ArrayVec<Statistics<T>, basic_dsp_vector::::vector_types::general::statistics::StatsVec::{constant#0}>>

source§

fn statistics_split_prec( &self, len: usize ) -> Result<Vec<ArrayVec<Statistics<T>, basic_dsp_vector::::vector_types::general::statistics::StatsVec::{constant#0}>>, ErrorReason>

Calculates the statistics of the data contained in the vector as if the vector would have been split into len pieces using a more precise but slower algorithm. self.len should be dividable by len without a remainder, but this isn’t enforced by the implementation. For implementation reasons len <= 16 must be true. Read more
source§

impl<S, V, T, O> PreciseSumOps<Vec<O>> for MatrixMxN<V, S, T>
where S: ToSlice<T>, V: Vector<T> + PreciseSumOps<O>, T: RealNumber, O: RealNumber,

source§

fn sum_prec(&self) -> Vec<O>

Calculates the sum of the data contained in the vector using a more precise but slower algorithm. Read more
source§

fn sum_sq_prec(&self) -> Vec<O>

Calculates the sum of the squared data contained in the vector using a more precise but slower algorithm. Read more
source§

impl<V, S, T> RealInterpolationOps<S, T> for MatrixMxN<V, S, T>
where V: Vector<T> + RealInterpolationOps<S, T>, S: ToSliceMut<T>, T: RealNumber,

source§

fn interpolate_hermite<B>( &mut self, buffer: &mut B, interpolation_factor: T, delay: T )
where B: for<'b> Buffer<'b, S, T>,

Piecewise cubic hermite interpolation between samples.
source§

fn interpolate_lin<B>( &mut self, buffer: &mut B, interpolation_factor: T, delay: T )
where B: for<'b> Buffer<'b, S, T>,

Linear interpolation between samples.
source§

impl<V, S, T> RealOps for MatrixMxN<V, S, T>
where V: Vector<T> + RealOps, S: ToSlice<T>, T: RealNumber,

source§

fn abs(&mut self)

Gets the absolute value of all vector elements. Read more
source§

impl<V, S, T> RealToComplexTransformsOps<T> for MatrixMxN<V, S, T>

source§

fn to_complex( self ) -> Result<<MatrixMxN<V, S, T> as ToComplexResult>::ComplexResult, (ErrorReason, <MatrixMxN<V, S, T> as ToComplexResult>::ComplexResult)>

Converts the real vector into a complex vector. Read more
source§

impl<V, S, T> RealToComplexTransformsOpsBuffered<S, T> for MatrixMxN<V, S, T>

source§

fn to_complex_b<B>( self, buffer: &mut B ) -> <MatrixMxN<V, S, T> as ToComplexResult>::ComplexResult
where B: for<'b> Buffer<'b, S, T>,

Converts the real vector into a complex vector. The buffer allows this operation to succeed even if the storage type doesn’t allow resizing. Read more
source§

impl<V, O, S, T> RededicateForceOps<MatrixMxN<O, S, T>> for MatrixMxN<V, S, T>
where S: ToSlice<T>, T: RealNumber, V: RededicateForceOps<O> + Vector<T>, O: Vector<T>,

source§

fn rededicate_from_force(origin: MatrixMxN<O, S, T>) -> MatrixMxN<V, S, T>

Make Other a Self without performing any checks.
source§

fn rededicate_with_runtime_data( origin: MatrixMxN<O, S, T>, is_complex: bool, domain: DataDomain ) -> MatrixMxN<V, S, T>

Make Other a Self without performing any checks. Read more
source§

impl<V, S, T> ReorganizeDataOps<T> for MatrixMxN<V, S, T>
where V: Vector<T> + ReorganizeDataOps<T>, S: ToSlice<T>, T: RealNumber,

source§

fn reverse(&mut self)

Reverses the data inside the vector. Read more
source§

fn swap_halves(&mut 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
source§

impl<V, S, T> ResizeOps for MatrixMxN<V, S, T>
where T: RealNumber, S: ToSlice<T>, V: Vector<T>,

source§

fn resize(&mut self, len: usize) -> Result<(), ErrorReason>

Changes self.len(). If self.is_complex() is true then len must be an even number. len > self.alloc_len() is only possible if the underlying storage supports resizing.
source§

impl<V, S, T> ScaleOps<Complex<T>> for MatrixMxN<V, S, T>
where V: Vector<T> + ScaleOps<Complex<T>>, S: ToSlice<T>, T: RealNumber,

source§

fn scale(&mut self, factor: Complex<T>)

Multiplies the vector element with a scalar. Read more
source§

impl<V, S, T> ScaleOps<T> for MatrixMxN<V, S, T>
where V: Vector<T> + ScaleOps<T>, S: ToSlice<T>, T: RealNumber,

source§

fn scale(&mut self, factor: T)

Multiplies the vector element with a scalar. Read more
source§

impl<S, V, T> StatisticsOps<T> for MatrixMxN<V, S, T>
where S: ToSlice<T>, V: Vector<T> + StatisticsOps<Statistics<T>, Result = Statistics<T>>, T: RealNumber,

§

type Result = Vec<Statistics<T>>

source§

fn statistics(&self) -> Vec<Statistics<T>>

Calculates the statistics of the data. Read more
source§

impl<S, V, T> StatisticsSplitOps<T> for MatrixMxN<V, S, T>
where S: ToSlice<T>, V: Vector<T> + StatisticsSplitOps<Statistics<T>, Result = ArrayVec<Statistics<T>, basic_dsp_vector::::vector_types::general::statistics::StatsVec::{constant#0}>>, T: RealNumber,

§

type Result = Vec<ArrayVec<Statistics<T>, basic_dsp_vector::::vector_types::general::statistics::StatsVec::{constant#0}>>

source§

fn statistics_split( &self, len: usize ) -> Result<Vec<ArrayVec<Statistics<T>, basic_dsp_vector::::vector_types::general::statistics::StatsVec::{constant#0}>>, ErrorReason>

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. For implementation reasons len <= 16 must be true. Read more
source§

impl<S, V, T> SumOps<Vec<T>> for MatrixMxN<V, S, T>
where S: ToSlice<T>, V: Vector<T> + SumOps<T>, T: RealNumber,

source§

fn sum(&self) -> Vec<T>

Calculates the sum of the data contained in the vector. Read more
source§

fn sum_sq(&self) -> Vec<T>

Calculates the sum of the squared data contained in the vector. Read more
source§

impl<V, S, T> SymmetricFrequencyToTimeDomainOperations<S, T> for MatrixMxN<V, S, T>

source§

fn plain_sifft<B>( self, buffer: &mut B ) -> Result<<MatrixMxN<V, S, T> as ToRealTimeResult>::RealTimeResult, (ErrorReason, <MatrixMxN<V, S, T> as ToRealTimeResult>::RealTimeResult)>
where B: for<'b> Buffer<'b, S, T>,

Performs a Symmetric Inverse Fast Fourier Transformation under the assumption that self contains half of a symmetric spectrum starting from 0 Hz. This assumption isn’t verified and no error is raised if the spectrum isn’t symmetric. The reason for this is that there is no robust verification possible. Read more
source§

fn sifft<B>( self, buffer: &mut B ) -> Result<<MatrixMxN<V, S, T> as ToRealTimeResult>::RealTimeResult, (ErrorReason, <MatrixMxN<V, S, T> as ToRealTimeResult>::RealTimeResult)>
where B: for<'b> Buffer<'b, S, T>,

Performs a Symmetric Inverse Fast Fourier Transformation under the assumption that self contains half of a symmetric spectrum starting from 0 Hz. This assumption isn’t verified and no error is raised if the spectrum isn’t symmetric. The reason for this is that there is no robust verification possible. Read more
source§

fn windowed_sifft<B>( self, buffer: &mut B, window: &dyn WindowFunction<T> ) -> Result<<MatrixMxN<V, S, T> as ToRealTimeResult>::RealTimeResult, (ErrorReason, <MatrixMxN<V, S, T> as ToRealTimeResult>::RealTimeResult)>
where B: for<'b> Buffer<'b, S, T>,

Performs a Symmetric Inverse Fast Fourier Transformation (SIFFT) and removes the FFT window. The SIFFT is performed under the assumption that self contains half of a symmetric spectrum starting from 0 Hz. This assumption isn’t verified and no error is raised if the spectrum isn’t symmetric. The reason for this is that there is no robust verification possible. Read more
source§

impl<V, S, T> SymmetricTimeToFrequencyDomainOperations<S, T> for MatrixMxN<V, S, T>

source§

fn plain_sfft<B>( self, buffer: &mut B ) -> Result<<MatrixMxN<V, S, T> as ToFreqResult>::FreqResult, (ErrorReason, <MatrixMxN<V, S, T> as ToFreqResult>::FreqResult)>
where B: for<'b> Buffer<'b, S, T>,

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
source§

fn sfft<B>( self, buffer: &mut B ) -> Result<<MatrixMxN<V, S, T> as ToFreqResult>::FreqResult, (ErrorReason, <MatrixMxN<V, S, T> as ToFreqResult>::FreqResult)>
where B: for<'b> Buffer<'b, S, T>,

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
source§

fn windowed_sfft<B>( self, buffer: &mut B, window: &dyn WindowFunction<T> ) -> Result<<MatrixMxN<V, S, T> as ToFreqResult>::FreqResult, (ErrorReason, <MatrixMxN<V, S, T> as ToFreqResult>::FreqResult)>
where B: for<'b> Buffer<'b, S, T>,

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
source§

impl<V, S, T> TimeDomainOperations<S, T> for MatrixMxN<V, S, T>
where V: Vector<T> + TimeDomainOperations<S, T>, S: ToSliceMut<T>, T: RealNumber,

source§

fn apply_window(&mut self, window: &dyn WindowFunction<T>)

Applies a window to the data vector.
source§

fn unapply_window(&mut self, window: &dyn WindowFunction<T>)

Removes a window from the data vector.
source§

impl<V, S, T> TimeToFrequencyDomainOperations<S, T> for MatrixMxN<V, S, T>

source§

fn plain_fft<B>( self, buffer: &mut B ) -> <MatrixMxN<V, S, T> as ToFreqResult>::FreqResult
where B: for<'b> Buffer<'b, S, T>,

Performs a Fast Fourier Transformation transforming a time domain vector into a frequency domain vector. Read more
source§

fn fft<B>( self, buffer: &mut B ) -> <MatrixMxN<V, S, T> as ToFreqResult>::FreqResult
where B: for<'b> Buffer<'b, S, T>,

Performs a Fast Fourier Transformation transforming a time domain vector into a frequency domain vector. Read more
source§

fn windowed_fft<B>( self, buffer: &mut B, window: &dyn WindowFunction<T> ) -> <MatrixMxN<V, S, T> as ToFreqResult>::FreqResult
where B: for<'b> Buffer<'b, S, T>,

Applies a FFT window and performs a Fast Fourier Transformation transforming a time domain vector into a frequency domain vector.
source§

impl<V, S, T> ToComplexResult for MatrixMxN<V, S, T>

source§

impl<V, S, T> ToFreqResult for MatrixMxN<V, S, T>
where V: Vector<T> + ToFreqResult, S: ToSlice<T>, T: RealNumber, <V as ToFreqResult>::FreqResult: Vector<T>,

source§

impl<V, S, T> ToRealResult for MatrixMxN<V, S, T>
where V: Vector<T> + ToRealResult, S: ToSlice<T>, T: RealNumber, <V as ToRealResult>::RealResult: Vector<T>,

source§

impl<V, S, T> ToRealTimeResult for MatrixMxN<V, S, T>

source§

impl<V, S, T> ToTimeResult for MatrixMxN<V, S, T>
where V: Vector<T> + ToTimeResult, S: ToSlice<T>, T: RealNumber, <V as ToTimeResult>::TimeResult: Vector<T>,

§

type TimeResult = MatrixMxN<<V as ToTimeResult>::TimeResult, S, T>

Specifies what the the result is if a type is transformed to time domain.
source§

impl<S, V, T> TrigOps for MatrixMxN<V, S, T>
where S: ToSlice<T>, V: Vector<T> + TrigOps, T: RealNumber,

source§

fn sin(&mut self)

Calculates the sine of each element in radians. Read more
source§

fn cos(&mut self)

Calculates the cosine of each element in radians. Read more
source§

fn tan(&mut self)

Calculates the tangent of each element in radians.
source§

fn asin(&mut self)

Calculates the principal value of the inverse sine of each element in radians.
source§

fn acos(&mut self)

Calculates the principal value of the inverse cosine of each element in radians.
source§

fn atan(&mut self)

Calculates the principal value of the inverse tangent of each element in radians.
source§

fn sinh(&mut self)

Calculates the hyperbolic sine each element in radians.
source§

fn cosh(&mut self)

Calculates the hyperbolic cosine each element in radians.
source§

fn tanh(&mut self)

Calculates the hyperbolic tangent each element in radians.
source§

fn asinh(&mut self)

Calculates the principal value of the inverse hyperbolic sine of each element in radians.
source§

fn acosh(&mut self)

Calculates the principal value of the inverse hyperbolic cosine of each element in radians.
source§

fn atanh(&mut self)

Calculates the principal value of the inverse hyperbolic tangent of each element in radians.

Auto Trait Implementations§

§

impl<V, S, T> Freeze for MatrixMxN<V, S, T>

§

impl<V, S, T> RefUnwindSafe for MatrixMxN<V, S, T>

§

impl<V, S, T> Send for MatrixMxN<V, S, T>
where S: Send, V: Send,

§

impl<V, S, T> Sync for MatrixMxN<V, S, T>
where S: Sync, V: Sync,

§

impl<V, S, T> Unpin for MatrixMxN<V, S, T>
where S: Unpin, T: Unpin, V: Unpin,

§

impl<V, S, T> UnwindSafe for MatrixMxN<V, S, T>
where S: UnwindSafe, T: UnwindSafe, V: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.