Trajectory Anti-Aliasing on Guaranteed-Passive Simulation of Nonlinear Physical Systems

Page created by Amy Mccarthy
 
CONTINUE READING
Trajectory Anti-Aliasing on Guaranteed-Passive
             Simulation of Nonlinear Physical Systems
                                   Rémy Muller, Thomas Hélie

     To cite this version:
    Rémy Muller, Thomas Hélie. Trajectory Anti-Aliasing on Guaranteed-Passive Simulation of Nonlinear
    Physical Systems. 20th International Conference on Digital Audio Effects (DAFx-17), Sep 2017,
    Edinburgh, United Kingdom. �hal-01550618�

                                 HAL Id: hal-01550618
                https://hal.archives-ouvertes.fr/hal-01550618
                                     Submitted on 21 Jul 2017

    HAL is a multi-disciplinary open access            L’archive ouverte pluridisciplinaire HAL, est
archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents
entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non,
lished or not. The documents may come from émanant des établissements d’enseignement et de
teaching and research institutions in France or recherche français ou étrangers, des laboratoires
abroad, or from public or private research centers. publics ou privés.
                                              Copyright
Proceedings of the 20th International Conference on Digital Audio Effects (DAFx-17), Edinburgh, UK, September 5–9, 2017

        TRAJECTORY ANTI-ALIASING ON GUARANTEED-PASSIVE SIMULATION OF
                        NONLINEAR PHYSICAL SYSTEMS

                                                          Rémy Muller, Thomas Hélie ∗
                                               S3AM team, IRCAM - CNRS UMR 9912- UPMC
                                                 1 place Igor Stravinsky, 75004 Paris, France
                                                        remy.muller@ircam.fr

                           ABSTRACT                                      that rely on non-uniform polynomial interpolation of the vector
                                                                         field. Splines and in particular uniform B-splines [14] [15] [16],
This article is concerned with the accurate simulation of passive        [17] also offer a particularly interesting framework to represent
nonlinear dynamical systems with a particular attention paid on          and manipulate piecewise continuous-time signals through their
aliasing reduction in the pass-band. The approach is based on the        digital representations using the standard tools of linear algebra
combination of Port-Hamiltonian Systems, continuous-time state-          and digital signal processing.
space trajectories reconstruction and exact continuous-time anti-             In this article, we try to combine the geometric and the signal
aliasing filter realization. The proposed framework is applied on        processing viewpoints: we choose a physically informed piece-
a nonlinear LC oscillator circuit to study the effectiveness of the      wise smooth polynomial reconstruction model based on a discrete
method.                                                                  sequence of points generated by a passive-guaranteed simulation
                                                                         method.
                      1. INTRODUCTION                                         The paper is organized as follows. We first recall some results
                                                                         about Port-Hamiltonian systems in Section 3, then we consider
The need for accurate and passive-guaranteed simulation of non-          passive numerical methods in section 4, we talk about piecewise-
linear multi-physical systems is ubiquitous in the modelling of          continuous trajectory reconstruction in section 5 and continuous-
electronic circuits or mechanical systems.                               time filtering of piecewise polynomials in section 6. Finally we
     Geometric numerical integration [1] is a very active research       apply our method to a non linear LC oscillator circuit in section 7.
field that provides a theoretical framework for structure and invari-
ant preserving integration of dynamical systems. Port-Hamiltonian                         2. PROBLEM STATEMENT
Systems (PHS) [2] [3] that focus on the energy storage functions
and power continuous component interconnections belong to this           2.1. Objective
field and offer a well adapted framework to preserve the system
energy (resp. passivity). In the context of nonlinear physical au-       The objective is to simulate nonlinear passive physical audio sys-
dio systems, it has been applied successfully to the modelling of        tems in such a way that:
the wah-wah pedal [4], Fender Rhodes [5], brass instruments [6]              (i) The nonlinear dynamics is accurately reproduced,
and the loudspeaker nonlinearities [7]. Automatic generation of             (ii) The power balance decomposed into its conservative, dissi-
the system equations from a graph of components has been inves-                  pative and source parts is satisfied,
tigated in [8]
                                                                           (iii) The observation operator is designed to reduce the aliasing
     However the presence of aliasing errors in the numerical sim-
                                                                                 induced by the nonlinearities.
ulation is annoying for three reasons. First it causes audible in-
harmonic audio artefacts. Second it deteriorates the accuracy of
the numerical scheme leading to poor convergence rate. Third it          2.2. Approach
requires the use of significant oversampling. This problem is even       To address this problem, the following strategy is adopted.
more pronounced in the case of systems such as sustained instru-              First, trajectories are approximated in the continuous-time do-
ments that rely on nonlinearities to achieve auto-oscillation.           main by smooth parametric piecewise-defined functions, such that
     Aliasing errors in the context of finite elements simulation        the three following properties are fulfilled:
and some alternatives have been discussed in [9] (ch 11). Anti-
                                                                          (P1) Regularity: functions and junctions are C k with k ∈ N,
aliased waveform generation without oversampling has been pro-
posed in [10]. Static nonlinearity anti-aliasing has also been pro-       (P2) Accuracy: the approximation has accuracy order p,
posed in [11] [12] by combining exact anti-derivatives and finite-        (P3) Passivity: the power balance is globally satisfied for each
differences.                                                                     frame.
     Continuous-time input reconstruction has been used in [13] to       Second, the anti-aliased output is built a posteriori in three steps:
simulate the frequency response of LTI systems with higher accu-
racy. It is also central in collocation-based Runge-Kutta methods            1. Observe the output from the approximated dynamics in the
                                                                                 continuous-time domain,
   ∗ The contribution of this author has been done at laboratory
                                                                             2. Apply a continuous-time anti-aliasing filter in order to re-
STMS, Paris, within the context of the French National Research                  spect the Shannon-Nyquist sampling theorem,
Agency sponsored project INFIDHEM. Further information is avail-
able at http://www.lagep.cpe.fr/wwwlagep7/anr-dfg-infidhem-fev-2017-         3. Sample the filtered trajectories to convert them back to discrete-
jan-2020/                                                                        time.

                                                                   DAFX-1
Proceedings of the 20th International Conference on Digital Audio Effects (DAFx-17), Edinburgh, UK, September 5–9, 2017

2.3. Methodology                                                                       with.
In this article, we restrict ourselves to piece-wise continuous glob-                                   Pc = ∇H(x)T J(x)∇H(x) = 0                           (10)
ally C 1 polynomial trajectories of the form                                                                            T
                                                                                                        Pd = ∇H(x) R(x)∇H(x) ≥ 0                            (11)
            ∞                                                   
            X                t − tn                       t − tn                                        Pe = ∇H(x) G(x)uT
                                                                                                                                                            (12)
  x̂(t) =          x̂n                    rect]0,1]                    ,   t ∈ R (1)
            n=−∞
                               h                            h
                                                                                       The Pc term is null because J is skew-symmetric: it represents
             N
with x̂ ∈ R , x̂n (τ ), τ ∈ [0, 1] being a local polynomial model                      conservative power exchange between storage components in the
of order r, tn = hn, n ∈ Z and h being the time step parameter.                        system. The Pd term is positive because R ≥ 0: it represents
The continuity hypothesis (P1) is expressed mathematically by.                         the dissipated power. Finally the term Pe represents the power
                                                                                       brought to the system by the external ports.
                  (`)           (`)
                 x̂n+1 (τ ) = x̂n   (τ ) ∀n ∈ Z, ` ≤ k                           (2)       Equation (9) express the system’s passivity property: with ex-
                                                                                       ternal inputs switched off (u = 0) the energy can either be constant
For property (P2) the local approximation error between the exact                      (conservative case Pd = 0) or decaying (dissipative case Pd > 0).
solution and its approximation is defined by
                                                                                       3.2. Component-based approach and semi-explicit DAE form
                   e(h) = x(t0 + h) − x̂(t0 + h)                                 (3)
                                                                                       More generally, PHS can be expressed in Differential Algebraic
provided that x(t0 ) = x̂(t0 ) and it is required that for some p.                     Equation form. When we consider physical systems containing
                                                                                       N energy-storage components, M dissipative components and P
                              e(h) = O(hp+1 )                                    (4)   external interaction ports described by

Finally to express property (P3) we require the power-balance                              Pc the stored energy level en and its variation law defined by
                                                                                              e0n = ∇Hn (xn )x0n for the state variable xn .
                             E 0 (t) = −Pd + Pe                                  (5)       Pd the dissipated power qm (w) ≥ 0 with the component’s flux
                                                                                              and effort variables being in algebraic relation of a single
where Pd and Pe are respectively the dissipated and external power                            variable w.
and E 0 (t) is the instantaneous energy variation of the system.
                                                                                           Pe the external power up yp brought to the system through this
                                                                                              port with up being the controllable input of the system and
             3. PORT-HAMILTONIAN SYSTEMS                                                      yp being the observable output.
In this article, nonlinear passive physical audio systems are de-                      For a storage component, en = Hn (xn ) gives the physical energy
scribed under their Port-Hamiltonian formulation. The theory of                        storage law. If x0n is a flux (resp. effort) variable then ∇Hn (xn )
Port-Hamiltonian Systems (PHS) [2] [3] extends the theory of Hamil-                    is the dual effort (resp. flux) variable.
tonian mechanics to non-autonomous and dissipative open sys-                                Similarly, for a dissipative component, the power is qm =
tems. It provides a general framework where the dynamic state-                         Rm (wm ) so that if wm is a flux (resp. effort) variable then z(wm ) =
                                                                                       Rm (wm )
space equations derives directly from an energy storage function                           wm
                                                                                                 is the effort (resp. flux) and gives the dissipation law.
and power-conserving interconnection of its subsystems.                                     We then consider a passive system obtained by interconnection
                                                                                       of these components given by
3.1. Explicit differential form                                                                             0                         
                                                                                                             x                   ∇H(x)
Consider a system with input u(t) ∈ U = RP , with state x(t) ∈                                              w  = S(x, w) z(w)                        (13)
X = RN and output y(t) ∈ Y = RP with the structured state-                                                   −y                     u
space equations [2]                                                                                        | {z }
                                                                                                              b
                                                                                                                               | {z }
                                                                                                                                      a
   0
     x = (J(x) − R(x)) ∇H(x) + G(x)u = f (x, u)                                        with S = −ST being skew-symmetric, H(x) = N
                                                                                                                                       P
                                                            (6)                                                                           i=1 Hn (xn )
     y = G(x)T u
                                                                                       and z(w) = [z1 (w1 ), . . . , zm (wm )]T .
where H gives the stored energy of the system                                              The S matrix represents the power exchange between compo-
                                                                                       nents: since S = −ST we have a · b = aT Sa = 0 which again
                             E(t) = (H ◦ x)(t)                                   (7)   leads to the power balance1 .

with H ∈ C 1 (X, R+ ), ∇ being the gradient operator, J = −JT a                                       ∇H(x) · x0 + z(w) · w − u · y = 0                     (14)
skew-symmetric matrix and R = RT  0 a positive-semidefinite
                                                                                                      |  {z    } | {z } | {z }
                                                                                                        Pc =E 0 (t)         Pd            Pe
matrix. The energy variation of this system satisfies the power-
balance given by the derivative chain rule                                             The explicit form (6) can be found by solving the second row of
                                                                                       (13). The S matrix represents a Dirac structure [2] that expresses
                             E 0 (t) = ∇H(x)T x0                                 (8)   the power-balance and can be constructed from a component con-
                                                                                       nection graph [8] [18].
which can be decomposed as
                                                                                          1 The minus sign in −y in Eq. (13) is used to restore the receiver con-
                         E 0 (t) = Pc − Pd + Pe                                  (9)   vention used for internal components.

                                                                                  DAFX-2
Proceedings of the 20th International Conference on Digital Audio Effects (DAFx-17), Edinburgh, UK, September 5–9, 2017

         4. PASSIVE NUMERICAL INTEGRATION                                     4.2. Accuracy order
                                                                              As shown in [22], the AVF has accuracy order p = 2, it is a B-
Whereas most numerical schemes concentrate their efforts on the
                                                                              series method, is affine-covariant and self-adjoint. When approxi-
the temporal derivative or the numerical integration quadrature,
                                                                              mated as in Eq (19) by evaluating matrices J, R, G for x∗ = xn
discrete gradient methods preserve the energy (resp. passivity)
                                                                              the accuracy is only of order 1. Order 2 is achieved when either
given by the power-balance (9), (14) in discrete-time by providing
                                                                              J, R, G are independent of x or when evaluated at the mid-point
a discrete equivalent of the chain rule derivation property E 0 (t) =
                                                                              x∗ = xn + δx2n in the conservative case. It is also possible to re-
∇H(x)T x0 . A discrete gradient [19] ∇H is required to satisfy the
                                                                              store the accuracy order p = 2 in the general case using a Runge-
following conditions.
                                                                              Kutta refinement [21].
             H(x + δx) − H(x) = ∇H(x, δx)T δx                          (15)
                                                                              4.3. Implicit resolution
                               ∇H(x, 0) = ∇H(x)                        (16)
                                                                              The discrete system is implicit on δxn and admits a unique so-
In this article, we will focus on the average vector field [20].              lution when H is convex. In the general case, an iterative solver
                                                                              is required (typically a fixed-point or Newton iteration), but when
                                                                              the Hamiltonian is quadratic we can avoid the need for an itera-
4.1. Average Vector Field                                                     tive resolution. Furthermore, when the Hamiltonian is convex the
                                                                              method can also be made non-iterative by quadratization of the
In the general case, the AVF method is defined by.                            Hamiltonian [21].
                     1
                                                                              Proof. When the Hamiltonian is quadratic of the form H(x) =
             Z
    δxn
        =                f (xn + τ δxn )dτ,          xn+1 = xn + δxn   (17)   1 T
                                                                                x Qx, the discrete gradient reduces to the mid-point rule
     δt          0                                                            2
                                                                                                 Z       1                                
When the matrices J(x), R(x), G(x) are approximated by con-                                                                           1
                                                                                  ∇H(x, δx) =                Q(xn + δxn τ )dτ = Q xn + δxn
stant matrices J̄, R̄, Ḡ, we obtain the separable structure-preserving                              0                                2
approximation of (17)
                                                                              the implicit dependency on δx can thus be solved by matrix inver-
             δxn                                                              sion                            −1
                 = (J − R)∇H(xn , δxn ) + Gūn
                                                                                                   
                                                                       (18)                               δt                      
              δt                                                                          δxn = δt I − A            Axn + Gun              (22)
                                                                                                          2
with the discrete gradient being defined by                                   with A = (J − R)Q
                                      Z       1
                 ∇H(x, δx) =                      ∇H(x + τ δx)dτ       (19)        5. PIECEWISE-CONTINUOUS TRAJECTORIES
                                          0

and it satisfies the discrete power balance
                                                                                              1.0
                            δx
       δE = ∇HT                = ∇HT (J − R)∇H + ∇HT Gu                                       0.9
                            δt
                               = 0 − Pd + Pe                                                  0.8
                                                                                              0.7
Then, by the fundamental theorem of calculus, for mono-variant                                0.6
                                                                                          y

components, i.e. separable Hamiltonians of the form H(x) =
PN                                                                                            0.5
  i=1 Hi (xi ), we have for each coordinate:
                                                                                              0.4
                                  Hi (xi +δxi )−Hi (xi )
                                                                                              0.3
                              
                                                                6 0
                                                            δxi =
    ∇Hi (xi , δxi ) =                      δxi                         (20)
                                  ∇H(xi )                   δxi = 0                           0.2
                                                                                                0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
                                                                                                                     x
which satisfies the discrete gradient conditions (15)-(16). For non-
separable Hamiltonians, a discrete-gradient can also be uniquely              Figure 1: Example of a cubic trajectory with conservative end-
defined, see [21] for more details.                                           points. The affine trajectory used to compute the average vector
     To summarize, this method relies on two complimentary ap-                field is shown (in green), the associated cubic interpolated ap-
proximations: the differential operator dxdt
                                              → δxδt
                                                      and the vector          proximation (in blue), its control polygon (in red), and the exact
field f → f to achieve energy (resp. passivity) conservation. The             manifold (in dashed black).
discrete PHS equivalent of (6) is given by the numerical scheme.
                                                                                  Given the sequence of points {xn } obtained by a passive-
           δxn
                                  
                                                                              guaranteed method, we would like to reconstruct piece-wise C k -
      
           δt
                          = J − R ∇H(xn , δxn ) + Gun
                              T
                          = G ∇H(xn , δxn )                            (21)   continuous polynomial trajectories informed by the system dy-
       yn                                                                    namics.
        xn+1              = xn + δxn

                                                                         DAFX-3
Proceedings of the 20th International Conference on Digital Audio Effects (DAFx-17), Edinburgh, UK, September 5–9, 2017

     The idea is to exploit the dynamic equation at each junction                Common choices are the observable and controllable state-space
point xn where the approximation is known to be O(hp+1 ).                        forms.
     Indeed, if we had the samples of the exact trajectory, by the                    Furthermore when the denominator can be factored with dis-
Weierstrass approximation theorem, arbitrarily close polynomial                  tinct roots, it is possible to rewrite the transfer function using par-
approximations converging uniformly to the exact solution could                  tial fraction expansion as.
be obtained by computing its derivatives to any desired order.
                                                                                                                         c1             cN
     Since we only have an approximation of order p = 2, we                                    H(s) = c0 +                    + ... +                              (30)
restrict ourselves to a regularity k = 1. This gives four constraints                                                  s − λ1         s − λN
                                                                                 which leads to the canonical diagonal form
x̂(0) = xn ,    x̂(1) = xn+1 ,        x̂0 (0) = f (xn ),   x̂0 (1) = f (xn+1 )
                                                                                                                               
                                                                                                   λ1                            1
that can be satisfied by a cubic polynomial (r = 3). We choose to
                                                                                                        .                       .
                                                                                           A=            ..                B =  ..                              (31)
                                                                                                                 
represent it using the Bézier form,                                                                               
              3
                                            !                                                                 λN                 1
             X         3         n        n
                                              (1 − t)n−i ti
                                                                                                                               
    x̂(τ ) =     Xi Bi (τ ), Bi (t) =                        (23)                          C = c1 . . . cN                  D = c0                                 (32)
             i=0
                                          i

with {Xi } being its control polygon and Bin (t) being the Bern-                 6.2. Exact exponential integration
stein polynomial basis functions, because they have important ge-                The exact state trajectory is given by the integral
ometric and finite differences interpretations [23].
     This choice immediately leads to the following equations,                                                           Z t
                                                                                   x̃(t) = x̃h (t) + x̃e (t) = eAt x̃0 +     eA(t−τ ) Bũ(τ )dτ (33)
                                            1                                                                                             0
           X0 = xn                X1 = xn +   f (xn )                 (24)
                                            3                                    as the sum of the homogeneous solution to the initial conditions
                                               1                                 x̃h and the forced state-response with zero initial conditions x̃e
           X3 = xn+1              X2 = xn+1 − f (xn+1 )               (25)
                                               3                                 given by the convolution of the input with the kernel eAt .
where the internal control points X1 , X2 are computed from the                      Furthermore when A is diagonal we have
end points xn , xn+1 by first order forward / backward prediction                                                   λ1 t                                
using the derivative rule.                                                                                          e
                                                                                                      eAt         =
                                                                                                                                ..                      
                                                                                                                                                                   (34)
                n−1                                                                                                                   .                  
       0
                X                                                                                                                                 λN t
     x̂ (t) =         Di Bin−1 (t),     Di = n(Xi+1 − Xi )            (26)                                                                    e
                i=0
                                                                                 which greatly simplifies the computation of the exponential map.
An example trajectory is shown in Figure 1.                                      In that case (33) can be evaluated component-wise as
                                                                                                            Z t
               6. ANTI-ALIASED OBSERVATION                                           x̃i (t) = eλi t x̃i0 +     eλi (t−τ ) ũ(τ )dτ i ∈ {1 . . . N } (35)
                                                                                                                  0
Given an observed signal ũ(t) = y(t) belonging to the class of
piecewise polynomials, in order to reject the non-band-limited part              where we used the notation xi to detonate the i-th coordinate of
of the spectrum, we would like to apply an antialiasing filter oper-             the vector x
ator given by its continuous-time ARMA transfer function H(s),
then sample its output ỹ(t) to get back to the digital domain.                      6.2.1. Polynomial input
     Since our anti-aliasing filter will be LTI, we will make use
of exact exponential integration and decompose its output on a                   With ũ(t) being a polynomial of degree K in monomial2 form and
custom basis of exponential polynomial functions.                                coefficients ũk
                                                                                                                  K
     Without loss of generality we only consider single-input single-                                            X       tk
                                                                                                         ũ(t) =     ũk                    (36)
output filters (SISO) since we can always filter each observed out-                                                      k!
                                                                                                                              k=0
put independently.
                                                                                 we can expand the forced response x̃e in (35) as a weighted sum
6.1. State-space ARMA filtering of polynomial input                                 Z t             K
                                                                                                                  !       K
                                                                                          λi (t−τ )
                                                                                                    X     tk (τ )        X
                                                                                        e             ũk           dτ =     ũk ϕk+1 (λi , t) (37)
We want to filter the trajectory by an ARMA filter given by its                      0                      k!
                                                                                                      k=0                                 k=0
Laplace transfer function
                                                                                 with the basis functions {ϕk } being defined by the convolution
                      Y (s)  b0 sN + b1 sN −1 + . . . + bN
           H(s) =           = N                                       (27)
                      U (s)   s + a1 sN −1 + . . . + aN                                               Z       t
                                                                                                                              τ k−1
                                                                                        ϕk (λ, t) =               eλ(t−τ )            dτ                     k≥1   (38)
This filter can be realized in state-space form as                                                        0                  (k − 1)!

                            x̃0 = Ax̃ + Bũ                           (28)       One of the main advantages of using a polynomial input (rather
                                                                                 than a more general model) lies in the fact that these basis func-
                             ỹ = Cx̃ + Dũ                           (29)       tions can be integrated exactly, avoiding the need of a quadrature

                                                                         DAFX-4
Proceedings of the 20th International Conference on Digital Audio Effects (DAFx-17), Edinburgh, UK, September 5–9, 2017

               λ = i2π                 λ = −5                                       1.0
    1.0                      1.0
    0.5                      0.8                                                    0.8
                             0.6                                                    0.6
    0.0
                             0.4
    0.5                                                                             0.4
                             0.2
    1.0                      0.0                                                    0.2
      0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0
                  t                       t                                         0.0
                                                                                       0                  1                2                 3          4
Figure 2: Normalized ϕ-functions for k ∈ {0 . . . 4}. The real                                                          samples
parts of the impulse (blue), step (red), ramp (green), quadratic
(magenta) and cubic (black) responses are shown for a complex                       Figure 3: Exact continuous-time responses of a first order low-
pole λ = i2π (left plot) and a real pole λ = −5 (right plot) over                   pass filter to a polynomial input (in blue).
the unit interval t ∈ [0, 1].
                                                                                        1.0
approximation formula. See Appendix 12 for a detailed derivation                        0.5
and a recursive formula, and Figure 2 for their temporal shapes.
    Using those we can decompose the local state trajectories as.                       0.0
                                              K
                                              X                                         0.5
             x̃i (t) = x̃i0 ϕ0 (λi , t) +            ũk ϕk+1 (λi , t)       (39)
                                              k=0
                                                                                        1.0
                                                                                           0          2            4              6              8     10
We note that the initial condition is equivalent to an impulsive                                                        samples
input x̃i0 δ(t). This filtering scheme can thus be generalized to non               Figure 4: Exact continuous-time response of the order 3 Butter-
polynomial impulsive inputs.                                                        worth filter with cutoff pulsation ωc = π to a triangle input at the
                                                                                    Nyquist frequency.
    6.2.2. Numerical update scheme
Since we only wish to sample the trajectory on a fixed grid tn ∈
Z, we just need to evaluate the local state trajectory x(t) and the                           7. APPLICATION: NONLINEAR LC OSCILLATOR
output y(t) at t = 1 to finally get the following numerical scheme
                                                                                    In order to illustrate the proposed method, we consider the sim-
                                             K
                                             X                                      plest example having non linear dynamics. For that purpose, we
            x̃in+1   =   x̃in ϕ0 (λi )   +         ũk,n ϕk+1 (λi , 1)       (40)   use a parallel autonomous LC circuit with a linear inductor and a
                                             k=0
                                                                                    saturating capacitor with the Hamiltonian energy storage function
                         N
                         X                                                          given by
             ỹn+1 =           ci x̃in+1 + c0 ũn (1)                        (41)
                         i=1                                                                                           ln(cosh(q))    φ
                                                                                                          H(q, φ) =                +                 (42)
where the coefficients ϕk (λi , 1) can be pre-computed and the com-                                                        C0        2L
ponents x̃in+1 evaluated in parallel.
                                                                                    where the state q is the charge of the capacitor and φ the flux in the
                                                                                    inductor. Its circuit’s schematic is shown in figure 5 and its energy
6.3. Filter examples                                                                storage law are displayed in 6
    6.3.1. Low-pass filter of order 1
                                                                                                           +
We consider a first order low-pass filter with transfer function                                                            +
            a
H(s) = s+a    . The temporal response to a piecewise polynomial
        2                                                                                                 VL   L       VC             C(q)
input {t , 1 − t, 0, 1} is shown in Figure 3 for a ∈ {1, 3, 6, 10}.
                                                                                                                            − IC
                                                                                                           − IL
    6.3.2. Butterworth Filter of order 3
To further illustrate the non-band-limited representation capacity
of piece-wise polynomials, and the effectiveness of the filtering                                 Figure 5: A nonlinear LC oscillator circuit
scheme, we have shown in Figure 4 the response of a third-order
Butterworth filter with cutoff ωc = π to a triangular input signal.                     By partial differentiation of the Hamiltonian function H by re-
Its Laplace transfer function for a normalized pulsation ωc =√ 1                    spectively q and φ we get the capacitor’s voltage and the inductor’s
                              1
is given by H(s) = (s2 +s+1)(s+1)     with poles λ1 = −1−i   2
                                                                3
                                                                  ,                 current, while applying the temporal derivative on q, φ gives the
             √                                                               √
                                                                                    capacitor’s current and inductor’s voltage.
λ2 = −1+i
        2√
           3
             , λ3 = −1 and coefficients c0 = 0, c1 =                     −3+i 3
                                                                           6
                                                                                ,
     −3−i 3
c2 =        , c3 = 1.                                                                                          tanh(q)
       6
                                                                                                  VC = ∂q H =                            IC = q 0    (43)
   2 We                                                                                                          C0
         use the monomial form here instead of Bernstein polynomials be-
                                                                                                               φ
cause this is the one that leads to the most straightforward and meaningful                        IL = ∂φ H =                           V L = φ0    (44)
derivation.                                                                                                    L

                                                                               DAFX-5
Proceedings of the 20th International Conference on Digital Audio Effects (DAFx-17), Edinburgh, UK, September 5–9, 2017

                                                                                                                      0
2.0             Hamiltonian                               1.0               Gradient                                 20                                                                10x
                                                                                                                     40
                             Hφ                                                                                      60

                                                                                                               dB
                                                                                                                     80
1.5                          Hq                           0.5                                                       100
                                                                                                                      10
                                                                                                                      0
                                                                                                                         2              103                 104                  105
1.0                                                       0.0                                                        20                                                                ZOH
                                                                                                                     40
                                                                                                                     60

                                                                                                               dB
                                                                                                                     80
0.5                                                       0.5                                  ∇φ H                 100
                                                                                               ∇q H                   10
                                                                                                                      0
                                                                                                                         2              103                 104                  105
0.0                                                       1.0                                                        20                                                                FOH
      2         1        0            1               2         2       1       0              1          2          40
                                                                                                                     60

                                                                                                               dB
                                                                                                                     80
Figure 6: Respective energy storage functions (left plot) and their                                                 100
                                                                                                                      10
                                                                                                                      0
                                                                                                                         2              103                 104                  105
gradients (right plot), of the nonlinear capacitor (in red) and lin-
ear inductor (in blue), for C = 1, L = 1.
                                                                                                                     20                                                    proposed cubic
                                                                                                                     40
                                                                                                                     60

                                                                                                               dB
                                                                                                                     80
 3            state space (q(t),φ(t))                       3                   φ(t)                                100
                                                                                                                      10
                                                                                                                      0
                                                                                                                         2              103                 104                  105
 2                                                          2                                                        20                                                    proposed + AA
                                                                                                                     40
                                                                                                                     60
 1                                                          1                                                  dB    80
 0                                                          0                                                       100
                                                                                                                      102               103                 104                  105
 1                                                          1                                                                                         Hz

 2                                                          2                                                   Figure 8: Continuous-time spectrum of the nonlinear LC circuit
                                                                                                                flux φ for a fundamental frequency of 500 Hz and a sampling fre-
 3                                                          3
          4       2      0        2               4          0      2       4       6   8          10     12    quency of 44.1 kHz. The 10x oversampled reference is compared
                                                                                    t
                                                                                                                to the AVF method’s discrete output with zero-order hold (ZOH),
Figure 7: Comparison of simulated orbits with discrete points (in                                               first-order hold (FOH), the proposed method (proposed cubic) and
blue) computed using the AVF method, reconstructed cubic trajec-                                                its 12th order Butterworth filtered spectrum (proposed + AA). The
tory (in green) and reference trajectory computed at 10x sampling                                               Nyquist frequency is materialized in blue and the multiples of the
rate (in red).                                                                                                  sampling rate in red.

This gives the Branch Component Equations.                                                                      around the Nyquist frequency. It also has a higher spectral images
     Applying Kirchhoff Current and Voltage Laws gives the con-                                                 decay rate thanks to its C 1 regularity. Its aliased components start
straints IC = −IL , VC = VL . We can summarize the previous                                                     at -85 dB at the Nyquist frequency and decay much faster to reach
equations with the conservative autonomous Hamiltonian system.                                                  -100 dB at about 14 kHz where they reach a kind of aliasing noise
                                                                                                                floor caused by higher harmonics fold-back.
                                          x0 = J∇H(x)                                                   (45)         Finally, as expected, the 12th-order Butterworth half-band low-
with.                                                                                                           pass filter removes components above the Nyquist frequency thanks
                                                                                                          to the piecewise continuous cubic input.
                q                             0       −1                            ∂q H
      x=           ,          J=                           ,        ∇H =                                (46)
                φ                             1        0                            ∂φ H
                                                                                                                                          8. DISCUSSION
    Its state space and temporal trajectories are shown in Figure 7.
We can see that the numerical scheme preserves the energy since                                                 First, we highlight the fact that the vector field approximation in
the discrete points lie exactly on the orbit of the reference trajec-                                           (17) acts as a first-order antialiasing filter: it is a projection of the
tory. The reconstructed state-space trajectory also shows a good                                                vector field on a rectangular kernel. It prevents high-order spec-
match with the reference for most of the interpolated segments,                                                 tral images from disturbing the low frequency dynamic during the
except around transition regions at the bottom and top.                                                         numerical simulation and it is consistent with the underlying piece-
    The spectrum of the flux φ is shown in Figure 8. One can see                                                wise linear approximation model.
that the reference spectrum contains harmonics above twice the                                                       Second, the numerical scheme is energy-preserving. From a
representable bandwidth where they pass below -90 dB.                                                           signal processing perspective, the lowpass filtering effect on the
    The ZOH and FOH spectrums contains spectral images of the                                                   vector field is compensated by the finite difference approximation
non bandlimited spectrum that decay respectively at -6dB/oct and                                                of the derivative. This is a direct generalization of the mid-point /
-12dB/oct. Their aliased components in the audio bandwidth start                                                bilinear methods to nonlinear differential equations.
around -80 dB at the Nyquist frequency and decay slowly toward                                                       Third, using the fact that the trajectory approximation has ac-
approximately -100 dB at low frequencies.                                                                       curacy order p = 2 at the junctions, we can re-exploit the dif-
    Contrary, our method, informed by the dynamic, exhibits both                                                ferential equation to reconstruct an informed C 1 -continuous cubic
reduced aliasing in the audio bandwidth and sharpened spectrum                                                  trajectory. It exhibits reduced aliasing in the passband and better

                                                                                                          DAFX-6
Proceedings of the 20th International Conference on Digital Audio Effects (DAFx-17), Edinburgh, UK, September 5–9, 2017

high-frequency resolution.                                                 [4] A. Falaize and T. Hélie, “Simulation of an analog circuit of
     We observe that on the studied example, our method man-                   a wah pedal: a port-Hamiltonian approach,” in 135th con-
ages to reduce aliased components that are folded once into the                vention of the Audio Engineering Society, New-York, United
audio band. However components caused by multiple folding of                   States, Oct. 2013, pp. –.
the spectrum cannot be removed anymore. This is related to the             [5] A. Falaize and T. Hélie, “Passive simulation of the nonlinear
Papoulis generalized sampling expansion [24] who states that a                 port-Hamiltonian modeling of a Rhodes Piano,” Journal of
band-limited function can be perfectly reconstructed from its val-             Sound and Vibration, vol. 390, pp. 289–309, Mar. 2017.
ues and derivatives sampled at half the Nyquist rate.
     Some difficulties arise when trying to generalize the above           [6] N. Lopes and T. Hélie, “Energy Balanced Model of a Jet
ideas to higher order trajectories and filtering kernels. First, the           Interacting With a Brass Player’s Lip,” Acta Acustica united
line-integral (17) is no longer computable in closed form when the             with Acustica, vol. 102, no. 1, pp. 141–154, 2016.
trajectory model is non-affine. Second, higher order kernels have          [7] A. Falaize and T. Hélie, “Passive simulation of electro-
longer temporal support which can lead to non-causal integrals.                dynamic loudspeakers for guitar amplifiers: a port- Hamil-
                                                                               tonian approach,” in International Symposium on Musical
          9. CONCLUSION AND PERSPECTIVES                                       Acoustics, Le Mans, France, July 2014, pp. 1–5.
                                                                           [8] A. Falaize and T. Hélie, “Passive guaranteed simulation of
Our main contribution is an approach based on smooth piecewise                 analog audio circuits: A port-hamiltonian approach,” Ap-
defined trajectories coupled with a guaranteed-passive simulation.             plied Sciences, vol. 6, no. 10, 2016.
The method proceeds in three steps: 1) an energy-preserving pas-
sive numerical scheme is applied, 2) C k -continuous trajectories          [9] J. P. Boyd, Chebyshev and Fourier Spectral Methods, Dover
are reconstructed, 3) Exact continuous time lowpass filtering and              Books on Mathematics. Dover Publications, Mineola, NY,
sampling is performed. We have proposed a first instance of this               second edition, 2001.
method using the class of piecewise polynomials with regularity        [10] T. S. Stilson, Efficiently-variable Non-oversampled Algo-
k = 1 and accuracy order p = 2 that exhibits reduced aliasing.              rithms in Virtual-analog Music Synthesis: A Root-locus Per-
     Further work will concern increasing the regularity k and ac-          spective, Ph.D. thesis, 2006.
curacy order p, merging the numerical scheme and the interpola-
tion steps by considering energy-preserving methods with a built-      [11] V. Zavalishin J. D. Parker and E. Le Bivic, “Reducing
in regular continuous model and considering other classes of mod-           the aliasing of nonlinear waveshaping using continuous-time
els such as rational and exponential functions.                             convolution,” in Proc. Digital Audio Effects (DAFx-16).
     In this regard, exponential integrators [25] that integrate the   [12] S. Bilbao, F. Esqueda J. D. Parker, and V. Valimaki, “An-
linear part of the dynamic exactly (as we have done in section 6)           tiderivative antialiasing for memoryless nonlinearities,” in
and rely on approximations for the nonlinear part are of great in-          IEEE Signal Processing Letters, Nov. 2016.
terest.                                                                [13] S. Sarkka and A. Huovilainen, “Accurate discretization of
     Finally we would like to further investigate the link between          analog audio filters with application to parametric equalizer
multi-stages / multi-derivatives general linear methods, their accu-        design,” IEEE Transactions on Audio, Speech, and Language
racy orders, numerical dispersion and internal bandwidth, and to            Processing, vol. 19, no. 8, pp. 2486–2493, Nov 2011.
analyze their behavior and representation capabilities within the
framework of Reproducing Kernels Hilbert Spaces and general-           [14] M. Unser, “Think analog, act digital,” in Seventh Biennial
ized sampling theory [26] [27] [28].                                        Conference, 2004 International Conference on Signal Pro-
                                                                            cessing and Communications (SPCOM’04), Bangalore, In-
                                                                            dia, December 11-14, 2004.
                 10. ACKNOWLEDGMENTS
                                                                       [15] M. Unser, A. Aldroubi, and M. Eden, “B-Spline signal pro-
This work has been done at laboratory STMS, Paris, within the               cessing: Part I—Theory,” IEEE Transactions on Signal Pro-
context of the French National Research Agency sponsored project            cessing, vol. 41, no. 2, pp. 821–833, February 1993.
INFIDHEM. Further information is available on the project web          [16] M. Unser, A. Aldroubi, and M. Eden, “B-Spline signal pro-
page.                                                                       cessing: Part II—Efficient design and applications,” IEEE
                                                                            Transactions on Signal Processing, vol. 41, no. 2, pp. 834–
                      11. REFERENCES                                        848, February 1993.
                                                                       [17] M. Unser, “Cardinal exponential splines: Part II—Think
 [1] E. Hairer, C. Lubich, and G. Wanner, Geometric Numerical
                                                                            analog, act digital,” IEEE Transactions on Signal Process-
     Integration: Structure-Preserving Algorithms for Ordinary
                                                                            ing, vol. 53, no. 4, pp. 1439–1449, April 2005.
     Differential Equations; 2nd ed., Springer, Dordrecht, 2006.
                                                                       [18] A. Falaize, N. Lopes, T. Hélie, D. Matignon, and
 [2] A. van der Schaft and D. Jeltsema, “Port-hamiltonian sys-
                                                                            B. Maschke, “Energy-balanced models for acoustic and au-
     tems theory: An introductory overview,” Foundations and
                                                                            dio systems: a port-Hamiltonian approach,” in Unfold Me-
     Trends in Systems and Control, vol. 1, no. 2-3, pp. 173–378,
                                                                            chanics for Sounds and Music, Paris, France, Sept. 2014.
     2014.
 [3] A. van der Schaft, “Port-hamiltonian systems: an introduc-        [19] E. L. Mansfield and G. R. W. Quispel, “On the construction
     tory survey,” in Proceedings of the International Congress             of discrete gradients,” 2009.
     of Mathematicians Vol. III: Invited Lectures, Madrid, Spain,      [20] E. Celledoni, V. Grimm, R.I. McLachlan, D.I. McLaren,
     2006, pp. 1339–1365.                                                   D. O’Neale, B. Owren, and G.R.W. Quispel, “Preserving

                                                                  DAFX-7
Proceedings of the 20th International Conference on Digital Audio Effects (DAFx-17), Edinburgh, UK, September 5–9, 2017

                                                                                                                                                               τ k−1
     energy resp. dissipation in numerical PDEs using the ’aver-                           with [a, b] = [0, t], u(τ ) = eλ(t−τ ) , v 0 (τ ) =                (k−1)!
                                                                                                                                                                          and its prim-
     age vector field’ method,” Journal of Computational Physics,                                          τk
                                                                                           itive v(τ ) =   k!
                                                                                                                gives
     vol. 231, no. 20, pp. 6770 – 6789, 2012.
                                                                                                                            k t    Z t
                                                                                                                                               τk
                                                                                                                            
[21] N. Lopes, T. Hélie, and A. Falaize, “Explicit second-order                                                   λ(t−τ ) τ
     accurate method for the passive guaranteed simulation of                                       ϕk (λ, t) = e               +λ     eλ(t−τ ) dτ
                                                                                                                          k! 0      0          k!
     port-Hamiltonian systems,” in 5th IFAC Work- shop on La-
     grangian and Hamiltonian Methods for Non Linear Control,                                                       tk
                                                                                                                =      + λϕk+1 (λ, t)
     Lyon, France, July 2015, IFAC.                                                                                 k!
[22] E. Celledoni, R. I. McLachlan, D. I. McLaren, B. Owren,                               which after using (49) and identification gives
     G. R. W. Quispel, and W. M. Wright, “Energy-preserving
                                                                                                                                   ϕk (λ, t) − ϕk (0, t)
     runge-kutta methods,” ESAIM: Mathematical Modelling and                                                ϕk+1 (λ, t) =
     Numerical Analysis.                                                                                                                     λ

[23] R. T. Farouki, “The bernstein polynomial basis: A centennial
     retrospective,” Comput. Aided Geom. Des., vol. 29, no. 6, pp.
     379–419, Aug. 2012.                                                                   12.2. Explicit form
[24] A. Papoulis, “Generalized sampling expansion,” IEEE                                   Using (50) recursively for λ 6= 0, the first basis functions are given
     Transactions on Circuits and Systems, vol. 24, no. 11, pp.                            by
     652–654, Nov 1977.
                                                                                                      ϕ0 (λ, t) = eλt                                                             (51)
[25] M. Hochbruck and A. Ostermann, “Exponential integrators,”                                                           λt
     Acta Numerica, vol. 19, pp. 209–286, 2010.                                                                       −1e
                                                                                                      ϕ1 (λ, t) =                                                                 (52)
                                                                                                                     λ
[26] D. Nehab and H. Hoppe, “A fresh look at generalized sam-
     pling,” Foundations and Trends in Computer Graphics and                                                      eλt − (1 + λt)
                                                                                                      ϕ2 (λ, t) =                                                                 (53)
     Vision, vol. 8, no. 1, pp. 1–84, 2014.                                                                             λ2
                                                                                                                                                          2
                                                                                                                                                   (λt)
[27] P.L. Dragotti, M. Vetterli, and T. Blu, “Sampling moments                                                          eλt − (1 + λt +              2!
                                                                                                                                                              )
                                                                                                      ϕ3 (λ, t) =                                                                 (54)
     and reconstructing signals of finite rate of innovation: Shan-                                                               λ3
                                                                                                                                                          2
                                                                                                                                                                      (λt)3
     non meets strang-fix,” IEEE Transactions on Signal Process-                                                        eλt − (1 + λt + (λt)
                                                                                                                                          2!
                                                                                                                                             +                          3!
                                                                                                                                                                            )
     ing, vol. 55, no. 5, pp. 1741–1757, May 2007.                                                    ϕ4 (λ, t) =                                                                 (55)
                                                                                                                                      λ4
[28] M. Unser, “Sampling-50 years after shannon,” Proceedings                              this suggests the following explicit form
     of the IEEE, vol. 88, no. 4, pp. 569–587, April 2000.
                                                                                                                                           k−1
                                                                                                                                                          !
                                                                                                                 1                λt
                                                                                                                                           X     (λt)n
                                                                                                     ϕk (λ, t) = k            e        −                          ,    λ 6= 0     (56)
                    12. APPENDIX: ϕ-FUNCTIONS                                                                   λ                                  n!
                                                                                                                                           n=0

The ϕ-functions, that appear when doing exact integration of an                            Proof. It is immediate to verify that (56) is satisfied for k = 0.
LTI system with polynomial input given in monomial form, are                               Then assuming that (56) is true for some k ∈ N and using the
defined by the convolution integral                                                        recurrence (50) we prove
                        Z       t
                                                τ k−1                                                                ϕk (λ, t) − ϕk (0, t)
      ϕk (λ, t) =                   eλ(t−τ )            dτ               k≥1        (47)           ϕk+1 (λ, t) =
                                                                                                                               λ
                            0                  (k − 1)!                                                                                        !
                                                                                                                                    k−1
                                                                                                                                    X (λt)n
                                                                                                                       1       λt                  1 tk
and by definition                                                                                                   = k+1 e −                    −
                                                                                                                     λ                     n!      λ k!
                                      ϕ0 (λ, t) := eλt                              (48)                                            n=0
                                                                                                                                               !
                                                                                                                                     k
For λ = 0 it is immediate that                                                                                         1            X    (λt)n
                                                                                                                    = k+1 eλt −
                                                                                                                     λ              n=0
                                                                                                                                           n!
                                                        tk
                                    ϕk (λ = 0, t) =                                 (49)
                                                        k!                                 that (56) is also true for k + 1. By induction (56) is thus satisfied
                                                                                           for all k ∈ N.
12.1. Recurrence relation
                                                                                                The ϕ-functions represent thus the tail of the truncated taylor
We first prove that they satisfy the recurrence formula                                    series expansion of eλt up to a scaling factor. This is clear when
                                                                                           rewriting (56) as
                                       ϕk (λ, t) − ϕk (0, t)
           ϕk+1 (λ, t) =                                                 λ 6= 0     (50)                                k−1
                                                 λ                                                                      X         (λt)n
                                                                                                                eλt =                   + λk ϕk (λ, t)                            (57)
                                                                                                                        n=0
                                                                                                                                    n!
Proof. Using integration by parts
         Z     b                                       Z       b
                   u(τ )v 0 (τ )dτ = [uv]ba −                      u0 (τ )v(τ )dτ
           a                                               a

                                                                                      DAFX-8
You can also read