Native Hamming-windowed averaged periodogram (Welch 1967).
Usage
morie_dsp_psd_welch(x, fs = 1, nperseg = 256L, noverlap = NULL)
Arguments
- x
Numeric vector.
- fs
Sampling frequency (Hz). Default 1.
- nperseg
Segment length. Default 256.
- noverlap
Overlap in samples. Default nperseg %/% 2.
Value
List with freqs and psd.
References
Rangayyan & Krishnan (2015), Ch. 6, sec. 6.4;
Welch (1967).
Examples
fs <- 1024; t <- seq.int(0, 2047) / fs
x <- cos(2 * pi * 50 * t)
out <- morie_dsp_psd_welch(x, fs = fs, nperseg = 256L)
out$freqs[which.max(out$psd)]
#> [1] 52