Main Content

Find Peak Values in a Signal

This example shows how the Peak Finder block analyzes a signal and detects peaks in the signal.

Consider the input vector [9 6 10 3 4 5 0 12]. Set the Peak Finder block parameters to the following values:

  • Peak type(s) to Maxima and Minima.

  • Index base to Zero.

  • Select Output peak indices.

  • Select Output peak values.

  • Maximum number of peaks to find to 5.

  • Clear Ignore peaks within threshold of neighboring values.

This table shows how the Peak Finder block processes the signal vector. The block does not consider the first and the last values of input signal.

[Previous, current, next]Current value if it is an extremumIndex of current value if it is an extremumPolarity of current value if it is an extremum
[9 6 10]610
[6 10 3]1021
[10 3 4]330
[3 4 5]–– –– ––
[4 5 0]551
[5 0 12]060

For this example, the outputs at the block ports are:

  • Cnt –– 5

  • Idx –– [1 2 3 5 6]

  • Val –– [6 10 3 5 0]

  • Pol –– [0 1 0 1 0]

See Also

Related Topics