SignalProcessing
Threshold
perform thresholding operations on an array of samples
Calling Sequence
Parameters
Options
Description
Thread Safety
Examples
Compatibility
Threshold(A, level)
A
-
Array of (real or complex) numeric values; the signal
level
realcons or [realcons, realcons], threshold value(s)
absolutevalue : truefalse, specifies whether or not to use absolute values when thresholding
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
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=Aklevel≤Aklevelotherwise
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=Ak⁢levelAkAk<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. The default value is false.
Bk=level0≤AkandAk<level−levelAk<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
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].
The SignalProcessing[Threshold] command is thread-safe as of Maple 17.
For more information on thread safety, see index/threadsafe.
with⁡SignalProcessing:
a≔GenerateUniform⁡10,−1,1
a≔0.9958675736749190.4083375294118190.167610888327636−0.2468588373222460.432866472071836−0.4399798582161470.4329013102693530.481379433115581−0.4776970633728260.0288390346482901
Threshold⁡a,0.2
0.9958675736749190.4083375294118190.2000000000000000.2000000000000000.4328664720718360.2000000000000000.4329013102693530.4813794331155810.2000000000000000.200000000000000
Threshold⁡a,0.2,absolutevalue
0.9958675736749190.4083375294118190.200000000000000−0.2468588373222460.432866472071836−0.4399798582161470.4329013102693530.481379433115581−0.4776970633728260.200000000000000
Threshold⁡a,0.2,comparison=greaterthan
0.2000000000000000.2000000000000000.167610888327636−0.2468588373222460.200000000000000−0.4399798582161470.2000000000000000.200000000000000−0.4776970633728260.0288390346482901
Threshold⁡a,0.2,value=π
0.9958675736749190.4083375294118193.141592654000003.141592654000000.4328664720718363.141592654000000.4329013102693530.4813794331155813.141592654000003.14159265400000
Threshold⁡a,−0.3,0.2,comparison=lessgreater
0.2000000000000000.2000000000000000.167610888327636−0.2468588373222460.200000000000000−0.3000000000000000.2000000000000000.200000000000000−0.3000000000000000.0288390346482901
Threshold⁡a,−0.3,0.2
Threshold⁡a,−0.3,0.2,value=−π,π
3.141592654000003.141592654000000.167610888327636−0.2468588373222463.14159265400000−3.141592654000003.141592654000003.14159265400000−3.141592654000000.0288390346482901
The SignalProcessing[Threshold] command was introduced in Maple 17.
For more information on Maple 17 changes, see Updates in Maple 17.
See Also
Download Help Document