Beyond its causal-inference and survey-statistics surfaces, MORIE exposes a small collection of signal-processing primitives. These are useful for forensic-audio work, biomedical signals, and any analysis that needs spectral or time-frequency methods adjacent to the causal pipeline (e.g.\u00a0inter-incident time series in criminological data).
The R surface is intentionally thin \u2014 the heavy lifting lives in the
Python morie.signal_processing and
morie.homomorphic_deconvolution modules. The R wrappers
cover the most commonly needed primitives.
library(morie)
set.seed(42)
fs <- 1000 # sampling rate (Hz)
t <- seq(0, 1, by = 1 / fs)
sig <- sin(2 * pi * 50 * t) +
0.5 * sin(2 * pi * 120 * t) +
0.3 * rnorm(length(t))
spec <- stats::fft(sig)
n <- length(sig)
freq <- (0:(n / 2 - 1)) * fs / n
mag <- Mod(spec)[1:(n / 2)]
peak_freqs <- freq[order(mag, decreasing = TRUE)[1:5]]
peak_freqs
#> [1] 49.95005 119.88012 120.87912 50.94905 48.95105
The two largest peaks should sit near 50 Hz and 120 Hz, recovering the synthetic signal\u2019s components.
morie.signal_processing module \u2014 with the same RichResult
return convention \u2014 and is documented in the package paper.morie.homomorphic_deconvolution.