Specifications

6.1 Amplitude dependent signal shaping 61
pd grapha
A
pd grapha
B
pd grapha
C
pd grapha
D
s~ A
s~ B
min~
phasor~ 1290
*~ -1
+~ 1
-~ 0.25
*~ 4
s~ C
s~ D
fig 6.9: Another way to make a triangle wave
Squaring and roots
One common function of a signal a is a
2
, another way of writing a × a. A
multiplier is the easies t way to perform squaring. If you connect a signal to
both inlets of a multiplier it is multiplied by itself. The effect of squar ing a
signal is twofold. It’s amplitude is scaled as a function of it’s own amplitude.
Amplitude values that are already high are increased more, while values closer to
zero are increased less. Another result is that the output signal is only positive.
Since a minus times a minus gives a plus there are no squares that are negative.
The reverse of this procedure is to determine a value r which if multiplied by
itself gives the input a. We say r is the squa re root of a. B e c ause finding square
roots is a common DSP operation that requires a number of steps there’s a built
in
sqrt~
object in Pd. Without creating complex (imaginar y) numbers there are
no square roots to negative numbers and so the output of
sqrt~
is zero for these
values. The effect of making the str aight phasor line between 0.0 and 1.0 into
s~ A
s~ B
phasor~ 1290
s~ C
s~ D
*~
phasor~ 1290
sqrt~
*~
osc~ 1290 osc~ 1290
sqrt~
pd grapha
D
pd grapha
C
pd grapha
B
pd grapha
A
fig 6.10: Square roots
a curve is clear in Fig . 6.10 gr aph A, likewise the curve bends the other way fo r
the s quare roo t in g raph B. Remembering that a minus times a minus gives
a plus you can see that whatever the sign of a signal appearing at bo th inlets