FeatureSet method: mul

FeatureSet method: mul

Syntax: <feature set> mul <feature> <featureA> <featureB> [optional flags]

Example: fs mul C A B ;# multiply coefficients one by one

A new feature is created by multiplying each coefficient of two features. The size (number of frames or samples and coefficients) of the source feature must be equal in the default mode (see flag -mode). In the example the new feature C will have the same size as A and B. The features A and B must be of the same type but can be FMatrix as well as SVector.

Optional flags:

-a <f>
Multiply with an additional constant f. C[i][j] = f * A[i][j] * B[i][j] for FMatrix features or c[i] = f * a[i] * b[i] for SVector features.
-div <b>
If b is NOT 0 divide instead of multiply. C[i][j] = f * A[i][j] / B[i][j]. If B[i][j] (or b[i]) are 0 then C[i][j] = 0 (c[i] = + or - MaxShort).
-mode <m>
The mode <m> determines wether the source features must have the same length or not. Default is <m> = 0 which means only features with exactly the same length can be used. <m> = -1 means the created feature will have the minimum of the lengths of the source features, <m> = 1 the maximum. In the latter case the shorter feature will be set to 0 if no more values are available (and so will be the result).
Related commands: matmul to multiply each frame with a matrix and add to add two features.


maier@ira.uka.de