Special convolutions

Screencast video [⯈]



In many practical situations a measured signal x[n], which is assumed to be zero for n<0, must first be cleaned up before further processing. This is done by filtering the measured samples of x[n] with a filter with impulse response h^[n]. In such situations the number of samples of the measured signal x[n] can be extremely long, while the length L of the impulse response h^[n] is much smaller. Thus the problem at hand is to calculate the following extreme, or ‘’, long convolution sum in an efficient way: (1)y[n]=h^[n]x[n]=k=0L1h^[k]x[nk]Length x[n]L. In a followup module we will show that the convolution sum of a signal x[n] with a length L impulse response h^[n] can be computed very efficiently with the use of Fast Fourier Transforms (FFT's). Typically FFT's process each iteration one block of N samples and for this approach it is necessary that all data is processed in blocks of N samples. The block length N can be long but certainly not as long as the ‘’ length of sequence x[n]. This efficient block processing approach implies that all sequences, the signal to be filtered, the impulse response and the output of our problem at hand, as described in equation (1), must be split in blocks of the same length of N samples. In case a sequence does not have a length of N samples it can easily be extended by padding it with zeros.

In the following subsections we will discuss two different of such block processing approaches to tackle the ‘’ long convolution problem (1). For both approaches we assume a block length of N samples and a length L impulse response h^[n], with L<N. This impulse response is zero padded up to a length N impulse response h[n] as follows: h[n]={h^[n]n=0,1,L10n=L,,N1 Note that with this zero padded description of the impulse response, the original convolution sum (1) can be written as: (2)y[n]=h^[n]x[n]h[n]x[n]=k=0L1h[k]x[nk]



Overlap-add method

The first, so called overlap-add, approach is based on the complete convolution of two blocks.

Complete convolution of two blocks.
Complete convolution of two blocks.
Referring to Fig. 1 this can be explained as follows:

The convolution sum of a sequence x[n] of M samples with an impulse response of L samples results in an output sequence y[n] which consists of N=M+L1 samples. As indicated in the figure, the first and last L1 samples are ‘fade-in’ (fi) and ‘fade-out’ (fo) samples respectively. In order not to have an overlap between fade-in and fade-out regions we assume ML.

In the overlap-add method, as depicted in Fig. 2, the ‘’ long sequence x[n] is partitioned into non-overlapping subsequences (‘blocks’) xi[n] of length M, thus: x[n]=i=0xi[n]withxi[n]={x[n+Mi]n=0,1,M10else With this non overlapped splitting we can rewrite the convolution sum (2) as follows: y[n]=h[n]x[n]=k=0L1h[k]x[nk]=k=0L1h[k](i=0xi[nk])=i=0(k=0L1h[k]xi[nk])=i=0(h[n]xi[n])=i=0yi[n] Each of the intermediate convolution sum results yi[n] consist of maximal N=M+L1 non zero samples in which the first and last L1 samples of each subsequence yi[n] are due to fade-in and fade-out.

Overlap-add method with $M \geq L$.
Overlap-add method with ML.
The overlap-add procedure consists of the following steps:
  • i=0:
    • Zero pad length L impulse response up to length N,
    • Zero pad length M input sequence x0[n] up to length N,
    • Calculate length N convolution sum y0[n]=h[n]x0[n],
    • The first M samples are valid convolution sum results:
    • y[n]=y0[n] for n=0,M1
  • i1:
    • Zero pad length M input sequence xi[n] up to length N,
    • Calculate length N convolution sum yi[n]=h[n]xi[n],
    • Add last L1 'fade-out' samples of block i1 and first L1 'fade-in' samples of block i:
    • y[n]={yi1[n]+yi[n] for n=iM,,iM+L1yi[n] for n=iM+L,,(i+1)M1



Overlap-save method

The second approach, which is called overlap-save, is based on the partial convolution of two blocks.

Partial convolution of two blocks.
Partial convolution of two blocks.
Referring to Fig. 3. this can be explained as follows: The impulse response h[n] consists of L samples, while now the Now the sequence x[n] now consists of N samples and the impulse response h[n] consists of L samples. Again N=L+M1 but now with M1. In this case the resulting sequence y[n] consists of N samples from which the first L1 samples are 'fade-in' samples and the last L1 'fade-out' samples are not computed.

In the overlap-save method, as depicted in Fig. 3, the ‘’ long sequence x[n] is partitioned into overlapping blocks xi[n] of length N=L+M1 with an overlap of L1 samples: xi[n]={x[n+iM] for n=0,1,,N10 else

Overlap-save method with $N=M+L-1$ and $M \geq 1$.
Overlap-save method with N=M+L1 and M1.
Each intermediate convolution sum result yi[n] consists of maximal N non zero samples in which the first L1 samples are due to fade-in. The last L1 'fade-out' samples are not computed. The overlap-save procedure consist of the following steps:
  • i=0:
    • Zero pad length L impulse response up to length N,
    • Calculate the first N samples of the convolution sum y0[n]=h[n]x0[n]:
    • The first N samples are valid convolution sum results: y[n]=y0[n] for n=0,N1
  • i1:
    • Calculate the first N samples of the convolution sum yi[n]=h[n]xi[n]:
    • Discard the first L1 'fade in' samples and the last M samples are valid convolution sum results: y[n]=yi[n] for n=L,N1



Final notes

The overlap-add procedure is based on complete convolution of non-overlapping blocks while the overlap-save procedure is based on partial convolution of overlapping blocks.

For applications in which the filter coefficients do not change during processing of the ‘’ long sequence x[n], it is valid to add the ‘fade out’ samples of iteration i1 and ‘fade in’ samples of iteration i since both use the same fixed impulse response. However, in adaptive filter applications the filter coefficients will change during the processing of the ‘’ long sequence x[n] and it is not valid to add the ‘fade out’ samples of iteration i1 and ‘fade in’ samples of iteration i. For this reason the overlap-add procedure is mainly used when the filter coefficients of the impulse response do not change while overlap-save is mainly used for adaptive applications.

In a follow up module we will show how both block processing approaches can be implemented efficiently with the use of FFT's.