| Signal Processing Toolbox | ![]() |
Compute the period of a sequence
Syntax
Description
p returns the integer = seqperiod(x)
p that corresponds to the period of the sequence in a vector x. The period p is computed as the minimum length of a subsequence x(1:p) of x that repeats itself continuously every p samples in x. The length of x does not have to be a multiple of p, so that an incomplete repetition is permitted at the end of x. If the sequence x is not periodic, then p = length(x).
x is a matrix, then seqperiod checks for periodicity along each column of x. The resulting output p is a row vector with the same number of columns as x.
x is a multidimensional array, then seqperiod checks for periodicity along the first nonsingleton dimension of x. In this case:
[p,num] also returns the number = seqperiod(x)
num of repetitions of x(1:p) in x. num might not be an integer.
Examples
x has period 2.
x has period 1.
x is not periodic, so p(3) is just the number of rows of x.
x has period 3, although the last (second) repetition of the periodic sequence is incomplete.
| schurrc | sgolay | ![]() |