SignalIndices
Documentation for SignalIndices.
SignalIndices._pairwise_idxSignalIndices.bin_boundsSignalIndices.bin_centerSignalIndices.clip_ndxSignalIndices.clip_ndx_devianceSignalIndices.copy_length_checkSignalIndices.filter_no_collisionsSignalIndices.filtermapSignalIndices.find_closestSignalIndices.find_not_uniqueSignalIndices.glhistSignalIndices.glhist!SignalIndices.moving_sumSignalIndices.moving_sum!SignalIndices.n_ndxSignalIndices.ndx_offsetSignalIndices.ndx_to_tSignalIndices.pairwise_idxSignalIndices.pairwise_idxsSignalIndices.skipoftypeSignalIndices.t_sup_to_ndxSignalIndices.t_to_last_ndxSignalIndices.t_to_ndxSignalIndices.time_intervalSignalIndices.trailing_zeros_idxSignalIndices.window_countsSignalIndices.window_counts
SignalIndices._pairwise_idx — Method
n is the number of elements in the INPUT of pairwise diff
SignalIndices.bin_bounds — Function
Find the indices to select all points in a bin
SignalIndices.bin_center — Function
Find the center index of a bin
SignalIndices.clip_ndx — Function
Clips an index to be within the valid range for an array of length l
SignalIndices.clip_ndx_deviance — Method
clip_ndx but also return deviance
SignalIndices.copy_length_check — Function
copylengthcheck returns true if dest can accept all data from source
SignalIndices.filter_no_collisions — Method
filter_no_collisions(as, bs, coll_rad)Filter elements of as to keep elements that are not within coll_rad of any element in bs. Assumes both are sorted.
SignalIndices.filtermap — Method
filtermap(p::Function, f::Function, xs)Filters the input vector, then maps the remaining values. For each element of xs which predicate function p returns true for, use mapping function f to transform the result.
SignalIndices.find_closest — Function
find_closest(a, target, ...)Find the index of the element in a that minimizes the absolute difference from the target.
SignalIndices.find_not_unique — Method
find_not_unique(a::AbstractArray)Returns the indices of all redundant elements in a. The time a value is seen, it is not considered redundant
SignalIndices.glhist! — Method
glhist!(cnts, xs, r)Histogram, left inclusive. Assumes regular bin size.
SignalIndices.glhist — Method
glhist([::Type{T} = Int,] xs, r) where TLike glhist!.
SignalIndices.moving_sum! — Method
moving_sum!(out, s, nav)Sum s in a sliding window of nav points, placing the result into out. The length of out should be max(length(s) - nav + 1, 0) if nav > 0, or length(s) otherwise.
Does not zero-pad.
SignalIndices.moving_sum — Method
moving_sum(s, nav)Same as moving_sum!, but returns a new array.
SignalIndices.n_ndx — Method
n_ndx(start_idx::T, stop_idx::T) where {T<:Integer}Find the number of indices between start_idx and stop_idx.
SignalIndices.ndx_offset — Method
ndx_offset(start_ndx, npt)Finds the index that will select npt number of elements starting at start_ndx.
If npt is negative, then start_ndx is treated like the end of a range of elements, and the index required to return npt number of elements is returned.
SignalIndices.ndx_to_t — Function
ndx_to_t(i, fs, start_t)Converts an index to its time in a regularly sampled time series.
SignalIndices.pairwise_idx — Method
n_el is the number of elements in the INPUT to pairwise diff
SignalIndices.pairwise_idxs — Method
pairwise_idxs(n::Integer) -> Vector{NTuple{2, Int}}Returns the possible combinations of 1:n indices excluding self-pairs. The first index is always greater than the second, allowing for easy subtraction of ordered lists.
Examples
julia> pairwise_idxs(3)
3-element Vector{Tuple{Int64,Int64}}:
(2, 1)
(3, 1)
(3, 2)SignalIndices.skipoftype — Method
skipoftype(::Type{T}, itr)Return an iterator over the elements in itr skipping values of type T. Use collect to obtain an Array containing the non-T values in itr. Note that even if itr is a multidimensional array, the result will always be a Vector since it is not possible to remove nothings while preserving dimensions of the input.
Examples
julia> sum(SignalIndices.skipoftype(nothing, [1, nothing, 2]))
3
julia> collect(SignalIndices.skipoftype(nothing, [1, nothing, 2]))
2-element Vector{Int64}:
1
2
julia> collect(SignalIndices.skipoftype(nothing, [1 nothing; 2 nothing]))
2-element Vector{Int64}:
1
2SignalIndices.t_sup_to_ndx — Method
t_sup_to_ndx()Converts a time in a regularly sampled time series to the index of the last sample before the specified time.
SignalIndices.t_to_last_ndx — Function
Like ttondx, but returns sample at or before time
SignalIndices.t_to_ndx — Function
t_to_ndx()Converts a time in a regularly sampled time series to its index. Returns the index of the first sample at or after the time specified
SignalIndices.time_interval — Function
Find the time_interval of a regularly sampled time series
SignalIndices.trailing_zeros_idx — Method
trailing_zeros_idx(arr)return last index that is not zero
SignalIndices.window_counts — Method
window_counts in a certain range`
SignalIndices.window_counts — Method
window_counts(ts, window_dur)For each event in ts, count the number of events in ts that are in the range of ts[i] and ts[i] + window_dur. Assumes ts is sorted, and that elements of ts are unique.