• Aucun résultat trouvé

Frequency-dependent loss

Dans le document Numerical Sound Synthesis (Page 187-190)

Linear bar and string vibration

7.3 Frequency-dependent loss

9900 1000 1010 1030 1020

0 0.5 1 1.5

990 1000 1010 1030 1020

2

0.5 1 1.5

0.98

1 0.9945 1

0.98 0.9945

2

vf vg

× 104

f f × 104

Figure 7.6 Phase velocityvφ (left) and group velocityvg (right) as functions of frequency f for the stiff string equation (7.20), with γ =1000 and κ=1, in black. Plotted in grey are the numerical phase velocities of the parameterized scheme (7.25), under different choices of the free parameterθ, as indicated. The sample rate isfs=44 100 Hz, and the grid spacinghis chosen at the stability limit (7.26).

and stability analysis leads to the condition

θ ≥ 1

2 and λ2+4μ2≤2θ−1 −→ hhmin=

γ2k2+

γ4k4+16κ2k2(2θ−1) 2(2θ−1)

(7.26) The number of degrees of freedom Nfd will thus be, in the ideal case where the bound above is satisfied with equality,

Nfd= 2

hmin (7.27)

As expected, the numerical phase and group velocities for the implicit scheme depend heavily on the choice ofθ; it is more difficult to get a good match, in this case, across the entire frequency spectrum, especially under low-stiffness conditions. See Figure 7.6. Still, one can do fairly well, as long asθis chosen properly. As before, the best fit occurs when the number of degrees of freedom of the scheme matches that of the model problem, and one can indeed determine in this way a value forθ, dependent now onγ,κ, andfs—see Problem 7.11 and Programming Exercise 7.2.

In vector–matrix form, the scheme may be written as un+1=A−1Bunun−1 with

A=θI+(1θ )M B=2A+k2 γ2Dxxκ2Dxxxx

Numerical boundary conditions for the stiff string may be determined through energy analysis;

the conditions (7.16a) and (7.16b) hold as before, and are the most useful in the context of string modeling.

178 LINEAR BAR AND STRING VIBRATION

The term with coefficientσ0≥0 is the familiar loss term which was encountered earlier in the case of the wave equation in Section 6.5. On its own, it gives rise to a bulk frequency-independent loss (i.e., a constantT60at all frequencies). The extra term with coefficientσ1≥0 is one means of modeling the frequency dependence of the loss characteristic. It is worth noting that this is not the original model of frequency-dependent loss (which employed a third time derivative term) which was proposed by Ruiz [305], and then later used in piano synthesis models by various authors [75].

See Problems 7.12 and 7.13.

The characteristic equation for (7.28) is s2+2 σ0+σ1β2

s+γ2β2+κ2β4=0 which has roots

s±= −σ0σ1β2±

0+σ1β2)22β2+κ2β4)

For small σ0 andσ1, the term under the root above is negative for all wavenumbers over a very small cutoff, and one may write, usings±=σ±j ω,

σ (β)= −σ0σ1β2 ω(β)=

γ2β2+κ2β40+σ1β2)2

The lossσ (β)thus decreases monotonically as a function of wavenumber, taking the value of−σ0 in the limit asβ approaches zero.

Practical settings for decay times

It can be somewhat difficult to get a grasp on the perceptual significance of the parameter σ1. To this end, it is worth rewriting the expression for loss σ (β) as a function of frequency, i.e., σ (ω). From the expression for ω(β)given above, it is reasonable to assume that when the loss parametersσ0andσ1 are small (as they should be in any reasonable model of a bar or string used for musical purposes), then one may write

ω(β)

γ2β2+κ2β4 −→ β2=−γ2+

γ4+4κ2ω2

2 ξ(ω)

which further implies that one may writeσ (ω)as

σ (ω)= −σ0σ1ξ(ω)

With two parameters available to set the decay profile for the string, one could then specify T60 decay times at frequenciesω1andω2, and setσ0andσ1, from the above formula, as

σ0= 6 ln(10) ξ(ω2)ξ(ω1)

ξ(ω2)

T601)ξ(ω1) T602)

σ1= 6 ln(10) ξ(ω2)ξ(ω1)

− 1

T601)+ 1 T602)

(7.29) See Figure 7.7, showing a typical loss profile for a two-parameter model and a spectrogram of an output signal. For this model, in which loss increases monotonically with frequency, one must choose T602)T601)whenω2> ω1. If one were interested in more a more complex decay profile, one could introduce additional terms in the model PDE involving higher spatial derivatives.

See Problems 7.14 and 7.15. This, however, complicates the analysis of boundary conditions and stability, and will inevitably lead to a higher computational cost, though it may be useful in some applications, such as bar-based percussion instruments [77, 110].

One of the advantages of modal methods is that loss may be set separately for each mode, at virtually no additional computational cost —one could, for example, make use of loss param-eters derived directly from measurement, in which case modal synthesis becomes a form of analysis –synthesis, allowing for very accurate reproduction of individual tones.

0 0 2 1.5 1 0.5

0.5 1

1 5 4 3 2

1.5 2 0 0.5 1 1.5 2 2.5

T60 f

× 104

× 104

f t

Figure 7.7 At left, a typical plot ofT60 against frequency, for system (7.28), with T60=5 at 100 Hz, andT60=3 at 2000 Hz. At right, a spectrogram of sound output, for a stiff string with γ =800 andκ=8, with the loss parameters as specified above.

7.3.1 Energy and boundary conditions

The energy analysis of system (7.28) is similar to that of previous systems, except for the treatment of the frequency-dependent loss term. Again examining the system over the domainD=R+, and taking an inner product withut, leads to the energy balance

dH

dt =B−σ0ut2R+σ1uxt2R+ with H=T+V

and whereTandVare defined as for the lossless stiff string, and where the boundary term must be modified to

B= −γ2ut(0, t )ux(0, t )+κ2(ut(0, t )uxxx(0, t )ut x(0, t )uxx(0, t ))−2σ1ut(0, t )ut x(0, t ) Clamped and simply supported terminations, of the form given in (7.7), may again be viewed as lossless,2asBvanishes. The free condition is more complex: one possibility is to write

uxx=0 κ2uxxxγ2ux−2σ1ut x=0

Under any of these conditions, and whenσ0≥0 andσ1≥0, one has, just as in the case of the wave equation with loss, a monotonic decrease in energy, i.e.,

dH

dt ≤0 −→ H(t2)≤H(t1) for t2t1

7.3.2 Finite difference schemes

There are various ways of approximating the mixed derivative term in order to arrive at a finite difference scheme; two slightly different approximations have been introduced in Section 5.2.3.

Two schemes are given, in operator form, as

δt tu=γ2δxxuκ2δxxxxu−2σ0δu+2σ1δt−δxxu (7.30a) δt tu=γ2δxxuκ2δxxxxu−2σ0δt·u+2σ1δt·δxxu (7.30b) Though these differ only in the discretization of the final term, there is a huge difference, in terms of implementation, between the two: scheme (7.30a) is explicit, and scheme (7.30b) is implicit.

2Lossless, in the sense that no additional loss is incurred at the boundaries, though the system is lossy as a whole.

180 LINEAR BAR AND STRING VIBRATION

Note also the use of a non-centered difference operatorδt in the explicit scheme, rendering it formally only first-order accurate, though as this term is quite small, it will not have an appreciable effect on accuracy as a whole, nor, even, a perceptual effect on sound output.

Because the implicit scheme employs centered operators only, stability analysis is far simpler—in fact, the loss terms have no effect on the stability condition, which remains the same as in the lossless case. The implicit scheme (7.30a) may be written in matrix form as

Aun+1+Bun+Cun−1=0 with

A=(1+σ0k)Iσ1kDxx B= −2I−γ2k2Dxx+κ2k2Dxxxx C=(1σ0k)I+σ1kDxx

The reader may wish to look at the code provided in Section A.8. The matrix formulation makes for a remarkably compact recursion, at least in Matlab. See Programming Exercise 7.3 for a comparison of the performance to that of the explicit scheme (7.30a).

Dans le document Numerical Sound Synthesis (Page 187-190)