Component: Level (DSP)

From Flowcode Help
Jump to navigationJump to search


Author Matrix Ltd
Version 1.2 (Release)
Category DSP


Image Level component

Allows for detection and collection of peaks, troughs and averages.

Examples

Here is a basic example of the Level component. The example collects the max, min and average readings from the buffer and displays them on the LCD display.

FC6 Icon.png Level


The values in the buffer are defined using the InputADC component.

DSPLevel.jpg


Min: Minimum (smallest) value read from the buffer.

Max: Maximum (largest) value read from the buffer.

Average: Rolling average calculated from the values inside the buffer.

Downloadable macro reference

ReadPeakTick

Returns the highest value from the last "Decay" number of index locations.

Parameters

This macro has no parameters


Return value

UINT


ReadTrough

Returns the lowest value from the last "Decay" number of buffers.

Parameters

This macro has no parameters


Return value

UINT


ReadAverage

Returns the average from the last "Decay" number of buffers.

Parameters

This macro has no parameters


Return value

UINT


ReadAverageTick

Returns the average from the last "Decay" number of index locations.

Parameters

This macro has no parameters


Return value

UINT


ReadTroughTick

Returns the lowest value from the last "Decay" number of index locations.

Parameters

This macro has no parameters


Return value

UINT


ReadPeak

Returns the highest value from the last "Decay" number of buffers.

Parameters

This macro has no parameters


Return value

UINT


Simulation macro reference

This component does not contain any simulation macros


Property reference

Buffer Manager

This property is of type Fixed list of ints and can be referenced with the variable name buffer_manager.

Reference to DSP system buffer manager component.

Input

This property is of type Fixed list of ints and can be referenced with the variable name input_a.

Buffer assigned to input channel

Decay

This property is of type Signed integer and can be referenced with the variable name decay.

Configures how many buffers or values to allow a record to persist