Calculates the mean of a vector
Calculates the mean of a vector
the vector
the offset into the vector
the number of samples to take into account
the average of the len
samples starting at offset off
in vector b
.
Perform cross correlation between two matrices a and b.
Perform cross correlation between two matrices a and b. Because either a
or b
may be static,
the method expects the means and standard deviations of matrices to be passed in.
While a
is considered a full matrix with at least numChannels
rows and at least
numFrames
columns, offset can be given for the b
matrix.
For efficiency reasons, b
may be updated in a rotational manner, thus bFrame + frameLen
may exceed the number of frames in b
. The algorithm automatically takes the modulus
bFrame + frameLen % b.numFrames
as offset when doing the calculations.
the first matrix
the mean of the samples in a
the standard deviation of the samples in a
the number of columns in a
, also the number of columns considered in the correlation
the number of rows in a
, also the number of rows considered in the correlation
the second matrix
the mean of the samples in b
the standard deviation of the samples in b
frame or column offset in b
channel or row offset in b
the cross correlation coefficient
Perform cross correlation between two horizontal halves of a matrix a
.
Perform cross correlation between two horizontal halves of a matrix a
.
For efficiency reasons, a
may be updated in a rotational manner, thus frameOff + halfWinSize
may exceed the number of frames in a
(the algorithm automatically takes the modulus).
the number of channels or rows to process in the matrix
half of the number of frames or columns in the matrix. The algorithm
performs a cross correlation between the first half frame beginning at offset
frameOff
and the second half beginning at frameOff + halfWinSize
(possibly
wrapped around the array boundaries)
the matrix to analyse
the channel or row offset in the matrix
the cross correlation coefficient (sum of cell multiplies, divided by product of variance and matrix size)
Normalizes a matrix with respect to a normalization vector.
Normalizes a matrix with respect to a normalization vector. For each row in the matrix, given
the rows minimum and maximum value through the normalization vector, every cell is offset
by -minimum
and then divided by maximum - minimum
.
provides normalization vector. The outer array must be of size b.length
.
each element of that outer array holds an array of size 2, specifying
minimum and maximum value for the index. The normBuf
argument may be
null
, in which case this method simply returns without any adjustments.
the matrix which is normalized in-place (the values are scaled and overwritten).
a frame of column offset in the matrix b
.
the number of frames or columns to process in the matrix b
.
Calculates the mean and standard deviation of a given matrix
Calculates the mean and standard deviation of a given matrix
the matrix to analyse
0 if the whole matrix is to be considered, otherwise column offset
the number of columns to analyse
0 if the whole matrix is to be considered, otherwise row offset
the number of rows to analyse
the tuple (mean, stddev)