cmake build system: visiblity support for clang
[supercollider.git] / Help / UGens / FFT / PV_Conj.html
blobf74bd2205c11948d51061a9f354989101df8fa7b
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <meta http-equiv="Content-Style-Type" content="text/css">
6 <title></title>
7 <meta name="Generator" content="Cocoa HTML Writer">
8 <meta name="CocoaVersion" content="949.43">
9 <style type="text/css">
10 p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Helvetica}
11 p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px}
12 p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; color: #001bb9}
13 p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
14 p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; color: #0021e7}
15 p.p6 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco}
16 p.p7 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; min-height: 12.0px}
17 p.p8 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #000000}
18 p.p9 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #bf0000}
19 span.s1 {color: #000000}
20 span.s2 {text-decoration: underline}
21 span.s3 {color: #002aba}
22 span.s4 {color: #0000bf}
23 span.s5 {color: #007300}
24 span.Apple-tab-span {white-space:pre}
25 </style>
26 </head>
27 <body>
28 <p class="p1"><b>PV_Conj<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>complex conjugate</b></p>
29 <p class="p2"><br></p>
30 <p class="p3"><span class="s1"><b>Inherits from: </b><a href="../../Core/Object.html"><b>Object</b></a></span><b> : </b><a href="../../Core/Kernel/AbstractFunction.html"><b>AbstractFunction</b></a><b> : </b><a href="../UGen.html"><b>UGen</b></a><b> : </b><a href="../PV_ChainUGen.html"><b>PV_ChainUGen</b></a><b> : </b><a href="PV_MagSquared.html"><b>PV_MagSquared</b></a></p>
31 <p class="p2"><br></p>
32 <p class="p4"><b>PV_Conj.new(chain)</b></p>
33 <p class="p2"><br></p>
34 <p class="p4">Converts the FFT frames to their complex conjugate (i.e. reverses the sign of their imaginary part). This is not usually a useful audio effect in itself, but may be a component of other analysis or transformation processes...</p>
35 <p class="p2"><br></p>
36 <p class="p4"><b>chain</b> - fft chain.</p>
37 <p class="p2"><br></p>
38 <p class="p5"><span class="s1">See also: <a href="FFT Overview.html"><span class="s2">FFT Overview</span></a></span></p>
39 <p class="p2"><br></p>
40 <p class="p6">s.boot;</p>
41 <p class="p7"><br></p>
42 <p class="p6">(</p>
43 <p class="p6">b = <span class="s3">Buffer</span>.alloc(s,2048,1);</p>
44 <p class="p6">c = <span class="s3">Buffer</span>.read(s,"sounds/a11wlk01.wav");</p>
45 <p class="p6">d = <span class="s3">Buffer</span>.alloc(s,2048,1);</p>
46 <p class="p6">)</p>
47 <p class="p7"><br></p>
48 <p class="p6">(</p>
49 <p class="p8"><span class="s4">SynthDef</span>(<span class="s5">\help_pvconj</span>, {<span class="Apple-converted-space">  </span><span class="s4">arg</span> out=0, bufnum=0, soundBufnum=2;</p>
50 <p class="p8"><span class="Apple-tab-span"> </span><span class="s4">var</span> in, chain;</p>
51 <p class="p8"><span class="Apple-tab-span"> </span>in = <span class="s4">PlayBuf</span>.ar(1, soundBufnum, <span class="s4">BufRateScale</span>.kr(soundBufnum), loop: 1);</p>
52 <p class="p8"><span class="Apple-tab-span"> </span>chain = <span class="s4">FFT</span>(bufnum, in);</p>
53 <p class="p8"><span class="Apple-tab-span"> </span>chain = <span class="s4">PV_Conj</span>(chain);</p>
54 <p class="p9"><span class="s1"><span class="Apple-tab-span"> </span></span>// Original is left, conj is right</p>
55 <p class="p8"><span class="Apple-tab-span"> </span><span class="s4">Out</span>.ar(out, 0.3 * [in, <span class="s4">IFFT</span>(chain)]);<span class="Apple-converted-space"> </span></p>
56 <p class="p8">}).play(s,[<span class="s5">\out</span>, 0, <span class="s5">\bufnum</span>, b, <span class="s5">\soundBufnum</span>, c]);</p>
57 <p class="p6">)</p>
58 <p class="p7"><br></p>
59 <p class="p6">(</p>
60 <p class="p8"><span class="s4">SynthDef</span>(<span class="s5">\help_pvconj2</span>, {<span class="Apple-converted-space">  </span><span class="s4">arg</span> out=0, bufnum=0, soundBufnum=2;</p>
61 <p class="p8"><span class="Apple-tab-span"> </span><span class="s4">var</span> in, chainA, chainB;</p>
62 <p class="p8"><span class="Apple-tab-span"> </span>in = <span class="s4">PlayBuf</span>.ar(1, soundBufnum, <span class="s4">BufRateScale</span>.kr(soundBufnum), loop: 1);</p>
63 <p class="p8"><span class="Apple-tab-span"> </span>chainA = <span class="s4">FFT</span>(bufnum, in);</p>
64 <p class="p8"><span class="Apple-tab-span"> </span>chainB = <span class="s4">PV_Copy</span>(chainA, d);</p>
65 <p class="p8"><span class="Apple-tab-span"> </span>chainB = <span class="s4">PV_Conj</span>(chainB);</p>
66 <p class="p9"><span class="s1"><span class="Apple-tab-span"> </span></span>// Now we have the original and conjugate, what happens if we add them?</p>
67 <p class="p8"><span class="Apple-tab-span"> </span><span class="s4">Out</span>.ar(out, 0.3 * (<span class="s4">IFFT</span>(<span class="s4">PV_Add</span>(chainA, chainB)).dup));<span class="Apple-converted-space"> </span></p>
68 <p class="p8">}).play(s,[<span class="s5">\out</span>, 0, <span class="s5">\bufnum</span>, b, <span class="s5">\soundBufnum</span>, c]);</p>
69 <p class="p6">)</p>
70 </body>
71 </html>