The threshold command changes data in an array by raising (or lowering) the values to meet a given threshold.
wk= |
|
wk= |
|
wk= |
|
wk= |
|
wk= |
|
threshold([2,3,1,2,5,4,3,7],3) |
|
threshold([2,3,1,2,5,4,3,7],3=a,'>=') |
|
threshold([-2,-3,1,2,5,-4,3,-1],3=0,abs=true) |
|
threshold([-2,-3,1,2,5,-4,3,-1],3=0,'<=',abs=true) |
|
threshold([-120,-11,-3,0,7,27,111,234],[-100,100]) |
|
threshold([-120,-11,-3,0,7,27,111,234],[-100=-inf,100=inf]) |
|
In the following example, a square-like signal is created from a sine wave by clipping sample values.
data:=threshold(3*sin(2*pi*440*soundsec(2)),[-1.0,1.0]):; snd:=createwav(data):; plotwav(snd,range=[1000,2000]) |