Wiki

This version (22 Jun 2012 16:03) was approved by William Jahn.The Previously approved version (21 Jun 2012 20:58) is available.Diff

Value Cross Detection

Click here to return to the Basic DSP page


The Value Cross Detection outputs a pulse every time the input signal has crossed the value specified in the cell. As a default this cell acts as a zero-cross detector, but it can compare the signal to any threshold value.

Input Pins

NameFormat [int/dec] - [control/audio]Function Description
Pin 0: Input Signaldec - audioInput Signal to monitor

Output Pins

NameFormat [int/dec] - [control/audio]Function Description
Pin 0: Pulse Outputdecimal - controlPulse output in 5.23 format

GUI Control

GUI Control NameDefault ValueRangeFunction Description
Value Threshold0-15, 15This is the threshold value that the input signal is compared to.

DSP parameter Information

GUI Control NameCompiler NameFunction Description
Value ThresholdCrossValueCrossAlg1When the value threshold is changed, it is written directly to the DSP

Algorithm Description

The Input signal is compared to the Value Threshold. Each time the input signal crosses this value (whether rising or falling) the output of the cell goes high. Otherwise the output of the cell is low. Below is a sample of the algorithm doing zero-cross detection, which is the default state of the block.



Example

In some applications it is useful not just to know when there is a value cross, but also count the number of times that this happens during a specified time. Using the Value-Cross Detection block along with the Pulse Counter, allows the number of value-crosses to be counted. The following image uses a sine tone input, on/off switches, Pulse Counter, Readback cell, and GPIO output.



Algorithm Details

Toolbox PathBasic DSP - Logic - Value Cross Detection
Cores SupportedAD1940
ADAU170x
ADAU144x
ADAU176x
ADAU178x
“Grow Algorithm” Supportedno
“Add Algorithm” Supportedyes - see Algorithm Addition Information
Subroutine/Loop Basedno
Program RAM15*
Data RAM3*
Parameter RAM1*

*Numbers are based on one instance of the algorithm with no additional “add”

Algorithm Addition Information

DescriptionWhen you add an algorithm, a new set of input/output pins are generated, but the control stays the same. The Value Threshold is repeated, but the same value is used for all “adds” of the algorithm
Program RAM Repetition15 per add
Data RAM Repetition3 per add
Parameter RAM Repetition1 per add
resources/tools-software/sigmastudio/toolbox/basicdsp/valuecrossdetection.txt · Last modified: 22 Jun 2012 16:03 by William Jahn