0% found this document useful (0 votes)
29 views9 pages

Tech 3

tech 3 for 24

Uploaded by

passme369
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views9 pages

Tech 3

tech 3 for 24

Uploaded by

passme369
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/263807657

SIMULATION OF TEXTURED AUDIO HARMONICS USING RANDOM FRACTAL


PHASELETS

Conference Paper · January 2013

CITATIONS READS

0 65

3 authors, including:

Derry Fitzgerald Rosangela Hickson


Cork Institute of Technology Faculdade de Tecnologia e Ciências
72 PUBLICATIONS 1,824 CITATIONS 101 PUBLICATIONS 4,022 CITATIONS

SEE PROFILE SEE PROFILE

All content following this page was uploaded by Derry Fitzgerald on 10 July 2014.

The user has requested enhancement of the downloaded file.


Proc. of the 16th Int. Conference on Digital Audio Effects (DAFx-13), Maynooth, Ireland, September 2-4, 2012

SIMULATION OF TEXTURED AUDIO HARMONICS USING RANDOM FRACTAL


PHASELETS

J Blackledge, ∗ D Fitzgerald, †
Audio Research Group Audio Research Group
Dublin Institute of Technology Dublin Institute of Technology
[email protected] [email protected]

R Hickson,‡
Audio Research Group
Dublin Institute of Technology
[email protected]

ABSTRACT those available from the Vienna Symphonic Library [3] and the al-
gorithmic simulation of solo stringed instruments remains an elu-
We present a method of simulating audio signals using the prin- sive problem to-date. This is because the sound field these instu-
ciples of random fractal geometry which, in the context of this ments produce is the result of a resonance involving complex inter-
paper, is concerned with the analysis of statistically self-affine actions (multiple reflections) of the sound waves inside a resonator
‘phaselets’. The approach is used to generate audio signals that are with a relatively complex topology. The result of this is to produce
characterised by texture and timbre through the Fractal Dimension a sound source that, compared with many other instruments, may
such as those associated with bowed stringed instruments. The pa- be loosely classified by the term ‘texture’. This is reflected in the
per provides a short overview on potential simulation methods us- onomatopoeic terms used to describe the violin, for example, in
ing Artificial Neural Networks and Evolutionary Computing and the slavonic languages, i.e. Skrzypce in Polish and Skripka in Rus-
on the problems associated with using a deterministic approach sian, both words being synonymous with the English phrase, ‘to
based on solutions to the acoustic wave equation. This serves to scrape’.
quantify the origins of the ‘noise’ associated with multiple scatter-
Texture and Timbre is fundamental to playing stringed instru-
ing events that often characterises texture and timbre in an audio
ments [4] and can significantly differentiate one individual player
signal. We then explore a method to compute the phaselet of a
from another which is often based on the traditions of the ‘School’
phase signal which is the primary phase function from which a
in which they have been trained, e.g. the tone of Jasha Heifetz
phase signal is, to a good approximation, a periodic replica and
(with its highly textured and ‘gritty’ timbre) [5] verses that of
show that, by modelling the phaselet as a random fractal signal,
Nathan Milstein known as the ‘man with the silver bow’ (a phrase
it can be characterised by the Fractal Dimension. The Fractal
used to describe the silky transparency of a sound with a ‘silver
Dimension is then used to synthesise a phaselet from which the
shade’) [6]. The word associations used to describe the subtleties
phase function is computed through multiple concatenations of the
of an audio signal generated by a bowed stringed instrument are
phaselet. The paper provides details of the principal steps associ-
of little value with regard to the issue of how such a sound can be
ated with the method considered and examines some example re-
synthesised. This is especially true with regard to the algorithmic
sults, providing a URL to m-coded functions for interested readers
synthesis of a solo violin (as opposed to developing a library of
to repeat the results obtained and develop the algorithms further.
samples associated with a string ensemble). There are a variety of
potential approaches that can be used which are briefly discussed
1. INTRODUCTION in the following sections.

The digital simulation of audio signals produced by different mu-


sical instruments is a standard problem with many example solu- 1.1. Synthesis using Artificial Neural Networks
tions having been considered and implemented over many decades
An Artificial Neural Network (ANN) aims, through iterative pro-
e.g. [1] and [2]. However, these successes tend to be related to the
cesses, to compute a set of optimal weights that determine the flow
simulation of instruments that are monotonic in the sense that the
of information (the amplitude of a signal at a given node) through a
sound field they generate is the result of a resonance with a rel-
network that simulates a simple output subject to a complex input.
atively small band-width. This includes instruments such as the
In this sense, an ANN simulates a high entropy input with the aim
trumpet, trombone, clarinet, flute, the forte-piano and so on. The
of transforming the result into a low entropy output. However, this
simulation of primarily bowed string instruments such as the vio-
process can be reversed to generate a high entropy output from a
lin, viola and cello relies on sound archives and libraries such as
low entropy input. In this sense, a ANN can be used to generate
∗ Stokes Professor, Science Foundation Ireland a textured harmonic by simulating signals once it has been trained
† Stokes Lecturer, Science Foundation Ireland to do so. To use a ANN in this way, the audio engineer requires
‡ Research Assistant, School of Electrical and Electronic Engineering knowledge of the ANN algorithm and the weights that have been

DAFX-1
Proc. of the 16th Int. Conference on Digital Audio Effects (DAFx-13), Maynooth, Ireland, September 2-4, 2012

generated through the training process (i.e. the input of the sig- complex phase signal. By understanding the physical background
nals used to generate the weights). For this purpose the type and to the problem, which is compounded in solutions to the wave
architecture of the ANN that provides a best simulation is crucial equation, we can assess which physical aspect of the sound source
[7]. is responsible for the complexity that we associated with the term
texture [10]. This is the purpose for the material presented in the
1.2. Synthesis using Evolutionary Algorithms following section.

Like artificial intelligence, evolutionary computing involves the 2.1. Model for a Simple Source
process of continuous optimisation. However, using ANNs to gen-
erating textured harmonics can be time consuming and inflexible It is well known that the fundamental model for an acoustic field
compared to using a formulaic approach to simulating sound tex- u(r, t) (i.e. three-dimensional pressure waves) as a function of
tures via an iterated (nonlinear) function, for example, whose out- three-dimensional space r = x̂x + ŷy + ẑz and time t, generated
put can be filtered as required. To do this, an evolutionary algo- by an acoustic source denoted by a ‘source function’ f (r, t) is
rithms approach is required in which a population-based, stochas- given by [11]
tic search engine is required that mimics natural selection. Due
1 ∂2
 
to their ability to find excellent solutions for conventionally diffi- ∇2 − 2 2 u(r, t) = −f (r, t) (1)
cult and dynamic problems within acceptable time, evolutionary c0 ∂t
algorithms have attracted interest from many areas of science and
where ∇2 is the Laplacian operator and c0 is the (constant) acous-
engineering [8]. Like the use of ANNs, the application of evolu-
tic wave speed. If we consider the source to be ideally localised in
tionary algorithms to simulate textured sound fields lies beyond the
space so that f (r, t) = δ 3 (r)f (t) then, with U (r, ω) = F1 [u(r, t)]
scope of the paper and will be considered in a future publication.
and F (ω) = F1 [f (t)] where F1 denotes the one-dimensional
However, it can be considered as an extension of the noise filtering
Fourier transform operator, equation (1) can be written in terms
approach considered in this paper where the iterator used to gen-
of the wavenumber k = ω/c0 as
erated random numbers coupled with a low-pass filter is replaced
by a single nonlinear iteration function that has been evolved to ∇2 + k2 U (r, k) = −δ 3 (r)F (k)

simulate the audio signal directly.
This equation has the general Green’s function solution [1]
1.3. Synthesis using Fractal Texture Analysis U (r, k) = g(r, k) ⊗r δ 3 (r)F (k) = g(r, k)F (k)
In a very general context, we may expect a textured sound signal
where
to be the result of filtered noise. As with all filtered noise mod- exp(ikr)
els, the problem is to determine what type of noise and what type g(r, k) = , r =| r |
4πr
of filter provides the closest simulation to the sound. In this pa-
and ⊗r denotes the convolution integral over r. Inverse Fourier
per, we focus on a 1/ | ω |q fractal noise model [9] where ω is the
transforming
(angular) frequency and q is some exponent which is taken to char- f (t + r/c0 )
acterise the real signal in some ‘best fit’ sense. This approach is u(r, t) =
4πr
consistent with self-affine stochastic systems theory. As discussed
later on in the paper, although such a model is relatively trivial, it and the time variations of the sound field are simply related to the
does provide surprisingly good results when applied to the simula- source function subject to an intensity | u |2 determined by the
tion of the phaselet associated with a textured monotonic harmonic inverse square law. Ignoring the scaling and translation effects by
subject to parameter optimisation. This filter based model is easy r (and c0 ), the detected signal at some point in space r can be taken
to implement on any audio engineering and post-production plat- to be given by
form and can be extended further to include a range of stochastic s(t) = p(t) ⊗t f (t)
field models However, in this paper we focus on the application of where ⊗t denotes the convolution integral over time and p is the
the simplest filtered-noise based random fractal model on the un- Impulse Response Function of the ‘detector’ (which may include
derstanding that interested readers can easily extend such a filter- the audio environment in which the source is placed). This result
based model. For this purpose, two m-code functions are given in provides a standard linear time invariant model for an audio signal.
Appendix A and Appendix B.
2.2. Model for a Complex Resonator
2. THE PHYSICAL ORIGINS OF TEXTURE IN SOUND Acoustic fields are rarely generated by the direct propagation of
SIGNALS a field from a source but through reflection or scattering of the
field in a resonator. The scattering effects can characterise both
The synthesis of an acoustic field from complex sound sources the source itself (the local resonator) and the environment (e.g.
such as stringed instruments is computationally intensive using a a concert hall) in which the source is placed. The effects of a
deterministic approach based on the application of conventional concert hall typical filter out the higher frequency components of
methods for modelling the propagation and scattering of sound the source. In either case, the scattering of an acoustic field can
waves. This is because the sound waves undergo many complex be taken to be generated by spatial variations in the wave speed so
scattering interactions to generate a ‘resonance’ that is character- that the wave equation (1) now becomes
istic of a particular instrument such as violin, for example. This
1 ∂2
 
‘resonance’ is not a simple one-dimensional standing wave pattern
but a three-dimensional quasi-standing wave pattern that outputs a ∇2 − 2 u(r, t) = −f (r, t)
c (r) ∂t2

DAFX-2
Proc. of the 16th Int. Conference on Digital Audio Effects (DAFx-13), Maynooth, Ireland, September 2-4, 2012

With equation. Consider the three-dimensional homogeneous time de-


1 1 pendent wave equation [13]
= 2 [1 + γ(r)]
c2 (r) c0
1 ∂2
 
and taking the Fourier transform with respect to time, we then ob- ∇2 − 2 2 u(r, t) = 0
tain the inhomogeneous Helmholtz equation c0 ∂t
and
∇2 + k2 U (r, k) = −k2 γ(r)U (r, k) − F (r, k)

u(x, y, z, t) = U (x, y, z, t) exp(iωt)
whose Green’s function ‘transformation’ is given by [13], [14] where it is assumed that the field u varies significantly slowly in
time compared with exp(iωt) and we note that
U (r, k) = Ui (r, k) + k2 g(r, k) ⊗r γ(r)U (r, k) (2)
u∗ (x, y, z, t) = U ∗ (x, y, z, t) exp(−iωt)
where
is also a solution to the wave equation. Differentiating
Ui (r, k) = g(r, k) ⊗r F (r, k)
It is important to stress that, unlike the ‘source problem’ consid- ∇2 U = exp(iωt)∇2 u,
ered in the previous section, equation (2) is not a solution since
the field we require a solution for is on both the left- and right- and
∂2 ∂2
 
∂u
hand sides of the equation, i.e. equation (2) is transcendental. This U = exp(iωt) u + 2iω − ω2 u
issue is a principal problem with regard to computing exact solu- ∂t2 ∂t2 ∂t
 
tions to the scattering problem in order to simulate the complex ∂u
' exp(iωt) 2iω − ω2 u
wave patterns generated by a scattered acoustic field. The ‘formal ∂t
approach’ is to consider the ‘iterative solution’ [11] when
2 4 ∂2u ∂u
U = Ui + k g ⊗r γUi + k g ⊗r γ(g ⊗r γUi ) + ... << 2ω .
∂t2 ∂t
which converges provided k2 kγk < 1. Each term in this series Under this condition, the wave equation reduces to
solution characterises the effect of increasingly higher order scat-
2ik ∂u
tering effects, i.e. the total field is equal to the incident field plus (∇2 + k2 )u =
single scattering processes plus second order scattering effects and c0 ∂t
so on. We consider the field pattern associated with the higher or- where k = ω/c0 . However, since u∗ is also a solution,
der terms to contribute to a ‘noise function’ N associated with the
generation of a complex (multiple scattered) audio signal (through 2ik ∂u∗
(∇2 + k2 )u∗ = −
the ‘resonator’ of a string instrument, for example) and write c0 ∂t

U (r, k) = Ui (r, k) + k2 g(r, k) ⊗r γ(r)Ui (r, k) + N (r, k) and thus,


∂u∗
 
2ik ∂u
The second term in this equation describes weak scattering under u∗ ∇2 u − u∇2 u∗ = u∗ +u
the Born approximation [11] and the third term the texture which c0 ∂t ∂t
we are required to model. The sound signal detected at a point in which can be written in the form
space r is taken to be given by [12]
2ik ∂I
∇2 I − 2∇ · (u∇u∗ ) =
s(r, t) = p(t) ⊗t u(r, t) = p(t) ⊗t ui (r, t) c0 ∂t

∂2 where I = uu∗ =| u |2 . Let u be given by


−p(t) ⊗t G(r, t) ⊗r γ(r) ⊗t ui (r, t) + p(t) ⊗t n(r, t)
∂t2 u(r, t) = A(r, t) exp(ikn̂ · r)
and is the result of contributions from the initial source, single
scattering events and the ‘noise’ generated by multiple scattering where n̂ is a unit vector and A is the amplitude function. Differ-
processes. In this sense, the development of a model for the (tem- entiating, and noting that I = A2 , we obtain
poral) noise function n(t) of a complex resonator changes from an
approach based on a deterministic model involving a series solu- 2 ∂A
n̂ · ∇A =
tion to one that is based on a stochastic model. The problem is then c0 ∂t
to consider the most suitable stochastic model in terms of its statis- or
tical properties and spectral characteristics subject to an evaluation  
based on known audio signals. ∂ ∂ ∂ 2 ∂
+ + A(x, y, z, t) = A(x, y, z, t)
∂x ∂y ∂z c0 ∂t
2.3. Diffusion Based Model which is the unconditional continuity equation for the amplitude
A of a wavefield
Diffusion models are based on an understanding that multiple scat-
tering effects can be taken to be analogous to the effect of dif- u(r, t) = A(r, t) exp[i(kn̂ · r + ωt)]
fusion via a random walk model. In this context, it is possible
to show that the diffusion equation is a special case of the wave where A varies slowly with time.

DAFX-3
Proc. of the 16th Int. Conference on Digital Audio Effects (DAFx-13), Maynooth, Ireland, September 2-4, 2012

The equation 2.4. Fractal Noise Model


2ik ∂I The models considered in the previous sections reveal some major
∇2 I − 2∇ · (u∇u∗ ) =
c0 ∂t problems with regard to using a deterministic approach to simu-
is valid for k = k0 − iκ (i.e. ω = ω0 − iκc0 ) and so, by equating lating an audio signal generated by an instrument and/or an envi-
the real and imaginary parts, we have ronment whose audio response is the result of multiple scattering
effects. These problems include: (i) the three-dimensional nature
∂I
D∇2 I + 2Re[∇ · (u∇u∗ )] = of the models used, that, while of physical significance, are in-
∂t compatible with the direct simulation of a time signature using a
and linear filtering approach; (ii) diffusion based models assume a uni-
k0 ∂I
Im[∇ · (u∇u∗ )] = − form phase distribution for the scattering of sound which is rarely
c0 ∂t the case, especially with regard to instruments that are specifi-
respectively, where D = c0 /2κ, so that under the condition cally designed to generate complex resonance effects; (iii) multiple
Re[∇ · (u∇u∗ )] = 0 scattering models ‘naturally iterative’ (as should be expected on a
causal basis, i.e. an (n + 1)th order reflection can only occur after
we obtain a nth order event) and therefore require complex simulations to be
∂I
D∇2 I = . undertaken in light of point (i) above. Thus, given the inadequacy
∂t of the simple sound-source model, the complexity associated with
This is the diffusion equation for the intensity of sound I. The the multiple scattering model, the incompatibility associated with
condition required to obtain this result can be justified by applying a fully diffusive model and the incompatibility of using fully three-
a boundary condition on the surface S of a volume V over which dimensional models to simulate time-dependent signals, we con-
the equation is taken to conform. Using the divergence theorem sider an approach to modelling the texture associated with multiple
scattering which is based on the one-dimensional fractional diffu-
Z I
Re ∇ · (u∇u∗ )d3 r = Re u∇u∗ · n̂d2 r = 0 sion equation for a localised source given by
V S
∂2 ∂q
 
under the homogenous boundary condition − u(x, t) = δ(x)w(t)
∂x2 ∂tq
u = 0, ∇u∗ = 0 ∀ r ∈ S
Physically, diffusion based models consider the multiple scattering where w(t) is white noise (with a uniformly distributed power
of an acoustic wavefield to be analogous to a random walk with a spectrum). This phenomenological equation represents the inter-
uniformly distributed phase. mediate case between a wave model q = 2 and a classical diffusion
If we consider the diffusion equation for a source f (r, t) to be model q = 1 in a one-dimensional sense, and, moreover, has the
given by self-affine temporal solution [14]
 
∂ 1
∇2 − σ I(r, t) = −f (r, t), I0 (r) = I(r, t = 0) u(t) = ⊗t w(t), t > 0 (3)
∂t Γ(q)t1−q/2
where σ = D−1 and f is of compact support, the Green’s function
where q = 5 − 2D and D ∈ [1, 2] is the Fractal Dimension. A
solution to this equation for homogenous boundary conditions is
fundamental property of this solution is that it is characterised by
given by [1]
a Power Spectral Density Function P̂ (ω) given by [12]
I(r, t) = f (r, t) ⊗r ⊗t G(r, t) + σI0 (r) ⊗r G(r, t)
where log P̂ (ω) = C − q log ω, ω > 0 (4)
  2 
1  σ  32 σr where C is a real scaling constant and the remaining focus of this
G(r, t) = exp − , t>0
σ 4πt 4t paper is the use of equation (4) to determine the Fractal Dimension
which satisfies the property: of a phaselet and equation (3) to simulate a phaselet and thereby,
Z ∞ harmonic texture.
1
G(r, t)d3 r = , t > 0
−∞ σ
3. FRACTAL PHASELET MODEL
The terms involved in the equation for the sound intensity are con-
volutions of the Green’s function with the source function and the A phaselet is the smallest phase signature of a single harmonic. If
initial condition I0 (r) respectively. Thus, for a localised source a perfect harmonic is taken to have a simple linear phase function
f (r, t) = δ 3 f (t) and with I0 = 0, the signal recorded a some that can be cut into a sequence of smaller linear phase functions
point in space r is given by concatenated together, then the phase of a textured harmonic is
s(r, t) = p(t) ⊗t f (t) ⊗t G(r, t) taken to be the concatenation of a many phaselets of compact sup-
port t = (0, T ]. Each phaselet is computed using equation (3),
Classically diffusive systems are thus characterised by an Impulse subject to a given fractal dimension that changes the texture of the
Response Function that is a Gaussian, a scenario that is compatible output. Thus, we consider a fractal phaselet to be given by
with the purpose of an anechoic chamber (i.e. a room designed to
completely absorb reflections of sound) but incompatible with the 1
concept of a resonator. θ(t) = ⊗t w(t), t ∈ [0, T ] (5)
Γ(q)t1−q/2

DAFX-4
Proc. of the 16th Int. Conference on Digital Audio Effects (DAFx-13), Maynooth, Ireland, September 2-4, 2012

The phase function Θ(t) is then given by the N th concatenation where τ defines the window of time over which the un-wrapped
of replicas of θ(t), i.e. phase is considered.
N
Θ(t) = k θj (t) ≡ θ1 (t) k θ2 (t) k · · · k θN (t) (6) 3.2. Phaselet Identification
j=1

With regard to automating the period of a phaselet and thereby


and the (complex) signal given by
identifying the primary resonance signature, this can be under-
s(t) = exp(i[ω0 t + Θ(t)]) taken by autocorrelating the de-trended unwrapped phase which
is composed of a sequence of ‘spikes’ whose width represents the
whose real (or imaginary) component is used to compute the audio periodicity of the phaselet. By locating the positions of the zero
harmonic. crossings in this autocorrelation function and rounding the aver-
age distance between them (for one half of the autocorrelation
3.1. Phase Evaluation of a Harmonic Audio Signal function) an estimate of the phaselet periodicity can be obtained
from which a single phaselet can then be extracted. However, this
To demonstrate the nature of a phaselet for a textured harmonic, approach assumes the absence of vibrato, which, as shown in Fig-
we consider the computation of the phase function for a concert ure 1, generates a distortion in terms of quasi-periodic trends. To
A (44.1kHz) generated by a violin. Figure 1 shows the unwrapped over come this problem, the de-trended unwrapped phase is first
and de-trended phase function for the signal together with a smaller differentiated (using a simple forward differencing scheme) to re-
window of the signal illustrating a series of replica phaselets asso- move the isolated trending effects caused by vibrato. The result of
ciated with the primary resonance phenomena. The macro-trends this computation is conveyed in Figure 2 which shows a single iso-
(with both positive and negative gradient) associated with this data lated phaselet together with the associated log-log power spectrum
are generated by the vibrato which is quasi-periodic but the phase- (for the first 50% of the positive half-space data) that is clearly
lets from which the entire phase signal is composed (and as illus- characteristic of the scaling relationship compounded in equation
trated in Figure 1) are the basis functions for the texture of the (4), i.e. a linear relationship between the logarithm of the power
sound generated. spectrum and the logarithm of the frequency with a negative gra-
dient characterised by q.

Figure 1: Unwrapped and de-trended phase for a concert A


recorded from a violin (above) and a windowed sample of the sig- Figure 2: Isolated phaselet (above) and the associated log-log
nal (below) showing a series of replica phaselets associated with power spectrum (below).
the primary resonance characteristics of the instrument.

The phase function shown in Figure 1 is the perturbation to an


otherwise near-linear function that must be extracted from the (un- 3.3. Computation of the Fractal Dimension of a Phaselet
wrapped) phase signal. This is easily accomplished by evaluating
the gradient of the phase ω0 and computing the (de-trended) phase Numerical methods for computing the Fractal Dimension of a ran-
function dom scaling fractal are well known. The power spectrum method
θ(t) = Θ(t) − ω0 t is particularly popular and involves the generation of a best fit es-
timation based on the scaling model associated with equation (4)
the gradient being obtained by applying a least square fit to the and thereby obtaining an estimate for q (and C). Application of a
data (when the unwrapped phase is quasi-linear) or, for a quasi- least squares method for estimating q, which is based on minimis-
harmonic phrase function, via the equation ing the error function
Θ(τ ) − Θ(0)
ω0 = e(q, C) = k log P (ω) − log P̂ (ω, q, C)k22
τ

DAFX-5
Proc. of the 16th Int. Conference on Digital Audio Effects (DAFx-13), Maynooth, Ireland, September 2-4, 2012

where P (ω) is the input power spectrum of the phaselet, generally Note that, for r = 1 and q = 2 we obtain a signal that is, in
leads to errors in estimates for q. The reason for this is that the ap- effect the same as that obtained under the ‘simple source model’
plication of a least squares approach is very sensitive to statistical presented in Section 2.1, i.e. s(t) = p(t) ⊗t f (t).
heterogeneity and may therefore provide values of the Fractal Di-
mension that are not compatible with the rationale associated with 5. DISCUSSION
the model. For this reason, Orthogonal Linear Regression (OLR)
is used to compute an estimate of q based on the algorithm avail- To quote B. Mandelbrot, ‘fractal geometry is an intrinsic study of
able at [15]. In Appendix A an m-code function is provided to texture’ and in this paper, we have developed a model for simu-
compute the Fractal Dimension of a phaselet for a single textured lating texture in audio signals based on random scaling fractals.
harmonic input from a (mono) .wav file. Note that this function However, the model has been introduced in a way that attempts
is only suitable for applications to single harmonic inputs alone. to relate it to the problem of evaluating multiple scattering effects
Its sole purpose is to identify the fractal dimension of the phase- that occur in instruments such as the violin when a simple sound-
let associated with a single harmonic characterised by texture, the source model is entirely inadequate and a deterministic approach
Fractal Dimension being a measure of this texture. The function is not practically realisable.
uses the OLR algorithm given by function OLR and in the case The principal original contribution we have made to the field
of the phaselet shown in Figure 2 yields a Fractal Dimension of of digital audio effects has been to illustrate how a fractional dif-
1.3945. fusion equation can be used to model a digital audio signal that is
taken to be generated from a complex resonance. This approach
4. SIMULATION OF A PHASELET USING RANDOM has specific applications in the simulation of audio signals gener-
FRACTALS ated by instruments such as the violin which is notoriously difficult
to synthesise because of the complex acoustic scattering processes
In principle, once the Fractal Dimension has been estimated for a that occur in this instrument. The primary controlling parameter is
phaselet of a harmonic texture, the phaselet can be simulated based the Fractal Dimension D. This parameter can be used to charac-
on the application of equation (5), in particular, using the Fourier terise the phaselet of audio signals using the algorithm presented
filtering operation in Appendix A which is then used to synthesise signals based on
  the application of equation (7).
[W (ω)]
θ(t, q, T ) = ReF1−1 , ω > 0, t ∈ [0, T ] (7) The purpose of this paper has been to introduce a fractal based
| ω |q model for the synthesis of audio signals using a texture associated
where w(t) is generated using a Pseudo Random Number Genera- with the generation of sound fields from instruments that generate
tor and where the phaselet may now depend upon the input Fractal complex resonance patterns due to multiple scattering effects. This
Dimension and the period T (user parameters). The phase func- has been considered through a study of conventional scattering the-
tion is then computed using equation (6) which depends upon an- ory which is too computationally difficult to use effectively for
other user defined parameter N . An example m-code function for audio simulation and a classical diffusion based approach which
simulating a harmonic texture using this approach is provide in produces a model that is ‘phase limited’. A fractional diffusion
Appendix B which depends upon user parameter D, T, N . The approach has therefore been considered in which each scattering
value of N determines the length of the signal and the parameter process is considered to be a random walk with a directional bias
T determines the pitch subject to the sampling rate chosen to out- to the phase (which is determined by the Fractal Dimension). This
put an audio signal. However, in the context of the remit for this is the essential link between attempting to model a multiple scat-
paper, the ‘key parameter’ is D which changes the texture of the tered sound field and using random scaling fractal signals to model
sound depending upon the value used subject to the pitch being audio texture produced from instruments such as a violin.
considered.
6. CONCLUDING REMARKS
4.1. Incorporation of a Deterministic Sound Source
With regard to the simulation method proposed, the audio signal is
To simulate an audio signal we need to include a deterministic still a relatively poor representation of a stringed instrument. First,
source term. This can be achieved by replacing the stochastic no vibrato is considered and second, the harmonic characteristics
source function w(t) as given in equation (5) with a hybrid term of the sound are weak. With regard to vibrato, it is observed that
that consists of two components including a deterministic source the quasi-regular trending behaviour of the unwrapped phase func-
function f (t), i.e. tion given in Figure 1 resembles a deterministic fractal structure
consistent with a Sierpinski triangle, for example. Thus applica-
w(t) := (1 − r)w(t) + rf (t), r ∈ [0, 1] tion of deterministic fractals for simulating vibrato may provide a
where kn(t)k∞ = 1 and kf (t)k∞ = 1. Here, r defines the rel- route to modelling this quasi-regular effect.
ative ‘strength’ of each term in relaton to its contribution to the The use of ANNs and evolutionary algorithms to simulate sound
solution of textures as briefly discussed earlier in this paper is the subject of
 2 future work and lies beyond the scope of this paper. However, it is
∂q

∂ noted that the evolution of nonlinear functions for the generation
− u(x, t) = δ(x)[(1 − r)w(t) + rf (t)]
∂x2 ∂tq of phase signals of the type given in Figure 1 is practically viable
within the context of applications packages such as Eureqa [8], for
which models a signal now determined by the equation example, especially if an output can be configured, through appli-
1 cation of an iterated function, for sound simulation over a range of
s(t) = p(t) ⊗t [(1 − r)w(t) + rf (t)] ⊗t frequencies. In contrast, although ANNs provide the potential for
Γ(q)t1−q/2

DAFX-6
Proc. of the 16th Int. Conference on Digital Audio Effects (DAFx-13), Maynooth, Ireland, September 2-4, 2012

a more subtle demarcation of a sound textures, the result is pred- %extract a phaselet.
icated on training data which makes the approach time and data k=1;
demanding. zero(k)=0;%initialize
The simplest and most cost effective approach is to further de- %only fist half of autocor required
velop the texture synthesis based on the approach considered here for i=1:round(size(autocor)/2)
which has introduced only the most basic method for fractal sound %find a zero crossing and repeat process
synthesis using a simple 1/ω q model. This model can be further if autocor(i)>0.0 & autocor(i+1)<=0.0
improved to incorporate generalised self-affine models and multi- zero(k)=i; k=k+1;
fractal methods coupled with a more in-depth analysis of stochas- end
tic time series applied to sound textures using, for example, the end
Ornstein-Uhlenbeck process [16]. Irrespective of the stochastic %Compute distance between zero crossings
model assumed, the identification and regeneration of a phaselet for i=1:round(length(zero))-1
for this purpose appears to be crucial. Thus, another approach zc(i)=zero(i+1)-zero(i);
is to categorise these functions, thereby developing a library of end
phaselets that can be concatenated for sound simulation. In this %Compute the (integer) average of the
context, the use of evolutionary algorithms could prove to be ad- %distanec between the zero crossings.
vantageous. However, in the context of the approach considered avzc=round(sum(zc));
in this paper, there would appear to be value in further exploring avzc=round(avzc/(length(zero)-1));
the role of random fractal geometry and fractal time random walks %extract phaselet from phase array centre
[17] and stochastic field theory focusing on the theory and appli- phaselet=phase(round(length(phase)/2)...
cations of fractional dynamics (e.g. [18] and [19]) for the purpose -round(avzc/2):round(length(phase)/2)...
of simulating textured audio signals. +round(avzc/2));
%Compute Power Spectrum of phaselet
powspec=abs(fft(phaselet)).^2;
Appendix A: m-Code for Computing the %Extract data for OLR estimation
%(50% of positive half space of spectrum).
Fractal Dimension of a Phaselet for i=1:round(size(powspec)/2)
if powspec(i)>0
The following code has been written to accommodate a two-column ydata(i)=log(powspec(i));
format and consequently uses the MATLAB continuation syntax xdata(i)=log(i);
‘...’. The code is somewhat condensed to minimize space. end
end
function D=FDPhaselet %Compute Fractal Dimension using OLR.
%Function to compute Fractal Dimension D p=OLR(xdata,ydata);
%for a phaselet extracted from a textured q=-p(2)/2; D=(5-q)/2;
% harmonic. %Output of function is D.
%START: %FINISH
%Read signal from mono .wav file. %
signal=wavread(’newvio.wav’); %-------------------------
signal=signal./max(abs(signal));%Normalise. %
%Compute Hilbert transform of signal & %OLR Function
%its angle and write unwrapped phase to %
%array ’phase’. function x=OLR(xdata,ydata)
phase=unwrap(angle(hilbert(signal))); fun=inline(’sum((p(1)+p(2)*xdata-ydata).^2)...
%Compute gradient of unwrapped phase /(1+p(2)^2)’,’p’,’xdata’,’ydata’);
grad=(phase(length(phase))-phase(1)); x0=flipdim(polyfit(xdata,ydata,1),2);
grad=grad/length(phase); options=optimset(’TolX’,1e-6,’TolFun’,1e-6);
%and de-trend x=fminsearch(fun,x0,options,xdata,ydata);
for i=1:length(phase)
phase(i)=phase(i)-grad*i;
end
%Compute gradient of phase
Appendix B: m-Code for Simulating a
for i=1:length(phase)-1 Fractal Textured Harmonic
dphase(i)=phase(i+1)-phase(i);
end The following code has been written to accommodate a two-column
dphase(length(phase))=... format and consequently uses the MATLAB continuation syntax
dphase(length(phase)-1); ‘...’. The code is somewhat condensed to minimize space.
dphase=dphase’;
%Compute autocorrelation function function Sig=FHTS(D,T,N)
autocor=xcorr(dphase,dphase); %Example Parameters:
autocor=autocor./max(autocor); %D=1.2; T=100; N=1000;
%Compute zero crossings metric to %Function to simulate harmonic texture

DAFX-7
Proc. of the 16th Int. Conference on Digital Audio Effects (DAFx-13), Maynooth, Ireland, September 2-4, 2012

%Fractal Harmonic Texture Simulator ’FGTS’. Bad Playing, PhD Thesis, Dublin Institute of Technology,
%INPUTS: D-Fractal Diomension 2010.
% T-Length of Phaselet [5] J. Heifetz, The Official Website, 2013, http://www.
% N-Number of cancatinations jaschaheifetz.com/.
% =length of phase signal
%OUTPUT: Sig-Simulated signal. [6] N Milstein, Reflection, 2013 http://www.
q=(5-2*D);%Comput q from D andromeda.at/mus/mil/refl_e.html.
%Compute noise using function rand. [7] E. R. Miranda and J. Matthias, Music Neurotechnology for
w=rand(1,T); Sound Synthesis: Sound Synthesis with Spiking Neuronal
%Comput complex spectrum of noise Networks, Leonardo, MIT Press Journals, Vol. 42, No. 5,
%with shift. 439-442, 2009.
w=fftshift(fft(w));
[8] Eureqa, A software tool for detecting equations and
%Filter the spectrum.
hidden mathematical relationships in your data, Cor-
for i=1:T
nell Creative Machine Lab, USA, 2013, http://
filter(i)=abs(i-round(T/2))^(q/2);
creativemachines.cornell.edu/eureqa.
if filter(i)==0%Check if singularity
w(i)=w(i); else [9] M. J. Turner, J. M. Blackledge and P. R. Andrews, Frac-
w(i)=w(i)/filter(i); tal Geometry in Digital Imaging, Academic Press, 1998;
end ISBN-10: 0127039708; ISBN-13: 978-0127039701.
end [10] P. Polotti, Fractal Additive Synthesis via Harmonic-Band
%Compute phaselet and normalise. Wavelets, Journal of Computer Music, Vol. 25, No. 3, MIT
theta=real(ifft(fftshift(w)))’; Press, Cambridge, 22-37, 2001.
theta=theta./max(theta);
%Cancatenate phaselets. [11] P. M. Morse and K. U. Ingard, Theoretical Acoustics, Prin-
Theta=theta;%initilise ston University Press, 1968.
for i=1:N [12] J. M. Blackledge, Digital Signal Processing, Horwood,
Theta=cat(1,theta,Theta); 2006; ISBN: 1-904275-26-5, http://eleceng.dit.
end ie/papers/102.pdf.
%Compute output signal
[13] J. M. Blackledge, Digital Image Processing, Second Edi-
for i=1:size(Theta)
tion, Horwood, 2005; ISBN:1-898563-49-7, http://
Sig(i)=cos(Theta(i)); end
eleceng.dit.ie/papers/103.pdf.
%FINISH
[14] J. M. Blackledge, The Fractal Market Hypothesis: Ap-
plications to Financial Forecasting, Canter for Advanced
7. ACKNOWLEDGMENTS Studies, Warsaw University of Technology, 2010; ISBN-
13: 978-83-61993-02-5, http://eleceng.dit.ie/
Jonathan Blackledge and Derry Fitzgerald are supported by the papers/182.pdf.
Science Foundation Ireland Stokes Professorship and Stokes Lec-
tureship Programmes, respectively. Ruairi Hickson is funded by [15] P. Sundqvist, Orthogonal Linear Regression, MATLAB
the Telecommunications Graduate Initiative, Ireland. The authors Central, 2005,
are grateful to Prof Eugene Coyle, Dr Marek Rebow and Prof Max http://www.mathworks.com/matlabcentral/
Ammann, all of Dublin Institute of Technology for the continued fileexchange/loadFile.do?objectId=
encouragement and support. 6716&objectType=File.
[16] E. Bibbona, G. Panfilo and P. Tavella, The Ornstein-
Uhlenbeck Process as a Model of a Lowpass Filtered White
8. REFERENCES Noise, Metrologia, Vol. 45 117-126, 2008.
[1] J. Chowning, J. M. Grey, L. Rush and J. A. Moorer, Com- [17] R. Hilfer, Exact Solutions for a Class of Fractal Time Ran-
puter Simulation of Music Instrument Tones in Reverberant dom Walks, Fractals, Vol. 3(1), 211-216, 1995.
Environments, Report, Stanford University Department of [18] R. Hilfer, Foundations of Fractional Dynamics, Fractals
Music, STAN-M-1, 1974 http://ccrma.stanford. Vol. 3(3), 549-556, 1995.
edu/files/papers/stanm1.pdf.
[19] A. Compte, Stochastic Foundations of Fractional Dynam-
[2] V. Välimäki, J. Pakarinen, C. Erkut and M. Karjalainen, ics, Phys. Rev E, Vol. 53(4), 4191-4193, 1996.
Discrete-time modelling of musical instruments, Rep. Prog.
Phys. 69, Institute of Physics Publishing, 1-78, 2006,
http://www.ece.uvic.ca/~bctill/papers/
numacoust/V%C3%A4lim%C3%A4ki_etal_2006.
pdf.
[3] Wienna Symphonic Library, 2013, http://vsl.co.
at/.
[4] J. Charles, Playing Technique and Violin Timbre: Detecting

DAFX-8

View publication stats

You might also like