/usr/share/SuperCollider/HelpSource/Classes/Median.schelp is in supercollider-common 1:3.8.0~repack-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | class:: Median
summary:: Median filter.
categories:: UGens>Filters>Nonlinear
Description::
Returns the median of the last length input points. This non-linear
filter is good at reducing impulse noise from a signal.
classmethods::
method::ar, kr
argument::length
Number of input points in which to find the median. Must be an
odd number from 1 to 31. If
code::length:: is 1
then Median has no effect.
argument::in
The input signal.
argument::mul
Output will be multiplied by this value.
argument::add
This value will be added to the output.
Examples::
code::
// a signal with impulse noise.
{ Saw.ar(500, 0.1) + Dust2.ar(100, 0.9) }.play;
// after applying median filter
{ Median.ar(3, Saw.ar(500, 0.1) + Dust2.ar(100, 0.9)) }.play;
// The median length can be increased for longer duration noise.
// a signal with longer impulse noise.
{ Saw.ar(500, 0.1) + LPZ1.ar(Dust2.ar(100, 0.9)) }.play;
// length 3 doesn't help here because the impulses are 2 samples long.
{ Median.ar(3, Saw.ar(500, 0.1) + LPZ1.ar(Dust2.ar(100, 0.9))) }.play;
// length 5 does better
{ Median.ar(5, Saw.ar(500, 0.1) + LPZ1.ar(Dust2.ar(100, 0.9))) }.play;
// long Median filters begin chopping off the peaks of the waveform
(
{
x = SinOsc.ar(1000, 0, 0.2);
[x, Median.ar(31, x)]
}.play;
)
// another noise reduction application:
Synth.play({ WhiteNoise.ar(0.1) + SinOsc.ar(800,0,0.1) });
// use Median filter for high frequency noise
Synth.play({ Median.ar(31, WhiteNoise.ar(0.1) + SinOsc.ar(800,0,0.1)) });
(
// use LeakDC for low frequency noise
Synth.play({
LeakDC.ar(Median.ar(31, WhiteNoise.ar(0.1) + SinOsc.ar(800,0,0.1)), 0.9)
});
)
::
|