MnM Modules

From ftm

  • mnm.biqoefs ... Biquad coefficients
  • mnm.biquad ... Biquad filtering
  • mnm.delta ... Inter-frame regression
  • mnm.diag ... Matrix diagonal
  • mnm.dtw ... Dynamic Time Warping
  • mnm.gmmem ... Expectation Maximization for Gaussian Mixture Models
  • mnm.hist ... Histogram
  • mnm.knn ... K-Nearest Neighbour search
  • mnm.lu ... Lower-Upper decomposition
  • mnm.mahalanobis ... Mahalanobis distance
  • mnm.mean ... Mean filtering
  • mnm.meanstd ... Mean and standard deviation
  • mnm.median ... Median filtering
  • mnm.minmax ... Minimum and maximum
  • mnm.moments ... Statistical moments
  • mnm.nmd ... Non-zero Matrix Decomposition
  • mnm.nmf ... Non-zero Matrix Factorization
  • mnm.obsprob ... Obsprob
  • mnm.onepole ... Onepole filtering
  • mnm.qr ... Orthogonal-Right decomposition
  • mnm.stats ... Stats
  • mnm.submat ... Sub-matrix
  • mnm.sum ... Matrix sum
  • mnm.svd ... Singular Value Decomposition
  • mnm.transpose ... Matrix transposition
  • mnm.viterbi ... Viterbi algorithm
  • mnm.xdist2 ... Square of Euclidean distance
  • mnm.xmul ... Matrix multiplication



mnm.biqoefs Biquad coefficients
Calculates biquad coefficients for various filter types.
arguments: none
attributes: mode <'lp'|'lowpass'|'hp'|'highpass'|'bpcskirt'|'resonant'|'bpcpeak'|'bandpass'|'peaking'|'peaknotch'|'notch'|'bs'|'bandstop'|'ap'|'allpass'|'ls'|'lowshelf'|'hs'|'highshelf': type> - filter type [lowpass]
f0 <num: freq> - cutoff or centre frequency (default is half Nyquist frequency)
unit <'nyquist'|'hz'|'hertz': unit> - set unit for freq as ratio to Nyquist frequency or in hz [nyquist]
sr <num: sr> - sample rate for freq in Hertz [44100]
q <num: q> - quality/resonance [1]
qnorm <num: qnorm> - if qnorm = 1, divide q by 1./sqrt(2.) so as to get a monotonic filter response with q = 1. (instead of 1./sqrt(2.), which is the default with qnorm = 0)
gain <num: gain> - linear gain [1]
out <matrix: coeffs> - output biquad coefficients
messages: postdoc - post external doc to console
bang - output coefficients
out <matrix: coeffs> - output biquad coefficients
inlets: none
outlets: 1 <matrix: coeffs> - output biquad coefficients

mnm.biquad Biquad filtering
Calculates biquad filtering over vectors (rows or columns) or stream of values (of any dimension).
arguments: <num: input> [<num: filter>] - init input and filter size
attributes: mode <'df1'|'df2t': struct> - set biquad structure [df1]
dim <'col'|'row'|'auto'|'stream': mode> - set the dimension on which to operate [auto]
out <matrix: values> - output filtered values
outstate <matrix: state> - output state
messages: postdoc - post external doc to console
insize <num: input> [<num: filter>] - init input and filter size
coefs <list: coeffs> - set the biquad coefficients
getstate - get the biquad state
clear - reset the internal state
out <matrix: values> - output filtered values
outstate <matrix: state> - output state
inlets: 1 <matrix: coeffs> - input values
outlets: 1 <matrix: values> - output filtered values
2 <matrix: state> - output state

mnm.delta Inter-frame regression
Calculates derivative of incoming matrices or vectors.
arguments: 1 <num: input> [<num: filter>] - init input size
2 <num: filter>: init filter size
attributes: insize <num: input> - set input size
filtersize <num: filter> - set filter size
inadddel <num: del> - add a delay to the delayed input
norm <bool: normalize> - set normalization mode ([off]
outdelayed <matrix: delayed> - output delayed inputs (in phase with deltas)
out <matrix: delta> - output deltas
outstate <matrix: state> - internal values
messages: postdoc - post external doc to console
clear - clear the memory of inputs
getstate - get the internal weights vector
getnorm - get the normalization factor
getring - get the input ring buffer
getdelay - get the filter delay
outdelayed <matrix: delayed> - output delayed inputs (in phase with deltas)
out <matrix: delta> - output deltas
outstate <matrix: state> - internal values
inlets: 1 <matrix: input> - multiply matrix with given right or left operand
outlets: 1 <matrix: delayed> - output delayed inputs (in phase with deltas)
2 <matrix: delta> - output deltas
3 <matrix: state> - internal values

mnm.diag Matrix diagonal
Returns a copy of the diagonal of the incoming matrix in a vector.The length of the result is the minimum of the dimensions of the input.
arguments: none
attributes: out <vector: diagonal> - output diagonal vector
messages: postdoc - post external doc to console
out <vector: diagonal> - output diagonal vector
inlets: 1 <matrix: input> - input matrix
outlets: 1 <vector: diagonal> - output diagonal vector

mnm.dtw Dynamic Time Warping
Calculates DTW of incoming matrix or vector.
arguments: 1 <matrix: op> - matrix to be used as right operand
attributes: outa <matrix: A> - set A output matrix
outb <matrix: B> - set B output matrix
messages: postdoc - post external doc to console
inlets: 1 <matrix: left> - left hand side matrix operand
2 <matrix: right> - right hand side matrix operand
outlets: 1 <matrix: A> - A output matrix
2 <matrix: B> - B output matrix

mnm.gmmem Expectation Maximization for Gaussian Mixture Models
GMM EM has to be documented.
arguments: 1 <num: num> - number of centers to use
attributes: outcenters <matrix: centers> - centers output matrix
outcov <matrix: covariance> - covariance output matrix
outpriors <matrix: priors> - priors output matrix
mode <diagonal|full|spherical: mode> covariance computation types
criteria <num: criteria> - criteria
ncenters <num: num> - number of centers
messages: postdoc - post external doc to console
inlets: 1 <matrix: input> - matrix of values
outlets: 1 <matrix: centers> - centers output matrix
2 <matrix: covariance> - covariance output matrix
3 <matrix: priors> - priors output matrix

mnm.hist Histogram
Calculates histogram of incoming matrix elements. The input matrix, list or vector element's occurences are counted in the given number of bins in between the min and max value
arguments: 1 <num: num> - number of bins
attributes: out <vector: histogram> - output histogram vector
bpf <matrix: histogram> - output two-column matrix with bin indices and histogram values
norm <'off'|'max'|'sum': normalize> - normalise histogram so that max or sum is 1
messages: postdoc - post external doc to console
out <vector: histogram> - output histogram vector
set_n <num: num> - number of bins
inlets: 1 <matrix: values> - intput matrix or list
outlets: 1 <vector: histogram> - output histogram vector
2 <num: min> - output min data value
3 <num: max> - output max data value

mnm.knn K-Nearest Neighbour search
Find the k nearest neighbours and their distances to the query point in multi-dimensional data using an efficient multidimensional search tree with logarithmic time complexity.
arguments: 1 <num: max k> - max number k of nearest neighbours to search
2 <num: max radius> - max radius of nearest neighbours to search (0 for unlimited)
attributes: setdata <matrix: data> - matrix(N, D) of data
setsigma <matrix: sigma> - matrix(1, D) of sigma = 1/weights
dmode <'orthogonal'|'hyperplane'|'pca': mode> decomposition mode
mmode <'mean'|'middle'|'median'> - pivot calculation mode
sort <bool: switch> - sort output by distance
height <num: height> - given tree height if positive, subtract from maxheight if negative
outdist <vector: distance> - output vector of distances to n <= k nearest neighbours (n x 1)
outind <vector: indices> - data row indices of n <= k nearest neighbours (n x 1)
messages: postdoc - post external doc to console
outdist <vector: distance> - output vector of distances to n <= k nearest neighbours (n x 1)
outind <vector: indices> - data row indices of n <= k nearest neighbours (n x 1)
setk <num: max> - max number k of nearest neighbours to search
setradius <num: max> - max radius of nearest neighbours to search (0 for unlimited)
getmeanvectors <matrix: out> - copy mean vectors for the M tree nodes to copy matrix (M x D) out
getsplitplanes <matrix: out> - copy vectors perpendicular to the hyperplanes splitting the M tree nodes to matrix (M x D) out
getprofile <dict: out> - copy profiling info to given dict and clear
print [<'info'|'r\ aw'|'data'|'compact'|'nodes'|'profile': mode>] - print tree info of varying detail (default: nodes), print and clear profiling info if keyword 'profile' is given
inlets: 1 <vector: x> - query vector to search k-nearest neighbours (1 x D)
2 <matrix: data> - data input matrix (N x D)
3 <vector: sigma> - sigma input matrix (1 x D)
outlets: 1 <vector: distance> - output vector of distances to n <= k nearest neighbours (n x 1)
2 <vector: indices> - data row indices of n <= k nearest neighbours (n x 1)

mnm.lu Lower-Upper decomposition
Calculates LU decomposition of incoming matrix.
arguments: none
attributes: outl <matrix: L> - L output matrix
outu <matrix: U> - U output matrix
outpivot <matrix: pivot> - pivot output matrix
outx <matrix: X> - X output matrix
outdet <matrix: det> - determinant output matrix
messages: postdoc - post external doc to console
determinant - computes determinant of decomposed matrix
solve <matrix: input> - solves system with incoming matrix and decomposed matrix
outl <matrix: L> - L output matrix
outu <matrix: U> - U output matrix
outpivot <matrix: pivot> - pivot output matrix
outx <matrix: X> - X output matrix
outdet <matrix: det> - determinant output matrix
inlets: 1 <matrix: input> - matrix to decompose
outlets: 1 <matrix: L> - L output matrix
2 <matrix: U> - U output matrix
3 <matrix: pivot> - pivot output matrix
4 <matrix: X> - X output matrix
5 <matrix: det> - determinant output matrix

mnm.mahalanobis Mahalanobis distance
Calculates mahalanobis distance of incoming matrices or vectors.
arguments: <matrix: mean> <matrix: covariance> - init mean and covariance
attributes: out <matrix: output> - output mahalanobis distance
messages: postdoc - post external doc to console
set_mu <matrix: mu> - matrix of mean values
set_sigma <matrix: sigma> - matrix of covariance
out <matrix: output> - output mahalanobis distance
inlets: 1 <vector: input> - query vector>
2 <matrix: mu> - mu input matrix
3 <matrix: sigma> - sigma input matrix
outlets: 1 <matrix: output> - output mahalanobis distance

mnm.mean Mean filtering
Calculates mean filtering over vectors (rows or columns) or stream of values (of any dimension).
arguments: <num: input> [<num: filter>] - init input and filter size
attributes: filtersize <num: max> - set the maximum filter size (default is 0 for using the input size)
dim <'col'|'row'|'auto'|'stream': mode> - set the dimension on which to operate [auto]
out <matrix: output> - filtered values
outstate <matrix: state> - output state
messages: postdoc - post external doc to console
insize <num: input> [<num: filter>] - set input and filter size
getstate - get the mean state
clear - reset the internal state
out <matrix: output> - filtered values
outstate <matrix: state> - output state
inlets: 1 <matrix: input> - input values
outlets: 1 <matrix: output> - filtered values
2 <matrix: state> - output state

mnm.meanstd Mean and standard deviation
Calculates the arithmetic mean and standard deviation of each column or row (depending on 'mode' argument) as one row or column vector
arguments: 1 <1|2|'row'|'col': mode switch> - compute over rows or columns [col]
attributes: mode <1|2|'row'|'col': mode switch> - compute over rows or columns [col]
scalar <bool: switch> - output a simple float value (instead of 1 x 1 matrix) for scalar results [on]
outmean <matrix: mean> - mean output vector or value
outstd <matrix: stddev> - standard deviation output vector or value
messages: postdoc - post external doc to console
outmean <matrix: mean> - mean output vector or value
outstd <matrix: stddev> - standard deviation output vector or value
inlets: 1 <matrix: input> - input matrix
outlets: 1 <matrix: mean> - mean output vector or value
2 <matrix: stddev> - standard deviation output vector or value

mnm.median Median filtering
Calculates median filtering over vectors (rows or columns) or stream of values (of any dimension).
arguments: <num: input> [<num: filter>] - init input and filter size
attributes: filtersize <num: filter> - set the maximum filter size (default is 0 for using the input size)
dim <'col'|'row'|'auto'|'stream': mode> - set the dimension on which to operate [auto]
out <matrix: output> - output filtered values
outstate <matrix: output> - output state
messages: postdoc - post external doc to console
insize <num: input> [<num: filter>] - set input and filter size
getstate - get the median state
clear - reset the internal state
out <matrix: output> - output filtered values
outstate <matrix: output> - output state
inlets: 1 <matrix: input> - input values
outlets: 1 <matrix: output> - output filtered values
2 <matrix: output> - output state

mnm.minmax Minimum and maximum
Calculates the min, index of min, max, index of max of each column or row (depending on argument) as one row or column vector
arguments: 1 <1|2|'row'|'col': mode switch> - compute over rows or columns [col]
attributes: mode <1|2|'row'|'col': mode switch> - compute over rows or columns [col]
scalar <bool: switch> - output a simple float value (instead of 1 x 1 matrix) for scalar results [on]
outmin <vector: min> - minimum output vector or value
outargmin <vector: min> - minimum index output vector or value
outmax <vector: max> - maximum output vector or value
outargmax <vector: max> - maximum index output vector or value
messages: postdoc - post external doc to console
outmin <vector: min> - minimum output vector or value
outargmin <vector: min> - minimum index output vector or value
outmax <vector: max> - maximum output vector or value
outargmax <vector: max> - maximum index output vector or value
inlets: 1 <matrix: input> - incoming matrix, vector, or list
outlets: 1 <vector: min> - minimum output vector or value
2 <vector: min> - minimum index output vector or value
3 <vector: max> - maximum output vector or value
4 <vector: max> - maximum index output vector or value

mnm.moments Statistical moments
Calculates moments from first to specified order.
arguments: 1 <num: order> - moments maximum order [1]
attributes: std <bool: switch> - compute the standards moments for orders > 2 [on]
mode <1|2|'row'|'col': mode switch> - compute over rows or columns [col]
out <vector: moments> - output moments vector
outsum <vector: moments> - output sums vector
messages: postdoc - post external doc to console
order <num: order> - set moments maximum order
out <vector: moments> - output moments vector
outsum <vector: moments> - output sums vector
inlets: 1 <vector: input> - input vector
outlets: 1 <vector: moments> - output moments vector
2 <vector: moments> - output sums vector

mnm.nmd Non-zero Matrix Decomposition
Calculates NMD of incoming matrix.
arguments: none
attributes: outh <matrix: H> - H output matrix
criteria <num: criteria> - criteria
sH <num: sH> - sH
itermax <num: itermax> - maximum number of iterations
messages: postdoc - post external doc to console
inlets: 1 <matrix: input> - input matrix
2 <matrix: input> - input matrix
3 <num: L2> - L2
outlets: 1 <matrix: output> - output matrix

mnm.nmf Non-zero Matrix Factorization
Calculates NMF of incoming matrix.
arguments: 1 <num: num> - number of components
attributes: outw <matrix: W> - W output matrix
outh <matrix: H> - H output matrix
criteria <num: criteria> - stopping criteria
rdim <num: num> - number of components
itermax <num: max> - maximum number of iterations
messages: postdoc - post external doc to console
inlets: 1 <matrix: input> - matrix to be decomposed
outlets: 1 <matrix: W> - W output matrix
2 <matrix: H> - H output matrix

mnm.obsprob Obsprob
Obsprob has to be documented.
arguments: none
attributes: none
messages: postdoc - post external doc to console
inlets: 1 <matrix: obs> - input observation frames matrix (D x 1)
2 <matrix: states> - input states matrix
outlets: 1 <matrix: prob> - output log(B) (K x 1)
2 <num> - no description

mnm.onepole Onepole filtering
Calculates onepole filtering (low-pass or high-pass) over vectors (rows or columns) or stream of values (of any dimension).
arguments: <num: input> [<num: filter>] - init input and filter size
attributes: f0 <num: freq> - set the onepole frequency, normalised by the Nyquist frequency (default is 1.)
dim <'col'|'row'|'auto'|'stream': mode> - set the dimension on which to operate [auto]
mode <'lowpass'|'highpass': mode> - filter type [lowpass]
out <matrix: output> - output filtered values
outstate <matrix: state> - output state
messages: postdoc - post external doc to console
getstate - get the onepole state
clear - reset the internal state
insize <num: input> [<num: filter>] - init input and filter size
out <matrix: output> - output filtered values
outstate <matrix: state> - output state
inlets: 1 <matrix: input> - input values
outlets: 1 <matrix: output> - output filtered values
2 <matrix: state> - output state

mnm.qr Orthogonal-Right decomposition
Calculates QR decomposition of incoming matrix.
arguments: none
attributes: outq <matrix: Q> - Q output matrix
outr <matrix: R> - R output matrix
outx <matrix: X> - X output matrix
messages: postdoc - post external doc to console
solve <matrix: input> - solve system with QR decomposition
outq <matrix: Q> - Q output matrix
outr <matrix: R> - R output matrix
outx <matrix: X> - X output matrix
inlets: 1 <matrix: input> - matrix to be decomposed
outlets: 1 <matrix: Q> - Q output matrix
2 <matrix: R> - R output matrix
3 <matrix: X> - X output matrix

mnm.stats Stats
Stats has to be documented.
arguments: <vector: histogram> [<num: low> <num: high>] - set histogram vector and boundaries
attributes: norm <bool: normalize> - switch normalization [off]
messages: postdoc - post external doc to console
bang - output stats
clear - clear histogram
set <vector: histogram> [<num: low> <num: high>] - set histogram vector and boundaries
inlets: 1 <num: value> - data input
outlets: 1 <num: average> - output average
2 <num: stddev> - output standard deviation
3 <num: count> - output count

mnm.submat Sub-matrix
Copies sub-matrix outof incoming matrix.
arguments: <num: begin row> <num: begin col> <num: end row> <num: end col> - start end end indices of sub-matrix
attributes: begin <num: row> <num: col> - start indices of sub-matrix
end <num: row> <num: col> - end indices of sub-matrix
out <matrix: output> - ouput sub-matrix
messages: postdoc - post external doc to console
out <matrix: output> - ouput sub-matrix
inlets: 1 <matrix: input> - input matrix
outlets: 1 <matrix: output> - ouput sub-matrix

mnm.sum Matrix sum
Calculates sum over entire matrix, matrix rows or matrix columns.
arguments: 1 <1|2|'row'|'col': mode switch> - compute over rows or columns [col]
attributes: mode <1|2|'row'|'col': mode switch> - compute over rows or columns [col]
out <vector: sum> - output sum vector
messages: postdoc - post external doc to console
out <vector: sum> - output sum vector
inlets: 1 <matrix: input> - incoming matrix to be summed
outlets: 1 <vector: sum> - output sum vector

mnm.svd Singular Value Decomposition
Calculates SVD of incoming matrix.
arguments: 1 <num: rank> - number of singular values
attributes: mode <'manual'|'auto': mode> - automatically eliminate negligible singular values [manual]
outu <matrix: U> - U output matrix
outs <matrix: S> - S output matrix
outvt <matrix: V'> - V' output matrix (transposed of V)
messages: postdoc - post external doc to console
outu <matrix: U> - U output matrix
outs <matrix: S> - S output matrix
outvt <matrix: V'> - V' output matrix (transposed of V)
inlets: 1 <matrix: input> - matrix to be decomposed by SVD
outlets: 1 <matrix: U> - U output matrix
2 <matrix: S> - S output matrix
3 <matrix: V'> - V' output matrix (transposed of V)

mnm.transpose Matrix transposition
Calculates transposed matrix.
arguments: none
attributes: out <matrix: output> - output transposed matrix
messages: postdoc - post external doc to console
out <matrix: output> - output transposed matrix
inlets: 1 <matrix: input> - matrix to be transposed
outlets: 1 <matrix: output> - output transposed matrix

mnm.viterbi Viterbi algorithm
Calculates Viterbi path of incoming matrices or vectors.
arguments: none
attributes: line <bool: online> - switch online mode on/off [off]
verbose <bool: verbose> - verbose or not [off]
latency <num: latency> - maximum latency (nb of frames)
messages: postdoc - post external doc to console
geta - get state matrix A
getpi - get state matrix Pi
getpsi - get state matrix Psi
locpaths - get locpaths matrix
reinit - input message reinit
bang - decode
inlets: 1 - messages only
2 <matrix: observations> - input observation matrix logB (T x K)
3 <matrix: pi> - input state prior distribution Pi (1 x K)
4 <matrix: A> - input state transition matrix A (K x K)
outlets: 1 <matrix: path> - output decoded best path
2 <matrix: state> - output state matrices

mnm.xdist2 Square of Euclidean distance
Calculates the square of the Euclidean distance between a vector and each line of a matrix.
arguments: <matrix: right> - matrix to be used as right operand
attributes: swap <bool: switch> swap operands
out <matrix: output> - result squared distance matrix
messages: postdoc - post external doc to console
out <matrix: output> - result squared distance matrix
inlets: 1 <matrix: left> - input left operand>
2 <matrix: right> - input right operand>
outlets: 1 <matrix: output> - result squared distance matrix

mnm.xmul Matrix multiplication
Calculates matrix multiplication as in out = left x right.
The left and right operands of the matrix multiplication are given by the respective inlets unless the swap option is enabled.The dimensions of the resulting output matrix are corresponding to the minimum dimensions of the two operators.
arguments: <matrix: op> - set right or (with swap enabled) left matrix multiplication operand
attributes: swap <bool: switch> swap operands
out <matrix: output> - output matrix
messages: postdoc - post external doc to console
out <matrix: output> - output matrix
inlets: 1 <matrix: input> - multiply matrix with given right or left operand
2 <matrix: op> - set right or (with swap enabled) left matrix multiplication operand
outlets: 1 <matrix: output> - output matrix