casio Casio VZ-1 Adaptive Phase Distortion Synthesis

Page 1
Proc. of the 12th Int. Conference on Digital Audio Effects (DAFx-09), Como, Italy, September 1-4, 2009
=
ADAPTIVE PHASE DISTORTION SYNTHESIS
Victor Lazzarini, Joseph Timoney Jussi Pekonen, Vesa Välimäki
Sound and Music Technology Group
Ireland
Victor.Lazzarini@nuim.ie
JTimoney@cs.nuim.ie
ABSTRACT
This article discusses Phase Distortion synthesis and its applica­tion to arbitrary input signals. The main elements that compose the technique are presented. Its similarities to Phase Modulation are discussed and the equivalence between the two techniques is explored. Two alternative methods of distorting the phase of an arbitrary signal are presented. The first is based on the audio-rate modulation of a first-order allpass filter coefficient. The other method relies on a re-casting of the Phase Modulation equation, which leads to a heterodyned form of waveshaping. The relation­ship of these implementations to the original technique is ex­plored in detail. Complementing the article, a number of exam­ples are discussed, demonstrating the application of the tech­nique as an interesting digital audio effect.
1. INTRODUCTION
Phase Distortion (PD) [1] is a synthesis technique based on the table lookup of a sinusoidal function using a non-linear mapping of a modulo counter (also called a phasor). It was first introduced in the Casio CZ-series of synthesisers [2], where it was used to emulate a typical subtractive synthesis signal flow composed of source-filter controls. This was actually a clever way of disguis­ing what otherwise might have been a less intuitive method of synthesis. In fact, as we will see, PD is effectively a subset of Phase Modulation (PM) synthesis, the usual implementation method of Frequency Modulation (FM) [3] in hardware synthe­sisers [4] such as the Yamaha DX-series [5]. FM was admitedly a non-intuitive synthesis method for musicians, although it was very powerful computationally.
PD has not been extensively explored in the signal process­ing literature. However, it remains possibly an interesting method for many applications, including the design of Virtual Analogue (VA) oscillators. In the present work, we will try to explore its possibilities for adaptive signal processing, in the vein of Adaptive FM (AdFM) [6] and Adaptive SpSB [7]. This paper is organised as follows. We will first sketch out the basic ele­ments of PD and its theoretical foundations. This will be fol­lowed by two proposed methods of phase distortion of arbitrary signals, employing audio-rate coefficient-modulated allpass fil­ters [8][9] and using a heterodyne arrangement [10]. The paper concludes with a discussion of a number of examples using dif­ferent inputs and parameters.
Dept. of Signal Processing and Acoustics
TKK Helsinki University of Technology
Espoo, Finland
Jussi.Pekonen@tkk.fi Vesa.Valimaki@tkk.fi
2. PHASE DISTORTION SYNTHESIS
The principles of PD synthesis as described in its original formu­lation [1] can be formalised as follows. A sinusoidal function with modulo phase φ(t) defined as
))(2cos()( ttx πφ= (1)
can produce a complex harmonic spectrum if its phase is shaped by a non-linear function f(x) as in
)))((2cos()( tftx φπ
(2)
Depending on the shape of f(x), different spectra can be pro­duced. If f(x) is linear, no distortion is effected and we have a pure sinusoidal tone. Thus, PD can be seen as form of phase- shaping, in analogy to the non-linear amplitude distortion method of waveshaping [11]. In its original implementation, PD synthesis used piecewise linear functions of two or more seg­ments to implement the non-linear mapping. Fig. 1 shows one such function, plotted against a linear phase increment. The re­sulting distorted waveshape is depicted in Fig. 2.
Figure 1. Phase distortion function (continuous line),
plotted against linear phase (dots), with d = 0.1.
DAFX-1
Page 2
Proc. of the 12th Int. Conference on Digital Audio Effects (DAFx-09), Como, Italy, September 1-4, 2009
+
φ
x
Figure 2. Phase distortion waveform (continuous line)
plotted against an inverted cosine wave (dots).
However, we can demonstrate that PD is no more than a dis-
guised way of implementing PM, albeit only a subset of it. We can decompose the phaseshaping function f(x) into a linear phase and a modulation term:
)()( xxgxf
= (3)
Now eq. 2 becomes the more familiar PM expression:
π= (4)
))])(()([2cos()( tgttx φ+
So what is the phase modulation function g(x)? This can be
found by subtracting the linear phase term from the phase distor­tion function. The piecewise linear function of fig.1 is defined as:
x
1
⎧ ⎪
d
2
xgx
=+
)(
1
1[
2
,
dx
)(
+
d
)1(
dx
<
dx
>=
],
x
<
1 0h wit
(5)
where d is the point at which the two pieces of the function join together. We can then extract g(x) using eq. 3, which yields:
1
x
d
⎪ ⎪
2
d
)(
=
xg
1
⎪ ⎪
[
d
2
,
<
dx
)1(
x
],
)1(
d
>=
dx
1 0h wit
<
(6)
i.e. a sawtooth wave inflected at d with an amplitude of (0.5 – d).
PD is then characterised as a form of phase-synchronous complex PM. The ratio between carrier and modulator funda­mental frequency is always integral (in this particular case 1) and the modulation index, controlling spectral energy is 2π(0.5 – d), reaching a maximum of
π
in the limit of d 0 (100% sawtooth).
Figure 3. PD spectrum, using sawtooth-shape distortion
of fig.1 (d = 0.1).
Moving the point d (to the left) not only increases the modu-
lation index, but also increases the number of significant compo­nents in the modulating wave. At the limit, this type of Complex PM can be expanded as [12]:
1
)([2cos()(
tts
1
π
+=
)(2sin(
t
πφ
=
k
k
2
n
=
1
n
⎛ ⎜
n
1
π
J
k
n
=
n
1
1
++=
414
n
=
1
n
)))(2sin(
tn
φπ
⎞ ⎟
⎟ ⎠
πφ
+
As it can be seen, there is scope for producing a very wideband spectrum with the technique, possibly with aliasing issues at high fundamentals. However, in a straightforward implementation of PD, d typically will not be too small. The resulting spectrum for d = 0.1 is plotted on fig.3, up to the fiftieth harmonic (this corre­sponds to the waveform and distortion functions of figs.2 and 1, respectively). Of course, when implementing PD in terms of PM, we can use a sawtooth wave liberally, and raise the modulation index above the π threshold, if needed.
Other distortion shapes can be used. For instance, a function with two inflections, instead of one, can produce spectra without even harmonics, similar to a square wave. This is equivalent to implementing PM with a carrier to modulator fundamental fre­quency ratio of 2, since the two inflections are equivalent to halving the period of the modulating function. Other distortion shapes can also be produced by concatenating simpler functions.
Typically, PD can be implemented by using a simple flow­control logic to shape the phase increment of a sinusoidal table lookup oscillator. It is also possible to implement the non-linear phase function by using a table lookup, in manner similar to waveshaping. However, possibly the most efficient method is to use the PM equivalence discussed above. In order to generate time-varying spectra, we can, depending on the implementation method, change the position of the inflection point or points, in-
]))(2sin(
tn
φπφπ
(7)
])1)[(2(sin)2(...
nkt
n
=
1
n
DAFX-2
Page 3
Proc. of the 12th Int. Conference on Digital Audio Effects (DAFx-09), Como, Italy, September 1-4, 2009
(
()(
()()(
)
terpolate between a linearly and non-linearly shaped phase or vary the modulation index.
In any case, all of these methods require the use of a pre­calculated lookup table, which will hold the signal whose phase is distorted (generally a single wave period). In order to apply phase distortion to arbitrary input signals, in analogous fashion to AdFM and related techniques, we will need to find alternative methods of implementation.
3. GENERAL-PURPOSE PHASE DISTORTION
METHODS
We will now investigate two methods for distorting the phase of arbitrary signals. The first of these employs a first-order allpass filter, which is a well-known method for imparting small delays and phase corrections to signals. The second takes advantage of the PD-PM equivalence demonstrated above and a rearrange­ment of the PM equation. Both methods will be shown to be comparable to the original PD formulation, whilst allowing for­more general-purpose applications.
3.1. Allpass filter-based phase distortion
A first-order allpass with the correct properties for a phase dis­tortion application can be implemented by any one of the follow­ing expressions [9]:
)]1()([)1()( = nynxanxny
(8)
or
() () ( )
⎧ ⎨
() () ( )
or
() () ()
⎧ ⎨
() () ( )
where a is the filter coefficient and its transfer function is
()
zH
=
1
For our present purpose, we will be using the implementation of eq.8, as this will be shown to provide better results when the coefficient a is time-varying. The output phase delay for this all­pass filter can be defined as a function of an input frequency [13]:
1
()
ωωφ
+=
We can vary the coefficient a at an audio-range rate with a modulating function m(t). This will yield a time-varying phase shift, which can now be put in terms of two variables (frequency and time):
tan2
⎜ ⎝
+=
1
nawnxnw
(9)
+=
1
nwnawny
+=
naynxnw
(10)
+=
1nwnaxny
1
za
+
(11)
1
az
()
ω
sin
a
a
cos1
(12)
()
ω
ω
as
() ( )
tm
1
()
One of the notable aspects of eq.13 is that it shows that the relationship between the time-varying phase and the modulation function is non-linear. In addition, it has been shown that the modulating signal needs to be placed in the range of zero to one to avoid dispersive effects associated with allpass filters, as well as to keep the filter stable [8].
As we are interested in phase distortion, we need to find a suitable modulation function for the allpass filter coefficient that will induce desired phase deviations in its input. To determine an expression for the modulation m(t) from the phase devia-
φ(ω
,t) it is possible to rearrange eq.11 and use a simplifying
tion approximation for the tan(x) function (for small x) [14]:
Experiments have indicated that the approximation in eq.14 does not lead to significant differences in the output signal. This will now provide an expression for the time-varying modulation function given a time-varying phase shift
Using eq.15, it is then possible to emulate the Phase Distor­tion technique by modulating an allpass filter coefficient. To ap­ply the modulation function g(x) defined in eq.6 to eq.15 some preliminary processing must be first carried out. The modulation function, when applied in eq.4, lies between 0 and 2π(0.5 − d), while the phase deviation for the allpass filter lies between −ω and −π. We will shift and scale it to bring it to the appropriate range:
Figure 4 shows the coefficient modulation function obtained using eq.16, with d = 0.1. The figure also shows that there are a number of significant dips in the modulation waveform. These correspond to the points of maximum phase distortion. In [9] an expression was used to smooth these dips as they caused unde­sired spikes in the output signal. However, by using a different filter implementation, namely that of eq.8, we are able to avoid these spikes almost completely. In fig.5, we plot the PD wave­form generated from a sinusoidal input to coefficient-modulated allpass filters implemented using eqs.9 and 10. The latter is iden­tified as the one used in [8] and [9].
A plot of the output of the allpass filter PD implementation using eq. 8 is given on fig.6, which shows a close approximation of the original PD waveform (shown in a dashed line). It will not match it exactly because the instantaneous frequency of the all­pass filter output must be dynamic unlike that of PD signal, as explained in [9]. As it can be clearly noted, the spikes of fig.5 are completely removed.
ωωφ
t (13)
+=
,
) ()()
tan
2
()
=
tm (15)
()
ωφ
= d
t 21
,
tan2,
() ( )
tm
+ tt
⎞ ⎟
⎟ ⎠
() ( )()()
()
,
=
2
ωωφ
,+−+
t
t
ωπ
dtg
21
π
d
21
ω
sin
⎟ ⎟
ω
cos1
ωωφωωφ
+
(14)
)
ωωωφω
cos,sin2
()
(16)
ωπ
DAFX-3
Page 4
Proc. of the 12th Int. Conference on Digital Audio Effects (DAFx-09), Como, Italy, September 1-4, 2009
φφπ
=
Figure 4. Coefficient modulation function for PD.
Figure 5. Plots of PD waveforms corresponding to filters implemented with eqs. 9 (solid line) and 10 (dashed line).
The actual shape of the phase distorted waveform at the out­put of the allpass filter depends on the phase of the input signal. In fig.6, in order to match the shape of a PD waveform based on a cosine wave, we adjust the input phase by (0.5 – d)2π. The main reason for the difference between the original PD and all­pass PD appears to be related to transient effects related to the use of time-varying coefficients, which are not accounted in the fixed-coefficient transfer function of eq.11. Moreover, these ef­fects clearly depend on the implementation used (eqs. 8, 9 or 10).
In fig.7, a spectral plot of the smoother allpass PD waveform from fig.6 is compared to the one generated by the original PD method with the same parameters (d = 0.1). It can be seen that the output of the allpass filter is quite close to the original PD method up to harmonic 11. However, it has a richer high­frequency content in contrast to the spectrum of the original PD waveform which is much sparser in the higher frequencies, with some missing components, as previously noted in [1]. In the fol­lowing section, in place of the cosine input we will be employing input signals with richer spectra, such as instrumental tones of various instruments, as will be discussed later in this article.
Figure 6. Allpass PD implemented according to eq.8 (solid line), plotted against the original PD waveform (dashed line).
Figure 7. Spectral plot of allpass PD (star markers) and
original PD (dot markers).
3.2. Heterodyne phase distortion
A second alternative method for general-purpose phase distortion is provided by a heterodyne formula for PM or FM, as already noted in [7] and [11]. Starting with the PD-equivalent PM for­mula of eq.4, we can use the relevant trigonometric identity to re-cast it into a sum of ring-modulated signals, as in:
))])(()([2cos()(
tgttx
+
))((2sin())(2sin(
tgt
=
The advantage of this formulation is that we can separate the carrier signal cleanly from the modulator, thus allowing us to substitute the former by any arbitrary input. PD becomes a het­erodyned form of waveshaping (using sinusoidal transfer func­tions). In order to achieve the correct result, it is essential that both carrier and modulator in the two terms have the correct
φππφ
(17)
))((2cos())(2cos(
tgt
φππφ
DAFX-4
Page 5
Proc. of the 12th Int. Conference on Digital Audio Effects (DAFx-09), Como, Italy, September 1-4, 2009
Figure 8. Heterodyne PD signal.
Figure 9. General-purpose PD using the heterodyne
method.
phase offsets (relative to each other). With that in place, we can reproduce the original PD waveforms faithfully. Fig. 8 output of eq. 17 using the same parameters employed to produce eq. 2.
Now, turning our attention to substituting the carrier signal with an arbitrary input, we will only need to preserve the 90 de­gree offset between the carriers in the two terms of eq. 17. As these actually make up an analytic signal, we can perform a Hil­bert Transform [15] in an input signal to place it in quadrature. A flowchart for the complete algorithm is provided in fig.9.
It is clear from the present discussion that the heterodyne method presents a faithful realisation of the original PD algorithm, whereas the allpass implementation of the previous section does not. This also indicates that the latter method will produce a spectrally richer output than the former for the same parameters. Thus both techniques offer advantages and disadvantages, as well as different timbral characteristics that can be harnessed for the designed digital audio effects.
plots the
Figure 10. Bassoon C2 tone, steady-state spectrum.
4. ADAPTIVE PHASE DISTORTION
The methods present in section 3 above are the central element in our technique of Adaptive Phase Distortion. In addition to them, we will control the modulation rate by tracking the pitch of the input signal. This ensures that PD is applied correctly according to the principles outlined above. The present technique uses the principles already outlined in other forms of adaptive distortion synthesis [6][7][10]. We will presently discuss some applications of Adaptive PD to musical signals.
4.1. Allpass filtering method
The allpass PD method can be used to enrich the spectra of in­strumental sounds. We will examine three different inputs and the effect of this technique on them. Fig. 10 shows the steady­state spectrum of a bassoon C2 tone, which is dominated by a strong formant around 800 Hz. Applying PD to this input, using a distorting function shaped as in fig.1 (sawtooth-like), with the inflection point at d = 0.1, we obtain the spectra plotted in fig.11.
Upon close examination, it is clear to see that the method adds several low-energy partials to the mid-high spectral range. The overall shape of the spectrum is preserved, but the secondary peak seen in the original tone at around 2 kHz is now blended into the overall spectral decay. The perceptual result is that of a sharper, raspier, tone, as a result of the added harmonics.
The effect can be used to generate dynamic spectra, by time­varying the amount of modulation from 0 to the maximum. This is shown on fig.12, which shows the spectrogram of a flute C4 tone processed by allpass PD. Here we vary the modulation amount, from 0 at the start to the maximum at 1 sec. It can be seen that as the distortion increases, extra partials are added at the higher end of the spectrum. Further modulating this parame­ter can generate interesting sweeping effects.
DAFX-5
Page 6
Proc. of the 12th Int. Conference on Digital Audio Effects (DAFx-09), Como, Italy, September 1-4, 2009
Figure 11. Allpass phase-distorted Bassoon tone.
Figure 12. Allpass PD flute tone, with varying modula-
tion amount (amplitudes in dB).
Finally, we can use a more pronounced phase distortion for
an increased effect. We can do this by moving the inflection po­sition d in the phase distortion function. The next example dem­onstrates this for d = 0.1 and d = 0.05. The first plot in fig.13 shows the steady-state spectrum of the original sound, a clarinet C3 tone. In fig.14, we plot the result of allpass PD with d = 0.1, which only imparts small changes to the spectrum. The most sig­nificant of these are in the increase of lower-order even harmonic energy.
To make more substantial modifications to the spectrum, we
set d = 0.05, which as discussed previously, will not only in­crease the effective modulation index, but also add energy to higher harmonics of the modulating function. This result is plot­ted on fig.15. A side-effect of this is the increased possibility of noticeable aliasing, which, in this particular case, is not signifi­cant.
Figure 13. Clarinet C3 tone, steady-state spectrum.
Figure 14. Allpass PD of clarinet tone, with moderate
distortion.
4.2. Heterodyne method
As discussed above, the heterodyne PD method reproduces the original technique more faithfully. As a result, it will impart less distortion if compared to the allpass implementation with similar parameters.
DAFX-6
Figure 15. Allpass PD of clarinet tone, with increased
distortion.
Page 7
Proc. of the 12th Int. Conference on Digital Audio Effects (DAFx-09), Como, Italy, September 1-4, 2009
Figure 16. Spectrum of heterodyne PD of bassoon tone,
d = 0.1.
Figure 17. Spectrum of heterodyne PD of bassoon tone
with a higher equivalent modulation index.
Fig.16 illustrates this point, where we plot the resulting spec-
trum of heterodyne PD applied to the same bassoon tone of fig.10, using d = 0.1. By comparing both plots, it can be seen that not too much change has been effected by the technique.
There are two ways of improving the effect to make it more
noticeable. The first one was already discussed in the previous section, namely, moving the inflection point d in the distortion function to the left (i.e. decreasing it). The other is basically to take advantage of the fact that we are actually implementing PM, so the limit on the distortion amount, ie. the modulation index, is removed. The next example, shown in fig.17 demonstrates the result of multiplying the modulation function by a factor of 5 (so that the equivalent modulation index is now 4π). In this particu­lar case, not only extra partials are added to the spectrum, but the secondary formant region in the original sound is enhanced.
Figure 18. Double-inflection PD function.
Figure 19. Steady-state PD spectrum using a flute tone as
input (single-inflection).
Complementing this discussion, we would like to examine the use of a different distortion function. In this case, we will select a function such as shown in fig.18. This generates, in the original method with a sinusoidal input, a signal with odd har­monics only. The effect it has on a complex input such as flute tone is shown on figs.19 and 20. The former shows the resulting spectrum PD using the single-inflection distortion function (d =
0.2) and while the latter uses the double-inflection one (d1 = 0.1 and d2 = 0.6).
The richer spectrum of fig.20 can be explained by the fact that the double inflection distortion function is equivalent to sin­gle inflection modulation at twice the frequency. Hence the in­flection points d1 and d2 are relatively smaller (i.e. towards the left of the function), resulting in more distortion. In addition, the spectrum is also different because of the use of an equivalent c:m ratio of 2. In fact, as an extension of both of the general-purpose PD techniques discussed here, we can possibly set this ratio to other values, something that is not directly possible with the original method as described in [1].
DAFX-7
Page 8
Proc. of the 12th Int. Conference on Digital Audio Effects (DAFx-09), Como, Italy, September 1-4, 2009
H. Massey, A. Noyes and D. Shklair. A Synthesist’s Guide
[2]
to Acoustic Instruments. Amsco publications, New York, USA, 1987.
J. Chowning, “The synthesis of complex audio spectra by
[3]
means of frequency modulations”, Journal of the Audio En- gineering Society, vol. 21, no. 7, Sept. 1973, pp. 525-534.
R. Pinkston, “FM synthesis in Csound”. The Csound Book,
[4]
R. Boulanger (ed.), MIT Press, Cambridge, Mass, 2000.
J. Chowning, “Method of synthesizing a sound”, United
[5]
States Patent 4018121, 1977.
V. Lazzarini, J. Timoney and T. Lysaght. “The Generation
[6]
of Natural-Synthetic Spectra by Means of Adaptive Fre­quency Modulation”, Computer Music Journal, 32(2), 2008, pp. 12-22.
V. Lazzarini, J. Timoney and T. Lysaght, “Non-linear dis-
[7]
tortion synthesis using the split sideband method with appli-
Figure 20. Steady-state PD spectrum of flute-tone (dou-
ble-inflection).
5. CONCLUSION
In this article we have explored the technique of PD synthesis, including two alternative implementations for it. We have shown the equivalence of PD and PM, and discussed the specific char­acteristics of the original technique. The two novel implementa­tions were shown to be general-purpose and with possible appli­cations in adaptive digital audio effects. We have then presented several examples of PD as applied to arbitrary input signals, dis­cussing the qualities of the resulting tones. It is our belief that the technique of Adaptive PD is a useful addition to its sister meth­ods of AdFM and Adaptive SpSB.
6. ACKNOWLEDGMENTS
We would like to acknowledge the support of An Foras Feasa., who partially funded the research leading to this article. The work of J. Pekonen and V. Välimäki has been financed by the Academy of Finland (projects no. 122815 and no. 126310).
7. REFERENCES
[1] M. Ishibashi, “Electronic musical instrument”, United States
Patent 4658691, 1985.
cations to adaptive signal processing”, Journal of the Audio Engineering Society, vol. 56, no. 9, Sept. 2008.
J. Pekonen, “Coefficient Modulated first-order allpass filter
[8]
as a distortion effect,” Proceedings of the 11th Conference on Digital Audio Effects (DAFx), Espoo, Finland, 2008, pp. 893-87.
J. Timoney, V. Lazzarini, J. Pekonen and V. Välimäki,
[9]
“Spectrally rich phase distortion sound synthesis using an allpass filter”, Proceedings of IEEE ICASSP 2009, Taipei, Taiwan, 2009, pp. 293-296.
V. Lazzarini, J. Timoney and T. Lysaght, “Asymmetric-
[10]
spectra methods for adaptive FM synthesis”, Proceedings of the 11th Conference on Digital Audio Effects (DAFx), Espoo, Finland, 2008.
M. Le Brun, “Digital Waveshaping Synthesis”, Journal of
[11]
the Audio Engineering Society, 27(4), 1979, pp. 250-266.
M. Le Brun, “A Derivation of the Spectrum of FM with a
[12]
Complex Modulating Wave”, Computer Music Journal, 1(4), 1977, pp. 51-52.
T. I. Laakso, V. Välimäki, M. Karjalainen, and U. Laine,
[13]
”Splitting the unit delay—Tools for fractional delay filter design,” IEEE Signal Processing Magazine, vol. 13, no. 1, pp. 30–60, Jan. 1996.
K. Steiglitz, A Digital Signal Processing Primer, Prentice
[14]
Hall, USA, Jan. 1996.
Wardle, S. “A Hilbert Transform Frequency Shifter for Au-
[15]
dio”. Proceedings of the International Conference on Digi- tal Audio Effects, Barcelona, Spain, pp. 25-29, 1999.
DAFX-8
Loading...