Skip to contents

Convenience pass-through so detection-side callers can stay within the dsp_detection namespace.

Usage

morie_dsp_coherence_spectrum(x, y, fs = 1, nperseg = 256L)

Arguments

x

Numeric vector.

y

Numeric vector.

fs

Sampling frequency (Hz). Default 1.

nperseg

Segment length. Default 256.

Value

Same as morie_dsp_coherence.

References

Rangayyan & Krishnan (2015), Ch. 4 & Ch. 6.

Examples

set.seed(1)
t <- seq(0, 4, by = 1 / 128)
x <- sin(2 * pi * 5 * t) + rnorm(length(t), 0, 0.2)
y <- sin(2 * pi * 5 * t + 0.5) + rnorm(length(t), 0, 0.2)
str(morie_dsp_coherence_spectrum(x, y, fs = 128, nperseg = 128L),
    max.level = 1)
#> List of 2
#>  $ freqs: num [1:65] 0 1 2 3 4 5 6 7 8 9 ...
#>  $ coh  : num [1:65] 0.0959 0.1831 0.2142 0.1173 0.9955 ...