Utils for PSMs
PressureSensitiveMats.active_sensors — Functionactive_sensors(x, thresh)
Return the indices of sensors whose mean value is greater than thresh.PressureSensitiveMats.active_sfm — Functionactive_sfm(x, n, thresh)Return the indices of sensors with a mean spectral flatness measure, taken in segments of length n, above the threshold in dB.
PressureSensitiveMats.apply2seg — Functionapply2seg(f::Function, x::AbstractMatrix{T} , n::Integer)Convenience function to apply a function f to segments of length n to the matrix x.
PressureSensitiveMats.choose_ref — Functionchoose_ref(x)Return the index of the sensor with the greatest power.
PressureSensitiveMats.moving_stats — Functionmoving_stats(x::AbstractVector{T}, L::Integer)Return moving average and variance of x using a window length L
moving_stats(x::AbstractVector{T}, w::AbstractVector{<:Integer})Return moving average and variance of x using a window lengths w
PressureSensitiveMats.mat_shape — Functionmat_shape(x, n)Reorders the columns of a matrix to be in the proper sensor order.
PressureSensitiveMats.reshape_psm — Functionreshape_psm(psm, n_mats)Takes in a PSM and reshapes it to be in the correct order.
ex. Nx72 -> 9x8xN
ex. Nx24 -> 3x8xN
PressureSensitiveMats.sfm — Functionsfm(x)Returns the spectral flatness measure of a signal.