Skip to contents

Computes the fault correlation factor between a signal and each of its modes, a normalized inner product without removal of means.

Usage

measureFCF(signal, modes)

Arguments

signal

Finite numeric vector without dim.

modes

Finite numeric matrix with one row per sample of signal and one column per mode. Attributes other than dim do not reach the outputs.

Details

$$\mathrm{FCF}(x, c) = \frac{\sum_n x[n] c[n]}{\sqrt{\sum_n x[n]^2 \sum_n c[n]^2}}.$$ The means are not removed, so the factor differs from a correlation of centered vectors when the inputs have a nonzero mean.

Value

Numeric vector with one factor per mode.

Conditions

A signal or a mode of zero norm stops the function with an error of class xemdZeroEnergy.

Examples

Time <- seq_len(1000) / 1000
Tones <- cbind(cos(2 * pi * 2 * Time), 0.25 * cos(2 * pi * 24 * Time),
               0.0625 * cos(2 * pi * 288 * Time))
measureFCF(signal = rowSums(Tones), modes = Tones)
#> [1] 0.96836405 0.24209101 0.06052275