## 4 Time-Varying Convolution  
Time-varying filters whose coefficients are changing at audio rates, as is the case here, have many applications in music [13; 37; 38]. In particular, some significant attention has been dedicated to infinite impulse response types that whose coefficients are modulated by a periodic signals [39; 40; 41; 42]. These filters tend to be of lower order (first or second order), which have equivalent longer forms made up of two sections arranged in series, a TVFIR and a fixed-coefficient IIR [41]. It has also been shown that the most significant part of the effect of these filters is contained in the TVFIR component. The case we will examine here presents a TVFIR whose coefficients are taken from an arbitrary input waveform, segmented by the filter length \(N\). This is formally defined by employing the sequence \(w(n)\) as the set of \(N\) filter coefficients starting at a given time index \(n\):  
\[a_{k}(n)=w(n+k)\qquad(0<k<N-1). \tag{20}\]  
This expression involves future values of \(w(n)\) and needs to be adapted so that we can calculate the signal \(y(n)\) based solely on the current and past values of the inputs. Furthermore, if we are to calculate successive values of \(a_{k}(n)\), the following expression should apply:  
\[a_{k}(n+1)=a_{k+1}(n), \tag{21}\]  
from which we should note that the complete set of \(N\) filter coefficients will differ only by one value as the current time index \(n\) increments by one. If we compare the first \(N\) samples of \(w(n)\) and \(w(n+1)\), we will observe that they share \(N-1\) values. To get the \(N\) coefficients \(a_{k}(n+1)\), we only need to discard \(a_{0}(n)\), shift all samples by one position to the left, and replace the last sample of the sequence by a new value \(w(n+N)\). We can do this efficiently by applying a circular shift in the coefficients  
Figure 4: Demonstration of dynamic filter replacement: The content of the filter impulse response buffer at four different points in time: Before transition (1.0 s), \(1/3\) into the transition (1.5 s), \(2/3\) into the transition (2.0 s) and after the transition (2.5 s). These time indices are marked with vertical lines in Figure 3.  
based on the filter size and current time. In this scenario, a set of \(N\) coefficient functions \(c_{k}(n)\) can be defined as  
\[c_{k}(n)= \begin{cases}w(n),&k=n\bmod\text{N},\\ c_{k}(n-1),&\text{otherwise},\end{cases}  \tag{22}\]  
where each one of the coefficients will change only once every \(N\) samples, as the signal \(w(n)\) is taken in by the filter. They will hold their values until a their update time is due. Using this set of coefficients \(c_{k}(n)\) as defined in Equation (22), the TVIR filter expression becomes (assuming that \(c_{k}(n)=0\), \(w(n)=0\), and \(x(n)=0\) for \(n<0\))  
\[ \begin{split} y(n)&=c_{0}(n)x(n)+c_{1}(n)x(n-1)+...+c_ {N-1}(n)x(n-N-1)\\ &=\sum_{k=0}^{N-1}c_{k}(n)x(n-k),\end{split}  \tag{23}\]  
which defines what in this paper we call _time-varying convolution_ (to distinguish it from the more general forms of TVFIR filters, even though in the other cases the convolution is actually also time varying). In this scenario, we are interpreting an arbitrary input signal of length \(N\) as an impulse response, and allow it to vary on a sample-by-sample basis. The resulting set of coefficients \(c_{k}\), derived from \(w(n)\), is completely replaced every \(N\) samples. There is, in fact, no particular distinction between the two inputs to the system (\(x(n)\) and \(w(n)\)), and we may wish to view either as the \"filtered\" signal or the \"impulse response\". Taking one of these, e.g., \(w(n)\), as the filter coefficients, we can determine the filter frequency response for an input \(x(n)\) from the filter transfer function, which has to be determined at every sample.