Page  00000280 Estimation of frequency dependent damping and implementation for physical modeling sound synthesis of violin Jan-Markus Holm Department of Musicology, University of Jyvaskyli, P.O.Box 35 FIN-40351 Jyvaskyla, FINLAND Abstract Frequency-dependent damping is an important factor affecting the sound of a musical instrument. In stringed instruments, for instance, the higher harmonics of sound get more damped when a note is played at higher positions on the fingerboard. In this paper, this phenomenon is modeled for violin sound synthesis. This includes the measurement of the frequency-dependent damping parameters and the estimation of parameters of a frequency-dependent damping (FDD) filter. The filter can be used in various applications, such as in physical models of bowed strings. 1 Introduction Modeling of musical instruments is an active branch of science today [1]. Digital waveguide modeling [2] has provided an efficient method for developing plausible physical modeling synthesis algorithms. Commuted synthesis [3] is thus a highly efficient method for instrument sound synthesis, the computational power in computers of today allows us to continue the development of the actual physical models of musical instruments. Physical models of bowed strings have not been extensively investigated, but some applications in violin sound synthesis have been developed [4, 5, 6]. The motivation for this study was the significant effect of damping of harmonics on the sound quality of violin when notes are played on higher positions on the fingerboard. For the purposes of violin physical modeling sound synthesis, this feature is modeled by first measuring the real instrument sounds played on each string at certain positions. The sounds are analyzed using tailored time-frequency estimation tools and the resulting parameterization is optimized for frequency dependent damping (FDD) digital filter design. 2 General filter model For a rapidly changing dynamic filter it is reasonable to use the simplest filter capable of matching the frequency-dependent damping of a physical string. Therefore, a low-order IIR filter is usually preferred [4, 8]. The designed filter is a firstorder approximation modeling the lossy behavior of frequency dependent damping. The general form of the filter is written as Hf (z)=g 1+ 1 + az' (1) where g is the gain of the filter at 0 Hz and a is the filter coefficient that determines the cutoff frequency of the filter. The numerator scales the frequency response at 0 to unity, thus allowing control of the gain at ) = 0 using the coefficient g. 3 Measurements For the analysis of frequency dependent damping and the estimation of filter parameters, notes played on each string of a violin were recorded. The sounds were played in pizzicato, and were captured with a condenser microphone in an anechoic room and recorded with a DAT-recorder with the sampling frequency of 44,1 kHz and 16 bit quantization. Eight notes on each string (G, D, A, E) were played and captured, with intervals of major third. This gives a sufficient amount of data for decay estimations, because the whole playable scale of the fingerboard is covered. 4 Analysis and optimization The procedure starts with a time-varying spectrum analysis. First, the fundamental frequency is estimated by the autocorrelation function method [7, 8], widely used for this purpose. After this, the partials are detected at spectral peaks residing at approximately integral multiplies of the fundamental frequency. For each harmonic, detection is continued 280

Page  00000281 until the amplitude threshold value is reached. Spectral peak detection results in a sequence of magnitude-frequency pairs for each harmonic. Next the decay rate of each partial is estimated. This is done by calculating a linear least-squares fit for the amplitude envelope of each partial on a logarithmic scale (Figure 1). The fit is calculated for the time span between the attack of the sound and the time instant at which the magnitude gets below the threshold. The threshold is applied to minimize the error caused by noise. The linear fit procedure yields a collection the slope values P,, n=1,2,...,Np, providing estimates for the decay rates of each partial. The procedure explained gives the gain G, for each partial as G, = 10, n= 1,2,...,Np (2) where fn are the slopes of the fitted partial envelopes, H is the hop size in samples and L is the length of string delay line in samples corresponding to the frequency of partial n. Each of the sequences G, determines the prototype magnitude response of the FDD-filter shown in Figure 2. 70 -60 255 30 - 25jj 1, - ---- -- -- -- 0.9 0.8 07 0.8 g=0.92201 0,5 a=-0.08204 0.3-- 0 05 1 15 2 Frequency |Hz] 25 x10 Figure 2. Gains of harmonics and the resulting fitted first-order filter curve for the case illustrated in Figure 1. The transfer function Hi(z) for the depicted case is Hi(z)=0.92201*(1-0.086204)/(1-0.086204) z-. The system models the damping by means of a low-order polynomial as a function of the finger position, or the distance on the fingerboard. This is directly comparable with, for instance, the length of the digital waveguide that models the vibrating string. The parameters for the first-order filter of Eq.1 are determined by a weighted least-squares error minimization procedure. The design is a good approximation for applied nut filter. The minimized error function is defined as Np -1 E=I W(Gnl)[JHf(f,) -G n=O (3) 0 0.02 004 006 0.08 0.1 Time [s] 0.12 0.14 0.16 0.18 0.2 Figure 1. Harmonic envelope curves and linear LSQestimation fitted straight lines of first four partials. The analyzed tone is the open G-string. In this example, the 25 first partials of each note are used in the analysis (20 in E-string case). This gives a feasible result for parameter estimation, because a sufficient amount of curves of significant harmonics are analyzed in sense of human hearing sensitivity to decay of sinusoids. where Np is the number of frequency points of Gn, a, are the central average frequencies of the harmonics Np, and W(GI) is a weighting function. Because of the known tendency of human auditory system to focus on the lower, slowly decaying partials, it is reasonable to focus on the weighting function to the low partials. A good reliability in the weighting function is obtained by a function which emphasizes the contribution of partials with longer decays. The analysis procedure is implemented in Matlab. The optimized values of parameters a and g are obtained by employing numerical optimization tools available in Matlab (e.g. functionfmincon). After obtaining the parameter values a and g for each note, a total of eight sets of values for each string, we have case-dependent filter parameters values for each position along the fingerboard. The parameter data for the G-string is presented in Table 1. 281

Page  00000282 Table 1. Coefficients for first-order polynomial fit to estimated filter data. Tones are labeled using the denotation by Helmholtz. Table 2. Coefficients x, and x2 for the exponential polynomial fits (Eqs. (4) & (5)) to the filter coefficients gn and an. Tone g g 0.9220 h 0.9717 d' 0.9538 f#' 0.8812 a (1.8432 c# " 0.8606 e'" 0.8113 g#'" 0.8163 a -0.0862 -0.1073 -0.1686 -0.8373 -0.2761 -0.4582 -0.5145 -0.4266,,6 String xl\ G 1.9722 D 1.9733 A 1.9669 E 1.9529 x, 0.0008 0.0009 0.0022 0.0033 a x, 0.0021 0.0022 0.0052 0.0054 -0.1111 -0.0020 0.0127 0.0095 5 Parameter estimates and filter design To obtain the actual FDD-filter, the dependency of the filtering parameters a and g on the finger position is modeled by a polynomial fit to the approximated values g, and a,. The analyzed variables are fitted to exponential dependencies on the length L of the string model. The exponential fit for G-string is illustrated in Figure 3. ---0.. i -0.2 -0.6 -06 --o~0 20 40 60 80 100 L [samples] 0.95h S0.85 0,85. 120 140 160 180 120 140 160 1 120 140 160 180 6 Conclusion In this paper, methods for the estimation of frequency-dependent damping in violin as well as the design and parameter estimation of a frequency dependent decay (FDD) filter model are presented. The filter coefficients are optimized to simulate the frequency-dependent losses of the analyzed violin tones. The designed filter is efficiently applicable to, for instance, physical models of violin. Acknowledgments This work constitutes a part of the post-graduate studies by J.-M. Holm in association with the Pythagoras Graduate School of Sound and Music Research. References [1] Smith, J.O., "Digital waveguide modeling of musical instruments", Book Draft, URL:, 25.2.2002. [2] Smith, J.O., "Physical Modeling by Digital Waveguides," Computer Music Journal, 17(4), (1993). [3] Smith, J.O., "Nonlinear Commuted Synthesis of Bowed Strings", Proc. Int. Comp. Mus. Conf., Greece, 1997. [4] Smith, J.O. Techniques for Digital Filter Design and System Identification with Application to the Violin, PhD thesis, Elec. Dept., Stanford University (CCRMA), June 1983. Available as CCRMA Technical Report STAN-M-14. [5] Serafin, S., Smith, J.O., "Influence of Attack Parameters on the Playability of a Virtual Bowed String Instrument", Proc. Int. Comp. Mus. Conf, Berlin Germany, 2000. [6] Holm, J.-M., "Towards Complete Physical Modelling Synthesis of Performance Characteristics in the Violin", Proc. SBCM, Fortaleza, Brazil, 2001. [7] Orfanidis, S.J., Introduction to Signal Processing. Prentice Hall, Englewood Cliffs, N.J., 1996. [8] V1ilimiki, V., Huopaniemi, J., Karjalainen M., and Janosy, Z., "Physical Modeling of Plucked String Instruments with Application to Real-Time Sound Synthesis," J. Audio Eng. Soc., vol. 44, no. 5, pp. 331 -353, May 1996. 0.8 0 20 40 60 80 100 L [samples] Figure 3. The exponential curve fit of parameters gn and an as a function of length L, with eight analyzed tones. The exponential function is illustrated by the solid line and the parameter values an (upper figure) and gn (lower figure) with asterisks. The polynomial fit is obtained by the least-square fit method. The dependency of the gain-loss function for each string on the finger position L, is modeled as g,no,,, = S g - exp(x2gL,), n = 1,2,...,N, (4) where Ls is the finger position (or the string length) along the string model, xlg and X2g are the function coefficients obtained by the fit. Similarly, the estimation for a, is modeled by a,,toss = 1 - [exp(x,,L,) - x2,], n= 1,2,...,N,, (5) The resulting parameter values gn and n for each of the four violin strings are presented in Table 2. 282