Next  |  Prev  |  Up  |  Top  |  REALSIMPLE Top


One-Zero String Damping Filter

The original EKS string-damping filter replaced the two-point average of the KS digitar algorithm by a weighted two-point average

\begin{displaymath}
H_d(z) = (1-S) + Sz^{-1}
\protect
\end{displaymath} (2)

where $S\in[0,1]$ is called the ``stretching factor,'' and it adjusts the relative decay-rate for high versus low frequencies in the string. This filter goes in the string feedback loop, as shown in Fig.4 above. At $S=0$ or $1$, the decay time is ``stretched infinitely'' (no decay), while fastest decay is obtained when $S=1/2$, where it reduces to the KS digitar damping filter. The decay-time is always infinity for dc, and higher frequencies decay faster than lower frequencies when $S\in(0,1)$.

To control the overall decay rate, another (frequency-independent) gain multiplier $\rho\in(0,1)$ was introduced to give the loop filter

\begin{displaymath}
H_d(z) = \rho[(1-S) + Sz^{-1}].
\end{displaymath}

Since this filter is applied once per period $P$ at the fundamental frequency, an attenuation by the factor $\vert H_d(e^{j2\pi/P})\vert\approx\rho$ occurs once each $P$ samples. Setting $\rho$ to achieve a decay of $-60$ dB in $t_{60}$ seconds is obtained by solving

\begin{displaymath}
\rho^{\frac{t_{60}}{PT}} = 0.001 \,\,\Rightarrow \,\,\fbox{$\displaystyle \rho = (0.001)^{PT/t_{60}}.$}
\end{displaymath}

In Faust, we can calculate $\rho$ from the desired decay-time in seconds as follows:
  t60 = hslider("decaytime_T60", 4, 0, 10, 0.01);  // seconds
  rho = pow(0.001,1.0/(freq*t60));
where freq is the fundamental frequency (computed from the MIDI key number in the example of Fig.9).

The following Faust code implements the original EKS damping filter in terms of a ``brightness'' parameter $B$ between 0 and 1:

  B = hslider("brightness", 0.5, 0, 1, 0.01); // 0-1

  b1 = 0.5*B; b0 = 1.0-b1; // S and 1-S
  dampingfilter1(x) = rho * (b0 * x  +  b1 * x');
Relating to Eq.$\,$(2), we have the relation $S=B/2$.


Next  |  Prev  |  Up  |  Top  |  REALSIMPLE Top

Download faust_strings.pdf

``Making Virtual Electric Guitars and Associated Effects Using Faust'', by Julius O. Smith III,
REALSIMPLE Project — work supported in part by the Wallenberg Global Learning Network .
Released 2013-08-22 under the Creative Commons License (Attribution 2.5), by Julius O. Smith III
Center for Computer Research in Music and Acoustics (CCRMA),   Stanford University
CCRMA