1 Hilbert : MultiOutUGen {
2 *ar { arg in, mul = 1, add = 0;
3 ^this.multiNew('audio', in).madd(mul, add);
6 init { arg ... theInputs;
8 ^this.initOutputs(2, rate);
12 // class using FFT (with a delay) for better results than the above UGen
13 // buffer should be 2048 or 1024
14 // 2048, better results, more delay
15 // 1024, less delay, little choppier results
20 fft = FFT(buffer, in);
21 fft = PV_PhaseShift90(fft);
22 delay = BufDur.kr(buffer);
23 // return [source, shift90]
24 ^[DelayN.ar(in, delay, delay), IFFT(fft)];
28 // single sideband amplitude modulation, using optimized Hilbert phase differencing network
29 // basically coded by Joe Anderson, except Sean Costello changed the word HilbertIIR.ar
34 arg in, // input signal
35 freq = 0.0, // shift, in cps
36 phase = 0.0, // phase of SSB
40 // freq = freq.asArray;
41 // shifts = Array.fill(freq.size, {arg i;
42 // // multiply by quadrature
43 // // and add together. . .
44 // (Hilbert.ar(in) * SinOsc.ar(freq[i], (phase + [ 0.5*pi, 0.0 ]))).sum});
45 // ^(shifts).madd(mul, add)
46 ^this.multiNew('audio', in, freq, phase).madd(mul, add)