Next  |  Prev  |  Up  |  Top  |  REALSIMPLE Top


Loop Filter Estimation

Figure 29: Digital Waveguide model with one single delay line and loop filter.
Image dwg_single_delay_loop_filter

As discussed in Section 2.1.4, the loop filter gives the Digital Waveguide frequency-dependent damping. Similar to what is used in Artificial Reverbation, the time for frequencies to decay $ 60$ dB, known as $ t_{60}$ , is used to determine the gains of the filter. We define $ t_{60}$ to be the time in seconds for a signal to decay $ 60$ dB. For obtaining gains for the fundamental and harmonics of our loop filter, we compute $ t_{60}$ for each of these frequencies over time using the Energy Decay Relief (EDR) [36,41].

For the remainder of this section, we commute the second delay line shown in Figure 14 with the loop filter and combine the delay lines. The resulting system, shown in Figure 29 is equivalent to the one shown in Figure 14 as the delay line and loop filter components are linear and time-invariant.

Similar to the STFT, the EDR shows the spectral components over time of a given signal. The single difference between the STFT and the EDR is that the square magnitudes of the FFT of each frame is used instead of the magnitudes. With the EDR, the amount of energy in each FFT bin is given over time. An advantage of using the EDR over the STFT is that energy decreases monotonically, whereas magnitudes, as used by the STFT, may increase and decrease resulting in noisier data for decay estimation.

Figure 30: Plot of the Energy Decay Relief of a plucked guitar note.
Image edr

The EDR is defined as follows

$\displaystyle EDR(t_n,f_k) = \sum_{m=n}^{M}{\vert H(m,k)\vert^2}$ (9)

where $ H(m,k)$ corresponds to the $ k$ th FFT bin at frame $ m$ of the EDR. $ M$ corresponds to the total number of frames in our EDR. Thus, $ EDR(t_n,f_k)$ represents the total amount of energy remaining in the signal at time $ t=t_n$ for frequency $ f_k$ . Figure 30 shows a three-dimensional plot of the EDR over time and frequency.

Since the displacement of the string decreases exponentially, viewing its motion and EDR in log space, we expect linear decays, as Figure 30 shows for a plucked guitar string note.

Figure 31: EDR over time at frequency bin $ 322.998$ Hz. The overlapping red segments were fitted with the underlying blue points and plotted using the estimated slopes.
Image polyfit_322

Figure 32: EDR over time at frequency bin $ 990.5273$ Hz. The overlapping red segments were fitted with the underlying blue points and plotted using the estimated slopes.
Image polyfit_990

Figure 33: EDR over time at frequency bin $ 1313.5254$ Hz. The overlapping red segments were fitted with the underlying blue points and plotted using the estimated slopes.
Image polyfit_1313

Figure 34: EDR over time at frequency bin $ 4608.1055$ Hz. The overlapping red segments were fitted with the underlying blue points and plotted using the estimated slopes.
Image polyfit_4608

Figure 35: EDR over time at frequency bin $ 7256.6895$ Hz. The overlapping red segments were fitted with the underlying blue points and plotted using the estimated slopes.
Image polyfit_7256

Figure 36: EDR over time at frequency bin $ 10874.2676$ Hz. The overlapping red segments were fitted with the underlying blue points and plotted using the estimated slopes.
Image polyfit_10874

For each frequency $ f_k$ in the set of frequencies closest to the fundamental and harmonic frequencies, we fit a line to the time-decay of its EDR. The primary parameter for estimation is the slope of the line. Figures 31 to 36 show EDR plots for the fundamental frequency and five harmonics. The EDR for each frequency over time is plotted in blue. The estimated line is shown in red. The estimation used only the segments of the EDR for which the red line overlaps the blue. As shown, the line estimated nearly matches exactly the subset of EDR points used.

Given the estimated slope, $ m_k$ , for frequency $ f_k$ , $ t_{60}(k) = \frac{-60}{m_k}$ . With $ t_{60}(k)$ computed for the fundamental and harmonic frequencies, we now relate the decay times to the gains of the loop filter.

$\displaystyle \vert G(\omega_k)\vert^{\frac{t_{60(k)}}{T}} = 0.001$ (10)

where $ \vert G(\omega_k)\vert$ corresponds to the per sample desired gain of our filter. We also have the relation that

$\displaystyle \vert H(\omega_k)_L\vert = \vert G(\omega_k)\vert^M$ (11)

$\displaystyle \vert H(\omega_k)_L\vert^\frac{1}{M} = \vert G(\omega_k)\vert$ (12)

where $ \vert H(\omega_k)_L\vert$ is the desired loop filter gain. This relates our per sample gain with the desired loop filter gain in series with a length $ M$ delay line. Substituting $ \vert H(\omega_k)_L\vert$ for $ \vert G(\omega_k)\vert$ in Equation 10, we obtain

$\displaystyle \vert H(\omega_k)\vert^{\frac{t_{60}(k)}{MT}} = 0.001$ (13)

Taking $ 20\log_{10}$ of both sides yields

$\displaystyle 20\log_{10}\vert H(\omega_k)\vert = -60\frac{MT}{t_{60}(k)}$ (14)

To specify gains at frequencies between the fundamental and harmonics, we linearly interpolate between points for which we have gains for. In specials cases, the gains at DC up until the fundamental frequency are set to the value of the gain computed at the fundamental. For frequencies between the last harmonic and half the sampling-rate, the gains decrease at an arbitrary slope.

With the gains specified for the loop filter, a complex spectrum with minimum-phase is computed [42]. A least-squares fit or the Steiglitz-McBride iteration is used to compute the coefficients for an arbitrary order filter [42,43].

Figure 37: Estimated gains from a guitar's high 'e' string. Only frequencies below $ 5$ kHz are shown. The fundamental frequency is $ 330$ Hz. Circled points correspond to gain values for the fundamental and harmonic frequencies. All other points were linearly interpolated. The gain at DC was set to be the same as that of the fundamental. The gain at half the sampling-rate was set arbitrarily to $ -4.08$ dB.
Image loop_filter_closeup

Figure 38: Estimated gains from a guitar's high 'e' string. The fundamental frequency is $ 330$ Hz. Circled points correspond to gain values for the fundamental and harmonic frequencies. All other points were linearly interpolated. The gain at DC was set to be the same as that of the fundamental. The gain at half the sampling-rate was set arbitrarily to $ -4.08$ dB.
Image loop_filter

Figures 37 and 38 show the desired gains computed for a recorded guitar note. The fundamental is $ 330$ Hz. Gains for the fundamental and harmonic frequencies are circled in red. All other points are linearly interpolated between these gains and the constants we set for DC and half the sampling-rate. Gains below the fundamental to DC are set to the value of the gain at the fundamental frequency. The gain at half the sampling-rate was arbitrarily set to $ -4.08$ dB. Figure 37 shows gains from DC up to $ 5$ kHz.


Next  |  Prev  |  Up  |  Top  |  REALSIMPLE Top

Download phys_mod_overview.pdf

``Virtual Stringed Instruments'', by Nelson Lee and Julius O. Smith III,
REALSIMPLE Project — work supported by the Wallenberg Global Learning Network .
Released 2008-02-20 under the Creative Commons License (Attribution 2.5), by Nelson Lee and Julius O. Smith III
Center for Computer Research in Music and Acoustics (CCRMA),   Stanford University
CCRMA