## 2 Time-Varying Finite Impulse Response Filters  
A digital finite impulse response filter (FIR) of length \(N\) is defined by the following difference equation [35]:  
\[\begin{split} y(n)&=a_{0}x(n)+a_{1}x(n-1)+...+a_{N- 1}x(n-[N-1])\\ &=\sum_{k=0}^{N-1}a_{k}x(n-k),\end{split} \tag{1}\]  
where \(x(n)\) and \(y(n)\) are the input and output signals, respectively, at time \(n\), and \(a_{0}\) to \(a_{N-1}\) are the scaling coefficients of each copy of the input signal delayed by 0 to \(N-1\) samples (in this text, we will use the convention that a filter with length \(N\) has order \(N-1\)). When these coefficients are unchanging, the filter is a linear time-invariant filter.  
For an FIR filter, its set of coefficients also make up the filter _impulse_ response \(h(n)\), which is the output of the filter when fed with a unit sample signal \(u(n)\), which is 1 for \(n=0\) and 0 elsewhere:  
\[h(n)=\sum_{k=0}^{N-1}a_{k}u(n-k)=a_{n}. \tag{2}\]  
The output signal \(y(n)\) can then be expressed as the _convolution_ of input signal \(x(n)\) and impulse response \(h(n)\) (convolution is a commutative operation):  
\[y(n)=\sum_{k=0}^{N-1}h(n-k)x(k)=\sum_{k=0}^{N-1}h(k)x(n-k). \tag{3}\]  
The spectrum of the filter impulse response defines its _frequency_ response, which determines how the filter modifies the input signal amplitudes and phases at different frequencies. A generalised form of this, called the filter _transfer function_ can be obtained via the _z-transform_,  
\[H(z)=\sum_{n=-\infty}^{\infty}h(n)z^{-n}, \tag{4}\]  
which is a function of the complex variable \(z\). In the usual case that the filter is of finite length \(N\), we have:  
\[H(z)=\sum_{n=0}^{N-1}h(n)z^{-n}=\sum_{n=0}^{N-1}a_{n}z^{-n}. \tag{5}\]By setting \(z=e^{j\omega}\) and \(\omega=2\pi k/N\), we can compute the filter spectrum via the discrete Fourier transform (DFT). This is called the filter _frequency response._ The effect of a filter in the spectral domain is defined by the following expression:  
\[Y(z)=H(z)X(z), \tag{6}\]  
and thus it is possible to implement the filter either in time domain as a convolution operation (Equation (3)) or in the frequency domain as a product of two spectra.  
We would like to examine the cases where these coefficients in Equation (1) are not fixed, which characterizes the filter as time-varying (TV). The most general expression for a TVFIR is defined as follows [10]:  
\[\begin{split} y(n)&=a_{0}(n)x(n)+a_{1}(n)x(n-1)+...+ a_{N-1}(n)x(n-[N-1])\\ &=\sum_{k=0}^{N-1}a_{k}(n)x(n-k),\end{split} \tag{7}\]  
where we assume that the filter coefficients are drawn each from a digital signal \(a_{k}(n)\). In this case, the impulse response will vary over time and thus becomes a function of two time variables, \(m\) and \(n\), representing time of input signal application and time of observation, respectively:  
\[h(m,n)=\sum_{k=0}^{N-1}a_{k}(n)u(n-m-k). \tag{8}\]  
The output of this filter is defined by the expression  
\[y(n)=\sum_{m=-\infty}^{\infty}h(m,n)x(m). \tag{9}\]  
Since the output can only appear after the input is applied (\(x(n)=0\) for \(n<0\)), the impulse response \(h(m,n)=0\) for \(n<0\) and \(n<m\). If we then substitute \(l=n-m\), we get the convolution  
\[y(n)=\sum_{l=0}^{n}h(n-l,n)x(n-l). \tag{10}\]  
The transfer function also becomes a function of two variables, \(z\) and \(n\), and assuming causality we get:  
\[H(z,n)=\sum_{m=0}^{n}h(m,n)z^{m-n}=\sum_{k=0}^{N-1}a_{k}(n)z^{-k}. \tag{11}\]  
The next two sections present two different approaches to time-varying filtering: Dynamic replacement of impulse responses and convolution with continuously varying filters.