SignalProcessing - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Science and Engineering : Signal Processing : Conversions : SignalProcessing/Threshold

SignalProcessing

  

Threshold

  

perform thresholding operations on an array of samples

 

Calling Sequence

Parameters

Options

Description

Thread Safety

Examples

Compatibility

Calling Sequence

Threshold(A, level)

Parameters

A

-

Array of (real or complex) numeric values; the signal

level

-

realcons or [realcons, realcons], threshold value(s)

Options

• 

container : Array, predefined Array for holding results

• 

comparison : lessthan, greaterthan, or lessgreater; type of comparison

• 

inplace : truefalse, specifies that output should overwrite input

• 

value : realcons or [realcons, realcons], alternative values to replace level values

Description

• 

The Threshold command performs thresholding operations on samples, which means retaining or discarding data points that do not meet some kind of minimality criterion.

• 

If the comparison option is lessthan (the default), then "less-than" thresholding is done on the Array A and the result, an Array B having the same length and datatype, is returned. The threshold is determined by the value of the parameter level as follows for real data.

Bk=AklevelAklevelotherwise

• 

For a complex Array A, the value of the level parameter must be real and non-negative. In this case, the formula governing the thresholding function is given by

Bk=AklevelAkAk<levelAkotherwise

• 

If the comparison option is greaterthan, then "greater-than" thresholding is done on the Array A. This is similar to the process described for comparison=lessthan, except that the less-than symbol is replaced by the greater-than symbol in the definitions shown above.

• 

If the absolutevalue option is set to true then thresholding is done on absolute values. The formula in this case, with comparison=lessthan, is shown below. With comparison=greaterthan, the inequality Ak<level is replaced by level<Ak. Note that this option works with real data only.

Bk=level0AkandAk<levellevelAk<0andAk<levelAkotherwise

• 

The value option allows you to specify an alternative real value to place in the output Array instead of level, as shown in the formulae below, with comparison=lessthan:

Bk=valueAk<levelAkotherwise

  

for real Arrays, and

Bk=valueAk<levelAkotherwise

  

for complex Arrays.

• 

The value option also works with comparison=greaterthan, and in this case, the inequalities in the formulae above are reversed. In addition, the comparison option  can also take the lessgreater value, where both "less-than" and "greater-than" conditions are used. In this case, the level parameter and the value option should each be a list of two real values, and level[1] must be less than level[2].

• 

By default, the value option is equal to level. Values in the Array A that are less than level[1] are set to value[1] in B, while those values in A that are greater than level[2] are set to value[2] in B. The precise formula used is

Bk=value[1]Ak<level[1]value[2]level[2]<AkAkotherwise

• 

Before the code performing the computation runs, Maple converts A to a hardware datatype, first attempting float[8] and subsequently complex[8], unless it already has one of these datatypes. For this reason, it is most efficient if A has one of these datatypes beforehand.

• 

If the container=C option is provided, then the results are put into C and C is returned. With this option, no additional memory is allocated to store the result. The container must be an Array having datatype and size equal to those of A.

• 

If the inplace or inplace=true option is provided, then A is overwritten with the results. In this case, the container option is ignored. Furthermore, A must have one of the datatypes float[8] and complex[8].

Thread Safety

• 

The SignalProcessing[Threshold] command is thread-safe as of Maple 17.

• 

For more information on thread safety, see index/threadsafe.

Examples

withSignalProcessing&colon;

aGenerateUniform10&comma;1&comma;1

a:=0.7852184921503080.5884139649570000.9931658226996680.9215782885439710.03878017095848920.01360579254105690.2107569728977980.7496002158150090.1389663578011100.212285134010017

(1)

Thresholda&comma;0.2

0.2000000000000000.5884139649570000.2000000000000000.9215782885439710.2000000000000000.2000000000000000.2000000000000000.7496002158150090.2000000000000000.212285134010017

(2)

Thresholda&comma;0.2&comma;&apos;absolutevalue&apos;

0.7852184921503080.5884139649570000.9931658226996680.9215782885439710.2000000000000000.2000000000000000.2107569728977980.7496002158150090.2000000000000000.212285134010017

(3)

Thresholda&comma;0.2&comma;&apos;comparison&apos;&equals;&apos;greaterthan&apos;

0.7852184921503080.2000000000000000.9931658226996680.2000000000000000.03878017095848920.01360579254105690.2107569728977980.2000000000000000.1389663578011100.200000000000000

(4)

Thresholda&comma;0.2&comma;&apos;value&apos;&equals;&pi;

3.141592654000000.5884139649570003.141592654000000.9215782885439713.141592654000003.141592654000003.141592654000000.7496002158150093.141592654000000.212285134010017

(5)

Thresholda&comma;0.3&comma;0.2&comma;&apos;comparison&apos;&equals;&apos;lessgreater&apos;

0.3000000000000000.2000000000000000.3000000000000000.2000000000000000.03878017095848920.01360579254105690.2107569728977980.2000000000000000.1389663578011100.200000000000000

(6)

Thresholda&comma;0.3&comma;0.2

0.3000000000000000.2000000000000000.3000000000000000.2000000000000000.03878017095848920.01360579254105690.2107569728977980.2000000000000000.1389663578011100.200000000000000

(7)

Thresholda&comma;0.3&comma;0.2&comma;&apos;value&apos;&equals;&pi;&comma;&pi;

3.141592654000003.141592654000003.141592654000003.141592654000000.03878017095848920.01360579254105690.2107569728977983.141592654000000.1389663578011103.14159265400000

(8)

Compatibility

• 

The SignalProcessing[Threshold] command was introduced in Maple 17.

• 

For more information on Maple 17 changes, see Updates in Maple 17.

See Also

SignalProcessing

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam