WT_MagBelow pass coefficients below a magnitude threshold
WT_MagBelow(buffer, threshold = 0.0, startindex = 1)
Zeroes out any coefficients whose magnitude is not below a threshold.
buffer - dwt buffer.
threshold - absolute magnitude threshold for coefficients
startindex - index of coefficient to begin thresholding at. Defaults to 1 to avoid zeroing the maximal lowpass smoothing information before reconstruction, but you can threshold on that too if you set this to 0 (or start at a higher scale).
s.boot;
b = Buffer.alloc(s,1024,1)
(
SynthDef("help-magBelow", { arg out=0;
var in, chain;
in = WhiteNoise.ar(0.2);
//in = SoundIn.ar;
chain = DWT(b, in);
chain = WT_MagBelow(chain, MouseX.kr(0.0,0.6));
//chain.poll;
Out.ar(out, 0.5 * IDWT(chain).dup);
}).play;
)
//noisy
(
SynthDef("help-magBelow", { arg out=0;
var in, chain;
in = SinOsc.ar(SinOsc.kr(SinOsc.kr(0.08, 0, 6, 6.2).squared, 0, 100, 800));
chain = DWT(LocalBuf(1024), in);
chain = WT_MagBelow(chain, MouseX.kr(0,6.0));
Out.ar(out, 0.1 * IDWT(chain).dup);
}).play;
)
b.free;