changeset 30870:b7826af05108

maint: merge stable to default.
author Rik <rik@octave.org>
date Tue, 29 Mar 2022 16:09:52 -0700
parents 79edd49a5a97 (current diff) 2ec4bc7593cc (diff)
children 1bddc0ddea74
files
diffstat 1 files changed, 29 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/signal/movslice.m	Mon Mar 28 19:52:24 2022 +0200
+++ b/scripts/signal/movslice.m	Tue Mar 29 16:09:52 2022 -0700
@@ -26,12 +26,38 @@
 ## -*- texinfo -*-
 ## @deftypefn  {} {@var{slcidx} =} movslice (@var{N}, @var{wlen})
 ## @deftypefnx {} {[@var{slcidx}, @var{C}, @var{Cpre}, @var{Cpost}, @var{win}] =} movslice (@dots{})
-## Generate indices to slice a vector of length @var{N} in to windows
+## Generate indices to slice a vector of length @var{N} into windows
 ## of length @var{wlen}.
 ##
-## FIXME: Document inputs N, wlen
+## The input @var{N} must be a positive integer.
+##
+## The moving window length input @var{wlen} can either be a scalar not equal
+## to 1 or a 2-element array of integers.  For scalar values, if odd the window
+## is symmetric and includes @w{@code{(@var{wlen} - 1) / 2}} elements on either
+## side of the central element.  If @var{wlen} is even the window is asymmetric
+## and has @w{@code{@var{wlen}/2}} elements to the left of the central element
+## and @w{@code{@var{wlen}/2 - 1}} elements to the right of the central element.
+## When @var{wlen}is a 2-element array , @w{@code{[@var{nb}, @var{na}]}}, the
+## window includes @var{nb} elements to the left of the current element and
+## @var{na} elements to the right of the current element.
 ##
-## FIXME: Document outputs slcidx, C, Cpre, Cpost, win.
+## The output @var{slcidx} is an array of indices of the slices that fit fully
+## within the vector, where each column is an individual slice as the window
+## moves from left to right. The slices have @var{wlen} elements for scalar
+## @var{wlen}, or @w{@code{@var{nb} + @var{na} + 1}} elements for array valued
+## @var{wlen}.
+##
+## Optional output @var{C} is an row vector of window center positions where
+## the window stays fully within the vector.
+##
+## Optional outputs @var{Cpre} and @var{Cpost} contain the vector elements at
+## the start and end of the vector, respectively, that result in the window
+## extending beyond the ends of the vector.
+##
+## Optional output @var{win} is a column vector with the same number of rows
+## as @var{slcidx} that contains the moving window defined as a center
+## relative position stencil.
+##
 ## @seealso{movfun}
 ## @end deftypefn