Document toolboxDocument toolbox

PeakFinder

Overview

Find peaks of input data

Discussion

This module finds a number of peaks per audio block as determined by the value of numPeaks. The module outputs the values of the found peaks and has an optional output pin to output at what index the peaks were found. The module will output peaks in descending order, and ignore nearby values as set by minDistanceSpacing. The output pin will have a block size the size of numPeaks with the same number of channels as the input.

Type Definition

typedef struct _ModulePeakFinder { ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure INT32 minDistanceSpacing; // Number of samples to ignore around found peak INT32* histSkip; // Array indicator that indicies should be skipped when peak searching } ModulePeakFinderClass;

Variables

Properties

Name

Type

Usage

isHidden

Default value

Range

Units

minDistanceSpacing

int

parameter

0

1

0:32

 

histSkip

int*

state

1

[32 x 1]

Unrestricted

 

Pins

Input Pins

Name: in

Description: Input Histogram

Data type: float

Channel range: Unrestricted

Block size range: Unrestricted

Sample rate range: Unrestricted

Complex support: Real

Output Pins

Name: out

Description: Peak Values

Data type: float

MATLAB Usage

File Name: peak_finder_module.m

M = peak_finder_module(NAME) Creates a peak finder module Arguments: NAME - name of the module. NUMPEAKS - number of peaks to detect per audio block INDEXPIN - boolean flag if you want an output pin to give you the index of the peaks detected